@faststore/components 3.11.3 → 3.13.1
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/cjs/atoms/Button/index.d.ts +1 -1
- package/dist/cjs/atoms/Link/Link.d.ts +1 -1
- package/dist/cjs/atoms/Link/Link.js.map +1 -1
- package/dist/cjs/atoms/Loader/Loader.d.ts +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/molecules/Alert/Alert.d.ts +1 -1
- package/dist/cjs/molecules/Alert/Alert.js.map +1 -1
- package/dist/cjs/molecules/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/cjs/molecules/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/cjs/molecules/Breadcrumb/BreadcrumbBase.d.ts +2 -2
- package/dist/cjs/molecules/Breadcrumb/BreadcrumbBase.js.map +1 -1
- package/dist/cjs/molecules/Breadcrumb/Divider.d.ts +3 -3
- package/dist/cjs/molecules/Breadcrumb/Divider.js +1 -1
- package/dist/cjs/molecules/Breadcrumb/Divider.js.map +1 -1
- package/dist/cjs/molecules/Breadcrumb/ListItem.d.ts +2 -2
- package/dist/cjs/molecules/Breadcrumb/ListItem.js.map +1 -1
- package/dist/cjs/molecules/Card/Card.d.ts +11 -11
- package/dist/cjs/molecules/Card/Card.js.map +1 -1
- package/dist/cjs/molecules/Carousel/Carousel.js +2 -2
- package/dist/cjs/molecules/Carousel/Carousel.js.map +1 -1
- package/dist/cjs/molecules/Carousel/CarouselItem.d.ts +1 -1
- package/dist/cjs/molecules/Carousel/CarouselItem.js.map +1 -1
- package/dist/cjs/molecules/CartItem/CartItem.d.ts +5 -5
- package/dist/cjs/molecules/CheckboxField/CheckboxField.d.ts +1 -1
- package/dist/cjs/molecules/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/cjs/molecules/DiscountBadge/DiscountBadge.d.ts +1 -1
- package/dist/cjs/molecules/DiscountBadge/DiscountBadge.js.map +1 -1
- package/dist/cjs/molecules/Dropdown/DropdownButton.d.ts +2 -2
- package/dist/cjs/molecules/Dropdown/DropdownButton.js.map +1 -1
- package/dist/cjs/molecules/Dropdown/DropdownMenu.js +1 -1
- package/dist/cjs/molecules/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/cjs/molecules/Dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/cjs/molecules/Dropdown/hooks/useDropdownPosition.js +3 -3
- package/dist/cjs/molecules/Dropdown/hooks/useDropdownPosition.js.map +1 -1
- package/dist/cjs/molecules/Modal/Modal.d.ts +1 -1
- package/dist/cjs/molecules/Modal/Modal.js.map +1 -1
- package/dist/cjs/molecules/Modal/ModalBody.d.ts +1 -1
- package/dist/cjs/molecules/Modal/ModalBody.js.map +1 -1
- package/dist/cjs/molecules/Modal/ModalHeader.d.ts +2 -2
- package/dist/cjs/molecules/Modal/ModalHeader.js.map +1 -1
- package/dist/cjs/molecules/OrderSummary/OrderSummary.js +1 -1
- package/dist/cjs/molecules/OrderSummary/OrderSummary.js.map +1 -1
- package/dist/cjs/molecules/ProductCard/ProductCardContent.d.ts +1 -1
- package/dist/cjs/molecules/ProductCard/ProductCardImage.js +1 -1
- package/dist/cjs/molecules/ProductTitle/ProductTitle.d.ts +1 -1
- package/dist/cjs/molecules/ProductTitle/ProductTitle.js.map +1 -1
- package/dist/cjs/molecules/Rating/Rating.d.ts +1 -1
- package/dist/cjs/molecules/Rating/Rating.js.map +1 -1
- package/dist/cjs/molecules/SearchAutoComplete/SearchAutoComplete.d.ts +1 -1
- package/dist/cjs/molecules/SearchAutoComplete/SearchAutoComplete.js.map +1 -1
- package/dist/cjs/molecules/SearchAutoComplete/SearchAutoCompleteTerm.d.ts +2 -2
- package/dist/cjs/molecules/SearchAutoComplete/SearchAutoCompleteTerm.js.map +1 -1
- package/dist/cjs/molecules/SearchDropdown/SearchDropdown.js +1 -1
- package/dist/cjs/molecules/SearchDropdown/SearchDropdown.js.map +1 -1
- package/dist/cjs/molecules/SearchHistory/SearchHistory.d.ts +1 -1
- package/dist/cjs/molecules/SearchHistory/SearchHistory.js.map +1 -1
- package/dist/cjs/molecules/SearchHistory/SearchHistoryTerm.d.ts +2 -2
- package/dist/cjs/molecules/SearchHistory/SearchHistoryTerm.js.map +1 -1
- package/dist/cjs/molecules/SearchProducts/SearchProductItem.d.ts +1 -1
- package/dist/cjs/molecules/SearchProducts/SearchProductItem.js.map +1 -1
- package/dist/cjs/molecules/SearchProducts/SearchProducts.d.ts +1 -1
- package/dist/cjs/molecules/SearchProducts/SearchProducts.js +1 -1
- package/dist/cjs/molecules/SearchProducts/SearchProducts.js.map +1 -1
- package/dist/cjs/molecules/SearchTop/SearchTop.js.map +1 -1
- package/dist/cjs/molecules/SearchTop/SearchTopTerm.d.ts +1 -1
- package/dist/cjs/molecules/SearchTop/SearchTopTerm.js.map +1 -1
- package/dist/cjs/molecules/SkuSelector/useDefineVariant.d.ts +1 -1
- package/dist/cjs/molecules/SkuSelector/useDefineVariant.js.map +1 -1
- package/dist/cjs/molecules/SkuSelector/useSkuSlug.d.ts +1 -1
- package/dist/cjs/molecules/Tag/Tag.d.ts +1 -1
- package/dist/cjs/molecules/Tag/Tag.js.map +1 -1
- package/dist/cjs/organisms/CartSidebar/CartSidebar.d.ts +2 -2
- package/dist/cjs/organisms/CartSidebar/CartSidebarFooter.d.ts +1 -1
- package/dist/cjs/organisms/CartSidebar/CartSidebarFooter.js.map +1 -1
- package/dist/cjs/organisms/CartSidebar/CartSidebarList.d.ts +1 -1
- package/dist/cjs/organisms/CartSidebar/CartSidebarList.js.map +1 -1
- package/dist/cjs/organisms/Filter/Filter.d.ts +1 -1
- package/dist/cjs/organisms/Filter/Filter.js.map +1 -1
- package/dist/cjs/organisms/Filter/FilterFacetBoolean.d.ts +1 -1
- package/dist/cjs/organisms/Filter/FilterFacetBoolean.js.map +1 -1
- package/dist/cjs/organisms/Filter/FilterFacetBooleanItem.d.ts +1 -1
- package/dist/cjs/organisms/Filter/FilterFacetRange.d.ts +1 -1
- package/dist/cjs/organisms/Filter/FilterFacets.d.ts +1 -1
- package/dist/cjs/organisms/Filter/FilterFacets.js.map +1 -1
- package/dist/cjs/organisms/Filter/FilterSlider.d.ts +2 -2
- package/dist/cjs/organisms/PriceRange/PriceRange.js.map +1 -1
- package/dist/cjs/organisms/SKUMatrix/SKUMatrix.d.ts +1 -1
- package/dist/cjs/organisms/SKUMatrix/SKUMatrix.js.map +1 -1
- package/dist/cjs/organisms/SKUMatrix/SKUMatrixSidebar.d.ts +2 -2
- package/dist/cjs/organisms/SKUMatrix/SKUMatrixSidebar.js.map +1 -1
- package/dist/cjs/organisms/SKUMatrix/provider/SKUMatrixProvider.d.ts +1 -1
- package/dist/cjs/organisms/SKUMatrix/provider/SKUMatrixProvider.js.map +1 -1
- package/dist/cjs/organisms/SearchInput/SearchInput.d.ts +1 -1
- package/dist/cjs/organisms/SearchInput/SearchInput.js.map +1 -1
- package/dist/cjs/organisms/ShippingSimulation/ShippingSimulation.d.ts +1 -1
- package/dist/cjs/organisms/SlideOver/SlideOverHeader.d.ts +2 -2
- package/dist/cjs/organisms/SlideOver/SlideOverHeader.js.map +1 -1
- package/dist/cjs/organisms/SlideOver/index.d.ts +1 -1
- package/dist/cjs/organisms/SlideOver/index.js.map +1 -1
- package/dist/esm/atoms/Button/index.d.ts +1 -1
- package/dist/esm/atoms/Link/Link.d.ts +1 -1
- package/dist/esm/atoms/Link/Link.js.map +1 -1
- package/dist/esm/atoms/Loader/Loader.d.ts +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/molecules/Alert/Alert.d.ts +1 -1
- package/dist/esm/molecules/Alert/Alert.js.map +1 -1
- package/dist/esm/molecules/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/esm/molecules/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/molecules/Breadcrumb/BreadcrumbBase.d.ts +2 -2
- package/dist/esm/molecules/Breadcrumb/BreadcrumbBase.js.map +1 -1
- package/dist/esm/molecules/Breadcrumb/Divider.d.ts +3 -3
- package/dist/esm/molecules/Breadcrumb/Divider.js +2 -2
- package/dist/esm/molecules/Breadcrumb/Divider.js.map +1 -1
- package/dist/esm/molecules/Breadcrumb/ListItem.d.ts +2 -2
- package/dist/esm/molecules/Breadcrumb/ListItem.js.map +1 -1
- package/dist/esm/molecules/Card/Card.d.ts +11 -11
- package/dist/esm/molecules/Card/Card.js.map +1 -1
- package/dist/esm/molecules/Carousel/Carousel.js +2 -2
- package/dist/esm/molecules/Carousel/Carousel.js.map +1 -1
- package/dist/esm/molecules/Carousel/CarouselItem.d.ts +1 -1
- package/dist/esm/molecules/Carousel/CarouselItem.js.map +1 -1
- package/dist/esm/molecules/CartItem/CartItem.d.ts +5 -5
- package/dist/esm/molecules/CheckboxField/CheckboxField.d.ts +1 -1
- package/dist/esm/molecules/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/esm/molecules/DiscountBadge/DiscountBadge.d.ts +1 -1
- package/dist/esm/molecules/DiscountBadge/DiscountBadge.js.map +1 -1
- package/dist/esm/molecules/Dropdown/DropdownButton.d.ts +2 -2
- package/dist/esm/molecules/Dropdown/DropdownButton.js.map +1 -1
- package/dist/esm/molecules/Dropdown/DropdownMenu.js +1 -1
- package/dist/esm/molecules/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/esm/molecules/Dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/esm/molecules/Dropdown/hooks/useDropdownPosition.js +3 -3
- package/dist/esm/molecules/Dropdown/hooks/useDropdownPosition.js.map +1 -1
- package/dist/esm/molecules/Modal/Modal.d.ts +1 -1
- package/dist/esm/molecules/Modal/Modal.js.map +1 -1
- package/dist/esm/molecules/Modal/ModalBody.d.ts +1 -1
- package/dist/esm/molecules/Modal/ModalBody.js.map +1 -1
- package/dist/esm/molecules/Modal/ModalHeader.d.ts +2 -2
- package/dist/esm/molecules/Modal/ModalHeader.js.map +1 -1
- package/dist/esm/molecules/OrderSummary/OrderSummary.js +1 -1
- package/dist/esm/molecules/OrderSummary/OrderSummary.js.map +1 -1
- package/dist/esm/molecules/ProductCard/ProductCardContent.d.ts +1 -1
- package/dist/esm/molecules/ProductCard/ProductCardImage.js +1 -1
- package/dist/esm/molecules/ProductTitle/ProductTitle.d.ts +1 -1
- package/dist/esm/molecules/ProductTitle/ProductTitle.js.map +1 -1
- package/dist/esm/molecules/Rating/Rating.d.ts +1 -1
- package/dist/esm/molecules/Rating/Rating.js +1 -1
- package/dist/esm/molecules/Rating/Rating.js.map +1 -1
- package/dist/esm/molecules/SearchAutoComplete/SearchAutoComplete.d.ts +1 -1
- package/dist/esm/molecules/SearchAutoComplete/SearchAutoComplete.js.map +1 -1
- package/dist/esm/molecules/SearchAutoComplete/SearchAutoCompleteTerm.d.ts +2 -2
- package/dist/esm/molecules/SearchAutoComplete/SearchAutoCompleteTerm.js.map +1 -1
- package/dist/esm/molecules/SearchDropdown/SearchDropdown.js +1 -1
- package/dist/esm/molecules/SearchDropdown/SearchDropdown.js.map +1 -1
- package/dist/esm/molecules/SearchHistory/SearchHistory.d.ts +1 -1
- package/dist/esm/molecules/SearchHistory/SearchHistory.js.map +1 -1
- package/dist/esm/molecules/SearchHistory/SearchHistoryTerm.d.ts +2 -2
- package/dist/esm/molecules/SearchHistory/SearchHistoryTerm.js.map +1 -1
- package/dist/esm/molecules/SearchProducts/SearchProductItem.d.ts +1 -1
- package/dist/esm/molecules/SearchProducts/SearchProductItem.js.map +1 -1
- package/dist/esm/molecules/SearchProducts/SearchProducts.d.ts +1 -1
- package/dist/esm/molecules/SearchProducts/SearchProducts.js +1 -1
- package/dist/esm/molecules/SearchProducts/SearchProducts.js.map +1 -1
- package/dist/esm/molecules/SearchTop/SearchTop.js.map +1 -1
- package/dist/esm/molecules/SearchTop/SearchTopTerm.d.ts +1 -1
- package/dist/esm/molecules/SearchTop/SearchTopTerm.js.map +1 -1
- package/dist/esm/molecules/SkuSelector/useDefineVariant.d.ts +1 -1
- package/dist/esm/molecules/SkuSelector/useDefineVariant.js.map +1 -1
- package/dist/esm/molecules/SkuSelector/useSkuSlug.d.ts +1 -1
- package/dist/esm/molecules/Tag/Tag.d.ts +1 -1
- package/dist/esm/molecules/Tag/Tag.js.map +1 -1
- package/dist/esm/organisms/CartSidebar/CartSidebar.d.ts +2 -2
- package/dist/esm/organisms/CartSidebar/CartSidebarFooter.d.ts +1 -1
- package/dist/esm/organisms/CartSidebar/CartSidebarFooter.js.map +1 -1
- package/dist/esm/organisms/CartSidebar/CartSidebarList.d.ts +1 -1
- package/dist/esm/organisms/CartSidebar/CartSidebarList.js.map +1 -1
- package/dist/esm/organisms/Filter/Filter.d.ts +1 -1
- package/dist/esm/organisms/Filter/Filter.js.map +1 -1
- package/dist/esm/organisms/Filter/FilterFacetBoolean.d.ts +1 -1
- package/dist/esm/organisms/Filter/FilterFacetBoolean.js.map +1 -1
- package/dist/esm/organisms/Filter/FilterFacetBooleanItem.d.ts +1 -1
- package/dist/esm/organisms/Filter/FilterFacetRange.d.ts +1 -1
- package/dist/esm/organisms/Filter/FilterFacets.d.ts +1 -1
- package/dist/esm/organisms/Filter/FilterFacets.js.map +1 -1
- package/dist/esm/organisms/Filter/FilterSlider.d.ts +2 -2
- package/dist/esm/organisms/PriceRange/PriceRange.js.map +1 -1
- package/dist/esm/organisms/SKUMatrix/SKUMatrix.d.ts +1 -1
- package/dist/esm/organisms/SKUMatrix/SKUMatrix.js.map +1 -1
- package/dist/esm/organisms/SKUMatrix/SKUMatrixSidebar.d.ts +2 -2
- package/dist/esm/organisms/SKUMatrix/SKUMatrixSidebar.js.map +1 -1
- package/dist/esm/organisms/SKUMatrix/provider/SKUMatrixProvider.d.ts +1 -1
- package/dist/esm/organisms/SKUMatrix/provider/SKUMatrixProvider.js +1 -1
- package/dist/esm/organisms/SKUMatrix/provider/SKUMatrixProvider.js.map +1 -1
- package/dist/esm/organisms/SearchInput/SearchInput.d.ts +1 -1
- package/dist/esm/organisms/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/organisms/ShippingSimulation/ShippingSimulation.d.ts +1 -1
- package/dist/esm/organisms/SlideOver/SlideOverHeader.d.ts +2 -2
- package/dist/esm/organisms/SlideOver/SlideOverHeader.js.map +1 -1
- package/dist/esm/organisms/SlideOver/index.d.ts +1 -1
- package/dist/esm/organisms/SlideOver/index.js +1 -1
- package/dist/esm/organisms/SlideOver/index.js.map +1 -1
- package/package.json +2 -2
- package/src/atoms/Button/index.ts +6 -1
- package/src/atoms/Link/Link.tsx +4 -1
- package/src/atoms/Loader/Loader.tsx +2 -2
- package/src/index.ts +3 -7
- package/src/molecules/Alert/Alert.tsx +1 -1
- package/src/molecules/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/molecules/Breadcrumb/BreadcrumbBase.tsx +5 -5
- package/src/molecules/Breadcrumb/Divider.tsx +17 -14
- package/src/molecules/Breadcrumb/ListItem.tsx +2 -2
- package/src/molecules/Card/Card.tsx +39 -28
- package/src/molecules/Carousel/Carousel.tsx +2 -2
- package/src/molecules/Carousel/CarouselItem.tsx +5 -4
- package/src/molecules/CartItem/CartItem.tsx +6 -6
- package/src/molecules/CheckboxField/CheckboxField.tsx +1 -1
- package/src/molecules/DiscountBadge/DiscountBadge.tsx +3 -3
- package/src/molecules/Dropdown/DropdownButton.tsx +5 -2
- package/src/molecules/Dropdown/DropdownMenu.tsx +13 -13
- package/src/molecules/Dropdown/hooks/useDropdown.ts +6 -2
- package/src/molecules/Dropdown/hooks/useDropdownPosition.ts +10 -5
- package/src/molecules/Modal/Modal.tsx +1 -1
- package/src/molecules/Modal/ModalBody.tsx +1 -1
- package/src/molecules/Modal/ModalHeader.tsx +2 -2
- package/src/molecules/OrderSummary/OrderSummary.tsx +2 -2
- package/src/molecules/ProductCard/ProductCardContent.tsx +2 -2
- package/src/molecules/ProductCard/ProductCardImage.tsx +1 -1
- package/src/molecules/ProductTitle/ProductTitle.tsx +1 -1
- package/src/molecules/Rating/Rating.tsx +6 -1
- package/src/molecules/SearchAutoComplete/SearchAutoComplete.tsx +1 -2
- package/src/molecules/SearchAutoComplete/SearchAutoCompleteTerm.tsx +2 -2
- package/src/molecules/SearchDropdown/SearchDropdown.tsx +5 -7
- package/src/molecules/SearchHistory/SearchHistory.tsx +1 -2
- package/src/molecules/SearchHistory/SearchHistoryTerm.tsx +2 -2
- package/src/molecules/SearchInputField/SearchInputField.tsx +1 -1
- package/src/molecules/SearchProducts/SearchProductItem.tsx +1 -1
- package/src/molecules/SearchProducts/SearchProducts.tsx +2 -2
- package/src/molecules/SearchProvider/index.ts +1 -1
- package/src/molecules/SearchTop/SearchTop.tsx +5 -11
- package/src/molecules/SearchTop/SearchTopTerm.tsx +1 -1
- package/src/molecules/SkuSelector/useDefineVariant.ts +9 -6
- package/src/molecules/SkuSelector/useSkuSlug.ts +1 -1
- package/src/molecules/Tag/Tag.tsx +1 -1
- package/src/organisms/CartSidebar/CartSidebar.tsx +2 -2
- package/src/organisms/CartSidebar/CartSidebarFooter.tsx +1 -1
- package/src/organisms/CartSidebar/CartSidebarList.tsx +1 -1
- package/src/organisms/Filter/Filter.tsx +1 -1
- package/src/organisms/Filter/FilterFacetBoolean.tsx +1 -1
- package/src/organisms/Filter/FilterFacetBooleanItem.tsx +1 -1
- package/src/organisms/Filter/FilterFacetRange.tsx +1 -1
- package/src/organisms/Filter/FilterFacets.tsx +1 -1
- package/src/organisms/Filter/FilterSlider.tsx +3 -3
- package/src/organisms/Filter/index.ts +0 -1
- package/src/organisms/PriceRange/PriceRange.tsx +2 -1
- package/src/organisms/SKUMatrix/SKUMatrix.tsx +1 -1
- package/src/organisms/SKUMatrix/SKUMatrixSidebar.tsx +2 -2
- package/src/organisms/SKUMatrix/provider/SKUMatrixProvider.tsx +10 -7
- package/src/organisms/SearchInput/SearchInput.tsx +10 -8
- package/src/organisms/ShippingSimulation/ShippingSimulation.tsx +2 -2
- package/src/organisms/SlideOver/SlideOverHeader.tsx +2 -2
- package/src/organisms/SlideOver/index.ts +5 -3
- package/src/typings/PolymorphicGenerics.ts +4 -4
|
@@ -4,7 +4,7 @@ import React, { forwardRef } from 'react'
|
|
|
4
4
|
import {
|
|
5
5
|
Icon,
|
|
6
6
|
IconButton,
|
|
7
|
-
IconButtonProps,
|
|
7
|
+
type IconButtonProps,
|
|
8
8
|
ProductPrice,
|
|
9
9
|
QuantitySelector,
|
|
10
10
|
} from '../../'
|
|
@@ -25,14 +25,14 @@ export interface CartItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
*/
|
|
26
26
|
quantity?: number
|
|
27
27
|
/**
|
|
28
|
-
* Controls by how many units the value advances
|
|
28
|
+
* Controls by how many units the value advances
|
|
29
29
|
**/
|
|
30
30
|
unitMultiplier?: number
|
|
31
|
-
|
|
32
|
-
* Controls wheter you use or not the unitMultiplier
|
|
33
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Controls wheter you use or not the unitMultiplier
|
|
33
|
+
*/
|
|
34
34
|
useUnitMultiplier?: boolean
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
36
|
* Specifies that this product is unavailable.
|
|
37
37
|
*/
|
|
38
38
|
unavailable?: boolean
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
|
-
import Checkbox, { CheckboxProps } from '../../atoms/Checkbox'
|
|
2
|
+
import Checkbox, { type CheckboxProps } from '../../atoms/Checkbox'
|
|
3
3
|
import Label from '../../atoms/Label'
|
|
4
4
|
|
|
5
5
|
export interface CheckboxFieldProps extends CheckboxProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Badge, BadgeProps } from '../..'
|
|
2
|
+
import { Badge, type BadgeProps } from '../..'
|
|
3
3
|
|
|
4
4
|
import { useDiscountPercent } from '../DiscountBadge/useDiscountPercent'
|
|
5
5
|
|
|
@@ -45,8 +45,8 @@ const DiscountBadge = ({
|
|
|
45
45
|
discountPercent <= thresholdLow
|
|
46
46
|
? 'low'
|
|
47
47
|
: discountPercent <= thresholdHigh
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
? 'medium'
|
|
49
|
+
: 'high'
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<Badge
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import React, { cloneElement, forwardRef, ReactNode } from 'react'
|
|
2
|
-
import Button, {
|
|
1
|
+
import React, { cloneElement, forwardRef, type ReactNode } from 'react'
|
|
2
|
+
import Button, {
|
|
3
|
+
type ButtonProps,
|
|
4
|
+
type ButtonIconPosition,
|
|
5
|
+
} from '../../atoms/Button'
|
|
3
6
|
import { useDropdownTrigger } from './hooks/useDropdownTrigger'
|
|
4
7
|
|
|
5
8
|
export interface DropdownButtonProps
|
|
@@ -62,7 +62,8 @@ const DropdownMenu = ({
|
|
|
62
62
|
id,
|
|
63
63
|
} = useDropdown()
|
|
64
64
|
|
|
65
|
-
const { loading: loadingPosition, ...dropdownPosition } =
|
|
65
|
+
const { loading: loadingPosition, ...dropdownPosition } =
|
|
66
|
+
useDropdownPosition(align)
|
|
66
67
|
|
|
67
68
|
const childrenLength = React.Children.toArray(children).length
|
|
68
69
|
|
|
@@ -102,24 +103,23 @@ const DropdownMenu = ({
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
const handleKeyNavigatePress = (key: string) => {
|
|
105
|
-
const dropdownItems = dropdownItemsRef?.current ?? []
|
|
106
|
-
const selectedIndex = selectedDropdownItemIndexRef!.current
|
|
107
|
-
|
|
106
|
+
const dropdownItems = dropdownItemsRef?.current ?? []
|
|
107
|
+
const selectedIndex = selectedDropdownItemIndexRef!.current
|
|
108
|
+
|
|
108
109
|
const rearrangedDropdownItems = [
|
|
109
110
|
...dropdownItems.slice(selectedIndex + 1),
|
|
110
111
|
...dropdownItems.slice(0, selectedIndex + 1),
|
|
111
|
-
]
|
|
112
|
-
|
|
112
|
+
]
|
|
113
|
+
|
|
113
114
|
const matchItem = rearrangedDropdownItems.find(
|
|
114
115
|
(item) => item.textContent?.[0]?.toLowerCase() === key.toLowerCase()
|
|
115
|
-
)
|
|
116
|
-
|
|
116
|
+
)
|
|
117
|
+
|
|
117
118
|
if (matchItem) {
|
|
118
|
-
selectedDropdownItemIndexRef!.current = dropdownItems.indexOf(matchItem)
|
|
119
|
-
matchItem.focus()
|
|
119
|
+
selectedDropdownItemIndexRef!.current = dropdownItems.indexOf(matchItem)
|
|
120
|
+
matchItem.focus()
|
|
120
121
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
122
|
+
}
|
|
123
123
|
|
|
124
124
|
const handleBackdropKeyDown = (event: KeyboardEvent) => {
|
|
125
125
|
if (event.defaultPrevented || event.key === 'Enter' || event.key === ' ') {
|
|
@@ -158,7 +158,7 @@ const DropdownMenu = ({
|
|
|
158
158
|
return null
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
return
|
|
161
|
+
return isOpen && !loadingPosition
|
|
162
162
|
? createPortal(
|
|
163
163
|
<div
|
|
164
164
|
role="presentation"
|
|
@@ -7,8 +7,12 @@ import DropdownContext from '../contexts/DropdownContext'
|
|
|
7
7
|
* Hook to use the Dropdown context.
|
|
8
8
|
* @returns Dropdown context.
|
|
9
9
|
*/
|
|
10
|
-
export const useDropdown = <
|
|
11
|
-
|
|
10
|
+
export const useDropdown = <
|
|
11
|
+
T extends HTMLElement = HTMLElement,
|
|
12
|
+
E extends HTMLElement = HTMLElement,
|
|
13
|
+
>() => {
|
|
14
|
+
const context =
|
|
15
|
+
useContext<DropdownContextState<HTMLElement, HTMLElement>>(DropdownContext)
|
|
12
16
|
|
|
13
17
|
if (context === undefined) {
|
|
14
18
|
throw new Error('Do not use useDropdown hook outside the Dropdown context.')
|
|
@@ -3,13 +3,18 @@ import { useDropdown } from './useDropdown'
|
|
|
3
3
|
|
|
4
4
|
type DropdownPosition = {
|
|
5
5
|
loading: boolean
|
|
6
|
-
} & Pick<
|
|
6
|
+
} & Pick<
|
|
7
|
+
React.CSSProperties,
|
|
8
|
+
'position' | 'top' | 'left' | 'right' | 'transform'
|
|
9
|
+
>
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* Hook used to find the DropdownMenu position in relation to DropdownButton
|
|
10
13
|
* @returns Style with positions.
|
|
11
14
|
*/
|
|
12
|
-
export const useDropdownPosition = (
|
|
15
|
+
export const useDropdownPosition = (
|
|
16
|
+
align: 'left' | 'center' | 'right' = 'left'
|
|
17
|
+
): DropdownPosition => {
|
|
13
18
|
const { dropdownTriggerRef, isOpen } = useDropdown()
|
|
14
19
|
|
|
15
20
|
const [positionProps, setPositionProps] = useState({
|
|
@@ -17,7 +22,7 @@ export const useDropdownPosition = (align: 'left' | 'center' | 'right' = 'left')
|
|
|
17
22
|
left: 0 as React.CSSProperties['left'],
|
|
18
23
|
right: 'auto',
|
|
19
24
|
transform: 'none',
|
|
20
|
-
loading: true
|
|
25
|
+
loading: true,
|
|
21
26
|
})
|
|
22
27
|
|
|
23
28
|
useEffect(() => {
|
|
@@ -47,7 +52,7 @@ export const useDropdownPosition = (align: 'left' | 'center' | 'right' = 'left')
|
|
|
47
52
|
rightPosition = `${document.documentElement.clientWidth - leftLevel - buttonWidth}px`
|
|
48
53
|
leftPosition = 'auto'
|
|
49
54
|
} else if (align === 'center') {
|
|
50
|
-
leftPosition = leftLevel +
|
|
55
|
+
leftPosition = leftLevel + buttonWidth / 2 + scrollLeft
|
|
51
56
|
transform = 'translateX(-50%)'
|
|
52
57
|
}
|
|
53
58
|
|
|
@@ -56,7 +61,7 @@ export const useDropdownPosition = (align: 'left' | 'center' | 'right' = 'left')
|
|
|
56
61
|
left: leftPosition,
|
|
57
62
|
right: rightPosition,
|
|
58
63
|
transform,
|
|
59
|
-
loading: false
|
|
64
|
+
loading: false,
|
|
60
65
|
})
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
import React from 'react'
|
|
8
8
|
import { createPortal } from 'react-dom'
|
|
9
9
|
|
|
10
|
-
import { Overlay, OverlayProps } from '../..'
|
|
10
|
+
import { Overlay, type OverlayProps } from '../..'
|
|
11
11
|
import { useFadeEffect, useUI } from '../../hooks'
|
|
12
12
|
import type { ModalContentProps } from './ModalContent'
|
|
13
13
|
import ModalContent from './ModalContent'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react'
|
|
1
|
+
import React, { type HTMLAttributes } from 'react'
|
|
2
2
|
import Icon from '../../atoms/Icon'
|
|
3
|
-
import IconButton, { IconButtonProps } from '../IconButton'
|
|
3
|
+
import IconButton, { type IconButtonProps } from '../IconButton'
|
|
4
4
|
|
|
5
5
|
export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
/**
|
|
@@ -54,7 +54,7 @@ const OrderSummary = forwardRef<HTMLUListElement, OrderSummaryProps>(
|
|
|
54
54
|
totalLabel = 'Total',
|
|
55
55
|
totalValue,
|
|
56
56
|
includeTaxes = false,
|
|
57
|
-
includeTaxesLabel =
|
|
57
|
+
includeTaxesLabel = 'Tax included',
|
|
58
58
|
...otherProps
|
|
59
59
|
},
|
|
60
60
|
ref
|
|
@@ -116,7 +116,7 @@ const OrderSummary = forwardRef<HTMLUListElement, OrderSummaryProps>(
|
|
|
116
116
|
<li data-fs-order-summary-taxes-label>
|
|
117
117
|
<Label>{includeTaxesLabel}</Label>
|
|
118
118
|
</li>
|
|
119
|
-
|
|
119
|
+
)}
|
|
120
120
|
</List>
|
|
121
121
|
)
|
|
122
122
|
}
|
|
@@ -29,7 +29,7 @@ const ProductCardImage = forwardRef<HTMLDivElement, ProductCardImageProps>(
|
|
|
29
29
|
data-testid={testId}
|
|
30
30
|
style={
|
|
31
31
|
{
|
|
32
|
-
'--fs-product-card-image-aspect-ratio': aspectRatio
|
|
32
|
+
'--fs-product-card-image-aspect-ratio': aspectRatio,
|
|
33
33
|
} as React.CSSProperties
|
|
34
34
|
}
|
|
35
35
|
{...otherProps}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
forwardRef,
|
|
3
|
+
type HTMLAttributes,
|
|
4
|
+
type ReactNode,
|
|
5
|
+
useState,
|
|
6
|
+
} from 'react'
|
|
2
7
|
|
|
3
8
|
import { Icon, IconButton } from '../..'
|
|
4
9
|
import List from '../../atoms/List'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react'
|
|
1
|
+
import React, { type HTMLAttributes } from 'react'
|
|
2
2
|
import { List, useSearch } from '../..'
|
|
3
3
|
|
|
4
4
|
export interface SearchAutoCompleteProps
|
|
@@ -14,7 +14,6 @@ const SearchAutoComplete = ({
|
|
|
14
14
|
children,
|
|
15
15
|
...otherProps
|
|
16
16
|
}: SearchAutoCompleteProps) => {
|
|
17
|
-
|
|
18
17
|
const { inContext, values } = useSearch()
|
|
19
18
|
|
|
20
19
|
if (inContext && (values.terms.length <= 0 || values.term.length <= 0)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react'
|
|
2
|
-
import React, { Fragment, HTMLAttributes } from 'react'
|
|
3
|
-
import { Icon, Link, LinkElementType, LinkProps } from '../..'
|
|
2
|
+
import React, { Fragment, type HTMLAttributes } from 'react'
|
|
3
|
+
import { Icon, Link, type LinkElementType, type LinkProps } from '../..'
|
|
4
4
|
|
|
5
5
|
function formatSearchTerm(
|
|
6
6
|
indexSubstring: number,
|
|
@@ -16,7 +16,9 @@ const SearchLoading = () => {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
|
-
{
|
|
19
|
+
{inContext && values.isLoading && (
|
|
20
|
+
<p data-fs-search-dropdown-loading-text>Loading...</p>
|
|
21
|
+
)}
|
|
20
22
|
</>
|
|
21
23
|
)
|
|
22
24
|
}
|
|
@@ -25,17 +27,13 @@ const SearchDropdown = forwardRef<
|
|
|
25
27
|
HTMLDivElement,
|
|
26
28
|
PropsWithChildren<SearchDropdownProps>
|
|
27
29
|
>(function SearchDropdown(
|
|
28
|
-
{
|
|
29
|
-
testId = 'fs-search-dropdown',
|
|
30
|
-
children,
|
|
31
|
-
...otherProps
|
|
32
|
-
},
|
|
30
|
+
{ testId = 'fs-search-dropdown', children, ...otherProps },
|
|
33
31
|
ref
|
|
34
32
|
) {
|
|
35
33
|
return (
|
|
36
34
|
<div ref={ref} data-fs-search-dropdown data-testid={testId} {...otherProps}>
|
|
37
35
|
<section>
|
|
38
|
-
<SearchLoading/>
|
|
36
|
+
<SearchLoading />
|
|
39
37
|
{children}
|
|
40
38
|
</section>
|
|
41
39
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react'
|
|
1
|
+
import React, { type HTMLAttributes } from 'react'
|
|
2
2
|
import { List, Button, useSearch } from '../..'
|
|
3
3
|
|
|
4
4
|
export interface SearchHistoryProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -28,7 +28,6 @@ const SearchHistory = ({
|
|
|
28
28
|
children,
|
|
29
29
|
...otherProps
|
|
30
30
|
}: SearchHistoryProps) => {
|
|
31
|
-
|
|
32
31
|
const { inContext, values } = useSearch()
|
|
33
32
|
|
|
34
33
|
if (inContext && (values.term.length !== 0 || values.isLoading)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react'
|
|
2
|
-
import React, { HTMLAttributes } from 'react'
|
|
3
|
-
import { Icon, Link, LinkElementType, LinkProps } from '../..'
|
|
2
|
+
import React, { type HTMLAttributes } from 'react'
|
|
3
|
+
import { Icon, Link, type LinkElementType, type LinkProps } from '../..'
|
|
4
4
|
|
|
5
5
|
export interface SearchHistoryTermProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import { Link, LinkElementType, LinkProps } from '../..'
|
|
4
|
+
import { Link, type LinkElementType, type LinkProps } from '../..'
|
|
5
5
|
|
|
6
6
|
export interface SearchProductItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react'
|
|
1
|
+
import React, { type HTMLAttributes } from 'react'
|
|
2
2
|
import { List, useSearch } from '../..'
|
|
3
3
|
|
|
4
4
|
export interface SearchProductsProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -20,7 +20,7 @@ const SearchProductsProps = ({
|
|
|
20
20
|
}: SearchProductsProps) => {
|
|
21
21
|
const { inContext, values } = useSearch()
|
|
22
22
|
|
|
23
|
-
if (inContext &&
|
|
23
|
+
if (inContext && values.products.length <= 0) {
|
|
24
24
|
return null
|
|
25
25
|
}
|
|
26
26
|
return (
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './SearchProvider'
|
|
2
|
-
export type { SearchProviderContextValue } from './SearchProvider'
|
|
2
|
+
export type { SearchProviderContextValue } from './SearchProvider'
|
|
@@ -16,15 +16,9 @@ export interface SearchTopProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const SearchTop = forwardRef<HTMLDivElement, SearchTopProps>(function SearchTop(
|
|
19
|
-
{
|
|
20
|
-
testId = 'fs-top-search',
|
|
21
|
-
title = 'Top Search',
|
|
22
|
-
children,
|
|
23
|
-
...otherProps
|
|
24
|
-
},
|
|
19
|
+
{ testId = 'fs-top-search', title = 'Top Search', children, ...otherProps },
|
|
25
20
|
ref
|
|
26
21
|
) {
|
|
27
|
-
|
|
28
22
|
const { inContext, values } = useSearch()
|
|
29
23
|
|
|
30
24
|
if (inContext && (values.term.length !== 0 || values.isLoading)) {
|
|
@@ -33,10 +27,10 @@ const SearchTop = forwardRef<HTMLDivElement, SearchTopProps>(function SearchTop(
|
|
|
33
27
|
|
|
34
28
|
return (
|
|
35
29
|
<section ref={ref} data-testid={testId} data-fs-search-top {...otherProps}>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
<header data-fs-search-top-header>
|
|
31
|
+
<p data-fs-search-top-title>{title}</p>
|
|
32
|
+
</header>
|
|
33
|
+
<List as="ol">{children}</List>
|
|
40
34
|
</section>
|
|
41
35
|
)
|
|
42
36
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import { Badge, Link, LinkElementType, LinkProps } from '../../'
|
|
4
|
+
import { Badge, Link, type LinkElementType, type LinkProps } from '../../'
|
|
5
5
|
|
|
6
6
|
export interface SearchTopTermProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react'
|
|
2
|
-
import { SkuOption } from './SkuSelector'
|
|
2
|
+
import type { SkuOption } from './SkuSelector'
|
|
3
3
|
|
|
4
4
|
export type Variant = 'image' | 'color' | 'label'
|
|
5
5
|
|
|
@@ -10,12 +10,15 @@ const getImageName = (src: string) => {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* This hook infers what kind of SKU Selector will be displayed on the UI.
|
|
13
|
+
* This hook infers what kind of SKU Selector will be displayed on the UI.
|
|
14
14
|
* There are three different options, color, image, and label (default version).
|
|
15
15
|
*/
|
|
16
|
-
export const useDefineVariant = (
|
|
16
|
+
export const useDefineVariant = (
|
|
17
|
+
options: SkuOption[],
|
|
18
|
+
variant?: Variant
|
|
19
|
+
): Variant =>
|
|
17
20
|
useMemo(() => {
|
|
18
|
-
if(variant) return variant
|
|
21
|
+
if (variant) return variant
|
|
19
22
|
|
|
20
23
|
const allOptionsHaveHexColor = options.every((option) => option.hexColor)
|
|
21
24
|
if (allOptionsHaveHexColor) {
|
|
@@ -24,9 +27,9 @@ export const useDefineVariant = (options: SkuOption[], variant?: Variant): Varia
|
|
|
24
27
|
|
|
25
28
|
const firstImageName = options[0]?.src && getImageName(options[0].src)
|
|
26
29
|
|
|
27
|
-
/*
|
|
30
|
+
/*
|
|
28
31
|
* If there's only one option (options.length === 1) and there is an image
|
|
29
|
-
* the correct return value is 'image'.
|
|
32
|
+
* the correct return value is 'image'.
|
|
30
33
|
* */
|
|
31
34
|
if (firstImageName && options.length === 1) {
|
|
32
35
|
return 'image'
|
|
@@ -4,14 +4,14 @@ import React from 'react'
|
|
|
4
4
|
import {
|
|
5
5
|
Alert,
|
|
6
6
|
Badge,
|
|
7
|
-
OverlayProps,
|
|
7
|
+
type OverlayProps,
|
|
8
8
|
SlideOver,
|
|
9
9
|
SlideOverHeader,
|
|
10
10
|
useFadeEffect,
|
|
11
11
|
useUI,
|
|
12
12
|
} from '../../'
|
|
13
13
|
|
|
14
|
-
import { SlideOverDirection, SlideOverWidthSize } from '../SlideOver'
|
|
14
|
+
import type { SlideOverDirection, SlideOverWidthSize } from '../SlideOver'
|
|
15
15
|
|
|
16
16
|
export interface CartSidebarProps extends HTMLAttributes<HTMLDivElement> {
|
|
17
17
|
/**
|
|
@@ -3,15 +3,15 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
Button,
|
|
6
|
-
ButtonProps,
|
|
7
|
-
OverlayProps,
|
|
6
|
+
type ButtonProps,
|
|
7
|
+
type OverlayProps,
|
|
8
8
|
SlideOver,
|
|
9
9
|
SlideOverHeader,
|
|
10
10
|
useFadeEffect,
|
|
11
11
|
useUI,
|
|
12
12
|
} from '../../'
|
|
13
13
|
|
|
14
|
-
import { SlideOverDirection, SlideOverWidthSize } from '../SlideOver'
|
|
14
|
+
import type { SlideOverDirection, SlideOverWidthSize } from '../SlideOver'
|
|
15
15
|
|
|
16
16
|
export interface FilterSliderProps extends HTMLAttributes<HTMLDivElement> {
|
|
17
17
|
/**
|
|
@@ -4,7 +4,8 @@ import type { AriaAttributes } from 'react'
|
|
|
4
4
|
import { Price, Slider, InputField } from '../../'
|
|
5
5
|
import type { PriceProps, SliderProps } from '../../'
|
|
6
6
|
|
|
7
|
-
export interface PriceRangeProps
|
|
7
|
+
export interface PriceRangeProps
|
|
8
|
+
extends Omit<SliderProps, 'absoluteValuesLabel'> {
|
|
8
9
|
/**
|
|
9
10
|
* The current use case variant for prices.
|
|
10
11
|
*/
|
|
@@ -3,7 +3,7 @@ import type { FunctionComponent } from 'react'
|
|
|
3
3
|
import React, { useMemo } from 'react'
|
|
4
4
|
import { Badge, Button, QuantitySelector, Skeleton } from '../..'
|
|
5
5
|
import Icon from '../../atoms/Icon'
|
|
6
|
-
import Price, { PriceFormatter } from '../../atoms/Price'
|
|
6
|
+
import Price, { type PriceFormatter } from '../../atoms/Price'
|
|
7
7
|
import { useFadeEffect, useSKUMatrix, useUI } from '../../hooks'
|
|
8
8
|
import {
|
|
9
9
|
Table,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TableHead,
|
|
13
13
|
TableRow,
|
|
14
14
|
} from '../../molecules/Table'
|
|
15
|
-
import SlideOver, { SlideOverHeader, SlideOverProps } from '../SlideOver'
|
|
15
|
+
import SlideOver, { SlideOverHeader, type SlideOverProps } from '../SlideOver'
|
|
16
16
|
interface VariationProductColumn {
|
|
17
17
|
name: string
|
|
18
18
|
additionalColumns: Array<{ label: string; value: string }>
|