@faststore/components 2.0.104-alpha.0 → 2.0.106-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/molecules/Modal/ModalHeader.d.ts +3 -0
- package/dist/molecules/Modal/ModalHeader.js +1 -1
- package/dist/molecules/Modal/ModalHeader.js.map +1 -1
- package/dist/organisms/RegionModal/RegionModal.d.ts +60 -0
- package/dist/organisms/RegionModal/RegionModal.js +21 -0
- package/dist/organisms/RegionModal/RegionModal.js.map +1 -0
- package/dist/organisms/RegionModal/index.d.ts +2 -0
- package/dist/organisms/RegionModal/index.js +2 -0
- package/dist/organisms/RegionModal/index.js.map +1 -0
- package/dist/organisms/ShippingSimulation/ShippingSimulation.d.ts +3 -3
- package/dist/organisms/ShippingSimulation/ShippingSimulation.js +6 -7
- package/dist/organisms/ShippingSimulation/ShippingSimulation.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +3 -0
- package/src/molecules/Modal/ModalHeader.tsx +5 -5
- package/src/organisms/RegionModal/RegionModal.tsx +125 -0
- package/src/organisms/RegionModal/index.ts +2 -0
- package/src/organisms/ShippingSimulation/ShippingSimulation.tsx +26 -21
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ export { default as PaymentMethods } from './organisms/PaymentMethods';
|
|
|
111
111
|
export type { PaymentMethodsProps } from './organisms/PaymentMethods';
|
|
112
112
|
export { default as PriceRange } from './organisms/PriceRange';
|
|
113
113
|
export type { PriceRangeProps } from './organisms/PriceRange';
|
|
114
|
+
export { default as RegionModal } from './organisms/RegionModal';
|
|
115
|
+
export type { RegionModalProps } from './organisms/RegionModal';
|
|
114
116
|
export { default as SearchInput } from './organisms/SearchInput';
|
|
115
117
|
export type { SearchInputProps } from './organisms/SearchInput';
|
|
116
118
|
export { default as ShippingSimulation } from './organisms/ShippingSimulation';
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ export { default as ImageGallery, ImageGallerySelector, ImageZoom, } from './org
|
|
|
61
61
|
export { default as OutOfStock } from './organisms/OutOfStock';
|
|
62
62
|
export { default as PaymentMethods } from './organisms/PaymentMethods';
|
|
63
63
|
export { default as PriceRange } from './organisms/PriceRange';
|
|
64
|
+
export { default as RegionModal } from './organisms/RegionModal';
|
|
64
65
|
export { default as SearchInput } from './organisms/SearchInput';
|
|
65
66
|
export { default as ShippingSimulation } from './organisms/ShippingSimulation';
|
|
66
67
|
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,OAAO,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,yBAAyB,CAAA;AAGhC,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, {
|
|
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,
|
|
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"}
|
|
@@ -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 @@
|
|
|
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
|
|
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 =
|
|
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 ?
|
|
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
|
-
|
|
10
|
-
|
|
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,
|
|
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,EACJ,UAAU,EACV,IAAI,EAGJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAA;AA8Ed,SAAS,kBAAkB,CAAC,EAC1B,MAAM,GAAG,wBAAwB,EACjC,SAAS,EACT,KAAK,GAAG,UAAU,EAClB,UAAU,GAAG,aAAa,EAC1B,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;IACxB,MAAM,kBAAkB,GAAG,CAAC,CAAC,OAAO,IAA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AC,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.
|
|
3
|
+
"version": "2.0.106-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": "
|
|
33
|
+
"gitHead": "e2e1f115c8372629eb729918052f662337a0c3b3"
|
|
34
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -242,6 +242,9 @@ export type { PaymentMethodsProps } from './organisms/PaymentMethods'
|
|
|
242
242
|
export { default as PriceRange } from './organisms/PriceRange'
|
|
243
243
|
export type { PriceRangeProps } from './organisms/PriceRange'
|
|
244
244
|
|
|
245
|
+
export { default as RegionModal } from './organisms/RegionModal'
|
|
246
|
+
export type { RegionModalProps } from './organisms/RegionModal'
|
|
247
|
+
|
|
245
248
|
export { default as SearchInput } from './organisms/SearchInput'
|
|
246
249
|
export type { SearchInputProps } from './organisms/SearchInput'
|
|
247
250
|
|
|
@@ -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
|
)}
|
|
@@ -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
|
|
@@ -4,10 +4,16 @@ import type { PriceFormatter } from '../../atoms/Price/Price'
|
|
|
4
4
|
import React from 'react'
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
Icon,
|
|
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
|
|
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?:
|
|
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 =
|
|
93
|
-
inputLabel =
|
|
94
|
-
optionsLabel =
|
|
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 ?
|
|
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
|
|
133
|
-
|
|
134
|
-
|
|
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>
|