@kadoui/react 2.0.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1052 -376
- package/dist/react-components/Accordion/Accordion.d.ts +1 -0
- package/dist/react-components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/react-components/Accordion/Accordion.js +1 -0
- package/dist/react-components/Accordion/AccordionBody.d.ts +1 -2
- package/dist/react-components/Accordion/AccordionBody.d.ts.map +1 -1
- package/dist/react-components/Accordion/AccordionContext.d.ts +1 -5
- package/dist/react-components/Accordion/AccordionContext.d.ts.map +1 -1
- package/dist/react-components/Accordion/AccordionRoot.d.ts +1 -2
- package/dist/react-components/Accordion/AccordionRoot.d.ts.map +1 -1
- package/dist/react-components/Accordion/AccordionToggle.d.ts +1 -4
- package/dist/react-components/Accordion/AccordionToggle.d.ts.map +1 -1
- package/dist/react-components/Accordion/accordionTypes.d.ts +12 -0
- package/dist/react-components/Accordion/accordionTypes.d.ts.map +1 -0
- package/dist/react-components/Accordion/accordionTypes.js +1 -0
- package/dist/react-components/Affix/Affix.d.ts +1 -2
- package/dist/react-components/Affix/Affix.d.ts.map +1 -1
- package/dist/react-components/Affix/affixTypes.d.ts +3 -0
- package/dist/react-components/Affix/affixTypes.d.ts.map +1 -0
- package/dist/react-components/Affix/affixTypes.js +1 -0
- package/dist/react-components/Breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/dist/react-components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/react-components/Breadcrumbs/Breadcrumbs.js +1 -0
- package/dist/react-components/Breadcrumbs/BreadcrumbsContext.d.ts +1 -4
- package/dist/react-components/Breadcrumbs/BreadcrumbsContext.d.ts.map +1 -1
- package/dist/react-components/Breadcrumbs/BreadcrumbsItem.d.ts +1 -4
- package/dist/react-components/Breadcrumbs/BreadcrumbsItem.d.ts.map +1 -1
- package/dist/react-components/Breadcrumbs/BreadcrumbsRoot.d.ts +1 -4
- package/dist/react-components/Breadcrumbs/BreadcrumbsRoot.d.ts.map +1 -1
- package/dist/react-components/Breadcrumbs/breadcrumbsTypes.d.ts +11 -0
- package/dist/react-components/Breadcrumbs/breadcrumbsTypes.d.ts.map +1 -0
- package/dist/react-components/Breadcrumbs/breadcrumbsTypes.js +1 -0
- package/dist/react-components/Carousel/Carousel.d.ts +1 -0
- package/dist/react-components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/react-components/Carousel/Carousel.js +1 -0
- package/dist/react-components/Carousel/CarouselContainer.d.ts +1 -2
- package/dist/react-components/Carousel/CarouselContainer.d.ts.map +1 -1
- package/dist/react-components/Carousel/CarouselContext.d.ts +1 -8
- package/dist/react-components/Carousel/CarouselContext.d.ts.map +1 -1
- package/dist/react-components/Carousel/CarouselLeftFade.d.ts +1 -3
- package/dist/react-components/Carousel/CarouselLeftFade.d.ts.map +1 -1
- package/dist/react-components/Carousel/CarouselNextBtn.d.ts +1 -2
- package/dist/react-components/Carousel/CarouselNextBtn.d.ts.map +1 -1
- package/dist/react-components/Carousel/CarouselPrevBtn.d.ts +1 -2
- package/dist/react-components/Carousel/CarouselPrevBtn.d.ts.map +1 -1
- package/dist/react-components/Carousel/CarouselRightFade.d.ts +1 -3
- package/dist/react-components/Carousel/CarouselRightFade.d.ts.map +1 -1
- package/dist/react-components/Carousel/CarouselRoot.d.ts +1 -4
- package/dist/react-components/Carousel/CarouselRoot.d.ts.map +1 -1
- package/dist/react-components/Carousel/carouselTypes.d.ts +17 -0
- package/dist/react-components/Carousel/carouselTypes.d.ts.map +1 -0
- package/dist/react-components/Carousel/carouselTypes.js +1 -0
- package/dist/react-components/Choice/Choice.d.ts +1 -0
- package/dist/react-components/Choice/Choice.d.ts.map +1 -1
- package/dist/react-components/Choice/Choice.js +1 -0
- package/dist/react-components/Choice/ChoiceContext.d.ts +1 -16
- package/dist/react-components/Choice/ChoiceContext.d.ts.map +1 -1
- package/dist/react-components/Choice/ChoiceNavigation.d.ts +1 -3
- package/dist/react-components/Choice/ChoiceNavigation.d.ts.map +1 -1
- package/dist/react-components/Choice/ChoiceRoot.d.ts +1 -4
- package/dist/react-components/Choice/ChoiceRoot.d.ts.map +1 -1
- package/dist/react-components/Choice/ChoiceTrigger.d.ts +1 -5
- package/dist/react-components/Choice/ChoiceTrigger.d.ts.map +1 -1
- package/dist/react-components/Choice/choiceTypes.d.ts +23 -0
- package/dist/react-components/Choice/choiceTypes.d.ts.map +1 -0
- package/dist/react-components/Choice/choiceTypes.js +1 -0
- package/dist/react-components/ClientOnly/ClientOnly.d.ts +1 -2
- package/dist/react-components/ClientOnly/ClientOnly.d.ts.map +1 -1
- package/dist/react-components/ClientOnly/clientOnlyTypes.d.ts +3 -0
- package/dist/react-components/ClientOnly/clientOnlyTypes.d.ts.map +1 -0
- package/dist/react-components/ClientOnly/clientOnlyTypes.js +1 -0
- package/dist/react-components/Clipboard/Clipboard.d.ts +1 -6
- package/dist/react-components/Clipboard/Clipboard.d.ts.map +1 -1
- package/dist/react-components/Clipboard/clipboardTypes.d.ts +7 -0
- package/dist/react-components/Clipboard/clipboardTypes.d.ts.map +1 -0
- package/dist/react-components/Clipboard/clipboardTypes.js +1 -0
- package/dist/react-components/ContextMenu/ContextMenu.d.ts +1 -0
- package/dist/react-components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/react-components/ContextMenu/ContextMenu.js +1 -0
- package/dist/react-components/ContextMenu/ContextMenuBody.d.ts +1 -2
- package/dist/react-components/ContextMenu/ContextMenuBody.d.ts.map +1 -1
- package/dist/react-components/ContextMenu/ContextMenuContext.d.ts +1 -10
- package/dist/react-components/ContextMenu/ContextMenuContext.d.ts.map +1 -1
- package/dist/react-components/ContextMenu/ContextMenuContext.js +1 -1
- package/dist/react-components/ContextMenu/ContextMenuItem.d.ts +1 -3
- package/dist/react-components/ContextMenu/ContextMenuItem.d.ts.map +1 -1
- package/dist/react-components/ContextMenu/ContextMenuNavigation.d.ts +1 -3
- package/dist/react-components/ContextMenu/ContextMenuNavigation.d.ts.map +1 -1
- package/dist/react-components/ContextMenu/ContextMenuNavigation.js +1 -1
- package/dist/react-components/ContextMenu/ContextMenuRoot.d.ts +1 -2
- package/dist/react-components/ContextMenu/ContextMenuRoot.d.ts.map +1 -1
- package/dist/react-components/ContextMenu/contextMenuTypes.d.ts +16 -0
- package/dist/react-components/ContextMenu/contextMenuTypes.d.ts.map +1 -0
- package/dist/react-components/ContextMenu/contextMenuTypes.js +1 -0
- package/dist/react-components/Drawer/Drawer.d.ts +1 -0
- package/dist/react-components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/react-components/Drawer/Drawer.js +1 -0
- package/dist/react-components/Drawer/DrawerBody.d.ts +1 -4
- package/dist/react-components/Drawer/DrawerBody.d.ts.map +1 -1
- package/dist/react-components/Drawer/DrawerBody.js +1 -1
- package/dist/react-components/Drawer/DrawerContext.d.ts +1 -5
- package/dist/react-components/Drawer/DrawerContext.d.ts.map +1 -1
- package/dist/react-components/Drawer/DrawerPortal.d.ts +1 -2
- package/dist/react-components/Drawer/DrawerPortal.d.ts.map +1 -1
- package/dist/react-components/Drawer/DrawerPortal.js +1 -1
- package/dist/react-components/Drawer/DrawerRoot.d.ts +1 -2
- package/dist/react-components/Drawer/DrawerRoot.d.ts.map +1 -1
- package/dist/react-components/Drawer/DrawerRoot.js +1 -1
- package/dist/react-components/Drawer/DrawerToggle.d.ts +1 -2
- package/dist/react-components/Drawer/DrawerToggle.d.ts.map +1 -1
- package/dist/react-components/Drawer/drawerTypes.d.ts +13 -0
- package/dist/react-components/Drawer/drawerTypes.d.ts.map +1 -0
- package/dist/react-components/Drawer/drawerTypes.js +1 -0
- package/dist/react-components/DrawerSheet/DrawerSheet.d.ts +2 -0
- package/dist/react-components/DrawerSheet/DrawerSheet.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/DrawerSheet.js +1 -0
- package/dist/react-components/DrawerSheet/browser.d.ts +8 -0
- package/dist/react-components/DrawerSheet/browser.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/browser.js +27 -0
- package/dist/react-components/DrawerSheet/constants.d.ts +12 -0
- package/dist/react-components/DrawerSheet/constants.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/constants.js +11 -0
- package/dist/react-components/DrawerSheet/context.d.ts +38 -0
- package/dist/react-components/DrawerSheet/context.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/context.js +39 -0
- package/dist/react-components/DrawerSheet/helpers.d.ts +17 -0
- package/dist/react-components/DrawerSheet/helpers.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/helpers.js +97 -0
- package/dist/react-components/DrawerSheet/index.d.ts +147 -0
- package/dist/react-components/DrawerSheet/index.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/index.js +803 -0
- package/dist/react-components/DrawerSheet/types.d.ts +7 -0
- package/dist/react-components/DrawerSheet/types.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/types.js +1 -0
- package/dist/react-components/DrawerSheet/use-composed-refs.d.ts +14 -0
- package/dist/react-components/DrawerSheet/use-composed-refs.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-composed-refs.js +30 -0
- package/dist/react-components/DrawerSheet/use-controllable-state.d.ts +9 -0
- package/dist/react-components/DrawerSheet/use-controllable-state.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-controllable-state.js +41 -0
- package/dist/react-components/DrawerSheet/use-position-fixed.d.ts +19 -0
- package/dist/react-components/DrawerSheet/use-position-fixed.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-position-fixed.js +109 -0
- package/dist/react-components/DrawerSheet/use-prevent-scroll.d.ts +18 -0
- package/dist/react-components/DrawerSheet/use-prevent-scroll.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-prevent-scroll.js +237 -0
- package/dist/react-components/DrawerSheet/use-scale-background.d.ts +2 -0
- package/dist/react-components/DrawerSheet/use-scale-background.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-scale-background.js +50 -0
- package/dist/react-components/DrawerSheet/use-snap-points.d.ts +32 -0
- package/dist/react-components/DrawerSheet/use-snap-points.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-snap-points.js +200 -0
- package/dist/react-components/Modal/Modal.d.ts +1 -0
- package/dist/react-components/Modal/Modal.d.ts.map +1 -1
- package/dist/react-components/Modal/Modal.js +1 -0
- package/dist/react-components/Modal/ModalBody.d.ts +1 -2
- package/dist/react-components/Modal/ModalBody.d.ts.map +1 -1
- package/dist/react-components/Modal/ModalBody.js +1 -1
- package/dist/react-components/Modal/ModalContent.d.ts +1 -2
- package/dist/react-components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/react-components/Modal/ModalContext.d.ts +1 -5
- package/dist/react-components/Modal/ModalContext.d.ts.map +1 -1
- package/dist/react-components/Modal/ModalHeader.d.ts +1 -2
- package/dist/react-components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/react-components/Modal/ModalPortal.d.ts +1 -2
- package/dist/react-components/Modal/ModalPortal.d.ts.map +1 -1
- package/dist/react-components/Modal/ModalPortal.js +1 -1
- package/dist/react-components/Modal/ModalRoot.d.ts +1 -4
- package/dist/react-components/Modal/ModalRoot.d.ts.map +1 -1
- package/dist/react-components/Modal/ModalRoot.js +1 -1
- package/dist/react-components/Modal/ModalTrigger.d.ts +1 -2
- package/dist/react-components/Modal/ModalTrigger.d.ts.map +1 -1
- package/dist/react-components/Modal/modalTypes.d.ts +15 -0
- package/dist/react-components/Modal/modalTypes.d.ts.map +1 -0
- package/dist/react-components/Modal/modalTypes.js +1 -0
- package/dist/react-components/Otp/Otp.d.ts +1 -0
- package/dist/react-components/Otp/Otp.d.ts.map +1 -1
- package/dist/react-components/Otp/Otp.js +1 -0
- package/dist/react-components/Otp/OtpContext.d.ts +2 -6
- package/dist/react-components/Otp/OtpContext.d.ts.map +1 -1
- package/dist/react-components/Otp/OtpHiddenInput.d.ts +1 -2
- package/dist/react-components/Otp/OtpHiddenInput.d.ts.map +1 -1
- package/dist/react-components/Otp/OtpInputs.d.ts +1 -5
- package/dist/react-components/Otp/OtpInputs.d.ts.map +1 -1
- package/dist/react-components/Otp/OtpRoot.d.ts +1 -4
- package/dist/react-components/Otp/OtpRoot.d.ts.map +1 -1
- package/dist/react-components/Otp/OtpRoot.js +1 -1
- package/dist/react-components/Otp/otpTypes.d.ts +15 -0
- package/dist/react-components/Otp/otpTypes.d.ts.map +1 -0
- package/dist/react-components/Otp/otpTypes.js +1 -0
- package/dist/react-components/Pagination/PaginationContext.d.ts +1 -10
- package/dist/react-components/Pagination/PaginationContext.d.ts.map +1 -1
- package/dist/react-components/Pagination/PaginationCounts.d.ts +1 -2
- package/dist/react-components/Pagination/PaginationCounts.d.ts.map +1 -1
- package/dist/react-components/Pagination/PaginationNextBtn.d.ts +1 -4
- package/dist/react-components/Pagination/PaginationNextBtn.d.ts.map +1 -1
- package/dist/react-components/Pagination/PaginationPrevBtn.d.ts +1 -4
- package/dist/react-components/Pagination/PaginationPrevBtn.d.ts.map +1 -1
- package/dist/react-components/Pagination/PaginationSearchParamsRoot.d.ts +1 -4
- package/dist/react-components/Pagination/PaginationSearchParamsRoot.d.ts.map +1 -1
- package/dist/react-components/Pagination/PaginationStateRoot.d.ts +1 -7
- package/dist/react-components/Pagination/PaginationStateRoot.d.ts.map +1 -1
- package/dist/react-components/Pagination/PaginationTypes.d.ts +23 -1
- package/dist/react-components/Pagination/PaginationTypes.d.ts.map +1 -1
- package/dist/react-components/PasswordInput/PasswordInput.d.ts +1 -0
- package/dist/react-components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/react-components/PasswordInput/PasswordInput.js +1 -0
- package/dist/react-components/PasswordInput/PasswordInputContext.d.ts +1 -5
- package/dist/react-components/PasswordInput/PasswordInputContext.d.ts.map +1 -1
- package/dist/react-components/PasswordInput/PasswordInputField.d.ts +1 -2
- package/dist/react-components/PasswordInput/PasswordInputField.d.ts.map +1 -1
- package/dist/react-components/PasswordInput/PasswordInputRoot.d.ts +1 -2
- package/dist/react-components/PasswordInput/PasswordInputRoot.d.ts.map +1 -1
- package/dist/react-components/PasswordInput/PasswordInputToggle.d.ts +1 -4
- package/dist/react-components/PasswordInput/PasswordInputToggle.d.ts.map +1 -1
- package/dist/react-components/PasswordInput/passwordInputTypes.d.ts +11 -0
- package/dist/react-components/PasswordInput/passwordInputTypes.d.ts.map +1 -0
- package/dist/react-components/PasswordInput/passwordInputTypes.js +1 -0
- package/dist/react-components/Popover/Popover.d.ts +1 -0
- package/dist/react-components/Popover/Popover.d.ts.map +1 -1
- package/dist/react-components/Popover/Popover.js +1 -0
- package/dist/react-components/Popover/PopoverBody.d.ts +1 -4
- package/dist/react-components/Popover/PopoverBody.d.ts.map +1 -1
- package/dist/react-components/Popover/PopoverContext.d.ts +1 -8
- package/dist/react-components/Popover/PopoverContext.d.ts.map +1 -1
- package/dist/react-components/Popover/PopoverNavigation.d.ts +2 -2
- package/dist/react-components/Popover/PopoverNavigation.d.ts.map +1 -1
- package/dist/react-components/Popover/PopoverNavigation.js +1 -1
- package/dist/react-components/Popover/PopoverRoot.d.ts +1 -5
- package/dist/react-components/Popover/PopoverRoot.d.ts.map +1 -1
- package/dist/react-components/Popover/PopoverToggle.d.ts +1 -2
- package/dist/react-components/Popover/PopoverToggle.d.ts.map +1 -1
- package/dist/react-components/Popover/popoverTypes.d.ts +18 -0
- package/dist/react-components/Popover/popoverTypes.d.ts.map +1 -0
- package/dist/react-components/Popover/popoverTypes.js +1 -0
- package/dist/react-components/Portal/Portal.d.ts +1 -4
- package/dist/react-components/Portal/Portal.d.ts.map +1 -1
- package/dist/react-components/Portal/portalTypes.d.ts +5 -0
- package/dist/react-components/Portal/portalTypes.d.ts.map +1 -0
- package/dist/react-components/Portal/portalTypes.js +1 -0
- package/dist/react-components/Progress/Progress.d.ts +1 -0
- package/dist/react-components/Progress/Progress.d.ts.map +1 -1
- package/dist/react-components/Progress/Progress.js +1 -0
- package/dist/react-components/Progress/ProgressBar.d.ts +1 -4
- package/dist/react-components/Progress/ProgressBar.d.ts.map +1 -1
- package/dist/react-components/Progress/ProgressContext.d.ts +1 -4
- package/dist/react-components/Progress/ProgressContext.d.ts.map +1 -1
- package/dist/react-components/Progress/ProgressRoot.d.ts +1 -5
- package/dist/react-components/Progress/ProgressRoot.d.ts.map +1 -1
- package/dist/react-components/Progress/progressTypes.d.ts +14 -0
- package/dist/react-components/Progress/progressTypes.d.ts.map +1 -0
- package/dist/react-components/Progress/progressTypes.js +1 -0
- package/dist/react-components/QrCode/QrCode.d.ts +1 -6
- package/dist/react-components/QrCode/QrCode.d.ts.map +1 -1
- package/dist/react-components/QrCode/qrCodeTypes.d.ts +7 -0
- package/dist/react-components/QrCode/qrCodeTypes.d.ts.map +1 -0
- package/dist/react-components/QrCode/qrCodeTypes.js +1 -0
- package/dist/react-components/Rating/Rating.d.ts +2 -1
- package/dist/react-components/Rating/Rating.d.ts.map +1 -1
- package/dist/react-components/Rating/Rating.js +1 -0
- package/dist/react-components/Rating/RatingContext.d.ts +1 -5
- package/dist/react-components/Rating/RatingContext.d.ts.map +1 -1
- package/dist/react-components/Rating/RatingItems.d.ts +1 -8
- package/dist/react-components/Rating/RatingItems.d.ts.map +1 -1
- package/dist/react-components/Rating/RatingRoot.d.ts +1 -2
- package/dist/react-components/Rating/RatingRoot.d.ts.map +1 -1
- package/dist/react-components/Rating/ratingTypes.d.ts +14 -0
- package/dist/react-components/Rating/ratingTypes.d.ts.map +1 -0
- package/dist/react-components/Rating/ratingTypes.js +1 -0
- package/dist/react-components/Sheet/Sheet.d.ts +1 -0
- package/dist/react-components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/react-components/Sheet/Sheet.js +1 -0
- package/dist/react-components/Sheet/SheetBody.d.ts +1 -2
- package/dist/react-components/Sheet/SheetBody.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetBody.js +1 -1
- package/dist/react-components/Sheet/SheetContent.d.ts +1 -2
- package/dist/react-components/Sheet/SheetContent.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetContext.d.ts +1 -9
- package/dist/react-components/Sheet/SheetContext.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetHandlebar.d.ts +1 -2
- package/dist/react-components/Sheet/SheetHandlebar.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetHeader.d.ts +1 -2
- package/dist/react-components/Sheet/SheetHeader.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetPortal.d.ts +1 -2
- package/dist/react-components/Sheet/SheetPortal.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetPortal.js +1 -1
- package/dist/react-components/Sheet/SheetRoot.d.ts +1 -2
- package/dist/react-components/Sheet/SheetRoot.d.ts.map +1 -1
- package/dist/react-components/Sheet/SheetRoot.js +1 -1
- package/dist/react-components/Sheet/SheetToggle.d.ts +1 -2
- package/dist/react-components/Sheet/SheetToggle.d.ts.map +1 -1
- package/dist/react-components/Sheet/sheetTypes.d.ts +17 -0
- package/dist/react-components/Sheet/sheetTypes.d.ts.map +1 -0
- package/dist/react-components/Sheet/sheetTypes.js +1 -0
- package/dist/react-components/ShowMore/ShowMore.d.ts +1 -0
- package/dist/react-components/ShowMore/ShowMore.d.ts.map +1 -1
- package/dist/react-components/ShowMore/ShowMore.js +1 -0
- package/dist/react-components/ShowMore/ShowMoreContent.d.ts +1 -2
- package/dist/react-components/ShowMore/ShowMoreContent.d.ts.map +1 -1
- package/dist/react-components/ShowMore/ShowMoreContext.d.ts +1 -8
- package/dist/react-components/ShowMore/ShowMoreContext.d.ts.map +1 -1
- package/dist/react-components/ShowMore/ShowMoreFade.d.ts +1 -2
- package/dist/react-components/ShowMore/ShowMoreFade.d.ts.map +1 -1
- package/dist/react-components/ShowMore/ShowMoreRoot.d.ts +1 -5
- package/dist/react-components/ShowMore/ShowMoreRoot.d.ts.map +1 -1
- package/dist/react-components/ShowMore/ShowMoreToggle.d.ts +1 -2
- package/dist/react-components/ShowMore/ShowMoreToggle.d.ts.map +1 -1
- package/dist/react-components/ShowMore/showMoreTypes.d.ts +16 -0
- package/dist/react-components/ShowMore/showMoreTypes.d.ts.map +1 -0
- package/dist/react-components/ShowMore/showMoreTypes.js +1 -0
- package/dist/react-components/Spoiler/Spoiler.d.ts +1 -0
- package/dist/react-components/Spoiler/Spoiler.d.ts.map +1 -1
- package/dist/react-components/Spoiler/Spoiler.js +1 -0
- package/dist/react-components/Spoiler/SpoilerBlur.d.ts +1 -2
- package/dist/react-components/Spoiler/SpoilerBlur.d.ts.map +1 -1
- package/dist/react-components/Spoiler/SpoilerContext.d.ts +1 -5
- package/dist/react-components/Spoiler/SpoilerContext.d.ts.map +1 -1
- package/dist/react-components/Spoiler/SpoilerRoot.d.ts +1 -2
- package/dist/react-components/Spoiler/SpoilerRoot.d.ts.map +1 -1
- package/dist/react-components/Spoiler/spoilerTypes.d.ts +8 -0
- package/dist/react-components/Spoiler/spoilerTypes.d.ts.map +1 -0
- package/dist/react-components/Spoiler/spoilerTypes.js +1 -0
- package/dist/react-components/Submit/Submit.d.ts +1 -0
- package/dist/react-components/Submit/Submit.d.ts.map +1 -1
- package/dist/react-components/Submit/Submit.js +1 -0
- package/dist/react-components/Submit/SubmitContext.d.ts +1 -3
- package/dist/react-components/Submit/SubmitContext.d.ts.map +1 -1
- package/dist/react-components/Submit/SubmitLoader.d.ts +2 -5
- package/dist/react-components/Submit/SubmitLoader.d.ts.map +1 -1
- package/dist/react-components/Submit/SubmitRoot.d.ts +1 -4
- package/dist/react-components/Submit/SubmitRoot.d.ts.map +1 -1
- package/dist/react-components/Submit/submitTypes.d.ts +11 -0
- package/dist/react-components/Submit/submitTypes.d.ts.map +1 -0
- package/dist/react-components/Submit/submitTypes.js +1 -0
- package/dist/react-components/Swap/Swap.d.ts +1 -0
- package/dist/react-components/Swap/Swap.d.ts.map +1 -1
- package/dist/react-components/Swap/Swap.js +1 -0
- package/dist/react-components/Swap/SwapBtn.d.ts +1 -4
- package/dist/react-components/Swap/SwapBtn.d.ts.map +1 -1
- package/dist/react-components/Swap/SwapContext.d.ts +1 -6
- package/dist/react-components/Swap/SwapContext.d.ts.map +1 -1
- package/dist/react-components/Swap/SwapRoot.d.ts +1 -6
- package/dist/react-components/Swap/SwapRoot.d.ts.map +1 -1
- package/dist/react-components/Swap/swapTypes.d.ts +15 -0
- package/dist/react-components/Swap/swapTypes.d.ts.map +1 -0
- package/dist/react-components/Swap/swapTypes.js +1 -0
- package/dist/react-components/Tabs/Tabs.d.ts +1 -0
- package/dist/react-components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/react-components/Tabs/Tabs.js +1 -0
- package/dist/react-components/Tabs/TabsContext.d.ts +1 -5
- package/dist/react-components/Tabs/TabsContext.d.ts.map +1 -1
- package/dist/react-components/Tabs/TabsList.d.ts +1 -2
- package/dist/react-components/Tabs/TabsList.d.ts.map +1 -1
- package/dist/react-components/Tabs/TabsPanel.d.ts +1 -4
- package/dist/react-components/Tabs/TabsPanel.d.ts.map +1 -1
- package/dist/react-components/Tabs/TabsRoot.d.ts +1 -5
- package/dist/react-components/Tabs/TabsRoot.d.ts.map +1 -1
- package/dist/react-components/Tabs/TabsTab.d.ts +1 -4
- package/dist/react-components/Tabs/TabsTab.d.ts.map +1 -1
- package/dist/react-components/Tabs/tabsTypes.d.ts +18 -0
- package/dist/react-components/Tabs/tabsTypes.d.ts.map +1 -0
- package/dist/react-components/Tabs/tabsTypes.js +1 -0
- package/dist/react-components/Theme/Theme.d.ts +1 -0
- package/dist/react-components/Theme/Theme.d.ts.map +1 -1
- package/dist/react-components/Theme/Theme.js +1 -0
- package/dist/react-components/Theme/ThemeContext.d.ts +1 -5
- package/dist/react-components/Theme/ThemeContext.d.ts.map +1 -1
- package/dist/react-components/Theme/ThemeProvider.d.ts +1 -3
- package/dist/react-components/Theme/ThemeProvider.d.ts.map +1 -1
- package/dist/react-components/Theme/themeTypes.d.ts +8 -0
- package/dist/react-components/Theme/themeTypes.d.ts.map +1 -0
- package/dist/react-components/Theme/themeTypes.js +1 -0
- package/dist/react-components/Theme/useTheme.d.ts +2 -2
- package/dist/react-components/drawer-sheet/DrawerSheet.d.ts +23 -0
- package/dist/react-components/drawer-sheet/DrawerSheet.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheet.js +22 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBackdrop.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBackdrop.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBackdrop.js +13 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBody.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBody.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBody.js +165 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContent.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContent.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContent.js +16 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContext.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContext.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContext.js +2 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHandlebar.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHandlebar.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHandlebar.js +5 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHeader.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHeader.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHeader.js +5 -0
- package/dist/react-components/drawer-sheet/DrawerSheetPortal.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetPortal.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetPortal.js +13 -0
- package/dist/react-components/drawer-sheet/DrawerSheetProvider.d.ts +15 -0
- package/dist/react-components/drawer-sheet/DrawerSheetProvider.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetProvider.js +75 -0
- package/dist/react-components/drawer-sheet/DrawerSheetRoot.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetRoot.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetRoot.js +130 -0
- package/dist/react-components/drawer-sheet/DrawerSheetToggle.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetToggle.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetToggle.js +11 -0
- package/dist/react-components/drawer-sheet/DrawerSheetViewport.d.ts +4 -0
- package/dist/react-components/drawer-sheet/DrawerSheetViewport.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetViewport.js +5 -0
- package/dist/react-components/drawer-sheet/drawerSheetTypes.d.ts +30 -0
- package/dist/react-components/drawer-sheet/drawerSheetTypes.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/drawerSheetTypes.js +1 -0
- package/dist/react-exports.d.ts +1 -0
- package/dist/react-exports.d.ts.map +1 -1
- package/dist/react-exports.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ContextMenuContextT = {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
closeHandler: () => void;
|
|
5
|
-
position: {
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
} | undefined;
|
|
9
|
-
contentRef: RefObject<HTMLDivElement | null>;
|
|
10
|
-
};
|
|
1
|
+
import type { ContextMenuContextT } from "./contextMenuTypes";
|
|
11
2
|
export declare const ContextMenuContext: import("react").Context<ContextMenuContextT>;
|
|
12
3
|
//# sourceMappingURL=ContextMenuContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenuContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,eAAO,MAAM,kBAAkB,8CAAgE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createContext } from
|
|
1
|
+
import { createContext } from "react";
|
|
2
2
|
export const ContextMenuContext = createContext({});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ContextMenuItemPropsT = ComponentProps<"button">;
|
|
1
|
+
import type { ContextMenuItemPropsT } from "./contextMenuTypes";
|
|
3
2
|
export declare function ContextMenuItem({ onClick, ...p }: ContextMenuItemPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export {};
|
|
5
3
|
//# sourceMappingURL=ContextMenuItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItem.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CASvE"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ContextMenuNavigationPropsT = AccessNavigationPropsT;
|
|
1
|
+
import type { ContextMenuNavigationPropsT } from "./contextMenuTypes";
|
|
3
2
|
export declare function ContextMenuNavigation(p: ContextMenuNavigationPropsT): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
export {};
|
|
5
3
|
//# sourceMappingURL=ContextMenuNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuNavigation.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuNavigation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenuNavigation.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuNavigation.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,2BAA2B,kDAInE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { use } from "react";
|
|
4
|
-
import { ContextMenuContext } from "./ContextMenuContext";
|
|
5
4
|
import { AccessNavigation } from "../AccessNavigation/AccessNavigation";
|
|
5
|
+
import { ContextMenuContext } from "./ContextMenuContext";
|
|
6
6
|
export function ContextMenuNavigation(p) {
|
|
7
7
|
const { isOpen } = use(ContextMenuContext);
|
|
8
8
|
return isOpen ? _jsx(AccessNavigation, { focusOnMount: true, ...p }) : null;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ContextMenuRootPropsT = ComponentProps<"div">;
|
|
1
|
+
import type { ContextMenuRootPropsT } from "./contextMenuTypes";
|
|
3
2
|
export declare function ContextMenuRoot({ onContextMenu, ...p }: ContextMenuRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=ContextMenuRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenuRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/ContextMenuRoot.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAuB,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAErF,wBAAgB,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,EAAE,qBAAqB,2CAyE7E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps, RefObject } from "react";
|
|
2
|
+
import type { AccessNavigationPropsT } from "../AccessNavigation/AccessNavigation";
|
|
3
|
+
export type ContextMenuContextT = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
closeHandler: () => void;
|
|
6
|
+
position: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
} | undefined;
|
|
10
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
11
|
+
};
|
|
12
|
+
export type ContextMenuRootPropsT = ComponentProps<"div">;
|
|
13
|
+
export type ContextMenuBodyPropsT = ComponentProps<"div">;
|
|
14
|
+
export type ContextMenuItemPropsT = ComponentProps<"button">;
|
|
15
|
+
export type ContextMenuNavigationPropsT = AccessNavigationPropsT;
|
|
16
|
+
//# sourceMappingURL=contextMenuTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextMenuTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/ContextMenu/contextMenuTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAY,SAAS,EAAkB,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC/C,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAE7D,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/Drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,MAAM;;;;CAIjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/Drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,MAAM;;;;CAIjB,CAAC;AAEH,cAAc,eAAe,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type DrawerBodyPropsT = HTMLMotionProps<"div"> & {
|
|
3
|
-
position?: "top" | "right" | "bottom" | "left";
|
|
4
|
-
};
|
|
1
|
+
import type { DrawerBodyPropsT } from "./drawerTypes";
|
|
5
2
|
export declare function DrawerBody({ position, dir, children, ...p }: DrawerBodyPropsT): import("react/jsx-runtime").JSX.Element;
|
|
6
3
|
//# sourceMappingURL=DrawerBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerBody.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerBody.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerBody.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerBody.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,EAAE,gBAAgB,2CAwD7E"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { motion } from "framer-motion";
|
|
4
4
|
import { use, useEffect, useRef } from "react";
|
|
5
|
-
import { DrawerContext } from "./DrawerContext";
|
|
6
5
|
import { FRAMER_MOTION_DURATION } from "../../configs";
|
|
6
|
+
import { DrawerContext } from "./DrawerContext";
|
|
7
7
|
export function DrawerBody({ position, dir, children, ...p }) {
|
|
8
8
|
const { isOpen } = use(DrawerContext);
|
|
9
9
|
const bodyRef = useRef(null);
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type DrawerContextT = {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
5
|
-
};
|
|
1
|
+
import type { DrawerContextT } from "./drawerTypes";
|
|
6
2
|
export declare const DrawerContext: import("react").Context<DrawerContextT>;
|
|
7
3
|
//# sourceMappingURL=DrawerContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerContext.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,aAAa,yCAAsD,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type DrawerPortalPropsT = HTMLMotionProps<"div">;
|
|
1
|
+
import type { DrawerPortalPropsT } from "./drawerTypes";
|
|
3
2
|
export declare function DrawerPortal({ onClick, ...p }: DrawerPortalPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=DrawerPortal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerPortal.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerPortal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerPortal.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerPortal.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CAuBjE"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { use } from "react";
|
|
4
4
|
import { motion, AnimatePresence } from "framer-motion";
|
|
5
|
+
import { ClientOnly } from "../ClientOnly/ClientOnly";
|
|
5
6
|
import { Portal } from "../Portal/Portal";
|
|
6
7
|
import { DrawerContext } from "./DrawerContext";
|
|
7
|
-
import { ClientOnly } from "../ClientOnly/ClientOnly";
|
|
8
8
|
export function DrawerPortal({ onClick, ...p }) {
|
|
9
9
|
const { isOpen, setOpen } = use(DrawerContext);
|
|
10
10
|
return (_jsx(ClientOnly, { children: _jsx(Portal, { children: _jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: ev => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type DrawerRootPropsT = PropsWithChildren;
|
|
1
|
+
import type { DrawerRootPropsT } from "./drawerTypes";
|
|
3
2
|
export declare function DrawerRoot({ children }: DrawerRootPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=DrawerRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerRoot.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerRoot.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CA2CxD"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { usePathname } from "next/navigation";
|
|
4
4
|
import { useState, useEffect } from "react";
|
|
5
|
-
import { DrawerContext } from "./DrawerContext";
|
|
6
5
|
import { getBrowserScrollbarWith } from "../../utils-exports";
|
|
6
|
+
import { DrawerContext } from "./DrawerContext";
|
|
7
7
|
export function DrawerRoot({ children }) {
|
|
8
8
|
const pathname = usePathname();
|
|
9
9
|
const [isOpen, setOpen] = useState(false);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type DrawerTogglePropsT = ComponentProps<"button">;
|
|
1
|
+
import type { DrawerTogglePropsT } from "./drawerTypes";
|
|
3
2
|
export declare function DrawerToggle({ onClick, ...props }: DrawerTogglePropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=DrawerToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerToggle.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerToggle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerToggle.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/DrawerToggle.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAYrE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLMotionProps } from "framer-motion";
|
|
2
|
+
import type { ComponentProps, Dispatch, PropsWithChildren, SetStateAction } from "react";
|
|
3
|
+
export type DrawerContextT = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
};
|
|
7
|
+
export type DrawerRootPropsT = PropsWithChildren;
|
|
8
|
+
export type DrawerBodyPropsT = HTMLMotionProps<"div"> & {
|
|
9
|
+
position?: "top" | "right" | "bottom" | "left";
|
|
10
|
+
};
|
|
11
|
+
export type DrawerTogglePropsT = ComponentProps<"button">;
|
|
12
|
+
export type DrawerPortalPropsT = HTMLMotionProps<"div">;
|
|
13
|
+
//# sourceMappingURL=drawerTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawerTypes.d.ts","sourceRoot":"","sources":["../../../src/react-components/Drawer/drawerTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEzF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG;IACtD,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerSheet.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/DrawerSheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DrawerSheet } from "./index";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isMobileFirefox(): boolean | undefined;
|
|
2
|
+
export declare function isMac(): boolean | undefined;
|
|
3
|
+
export declare function isIPhone(): boolean | undefined;
|
|
4
|
+
export declare function isSafari(): boolean | undefined;
|
|
5
|
+
export declare function isIPad(): boolean | undefined;
|
|
6
|
+
export declare function isIOS(): boolean | undefined;
|
|
7
|
+
export declare function testPlatform(re: RegExp): boolean | undefined;
|
|
8
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/browser.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,IAAI,OAAO,GAAG,SAAS,CAOrD;AAED,wBAAgB,KAAK,IAAI,OAAO,GAAG,SAAS,CAE3C;AAED,wBAAgB,QAAQ,IAAI,OAAO,GAAG,SAAS,CAE9C;AAED,wBAAgB,QAAQ,IAAI,OAAO,GAAG,SAAS,CAE9C;AAED,wBAAgB,MAAM,IAAI,OAAO,GAAG,SAAS,CAM5C;AAED,wBAAgB,KAAK,IAAI,OAAO,GAAG,SAAS,CAE3C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE5D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function isMobileFirefox() {
|
|
2
|
+
const userAgent = navigator.userAgent;
|
|
3
|
+
return (typeof window !== 'undefined' &&
|
|
4
|
+
((/Firefox/.test(userAgent) && /Mobile/.test(userAgent)) || // Android Firefox
|
|
5
|
+
/FxiOS/.test(userAgent)) // iOS Firefox
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
export function isMac() {
|
|
9
|
+
return testPlatform(/^Mac/);
|
|
10
|
+
}
|
|
11
|
+
export function isIPhone() {
|
|
12
|
+
return testPlatform(/^iPhone/);
|
|
13
|
+
}
|
|
14
|
+
export function isSafari() {
|
|
15
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
16
|
+
}
|
|
17
|
+
export function isIPad() {
|
|
18
|
+
return (testPlatform(/^iPad/) ||
|
|
19
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
20
|
+
(isMac() && navigator.maxTouchPoints > 1));
|
|
21
|
+
}
|
|
22
|
+
export function isIOS() {
|
|
23
|
+
return isIPhone() || isIPad();
|
|
24
|
+
}
|
|
25
|
+
export function testPlatform(re) {
|
|
26
|
+
return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : undefined;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const TRANSITIONS: {
|
|
2
|
+
DURATION: number;
|
|
3
|
+
EASE: number[];
|
|
4
|
+
};
|
|
5
|
+
export declare const VELOCITY_THRESHOLD = 0.4;
|
|
6
|
+
export declare const CLOSE_THRESHOLD = 0.25;
|
|
7
|
+
export declare const SCROLL_LOCK_TIMEOUT = 100;
|
|
8
|
+
export declare const BORDER_RADIUS = 8;
|
|
9
|
+
export declare const NESTED_DISPLACEMENT = 16;
|
|
10
|
+
export declare const WINDOW_TOP_OFFSET = 26;
|
|
11
|
+
export declare const DRAG_CLASS = "drawer-sheet-dragging";
|
|
12
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,UAAU,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const TRANSITIONS = {
|
|
2
|
+
DURATION: 0.5,
|
|
3
|
+
EASE: [0.32, 0.72, 0, 1],
|
|
4
|
+
};
|
|
5
|
+
export const VELOCITY_THRESHOLD = 0.4;
|
|
6
|
+
export const CLOSE_THRESHOLD = 0.25;
|
|
7
|
+
export const SCROLL_LOCK_TIMEOUT = 100;
|
|
8
|
+
export const BORDER_RADIUS = 8;
|
|
9
|
+
export const NESTED_DISPLACEMENT = 16;
|
|
10
|
+
export const WINDOW_TOP_OFFSET = 26;
|
|
11
|
+
export const DRAG_CLASS = 'drawer-sheet-dragging';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DrawerDirection } from './types';
|
|
3
|
+
interface DrawerContextValue {
|
|
4
|
+
drawerRef: React.RefObject<HTMLDivElement | null>;
|
|
5
|
+
overlayRef: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
onPress: (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
7
|
+
onRelease: (event: React.PointerEvent<HTMLDivElement> | null) => void;
|
|
8
|
+
onDrag: (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
9
|
+
onNestedDrag: (event: React.PointerEvent<HTMLDivElement>, percentageDragged: number) => void;
|
|
10
|
+
onNestedOpenChange: (o: boolean) => void;
|
|
11
|
+
onNestedRelease: (event: React.PointerEvent<HTMLDivElement>, open: boolean) => void;
|
|
12
|
+
dismissible: boolean;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
isDragging: boolean;
|
|
15
|
+
keyboardIsOpen: React.MutableRefObject<boolean>;
|
|
16
|
+
snapPointsOffset: number[] | null;
|
|
17
|
+
snapPoints?: (number | string)[] | null;
|
|
18
|
+
activeSnapPointIndex?: number | null;
|
|
19
|
+
modal: boolean;
|
|
20
|
+
shouldFade: boolean;
|
|
21
|
+
activeSnapPoint?: number | string | null;
|
|
22
|
+
setActiveSnapPoint: (o: number | string | null) => void;
|
|
23
|
+
closeDrawer: (fromWithin?: boolean) => void;
|
|
24
|
+
openProp?: boolean;
|
|
25
|
+
onOpenChange?: (o: boolean) => void;
|
|
26
|
+
direction: DrawerDirection;
|
|
27
|
+
shouldScaleBackground: boolean;
|
|
28
|
+
setBackgroundColorOnScale: boolean;
|
|
29
|
+
noBodyStyles: boolean;
|
|
30
|
+
handleOnly?: boolean;
|
|
31
|
+
container?: HTMLElement | null;
|
|
32
|
+
autoFocus?: boolean;
|
|
33
|
+
shouldAnimate?: React.RefObject<boolean>;
|
|
34
|
+
}
|
|
35
|
+
export declare const DrawerContext: React.Context<DrawerContextValue>;
|
|
36
|
+
export declare const useDrawerContext: () => DrawerContextValue;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,UAAU,kBAAkB;IAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClD,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC7D,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC5D,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7F,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACpF,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,gBAAgB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACzC,kBAAkB,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,eAAe,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,yBAAyB,EAAE,OAAO,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,aAAa,mCA8BxB,CAAC;AAEH,eAAO,MAAM,gBAAgB,0BAM5B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const DrawerContext = React.createContext({
|
|
3
|
+
drawerRef: { current: null },
|
|
4
|
+
overlayRef: { current: null },
|
|
5
|
+
onPress: () => { },
|
|
6
|
+
onRelease: () => { },
|
|
7
|
+
onDrag: () => { },
|
|
8
|
+
onNestedDrag: () => { },
|
|
9
|
+
onNestedOpenChange: () => { },
|
|
10
|
+
onNestedRelease: () => { },
|
|
11
|
+
openProp: undefined,
|
|
12
|
+
dismissible: false,
|
|
13
|
+
isOpen: false,
|
|
14
|
+
isDragging: false,
|
|
15
|
+
keyboardIsOpen: { current: false },
|
|
16
|
+
snapPointsOffset: null,
|
|
17
|
+
snapPoints: null,
|
|
18
|
+
handleOnly: false,
|
|
19
|
+
modal: false,
|
|
20
|
+
shouldFade: false,
|
|
21
|
+
activeSnapPoint: null,
|
|
22
|
+
onOpenChange: () => { },
|
|
23
|
+
setActiveSnapPoint: () => { },
|
|
24
|
+
closeDrawer: () => { },
|
|
25
|
+
direction: 'bottom',
|
|
26
|
+
shouldAnimate: { current: true },
|
|
27
|
+
shouldScaleBackground: false,
|
|
28
|
+
setBackgroundColorOnScale: true,
|
|
29
|
+
noBodyStyles: false,
|
|
30
|
+
container: null,
|
|
31
|
+
autoFocus: false,
|
|
32
|
+
});
|
|
33
|
+
export const useDrawerContext = () => {
|
|
34
|
+
const context = React.useContext(DrawerContext);
|
|
35
|
+
if (!context) {
|
|
36
|
+
throw new Error('useDrawerContext must be used within a Drawer.Root');
|
|
37
|
+
}
|
|
38
|
+
return context;
|
|
39
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnyFunction, DrawerDirection } from './types';
|
|
2
|
+
interface Style {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function isInView(el: HTMLElement): boolean;
|
|
6
|
+
export declare function set(el: Element | HTMLElement | null | undefined, styles: Style, ignoreCache?: boolean): void;
|
|
7
|
+
export declare function reset(el: Element | HTMLElement | null, prop?: string): void;
|
|
8
|
+
export declare const isVertical: (direction: DrawerDirection) => boolean;
|
|
9
|
+
export declare function getTranslate(element: HTMLElement, direction: DrawerDirection): number | null;
|
|
10
|
+
export declare function dampenValue(v: number): number;
|
|
11
|
+
export declare function assignStyle(element: HTMLElement | null | undefined, style: Partial<CSSStyleDeclaration>): () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Receives functions as arguments and returns a new function that calls all.
|
|
14
|
+
*/
|
|
15
|
+
export declare function chain<T>(...fns: T[]): (...args: T extends AnyFunction ? Parameters<T> : never) => void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEvD,UAAU,KAAK;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAID,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAYjD;AAED,wBAAgB,GAAG,CAAC,EAAE,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,UAAQ,QAiBnG;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,QAepE;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,eAAe,YAWpD,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAgB5F;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,UAEpC;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,cASvG;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,EAAE,IAC1B,GAAG,MAAM,CAAC,SAAS,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,UAQ/D"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const cache = new WeakMap();
|
|
2
|
+
export function isInView(el) {
|
|
3
|
+
const rect = el.getBoundingClientRect();
|
|
4
|
+
if (!window.visualViewport)
|
|
5
|
+
return false;
|
|
6
|
+
return (rect.top >= 0 &&
|
|
7
|
+
rect.left >= 0 &&
|
|
8
|
+
// Need + 40 for safari detection
|
|
9
|
+
rect.bottom <= window.visualViewport.height - 40 &&
|
|
10
|
+
rect.right <= window.visualViewport.width);
|
|
11
|
+
}
|
|
12
|
+
export function set(el, styles, ignoreCache = false) {
|
|
13
|
+
if (!el || !(el instanceof HTMLElement))
|
|
14
|
+
return;
|
|
15
|
+
let originalStyles = {};
|
|
16
|
+
Object.entries(styles).forEach(([key, value]) => {
|
|
17
|
+
if (key.startsWith('--')) {
|
|
18
|
+
el.style.setProperty(key, value);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
originalStyles[key] = el.style[key];
|
|
22
|
+
el.style[key] = value;
|
|
23
|
+
});
|
|
24
|
+
if (ignoreCache)
|
|
25
|
+
return;
|
|
26
|
+
cache.set(el, originalStyles);
|
|
27
|
+
}
|
|
28
|
+
export function reset(el, prop) {
|
|
29
|
+
if (!el || !(el instanceof HTMLElement))
|
|
30
|
+
return;
|
|
31
|
+
let originalStyles = cache.get(el);
|
|
32
|
+
if (!originalStyles) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (prop) {
|
|
36
|
+
el.style[prop] = originalStyles[prop];
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
Object.entries(originalStyles).forEach(([key, value]) => {
|
|
40
|
+
el.style[key] = value;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export const isVertical = (direction) => {
|
|
45
|
+
switch (direction) {
|
|
46
|
+
case 'top':
|
|
47
|
+
case 'bottom':
|
|
48
|
+
return true;
|
|
49
|
+
case 'left':
|
|
50
|
+
case 'right':
|
|
51
|
+
return false;
|
|
52
|
+
default:
|
|
53
|
+
return direction;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export function getTranslate(element, direction) {
|
|
57
|
+
if (!element) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const style = window.getComputedStyle(element);
|
|
61
|
+
const transform =
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
style.transform || style.webkitTransform || style.mozTransform;
|
|
64
|
+
let mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
65
|
+
if (mat) {
|
|
66
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d
|
|
67
|
+
return parseFloat(mat[1].split(', ')[isVertical(direction) ? 13 : 12]);
|
|
68
|
+
}
|
|
69
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix
|
|
70
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
|
71
|
+
return mat ? parseFloat(mat[1].split(', ')[isVertical(direction) ? 5 : 4]) : null;
|
|
72
|
+
}
|
|
73
|
+
export function dampenValue(v) {
|
|
74
|
+
return 8 * (Math.log(v + 1) - 2);
|
|
75
|
+
}
|
|
76
|
+
export function assignStyle(element, style) {
|
|
77
|
+
if (!element)
|
|
78
|
+
return () => { };
|
|
79
|
+
const prevStyle = element.style.cssText;
|
|
80
|
+
Object.assign(element.style, style);
|
|
81
|
+
return () => {
|
|
82
|
+
element.style.cssText = prevStyle;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Receives functions as arguments and returns a new function that calls all.
|
|
87
|
+
*/
|
|
88
|
+
export function chain(...fns) {
|
|
89
|
+
return (...args) => {
|
|
90
|
+
for (const fn of fns) {
|
|
91
|
+
if (typeof fn === 'function') {
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
fn(...args);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|