@kadoui/react 1.0.0
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/dist/components/AccessNavigation/AccessNavigation.d.ts +6 -0
- package/dist/components/AccessNavigation/AccessNavigation.d.ts.map +1 -0
- package/dist/components/AccessNavigation/AccessNavigation.jsx +26 -0
- package/dist/components/Accordion/Accordion.d.ts +8 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.js +7 -0
- package/dist/components/Accordion/AccordionBody.d.ts +4 -0
- package/dist/components/Accordion/AccordionBody.d.ts.map +1 -0
- package/dist/components/Accordion/AccordionBody.jsx +17 -0
- package/dist/components/Accordion/AccordionContext.d.ts +7 -0
- package/dist/components/Accordion/AccordionContext.d.ts.map +1 -0
- package/dist/components/Accordion/AccordionContext.js +2 -0
- package/dist/components/Accordion/AccordionRoot.d.ts +4 -0
- package/dist/components/Accordion/AccordionRoot.d.ts.map +1 -0
- package/dist/components/Accordion/AccordionRoot.jsx +9 -0
- package/dist/components/Accordion/AccordionToggle.d.ts +6 -0
- package/dist/components/Accordion/AccordionToggle.d.ts.map +1 -0
- package/dist/components/Accordion/AccordionToggle.jsx +16 -0
- package/dist/components/Affix/Affix.d.ts +4 -0
- package/dist/components/Affix/Affix.d.ts.map +1 -0
- package/dist/components/Affix/Affix.jsx +38 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +5 -0
- package/dist/components/Breadcrumbs/BreadcrumbsContext.d.ts +6 -0
- package/dist/components/Breadcrumbs/BreadcrumbsContext.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbsContext.js +2 -0
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts +6 -0
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbsItem.jsx +11 -0
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts +6 -0
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.jsx +8 -0
- package/dist/components/Carousel/Carousel.d.ts +6 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel/Carousel.js +5 -0
- package/dist/components/Carousel/CarouselContainer.d.ts +4 -0
- package/dist/components/Carousel/CarouselContainer.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselContainer.jsx +10 -0
- package/dist/components/Carousel/CarouselContext.d.ts +6 -0
- package/dist/components/Carousel/CarouselContext.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselContext.js +2 -0
- package/dist/components/Carousel/CarouselRoot.d.ts +4 -0
- package/dist/components/Carousel/CarouselRoot.d.ts.map +1 -0
- package/dist/components/Carousel/CarouselRoot.jsx +53 -0
- package/dist/components/ClientOnly/ClientOnly.d.ts +4 -0
- package/dist/components/ClientOnly/ClientOnly.d.ts.map +1 -0
- package/dist/components/ClientOnly/ClientOnly.jsx +6 -0
- package/dist/components/Clipboard/Clipboard.d.ts +7 -0
- package/dist/components/Clipboard/Clipboard.d.ts.map +1 -0
- package/dist/components/Clipboard/Clipboard.jsx +15 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +6 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.js +5 -0
- package/dist/components/ContextMenu/ContextMenuContent.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuContent.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenuContent.jsx +28 -0
- package/dist/components/ContextMenu/ContextMenuContext.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenuContext.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenuContext.js +2 -0
- package/dist/components/ContextMenu/ContextMenuRoot.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuRoot.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenuRoot.jsx +56 -0
- package/dist/components/Drawer/Drawer.d.ts +10 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.js +9 -0
- package/dist/components/Drawer/DrawerBody.d.ts +6 -0
- package/dist/components/Drawer/DrawerBody.d.ts.map +1 -0
- package/dist/components/Drawer/DrawerBody.jsx +39 -0
- package/dist/components/Drawer/DrawerContext.d.ts +7 -0
- package/dist/components/Drawer/DrawerContext.d.ts.map +1 -0
- package/dist/components/Drawer/DrawerContext.js +2 -0
- package/dist/components/Drawer/DrawerPortal.d.ts +4 -0
- package/dist/components/Drawer/DrawerPortal.d.ts.map +1 -0
- package/dist/components/Drawer/DrawerPortal.jsx +20 -0
- package/dist/components/Drawer/DrawerRoot.d.ts +4 -0
- package/dist/components/Drawer/DrawerRoot.d.ts.map +1 -0
- package/dist/components/Drawer/DrawerRoot.jsx +35 -0
- package/dist/components/Drawer/DrawerToggle.d.ts +4 -0
- package/dist/components/Drawer/DrawerToggle.d.ts.map +1 -0
- package/dist/components/Drawer/DrawerToggle.jsx +10 -0
- package/dist/components/Dropdown/Dropdown.d.ts +8 -0
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/Dropdown.js +7 -0
- package/dist/components/Dropdown/DropdownContext.d.ts +9 -0
- package/dist/components/Dropdown/DropdownContext.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownContext.js +2 -0
- package/dist/components/Dropdown/DropdownMenu.d.ts +6 -0
- package/dist/components/Dropdown/DropdownMenu.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownMenu.jsx +13 -0
- package/dist/components/Dropdown/DropdownRoot.d.ts +6 -0
- package/dist/components/Dropdown/DropdownRoot.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownRoot.jsx +65 -0
- package/dist/components/Dropdown/DropdownToggle.d.ts +4 -0
- package/dist/components/Dropdown/DropdownToggle.d.ts.map +1 -0
- package/dist/components/Dropdown/DropdownToggle.jsx +11 -0
- package/dist/components/LinkLoader/LinkLoader.d.ts +6 -0
- package/dist/components/LinkLoader/LinkLoader.d.ts.map +1 -0
- package/dist/components/LinkLoader/LinkLoader.jsx +8 -0
- package/dist/components/Modal/Modal.d.ts +14 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +13 -0
- package/dist/components/Modal/ModalBody.d.ts +4 -0
- package/dist/components/Modal/ModalBody.d.ts.map +1 -0
- package/dist/components/Modal/ModalBody.jsx +6 -0
- package/dist/components/Modal/ModalContent.d.ts +4 -0
- package/dist/components/Modal/ModalContent.d.ts.map +1 -0
- package/dist/components/Modal/ModalContent.jsx +22 -0
- package/dist/components/Modal/ModalContext.d.ts +7 -0
- package/dist/components/Modal/ModalContext.d.ts.map +1 -0
- package/dist/components/Modal/ModalContext.js +2 -0
- package/dist/components/Modal/ModalHeader.d.ts +4 -0
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -0
- package/dist/components/Modal/ModalHeader.jsx +4 -0
- package/dist/components/Modal/ModalPortal.d.ts +4 -0
- package/dist/components/Modal/ModalPortal.d.ts.map +1 -0
- package/dist/components/Modal/ModalPortal.jsx +20 -0
- package/dist/components/Modal/ModalRoot.d.ts +6 -0
- package/dist/components/Modal/ModalRoot.d.ts.map +1 -0
- package/dist/components/Modal/ModalRoot.jsx +35 -0
- package/dist/components/Modal/ModalTrigger.d.ts +4 -0
- package/dist/components/Modal/ModalTrigger.d.ts.map +1 -0
- package/dist/components/Modal/ModalTrigger.jsx +10 -0
- package/dist/components/Otp/Otp.d.ts +8 -0
- package/dist/components/Otp/Otp.d.ts.map +1 -0
- package/dist/components/Otp/Otp.js +7 -0
- package/dist/components/Otp/OtpContext.d.ts +7 -0
- package/dist/components/Otp/OtpContext.d.ts.map +1 -0
- package/dist/components/Otp/OtpContext.js +4 -0
- package/dist/components/Otp/OtpHiddenInput.d.ts +4 -0
- package/dist/components/Otp/OtpHiddenInput.d.ts.map +1 -0
- package/dist/components/Otp/OtpHiddenInput.jsx +7 -0
- package/dist/components/Otp/OtpInputs.d.ts +7 -0
- package/dist/components/Otp/OtpInputs.d.ts.map +1 -0
- package/dist/components/Otp/OtpInputs.jsx +55 -0
- package/dist/components/Otp/OtpRoot.d.ts +4 -0
- package/dist/components/Otp/OtpRoot.d.ts.map +1 -0
- package/dist/components/Otp/OtpRoot.jsx +16 -0
- package/dist/components/Pagination/Pagination.d.ts +16 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +12 -0
- package/dist/components/Pagination/PaginationContext.d.ts +8 -0
- package/dist/components/Pagination/PaginationContext.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationContext.jsx +2 -0
- package/dist/components/Pagination/PaginationCounts.d.ts +4 -0
- package/dist/components/Pagination/PaginationCounts.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationCounts.jsx +9 -0
- package/dist/components/Pagination/PaginationNextBtn.d.ts +6 -0
- package/dist/components/Pagination/PaginationNextBtn.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationNextBtn.jsx +13 -0
- package/dist/components/Pagination/PaginationPrevBtn.d.ts +6 -0
- package/dist/components/Pagination/PaginationPrevBtn.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationPrevBtn.jsx +13 -0
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts +7 -0
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationSearchParamsRoot.jsx +30 -0
- package/dist/components/Pagination/PaginationStateRoot.d.ts +6 -0
- package/dist/components/Pagination/PaginationStateRoot.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationStateRoot.jsx +11 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +8 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.js +7 -0
- package/dist/components/PasswordInput/PasswordInputContext.d.ts +7 -0
- package/dist/components/PasswordInput/PasswordInputContext.d.ts.map +1 -0
- package/dist/components/PasswordInput/PasswordInputContext.jsx +2 -0
- package/dist/components/PasswordInput/PasswordInputField.d.ts +4 -0
- package/dist/components/PasswordInput/PasswordInputField.d.ts.map +1 -0
- package/dist/components/PasswordInput/PasswordInputField.jsx +7 -0
- package/dist/components/PasswordInput/PasswordInputRoot.d.ts +4 -0
- package/dist/components/PasswordInput/PasswordInputRoot.d.ts.map +1 -0
- package/dist/components/PasswordInput/PasswordInputRoot.jsx +9 -0
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts +4 -0
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts.map +1 -0
- package/dist/components/PasswordInput/PasswordInputToggle.jsx +20 -0
- package/dist/components/Portal/Portal.d.ts +6 -0
- package/dist/components/Portal/Portal.d.ts.map +1 -0
- package/dist/components/Portal/Portal.jsx +7 -0
- package/dist/components/Progress/Progress.d.ts +6 -0
- package/dist/components/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Progress/Progress.js +5 -0
- package/dist/components/Progress/ProgressBar.d.ts +6 -0
- package/dist/components/Progress/ProgressBar.d.ts.map +1 -0
- package/dist/components/Progress/ProgressBar.jsx +12 -0
- package/dist/components/Progress/ProgressContext.d.ts +6 -0
- package/dist/components/Progress/ProgressContext.d.ts.map +1 -0
- package/dist/components/Progress/ProgressContext.js +2 -0
- package/dist/components/Progress/ProgressRoot.d.ts +7 -0
- package/dist/components/Progress/ProgressRoot.d.ts.map +1 -0
- package/dist/components/Progress/ProgressRoot.jsx +8 -0
- package/dist/components/QrCode/QrCode.d.ts +8 -0
- package/dist/components/QrCode/QrCode.d.ts.map +1 -0
- package/dist/components/QrCode/QrCode.jsx +14 -0
- package/dist/components/Rating/Rating.d.ts +5 -0
- package/dist/components/Rating/Rating.d.ts.map +1 -0
- package/dist/components/Rating/Rating.js +5 -0
- package/dist/components/Rating/RatingContext.d.ts +7 -0
- package/dist/components/Rating/RatingContext.d.ts.map +1 -0
- package/dist/components/Rating/RatingContext.js +2 -0
- package/dist/components/Rating/RatingItems.d.ts +10 -0
- package/dist/components/Rating/RatingItems.d.ts.map +1 -0
- package/dist/components/Rating/RatingItems.jsx +18 -0
- package/dist/components/Rating/RatingRoot.d.ts +4 -0
- package/dist/components/Rating/RatingRoot.d.ts.map +1 -0
- package/dist/components/Rating/RatingRoot.jsx +10 -0
- package/dist/components/Sheet/Sheet.d.ts +14 -0
- package/dist/components/Sheet/Sheet.d.ts.map +1 -0
- package/dist/components/Sheet/Sheet.jsx +13 -0
- package/dist/components/Sheet/SheetBody.d.ts +4 -0
- package/dist/components/Sheet/SheetBody.d.ts.map +1 -0
- package/dist/components/Sheet/SheetBody.jsx +21 -0
- package/dist/components/Sheet/SheetContent.d.ts +4 -0
- package/dist/components/Sheet/SheetContent.d.ts.map +1 -0
- package/dist/components/Sheet/SheetContent.jsx +4 -0
- package/dist/components/Sheet/SheetContext.d.ts +13 -0
- package/dist/components/Sheet/SheetContext.d.ts.map +1 -0
- package/dist/components/Sheet/SheetContext.js +2 -0
- package/dist/components/Sheet/SheetHeader.d.ts +4 -0
- package/dist/components/Sheet/SheetHeader.d.ts.map +1 -0
- package/dist/components/Sheet/SheetHeader.jsx +10 -0
- package/dist/components/Sheet/SheetPortal.d.ts +4 -0
- package/dist/components/Sheet/SheetPortal.d.ts.map +1 -0
- package/dist/components/Sheet/SheetPortal.jsx +17 -0
- package/dist/components/Sheet/SheetRoot.d.ts +4 -0
- package/dist/components/Sheet/SheetRoot.d.ts.map +1 -0
- package/dist/components/Sheet/SheetRoot.jsx +37 -0
- package/dist/components/Sheet/SheetToggle.d.ts +4 -0
- package/dist/components/Sheet/SheetToggle.d.ts.map +1 -0
- package/dist/components/Sheet/SheetToggle.jsx +10 -0
- package/dist/components/ShowMore/ShowMore.d.ts +10 -0
- package/dist/components/ShowMore/ShowMore.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMore.js +9 -0
- package/dist/components/ShowMore/ShowMoreContent.d.ts +4 -0
- package/dist/components/ShowMore/ShowMoreContent.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMoreContent.jsx +18 -0
- package/dist/components/ShowMore/ShowMoreContext.d.ts +10 -0
- package/dist/components/ShowMore/ShowMoreContext.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMoreContext.js +2 -0
- package/dist/components/ShowMore/ShowMoreFade.d.ts +4 -0
- package/dist/components/ShowMore/ShowMoreFade.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMoreFade.jsx +8 -0
- package/dist/components/ShowMore/ShowMoreRoot.d.ts +7 -0
- package/dist/components/ShowMore/ShowMoreRoot.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMoreRoot.jsx +23 -0
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts +4 -0
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts.map +1 -0
- package/dist/components/ShowMore/ShowMoreTrigger.jsx +11 -0
- package/dist/components/Slide/Slide.d.ts +12 -0
- package/dist/components/Slide/Slide.d.ts.map +1 -0
- package/dist/components/Slide/Slide.js +11 -0
- package/dist/components/Slide/SlideContent.d.ts +4 -0
- package/dist/components/Slide/SlideContent.d.ts.map +1 -0
- package/dist/components/Slide/SlideContent.jsx +4 -0
- package/dist/components/Slide/SlideContext.d.ts +7 -0
- package/dist/components/Slide/SlideContext.d.ts.map +1 -0
- package/dist/components/Slide/SlideContext.js +5 -0
- package/dist/components/Slide/SlideHeader.d.ts +4 -0
- package/dist/components/Slide/SlideHeader.d.ts.map +1 -0
- package/dist/components/Slide/SlideHeader.jsx +4 -0
- package/dist/components/Slide/SlidePortal.d.ts +4 -0
- package/dist/components/Slide/SlidePortal.d.ts.map +1 -0
- package/dist/components/Slide/SlidePortal.jsx +11 -0
- package/dist/components/Slide/SlideRoot.d.ts +4 -0
- package/dist/components/Slide/SlideRoot.d.ts.map +1 -0
- package/dist/components/Slide/SlideRoot.jsx +30 -0
- package/dist/components/Slide/SlideToggle.d.ts +4 -0
- package/dist/components/Slide/SlideToggle.d.ts.map +1 -0
- package/dist/components/Slide/SlideToggle.jsx +10 -0
- package/dist/components/Spoiler/Spoiler.d.ts +6 -0
- package/dist/components/Spoiler/Spoiler.d.ts.map +1 -0
- package/dist/components/Spoiler/Spoiler.jsx +11 -0
- package/dist/components/Steps/Steps.d.ts +16 -0
- package/dist/components/Steps/Steps.d.ts.map +1 -0
- package/dist/components/Steps/Steps.js +12 -0
- package/dist/components/Steps/StepsContext.d.ts +14 -0
- package/dist/components/Steps/StepsContext.d.ts.map +1 -0
- package/dist/components/Steps/StepsContext.jsx +2 -0
- package/dist/components/Steps/StepsControls.d.ts +4 -0
- package/dist/components/Steps/StepsControls.d.ts.map +1 -0
- package/dist/components/Steps/StepsControls.jsx +34 -0
- package/dist/components/Steps/StepsNextBtn.d.ts +6 -0
- package/dist/components/Steps/StepsNextBtn.d.ts.map +1 -0
- package/dist/components/Steps/StepsNextBtn.jsx +13 -0
- package/dist/components/Steps/StepsPrevBtn.d.ts +6 -0
- package/dist/components/Steps/StepsPrevBtn.d.ts.map +1 -0
- package/dist/components/Steps/StepsPrevBtn.jsx +13 -0
- package/dist/components/Steps/StepsSearchParamsRoot.d.ts +8 -0
- package/dist/components/Steps/StepsSearchParamsRoot.d.ts.map +1 -0
- package/dist/components/Steps/StepsSearchParamsRoot.jsx +30 -0
- package/dist/components/Steps/StepsStateRoot.d.ts +7 -0
- package/dist/components/Steps/StepsStateRoot.d.ts.map +1 -0
- package/dist/components/Steps/StepsStateRoot.jsx +11 -0
- package/dist/components/Swap/Swap.d.ts +8 -0
- package/dist/components/Swap/Swap.d.ts.map +1 -0
- package/dist/components/Swap/Swap.js +7 -0
- package/dist/components/Swap/SwapContext.d.ts +7 -0
- package/dist/components/Swap/SwapContext.d.ts.map +1 -0
- package/dist/components/Swap/SwapContext.js +2 -0
- package/dist/components/Swap/SwapItem.d.ts +4 -0
- package/dist/components/Swap/SwapItem.d.ts.map +1 -0
- package/dist/components/Swap/SwapItem.jsx +5 -0
- package/dist/components/Swap/SwapRoot.d.ts +8 -0
- package/dist/components/Swap/SwapRoot.d.ts.map +1 -0
- package/dist/components/Swap/SwapRoot.jsx +16 -0
- package/dist/components/Swap/SwapTrigger.d.ts +6 -0
- package/dist/components/Swap/SwapTrigger.d.ts.map +1 -0
- package/dist/components/Swap/SwapTrigger.jsx +16 -0
- package/dist/components/Tabs/Tabs.d.ts +10 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +9 -0
- package/dist/components/Tabs/TabsContext.d.ts +7 -0
- package/dist/components/Tabs/TabsContext.d.ts.map +1 -0
- package/dist/components/Tabs/TabsContext.js +5 -0
- package/dist/components/Tabs/TabsList.d.ts +4 -0
- package/dist/components/Tabs/TabsList.d.ts.map +1 -0
- package/dist/components/Tabs/TabsList.jsx +5 -0
- package/dist/components/Tabs/TabsPanel.d.ts +6 -0
- package/dist/components/Tabs/TabsPanel.d.ts.map +1 -0
- package/dist/components/Tabs/TabsPanel.jsx +9 -0
- package/dist/components/Tabs/TabsRoot.d.ts +7 -0
- package/dist/components/Tabs/TabsRoot.d.ts.map +1 -0
- package/dist/components/Tabs/TabsRoot.jsx +7 -0
- package/dist/components/Tabs/TabsTab.d.ts +6 -0
- package/dist/components/Tabs/TabsTab.d.ts.map +1 -0
- package/dist/components/Tabs/TabsTab.jsx +10 -0
- package/dist/components/Toast/Toast.d.ts +4 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +3 -0
- package/dist/components/Toast/ToastBox.d.ts +6 -0
- package/dist/components/Toast/ToastBox.d.ts.map +1 -0
- package/dist/components/Toast/ToastBox.jsx +32 -0
- package/dist/components/Toast/ToastRoot.d.ts +15 -0
- package/dist/components/Toast/ToastRoot.d.ts.map +1 -0
- package/dist/components/Toast/ToastRoot.jsx +38 -0
- package/dist/components/Toast/toastStore.d.ts +11 -0
- package/dist/components/Toast/toastStore.d.ts.map +1 -0
- package/dist/components/Toast/toastStore.js +10 -0
- package/dist/components/Toggle/Toggle.d.ts +6 -0
- package/dist/components/Toggle/Toggle.d.ts.map +1 -0
- package/dist/components/Toggle/Toggle.js +5 -0
- package/dist/components/Toggle/ToggleContext.d.ts +8 -0
- package/dist/components/Toggle/ToggleContext.d.ts.map +1 -0
- package/dist/components/Toggle/ToggleContext.js +2 -0
- package/dist/components/Toggle/ToggleRoot.d.ts +8 -0
- package/dist/components/Toggle/ToggleRoot.d.ts.map +1 -0
- package/dist/components/Toggle/ToggleRoot.jsx +13 -0
- package/dist/components/Toggle/ToggleSwitch.d.ts +4 -0
- package/dist/components/Toggle/ToggleSwitch.d.ts.map +1 -0
- package/dist/components/Toggle/ToggleSwitch.jsx +23 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/package.json +43 -0
- package/src/components/AccessNavigation/AccessNavigation.tsx +46 -0
- package/src/components/Accordion/Accordion.ts +8 -0
- package/src/components/Accordion/AccordionBody.tsx +31 -0
- package/src/components/Accordion/AccordionContext.ts +8 -0
- package/src/components/Accordion/AccordionRoot.tsx +17 -0
- package/src/components/Accordion/AccordionToggle.tsx +29 -0
- package/src/components/Affix/Affix.tsx +59 -0
- package/src/components/Breadcrumbs/Breadcrumbs.ts +6 -0
- package/src/components/Breadcrumbs/BreadcrumbsContext.ts +7 -0
- package/src/components/Breadcrumbs/BreadcrumbsItem.tsx +24 -0
- package/src/components/Breadcrumbs/BreadcrumbsRoot.tsx +21 -0
- package/src/components/Carousel/Carousel.ts +6 -0
- package/src/components/Carousel/CarouselContainer.tsx +18 -0
- package/src/components/Carousel/CarouselContext.ts +7 -0
- package/src/components/Carousel/CarouselRoot.tsx +75 -0
- package/src/components/ClientOnly/ClientOnly.tsx +12 -0
- package/src/components/Clipboard/Clipboard.tsx +36 -0
- package/src/components/ContextMenu/ContextMenu.ts +6 -0
- package/src/components/ContextMenu/ContextMenuContent.tsx +51 -0
- package/src/components/ContextMenu/ContextMenuContext.ts +9 -0
- package/src/components/ContextMenu/ContextMenuRoot.tsx +79 -0
- package/src/components/Drawer/Drawer.ts +10 -0
- package/src/components/Drawer/DrawerBody.tsx +67 -0
- package/src/components/Drawer/DrawerContext.ts +8 -0
- package/src/components/Drawer/DrawerPortal.tsx +40 -0
- package/src/components/Drawer/DrawerRoot.tsx +45 -0
- package/src/components/Drawer/DrawerToggle.tsx +21 -0
- package/src/components/Dropdown/Dropdown.ts +8 -0
- package/src/components/Dropdown/DropdownContext.ts +10 -0
- package/src/components/Dropdown/DropdownMenu.tsx +34 -0
- package/src/components/Dropdown/DropdownRoot.tsx +90 -0
- package/src/components/Dropdown/DropdownToggle.tsx +23 -0
- package/src/components/LinkLoader/LinkLoader.tsx +16 -0
- package/src/components/Modal/Modal.ts +14 -0
- package/src/components/Modal/ModalBody.tsx +12 -0
- package/src/components/Modal/ModalContent.tsx +44 -0
- package/src/components/Modal/ModalContext.ts +8 -0
- package/src/components/Modal/ModalHeader.tsx +10 -0
- package/src/components/Modal/ModalPortal.tsx +40 -0
- package/src/components/Modal/ModalRoot.tsx +47 -0
- package/src/components/Modal/ModalTrigger.tsx +21 -0
- package/src/components/Otp/Otp.ts +8 -0
- package/src/components/Otp/OtpContext.ts +10 -0
- package/src/components/Otp/OtpHiddenInput.tsx +15 -0
- package/src/components/Otp/OtpInputs.tsx +86 -0
- package/src/components/Otp/OtpRoot.tsx +26 -0
- package/src/components/Pagination/Pagination.ts +15 -0
- package/src/components/Pagination/PaginationContext.tsx +10 -0
- package/src/components/Pagination/PaginationCounts.tsx +17 -0
- package/src/components/Pagination/PaginationNextBtn.tsx +27 -0
- package/src/components/Pagination/PaginationPrevBtn.tsx +27 -0
- package/src/components/Pagination/PaginationSearchParamsRoot.tsx +45 -0
- package/src/components/Pagination/PaginationStateRoot.tsx +23 -0
- package/src/components/PasswordInput/PasswordInput.ts +8 -0
- package/src/components/PasswordInput/PasswordInputContext.tsx +8 -0
- package/src/components/PasswordInput/PasswordInputField.tsx +15 -0
- package/src/components/PasswordInput/PasswordInputRoot.tsx +17 -0
- package/src/components/PasswordInput/PasswordInputToggle.tsx +52 -0
- package/src/components/Portal/Portal.tsx +17 -0
- package/src/components/Progress/Progress.ts +6 -0
- package/src/components/Progress/ProgressBar.tsx +29 -0
- package/src/components/Progress/ProgressContext.ts +8 -0
- package/src/components/Progress/ProgressRoot.tsx +22 -0
- package/src/components/QrCode/QrCode.tsx +22 -0
- package/src/components/Rating/Rating.ts +6 -0
- package/src/components/Rating/RatingContext.ts +8 -0
- package/src/components/Rating/RatingItems.tsx +50 -0
- package/src/components/Rating/RatingRoot.tsx +22 -0
- package/src/components/Sheet/Sheet.tsx +14 -0
- package/src/components/Sheet/SheetBody.tsx +49 -0
- package/src/components/Sheet/SheetContent.tsx +8 -0
- package/src/components/Sheet/SheetContext.ts +14 -0
- package/src/components/Sheet/SheetHeader.tsx +24 -0
- package/src/components/Sheet/SheetPortal.tsx +35 -0
- package/src/components/Sheet/SheetRoot.tsx +56 -0
- package/src/components/Sheet/SheetToggle.tsx +21 -0
- package/src/components/ShowMore/ShowMore.ts +10 -0
- package/src/components/ShowMore/ShowMoreContent.tsx +31 -0
- package/src/components/ShowMore/ShowMoreContext.ts +11 -0
- package/src/components/ShowMore/ShowMoreFade.tsx +18 -0
- package/src/components/ShowMore/ShowMoreRoot.tsx +37 -0
- package/src/components/ShowMore/ShowMoreTrigger.tsx +23 -0
- package/src/components/Slide/Slide.ts +12 -0
- package/src/components/Slide/SlideContent.tsx +8 -0
- package/src/components/Slide/SlideContext.ts +11 -0
- package/src/components/Slide/SlideHeader.tsx +10 -0
- package/src/components/Slide/SlidePortal.tsx +26 -0
- package/src/components/Slide/SlideRoot.tsx +39 -0
- package/src/components/Slide/SlideToggle.tsx +21 -0
- package/src/components/Spoiler/Spoiler.tsx +28 -0
- package/src/components/Steps/Steps.ts +15 -0
- package/src/components/Steps/StepsContext.tsx +16 -0
- package/src/components/Steps/StepsControls.tsx +56 -0
- package/src/components/Steps/StepsNextBtn.tsx +27 -0
- package/src/components/Steps/StepsPrevBtn.tsx +27 -0
- package/src/components/Steps/StepsSearchParamsRoot.tsx +45 -0
- package/src/components/Steps/StepsStateRoot.tsx +23 -0
- package/src/components/Swap/Swap.ts +8 -0
- package/src/components/Swap/SwapContext.ts +9 -0
- package/src/components/Swap/SwapItem.tsx +16 -0
- package/src/components/Swap/SwapRoot.tsx +29 -0
- package/src/components/Swap/SwapTrigger.tsx +31 -0
- package/src/components/Tabs/Tabs.ts +10 -0
- package/src/components/Tabs/TabsContext.ts +11 -0
- package/src/components/Tabs/TabsList.tsx +12 -0
- package/src/components/Tabs/TabsPanel.tsx +23 -0
- package/src/components/Tabs/TabsRoot.tsx +18 -0
- package/src/components/Tabs/TabsTab.tsx +23 -0
- package/src/components/Toast/Toast.ts +3 -0
- package/src/components/Toast/ToastBox.tsx +50 -0
- package/src/components/Toast/ToastRoot.tsx +71 -0
- package/src/components/Toast/toastStore.ts +22 -0
- package/src/components/Toggle/Toggle.ts +6 -0
- package/src/components/Toggle/ToggleContext.ts +9 -0
- package/src/components/Toggle/ToggleRoot.tsx +26 -0
- package/src/components/Toggle/ToggleSwitch.tsx +41 -0
- package/src/index.ts +28 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren } from "react";
|
|
4
|
+
import { useMounted } from "@mantine/hooks";
|
|
5
|
+
|
|
6
|
+
export type ClientOnlyPropsT = PropsWithChildren;
|
|
7
|
+
|
|
8
|
+
export function ClientOnly({ children }: ClientOnlyPropsT) {
|
|
9
|
+
const mounted = useMounted();
|
|
10
|
+
|
|
11
|
+
return mounted ? children : null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { CopyCheckIcon, CopyIcon } from "lucide-react";
|
|
4
|
+
import { ButtonHTMLAttributes, MouseEvent } from "react";
|
|
5
|
+
|
|
6
|
+
import { useClipboard } from "@mantine/hooks";
|
|
7
|
+
|
|
8
|
+
export type ClipboardPropsT = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
+
text: string;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function Clipboard({ onClick, children, text, timeout = 3_000, ...props }: ClipboardPropsT) {
|
|
14
|
+
const { copy, copied } = useClipboard({ timeout });
|
|
15
|
+
|
|
16
|
+
const handleClick = (ev: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>) => {
|
|
17
|
+
onClick?.(ev);
|
|
18
|
+
copy(text.trim());
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<button
|
|
23
|
+
aria-label={text}
|
|
24
|
+
onClick={handleClick}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{copied ? (
|
|
28
|
+
<CopyCheckIcon className="compatible-icon" />
|
|
29
|
+
) : (
|
|
30
|
+
<CopyIcon className="compatible-icon" />
|
|
31
|
+
)}
|
|
32
|
+
|
|
33
|
+
{children}
|
|
34
|
+
</button>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { HTMLAttributes, use, useEffect } from "react";
|
|
4
|
+
import { cn, selectAccessibleChildren } from "@kadoui/utils";
|
|
5
|
+
|
|
6
|
+
import { ContextMenuContext } from "./ContextMenuContext";
|
|
7
|
+
|
|
8
|
+
export type ContextMenuContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
|
|
10
|
+
export function ContextMenuContent({ onContextMenu, className, ...p }: ContextMenuContentPropsT) {
|
|
11
|
+
const { contentRef, position, isOpen } = use(ContextMenuContext);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!contentRef.current) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (isOpen) {
|
|
19
|
+
const children = selectAccessibleChildren(contentRef.current);
|
|
20
|
+
const firstChild = children[0];
|
|
21
|
+
|
|
22
|
+
if (!firstChild) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
firstChild.focus();
|
|
27
|
+
}
|
|
28
|
+
}, [isOpen, position, contentRef])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
ref={contentRef}
|
|
33
|
+
onContextMenu={ev => {
|
|
34
|
+
ev.stopPropagation();
|
|
35
|
+
ev.preventDefault();
|
|
36
|
+
onContextMenu?.(ev);
|
|
37
|
+
}}
|
|
38
|
+
className={cn(
|
|
39
|
+
"z-50 fixed",
|
|
40
|
+
position ? "transition-all" : "",
|
|
41
|
+
isOpen ? "" : "hidden",
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
style={{
|
|
45
|
+
top: position?.y,
|
|
46
|
+
left: position?.x,
|
|
47
|
+
}}
|
|
48
|
+
{...p}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext, RefObject } from 'react'
|
|
2
|
+
|
|
3
|
+
export type ContextMenuContextT = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
position: { x: number, y: number } | undefined;
|
|
6
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const ContextMenuContext = createContext<ContextMenuContextT>({} as ContextMenuContextT);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { getBrowserScrollbarWith } from "@kadoui/utils";
|
|
4
|
+
import { HTMLAttributes, MouseEvent, useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { ContextMenuContext, ContextMenuContextT } from "./ContextMenuContext";
|
|
7
|
+
|
|
8
|
+
export type ContextMenuRootPropsT = HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
|
|
10
|
+
export function ContextMenuRoot({ onContextMenu, ...p }: ContextMenuRootPropsT) {
|
|
11
|
+
const [position, setPosition] = useState<ContextMenuContextT["position"]>(undefined);
|
|
12
|
+
const [isOpen, setOpen] = useState(false);
|
|
13
|
+
|
|
14
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
15
|
+
|
|
16
|
+
const handleClickOutside = useCallback((ev: globalThis.MouseEvent) => {
|
|
17
|
+
if (!contentRef.current?.contains(ev.target as Node)) {
|
|
18
|
+
setOpen(false);
|
|
19
|
+
setPosition(undefined);
|
|
20
|
+
}
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
document.addEventListener("click", handleClickOutside);
|
|
25
|
+
|
|
26
|
+
return () => document.removeEventListener("click", handleClickOutside);
|
|
27
|
+
}, [handleClickOutside]);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const scrollbarWidth = getBrowserScrollbarWith();
|
|
31
|
+
|
|
32
|
+
if (isOpen) {
|
|
33
|
+
document.body.style.overflow = "hidden";
|
|
34
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
35
|
+
} else {
|
|
36
|
+
document.body.style.overflow = "unset";
|
|
37
|
+
document.body.style.paddingRight = "0px";
|
|
38
|
+
};
|
|
39
|
+
}, [isOpen]);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
const handleContextMenu = (ev: MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => {
|
|
43
|
+
if (!contentRef.current) return;
|
|
44
|
+
|
|
45
|
+
ev.preventDefault();
|
|
46
|
+
|
|
47
|
+
const viewportWidth = window.innerWidth;
|
|
48
|
+
const viewportHeight = window.innerHeight;
|
|
49
|
+
|
|
50
|
+
const menuWidth = contentRef.current.scrollWidth;
|
|
51
|
+
const menuHeight = contentRef.current.scrollHeight;
|
|
52
|
+
|
|
53
|
+
let x = ev.clientX;
|
|
54
|
+
let y = ev.clientY;
|
|
55
|
+
|
|
56
|
+
if (x + menuWidth > viewportWidth) {
|
|
57
|
+
x = viewportWidth - menuWidth - 10;
|
|
58
|
+
}
|
|
59
|
+
if (y + menuHeight > viewportHeight) {
|
|
60
|
+
y = viewportHeight - menuHeight - 10;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setPosition({ x, y });
|
|
64
|
+
setOpen(true);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<ContextMenuContext value={{ contentRef, isOpen, position }}>
|
|
70
|
+
<div
|
|
71
|
+
onContextMenu={ev => {
|
|
72
|
+
onContextMenu?.(ev);
|
|
73
|
+
handleContextMenu(ev);
|
|
74
|
+
}}
|
|
75
|
+
{...p}
|
|
76
|
+
/>
|
|
77
|
+
</ContextMenuContext>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DrawerBody } from "./DrawerBody";
|
|
2
|
+
import { DrawerRoot } from "./DrawerRoot";
|
|
3
|
+
import { DrawerPortal } from "./DrawerPortal";
|
|
4
|
+
import { DrawerToggle } from "./DrawerToggle";
|
|
5
|
+
|
|
6
|
+
export const Drawer = Object.assign(DrawerRoot, {
|
|
7
|
+
Toggle: DrawerToggle,
|
|
8
|
+
Portal: DrawerPortal,
|
|
9
|
+
Body: DrawerBody
|
|
10
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { motion, HTMLMotionProps } from "framer-motion";
|
|
5
|
+
import { ReactNode, use, useEffect, useRef } from "react";
|
|
6
|
+
|
|
7
|
+
import { DrawerContext } from "./DrawerContext";
|
|
8
|
+
|
|
9
|
+
export type DrawerBodyPropsT = HTMLMotionProps<"div"> & {
|
|
10
|
+
position?: "top" | "right" | "bottom" | "left";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function DrawerBody({ position, dir, children, className, ...props }: DrawerBodyPropsT) {
|
|
14
|
+
const { isOpen } = use(DrawerContext);
|
|
15
|
+
|
|
16
|
+
const bodyRef = useRef<HTMLDivElement>(null);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (isOpen) {
|
|
20
|
+
const indexElement = bodyRef.current?.querySelector("[data-drawer='index']") as HTMLElement | null | undefined;
|
|
21
|
+
indexElement?.focus();
|
|
22
|
+
};
|
|
23
|
+
}, [isOpen]);
|
|
24
|
+
|
|
25
|
+
const currentDir: "ltr" | "rtl" = (dir || document.documentElement.getAttribute("dir") || "ltr") as ("ltr" | "rtl");
|
|
26
|
+
const currentPosition = position || (currentDir === "ltr" ? "left" : "right");
|
|
27
|
+
const direction = ["right", "left"].includes(currentPosition) ? "y" : "x";
|
|
28
|
+
|
|
29
|
+
const width = direction === "y" ? "clamp(300px,30%,30%)" : undefined;
|
|
30
|
+
const height = direction === "y" ? undefined : "50%";
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<motion.div
|
|
34
|
+
ref={bodyRef}
|
|
35
|
+
onClick={ev => ev.stopPropagation()}
|
|
36
|
+
className={cn("absolute bg-background p-3 overflow-y-auto", className)}
|
|
37
|
+
initial={
|
|
38
|
+
direction === "y"
|
|
39
|
+
? { x: currentPosition === "left" ? "-100%" : "100%" }
|
|
40
|
+
: { y: currentPosition === "top" ? "-100%" : "100%" }
|
|
41
|
+
}
|
|
42
|
+
animate={{ y: 0, x: 0 }}
|
|
43
|
+
exit={
|
|
44
|
+
direction === "y"
|
|
45
|
+
? { x: currentPosition === "left" ? "-100%" : "100%" }
|
|
46
|
+
: { y: currentPosition === "top" ? "-100%" : "100%" }
|
|
47
|
+
}
|
|
48
|
+
style={{
|
|
49
|
+
width,
|
|
50
|
+
height,
|
|
51
|
+
...(
|
|
52
|
+
currentPosition === "top"
|
|
53
|
+
? { top: 0, left: 0, right: 0 }
|
|
54
|
+
: currentPosition === "right"
|
|
55
|
+
? { top: 0, bottom: 0, right: 0 }
|
|
56
|
+
: currentPosition === "bottom"
|
|
57
|
+
? { bottom: 0, left: 0, right: 0 }
|
|
58
|
+
: { top: 0, bottom: 0, left: 0 }
|
|
59
|
+
)
|
|
60
|
+
}}
|
|
61
|
+
transition={{ ease: "easeInOut" }}
|
|
62
|
+
{...props}
|
|
63
|
+
>
|
|
64
|
+
{children as ReactNode}
|
|
65
|
+
</motion.div>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { cn } from "@kadoui/utils";
|
|
5
|
+
import { motion, AnimatePresence, HTMLMotionProps } from "framer-motion";
|
|
6
|
+
|
|
7
|
+
import { Portal } from "../Portal/Portal";
|
|
8
|
+
import { DrawerContext } from "./DrawerContext";
|
|
9
|
+
import { ClientOnly } from "../ClientOnly/ClientOnly";
|
|
10
|
+
|
|
11
|
+
export type DrawerPortalPropsT = HTMLMotionProps<"div">;
|
|
12
|
+
|
|
13
|
+
export function DrawerPortal({ onClick, className, ...props }: DrawerPortalPropsT) {
|
|
14
|
+
const { isOpen, setOpen } = use(DrawerContext);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<ClientOnly>
|
|
18
|
+
<Portal>
|
|
19
|
+
<AnimatePresence>
|
|
20
|
+
{isOpen ? (
|
|
21
|
+
<motion.div
|
|
22
|
+
initial={{ opacity: 0 }}
|
|
23
|
+
animate={{ opacity: 1 }}
|
|
24
|
+
exit={{ opacity: 0 }}
|
|
25
|
+
onClick={ev => {
|
|
26
|
+
onClick?.(ev);
|
|
27
|
+
setOpen(false);
|
|
28
|
+
}}
|
|
29
|
+
className={cn(
|
|
30
|
+
"fixed inset-0 z-50 bg-foreground/50",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
) : null}
|
|
36
|
+
</AnimatePresence>
|
|
37
|
+
</Portal>
|
|
38
|
+
</ClientOnly>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { getBrowserScrollbarWith } from "@kadoui/utils";
|
|
4
|
+
import { useState, useEffect, PropsWithChildren } from "react";
|
|
5
|
+
|
|
6
|
+
import { DrawerContext } from "./DrawerContext";
|
|
7
|
+
|
|
8
|
+
export type DrawerRootPropsT = PropsWithChildren;
|
|
9
|
+
|
|
10
|
+
export function DrawerRoot({ children }: DrawerRootPropsT) {
|
|
11
|
+
const [isOpen, setOpen] = useState(false);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const handleEscape = (ev: KeyboardEvent) => {
|
|
15
|
+
if (ev.key === "Escape") {
|
|
16
|
+
setOpen(false);
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
document.addEventListener("keydown", handleEscape);
|
|
21
|
+
|
|
22
|
+
return () => {
|
|
23
|
+
document.removeEventListener("keydown", handleEscape);
|
|
24
|
+
document.body.style.overflow = "unset";
|
|
25
|
+
};
|
|
26
|
+
}, [])
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const scrollbarWidth = getBrowserScrollbarWith();
|
|
30
|
+
|
|
31
|
+
if (isOpen) {
|
|
32
|
+
document.body.style.overflow = "hidden";
|
|
33
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
34
|
+
} else {
|
|
35
|
+
document.body.style.overflow = "unset";
|
|
36
|
+
document.body.style.paddingRight = "0px";
|
|
37
|
+
};
|
|
38
|
+
}, [isOpen]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<DrawerContext value={{ isOpen, setOpen }}>
|
|
42
|
+
{children}
|
|
43
|
+
</DrawerContext>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ButtonHTMLAttributes, use } from "react";
|
|
4
|
+
|
|
5
|
+
import { DrawerContext } from "./DrawerContext";
|
|
6
|
+
|
|
7
|
+
export type DrawerTogglePropsT = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
|
|
9
|
+
export function DrawerToggle({ onClick, ...props }: DrawerTogglePropsT) {
|
|
10
|
+
const { setOpen } = use(DrawerContext);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<button
|
|
14
|
+
onClick={(ev) => {
|
|
15
|
+
onClick?.(ev);
|
|
16
|
+
setOpen(prev => !prev);
|
|
17
|
+
}}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, Dispatch, RefObject, SetStateAction } from "react";
|
|
2
|
+
|
|
3
|
+
export type DropdownContextT = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
toggleRef: RefObject<HTMLButtonElement | null>;
|
|
7
|
+
menuRef: RefObject<HTMLDivElement | null>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const DropdownContext = createContext<DropdownContextT>({} as DropdownContextT);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { HTMLAttributes, use } from "react";
|
|
5
|
+
|
|
6
|
+
import { DropdownContext } from "./DropdownContext";
|
|
7
|
+
|
|
8
|
+
export type DropdownMenuPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
preventClose?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function DropdownMenu({ preventClose, onClick, className, ...p }: DropdownMenuPropsT) {
|
|
13
|
+
const { menuRef, isOpen } = use(DropdownContext);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
isOpen ? (
|
|
17
|
+
<div
|
|
18
|
+
ref={menuRef}
|
|
19
|
+
onClick={ev => {
|
|
20
|
+
if (preventClose) {
|
|
21
|
+
ev.stopPropagation();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
onClick?.(ev);
|
|
25
|
+
}}
|
|
26
|
+
className={cn(
|
|
27
|
+
"absolute w-max z-10",
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...p}
|
|
31
|
+
/>
|
|
32
|
+
) : null
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn, selectAccessibleChildren } from "@kadoui/utils";
|
|
4
|
+
import { HTMLAttributes, KeyboardEvent, useEffect, useRef, useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { DropdownContext } from "./DropdownContext";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export type DropdownRootPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
accessHorizontalArrows?: "ArrowRight" | "ArrowLeft";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function DropdownRoot({ accessHorizontalArrows, onKeyDown, className, ...p }: DropdownRootPropsT) {
|
|
14
|
+
const [isOpen, setOpen] = useState(false);
|
|
15
|
+
|
|
16
|
+
const toggleRef = useRef<HTMLButtonElement>(null);
|
|
17
|
+
const menuRef = useRef<HTMLDivElement>(null);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const closeHandler = () => {
|
|
21
|
+
setOpen(false);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
window.addEventListener("click", closeHandler);
|
|
25
|
+
|
|
26
|
+
return () => window.removeEventListener("click", closeHandler);
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (isOpen) {
|
|
31
|
+
selectFirstMenuChild();
|
|
32
|
+
}
|
|
33
|
+
}, [isOpen]);
|
|
34
|
+
|
|
35
|
+
const selectFirstMenuChild = () => {
|
|
36
|
+
if (!menuRef.current) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const children = selectAccessibleChildren(menuRef.current);
|
|
41
|
+
const firstChild = children[0];
|
|
42
|
+
|
|
43
|
+
if (!firstChild) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
firstChild.focus();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const handleKeyDown = (ev: KeyboardEvent<HTMLDivElement>) => {
|
|
51
|
+
if (!accessHorizontalArrows) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (ev.key === "ArrowRight") {
|
|
56
|
+
if (accessHorizontalArrows === "ArrowRight") {
|
|
57
|
+
setOpen(true);
|
|
58
|
+
selectFirstMenuChild();
|
|
59
|
+
} else {
|
|
60
|
+
setOpen(false);
|
|
61
|
+
toggleRef.current?.focus();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (ev.key === "ArrowLeft") {
|
|
66
|
+
if (accessHorizontalArrows === "ArrowLeft") {
|
|
67
|
+
setOpen(true);
|
|
68
|
+
selectFirstMenuChild();
|
|
69
|
+
} else {
|
|
70
|
+
setOpen(false);
|
|
71
|
+
toggleRef.current?.focus();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<DropdownContext value={{
|
|
78
|
+
isOpen, setOpen, toggleRef, menuRef
|
|
79
|
+
}}>
|
|
80
|
+
<div
|
|
81
|
+
className={cn("relative w-fit max-w-full", className)}
|
|
82
|
+
onKeyDown={ev => {
|
|
83
|
+
onKeyDown?.(ev);
|
|
84
|
+
handleKeyDown(ev);
|
|
85
|
+
}}
|
|
86
|
+
{...p}
|
|
87
|
+
/>
|
|
88
|
+
</DropdownContext>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { HTMLAttributes, use } from "react";
|
|
4
|
+
|
|
5
|
+
import { DropdownContext } from "./DropdownContext";
|
|
6
|
+
|
|
7
|
+
export type DropdownTogglePropsT = HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
|
|
9
|
+
export function DropdownToggle({ onClick, ...props }: DropdownTogglePropsT) {
|
|
10
|
+
const { toggleRef, setOpen } = use(DropdownContext);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<button
|
|
14
|
+
ref={toggleRef}
|
|
15
|
+
onClick={ev => {
|
|
16
|
+
ev.stopPropagation();
|
|
17
|
+
onClick?.(ev);
|
|
18
|
+
setOpen(prev => !prev);
|
|
19
|
+
}}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { LoaderIcon } from "lucide-react";
|
|
5
|
+
import { useLinkStatus } from "next/link";
|
|
6
|
+
import { PropsWithChildren } from "react";
|
|
7
|
+
|
|
8
|
+
export type LinkLoaderPropsT = PropsWithChildren & {
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function LinkLoader({ children, className }: LinkLoaderPropsT) {
|
|
13
|
+
const { pending } = useLinkStatus()
|
|
14
|
+
|
|
15
|
+
return pending ? <LoaderIcon className={cn("compatible-icon animate-spin", className)} /> : children
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModalBody } from "./ModalBody";
|
|
2
|
+
import { ModalRoot } from "./ModalRoot";
|
|
3
|
+
import { ModalHeader } from "./ModalHeader";
|
|
4
|
+
import { ModalPortal } from "./ModalPortal";
|
|
5
|
+
import { ModalToggle } from "./ModalTrigger";
|
|
6
|
+
import { ModalContent } from "./ModalContent";
|
|
7
|
+
|
|
8
|
+
export const Modal = Object.assign(ModalRoot, {
|
|
9
|
+
Toggle: ModalToggle,
|
|
10
|
+
Portal: ModalPortal,
|
|
11
|
+
Content: ModalContent,
|
|
12
|
+
Header: ModalHeader,
|
|
13
|
+
Body: ModalBody
|
|
14
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cn } from "@kadoui/utils";
|
|
2
|
+
import type { HTMLAttributes } from "react";
|
|
3
|
+
|
|
4
|
+
export type ModalBodyPropsT = HTMLAttributes<HTMLDivElement>;
|
|
5
|
+
|
|
6
|
+
export function ModalBody({ children, className, ...props }: ModalBodyPropsT) {
|
|
7
|
+
return (
|
|
8
|
+
<div className={cn("py-3 px-1.5 mx-1.5 max-h-[calc(100%-4rem)] overflow-y-auto", className)} {...props}>
|
|
9
|
+
{children}
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { use, useEffect, useRef } from "react";
|
|
5
|
+
import { AnimatePresence, HTMLMotionProps, motion } from "framer-motion";
|
|
6
|
+
|
|
7
|
+
import { ModalContext } from "./ModalContext";
|
|
8
|
+
|
|
9
|
+
export type ModalContentPropsT = HTMLMotionProps<"div">;
|
|
10
|
+
|
|
11
|
+
export function ModalContent({ onClick, className, ...props }: ModalContentPropsT) {
|
|
12
|
+
const { isOpen } = use(ModalContext);
|
|
13
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (isOpen) {
|
|
17
|
+
const indexElement = contentRef.current?.querySelector("[data-modal='index']") as HTMLElement | null | undefined;
|
|
18
|
+
indexElement?.focus();
|
|
19
|
+
};
|
|
20
|
+
}, [isOpen]);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<AnimatePresence>
|
|
24
|
+
{isOpen ? (
|
|
25
|
+
<motion.div
|
|
26
|
+
ref={contentRef}
|
|
27
|
+
initial={{ opacity: 0, scale: 0.9 }}
|
|
28
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
29
|
+
exit={{ opacity: 0, scale: 0.9 }}
|
|
30
|
+
transition={{ ease: "easeInOut" }}
|
|
31
|
+
onClick={ev => {
|
|
32
|
+
onClick?.(ev);
|
|
33
|
+
ev.stopPropagation();
|
|
34
|
+
}}
|
|
35
|
+
className={cn(
|
|
36
|
+
"bg-background rounded-2xl w-max max-w-[90%] h-full max-h-[90%]",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
) : null}
|
|
42
|
+
</AnimatePresence>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { cn } from "@kadoui/utils";
|
|
2
|
+
import type { HTMLAttributes } from "react";
|
|
3
|
+
|
|
4
|
+
export type ModalHeaderPropsT = HTMLAttributes<HTMLDivElement>;
|
|
5
|
+
|
|
6
|
+
export function ModalHeader({ className, ...props }: ModalHeaderPropsT) {
|
|
7
|
+
return (
|
|
8
|
+
<div className={cn("h-16 f-align px-3 bg-background rounded-t-2xl border-b border-separator sticky top-0", className)} {...props} />
|
|
9
|
+
);
|
|
10
|
+
}
|