@faststore/ui 1.12.32 → 1.12.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Incentive/Incentive.js +1 -1
- package/dist/components/atoms/Incentive/Incentive.js.map +1 -1
- package/dist/components/atoms/Popover/Popover.d.ts +1 -1
- package/dist/components/atoms/Popover/Popover.js +1 -1
- package/dist/components/atoms/Popover/Popover.js.map +1 -1
- package/dist/components/atoms/Skeleton/Skeleton.js +1 -1
- package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/atoms/Slider/Slider.d.ts +2 -2
- package/dist/components/atoms/Spinner/Spinner.d.ts +1 -1
- package/dist/components/atoms/Spinner/Spinner.js +1 -1
- package/dist/components/atoms/Spinner/Spinner.js.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +1 -1
- package/dist/components/atoms/TextArea/TextArea.js.map +1 -1
- package/dist/components/molecules/AggregateRating/AggregateRating.d.ts +2 -2
- package/dist/components/molecules/AggregateRating/AggregateRating.js +4 -4
- package/dist/components/molecules/AggregateRating/AggregateRating.js.map +1 -1
- package/dist/components/molecules/Alert/Alert.js +1 -1
- package/dist/components/molecules/Alert/Alert.js.map +1 -1
- package/dist/components/molecules/Banner/Banner.d.ts +1 -1
- package/dist/components/molecules/Banner/Banner.js +1 -1
- package/dist/components/molecules/Banner/Banner.js.map +1 -1
- package/dist/components/molecules/Banner/BannerContent.js +1 -1
- package/dist/components/molecules/Banner/BannerContent.js.map +1 -1
- package/dist/components/molecules/Banner/BannerImage.js +1 -1
- package/dist/components/molecules/Banner/BannerImage.js.map +1 -1
- package/dist/components/molecules/Banner/BannerLink.js +1 -1
- package/dist/components/molecules/Banner/BannerLink.js.map +1 -1
- package/dist/components/molecules/Breadcrumb/Breadcrumb.js +5 -5
- package/dist/components/molecules/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/molecules/Bullets/Bullets.js +1 -1
- package/dist/components/molecules/Bullets/Bullets.js.map +1 -1
- package/dist/components/molecules/Card/Card.js +1 -1
- package/dist/components/molecules/Card/Card.js.map +1 -1
- package/dist/components/molecules/Card/CardActions.js +1 -1
- package/dist/components/molecules/Card/CardActions.js.map +1 -1
- package/dist/components/molecules/Card/CardContent.js +1 -1
- package/dist/components/molecules/Card/CardContent.js.map +1 -1
- package/dist/components/molecules/Card/CardImage.js +1 -1
- package/dist/components/molecules/Card/CardImage.js.map +1 -1
- package/dist/components/molecules/Carousel/Carousel.js +2 -2
- package/dist/components/molecules/Carousel/Carousel.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItem.js +1 -1
- package/dist/components/molecules/CartItem/CartItem.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItemActions.js +1 -1
- package/dist/components/molecules/CartItem/CartItemActions.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItemContent.js +1 -1
- package/dist/components/molecules/CartItem/CartItemContent.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItemImage.js +1 -1
- package/dist/components/molecules/CartItem/CartItemImage.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItemPrices.js +1 -1
- package/dist/components/molecules/CartItem/CartItemPrices.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItemSummary.js +1 -1
- package/dist/components/molecules/CartItem/CartItemSummary.js.map +1 -1
- package/dist/components/molecules/CartItem/CartItemTitle.js +1 -1
- package/dist/components/molecules/CartItem/CartItemTitle.js.map +1 -1
- package/dist/components/molecules/Form/Form.js +1 -1
- package/dist/components/molecules/Form/Form.js.map +1 -1
- package/dist/components/molecules/LoadingButton/LoadingButton.js +1 -1
- package/dist/components/molecules/LoadingButton/LoadingButton.js.map +1 -1
- package/dist/components/molecules/Modal/Modal.js +3 -3
- package/dist/components/molecules/Modal/Modal.js.map +1 -1
- package/dist/components/molecules/Modal/ModalContent.d.ts +1 -1
- package/dist/components/molecules/Modal/ModalContent.js +3 -3
- package/dist/components/molecules/Modal/ModalContent.js.map +1 -1
- package/dist/components/molecules/OrderSummary/OrderSummary.d.ts +3 -3
- package/dist/components/molecules/OrderSummary/OrderSummary.js +3 -3
- package/dist/components/molecules/OrderSummary/OrderSummary.js.map +1 -1
- package/dist/components/molecules/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/components/molecules/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/components/molecules/PriceRange/PriceRange.d.ts +3 -3
- package/dist/components/molecules/PriceRange/PriceRange.js +1 -1
- package/dist/components/molecules/PriceRange/PriceRange.js.map +1 -1
- package/dist/components/molecules/ProductCard/ProductCard.js +1 -1
- package/dist/components/molecules/ProductCard/ProductCard.js.map +1 -1
- package/dist/components/molecules/ProductCard/ProductCardActions.js +1 -1
- package/dist/components/molecules/ProductCard/ProductCardActions.js.map +1 -1
- package/dist/components/molecules/ProductCard/ProductCardContent.js +1 -1
- package/dist/components/molecules/ProductCard/ProductCardContent.js.map +1 -1
- package/dist/components/molecules/ProductCard/ProductCardImage.js +1 -1
- package/dist/components/molecules/ProductCard/ProductCardImage.js.map +1 -1
- package/dist/components/molecules/ProductTitle/ProductTitle.d.ts +1 -1
- package/dist/components/molecules/ProductTitle/ProductTitle.js +1 -1
- package/dist/components/molecules/ProductTitle/ProductTitle.js.map +1 -1
- package/dist/components/molecules/QuantitySelector/QuantitySelector.d.ts +1 -2
- package/dist/components/molecules/QuantitySelector/QuantitySelector.js +5 -6
- package/dist/components/molecules/QuantitySelector/QuantitySelector.js.map +1 -1
- package/dist/components/molecules/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/molecules/RadioGroup/RadioOption.js +1 -1
- package/dist/components/molecules/RadioGroup/RadioOption.js.map +1 -1
- package/dist/components/molecules/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/molecules/SearchInput/SearchInput.js +2 -3
- package/dist/components/molecules/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/molecules/SkuSelector/SkuSelector.d.ts +1 -1
- package/dist/components/molecules/SkuSelector/SkuSelector.js +1 -1
- package/dist/components/molecules/SkuSelector/SkuSelector.js.map +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStock.d.ts +2 -2
- package/dist/components/organisms/OutOfStock/OutOfStock.js +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStock.js.map +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStockMessage.d.ts +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStockMessage.js +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStockMessage.js.map +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStockTitle.d.ts +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStockTitle.js +1 -1
- package/dist/components/organisms/OutOfStock/OutOfStockTitle.js.map +1 -1
- package/dist/components/organisms/Tiles/Tile.js +1 -1
- package/dist/components/organisms/Tiles/Tile.js.map +1 -1
- package/dist/components/organisms/Tiles/Tiles.js +1 -1
- package/dist/components/organisms/Tiles/Tiles.js.map +1 -1
- package/dist/components/src/atoms/List/List.d.ts +16 -0
- package/dist/components/src/atoms/List/List.js +7 -0
- package/dist/components/src/atoms/List/List.js.map +1 -0
- package/dist/components/src/atoms/List/index.d.ts +2 -0
- package/dist/components/src/atoms/List/index.js +2 -0
- package/dist/components/src/atoms/List/index.js.map +1 -0
- package/dist/components/src/typings/PolymorphicGenerics.d.ts +28 -0
- package/dist/components/src/typings/PolymorphicGenerics.js +8 -0
- package/dist/components/src/typings/PolymorphicGenerics.js.map +1 -0
- package/dist/components/src/typings/index.d.ts +1 -0
- package/dist/components/src/typings/index.js +2 -0
- package/dist/components/src/typings/index.js.map +1 -0
- package/dist/hooks/useSlider/useSlider.d.ts +3 -3
- package/dist/index.d.ts +0 -22
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/dist/typings/PolymorphicGenerics.d.ts +6 -6
- package/dist/ui/src/components/atoms/Incentive/Incentive.d.ts +11 -0
- package/dist/ui/src/components/atoms/Incentive/Incentive.js +6 -0
- package/dist/ui/src/components/atoms/Incentive/Incentive.js.map +1 -0
- package/dist/ui/src/components/atoms/Incentive/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Incentive/index.js +2 -0
- package/dist/ui/src/components/atoms/Incentive/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Incentive/stories/assets/Icons.d.ts +2 -0
- package/dist/ui/src/components/atoms/Incentive/stories/assets/Icons.js +6 -0
- package/dist/ui/src/components/atoms/Incentive/stories/assets/Icons.js.map +1 -0
- package/dist/ui/src/components/atoms/Link/Link.d.ts +19 -0
- package/dist/ui/src/components/atoms/Link/Link.js +13 -0
- package/dist/ui/src/components/atoms/Link/Link.js.map +1 -0
- package/dist/ui/src/components/atoms/Link/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Link/index.js +2 -0
- package/dist/ui/src/components/atoms/Link/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Popover/Popover.d.ts +15 -0
- package/dist/ui/src/components/atoms/Popover/Popover.js +7 -0
- package/dist/ui/src/components/atoms/Popover/Popover.js.map +1 -0
- package/dist/ui/src/components/atoms/Popover/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Popover/index.js +2 -0
- package/dist/ui/src/components/atoms/Popover/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Price/Price.d.ts +28 -0
- package/dist/ui/src/components/atoms/Price/Price.js +7 -0
- package/dist/ui/src/components/atoms/Price/Price.js.map +1 -0
- package/dist/ui/src/components/atoms/Price/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Price/index.js +2 -0
- package/dist/ui/src/components/atoms/Price/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Select/Select.d.ts +10 -0
- package/dist/ui/src/components/atoms/Select/Select.js +6 -0
- package/dist/ui/src/components/atoms/Select/Select.js.map +1 -0
- package/dist/ui/src/components/atoms/Select/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Select/index.js +2 -0
- package/dist/ui/src/components/atoms/Select/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Skeleton/Skeleton.d.ts +10 -0
- package/dist/ui/src/components/atoms/Skeleton/Skeleton.js +6 -0
- package/dist/ui/src/components/atoms/Skeleton/Skeleton.js.map +1 -0
- package/dist/ui/src/components/atoms/Skeleton/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Skeleton/index.js +2 -0
- package/dist/ui/src/components/atoms/Skeleton/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Slider/Slider.d.ts +67 -0
- package/dist/ui/src/components/atoms/Slider/Slider.js +48 -0
- package/dist/ui/src/components/atoms/Slider/Slider.js.map +1 -0
- package/dist/ui/src/components/atoms/Slider/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Slider/index.js +2 -0
- package/dist/ui/src/components/atoms/Slider/index.js.map +1 -0
- package/dist/ui/src/components/atoms/Spinner/Spinner.d.ts +11 -0
- package/dist/ui/src/components/atoms/Spinner/Spinner.js +6 -0
- package/dist/ui/src/components/atoms/Spinner/Spinner.js.map +1 -0
- package/dist/ui/src/components/atoms/Spinner/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/Spinner/index.js +2 -0
- package/dist/ui/src/components/atoms/Spinner/index.js.map +1 -0
- package/dist/ui/src/components/atoms/TextArea/TextArea.d.ts +14 -0
- package/dist/ui/src/components/atoms/TextArea/TextArea.js +10 -0
- package/dist/ui/src/components/atoms/TextArea/TextArea.js.map +1 -0
- package/dist/ui/src/components/atoms/TextArea/index.d.ts +2 -0
- package/dist/ui/src/components/atoms/TextArea/index.js +2 -0
- package/dist/ui/src/components/atoms/TextArea/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Accordion/Accordion.d.ts +26 -0
- package/dist/ui/src/components/molecules/Accordion/Accordion.js +21 -0
- package/dist/ui/src/components/molecules/Accordion/Accordion.js.map +1 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionButton.d.ts +10 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionButton.js +37 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionButton.js.map +1 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionItem.d.ts +37 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionItem.js +28 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionItem.js.map +1 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionPanel.d.ts +10 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionPanel.js +10 -0
- package/dist/ui/src/components/molecules/Accordion/AccordionPanel.js.map +1 -0
- package/dist/ui/src/components/molecules/Accordion/index.d.ts +8 -0
- package/dist/ui/src/components/molecules/Accordion/index.js +5 -0
- package/dist/ui/src/components/molecules/Accordion/index.js.map +1 -0
- package/dist/ui/src/components/molecules/AggregateRating/AggregateRating.d.ts +18 -0
- package/dist/ui/src/components/molecules/AggregateRating/AggregateRating.js +26 -0
- package/dist/ui/src/components/molecules/AggregateRating/AggregateRating.js.map +1 -0
- package/dist/ui/src/components/molecules/AggregateRating/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/AggregateRating/index.js +2 -0
- package/dist/ui/src/components/molecules/AggregateRating/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Alert/Alert.d.ts +11 -0
- package/dist/ui/src/components/molecules/Alert/Alert.js +6 -0
- package/dist/ui/src/components/molecules/Alert/Alert.js.map +1 -0
- package/dist/ui/src/components/molecules/Alert/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/Alert/index.js +2 -0
- package/dist/ui/src/components/molecules/Alert/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Banner/Banner.d.ts +14 -0
- package/dist/ui/src/components/molecules/Banner/Banner.js +6 -0
- package/dist/ui/src/components/molecules/Banner/Banner.js.map +1 -0
- package/dist/ui/src/components/molecules/Banner/BannerContent.d.ts +10 -0
- package/dist/ui/src/components/molecules/Banner/BannerContent.js +6 -0
- package/dist/ui/src/components/molecules/Banner/BannerContent.js.map +1 -0
- package/dist/ui/src/components/molecules/Banner/BannerImage.d.ts +10 -0
- package/dist/ui/src/components/molecules/Banner/BannerImage.js +6 -0
- package/dist/ui/src/components/molecules/Banner/BannerImage.js.map +1 -0
- package/dist/ui/src/components/molecules/Banner/BannerLink.d.ts +10 -0
- package/dist/ui/src/components/molecules/Banner/BannerLink.js +6 -0
- package/dist/ui/src/components/molecules/Banner/BannerLink.js.map +1 -0
- package/dist/ui/src/components/molecules/Banner/index.d.ts +8 -0
- package/dist/ui/src/components/molecules/Banner/index.js +5 -0
- package/dist/ui/src/components/molecules/Banner/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Breadcrumb/Breadcrumb.d.ts +14 -0
- package/dist/ui/src/components/molecules/Breadcrumb/Breadcrumb.js +38 -0
- package/dist/ui/src/components/molecules/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/ui/src/components/molecules/Breadcrumb/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/Breadcrumb/index.js +2 -0
- package/dist/ui/src/components/molecules/Breadcrumb/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Bullets/Bullets.d.ts +35 -0
- package/dist/ui/src/components/molecules/Bullets/Bullets.js +12 -0
- package/dist/ui/src/components/molecules/Bullets/Bullets.js.map +1 -0
- package/dist/ui/src/components/molecules/Bullets/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/Bullets/index.js +2 -0
- package/dist/ui/src/components/molecules/Bullets/index.js.map +1 -0
- package/dist/{components/atoms/Overlay/Overlay.d.ts → ui/src/components/molecules/Card/Card.d.ts} +4 -4
- package/dist/ui/src/components/molecules/Card/Card.js +6 -0
- package/dist/ui/src/components/molecules/Card/Card.js.map +1 -0
- package/dist/ui/src/components/molecules/Card/CardActions.d.ts +10 -0
- package/dist/ui/src/components/molecules/Card/CardActions.js +6 -0
- package/dist/ui/src/components/molecules/Card/CardActions.js.map +1 -0
- package/dist/ui/src/components/molecules/Card/CardContent.d.ts +10 -0
- package/dist/ui/src/components/molecules/Card/CardContent.js +6 -0
- package/dist/ui/src/components/molecules/Card/CardContent.js.map +1 -0
- package/dist/ui/src/components/molecules/Card/CardImage.d.ts +10 -0
- package/dist/ui/src/components/molecules/Card/CardImage.js +6 -0
- package/dist/ui/src/components/molecules/Card/CardImage.js.map +1 -0
- package/dist/ui/src/components/molecules/Card/index.d.ts +8 -0
- package/dist/ui/src/components/molecules/Card/index.js +5 -0
- package/dist/ui/src/components/molecules/Card/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Carousel/Arrows.d.ts +12 -0
- package/dist/ui/src/components/molecules/Carousel/Arrows.js +6 -0
- package/dist/ui/src/components/molecules/Carousel/Arrows.js.map +1 -0
- package/dist/ui/src/components/molecules/Carousel/Carousel.d.ts +54 -0
- package/dist/ui/src/components/molecules/Carousel/Carousel.js +183 -0
- package/dist/ui/src/components/molecules/Carousel/Carousel.js.map +1 -0
- package/dist/ui/src/components/molecules/Carousel/CarouselItem.d.ts +11 -0
- package/dist/ui/src/components/molecules/Carousel/CarouselItem.js +18 -0
- package/dist/ui/src/components/molecules/Carousel/CarouselItem.js.map +1 -0
- package/dist/ui/src/components/molecules/Carousel/hooks/useSlideVisibility.d.ts +9 -0
- package/dist/ui/src/components/molecules/Carousel/hooks/useSlideVisibility.js +29 -0
- package/dist/ui/src/components/molecules/Carousel/hooks/useSlideVisibility.js.map +1 -0
- package/dist/ui/src/components/molecules/Carousel/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/Carousel/index.js +3 -0
- package/dist/ui/src/components/molecules/Carousel/index.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItem.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItem.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItem.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemActions.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemActions.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemActions.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemContent.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemContent.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemContent.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemImage.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemImage.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemImage.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemPrices.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemPrices.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemPrices.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemSummary.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemSummary.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemSummary.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemTitle.d.ts +10 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemTitle.js +6 -0
- package/dist/ui/src/components/molecules/CartItem/CartItemTitle.js.map +1 -0
- package/dist/ui/src/components/molecules/CartItem/index.d.ts +14 -0
- package/dist/ui/src/components/molecules/CartItem/index.js +8 -0
- package/dist/ui/src/components/molecules/CartItem/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/Dropdown.d.ts +9 -0
- package/dist/ui/src/components/molecules/Dropdown/Dropdown.js +67 -0
- package/dist/ui/src/components/molecules/Dropdown/Dropdown.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownButton.d.ts +10 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownButton.js +11 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownButton.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownItem.d.ts +10 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownItem.js +26 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownItem.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownMenu.d.ts +22 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownMenu.js +65 -0
- package/dist/ui/src/components/molecules/Dropdown/DropdownMenu.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/contexts/DropdownContext.d.ts +41 -0
- package/dist/ui/src/components/molecules/Dropdown/contexts/DropdownContext.js +11 -0
- package/dist/ui/src/components/molecules/Dropdown/contexts/DropdownContext.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/hooks/useDropdown.d.ts +6 -0
- package/dist/ui/src/components/molecules/Dropdown/hooks/useDropdown.js +14 -0
- package/dist/ui/src/components/molecules/Dropdown/hooks/useDropdown.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/hooks/useDropdownPosition.d.ts +8 -0
- package/dist/ui/src/components/molecules/Dropdown/hooks/useDropdownPosition.js +25 -0
- package/dist/ui/src/components/molecules/Dropdown/hooks/useDropdownPosition.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/index.d.ts +8 -0
- package/dist/ui/src/components/molecules/Dropdown/index.js +5 -0
- package/dist/ui/src/components/molecules/Dropdown/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Dropdown/stories/assets/Caret.d.ts +2 -0
- package/dist/ui/src/components/molecules/Dropdown/stories/assets/Caret.js +4 -0
- package/dist/ui/src/components/molecules/Dropdown/stories/assets/Caret.js.map +1 -0
- package/dist/ui/src/components/molecules/Form/Form.d.ts +11 -0
- package/dist/ui/src/components/molecules/Form/Form.js +6 -0
- package/dist/ui/src/components/molecules/Form/Form.js.map +1 -0
- package/dist/ui/src/components/molecules/Form/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/Form/index.js +2 -0
- package/dist/ui/src/components/molecules/Form/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Gift/Gift.d.ts +15 -0
- package/dist/ui/src/components/molecules/Gift/Gift.js +9 -0
- package/dist/ui/src/components/molecules/Gift/Gift.js.map +1 -0
- package/dist/ui/src/components/molecules/Gift/GiftContent.d.ts +10 -0
- package/dist/ui/src/components/molecules/Gift/GiftContent.js +6 -0
- package/dist/ui/src/components/molecules/Gift/GiftContent.js.map +1 -0
- package/dist/ui/src/components/molecules/Gift/GiftImage.d.ts +10 -0
- package/dist/ui/src/components/molecules/Gift/GiftImage.js +6 -0
- package/dist/ui/src/components/molecules/Gift/GiftImage.js.map +1 -0
- package/dist/ui/src/components/molecules/Gift/index.d.ts +6 -0
- package/dist/ui/src/components/molecules/Gift/index.js +4 -0
- package/dist/ui/src/components/molecules/Gift/index.js.map +1 -0
- package/dist/ui/src/components/molecules/LoadingButton/LoadingButton.d.ts +14 -0
- package/dist/ui/src/components/molecules/LoadingButton/LoadingButton.js +8 -0
- package/dist/ui/src/components/molecules/LoadingButton/LoadingButton.js.map +1 -0
- package/dist/ui/src/components/molecules/LoadingButton/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/LoadingButton/index.js +2 -0
- package/dist/ui/src/components/molecules/LoadingButton/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Modal/Modal.d.ts +25 -0
- package/dist/ui/src/components/molecules/Modal/Modal.js +31 -0
- package/dist/ui/src/components/molecules/Modal/Modal.js.map +1 -0
- package/dist/ui/src/components/molecules/Modal/ModalContent.d.ts +10 -0
- package/dist/ui/src/components/molecules/Modal/ModalContent.js +23 -0
- package/dist/ui/src/components/molecules/Modal/ModalContent.js.map +1 -0
- package/dist/ui/src/components/molecules/Modal/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/Modal/index.js +2 -0
- package/dist/ui/src/components/molecules/Modal/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Modal/useTrapFocus.d.ts +8 -0
- package/dist/ui/src/components/molecules/Modal/useTrapFocus.js +76 -0
- package/dist/ui/src/components/molecules/Modal/useTrapFocus.js.map +1 -0
- package/dist/ui/src/components/molecules/OrderSummary/OrderSummary.d.ts +35 -0
- package/dist/ui/src/components/molecules/OrderSummary/OrderSummary.js +16 -0
- package/dist/ui/src/components/molecules/OrderSummary/OrderSummary.js.map +1 -0
- package/dist/ui/src/components/molecules/OrderSummary/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/OrderSummary/index.js +2 -0
- package/dist/ui/src/components/molecules/OrderSummary/index.js.map +1 -0
- package/dist/ui/src/components/molecules/PaymentMethods/PaymentMethods.d.ts +26 -0
- package/dist/ui/src/components/molecules/PaymentMethods/PaymentMethods.js +8 -0
- package/dist/ui/src/components/molecules/PaymentMethods/PaymentMethods.js.map +1 -0
- package/dist/ui/src/components/molecules/PaymentMethods/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/PaymentMethods/index.js +2 -0
- package/dist/ui/src/components/molecules/PaymentMethods/index.js.map +1 -0
- package/dist/ui/src/components/molecules/PaymentMethods/stories/assets/Icons.d.ts +9 -0
- package/dist/ui/src/components/molecules/PaymentMethods/stories/assets/Icons.js +26 -0
- package/dist/ui/src/components/molecules/PaymentMethods/stories/assets/Icons.js.map +1 -0
- package/dist/ui/src/components/molecules/PriceRange/PriceRange.d.ts +47 -0
- package/dist/ui/src/components/molecules/PriceRange/PriceRange.js +28 -0
- package/dist/ui/src/components/molecules/PriceRange/PriceRange.js.map +1 -0
- package/dist/ui/src/components/molecules/PriceRange/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/PriceRange/index.js +2 -0
- package/dist/ui/src/components/molecules/PriceRange/index.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCard.d.ts +11 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCard.js +6 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCard.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardActions.d.ts +10 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardActions.js +6 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardActions.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardContent.d.ts +10 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardContent.js +6 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardContent.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardImage.d.ts +10 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardImage.js +6 -0
- package/dist/ui/src/components/molecules/ProductCard/ProductCardImage.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductCard/index.d.ts +8 -0
- package/dist/ui/src/components/molecules/ProductCard/index.js +5 -0
- package/dist/ui/src/components/molecules/ProductCard/index.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductTitle/ProductTitle.d.ts +47 -0
- package/dist/ui/src/components/molecules/ProductTitle/ProductTitle.js +12 -0
- package/dist/ui/src/components/molecules/ProductTitle/ProductTitle.js.map +1 -0
- package/dist/ui/src/components/molecules/ProductTitle/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/ProductTitle/index.js +2 -0
- package/dist/ui/src/components/molecules/ProductTitle/index.js.map +1 -0
- package/dist/ui/src/components/molecules/QuantitySelector/QuantitySelector.d.ts +29 -0
- package/dist/ui/src/components/molecules/QuantitySelector/QuantitySelector.js +10 -0
- package/dist/ui/src/components/molecules/QuantitySelector/QuantitySelector.js.map +1 -0
- package/dist/ui/src/components/molecules/QuantitySelector/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/QuantitySelector/index.js +2 -0
- package/dist/ui/src/components/molecules/QuantitySelector/index.js.map +1 -0
- package/dist/ui/src/components/molecules/QuantitySelector/stories/assets/Icons.d.ts +7 -0
- package/dist/ui/src/components/molecules/QuantitySelector/stories/assets/Icons.js +11 -0
- package/dist/ui/src/components/molecules/QuantitySelector/stories/assets/Icons.js.map +1 -0
- package/dist/ui/src/components/molecules/RadioGroup/RadioGroup.d.ts +5 -0
- package/dist/ui/src/components/molecules/RadioGroup/RadioGroup.js +10 -0
- package/dist/ui/src/components/molecules/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/ui/src/components/molecules/RadioGroup/RadioOption.d.ts +19 -0
- package/dist/ui/src/components/molecules/RadioGroup/RadioOption.js +11 -0
- package/dist/ui/src/components/molecules/RadioGroup/RadioOption.js.map +1 -0
- package/dist/ui/src/components/molecules/RadioGroup/index.d.ts +4 -0
- package/dist/ui/src/components/molecules/RadioGroup/index.js +3 -0
- package/dist/ui/src/components/molecules/RadioGroup/index.js.map +1 -0
- package/dist/ui/src/components/molecules/RadioGroup/useRadioGroup.d.ts +17 -0
- package/dist/ui/src/components/molecules/RadioGroup/useRadioGroup.js +10 -0
- package/dist/ui/src/components/molecules/RadioGroup/useRadioGroup.js.map +1 -0
- package/dist/ui/src/components/molecules/SearchInput/SearchInput.d.ts +28 -0
- package/dist/ui/src/components/molecules/SearchInput/SearchInput.js +26 -0
- package/dist/ui/src/components/molecules/SearchInput/SearchInput.js.map +1 -0
- package/dist/ui/src/components/molecules/SearchInput/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/SearchInput/index.js +2 -0
- package/dist/ui/src/components/molecules/SearchInput/index.js.map +1 -0
- package/dist/ui/src/components/molecules/SearchInput/stories/assets/CustomIcon.d.ts +3 -0
- package/dist/ui/src/components/molecules/SearchInput/stories/assets/CustomIcon.js +7 -0
- package/dist/ui/src/components/molecules/SearchInput/stories/assets/CustomIcon.js.map +1 -0
- package/dist/ui/src/components/molecules/SkuSelector/SkuSelector.d.ts +58 -0
- package/dist/ui/src/components/molecules/SkuSelector/SkuSelector.js +16 -0
- package/dist/ui/src/components/molecules/SkuSelector/SkuSelector.js.map +1 -0
- package/dist/ui/src/components/molecules/SkuSelector/index.d.ts +2 -0
- package/dist/ui/src/components/molecules/SkuSelector/index.js +2 -0
- package/dist/ui/src/components/molecules/SkuSelector/index.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/Table.d.ts +11 -0
- package/dist/ui/src/components/molecules/Table/Table.js +6 -0
- package/dist/ui/src/components/molecules/Table/Table.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/TableBody.d.ts +11 -0
- package/dist/ui/src/components/molecules/Table/TableBody.js +6 -0
- package/dist/ui/src/components/molecules/Table/TableBody.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/TableCell.d.ts +20 -0
- package/dist/ui/src/components/molecules/Table/TableCell.js +7 -0
- package/dist/ui/src/components/molecules/Table/TableCell.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/TableFooter.d.ts +11 -0
- package/dist/ui/src/components/molecules/Table/TableFooter.js +6 -0
- package/dist/ui/src/components/molecules/Table/TableFooter.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/TableHead.d.ts +11 -0
- package/dist/ui/src/components/molecules/Table/TableHead.js +6 -0
- package/dist/ui/src/components/molecules/Table/TableHead.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/TableRow.d.ts +11 -0
- package/dist/ui/src/components/molecules/Table/TableRow.js +6 -0
- package/dist/ui/src/components/molecules/Table/TableRow.js.map +1 -0
- package/dist/ui/src/components/molecules/Table/index.d.ts +12 -0
- package/dist/ui/src/components/molecules/Table/index.js +7 -0
- package/dist/ui/src/components/molecules/Table/index.js.map +1 -0
- package/dist/ui/src/components/organisms/Hero/Hero.d.ts +11 -0
- package/dist/ui/src/components/organisms/Hero/Hero.js +6 -0
- package/dist/ui/src/components/organisms/Hero/Hero.js.map +1 -0
- package/dist/ui/src/components/organisms/Hero/HeroHeading.d.ts +10 -0
- package/dist/ui/src/components/organisms/Hero/HeroHeading.js +6 -0
- package/dist/ui/src/components/organisms/Hero/HeroHeading.js.map +1 -0
- package/dist/ui/src/components/organisms/Hero/HeroImage.d.ts +10 -0
- package/dist/ui/src/components/organisms/Hero/HeroImage.js +6 -0
- package/dist/ui/src/components/organisms/Hero/HeroImage.js.map +1 -0
- package/dist/ui/src/components/organisms/Hero/index.d.ts +6 -0
- package/dist/ui/src/components/organisms/Hero/index.js +4 -0
- package/dist/ui/src/components/organisms/Hero/index.js.map +1 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStock.d.ts +21 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStock.js +8 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStock.js.map +1 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStockMessage.d.ts +9 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStockMessage.js +5 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStockMessage.js.map +1 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStockTitle.d.ts +9 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStockTitle.js +5 -0
- package/dist/ui/src/components/organisms/OutOfStock/OutOfStockTitle.js.map +1 -0
- package/dist/ui/src/components/organisms/OutOfStock/index.d.ts +6 -0
- package/dist/ui/src/components/organisms/OutOfStock/index.js +4 -0
- package/dist/ui/src/components/organisms/OutOfStock/index.js.map +1 -0
- package/dist/ui/src/components/organisms/Tiles/Tile.d.ts +11 -0
- package/dist/ui/src/components/organisms/Tiles/Tile.js +6 -0
- package/dist/ui/src/components/organisms/Tiles/Tile.js.map +1 -0
- package/dist/ui/src/components/organisms/Tiles/Tiles.d.ts +11 -0
- package/dist/ui/src/components/organisms/Tiles/Tiles.js +30 -0
- package/dist/ui/src/components/organisms/Tiles/Tiles.js.map +1 -0
- package/dist/ui/src/components/organisms/Tiles/index.d.ts +4 -0
- package/dist/ui/src/components/organisms/Tiles/index.js +3 -0
- package/dist/ui/src/components/organisms/Tiles/index.js.map +1 -0
- package/dist/ui/src/hooks/useSlider/index.d.ts +2 -0
- package/dist/ui/src/hooks/useSlider/index.js +3 -0
- package/dist/ui/src/hooks/useSlider/index.js.map +1 -0
- package/dist/ui/src/hooks/useSlider/useSlider.d.ts +64 -0
- package/dist/ui/src/hooks/useSlider/useSlider.js +103 -0
- package/dist/ui/src/hooks/useSlider/useSlider.js.map +1 -0
- package/dist/ui/src/index.d.ts +75 -0
- package/dist/ui/src/index.js +43 -0
- package/dist/ui/src/index.js.map +1 -0
- package/dist/ui/src/typings/PolymorphicGenerics.d.ts +28 -0
- package/dist/ui/src/typings/PolymorphicGenerics.js +8 -0
- package/dist/ui/src/typings/PolymorphicGenerics.js.map +1 -0
- package/dist/ui/src/typings/index.d.ts +1 -0
- package/dist/ui/src/typings/index.js +2 -0
- package/dist/ui/src/typings/index.js.map +1 -0
- package/package.json +4 -5
- package/CHANGELOG.md +0 -2032
- package/LICENSE +0 -21
- package/dist/assets/ShoppingCart.d.ts +0 -3
- package/dist/assets/ShoppingCart.js +0 -10
- package/dist/assets/ShoppingCart.js.map +0 -1
- package/dist/assets/X.d.ts +0 -3
- package/dist/assets/X.js +0 -8
- package/dist/assets/X.js.map +0 -1
- package/dist/assets/index.d.ts +0 -2
- package/dist/assets/index.js +0 -3
- package/dist/assets/index.js.map +0 -1
- package/dist/components/atoms/Overlay/Overlay.js +0 -6
- package/dist/components/atoms/Overlay/Overlay.js.map +0 -1
- package/dist/components/atoms/Overlay/index.d.ts +0 -2
- package/dist/components/atoms/Overlay/index.js +0 -2
- package/dist/components/atoms/Overlay/index.js.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
2
|
+
import type { SwipeableProps } from 'react-swipeable';
|
|
3
|
+
export declare 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 declare type Action = NextPageAction | PreviousPageAction | StopSlideAction | GoToPageAction;
|
|
21
|
+
export declare 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 default function useSlider({ totalItems, itemsPerPage, infiniteMode, shouldSlideOnSwipe, ...swipeableConfigOverrides }: UseSliderArgs): {
|
|
59
|
+
handlers: import("react-swipeable").SwipeableHandlers;
|
|
60
|
+
slide: (page: number | SlideDirection, 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 default function 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/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;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,WAAW,CAAC,CAAC;YAChB,qEAAqE;YACrE,yEAAyE;YACzE,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ;gBACvC,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC;gBACtB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAA;YAEpB,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;YAErE,MAAM,aAA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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"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export * from '@faststore/components';
|
|
2
|
+
export { default as Link } from './components/atoms/Link';
|
|
3
|
+
export type { LinkProps } from './components/atoms/Link';
|
|
4
|
+
export { default as Popover } from './components/atoms/Popover';
|
|
5
|
+
export type { PopoverProps } from './components/atoms/Popover';
|
|
6
|
+
export { default as Price } from './components/atoms/Price';
|
|
7
|
+
export type { PriceProps } from './components/atoms/Price';
|
|
8
|
+
export { default as TextArea } from './components/atoms/TextArea';
|
|
9
|
+
export type { TextAreaProps } from './components/atoms/TextArea';
|
|
10
|
+
export { default as Select } from './components/atoms/Select';
|
|
11
|
+
export type { SelectProps } from './components/atoms/Select';
|
|
12
|
+
export { default as Slider } from './components/atoms/Slider';
|
|
13
|
+
export type { SliderProps } from './components/atoms/Slider';
|
|
14
|
+
export { default as Skeleton } from './components/atoms/Skeleton';
|
|
15
|
+
export type { SkeletonProps } from './components/atoms/Skeleton';
|
|
16
|
+
export { default as Spinner } from './components/atoms/Spinner';
|
|
17
|
+
export type { SpinnerProps } from './components/atoms/Spinner';
|
|
18
|
+
export { default as Incentive } from './components/atoms/Incentive';
|
|
19
|
+
export type { IncentiveProps } from './components/atoms/Incentive';
|
|
20
|
+
export { default as SkuSelector } from './components/molecules/SkuSelector';
|
|
21
|
+
export type { SkuSelectorProps } from './components/molecules/SkuSelector';
|
|
22
|
+
export { default as Gift, GiftContent, GiftImage, } from './components/molecules/Gift';
|
|
23
|
+
export type { GiftProps, GiftContentProps, GiftImageProps, } from './components/molecules/Gift';
|
|
24
|
+
export { default as ProductTitle } from './components/molecules/ProductTitle';
|
|
25
|
+
export type { ProductTitleProps } from './components/molecules/ProductTitle';
|
|
26
|
+
export { default as OrderSummary } from './components/molecules/OrderSummary';
|
|
27
|
+
export type { OrderSummaryProps } from './components/molecules/OrderSummary';
|
|
28
|
+
export { default as AggregateRating } from './components/molecules/AggregateRating';
|
|
29
|
+
export type { AggregateRatingProps } from './components/molecules/AggregateRating';
|
|
30
|
+
export { default as ProductCard, ProductCardImage, ProductCardContent, ProductCardActions, } from './components/molecules/ProductCard';
|
|
31
|
+
export type { ProductCardProps, ProductCardImageProps, ProductCardContentProps, ProductCardActionsProps, } from './components/molecules/ProductCard';
|
|
32
|
+
export { default as Card, CardImage, CardContent, CardActions, } from './components/molecules/Card';
|
|
33
|
+
export type { CardProps, CardImageProps, CardContentProps, CardActionsProps, } from './components/molecules/Card';
|
|
34
|
+
export { default as CartItem, CartItemActions, CartItemContent, CartItemImage, CartItemPrices, CartItemSummary, CartItemTitle, } from './components/molecules/CartItem';
|
|
35
|
+
export type { CartItemProps, CartItemActionsProps, CartItemContentProps, CartItemImageProps, CartItemPricesProps, CartItemSummaryProps, CartItemTitleProps, } from './components/molecules/CartItem';
|
|
36
|
+
export { default as Bullets } from './components/molecules/Bullets';
|
|
37
|
+
export type { BulletsProps } from './components/molecules/Bullets';
|
|
38
|
+
export { default as SearchInput } from './components/molecules/SearchInput';
|
|
39
|
+
export type { SearchInputProps, SearchInputRef, } from './components/molecules/SearchInput';
|
|
40
|
+
export { default as Carousel } from './components/molecules/Carousel';
|
|
41
|
+
export type { CarouselProps } from './components/molecules/Carousel';
|
|
42
|
+
export { default as Modal } from './components/molecules/Modal';
|
|
43
|
+
export type { ModalProps } from './components/molecules/Modal';
|
|
44
|
+
export { default as Banner, BannerContent, BannerImage, BannerLink, } from './components/molecules/Banner';
|
|
45
|
+
export type { BannerProps, BannerContentProps, BannerImageProps, BannerLinkProps, } from './components/molecules/Banner';
|
|
46
|
+
export { default as PaymentMethods } from './components/molecules/PaymentMethods';
|
|
47
|
+
export type { PaymentMethodsProps } from './components/molecules/PaymentMethods';
|
|
48
|
+
export { default as Breadcrumb } from './components/molecules/Breadcrumb';
|
|
49
|
+
export type { BreadcrumbProps } from './components/molecules/Breadcrumb';
|
|
50
|
+
export { default as LoadingButton } from './components/molecules/LoadingButton';
|
|
51
|
+
export type { LoadingButtonProps } from './components/molecules/LoadingButton';
|
|
52
|
+
export { default as PriceRange } from './components/molecules/PriceRange';
|
|
53
|
+
export type { PriceRangeProps } from './components/molecules/PriceRange';
|
|
54
|
+
export { default as RadioGroup, RadioOption, } from './components/molecules/RadioGroup';
|
|
55
|
+
export type { RadioGroupProps, RadioOptionProps, } from './components/molecules/RadioGroup';
|
|
56
|
+
export { default as Accordion, AccordionItem, AccordionButton, AccordionPanel, } from './components/molecules/Accordion';
|
|
57
|
+
export type { AccordionProps, AccordionItemProps, AccordionButtonProps, AccordionPanelProps, } from './components/molecules/Accordion';
|
|
58
|
+
export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './components/molecules/Table';
|
|
59
|
+
export type { TableProps, TableBodyProps, TableCellProps, TableFooterProps, TableHeadProps, TableRowProps, } from './components/molecules/Table';
|
|
60
|
+
export { default as Form } from './components/molecules/Form';
|
|
61
|
+
export type { FormProps } from './components/molecules/Form';
|
|
62
|
+
export { default as Alert } from './components/molecules/Alert';
|
|
63
|
+
export type { AlertProps } from './components/molecules/Alert';
|
|
64
|
+
export { default as QuantitySelector } from './components/molecules/QuantitySelector';
|
|
65
|
+
export type { QuantitySelectorProps } from './components/molecules/QuantitySelector';
|
|
66
|
+
export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './components/molecules/Dropdown';
|
|
67
|
+
export type { DropdownProps, DropdownButtonProps, DropdownItemProps, DropdownMenuProps, } from './components/molecules/Dropdown';
|
|
68
|
+
export { default as OutOfStock, OutOfStockTitle, OutOfStockMessage, } from './components/organisms/OutOfStock';
|
|
69
|
+
export type { OutOfStockProps, OutOfStockMessageProps, OutOfStockTitleProps, } from './components/organisms/OutOfStock';
|
|
70
|
+
export { Tiles, Tile } from './components/organisms/Tiles';
|
|
71
|
+
export type { TilesProps, TileProps } from './components/organisms/Tiles';
|
|
72
|
+
export { default as Hero, HeroHeading, HeroImage, } from './components/organisms/Hero';
|
|
73
|
+
export type { HeroProps, HeroHeadingProps, HeroImageProps, } from './components/organisms/Hero';
|
|
74
|
+
export { default as useSlider } from './hooks/useSlider';
|
|
75
|
+
export type { UseSliderArgs, SliderState, SliderDispatch, SlideDirection, } from './hooks/useSlider';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export * from '@faststore/components';
|
|
2
|
+
// Atoms
|
|
3
|
+
export { default as Link } from './components/atoms/Link';
|
|
4
|
+
export { default as Popover } from './components/atoms/Popover';
|
|
5
|
+
export { default as Price } from './components/atoms/Price';
|
|
6
|
+
export { default as TextArea } from './components/atoms/TextArea';
|
|
7
|
+
export { default as Select } from './components/atoms/Select';
|
|
8
|
+
export { default as Slider } from './components/atoms/Slider';
|
|
9
|
+
export { default as Skeleton } from './components/atoms/Skeleton';
|
|
10
|
+
export { default as Spinner } from './components/atoms/Spinner';
|
|
11
|
+
export { default as Incentive } from './components/atoms/Incentive';
|
|
12
|
+
// Molecules
|
|
13
|
+
export { default as SkuSelector } from './components/molecules/SkuSelector';
|
|
14
|
+
export { default as Gift, GiftContent, GiftImage, } from './components/molecules/Gift';
|
|
15
|
+
export { default as ProductTitle } from './components/molecules/ProductTitle';
|
|
16
|
+
export { default as OrderSummary } from './components/molecules/OrderSummary';
|
|
17
|
+
export { default as AggregateRating } from './components/molecules/AggregateRating';
|
|
18
|
+
export { default as ProductCard, ProductCardImage, ProductCardContent, ProductCardActions, } from './components/molecules/ProductCard';
|
|
19
|
+
export { default as Card, CardImage, CardContent, CardActions, } from './components/molecules/Card';
|
|
20
|
+
export { default as CartItem, CartItemActions, CartItemContent, CartItemImage, CartItemPrices, CartItemSummary, CartItemTitle, } from './components/molecules/CartItem';
|
|
21
|
+
export { default as Bullets } from './components/molecules/Bullets';
|
|
22
|
+
export { default as SearchInput } from './components/molecules/SearchInput';
|
|
23
|
+
export { default as Carousel } from './components/molecules/Carousel';
|
|
24
|
+
export { default as Modal } from './components/molecules/Modal';
|
|
25
|
+
export { default as Banner, BannerContent, BannerImage, BannerLink, } from './components/molecules/Banner';
|
|
26
|
+
export { default as PaymentMethods } from './components/molecules/PaymentMethods';
|
|
27
|
+
export { default as Breadcrumb } from './components/molecules/Breadcrumb';
|
|
28
|
+
export { default as LoadingButton } from './components/molecules/LoadingButton';
|
|
29
|
+
export { default as PriceRange } from './components/molecules/PriceRange';
|
|
30
|
+
export { default as RadioGroup, RadioOption, } from './components/molecules/RadioGroup';
|
|
31
|
+
export { default as Accordion, AccordionItem, AccordionButton, AccordionPanel, } from './components/molecules/Accordion';
|
|
32
|
+
export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './components/molecules/Table';
|
|
33
|
+
export { default as Form } from './components/molecules/Form';
|
|
34
|
+
export { default as Alert } from './components/molecules/Alert';
|
|
35
|
+
export { default as QuantitySelector } from './components/molecules/QuantitySelector';
|
|
36
|
+
export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './components/molecules/Dropdown';
|
|
37
|
+
// Organisms
|
|
38
|
+
export { default as OutOfStock, OutOfStockTitle, OutOfStockMessage, } from './components/organisms/OutOfStock';
|
|
39
|
+
export { Tiles, Tile } from './components/organisms/Tiles';
|
|
40
|
+
export { default as Hero, HeroHeading, HeroImage, } from './components/organisms/Hero';
|
|
41
|
+
// Hooks
|
|
42
|
+
export { default as use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AAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAGrF,OAAO,EACL,OAAO,IAAI,QAAQ,EACnB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,iCAAiC,CAAA;AAQxC,YAAY;AACZ,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,mCAAmC,CAAA;AAO1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAG1D,OAAO,EACL,OAAO,IAAI,IAAI,EACf,WAAW,EACX,SAAS,GACV,MAAM,6BAA6B,CAAA;AAOpC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These were heavily inspired by "Forwarding refs for a polymorphic React
|
|
3
|
+
* component in TypeScript", written by Ben Ilegbodu.
|
|
4
|
+
*
|
|
5
|
+
* Article link: https://www.benmvp.com/blog/forwarding-refs-polymorphic-react-component-typescript/
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType } from 'react';
|
|
8
|
+
declare type AsProp<C extends ElementType> = {
|
|
9
|
+
as?: C;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
|
|
13
|
+
* (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
|
|
14
|
+
* set of props.
|
|
15
|
+
*/
|
|
16
|
+
declare type ExtendableProps<ExtendedProps = Record<string, never>, OverrideProps = Record<string, never>> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
|
|
17
|
+
/**
|
|
18
|
+
* Allows for inheriting the props from the specified element type so that
|
|
19
|
+
* props like children, className & style work, as well as element-specific
|
|
20
|
+
* attributes like aria roles. The component (`C`) must be passed in.
|
|
21
|
+
*/
|
|
22
|
+
declare type InheritableElementProps<C extends ElementType, Props = Record<string, never>> = ExtendableProps<ComponentPropsWithoutRef<C>, Props>;
|
|
23
|
+
export declare type PolymorphicComponentProps<C extends ElementType, Props = Record<string, never>> = InheritableElementProps<C, Props & AsProp<C>>;
|
|
24
|
+
export declare type PolymorphicComponentPropsWithRef<C extends ElementType, P = Record<string, never>> = PolymorphicComponentProps<C, P> & {
|
|
25
|
+
ref?: ComponentPropsWithRef<C>['ref'];
|
|
26
|
+
};
|
|
27
|
+
export declare type PolymorphicRef<C extends ElementType> = PolymorphicComponentPropsWithRef<C>['ref'];
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These were heavily inspired by "Forwarding refs for a polymorphic React
|
|
3
|
+
* component in TypeScript", written by Ben Ilegbodu.
|
|
4
|
+
*
|
|
5
|
+
* Article link: https://www.benmvp.com/blog/forwarding-refs-polymorphic-react-component-typescript/
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=PolymorphicGenerics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolymorphicGenerics.js","sourceRoot":"","sources":["../../../../src/typings/PolymorphicGenerics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PolymorphicComponentProps, PolymorphicComponentPropsWithRef, PolymorphicRef, } from './PolymorphicGenerics';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/typings/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/ui",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.33",
|
|
4
4
|
"description": "A lightweight, framework agnostic component library for React",
|
|
5
5
|
"author": "emersonlaurentino",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"react-dom": "^17.0.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@faststore/shared": "^1.12.
|
|
61
|
-
"@faststore/styles": "^1.12.
|
|
60
|
+
"@faststore/shared": "^1.12.20",
|
|
61
|
+
"@faststore/styles": "^1.12.23",
|
|
62
62
|
"@size-limit/preset-small-lib": "^7.0.8",
|
|
63
63
|
"@storybook/addon-actions": "^6.4.4",
|
|
64
64
|
"@storybook/addon-docs": "^6.4.4",
|
|
@@ -84,6 +84,5 @@
|
|
|
84
84
|
"storybook-addon-themes": "^6.1.0",
|
|
85
85
|
"tsdx": "^0.14.1",
|
|
86
86
|
"typescript": "^4.2.4"
|
|
87
|
-
}
|
|
88
|
-
"gitHead": "9deb68d7b10560726e2f50841d319590a7249392"
|
|
87
|
+
}
|
|
89
88
|
}
|