@faststore/components 2.0.104-alpha.0 → 2.0.108-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/molecules/Modal/ModalHeader.d.ts +3 -0
  5. package/dist/molecules/Modal/ModalHeader.js +1 -1
  6. package/dist/molecules/Modal/ModalHeader.js.map +1 -1
  7. package/dist/molecules/ProductTitle/ProductTitle.d.ts +8 -8
  8. package/dist/organisms/CartSidebar/CartSidebar.d.ts +1 -2
  9. package/dist/organisms/CartSidebar/CartSidebar.js.map +1 -1
  10. package/dist/organisms/EmptyState/EmptyState.d.ts +27 -0
  11. package/dist/organisms/EmptyState/EmptyState.js +10 -0
  12. package/dist/organisms/EmptyState/EmptyState.js.map +1 -0
  13. package/dist/organisms/EmptyState/index.d.ts +2 -0
  14. package/dist/organisms/EmptyState/index.js +2 -0
  15. package/dist/organisms/EmptyState/index.js.map +1 -0
  16. package/dist/organisms/RegionModal/RegionModal.d.ts +60 -0
  17. package/dist/organisms/RegionModal/RegionModal.js +21 -0
  18. package/dist/organisms/RegionModal/RegionModal.js.map +1 -0
  19. package/dist/organisms/RegionModal/index.d.ts +2 -0
  20. package/dist/organisms/RegionModal/index.js +2 -0
  21. package/dist/organisms/RegionModal/index.js.map +1 -0
  22. package/dist/organisms/ShippingSimulation/ShippingSimulation.d.ts +3 -3
  23. package/dist/organisms/ShippingSimulation/ShippingSimulation.js +6 -7
  24. package/dist/organisms/ShippingSimulation/ShippingSimulation.js.map +1 -1
  25. package/package.json +2 -2
  26. package/src/index.ts +6 -0
  27. package/src/molecules/Modal/ModalHeader.tsx +5 -5
  28. package/src/molecules/ProductTitle/ProductTitle.tsx +4 -4
  29. package/src/organisms/CartSidebar/CartSidebar.tsx +2 -2
  30. package/src/organisms/EmptyState/EmptyState.tsx +58 -0
  31. package/src/organisms/EmptyState/index.ts +2 -0
  32. package/src/organisms/RegionModal/RegionModal.tsx +125 -0
  33. package/src/organisms/RegionModal/index.ts +2 -0
  34. package/src/organisms/ShippingSimulation/ShippingSimulation.tsx +26 -21
package/dist/index.d.ts CHANGED
@@ -99,6 +99,8 @@ export { default as QuantitySelector } from './molecules/QuantitySelector';
99
99
  export type { QuantitySelectorProps } from './molecules/QuantitySelector';
100
100
  export { default as CartSidebar, CartSidebarList, CartSidebarFooter, } from './organisms/CartSidebar';
101
101
  export type { CartSidebarProps } from './organisms/CartSidebar';
102
+ export { default as EmptyState } from './organisms/EmptyState';
103
+ export type { EmptyStateProps } from './organisms/EmptyState';
102
104
  export { default as Filter, FilterFacetBoolean, FilterFacetBooleanItem, FilterFacetRange, FilterFacets, FilterSlider, } from './organisms/Filter';
103
105
  export type { FilterFacetBooleanItemProps, FilterFacetRangeProps, FilterFacetsProps, FilterProps, FilterSliderProps, } from './organisms/Filter';
104
106
  export { default as Hero, HeroImage, HeroHeader } from './organisms/Hero';
@@ -111,6 +113,8 @@ export { default as PaymentMethods } from './organisms/PaymentMethods';
111
113
  export type { PaymentMethodsProps } from './organisms/PaymentMethods';
112
114
  export { default as PriceRange } from './organisms/PriceRange';
113
115
  export type { PriceRangeProps } from './organisms/PriceRange';
116
+ export { default as RegionModal } from './organisms/RegionModal';
117
+ export type { RegionModalProps } from './organisms/RegionModal';
114
118
  export { default as SearchInput } from './organisms/SearchInput';
115
119
  export type { SearchInputProps } from './organisms/SearchInput';
116
120
  export { default as ShippingSimulation } from './organisms/ShippingSimulation';
package/dist/index.js CHANGED
@@ -55,12 +55,14 @@ export { default as ToggleField } from './molecules/ToggleField';
55
55
  export { default as QuantitySelector } from './molecules/QuantitySelector';
56
56
  // Organisms
57
57
  export { default as CartSidebar, CartSidebarList, CartSidebarFooter, } from './organisms/CartSidebar';
58
+ export { default as EmptyState } from './organisms/EmptyState';
58
59
  export { default as Filter, FilterFacetBoolean, FilterFacetBooleanItem, FilterFacetRange, FilterFacets, FilterSlider, } from './organisms/Filter';
59
60
  export { default as Hero, HeroImage, HeroHeader } from './organisms/Hero';
60
61
  export { default as ImageGallery, ImageGallerySelector, ImageZoom, } from './organisms/ImageGallery';
61
62
  export { default as OutOfStock } from './organisms/OutOfStock';
62
63
  export { default as PaymentMethods } from './organisms/PaymentMethods';
