@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,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { HTMLAttributes, use } from "react";
|
|
5
|
+
|
|
6
|
+
import { StepsContext } from "./StepsContext";
|
|
7
|
+
|
|
8
|
+
export type StepsControlsPropsT = HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
|
|
10
|
+
export function StepsControls({ className, ...props }: StepsControlsPropsT) {
|
|
11
|
+
const { step, steps, setStep } = use(StepsContext);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<div className={cn("f-align mb-[calc(1.5rem+0.75rem+0.375rem)]", className)} {...props}>
|
|
16
|
+
{steps.map((item, index) => (
|
|
17
|
+
<div
|
|
18
|
+
key={index}
|
|
19
|
+
className={`${index + 1 < steps.length ? "w-full" : "w-max"} f-align justify-between`}
|
|
20
|
+
>
|
|
21
|
+
<div className="f-center relative flex-col">
|
|
22
|
+
<button
|
|
23
|
+
onClick={() => step > index + 1 && setStep(index + 1)}
|
|
24
|
+
className={`${step >= index + 1 ? "btn-fill" : "btn-ghost"} btn-square rounded-full`}
|
|
25
|
+
>
|
|
26
|
+
<span className="text-sm">{(index + 1)}</span>
|
|
27
|
+
</button>
|
|
28
|
+
<span
|
|
29
|
+
className={`
|
|
30
|
+
f-align mt-1.5 h-3 w-max text-center text-xs absolute top-full
|
|
31
|
+
${step === index + 1 ? "font-bold" : ""}
|
|
32
|
+
${index === 0 ? "ltr:left-0 rtl:right-0" : index + 1 === steps.length ? "ltr:right-0 rtl:left-0" : ""}
|
|
33
|
+
`}
|
|
34
|
+
>
|
|
35
|
+
{item.name}
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
{index + 1 < steps.length ? (
|
|
40
|
+
<div key={index} className="bg-foreground/10 flex h-1.5 flex-1 shrink-0">
|
|
41
|
+
<div
|
|
42
|
+
className={`
|
|
43
|
+
bg-primary w-full ltr:origin-left rtl:origin-right h-full
|
|
44
|
+
${step > index + 1 ? "scale-x-100" : step === index + 1 ? "scale-x-[50%]" : "scale-x-0"}
|
|
45
|
+
`}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
) : null}
|
|
49
|
+
</div>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{steps.find((_, index) => index + 1 === step)?.component}
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { HTMLAttributes, use } from "react";
|
|
4
|
+
import { ChevronRightIcon } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
import { StepsContext } from "./StepsContext";
|
|
7
|
+
|
|
8
|
+
export type StepsNextBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function StepsNextBtn({ onClick, disabled, children, ...props }: StepsNextBtnPropsT) {
|
|
13
|
+
const { step, steps, nextStep } = use(StepsContext);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<button
|
|
17
|
+
disabled={disabled || step === steps.length}
|
|
18
|
+
onClick={ev => {
|
|
19
|
+
onClick?.(ev);
|
|
20
|
+
nextStep();
|
|
21
|
+
}}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
{children || <ChevronRightIcon className="compatible-icon" />}
|
|
25
|
+
</button>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { HTMLAttributes, use } from "react";
|
|
4
|
+
import { ChevronLeftIcon } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
import { StepsContext } from "./StepsContext";
|
|
7
|
+
|
|
8
|
+
export type StepsPrevBtnPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function StepsPrevBtn({ onClick, disabled, children, ...props }: StepsPrevBtnPropsT) {
|
|
13
|
+
const { step, prevStep } = use(StepsContext);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<button
|
|
17
|
+
disabled={disabled || step === 1}
|
|
18
|
+
onClick={ev => {
|
|
19
|
+
onClick?.(ev);
|
|
20
|
+
prevStep();
|
|
21
|
+
}}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
{children || <ChevronLeftIcon className="compatible-icon" />}
|
|
25
|
+
</button>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useRouter, useSearchParams } from "next/navigation";
|
|
4
|
+
import { PropsWithChildren, useEffect, useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { StepsContext, StepsT } from "./StepsContext";
|
|
7
|
+
|
|
8
|
+
export type StepsSearchParamsRootPropsT = PropsWithChildren & {
|
|
9
|
+
stepKey?: string;
|
|
10
|
+
steps: StepsT[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function StepsSearchParamsRoot({ children, steps, stepKey }: StepsSearchParamsRootPropsT) {
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
const searchParams = useSearchParams();
|
|
16
|
+
const [currentStep, setCurrentStep] = useState(1);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setCurrentStep(+(searchParams.get(stepKey || "step") || "1"));
|
|
20
|
+
}, [stepKey, searchParams]);
|
|
21
|
+
|
|
22
|
+
const pushRouter = (page: number) => {
|
|
23
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
24
|
+
params.set(stepKey || "step", page.toString());
|
|
25
|
+
router.push("?" + params.toString())
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const nextStep = () => {
|
|
29
|
+
if (currentStep < steps.length) {
|
|
30
|
+
pushRouter(currentStep + 1);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const prevStep = () => {
|
|
35
|
+
if (currentStep > 1) {
|
|
36
|
+
pushRouter(currentStep - 1);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<StepsContext.Provider value={{ step: currentStep, setStep: setCurrentStep, steps, nextStep, prevStep }}>
|
|
42
|
+
{children}
|
|
43
|
+
</StepsContext.Provider>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren, useState } from "react";
|
|
4
|
+
|
|
5
|
+
import { StepsT, StepsContext } from "./StepsContext";
|
|
6
|
+
|
|
7
|
+
export type StepsStateRootPropsT = PropsWithChildren & {
|
|
8
|
+
steps: StepsT[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function StepsStateRoot({ children, steps }: StepsStateRootPropsT) {
|
|
12
|
+
const [step, setStep] = useState(1);
|
|
13
|
+
|
|
14
|
+
const nextStep = () => setStep(prev => prev + 1);
|
|
15
|
+
|
|
16
|
+
const prevStep = () => setStep(prev => prev - 1);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<StepsContext.Provider value={{ step, setStep, steps, nextStep, prevStep }}>
|
|
20
|
+
{children}
|
|
21
|
+
</StepsContext.Provider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { motion, HTMLMotionProps } from "framer-motion";
|
|
4
|
+
|
|
5
|
+
export type SwapItemPropsT = HTMLMotionProps<"span">;
|
|
6
|
+
|
|
7
|
+
export function SwapItem(p: SwapItemPropsT) {
|
|
8
|
+
return (
|
|
9
|
+
<motion.span
|
|
10
|
+
initial={{ rotate: 90, opacity: 0 }}
|
|
11
|
+
animate={{ rotate: 0, opacity: 1 }}
|
|
12
|
+
exit={{ rotate: 90, opacity: 0 }}
|
|
13
|
+
{...p}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { AnimatePresence } from "framer-motion";
|
|
4
|
+
import { HTMLAttributes, useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { SwapContext } from "./SwapContext";
|
|
7
|
+
|
|
8
|
+
export type SwapRootPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
items: string[];
|
|
10
|
+
defaultItem?: string;
|
|
11
|
+
onSwap?: (item: string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function SwapRoot({ items, defaultItem, onSwap, ...p }: SwapRootPropsT) {
|
|
15
|
+
const [activeItem, setActiveItem] = useState(defaultItem || items[1]);
|
|
16
|
+
|
|
17
|
+
const handleSwap = (newItem: string) => {
|
|
18
|
+
setActiveItem(newItem);
|
|
19
|
+
onSwap?.(newItem);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<SwapContext value={{ items, activeItem, handleSwap }} >
|
|
24
|
+
<AnimatePresence mode="wait">
|
|
25
|
+
<div {...p} />
|
|
26
|
+
</AnimatePresence>
|
|
27
|
+
</SwapContext>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { HTMLAttributes, use } from "react";
|
|
4
|
+
|
|
5
|
+
import { SwapContext } from "./SwapContext";
|
|
6
|
+
|
|
7
|
+
export type SwapTriggerPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
item: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function SwapTrigger({ item, onClick, ...p }: SwapTriggerPropsT) {
|
|
12
|
+
const { items, activeItem, handleSwap } = use(SwapContext);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
activeItem === item ? (
|
|
16
|
+
<button
|
|
17
|
+
onClick={ev => {
|
|
18
|
+
onClick?.(ev);
|
|
19
|
+
{
|
|
20
|
+
const nextIndex = items.indexOf(item) + 1 >= items.length ? 0 : items.indexOf(item) + 1;
|
|
21
|
+
const nextItem = items[nextIndex];
|
|
22
|
+
if (nextItem !== undefined) {
|
|
23
|
+
handleSwap(nextItem);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}}
|
|
27
|
+
{...p}
|
|
28
|
+
/>
|
|
29
|
+
) : null
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabsTab } from "./TabsTab";
|
|
2
|
+
import { TabsList } from "./TabsList";
|
|
3
|
+
import { TabsRoot } from "./TabsRoot";
|
|
4
|
+
import { TabsPanel } from "./TabsPanel";
|
|
5
|
+
|
|
6
|
+
export const Tabs = Object.assign(TabsRoot, {
|
|
7
|
+
List: TabsList,
|
|
8
|
+
Tab: TabsTab,
|
|
9
|
+
Panel: TabsPanel
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, Dispatch, SetStateAction } from "react";
|
|
2
|
+
|
|
3
|
+
export type TabsContextT = {
|
|
4
|
+
activeTab: string;
|
|
5
|
+
setActiveTab: Dispatch<SetStateAction<string>>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const TabsContext = createContext<TabsContextT>({
|
|
9
|
+
activeTab: "",
|
|
10
|
+
setActiveTab: () => { },
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { HTMLAttributes } from "react";
|
|
5
|
+
|
|
6
|
+
export type TabsListPropsT = HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
|
|
8
|
+
export function TabsList({ className, ...props }: TabsListPropsT) {
|
|
9
|
+
return (
|
|
10
|
+
<div className={cn("join-border", className)} {...props} />
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@kadoui/utils";
|
|
4
|
+
import { HTMLAttributes, use } from "react";
|
|
5
|
+
|
|
6
|
+
import { TabsContext } from "./TabsContext";
|
|
7
|
+
|
|
8
|
+
export type TabsPanelPropsT = HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function TabsPanel({ value, className, ...props }: TabsPanelPropsT) {
|
|
13
|
+
const { activeTab } = use(TabsContext);
|
|
14
|
+
|
|
15
|
+
const isActive = activeTab === value;
|
|
16
|
+
|
|
17
|
+
return isActive ? (
|
|
18
|
+
<div
|
|
19
|
+
className={cn("p-3 rounded-kado bg-foreground/10 mt-1.5", className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
) : null
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Dispatch, PropsWithChildren, SetStateAction } from "react";
|
|
4
|
+
|
|
5
|
+
import { TabsContext } from "./TabsContext";
|
|
6
|
+
|
|
7
|
+
export type TabsRootPropsT = PropsWithChildren & {
|
|
8
|
+
activeTab: string;
|
|
9
|
+
setActiveTab: Dispatch<SetStateAction<string>>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function TabsRoot({ activeTab, setActiveTab, children }: TabsRootPropsT) {
|
|
13
|
+
return (
|
|
14
|
+
<TabsContext value={{ activeTab, setActiveTab }}>
|
|
15
|
+
{children}
|
|
16
|
+
</TabsContext>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type HTMLAttributes, use } from "react";
|
|
4
|
+
|
|
5
|
+
import { TabsContext } from "./TabsContext";
|
|
6
|
+
|
|
7
|
+
export type TabsTabPropsT = HTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function TabsTab({ value, onClick, ...props }: TabsTabPropsT) {
|
|
12
|
+
const { setActiveTab } = use(TabsContext);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<button
|
|
16
|
+
onClick={(ev) => {
|
|
17
|
+
onClick?.(ev);
|
|
18
|
+
setActiveTab(value);
|
|
19
|
+
}}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn } from "@kadoui/utils";
|
|
2
|
+
import { CheckIcon, CircleAlertIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
import { ToastT } from "./ToastRoot";
|
|
5
|
+
|
|
6
|
+
export type ToastBoxPropsT = {
|
|
7
|
+
toast: ToastT;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ToastBox({ toast }: ToastBoxPropsT) {
|
|
11
|
+
let toastIcon = null;
|
|
12
|
+
|
|
13
|
+
switch (toast.status) {
|
|
14
|
+
case "info": {
|
|
15
|
+
toastIcon = <CircleAlertIcon className="toast-icon-info" />;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
case "success": {
|
|
20
|
+
toastIcon = <CheckIcon className="toast-icon-success" />;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
case "warning": {
|
|
25
|
+
toastIcon = <TriangleAlertIcon className="toast-icon-warning" />;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
case "error": {
|
|
30
|
+
toastIcon = <XIcon className="toast-icon-error" />;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
default: {
|
|
35
|
+
toastIcon = null;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className={cn(
|
|
42
|
+
toast.variant || "toast-fill",
|
|
43
|
+
toast.size
|
|
44
|
+
)}>
|
|
45
|
+
{toastIcon}
|
|
46
|
+
{toast.data}
|
|
47
|
+
{toast.action}
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { useMounted } from "@mantine/hooks";
|
|
5
|
+
import { ReactNode, useEffect } from "react";
|
|
6
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
7
|
+
|
|
8
|
+
import { ToastBox } from "./ToastBox";
|
|
9
|
+
import { useToastStore } from "./toastStore";
|
|
10
|
+
|
|
11
|
+
export type ToastT = {
|
|
12
|
+
id: string;
|
|
13
|
+
data: ReactNode;
|
|
14
|
+
status?: "info" | "success" | "warning" | "error";
|
|
15
|
+
variant?: "toast-fill" | "toast-glass";
|
|
16
|
+
size?: "toast-sm" | "toast-lg";
|
|
17
|
+
action?: ReactNode;
|
|
18
|
+
duration?: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ToastRootT = {
|
|
22
|
+
defaultDuration?: ToastT["duration"];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function ToastRoot({ defaultDuration }: ToastRootT) {
|
|
26
|
+
const mounted = useMounted();
|
|
27
|
+
|
|
28
|
+
const toasts = useToastStore(store => store.toasts);
|
|
29
|
+
const remove = useToastStore(store => store.remove);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!toasts.length) {
|
|
33
|
+
return;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const lastToast = toasts[toasts.length - 1];
|
|
37
|
+
|
|
38
|
+
if (lastToast) {
|
|
39
|
+
const duration = lastToast?.duration || defaultDuration || 2_000;
|
|
40
|
+
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
remove(lastToast.id);
|
|
43
|
+
}, duration);
|
|
44
|
+
}
|
|
45
|
+
}, [toasts]);
|
|
46
|
+
|
|
47
|
+
if (!mounted) {
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return createPortal(
|
|
52
|
+
<>
|
|
53
|
+
<div className="max-h-screen py-3 space-y-3 fixed top-0 left-center w-fit">
|
|
54
|
+
<AnimatePresence>
|
|
55
|
+
{toasts.toReversed().map(item => (
|
|
56
|
+
<motion.div
|
|
57
|
+
key={item.id}
|
|
58
|
+
className="origin-top"
|
|
59
|
+
initial={{ opacity: 0, y: -10, scale: 0 }}
|
|
60
|
+
animate={{ opacity: 1, y: 0, scale: 1 }}
|
|
61
|
+
exit={{ opacity: 0, y: -10, scale: 0 }}
|
|
62
|
+
>
|
|
63
|
+
<ToastBox toast={item} />
|
|
64
|
+
</motion.div>
|
|
65
|
+
))}
|
|
66
|
+
</AnimatePresence>
|
|
67
|
+
</div>
|
|
68
|
+
</>,
|
|
69
|
+
document.body
|
|
70
|
+
)
|
|
71
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { nanoid } from "nanoid";
|
|
2
|
+
import { create } from "zustand";
|
|
3
|
+
|
|
4
|
+
import { ToastT } from "./ToastRoot";
|
|
5
|
+
|
|
6
|
+
type NewToastT = Omit<ToastT, "id">;
|
|
7
|
+
|
|
8
|
+
type UseToastStoreT = {
|
|
9
|
+
toasts: ToastT[];
|
|
10
|
+
add: (newToast: NewToastT) => void;
|
|
11
|
+
remove: (id: ToastT["id"]) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const useToastStore = create<UseToastStoreT>((set) => ({
|
|
15
|
+
toasts: [],
|
|
16
|
+
add: (newToast) => set(prev => ({ toasts: [...prev.toasts, { id: nanoid(), ...newToast }] })),
|
|
17
|
+
remove: id => set(prev => ({ toasts: prev.toasts.filter(item => item.id !== id) })),
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const addToast = (newToast: NewToastT) => {
|
|
21
|
+
useToastStore.getState().add(newToast);
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext, Dispatch, SetStateAction } from "react";
|
|
2
|
+
|
|
3
|
+
export type ToggleContextT = {
|
|
4
|
+
isToggled: boolean;
|
|
5
|
+
setToggled: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const ToggleContext = createContext<ToggleContextT>({} as ToggleContextT);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren, useState } from "react"
|
|
4
|
+
|
|
5
|
+
import { ToggleContext } from "./ToggleContext";
|
|
6
|
+
|
|
7
|
+
export type ToggleRootPropsT = PropsWithChildren & {
|
|
8
|
+
defaultToggled?: boolean;
|
|
9
|
+
onChange?: (toggled: boolean) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function ToggleRoot({ children, defaultToggled = false, disabled = false, onChange }: ToggleRootPropsT) {
|
|
14
|
+
const [isToggled, setToggled] = useState(defaultToggled)
|
|
15
|
+
|
|
16
|
+
const handleToggle = (newValue: boolean) => {
|
|
17
|
+
setToggled(newValue);
|
|
18
|
+
onChange?.(newValue);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<ToggleContext value={{ isToggled, disabled, setToggled: () => handleToggle }}>
|
|
23
|
+
{children}
|
|
24
|
+
</ToggleContext>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { HTMLAttributes, use } from "react";
|
|
4
|
+
|
|
5
|
+
import { ToggleContext } from "./ToggleContext";
|
|
6
|
+
|
|
7
|
+
export type ToggleSwitchPropsT = HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
|
|
9
|
+
export function ToggleSwitch({ onClick, ...p }: ToggleSwitchPropsT) {
|
|
10
|
+
const { isToggled, setToggled, disabled } = use(ToggleContext)
|
|
11
|
+
|
|
12
|
+
const handleClick = (ev: React.MouseEvent<HTMLButtonElement>) => {
|
|
13
|
+
if (!disabled) {
|
|
14
|
+
onClick?.(ev);
|
|
15
|
+
setToggled(!isToggled);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const handleKeyDown = (ev: React.KeyboardEvent<HTMLButtonElement>) => {
|
|
20
|
+
if ((ev.key === " " || ev.key === "Enter") && !disabled) {
|
|
21
|
+
ev.preventDefault();
|
|
22
|
+
setToggled(!isToggled);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
type="button"
|
|
29
|
+
role="switch"
|
|
30
|
+
disabled={disabled}
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
aria-checked={isToggled}
|
|
33
|
+
onKeyDown={handleKeyDown}
|
|
34
|
+
{...p}
|
|
35
|
+
>
|
|
36
|
+
<span className={isToggled ? "toggle-track-on" : "toggle-track-off"}>
|
|
37
|
+
<span className={isToggled ? "toggle-thumb-on" : "toggle-thumb-off"} />
|
|
38
|
+
</span>
|
|
39
|
+
</button>
|
|
40
|
+
)
|
|
41
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from "./components/AccessNavigation/AccessNavigation";
|
|
2
|
+
export * from "./components/Accordion/Accordion";
|
|
3
|
+
export * from "./components/Affix/Affix";
|
|
4
|
+
export * from "./components/Breadcrumbs/Breadcrumbs";
|
|
5
|
+
export * from "./components/Carousel/Carousel";
|
|
6
|
+
export * from "./components/ClientOnly/ClientOnly";
|
|
7
|
+
export * from "./components/Clipboard/Clipboard";
|
|
8
|
+
export * from "./components/ContextMenu/ContextMenu";
|
|
9
|
+
export * from "./components/Drawer/Drawer";
|
|
10
|
+
export * from "./components/Dropdown/Dropdown";
|
|
11
|
+
export * from "./components/LinkLoader/LinkLoader";
|
|
12
|
+
export * from "./components/Modal/Modal";
|
|
13
|
+
export * from "./components/Otp/Otp";
|
|
14
|
+
export * from "./components/Pagination/Pagination";
|
|
15
|
+
export * from "./components/PasswordInput/PasswordInput";
|
|
16
|
+
export * from "./components/Portal/Portal";
|
|
17
|
+
export * from "./components/Progress/Progress";
|
|
18
|
+
export * from "./components/QrCode/QrCode";
|
|
19
|
+
export * from "./components/Rating/Rating";
|
|
20
|
+
export * from "./components/Sheet/Sheet";
|
|
21
|
+
export * from "./components/ShowMore/ShowMore";
|
|
22
|
+
export * from "./components/Slide/Slide";
|
|
23
|
+
export * from "./components/Spoiler/Spoiler";
|
|
24
|
+
export * from "./components/Steps/Steps";
|
|
25
|
+
export * from "./components/Swap/Swap";
|
|
26
|
+
export * from "./components/Tabs/Tabs";
|
|
27
|
+
export * from "./components/Toast/Toast";
|
|
28
|
+
export * from "./components/Toggle/Toggle";
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@repo/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"jsx": "preserve",
|
|
7
|
+
"outDir": "dist"
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"exclude": [
|
|
13
|
+
"dist",
|
|
14
|
+
"build",
|
|
15
|
+
"node_modules"
|
|
16
|
+
]
|
|
17
|
+
}
|