@zentauri-ui/zentauri-components 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/cli/cli.integration.test.ts +79 -0
- package/cli/index.mjs +718 -0
- package/cli/registry.json +63 -0
- package/cli/rewrite-imports.mjs +57 -0
- package/cli/rewrite-imports.test.ts +71 -0
- package/dist/ui/slider.js +21 -25
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/slider.mjs +21 -25
- package/dist/ui/slider.mjs.map +1 -1
- package/package.json +9 -3
- package/{dist/hooks/index.d.ts → src/hooks/index.ts} +28 -7
- package/{dist/hooks/useBodyScrollLock/index.d.ts → src/hooks/useBodyScrollLock/index.ts} +0 -1
- package/src/hooks/useBodyScrollLock/useBodyScrollLock.test.ts +51 -0
- package/src/hooks/useBodyScrollLock/useBodyScrollLock.ts +48 -0
- package/src/hooks/useClickOutside/index.ts +5 -0
- package/src/hooks/useClickOutside/useClickOutside.test.tsx +60 -0
- package/src/hooks/useClickOutside/useClickOutside.ts +52 -0
- package/{dist/hooks/useClipboard/index.d.ts → src/hooks/useClipboard/index.ts} +0 -1
- package/src/hooks/useClipboard/useClipboard.test.ts +101 -0
- package/src/hooks/useClipboard/useClipboard.ts +69 -0
- package/src/hooks/useControllableState/index.ts +4 -0
- package/src/hooks/useControllableState/useControllableState.test.ts +59 -0
- package/src/hooks/useControllableState/useControllableState.ts +49 -0
- package/{dist/hooks/useDebouncedValue/index.d.ts → src/hooks/useDebouncedValue/index.ts} +0 -1
- package/src/hooks/useDebouncedValue/useDebouncedValue.test.ts +74 -0
- package/{dist/hooks/useDebouncedValue/useDebouncedValue.d.ts → src/hooks/useDebouncedValue/useDebouncedValue.ts} +18 -2
- package/src/hooks/useDisclosure/index.ts +5 -0
- package/src/hooks/useDisclosure/useDisclosure.test.ts +64 -0
- package/src/hooks/useDisclosure/useDisclosure.ts +62 -0
- package/src/hooks/useDocumentTitle/index.ts +4 -0
- package/src/hooks/useDocumentTitle/useDocumentTitle.test.ts +40 -0
- package/src/hooks/useDocumentTitle/useDocumentTitle.ts +58 -0
- package/{dist/hooks/useFocusManagement/index.d.ts → src/hooks/useFocusManagement/index.ts} +0 -1
- package/src/hooks/useFocusManagement/useFocusManagement.test.tsx +45 -0
- package/src/hooks/useFocusManagement/useFocusManagement.ts +77 -0
- package/{dist/hooks/useHover/index.d.ts → src/hooks/useHover/index.ts} +0 -1
- package/src/hooks/useHover/useHover.test.ts +45 -0
- package/src/hooks/useHover/useHover.ts +45 -0
- package/{dist/hooks/useInView/index.d.ts → src/hooks/useInView/index.ts} +0 -1
- package/src/hooks/useInView/useInView.test.ts +43 -0
- package/{dist/hooks/useInView/useInView.d.ts → src/hooks/useInView/useInView.ts} +15 -4
- package/src/hooks/useIntersectionObserver/index.ts +4 -0
- package/src/hooks/useIntersectionObserver/useIntersectionObserver.test.ts +75 -0
- package/src/hooks/useIntersectionObserver/useIntersectionObserver.ts +54 -0
- package/{dist/hooks/useIsMounted/index.d.ts → src/hooks/useIsMounted/index.ts} +0 -1
- package/src/hooks/useIsMounted/useIsMounted.test.ts +25 -0
- package/{dist/hooks/useIsMounted/useIsMounted.d.ts → src/hooks/useIsMounted/useIsMounted.ts} +14 -2
- package/{dist/hooks/useIsomorphicLayoutEffect/index.d.ts → src/hooks/useIsomorphicLayoutEffect/index.ts} +0 -1
- package/src/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.test.ts +19 -0
- package/{dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts → src/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts} +6 -3
- package/src/hooks/useLocalStorage/index.ts +4 -0
- package/src/hooks/useLocalStorage/useLocalStorage.test.ts +99 -0
- package/src/hooks/useLocalStorage/useLocalStorage.ts +109 -0
- package/{dist/hooks/useMediaQuery/index.d.ts → src/hooks/useMediaQuery/index.ts} +0 -1
- package/src/hooks/useMediaQuery/useMediaQuery.test.ts +63 -0
- package/src/hooks/useMediaQuery/useMediaQuery.ts +37 -0
- package/{dist/hooks/useNetworkStatus/index.d.ts → src/hooks/useNetworkStatus/index.ts} +0 -1
- package/src/hooks/useNetworkStatus/useNetworkStatus.test.ts +53 -0
- package/src/hooks/useNetworkStatus/useNetworkStatus.ts +33 -0
- package/{dist/hooks/usePageVisibility/index.d.ts → src/hooks/usePageVisibility/index.ts} +0 -1
- package/src/hooks/usePageVisibility/usePageVisibility.test.ts +21 -0
- package/src/hooks/usePageVisibility/usePageVisibility.ts +31 -0
- package/src/hooks/usePagination/index.ts +6 -0
- package/src/hooks/usePagination/usePagination.test.ts +139 -0
- package/src/hooks/usePagination/usePagination.ts +153 -0
- package/src/hooks/usePrefersColorScheme/index.ts +4 -0
- package/src/hooks/usePrefersColorScheme/usePrefersColorScheme.test.ts +53 -0
- package/{dist/hooks/usePrefersColorScheme/usePrefersColorScheme.d.ts → src/hooks/usePrefersColorScheme/usePrefersColorScheme.ts} +14 -2
- package/{dist/hooks/usePrefersReducedMotion/index.d.ts → src/hooks/usePrefersReducedMotion/index.ts} +0 -1
- package/src/hooks/usePrefersReducedMotion/usePrefersReducedMotion.test.ts +27 -0
- package/{dist/hooks/usePrefersReducedMotion/usePrefersReducedMotion.d.ts → src/hooks/usePrefersReducedMotion/usePrefersReducedMotion.ts} +7 -2
- package/src/hooks/useResizeObserver/index.ts +4 -0
- package/src/hooks/useResizeObserver/useResizeObserver.test.ts +68 -0
- package/src/hooks/useResizeObserver/useResizeObserver.ts +58 -0
- package/src/hooks/useSessionStorage/index.ts +4 -0
- package/src/hooks/useSessionStorage/useSessionStorage.test.ts +54 -0
- package/src/hooks/useSessionStorage/useSessionStorage.ts +84 -0
- package/{dist/hooks/useThrottledCallback/index.d.ts → src/hooks/useThrottledCallback/index.ts} +0 -1
- package/src/hooks/useThrottledCallback/useThrottledCallback.test.ts +75 -0
- package/{dist/hooks/useThrottledCallback/useThrottledCallback.d.ts → src/hooks/useThrottledCallback/useThrottledCallback.ts} +25 -2
- package/{dist/hooks/useToggle/index.d.ts → src/hooks/useToggle/index.ts} +0 -1
- package/src/hooks/useToggle/useToggle.test.ts +40 -0
- package/src/hooks/useToggle/useToggle.ts +22 -0
- package/{dist/hooks/useWindowSize/index.d.ts → src/hooks/useWindowSize/index.ts} +0 -1
- package/src/hooks/useWindowSize/useWindowSize.test.ts +23 -0
- package/src/hooks/useWindowSize/useWindowSize.ts +39 -0
- package/src/lib/utils.ts +25 -0
- package/src/ui/accordion/accordion-base.tsx +223 -0
- package/src/ui/accordion/accordion.test.tsx +146 -0
- package/src/ui/accordion/accordion.tsx +11 -0
- package/src/ui/accordion/animated/accordion-content-animated.tsx +46 -0
- package/src/ui/accordion/animated/accordion-root-animated.tsx +10 -0
- package/src/ui/accordion/animated/animations.ts +16 -0
- package/{dist/ui/accordion/animated/index.d.ts → src/ui/accordion/animated/index.ts} +2 -1
- package/{dist/ui/accordion/animated/types.d.ts → src/ui/accordion/animated/types.ts} +4 -3
- package/src/ui/accordion/index.ts +23 -0
- package/{dist/ui/accordion/types.d.ts → src/ui/accordion/types.ts} +30 -21
- package/src/ui/accordion/variants.ts +115 -0
- package/src/ui/alert/alert-base.tsx +157 -0
- package/src/ui/alert/alert.test.tsx +150 -0
- package/src/ui/alert/alert.tsx +9 -0
- package/src/ui/alert/animated/alert-animated.tsx +20 -0
- package/src/ui/alert/animated/animations.ts +20 -0
- package/src/ui/alert/animated/index.ts +3 -0
- package/src/ui/alert/animated/types.ts +16 -0
- package/src/ui/alert/index.ts +22 -0
- package/{dist/ui/alert/types.d.ts → src/ui/alert/types.ts} +18 -11
- package/src/ui/alert/variants.ts +74 -0
- package/src/ui/avatar/animated/animations.ts +11 -0
- package/src/ui/avatar/animated/avatar-animated.tsx +25 -0
- package/{dist/ui/avatar/animated/index.d.ts → src/ui/avatar/animated/index.ts} +3 -2
- package/{dist/ui/avatar/animated/types.d.ts → src/ui/avatar/animated/types.ts} +11 -3
- package/src/ui/avatar/avatar-base.tsx +184 -0
- package/src/ui/avatar/avatar.test.tsx +51 -0
- package/src/ui/avatar/avatar.tsx +11 -0
- package/src/ui/avatar/index.ts +16 -0
- package/{dist/ui/avatar/types.d.ts → src/ui/avatar/types.ts} +22 -11
- package/src/ui/avatar/variants.ts +52 -0
- package/src/ui/badge/animated/animations.ts +20 -0
- package/src/ui/badge/animated/badge-animated.tsx +28 -0
- package/{dist/ui/badge/animated/index.d.ts → src/ui/badge/animated/index.ts} +3 -2
- package/src/ui/badge/animated/types.ts +18 -0
- package/src/ui/badge/badge-base.tsx +53 -0
- package/src/ui/badge/badge.test.tsx +48 -0
- package/src/ui/badge/badge.tsx +9 -0
- package/{dist/ui/badge/index.d.ts → src/ui/badge/index.ts} +2 -1
- package/src/ui/badge/types.ts +25 -0
- package/src/ui/badge/variants.ts +85 -0
- package/src/ui/breadcrumb/breadcrumb.test.tsx +62 -0
- package/src/ui/breadcrumb/breadcrumb.tsx +135 -0
- package/src/ui/breadcrumb/index.ts +28 -0
- package/{dist/ui/breadcrumb/types.d.ts → src/ui/breadcrumb/types.ts} +18 -15
- package/src/ui/breadcrumb/variants.ts +53 -0
- package/src/ui/buttons/animated/animations.ts +34 -0
- package/src/ui/buttons/animated/button-animated.tsx +70 -0
- package/{dist/ui/buttons/animated/index.d.ts → src/ui/buttons/animated/index.ts} +2 -1
- package/src/ui/buttons/animated/types.ts +29 -0
- package/src/ui/buttons/button-base.tsx +59 -0
- package/src/ui/buttons/button.test.tsx +480 -0
- package/src/ui/buttons/button.tsx +9 -0
- package/{dist/ui/buttons/index.d.ts → src/ui/buttons/index.ts} +2 -1
- package/{dist/ui/buttons/types.d.ts → src/ui/buttons/types.ts} +10 -6
- package/src/ui/buttons/variants.ts +77 -0
- package/src/ui/card/animated/animations.ts +32 -0
- package/src/ui/card/animated/card-animated.tsx +28 -0
- package/{dist/ui/card/animated/index.d.ts → src/ui/card/animated/index.ts} +9 -2
- package/{dist/ui/card/animated/types.d.ts → src/ui/card/animated/types.ts} +4 -2
- package/src/ui/card/card-base.tsx +146 -0
- package/src/ui/card/card.test.tsx +79 -0
- package/src/ui/card/card.tsx +11 -0
- package/src/ui/card/index.ts +21 -0
- package/src/ui/card/types.ts +42 -0
- package/src/ui/card/variants.ts +122 -0
- package/src/ui/divider/animated/animations.ts +27 -0
- package/src/ui/divider/animated/divider-animated.tsx +24 -0
- package/{dist/ui/divider/animated/index.d.ts → src/ui/divider/animated/index.ts} +2 -1
- package/{dist/ui/divider/animated/types.d.ts → src/ui/divider/animated/types.ts} +13 -3
- package/src/ui/divider/divider-base.tsx +80 -0
- package/src/ui/divider/divider.tsx +9 -0
- package/src/ui/divider/index.ts +14 -0
- package/{dist/ui/divider/types.d.ts → src/ui/divider/types.ts} +11 -8
- package/src/ui/divider/variants.ts +98 -0
- package/src/ui/drawer/animated/animations.ts +39 -0
- package/src/ui/drawer/animated/drawer-content-animated.tsx +101 -0
- package/{dist/ui/drawer/animated/index.d.ts → src/ui/drawer/animated/index.ts} +11 -2
- package/src/ui/drawer/animated/types.ts +18 -0
- package/src/ui/drawer/drawer-base.tsx +259 -0
- package/src/ui/drawer/drawer.test.tsx +132 -0
- package/src/ui/drawer/drawer.tsx +11 -0
- package/src/ui/drawer/index.ts +21 -0
- package/src/ui/drawer/types.ts +39 -0
- package/src/ui/drawer/variants.ts +122 -0
- package/src/ui/dropdown/dropdown.test.tsx +114 -0
- package/src/ui/dropdown/dropdown.tsx +179 -0
- package/src/ui/dropdown/index.ts +15 -0
- package/src/ui/dropdown/types.ts +68 -0
- package/src/ui/dropdown/variants.ts +138 -0
- package/src/ui/empty-state/animated/animations.ts +19 -0
- package/src/ui/empty-state/animated/empty-state-animated.tsx +23 -0
- package/src/ui/empty-state/animated/index.ts +7 -0
- package/{dist/ui/empty-state/animated/types.d.ts → src/ui/empty-state/animated/types.ts} +17 -5
- package/src/ui/empty-state/empty-state-base.tsx +114 -0
- package/src/ui/empty-state/empty-state.tsx +9 -0
- package/{dist/ui/empty-state/index.d.ts → src/ui/empty-state/index.ts} +7 -2
- package/{dist/ui/empty-state/types.d.ts → src/ui/empty-state/types.ts} +10 -6
- package/src/ui/empty-state/variants.ts +51 -0
- package/src/ui/file-upload/file-upload.test.tsx +36 -0
- package/src/ui/file-upload/file-upload.tsx +119 -0
- package/{dist/ui/file-upload/index.d.ts → src/ui/file-upload/index.ts} +2 -1
- package/{dist/ui/file-upload/types.d.ts → src/ui/file-upload/types.ts} +6 -3
- package/src/ui/file-upload/variants.ts +29 -0
- package/src/ui/inputs/animated/animations.ts +36 -0
- package/{dist/ui/inputs/animated/index.d.ts → src/ui/inputs/animated/index.ts} +2 -1
- package/src/ui/inputs/animated/input-animated.tsx +124 -0
- package/src/ui/inputs/animated/types.ts +40 -0
- package/{dist/ui/inputs/index.d.ts → src/ui/inputs/index.ts} +2 -1
- package/src/ui/inputs/input-base.tsx +114 -0
- package/src/ui/inputs/input.test.tsx +414 -0
- package/src/ui/inputs/input.tsx +8 -0
- package/src/ui/inputs/types.ts +18 -0
- package/src/ui/inputs/variants.ts +316 -0
- package/src/ui/modal/animated/animations.ts +29 -0
- package/{dist/ui/modal/animated/index.d.ts → src/ui/modal/animated/index.ts} +2 -1
- package/src/ui/modal/animated/modal-content-animated.tsx +96 -0
- package/src/ui/modal/animated/types.ts +23 -0
- package/src/ui/modal/index.ts +21 -0
- package/src/ui/modal/modal-base.tsx +279 -0
- package/src/ui/modal/modal.test.tsx +129 -0
- package/src/ui/modal/modal.tsx +8 -0
- package/src/ui/modal/types.ts +31 -0
- package/src/ui/modal/variants.ts +109 -0
- package/src/ui/pagination/index.ts +13 -0
- package/src/ui/pagination/pagination.test.tsx +165 -0
- package/src/ui/pagination/pagination.tsx +237 -0
- package/{dist/ui/pagination/types.d.ts → src/ui/pagination/types.ts} +37 -27
- package/src/ui/pagination/variants.ts +97 -0
- package/src/ui/progress/animated/animations.ts +9 -0
- package/src/ui/progress/animated/index.ts +17 -0
- package/src/ui/progress/animated/progress-animated.tsx +133 -0
- package/{dist/ui/progress/animated/types.d.ts → src/ui/progress/animated/types.ts} +20 -8
- package/{dist/ui/progress/index.d.ts → src/ui/progress/index.ts} +7 -2
- package/src/ui/progress/progress-base.tsx +151 -0
- package/src/ui/progress/progress.test.tsx +84 -0
- package/src/ui/progress/progress.tsx +12 -0
- package/src/ui/progress/types.ts +33 -0
- package/src/ui/progress/variants.ts +105 -0
- package/src/ui/select/index.ts +25 -0
- package/src/ui/select/select.test.tsx +128 -0
- package/src/ui/select/select.tsx +221 -0
- package/src/ui/select/types.ts +77 -0
- package/src/ui/select/variants.ts +163 -0
- package/src/ui/skeleton/animated/animations.ts +15 -0
- package/src/ui/skeleton/animated/index.ts +20 -0
- package/src/ui/skeleton/animated/skeleton-animated.tsx +119 -0
- package/{dist/ui/skeleton/animated/types.d.ts → src/ui/skeleton/animated/types.ts} +30 -11
- package/src/ui/skeleton/index.ts +24 -0
- package/src/ui/skeleton/skeleton-base.tsx +288 -0
- package/src/ui/skeleton/skeleton.tsx +8 -0
- package/{dist/ui/skeleton/types.d.ts → src/ui/skeleton/types.ts} +15 -7
- package/src/ui/skeleton/variants.ts +254 -0
- package/src/ui/slider/index.ts +22 -0
- package/src/ui/slider/slider.test.tsx +94 -0
- package/src/ui/slider/slider.tsx +728 -0
- package/src/ui/slider/types.ts +66 -0
- package/src/ui/slider/variants.ts +81 -0
- package/{dist/ui/spinner/animated/index.d.ts → src/ui/spinner/animated/index.ts} +2 -1
- package/src/ui/spinner/animated/spinner.test.tsx +41 -0
- package/src/ui/spinner/animated/spinner.tsx +143 -0
- package/{dist/ui/spinner/animated/types.d.ts → src/ui/spinner/animated/types.ts} +6 -4
- package/src/ui/spinner/animated/variants.ts +50 -0
- package/src/ui/stepper/index.ts +22 -0
- package/src/ui/stepper/stepper.test.tsx +183 -0
- package/src/ui/stepper/stepper.tsx +172 -0
- package/{dist/ui/stepper/types.d.ts → src/ui/stepper/types.ts} +18 -11
- package/src/ui/stepper/variants.ts +69 -0
- package/src/ui/table/animated/animations.ts +9 -0
- package/src/ui/table/animated/index.ts +15 -0
- package/src/ui/table/animated/table-animated.tsx +15 -0
- package/src/ui/table/animated/types.ts +16 -0
- package/src/ui/table/index.ts +22 -0
- package/src/ui/table/table-base.tsx +197 -0
- package/src/ui/table/table.tsx +13 -0
- package/src/ui/table/types.ts +47 -0
- package/src/ui/table/variants.ts +105 -0
- package/src/ui/tabs/animated/animations.ts +48 -0
- package/{dist/ui/tabs/animated/index.d.ts → src/ui/tabs/animated/index.ts} +6 -2
- package/src/ui/tabs/animated/tabs-content-animated.tsx +46 -0
- package/src/ui/tabs/animated/types.ts +24 -0
- package/{dist/ui/tabs/index.d.ts → src/ui/tabs/index.ts} +8 -2
- package/src/ui/tabs/tabs-base.tsx +185 -0
- package/src/ui/tabs/tabs.test.tsx +53 -0
- package/{dist/ui/tabs/tabs.d.ts → src/ui/tabs/tabs.tsx} +1 -1
- package/src/ui/tabs/types.ts +88 -0
- package/src/ui/tabs/variants.ts +70 -0
- package/src/ui/toast/animated/animations.ts +17 -0
- package/src/ui/toast/animated/index.ts +9 -0
- package/src/ui/toast/animated/toast-animated.tsx +96 -0
- package/src/ui/toast/animated/types.ts +13 -0
- package/src/ui/toast/index.ts +26 -0
- package/src/ui/toast/toast-base.tsx +231 -0
- package/src/ui/toast/toast.test.tsx +102 -0
- package/src/ui/toast/toast.tsx +13 -0
- package/{dist/ui/toast/types.d.ts → src/ui/toast/types.ts} +35 -23
- package/src/ui/toast/variants.ts +73 -0
- package/src/ui/toggle/animated/animations.ts +9 -0
- package/src/ui/toggle/animated/index.ts +7 -0
- package/src/ui/toggle/animated/toggle-animated.tsx +76 -0
- package/{dist/ui/toggle/animated/types.d.ts → src/ui/toggle/animated/types.ts} +6 -2
- package/{dist/ui/toggle/index.d.ts → src/ui/toggle/index.ts} +2 -1
- package/src/ui/toggle/toggle-base.tsx +70 -0
- package/src/ui/toggle/toggle.test.tsx +44 -0
- package/src/ui/toggle/toggle.tsx +9 -0
- package/{dist/ui/toggle/types.d.ts → src/ui/toggle/types.ts} +7 -3
- package/src/ui/toggle/variants.ts +84 -0
- package/src/ui/tooltip/animated/animations.ts +16 -0
- package/src/ui/tooltip/animated/index.ts +10 -0
- package/src/ui/tooltip/animated/tooltip-content-animated.tsx +47 -0
- package/src/ui/tooltip/animated/types.ts +19 -0
- package/src/ui/tooltip/index.ts +17 -0
- package/src/ui/tooltip/tooltip-base.tsx +152 -0
- package/src/ui/tooltip/tooltip.test.tsx +84 -0
- package/src/ui/tooltip/tooltip.tsx +8 -0
- package/src/ui/tooltip/types.ts +57 -0
- package/src/ui/tooltip/variants.ts +61 -0
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/useBodyScrollLock/index.d.ts.map +0 -1
- package/dist/hooks/useBodyScrollLock/useBodyScrollLock.d.ts +0 -13
- package/dist/hooks/useBodyScrollLock/useBodyScrollLock.d.ts.map +0 -1
- package/dist/hooks/useClickOutside/index.d.ts +0 -2
- package/dist/hooks/useClickOutside/index.d.ts.map +0 -1
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -22
- package/dist/hooks/useClickOutside/useClickOutside.d.ts.map +0 -1
- package/dist/hooks/useClipboard/index.d.ts.map +0 -1
- package/dist/hooks/useClipboard/useClipboard.d.ts +0 -21
- package/dist/hooks/useClipboard/useClipboard.d.ts.map +0 -1
- package/dist/hooks/useControllableState/index.d.ts +0 -2
- package/dist/hooks/useControllableState/index.d.ts.map +0 -1
- package/dist/hooks/useControllableState/useControllableState.d.ts +0 -21
- package/dist/hooks/useControllableState/useControllableState.d.ts.map +0 -1
- package/dist/hooks/useDebouncedValue/index.d.ts.map +0 -1
- package/dist/hooks/useDebouncedValue/useDebouncedValue.d.ts.map +0 -1
- package/dist/hooks/useDisclosure/index.d.ts +0 -2
- package/dist/hooks/useDisclosure/index.d.ts.map +0 -1
- package/dist/hooks/useDisclosure/useDisclosure.d.ts +0 -24
- package/dist/hooks/useDisclosure/useDisclosure.d.ts.map +0 -1
- package/dist/hooks/useDocumentTitle/index.d.ts +0 -2
- package/dist/hooks/useDocumentTitle/index.d.ts.map +0 -1
- package/dist/hooks/useDocumentTitle/useDocumentTitle.d.ts +0 -18
- package/dist/hooks/useDocumentTitle/useDocumentTitle.d.ts.map +0 -1
- package/dist/hooks/useFocusManagement/index.d.ts.map +0 -1
- package/dist/hooks/useFocusManagement/useFocusManagement.d.ts +0 -22
- package/dist/hooks/useFocusManagement/useFocusManagement.d.ts.map +0 -1
- package/dist/hooks/useHover/index.d.ts.map +0 -1
- package/dist/hooks/useHover/useHover.d.ts +0 -13
- package/dist/hooks/useHover/useHover.d.ts.map +0 -1
- package/dist/hooks/useInView/index.d.ts.map +0 -1
- package/dist/hooks/useInView/useInView.d.ts.map +0 -1
- package/dist/hooks/useIntersectionObserver/index.d.ts +0 -2
- package/dist/hooks/useIntersectionObserver/index.d.ts.map +0 -1
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +0 -17
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts.map +0 -1
- package/dist/hooks/useIsMounted/index.d.ts.map +0 -1
- package/dist/hooks/useIsMounted/useIsMounted.d.ts.map +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.ts.map +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/dist/hooks/useLocalStorage/index.d.ts +0 -2
- package/dist/hooks/useLocalStorage/index.d.ts.map +0 -1
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +0 -21
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts.map +0 -1
- package/dist/hooks/useMediaQuery/index.d.ts.map +0 -1
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +0 -12
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts.map +0 -1
- package/dist/hooks/useNetworkStatus/index.d.ts.map +0 -1
- package/dist/hooks/useNetworkStatus/useNetworkStatus.d.ts +0 -9
- package/dist/hooks/useNetworkStatus/useNetworkStatus.d.ts.map +0 -1
- package/dist/hooks/usePageVisibility/index.d.ts.map +0 -1
- package/dist/hooks/usePageVisibility/usePageVisibility.d.ts +0 -9
- package/dist/hooks/usePageVisibility/usePageVisibility.d.ts.map +0 -1
- package/dist/hooks/usePagination/index.d.ts +0 -2
- package/dist/hooks/usePagination/index.d.ts.map +0 -1
- package/dist/hooks/usePagination/usePagination.d.ts +0 -30
- package/dist/hooks/usePagination/usePagination.d.ts.map +0 -1
- package/dist/hooks/usePrefersColorScheme/index.d.ts +0 -2
- package/dist/hooks/usePrefersColorScheme/index.d.ts.map +0 -1
- package/dist/hooks/usePrefersColorScheme/usePrefersColorScheme.d.ts.map +0 -1
- package/dist/hooks/usePrefersReducedMotion/index.d.ts.map +0 -1
- package/dist/hooks/usePrefersReducedMotion/usePrefersReducedMotion.d.ts.map +0 -1
- package/dist/hooks/useResizeObserver/index.d.ts +0 -2
- package/dist/hooks/useResizeObserver/index.d.ts.map +0 -1
- package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +0 -21
- package/dist/hooks/useResizeObserver/useResizeObserver.d.ts.map +0 -1
- package/dist/hooks/useSessionStorage/index.d.ts +0 -2
- package/dist/hooks/useSessionStorage/index.d.ts.map +0 -1
- package/dist/hooks/useSessionStorage/useSessionStorage.d.ts +0 -21
- package/dist/hooks/useSessionStorage/useSessionStorage.d.ts.map +0 -1
- package/dist/hooks/useThrottledCallback/index.d.ts.map +0 -1
- package/dist/hooks/useThrottledCallback/useThrottledCallback.d.ts.map +0 -1
- package/dist/hooks/useToggle/index.d.ts.map +0 -1
- package/dist/hooks/useToggle/useToggle.d.ts +0 -8
- package/dist/hooks/useToggle/useToggle.d.ts.map +0 -1
- package/dist/hooks/useWindowSize/index.d.ts.map +0 -1
- package/dist/hooks/useWindowSize/useWindowSize.d.ts +0 -13
- package/dist/hooks/useWindowSize/useWindowSize.d.ts.map +0 -1
- package/dist/lib/utils.d.ts +0 -6
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/ui/accordion/accordion-base.d.ts +0 -20
- package/dist/ui/accordion/accordion-base.d.ts.map +0 -1
- package/dist/ui/accordion/accordion.d.ts +0 -8
- package/dist/ui/accordion/accordion.d.ts.map +0 -1
- package/dist/ui/accordion/animated/accordion-content-animated.d.ts +0 -6
- package/dist/ui/accordion/animated/accordion-content-animated.d.ts.map +0 -1
- package/dist/ui/accordion/animated/accordion-root-animated.d.ts +0 -6
- package/dist/ui/accordion/animated/accordion-root-animated.d.ts.map +0 -1
- package/dist/ui/accordion/animated/animations.d.ts +0 -6
- package/dist/ui/accordion/animated/animations.d.ts.map +0 -1
- package/dist/ui/accordion/animated/index.d.ts.map +0 -1
- package/dist/ui/accordion/animated/types.d.ts.map +0 -1
- package/dist/ui/accordion/index.d.ts +0 -5
- package/dist/ui/accordion/index.d.ts.map +0 -1
- package/dist/ui/accordion/types.d.ts.map +0 -1
- package/dist/ui/accordion/variants.d.ts +0 -14
- package/dist/ui/accordion/variants.d.ts.map +0 -1
- package/dist/ui/alert/alert-base.d.ts +0 -28
- package/dist/ui/alert/alert-base.d.ts.map +0 -1
- package/dist/ui/alert/alert.d.ts +0 -6
- package/dist/ui/alert/alert.d.ts.map +0 -1
- package/dist/ui/alert/animated/alert-animated.d.ts +0 -3
- package/dist/ui/alert/animated/alert-animated.d.ts.map +0 -1
- package/dist/ui/alert/animated/animations.d.ts +0 -3
- package/dist/ui/alert/animated/animations.d.ts.map +0 -1
- package/dist/ui/alert/animated/index.d.ts +0 -4
- package/dist/ui/alert/animated/index.d.ts.map +0 -1
- package/dist/ui/alert/animated/types.d.ts +0 -8
- package/dist/ui/alert/animated/types.d.ts.map +0 -1
- package/dist/ui/alert/index.d.ts +0 -5
- package/dist/ui/alert/index.d.ts.map +0 -1
- package/dist/ui/alert/types.d.ts.map +0 -1
- package/dist/ui/alert/variants.d.ts +0 -11
- package/dist/ui/alert/variants.d.ts.map +0 -1
- package/dist/ui/avatar/animated/animations.d.ts +0 -3
- package/dist/ui/avatar/animated/animations.d.ts.map +0 -1
- package/dist/ui/avatar/animated/avatar-animated.d.ts +0 -6
- package/dist/ui/avatar/animated/avatar-animated.d.ts.map +0 -1
- package/dist/ui/avatar/animated/index.d.ts.map +0 -1
- package/dist/ui/avatar/animated/types.d.ts.map +0 -1
- package/dist/ui/avatar/avatar-base.d.ts +0 -25
- package/dist/ui/avatar/avatar-base.d.ts.map +0 -1
- package/dist/ui/avatar/avatar.d.ts +0 -8
- package/dist/ui/avatar/avatar.d.ts.map +0 -1
- package/dist/ui/avatar/index.d.ts +0 -5
- package/dist/ui/avatar/index.d.ts.map +0 -1
- package/dist/ui/avatar/types.d.ts.map +0 -1
- package/dist/ui/avatar/variants.d.ts +0 -8
- package/dist/ui/avatar/variants.d.ts.map +0 -1
- package/dist/ui/badge/animated/animations.d.ts +0 -3
- package/dist/ui/badge/animated/animations.d.ts.map +0 -1
- package/dist/ui/badge/animated/badge-animated.d.ts +0 -6
- package/dist/ui/badge/animated/badge-animated.d.ts.map +0 -1
- package/dist/ui/badge/animated/index.d.ts.map +0 -1
- package/dist/ui/badge/animated/types.d.ts +0 -10
- package/dist/ui/badge/animated/types.d.ts.map +0 -1
- package/dist/ui/badge/badge-base.d.ts +0 -6
- package/dist/ui/badge/badge-base.d.ts.map +0 -1
- package/dist/ui/badge/badge.d.ts +0 -6
- package/dist/ui/badge/badge.d.ts.map +0 -1
- package/dist/ui/badge/index.d.ts.map +0 -1
- package/dist/ui/badge/types.d.ts +0 -17
- package/dist/ui/badge/types.d.ts.map +0 -1
- package/dist/ui/badge/variants.d.ts +0 -40
- package/dist/ui/badge/variants.d.ts.map +0 -1
- package/dist/ui/breadcrumb/breadcrumb.d.ts +0 -33
- package/dist/ui/breadcrumb/breadcrumb.d.ts.map +0 -1
- package/dist/ui/breadcrumb/index.d.ts +0 -4
- package/dist/ui/breadcrumb/index.d.ts.map +0 -1
- package/dist/ui/breadcrumb/types.d.ts.map +0 -1
- package/dist/ui/breadcrumb/variants.d.ts +0 -11
- package/dist/ui/breadcrumb/variants.d.ts.map +0 -1
- package/dist/ui/buttons/animated/animations.d.ts +0 -3
- package/dist/ui/buttons/animated/animations.d.ts.map +0 -1
- package/dist/ui/buttons/animated/button-animated.d.ts +0 -6
- package/dist/ui/buttons/animated/button-animated.d.ts.map +0 -1
- package/dist/ui/buttons/animated/index.d.ts.map +0 -1
- package/dist/ui/buttons/animated/types.d.ts +0 -16
- package/dist/ui/buttons/animated/types.d.ts.map +0 -1
- package/dist/ui/buttons/button-base.d.ts +0 -6
- package/dist/ui/buttons/button-base.d.ts.map +0 -1
- package/dist/ui/buttons/button.d.ts +0 -6
- package/dist/ui/buttons/button.d.ts.map +0 -1
- package/dist/ui/buttons/index.d.ts.map +0 -1
- package/dist/ui/buttons/types.d.ts.map +0 -1
- package/dist/ui/buttons/variants.d.ts +0 -5
- package/dist/ui/buttons/variants.d.ts.map +0 -1
- package/dist/ui/card/animated/animations.d.ts +0 -7
- package/dist/ui/card/animated/animations.d.ts.map +0 -1
- package/dist/ui/card/animated/card-animated.d.ts +0 -6
- package/dist/ui/card/animated/card-animated.d.ts.map +0 -1
- package/dist/ui/card/animated/index.d.ts.map +0 -1
- package/dist/ui/card/animated/types.d.ts.map +0 -1
- package/dist/ui/card/card-base.d.ts +0 -26
- package/dist/ui/card/card-base.d.ts.map +0 -1
- package/dist/ui/card/card.d.ts +0 -6
- package/dist/ui/card/card.d.ts.map +0 -1
- package/dist/ui/card/index.d.ts +0 -5
- package/dist/ui/card/index.d.ts.map +0 -1
- package/dist/ui/card/types.d.ts +0 -29
- package/dist/ui/card/types.d.ts.map +0 -1
- package/dist/ui/card/variants.d.ts +0 -18
- package/dist/ui/card/variants.d.ts.map +0 -1
- package/dist/ui/divider/animated/animations.d.ts +0 -6
- package/dist/ui/divider/animated/animations.d.ts.map +0 -1
- package/dist/ui/divider/animated/divider-animated.d.ts +0 -6
- package/dist/ui/divider/animated/divider-animated.d.ts.map +0 -1
- package/dist/ui/divider/animated/index.d.ts.map +0 -1
- package/dist/ui/divider/animated/types.d.ts.map +0 -1
- package/dist/ui/divider/divider-base.d.ts +0 -6
- package/dist/ui/divider/divider-base.d.ts.map +0 -1
- package/dist/ui/divider/divider.d.ts +0 -6
- package/dist/ui/divider/divider.d.ts.map +0 -1
- package/dist/ui/divider/index.d.ts +0 -4
- package/dist/ui/divider/index.d.ts.map +0 -1
- package/dist/ui/divider/types.d.ts.map +0 -1
- package/dist/ui/divider/variants.d.ts +0 -14
- package/dist/ui/divider/variants.d.ts.map +0 -1
- package/dist/ui/drawer/animated/animations.d.ts +0 -3
- package/dist/ui/drawer/animated/animations.d.ts.map +0 -1
- package/dist/ui/drawer/animated/drawer-content-animated.d.ts +0 -6
- package/dist/ui/drawer/animated/drawer-content-animated.d.ts.map +0 -1
- package/dist/ui/drawer/animated/index.d.ts.map +0 -1
- package/dist/ui/drawer/animated/types.d.ts +0 -9
- package/dist/ui/drawer/animated/types.d.ts.map +0 -1
- package/dist/ui/drawer/drawer-base.d.ts +0 -35
- package/dist/ui/drawer/drawer-base.d.ts.map +0 -1
- package/dist/ui/drawer/drawer.d.ts +0 -2
- package/dist/ui/drawer/drawer.d.ts.map +0 -1
- package/dist/ui/drawer/index.d.ts +0 -4
- package/dist/ui/drawer/index.d.ts.map +0 -1
- package/dist/ui/drawer/types.d.ts +0 -33
- package/dist/ui/drawer/types.d.ts.map +0 -1
- package/dist/ui/drawer/variants.d.ts +0 -10
- package/dist/ui/drawer/variants.d.ts.map +0 -1
- package/dist/ui/dropdown/dropdown.d.ts +0 -6
- package/dist/ui/dropdown/dropdown.d.ts.map +0 -1
- package/dist/ui/dropdown/index.d.ts +0 -4
- package/dist/ui/dropdown/index.d.ts.map +0 -1
- package/dist/ui/dropdown/types.d.ts +0 -38
- package/dist/ui/dropdown/types.d.ts.map +0 -1
- package/dist/ui/dropdown/variants.d.ts +0 -12
- package/dist/ui/dropdown/variants.d.ts.map +0 -1
- package/dist/ui/empty-state/animated/animations.d.ts +0 -3
- package/dist/ui/empty-state/animated/animations.d.ts.map +0 -1
- package/dist/ui/empty-state/animated/empty-state-animated.d.ts +0 -6
- package/dist/ui/empty-state/animated/empty-state-animated.d.ts.map +0 -1
- package/dist/ui/empty-state/animated/index.d.ts +0 -4
- package/dist/ui/empty-state/animated/index.d.ts.map +0 -1
- package/dist/ui/empty-state/animated/types.d.ts.map +0 -1
- package/dist/ui/empty-state/empty-state-base.d.ts +0 -23
- package/dist/ui/empty-state/empty-state-base.d.ts.map +0 -1
- package/dist/ui/empty-state/empty-state.d.ts +0 -6
- package/dist/ui/empty-state/empty-state.d.ts.map +0 -1
- package/dist/ui/empty-state/index.d.ts.map +0 -1
- package/dist/ui/empty-state/types.d.ts.map +0 -1
- package/dist/ui/empty-state/variants.d.ts +0 -12
- package/dist/ui/empty-state/variants.d.ts.map +0 -1
- package/dist/ui/file-upload/file-upload.d.ts +0 -8
- package/dist/ui/file-upload/file-upload.d.ts.map +0 -1
- package/dist/ui/file-upload/index.d.ts.map +0 -1
- package/dist/ui/file-upload/types.d.ts.map +0 -1
- package/dist/ui/file-upload/variants.d.ts +0 -4
- package/dist/ui/file-upload/variants.d.ts.map +0 -1
- package/dist/ui/inputs/animated/animations.d.ts +0 -3
- package/dist/ui/inputs/animated/animations.d.ts.map +0 -1
- package/dist/ui/inputs/animated/index.d.ts.map +0 -1
- package/dist/ui/inputs/animated/input-animated.d.ts +0 -6
- package/dist/ui/inputs/animated/input-animated.d.ts.map +0 -1
- package/dist/ui/inputs/animated/types.d.ts +0 -16
- package/dist/ui/inputs/animated/types.d.ts.map +0 -1
- package/dist/ui/inputs/index.d.ts.map +0 -1
- package/dist/ui/inputs/input-base.d.ts +0 -6
- package/dist/ui/inputs/input-base.d.ts.map +0 -1
- package/dist/ui/inputs/input.d.ts +0 -6
- package/dist/ui/inputs/input.d.ts.map +0 -1
- package/dist/ui/inputs/types.d.ts +0 -12
- package/dist/ui/inputs/types.d.ts.map +0 -1
- package/dist/ui/inputs/variants.d.ts +0 -7
- package/dist/ui/inputs/variants.d.ts.map +0 -1
- package/dist/ui/modal/animated/animations.d.ts +0 -3
- package/dist/ui/modal/animated/animations.d.ts.map +0 -1
- package/dist/ui/modal/animated/index.d.ts.map +0 -1
- package/dist/ui/modal/animated/modal-content-animated.d.ts +0 -6
- package/dist/ui/modal/animated/modal-content-animated.d.ts.map +0 -1
- package/dist/ui/modal/animated/types.d.ts +0 -9
- package/dist/ui/modal/animated/types.d.ts.map +0 -1
- package/dist/ui/modal/index.d.ts +0 -5
- package/dist/ui/modal/index.d.ts.map +0 -1
- package/dist/ui/modal/modal-base.d.ts +0 -47
- package/dist/ui/modal/modal-base.d.ts.map +0 -1
- package/dist/ui/modal/modal.d.ts +0 -6
- package/dist/ui/modal/modal.d.ts.map +0 -1
- package/dist/ui/modal/types.d.ts +0 -26
- package/dist/ui/modal/types.d.ts.map +0 -1
- package/dist/ui/modal/variants.d.ts +0 -10
- package/dist/ui/modal/variants.d.ts.map +0 -1
- package/dist/ui/pagination/index.d.ts +0 -5
- package/dist/ui/pagination/index.d.ts.map +0 -1
- package/dist/ui/pagination/pagination.d.ts +0 -17
- package/dist/ui/pagination/pagination.d.ts.map +0 -1
- package/dist/ui/pagination/types.d.ts.map +0 -1
- package/dist/ui/pagination/variants.d.ts +0 -12
- package/dist/ui/pagination/variants.d.ts.map +0 -1
- package/dist/ui/progress/animated/animations.d.ts +0 -3
- package/dist/ui/progress/animated/animations.d.ts.map +0 -1
- package/dist/ui/progress/animated/index.d.ts +0 -4
- package/dist/ui/progress/animated/index.d.ts.map +0 -1
- package/dist/ui/progress/animated/progress-animated.d.ts +0 -16
- package/dist/ui/progress/animated/progress-animated.d.ts.map +0 -1
- package/dist/ui/progress/animated/types.d.ts.map +0 -1
- package/dist/ui/progress/index.d.ts.map +0 -1
- package/dist/ui/progress/progress-base.d.ts +0 -23
- package/dist/ui/progress/progress-base.d.ts.map +0 -1
- package/dist/ui/progress/progress.d.ts +0 -6
- package/dist/ui/progress/progress.d.ts.map +0 -1
- package/dist/ui/progress/types.d.ts +0 -28
- package/dist/ui/progress/types.d.ts.map +0 -1
- package/dist/ui/progress/variants.d.ts +0 -15
- package/dist/ui/progress/variants.d.ts.map +0 -1
- package/dist/ui/select/index.d.ts +0 -4
- package/dist/ui/select/index.d.ts.map +0 -1
- package/dist/ui/select/select.d.ts +0 -10
- package/dist/ui/select/select.d.ts.map +0 -1
- package/dist/ui/select/types.d.ts +0 -48
- package/dist/ui/select/types.d.ts.map +0 -1
- package/dist/ui/select/variants.d.ts +0 -14
- package/dist/ui/select/variants.d.ts.map +0 -1
- package/dist/ui/skeleton/animated/animations.d.ts +0 -3
- package/dist/ui/skeleton/animated/animations.d.ts.map +0 -1
- package/dist/ui/skeleton/animated/index.d.ts +0 -4
- package/dist/ui/skeleton/animated/index.d.ts.map +0 -1
- package/dist/ui/skeleton/animated/skeleton-animated.d.ts +0 -22
- package/dist/ui/skeleton/animated/skeleton-animated.d.ts.map +0 -1
- package/dist/ui/skeleton/animated/types.d.ts.map +0 -1
- package/dist/ui/skeleton/index.d.ts +0 -5
- package/dist/ui/skeleton/index.d.ts.map +0 -1
- package/dist/ui/skeleton/skeleton-base.d.ts +0 -24
- package/dist/ui/skeleton/skeleton-base.d.ts.map +0 -1
- package/dist/ui/skeleton/skeleton.d.ts +0 -2
- package/dist/ui/skeleton/skeleton.d.ts.map +0 -1
- package/dist/ui/skeleton/types.d.ts.map +0 -1
- package/dist/ui/skeleton/variants.d.ts +0 -38
- package/dist/ui/skeleton/variants.d.ts.map +0 -1
- package/dist/ui/slider/index.d.ts +0 -4
- package/dist/ui/slider/index.d.ts.map +0 -1
- package/dist/ui/slider/slider.d.ts +0 -33
- package/dist/ui/slider/slider.d.ts.map +0 -1
- package/dist/ui/slider/types.d.ts +0 -49
- package/dist/ui/slider/types.d.ts.map +0 -1
- package/dist/ui/slider/variants.d.ts +0 -13
- package/dist/ui/slider/variants.d.ts.map +0 -1
- package/dist/ui/spinner/animated/index.d.ts.map +0 -1
- package/dist/ui/spinner/animated/spinner.d.ts +0 -6
- package/dist/ui/spinner/animated/spinner.d.ts.map +0 -1
- package/dist/ui/spinner/animated/types.d.ts.map +0 -1
- package/dist/ui/spinner/animated/variants.d.ts +0 -6
- package/dist/ui/spinner/animated/variants.d.ts.map +0 -1
- package/dist/ui/stepper/index.d.ts +0 -4
- package/dist/ui/stepper/index.d.ts.map +0 -1
- package/dist/ui/stepper/stepper.d.ts +0 -33
- package/dist/ui/stepper/stepper.d.ts.map +0 -1
- package/dist/ui/stepper/types.d.ts.map +0 -1
- package/dist/ui/stepper/variants.d.ts +0 -11
- package/dist/ui/stepper/variants.d.ts.map +0 -1
- package/dist/ui/table/animated/animations.d.ts +0 -3
- package/dist/ui/table/animated/animations.d.ts.map +0 -1
- package/dist/ui/table/animated/index.d.ts +0 -5
- package/dist/ui/table/animated/index.d.ts.map +0 -1
- package/dist/ui/table/animated/table-animated.d.ts +0 -5
- package/dist/ui/table/animated/table-animated.d.ts.map +0 -1
- package/dist/ui/table/animated/types.d.ts +0 -8
- package/dist/ui/table/animated/types.d.ts.map +0 -1
- package/dist/ui/table/index.d.ts +0 -4
- package/dist/ui/table/index.d.ts.map +0 -1
- package/dist/ui/table/table-base.d.ts +0 -38
- package/dist/ui/table/table-base.d.ts.map +0 -1
- package/dist/ui/table/table.d.ts +0 -2
- package/dist/ui/table/table.d.ts.map +0 -1
- package/dist/ui/table/types.d.ts +0 -33
- package/dist/ui/table/types.d.ts.map +0 -1
- package/dist/ui/table/variants.d.ts +0 -14
- package/dist/ui/table/variants.d.ts.map +0 -1
- package/dist/ui/tabs/animated/animations.d.ts +0 -5
- package/dist/ui/tabs/animated/animations.d.ts.map +0 -1
- package/dist/ui/tabs/animated/index.d.ts.map +0 -1
- package/dist/ui/tabs/animated/tabs-content-animated.d.ts +0 -6
- package/dist/ui/tabs/animated/tabs-content-animated.d.ts.map +0 -1
- package/dist/ui/tabs/animated/types.d.ts +0 -14
- package/dist/ui/tabs/animated/types.d.ts.map +0 -1
- package/dist/ui/tabs/index.d.ts.map +0 -1
- package/dist/ui/tabs/tabs-base.d.ts +0 -8
- package/dist/ui/tabs/tabs-base.d.ts.map +0 -1
- package/dist/ui/tabs/tabs.d.ts.map +0 -1
- package/dist/ui/tabs/types.d.ts +0 -40
- package/dist/ui/tabs/types.d.ts.map +0 -1
- package/dist/ui/tabs/variants.d.ts +0 -11
- package/dist/ui/tabs/variants.d.ts.map +0 -1
- package/dist/ui/toast/animated/animations.d.ts +0 -3
- package/dist/ui/toast/animated/animations.d.ts.map +0 -1
- package/dist/ui/toast/animated/index.d.ts +0 -4
- package/dist/ui/toast/animated/index.d.ts.map +0 -1
- package/dist/ui/toast/animated/toast-animated.d.ts +0 -10
- package/dist/ui/toast/animated/toast-animated.d.ts.map +0 -1
- package/dist/ui/toast/animated/types.d.ts +0 -5
- package/dist/ui/toast/animated/types.d.ts.map +0 -1
- package/dist/ui/toast/index.d.ts +0 -4
- package/dist/ui/toast/index.d.ts.map +0 -1
- package/dist/ui/toast/toast-base.d.ts +0 -35
- package/dist/ui/toast/toast-base.d.ts.map +0 -1
- package/dist/ui/toast/toast.d.ts +0 -2
- package/dist/ui/toast/toast.d.ts.map +0 -1
- package/dist/ui/toast/types.d.ts.map +0 -1
- package/dist/ui/toast/variants.d.ts +0 -8
- package/dist/ui/toast/variants.d.ts.map +0 -1
- package/dist/ui/toggle/animated/animations.d.ts +0 -3
- package/dist/ui/toggle/animated/animations.d.ts.map +0 -1
- package/dist/ui/toggle/animated/index.d.ts +0 -4
- package/dist/ui/toggle/animated/index.d.ts.map +0 -1
- package/dist/ui/toggle/animated/toggle-animated.d.ts +0 -6
- package/dist/ui/toggle/animated/toggle-animated.d.ts.map +0 -1
- package/dist/ui/toggle/animated/types.d.ts.map +0 -1
- package/dist/ui/toggle/index.d.ts.map +0 -1
- package/dist/ui/toggle/toggle-base.d.ts +0 -6
- package/dist/ui/toggle/toggle-base.d.ts.map +0 -1
- package/dist/ui/toggle/toggle.d.ts +0 -6
- package/dist/ui/toggle/toggle.d.ts.map +0 -1
- package/dist/ui/toggle/types.d.ts.map +0 -1
- package/dist/ui/toggle/variants.d.ts +0 -8
- package/dist/ui/toggle/variants.d.ts.map +0 -1
- package/dist/ui/tooltip/animated/animations.d.ts +0 -3
- package/dist/ui/tooltip/animated/animations.d.ts.map +0 -1
- package/dist/ui/tooltip/animated/index.d.ts +0 -4
- package/dist/ui/tooltip/animated/index.d.ts.map +0 -1
- package/dist/ui/tooltip/animated/tooltip-content-animated.d.ts +0 -3
- package/dist/ui/tooltip/animated/tooltip-content-animated.d.ts.map +0 -1
- package/dist/ui/tooltip/animated/types.d.ts +0 -9
- package/dist/ui/tooltip/animated/types.d.ts.map +0 -1
- package/dist/ui/tooltip/index.d.ts +0 -4
- package/dist/ui/tooltip/index.d.ts.map +0 -1
- package/dist/ui/tooltip/tooltip-base.d.ts +0 -7
- package/dist/ui/tooltip/tooltip-base.d.ts.map +0 -1
- package/dist/ui/tooltip/tooltip.d.ts +0 -2
- package/dist/ui/tooltip/tooltip.d.ts.map +0 -1
- package/dist/ui/tooltip/types.d.ts +0 -30
- package/dist/ui/tooltip/types.d.ts.map +0 -1
- package/dist/ui/tooltip/variants.d.ts +0 -6
- package/dist/ui/tooltip/variants.d.ts.map +0 -1
- package/dist/vitest-setup.d.ts +0 -2
- package/dist/vitest-setup.d.ts.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../../lib/utils";
|
|
8
|
+
|
|
9
|
+
import { toastAnimationPresets } from "./animations";
|
|
10
|
+
import type { ToastProps, ToastViewportProps } from "../types";
|
|
11
|
+
import { toastRootVariants, toastViewportVariants } from "../variants";
|
|
12
|
+
import {
|
|
13
|
+
ToastClose,
|
|
14
|
+
ToastDescription,
|
|
15
|
+
ToastStoreContext,
|
|
16
|
+
ToastTitle,
|
|
17
|
+
} from "../toast-base";
|
|
18
|
+
|
|
19
|
+
export function ToastViewportAnimated({
|
|
20
|
+
position = "bottom-right",
|
|
21
|
+
className,
|
|
22
|
+
}: ToastViewportProps) {
|
|
23
|
+
const ctx = useContext(ToastStoreContext);
|
|
24
|
+
if (!ctx) {
|
|
25
|
+
throw new Error("ToastViewportAnimated must be used within <ToastProvider>");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const portalTarget = typeof document !== "undefined" ? document.body : null;
|
|
29
|
+
if (!portalTarget) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return createPortal(
|
|
34
|
+
<div
|
|
35
|
+
className={cn(toastViewportVariants({ position }), className)}
|
|
36
|
+
data-slot="toast-viewport"
|
|
37
|
+
>
|
|
38
|
+
<AnimatePresence>
|
|
39
|
+
{ctx.toasts.map((item) => (
|
|
40
|
+
<ToastAnimated
|
|
41
|
+
key={item.id}
|
|
42
|
+
toastId={item.id}
|
|
43
|
+
appearance={item.appearance}
|
|
44
|
+
size={item.size}
|
|
45
|
+
animation={item.animation}
|
|
46
|
+
>
|
|
47
|
+
<ToastTitle>{item.title}</ToastTitle>
|
|
48
|
+
{item.description ? (
|
|
49
|
+
<ToastDescription>{item.description}</ToastDescription>
|
|
50
|
+
) : null}
|
|
51
|
+
<ToastClose onClick={() => ctx.dismiss(item.id)} />
|
|
52
|
+
</ToastAnimated>
|
|
53
|
+
))}
|
|
54
|
+
</AnimatePresence>
|
|
55
|
+
</div>,
|
|
56
|
+
portalTarget,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ToastViewportAnimated.displayName = "ToastViewport";
|
|
61
|
+
|
|
62
|
+
export function ToastAnimated({
|
|
63
|
+
toastId: _toastId,
|
|
64
|
+
appearance,
|
|
65
|
+
size,
|
|
66
|
+
animation = "slide",
|
|
67
|
+
className,
|
|
68
|
+
children,
|
|
69
|
+
}: ToastProps) {
|
|
70
|
+
const live = appearance === "error" ? "assertive" : "polite";
|
|
71
|
+
|
|
72
|
+
const motionProps = toastAnimationPresets[animation];
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<motion.div
|
|
76
|
+
layout
|
|
77
|
+
data-slot="toast"
|
|
78
|
+
role={appearance === "error" ? "alert" : "status"}
|
|
79
|
+
aria-live={live}
|
|
80
|
+
aria-atomic="true"
|
|
81
|
+
className={cn(
|
|
82
|
+
"relative",
|
|
83
|
+
toastRootVariants({ appearance, size }),
|
|
84
|
+
className,
|
|
85
|
+
)}
|
|
86
|
+
initial={animation === "none" ? false : motionProps.initial}
|
|
87
|
+
animate={animation === "none" ? undefined : motionProps.animate}
|
|
88
|
+
exit={animation === "none" ? undefined : motionProps.exit}
|
|
89
|
+
transition={motionProps.transition}
|
|
90
|
+
>
|
|
91
|
+
{children}
|
|
92
|
+
</motion.div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
ToastAnimated.displayName = "Toast";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLMotionProps } from "framer-motion";
|
|
2
|
+
|
|
3
|
+
export type ToastAnimation = "none" | "slide" | "fade";
|
|
4
|
+
|
|
5
|
+
export type ToastPresetMotionProps = Pick<
|
|
6
|
+
HTMLMotionProps<"div">,
|
|
7
|
+
"initial" | "animate" | "exit" | "transition"
|
|
8
|
+
>;
|
|
9
|
+
|
|
10
|
+
export type ToastAnimationPresets = Record<
|
|
11
|
+
ToastAnimation,
|
|
12
|
+
ToastPresetMotionProps
|
|
13
|
+
>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Toast,
|
|
5
|
+
ToastAction,
|
|
6
|
+
ToastClose,
|
|
7
|
+
ToastDescription,
|
|
8
|
+
ToastProvider,
|
|
9
|
+
ToastTitle,
|
|
10
|
+
ToastViewport,
|
|
11
|
+
toast,
|
|
12
|
+
useToast,
|
|
13
|
+
} from "./toast";
|
|
14
|
+
export type {
|
|
15
|
+
ToastAnimation,
|
|
16
|
+
ToastContextValue,
|
|
17
|
+
ToastInput,
|
|
18
|
+
ToastPosition,
|
|
19
|
+
ToastProps,
|
|
20
|
+
ToastProviderProps,
|
|
21
|
+
ToastSectionProps,
|
|
22
|
+
ToastViewportProps,
|
|
23
|
+
ToastRootVariantProps,
|
|
24
|
+
ToastViewportVariantProps,
|
|
25
|
+
} from "./types";
|
|
26
|
+
export { toastRootVariants, toastViewportVariants } from "./variants";
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from "react";
|
|
12
|
+
import { createPortal } from "react-dom";
|
|
13
|
+
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
|
|
16
|
+
import type {
|
|
17
|
+
ToastContextValue,
|
|
18
|
+
ToastStoreContextValue,
|
|
19
|
+
InternalToast,
|
|
20
|
+
ToastInput,
|
|
21
|
+
ToastProps,
|
|
22
|
+
ToastProviderProps,
|
|
23
|
+
ToastSectionProps,
|
|
24
|
+
ToastViewportProps,
|
|
25
|
+
} from "./types";
|
|
26
|
+
import { toastRootVariants, toastViewportVariants } from "./variants";
|
|
27
|
+
|
|
28
|
+
export const ToastStoreContext = createContext<ToastStoreContextValue | null>(
|
|
29
|
+
null,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
let toastDispatcher: ToastStoreContextValue["push"] | null = null;
|
|
33
|
+
|
|
34
|
+
export function toast(input: ToastInput) {
|
|
35
|
+
if (!toastDispatcher) {
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
return toastDispatcher(input);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function useToast(): ToastContextValue {
|
|
42
|
+
const ctx = useContext(ToastStoreContext);
|
|
43
|
+
if (!ctx) {
|
|
44
|
+
throw new Error("useToast must be used within <ToastProvider>");
|
|
45
|
+
}
|
|
46
|
+
return { toast: ctx.push, dismiss: ctx.dismiss };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function ToastProvider({ children }: ToastProviderProps) {
|
|
50
|
+
const [toasts, setToasts] = useState<InternalToast[]>([]);
|
|
51
|
+
const timers = useRef<Map<string, number>>(new Map());
|
|
52
|
+
|
|
53
|
+
const dismiss = useCallback((id: string) => {
|
|
54
|
+
const timerId = timers.current.get(id);
|
|
55
|
+
if (timerId) {
|
|
56
|
+
window.clearTimeout(timerId);
|
|
57
|
+
timers.current.delete(id);
|
|
58
|
+
}
|
|
59
|
+
setToasts((prev) => prev.filter((toastItem) => toastItem.id !== id));
|
|
60
|
+
}, []);
|
|
61
|
+
|
|
62
|
+
const push = useCallback(
|
|
63
|
+
(input: ToastInput) => {
|
|
64
|
+
const id = input.id ?? `toast-${Math.random().toString(16).slice(2)}`;
|
|
65
|
+
const durationMs = input.durationMs ?? 4500;
|
|
66
|
+
const record: InternalToast = {
|
|
67
|
+
...input,
|
|
68
|
+
id,
|
|
69
|
+
durationMs,
|
|
70
|
+
animation: input.animation ?? "slide",
|
|
71
|
+
};
|
|
72
|
+
setToasts((prev) => [...prev, record]);
|
|
73
|
+
const timerId = window.setTimeout(() => dismiss(id), durationMs);
|
|
74
|
+
timers.current.set(id, timerId);
|
|
75
|
+
return id;
|
|
76
|
+
},
|
|
77
|
+
[dismiss],
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const ctx = useMemo(
|
|
81
|
+
() => ({
|
|
82
|
+
toasts,
|
|
83
|
+
push,
|
|
84
|
+
dismiss,
|
|
85
|
+
}),
|
|
86
|
+
[dismiss, push, toasts],
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
toastDispatcher = push;
|
|
91
|
+
return () => {
|
|
92
|
+
toastDispatcher = null;
|
|
93
|
+
};
|
|
94
|
+
}, [push]);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<ToastStoreContext.Provider value={ctx}>
|
|
98
|
+
{children}
|
|
99
|
+
</ToastStoreContext.Provider>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
ToastProvider.displayName = "ToastProvider";
|
|
104
|
+
|
|
105
|
+
export function ToastViewport({
|
|
106
|
+
position = "bottom-right",
|
|
107
|
+
className,
|
|
108
|
+
}: ToastViewportProps) {
|
|
109
|
+
const ctx = useContext(ToastStoreContext);
|
|
110
|
+
if (!ctx) {
|
|
111
|
+
throw new Error("ToastViewport must be used within <ToastProvider>");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const portalTarget = typeof document !== "undefined" ? document.body : null;
|
|
115
|
+
if (!portalTarget) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return createPortal(
|
|
120
|
+
<div
|
|
121
|
+
className={cn(toastViewportVariants({ position }), className)}
|
|
122
|
+
data-slot="toast-viewport"
|
|
123
|
+
>
|
|
124
|
+
{ctx.toasts.map((item) => (
|
|
125
|
+
<Toast
|
|
126
|
+
key={item.id}
|
|
127
|
+
toastId={item.id}
|
|
128
|
+
appearance={item.appearance}
|
|
129
|
+
size={item.size}
|
|
130
|
+
animation={item.animation}
|
|
131
|
+
>
|
|
132
|
+
<ToastTitle>{item.title}</ToastTitle>
|
|
133
|
+
{item.description ? (
|
|
134
|
+
<ToastDescription>{item.description}</ToastDescription>
|
|
135
|
+
) : null}
|
|
136
|
+
<ToastClose onClick={() => ctx.dismiss(item.id)} />
|
|
137
|
+
</Toast>
|
|
138
|
+
))}
|
|
139
|
+
</div>,
|
|
140
|
+
portalTarget,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
ToastViewport.displayName = "ToastViewport";
|
|
145
|
+
|
|
146
|
+
export function Toast({
|
|
147
|
+
toastId: _toastId,
|
|
148
|
+
appearance,
|
|
149
|
+
size,
|
|
150
|
+
animation: _animation = "slide",
|
|
151
|
+
className,
|
|
152
|
+
children,
|
|
153
|
+
}: ToastProps) {
|
|
154
|
+
const live = appearance === "error" ? "assertive" : "polite";
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<div
|
|
158
|
+
data-slot="toast"
|
|
159
|
+
role={appearance === "error" ? "alert" : "status"}
|
|
160
|
+
aria-live={live}
|
|
161
|
+
aria-atomic="true"
|
|
162
|
+
className={cn(
|
|
163
|
+
"relative",
|
|
164
|
+
toastRootVariants({ appearance, size }),
|
|
165
|
+
className,
|
|
166
|
+
)}
|
|
167
|
+
>
|
|
168
|
+
{children}
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
Toast.displayName = "Toast";
|
|
174
|
+
|
|
175
|
+
export function ToastTitle({ className, children }: ToastSectionProps) {
|
|
176
|
+
return (
|
|
177
|
+
<div data-slot="toast-title" className={cn("font-semibold", className)}>
|
|
178
|
+
{children}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
ToastTitle.displayName = "ToastTitle";
|
|
184
|
+
|
|
185
|
+
export function ToastDescription({ className, children }: ToastSectionProps) {
|
|
186
|
+
return (
|
|
187
|
+
<div
|
|
188
|
+
data-slot="toast-description"
|
|
189
|
+
className={cn("text-sm text-slate-300", className)}
|
|
190
|
+
>
|
|
191
|
+
{children}
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
ToastDescription.displayName = "ToastDescription";
|
|
197
|
+
|
|
198
|
+
export function ToastAction({ className, children }: ToastSectionProps) {
|
|
199
|
+
return (
|
|
200
|
+
<div data-slot="toast-action" className={cn("mt-3", className)}>
|
|
201
|
+
{children}
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
ToastAction.displayName = "ToastAction";
|
|
207
|
+
|
|
208
|
+
export function ToastClose({
|
|
209
|
+
className,
|
|
210
|
+
children,
|
|
211
|
+
onClick,
|
|
212
|
+
...rest
|
|
213
|
+
}: ToastSectionProps & { onClick?: () => void }) {
|
|
214
|
+
return (
|
|
215
|
+
<button
|
|
216
|
+
type="button"
|
|
217
|
+
data-slot="toast-close"
|
|
218
|
+
aria-label="Dismiss notification"
|
|
219
|
+
className={cn(
|
|
220
|
+
"absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10",
|
|
221
|
+
className,
|
|
222
|
+
)}
|
|
223
|
+
onClick={onClick}
|
|
224
|
+
{...rest}
|
|
225
|
+
>
|
|
226
|
+
{children ?? "×"}
|
|
227
|
+
</button>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
ToastClose.displayName = "ToastClose";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { render, screen, waitFor } from "@testing-library/react";
|
|
3
|
+
import userEvent from "@testing-library/user-event";
|
|
4
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
|
|
6
|
+
import type { ToastAnimation } from "./types";
|
|
7
|
+
|
|
8
|
+
import { ToastProvider, ToastViewport, useToast } from "./toast";
|
|
9
|
+
|
|
10
|
+
function ToastHarness({
|
|
11
|
+
title,
|
|
12
|
+
appearance,
|
|
13
|
+
id,
|
|
14
|
+
durationMs,
|
|
15
|
+
animation,
|
|
16
|
+
}: {
|
|
17
|
+
title: string;
|
|
18
|
+
appearance?: "default" | "success" | "error" | "warning" | "info";
|
|
19
|
+
id?: string;
|
|
20
|
+
durationMs?: number;
|
|
21
|
+
animation?: ToastAnimation;
|
|
22
|
+
}) {
|
|
23
|
+
const { toast: push } = useToast();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
push({ title, appearance, id, durationMs, animation });
|
|
26
|
+
}, [animation, appearance, durationMs, id, push, title]);
|
|
27
|
+
return <ToastViewport />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe("Toast", () => {
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
vi.useRealTimers();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("should expose displayName on provider and viewport", () => {
|
|
36
|
+
expect(ToastProvider.displayName).toBe("ToastProvider");
|
|
37
|
+
expect(ToastViewport.displayName).toBe("ToastViewport");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("should render pushed toasts in the viewport portal", async () => {
|
|
41
|
+
render(
|
|
42
|
+
<ToastProvider>
|
|
43
|
+
<ToastHarness title="Saved" id="toast-saved" durationMs={60_000} />
|
|
44
|
+
</ToastProvider>,
|
|
45
|
+
);
|
|
46
|
+
expect(await screen.findByText("Saved")).toBeInTheDocument();
|
|
47
|
+
expect(document.querySelector('[data-slot="toast-viewport"]')).toBeTruthy();
|
|
48
|
+
expect(document.querySelector('[data-slot="toast"]')).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should use role alert for error toasts", async () => {
|
|
52
|
+
render(
|
|
53
|
+
<ToastProvider>
|
|
54
|
+
<ToastHarness
|
|
55
|
+
title="Failed"
|
|
56
|
+
appearance="error"
|
|
57
|
+
id="toast-err"
|
|
58
|
+
durationMs={60_000}
|
|
59
|
+
/>
|
|
60
|
+
</ToastProvider>,
|
|
61
|
+
);
|
|
62
|
+
const root = await screen.findByRole("alert");
|
|
63
|
+
expect(root.getAttribute("data-slot")).toBe("toast");
|
|
64
|
+
expect(root).toHaveTextContent("Failed");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("should dismiss when the close control is used", async () => {
|
|
68
|
+
const user = userEvent.setup();
|
|
69
|
+
render(
|
|
70
|
+
<ToastProvider>
|
|
71
|
+
<ToastHarness title="Closable" id="toast-close" durationMs={60_000} />
|
|
72
|
+
</ToastProvider>,
|
|
73
|
+
);
|
|
74
|
+
expect(await screen.findByText("Closable")).toBeInTheDocument();
|
|
75
|
+
await user.click(
|
|
76
|
+
screen.getByRole("button", { name: /dismiss notification/i }),
|
|
77
|
+
);
|
|
78
|
+
await waitFor(() => {
|
|
79
|
+
expect(screen.queryByText("Closable")).not.toBeInTheDocument();
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("should auto-dismiss after durationMs", async () => {
|
|
84
|
+
render(
|
|
85
|
+
<ToastProvider>
|
|
86
|
+
<ToastHarness
|
|
87
|
+
title="Short lived"
|
|
88
|
+
id="toast-auto"
|
|
89
|
+
durationMs={80}
|
|
90
|
+
animation="none"
|
|
91
|
+
/>
|
|
92
|
+
</ToastProvider>,
|
|
93
|
+
);
|
|
94
|
+
expect(await screen.findByText("Short lived")).toBeInTheDocument();
|
|
95
|
+
await waitFor(
|
|
96
|
+
() => {
|
|
97
|
+
expect(screen.queryByText("Short lived")).not.toBeInTheDocument();
|
|
98
|
+
},
|
|
99
|
+
{ timeout: 2000 },
|
|
100
|
+
);
|
|
101
|
+
}, 5000);
|
|
102
|
+
});
|
|
@@ -1,45 +1,57 @@
|
|
|
1
1
|
import type { VariantProps } from "class-variance-authority";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
2
|
+
import type { ElementType, ReactNode } from "react";
|
|
3
|
+
|
|
3
4
|
import type { toastRootVariants, toastViewportVariants } from "./variants";
|
|
5
|
+
|
|
4
6
|
export type ToastAnimation = "none" | "slide" | "fade";
|
|
7
|
+
|
|
5
8
|
export type ToastViewportVariantProps = VariantProps<typeof toastViewportVariants>;
|
|
6
9
|
export type ToastRootVariantProps = VariantProps<typeof toastRootVariants>;
|
|
10
|
+
|
|
7
11
|
export type ToastPosition = NonNullable<ToastViewportVariantProps["position"]>;
|
|
12
|
+
|
|
8
13
|
export type ToastInput = ToastRootVariantProps & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
id?: string;
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
durationMs?: number;
|
|
18
|
+
animation?: ToastAnimation;
|
|
14
19
|
};
|
|
20
|
+
|
|
15
21
|
export type ToastContextValue = {
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
toast: (input: ToastInput) => string;
|
|
23
|
+
dismiss: (id: string) => void;
|
|
18
24
|
};
|
|
25
|
+
|
|
19
26
|
export type ToastProviderProps = {
|
|
20
|
-
|
|
27
|
+
children?: ReactNode;
|
|
21
28
|
};
|
|
29
|
+
|
|
22
30
|
export type ToastViewportProps = ToastViewportVariantProps & {
|
|
23
|
-
|
|
31
|
+
className?: string;
|
|
24
32
|
};
|
|
33
|
+
|
|
25
34
|
export type ToastProps = ToastRootVariantProps & {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
toastId: string;
|
|
36
|
+
animation?: ToastAnimation;
|
|
37
|
+
className?: string;
|
|
38
|
+
children?: ReactNode;
|
|
30
39
|
};
|
|
40
|
+
|
|
31
41
|
export type ToastSectionProps = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
className?: string;
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
onClick?: () => void;
|
|
35
45
|
};
|
|
36
|
-
|
|
46
|
+
|
|
47
|
+
export type InternalToast = Required<Pick<ToastInput, "id">> &
|
|
48
|
+
Omit<ToastInput, "id"> & {
|
|
37
49
|
durationMs: number;
|
|
38
50
|
animation: NonNullable<ToastInput["animation"]>;
|
|
39
|
-
};
|
|
51
|
+
};
|
|
52
|
+
|
|
40
53
|
export type ToastStoreContextValue = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
toasts: InternalToast[];
|
|
55
|
+
push: (input: ToastInput) => string;
|
|
56
|
+
dismiss: (id: string) => void;
|
|
44
57
|
};
|
|
45
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const toastViewportVariants = cva(
|
|
4
|
+
"fixed z-[60] flex max-h-screen flex-col gap-2 p-4",
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
position: {
|
|
8
|
+
"top-left": "left-0 top-0 items-start",
|
|
9
|
+
"top-center": "left-1/2 top-0 -translate-x-1/2 items-center",
|
|
10
|
+
"top-right": "right-0 top-0 items-end",
|
|
11
|
+
"bottom-left": "bottom-0 left-0 items-start",
|
|
12
|
+
"bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center",
|
|
13
|
+
"bottom-right": "bottom-0 right-0 items-end",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
position: "bottom-right",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const toastRootVariants = cva(
|
|
23
|
+
"pointer-events-auto w-[min(100vw-2rem,380px)] rounded-xl border border-white/10 bg-slate-950 p-4 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.45)]",
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
appearance: {
|
|
27
|
+
default: "bg-slate-950",
|
|
28
|
+
success: "border-emerald-500/40 bg-emerald-950",
|
|
29
|
+
warning: "border-amber-500/40 bg-amber-950",
|
|
30
|
+
error: "border-rose-500/50 bg-rose-950",
|
|
31
|
+
info: "border-sky-500/40 bg-sky-950",
|
|
32
|
+
ghost: "border-transparent bg-transparent text-slate-200",
|
|
33
|
+
purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
|
|
34
|
+
pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
|
|
35
|
+
orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
|
|
36
|
+
yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
|
|
37
|
+
teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
|
|
38
|
+
indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
|
|
39
|
+
emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
|
|
40
|
+
gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
|
|
41
|
+
amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
|
|
42
|
+
violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
|
|
43
|
+
"gradient-blue":
|
|
44
|
+
"border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
|
|
45
|
+
"gradient-green":
|
|
46
|
+
"border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
|
|
47
|
+
"gradient-red":
|
|
48
|
+
"border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
|
|
49
|
+
"gradient-yellow":
|
|
50
|
+
"border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
|
|
51
|
+
"gradient-purple":
|
|
52
|
+
"border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
|
|
53
|
+
"gradient-teal":
|
|
54
|
+
"border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
|
|
55
|
+
"gradient-indigo":
|
|
56
|
+
"border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
|
|
57
|
+
"gradient-pink":
|
|
58
|
+
"border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
|
|
59
|
+
"gradient-orange":
|
|
60
|
+
"border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl",
|
|
61
|
+
},
|
|
62
|
+
size: {
|
|
63
|
+
sm: "p-3 text-xs",
|
|
64
|
+
md: "p-4 text-sm",
|
|
65
|
+
lg: "p-5 text-base",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
defaultVariants: {
|
|
69
|
+
appearance: "default",
|
|
70
|
+
size: "md",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
);
|