63
64
  export { default as PriceRange } from './organisms/PriceRange';
65
+ export { default as RegionModal } from './organisms/RegionModal';
64
66
  export { default as SearchInput } from './organisms/SearchInput';
65
67
  export { default as ShippingSimulation } from './organisms/ShippingSimulation';
66
68
  export { default as SlideOver, SlideOverHeader } from './organisms/SlideOver';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,SAAS,CAAA;AAEvB,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OA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AAyB,CAAA;AAGhC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAOzE,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,oBAAoB,EACpB,SAAS,GACV,MAAM,0BAA0B,CAAA;AAQjC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAG9E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
@@ -13,6 +13,9 @@ export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
13
13
  * Props for the Close Button component.
14
14
  */
15
15
  closeBtnProps?: Partial<Omit<IconButtonProps, 'onClick'>>;
16
+ /**
17
+ * Function called when dismiss button is clicked.
18
+ */
16
19
  onClose?: () => void;
17
20
  }
18
21
  declare const ModalHeader: ({ onClose, title, closeBtnProps, description, }: ModalHeaderProps) => JSX.Element;
@@ -3,7 +3,7 @@ import Icon from '../../atoms/Icon';
3
3
  import IconButton from '../IconButton';
4
4
  const ModalHeader = ({ onClose, title, closeBtnProps = {}, description, }) => {
5
5
  return (React.createElement("header", { "data-fs-modal-header": true },
6
- onClose && (React.createElement(IconButton, { onClick: () => onClose?.(), "data-fs-modal-header-close-button": true, icon: React.createElement(Icon, { name: "X" }), "aria-label": "Close modal", ...closeBtnProps })),
6
+ onClose && (React.createElement(IconButton, { "data-fs-modal-header-close-button": true, "aria-label": "Close modal", icon: React.createElement(Icon, { name: "X" }), onClick: () => onClose?.(), ...closeBtnProps })),
7
7
  React.createElement("p", { "data-fs-modal-header-title": true }, title),
8
8
  description && React.createElement("p", { "data-fs-modal-header-description": true }, description)));
9
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ModalHeader.js","sourceRoot":"","sources":["../../../src/molecules/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,UAA+B,MAAM,eAAe,CAAA;AAqB3D,MAAM,WAAW,GAAG,CAAC,EACnB,OAAO,EACP,KAAK,EACL,aAAa,GAAG,EAAE,EAClB,WAAW,GACM,EAAE,EAAE;IACrB,OAAO,CACL;QACG,OAAO,IAAI,CACV,oBAAC,UAAU,IACT,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,6CAE1B,IAAI,EAAE,oBAAC,IAAI,IAAC,IAAI,EAAC,GAAG,GAAG,gBACZ,aAAa,KACpB,aAAa,GACjB,CACH;QACD,iEAA+B,KAAK,CAAK;QACxC,WAAW,IAAI,uEAAqC,WAAW,CAAK,CAC9D,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"ModalHeader.js","sourceRoot":"","sources":["../../../src/molecules/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,UAA+B,MAAM,eAAe,CAAA;AAqB3D,MAAM,WAAW,GAAG,CAAC,EACnB,OAAO,EACP,KAAK,EACL,aAAa,GAAG,EAAE,EAClB,WAAW,GACM,EAAE,EAAE;IACrB,OAAO,CACL;QACG,OAAO,IAAI,CACV,oBAAC,UAAU,6DAEE,aAAa,EACxB,IAAI,EAAE,oBAAC,IAAI,IAAC,IAAI,EAAC,GAAG,GAAG,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,KACtB,aAAa,GACjB,CACH;QACD,iEAA+B,KAAK,CAAK;QACxC,WAAW,IAAI,uEAAqC,WAAW,CAAK,CAC9D,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -2,6 +2,10 @@ import React, { HTMLAttributes } from 'react';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { RatingProps } from '../../';
4
4
  export type ProductTitleProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
5
+ /**
6
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
7
+ */
8
+ testId?: string;
5
9
  /**
6
10
  * A react component to be used as the product title, e.g. a `h1`
7
11
  */
@@ -18,16 +22,16 @@ export type ProductTitleProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
18
22
  * A text to be used below the title and the label, such as the product's reference number.
19
23
  */
20
24
  refNumber?: string;
21
- /**
22
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
23
- */
24
- testId?: string;
25
25
  /**
26
26
  * The current value of the rating, a number from 0 to 5.
27
27
  */
28
28
  ratingValue?: number;
29
29
  } & Omit<RatingProps, 'testId' | 'onChange' | 'value' | 'title'>;
30
30
  declare const ProductTitle: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
31
+ /**
32
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
33
+ */
34
+ testId?: string | undefined;
31
35
  /**
32
36
  * A react component to be used as the product title, e.g. a `h1`
33
37
  */
@@ -44,10 +48,6 @@ declare const ProductTitle: React.ForwardRefExoticComponent<Omit<React.HTMLAttri
44
48
  * A text to be used below the title and the label, such as the product's reference number.
45
49
  */
46
50
  refNumber?: string | undefined;
47
- /**
48
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
49
- */
50
- testId?: string | undefined;
51
51
  /**
52
52
  * The current value of the rating, a number from 0 to 5.
53
53
  */
@@ -1,5 +1,4 @@
1
- import { PropsWithChildren } from 'react';
2
- import type { ReactNode } from 'react';
1
+ import type { PropsWithChildren, ReactNode } from 'react';
3
2
  import { SlideOverDirection, SlideOverWidthSize } from '../SlideOver';
4
3
  export interface CartSidebarProps {
5
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CartSidebar.js","sourceRoot":"","sources":["../../../src/organisms/CartSidebar/CartSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAGhD,OAAO,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,KAAK,GACN,MAAM,QAAQ,CAAA;AAwCf,SAAS,WAAW,CAAC,EACnB,MAAM,GAAG,iBAAiB,EAC1B,KAAK,GAAG,WAAW,EACnB,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,WAAW,EACvB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,GAC6B;IACpC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAA;IACzC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,CAAA;IAE7B,OAAO,CACL,oBAAC,SAAS,kCAER,MAAM,QACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,KAAK,IAAI,SAAS,EAAE,EACpD,MAAM,EAAE,MAAM;QAEd,oBAAC,eAAe,IACd,aAAa,EAAE,EAAE,MAAM,EAAE,8BAA8B,EAAE,EACzD,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAA;gBACT,OAAO,EAAE,CAAA;YACX,CAAC;YAED;gBACG,KAAK;gBACN,oBAAC,KAAK,IAAC,OAAO,EAAC,MAAM,IAAE,UAAU,CAAS,CACvC,CACW;QAEjB,SAAS,IAAI,oBAAC,KAAK,IAAC,IAAI,EAAE,SAAS,IAAG,SAAS,CAAS;QACxD,QAAQ,CACC,CACb,CAAA;AACH,CAAC;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"CartSidebar.js","sourceRoot":"","sources":["../../../src/organisms/CartSidebar/CartSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,KAAK,GACN,MAAM,QAAQ,CAAA;AAwCf,SAAS,WAAW,CAAC,EACnB,MAAM,GAAG,iBAAiB,EAC1B,KAAK,GAAG,WAAW,EACnB,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,WAAW,EACvB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,GAC6B;IACpC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAA;IACzC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,CAAA;IAE7B,OAAO,CACL,oBAAC,SAAS,kCAER,MAAM,QACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,KAAK,IAAI,SAAS,EAAE,EACpD,MAAM,EAAE,MAAM;QAEd,oBAAC,eAAe,IACd,aAAa,EAAE,EAAE,MAAM,EAAE,8BAA8B,EAAE,EACzD,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAA;gBACT,OAAO,EAAE,CAAA;YACX,CAAC;YAED;gBACG,KAAK;gBACN,oBAAC,KAAK,IAAC,OAAO,EAAC,MAAM,IAAE,UAAU,CAAS,CACvC,CACW;QAEjB,SAAS,IAAI,oBAAC,KAAK,IAAC,IAAI,EAAE,SAAS,IAAG,SAAS,CAAS;QACxD,QAAQ,CACC,CACb,CAAA;AACH,CAAC;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,27 @@
1
+ import type { PropsWithChildren, ReactNode } from 'react';
2
+ type Variant = 'default' | 'rounded';
3
+ type BackgroundColor = 'default' | 'light';
4
+ export interface EmptyStateProps {
5
+ /**
6
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * The EmptyState component's title.
11
+ */
12
+ title?: string;
13
+ /**
14
+ * A React component that will be rendered as an icon on the Title.
15
+ */
16
+ titleIcon?: ReactNode;
17
+ /**
18
+ * Specifies the component border variant.
19
+ */
20
+ variant?: Variant;
21
+ /**
22
+ * Specifies the component background color.
23
+ */
24
+ bkgColor?: BackgroundColor;
25
+ }
26
+ declare function EmptyState({ testId, title, titleIcon, variant, bkgColor, children, ...otherProps }: PropsWithChildren<EmptyStateProps>): JSX.Element;
27
+ export default EmptyState;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ function EmptyState({ testId = 'fs-empty-state', title, titleIcon, variant = 'default', bkgColor = 'default', children, ...otherProps }) {
3
+ return (React.createElement("section", { "data-fs-empty-state": true, "data-fs-empty-state-variant": variant, "data-fs-empty-state-bkg-color": bkgColor, "data-testid": testId, ...otherProps },
4
+ title && (React.createElement("header", { "data-fs-empty-state-title": true },
5
+ titleIcon && React.createElement(React.Fragment, null, titleIcon),
6
+ React.createElement("p", null, title))),
7
+ children));
8
+ }
9
+ export default EmptyState;
10
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../src/organisms/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AA6BzB,SAAS,UAAU,CAAC,EAClB,MAAM,GAAG,gBAAgB,EACzB,KAAK,EACL,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,QAAQ,GAAG,SAAS,EACpB,QAAQ,EACR,GAAG,UAAU,EACsB;IACnC,OAAO,CACL,6FAE+B,OAAO,mCACL,QAAQ,iBAC1B,MAAM,KACf,UAAU;QAEb,KAAK,IAAI,CACR;YACG,SAAS,IAAI,0CAAG,SAAS,CAAI;YAC9B,+BAAI,KAAK,CAAK,CACP,CACV;QACA,QAAQ,CACD,CACX,CAAA;AACH,CAAC;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default } from './EmptyState';
2
+ export type { EmptyStateProps } from './EmptyState';
@@ -0,0 +1,2 @@
1
+ export { default } from './EmptyState';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/organisms/EmptyState/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import type { MutableRefObject } from 'react';
3
+ import type { ModalProps, LinkProps, LinkElementType } from '../../';
4
+ export interface RegionModalProps extends Omit<ModalProps, 'children'> {
5
+ /**
6
+ * ID to find this component in testing tools (e.g.: cypress,
7
+ * testing-library, and jest).
8
+ */
9
+ testId?: string;
10
+ /**
11
+ * The region modal's title.
12
+ */
13
+ title?: string;
14
+ /**
15
+ * Description for region modal.
16
+ */
17
+ description?: string;
18
+ /**
19
+ * Props for the link `I don't know my Postal Code`.
20
+ */
21
+ idkPostalCodeLinkProps?: Partial<LinkProps<LinkElementType>>;
22
+ /**
23
+ * Props for the `I don't know my Postal Code` link on modal body content.
24
+ */
25
+ linkText?: Partial<LinkProps<LinkElementType>>;
26
+ /**
27
+ * Message of error for input.
28
+ */
29
+ errorMessage?: string;
30
+ /**
31
+ * Postal code input's ref.
32
+ */
33
+ inputRef?: MutableRefObject<HTMLInputElement | null>;
34
+ /**
35
+ * Postal code input's value.
36
+ */
37
+ inputValue?: string;
38
+ /**
39
+ * Enables fadeOut effect on modal after onSubmit function
40
+ */
41
+ fadeOutOnSubmit?: boolean;
42
+ /**
43
+ * Function called when Close button is clicked.
44
+ */
45
+ onClose?: () => void;
46
+ /**
47
+ * Callback function when input is typed.
48
+ */
49
+ onInput?: (event: React.FormEvent<HTMLInputElement>) => void;
50
+ /**
51
+ * Callback function when form is submitted.
52
+ */
53
+ onSubmit?: () => void;
54
+ /**
55
+ * Callback function when the input clear button is clicked.
56
+ */
57
+ onClear?: () => void;
58
+ }
59
+ declare function RegionModal({ testId, title, description, idkPostalCodeLinkProps, errorMessage, inputRef, inputValue, fadeOutOnSubmit, onClose, onInput, onSubmit, onClear, ...otherProps }: RegionModalProps): JSX.Element;
60
+ export default RegionModal;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Icon, InputField, Link, Modal, ModalHeader, ModalBody } from '../..';
3
+ function RegionModal({ testId = 'fs-region-modal', title = 'Set your location', description = 'Prices, offers and availability may vary according to your location.', idkPostalCodeLinkProps, errorMessage, inputRef, inputValue, fadeOutOnSubmit, onClose, onInput, onSubmit, onClear, ...otherProps }) {
4
+ return (React.createElement(Modal, { "data-fs-region-modal": true, testId: testId, ...otherProps }, ({ fadeOut }) => (React.createElement(React.Fragment, null,
5
+ React.createElement(ModalHeader, { onClose: () => {
6
+ fadeOut();
7
+ onClose?.();
8
+ }, title: title, description: description, closeBtnProps: {
9
+ 'aria-label': 'Close Region Modal',
10
+ } }),
11
+ React.createElement(ModalBody, null,
12
+ React.createElement(InputField, { "data-fs-region-modal-input": true, id: `${testId}-input-field`, inputRef: inputRef, label: "Postal Code", actionable: true, value: inputValue, onInput: (event) => onInput?.(event), onSubmit: () => {
13
+ onSubmit?.();
14
+ fadeOutOnSubmit ? fadeOut() : null;
15
+ }, onClear: () => onClear?.(), error: errorMessage }),
16
+ React.createElement(Link, { "data-fs-region-modal-link": true, ...idkPostalCodeLinkProps }, idkPostalCodeLinkProps?.children ?? (React.createElement(React.Fragment, null,
17
+ "I don't know my Postal Code",
18
+ React.createElement(Icon, { name: "ArrowSquareOut", width: 20, height: 20 })))))))));
19
+ }
20
+ export default RegionModal;
21
+ //# sourceMappingURL=RegionModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegionModal.js","sourceRoot":"","sources":["../../../src/organisms/RegionModal/RegionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AA0D7E,SAAS,WAAW,CAAC,EACnB,MAAM,GAAG,iBAAiB,EAC1B,KAAK,GAAG,mBAAmB,EAC3B,WAAW,GAAG,sEAAsE,EACpF,sBAAsB,EACtB,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,GAAG,UAAU,EACI;IACjB,OAAO,CACL,oBAAC,KAAK,kCAAsB,MAAM,EAAE,MAAM,KAAM,UAAU,IACvD,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChB;QACE,oBAAC,WAAW,IACV,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAA;gBACT,OAAO,EAAE,EAAE,CAAA;YACb,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE;gBACb,YAAY,EAAE,oBAAoB;aACnC,GACD;QACF,oBAAC,SAAS;YACR,oBAAC,UAAU,wCAET,EAAE,EAAE,GAAG,MAAM,cAAc,EAC3B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAC,aAAa,EACnB,UAAU,QACV,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,EACpC,QAAQ,EAAE,GAAG,EAAE;oBACb,QAAQ,EAAE,EAAE,CAAA;oBACZ,eAAe,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;gBACpC,CAAC,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,EAC1B,KAAK,EAAE,YAAY,GACnB;YAEF,oBAAC,IAAI,0CAA+B,sBAAsB,IACvD,sBAAsB,EAAE,QAAQ,IAAI,CACnC;gBACG,6BAA6B;gBAC9B,oBAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,CACpD,CACJ,CACI,CACG,CACX,CACJ,CACK,CACT,CAAA;AACH,CAAC;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default } from './RegionModal';
2
+ export type { RegionModalProps } from './RegionModal';
@@ -0,0 +1,2 @@
1
+ export { default } from './RegionModal';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/organisms/RegionModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -39,7 +39,7 @@ export interface ShippingSimulationProps extends HTMLAttributes<HTMLDivElement>
39
39
  */
40
40
  optionsLabel?: string;
41
41
  /**
42
- * Props for the link for i don't know my postal code.
42
+ * Props for the link `I don't know my Postal Code`.
43
43
  */
44
44
  idkPostalCodeLinkProps?: Partial<LinkProps<LinkElementType>>;
45
45
  /**
@@ -51,7 +51,7 @@ export interface ShippingSimulationProps extends HTMLAttributes<HTMLDivElement>
51
51
  */
52
52
  onSubmit?: () => void;
53
53
  /**
54
- * Callback function when the clear button is clicked.
54
+ * Callback function when the input clear button is clicked.
55
55
  */
56
56
  onClear?: () => void;
57
57
  /**
@@ -67,7 +67,7 @@ export interface ShippingSimulationProps extends HTMLAttributes<HTMLDivElement>
67
67
  */
68
68
  displayClearButton?: boolean;
69
69
  /**
70
- * Message of error.
70
+ * Message of error for input.
71
71
  */
72
72
  errorMessage?: string;
73
73
  /**
@@ -1,14 +1,13 @@
1
1
  import React from 'react';
2
- import { Icon, InputField, Link, Price, Table, TableBody, TableCell, TableRow } from '../..';
3
- function ShippingSimulation({ testId = 'fs-shipping-simulation', formatter, title = "Shipping", inputLabel = "Postal Code", optionsLabel = "Shipping options", idkPostalCodeLinkProps, onInput, onSubmit, onClear, location, options = [], displayClearButton = false, errorMessage, postalCode, ...otherProps }) {
2
+ import { Icon, InputField, Link, Price, Table, TableBody, TableCell, TableRow, } from '../..';
3
+ function ShippingSimulation({ testId = 'fs-shipping-simulation', formatter, title = 'Shipping', inputLabel = 'Postal Code', optionsLabel = 'Shipping options', idkPostalCodeLinkProps, onInput, onSubmit, onClear, location, options = [], displayClearButton = false, errorMessage, postalCode, ...otherProps }) {
4
4
  const hasShippingOptions = !!options && options.length > 0;
5
- return (React.createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? "true" : "false", "data-testid": testId, ...otherProps },
5
+ return (React.createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
6
6
  React.createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
7
7
  React.createElement(InputField, { actionable: true, error: errorMessage, id: `${testId}-input-field`, label: inputLabel, value: postalCode, onInput: (event) => onInput?.(event), onSubmit: () => onSubmit?.(), onClear: () => onClear?.(), displayClearButton: displayClearButton }),
8
- React.createElement(Link, { href: "/", "data-fs-shipping-simulation-link": true, size: "small", ...idkPostalCodeLinkProps }, idkPostalCodeLinkProps?.children ??
9
- React.createElement(React.Fragment, null,
10
- "I don't know my Postal Code",
11
- React.createElement(Icon, { name: "ArrowSquareOut", width: 20, height: 20 }))),
8
+ React.createElement(Link, { href: "/", "data-fs-shipping-simulation-link": true, size: "small", ...idkPostalCodeLinkProps }, idkPostalCodeLinkProps?.children ?? (React.createElement(React.Fragment, null,
9
+ "I don't know my Postal Code",
10
+ React.createElement(Icon, { name: "ArrowSquareOut", width: 20, height: 20 })))),
12
11
  hasShippingOptions && (React.createElement(React.Fragment, null,
13
12
  React.createElement("header", { "data-fs-shipping-simulation-header": true },
14
13
  React.createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
@@ -1 +1 @@
1
- {"version":3,"file":"ShippingSimulation.js","sourceRoot":"","sources":["../../../src/organisms/ShippingSimulation/ShippingSimulation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EACL,IAAI,EAAE,UAAU,EAAE,IAAI,EAA8B,KAAK,EAAE,KAAK,EAChE,SAAS,EACT,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAA;AA8Ed,SAAS,kBAAkB,CAAC,EAC1B,MAAM,GAAG,wBAAwB,EACjC,SAAS,EACT,KAAK,GAAG,UAAU,EAClB,UAAU,GAAI,aAAa,EAC3B,YAAY,GAAG,kBAAkB,EACjC,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,GAAG,EAAE,EACZ,kBAAkB,GAAG,KAAK,EAC1B,YAAY,EACZ,UAAU,EACV,GAAG,UAAU,EACW;IAExB,MAAM,kBAAkB,GAAG,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAA;IAE1D,OAAO,CACL,2GAEqC,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,iBAC5D,MAAM,KACf,UAAU;QAEd,yEACG,KAAK,CACH;QAEL,oBAAC,UAAU,IACT,UAAU,QACV,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,GAAG,MA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ACG,6BAA6B;YAC9B,oBAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,CACpD,CACJ,CACI;QAEN,kBAAkB,IAAI,CACrB;YACE;gBACE,4EAA0C,YAAY,CAAM;gBAC5D,2EAAyC,QAAQ,CAAK,CAC/C;YAET,oBAAC,KAAK;gBACJ,oBAAC,SAAS,QACP,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,CAAC,OAAO;oBAC3B,oBAAC,SAAS,IAAC,KAAK,EAAC,MAAM,IAAE,MAAM,CAAC,OAAO,CAAa;oBACpD,oBAAC,SAAS,QAAE,MAAM,CAAC,kBAAkB,CAAa;oBAClD,oBAAC,SAAS,IAAC,KAAK,EAAC,OAAO,IACrB,MAAM,CAAC,KAAK,IAAI,CACf,oBAAC,KAAK,IACJ,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAC,OAAO,GACd,CACH,CACS,CACH,CACZ,CAAC,CACQ,CACN,CACP,CACJ,CACO,CACX,CAAA;AACH,CAAC;AAED,eAAe,kBAAkB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/components",
3
- "version": "2.0.104-alpha.0",
3
+ "version": "2.0.108-alpha.0",
4
4
  "module": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "author": "Emerson Laurentino @emersonlaurentino",
@@ -30,5 +30,5 @@
30
30
  "node": "16.18.0",
31
31
  "yarn": "1.19.1"
32
32
  },
33
- "gitHead": "0db7f06c36c7c41ecec51f247b21866469977618"
33
+ "gitHead": "89d5c048f1ebe684c74a748b799a5fc0a3954819"
34
34
  }
package/src/index.ts CHANGED
@@ -198,6 +198,9 @@ export {
198
198
  } from './organisms/CartSidebar'
199
199
  export type { CartSidebarProps } from './organisms/CartSidebar'
200
200
 
201
+ export { default as EmptyState } from './organisms/EmptyState'
202
+ export type { EmptyStateProps } from './organisms/EmptyState'
203
+
201
204
  export {
202
205
  default as Filter,
203
206
  FilterFacetBoolean,
@@ -242,6 +245,9 @@ export type { PaymentMethodsProps } from './organisms/PaymentMethods'
242
245
  export { default as PriceRange } from './organisms/PriceRange'
243
246
  export type { PriceRangeProps } from './organisms/PriceRange'
244
247
 
248
+ export { default as RegionModal } from './organisms/RegionModal'
249
+ export type { RegionModalProps } from './organisms/RegionModal'
250
+
245
251
  export { default as SearchInput } from './organisms/SearchInput'
246
252
  export type { SearchInputProps } from './organisms/SearchInput'
247
253
 
@@ -7,17 +7,17 @@ export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
7
7
  * Title for header modal.
8
8
  */
9
9
  title: string
10
-
11
10
  /**
12
11
  * Description for header modal.
13
12
  */
14
13
  description?: string
15
-
16
14
  /**
17
15
  * Props for the Close Button component.
18
16
  */
19
17
  closeBtnProps?: Partial<Omit<IconButtonProps, 'onClick'>>
20
-
18
+ /**
19
+ * Function called when dismiss button is clicked.
20
+ */
21
21
  onClose?: () => void
22
22
  }
