@zentauri-ui/zentauri-components 1.4.0 → 1.4.2
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 +19 -6
- package/cli/cli.integration.test.ts +28 -0
- package/cli/index.mjs +66 -8
- package/cli/registry.json +28 -1
- package/package.json +2 -2
- package/dist/hooks/index.d.ts +0 -27
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/useBodyScrollLock/index.d.ts +0 -2
- 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 +0 -2
- 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 +0 -2
- package/dist/hooks/useDebouncedValue/index.d.ts.map +0 -1
- package/dist/hooks/useDebouncedValue/useDebouncedValue.d.ts +0 -13
- 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 +0 -2
- 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 +0 -2
- 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 +0 -2
- package/dist/hooks/useInView/index.d.ts.map +0 -1
- package/dist/hooks/useInView/useInView.d.ts +0 -17
- 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 +0 -2
- package/dist/hooks/useIsMounted/index.d.ts.map +0 -1
- package/dist/hooks/useIsMounted/useIsMounted.d.ts +0 -10
- package/dist/hooks/useIsMounted/useIsMounted.d.ts.map +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.ts +0 -2
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.ts.map +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +0 -9
- 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 +0 -2
- 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 +0 -2
- 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 +0 -2
- 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 +0 -9
- package/dist/hooks/usePrefersColorScheme/usePrefersColorScheme.d.ts.map +0 -1
- package/dist/hooks/usePrefersReducedMotion/index.d.ts +0 -2
- package/dist/hooks/usePrefersReducedMotion/index.d.ts.map +0 -1
- package/dist/hooks/usePrefersReducedMotion/usePrefersReducedMotion.d.ts +0 -9
- 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 +0 -2
- package/dist/hooks/useThrottledCallback/index.d.ts.map +0 -1
- package/dist/hooks/useThrottledCallback/useThrottledCallback.d.ts +0 -13
- package/dist/hooks/useThrottledCallback/useThrottledCallback.d.ts.map +0 -1
- package/dist/hooks/useToggle/index.d.ts +0 -2
- 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 +0 -2
- 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 +0 -6
- package/dist/ui/accordion/animated/index.d.ts.map +0 -1
- package/dist/ui/accordion/animated/types.d.ts +0 -6
- 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 +0 -39
- 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 +0 -21
- 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 +0 -5
- package/dist/ui/avatar/animated/index.d.ts.map +0 -1
- package/dist/ui/avatar/animated/types.d.ts +0 -8
- 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 +0 -25
- 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 +0 -4
- 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 +0 -4
- 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 +0 -26
- 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 +0 -4
- 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 +0 -4
- package/dist/ui/buttons/index.d.ts.map +0 -1
- package/dist/ui/buttons/types.d.ts +0 -10
- 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 +0 -5
- package/dist/ui/card/animated/index.d.ts.map +0 -1
- package/dist/ui/card/animated/types.d.ts +0 -6
- 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 +0 -3
- package/dist/ui/divider/animated/index.d.ts.map +0 -1
- package/dist/ui/divider/animated/types.d.ts +0 -8
- 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 +0 -15
- 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 +0 -5
- 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 +0 -14
- 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 +0 -5
- package/dist/ui/empty-state/index.d.ts.map +0 -1
- package/dist/ui/empty-state/types.d.ts +0 -15
- 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 +0 -4
- package/dist/ui/file-upload/index.d.ts.map +0 -1
- package/dist/ui/file-upload/types.d.ts +0 -18
- 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 +0 -4
- 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 +0 -4
- 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 +0 -4
- 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 +0 -56
- 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 +0 -23
- package/dist/ui/progress/animated/types.d.ts.map +0 -1
- package/dist/ui/progress/index.d.ts +0 -5
- 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 +0 -30
- 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 +0 -23
- 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 -51
- 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 +0 -4
- 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 +0 -9
- 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 +0 -25
- 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 +0 -4
- 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 +0 -4
- 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 +0 -2
- 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 +0 -45
- 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 +0 -9
- package/dist/ui/toggle/animated/types.d.ts.map +0 -1
- package/dist/ui/toggle/index.d.ts +0 -4
- 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 +0 -14
- 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
package/README.md
CHANGED
|
@@ -280,16 +280,26 @@ Which UI folders are valid for `add` is driven by **`cli/registry.json`**: a gen
|
|
|
280
280
|
|
|
281
281
|
### Commands
|
|
282
282
|
|
|
283
|
+
Call the published binary by name after the package (recommended so `npx` does not treat the first word as a shell command):
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
npx @zentauri-ui/zentauri-components zentauri-components init
|
|
287
|
+
npx @zentauri-ui/zentauri-components zentauri-components add buttons inputs
|
|
288
|
+
npx @zentauri-ui/zentauri-components zentauri-components -h
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Hooks only** (copy `src/hooks/<name>` into your app, plus sibling hook dependencies such as `useMediaQuery` when needed):
|
|
292
|
+
|
|
283
293
|
```bash
|
|
284
|
-
npx @zentauri-ui/zentauri-components
|
|
285
|
-
npx @zentauri-ui/zentauri-components add
|
|
294
|
+
npx @zentauri-ui/zentauri-components zentauri-components add hook useWindowSize
|
|
295
|
+
npx @zentauri-ui/zentauri-components zentauri-components add hook useToggle useDebouncedValue
|
|
286
296
|
```
|
|
287
297
|
|
|
288
|
-
The **`zentauri-ui`**
|
|
298
|
+
The **`zentauri-ui`** binary is the same entry as **`zentauri-components`**. If `npx` still mis-resolves, pin the package:
|
|
289
299
|
|
|
290
300
|
```bash
|
|
291
301
|
npx --yes --package=@zentauri-ui/zentauri-components zentauri-components init
|
|
292
|
-
npx --yes --package=@zentauri-ui/zentauri-components zentauri-
|
|
302
|
+
npx --yes --package=@zentauri-ui/zentauri-components zentauri-components add button
|
|
293
303
|
```
|
|
294
304
|
|
|
295
305
|
From a monorepo checkout you can run the script by path instead of `npx`:
|
|
@@ -297,12 +307,14 @@ From a monorepo checkout you can run the script by path instead of `npx`:
|
|
|
297
307
|
```bash
|
|
298
308
|
node node_modules/@zentauri-ui/zentauri-components/cli/index.mjs init
|
|
299
309
|
node node_modules/@zentauri-ui/zentauri-components/cli/index.mjs add accordion
|
|
310
|
+
node node_modules/@zentauri-ui/zentauri-components/cli/index.mjs add hook useWindowSize
|
|
300
311
|
```
|
|
301
312
|
|
|
302
313
|
| Command | What it does |
|
|
303
314
|
| ------- | -------------- |
|
|
304
315
|
| `init` | Writes **`components.json`** in the current working directory (or `--cwd`) with default `aliases` and `resolvedPaths`. Refuses to overwrite an existing file. |
|
|
305
|
-
| `add <names...>` | Walks up from `--cwd` (default `.`) to find `components.json`, then copies each resolved UI folder
|
|
316
|
+
| `add <names...>` | Walks up from `--cwd` (default `.`) to find `components.json`, then copies each resolved **UI** folder under `src/ui`, pulls in hooks those files depend on (including transitive hook imports), and creates **`lib/utils`** at `resolvedPaths.utils` from the package template if it is missing. |
|
|
317
|
+
| `add hook <names...>` | Same config lookup; copies only **hook** folders listed under `registry.hooks` (from `hooksEntryNames` in `tsup.config.ts`), including transitive sibling-hook imports. Does not copy UI unless a hook’s imports require you to add a component separately (for example `usePagination` imports types from `ui/pagination`). |
|
|
306
318
|
|
|
307
319
|
Global flags: `-h` / `--help`, `-v` / `--version`, `--cwd <dir>` (relative to `process.cwd()`).
|
|
308
320
|
|
|
@@ -328,6 +340,7 @@ Defaults look like this; edit `resolvedPaths` and `aliases` so they match your a
|
|
|
328
340
|
### Registry (`cli/registry.json`)
|
|
329
341
|
|
|
330
342
|
- **`components`**: sorted list of folder names under **`src/ui/`** that `add` may copy. The file is **generated**; the canonical build list lives in **`tsup.config.ts`** as `uiComponentNames`, and the generator always ensures **`spinner`** is included so the CLI stays aligned with the animated-only spinner bundle.
|
|
343
|
+
- **`hooks`**: sorted list of folder names under **`src/hooks/`** that `add hook` may copy; generated from **`hooksEntryNames`** in **`tsup.config.ts`** (same entries as published `…/hooks/<name>` subpaths).
|
|
331
344
|
- **`nameAliases`**: optional map from a CLI token to a real folder name. Today: `button` → `buttons`, `input` → `inputs` (matching common singular names while folders stay plural).
|
|
332
345
|
|
|
333
346
|
Example: these are equivalent when `nameAliases` is configured:
|
|
@@ -359,7 +372,7 @@ From this package directory in the monorepo:
|
|
|
359
372
|
- `pnpm build` (or `npm run build`) — production bundle via `tsup` (Rollup treeshake + `scripts/prepend-use-client.mjs` via `onSuccess` so each UI entry under `dist/ui/`, including `dist/ui/<name>/animated.*`, starts with `"use client"` where needed)
|
|
360
373
|
- `pnpm dev` — `tsup` watch mode (same `onSuccess` hook after each rebuild)
|
|
361
374
|
- `pnpm test` / `pnpm test:watch` — **Vitest** and **Testing Library** unit tests
|
|
362
|
-
- **`pnpm run generate:registry`** — runs `scripts/generate-registry.mjs`, which reads **`uiComponentNames`** from `tsup.config.ts`, merges in **`spinner`**, applies fixed **`nameAliases`**, and writes **`cli/registry.json
|
|
375
|
+
- **`pnpm run generate:registry`** — runs `scripts/generate-registry.mjs`, which reads **`uiComponentNames`** and **`hooksEntryNames`** from `tsup.config.ts`, merges in **`spinner`**, applies fixed **`nameAliases`**, and writes **`cli/registry.json`** (`components` + `hooks`). Run this after adding or renaming UI areas or hook entries so the CLI stays in sync (the script prints counts).
|
|
363
376
|
- **`prepack`** — invokes `generate:registry` automatically before `npm pack` / publish so the published tarball always ships an up-to-date registry alongside `cli/index.mjs`.
|
|
364
377
|
|
|
365
378
|
## Github Release log
|
|
@@ -48,4 +48,32 @@ describe("zentauri-ui CLI", () => {
|
|
|
48
48
|
rmSync(dir, { recursive: true, force: true });
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
+
|
|
52
|
+
it("should add hook-only mode for useWindowSize", () => {
|
|
53
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-hook-"));
|
|
54
|
+
try {
|
|
55
|
+
runCli(dir, ["init"]);
|
|
56
|
+
runCli(dir, ["add", "hook", "useWindowSize"]);
|
|
57
|
+
const hookFile = join(dir, "src/hooks/useWindowSize/useWindowSize.ts");
|
|
58
|
+
expect(existsSync(hookFile)).toBe(true);
|
|
59
|
+
const src = readFileSync(hookFile, "utf8");
|
|
60
|
+
expect(src).toContain("useWindowSize");
|
|
61
|
+
expect(src).toContain('"use client"');
|
|
62
|
+
} finally {
|
|
63
|
+
rmSync(dir, { recursive: true, force: true });
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("should pull transitive hook deps for usePrefersReducedMotion", () => {
|
|
68
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-hook-trans-"));
|
|
69
|
+
try {
|
|
70
|
+
runCli(dir, ["init"]);
|
|
71
|
+
runCli(dir, ["add", "hook", "usePrefersReducedMotion"]);
|
|
72
|
+
expect(
|
|
73
|
+
existsSync(join(dir, "src/hooks/useMediaQuery/useMediaQuery.ts")),
|
|
74
|
+
).toBe(true);
|
|
75
|
+
} finally {
|
|
76
|
+
rmSync(dir, { recursive: true, force: true });
|
|
77
|
+
}
|
|
78
|
+
});
|
|
51
79
|
});
|
package/cli/index.mjs
CHANGED
|
@@ -131,11 +131,22 @@ function loadRegistry() {
|
|
|
131
131
|
* // Terminal shows multi-line Usage / Options / examples (see string below).
|
|
132
132
|
*/
|
|
133
133
|
function printHelp() {
|
|
134
|
+
const reg = loadRegistry();
|
|
135
|
+
const componentsList = (reg.components ?? []).join("\n");
|
|
136
|
+
const hooksList = (reg.hooks ?? []).join("\n");
|
|
137
|
+
|
|
134
138
|
console.log(`Zentauri UI — copy component source into your app (shadcn-style)
|
|
135
139
|
|
|
136
140
|
Usage:
|
|
137
|
-
zentauri-components init [options]
|
|
138
|
-
zentauri-components add <
|
|
141
|
+
zentauri-components init [options] Create components.json with defaults
|
|
142
|
+
zentauri-components add <component> [...] Copy UI components (and their hooks)
|
|
143
|
+
zentauri-components add hook <hook> [...] Copy hook source only (plus transitive hook deps)
|
|
144
|
+
|
|
145
|
+
List of components:
|
|
146
|
+
${componentsList}
|
|
147
|
+
|
|
148
|
+
List of hooks:
|
|
149
|
+
${hooksList}
|
|
139
150
|
|
|
140
151
|
(The zentauri-ui binary name works the same if your PATH exposes it.)
|
|
141
152
|
|
|
@@ -147,11 +158,15 @@ Options:
|
|
|
147
158
|
Local (no npm publish): cd to your app root, then run Node with a path to this CLI (yours may differ):
|
|
148
159
|
node ../../packages/components/cli/index.mjs init
|
|
149
160
|
node ../../packages/components/cli/index.mjs add button
|
|
150
|
-
|
|
161
|
+
node ../../packages/components/cli/index.mjs add hook useWindowSize
|
|
162
|
+
Only copies the requested trees; not the whole monorepo.
|
|
163
|
+
|
|
164
|
+
Use hooks from the package without copying (after npm install):
|
|
165
|
+
import { useWindowSize } from "@zentauri-ui/zentauri-components/hooks/useWindowSize";
|
|
151
166
|
|
|
152
167
|
Published package:
|
|
153
|
-
npx @zentauri-ui/zentauri-components init
|
|
154
|
-
npx @zentauri-ui/zentauri-components add accordion buttons inputs
|
|
168
|
+
npx @zentauri-ui/zentauri-components zentauri-components init
|
|
169
|
+
npx @zentauri-ui/zentauri-components zentauri-components add accordion buttons inputs
|
|
155
170
|
|
|
156
171
|
If npx does not pick the right binary:
|
|
157
172
|
npx --yes --package=@zentauri-ui/zentauri-components zentauri-components init
|
|
@@ -341,6 +356,25 @@ function resolveComponentName(input, registry) {
|
|
|
341
356
|
);
|
|
342
357
|
}
|
|
343
358
|
|
|
359
|
+
/**
|
|
360
|
+
* @param {string} input — argv token, e.g. `useWindowSize`
|
|
361
|
+
* @param {object} registry — must include `hooks` string array
|
|
362
|
+
* @returns {string} — canonical hook folder name under `src/hooks`
|
|
363
|
+
*/
|
|
364
|
+
function resolveHookName(input, registry) {
|
|
365
|
+
const list = registry.hooks ?? [];
|
|
366
|
+
if (list.includes(input)) {
|
|
367
|
+
return input;
|
|
368
|
+
}
|
|
369
|
+
const found = list.find((h) => h.toLowerCase() === input.toLowerCase());
|
|
370
|
+
if (found) {
|
|
371
|
+
return found;
|
|
372
|
+
}
|
|
373
|
+
throw new Error(
|
|
374
|
+
`Unknown hook "${input}". Valid hooks include: ${list.join(", ")}`,
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
344
378
|
/**
|
|
345
379
|
* Starting from hook folder names discovered in UI code, expands the set to
|
|
346
380
|
* include every hook that those hooks import from **sibling** hook packages
|
|
@@ -560,9 +594,33 @@ async function cmdAdd(names, cwd) {
|
|
|
560
594
|
validateConfig(config);
|
|
561
595
|
|
|
562
596
|
const registry = loadRegistry();
|
|
563
|
-
const
|
|
597
|
+
const hookMode =
|
|
598
|
+
names.length > 0 && names[0].toLowerCase() === "hook";
|
|
599
|
+
const payload = hookMode ? names.slice(1) : names;
|
|
600
|
+
|
|
601
|
+
if (hookMode && payload.length === 0) {
|
|
602
|
+
console.error(
|
|
603
|
+
"Usage: zentauri-components add hook <hookName> [more...] (e.g. add hook useWindowSize)",
|
|
604
|
+
);
|
|
605
|
+
process.exitCode = 1;
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
if (hookMode) {
|
|
610
|
+
const resolvedHooks = payload.map((n) => resolveHookName(n, registry));
|
|
611
|
+
const finalHooks = await collectHookTransitiveClosure(
|
|
612
|
+
packageRoot,
|
|
613
|
+
resolvedHooks,
|
|
614
|
+
);
|
|
615
|
+
for (const h of finalHooks) {
|
|
616
|
+
console.log(`Adding hook ${h}…`);
|
|
617
|
+
await copyHookFolder(h, config, configDir, packageRoot);
|
|
618
|
+
}
|
|
619
|
+
console.log("Done.");
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
564
622
|
|
|
565
|
-
|
|
623
|
+
const resolvedNames = payload.map((n) => resolveComponentName(n, registry));
|
|
566
624
|
|
|
567
625
|
const allHooks = new Set();
|
|
568
626
|
for (const name of resolvedNames) {
|
|
@@ -644,7 +702,7 @@ async function main() {
|
|
|
644
702
|
if (cmd === "add") {
|
|
645
703
|
if (rest.length === 0) {
|
|
646
704
|
console.error(
|
|
647
|
-
"Usage: zentauri-components add <component> [more...]
|
|
705
|
+
"Usage: zentauri-components add <component> [more...] | add hook <hookName> [more...]",
|
|
648
706
|
);
|
|
649
707
|
process.exitCode = 1;
|
|
650
708
|
return;
|
package/cli/registry.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"description": "Addable UI
|
|
3
|
+
"description": "Addable UI components (src/ui) and hooks (src/hooks). Generated by scripts/generate-registry.mjs.",
|
|
4
4
|
"components": [
|
|
5
5
|
"accordion",
|
|
6
6
|
"alert",
|
|
@@ -29,6 +29,33 @@
|
|
|
29
29
|
"toggle",
|
|
30
30
|
"tooltip"
|
|
31
31
|
],
|
|
32
|
+
"hooks": [
|
|
33
|
+
"useBodyScrollLock",
|
|
34
|
+
"useClickOutside",
|
|
35
|
+
"useClipboard",
|
|
36
|
+
"useControllableState",
|
|
37
|
+
"useDebouncedValue",
|
|
38
|
+
"useDisclosure",
|
|
39
|
+
"useDocumentTitle",
|
|
40
|
+
"useFocusManagement",
|
|
41
|
+
"useHover",
|
|
42
|
+
"useInView",
|
|
43
|
+
"useIntersectionObserver",
|
|
44
|
+
"useIsMounted",
|
|
45
|
+
"useIsomorphicLayoutEffect",
|
|
46
|
+
"useLocalStorage",
|
|
47
|
+
"useMediaQuery",
|
|
48
|
+
"useNetworkStatus",
|
|
49
|
+
"usePageVisibility",
|
|
50
|
+
"usePagination",
|
|
51
|
+
"usePrefersColorScheme",
|
|
52
|
+
"usePrefersReducedMotion",
|
|
53
|
+
"useResizeObserver",
|
|
54
|
+
"useSessionStorage",
|
|
55
|
+
"useThrottledCallback",
|
|
56
|
+
"useToggle",
|
|
57
|
+
"useWindowSize"
|
|
58
|
+
],
|
|
32
59
|
"nameAliases": {
|
|
33
60
|
"button": "buttons",
|
|
34
61
|
"input": "inputs"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zentauri-ui/zentauri-components",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "React + Tailwind UI kit with ESM/CJS builds, per-entry exports, and a zentauri-components / zentauri-ui CLI to vendor UI or hook source into your app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": ["dist", "src/ui", "src/lib", "src/hooks", "cli"],
|
|
7
7
|
"sideEffects": false,
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export { cn, clampPage, range } from "../lib/utils";
|
|
2
|
-
export { useBodyScrollLock } from "./useBodyScrollLock";
|
|
3
|
-
export { useClickOutside, type ClickOutsideEventType, type UseClickOutsideParams, } from "./useClickOutside";
|
|
4
|
-
export { useFocusManagement } from "./useFocusManagement";
|
|
5
|
-
export { buildPaginationItems, usePagination, type BuildPaginationItemsParams, type PaginationPageItem, } from "./usePagination";
|
|
6
|
-
export { useClipboard, type UseClipboardResult } from "./useClipboard";
|
|
7
|
-
export { useControllableState, type UseControllableStateParams, } from "./useControllableState";
|
|
8
|
-
export { useDebouncedValue } from "./useDebouncedValue";
|
|
9
|
-
export { useDisclosure, type UseDisclosureParams, type UseDisclosureResult, } from "./useDisclosure";
|
|
10
|
-
export { useDocumentTitle, type UseDocumentTitleParams } from "./useDocumentTitle";
|
|
11
|
-
export { useHover } from "./useHover";
|
|
12
|
-
export { useInView, type UseInViewParams } from "./useInView";
|
|
13
|
-
export { useIntersectionObserver, type UseIntersectionObserverParams, } from "./useIntersectionObserver";
|
|
14
|
-
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
|
|
15
|
-
export { useIsMounted } from "./useIsMounted";
|
|
16
|
-
export { useLocalStorage, type UseLocalStorageResult } from "./useLocalStorage";
|
|
17
|
-
export { useMediaQuery } from "./useMediaQuery";
|
|
18
|
-
export { useNetworkStatus } from "./useNetworkStatus";
|
|
19
|
-
export { usePageVisibility } from "./usePageVisibility";
|
|
20
|
-
export { usePrefersColorScheme, type ColorSchemePreference, } from "./usePrefersColorScheme";
|
|
21
|
-
export { usePrefersReducedMotion } from "./usePrefersReducedMotion";
|
|
22
|
-
export { useResizeObserver, type ElementSize } from "./useResizeObserver";
|
|
23
|
-
export { useSessionStorage, type UseSessionStorageResult } from "./useSessionStorage";
|
|
24
|
-
export { useThrottledCallback } from "./useThrottledCallback";
|
|
25
|
-
export { useToggle } from "./useToggle";
|
|
26
|
-
export { useWindowSize, type WindowSize } from "./useWindowSize";
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useBodyScrollLock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Locks the document body scroll while `locked` is true by setting `document.body.style.overflow`
|
|
3
|
-
* to `"hidden"`. Uses a module-level lock count so multiple concurrent callers (nested modals,
|
|
4
|
-
* drawer + modal, several hook instances) only restore the original inline `overflow` after the
|
|
5
|
-
* last lock releases.
|
|
6
|
-
*
|
|
7
|
-
* Typical use: modals, drawers, and full-screen overlays where background content must not scroll.
|
|
8
|
-
*
|
|
9
|
-
* @param locked - When `true`, body scroll is hidden; when `false`, this instance releases its
|
|
10
|
-
* lock; the prior overflow is restored only when no instance still holds a lock.
|
|
11
|
-
*/
|
|
12
|
-
export declare const useBodyScrollLock: (locked: boolean) => void;
|
|
13
|
-
//# sourceMappingURL=useBodyScrollLock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBodyScrollLock.d.ts","sourceRoot":"","sources":["../../../src/hooks/useBodyScrollLock/useBodyScrollLock.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,OAAO,SAUhD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClickOutside/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { RefObject } from "react";
|
|
2
|
-
import { Dispatch, SetStateAction } from "react";
|
|
3
|
-
/** DOM events that can represent an “outside” press for closing overlays. */
|
|
4
|
-
export type ClickOutsideEventType = "mousedown" | "pointerdown" | "touchstart";
|
|
5
|
-
export type UseClickOutsideParams = {
|
|
6
|
-
/** Called with `false` when a qualifying event target is outside `ref.current`. */
|
|
7
|
-
setOpen: (open: boolean) => void | Dispatch<SetStateAction<boolean>>;
|
|
8
|
-
/** Root element of the floating UI; clicks inside this node do not close. */
|
|
9
|
-
ref: RefObject<HTMLElement | null>;
|
|
10
|
-
/** Defaults to `["mousedown"]` for backward compatibility */
|
|
11
|
-
listenEvents?: ClickOutsideEventType[];
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Registers document-level listeners so that when the user activates outside of `ref`, `setOpen(false)`
|
|
15
|
-
* runs. Useful for dropdowns, popovers, and menus paired with `open` state.
|
|
16
|
-
*
|
|
17
|
-
* @param params.setOpen - State setter or callback that closes the surface.
|
|
18
|
-
* @param params.ref - Container ref; outside is determined with `contains()` on the event target.
|
|
19
|
-
* @param params.listenEvents - Which events to listen for; default is `mousedown` only.
|
|
20
|
-
*/
|
|
21
|
-
export declare const useClickOutside: ({ setOpen, ref, listenEvents, }: UseClickOutsideParams) => void;
|
|
22
|
-
//# sourceMappingURL=useClickOutside.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClickOutside/useClickOutside.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAE5D,6EAA6E;AAC7E,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,aAAa,GACb,YAAY,CAAC;AAEjB,MAAM,MAAM,qBAAqB,GAAG;IAClC,mFAAmF;IACnF,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,6EAA6E;IAC7E,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACnC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACxC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,iCAI7B,qBAAqB,SAmBvB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClipboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type UseClipboardResult = {
|
|
2
|
-
/** `true` after a successful `copy` until the reset delay elapses or `reset` is called. */
|
|
3
|
-
copied: boolean;
|
|
4
|
-
/** Set when the Clipboard API is missing or `writeText` rejects (e.g. permission denied). */
|
|
5
|
-
error: Error | undefined;
|
|
6
|
-
/** Writes `text` via `navigator.clipboard.writeText`; returns whether the write succeeded. */
|
|
7
|
-
copy: (text: string) => Promise<boolean>;
|
|
8
|
-
/** Clears `copied`/`error` and cancels any pending auto-reset timeout. */
|
|
9
|
-
reset: () => void;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Wraps the async Clipboard API with React state for UX feedback (“Copied!”) and error surfacing.
|
|
13
|
-
*
|
|
14
|
-
* After a successful copy, `copied` flips to `true` for `resetDelay` ms (or stays true if `resetDelay` is 0).
|
|
15
|
-
* SSR-safe: `copy` resolves `false` with an error when `navigator.clipboard` is unavailable.
|
|
16
|
-
*
|
|
17
|
-
* @param resetDelay - Milliseconds before `copied` auto-clears after success; `0` disables auto-clear.
|
|
18
|
-
* @returns `{ copied, error, copy, reset }` for rendering and handlers.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useClipboard(resetDelay?: number): UseClipboardResult;
|
|
21
|
-
//# sourceMappingURL=useClipboard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClipboard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClipboard/useClipboard.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,2FAA2F;IAC3F,MAAM,EAAE,OAAO,CAAC;IAChB,6FAA6F;IAC7F,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,8FAA8F;IAC9F,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,UAAU,SAAO,GAAG,kBAAkB,CA4ClE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useControllableState/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,GAChC,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type UseControllableStateParams<T> = {
|
|
2
|
-
/** When defined, the hook is controlled and this value is returned as state. */
|
|
3
|
-
value?: T;
|
|
4
|
-
/** Initial / fallback value when uncontrolled (`value` is `undefined`). */
|
|
5
|
-
defaultValue: T;
|
|
6
|
-
/** Notified on every `setValue` with the resolved next value (controlled and uncontrolled). */
|
|
7
|
-
onChange?: (next: T) => void;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Implements the React “controlled vs uncontrolled” pattern as a single state tuple.
|
|
11
|
-
*
|
|
12
|
-
* - If `value` is `undefined`, internal state mirrors `defaultValue` and updates on `setValue`.
|
|
13
|
-
* - If `value` is defined, returned state follows `value`; `setValue` still calls `onChange` so the parent can update.
|
|
14
|
-
* - `setValue` accepts either the next value or an updater `(prev) => next` (updater uses the current `value` in controlled mode).
|
|
15
|
-
*
|
|
16
|
-
* @typeParam T - State value type.
|
|
17
|
-
* @param params - `value`, `defaultValue`, and optional `onChange`.
|
|
18
|
-
* @returns `[value, setValue]` compatible with `useState`-style usage.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useControllableState<T>({ value: valueProp, defaultValue, onChange, }: UseControllableStateParams<T>): [T, (next: T | ((prev: T) => T)) => void];
|
|
21
|
-
//# sourceMappingURL=useControllableState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useControllableState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useControllableState/useControllableState.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,0BAA0B,CAAC,CAAC,IAAI;IAC1C,gFAAgF;IAChF,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,2EAA2E;IAC3E,YAAY,EAAE,CAAC,CAAC;IAChB,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EACtC,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,QAAQ,GACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAoB3E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDebouncedValue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a lagged copy of `value` that only updates after `value` has been stable for `delayMs`.
|
|
3
|
-
* Each change to `value` or `delayMs` resets the timer; rapid updates collapse into one committed update.
|
|
4
|
-
*
|
|
5
|
-
* Common uses: search inputs, resize-driven layout, or any expensive work that should not run on every keystroke.
|
|
6
|
-
*
|
|
7
|
-
* @typeParam T - Value type (any JSON-serializable or referential type).
|
|
8
|
-
* @param value - Live value from props or state.
|
|
9
|
-
* @param delayMs - Debounce interval in milliseconds.
|
|
10
|
-
* @returns The last value that survived the full delay without a newer `value` arriving.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useDebouncedValue<T>(value: T, delayMs: number): T;
|
|
13
|
-
//# sourceMappingURL=useDebouncedValue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDebouncedValue.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDebouncedValue/useDebouncedValue.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAajE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDisclosure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type UseDisclosureParams = {
|
|
2
|
-
/** Controlled open flag; omit for uncontrolled usage with `defaultOpen`. */
|
|
3
|
-
open?: boolean;
|
|
4
|
-
/** Initial open state when uncontrolled. */
|
|
5
|
-
defaultOpen?: boolean;
|
|
6
|
-
/** Fired whenever open state changes from user-driven `setOpen` / `open` / `close` / `toggle`. */
|
|
7
|
-
onOpenChange?: (open: boolean) => void;
|
|
8
|
-
};
|
|
9
|
-
export type UseDisclosureResult = {
|
|
10
|
-
isOpen: boolean;
|
|
11
|
-
open: () => void;
|
|
12
|
-
close: () => void;
|
|
13
|
-
toggle: () => void;
|
|
14
|
-
setOpen: (open: boolean) => void;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Boolean open/close state for overlays (dialogs, menus, collapsible regions) with optional control from the parent.
|
|
18
|
-
* Built on {@link useControllableState}; semantics match common headless UI libraries.
|
|
19
|
-
*
|
|
20
|
-
* @param params - Optional `open`, `defaultOpen`, and `onOpenChange`.
|
|
21
|
-
* @returns Helpers `open`, `close`, `toggle`, `setOpen`, and the current `isOpen` flag.
|
|
22
|
-
*/
|
|
23
|
-
export declare function useDisclosure({ open: openProp, defaultOpen, onOpenChange, }?: UseDisclosureParams): UseDisclosureResult;
|
|
24
|
-
//# sourceMappingURL=useDisclosure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDisclosure.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDisclosure/useDisclosure.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,mBAAmB,GAAG;IAChC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kGAAkG;IAClG,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EAAE,QAAQ,EACd,WAAmB,EACnB,YAAY,GACb,GAAE,mBAAwB,GAAG,mBAAmB,CA2BhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDocumentTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type UseDocumentTitleParams = {
|
|
2
|
-
title: string;
|
|
3
|
-
/** When true (default), restores the document title from before this hook mounted when the component unmounts */
|
|
4
|
-
restoreOnUnmount?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Keeps `document.title` in sync with `title` for the lifetime of the component.
|
|
8
|
-
*
|
|
9
|
-
* On first mount in the browser, the current title is captured. When `title` changes, the document title updates.
|
|
10
|
-
* If `restoreOnUnmount` is true when the component unmounts, the captured title is restored so nested routes or
|
|
11
|
-
* modals do not leak titles. Changing `restoreOnUnmount` while mounted does not run restore; only unmount does.
|
|
12
|
-
*
|
|
13
|
-
* @param params.title - Desired `document.title` string.
|
|
14
|
-
* @param params.restoreOnUnmount - Whether to restore the pre-mount title on unmount (default `true`). The value
|
|
15
|
-
* read at unmount time determines behavior, not mid-mount prop changes.
|
|
16
|
-
*/
|
|
17
|
-
export declare function useDocumentTitle({ title, restoreOnUnmount, }: UseDocumentTitleParams): void;
|
|
18
|
-
//# sourceMappingURL=useDocumentTitle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentTitle.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDocumentTitle/useDocumentTitle.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,iHAAiH;IACjH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,gBAAuB,GACxB,EAAE,sBAAsB,GAAG,IAAI,CAiC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFocusManagement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { RefObject } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Composes modal-like behavior for an open overlay: body scroll lock, Escape to close, and focus trapping.
|
|
4
|
-
*
|
|
5
|
-
* - Delegates scroll locking to {@link useBodyScrollLock} while `open` is true.
|
|
6
|
-
* - Listens for `Escape` on `window` and calls `setOpen(false)`.
|
|
7
|
-
* - When `open` becomes true, focuses the first visible focusable inside `contentRef`, or the container itself.
|
|
8
|
-
* - Traps focus within `contentRef` via a capturing `focusin` listener on `document` that redirects focus back inside.
|
|
9
|
-
* - On close/unmount of the open effect, restores focus to the element that was focused before the trap ran.
|
|
10
|
-
*
|
|
11
|
-
* @param params.open - Whether the overlay is visible.
|
|
12
|
-
* @param params.setOpen - Setter used for Escape and cleanup paths.
|
|
13
|
-
* @param params.contentRef - Root of the dialog/drawer content (must point at a focusable container or include focusables).
|
|
14
|
-
* @param params.focusableSelector - Query selector for tabbable elements; defaults to a common interactive set.
|
|
15
|
-
*/
|
|
16
|
-
export declare const useFocusManagement: ({ open, setOpen, contentRef, focusableSelector, }: {
|
|
17
|
-
open: boolean;
|
|
18
|
-
setOpen: (open: boolean) => void;
|
|
19
|
-
contentRef: RefObject<HTMLDivElement | null>;
|
|
20
|
-
focusableSelector?: string;
|
|
21
|
-
}) => void;
|
|
22
|
-
//# sourceMappingURL=useFocusManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusManagement.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFocusManagement/useFocusManagement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAAI,mDAKhC;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,SA2CA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useHover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RefCallback } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Tracks pointer hover state for a single DOM node using `pointerenter` / `pointerleave`.
|
|
4
|
-
*
|
|
5
|
-
* When the ref target changes (or unmounts), hover is cleared so state does not stay `true` after
|
|
6
|
-
* retargeting without a `pointerleave` on the previous node.
|
|
7
|
-
*
|
|
8
|
-
* @typeParam T - HTMLElement subtype for the ref callback (e.g. `HTMLDivElement`).
|
|
9
|
-
* @returns A tuple `[setRef, hovered]` where `setRef` is a callback ref to attach to the target element
|
|
10
|
-
* and `hovered` is `true` while the pointer is over that element (primary button agnostic).
|
|
11
|
-
*/
|
|
12
|
-
export declare function useHover<T extends HTMLElement>(): [RefCallback<T>, boolean];
|
|
13
|
-
//# sourceMappingURL=useHover.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHover.d.ts","sourceRoot":"","sources":["../../../src/hooks/useHover/useHover.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGzC;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CA6B3E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useInView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RefCallback } from "react";
|
|
2
|
-
export type UseInViewParams = IntersectionObserverInit & {
|
|
3
|
-
/** When `false`, no observer is attached (useful to pause work when off-screen lists are virtualized). */
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Convenience wrapper around {@link useIntersectionObserver} that exposes only a boolean `inView` flag.
|
|
8
|
-
*
|
|
9
|
-
* `inView` is `true` when the latest `IntersectionObserverEntry.isIntersecting` is truthy; otherwise `false`.
|
|
10
|
-
* Accepts the same `root`, `rootMargin`, `threshold`, and `enabled` options as the underlying observer.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam T - Observed element type.
|
|
13
|
-
* @param params - IntersectionObserver options plus optional `enabled` flag.
|
|
14
|
-
* @returns `[setRef, inView]` callback ref and intersection boolean.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useInView<T extends Element>(params?: UseInViewParams): [RefCallback<T>, boolean];
|
|
17
|
-
//# sourceMappingURL=useInView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInView.d.ts","sourceRoot":"","sources":["../../../src/hooks/useInView/useInView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIzC,MAAM,MAAM,eAAe,GAAG,wBAAwB,GAAG;IACvD,0GAA0G;IAC1G,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EACzC,MAAM,GAAE,eAAoB,GAC3B,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAI3B"}
|