@faststore/components 2.0.69-alpha.0 → 2.0.73-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/assets/ClockClockwise.d.ts +3 -0
- package/dist/assets/ClockClockwise.js +10 -0
- package/dist/assets/ClockClockwise.js.map +1 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.js +1 -0
- package/dist/assets/index.js.map +1 -1
- package/dist/atoms/Price/Price.d.ts +4 -0
- package/dist/atoms/Price/Price.js +5 -2
- package/dist/atoms/Price/Price.js.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/molecules/CartItem/CartItem.js +2 -2
- package/dist/molecules/CartItem/CartItem.js.map +1 -1
- package/dist/molecules/Gift/GiftContent.d.ts +23 -0
- package/dist/molecules/Gift/GiftContent.js +10 -2
- package/dist/molecules/Gift/GiftContent.js.map +1 -1
- package/dist/molecules/Modal/ModalHeader.d.ts +2 -2
- package/dist/molecules/Modal/ModalHeader.js +2 -2
- package/dist/molecules/Modal/ModalHeader.js.map +1 -1
- package/dist/molecules/ProductCard/ProductCardContent.js +2 -2
- package/dist/molecules/ProductCard/ProductCardContent.js.map +1 -1
- package/dist/molecules/SearchHistory/SearchHistory.d.ts +21 -0
- package/dist/molecules/SearchHistory/SearchHistory.js +11 -0
- package/dist/molecules/SearchHistory/SearchHistory.js.map +1 -0
- package/dist/molecules/SearchHistory/SearchHistoryTerm.d.ts +23 -0
- package/dist/molecules/SearchHistory/SearchHistoryTerm.js +11 -0
- package/dist/molecules/SearchHistory/SearchHistoryTerm.js.map +1 -0
- package/dist/molecules/SearchHistory/index.d.ts +4 -0
- package/dist/molecules/SearchHistory/index.js +3 -0
- package/dist/molecules/SearchHistory/index.js.map +1 -0
- package/dist/molecules/SearchProductCard/SearchProductCard.d.ts +20 -0
- package/dist/molecules/SearchProductCard/SearchProductCard.js +8 -0
- package/dist/molecules/SearchProductCard/SearchProductCard.js.map +1 -0
- package/dist/molecules/SearchProductCard/SearchProductCardContent.d.ts +20 -0
- package/dist/molecules/SearchProductCard/SearchProductCardContent.js +11 -0
- package/dist/molecules/SearchProductCard/SearchProductCardContent.js.map +1 -0
- package/dist/molecules/SearchProductCard/SearchProductCardImage.d.ts +10 -0
- package/dist/molecules/SearchProductCard/SearchProductCardImage.js +6 -0
- package/dist/molecules/SearchProductCard/SearchProductCardImage.js.map +1 -0
- package/dist/molecules/SearchProductCard/index.d.ts +6 -0
- package/dist/molecules/SearchProductCard/index.js +4 -0
- package/dist/molecules/SearchProductCard/index.js.map +1 -0
- package/dist/molecules/SearchTop/SearchTop.d.ts +22 -0
- package/dist/molecules/SearchTop/SearchTop.js +11 -0
- package/dist/molecules/SearchTop/SearchTop.js.map +1 -0
- package/dist/molecules/SearchTop/SearchTopTerm.d.ts +23 -0
- package/dist/molecules/SearchTop/SearchTopTerm.js +11 -0
- package/dist/molecules/SearchTop/SearchTopTerm.js.map +1 -0
- package/dist/molecules/SearchTop/index.d.ts +4 -0
- package/dist/molecules/SearchTop/index.js +3 -0
- package/dist/molecules/SearchTop/index.js.map +1 -0
- package/dist/organisms/Hero/{HeroHeading.d.ts → HeroHeader.d.ts} +3 -3
- package/dist/organisms/Hero/{HeroHeading.js → HeroHeader.js} +3 -3
- package/dist/organisms/Hero/HeroHeader.js.map +1 -0
- package/dist/organisms/Hero/index.d.ts +2 -2
- package/dist/organisms/Hero/index.js +1 -1
- package/dist/organisms/Hero/index.js.map +1 -1
- package/dist/organisms/SlideOver/SlideOver.d.ts +34 -0
- package/dist/organisms/SlideOver/SlideOver.js +7 -0
- package/dist/organisms/SlideOver/SlideOver.js.map +1 -0
- package/dist/organisms/SlideOver/SlideOverHeader.d.ts +16 -0
- package/dist/organisms/SlideOver/SlideOverHeader.js +10 -0
- package/dist/organisms/SlideOver/SlideOverHeader.js.map +1 -0
- package/dist/organisms/SlideOver/index.d.ts +4 -0
- package/dist/organisms/SlideOver/index.js +3 -0
- package/dist/organisms/SlideOver/index.js.map +1 -0
- package/package.json +4 -4
- package/src/assets/ClockClockwise.tsx +56 -0
- package/src/assets/index.ts +1 -0
- package/src/atoms/Price/Price.tsx +8 -0
- package/src/index.ts +29 -6
- package/src/molecules/CartItem/CartItem.tsx +2 -0
- package/src/molecules/Gift/GiftContent.tsx +48 -2
- package/src/molecules/Modal/ModalHeader.tsx +3 -3
- package/src/molecules/ProductCard/ProductCardContent.tsx +2 -0
- package/src/molecules/SearchHistory/SearchHistory.tsx +44 -0
- package/src/molecules/SearchHistory/SearchHistoryTerm.tsx +44 -0
- package/src/molecules/SearchHistory/index.ts +5 -0
- package/src/molecules/SearchProductCard/SearchProductCard.tsx +54 -0
- package/src/molecules/SearchProductCard/SearchProductCardContent.tsx +51 -0
- package/src/molecules/SearchProductCard/SearchProductCardImage.tsx +31 -0
- package/src/molecules/SearchProductCard/index.ts +8 -0
- package/src/molecules/SearchTop/SearchTop.tsx +53 -0
- package/src/molecules/SearchTop/SearchTopTerm.tsx +46 -0
- package/src/molecules/SearchTop/index.ts +5 -0
- package/src/organisms/Hero/{HeroHeading.tsx → HeroHeader.tsx} +4 -4
- package/src/organisms/Hero/index.tsx +2 -2
- package/src/organisms/SlideOver/SlideOver.tsx +65 -0
- package/src/organisms/SlideOver/SlideOverHeader.tsx +40 -0
- package/src/organisms/SlideOver/index.ts +5 -0
- package/dist/organisms/Hero/HeroHeading.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchTopTerm.js","sourceRoot":"","sources":["../../../src/molecules/SearchTop/SearchTopTerm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGlC,OAAO,EAAE,KAAK,EAAE,IAAI,EAA8B,MAAM,QAAQ,CAAA;AAqBhE,MAAM,aAAa,GAAG,UAAU,CAC9B,SAAS,aAAa,CAAC,EACrB,MAAM,GAAG,oBAAoB,EAC7B,KAAK,EACL,SAAS,EACT,KAAK,GACN;IACC,OAAO,CACL,4EAAyC,MAAM;QAC7C,oBAAC,IAAI,OAAK,SAAS,wCAA+B,OAAO,EAAC,SAAS;YACjE,oBAAC,KAAK,2CAA+B,OAAO,EAAC,MAAM,IAChD,KAAK,GAAG,CAAC,CACJ;YACP,KAAK,CACD,CACJ,CACN,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molecules/SearchTop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGrC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export interface
|
|
3
|
+
export interface HeroHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Content for the h1 tag.
|
|
6
6
|
*/
|
|
@@ -26,5 +26,5 @@ export interface HeroHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
26
26
|
*/
|
|
27
27
|
testId?: string;
|
|
28
28
|
}
|
|
29
|
-
declare const
|
|
30
|
-
export default
|
|
29
|
+
declare const HeroHeader: React.ForwardRefExoticComponent<HeroHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export default HeroHeader;
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import { Icon, LinkButton } from '../..';
|
|
3
3
|
import { ArrowRight } from '../../assets';
|
|
4
4
|
import { useHero } from './Hero';
|
|
5
|
-
const
|
|
5
|
+
const HeroHeader = forwardRef(function HeroHeader({ icon, link, title, linkText, subtitle, children, testId = 'fs-hero-heading', ...otherProps }, ref) {
|
|
6
6
|
const { variant, colorVariant } = useHero();
|
|
7
7
|
return (React.createElement("header", { ref: ref, "data-fs-hero-heading": true, "data-testid": testId, ...otherProps },
|
|
8
8
|
React.createElement("div", { "data-fs-hero-wrapper": true, className: "layout__content" },
|
|
@@ -12,5 +12,5 @@ const HeroHeading = forwardRef(function HeroHeading({ icon, link, title, linkTex
|
|
|
12
12
|
!!link && (React.createElement(LinkButton, { href: link, inverse: colorVariant === 'main', icon: React.createElement(ArrowRight, null), iconPosition: "right" }, linkText))),
|
|
13
13
|
icon && variant === 'secondary' && (React.createElement(Icon, { "data-fs-hero-icon": true, component: icon })))));
|
|
14
14
|
});
|
|
15
|
-
export default
|
|
16
|
-
//# sourceMappingURL=
|
|
15
|
+
export default HeroHeader;
|
|
16
|
+
//# sourceMappingURL=HeroHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeroHeader.js","sourceRoot":"","sources":["../../../src/organisms/Hero/HeroHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AA6BhC,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EACE,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,GAAG,iBAAiB,EAC1B,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAA;IAE3C,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,+CAEK,MAAM,KACf,UAAU;QAEd,2DAA0B,SAAS,EAAC,iBAAiB;YACnD;gBACE,0DAAwB,KAAK,CAAM;gBACnC,4DAA0B,QAAQ,CAAK;gBACtC,CAAC,CAAC,IAAI,IAAI,CACT,oBAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,YAAY,KAAK,MAAM,EAChC,IAAI,EAAE,oBAAC,UAAU,OAAG,EACpB,YAAY,EAAC,OAAO,IAEnB,QAAQ,CACE,CACd,CACG;YACL,IAAI,IAAI,OAAO,KAAK,WAAW,IAAI,CAClC,oBAAC,IAAI,+BAAmB,SAAS,EAAE,IAAI,GAAI,CAC5C,CACG,CACC,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -2,5 +2,5 @@ export { default } from './Hero';
|
|
|
2
2
|
export type { HeroProps } from './Hero';
|
|
3
3
|
export { default as HeroImage } from './HeroImage';
|
|
4
4
|
export type { HeroImageProps } from './HeroImage';
|
|
5
|
-
export { default as
|
|
6
|
-
export type {
|
|
5
|
+
export { default as HeroHeader } from './HeroHeader';
|
|
6
|
+
export type { HeroHeaderProps } from './HeroHeader';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/organisms/Hero/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGhC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlD,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/organisms/Hero/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGhC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ModalProps } from '../../';
|
|
3
|
+
type Direction = 'leftSide' | 'rightSide';
|
|
4
|
+
type WidthSize = 'full' | 'partial';
|
|
5
|
+
export type SlideOverProps = Omit<ModalProps, 'title'> & {
|
|
6
|
+
/**
|
|
7
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
8
|
+
*/
|
|
9
|
+
testId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* A boolean value that represents the state of the SlideOver
|
|
12
|
+
*/
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Represents the side that the SlideOver comes from.
|
|
16
|
+
*/
|
|
17
|
+
direction: Direction;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the size of the SlideOver.
|
|
20
|
+
*/
|
|
21
|
+
size: WidthSize;
|
|
22
|
+
/**
|
|
23
|
+
* Represents the fade effect of the SlideOver.
|
|
24
|
+
*/
|
|
25
|
+
fade: 'in' | 'out';
|
|
26
|
+
/**
|
|
27
|
+
* This function is called whenever the user clicks outside.
|
|
28
|
+
* the modal content
|
|
29
|
+
*/
|
|
30
|
+
onDismiss?: () => void;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
declare function SlideOver({ isOpen, direction, size, fade, children, onDismiss, testId, ...otherProps }: SlideOverProps): JSX.Element;
|
|
34
|
+
export default SlideOver;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal } from '../../';
|
|
3
|
+
function SlideOver({ isOpen, direction = 'leftSide', size = 'full', fade = 'out', children, onDismiss, testId = 'fs-slide-over', ...otherProps }) {
|
|
4
|
+
return (React.createElement(Modal, { "data-fs-modal": null, "data-fs-slide-over": true, "data-fs-slide-over-direction": direction, "data-fs-slide-over-size": size, "data-fs-slide-over-state": fade, isOpen: isOpen, onDismiss: onDismiss, ...otherProps }, children));
|
|
5
|
+
}
|
|
6
|
+
export default SlideOver;
|
|
7
|
+
//# sourceMappingURL=SlideOver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideOver.js","sourceRoot":"","sources":["../../../src/organisms/SlideOver/SlideOver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAmC9B,SAAS,SAAS,CAAC,EACjB,MAAM,EACN,SAAS,GAAG,UAAU,EACtB,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,KAAK,EACZ,QAAQ,EACR,SAAS,EACT,MAAM,GAAG,eAAe,EACxB,GAAG,UAAU,EACE;IACf,OAAO,CACL,oBAAC,KAAK,qBACW,IAAI,8DAEW,SAAS,6BACd,IAAI,8BACH,IAAI,EAC9B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,KAChB,UAAU,IAEb,QAAQ,CACH,CACT,CAAA;AACH,CAAC;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { IconButtonProps } from '../../';
|
|
4
|
+
export interface SlideOverHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
/**
|
|
6
|
+
* A react component to be used as the title in the header.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Props for the Close Button component.
|
|
11
|
+
*/
|
|
12
|
+
closeBtnProps?: Partial<Omit<IconButtonProps, 'onClick'>>;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const SlideOverHeader: ({ onClose, children, closeBtnProps, }: SlideOverHeaderProps) => JSX.Element;
|
|
16
|
+
export default SlideOverHeader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { X } from '../../assets';
|
|
3
|
+
import { IconButton } from '../../';
|
|
4
|
+
const SlideOverHeader = ({ onClose, children, closeBtnProps = {}, }) => {
|
|
5
|
+
return (React.createElement("header", { "data-fs-slide-over-header": true },
|
|
6
|
+
children,
|
|
7
|
+
React.createElement(IconButton, { "data-fs-slide-over-header-icon": true, "aria-label": "Close", icon: React.createElement(X, null), onClick: onClose, ...closeBtnProps })));
|
|
8
|
+
};
|
|
9
|
+
export default SlideOverHeader;
|
|
10
|
+
//# sourceMappingURL=SlideOverHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideOverHeader.js","sourceRoot":"","sources":["../../../src/organisms/SlideOver/SlideOverHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAiBnC,MAAM,eAAe,GAAG,CAAC,EACvB,OAAO,EACP,QAAQ,EACR,aAAa,GAAG,EAAE,GACG,EAAE,EAAE;IACzB,OAAO,CACL;QACG,QAAQ;QACT,oBAAC,UAAU,0DAEE,OAAO,EAClB,IAAI,EAAE,oBAAC,CAAC,OAAG,EACX,OAAO,EAAE,OAAO,KACZ,aAAa,GACjB,CACK,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/organisms/SlideOver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGrC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.73-alpha.0",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"author": "Emerson Laurentino @emersonlaurentino",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"src"
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@faststore/eslint-config": "^2.0.
|
|
25
|
-
"@faststore/shared": "^2.0.
|
|
24
|
+
"@faststore/eslint-config": "^2.0.73-alpha.0",
|
|
25
|
+
"@faststore/shared": "^2.0.73-alpha.0",
|
|
26
26
|
"eslint": "7.32.0",
|
|
27
27
|
"typescript": "^4.8.4"
|
|
28
28
|
},
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"node": "16.18.0",
|
|
31
31
|
"yarn": "1.19.1"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "6ea74fc2ff1eaa78550e8801304eeac29e7d5938"
|
|
34
34
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { FC } from 'react'
|
|
3
|
+
|
|
4
|
+
// Icon from Phosphor Icons
|
|
5
|
+
const ClockClockwise: FC = () => (
|
|
6
|
+
<svg
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
strokeWidth="16"
|
|
11
|
+
width={24}
|
|
12
|
+
height={24}
|
|
13
|
+
>
|
|
14
|
+
<rect width="256" height="256" fill="none"></rect>
|
|
15
|
+
<line
|
|
16
|
+
x1="128"
|
|
17
|
+
y1="80"
|
|
18
|
+
x2="128"
|
|
19
|
+
y2="128"
|
|
20
|
+
fill="none"
|
|
21
|
+
stroke="currentColor"
|
|
22
|
+
stroke-linecap="round"
|
|
23
|
+
stroke-linejoin="round"
|
|
24
|
+
stroke-width="16"
|
|
25
|
+
></line>
|
|
26
|
+
<line
|
|
27
|
+
x1="169.6"
|
|
28
|
+
y1="152"
|
|
29
|
+
x2="128"
|
|
30
|
+
y2="128"
|
|
31
|
+
fill="none"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
stroke-linecap="round"
|
|
34
|
+
stroke-linejoin="round"
|
|
35
|
+
stroke-width="16"
|
|
36
|
+
></line>
|
|
37
|
+
<polyline
|
|
38
|
+
points="184.2 99.7 224.2 99.7 224.2 59.7"
|
|
39
|
+
fill="none"
|
|
40
|
+
stroke="currentColor"
|
|
41
|
+
stroke-linecap="round"
|
|
42
|
+
stroke-linejoin="round"
|
|
43
|
+
stroke-width="16"
|
|
44
|
+
></polyline>
|
|
45
|
+
<path
|
|
46
|
+
d="M190.2,190.2a88,88,0,1,1,0-124.4l34,33.9"
|
|
47
|
+
fill="none"
|
|
48
|
+
stroke="currentColor"
|
|
49
|
+
stroke-linecap="round"
|
|
50
|
+
stroke-linejoin="round"
|
|
51
|
+
stroke-width="16"
|
|
52
|
+
></path>
|
|
53
|
+
</svg>
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
export default ClockClockwise
|
package/src/assets/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as ArrowElbowDownRight } from './ArrowElbowDownRight'
|
|
|
5
5
|
export { default as ArrowRight } from './ArrowRight'
|
|
6
6
|
export { default as CaretDown } from './CaretDown'
|
|
7
7
|
export { default as Checked } from './Checked'
|
|
8
|
+
export { default as ClockClockwise } from './ClockClockwise'
|
|
8
9
|
export { default as DotsThree } from './DotsThree'
|
|
9
10
|
export { default as Heart } from './Heart'
|
|
10
11
|
export { default as House } from './House'
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes, ElementType, ReactNode } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
+
import { SROnly } from '../../'
|
|
5
|
+
|
|
4
6
|
export type PriceVariant =
|
|
5
7
|
| 'selling'
|
|
6
8
|
| 'listing'
|
|
@@ -32,6 +34,10 @@ export interface PriceProps
|
|
|
32
34
|
* The current use case variant for prices.
|
|
33
35
|
*/
|
|
34
36
|
variant?: PriceVariant
|
|
37
|
+
/**
|
|
38
|
+
* Text for the screen readers only
|
|
39
|
+
*/
|
|
40
|
+
SRText?: string
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
const Price = forwardRef<Omit<HTMLSpanElement, 'children'>, PriceProps>(
|
|
@@ -42,6 +48,7 @@ const Price = forwardRef<Omit<HTMLSpanElement, 'children'>, PriceProps>(
|
|
|
42
48
|
variant = 'selling',
|
|
43
49
|
testId = 'fs-price',
|
|
44
50
|
formatter = (price) => price,
|
|
51
|
+
SRText,
|
|
45
52
|
...otherProps
|
|
46
53
|
},
|
|
47
54
|
ref
|
|
@@ -56,6 +63,7 @@ const Price = forwardRef<Omit<HTMLSpanElement, 'children'>, PriceProps>(
|
|
|
56
63
|
data-testid={testId}
|
|
57
64
|
{...otherProps}
|
|
58
65
|
>
|
|
66
|
+
{SRText && <SROnly text={SRText} />}
|
|
59
67
|
{formattedPrice}
|
|
60
68
|
</Component>
|
|
61
69
|
)
|
package/src/index.ts
CHANGED
|
@@ -52,10 +52,7 @@ export type {
|
|
|
52
52
|
} from './molecules/Accordion'
|
|
53
53
|
export { default as Alert } from './molecules/Alert'
|
|
54
54
|
export type { AlertProps } from './molecules/Alert'
|
|
55
|
-
export {
|
|
56
|
-
BreadcrumbPure,
|
|
57
|
-
Breadcrumb,
|
|
58
|
-
} from './molecules/Breadcrumb'
|
|
55
|
+
export { BreadcrumbPure, Breadcrumb } from './molecules/Breadcrumb'
|
|
59
56
|
export type {
|
|
60
57
|
BreadcrumbPureProps,
|
|
61
58
|
BreadcrumbProps,
|
|
@@ -119,6 +116,26 @@ export { default as RadioGroup, RadioOption } from './molecules/RadioGroup'
|
|
|
119
116
|
export type { RadioGroupProps, RadioOptionProps } from './molecules/RadioGroup'
|
|
120
117
|
export { default as Rating } from './molecules/Rating'
|
|
121
118
|
export type { RatingProps } from './molecules/Rating'
|
|
119
|
+
export {
|
|
120
|
+
default as SearchHistory,
|
|
121
|
+
SearchHistoryTerm,
|
|
122
|
+
} from './molecules/SearchHistory'
|
|
123
|
+
export type {
|
|
124
|
+
SearchHistoryProps,
|
|
125
|
+
SearchHistoryTermProps,
|
|
126
|
+
} from './molecules/SearchHistory'
|
|
127
|
+
export {
|
|
128
|
+
default as SearchProductCard,
|
|
129
|
+
SearchProductCardImage,
|
|
130
|
+
SearchProductCardContent,
|
|
131
|
+
} from './molecules/SearchProductCard'
|
|
132
|
+
export type {
|
|
133
|
+
SearchProductCardProps,
|
|
134
|
+
SearchProductCardImageProps,
|
|
135
|
+
SearchProductCardContentProps,
|
|
136
|
+
} from './molecules/SearchProductCard'
|
|
137
|
+
export { default as SearchTop, SearchTopTerm } from './molecules/SearchTop'
|
|
138
|
+
export type { SearchTopProps, SearchTopTermProps } from './molecules/SearchTop'
|
|
122
139
|
export { default as SelectField } from './molecules/SelectField'
|
|
123
140
|
export type { SelectFieldProps } from './molecules/SelectField'
|
|
124
141
|
export {
|
|
@@ -147,11 +164,11 @@ export { default as QuantitySelector } from './molecules/QuantitySelector'
|
|
|
147
164
|
export type { QuantitySelectorProps } from './molecules/QuantitySelector'
|
|
148
165
|
|
|
149
166
|
// Organisms
|
|
150
|
-
export { default as Hero, HeroImage,
|
|
167
|
+
export { default as Hero, HeroImage, HeroHeader } from './organisms/Hero'
|
|
151
168
|
export type {
|
|
152
169
|
HeroProps,
|
|
153
170
|
HeroImageProps,
|
|
154
|
-
|
|
171
|
+
HeroHeaderProps,
|
|
155
172
|
} from './organisms/Hero'
|
|
156
173
|
|
|
157
174
|
export { default as PaymentMethods } from './organisms/PaymentMethods'
|
|
@@ -159,3 +176,9 @@ export type { PaymentMethodsProps } from './organisms/PaymentMethods'
|
|
|
159
176
|
|
|
160
177
|
export { default as PriceRange } from './organisms/PriceRange'
|
|
161
178
|
export type { PriceRangeProps } from './organisms/PriceRange'
|
|
179
|
+
|
|
180
|
+
export { default as SlideOver, SlideOverHeader } from './organisms/SlideOver'
|
|
181
|
+
export type {
|
|
182
|
+
SlideOverProps,
|
|
183
|
+
SlideOverHeaderProps,
|
|
184
|
+
} from './organisms/SlideOver'
|
|
@@ -77,11 +77,13 @@ const CartItem = forwardRef<HTMLDivElement, CartItemProps>(function CartItem(
|
|
|
77
77
|
value={price?.listPrice ? price.listPrice : 0}
|
|
78
78
|
formatter={price?.formatter}
|
|
79
79
|
variant="listing"
|
|
80
|
+
SRText="Original price:"
|
|
80
81
|
/>
|
|
81
82
|
<Price
|
|
82
83
|
value={price?.value ? price.value : 0}
|
|
83
84
|
formatter={price?.formatter}
|
|
84
85
|
variant="spot"
|
|
86
|
+
SRText="Price:"
|
|
85
87
|
/>
|
|
86
88
|
</span>
|
|
87
89
|
</div>
|
|
@@ -1,16 +1,49 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
+
import type { PriceFormatter } from '../../atoms/Price/Price'
|
|
5
|
+
|
|
6
|
+
import { Price, Badge } from '../../'
|
|
7
|
+
|
|
8
|
+
interface Price {
|
|
9
|
+
value: number
|
|
10
|
+
listPrice: number
|
|
11
|
+
formatter: PriceFormatter
|
|
12
|
+
}
|
|
13
|
+
|
|
4
14
|
export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
|
|
5
15
|
/**
|
|
6
16
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
17
|
*/
|
|
8
18
|
testId?: string
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the product's name.
|
|
21
|
+
*/
|
|
22
|
+
productName: string
|
|
23
|
+
/**
|
|
24
|
+
* Specifies product's prices.
|
|
25
|
+
*/
|
|
26
|
+
price: Price
|
|
27
|
+
/**
|
|
28
|
+
* Badge's label
|
|
29
|
+
*/
|
|
30
|
+
badgeLabel?: string
|
|
31
|
+
/**
|
|
32
|
+
* Additional message in the title
|
|
33
|
+
*/
|
|
34
|
+
titleMessage?: string
|
|
9
35
|
}
|
|
10
36
|
|
|
11
37
|
const GiftContent = forwardRef<HTMLElement, GiftContentProps>(
|
|
12
38
|
function GiftContent(
|
|
13
|
-
{
|
|
39
|
+
{
|
|
40
|
+
price,
|
|
41
|
+
productName,
|
|
42
|
+
titleMessage = 'Get a',
|
|
43
|
+
badgeLabel = 'Free',
|
|
44
|
+
testId = 'fs-gift-content',
|
|
45
|
+
...otherProps
|
|
46
|
+
},
|
|
14
47
|
ref
|
|
15
48
|
) {
|
|
16
49
|
return (
|
|
@@ -20,7 +53,20 @@ const GiftContent = forwardRef<HTMLElement, GiftContentProps>(
|
|
|
20
53
|
data-testid={testId}
|
|
21
54
|
{...otherProps}
|
|
22
55
|
>
|
|
23
|
-
|
|
56
|
+
<h3 data-fs-gift-product-title>
|
|
57
|
+
{titleMessage} {productName}
|
|
58
|
+
</h3>
|
|
59
|
+
<span data-fs-gift-product-summary>
|
|
60
|
+
<Price
|
|
61
|
+
value={price?.listPrice ? price.listPrice : 0}
|
|
62
|
+
formatter={price?.formatter}
|
|
63
|
+
testId="list-price"
|
|
64
|
+
data-value={price?.listPrice}
|
|
65
|
+
variant="listing"
|
|
66
|
+
SRText="Original price:"
|
|
67
|
+
/>
|
|
68
|
+
<Badge>{badgeLabel}</Badge>
|
|
69
|
+
</span>
|
|
24
70
|
</section>
|
|
25
71
|
)
|
|
26
72
|
}
|
|
@@ -16,7 +16,7 @@ export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
/**
|
|
17
17
|
* Props for the Close Button component.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
closeBtnProps?: Partial<Omit<IconButtonProps, 'onClick'>>
|
|
20
20
|
|
|
21
21
|
onClose?: () => void
|
|
22
22
|
}
|
|
@@ -24,7 +24,7 @@ export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
24
24
|
const ModalHeader = ({
|
|
25
25
|
onClose,
|
|
26
26
|
title,
|
|
27
|
-
|
|
27
|
+
closeBtnProps = {},
|
|
28
28
|
description,
|
|
29
29
|
}: ModalHeaderProps) => {
|
|
30
30
|
return (
|
|
@@ -35,7 +35,7 @@ const ModalHeader = ({
|
|
|
35
35
|
data-fs-modal-header-close-button
|
|
36
36
|
icon={<X />}
|
|
37
37
|
aria-label="Close modal"
|
|
38
|
-
{...
|
|
38
|
+
{...closeBtnProps}
|
|
39
39
|
/>
|
|
40
40
|
)}
|
|
41
41
|
<p data-fs-modal-header-title>{title}</p>
|
|
@@ -103,6 +103,7 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
|
103
103
|
testId="list-price"
|
|
104
104
|
data-value={price?.listPrice}
|
|
105
105
|
variant="listing"
|
|
106
|
+
SRText="Original price:"
|
|
106
107
|
/>
|
|
107
108
|
<Price
|
|
108
109
|
value={price?.value ? price.value : 0}
|
|
@@ -110,6 +111,7 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
|
110
111
|
testId="price"
|
|
111
112
|
data-value={price?.value}
|
|
112
113
|
variant="spot"
|
|
114
|
+
SRText="Sale Price:"
|
|
113
115
|
/>
|
|
114
116
|
</div>
|
|
115
117
|
{ratingValue && <Rating value={ratingValue} icon={<Star />} />}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react'
|
|
2
|
+
import { List, Button } from '../..'
|
|
3
|
+
|
|
4
|
+
export interface SearchHistoryProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
+
*/
|
|
8
|
+
testId?: string
|
|
9
|
+
/**
|
|
10
|
+
* Title attribute for the <section> tag rendered by this component.
|
|
11
|
+
*/
|
|
12
|
+
title: string
|
|
13
|
+
/**
|
|
14
|
+
* Defines the text displayed in clear history button.
|
|
15
|
+
*/
|
|
16
|
+
clearLabel?: string
|
|
17
|
+
/**
|
|
18
|
+
* Event handler for click on clear history button.
|
|
19
|
+
*/
|
|
20
|
+
onClear?: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SearchHistory = ({
|
|
24
|
+
testId = 'fs-search-history',
|
|
25
|
+
title = 'History',
|
|
26
|
+
clearLabel = 'Clear History',
|
|
27
|
+
onClear,
|
|
28
|
+
children,
|
|
29
|
+
...otherProps
|
|
30
|
+
}: SearchHistoryProps) => {
|
|
31
|
+
return (
|
|
32
|
+
<section data-testid={testId} data-fs-search-history {...otherProps}>
|
|
33
|
+
<header data-fs-search-history-header>
|
|
34
|
+
<p data-fs-search-history-title>{title}</p>
|
|
35
|
+
<Button variant="tertiary" onClick={onClear} size="small">
|
|
36
|
+
{clearLabel}
|
|
37
|
+
</Button>
|
|
38
|
+
</header>
|
|
39
|
+
<List as="ol">{children}</List>
|
|
40
|
+
</section>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default SearchHistory
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import React, { HTMLAttributes } from 'react'
|
|
3
|
+
import { Icon, ClockClockwise, Link, LinkProps, LinkElementType } from '../..'
|
|
4
|
+
|
|
5
|
+
export interface SearchHistoryTermProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
8
|
+
*/
|
|
9
|
+
testId?: string
|
|
10
|
+
/**
|
|
11
|
+
* Defines the text displayed in history term item.
|
|
12
|
+
*/
|
|
13
|
+
value: string
|
|
14
|
+
/**
|
|
15
|
+
* Props for the link from term component.
|
|
16
|
+
*/
|
|
17
|
+
linkProps?: Partial<LinkProps<LinkElementType>>
|
|
18
|
+
/**
|
|
19
|
+
* A React component that will be rendered as an icon.
|
|
20
|
+
*/
|
|
21
|
+
icon?: ReactNode
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const SearchHistoryTerm = ({
|
|
25
|
+
testId = 'fs-search-history-term',
|
|
26
|
+
value,
|
|
27
|
+
linkProps,
|
|
28
|
+
icon,
|
|
29
|
+
}: SearchHistoryTermProps) => {
|
|
30
|
+
const historyIcon = icon ? icon : <ClockClockwise />
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<li data-fs-search-history-item data-testid={testId}>
|
|
34
|
+
<Link {...linkProps} data-fs-search-history-item-link variant="display">
|
|
35
|
+
{historyIcon && (
|
|
36
|
+
<Icon component={historyIcon} data-fs-search-history-item-icon />
|
|
37
|
+
)}
|
|
38
|
+
<span>{value}</span>
|
|
39
|
+
</Link>
|
|
40
|
+
</li>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default SearchHistoryTerm
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
import type { HTMLAttributes } from 'react'
|
|
3
|
+
|
|
4
|
+
import { Link, LinkProps, LinkElementType } from '../../'
|
|
5
|
+
|
|
6
|
+
export interface SearchProductCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* ID to find this component in testing tools (e.g.: cypress,
|
|
9
|
+
* testing-library, and jest).
|
|
10
|
+
*/
|
|
11
|
+
testId?: string
|
|
12
|
+
/**
|
|
13
|
+
* Props for the link from SearchProduct component.
|
|
14
|
+
*/
|
|
15
|
+
linkProps?: Partial<LinkProps<LinkElementType>>
|
|
16
|
+
/**
|
|
17
|
+
* Callback function when SearchProduct link is clicked.
|
|
18
|
+
*/
|
|
19
|
+
onLinkClick?: () => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SearchProductCard = forwardRef<HTMLDivElement, SearchProductCardProps>(
|
|
23
|
+
function ProductCard(
|
|
24
|
+
{
|
|
25
|
+
testId = 'fs-search-product-card',
|
|
26
|
+
linkProps,
|
|
27
|
+
onLinkClick,
|
|
28
|
+
children,
|
|
29
|
+
...otherProps
|
|
30
|
+
},
|
|
31
|
+
ref
|
|
32
|
+
) {
|
|
33
|
+
return (
|
|
34
|
+
<article
|
|
35
|
+
ref={ref}
|
|
36
|
+
data-fs-search-product-card
|
|
37
|
+
data-testid={testId}
|
|
38
|
+
{...otherProps}
|
|
39
|
+
>
|
|
40
|
+
<Link
|
|
41
|
+
{...linkProps}
|
|
42
|
+
data-fs-search-product-card-link
|
|
43
|
+
title={name}
|
|
44
|
+
variant="display"
|
|
45
|
+
onClick={onLinkClick}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</Link>
|
|
49
|
+
</article>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
export default SearchProductCard
|