23
23
 
@@ -31,10 +31,10 @@ const ModalHeader = ({
31
31
  <header data-fs-modal-header>
32
32
  {onClose && (
33
33
  <IconButton
34
- onClick={() => onClose?.()}
35
34
  data-fs-modal-header-close-button
36
- icon={<Icon name="X" />}
37
35
  aria-label="Close modal"
36
+ icon={<Icon name="X" />}
37
+ onClick={() => onClose?.()}
38
38
  {...closeBtnProps}
39
39
  />
40
40
  )}
@@ -5,6 +5,10 @@ import { Rating } from '../../'
5
5
  import type { RatingProps } from '../../'
6
6
 
7
7
  export type ProductTitleProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
8
+ /**
9
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
10
+ */
11
+ testId?: string
8
12
  /**
9
13
  * A react component to be used as the product title, e.g. a `h1`
10
14
  */
@@ -21,10 +25,6 @@ export type ProductTitleProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
21
25
  * A text to be used below the title and the label, such as the product's reference number.
22
26
  */
23
27
  refNumber?: string
24
- /**
25
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
26
- */
27
- testId?: string
28
28
  /**
29
29
  * The current value of the rating, a number from 0 to 5.
30
30
  */
@@ -1,5 +1,5 @@
1
- import React, { PropsWithChildren } from 'react'
2
- import type { ReactNode } from 'react'
1
+ import React from 'react'
2
+ import type { PropsWithChildren, ReactNode } from 'react'
3
3
 
4
4
  import {
5
5
  Alert,
@@ -0,0 +1,58 @@
1
+ import React from 'react'
2
+ import type { PropsWithChildren, ReactNode } from 'react'
3
+
4
+ type Variant = 'default' | 'rounded'
5
+ type BackgroundColor = 'default' | 'light'
6
+
7
+ export interface EmptyStateProps {
8
+ /**
9
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
10
+ */
11
+ testId?: string
12
+ /**
13
+ * The EmptyState component's title.
14
+ */
15
+ title?: string
16
+ /**
17
+ * A React component that will be rendered as an icon on the Title.
18
+ */
19
+ titleIcon?: ReactNode
20
+ /**
21
+ * Specifies the component border variant.
22
+ */
23
+ variant?: Variant
24
+ /**
25
+ * Specifies the component background color.
26
+ */
27
+ bkgColor?: BackgroundColor
28
+ }
29
+
30
+ function EmptyState({
31
+ testId = 'fs-empty-state',
32
+ title,
33
+ titleIcon,
34
+ variant = 'default',
35
+ bkgColor = 'default',
36
+ children,
37
+ ...otherProps
38
+ }: PropsWithChildren<EmptyStateProps>) {
39
+ return (
40
+ <section
41
+ data-fs-empty-state
42
+ data-fs-empty-state-variant={variant}
43
+ data-fs-empty-state-bkg-color={bkgColor}
44
+ data-testid={testId}
45
+ {...otherProps}
46
+ >
47
+ {title && (
48
+ <header data-fs-empty-state-title>
49
+ {titleIcon && <>{titleIcon}</>}
50
+ <p>{title}</p>
51
+ </header>
52
+ )}
53
+ {children}
54
+ </section>
55
+ )
56
+ }
57
+
58
+ export default EmptyState
@@ -0,0 +1,2 @@
1
+ export { default } from './EmptyState'
2
+ export type { EmptyStateProps } from './EmptyState'
@@ -0,0 +1,125 @@
1
+ import React from 'react'
2
+
3
+ import type { MutableRefObject } from 'react'
4
+ import type { ModalProps, LinkProps, LinkElementType } from '../../'
5
+ import { Icon, InputField, Link, Modal, ModalHeader, ModalBody } from '../..'
6
+
7
+ export interface RegionModalProps extends Omit<ModalProps, 'children'> {
8
+ /**
9
+ * ID to find this component in testing tools (e.g.: cypress,
10
+ * testing-library, and jest).
11
+ */
12
+ testId?: string
13
+ /**
14
+ * The region modal's title.
15
+ */
16
+ title?: string
17
+ /**
18
+ * Description for region modal.
19
+ */
20
+ description?: string
21
+ /**
22
+ * Props for the link `I don't know my Postal Code`.
23
+ */
24
+ idkPostalCodeLinkProps?: Partial<LinkProps<LinkElementType>>
25
+ /**
26
+ * Props for the `I don't know my Postal Code` link on modal body content.
27
+ */
28
+ linkText?: Partial<LinkProps<LinkElementType>>
29
+ /**
30
+ * Message of error for input.
31
+ */
32
+ errorMessage?: string
33
+ /**
34
+ * Postal code input's ref.
35
+ */
36
+ inputRef?: MutableRefObject<HTMLInputElement | null>
37
+ /**
38
+ * Postal code input's value.
39
+ */
40
+ inputValue?: string
41
+ /**
42
+ * Enables fadeOut effect on modal after onSubmit function
43
+ */
44
+ fadeOutOnSubmit?: boolean
45
+ /**
46
+ * Function called when Close button is clicked.
47
+ */
48
+ onClose?: () => void
49
+ /**
50
+ * Callback function when input is typed.
51
+ */
52
+ onInput?: (event: React.FormEvent<HTMLInputElement>) => void
53
+ /**
54
+ * Callback function when form is submitted.
55
+ */
56
+ onSubmit?: () => void
57
+ /**
58
+ * Callback function when the input clear button is clicked.
59
+ */
60
+ onClear?: () => void
61
+ }
62
+
63
+ function RegionModal({
64
+ testId = 'fs-region-modal',
65
+ title = 'Set your location',
66
+ description = 'Prices, offers and availability may vary according to your location.',
67
+ idkPostalCodeLinkProps,
68
+ errorMessage,
69
+ inputRef,
70
+ inputValue,
71
+ fadeOutOnSubmit,
72
+ onClose,
73
+ onInput,
74
+ onSubmit,
75
+ onClear,
76
+ ...otherProps
77
+ }: RegionModalProps) {
78
+ return (
79
+ <Modal data-fs-region-modal testId={testId} {...otherProps}>
80
+ {({ fadeOut }) => (
81
+ <>
82
+ <ModalHeader
83
+ onClose={() => {
84
+ fadeOut()
85
+ onClose?.()
86
+ }}
87
+ title={title}
88
+ description={description}
89
+ closeBtnProps={{
90
+ 'aria-label': 'Close Region Modal',
91
+ }}
92
+ />
93
+ <ModalBody>
94
+ <InputField
95
+ data-fs-region-modal-input
96
+ id={`${testId}-input-field`}
97
+ inputRef={inputRef}
98
+ label="Postal Code"
99
+ actionable
100
+ value={inputValue}
101
+ onInput={(event) => onInput?.(event)}
102
+ onSubmit={() => {
103
+ onSubmit?.()
104
+ fadeOutOnSubmit ? fadeOut() : null
105
+ }}
106
+ onClear={() => onClear?.()}
107
+ error={errorMessage}
108
+ />
109
+
110
+ <Link data-fs-region-modal-link {...idkPostalCodeLinkProps}>
111
+ {idkPostalCodeLinkProps?.children ?? (
112
+ <>
113
+ {"I don't know my Postal Code"}
114
+ <Icon name="ArrowSquareOut" width={20} height={20} />
115
+ </>
116
+ )}
117
+ </Link>
118
+ </ModalBody>
119
+ </>
120
+ )}
121
+ </Modal>
122
+ )
123
+ }
124
+
125
+ export default RegionModal
@@ -0,0 +1,2 @@
1
+ export { default } from './RegionModal'
2
+ export type { RegionModalProps } from './RegionModal'
@@ -4,10 +4,16 @@ import type { PriceFormatter } from '../../atoms/Price/Price'
4
4
  import React from 'react'
5
5
 
6
6
  import {
7
- Icon, InputField, Link, LinkElementType, LinkProps, Price, Table,
7
+ Icon,
8
+ InputField,
9
+ Link,
10
+ LinkElementType,
11
+ LinkProps,
12
+ Price,
13
+ Table,
8
14
  TableBody,
9
15
  TableCell,
10
- TableRow
16
+ TableRow,
11
17
  } from '../..'
12
18
 
13
19
  interface ShippingSLA {
@@ -49,7 +55,7 @@ export interface ShippingSimulationProps
49
55
  */
50
56
  optionsLabel?: string
51
57
  /**
52
- * Props for the link for i don't know my postal code.
58
+ * Props for the link `I don't know my Postal Code`.
53
59
  */
54
60
  idkPostalCodeLinkProps?: Partial<LinkProps<LinkElementType>>
55
61
  /**
@@ -61,9 +67,9 @@ export interface ShippingSimulationProps
61
67
  */
62
68
  onSubmit?: () => void
63
69
  /**
64
- * Callback function when the clear button is clicked.
70
+ * Callback function when the input clear button is clicked.
65
71
  */
66
- onClear?: () => void
72
+ onClear?: () => void
67
73
  /**
68
74
  * Location for shipping.
69
75
  */
@@ -77,7 +83,7 @@ export interface ShippingSimulationProps
77
83
  */
78
84
  displayClearButton?: boolean
79
85
  /**
80
- * Message of error.
86
+ * Message of error for input.
81
87
  */
82
88
  errorMessage?: string
83
89
  /**
@@ -89,9 +95,9 @@ export interface ShippingSimulationProps
89
95
  function ShippingSimulation({
90
96
  testId = 'fs-shipping-simulation',
91
97
  formatter,
92
- title = "Shipping",
93
- inputLabel = "Postal Code",
94
- optionsLabel = "Shipping options",
98
+ title = 'Shipping',
99
+ inputLabel = 'Postal Code',
100
+ optionsLabel = 'Shipping options',
95
101
  idkPostalCodeLinkProps,
96
102
  onInput,
97
103
  onSubmit,
@@ -103,19 +109,16 @@ function ShippingSimulation({
103
109
  postalCode,
104
110
  ...otherProps
105
111
  }: ShippingSimulationProps) {
106
-
107
112
  const hasShippingOptions = !!options && options.length > 0
108
113
 
109
114
  return (
110
115
  <section
111
116
  data-fs-shipping-simulation
112
- data-fs-shipping-simulation-empty={!hasShippingOptions ? "true" : "false"}
117
+ data-fs-shipping-simulation-empty={!hasShippingOptions ? 'true' : 'false'}
113
118
  data-testid={testId}
114
119
  {...otherProps}
115
120
  >
116
- <h2 data-fs-shipping-simulation-title>
117
- {title}
118
- </h2>
121
+ <h2 data-fs-shipping-simulation-title>{title}</h2>
119
122
 
120
123
  <InputField
121
124
  actionable
@@ -129,23 +132,25 @@ function ShippingSimulation({
129
132
  displayClearButton={displayClearButton}
130
133
  />
131
134
 
132
- <Link href="/" data-fs-shipping-simulation-link size="small" {...idkPostalCodeLinkProps}>
133
- {
134
- idkPostalCodeLinkProps?.children ??
135
+ <Link
136
+ href="/"
137
+ data-fs-shipping-simulation-link
138
+ size="small"
139
+ {...idkPostalCodeLinkProps}
140
+ >
141
+ {idkPostalCodeLinkProps?.children ?? (
135
142
  <>
136
143
  {"I don't know my Postal Code"}
137
144
  <Icon name="ArrowSquareOut" width={20} height={20} />
138
145
  </>
139
- }
146
+ )}
140
147
  </Link>
141
148
 
142
149
  {hasShippingOptions && (
143
150
  <>
144
151
  <header data-fs-shipping-simulation-header>
145
152
  <h3 data-fs-shipping-simulation-subtitle>{optionsLabel}</h3>
146
- <p data-fs-shipping-simulation-location>
147
- {location}
148
- </p>
153
+ <p data-fs-shipping-simulation-location>{location}</p>
149
154
  </header>
150
155
 
151
156
  <Table>