@faststore/components 3.0.24 → 3.0.32-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms/Badge/Badge.d.ts +27 -0
- package/dist/atoms/Badge/Badge.js +7 -0
- package/dist/atoms/Badge/Badge.js.map +1 -0
- package/dist/atoms/Badge/index.d.ts +2 -0
- package/dist/atoms/Badge/index.js +2 -0
- package/dist/atoms/Badge/index.js.map +1 -0
- package/dist/atoms/Button/Button.d.ts +45 -0
- package/dist/atoms/Button/Button.js +14 -0
- package/dist/atoms/Button/Button.js.map +1 -0
- package/dist/atoms/Button/index.d.ts +2 -0
- package/dist/atoms/Button/index.js +2 -0
- package/dist/atoms/Button/index.js.map +1 -0
- package/dist/atoms/Checkbox/Checkbox.d.ts +14 -0
- package/dist/atoms/Checkbox/Checkbox.js +6 -0
- package/dist/atoms/Checkbox/Checkbox.js.map +1 -0
- package/dist/atoms/Checkbox/index.d.ts +2 -0
- package/dist/atoms/Checkbox/index.js +2 -0
- package/dist/atoms/Checkbox/index.js.map +1 -0
- package/dist/atoms/Icon/Icon.d.ts +35 -0
- package/dist/atoms/Icon/Icon.js +14 -0
- package/dist/atoms/Icon/Icon.js.map +1 -0
- package/dist/atoms/Icon/index.d.ts +2 -0
- package/dist/atoms/Icon/index.js +2 -0
- package/dist/atoms/Icon/index.js.map +1 -0
- package/dist/atoms/Input/Input.d.ts +10 -0
- package/dist/atoms/Input/Input.js +6 -0
- package/dist/atoms/Input/Input.js.map +1 -0
- package/dist/atoms/Input/index.d.ts +2 -0
- package/dist/atoms/Input/index.js +2 -0
- package/dist/atoms/Input/index.js.map +1 -0
- package/dist/atoms/Label/Label.d.ts +10 -0
- package/dist/atoms/Label/Label.js +6 -0
- package/dist/atoms/Label/Label.js.map +1 -0
- package/dist/atoms/Label/index.d.ts +2 -0
- package/dist/atoms/Label/index.js +2 -0
- package/dist/atoms/Label/index.js.map +1 -0
- package/dist/atoms/Link/Link.d.ts +25 -0
- package/dist/atoms/Link/Link.js +7 -0
- package/dist/atoms/Link/Link.js.map +1 -0
- package/dist/atoms/Link/index.d.ts +2 -0
- package/dist/atoms/Link/index.js +2 -0
- package/dist/atoms/Link/index.js.map +1 -0
- package/dist/atoms/List/List.d.ts +16 -0
- package/dist/atoms/List/List.js +7 -0
- package/dist/atoms/List/List.js.map +1 -0
- package/dist/atoms/List/index.d.ts +2 -0
- package/dist/atoms/List/index.js +2 -0
- package/dist/atoms/List/index.js.map +1 -0
- package/dist/atoms/Loader/Loader.d.ts +14 -0
- package/dist/atoms/Loader/Loader.js +9 -0
- package/dist/atoms/Loader/Loader.js.map +1 -0
- package/dist/atoms/Loader/index.d.ts +2 -0
- package/dist/atoms/Loader/index.js +2 -0
- package/dist/atoms/Loader/index.js.map +1 -0
- package/dist/atoms/Overlay/Overlay.d.ts +10 -0
- package/dist/atoms/Overlay/Overlay.js +6 -0
- package/dist/atoms/Overlay/Overlay.js.map +1 -0
- package/dist/atoms/Overlay/index.d.ts +2 -0
- package/dist/atoms/Overlay/index.js +2 -0
- package/dist/atoms/Overlay/index.js.map +1 -0
- package/dist/atoms/Price/Price.d.ts +32 -0
- package/dist/atoms/Price/Price.js +10 -0
- package/dist/atoms/Price/Price.js.map +1 -0
- package/dist/atoms/Price/index.d.ts +2 -0
- package/dist/atoms/Price/index.js +2 -0
- package/dist/atoms/Price/index.js.map +1 -0
- package/dist/atoms/Radio/Radio.d.ts +10 -0
- package/dist/atoms/Radio/Radio.js +6 -0
- package/dist/atoms/Radio/Radio.js.map +1 -0
- package/dist/atoms/Radio/index.d.ts +2 -0
- package/dist/atoms/Radio/index.js +2 -0
- package/dist/atoms/Radio/index.js.map +1 -0
- package/dist/atoms/SROnly/SROnly.d.ts +14 -0
- package/dist/atoms/SROnly/SROnly.js +7 -0
- package/dist/atoms/SROnly/SROnly.js.map +1 -0
- package/dist/atoms/SROnly/index.d.ts +1 -0
- package/dist/atoms/SROnly/index.js +2 -0
- package/dist/atoms/SROnly/index.js.map +1 -0
- package/dist/atoms/Select/Select.d.ts +20 -0
- package/dist/atoms/Select/Select.js +9 -0
- package/dist/atoms/Select/Select.js.map +1 -0
- package/dist/atoms/Select/index.d.ts +2 -0
- package/dist/atoms/Select/index.js +2 -0
- package/dist/atoms/Select/index.js.map +1 -0
- package/dist/atoms/Skeleton/Skeleton.d.ts +37 -0
- package/dist/atoms/Skeleton/Skeleton.js +10 -0
- package/dist/atoms/Skeleton/Skeleton.js.map +1 -0
- package/dist/atoms/Skeleton/index.d.ts +2 -0
- package/dist/atoms/Skeleton/index.js +2 -0
- package/dist/atoms/Skeleton/index.js.map +1 -0
- package/dist/atoms/Slider/Slider.d.ts +71 -0
- package/dist/atoms/Slider/Slider.js +57 -0
- package/dist/atoms/Slider/Slider.js.map +1 -0
- package/dist/atoms/Slider/index.d.ts +2 -0
- package/dist/atoms/Slider/index.js +2 -0
- package/dist/atoms/Slider/index.js.map +1 -0
- package/dist/cjs/organisms/ImageGallery/ImageZoom.d.ts +7 -0
- package/dist/cjs/organisms/ImageGallery/ImageZoom.js +9 -0
- package/dist/cjs/organisms/ImageGallery/ImageZoom.js.map +1 -0
- package/dist/cjs/organisms/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/cjs/organisms/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/esm/organisms/ImageGallery/ImageZoom.d.ts +7 -0
- package/dist/esm/organisms/ImageGallery/ImageZoom.js +6 -0
- package/dist/esm/organisms/ImageGallery/ImageZoom.js.map +1 -0
- package/dist/esm/organisms/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/esm/organisms/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/hooks/UIProvider.d.ts +34 -0
- package/dist/hooks/UIProvider.js +78 -0
- package/dist/hooks/UIProvider.js.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useFadeEffect.d.ts +5 -0
- package/dist/hooks/useFadeEffect.js +18 -0
- package/dist/hooks/useFadeEffect.js.map +1 -0
- package/dist/hooks/useScrollDirection.d.ts +1 -0
- package/dist/hooks/useScrollDirection.js +22 -0
- package/dist/hooks/useScrollDirection.js.map +1 -0
- package/dist/hooks/useSearch.d.ts +7 -0
- package/dist/hooks/useSearch.js +10 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/hooks/useSlideVisibility.d.ts +9 -0
- package/dist/hooks/useSlideVisibility.js +29 -0
- package/dist/hooks/useSlideVisibility.js.map +1 -0
- package/dist/hooks/useSlider.d.ts +64 -0
- package/dist/hooks/useSlider.js +103 -0
- package/dist/hooks/useSlider.js.map +1 -0
- package/dist/hooks/useTrapFocus.d.ts +8 -0
- package/dist/hooks/useTrapFocus.js +75 -0
- package/dist/hooks/useTrapFocus.js.map +1 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/molecules/Accordion/Accordion.d.ts +26 -0
- package/dist/molecules/Accordion/Accordion.js +21 -0
- package/dist/molecules/Accordion/Accordion.js.map +1 -0
- package/dist/molecules/Accordion/AccordionButton.d.ts +19 -0
- package/dist/molecules/Accordion/AccordionButton.js +37 -0
- package/dist/molecules/Accordion/AccordionButton.js.map +1 -0
- package/dist/molecules/Accordion/AccordionItem.d.ts +31 -0
- package/dist/molecules/Accordion/AccordionItem.js +22 -0
- package/dist/molecules/Accordion/AccordionItem.js.map +1 -0
- package/dist/molecules/Accordion/AccordionPanel.d.ts +10 -0
- package/dist/molecules/Accordion/AccordionPanel.js +10 -0
- package/dist/molecules/Accordion/AccordionPanel.js.map +1 -0
- package/dist/molecules/Accordion/index.d.ts +8 -0
- package/dist/molecules/Accordion/index.js +5 -0
- package/dist/molecules/Accordion/index.js.map +1 -0
- package/dist/molecules/Alert/Alert.d.ts +29 -0
- package/dist/molecules/Alert/Alert.js +17 -0
- package/dist/molecules/Alert/Alert.js.map +1 -0
- package/dist/molecules/Alert/index.d.ts +2 -0
- package/dist/molecules/Alert/index.js +2 -0
- package/dist/molecules/Alert/index.js.map +1 -0
- package/dist/molecules/Breadcrumb/Breadcrumb.d.ts +6 -0
- package/dist/molecules/Breadcrumb/Breadcrumb.js +7 -0
- package/dist/molecules/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/molecules/Breadcrumb/BreadcrumbBase.d.ts +47 -0
- package/dist/molecules/Breadcrumb/BreadcrumbBase.js +45 -0
- package/dist/molecules/Breadcrumb/BreadcrumbBase.js.map +1 -0
- package/dist/molecules/Breadcrumb/BreadcrumbPure.d.ts +14 -0
- package/dist/molecules/Breadcrumb/BreadcrumbPure.js +12 -0
- package/dist/molecules/Breadcrumb/BreadcrumbPure.js.map +1 -0
- package/dist/molecules/Breadcrumb/Divider.d.ts +4 -0
- package/dist/molecules/Breadcrumb/Divider.js +14 -0
- package/dist/molecules/Breadcrumb/Divider.js.map +1 -0
- package/dist/molecules/Breadcrumb/ListItem.d.ts +10 -0
- package/dist/molecules/Breadcrumb/ListItem.js +20 -0
- package/dist/molecules/Breadcrumb/ListItem.js.map +1 -0
- package/dist/molecules/Breadcrumb/index.d.ts +4 -0
- package/dist/molecules/Breadcrumb/index.js +3 -0
- package/dist/molecules/Breadcrumb/index.js.map +1 -0
- package/dist/molecules/BuyButton/BuyButton.d.ts +5 -0
- package/dist/molecules/BuyButton/BuyButton.js +7 -0
- package/dist/molecules/BuyButton/BuyButton.js.map +1 -0
- package/dist/molecules/BuyButton/index.d.ts +1 -0
- package/dist/molecules/BuyButton/index.js +2 -0
- package/dist/molecules/BuyButton/index.js.map +1 -0
- package/dist/molecules/Carousel/Carousel.d.ts +60 -0
- package/dist/molecules/Carousel/Carousel.js +188 -0
- package/dist/molecules/Carousel/Carousel.js.map +1 -0
- package/dist/molecules/Carousel/CarouselBullets.d.ts +39 -0
- package/dist/molecules/Carousel/CarouselBullets.js +12 -0
- package/dist/molecules/Carousel/CarouselBullets.js.map +1 -0
- package/dist/molecules/Carousel/CarouselItem.d.ts +13 -0
- package/dist/molecules/Carousel/CarouselItem.js +20 -0
- package/dist/molecules/Carousel/CarouselItem.js.map +1 -0
- package/dist/molecules/Carousel/index.d.ts +6 -0
- package/dist/molecules/Carousel/index.js +4 -0
- package/dist/molecules/Carousel/index.js.map +1 -0
- package/dist/molecules/CartItem/CartItem.d.ts +32 -0
- package/dist/molecules/CartItem/CartItem.js +12 -0
- package/dist/molecules/CartItem/CartItem.js.map +1 -0
- package/dist/molecules/CartItem/CartItemImage.d.ts +10 -0
- package/dist/molecules/CartItem/CartItemImage.js +6 -0
- package/dist/molecules/CartItem/CartItemImage.js.map +1 -0
- package/dist/molecules/CartItem/CartItemSummary.d.ts +21 -0
- package/dist/molecules/CartItem/CartItemSummary.js +12 -0
- package/dist/molecules/CartItem/CartItemSummary.js.map +1 -0
- package/dist/molecules/CartItem/index.d.ts +6 -0
- package/dist/molecules/CartItem/index.js +4 -0
- package/dist/molecules/CartItem/index.js.map +1 -0
- package/dist/molecules/CheckboxField/CheckboxField.d.ts +25 -0
- package/dist/molecules/CheckboxField/CheckboxField.js +10 -0
- package/dist/molecules/CheckboxField/CheckboxField.js.map +1 -0
- package/dist/molecules/CheckboxField/index.d.ts +2 -0
- package/dist/molecules/CheckboxField/index.js +2 -0
- package/dist/molecules/CheckboxField/index.js.map +1 -0
- package/dist/molecules/DiscountBadge/DiscountBadge.d.ts +26 -0
- package/dist/molecules/DiscountBadge/DiscountBadge.js +19 -0
- package/dist/molecules/DiscountBadge/DiscountBadge.js.map +1 -0
- package/dist/molecules/DiscountBadge/index.d.ts +2 -0
- package/dist/molecules/DiscountBadge/index.js +2 -0
- package/dist/molecules/DiscountBadge/index.js.map +1 -0
- package/dist/molecules/DiscountBadge/useDiscountPercent.d.ts +1 -0
- package/dist/molecules/DiscountBadge/useDiscountPercent.js +9 -0
- package/dist/molecules/DiscountBadge/useDiscountPercent.js.map +1 -0
- package/dist/molecules/Dropdown/Dropdown.d.ts +18 -0
- package/dist/molecules/Dropdown/Dropdown.js +66 -0
- package/dist/molecules/Dropdown/Dropdown.js.map +1 -0
- package/dist/molecules/Dropdown/DropdownButton.d.ts +14 -0
- package/dist/molecules/Dropdown/DropdownButton.js +12 -0
- package/dist/molecules/Dropdown/DropdownButton.js.map +1 -0
- package/dist/molecules/Dropdown/DropdownItem.d.ts +14 -0
- package/dist/molecules/Dropdown/DropdownItem.js +28 -0
- package/dist/molecules/Dropdown/DropdownItem.js.map +1 -0
- package/dist/molecules/Dropdown/DropdownMenu.d.ts +26 -0
- package/dist/molecules/Dropdown/DropdownMenu.js +66 -0
- package/dist/molecules/Dropdown/DropdownMenu.js.map +1 -0
- package/dist/molecules/Dropdown/contexts/DropdownContext.d.ts +41 -0
- package/dist/molecules/Dropdown/contexts/DropdownContext.js +11 -0
- package/dist/molecules/Dropdown/contexts/DropdownContext.js.map +1 -0
- package/dist/molecules/Dropdown/hooks/useDropdown.d.ts +6 -0
- package/dist/molecules/Dropdown/hooks/useDropdown.js +14 -0
- package/dist/molecules/Dropdown/hooks/useDropdown.js.map +1 -0
- package/dist/molecules/Dropdown/hooks/useDropdownPosition.d.ts +8 -0
- package/dist/molecules/Dropdown/hooks/useDropdownPosition.js +25 -0
- package/dist/molecules/Dropdown/hooks/useDropdownPosition.js.map +1 -0
- package/dist/molecules/Dropdown/index.d.ts +8 -0
- package/dist/molecules/Dropdown/index.js +5 -0
- package/dist/molecules/Dropdown/index.js.map +1 -0
- package/dist/molecules/Gift/Gift.d.ts +15 -0
- package/dist/molecules/Gift/Gift.js +8 -0
- package/dist/molecules/Gift/Gift.js.map +1 -0
- package/dist/molecules/Gift/GiftContent.d.ts +27 -0
- package/dist/molecules/Gift/GiftContent.js +14 -0
- package/dist/molecules/Gift/GiftContent.js.map +1 -0
- package/dist/molecules/Gift/GiftImage.d.ts +10 -0
- package/dist/molecules/Gift/GiftImage.js +6 -0
- package/dist/molecules/Gift/GiftImage.js.map +1 -0
- package/dist/molecules/Gift/index.d.ts +6 -0
- package/dist/molecules/Gift/index.js +4 -0
- package/dist/molecules/Gift/index.js.map +1 -0
- package/dist/molecules/IconButton/IconButton.d.ts +19 -0
- package/dist/molecules/IconButton/IconButton.js +7 -0
- package/dist/molecules/IconButton/IconButton.js.map +1 -0
- package/dist/molecules/IconButton/index.d.ts +2 -0
- package/dist/molecules/IconButton/index.js +2 -0
- package/dist/molecules/IconButton/index.js.map +1 -0
- package/dist/molecules/InputField/InputField.d.ts +60 -0
- package/dist/molecules/InputField/InputField.js +18 -0
- package/dist/molecules/InputField/InputField.js.map +1 -0
- package/dist/molecules/InputField/index.d.ts +2 -0
- package/dist/molecules/InputField/index.js +2 -0
- package/dist/molecules/InputField/index.js.map +1 -0
- package/dist/molecules/LinkButton/LinkButton.d.ts +6 -0
- package/dist/molecules/LinkButton/LinkButton.js +17 -0
- package/dist/molecules/LinkButton/LinkButton.js.map +1 -0
- package/dist/molecules/LinkButton/index.d.ts +2 -0
- package/dist/molecules/LinkButton/index.js +2 -0
- package/dist/molecules/LinkButton/index.js.map +1 -0
- package/dist/molecules/Modal/Modal.d.ts +39 -0
- package/dist/molecules/Modal/Modal.js +38 -0
- package/dist/molecules/Modal/Modal.js.map +1 -0
- package/dist/molecules/Modal/ModalBody.d.ts +9 -0
- package/dist/molecules/Modal/ModalBody.js +4 -0
- package/dist/molecules/Modal/ModalBody.js.map +1 -0
- package/dist/molecules/Modal/ModalContent.d.ts +11 -0
- package/dist/molecules/Modal/ModalContent.js +23 -0
- package/dist/molecules/Modal/ModalContent.js.map +1 -0
- package/dist/molecules/Modal/ModalHeader.d.ts +22 -0
- package/dist/molecules/Modal/ModalHeader.js +11 -0
- package/dist/molecules/Modal/ModalHeader.js.map +1 -0
- package/dist/molecules/Modal/index.d.ts +5 -0
- package/dist/molecules/Modal/index.js +4 -0
- package/dist/molecules/Modal/index.js.map +1 -0
- package/dist/molecules/NavbarLinks/NavbarLinks.d.ts +10 -0
- package/dist/molecules/NavbarLinks/NavbarLinks.js +6 -0
- package/dist/molecules/NavbarLinks/NavbarLinks.js.map +1 -0
- package/dist/molecules/NavbarLinks/NavbarLinksList.d.ts +10 -0
- package/dist/molecules/NavbarLinks/NavbarLinksList.js +7 -0
- package/dist/molecules/NavbarLinks/NavbarLinksList.js.map +1 -0
- package/dist/molecules/NavbarLinks/NavbarLinksListItem.d.ts +10 -0
- package/dist/molecules/NavbarLinks/NavbarLinksListItem.js +6 -0
- package/dist/molecules/NavbarLinks/NavbarLinksListItem.js.map +1 -0
- package/dist/molecules/NavbarLinks/index.d.ts +6 -0
- package/dist/molecules/NavbarLinks/index.js +4 -0
- package/dist/molecules/NavbarLinks/index.js.map +1 -0
- package/dist/molecules/OrderSummary/OrderSummary.d.ts +35 -0
- package/dist/molecules/OrderSummary/OrderSummary.js +16 -0
- package/dist/molecules/OrderSummary/OrderSummary.js.map +1 -0
- package/dist/molecules/OrderSummary/index.d.ts +2 -0
- package/dist/molecules/OrderSummary/index.js +2 -0
- package/dist/molecules/OrderSummary/index.js.map +1 -0
- package/dist/molecules/ProductCard/ProductCard.d.ts +23 -0
- package/dist/molecules/ProductCard/ProductCard.js +6 -0
- package/dist/molecules/ProductCard/ProductCard.js.map +1 -0
- package/dist/molecules/ProductCard/ProductCardContent.d.ts +48 -0
- package/dist/molecules/ProductCard/ProductCardContent.js +19 -0
- package/dist/molecules/ProductCard/ProductCardContent.js.map +1 -0
- package/dist/molecules/ProductCard/ProductCardImage.d.ts +14 -0
- package/dist/molecules/ProductCard/ProductCardImage.js +8 -0
- package/dist/molecules/ProductCard/ProductCardImage.js.map +1 -0
- package/dist/molecules/ProductCard/index.d.ts +6 -0
- package/dist/molecules/ProductCard/index.js +4 -0
- package/dist/molecules/ProductCard/index.js.map +1 -0
- package/dist/molecules/ProductPrice/ProductPrice.d.ts +24 -0
- package/dist/molecules/ProductPrice/ProductPrice.js +11 -0
- package/dist/molecules/ProductPrice/ProductPrice.js.map +1 -0
- package/dist/molecules/ProductPrice/index.d.ts +2 -0
- package/dist/molecules/ProductPrice/index.js +2 -0
- package/dist/molecules/ProductPrice/index.js.map +1 -0
- package/dist/molecules/ProductTitle/ProductTitle.d.ts +30 -0
- package/dist/molecules/ProductTitle/ProductTitle.js +16 -0
- package/dist/molecules/ProductTitle/ProductTitle.js.map +1 -0
- package/dist/molecules/ProductTitle/index.d.ts +2 -0
- package/dist/molecules/ProductTitle/index.js +2 -0
- package/dist/molecules/ProductTitle/index.js.map +1 -0
- package/dist/molecules/QuantitySelector/QuantitySelector.d.ts +31 -0
- package/dist/molecules/QuantitySelector/QuantitySelector.js +37 -0
- package/dist/molecules/QuantitySelector/QuantitySelector.js.map +1 -0
- package/dist/molecules/QuantitySelector/index.d.ts +2 -0
- package/dist/molecules/QuantitySelector/index.js +2 -0
- package/dist/molecules/QuantitySelector/index.js.map +1 -0
- package/dist/molecules/RadioField/RadioField.d.ts +26 -0
- package/dist/molecules/RadioField/RadioField.js +10 -0
- package/dist/molecules/RadioField/RadioField.js.map +1 -0
- package/dist/molecules/RadioField/index.d.ts +2 -0
- package/dist/molecules/RadioField/index.js +2 -0
- package/dist/molecules/RadioField/index.js.map +1 -0
- package/dist/molecules/RadioGroup/RadioGroup.d.ts +6 -0
- package/dist/molecules/RadioGroup/RadioGroup.js +10 -0
- package/dist/molecules/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/molecules/RadioGroup/RadioOption.d.ts +19 -0
- package/dist/molecules/RadioGroup/RadioOption.js +11 -0
- package/dist/molecules/RadioGroup/RadioOption.js.map +1 -0
- package/dist/molecules/RadioGroup/index.d.ts +4 -0
- package/dist/molecules/RadioGroup/index.js +3 -0
- package/dist/molecules/RadioGroup/index.js.map +1 -0
- package/dist/molecules/RadioGroup/useRadioGroup.d.ts +17 -0
- package/dist/molecules/RadioGroup/useRadioGroup.js +10 -0
- package/dist/molecules/RadioGroup/useRadioGroup.js.map +1 -0
- package/dist/molecules/Rating/Rating.d.ts +29 -0
- package/dist/molecules/Rating/Rating.js +27 -0
- package/dist/molecules/Rating/Rating.js.map +1 -0
- package/dist/molecules/Rating/index.d.ts +2 -0
- package/dist/molecules/Rating/index.js +2 -0
- package/dist/molecules/Rating/index.js.map +1 -0
- package/dist/molecules/RegionBar/RegionBar.d.ts +30 -0
- package/dist/molecules/RegionBar/RegionBar.js +12 -0
- package/dist/molecules/RegionBar/RegionBar.js.map +1 -0
- package/dist/molecules/RegionBar/index.d.ts +2 -0
- package/dist/molecules/RegionBar/index.js +2 -0
- package/dist/molecules/RegionBar/index.js.map +1 -0
- package/dist/molecules/SearchAutoComplete/SearchAutoComplete.d.ts +9 -0
- package/dist/molecules/SearchAutoComplete/SearchAutoComplete.js +12 -0
- package/dist/molecules/SearchAutoComplete/SearchAutoComplete.js.map +1 -0
- package/dist/molecules/SearchAutoComplete/SearchAutoCompleteTerm.d.ts +27 -0
- package/dist/molecules/SearchAutoComplete/SearchAutoCompleteTerm.js +27 -0
- package/dist/molecules/SearchAutoComplete/SearchAutoCompleteTerm.js.map +1 -0
- package/dist/molecules/SearchAutoComplete/index.d.ts +4 -0
- package/dist/molecules/SearchAutoComplete/index.js +3 -0
- package/dist/molecules/SearchAutoComplete/index.js.map +1 -0
- package/dist/molecules/SearchDropdown/SearchDropdown.d.ts +14 -0
- package/dist/molecules/SearchDropdown/SearchDropdown.js +14 -0
- package/dist/molecules/SearchDropdown/SearchDropdown.js.map +1 -0
- package/dist/molecules/SearchDropdown/index.d.ts +2 -0
- package/dist/molecules/SearchDropdown/index.js +2 -0
- package/dist/molecules/SearchDropdown/index.js.map +1 -0
- package/dist/molecules/SearchHistory/SearchHistory.d.ts +21 -0
- package/dist/molecules/SearchHistory/SearchHistory.js +15 -0
- package/dist/molecules/SearchHistory/SearchHistory.js.map +1 -0
- package/dist/molecules/SearchHistory/SearchHistoryTerm.d.ts +23 -0
- package/dist/molecules/SearchHistory/SearchHistoryTerm.js +10 -0
- package/dist/molecules/SearchHistory/SearchHistoryTerm.js.map +1 -0
- package/dist/molecules/SearchHistory/index.d.ts +4 -0
- package/dist/molecules/SearchHistory/index.js +3 -0
- package/dist/molecules/SearchHistory/index.js.map +1 -0
- package/dist/molecules/SearchInputField/SearchInputField.d.ts +36 -0
- package/dist/molecules/SearchInputField/SearchInputField.js +21 -0
- package/dist/molecules/SearchInputField/SearchInputField.js.map +1 -0
- package/dist/molecules/SearchInputField/index.d.ts +2 -0
- package/dist/molecules/SearchInputField/index.js +2 -0
- package/dist/molecules/SearchInputField/index.js.map +1 -0
- package/dist/molecules/SearchProducts/SearchProductItem.d.ts +16 -0
- package/dist/molecules/SearchProducts/SearchProductItem.js +8 -0
- package/dist/molecules/SearchProducts/SearchProductItem.js.map +1 -0
- package/dist/molecules/SearchProducts/SearchProductItemContent.d.ts +14 -0
- package/dist/molecules/SearchProducts/SearchProductItemContent.js +9 -0
- package/dist/molecules/SearchProducts/SearchProductItemContent.js.map +1 -0
- package/dist/molecules/SearchProducts/SearchProductItemImage.d.ts +10 -0
- package/dist/molecules/SearchProducts/SearchProductItemImage.js +6 -0
- package/dist/molecules/SearchProducts/SearchProductItemImage.js.map +1 -0
- package/dist/molecules/SearchProducts/SearchProducts.d.ts +13 -0
- package/dist/molecules/SearchProducts/SearchProducts.js +14 -0
- package/dist/molecules/SearchProducts/SearchProducts.js.map +1 -0
- package/dist/molecules/SearchProducts/index.d.ts +8 -0
- package/dist/molecules/SearchProducts/index.js +5 -0
- package/dist/molecules/SearchProducts/index.js.map +1 -0
- package/dist/molecules/SearchProvider/SearchProvider.d.ts +29 -0
- package/dist/molecules/SearchProvider/SearchProvider.js +8 -0
- package/dist/molecules/SearchProvider/SearchProvider.js.map +1 -0
- package/dist/molecules/SearchProvider/index.d.ts +2 -0
- package/dist/molecules/SearchProvider/index.js +2 -0
- package/dist/molecules/SearchProvider/index.js.map +1 -0
- package/dist/molecules/SearchTop/SearchTop.d.ts +14 -0
- package/dist/molecules/SearchTop/SearchTop.js +15 -0
- package/dist/molecules/SearchTop/SearchTop.js.map +1 -0
- package/dist/molecules/SearchTop/SearchTopTerm.d.ts +23 -0
- package/dist/molecules/SearchTop/SearchTopTerm.js +10 -0
- package/dist/molecules/SearchTop/SearchTopTerm.js.map +1 -0
- package/dist/molecules/SearchTop/index.d.ts +4 -0
- package/dist/molecules/SearchTop/index.js +3 -0
- package/dist/molecules/SearchTop/index.js.map +1 -0
- package/dist/molecules/SelectField/SelectField.d.ts +12 -0
- package/dist/molecules/SelectField/SelectField.js +9 -0
- package/dist/molecules/SelectField/SelectField.js.map +1 -0
- package/dist/molecules/SelectField/index.d.ts +2 -0
- package/dist/molecules/SelectField/index.js +2 -0
- package/dist/molecules/SelectField/index.js.map +1 -0
- package/dist/molecules/SkuSelector/SkuSelector.d.ts +78 -0
- package/dist/molecules/SkuSelector/SkuSelector.js +31 -0
- package/dist/molecules/SkuSelector/SkuSelector.js.map +1 -0
- package/dist/molecules/SkuSelector/index.d.ts +2 -0
- package/dist/molecules/SkuSelector/index.js +2 -0
- package/dist/molecules/SkuSelector/index.js.map +1 -0
- package/dist/molecules/SkuSelector/useDefineVariant.d.ts +3 -0
- package/dist/molecules/SkuSelector/useDefineVariant.js +27 -0
- package/dist/molecules/SkuSelector/useDefineVariant.js.map +1 -0
- package/dist/molecules/SkuSelector/useSkuSlug.d.ts +6 -0
- package/dist/molecules/SkuSelector/useSkuSlug.js +23 -0
- package/dist/molecules/SkuSelector/useSkuSlug.js.map +1 -0
- package/dist/molecules/Table/Table.d.ts +26 -0
- package/dist/molecules/Table/Table.js +7 -0
- package/dist/molecules/Table/Table.js.map +1 -0
- package/dist/molecules/Table/TableBody.d.ts +12 -0
- package/dist/molecules/Table/TableBody.js +6 -0
- package/dist/molecules/Table/TableBody.js.map +1 -0
- package/dist/molecules/Table/TableCell.d.ts +26 -0
- package/dist/molecules/Table/TableCell.js +7 -0
- package/dist/molecules/Table/TableCell.js.map +1 -0
- package/dist/molecules/Table/TableFooter.d.ts +12 -0
- package/dist/molecules/Table/TableFooter.js +6 -0
- package/dist/molecules/Table/TableFooter.js.map +1 -0
- package/dist/molecules/Table/TableHead.d.ts +12 -0
- package/dist/molecules/Table/TableHead.js +6 -0
- package/dist/molecules/Table/TableHead.js.map +1 -0
- package/dist/molecules/Table/TableRow.d.ts +12 -0
- package/dist/molecules/Table/TableRow.js +6 -0
- package/dist/molecules/Table/TableRow.js.map +1 -0
- package/dist/molecules/Table/index.d.ts +12 -0
- package/dist/molecules/Table/index.js +7 -0
- package/dist/molecules/Table/index.js.map +1 -0
- package/dist/molecules/Tag/Tag.d.ts +27 -0
- package/dist/molecules/Tag/Tag.js +9 -0
- package/dist/molecules/Tag/Tag.js.map +1 -0
- package/dist/molecules/Tag/index.d.ts +2 -0
- package/dist/molecules/Tag/index.js +2 -0
- package/dist/molecules/Tag/index.js.map +1 -0
- package/dist/molecules/Toast/Toast.d.ts +3 -0
- package/dist/molecules/Toast/Toast.js +29 -0
- package/dist/molecules/Toast/Toast.js.map +1 -0
- package/dist/molecules/Toast/index.d.ts +1 -0
- package/dist/molecules/Toast/index.js +2 -0
- package/dist/molecules/Toast/index.js.map +1 -0
- package/dist/molecules/Toggle/Toggle.d.ts +22 -0
- package/dist/molecules/Toggle/Toggle.js +10 -0
- package/dist/molecules/Toggle/Toggle.js.map +1 -0
- package/dist/molecules/Toggle/index.d.ts +2 -0
- package/dist/molecules/Toggle/index.js +2 -0
- package/dist/molecules/Toggle/index.js.map +1 -0
- package/dist/molecules/ToggleField/ToggleField.d.ts +29 -0
- package/dist/molecules/ToggleField/ToggleField.js +9 -0
- package/dist/molecules/ToggleField/ToggleField.js.map +1 -0
- package/dist/molecules/ToggleField/index.d.ts +2 -0
- package/dist/molecules/ToggleField/index.js +2 -0
- package/dist/molecules/ToggleField/index.js.map +1 -0
- package/dist/organisms/BannerText/BannerText.d.ts +27 -0
- package/dist/organisms/BannerText/BannerText.js +16 -0
- package/dist/organisms/BannerText/BannerText.js.map +1 -0
- package/dist/organisms/BannerText/BannerTextContent.d.ts +30 -0
- package/dist/organisms/BannerText/BannerTextContent.js +13 -0
- package/dist/organisms/BannerText/BannerTextContent.js.map +1 -0
- package/dist/organisms/BannerText/index.d.ts +4 -0
- package/dist/organisms/BannerText/index.js +3 -0
- package/dist/organisms/BannerText/index.js.map +1 -0
- package/dist/organisms/CartSidebar/CartSidebar.d.ts +45 -0
- package/dist/organisms/CartSidebar/CartSidebar.js +18 -0
- package/dist/organisms/CartSidebar/CartSidebar.js.map +1 -0
- package/dist/organisms/CartSidebar/CartSidebarFooter.d.ts +5 -0
- package/dist/organisms/CartSidebar/CartSidebarFooter.js +6 -0
- package/dist/organisms/CartSidebar/CartSidebarFooter.js.map +1 -0
- package/dist/organisms/CartSidebar/CartSidebarList.d.ts +5 -0
- package/dist/organisms/CartSidebar/CartSidebarList.js +7 -0
- package/dist/organisms/CartSidebar/CartSidebarList.js.map +1 -0
- package/dist/organisms/CartSidebar/index.d.ts +4 -0
- package/dist/organisms/CartSidebar/index.js +4 -0
- package/dist/organisms/CartSidebar/index.js.map +1 -0
- package/dist/organisms/EmptyState/EmptyState.d.ts +28 -0
- package/dist/organisms/EmptyState/EmptyState.js +10 -0
- package/dist/organisms/EmptyState/EmptyState.js.map +1 -0
- package/dist/organisms/EmptyState/index.d.ts +2 -0
- package/dist/organisms/EmptyState/index.js +2 -0
- package/dist/organisms/EmptyState/index.js.map +1 -0
- package/dist/organisms/Filter/Filter.d.ts +26 -0
- package/dist/organisms/Filter/Filter.js +9 -0
- package/dist/organisms/Filter/Filter.js.map +1 -0
- package/dist/organisms/Filter/FilterFacetBoolean.d.ts +5 -0
- package/dist/organisms/Filter/FilterFacetBoolean.js +7 -0
- package/dist/organisms/Filter/FilterFacetBoolean.js.map +1 -0
- package/dist/organisms/Filter/FilterFacetBooleanItem.d.ts +38 -0
- package/dist/organisms/Filter/FilterFacetBooleanItem.js +12 -0
- package/dist/organisms/Filter/FilterFacetBooleanItem.js.map +1 -0
- package/dist/organisms/Filter/FilterFacetRange.d.ts +32 -0
- package/dist/organisms/Filter/FilterFacetRange.js +11 -0
- package/dist/organisms/Filter/FilterFacetRange.js.map +1 -0
- package/dist/organisms/Filter/FilterFacets.d.ts +21 -0
- package/dist/organisms/Filter/FilterFacets.js +9 -0
- package/dist/organisms/Filter/FilterFacets.js.map +1 -0
- package/dist/organisms/Filter/FilterSlider.d.ts +36 -0
- package/dist/organisms/Filter/FilterSlider.js +22 -0
- package/dist/organisms/Filter/FilterSlider.js.map +1 -0
- package/dist/organisms/Filter/index.d.ts +11 -0
- package/dist/organisms/Filter/index.js +7 -0
- package/dist/organisms/Filter/index.js.map +1 -0
- package/dist/organisms/Hero/Hero.d.ts +27 -0
- package/dist/organisms/Hero/Hero.js +16 -0
- package/dist/organisms/Hero/Hero.js.map +1 -0
- package/dist/organisms/Hero/HeroHeader.d.ts +34 -0
- package/dist/organisms/Hero/HeroHeader.js +15 -0
- package/dist/organisms/Hero/HeroHeader.js.map +1 -0
- package/dist/organisms/Hero/HeroImage.d.ts +10 -0
- package/dist/organisms/Hero/HeroImage.js +6 -0
- package/dist/organisms/Hero/HeroImage.js.map +1 -0
- package/dist/organisms/Hero/index.d.ts +6 -0
- package/dist/organisms/Hero/index.js +4 -0
- package/dist/organisms/Hero/index.js.map +1 -0
- package/dist/organisms/ImageGallery/ImageGallery.d.ts +42 -0
- package/dist/organisms/ImageGallery/ImageGallery.js +10 -0
- package/dist/organisms/ImageGallery/ImageGallery.js.map +1 -0
- package/dist/organisms/ImageGallery/ImageGallerySelector.d.ts +32 -0
- package/dist/organisms/ImageGallery/ImageGallerySelector.js +46 -0
- package/dist/organisms/ImageGallery/ImageGallerySelector.js.map +1 -0
- package/dist/organisms/ImageGallery/ImageGalleryViewer.d.ts +8 -0
- package/dist/organisms/ImageGallery/ImageGalleryViewer.js +6 -0
- package/dist/organisms/ImageGallery/ImageGalleryViewer.js.map +1 -0
- package/dist/organisms/ImageGallery/ImageZoom.d.ts +7 -0
- package/dist/organisms/ImageGallery/ImageZoom.js +6 -0
- package/dist/organisms/ImageGallery/ImageZoom.js.map +1 -0
- package/dist/organisms/ImageGallery/index.d.ts +6 -0
- package/dist/organisms/ImageGallery/index.js +4 -0
- package/dist/organisms/ImageGallery/index.js.map +1 -0
- package/dist/organisms/Navbar/Navbar.d.ts +14 -0
- package/dist/organisms/Navbar/Navbar.js +6 -0
- package/dist/organisms/Navbar/Navbar.js.map +1 -0
- package/dist/organisms/Navbar/NavbarButtons.d.ts +14 -0
- package/dist/organisms/Navbar/NavbarButtons.js +6 -0
- package/dist/organisms/Navbar/NavbarButtons.js.map +1 -0
- package/dist/organisms/Navbar/NavbarHeader.d.ts +10 -0
- package/dist/organisms/Navbar/NavbarHeader.js +6 -0
- package/dist/organisms/Navbar/NavbarHeader.js.map +1 -0
- package/dist/organisms/Navbar/NavbarRow.d.ts +10 -0
- package/dist/organisms/Navbar/NavbarRow.js +6 -0
- package/dist/organisms/Navbar/NavbarRow.js.map +1 -0
- package/dist/organisms/Navbar/index.d.ts +8 -0
- package/dist/organisms/Navbar/index.js +5 -0
- package/dist/organisms/Navbar/index.js.map +1 -0
- package/dist/organisms/NavbarSlider/NavbarSlider.d.ts +19 -0
- package/dist/organisms/NavbarSlider/NavbarSlider.js +7 -0
- package/dist/organisms/NavbarSlider/NavbarSlider.js.map +1 -0
- package/dist/organisms/NavbarSlider/NavbarSliderContent.d.ts +10 -0
- package/dist/organisms/NavbarSlider/NavbarSliderContent.js +6 -0
- package/dist/organisms/NavbarSlider/NavbarSliderContent.js.map +1 -0
- package/dist/organisms/NavbarSlider/NavbarSliderFooter.d.ts +10 -0
- package/dist/organisms/NavbarSlider/NavbarSliderFooter.js +6 -0
- package/dist/organisms/NavbarSlider/NavbarSliderFooter.js.map +1 -0
- package/dist/organisms/NavbarSlider/NavbarSliderHeader.d.ts +10 -0
- package/dist/organisms/NavbarSlider/NavbarSliderHeader.js +7 -0
- package/dist/organisms/NavbarSlider/NavbarSliderHeader.js.map +1 -0
- package/dist/organisms/NavbarSlider/index.d.ts +8 -0
- package/dist/organisms/NavbarSlider/index.js +5 -0
- package/dist/organisms/NavbarSlider/index.js.map +1 -0
- package/dist/organisms/Newsletter/Newsletter.d.ts +19 -0
- package/dist/organisms/Newsletter/Newsletter.js +6 -0
- package/dist/organisms/Newsletter/Newsletter.js.map +1 -0
- package/dist/organisms/Newsletter/NewsletterAddendum.d.ts +14 -0
- package/dist/organisms/Newsletter/NewsletterAddendum.js +6 -0
- package/dist/organisms/Newsletter/NewsletterAddendum.js.map +1 -0
- package/dist/organisms/Newsletter/NewsletterContent.d.ts +10 -0
- package/dist/organisms/Newsletter/NewsletterContent.js +6 -0
- package/dist/organisms/Newsletter/NewsletterContent.js.map +1 -0
- package/dist/organisms/Newsletter/NewsletterForm.d.ts +14 -0
- package/dist/organisms/Newsletter/NewsletterForm.js +6 -0
- package/dist/organisms/Newsletter/NewsletterForm.js.map +1 -0
- package/dist/organisms/Newsletter/NewsletterHeader.d.ts +22 -0
- package/dist/organisms/Newsletter/NewsletterHeader.js +10 -0
- package/dist/organisms/Newsletter/NewsletterHeader.js.map +1 -0
- package/dist/organisms/Newsletter/index.d.ts +10 -0
- package/dist/organisms/Newsletter/index.js +6 -0
- package/dist/organisms/Newsletter/index.js.map +1 -0
- package/dist/organisms/OutOfStock/OutOfStock.d.ts +43 -0
- package/dist/organisms/OutOfStock/OutOfStock.js +13 -0
- package/dist/organisms/OutOfStock/OutOfStock.js.map +1 -0
- package/dist/organisms/OutOfStock/index.d.ts +2 -0
- package/dist/organisms/OutOfStock/index.js +2 -0
- package/dist/organisms/OutOfStock/index.js.map +1 -0
- package/dist/organisms/PaymentMethods/PaymentMethods.d.ts +32 -0
- package/dist/organisms/PaymentMethods/PaymentMethods.js +11 -0
- package/dist/organisms/PaymentMethods/PaymentMethods.js.map +1 -0
- package/dist/organisms/PaymentMethods/index.d.ts +2 -0
- package/dist/organisms/PaymentMethods/index.js +2 -0
- package/dist/organisms/PaymentMethods/index.js.map +1 -0
- package/dist/organisms/PriceRange/PriceRange.d.ts +25 -0
- package/dist/organisms/PriceRange/PriceRange.js +75 -0
- package/dist/organisms/PriceRange/PriceRange.js.map +1 -0
- package/dist/organisms/PriceRange/index.d.ts +2 -0
- package/dist/organisms/PriceRange/index.js +2 -0
- package/dist/organisms/PriceRange/index.js.map +1 -0
- package/dist/organisms/ProductGrid/ProductGrid.d.ts +10 -0
- package/dist/organisms/ProductGrid/ProductGrid.js +6 -0
- package/dist/organisms/ProductGrid/ProductGrid.js.map +1 -0
- package/dist/organisms/ProductGrid/ProductGridItem.d.ts +10 -0
- package/dist/organisms/ProductGrid/ProductGridItem.js +6 -0
- package/dist/organisms/ProductGrid/ProductGridItem.js.map +1 -0
- package/dist/organisms/ProductGrid/index.d.ts +4 -0
- package/dist/organisms/ProductGrid/index.js +3 -0
- package/dist/organisms/ProductGrid/index.js.map +1 -0
- package/dist/organisms/ProductShelf/ProductShelf.d.ts +10 -0
- package/dist/organisms/ProductShelf/ProductShelf.js +6 -0
- package/dist/organisms/ProductShelf/ProductShelf.js.map +1 -0
- package/dist/organisms/ProductShelf/ProductShelfItem.d.ts +10 -0
- package/dist/organisms/ProductShelf/ProductShelfItem.js +6 -0
- package/dist/organisms/ProductShelf/ProductShelfItem.js.map +1 -0
- package/dist/organisms/ProductShelf/ProductShelfItems.d.ts +10 -0
- package/dist/organisms/ProductShelf/ProductShelfItems.js +6 -0
- package/dist/organisms/ProductShelf/ProductShelfItems.js.map +1 -0
- package/dist/organisms/ProductShelf/index.d.ts +6 -0
- package/dist/organisms/ProductShelf/index.js +4 -0
- package/dist/organisms/ProductShelf/index.js.map +1 -0
- package/dist/organisms/RegionModal/RegionModal.d.ts +72 -0
- package/dist/organisms/RegionModal/RegionModal.js +19 -0
- package/dist/organisms/RegionModal/RegionModal.js.map +1 -0
- package/dist/organisms/RegionModal/index.d.ts +2 -0
- package/dist/organisms/RegionModal/index.js +2 -0
- package/dist/organisms/RegionModal/index.js.map +1 -0
- package/dist/organisms/SearchInput/SearchInput.d.ts +26 -0
- package/dist/organisms/SearchInput/SearchInput.js +8 -0
- package/dist/organisms/SearchInput/SearchInput.js.map +1 -0
- package/dist/organisms/SearchInput/index.d.ts +2 -0
- package/dist/organisms/SearchInput/index.js +2 -0
- package/dist/organisms/SearchInput/index.js.map +1 -0
- package/dist/organisms/ShippingSimulation/ShippingSimulation.d.ts +125 -0
- package/dist/organisms/ShippingSimulation/ShippingSimulation.js +22 -0
- package/dist/organisms/ShippingSimulation/ShippingSimulation.js.map +1 -0
- package/dist/organisms/ShippingSimulation/index.d.ts +2 -0
- package/dist/organisms/ShippingSimulation/index.js +2 -0
- package/dist/organisms/ShippingSimulation/index.js.map +1 -0
- package/dist/organisms/SlideOver/SlideOver.d.ts +39 -0
- package/dist/organisms/SlideOver/SlideOver.js +7 -0
- package/dist/organisms/SlideOver/SlideOver.js.map +1 -0
- package/dist/organisms/SlideOver/SlideOverHeader.d.ts +19 -0
- package/dist/organisms/SlideOver/SlideOverHeader.js +9 -0
- package/dist/organisms/SlideOver/SlideOverHeader.js.map +1 -0
- package/dist/organisms/SlideOver/index.d.ts +4 -0
- package/dist/organisms/SlideOver/index.js +3 -0
- package/dist/organisms/SlideOver/index.js.map +1 -0
- package/dist/typings/PolymorphicGenerics.d.ts +28 -0
- package/dist/typings/PolymorphicGenerics.js +8 -0
- package/dist/typings/PolymorphicGenerics.js.map +1 -0
- package/dist/typings/PriceDefinition.d.ts +6 -0
- package/dist/typings/PriceDefinition.js +2 -0
- package/dist/typings/PriceDefinition.js.map +1 -0
- package/dist/typings/index.d.ts +2 -0
- package/dist/typings/index.js +2 -0
- package/dist/typings/index.js.map +1 -0
- package/package.json +2 -2
- package/src/organisms/PaymentMethods/PaymentMethods.tsx +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
function isSlideVisible({ itemsPerPage, currentSlide, slideIdx, totalItems, }) {
|
|
3
|
+
const isClonedSlide = currentSlide < 0 || currentSlide >= totalItems;
|
|
4
|
+
const isVisible = slideIdx >= currentSlide && slideIdx < currentSlide + itemsPerPage;
|
|
5
|
+
return isClonedSlide || isVisible;
|
|
6
|
+
}
|
|
7
|
+
export const useSlideVisibility = ({ currentSlide, itemsPerPage, totalItems, }) => {
|
|
8
|
+
/** Keeps track of slides that have been visualized before.
|
|
9
|
+
* We want to keep rendering them because the issue is mostly rendering
|
|
10
|
+
* slides that might never be viewed; On the other hand, hiding slides
|
|
11
|
+
* that were visible causes visual glitches */
|
|
12
|
+
const visitedSlides = useRef(new Set());
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
for (let i = 0; i < itemsPerPage; i++) {
|
|
15
|
+
visitedSlides.current.add(currentSlide + i);
|
|
16
|
+
}
|
|
17
|
+
}, [currentSlide, itemsPerPage]);
|
|
18
|
+
const isItemVisible = (index) => isSlideVisible({
|
|
19
|
+
slideIdx: index,
|
|
20
|
+
currentSlide,
|
|
21
|
+
itemsPerPage,
|
|
22
|
+
totalItems,
|
|
23
|
+
});
|
|
24
|
+
const shouldRenderItem = (index) => {
|
|
25
|
+
return visitedSlides.current.has(index) || isItemVisible(index);
|
|
26
|
+
};
|
|
27
|
+
return { shouldRenderItem, isItemVisible };
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useSlideVisibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlideVisibility.js","sourceRoot":"","sources":["../../src/hooks/useSlideVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAezC,SAAS,cAAc,CAAC,EACtB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,UAAU,GACS;IACnB,MAAM,aAAa,GAAG,YAAY,GAAG,CAAC,IAAI,YAAY,IAAI,UAAU,CAAA;IACpE,MAAM,SAAS,GACb,QAAQ,IAAI,YAAY,IAAI,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAA;IAEpE,OAAO,aAAa,IAAI,SAAS,CAAA;AACnC,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,YAAY,EACZ,YAAY,EACZ,UAAU,GACa,EAAE,EAAE;IAC3B;;;kDAG8C;IAC9C,MAAM,aAAa,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAA;IAEpD,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;YACrC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;SAC5C;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;IAEhC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,EAAE,CACtC,cAAc,CAAC;QACb,QAAQ,EAAE,KAAK;QACf,YAAY;QACZ,YAAY;QACZ,UAAU;KACX,CAAC,CAAA;IAEJ,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE;QACzC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAA;IACjE,CAAC,CAAA;IAED,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAA;AAC5C,CAAC,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
2
|
+
import type { SwipeableProps } from 'react-swipeable';
|
|
3
|
+
export type SlideDirection = 'next' | 'previous';
|
|
4
|
+
interface NextPageAction {
|
|
5
|
+
type: 'NEXT_PAGE';
|
|
6
|
+
}
|
|
7
|
+
interface PreviousPageAction {
|
|
8
|
+
type: 'PREVIOUS_PAGE';
|
|
9
|
+
}
|
|
10
|
+
interface GoToPageAction {
|
|
11
|
+
type: 'GO_TO_PAGE';
|
|
12
|
+
payload: {
|
|
13
|
+
pageIndex: number;
|
|
14
|
+
shouldSlide: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface StopSlideAction {
|
|
18
|
+
type: 'STOP_SLIDE';
|
|
19
|
+
}
|
|
20
|
+
export type Action = NextPageAction | PreviousPageAction | StopSlideAction | GoToPageAction;
|
|
21
|
+
export type SliderDispatch = Dispatch<Action>;
|
|
22
|
+
export interface SliderState {
|
|
23
|
+
/**
|
|
24
|
+
* The `currentItem` in a Slider with multiple items in a single page is
|
|
25
|
+
* always **the one with the lowest index** in the current page.
|
|
26
|
+
*/
|
|
27
|
+
currentItem: number;
|
|
28
|
+
/** Currently active page */
|
|
29
|
+
currentPage: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether or not the Slider is currently sliding. This is useful to
|
|
32
|
+
* manipulate the `transition` property in a component.
|
|
33
|
+
*/
|
|
34
|
+
sliding: boolean;
|
|
35
|
+
/** The direction in which the Slider is sliding. */
|
|
36
|
+
slideDirection: SlideDirection;
|
|
37
|
+
/** The total number of unique items in the slider. */
|
|
38
|
+
totalItems: number;
|
|
39
|
+
/** The number of items in a single page. */
|
|
40
|
+
itemsPerPage: number;
|
|
41
|
+
/** The total number of pages in the slider. */
|
|
42
|
+
totalPages: number;
|
|
43
|
+
/** Whether or not the slider is infinite. */
|
|
44
|
+
infinite: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const nextPage: (current: number, total: number) => number;
|
|
47
|
+
export declare const previousPage: (current: number, total: number) => number;
|
|
48
|
+
export interface UseSliderArgs extends SwipeableProps {
|
|
49
|
+
/** The total number of unique items in the slider. */
|
|
50
|
+
totalItems: number;
|
|
51
|
+
/** The number of items in a single slider page. */
|
|
52
|
+
itemsPerPage?: number;
|
|
53
|
+
/** Whether or not the slider is infinite. */
|
|
54
|
+
infiniteMode?: boolean;
|
|
55
|
+
/** Whether or not slide after swiping left/right. */
|
|
56
|
+
shouldSlideOnSwipe?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare const useSlider: ({ totalItems, itemsPerPage, infiniteMode, shouldSlideOnSwipe, ...swipeableConfigOverrides }: UseSliderArgs) => {
|
|
59
|
+
handlers: import("react-swipeable").SwipeableHandlers;
|
|
60
|
+
slide: (page: SlideDirection | number, dispatch: Dispatch<Action>) => void;
|
|
61
|
+
sliderState: SliderState;
|
|
62
|
+
sliderDispatch: Dispatch<Action>;
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useReducer } from 'react';
|
|
2
|
+
import { useSwipeable } from 'react-swipeable';
|
|
3
|
+
export const nextPage = (current, total) => (current + 1) % total;
|
|
4
|
+
export const previousPage = (current, total) => (total - ((total - current + 1) % total)) % total;
|
|
5
|
+
function reducer(state, action) {
|
|
6
|
+
switch (action.type) {
|
|
7
|
+
case 'NEXT_PAGE': {
|
|
8
|
+
// If `state.infinite` is true, we need to take into account an extra
|
|
9
|
+
// page in the calculation. This extra page is a clone of the first page.
|
|
10
|
+
const adjustedTotalPages = state.infinite
|
|
11
|
+
? state.totalPages + 1
|
|
12
|
+
: state.totalPages;
|
|
13
|
+
const nextPageIndex = nextPage(state.currentPage, adjustedTotalPages);
|
|
14
|
+
const nextItemIndex = (nextPageIndex % adjustedTotalPages) * state.itemsPerPage;
|
|
15
|
+
return {
|
|
16
|
+
...state,
|
|
17
|
+
sliding: true,
|
|
18
|
+
slideDirection: 'next',
|
|
19
|
+
currentItem: nextItemIndex,
|
|
20
|
+
currentPage: nextPageIndex,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
case 'PREVIOUS_PAGE': {
|
|
24
|
+
// If `state.infinite` is true, we need to take into account an extra
|
|
25
|
+
// page in the calculation. This extra page is a clone of the first page.
|
|
26
|
+
const adjustedTotalPages = state.infinite
|
|
27
|
+
? state.totalPages + 1
|
|
28
|
+
: state.totalPages;
|
|
29
|
+
// If `state.infinite` is true and we're currently on page 0, we need to
|
|
30
|
+
// let the slider go to page -1. This -1 page is a clone of the last page.
|
|
31
|
+
const shouldGoToClone = state.infinite && state.currentPage === 0;
|
|
32
|
+
const previousPageIndex = shouldGoToClone
|
|
33
|
+
? -1
|
|
34
|
+
: previousPage(state.currentPage, state.totalPages);
|
|
35
|
+
return {
|
|
36
|
+
...state,
|
|
37
|
+
sliding: true,
|
|
38
|
+
slideDirection: 'previous',
|
|
39
|
+
currentItem: (previousPageIndex % adjustedTotalPages) * state.itemsPerPage,
|
|
40
|
+
currentPage: previousPageIndex,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
case 'GO_TO_PAGE': {
|
|
44
|
+
if (action.payload.pageIndex === state.currentPage) {
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
sliding: action.payload.shouldSlide,
|
|
50
|
+
slideDirection: action.payload.pageIndex > state.currentPage ? 'next' : 'previous',
|
|
51
|
+
currentItem: (action.payload.pageIndex % state.totalPages) * state.itemsPerPage,
|
|
52
|
+
currentPage: action.payload.pageIndex,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
case 'STOP_SLIDE':
|
|
56
|
+
return { ...state, sliding: false };
|
|
57
|
+
default:
|
|
58
|
+
return state;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const defaultSliderState = (totalItems, itemsPerPage, infinite) => ({
|
|
62
|
+
currentItem: 0,
|
|
63
|
+
currentPage: 0,
|
|
64
|
+
sliding: false,
|
|
65
|
+
slideDirection: 'next',
|
|
66
|
+
totalItems,
|
|
67
|
+
itemsPerPage,
|
|
68
|
+
totalPages: Math.ceil(totalItems / itemsPerPage),
|
|
69
|
+
infinite,
|
|
70
|
+
});
|
|
71
|
+
const slide = (page, dispatch) => {
|
|
72
|
+
if (page === 'next') {
|
|
73
|
+
dispatch({ type: 'NEXT_PAGE' });
|
|
74
|
+
}
|
|
75
|
+
if (page === 'previous') {
|
|
76
|
+
dispatch({ type: 'PREVIOUS_PAGE' });
|
|
77
|
+
}
|
|
78
|
+
if (typeof page === 'number') {
|
|
79
|
+
dispatch({
|
|
80
|
+
type: 'GO_TO_PAGE',
|
|
81
|
+
payload: {
|
|
82
|
+
pageIndex: page,
|
|
83
|
+
shouldSlide: true,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export const useSlider = ({ totalItems, itemsPerPage = 1, infiniteMode = false, shouldSlideOnSwipe = true, ...swipeableConfigOverrides }) => {
|
|
89
|
+
const [sliderState, sliderDispatch] = useReducer(reducer, undefined, () => defaultSliderState(totalItems, itemsPerPage, infiniteMode));
|
|
90
|
+
const handlers = useSwipeable({
|
|
91
|
+
onSwipedRight: () => shouldSlideOnSwipe && slide('previous', sliderDispatch),
|
|
92
|
+
onSwipedLeft: () => shouldSlideOnSwipe && slide('next', sliderDispatch),
|
|
93
|
+
trackMouse: true,
|
|
94
|
+
...swipeableConfigOverrides,
|
|
95
|
+
});
|
|
96
|
+
return {
|
|
97
|
+
handlers,
|
|
98
|
+
slide,
|
|
99
|
+
sliderState,
|
|
100
|
+
sliderDispatch,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=useSlider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlider.js","sourceRoot":"","sources":["../../src/hooks/useSlider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAyD9C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,KAAa,EAAE,EAAE,CACzD,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAE,EAAE,CAC7D,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAA;AAEnD,SAAS,OAAO,CAAC,KAAkB,EAAE,MAAc;IAC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B,QAAQ,CAAC;YACP,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE;gBACP,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,IAAI;aAClB;SACF,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAaD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,UAAU,EACV,YAAY,GAAG,CAAC,EAChB,YAAY,GAAG,KAAK,EACpB,kBAAkB,GAAG,IAAI,EACzB,GAAG,wBAAwB,EACb,EAAE,EAAE;IAClB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CACxE,kBAAkB,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,CAC3D,CAAA;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC;QAC5B,aAAa,EAAE,GAAG,EAAE,CAClB,kBAAkB,IAAI,KAAK,CAAC,UAAU,EAAE,cAAc,CAAC;QACzD,YAAY,EAAE,GAAG,EAAE,CAAC,kBAAkB,IAAI,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC;QACvE,UAAU,EAAE,IAAI;QAChB,GAAG,wBAAwB;KAC5B,CAAC,CAAA;IAEF,OAAO;QACL,QAAQ;QACR,KAAK;QACL,WAAW;QACX,cAAc;KACf,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
interface TrapFocusParams {
|
|
3
|
+
beforeElementRef: RefObject<HTMLElement>;
|
|
4
|
+
trapFocusRef: RefObject<HTMLElement>;
|
|
5
|
+
afterElementRef: RefObject<HTMLElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const useTrapFocus: ({ trapFocusRef, beforeElementRef, afterElementRef, }: TrapFocusParams) => void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { tabbable } from 'tabbable';
|
|
3
|
+
/*
|
|
4
|
+
* Element that will maintain the focus inside trapFocusRef, focus the first element,
|
|
5
|
+
* and focus back on the element that was in focus when useTrapFocus was triggered.
|
|
6
|
+
*
|
|
7
|
+
* Inspired by Reakit useTrapFocus https://github.com/reakit/reakit/blob/a211d94da9f3b683182568a56479b91afb1b85ae/packages/reakit/src/Dialog/__utils/useFocusTrap.ts
|
|
8
|
+
*/
|
|
9
|
+
export const useTrapFocus = ({ trapFocusRef, beforeElementRef, afterElementRef, }) => {
|
|
10
|
+
const tabbableNodesRef = useRef();
|
|
11
|
+
const nodeToRestoreRef = useRef(document.hasFocus() ? document.activeElement : null);
|
|
12
|
+
// Focus back on the element that was focused when useTrapFocus is triggered.
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const nodeToRestore = nodeToRestoreRef.current;
|
|
15
|
+
return () => {
|
|
16
|
+
nodeToRestore?.focus();
|
|
17
|
+
};
|
|
18
|
+
}, [nodeToRestoreRef]);
|
|
19
|
+
// Set focus on first tabbable element
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!trapFocusRef.current) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (!tabbableNodesRef.current) {
|
|
25
|
+
tabbableNodesRef.current = tabbable(trapFocusRef.current);
|
|
26
|
+
}
|
|
27
|
+
const [firstTabbable] = tabbableNodesRef.current;
|
|
28
|
+
if (!firstTabbable) {
|
|
29
|
+
trapFocusRef.current.focus();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
firstTabbable.focus();
|
|
33
|
+
}, [trapFocusRef]);
|
|
34
|
+
// Handle loop focus. Set keydown and focusin event listeners
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!trapFocusRef.current ||
|
|
37
|
+
!beforeElementRef.current ||
|
|
38
|
+
!afterElementRef.current) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const beforeElement = beforeElementRef.current;
|
|
42
|
+
const afterElement = afterElementRef.current;
|
|
43
|
+
const trapFocus = trapFocusRef.current;
|
|
44
|
+
const handleLoopFocus = (nativeEvent) => {
|
|
45
|
+
if (!document.hasFocus()) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
tabbableNodesRef.current = tabbable(trapFocusRef.current);
|
|
49
|
+
if (!tabbableNodesRef.current.length) {
|
|
50
|
+
trapFocus.focus();
|
|
51
|
+
}
|
|
52
|
+
/*
|
|
53
|
+
* Handle loop focus from beforeElementRef. This node can only be focused if the user press shift tab.
|
|
54
|
+
* It will focus the last element of the trapFocusRef.
|
|
55
|
+
*/
|
|
56
|
+
if (nativeEvent.target === beforeElement) {
|
|
57
|
+
tabbableNodesRef.current[tabbableNodesRef.current.length - 1]?.focus();
|
|
58
|
+
}
|
|
59
|
+
/*
|
|
60
|
+
* Handle loop focus from afterElementRef. This node can only be focused if the user press tab.
|
|
61
|
+
* It will focus the first element of the trapFocusRef.
|
|
62
|
+
*/
|
|
63
|
+
if (nativeEvent.target === afterElement) {
|
|
64
|
+
tabbableNodesRef.current[0]?.focus();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
beforeElement?.addEventListener('focusin', handleLoopFocus);
|
|
68
|
+
afterElement?.addEventListener('focusin', handleLoopFocus);
|
|
69
|
+
return () => {
|
|
70
|
+
beforeElement?.removeEventListener('focusin', handleLoopFocus);
|
|
71
|
+
afterElement?.removeEventListener('focusin', handleLoopFocus);
|
|
72
|
+
};
|
|
73
|
+
}, [tabbableNodesRef, afterElementRef, beforeElementRef, trapFocusRef]);
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=useTrapFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrapFocus.js","sourceRoot":"","sources":["../../src/hooks/useTrapFocus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAQnC;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badge';
|
|
4
|
+
export { default as Button } from './atoms/Button';
|
|
5
|
+
export type { ButtonProps } from './atoms/Button';
|
|
6
|
+
export { default as Checkbox } from './atoms/Checkbox';
|
|
7
|
+
export type { CheckboxProps } from './atoms/Checkbox';
|
|
8
|
+
export { default as Icon } from './atoms/Icon';
|
|
9
|
+
export type { IconProps } from './atoms/Icon';
|
|
10
|
+
export { default as Input } from './atoms/Input';
|
|
11
|
+
export type { InputProps } from './atoms/Input';
|
|
12
|
+
export { default as Label } from './atoms/Label';
|
|
13
|
+
export type { LabelProps } from './atoms/Label';
|
|
14
|
+
export { default as Link } from './atoms/Link';
|
|
15
|
+
export type { LinkProps, LinkElementType } from './atoms/Link';
|
|
16
|
+
export { default as Loader } from './atoms/Loader';
|
|
17
|
+
export type { LoaderProps } from './atoms/Loader';
|
|
18
|
+
export { default as List } from './atoms/List';
|
|
19
|
+
export type { ListProps } from './atoms/List';
|
|
20
|
+
export { default as Overlay } from './atoms/Overlay';
|
|
21
|
+
export type { OverlayProps } from './atoms/Overlay';
|
|
22
|
+
export { default as Price } from './atoms/Price';
|
|
23
|
+
export type { PriceProps } from './atoms/Price';
|
|
24
|
+
export { default as Radio } from './atoms/Radio';
|
|
25
|
+
export type { RadioProps } from './atoms/Radio';
|
|
26
|
+
export { default as Skeleton } from './atoms/Skeleton';
|
|
27
|
+
export type { SkeletonProps } from './atoms/Skeleton';
|
|
28
|
+
export { default as Select } from './atoms/Select';
|
|
29
|
+
export type { SelectProps } from './atoms/Select';
|
|
30
|
+
export { default as Slider } from './atoms/Slider';
|
|
31
|
+
export type { SliderProps } from './atoms/Slider';
|
|
32
|
+
export { default as SROnly } from './atoms/SROnly';
|
|
33
|
+
export { default as Accordion, AccordionItem, AccordionButton, AccordionPanel, } from './molecules/Accordion';
|
|
34
|
+
export type { AccordionProps, AccordionItemProps, AccordionButtonProps, AccordionPanelProps, } from './molecules/Accordion';
|
|
35
|
+
export { default as Alert } from './molecules/Alert';
|
|
36
|
+
export type { AlertProps } from './molecules/Alert';
|
|
37
|
+
export { BreadcrumbPure, Breadcrumb } from './molecules/Breadcrumb';
|
|
38
|
+
export type { BreadcrumbPureProps, BreadcrumbProps, } from './molecules/Breadcrumb';
|
|
39
|
+
export { default as BuyButton } from './molecules/BuyButton';
|
|
40
|
+
export { default as Carousel, CarouselItem, CarouselBullets, } from './molecules/Carousel';
|
|
41
|
+
export type { CarouselProps, CarouselItemProps, CarouselBulletsProps, } from './molecules/Carousel';
|
|
42
|
+
export { default as CartItem, CartItemImage, CartItemSummary, } from './molecules/CartItem';
|
|
43
|
+
export type { CartItemProps, CartItemImageProps, CartItemSummaryProps, } from './molecules/CartItem';
|
|
44
|
+
export { default as CheckboxField } from './molecules/CheckboxField';
|
|
45
|
+
export type { CheckboxFieldProps } from './molecules/CheckboxField';
|
|
46
|
+
export { default as IconButton } from './molecules/IconButton';
|
|
47
|
+
export type { IconButtonProps } from './molecules/IconButton';
|
|
48
|
+
export { default as DiscountBadge } from './molecules/DiscountBadge';
|
|
49
|
+
export type { DiscountBadgeProps } from './molecules/DiscountBadge';
|
|
50
|
+
export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
|
|
51
|
+
export type { DropdownProps, DropdownButtonProps, DropdownItemProps, DropdownMenuProps, } from './molecules/Dropdown';
|
|
52
|
+
export { default as Gift, GiftContent, GiftImage } from './molecules/Gift';
|
|
53
|
+
export type { GiftProps, GiftContentProps, GiftImageProps, } from './molecules/Gift';
|
|
54
|
+
export { default as InputField } from './molecules/InputField';
|
|
55
|
+
export type { InputFieldProps } from './molecules/InputField';
|
|
56
|
+
export { default as LinkButton } from './molecules/LinkButton';
|
|
57
|
+
export type { LinkButtonProps } from './molecules/LinkButton';
|
|
58
|
+
export { default as Modal, ModalHeader, ModalBody } from './molecules/Modal';
|
|
59
|
+
export type { ModalProps, ModalHeaderProps } from './molecules/Modal';
|
|
60
|
+
export { default as NavbarLinks, NavbarLinksList, NavbarLinksListItem, } from './molecules/NavbarLinks';
|
|
61
|
+
export type { NavbarLinksProps, NavbarLinksListProps, NavbarLinksListItemProps, } from './molecules/NavbarLinks';
|
|
62
|
+
export { default as OrderSummary } from './molecules/OrderSummary';
|
|
63
|
+
export type { OrderSummaryProps } from './molecules/OrderSummary';
|
|
64
|
+
export { default as ProductCard, ProductCardImage, ProductCardContent, } from './molecules/ProductCard';
|
|
65
|
+
export type { ProductCardProps, ProductCardImageProps, ProductCardContentProps, } from './molecules/ProductCard';
|
|
66
|
+
export { default as ProductPrice } from './molecules/ProductPrice';
|
|
67
|
+
export type { ProductPriceProps } from './molecules/ProductPrice';
|
|
68
|
+
export { default as ProductTitle } from './molecules/ProductTitle';
|
|
69
|
+
export type { ProductTitleProps } from './molecules/ProductTitle';
|
|
70
|
+
export { default as RadioField } from './molecules/RadioField';
|
|
71
|
+
export type { RadioFieldProps } from './molecules/RadioField';
|
|
72
|
+
export { default as RadioGroup, RadioOption } from './molecules/RadioGroup';
|
|
73
|
+
export type { RadioGroupProps, RadioOptionProps } from './molecules/RadioGroup';
|
|
74
|
+
export { default as Rating } from './molecules/Rating';
|
|
75
|
+
export type { RatingProps } from './molecules/Rating';
|
|
76
|
+
export { default as RegionBar } from './molecules/RegionBar';
|
|
77
|
+
export type { RegionBarProps } from './molecules/RegionBar';
|
|
78
|
+
export { default as SearchProvider } from './molecules/SearchProvider';
|
|
79
|
+
export type { SearchProviderContextValue } from './molecules/SearchProvider';
|
|
80
|
+
export { default as SearchInputField } from './molecules/SearchInputField';
|
|
81
|
+
export type { SearchInputFieldProps, SearchInputFieldRef, } from './molecules/SearchInputField';
|
|
82
|
+
export { default as SearchAutoComplete, SearchAutoCompleteTerm, } from './molecules/SearchAutoComplete';
|
|
83
|
+
export type { SearchAutoCompleteProps, SearchAutoCompleteTermProps, } from './molecules/SearchAutoComplete';
|
|
84
|
+
export { default as SearchDropdown, SearchDropdownProps, } from './molecules/SearchDropdown';
|
|
85
|
+
export { default as SearchHistory, SearchHistoryTerm, } from './molecules/SearchHistory';
|
|
86
|
+
export type { SearchHistoryProps, SearchHistoryTermProps, } from './molecules/SearchHistory';
|
|
87
|
+
export { default as SearchProducts, SearchProductItem, SearchProductItemImage, SearchProductItemContent, } from './molecules/SearchProducts';
|
|
88
|
+
export type { SearchProductsProps, SearchProductItemProps, SearchProductItemImageProps, SearchProductItemContentProps, } from './molecules/SearchProducts';
|
|
89
|
+
export { default as SearchTop, SearchTopTerm } from './molecules/SearchTop';
|
|
90
|
+
export type { SearchTopProps, SearchTopTermProps } from './molecules/SearchTop';
|
|
91
|
+
export { default as SelectField } from './molecules/SelectField';
|
|
92
|
+
export type { SelectFieldProps } from './molecules/SelectField';
|
|
93
|
+
export { default as SkuSelector } from './molecules/SkuSelector';
|
|
94
|
+
export type { SkuSelectorProps, SkuOption } from './molecules/SkuSelector';
|
|
95
|
+
export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './molecules/Table';
|
|
96
|
+
export type { TableProps, TableBodyProps, TableCellProps, TableFooterProps, TableHeadProps, TableRowProps, } from './molecules/Table';
|
|
97
|
+
export { default as Tag } from './molecules/Tag';
|
|
98
|
+
export type { TagProps } from './molecules/Tag';
|
|
99
|
+
export { default as Toast } from './molecules/Toast';
|
|
100
|
+
export { default as Toggle } from './molecules/Toggle';
|
|
101
|
+
export type { ToggleProps } from './molecules/Toggle';
|
|
102
|
+
export { default as ToggleField } from './molecules/ToggleField';
|
|
103
|
+
export type { ToggleFieldProps } from './molecules/ToggleField';
|
|
104
|
+
export { default as QuantitySelector } from './molecules/QuantitySelector';
|
|
105
|
+
export type { QuantitySelectorProps } from './molecules/QuantitySelector';
|
|
106
|
+
export { default as BannerText, BannerTextContent, } from './organisms/BannerText';
|
|
107
|
+
export type { BannerTextProps, BannerTextContentProps, } from './organisms/BannerText';
|
|
108
|
+
export { default as CartSidebar, CartSidebarList, CartSidebarFooter, } from './organisms/CartSidebar';
|
|
109
|
+
export type { CartSidebarProps } from './organisms/CartSidebar';
|
|
110
|
+
export { default as EmptyState } from './organisms/EmptyState';
|
|
111
|
+
export type { EmptyStateProps } from './organisms/EmptyState';
|
|
112
|
+
export { default as Filter, FilterFacetBoolean, FilterFacetBooleanItem, FilterFacetRange, FilterFacets, FilterSlider, } from './organisms/Filter';
|
|
113
|
+
export type { FilterFacetBooleanItemProps, FilterFacetRangeProps, FilterFacetsProps, FilterProps, FilterSliderProps, } from './organisms/Filter';
|
|
114
|
+
export { default as Hero, HeroImage, HeroHeader } from './organisms/Hero';
|
|
115
|
+
export type { HeroProps, HeroImageProps, HeroHeaderProps, } from './organisms/Hero';
|
|
116
|
+
export { default as ImageGallery, ImageGallerySelector, ImageGalleryViewer, } from './organisms/ImageGallery';
|
|
117
|
+
export type { ImageElementData, ImageGalleryProps, ImageGallerySelectorProps, ImageGalleryViewerProps, } from './organisms/ImageGallery';
|
|
118
|
+
export { default as Navbar, NavbarHeader, NavbarRow, NavbarButtons, } from './organisms/Navbar';
|
|
119
|
+
export type { NavbarProps, NavbarHeaderProps, NavbarRowProps, NavbarButtonsProps, } from './organisms/Navbar';
|
|
120
|
+
export { default as NavbarSlider, NavbarSliderHeader, NavbarSliderContent, NavbarSliderFooter, } from './organisms/NavbarSlider';
|
|
121
|
+
export type { NavbarSliderProps, NavbarSliderHeaderProps, NavbarSliderContentProps, NavbarSliderFooterProps, } from './organisms/NavbarSlider';
|
|
122
|
+
export { default as Newsletter, NewsletterAddendum, NewsletterContent, NewsletterForm, NewsletterHeader, } from './organisms/Newsletter';
|
|
123
|
+
export type { NewsletterProps, NewsletterAddendumProps, NewsletterContentProps, NewsletterFormProps, NewsletterHeaderProps, } from './organisms/Newsletter';
|
|
124
|
+
export { default as OutOfStock } from './organisms/OutOfStock';
|
|
125
|
+
export type { OutOfStockProps } from './organisms/OutOfStock';
|
|
126
|
+
export { default as PaymentMethods } from './organisms/PaymentMethods';
|
|
127
|
+
export type { PaymentMethodsProps } from './organisms/PaymentMethods';
|
|
128
|
+
export { default as PriceRange } from './organisms/PriceRange';
|
|
129
|
+
export type { PriceRangeProps } from './organisms/PriceRange';
|
|
130
|
+
export { default as ProductGrid, ProductGridItem, } from './organisms/ProductGrid';
|
|
131
|
+
export type { ProductGridProps, ProductGridItemProps, } from './organisms/ProductGrid';
|
|
132
|
+
export { default as ProductShelf, ProductShelfItems, ProductShelfItem, } from './organisms/ProductShelf';
|
|
133
|
+
export type { ProductShelfProps, ProductShelfItemsProps, ProductShelfItemProps, } from './organisms/ProductShelf';
|
|
134
|
+
export { default as RegionModal } from './organisms/RegionModal';
|
|
135
|
+
export type { RegionModalProps } from './organisms/RegionModal';
|
|
136
|
+
export { default as SearchInput } from './organisms/SearchInput';
|
|
137
|
+
export type { SearchInputProps } from './organisms/SearchInput';
|
|
138
|
+
export { default as ShippingSimulation } from './organisms/ShippingSimulation';
|
|
139
|
+
export type { ShippingSimulationProps } from './organisms/ShippingSimulation';
|
|
140
|
+
export { default as SlideOver, SlideOverHeader } from './organisms/SlideOver';
|
|
141
|
+
export type { SlideOverProps, SlideOverHeaderProps, } from './organisms/SlideOver';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Hooks
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
// Atoms
|
|
4
|
+
export { default as Badge } from './atoms/Badge';
|
|
5
|
+
export { default as Button } from './atoms/Button';
|
|
6
|
+
export { default as Checkbox } from './atoms/Checkbox';
|
|
7
|
+
export { default as Icon } from './atoms/Icon';
|
|
8
|
+
export { default as Input } from './atoms/Input';
|
|
9
|
+
export { default as Label } from './atoms/Label';
|
|
10
|
+
export { default as Link } from './atoms/Link';
|
|
11
|
+
export { default as Loader } from './atoms/Loader';
|
|
12
|
+
export { default as List } from './atoms/List';
|
|
13
|
+
export { default as Overlay } from './atoms/Overlay';
|
|
14
|
+
export { default as Price } from './atoms/Price';
|
|
15
|
+
export { default as Radio } from './atoms/Radio';
|
|
16
|
+
export { default as Skeleton } from './atoms/Skeleton';
|
|
17
|
+
export { default as Select } from './atoms/Select';
|
|
18
|
+
export { default as Slider } from './atoms/Slider';
|
|
19
|
+
export { default as SROnly } from './atoms/SROnly';
|
|
20
|
+
// Molecules
|
|
21
|
+
export { default as Accordion, AccordionItem, AccordionButton, AccordionPanel, } from './molecules/Accordion';
|
|
22
|
+
export { default as Alert } from './molecules/Alert';
|
|
23
|
+
export { BreadcrumbPure, Breadcrumb } from './molecules/Breadcrumb';
|
|
24
|
+
export { default as BuyButton } from './molecules/BuyButton';
|
|
25
|
+
export { default as Carousel, CarouselItem, CarouselBullets, } from './molecules/Carousel';
|
|
26
|
+
export { default as CartItem, CartItemImage, CartItemSummary, } from './molecules/CartItem';
|
|
27
|
+
export { default as CheckboxField } from './molecules/CheckboxField';
|
|
28
|
+
export { default as IconButton } from './molecules/IconButton';
|
|
29
|
+
export { default as DiscountBadge } from './molecules/DiscountBadge';
|
|
30
|
+
export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
|
|
31
|
+
export { default as Gift, GiftContent, GiftImage } from './molecules/Gift';
|
|
32
|
+
export { default as InputField } from './molecules/InputField';
|
|
33
|
+
export { default as LinkButton } from './molecules/LinkButton';
|
|
34
|
+
export { default as Modal, ModalHeader, ModalBody } from './molecules/Modal';
|
|
35
|
+
export { default as NavbarLinks, NavbarLinksList, NavbarLinksListItem, } from './molecules/NavbarLinks';
|
|
36
|
+
export { default as OrderSummary } from './molecules/OrderSummary';
|
|
37
|
+
export { default as ProductCard, ProductCardImage, ProductCardContent, } from './molecules/ProductCard';
|
|
38
|
+
export { default as ProductPrice } from './molecules/ProductPrice';
|
|
39
|
+
export { default as ProductTitle } from './molecules/ProductTitle';
|
|
40
|
+
export { default as RadioField } from './molecules/RadioField';
|
|
41
|
+
export { default as RadioGroup, RadioOption } from './molecules/RadioGroup';
|
|
42
|
+
export { default as Rating } from './molecules/Rating';
|
|
43
|
+
export { default as RegionBar } from './molecules/RegionBar';
|
|
44
|
+
export { default as SearchProvider } from './molecules/SearchProvider';
|
|
45
|
+
export { default as SearchInputField } from './molecules/SearchInputField';
|
|
46
|
+
export { default as SearchAutoComplete, SearchAutoCompleteTerm, } from './molecules/SearchAutoComplete';
|
|
47
|
+
export { default as SearchDropdown, } from './molecules/SearchDropdown';
|
|
48
|
+
export { default as SearchHistory, SearchHistoryTerm, } from './molecules/SearchHistory';
|
|
49
|
+
export { default as SearchProducts, SearchProductItem, SearchProductItemImage, SearchProductItemContent, } from './molecules/SearchProducts';
|
|
50
|
+
export { default as SearchTop, SearchTopTerm } from './molecules/SearchTop';
|
|
51
|
+
export { default as SelectField } from './molecules/SelectField';
|
|
52
|
+
export { default as SkuSelector } from './molecules/SkuSelector';
|
|
53
|
+
export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './molecules/Table';
|
|
54
|
+
export { default as Tag } from './molecules/Tag';
|
|
55
|
+
export { default as Toast } from './molecules/Toast';
|
|
56
|
+
export { default as Toggle } from './molecules/Toggle';
|
|
57
|
+
export { default as ToggleField } from './molecules/ToggleField';
|
|
58
|
+
export { default as QuantitySelector } from './molecules/QuantitySelector';
|
|
59
|
+
// Organisms
|
|
60
|
+
export { default as BannerText, BannerTextContent, } from './organisms/BannerText';
|
|
61
|
+
export { default as CartSidebar, CartSidebarList, CartSidebarFooter, } from './organisms/CartSidebar';
|
|
62
|
+
export { default as EmptyState } from './organisms/EmptyState';
|
|
63
|
+
export { default as Filter, FilterFacetBoolean, FilterFacetBooleanItem, FilterFacetRange, FilterFacets, FilterSlider, } from './organisms/Filter';
|
|
64
|
+
export { default as Hero, HeroImage, HeroHeader } from './organisms/Hero';
|
|
65
|
+
export { default as ImageGallery, ImageGallerySelector, ImageGalleryViewer, } from './organisms/ImageGallery';
|
|
66
|
+
export { default as Navbar, NavbarHeader, NavbarRow, NavbarButtons, } from './organisms/Navbar';
|
|
67
|
+
export { default as NavbarSlider, NavbarSliderHeader, NavbarSliderContent, NavbarSliderFooter, } from './organisms/NavbarSlider';
|
|
68
|
+
export { default as Newsletter, NewsletterAddendum, NewsletterContent, NewsletterForm, NewsletterHeader, } from './organisms/Newsletter';
|
|
69
|
+
export { default as OutOfStock } from './organisms/OutOfStock';
|
|
70
|
+
export { default as PaymentMethods } from './organisms/PaymentMethods';
|
|
71
|
+
export { default as PriceRange } from './organisms/PriceRange';
|
|
72
|
+
export { default as ProductGrid, ProductGridItem, } from './organisms/ProductGrid';
|
|
73
|
+
export { default as ProductShelf, ProductShelfItems, ProductShelfItem, } from './organisms/ProductShelf';
|
|
74
|
+
export { default as RegionModal } from './organisms/RegionModal';
|
|
75
|
+
export { default as SearchInput } from './organisms/SearchInput';
|
|
76
|
+
export { default as ShippingSimulation } from './organisms/ShippingSimulation';
|
|
77
|
+
export { default as SlideOver, SlideOverHeader } from './organisms/SlideOver';
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,SAAS,CAAA;AAEvB,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,OAAO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,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,YAAY,EACZ,SAAS,EACT,aAAa,GACd,MAAM,oBAAoB,CAAA;AAQ3B,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAS/B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAMhC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,0BAA0B,CAAA;AAOjC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAG9E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface AccordionContext {
|
|
4
|
+
indices: Set<number>;
|
|
5
|
+
onChange: (index: number) => void;
|
|
6
|
+
numberOfItems: number;
|
|
7
|
+
}
|
|
8
|
+
declare const AccordionContext: React.Context<AccordionContext | undefined>;
|
|
9
|
+
export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
10
|
+
/**
|
|
11
|
+
* ID to find this component in testing tools (e.g.: cypress,
|
|
12
|
+
* testing-library, and jest).
|
|
13
|
+
*/
|
|
14
|
+
testId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Indices that indicate which accordion items are opened.
|
|
17
|
+
*/
|
|
18
|
+
indices: Iterable<number>;
|
|
19
|
+
/**
|
|
20
|
+
* Function that is triggered when an accordion item is opened/closed.
|
|
21
|
+
*/
|
|
22
|
+
onChange: (index: number) => void;
|
|
23
|
+
}
|
|
24
|
+
declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export declare function useAccordion(): AccordionContext;
|
|
26
|
+
export default Accordion;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useContext, cloneElement, forwardRef, createContext, } from 'react';
|
|
2
|
+
const AccordionContext = createContext(undefined);
|
|
3
|
+
const Accordion = forwardRef(function Accordion({ testId = 'fs-accordion', indices, onChange, children, ...otherProps }, ref) {
|
|
4
|
+
const childrenWithIndex = React.Children.map(children, (child, index) => cloneElement(child, { index: child.props.index ?? index }));
|
|
5
|
+
const context = {
|
|
6
|
+
indices: new Set(indices),
|
|
7
|
+
onChange,
|
|
8
|
+
numberOfItems: childrenWithIndex.length,
|
|
9
|
+
};
|
|
10
|
+
return (React.createElement(AccordionContext.Provider, { value: context },
|
|
11
|
+
React.createElement("div", { ref: ref, "data-fs-accordion": true, role: "region", "data-testid": testId, ...otherProps }, childrenWithIndex)));
|
|
12
|
+
});
|
|
13
|
+
export function useAccordion() {
|
|
14
|
+
const context = useContext(AccordionContext);
|
|
15
|
+
if (context === undefined) {
|
|
16
|
+
throw new Error('Do not use Accordion components outside the Accordion context.');
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
export default Accordion;
|
|
21
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../src/molecules/Accordion/Accordion.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,OAAO,CAAA;AAQd,MAAM,gBAAgB,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAA;AAmB/E,MAAM,SAAS,GAAG,UAAU,CAAiC,SAAS,SAAS,CAC7E,EAAE,MAAM,GAAG,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACvE,GAAG;IAEH,MAAM,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAC1C,QAAwB,EACxB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,EAAE,CAAC,CAC7E,CAAA;IAED,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC;QACzB,QAAQ;QACR,aAAa,EAAE,iBAAiB,CAAC,MAAM;KACxC,CAAA;IAED,OAAO,CACL,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO;QACvC,6BACE,GAAG,EAAE,GAAG,6BAER,IAAI,EAAC,QAAQ,iBACA,MAAM,KACf,UAAU,IAEb,iBAAiB,CACd,CACoB,CAC7B,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAA;IAE5C,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAA;KACF;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ButtonProps } from '../..';
|
|
4
|
+
export interface AccordionButtonProps extends ButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
+
*/
|
|
8
|
+
testId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* A React component is rendered as an icon when the accordion is expanded.
|
|
11
|
+
*/
|
|
12
|
+
expandedIcon?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* A React component is rendered as an icon when the accordion is collapsed.
|
|
15
|
+
*/
|
|
16
|
+
collapsedIcon?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const AccordionButton: React.ForwardRefExoticComponent<AccordionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export default AccordionButton;
|