({state, toast, ...props}: AriaToastProps<string> & {state: ToastState<string>})
| 50 | } |
| 51 | |
| 52 | function Toast({state, toast, ...props}: AriaToastProps<string> & {state: ToastState<string>}) { |
| 53 | let ref = useRef<HTMLDivElement>(null); |
| 54 | /*- begin highlight -*/ |
| 55 | let {toastProps, contentProps, titleProps, closeButtonProps} = useToast( |
| 56 | {...props, toast}, |
| 57 | state, |
| 58 | ref |
| 59 | ); |
| 60 | /*- end highlight -*/ |
| 61 | let {focusProps, isFocusVisible} = useFocusRing(); |
| 62 | |
| 63 | return ( |
| 64 | <div |
| 65 | {...mergeProps(toastProps, focusProps)} |
| 66 | ref={ref} |
| 67 | className="react-aria-Toast" |
| 68 | data-focus-visible={isFocusVisible || undefined}> |
| 69 | <div {...contentProps} className="react-aria-ToastContent"> |
| 70 | <div {...titleProps} slot="title"> |
| 71 | {toast.content} |
| 72 | </div> |
| 73 | </div> |
| 74 | <Button {...closeButtonProps} slot="close" variant="quiet" aria-label="Close"> |
| 75 | <X size={16} /> |
| 76 | </Button> |
| 77 | </div> |
| 78 | ); |
| 79 | } |
| 80 | |
| 81 | export {Button}; |
nothing calls this directly
no test coverage detected