@kadoui/react 1.4.9 → 1.5.10
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/index.cjs +1824 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +434 -0
- package/dist/index.d.ts +434 -27
- package/dist/index.js +1764 -26
- package/dist/index.js.map +1 -0
- package/dist/utils.cjs +76 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +10 -0
- package/dist/utils.d.ts +10 -4
- package/dist/utils.js +46 -3
- package/dist/utils.js.map +1 -0
- package/package.json +12 -5
- package/dist/components/AccessNavigation/AccessNavigation.d.ts +0 -6
- package/dist/components/AccessNavigation/AccessNavigation.d.ts.map +0 -1
- package/dist/components/AccessNavigation/AccessNavigation.js +0 -27
- package/dist/components/AccessNavigation/AccessNavigation.jsx +0 -26
- package/dist/components/Accordion/Accordion.d.ts +0 -8
- package/dist/components/Accordion/Accordion.d.ts.map +0 -1
- package/dist/components/Accordion/Accordion.js +0 -7
- package/dist/components/Accordion/AccordionBody.d.ts +0 -4
- package/dist/components/Accordion/AccordionBody.d.ts.map +0 -1
- package/dist/components/Accordion/AccordionBody.js +0 -11
- package/dist/components/Accordion/AccordionBody.jsx +0 -14
- package/dist/components/Accordion/AccordionContext.d.ts +0 -7
- package/dist/components/Accordion/AccordionContext.d.ts.map +0 -1
- package/dist/components/Accordion/AccordionContext.js +0 -2
- package/dist/components/Accordion/AccordionRoot.d.ts +0 -4
- package/dist/components/Accordion/AccordionRoot.d.ts.map +0 -1
- package/dist/components/Accordion/AccordionRoot.js +0 -8
- package/dist/components/Accordion/AccordionRoot.jsx +0 -9
- package/dist/components/Accordion/AccordionToggle.d.ts +0 -6
- package/dist/components/Accordion/AccordionToggle.d.ts.map +0 -1
- package/dist/components/Accordion/AccordionToggle.js +0 -12
- package/dist/components/Accordion/AccordionToggle.jsx +0 -11
- package/dist/components/Affix/Affix.d.ts +0 -4
- package/dist/components/Affix/Affix.d.ts.map +0 -1
- package/dist/components/Affix/Affix.js +0 -36
- package/dist/components/Affix/Affix.jsx +0 -35
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -6
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -5
- package/dist/components/Breadcrumbs/BreadcrumbsContext.d.ts +0 -6
- package/dist/components/Breadcrumbs/BreadcrumbsContext.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/BreadcrumbsContext.js +0 -2
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts +0 -6
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.js +0 -8
- package/dist/components/Breadcrumbs/BreadcrumbsItem.jsx +0 -10
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts +0 -6
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.js +0 -6
- package/dist/components/Breadcrumbs/BreadcrumbsRoot.jsx +0 -7
- package/dist/components/Carousel/Carousel.d.ts +0 -10
- package/dist/components/Carousel/Carousel.d.ts.map +0 -1
- package/dist/components/Carousel/Carousel.js +0 -9
- package/dist/components/Carousel/CarouselContainer.d.ts +0 -4
- package/dist/components/Carousel/CarouselContainer.d.ts.map +0 -1
- package/dist/components/Carousel/CarouselContainer.js +0 -8
- package/dist/components/Carousel/CarouselContainer.jsx +0 -9
- package/dist/components/Carousel/CarouselContext.d.ts +0 -8
- package/dist/components/Carousel/CarouselContext.d.ts.map +0 -1
- package/dist/components/Carousel/CarouselContext.js +0 -2
- package/dist/components/Carousel/CarouselLeftFade.d.ts +0 -5
- package/dist/components/Carousel/CarouselLeftFade.d.ts.map +0 -1
- package/dist/components/Carousel/CarouselLeftFade.js +0 -11
- package/dist/components/Carousel/CarouselLeftFade.jsx +0 -10
- package/dist/components/Carousel/CarouselRightFade.d.ts +0 -5
- package/dist/components/Carousel/CarouselRightFade.d.ts.map +0 -1
- package/dist/components/Carousel/CarouselRightFade.js +0 -11
- package/dist/components/Carousel/CarouselRightFade.jsx +0 -10
- package/dist/components/Carousel/CarouselRoot.d.ts +0 -4
- package/dist/components/Carousel/CarouselRoot.d.ts.map +0 -1
- package/dist/components/Carousel/CarouselRoot.js +0 -40
- package/dist/components/Carousel/CarouselRoot.jsx +0 -40
- package/dist/components/ClientOnly/ClientOnly.d.ts +0 -4
- package/dist/components/ClientOnly/ClientOnly.d.ts.map +0 -1
- package/dist/components/ClientOnly/ClientOnly.js +0 -6
- package/dist/components/ClientOnly/ClientOnly.jsx +0 -6
- package/dist/components/Clipboard/Clipboard.d.ts +0 -8
- package/dist/components/Clipboard/Clipboard.d.ts.map +0 -1
- package/dist/components/Clipboard/Clipboard.js +0 -11
- package/dist/components/Clipboard/Clipboard.jsx +0 -12
- package/dist/components/ContextMenu/ContextMenu.d.ts +0 -6
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +0 -1
- package/dist/components/ContextMenu/ContextMenu.js +0 -5
- package/dist/components/ContextMenu/ContextMenuContent.d.ts +0 -4
- package/dist/components/ContextMenu/ContextMenuContent.d.ts.map +0 -1
- package/dist/components/ContextMenu/ContextMenuContent.js +0 -30
- package/dist/components/ContextMenu/ContextMenuContent.jsx +0 -29
- package/dist/components/ContextMenu/ContextMenuContext.d.ts +0 -11
- package/dist/components/ContextMenu/ContextMenuContext.d.ts.map +0 -1
- package/dist/components/ContextMenu/ContextMenuContext.js +0 -2
- package/dist/components/ContextMenu/ContextMenuRoot.d.ts +0 -4
- package/dist/components/ContextMenu/ContextMenuRoot.d.ts.map +0 -1
- package/dist/components/ContextMenu/ContextMenuRoot.js +0 -55
- package/dist/components/ContextMenu/ContextMenuRoot.jsx +0 -56
- package/dist/components/Drawer/Drawer.d.ts +0 -10
- package/dist/components/Drawer/Drawer.d.ts.map +0 -1
- package/dist/components/Drawer/Drawer.js +0 -9
- package/dist/components/Drawer/DrawerBody.d.ts +0 -6
- package/dist/components/Drawer/DrawerBody.d.ts.map +0 -1
- package/dist/components/Drawer/DrawerBody.js +0 -37
- package/dist/components/Drawer/DrawerBody.jsx +0 -38
- package/dist/components/Drawer/DrawerContext.d.ts +0 -7
- package/dist/components/Drawer/DrawerContext.d.ts.map +0 -1
- package/dist/components/Drawer/DrawerContext.js +0 -2
- package/dist/components/Drawer/DrawerPortal.d.ts +0 -4
- package/dist/components/Drawer/DrawerPortal.d.ts.map +0 -1
- package/dist/components/Drawer/DrawerPortal.js +0 -14
- package/dist/components/Drawer/DrawerPortal.jsx +0 -19
- package/dist/components/Drawer/DrawerRoot.d.ts +0 -4
- package/dist/components/Drawer/DrawerRoot.d.ts.map +0 -1
- package/dist/components/Drawer/DrawerRoot.js +0 -34
- package/dist/components/Drawer/DrawerRoot.jsx +0 -35
- package/dist/components/Drawer/DrawerToggle.d.ts +0 -4
- package/dist/components/Drawer/DrawerToggle.d.ts.map +0 -1
- package/dist/components/Drawer/DrawerToggle.js +0 -11
- package/dist/components/Drawer/DrawerToggle.jsx +0 -10
- package/dist/components/Dropdown/Dropdown.d.ts +0 -8
- package/dist/components/Dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/Dropdown/Dropdown.js +0 -7
- package/dist/components/Dropdown/DropdownContext.d.ts +0 -9
- package/dist/components/Dropdown/DropdownContext.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownContext.js +0 -2
- package/dist/components/Dropdown/DropdownMenu.d.ts +0 -6
- package/dist/components/Dropdown/DropdownMenu.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownMenu.jsx +0 -12
- package/dist/components/Dropdown/DropdownRoot.d.ts +0 -6
- package/dist/components/Dropdown/DropdownRoot.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownRoot.jsx +0 -63
- package/dist/components/Dropdown/DropdownToggle.d.ts +0 -4
- package/dist/components/Dropdown/DropdownToggle.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownToggle.jsx +0 -11
- package/dist/components/LoaderLink/LoaderLink.d.ts +0 -6
- package/dist/components/LoaderLink/LoaderLink.d.ts.map +0 -1
- package/dist/components/LoaderLink/LoaderLink.js +0 -6
- package/dist/components/LoaderLink/LoaderLink.jsx +0 -6
- package/dist/components/Modal/Modal.d.ts +0 -14
- package/dist/components/Modal/Modal.d.ts.map +0 -1
- package/dist/components/Modal/Modal.js +0 -13
- package/dist/components/Modal/ModalBody.d.ts +0 -4
- package/dist/components/Modal/ModalBody.d.ts.map +0 -1
- package/dist/components/Modal/ModalBody.js +0 -20
- package/dist/components/Modal/ModalBody.jsx +0 -21
- package/dist/components/Modal/ModalContent.d.ts +0 -4
- package/dist/components/Modal/ModalContent.d.ts.map +0 -1
- package/dist/components/Modal/ModalContent.js +0 -4
- package/dist/components/Modal/ModalContent.jsx +0 -3
- package/dist/components/Modal/ModalContext.d.ts +0 -7
- package/dist/components/Modal/ModalContext.d.ts.map +0 -1
- package/dist/components/Modal/ModalContext.js +0 -2
- package/dist/components/Modal/ModalHeader.d.ts +0 -4
- package/dist/components/Modal/ModalHeader.d.ts.map +0 -1
- package/dist/components/Modal/ModalHeader.js +0 -4
- package/dist/components/Modal/ModalHeader.jsx +0 -3
- package/dist/components/Modal/ModalPortal.d.ts +0 -4
- package/dist/components/Modal/ModalPortal.d.ts.map +0 -1
- package/dist/components/Modal/ModalPortal.js +0 -14
- package/dist/components/Modal/ModalPortal.jsx +0 -19
- package/dist/components/Modal/ModalRoot.d.ts +0 -6
- package/dist/components/Modal/ModalRoot.d.ts.map +0 -1
- package/dist/components/Modal/ModalRoot.js +0 -34
- package/dist/components/Modal/ModalRoot.jsx +0 -35
- package/dist/components/Modal/ModalTrigger.d.ts +0 -4
- package/dist/components/Modal/ModalTrigger.d.ts.map +0 -1
- package/dist/components/Modal/ModalTrigger.js +0 -11
- package/dist/components/Modal/ModalTrigger.jsx +0 -10
- package/dist/components/Otp/Otp.d.ts +0 -8
- package/dist/components/Otp/Otp.d.ts.map +0 -1
- package/dist/components/Otp/Otp.js +0 -7
- package/dist/components/Otp/OtpContext.d.ts +0 -7
- package/dist/components/Otp/OtpContext.d.ts.map +0 -1
- package/dist/components/Otp/OtpContext.js +0 -4
- package/dist/components/Otp/OtpHiddenInput.d.ts +0 -4
- package/dist/components/Otp/OtpHiddenInput.d.ts.map +0 -1
- package/dist/components/Otp/OtpHiddenInput.js +0 -8
- package/dist/components/Otp/OtpHiddenInput.jsx +0 -7
- package/dist/components/Otp/OtpInputs.d.ts +0 -7
- package/dist/components/Otp/OtpInputs.d.ts.map +0 -1
- package/dist/components/Otp/OtpInputs.js +0 -55
- package/dist/components/Otp/OtpInputs.jsx +0 -54
- package/dist/components/Otp/OtpRoot.d.ts +0 -4
- package/dist/components/Otp/OtpRoot.d.ts.map +0 -1
- package/dist/components/Otp/OtpRoot.js +0 -14
- package/dist/components/Otp/OtpRoot.jsx +0 -15
- package/dist/components/Pagination/Pagination.d.ts +0 -16
- package/dist/components/Pagination/Pagination.d.ts.map +0 -1
- package/dist/components/Pagination/Pagination.js +0 -12
- package/dist/components/Pagination/PaginationContext.d.ts +0 -8
- package/dist/components/Pagination/PaginationContext.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationContext.js +0 -2
- package/dist/components/Pagination/PaginationContext.jsx +0 -2
- package/dist/components/Pagination/PaginationCounts.d.ts +0 -4
- package/dist/components/Pagination/PaginationCounts.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationCounts.js +0 -8
- package/dist/components/Pagination/PaginationCounts.jsx +0 -9
- package/dist/components/Pagination/PaginationNextBtn.d.ts +0 -6
- package/dist/components/Pagination/PaginationNextBtn.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationNextBtn.js +0 -11
- package/dist/components/Pagination/PaginationNextBtn.jsx +0 -10
- package/dist/components/Pagination/PaginationPrevBtn.d.ts +0 -6
- package/dist/components/Pagination/PaginationPrevBtn.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationPrevBtn.js +0 -11
- package/dist/components/Pagination/PaginationPrevBtn.jsx +0 -10
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts +0 -7
- package/dist/components/Pagination/PaginationSearchParamsRoot.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationSearchParamsRoot.js +0 -29
- package/dist/components/Pagination/PaginationSearchParamsRoot.jsx +0 -30
- package/dist/components/Pagination/PaginationStateRoot.d.ts +0 -6
- package/dist/components/Pagination/PaginationStateRoot.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationStateRoot.js +0 -10
- package/dist/components/Pagination/PaginationStateRoot.jsx +0 -11
- package/dist/components/PasswordInput/PasswordInput.d.ts +0 -8
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +0 -1
- package/dist/components/PasswordInput/PasswordInput.js +0 -7
- package/dist/components/PasswordInput/PasswordInputContext.d.ts +0 -7
- package/dist/components/PasswordInput/PasswordInputContext.d.ts.map +0 -1
- package/dist/components/PasswordInput/PasswordInputContext.js +0 -2
- package/dist/components/PasswordInput/PasswordInputContext.jsx +0 -2
- package/dist/components/PasswordInput/PasswordInputField.d.ts +0 -4
- package/dist/components/PasswordInput/PasswordInputField.d.ts.map +0 -1
- package/dist/components/PasswordInput/PasswordInputField.js +0 -8
- package/dist/components/PasswordInput/PasswordInputField.jsx +0 -7
- package/dist/components/PasswordInput/PasswordInputRoot.d.ts +0 -4
- package/dist/components/PasswordInput/PasswordInputRoot.d.ts.map +0 -1
- package/dist/components/PasswordInput/PasswordInputRoot.js +0 -8
- package/dist/components/PasswordInput/PasswordInputRoot.jsx +0 -9
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts +0 -6
- package/dist/components/PasswordInput/PasswordInputToggle.d.ts.map +0 -1
- package/dist/components/PasswordInput/PasswordInputToggle.js +0 -11
- package/dist/components/PasswordInput/PasswordInputToggle.jsx +0 -12
- package/dist/components/Popover/Popover.d.ts +0 -8
- package/dist/components/Popover/Popover.d.ts.map +0 -1
- package/dist/components/Popover/Popover.js +0 -7
- package/dist/components/Popover/PopoverBody.d.ts +0 -6
- package/dist/components/Popover/PopoverBody.d.ts.map +0 -1
- package/dist/components/Popover/PopoverBody.js +0 -13
- package/dist/components/Popover/PopoverBody.jsx +0 -12
- package/dist/components/Popover/PopoverContext.d.ts +0 -10
- package/dist/components/Popover/PopoverContext.d.ts.map +0 -1
- package/dist/components/Popover/PopoverContext.js +0 -2
- package/dist/components/Popover/PopoverMenu.d.ts +0 -6
- package/dist/components/Popover/PopoverMenu.d.ts.map +0 -1
- package/dist/components/Popover/PopoverMenu.jsx +0 -12
- package/dist/components/Popover/PopoverRoot.d.ts +0 -8
- package/dist/components/Popover/PopoverRoot.d.ts.map +0 -1
- package/dist/components/Popover/PopoverRoot.js +0 -74
- package/dist/components/Popover/PopoverRoot.jsx +0 -75
- package/dist/components/Popover/PopoverToggle.d.ts +0 -4
- package/dist/components/Popover/PopoverToggle.d.ts.map +0 -1
- package/dist/components/Popover/PopoverToggle.js +0 -14
- package/dist/components/Popover/PopoverToggle.jsx +0 -13
- package/dist/components/Portal/Portal.d.ts +0 -6
- package/dist/components/Portal/Portal.d.ts.map +0 -1
- package/dist/components/Portal/Portal.js +0 -6
- package/dist/components/Portal/Portal.jsx +0 -7
- package/dist/components/Progress/Progress.d.ts +0 -6
- package/dist/components/Progress/Progress.d.ts.map +0 -1
- package/dist/components/Progress/Progress.js +0 -5
- package/dist/components/Progress/ProgressBar.d.ts +0 -6
- package/dist/components/Progress/ProgressBar.d.ts.map +0 -1
- package/dist/components/Progress/ProgressBar.js +0 -10
- package/dist/components/Progress/ProgressBar.jsx +0 -11
- package/dist/components/Progress/ProgressContext.d.ts +0 -6
- package/dist/components/Progress/ProgressContext.d.ts.map +0 -1
- package/dist/components/Progress/ProgressContext.js +0 -2
- package/dist/components/Progress/ProgressRoot.d.ts +0 -7
- package/dist/components/Progress/ProgressRoot.d.ts.map +0 -1
- package/dist/components/Progress/ProgressRoot.js +0 -6
- package/dist/components/Progress/ProgressRoot.jsx +0 -7
- package/dist/components/QrCode/QrCode.d.ts +0 -8
- package/dist/components/QrCode/QrCode.d.ts.map +0 -1
- package/dist/components/QrCode/QrCode.js +0 -15
- package/dist/components/QrCode/QrCode.jsx +0 -14
- package/dist/components/Rating/Rating.d.ts +0 -5
- package/dist/components/Rating/Rating.d.ts.map +0 -1
- package/dist/components/Rating/Rating.js +0 -5
- package/dist/components/Rating/RatingContext.d.ts +0 -7
- package/dist/components/Rating/RatingContext.d.ts.map +0 -1
- package/dist/components/Rating/RatingContext.js +0 -2
- package/dist/components/Rating/RatingItems.d.ts +0 -10
- package/dist/components/Rating/RatingItems.d.ts.map +0 -1
- package/dist/components/Rating/RatingItems.js +0 -13
- package/dist/components/Rating/RatingItems.jsx +0 -14
- package/dist/components/Rating/RatingRoot.d.ts +0 -4
- package/dist/components/Rating/RatingRoot.d.ts.map +0 -1
- package/dist/components/Rating/RatingRoot.js +0 -8
- package/dist/components/Rating/RatingRoot.jsx +0 -9
- package/dist/components/Sheet/Sheet.d.ts +0 -14
- package/dist/components/Sheet/Sheet.d.ts.map +0 -1
- package/dist/components/Sheet/Sheet.js +0 -13
- package/dist/components/Sheet/SheetBody.d.ts +0 -4
- package/dist/components/Sheet/SheetBody.d.ts.map +0 -1
- package/dist/components/Sheet/SheetBody.js +0 -21
- package/dist/components/Sheet/SheetBody.jsx +0 -20
- package/dist/components/Sheet/SheetContent.d.ts +0 -4
- package/dist/components/Sheet/SheetContent.d.ts.map +0 -1
- package/dist/components/Sheet/SheetContent.js +0 -4
- package/dist/components/Sheet/SheetContent.jsx +0 -3
- package/dist/components/Sheet/SheetContext.d.ts +0 -12
- package/dist/components/Sheet/SheetContext.d.ts.map +0 -1
- package/dist/components/Sheet/SheetContext.js +0 -2
- package/dist/components/Sheet/SheetHeader.d.ts +0 -4
- package/dist/components/Sheet/SheetHeader.d.ts.map +0 -1
- package/dist/components/Sheet/SheetHeader.js +0 -11
- package/dist/components/Sheet/SheetHeader.jsx +0 -10
- package/dist/components/Sheet/SheetPortal.d.ts +0 -4
- package/dist/components/Sheet/SheetPortal.d.ts.map +0 -1
- package/dist/components/Sheet/SheetPortal.js +0 -11
- package/dist/components/Sheet/SheetPortal.jsx +0 -16
- package/dist/components/Sheet/SheetRoot.d.ts +0 -4
- package/dist/components/Sheet/SheetRoot.d.ts.map +0 -1
- package/dist/components/Sheet/SheetRoot.js +0 -35
- package/dist/components/Sheet/SheetRoot.jsx +0 -36
- package/dist/components/Sheet/SheetToggle.d.ts +0 -4
- package/dist/components/Sheet/SheetToggle.d.ts.map +0 -1
- package/dist/components/Sheet/SheetToggle.js +0 -11
- package/dist/components/Sheet/SheetToggle.jsx +0 -10
- package/dist/components/ShowMore/ShowMore.d.ts +0 -10
- package/dist/components/ShowMore/ShowMore.d.ts.map +0 -1
- package/dist/components/ShowMore/ShowMore.js +0 -9
- package/dist/components/ShowMore/ShowMoreContent.d.ts +0 -4
- package/dist/components/ShowMore/ShowMoreContent.d.ts.map +0 -1
- package/dist/components/ShowMore/ShowMoreContent.js +0 -19
- package/dist/components/ShowMore/ShowMoreContent.jsx +0 -20
- package/dist/components/ShowMore/ShowMoreContext.d.ts +0 -10
- package/dist/components/ShowMore/ShowMoreContext.d.ts.map +0 -1
- package/dist/components/ShowMore/ShowMoreContext.js +0 -2
- package/dist/components/ShowMore/ShowMoreFade.d.ts +0 -4
- package/dist/components/ShowMore/ShowMoreFade.d.ts.map +0 -1
- package/dist/components/ShowMore/ShowMoreFade.js +0 -8
- package/dist/components/ShowMore/ShowMoreFade.jsx +0 -7
- package/dist/components/ShowMore/ShowMoreRoot.d.ts +0 -7
- package/dist/components/ShowMore/ShowMoreRoot.d.ts.map +0 -1
- package/dist/components/ShowMore/ShowMoreRoot.js +0 -21
- package/dist/components/ShowMore/ShowMoreRoot.jsx +0 -22
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts +0 -4
- package/dist/components/ShowMore/ShowMoreTrigger.d.ts.map +0 -1
- package/dist/components/ShowMore/ShowMoreTrigger.js +0 -14
- package/dist/components/ShowMore/ShowMoreTrigger.jsx +0 -13
- package/dist/components/Slide/Slide.d.ts +0 -12
- package/dist/components/Slide/Slide.d.ts.map +0 -1
- package/dist/components/Slide/Slide.js +0 -11
- package/dist/components/Slide/SlideBody.d.ts +0 -4
- package/dist/components/Slide/SlideBody.d.ts.map +0 -1
- package/dist/components/Slide/SlideBody.jsx +0 -3
- package/dist/components/Slide/SlideContext.d.ts +0 -7
- package/dist/components/Slide/SlideContext.d.ts.map +0 -1
- package/dist/components/Slide/SlideContext.js +0 -5
- package/dist/components/Slide/SlideHeader.d.ts +0 -4
- package/dist/components/Slide/SlideHeader.d.ts.map +0 -1
- package/dist/components/Slide/SlideHeader.jsx +0 -3
- package/dist/components/Slide/SlidePortal.d.ts +0 -4
- package/dist/components/Slide/SlidePortal.d.ts.map +0 -1
- package/dist/components/Slide/SlidePortal.jsx +0 -11
- package/dist/components/Slide/SlideRoot.d.ts +0 -6
- package/dist/components/Slide/SlideRoot.d.ts.map +0 -1
- package/dist/components/Slide/SlideRoot.jsx +0 -35
- package/dist/components/Slide/SlideToggle.d.ts +0 -4
- package/dist/components/Slide/SlideToggle.d.ts.map +0 -1
- package/dist/components/Slide/SlideToggle.jsx +0 -10
- package/dist/components/Spoiler/Spoiler.d.ts +0 -6
- package/dist/components/Spoiler/Spoiler.d.ts.map +0 -1
- package/dist/components/Spoiler/Spoiler.js +0 -5
- package/dist/components/Spoiler/SpoilerBlur.d.ts +0 -4
- package/dist/components/Spoiler/SpoilerBlur.d.ts.map +0 -1
- package/dist/components/Spoiler/SpoilerBlur.js +0 -9
- package/dist/components/Spoiler/SpoilerBlur.jsx +0 -8
- package/dist/components/Spoiler/SpoilerContext.d.ts +0 -7
- package/dist/components/Spoiler/SpoilerContext.d.ts.map +0 -1
- package/dist/components/Spoiler/SpoilerContext.js +0 -2
- package/dist/components/Spoiler/SpoilerRoot.d.ts +0 -4
- package/dist/components/Spoiler/SpoilerRoot.d.ts.map +0 -1
- package/dist/components/Spoiler/SpoilerRoot.js +0 -9
- package/dist/components/Spoiler/SpoilerRoot.jsx +0 -10
- package/dist/components/Steps/Steps.d.ts +0 -19
- package/dist/components/Steps/Steps.d.ts.map +0 -1
- package/dist/components/Steps/Steps.js +0 -14
- package/dist/components/Steps/StepsContext.d.ts +0 -14
- package/dist/components/Steps/StepsContext.d.ts.map +0 -1
- package/dist/components/Steps/StepsContext.js +0 -2
- package/dist/components/Steps/StepsContext.jsx +0 -2
- package/dist/components/Steps/StepsControls.d.ts +0 -4
- package/dist/components/Steps/StepsControls.d.ts.map +0 -1
- package/dist/components/Steps/StepsControls.jsx +0 -34
- package/dist/components/Steps/StepsIndexBtn.d.ts +0 -6
- package/dist/components/Steps/StepsIndexBtn.d.ts.map +0 -1
- package/dist/components/Steps/StepsIndexBtn.js +0 -11
- package/dist/components/Steps/StepsIndexBtn.jsx +0 -10
- package/dist/components/Steps/StepsNextBtn.d.ts +0 -6
- package/dist/components/Steps/StepsNextBtn.d.ts.map +0 -1
- package/dist/components/Steps/StepsNextBtn.js +0 -11
- package/dist/components/Steps/StepsNextBtn.jsx +0 -10
- package/dist/components/Steps/StepsPrevBtn.d.ts +0 -6
- package/dist/components/Steps/StepsPrevBtn.d.ts.map +0 -1
- package/dist/components/Steps/StepsPrevBtn.js +0 -11
- package/dist/components/Steps/StepsPrevBtn.jsx +0 -10
- package/dist/components/Steps/StepsRender.d.ts +0 -2
- package/dist/components/Steps/StepsRender.d.ts.map +0 -1
- package/dist/components/Steps/StepsRender.js +0 -7
- package/dist/components/Steps/StepsRender.jsx +0 -7
- package/dist/components/Steps/StepsSearchParamsRoot.d.ts +0 -8
- package/dist/components/Steps/StepsSearchParamsRoot.d.ts.map +0 -1
- package/dist/components/Steps/StepsSearchParamsRoot.js +0 -29
- package/dist/components/Steps/StepsSearchParamsRoot.jsx +0 -30
- package/dist/components/Steps/StepsStateRoot.d.ts +0 -7
- package/dist/components/Steps/StepsStateRoot.d.ts.map +0 -1
- package/dist/components/Steps/StepsStateRoot.js +0 -10
- package/dist/components/Steps/StepsStateRoot.jsx +0 -11
- package/dist/components/Submit/Submit.d.ts +0 -6
- package/dist/components/Submit/Submit.d.ts.map +0 -1
- package/dist/components/Submit/Submit.js +0 -5
- package/dist/components/Submit/SubmitContext.d.ts +0 -5
- package/dist/components/Submit/SubmitContext.d.ts.map +0 -1
- package/dist/components/Submit/SubmitContext.js +0 -2
- package/dist/components/Submit/SubmitLoader.d.ts +0 -6
- package/dist/components/Submit/SubmitLoader.d.ts.map +0 -1
- package/dist/components/Submit/SubmitLoader.js +0 -7
- package/dist/components/Submit/SubmitRoot.d.ts +0 -6
- package/dist/components/Submit/SubmitRoot.d.ts.map +0 -1
- package/dist/components/Submit/SubmitRoot.js +0 -8
- package/dist/components/Swap/Swap.d.ts +0 -8
- package/dist/components/Swap/Swap.d.ts.map +0 -1
- package/dist/components/Swap/Swap.js +0 -7
- package/dist/components/Swap/SwapContext.d.ts +0 -7
- package/dist/components/Swap/SwapContext.d.ts.map +0 -1
- package/dist/components/Swap/SwapContext.js +0 -2
- package/dist/components/Swap/SwapItem.d.ts +0 -4
- package/dist/components/Swap/SwapItem.d.ts.map +0 -1
- package/dist/components/Swap/SwapItem.js +0 -6
- package/dist/components/Swap/SwapItem.jsx +0 -5
- package/dist/components/Swap/SwapRoot.d.ts +0 -8
- package/dist/components/Swap/SwapRoot.d.ts.map +0 -1
- package/dist/components/Swap/SwapRoot.js +0 -13
- package/dist/components/Swap/SwapRoot.jsx +0 -16
- package/dist/components/Swap/SwapTrigger.d.ts +0 -6
- package/dist/components/Swap/SwapTrigger.d.ts.map +0 -1
- package/dist/components/Swap/SwapTrigger.js +0 -17
- package/dist/components/Swap/SwapTrigger.jsx +0 -16
- package/dist/components/Tabs/Tabs.d.ts +0 -10
- package/dist/components/Tabs/Tabs.d.ts.map +0 -1
- package/dist/components/Tabs/Tabs.js +0 -9
- package/dist/components/Tabs/TabsContext.d.ts +0 -7
- package/dist/components/Tabs/TabsContext.d.ts.map +0 -1
- package/dist/components/Tabs/TabsContext.js +0 -5
- package/dist/components/Tabs/TabsList.d.ts +0 -4
- package/dist/components/Tabs/TabsList.d.ts.map +0 -1
- package/dist/components/Tabs/TabsList.js +0 -5
- package/dist/components/Tabs/TabsList.jsx +0 -4
- package/dist/components/Tabs/TabsPanel.d.ts +0 -6
- package/dist/components/Tabs/TabsPanel.d.ts.map +0 -1
- package/dist/components/Tabs/TabsPanel.js +0 -9
- package/dist/components/Tabs/TabsPanel.jsx +0 -8
- package/dist/components/Tabs/TabsRoot.d.ts +0 -7
- package/dist/components/Tabs/TabsRoot.d.ts.map +0 -1
- package/dist/components/Tabs/TabsRoot.js +0 -6
- package/dist/components/Tabs/TabsRoot.jsx +0 -7
- package/dist/components/Tabs/TabsTab.d.ts +0 -6
- package/dist/components/Tabs/TabsTab.d.ts.map +0 -1
- package/dist/components/Tabs/TabsTab.js +0 -11
- package/dist/components/Tabs/TabsTab.jsx +0 -10
- package/dist/components/Toast/Toast.d.ts +0 -4
- package/dist/components/Toast/Toast.d.ts.map +0 -1
- package/dist/components/Toast/Toast.js +0 -3
- package/dist/components/Toast/ToastBox.d.ts +0 -6
- package/dist/components/Toast/ToastBox.d.ts.map +0 -1
- package/dist/components/Toast/ToastBox.jsx +0 -32
- package/dist/components/Toast/ToastRoot.d.ts +0 -15
- package/dist/components/Toast/ToastRoot.d.ts.map +0 -1
- package/dist/components/Toast/ToastRoot.jsx +0 -38
- package/dist/components/Toast/toastStore.d.ts +0 -11
- package/dist/components/Toast/toastStore.d.ts.map +0 -1
- package/dist/components/Toast/toastStore.js +0 -10
- package/dist/components/Toggle/Toggle.d.ts +0 -6
- package/dist/components/Toggle/Toggle.d.ts.map +0 -1
- package/dist/components/Toggle/Toggle.js +0 -5
- package/dist/components/Toggle/ToggleContext.d.ts +0 -8
- package/dist/components/Toggle/ToggleContext.d.ts.map +0 -1
- package/dist/components/Toggle/ToggleContext.js +0 -2
- package/dist/components/Toggle/ToggleRoot.d.ts +0 -8
- package/dist/components/Toggle/ToggleRoot.d.ts.map +0 -1
- package/dist/components/Toggle/ToggleRoot.jsx +0 -13
- package/dist/components/Toggle/ToggleSwitch.d.ts +0 -4
- package/dist/components/Toggle/ToggleSwitch.d.ts.map +0 -1
- package/dist/components/Toggle/ToggleSwitch.jsx +0 -23
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/browser.d.ts +0 -3
- package/dist/utils/browser.d.ts.map +0 -1
- package/dist/utils/browser.js +0 -21
- package/dist/utils/cn.d.ts +0 -3
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -3
- package/dist/utils/form.d.ts +0 -2
- package/dist/utils/form.d.ts.map +0 -1
- package/dist/utils/form.js +0 -8
- package/dist/utils.d.ts.map +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1824 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
AccessNavigation: () => AccessNavigation,
|
|
34
|
+
Accordion: () => Accordion,
|
|
35
|
+
Affix: () => Affix,
|
|
36
|
+
Breadcrumbs: () => Breadcrumbs,
|
|
37
|
+
Carousel: () => Carousel,
|
|
38
|
+
ClientOnly: () => ClientOnly,
|
|
39
|
+
Clipboard: () => Clipboard,
|
|
40
|
+
ContextMenu: () => ContextMenu,
|
|
41
|
+
Drawer: () => Drawer,
|
|
42
|
+
LoaderLink: () => LoaderLink,
|
|
43
|
+
Modal: () => Modal,
|
|
44
|
+
Otp: () => Otp,
|
|
45
|
+
PaginationWithSearchParams: () => PaginationWithSearchParams,
|
|
46
|
+
PaginationWithState: () => PaginationWithState,
|
|
47
|
+
PasswordInput: () => PasswordInput,
|
|
48
|
+
Popover: () => Popover,
|
|
49
|
+
Portal: () => Portal,
|
|
50
|
+
Progress: () => Progress,
|
|
51
|
+
QrCode: () => QrCode,
|
|
52
|
+
Rating: () => Rating,
|
|
53
|
+
Sheet: () => Sheet,
|
|
54
|
+
ShowMore: () => ShowMore,
|
|
55
|
+
Spoiler: () => Spoiler,
|
|
56
|
+
StepsWithSearchParams: () => StepsWithSearchParams,
|
|
57
|
+
StepsWithState: () => StepsWithState,
|
|
58
|
+
Submit: () => Submit,
|
|
59
|
+
Swap: () => Swap,
|
|
60
|
+
Tabs: () => Tabs
|
|
61
|
+
});
|
|
62
|
+
module.exports = __toCommonJS(index_exports);
|
|
63
|
+
|
|
64
|
+
// src/utils/browser.ts
|
|
65
|
+
var getBrowserScrollbarWith = () => {
|
|
66
|
+
const outer = document.createElement("div");
|
|
67
|
+
outer.style.visibility = "hidden";
|
|
68
|
+
outer.style.overflow = "scroll";
|
|
69
|
+
document.body.appendChild(outer);
|
|
70
|
+
const inner = document.createElement("div");
|
|
71
|
+
outer.appendChild(inner);
|
|
72
|
+
const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
|
|
73
|
+
outer.parentNode?.removeChild(outer);
|
|
74
|
+
return scrollbarWidth;
|
|
75
|
+
};
|
|
76
|
+
var selectAccessibleChildren = (parent) => {
|
|
77
|
+
const children = Array.from(
|
|
78
|
+
parent.querySelectorAll(`
|
|
79
|
+
a:not([tabindex="-1"]),
|
|
80
|
+
input:not([disabled],[tabindex="-1"]),
|
|
81
|
+
select:not([disabled],[tabindex="-1"]),
|
|
82
|
+
textarea:not([disabled],[tabindex="-1"]),
|
|
83
|
+
button:not([disabled],[tabindex="-1"])
|
|
84
|
+
`)
|
|
85
|
+
);
|
|
86
|
+
return children;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/utils/cn.ts
|
|
90
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
91
|
+
var import_clsx = require("clsx");
|
|
92
|
+
var cn = (...inputs) => (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
93
|
+
|
|
94
|
+
// src/components/AccessNavigation/AccessNavigation.tsx
|
|
95
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
96
|
+
function AccessNavigation({ direction = "y", dir, onKeyDown, ...p }) {
|
|
97
|
+
const handleKeyDown = (ev) => {
|
|
98
|
+
const focusableChildren = selectAccessibleChildren(ev.currentTarget);
|
|
99
|
+
if (!focusableChildren.length) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const currentDir = dir || document.documentElement.getAttribute("dir") || "ltr";
|
|
103
|
+
const currentIndex = focusableChildren.findIndex((item) => item === document.activeElement);
|
|
104
|
+
if (ev.key === (direction === "y" ? "ArrowDown" : currentDir === "ltr" ? "ArrowRight" : "ArrowLeft")) {
|
|
105
|
+
ev.preventDefault();
|
|
106
|
+
const nextIndex = currentIndex === -1 || currentIndex === focusableChildren.length - 1 ? 0 : currentIndex + 1;
|
|
107
|
+
focusableChildren[nextIndex]?.focus();
|
|
108
|
+
}
|
|
109
|
+
if (ev.key === (direction === "y" ? "ArrowUp" : currentDir === "ltr" ? "ArrowLeft" : "ArrowRight")) {
|
|
110
|
+
ev.preventDefault();
|
|
111
|
+
const prevIndex = currentIndex <= 0 ? focusableChildren.length - 1 : currentIndex - 1;
|
|
112
|
+
focusableChildren[prevIndex]?.focus();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
dir,
|
|
119
|
+
onKeyDown: (ev) => {
|
|
120
|
+
onKeyDown?.(ev);
|
|
121
|
+
handleKeyDown(ev);
|
|
122
|
+
},
|
|
123
|
+
...p
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// src/components/Accordion/AccordionBody.tsx
|
|
129
|
+
var import_react2 = require("react");
|
|
130
|
+
var import_framer_motion = require("framer-motion");
|
|
131
|
+
|
|
132
|
+
// src/components/Accordion/AccordionContext.ts
|
|
133
|
+
var import_react = require("react");
|
|
134
|
+
var AccordionContext = (0, import_react.createContext)({});
|
|
135
|
+
|
|
136
|
+
// src/components/Accordion/AccordionBody.tsx
|
|
137
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
138
|
+
function AccordionBody({ children, ...props }) {
|
|
139
|
+
const { isOpen } = (0, import_react2.use)(AccordionContext);
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_framer_motion.AnimatePresence, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
141
|
+
import_framer_motion.motion.div,
|
|
142
|
+
{
|
|
143
|
+
initial: { height: 0, opacity: 0 },
|
|
144
|
+
animate: { height: "auto", opacity: 1 },
|
|
145
|
+
exit: { height: 0, opacity: 0 },
|
|
146
|
+
...props,
|
|
147
|
+
children
|
|
148
|
+
}
|
|
149
|
+
) : null });
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/components/Accordion/AccordionRoot.tsx
|
|
153
|
+
var import_react3 = require("react");
|
|
154
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
155
|
+
function AccordionRoot({ children }) {
|
|
156
|
+
const [isOpen, setOpen] = (0, import_react3.useState)(false);
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AccordionContext, { value: { isOpen, setOpen }, children });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// src/components/Accordion/AccordionToggle.tsx
|
|
161
|
+
var import_react4 = require("react");
|
|
162
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
163
|
+
function AccordionToggle({ className, onClick, ...props }) {
|
|
164
|
+
const { isOpen, setOpen } = (0, import_react4.use)(AccordionContext);
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
166
|
+
"button",
|
|
167
|
+
{
|
|
168
|
+
onClick: (ev) => {
|
|
169
|
+
onClick?.(ev);
|
|
170
|
+
setOpen((prev) => !prev);
|
|
171
|
+
},
|
|
172
|
+
className: cn(
|
|
173
|
+
isOpen ? "accordion-active" : null,
|
|
174
|
+
className
|
|
175
|
+
),
|
|
176
|
+
...props
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// src/components/Accordion/Accordion.ts
|
|
182
|
+
var Accordion = Object.assign(AccordionRoot, {
|
|
183
|
+
Toggle: AccordionToggle,
|
|
184
|
+
Body: AccordionBody
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// src/components/Affix/Affix.tsx
|
|
188
|
+
var import_react5 = require("react");
|
|
189
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
190
|
+
var Affix = ({ className, onClick, ...p }) => {
|
|
191
|
+
const [isVisible, setIsVisible] = (0, import_react5.useState)(false);
|
|
192
|
+
const [lastScrollY, setLastScrollY] = (0, import_react5.useState)(0);
|
|
193
|
+
(0, import_react5.useEffect)(() => {
|
|
194
|
+
const handleScroll = () => {
|
|
195
|
+
const currentScrollY = window.scrollY;
|
|
196
|
+
const viewportHeight = window.innerHeight;
|
|
197
|
+
const scrollThreshold = viewportHeight * 0.5;
|
|
198
|
+
if (currentScrollY > scrollThreshold && currentScrollY > lastScrollY) {
|
|
199
|
+
setIsVisible(true);
|
|
200
|
+
} else if (currentScrollY < lastScrollY && currentScrollY < scrollThreshold) {
|
|
201
|
+
setIsVisible(false);
|
|
202
|
+
}
|
|
203
|
+
setLastScrollY(currentScrollY);
|
|
204
|
+
};
|
|
205
|
+
window.addEventListener("scroll", handleScroll, {
|
|
206
|
+
passive: true
|
|
207
|
+
});
|
|
208
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
209
|
+
}, [lastScrollY]);
|
|
210
|
+
const scrollToTop = () => {
|
|
211
|
+
window.scrollTo({
|
|
212
|
+
top: 0,
|
|
213
|
+
behavior: "smooth"
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
217
|
+
"button",
|
|
218
|
+
{
|
|
219
|
+
onClick: (ev) => {
|
|
220
|
+
onClick?.(ev);
|
|
221
|
+
scrollToTop();
|
|
222
|
+
},
|
|
223
|
+
className: cn(
|
|
224
|
+
isVisible ? "affix-active" : null,
|
|
225
|
+
className
|
|
226
|
+
),
|
|
227
|
+
...p
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// src/components/Breadcrumbs/BreadcrumbsItem.tsx
|
|
233
|
+
var import_react7 = require("react");
|
|
234
|
+
|
|
235
|
+
// src/components/Breadcrumbs/BreadcrumbsContext.ts
|
|
236
|
+
var import_react6 = require("react");
|
|
237
|
+
var BreadcrumbsContext = (0, import_react6.createContext)({});
|
|
238
|
+
|
|
239
|
+
// src/components/Breadcrumbs/BreadcrumbsItem.tsx
|
|
240
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
241
|
+
function BreadcrumbsItem({ isLast = false, children, ...p }) {
|
|
242
|
+
const { separator } = (0, import_react7.use)(BreadcrumbsContext);
|
|
243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ...p, children: [
|
|
244
|
+
children,
|
|
245
|
+
!isLast && separator
|
|
246
|
+
] });
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// src/components/Breadcrumbs/BreadcrumbsRoot.tsx
|
|
250
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
251
|
+
function BreadcrumbsRoot({ separator = "/", ...p }) {
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BreadcrumbsContext, { value: { separator }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { ...p }) });
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/components/Breadcrumbs/Breadcrumbs.ts
|
|
256
|
+
var Breadcrumbs = Object.assign(BreadcrumbsRoot, {
|
|
257
|
+
Item: BreadcrumbsItem
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// src/components/Carousel/CarouselRoot.tsx
|
|
261
|
+
var import_react9 = require("react");
|
|
262
|
+
|
|
263
|
+
// src/components/Carousel/CarouselContext.ts
|
|
264
|
+
var import_react8 = require("react");
|
|
265
|
+
var CarouselContext = (0, import_react8.createContext)({});
|
|
266
|
+
|
|
267
|
+
// src/components/Carousel/CarouselRoot.tsx
|
|
268
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
269
|
+
function CarouselRoot({ dir, ...p }) {
|
|
270
|
+
const scrollRef = (0, import_react9.useRef)(null);
|
|
271
|
+
const [leftOpacity, setLeftOpacity] = (0, import_react9.useState)(0);
|
|
272
|
+
const [rightOpacity, setRightOpacity] = (0, import_react9.useState)(1);
|
|
273
|
+
const updateFade = () => {
|
|
274
|
+
const el = scrollRef.current;
|
|
275
|
+
if (!el) return;
|
|
276
|
+
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
277
|
+
const maxScroll = scrollWidth - clientWidth;
|
|
278
|
+
if (maxScroll <= 0) {
|
|
279
|
+
setLeftOpacity(0);
|
|
280
|
+
setRightOpacity(0);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const scrollRatio = Math.abs(+(scrollLeft / maxScroll));
|
|
284
|
+
const left = +Math.min(1, scrollRatio * 2).toFixed(1);
|
|
285
|
+
const right = +Math.min(1, (1 - scrollRatio) * 2).toFixed(1);
|
|
286
|
+
const currentDir = dir || document.documentElement.getAttribute("dir") || "ltr";
|
|
287
|
+
setLeftOpacity(currentDir === "ltr" ? right : left);
|
|
288
|
+
setRightOpacity(currentDir === "ltr" ? left : right);
|
|
289
|
+
};
|
|
290
|
+
(0, import_react9.useEffect)(() => {
|
|
291
|
+
const el = scrollRef.current;
|
|
292
|
+
if (!el) return;
|
|
293
|
+
updateFade();
|
|
294
|
+
el.addEventListener("scroll", updateFade);
|
|
295
|
+
window.addEventListener("resize", updateFade);
|
|
296
|
+
return () => {
|
|
297
|
+
el.removeEventListener("scroll", updateFade);
|
|
298
|
+
window.removeEventListener("resize", updateFade);
|
|
299
|
+
};
|
|
300
|
+
}, []);
|
|
301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CarouselContext, { value: { scrollRef, leftOpacity, rightOpacity }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ...p }) });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// src/components/Carousel/CarouselLeftFade.tsx
|
|
305
|
+
var import_react10 = require("react");
|
|
306
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
307
|
+
function CarouselLeftFade({ style, ...p }) {
|
|
308
|
+
const { leftOpacity } = (0, import_react10.use)(CarouselContext);
|
|
309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
style: {
|
|
313
|
+
opacity: leftOpacity,
|
|
314
|
+
...style
|
|
315
|
+
},
|
|
316
|
+
...p
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// src/components/Carousel/CarouselContainer.tsx
|
|
322
|
+
var import_react11 = require("react");
|
|
323
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
324
|
+
function CarouselContainer({ children, ...p }) {
|
|
325
|
+
const { scrollRef } = (0, import_react11.use)(CarouselContext);
|
|
326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: scrollRef, ...p, children });
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// src/components/Carousel/CarouselRightFade.tsx
|
|
330
|
+
var import_react12 = require("react");
|
|
331
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
332
|
+
function CarouselRightFade({ style, ...p }) {
|
|
333
|
+
const { rightOpacity } = (0, import_react12.use)(CarouselContext);
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
335
|
+
"div",
|
|
336
|
+
{
|
|
337
|
+
style: {
|
|
338
|
+
opacity: rightOpacity,
|
|
339
|
+
...style
|
|
340
|
+
},
|
|
341
|
+
...p
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/components/Carousel/Carousel.ts
|
|
347
|
+
var Carousel = Object.assign(CarouselRoot, {
|
|
348
|
+
Container: CarouselContainer,
|
|
349
|
+
LeftFade: CarouselLeftFade,
|
|
350
|
+
RightFade: CarouselRightFade
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// src/components/ClientOnly/ClientOnly.tsx
|
|
354
|
+
var import_hooks = require("@mantine/hooks");
|
|
355
|
+
function ClientOnly({ children }) {
|
|
356
|
+
const mounted = (0, import_hooks.useMounted)();
|
|
357
|
+
return mounted ? children : null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// src/components/Clipboard/Clipboard.tsx
|
|
361
|
+
var import_hooks2 = require("@mantine/hooks");
|
|
362
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
363
|
+
function Clipboard({ copiedChildren, onClick, children, text, timeout = 3e3, ...props }) {
|
|
364
|
+
const { copy, copied } = (0, import_hooks2.useClipboard)({ timeout });
|
|
365
|
+
const handleClick = (ev) => {
|
|
366
|
+
onClick?.(ev);
|
|
367
|
+
copy(text.trim());
|
|
368
|
+
};
|
|
369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
370
|
+
"button",
|
|
371
|
+
{
|
|
372
|
+
"aria-label": text,
|
|
373
|
+
onClick: handleClick,
|
|
374
|
+
...props,
|
|
375
|
+
children: copiedChildren && copied ? copiedChildren : children
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// src/components/ContextMenu/ContextMenuRoot.tsx
|
|
381
|
+
var import_react14 = require("react");
|
|
382
|
+
|
|
383
|
+
// src/components/ContextMenu/ContextMenuContext.ts
|
|
384
|
+
var import_react13 = require("react");
|
|
385
|
+
var ContextMenuContext = (0, import_react13.createContext)({});
|
|
386
|
+
|
|
387
|
+
// src/components/ContextMenu/ContextMenuRoot.tsx
|
|
388
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
389
|
+
function ContextMenuRoot({ onContextMenu, ...p }) {
|
|
390
|
+
const [position, setPosition] = (0, import_react14.useState)(void 0);
|
|
391
|
+
const [isOpen, setOpen] = (0, import_react14.useState)(false);
|
|
392
|
+
const contentRef = (0, import_react14.useRef)(null);
|
|
393
|
+
const handleClickOutside = (0, import_react14.useCallback)((ev) => {
|
|
394
|
+
if (!contentRef.current?.contains(ev.target)) {
|
|
395
|
+
setOpen(false);
|
|
396
|
+
setPosition(void 0);
|
|
397
|
+
}
|
|
398
|
+
}, []);
|
|
399
|
+
(0, import_react14.useEffect)(() => {
|
|
400
|
+
document.addEventListener("click", handleClickOutside);
|
|
401
|
+
return () => document.removeEventListener("click", handleClickOutside);
|
|
402
|
+
}, [handleClickOutside]);
|
|
403
|
+
(0, import_react14.useEffect)(() => {
|
|
404
|
+
const scrollbarWidth = getBrowserScrollbarWith();
|
|
405
|
+
if (isOpen) {
|
|
406
|
+
document.body.style.overflow = "hidden";
|
|
407
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
408
|
+
} else {
|
|
409
|
+
document.body.style.overflow = "unset";
|
|
410
|
+
document.body.style.paddingRight = "0px";
|
|
411
|
+
}
|
|
412
|
+
;
|
|
413
|
+
}, [isOpen]);
|
|
414
|
+
const handleContextMenu = (ev) => {
|
|
415
|
+
if (!contentRef.current) return;
|
|
416
|
+
ev.preventDefault();
|
|
417
|
+
const viewportWidth = window.innerWidth;
|
|
418
|
+
const viewportHeight = window.innerHeight;
|
|
419
|
+
const menuWidth = contentRef.current.scrollWidth;
|
|
420
|
+
const menuHeight = contentRef.current.scrollHeight;
|
|
421
|
+
let x = ev.clientX;
|
|
422
|
+
let y = ev.clientY;
|
|
423
|
+
if (x + menuWidth > viewportWidth) {
|
|
424
|
+
x = viewportWidth - menuWidth - 10;
|
|
425
|
+
}
|
|
426
|
+
if (y + menuHeight > viewportHeight) {
|
|
427
|
+
y = viewportHeight - menuHeight - 10;
|
|
428
|
+
}
|
|
429
|
+
setPosition({ x, y });
|
|
430
|
+
setOpen(true);
|
|
431
|
+
};
|
|
432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ContextMenuContext, { value: { contentRef, isOpen, position }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
onContextMenu: (ev) => {
|
|
436
|
+
onContextMenu?.(ev);
|
|
437
|
+
handleContextMenu(ev);
|
|
438
|
+
},
|
|
439
|
+
...p
|
|
440
|
+
}
|
|
441
|
+
) });
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// src/components/ContextMenu/ContextMenuContent.tsx
|
|
445
|
+
var import_react15 = require("react");
|
|
446
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
447
|
+
function ContextMenuContent({ onContextMenu, className, ...p }) {
|
|
448
|
+
const { contentRef, position, isOpen } = (0, import_react15.use)(ContextMenuContext);
|
|
449
|
+
(0, import_react15.useEffect)(() => {
|
|
450
|
+
if (!contentRef.current) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (isOpen) {
|
|
454
|
+
const children = selectAccessibleChildren(contentRef.current);
|
|
455
|
+
const firstChild = children[0];
|
|
456
|
+
if (!firstChild) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
firstChild.focus();
|
|
460
|
+
}
|
|
461
|
+
}, [isOpen, position, contentRef]);
|
|
462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
463
|
+
"div",
|
|
464
|
+
{
|
|
465
|
+
ref: contentRef,
|
|
466
|
+
onContextMenu: (ev) => {
|
|
467
|
+
ev.stopPropagation();
|
|
468
|
+
ev.preventDefault();
|
|
469
|
+
onContextMenu?.(ev);
|
|
470
|
+
},
|
|
471
|
+
className: cn(
|
|
472
|
+
isOpen ? "context-menu-active" : null,
|
|
473
|
+
className
|
|
474
|
+
),
|
|
475
|
+
style: {
|
|
476
|
+
top: position?.y,
|
|
477
|
+
left: position?.x
|
|
478
|
+
},
|
|
479
|
+
...p
|
|
480
|
+
}
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// src/components/ContextMenu/ContextMenu.ts
|
|
485
|
+
var ContextMenu = Object.assign(ContextMenuRoot, {
|
|
486
|
+
Content: ContextMenuContent
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
// src/components/Drawer/DrawerBody.tsx
|
|
490
|
+
var import_framer_motion2 = require("framer-motion");
|
|
491
|
+
var import_react17 = require("react");
|
|
492
|
+
|
|
493
|
+
// src/components/Drawer/DrawerContext.ts
|
|
494
|
+
var import_react16 = require("react");
|
|
495
|
+
var DrawerContext = (0, import_react16.createContext)({});
|
|
496
|
+
|
|
497
|
+
// src/components/Drawer/DrawerBody.tsx
|
|
498
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
499
|
+
function DrawerBody({ position, dir, children, ...p }) {
|
|
500
|
+
const { isOpen } = (0, import_react17.use)(DrawerContext);
|
|
501
|
+
const bodyRef = (0, import_react17.useRef)(null);
|
|
502
|
+
(0, import_react17.useEffect)(() => {
|
|
503
|
+
if (isOpen) {
|
|
504
|
+
const indexElement = bodyRef.current?.querySelector("[data-drawer='index']");
|
|
505
|
+
indexElement?.focus();
|
|
506
|
+
}
|
|
507
|
+
;
|
|
508
|
+
}, [isOpen]);
|
|
509
|
+
const currentDir = dir || document.documentElement.getAttribute("dir") || "ltr";
|
|
510
|
+
const currentPosition = position || (currentDir === "ltr" ? "left" : "right");
|
|
511
|
+
const direction = ["right", "left"].includes(currentPosition) ? "y" : "x";
|
|
512
|
+
const width = direction === "y" ? "clamp(300px,30%,30%)" : void 0;
|
|
513
|
+
const height = direction === "y" ? void 0 : "50%";
|
|
514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
515
|
+
import_framer_motion2.motion.div,
|
|
516
|
+
{
|
|
517
|
+
ref: bodyRef,
|
|
518
|
+
onClick: (ev) => ev.stopPropagation(),
|
|
519
|
+
initial: direction === "y" ? { x: currentPosition === "left" ? "-100%" : "100%" } : { y: currentPosition === "top" ? "-100%" : "100%" },
|
|
520
|
+
animate: { y: 0, x: 0 },
|
|
521
|
+
exit: direction === "y" ? { x: currentPosition === "left" ? "-100%" : "100%" } : { y: currentPosition === "top" ? "-100%" : "100%" },
|
|
522
|
+
style: {
|
|
523
|
+
width,
|
|
524
|
+
height,
|
|
525
|
+
...currentPosition === "top" ? { top: 0, left: 0, right: 0 } : currentPosition === "right" ? { top: 0, bottom: 0, right: 0 } : currentPosition === "bottom" ? { bottom: 0, left: 0, right: 0 } : { top: 0, bottom: 0, left: 0 }
|
|
526
|
+
},
|
|
527
|
+
transition: { ease: "easeInOut" },
|
|
528
|
+
...p,
|
|
529
|
+
children
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// src/components/Drawer/DrawerRoot.tsx
|
|
535
|
+
var import_react18 = require("react");
|
|
536
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
537
|
+
function DrawerRoot({ children }) {
|
|
538
|
+
const [isOpen, setOpen] = (0, import_react18.useState)(false);
|
|
539
|
+
(0, import_react18.useEffect)(() => {
|
|
540
|
+
const handleEscape = (ev) => {
|
|
541
|
+
if (ev.key === "Escape") {
|
|
542
|
+
setOpen(false);
|
|
543
|
+
}
|
|
544
|
+
;
|
|
545
|
+
};
|
|
546
|
+
document.addEventListener("keydown", handleEscape);
|
|
547
|
+
return () => {
|
|
548
|
+
document.removeEventListener("keydown", handleEscape);
|
|
549
|
+
document.body.style.overflow = "unset";
|
|
550
|
+
};
|
|
551
|
+
}, []);
|
|
552
|
+
(0, import_react18.useEffect)(() => {
|
|
553
|
+
const scrollbarWidth = getBrowserScrollbarWith();
|
|
554
|
+
if (isOpen) {
|
|
555
|
+
document.body.style.overflow = "hidden";
|
|
556
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
557
|
+
} else {
|
|
558
|
+
document.body.style.overflow = "unset";
|
|
559
|
+
document.body.style.paddingRight = "0px";
|
|
560
|
+
}
|
|
561
|
+
;
|
|
562
|
+
}, [isOpen]);
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerContext, { value: { isOpen, setOpen }, children });
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// src/components/Drawer/DrawerPortal.tsx
|
|
567
|
+
var import_react19 = require("react");
|
|
568
|
+
var import_framer_motion3 = require("framer-motion");
|
|
569
|
+
|
|
570
|
+
// src/components/Portal/Portal.tsx
|
|
571
|
+
var import_react_dom = require("react-dom");
|
|
572
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
573
|
+
function Portal({ children, container }) {
|
|
574
|
+
return (0, import_react_dom.createPortal)(
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children }),
|
|
576
|
+
container || document.body
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// src/components/Drawer/DrawerPortal.tsx
|
|
581
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
582
|
+
function DrawerPortal({ onClick, ...p }) {
|
|
583
|
+
const { isOpen, setOpen } = (0, import_react19.use)(DrawerContext);
|
|
584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ClientOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_framer_motion3.AnimatePresence, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
585
|
+
import_framer_motion3.motion.div,
|
|
586
|
+
{
|
|
587
|
+
initial: { opacity: 0 },
|
|
588
|
+
animate: { opacity: 1 },
|
|
589
|
+
exit: { opacity: 0 },
|
|
590
|
+
onClick: (ev) => {
|
|
591
|
+
onClick?.(ev);
|
|
592
|
+
setOpen(false);
|
|
593
|
+
},
|
|
594
|
+
...p
|
|
595
|
+
}
|
|
596
|
+
) : null }) }) });
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
// src/components/Drawer/DrawerToggle.tsx
|
|
600
|
+
var import_react20 = require("react");
|
|
601
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
602
|
+
function DrawerToggle({ onClick, ...props }) {
|
|
603
|
+
const { setOpen } = (0, import_react20.use)(DrawerContext);
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
605
|
+
"button",
|
|
606
|
+
{
|
|
607
|
+
onClick: (ev) => {
|
|
608
|
+
onClick?.(ev);
|
|
609
|
+
setOpen((prev) => !prev);
|
|
610
|
+
},
|
|
611
|
+
...props
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// src/components/Drawer/Drawer.ts
|
|
617
|
+
var Drawer = Object.assign(DrawerRoot, {
|
|
618
|
+
Toggle: DrawerToggle,
|
|
619
|
+
Portal: DrawerPortal,
|
|
620
|
+
Body: DrawerBody
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
// src/components/LoaderLink/LoaderLink.tsx
|
|
624
|
+
var import_link = require("next/link");
|
|
625
|
+
function LoaderLink({ loader, children }) {
|
|
626
|
+
const { pending } = (0, import_link.useLinkStatus)();
|
|
627
|
+
return pending ? loader : children;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// src/components/Modal/ModalRoot.tsx
|
|
631
|
+
var import_react22 = require("react");
|
|
632
|
+
|
|
633
|
+
// src/components/Modal/ModalContext.ts
|
|
634
|
+
var import_react21 = require("react");
|
|
635
|
+
var ModalContext = (0, import_react21.createContext)({});
|
|
636
|
+
|
|
637
|
+
// src/components/Modal/ModalRoot.tsx
|
|
638
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
639
|
+
function ModalRoot({ children, defaultOpen = false }) {
|
|
640
|
+
const [isOpen, setOpen] = (0, import_react22.useState)(defaultOpen);
|
|
641
|
+
(0, import_react22.useEffect)(() => {
|
|
642
|
+
const handleEscape = (e) => {
|
|
643
|
+
if (e.key === "Escape") {
|
|
644
|
+
setOpen(false);
|
|
645
|
+
}
|
|
646
|
+
;
|
|
647
|
+
};
|
|
648
|
+
document.addEventListener("keydown", handleEscape);
|
|
649
|
+
return () => {
|
|
650
|
+
document.removeEventListener("keydown", handleEscape);
|
|
651
|
+
document.body.style.overflow = "unset";
|
|
652
|
+
};
|
|
653
|
+
}, []);
|
|
654
|
+
(0, import_react22.useEffect)(() => {
|
|
655
|
+
const scrollbarWidth = getBrowserScrollbarWith();
|
|
656
|
+
if (isOpen) {
|
|
657
|
+
document.body.style.overflow = "hidden";
|
|
658
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
659
|
+
} else {
|
|
660
|
+
document.body.style.overflow = "unset";
|
|
661
|
+
document.body.style.paddingRight = "0px";
|
|
662
|
+
}
|
|
663
|
+
;
|
|
664
|
+
}, [isOpen]);
|
|
665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ModalContext, { value: { isOpen, setOpen }, children });
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// src/components/Modal/ModalBody.tsx
|
|
669
|
+
var import_react23 = require("react");
|
|
670
|
+
var import_framer_motion4 = require("framer-motion");
|
|
671
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
672
|
+
function ModalBody({ onClick, ...props }) {
|
|
673
|
+
const { isOpen } = (0, import_react23.use)(ModalContext);
|
|
674
|
+
const contentRef = (0, import_react23.useRef)(null);
|
|
675
|
+
(0, import_react23.useEffect)(() => {
|
|
676
|
+
if (isOpen) {
|
|
677
|
+
const indexElement = contentRef.current?.querySelector("[data-modal='index']");
|
|
678
|
+
indexElement?.focus();
|
|
679
|
+
}
|
|
680
|
+
;
|
|
681
|
+
}, [isOpen]);
|
|
682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_framer_motion4.AnimatePresence, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
683
|
+
import_framer_motion4.motion.div,
|
|
684
|
+
{
|
|
685
|
+
ref: contentRef,
|
|
686
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
687
|
+
animate: { opacity: 1, scale: 1 },
|
|
688
|
+
exit: { opacity: 0, scale: 0.9 },
|
|
689
|
+
transition: { ease: "easeInOut" },
|
|
690
|
+
onClick: (ev) => {
|
|
691
|
+
onClick?.(ev);
|
|
692
|
+
ev.stopPropagation();
|
|
693
|
+
},
|
|
694
|
+
...props
|
|
695
|
+
}
|
|
696
|
+
) : null });
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// src/components/Modal/ModalHeader.tsx
|
|
700
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
701
|
+
function ModalHeader(p) {
|
|
702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ...p });
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// src/components/Modal/ModalPortal.tsx
|
|
706
|
+
var import_react24 = require("react");
|
|
707
|
+
var import_framer_motion5 = require("framer-motion");
|
|
708
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
709
|
+
function ModalPortal({ onClick, ...p }) {
|
|
710
|
+
const { isOpen, setOpen } = (0, import_react24.use)(ModalContext);
|
|
711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ClientOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_framer_motion5.AnimatePresence, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
712
|
+
import_framer_motion5.motion.div,
|
|
713
|
+
{
|
|
714
|
+
initial: { opacity: 0 },
|
|
715
|
+
animate: { opacity: 1 },
|
|
716
|
+
exit: { opacity: 0 },
|
|
717
|
+
onClick: (ev) => {
|
|
718
|
+
onClick?.(ev);
|
|
719
|
+
setOpen(false);
|
|
720
|
+
},
|
|
721
|
+
...p
|
|
722
|
+
}
|
|
723
|
+
) : null }) }) });
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// src/components/Modal/ModalTrigger.tsx
|
|
727
|
+
var import_react25 = require("react");
|
|
728
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
729
|
+
function ModalToggle({ onClick, ...props }) {
|
|
730
|
+
const { setOpen } = (0, import_react25.use)(ModalContext);
|
|
731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
732
|
+
"button",
|
|
733
|
+
{
|
|
734
|
+
onClick: (ev) => {
|
|
735
|
+
onClick?.(ev);
|
|
736
|
+
setOpen((prev) => !prev);
|
|
737
|
+
},
|
|
738
|
+
...props
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// src/components/Modal/ModalContent.tsx
|
|
744
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
745
|
+
function ModalContent(p) {
|
|
746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...p });
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// src/components/Modal/Modal.ts
|
|
750
|
+
var Modal = Object.assign(ModalRoot, {
|
|
751
|
+
Toggle: ModalToggle,
|
|
752
|
+
Portal: ModalPortal,
|
|
753
|
+
Body: ModalBody,
|
|
754
|
+
Header: ModalHeader,
|
|
755
|
+
Content: ModalContent
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
// src/components/Otp/OtpRoot.tsx
|
|
759
|
+
var import_react27 = require("react");
|
|
760
|
+
|
|
761
|
+
// src/components/Otp/OtpContext.ts
|
|
762
|
+
var import_react26 = require("react");
|
|
763
|
+
var OtpContext = (0, import_react26.createContext)({
|
|
764
|
+
getInputsValue: () => ""
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
// src/components/Otp/OtpRoot.tsx
|
|
768
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
769
|
+
function OtpRoot(p) {
|
|
770
|
+
const inputs = (0, import_react27.useRef)([]);
|
|
771
|
+
(0, import_react27.useEffect)(() => {
|
|
772
|
+
inputs.current[0]?.focus();
|
|
773
|
+
}, []);
|
|
774
|
+
const getInputsValue = () => {
|
|
775
|
+
return inputs?.current.map((input) => input?.value || "").join("") || "";
|
|
776
|
+
};
|
|
777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(OtpContext, { value: { inputs, getInputsValue }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ...p }) });
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// src/components/Otp/OtpInputs.tsx
|
|
781
|
+
var import_react28 = require("react");
|
|
782
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
783
|
+
function OtpInputs({ name, length, onLastChange, ...props }) {
|
|
784
|
+
const { inputs, getInputsValue } = (0, import_react28.use)(OtpContext);
|
|
785
|
+
const handlePaste = (ev, startIndex) => {
|
|
786
|
+
ev.preventDefault();
|
|
787
|
+
const pastedData = ev.clipboardData.getData("text").replace(/\s/g, "");
|
|
788
|
+
if (!pastedData) return;
|
|
789
|
+
for (let i = 0; i < pastedData.length; i++) {
|
|
790
|
+
const inputIndex = startIndex + i;
|
|
791
|
+
if (inputIndex >= length) break;
|
|
792
|
+
const input = inputs?.current[inputIndex];
|
|
793
|
+
const indexedPastedData = pastedData[i];
|
|
794
|
+
if (input && indexedPastedData) {
|
|
795
|
+
input.value = indexedPastedData;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
const nextIndex = Math.min(startIndex + pastedData.length, length - 1);
|
|
799
|
+
inputs?.current[nextIndex]?.focus();
|
|
800
|
+
const otpValue = getInputsValue();
|
|
801
|
+
if (otpValue.length === length) {
|
|
802
|
+
onLastChange?.(otpValue);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
const handleInputChange = (value, index) => {
|
|
806
|
+
if (value) {
|
|
807
|
+
const currentInput = inputs?.current[index];
|
|
808
|
+
const currentValue = currentInput?.value[currentInput.value.length - 1];
|
|
809
|
+
if (currentValue) {
|
|
810
|
+
currentInput.value = currentValue;
|
|
811
|
+
}
|
|
812
|
+
const nextInput = inputs?.current[index + 1];
|
|
813
|
+
if (nextInput) {
|
|
814
|
+
nextInput.value = "";
|
|
815
|
+
nextInput.focus();
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
onLastChange?.(getInputsValue());
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
const handleBackspace = (e, index) => {
|
|
822
|
+
if (e.key === "Backspace" && !e.currentTarget.value && index > 0) {
|
|
823
|
+
inputs?.current[index - 1]?.focus();
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
return Array.from({ length }).map(
|
|
827
|
+
(_, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
828
|
+
"input",
|
|
829
|
+
{
|
|
830
|
+
autoComplete: "off",
|
|
831
|
+
name: `${name || "otp"}-${index}`,
|
|
832
|
+
onPaste: (ev) => handlePaste(ev, index),
|
|
833
|
+
onKeyDown: (ev) => handleBackspace(ev, index),
|
|
834
|
+
onChange: (ev) => handleInputChange(ev.target.value, index),
|
|
835
|
+
ref: (el) => {
|
|
836
|
+
if (inputs) {
|
|
837
|
+
inputs.current[index] = el;
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
...props
|
|
841
|
+
},
|
|
842
|
+
index
|
|
843
|
+
)
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
// src/components/Otp/OtpHiddenInput.tsx
|
|
848
|
+
var import_react29 = require("react");
|
|
849
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
850
|
+
function OtpHiddenInput({ name, ...p }) {
|
|
851
|
+
const { getInputsValue } = (0, import_react29.use)(OtpContext);
|
|
852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("input", { type: "hidden", tabIndex: -1, name: name || "otp", value: getInputsValue(), ...p });
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// src/components/Otp/Otp.ts
|
|
856
|
+
var Otp = Object.assign(OtpRoot, {
|
|
857
|
+
Inputs: OtpInputs,
|
|
858
|
+
HiddenInput: OtpHiddenInput
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
// src/components/Pagination/PaginationCounts.tsx
|
|
862
|
+
var import_react31 = require("react");
|
|
863
|
+
|
|
864
|
+
// src/components/Pagination/PaginationContext.tsx
|
|
865
|
+
var import_react30 = require("react");
|
|
866
|
+
var PaginationContext = (0, import_react30.createContext)({});
|
|
867
|
+
|
|
868
|
+
// src/components/Pagination/PaginationCounts.tsx
|
|
869
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
870
|
+
function PaginationCounts(props) {
|
|
871
|
+
const { page, pageLength } = (0, import_react31.use)(PaginationContext);
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { ...props, children: [
|
|
873
|
+
"Page ",
|
|
874
|
+
page,
|
|
875
|
+
" / ",
|
|
876
|
+
pageLength
|
|
877
|
+
] });
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// src/components/Pagination/PaginationNextBtn.tsx
|
|
881
|
+
var import_react32 = require("react");
|
|
882
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
883
|
+
function PaginationNextBtn({ onClick, disabled, ...p }) {
|
|
884
|
+
const { page, pageLength, nextPage } = (0, import_react32.use)(PaginationContext);
|
|
885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
886
|
+
"button",
|
|
887
|
+
{
|
|
888
|
+
disabled: disabled || page === pageLength,
|
|
889
|
+
onClick: (ev) => {
|
|
890
|
+
onClick?.(ev);
|
|
891
|
+
nextPage();
|
|
892
|
+
},
|
|
893
|
+
...p
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/components/Pagination/PaginationPrevBtn.tsx
|
|
899
|
+
var import_react33 = require("react");
|
|
900
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
901
|
+
function PaginationPrevBtn({ onClick, disabled, ...p }) {
|
|
902
|
+
const { page, prevPage } = (0, import_react33.use)(PaginationContext);
|
|
903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
904
|
+
"button",
|
|
905
|
+
{
|
|
906
|
+
disabled: disabled || page === 1,
|
|
907
|
+
onClick: (ev) => {
|
|
908
|
+
onClick?.(ev);
|
|
909
|
+
prevPage();
|
|
910
|
+
},
|
|
911
|
+
...p
|
|
912
|
+
}
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// src/components/Pagination/PaginationStateRoot.tsx
|
|
917
|
+
var import_react34 = require("react");
|
|
918
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
919
|
+
function PaginationStateRoot({ pageLength, children }) {
|
|
920
|
+
const [page, setPage] = (0, import_react34.useState)(1);
|
|
921
|
+
const nextPage = () => setPage((prev) => prev < pageLength ? prev + 1 : prev);
|
|
922
|
+
const prevPage = () => setPage((prev) => prev > 1 ? prev - 1 : prev);
|
|
923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaginationContext.Provider, { value: { page, pageLength, nextPage, prevPage }, children });
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// src/components/Pagination/PaginationSearchParamsRoot.tsx
|
|
927
|
+
var import_navigation = require("next/navigation");
|
|
928
|
+
var import_react35 = require("react");
|
|
929
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
930
|
+
function PaginationSearchParamsRoot({ pageKey, pageLength, children }) {
|
|
931
|
+
const router = (0, import_navigation.useRouter)();
|
|
932
|
+
const searchParams = (0, import_navigation.useSearchParams)();
|
|
933
|
+
const [currentPage, setCurrentPage] = (0, import_react35.useState)(1);
|
|
934
|
+
(0, import_react35.useEffect)(() => {
|
|
935
|
+
setCurrentPage(+(searchParams.get(pageKey || "page") || "1"));
|
|
936
|
+
}, [pageKey, searchParams]);
|
|
937
|
+
const pushRouter = (page) => {
|
|
938
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
939
|
+
params.set(pageKey || "page", page.toString());
|
|
940
|
+
router.push("?" + params.toString());
|
|
941
|
+
};
|
|
942
|
+
const nextPage = () => {
|
|
943
|
+
if (currentPage < pageLength) {
|
|
944
|
+
pushRouter(currentPage + 1);
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
const prevPage = () => {
|
|
948
|
+
if (currentPage > 1) {
|
|
949
|
+
pushRouter(currentPage - 1);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PaginationContext.Provider, { value: { page: currentPage, pageLength, nextPage, prevPage }, children });
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// src/components/Pagination/Pagination.ts
|
|
956
|
+
var baseComponents = {
|
|
957
|
+
Counts: PaginationCounts,
|
|
958
|
+
NextBtn: PaginationNextBtn,
|
|
959
|
+
PrevBtn: PaginationPrevBtn
|
|
960
|
+
};
|
|
961
|
+
var PaginationWithState = Object.assign(PaginationStateRoot, baseComponents);
|
|
962
|
+
var PaginationWithSearchParams = Object.assign(PaginationSearchParamsRoot, baseComponents);
|
|
963
|
+
|
|
964
|
+
// src/components/PasswordInput/PasswordInputRoot.tsx
|
|
965
|
+
var import_react37 = require("react");
|
|
966
|
+
|
|
967
|
+
// src/components/PasswordInput/PasswordInputContext.tsx
|
|
968
|
+
var import_react36 = require("react");
|
|
969
|
+
var PasswordInputContext = (0, import_react36.createContext)({});
|
|
970
|
+
|
|
971
|
+
// src/components/PasswordInput/PasswordInputRoot.tsx
|
|
972
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
973
|
+
function PasswordInputRoot(props) {
|
|
974
|
+
const [isVisible, setIsVisible] = (0, import_react37.useState)(false);
|
|
975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PasswordInputContext, { value: { isVisible, setIsVisible }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { ...props }) });
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// src/components/PasswordInput/PasswordInputField.tsx
|
|
979
|
+
var import_react38 = require("react");
|
|
980
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
981
|
+
function PasswordInputField(props) {
|
|
982
|
+
const { isVisible } = (0, import_react38.use)(PasswordInputContext);
|
|
983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { type: isVisible ? "text" : "password", ...props });
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
// src/components/PasswordInput/PasswordInputToggle.tsx
|
|
987
|
+
var import_react39 = require("react");
|
|
988
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
989
|
+
function PasswordInputToggle({ visibleChildren, onClick, children, ...props }) {
|
|
990
|
+
const { isVisible, setIsVisible } = (0, import_react39.use)(PasswordInputContext);
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
992
|
+
"button",
|
|
993
|
+
{
|
|
994
|
+
type: "button",
|
|
995
|
+
onClick: (ev) => {
|
|
996
|
+
setIsVisible((prev) => !prev);
|
|
997
|
+
onClick?.(ev);
|
|
998
|
+
},
|
|
999
|
+
...props,
|
|
1000
|
+
children: isVisible ? visibleChildren : children
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
// src/components/PasswordInput/PasswordInput.ts
|
|
1006
|
+
var PasswordInput = Object.assign(PasswordInputRoot, {
|
|
1007
|
+
Field: PasswordInputField,
|
|
1008
|
+
Toggle: PasswordInputToggle
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
// src/components/Popover/PopoverBody.tsx
|
|
1012
|
+
var import_react41 = require("react");
|
|
1013
|
+
|
|
1014
|
+
// src/components/Popover/PopoverContext.ts
|
|
1015
|
+
var import_react40 = require("react");
|
|
1016
|
+
var PopoverContext = (0, import_react40.createContext)({});
|
|
1017
|
+
|
|
1018
|
+
// src/components/Popover/PopoverBody.tsx
|
|
1019
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1020
|
+
function PopoverBody({ preventClose, onClick, ...p }) {
|
|
1021
|
+
const { bodyRef, isOpen } = (0, import_react41.use)(PopoverContext);
|
|
1022
|
+
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1023
|
+
"div",
|
|
1024
|
+
{
|
|
1025
|
+
ref: bodyRef,
|
|
1026
|
+
"data-state": isOpen ? "active" : "inactive",
|
|
1027
|
+
onClick: (ev) => {
|
|
1028
|
+
if (preventClose) {
|
|
1029
|
+
ev.stopPropagation();
|
|
1030
|
+
}
|
|
1031
|
+
onClick?.(ev);
|
|
1032
|
+
},
|
|
1033
|
+
...p
|
|
1034
|
+
}
|
|
1035
|
+
) : null;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// src/components/Popover/PopoverRoot.tsx
|
|
1039
|
+
var import_react42 = require("react");
|
|
1040
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1041
|
+
function PopoverRoot({ mode = "click", accessHorizontalArrows, onKeyDown, onMouseEnter, onMouseLeave, ...p }) {
|
|
1042
|
+
const [isOpen, setOpen] = (0, import_react42.useState)(false);
|
|
1043
|
+
const toggleRef = (0, import_react42.useRef)(null);
|
|
1044
|
+
const bodyRef = (0, import_react42.useRef)(null);
|
|
1045
|
+
(0, import_react42.useEffect)(() => {
|
|
1046
|
+
const closeHandler = () => {
|
|
1047
|
+
setOpen(false);
|
|
1048
|
+
};
|
|
1049
|
+
window.addEventListener("click", closeHandler);
|
|
1050
|
+
return () => window.removeEventListener("click", closeHandler);
|
|
1051
|
+
}, []);
|
|
1052
|
+
(0, import_react42.useEffect)(() => {
|
|
1053
|
+
if (isOpen) {
|
|
1054
|
+
selectFirstMenuChild();
|
|
1055
|
+
}
|
|
1056
|
+
}, [isOpen]);
|
|
1057
|
+
const selectFirstMenuChild = () => {
|
|
1058
|
+
if (!bodyRef.current) {
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
const children = selectAccessibleChildren(bodyRef.current);
|
|
1062
|
+
const firstChild = children[0];
|
|
1063
|
+
if (!firstChild) {
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
firstChild.focus();
|
|
1067
|
+
};
|
|
1068
|
+
const handleKeyDown = (ev) => {
|
|
1069
|
+
if (!accessHorizontalArrows) {
|
|
1070
|
+
return null;
|
|
1071
|
+
}
|
|
1072
|
+
if (ev.key === "ArrowRight") {
|
|
1073
|
+
if (accessHorizontalArrows === "ArrowRight") {
|
|
1074
|
+
setOpen(true);
|
|
1075
|
+
selectFirstMenuChild();
|
|
1076
|
+
} else {
|
|
1077
|
+
setOpen(false);
|
|
1078
|
+
toggleRef.current?.focus();
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
if (ev.key === "ArrowLeft") {
|
|
1082
|
+
if (accessHorizontalArrows === "ArrowLeft") {
|
|
1083
|
+
setOpen(true);
|
|
1084
|
+
selectFirstMenuChild();
|
|
1085
|
+
} else {
|
|
1086
|
+
setOpen(false);
|
|
1087
|
+
toggleRef.current?.focus();
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PopoverContext, { value: { isOpen, setOpen, toggleRef, bodyRef, mode }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1092
|
+
"div",
|
|
1093
|
+
{
|
|
1094
|
+
"data-state": isOpen ? "active" : "inactive",
|
|
1095
|
+
onKeyDown: (ev) => {
|
|
1096
|
+
onKeyDown?.(ev);
|
|
1097
|
+
handleKeyDown(ev);
|
|
1098
|
+
},
|
|
1099
|
+
onMouseEnter: (ev) => {
|
|
1100
|
+
onMouseEnter?.(ev);
|
|
1101
|
+
if (["hover", "both"].includes(mode)) {
|
|
1102
|
+
ev.stopPropagation();
|
|
1103
|
+
setOpen(true);
|
|
1104
|
+
}
|
|
1105
|
+
},
|
|
1106
|
+
onMouseLeave: (ev) => {
|
|
1107
|
+
onMouseLeave?.(ev);
|
|
1108
|
+
if (["hover", "both"].includes(mode)) {
|
|
1109
|
+
ev.stopPropagation();
|
|
1110
|
+
setOpen(false);
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
...p
|
|
1114
|
+
}
|
|
1115
|
+
) });
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// src/components/Popover/PopoverToggle.tsx
|
|
1119
|
+
var import_react43 = require("react");
|
|
1120
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1121
|
+
function PopoverToggle({ onClick, ...props }) {
|
|
1122
|
+
const { mode, toggleRef, isOpen, setOpen } = (0, import_react43.use)(PopoverContext);
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1124
|
+
"button",
|
|
1125
|
+
{
|
|
1126
|
+
ref: toggleRef,
|
|
1127
|
+
"data-state": isOpen ? "active" : "inactive",
|
|
1128
|
+
onClick: (ev) => {
|
|
1129
|
+
onClick?.(ev);
|
|
1130
|
+
ev.stopPropagation();
|
|
1131
|
+
if (["click", "both"].includes(mode)) {
|
|
1132
|
+
setOpen((prev) => !prev);
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
...props
|
|
1136
|
+
}
|
|
1137
|
+
);
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
// src/components/Popover/Popover.ts
|
|
1141
|
+
var Popover = Object.assign(PopoverRoot, {
|
|
1142
|
+
Toggle: PopoverToggle,
|
|
1143
|
+
Body: PopoverBody
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
// src/components/Progress/ProgressBar.tsx
|
|
1147
|
+
var import_react45 = require("react");
|
|
1148
|
+
var import_framer_motion6 = require("framer-motion");
|
|
1149
|
+
|
|
1150
|
+
// src/components/Progress/ProgressContext.ts
|
|
1151
|
+
var import_react44 = require("react");
|
|
1152
|
+
var ProgressContext = (0, import_react44.createContext)({});
|
|
1153
|
+
|
|
1154
|
+
// src/components/Progress/ProgressBar.tsx
|
|
1155
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1156
|
+
function ProgressBar({ duration, children, ...p }) {
|
|
1157
|
+
const { value, maxValue } = (0, import_react45.use)(ProgressContext);
|
|
1158
|
+
const percentage = Math.min(100, Math.max(0, value / maxValue * 100));
|
|
1159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1160
|
+
import_framer_motion6.motion.div,
|
|
1161
|
+
{
|
|
1162
|
+
initial: { width: 0 },
|
|
1163
|
+
whileInView: { width: `${percentage}%` },
|
|
1164
|
+
transition: { duration: duration || 3 },
|
|
1165
|
+
...p,
|
|
1166
|
+
children: children || /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "text-xs", children: [
|
|
1167
|
+
percentage,
|
|
1168
|
+
"%"
|
|
1169
|
+
] })
|
|
1170
|
+
}
|
|
1171
|
+
);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
// src/components/Progress/ProgressRoot.tsx
|
|
1175
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1176
|
+
function ProgressRoot({ value, maxValue = 100, ...p }) {
|
|
1177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ProgressContext, { value: { value, maxValue }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { ...p }) });
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// src/components/Progress/Progress.ts
|
|
1181
|
+
var Progress = Object.assign(ProgressRoot, {
|
|
1182
|
+
Bar: ProgressBar
|
|
1183
|
+
});
|
|
1184
|
+
|
|
1185
|
+
// src/components/QrCode/QrCode.tsx
|
|
1186
|
+
var import_qrcode = __toESM(require("qrcode"), 1);
|
|
1187
|
+
var import_react46 = require("react");
|
|
1188
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1189
|
+
function QrCode({ value, options, ...props }) {
|
|
1190
|
+
const canvasRef = (0, import_react46.useRef)(null);
|
|
1191
|
+
(0, import_react46.useEffect)(() => {
|
|
1192
|
+
console.log(value);
|
|
1193
|
+
import_qrcode.default.toCanvas(canvasRef.current, value, options, function(error) {
|
|
1194
|
+
if (error) console.error(error);
|
|
1195
|
+
});
|
|
1196
|
+
}, [value, options]);
|
|
1197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("canvas", { ref: canvasRef, ...props });
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
// src/components/Rating/RatingRoot.tsx
|
|
1201
|
+
var import_react48 = require("react");
|
|
1202
|
+
|
|
1203
|
+
// src/components/Rating/RatingContext.ts
|
|
1204
|
+
var import_react47 = require("react");
|
|
1205
|
+
var RatingContext = (0, import_react47.createContext)({});
|
|
1206
|
+
|
|
1207
|
+
// src/components/Rating/RatingRoot.tsx
|
|
1208
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1209
|
+
var RatingRoot = (p) => {
|
|
1210
|
+
const [hoverValue, setHoverValue] = (0, import_react48.useState)(null);
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RatingContext, { value: { hoverValue, setHoverValue }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
onMouseLeave: () => setHoverValue(null),
|
|
1215
|
+
...p
|
|
1216
|
+
}
|
|
1217
|
+
) });
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
// src/components/Rating/RatingItems.tsx
|
|
1221
|
+
var import_react49 = require("react");
|
|
1222
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1223
|
+
function RatingItems({ count, value, onValueChange, element, activeElement, ...p }) {
|
|
1224
|
+
const { hoverValue, setHoverValue } = (0, import_react49.use)(RatingContext);
|
|
1225
|
+
const displayValue = hoverValue !== null ? hoverValue : value;
|
|
1226
|
+
return Array.from({ length: count }).map((_, index) => {
|
|
1227
|
+
const itemValue = index + 1;
|
|
1228
|
+
const isActive = itemValue <= displayValue;
|
|
1229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1230
|
+
"button",
|
|
1231
|
+
{
|
|
1232
|
+
role: "radio",
|
|
1233
|
+
type: "button",
|
|
1234
|
+
"aria-checked": itemValue === value,
|
|
1235
|
+
onClick: () => onValueChange(itemValue),
|
|
1236
|
+
onMouseEnter: () => setHoverValue(itemValue),
|
|
1237
|
+
"aria-label": `${itemValue} out of ${count} stars`,
|
|
1238
|
+
...p,
|
|
1239
|
+
children: isActive ? activeElement : element
|
|
1240
|
+
},
|
|
1241
|
+
index
|
|
1242
|
+
);
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// src/components/Rating/Rating.ts
|
|
1247
|
+
var Rating = Object.assign(RatingRoot, {
|
|
1248
|
+
Items: RatingItems
|
|
1249
|
+
});
|
|
1250
|
+
|
|
1251
|
+
// src/components/Sheet/SheetBody.tsx
|
|
1252
|
+
var import_react51 = require("react");
|
|
1253
|
+
var import_framer_motion7 = require("framer-motion");
|
|
1254
|
+
|
|
1255
|
+
// src/components/Sheet/SheetContext.ts
|
|
1256
|
+
var import_react50 = require("react");
|
|
1257
|
+
var SheetContext = (0, import_react50.createContext)({});
|
|
1258
|
+
|
|
1259
|
+
// src/components/Sheet/SheetBody.tsx
|
|
1260
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1261
|
+
function SheetBody(p) {
|
|
1262
|
+
const { controls, y, closeHandler: handleClose } = (0, import_react51.use)(SheetContext);
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1264
|
+
import_framer_motion7.motion.div,
|
|
1265
|
+
{
|
|
1266
|
+
id: "sheet",
|
|
1267
|
+
onClick: (ev) => ev.stopPropagation(),
|
|
1268
|
+
initial: { y: "100%" },
|
|
1269
|
+
animate: { y: "0%" },
|
|
1270
|
+
exit: { y: "100%" },
|
|
1271
|
+
style: { y },
|
|
1272
|
+
drag: "y",
|
|
1273
|
+
dragControls: controls,
|
|
1274
|
+
dragListener: false,
|
|
1275
|
+
transition: {
|
|
1276
|
+
ease: "easeInOut"
|
|
1277
|
+
},
|
|
1278
|
+
onDragEnd: () => {
|
|
1279
|
+
if ((y?.get() || 0) >= 100) {
|
|
1280
|
+
handleClose();
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
dragConstraints: {
|
|
1284
|
+
top: 0,
|
|
1285
|
+
bottom: 0
|
|
1286
|
+
},
|
|
1287
|
+
dragElastic: {
|
|
1288
|
+
top: 0,
|
|
1289
|
+
bottom: 0.5
|
|
1290
|
+
},
|
|
1291
|
+
...p
|
|
1292
|
+
}
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// src/components/Sheet/SheetRoot.tsx
|
|
1297
|
+
var import_react52 = require("react");
|
|
1298
|
+
var import_framer_motion8 = require("framer-motion");
|
|
1299
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1300
|
+
function SheetRoot({ children }) {
|
|
1301
|
+
const y = (0, import_framer_motion8.useMotionValue)(0);
|
|
1302
|
+
const controls = (0, import_framer_motion8.useDragControls)();
|
|
1303
|
+
const [scope, animate] = (0, import_framer_motion8.useAnimate)();
|
|
1304
|
+
const [isOpen, setOpen] = (0, import_react52.useState)(false);
|
|
1305
|
+
(0, import_react52.useEffect)(() => {
|
|
1306
|
+
const bodyElem = document.body;
|
|
1307
|
+
const removeOverflow = () => {
|
|
1308
|
+
bodyElem.style.overflow = "unset";
|
|
1309
|
+
};
|
|
1310
|
+
if (isOpen) {
|
|
1311
|
+
bodyElem.style.overflow = "hidden";
|
|
1312
|
+
} else {
|
|
1313
|
+
removeOverflow();
|
|
1314
|
+
}
|
|
1315
|
+
return () => removeOverflow();
|
|
1316
|
+
}, [isOpen]);
|
|
1317
|
+
const closeHandler = async () => {
|
|
1318
|
+
animate(scope.current, {
|
|
1319
|
+
opacity: [1, 0]
|
|
1320
|
+
});
|
|
1321
|
+
const yStart = typeof y.get() === "number" ? y.get() : 0;
|
|
1322
|
+
await animate("#sheet", {
|
|
1323
|
+
y: [yStart, "100%"]
|
|
1324
|
+
});
|
|
1325
|
+
setOpen(false);
|
|
1326
|
+
};
|
|
1327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SheetContext, { value: { isOpen, setOpen, closeHandler, scope, controls, y }, children });
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// src/components/Sheet/SheetHeader.tsx
|
|
1331
|
+
var import_react53 = require("react");
|
|
1332
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1333
|
+
function SheetHeader({ onPointerDown, ...p }) {
|
|
1334
|
+
const { controls } = (0, import_react53.use)(SheetContext);
|
|
1335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
1336
|
+
"div",
|
|
1337
|
+
{
|
|
1338
|
+
onPointerDown: (ev) => {
|
|
1339
|
+
controls?.start(ev);
|
|
1340
|
+
onPointerDown?.(ev);
|
|
1341
|
+
},
|
|
1342
|
+
...p
|
|
1343
|
+
}
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
// src/components/Sheet/SheetPortal.tsx
|
|
1348
|
+
var import_react54 = require("react");
|
|
1349
|
+
var import_framer_motion9 = require("framer-motion");
|
|
1350
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1351
|
+
function SheetPortal(p) {
|
|
1352
|
+
const { isOpen, closeHandler: handleClose, scope } = (0, import_react54.use)(SheetContext);
|
|
1353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ClientOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_framer_motion9.AnimatePresence, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1354
|
+
import_framer_motion9.motion.div,
|
|
1355
|
+
{
|
|
1356
|
+
ref: scope,
|
|
1357
|
+
onClick: handleClose,
|
|
1358
|
+
initial: { opacity: 0 },
|
|
1359
|
+
animate: { opacity: 1 },
|
|
1360
|
+
exit: { opacity: 0 },
|
|
1361
|
+
...p
|
|
1362
|
+
}
|
|
1363
|
+
) : null }) }) });
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
// src/components/Sheet/SheetToggle.tsx
|
|
1367
|
+
var import_react55 = require("react");
|
|
1368
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1369
|
+
function SheetToggle({ onClick, ...props }) {
|
|
1370
|
+
const { setOpen } = (0, import_react55.use)(SheetContext);
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
1372
|
+
"button",
|
|
1373
|
+
{
|
|
1374
|
+
onClick: (ev) => {
|
|
1375
|
+
onClick?.(ev);
|
|
1376
|
+
setOpen((prev) => !prev);
|
|
1377
|
+
},
|
|
1378
|
+
...props
|
|
1379
|
+
}
|
|
1380
|
+
);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
// src/components/Sheet/SheetContent.tsx
|
|
1384
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1385
|
+
function SheetContent(p) {
|
|
1386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ...p });
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// src/components/Sheet/Sheet.ts
|
|
1390
|
+
var Sheet = Object.assign(SheetRoot, {
|
|
1391
|
+
Portal: SheetPortal,
|
|
1392
|
+
Body: SheetBody,
|
|
1393
|
+
Header: SheetHeader,
|
|
1394
|
+
Content: SheetContent,
|
|
1395
|
+
Toggle: SheetToggle
|
|
1396
|
+
});
|
|
1397
|
+
|
|
1398
|
+
// src/components/ShowMore/ShowMoreRoot.tsx
|
|
1399
|
+
var import_react57 = require("react");
|
|
1400
|
+
|
|
1401
|
+
// src/components/ShowMore/ShowMoreContext.ts
|
|
1402
|
+
var import_react56 = require("react");
|
|
1403
|
+
var ShowMoreContext = (0, import_react56.createContext)({});
|
|
1404
|
+
|
|
1405
|
+
// src/components/ShowMore/ShowMoreRoot.tsx
|
|
1406
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
1407
|
+
function ShowMoreRoot({ maxLines, defaultExpanded = false, style, ...p }) {
|
|
1408
|
+
const [shouldShowMore, setShouldShowMore] = (0, import_react57.useState)(false);
|
|
1409
|
+
const [isShowMore, setIsShowMore] = (0, import_react57.useState)(defaultExpanded);
|
|
1410
|
+
const [maxHeight, setMaxHeight] = (0, import_react57.useState)(0);
|
|
1411
|
+
const contentRef = (0, import_react57.useRef)(null);
|
|
1412
|
+
(0, import_react57.useEffect)(() => {
|
|
1413
|
+
if (contentRef.current) {
|
|
1414
|
+
const element = contentRef.current;
|
|
1415
|
+
const lineHeight = Number.parseInt(window.getComputedStyle(element).lineHeight);
|
|
1416
|
+
const maxHeight2 = lineHeight * (maxLines || 3);
|
|
1417
|
+
const actualHeight = element.scrollHeight;
|
|
1418
|
+
setMaxHeight(maxHeight2);
|
|
1419
|
+
setShouldShowMore(actualHeight > maxHeight2);
|
|
1420
|
+
}
|
|
1421
|
+
}, [maxLines]);
|
|
1422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ShowMoreContext, { value: { contentRef, isShowMore, setIsShowMore, maxHeight, shouldShowMore }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { style: { position: "relative", ...style }, ...p }) });
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// src/components/ShowMore/ShowMoreFade.tsx
|
|
1426
|
+
var import_react58 = require("react");
|
|
1427
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1428
|
+
function ShowMoreFade(p) {
|
|
1429
|
+
const { shouldShowMore, isShowMore } = (0, import_react58.use)(ShowMoreContext);
|
|
1430
|
+
return shouldShowMore && !isShowMore ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { ...p }) : null;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// src/components/ShowMore/ShowMoreContent.tsx
|
|
1434
|
+
var import_react59 = require("react");
|
|
1435
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1436
|
+
function ShowMoreContent({ children, style, ...props }) {
|
|
1437
|
+
const { contentRef, shouldShowMore, isShowMore, maxHeight } = (0, import_react59.use)(ShowMoreContext);
|
|
1438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1439
|
+
"div",
|
|
1440
|
+
{
|
|
1441
|
+
ref: contentRef,
|
|
1442
|
+
style: {
|
|
1443
|
+
overflow: "hidden",
|
|
1444
|
+
transition: "all 150ms ease",
|
|
1445
|
+
height: shouldShowMore ? isShowMore ? contentRef.current?.scrollHeight ? `${contentRef.current.scrollHeight}px` : "auto" : maxHeight : "auto",
|
|
1446
|
+
...style
|
|
1447
|
+
},
|
|
1448
|
+
...props,
|
|
1449
|
+
children
|
|
1450
|
+
}
|
|
1451
|
+
);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
// src/components/ShowMore/ShowMoreTrigger.tsx
|
|
1455
|
+
var import_react60 = require("react");
|
|
1456
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
1457
|
+
function ShowMoreTrigger({ onClick, style, ...p }) {
|
|
1458
|
+
const { setIsShowMore } = (0, import_react60.use)(ShowMoreContext);
|
|
1459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
1460
|
+
"button",
|
|
1461
|
+
{
|
|
1462
|
+
style: {
|
|
1463
|
+
position: "relative",
|
|
1464
|
+
...style
|
|
1465
|
+
},
|
|
1466
|
+
onClick: (ev) => {
|
|
1467
|
+
onClick?.(ev);
|
|
1468
|
+
setIsShowMore((prev) => !prev);
|
|
1469
|
+
},
|
|
1470
|
+
...p
|
|
1471
|
+
}
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
// src/components/ShowMore/ShowMore.ts
|
|
1476
|
+
var ShowMore = Object.assign(ShowMoreRoot, {
|
|
1477
|
+
Content: ShowMoreContent,
|
|
1478
|
+
Trigger: ShowMoreTrigger,
|
|
1479
|
+
Fade: ShowMoreFade
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
// src/components/Spoiler/SpoilerBlur.tsx
|
|
1483
|
+
var import_react62 = require("react");
|
|
1484
|
+
|
|
1485
|
+
// src/components/Spoiler/SpoilerContext.ts
|
|
1486
|
+
var import_react61 = require("react");
|
|
1487
|
+
var SpoilerContext = (0, import_react61.createContext)({});
|
|
1488
|
+
|
|
1489
|
+
// src/components/Spoiler/SpoilerBlur.tsx
|
|
1490
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
1491
|
+
function SpoilerBlur({ className, ...p }) {
|
|
1492
|
+
const { isOpen } = (0, import_react62.use)(SpoilerContext);
|
|
1493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
1494
|
+
"span",
|
|
1495
|
+
{
|
|
1496
|
+
className: cn(
|
|
1497
|
+
isOpen ? "spoiler-active" : null,
|
|
1498
|
+
className
|
|
1499
|
+
),
|
|
1500
|
+
...p
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
// src/components/Spoiler/SpoilerRoot.tsx
|
|
1506
|
+
var import_react63 = require("react");
|
|
1507
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1508
|
+
function SpoilerRoot({ className, ...p }) {
|
|
1509
|
+
const [isOpen, setOpen] = (0, import_react63.useState)(false);
|
|
1510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SpoilerContext, { value: { isOpen, setOpen }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1511
|
+
"span",
|
|
1512
|
+
{
|
|
1513
|
+
onClick: () => setOpen(true),
|
|
1514
|
+
className: cn(
|
|
1515
|
+
isOpen ? "spoiler-active" : null,
|
|
1516
|
+
className
|
|
1517
|
+
),
|
|
1518
|
+
...p
|
|
1519
|
+
}
|
|
1520
|
+
) });
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
// src/components/Spoiler/Spoiler.ts
|
|
1524
|
+
var Spoiler = Object.assign(SpoilerRoot, {
|
|
1525
|
+
Blur: SpoilerBlur
|
|
1526
|
+
});
|
|
1527
|
+
|
|
1528
|
+
// src/components/Steps/StepsRender.tsx
|
|
1529
|
+
var import_react65 = require("react");
|
|
1530
|
+
|
|
1531
|
+
// src/components/Steps/StepsContext.ts
|
|
1532
|
+
var import_react64 = require("react");
|
|
1533
|
+
var StepsContext = (0, import_react64.createContext)({});
|
|
1534
|
+
|
|
1535
|
+
// src/components/Steps/StepsRender.tsx
|
|
1536
|
+
function StepsRender() {
|
|
1537
|
+
const { step, steps } = (0, import_react65.use)(StepsContext);
|
|
1538
|
+
return steps.find((_, index) => index + 1 === step)?.component;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
// src/components/Steps/StepsPrevBtn.tsx
|
|
1542
|
+
var import_react66 = require("react");
|
|
1543
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
1544
|
+
function StepsPrevBtn({ onClick, disabled, ...p }) {
|
|
1545
|
+
const { step, prevStep } = (0, import_react66.use)(StepsContext);
|
|
1546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
1547
|
+
"button",
|
|
1548
|
+
{
|
|
1549
|
+
disabled: disabled || step === 1,
|
|
1550
|
+
onClick: (ev) => {
|
|
1551
|
+
onClick?.(ev);
|
|
1552
|
+
prevStep();
|
|
1553
|
+
},
|
|
1554
|
+
...p
|
|
1555
|
+
}
|
|
1556
|
+
);
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
// src/components/Steps/StepsNextBtn.tsx
|
|
1560
|
+
var import_react67 = require("react");
|
|
1561
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
1562
|
+
function StepsNextBtn({ onClick, disabled, ...p }) {
|
|
1563
|
+
const { step, steps, nextStep } = (0, import_react67.use)(StepsContext);
|
|
1564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
1565
|
+
"button",
|
|
1566
|
+
{
|
|
1567
|
+
disabled: disabled || step === steps.length,
|
|
1568
|
+
onClick: (ev) => {
|
|
1569
|
+
onClick?.(ev);
|
|
1570
|
+
nextStep();
|
|
1571
|
+
},
|
|
1572
|
+
...p
|
|
1573
|
+
}
|
|
1574
|
+
);
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
// src/components/Steps/StepsIndexBtn.tsx
|
|
1578
|
+
var import_react68 = require("react");
|
|
1579
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
1580
|
+
function StepsIndexBtn({ index, onClick, ...p }) {
|
|
1581
|
+
const { step, setStep } = (0, import_react68.use)(StepsContext);
|
|
1582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
1583
|
+
"button",
|
|
1584
|
+
{
|
|
1585
|
+
disabled: step < index,
|
|
1586
|
+
onClick: (ev) => {
|
|
1587
|
+
onClick?.(ev);
|
|
1588
|
+
setStep(index);
|
|
1589
|
+
},
|
|
1590
|
+
...p
|
|
1591
|
+
}
|
|
1592
|
+
);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
// src/components/Steps/StepsStateRoot.tsx
|
|
1596
|
+
var import_react69 = require("react");
|
|
1597
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
1598
|
+
function StepsStateRoot({ children, steps }) {
|
|
1599
|
+
const [step, setStep] = (0, import_react69.useState)(1);
|
|
1600
|
+
const nextStep = () => setStep((prev) => prev + 1);
|
|
1601
|
+
const prevStep = () => setStep((prev) => prev - 1);
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(StepsContext.Provider, { value: { step, setStep, steps, nextStep, prevStep }, children });
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
// src/components/Steps/StepsSearchParamsRoot.tsx
|
|
1606
|
+
var import_navigation2 = require("next/navigation");
|
|
1607
|
+
var import_react70 = require("react");
|
|
1608
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
1609
|
+
function StepsSearchParamsRoot({ children, steps, stepKey }) {
|
|
1610
|
+
const router = (0, import_navigation2.useRouter)();
|
|
1611
|
+
const searchParams = (0, import_navigation2.useSearchParams)();
|
|
1612
|
+
const [currentStep, setCurrentStep] = (0, import_react70.useState)(1);
|
|
1613
|
+
(0, import_react70.useEffect)(() => {
|
|
1614
|
+
setCurrentStep(+(searchParams.get(stepKey || "step") || "1"));
|
|
1615
|
+
}, [stepKey, searchParams]);
|
|
1616
|
+
const pushRouter = (page) => {
|
|
1617
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
1618
|
+
params.set(stepKey || "step", page.toString());
|
|
1619
|
+
router.push("?" + params.toString());
|
|
1620
|
+
};
|
|
1621
|
+
const nextStep = () => {
|
|
1622
|
+
if (currentStep < steps.length) {
|
|
1623
|
+
pushRouter(currentStep + 1);
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
const prevStep = () => {
|
|
1627
|
+
if (currentStep > 1) {
|
|
1628
|
+
pushRouter(currentStep - 1);
|
|
1629
|
+
}
|
|
1630
|
+
};
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(StepsContext.Provider, { value: { step: currentStep, setStep: setCurrentStep, steps, nextStep, prevStep }, children });
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/components/Steps/Steps.ts
|
|
1635
|
+
var baseComponents2 = {
|
|
1636
|
+
Render: StepsRender,
|
|
1637
|
+
IndexBtn: StepsIndexBtn,
|
|
1638
|
+
PrevBtn: StepsPrevBtn,
|
|
1639
|
+
NextBtn: StepsNextBtn
|
|
1640
|
+
};
|
|
1641
|
+
var StepsWithState = Object.assign(StepsStateRoot, baseComponents2);
|
|
1642
|
+
var StepsWithSearchParams = Object.assign(StepsSearchParamsRoot, baseComponents2);
|
|
1643
|
+
|
|
1644
|
+
// src/components/Swap/SwapItem.tsx
|
|
1645
|
+
var import_framer_motion10 = require("framer-motion");
|
|
1646
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
1647
|
+
function SwapItem(p) {
|
|
1648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
1649
|
+
import_framer_motion10.motion.span,
|
|
1650
|
+
{
|
|
1651
|
+
initial: { rotate: 90, opacity: 0 },
|
|
1652
|
+
animate: { rotate: 0, opacity: 1 },
|
|
1653
|
+
exit: { rotate: 90, opacity: 0 },
|
|
1654
|
+
...p
|
|
1655
|
+
}
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
// src/components/Swap/SwapRoot.tsx
|
|
1660
|
+
var import_framer_motion11 = require("framer-motion");
|
|
1661
|
+
var import_react72 = require("react");
|
|
1662
|
+
|
|
1663
|
+
// src/components/Swap/SwapContext.ts
|
|
1664
|
+
var import_react71 = require("react");
|
|
1665
|
+
var SwapContext = (0, import_react71.createContext)({});
|
|
1666
|
+
|
|
1667
|
+
// src/components/Swap/SwapRoot.tsx
|
|
1668
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
1669
|
+
function SwapRoot({ items, defaultItem, onSwap, ...p }) {
|
|
1670
|
+
const [activeItem, setActiveItem] = (0, import_react72.useState)(defaultItem || items[1]);
|
|
1671
|
+
const handleSwap = (newItem) => {
|
|
1672
|
+
setActiveItem(newItem);
|
|
1673
|
+
onSwap?.(newItem);
|
|
1674
|
+
};
|
|
1675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SwapContext, { value: { items, activeItem, handleSwap }, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion11.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { ...p }) }) });
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
// src/components/Swap/SwapTrigger.tsx
|
|
1679
|
+
var import_react73 = require("react");
|
|
1680
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
1681
|
+
function SwapTrigger({ item, onClick, ...p }) {
|
|
1682
|
+
const { items, activeItem, handleSwap } = (0, import_react73.use)(SwapContext);
|
|
1683
|
+
return activeItem === item ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
1684
|
+
"button",
|
|
1685
|
+
{
|
|
1686
|
+
onClick: (ev) => {
|
|
1687
|
+
onClick?.(ev);
|
|
1688
|
+
{
|
|
1689
|
+
const nextIndex = items.indexOf(item) + 1 >= items.length ? 0 : items.indexOf(item) + 1;
|
|
1690
|
+
const nextItem = items[nextIndex];
|
|
1691
|
+
if (nextItem !== void 0) {
|
|
1692
|
+
handleSwap(nextItem);
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
},
|
|
1696
|
+
...p
|
|
1697
|
+
}
|
|
1698
|
+
) : null;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
// src/components/Swap/Swap.ts
|
|
1702
|
+
var Swap = Object.assign(SwapRoot, {
|
|
1703
|
+
Trigger: SwapTrigger,
|
|
1704
|
+
Item: SwapItem
|
|
1705
|
+
});
|
|
1706
|
+
|
|
1707
|
+
// src/components/Tabs/TabsTab.tsx
|
|
1708
|
+
var import_react75 = require("react");
|
|
1709
|
+
|
|
1710
|
+
// src/components/Tabs/TabsContext.ts
|
|
1711
|
+
var import_react74 = require("react");
|
|
1712
|
+
var TabsContext = (0, import_react74.createContext)({
|
|
1713
|
+
activeTab: "",
|
|
1714
|
+
setActiveTab: () => {
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
|
|
1718
|
+
// src/components/Tabs/TabsTab.tsx
|
|
1719
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
1720
|
+
function TabsTab({ value, onClick, ...props }) {
|
|
1721
|
+
const { setActiveTab } = (0, import_react75.use)(TabsContext);
|
|
1722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
1723
|
+
"button",
|
|
1724
|
+
{
|
|
1725
|
+
onClick: (ev) => {
|
|
1726
|
+
onClick?.(ev);
|
|
1727
|
+
setActiveTab(value);
|
|
1728
|
+
},
|
|
1729
|
+
...props
|
|
1730
|
+
}
|
|
1731
|
+
);
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
// src/components/Tabs/TabsList.tsx
|
|
1735
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
1736
|
+
function TabsList(p) {
|
|
1737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { ...p });
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
// src/components/Tabs/TabsRoot.tsx
|
|
1741
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
1742
|
+
function TabsRoot({ activeTab, setActiveTab, children }) {
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TabsContext, { value: { activeTab, setActiveTab }, children });
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
// src/components/Tabs/TabsPanel.tsx
|
|
1747
|
+
var import_react76 = require("react");
|
|
1748
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
1749
|
+
function TabsPanel({ value, ...p }) {
|
|
1750
|
+
const { activeTab } = (0, import_react76.use)(TabsContext);
|
|
1751
|
+
const isActive = activeTab === value;
|
|
1752
|
+
return isActive ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { ...p }) : null;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
// src/components/Tabs/Tabs.ts
|
|
1756
|
+
var Tabs = Object.assign(TabsRoot, {
|
|
1757
|
+
List: TabsList,
|
|
1758
|
+
Tab: TabsTab,
|
|
1759
|
+
Panel: TabsPanel
|
|
1760
|
+
});
|
|
1761
|
+
|
|
1762
|
+
// src/components/Submit/SubmitRoot.tsx
|
|
1763
|
+
var import_react_dom2 = require("react-dom");
|
|
1764
|
+
|
|
1765
|
+
// src/components/Submit/SubmitContext.ts
|
|
1766
|
+
var import_react77 = require("react");
|
|
1767
|
+
var SubmitContext = (0, import_react77.createContext)({});
|
|
1768
|
+
|
|
1769
|
+
// src/components/Submit/SubmitRoot.tsx
|
|
1770
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
1771
|
+
function SubmitRoot({ disabled, ...p }) {
|
|
1772
|
+
const { pending } = (0, import_react_dom2.useFormStatus)();
|
|
1773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SubmitContext, { value: { pending }, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
1774
|
+
"button",
|
|
1775
|
+
{
|
|
1776
|
+
disabled: disabled || pending,
|
|
1777
|
+
...p
|
|
1778
|
+
}
|
|
1779
|
+
) });
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
// src/components/Submit/SubmitLoader.tsx
|
|
1783
|
+
var import_react78 = require("react");
|
|
1784
|
+
function SubmitLoader({ children, loader }) {
|
|
1785
|
+
const { pending } = (0, import_react78.use)(SubmitContext);
|
|
1786
|
+
return pending ? loader : children;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
// src/components/Submit/Submit.ts
|
|
1790
|
+
var Submit = Object.assign(SubmitRoot, {
|
|
1791
|
+
Loader: SubmitLoader
|
|
1792
|
+
});
|
|
1793
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1794
|
+
0 && (module.exports = {
|
|
1795
|
+
AccessNavigation,
|
|
1796
|
+
Accordion,
|
|
1797
|
+
Affix,
|
|
1798
|
+
Breadcrumbs,
|
|
1799
|
+
Carousel,
|
|
1800
|
+
ClientOnly,
|
|
1801
|
+
Clipboard,
|
|
1802
|
+
ContextMenu,
|
|
1803
|
+
Drawer,
|
|
1804
|
+
LoaderLink,
|
|
1805
|
+
Modal,
|
|
1806
|
+
Otp,
|
|
1807
|
+
PaginationWithSearchParams,
|
|
1808
|
+
PaginationWithState,
|
|
1809
|
+
PasswordInput,
|
|
1810
|
+
Popover,
|
|
1811
|
+
Portal,
|
|
1812
|
+
Progress,
|
|
1813
|
+
QrCode,
|
|
1814
|
+
Rating,
|
|
1815
|
+
Sheet,
|
|
1816
|
+
ShowMore,
|
|
1817
|
+
Spoiler,
|
|
1818
|
+
StepsWithSearchParams,
|
|
1819
|
+
StepsWithState,
|
|
1820
|
+
Submit,
|
|
1821
|
+
Swap,
|
|
1822
|
+
Tabs
|
|
1823
|
+
});
|
|
1824
|
+
//# sourceMappingURL=index.cjs.map
|