@faststore/components 2.0.50-alpha.0 → 2.0.53-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 (44) hide show
  1. package/dist/assets/TagIcon.d.ts +3 -0
  2. package/dist/assets/TagIcon.js +8 -0
  3. package/dist/assets/TagIcon.js.map +1 -0
  4. package/dist/assets/index.d.ts +2 -1
  5. package/dist/assets/index.js +2 -1
  6. package/dist/assets/index.js.map +1 -1
  7. package/dist/atoms/Button/Button.d.ts +9 -1
  8. package/dist/atoms/Button/Button.js +7 -4
  9. package/dist/atoms/Button/Button.js.map +1 -1
  10. package/dist/atoms/Loader/Loader.d.ts +13 -0
  11. package/dist/atoms/Loader/Loader.js +9 -0
  12. package/dist/atoms/Loader/Loader.js.map +1 -0
  13. package/dist/atoms/Loader/index.d.ts +2 -0
  14. package/dist/atoms/Loader/index.js +2 -0
  15. package/dist/atoms/Loader/index.js.map +1 -0
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/molecules/BuyButton/BuyButton.js +2 -4
  20. package/dist/molecules/BuyButton/BuyButton.js.map +1 -1
  21. package/dist/molecules/Gift/Gift.d.ts +15 -0
  22. package/dist/molecules/Gift/Gift.js +9 -0
  23. package/dist/molecules/Gift/Gift.js.map +1 -0
  24. package/dist/molecules/Gift/GiftContent.d.ts +10 -0
  25. package/dist/molecules/Gift/GiftContent.js +6 -0
  26. package/dist/molecules/Gift/GiftContent.js.map +1 -0
  27. package/dist/molecules/Gift/GiftImage.d.ts +10 -0
  28. package/dist/molecules/Gift/GiftImage.js +6 -0
  29. package/dist/molecules/Gift/GiftImage.js.map +1 -0
  30. package/dist/molecules/Gift/index.d.ts +6 -0
  31. package/dist/molecules/Gift/index.js +4 -0
  32. package/dist/molecules/Gift/index.js.map +1 -0
  33. package/package.json +2 -2
  34. package/src/assets/TagIcon.tsx +26 -0
  35. package/src/assets/index.ts +2 -1
  36. package/src/atoms/Button/Button.tsx +21 -3
  37. package/src/atoms/Loader/Loader.tsx +33 -0
  38. package/src/atoms/Loader/index.ts +2 -0
  39. package/src/index.ts +12 -0
  40. package/src/molecules/BuyButton/BuyButton.tsx +8 -3
  41. package/src/molecules/Gift/Gift.tsx +30 -0
  42. package/src/molecules/Gift/GiftContent.tsx +29 -0
  43. package/src/molecules/Gift/GiftImage.tsx +22 -0
  44. package/src/molecules/Gift/index.tsx +8 -0
@@ -0,0 +1,3 @@
1
+ import type { FC } from 'react';
2
+ declare const TagIcon: FC;
3
+ export default TagIcon;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ // Icon from Phosphor Icons
3
+ const TagIcon = () => (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "192", height: "192", fill: "currentColor", viewBox: "0 0 256 256" },
4
+ React.createElement("rect", { width: "256", height: "256", fill: "none" }),
5
+ React.createElement("path", { d: "M122.7,25.9,42,42,25.9,122.7a8,8,0,0,0,2.2,7.2L132.5,234.3a7.9,7.9,0,0,0,11.3,0l90.5-90.5a7.9,7.9,0,0,0,0-11.3L129.9,28.1A8,8,0,0,0,122.7,25.9Z", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" }),
6
+ React.createElement("circle", { cx: "84", cy: "84", r: "12" })));
7
+ export default TagIcon;
8
+ //# sourceMappingURL=TagIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagIcon.js","sourceRoot":"","sources":["../../src/assets/TagIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,2BAA2B;AAC3B,MAAM,OAAO,GAAO,GAAG,EAAE,CAAC,CACxB,6BACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,aAAa;IAErB,8BAAM,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,GAAQ;IAClD,8BACE,CAAC,EAAC,iJAAiJ,EACnJ,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,IAAI,GACV;IACR,gCAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAU,CACpC,CACP,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -1,5 +1,5 @@
1
- export { default as ArrowRight } from './ArrowRight';
2
1
  export { default as ArrowElbowDownRight } from './ArrowElbowDownRight';
2
+ export { default as ArrowRight } from './ArrowRight';
3
3
  export { default as CaretDown } from './CaretDown';
4
4
  export { default as Checked } from './Checked';
5
5
  export { default as Heart } from './Heart';
@@ -11,5 +11,6 @@ export { default as PlusCircle } from './PlusCircle';
11
11
  export { default as Ruler } from './Ruler';
12
12
  export { default as ShoppingCart } from './ShoppingCart';
13
13
  export { default as Star } from './Star';
14
+ export { default as TagIcon } from './TagIcon';
14
15
  export { default as X } from './X';
15
16
  export { default as XCircle } from './XCircle';
@@ -1,5 +1,5 @@
1
- export { default as ArrowRight } from './ArrowRight';
2
1
  export { default as ArrowElbowDownRight } from './ArrowElbowDownRight';
2
+ export { default as ArrowRight } from './ArrowRight';
3
3
  export { default as CaretDown } from './CaretDown';
4
4
  export { default as Checked } from './Checked';
5
5
  export { default as Heart } from './Heart';
@@ -11,6 +11,7 @@ export { default as PlusCircle } from './PlusCircle';
11
11
  export { default as Ruler } from './Ruler';
12
12
  export { default as ShoppingCart } from './ShoppingCart';
13
13
  export { default as Star } from './Star';
14
+ export { default as TagIcon } from './TagIcon';
14
15
  export { default as X } from './X';
15
16
  export { default as XCircle } from './XCircle';
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],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,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA"}
@@ -21,13 +21,21 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
21
21
  */
22
22
  inverse?: boolean;
23
23
  /**
24
- * Specifies that this button should be disabled
24
+ * Specifies that this button should be disabled.
25
25
  */
26
26
  disabled?: boolean;
27
27
  /**
28
28
  * A React component that will be rendered as an icon.
29
29
  */
30
30
  icon?: ReactNode;
31
+ /**
32
+ * Boolean that represents a loading state.
33
+ */
34
+ loading?: boolean;
35
+ /**
36
+ * Specifies a label for loading state.
37
+ */
38
+ loadingLabel?: string;
31
39
  /**
32
40
  * Specifies where the icon should be positioned
33
41
  */
@@ -1,9 +1,12 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { Icon } from '../../index';
3
- const Button = forwardRef(function Button({ children, variant, inverse, size = 'regular', testId = 'fs-button', icon, iconPosition = 'left', disabled, ...otherProps }, ref) {
4
- return (React.createElement("button", { ref: ref, "data-fs-button": true, "data-fs-button-inverse": inverse, "data-fs-button-size": size, "data-fs-button-variant": variant, disabled: disabled, "data-testid": testId, ...otherProps },
2
+ import { Icon, Loader } from '../../index';
3
+ const Button = forwardRef(function Button({ children, variant, inverse, size = 'regular', testId = 'fs-button', loading, loadingLabel, icon, iconPosition = 'left', disabled, ...otherProps }, ref) {
4
+ return (React.createElement("button", { ref: ref, "data-fs-button": true, "data-fs-button-inverse": inverse, "data-fs-button-size": size, "data-fs-button-loading": loading, "data-fs-button-variant": variant, disabled: disabled, "data-testid": testId, ...otherProps },
5
+ loading && (React.createElement("p", { "data-fs-button-loading-label": true },
6
+ loadingLabel,
7
+ React.createElement(Loader, { variant: variant === 'primary' && !inverse ? 'light' : 'dark' }))),
5
8
  icon && iconPosition === 'left' && React.createElement(Icon, { component: icon }),
6
- children,
9
+ React.createElement("span", null, children),
7
10
  icon && iconPosition === 'right' && React.createElement(Icon, { component: icon })));
8
11
  });
9
12
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/atoms/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAqClC,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CACvE,EACE,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,GAAG,SAAS,EAChB,MAAM,GAAG,WAAW,EACpB,IAAI,EACJ,YAAY,GAAG,MAAM,EACrB,QAAQ,EACR,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,oDAEgB,OAAO,yBACV,IAAI,4BACD,OAAO,EAC/B,QAAQ,EAAE,QAAQ,iBACL,MAAM,KACf,UAAU;QAEb,IAAI,IA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AAe,MAAM,CAAA"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export type LoaderProps = {
3
+ /**
4
+ * Specifies the component color variant.
5
+ */
6
+ variant?: 'light' | 'dark';
7
+ /**
8
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
9
+ */
10
+ testId?: string;
11
+ };
12
+ declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLDivElement>>;
13
+ export default Loader;
@@ -0,0 +1,9 @@
1
+ import React, { forwardRef } from 'react';
2
+ const Loader = forwardRef(function Loader({ variant = 'dark', testId = 'fs-loader', ...otherProps }, ref) {
3
+ return (React.createElement("div", { ref: ref, "data-fs-loader": true, "data-fs-loader-variant": variant, "data-testid": testId, ...otherProps },
4
+ React.createElement("span", { "data-fs-loader-item": true }),
5
+ React.createElement("span", { "data-fs-loader-item": true }),
6
+ React.createElement("span", { "data-fs-loader-item": true })));
7
+ });
8
+ export default Loader;
9
+ //# sourceMappingURL=Loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../src/atoms/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAazC,MAAM,MAAM,GAAG,UAAU,CAA8B,SAAS,MAAM,CACpE,EAAE,OAAO,GAAG,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,UAAU,EAAe,EACtE,GAAG;IAEH,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,oDAEgB,OAAO,iBAClB,MAAM,KACf,UAAU;QAEd,4DAAiC;QACjC,4DAAiC;QACjC,4DAAiC,CAC7B,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,MAAM,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Loader';
2
+ export type { LoaderProps } from './Loader';
@@ -0,0 +1,2 @@
1
+ export { default } from './Loader';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/atoms/Loader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ export { default as Label } from './atoms/Label';
13
13
  export type { LabelProps } from './atoms/Label';
14
14
  export { default as Link } from './atoms/Link';
15
15
  export type { LinkProps, LinkElementType } from './atoms/Link';
16
+ export { default as Loader } from './atoms/Loader';
17
+ export type { LoaderProps } from './atoms/Loader';
16
18
  export { default as List } from './atoms/List';
17
19
  export type { ListProps } from './atoms/List';
18
20
  export { default as Overlay } from './atoms/Overlay';
@@ -37,6 +39,8 @@ export { default as DiscountBadge } from './molecules/DiscountBadge';
37
39
  export type { DiscountBadgeProps } from './molecules/DiscountBadge';
38
40
  export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
39
41
  export type { DropdownProps, DropdownButtonProps, DropdownItemProps, DropdownMenuProps, } from './molecules/Dropdown';
42
+ export { default as Gift, GiftContent, GiftImage, } from './molecules/Gift';
43
+ export type { GiftProps, GiftContentProps, GiftImageProps, } from './molecules/Gift';
40
44
  export { default as InputField } from './molecules/InputField';
41
45
  export type { InputFieldProps } from './molecules/InputField';
42
46
  export { default as LinkButton } from './molecules/LinkButton';
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export { default as Icon } from './atoms/Icon';
8
8
  export { default as Input } from './atoms/Input';
9
9
  export { default as Label } from './atoms/Label';
10
10
  export { default as Link } from './atoms/Link';
11
+ export { default as Loader } from './atoms/Loader';
11
12
  export { default as List } from './atoms/List';
12
13
  export { default as Overlay } from './atoms/Overlay';
13
14
  export { default as Price } from './atoms/Price';
@@ -22,6 +23,7 @@ export { default as CheckboxField } from './molecules/CheckboxField';
22
23
  export { default as IconButton } from './molecules/IconButton';
23
24
  export { default as DiscountBadge } from './molecules/DiscountBadge';
24
25
  export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
26
+ export { default as Gift, GiftContent, GiftImage, } from './molecules/Gift';
25
27
  export { default as InputField } from './molecules/InputField';
26
28
  export { default as LinkButton } from './molecules/LinkButton';
27
29
  export { default as RadioField } from './molecules/RadioField';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,cAAc,UAAU,CAAA;AAExB,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,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,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,YAAY;AACZ,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,uBAAuB,CAAA;AA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kBAAkB,CAAA"}
@@ -1,10 +1,8 @@
1
1
  import React from 'react';
2
- import { Button, Icon } from '../../index';
2
+ import { Button } from '../../index';
3
3
  import { ShoppingCart } from '../../assets';
4
4
  function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
5
- return (React.createElement(Button, { "data-fs-buy-button": true, "data-testid": testId, ...otherProps },
6
- React.createElement(Icon, { component: React.createElement(ShoppingCart, null) }),
7
- children));
5
+ return (React.createElement(Button, { "data-fs-buy-button": true, icon: React.createElement(ShoppingCart, null), iconPosition: "left", "data-testid": testId, ...otherProps }, children));
8
6
  }
9
7
  export default BuyButton;
10
8
  //# sourceMappingURL=BuyButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BuyButton.js","sourceRoot":"","sources":["../../../src/molecules/BuyButton/BuyButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3C,SAAS,SAAS,CAAC,EACjB,MAAM,GAAG,eAAe,EACxB,IAAI,EACJ,QAAQ,EACR,GAAG,UAAU,EACE;IACf,OAAO,CACL,oBAAC,MAAM,+CAAiC,MAAM,KAAM,UAAU;QAC5D,oBAAC,IAAI,IAAC,SAAS,EAAE,oBAAC,YAAY,OAAG,GAAI;QACpC,QAAQ,CACF,CACV,CAAA;AACH,CAAC;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"BuyButton.js","sourceRoot":"","sources":["../../../src/molecules/BuyButton/BuyButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3C,SAAS,SAAS,CAAC,EACjB,MAAM,GAAG,eAAe,EACxB,IAAI,EACJ,QAAQ,EACR,GAAG,UAAU,EACE;IACf,OAAO,CACL,oBAAC,MAAM,gCAEL,IAAI,EAAE,oBAAC,YAAY,OAAG,EACtB,YAAY,EAAC,MAAM,iBACN,MAAM,KACf,UAAU,IAEb,QAAQ,CACF,CACV,CAAA;AACH,CAAC;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ import React from 'react';
3
+ export interface GiftProps extends HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress,
6
+ * testing-library, and jest).
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * A React component that will be rendered as an icon.
11
+ */
12
+ icon?: ReactNode;
13
+ }
14
+ declare const Gift: React.ForwardRefExoticComponent<GiftProps & React.RefAttributes<HTMLDivElement>>;
15
+ export default Gift;
@@ -0,0 +1,9 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { Icon } from '../..';
3
+ const Gift = forwardRef(function Gift({ icon, testId = 'fs-gift', children, ...otherProps }, ref) {
4
+ return (React.createElement("div", { ref: ref, "data-fs-gift": true, "data-testid": testId, ...otherProps },
5
+ icon && React.createElement(Icon, { component: icon, "data-fs-gift-icon": true }),
6
+ React.createElement("div", { "data-fs-gift-wrapper": true }, children)));
7
+ });
8
+ export default Gift;
9
+ //# sourceMappingURL=Gift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gift.js","sourceRoot":"","sources":["../../../src/molecules/Gift/Gift.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAc5B,MAAM,IAAI,GAAG,UAAU,CAA4B,SAAS,IAAI,CAC9D,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACrD,GAAG;IAEH,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,uCAA4B,MAAM,KAAM,UAAU;QAC5D,IAAI,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAE,IAAI,8BAAsB;QACpD,6DAA2B,QAAQ,CAAO,CACtC,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,IAAI,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
+ */
7
+ testId?: string;
8
+ }
9
+ declare const GiftContent: React.ForwardRefExoticComponent<GiftContentProps & React.RefAttributes<HTMLElement>>;
10
+ export default GiftContent;
@@ -0,0 +1,6 @@
1
+ import React, { forwardRef } from 'react';
2
+ const GiftContent = forwardRef(function GiftContent({ testId = 'fs-gift-content', children, ...otherProps }, ref) {
3
+ return (React.createElement("section", { ref: ref, "data-fs-gift-content": true, "data-testid": testId, ...otherProps }, children));
4
+ });
5
+ export default GiftContent;
6
+ //# sourceMappingURL=GiftContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiftContent.js","sourceRoot":"","sources":["../../../src/molecules/Gift/GiftContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASzC,MAAM,WAAW,GAAG,UAAU,CAC5B,SAAS,WAAW,CAClB,EAAE,MAAM,GAAG,iBAAiB,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACvD,GAAG;IAEH,OAAO,CACL,iCACE,GAAG,EAAE,GAAG,+CAEK,MAAM,KACf,UAAU,IAEb,QAAQ,CACD,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface GiftImageProps extends HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
+ */
7
+ testId?: string;
8
+ }
9
+ declare const GiftImage: React.ForwardRefExoticComponent<GiftImageProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default GiftImage;
@@ -0,0 +1,6 @@
1
+ import React, { forwardRef } from 'react';
2
+ const GiftImage = forwardRef(function GiftImage({ testId = 'fs-gift-image', children, ...otherProps }, ref) {
3
+ return (React.createElement("div", { ref: ref, "data-fs-gift-image": true, "data-testid": testId, ...otherProps }, children));
4
+ });
5
+ export default GiftImage;
6
+ //# sourceMappingURL=GiftImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiftImage.js","sourceRoot":"","sources":["../../../src/molecules/Gift/GiftImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASzC,MAAM,SAAS,GAAG,UAAU,CAAiC,SAAS,SAAS,CAC7E,EAAE,MAAM,GAAG,eAAe,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACrD,GAAG;IAEH,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,6CAAkC,MAAM,KAAM,UAAU,IAClE,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
@@ -0,0 +1,6 @@
1
+ export { default } from './Gift';
2
+ export type { GiftProps } from './Gift';
3
+ export { default as GiftContent } from './GiftContent';
4
+ export type { GiftContentProps } from './GiftContent';
5
+ export { default as GiftImage } from './GiftImage';
6
+ export type { GiftImageProps } from './GiftImage';
@@ -0,0 +1,4 @@
1
+ export { default } from './Gift';
2
+ export { default as GiftContent } from './GiftContent';
3
+ export { default as GiftImage } from './GiftImage';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molecules/Gift/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGhC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AAGtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/components",
3
- "version": "2.0.50-alpha.0",
3
+ "version": "2.0.53-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": "ff4612f903a6be4e99df0b614a032b21ad7dc711"
33
+ "gitHead": "a9a211450d2173e08fd8b8dcf4a6da4d78590a71"
34
34
  }
@@ -0,0 +1,26 @@
1
+ import type { FC } from 'react'
2
+ import React from 'react'
3
+
4
+ // Icon from Phosphor Icons
5
+ const TagIcon: FC = () => (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width="192"
9
+ height="192"
10
+ fill="currentColor"
11
+ viewBox="0 0 256 256"
12
+ >
13
+ <rect width="256" height="256" fill="none"></rect>
14
+ <path
15
+ d="M122.7,25.9,42,42,25.9,122.7a8,8,0,0,0,2.2,7.2L132.5,234.3a7.9,7.9,0,0,0,11.3,0l90.5-90.5a7.9,7.9,0,0,0,0-11.3L129.9,28.1A8,8,0,0,0,122.7,25.9Z"
16
+ fill="none"
17
+ stroke="currentColor"
18
+ strokeLinecap="round"
19
+ strokeLinejoin="round"
20
+ strokeWidth="16"
21
+ ></path>
22
+ <circle cx="84" cy="84" r="12"></circle>
23
+ </svg>
24
+ )
25
+
26
+ export default TagIcon
@@ -1,5 +1,5 @@
1
- export { default as ArrowRight } from './ArrowRight'
2
1
  export { default as ArrowElbowDownRight } from './ArrowElbowDownRight'
2
+ export { default as ArrowRight } from './ArrowRight'
3
3
  export { default as CaretDown } from './CaretDown'
4
4
  export { default as Checked } from './Checked'
5
5
  export { default as Heart } from './Heart'
@@ -11,5 +11,6 @@ export { default as PlusCircle } from './PlusCircle'
11
11
  export { default as Ruler } from './Ruler'
12
12
  export { default as ShoppingCart } from './ShoppingCart'
13
13
  export { default as Star } from './Star'
14
+ export { default as TagIcon } from './TagIcon'
14
15
  export { default as X } from './X'
15
16
  export { default as XCircle } from './XCircle'
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode, ButtonHTMLAttributes } from 'react'
2
2
  import React, { forwardRef } from 'react'
3
- import { Icon } from '../../index'
3
+ import { Icon, Loader } from '../../index'
4
4
 
5
5
  export type Variant = 'primary' | 'secondary' | 'tertiary'
6
6
  export type Size = 'small' | 'regular'
@@ -24,13 +24,21 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
24
24
  */
25
25
  inverse?: boolean
26
26
  /**
27
- * Specifies that this button should be disabled
27
+ * Specifies that this button should be disabled.
28
28
  */
29
29
  disabled?: boolean
30
30
  /**
31
31
  * A React component that will be rendered as an icon.
32
32
  */
33
33
  icon?: ReactNode
34
+ /**
35
+ * Boolean that represents a loading state.
36
+ */
37
+ loading?: boolean
38
+ /**
39
+ * Specifies a label for loading state.
40
+ */
41
+ loadingLabel?: string
34
42
  /**
35
43
  * Specifies where the icon should be positioned
36
44
  */
@@ -44,6 +52,8 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
44
52
  inverse,
45
53
  size = 'regular',
46
54
  testId = 'fs-button',
55
+ loading,
56
+ loadingLabel,
47
57
  icon,
48
58
  iconPosition = 'left',
49
59
  disabled,
@@ -51,19 +61,27 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
51
61
  },
52
62
  ref
53
63
  ) {
64
+
54
65
  return (
55
66
  <button
56
67
  ref={ref}
57
68
  data-fs-button
58
69
  data-fs-button-inverse={inverse}
59
70
  data-fs-button-size={size}
71
+ data-fs-button-loading={loading}
60
72
  data-fs-button-variant={variant}
61
73
  disabled={disabled}
62
74
  data-testid={testId}
63
75
  {...otherProps}
64
76
  >
77
+ {loading && (
78
+ <p data-fs-button-loading-label>
79
+ {loadingLabel}
80
+ <Loader variant={variant === 'primary' && !inverse ? 'light' : 'dark'} />
81
+ </p>
82
+ )}
65
83
  {icon && iconPosition === 'left' && <Icon component={icon} />}
66
- {children}
84
+ <span>{children}</span>
67
85
  {icon && iconPosition === 'right' && <Icon component={icon} />}
68
86
  </button>
69
87
  )
@@ -0,0 +1,33 @@
1
+ import React, { forwardRef } from 'react'
2
+
3
+ export type LoaderProps = {
4
+ /**
5
+ * Specifies the component color variant.
6
+ */
7
+ variant?: 'light' | 'dark'
8
+ /**
9
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
10
+ */
11
+ testId?: string
12
+ }
13
+
14
+ const Loader = forwardRef<HTMLDivElement, LoaderProps>(function Loader(
15
+ { variant = 'dark', testId = 'fs-loader', ...otherProps }: LoaderProps,
16
+ ref
17
+ ) {
18
+ return (
19
+ <div
20
+ ref={ref}
21
+ data-fs-loader
22
+ data-fs-loader-variant={variant}
23
+ data-testid={testId}
24
+ {...otherProps}
25
+ >
26
+ <span data-fs-loader-item></span>
27
+ <span data-fs-loader-item></span>
28
+ <span data-fs-loader-item></span>
29
+ </div>
30
+ )
31
+ })
32
+
33
+ export default Loader
@@ -0,0 +1,2 @@
1
+ export { default } from './Loader'
2
+ export type { LoaderProps } from './Loader'
package/src/index.ts CHANGED
@@ -16,6 +16,8 @@ export { default as Label } from './atoms/Label'
16
16
  export type { LabelProps } from './atoms/Label'
17
17
  export { default as Link } from './atoms/Link'
18
18
  export type { LinkProps, LinkElementType } from './atoms/Link'
19
+ export { default as Loader } from './atoms/Loader'
20
+ export type { LoaderProps } from './atoms/Loader'
19
21
  export { default as List } from './atoms/List'
20
22
  export type { ListProps } from './atoms/List'
21
23
  export { default as Overlay } from './atoms/Overlay'
@@ -62,6 +64,16 @@ export type {
62
64
  DropdownItemProps,
63
65
  DropdownMenuProps,
64
66
  } from './molecules/Dropdown'
67
+ export {
68
+ default as Gift,
69
+ GiftContent,
70
+ GiftImage,
71
+ } from './molecules/Gift'
72
+ export type {
73
+ GiftProps,
74
+ GiftContentProps,
75
+ GiftImageProps,
76
+ } from './molecules/Gift'
65
77
  export { default as InputField } from './molecules/InputField'
66
78
  export type { InputFieldProps } from './molecules/InputField'
67
79
  export { default as LinkButton } from './molecules/LinkButton'
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
- import { Button, Icon } from '../../index'
3
+ import { Button } from '../../index'
4
4
  import type { ButtonProps } from '../../index'
5
5
  import { ShoppingCart } from '../../assets'
6
6
 
@@ -13,8 +13,13 @@ function BuyButton({
13
13
  ...otherProps
14
14
  }: BuyButtonProps) {
15
15
  return (
16
- <Button data-fs-buy-button data-testid={testId} {...otherProps}>
17
- <Icon component={<ShoppingCart />} />
16
+ <Button
17
+ data-fs-buy-button
18
+ icon={<ShoppingCart />}
19
+ iconPosition="left"
20
+ data-testid={testId}
21
+ {...otherProps}
22
+ >
18
23
  {children}
19
24
  </Button>
20
25
  )
@@ -0,0 +1,30 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react'
2
+ import React, { forwardRef } from 'react'
3
+
4
+ import { Icon } from '../..'
5
+
6
+ export interface GiftProps 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
+ * A React component that will be rendered as an icon.
14
+ */
15
+ icon?: ReactNode
16
+ }
17
+
18
+ const Gift = forwardRef<HTMLDivElement, GiftProps>(function Gift(
19
+ { icon, testId = 'fs-gift', children, ...otherProps },
20
+ ref
21
+ ) {
22
+ return (
23
+ <div ref={ref} data-fs-gift data-testid={testId} {...otherProps}>
24
+ {icon && <Icon component={icon} data-fs-gift-icon />}
25
+ <div data-fs-gift-wrapper>{children}</div>
26
+ </div>
27
+ )
28
+ })
29
+
30
+ export default Gift
@@ -0,0 +1,29 @@
1
+ import type { HTMLAttributes } from 'react'
2
+ import React, { forwardRef } from 'react'
3
+
4
+ export interface GiftContentProps extends HTMLAttributes<HTMLElement> {
5
+ /**
6
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
7
+ */
8
+ testId?: string
9
+ }
10
+
11
+ const GiftContent = forwardRef<HTMLElement, GiftContentProps>(
12
+ function GiftContent(
13
+ { testId = 'fs-gift-content', children, ...otherProps },
14
+ ref
15
+ ) {
16
+ return (
17
+ <section
18
+ ref={ref}
19
+ data-fs-gift-content
20
+ data-testid={testId}
21
+ {...otherProps}
22
+ >
23
+ {children}
24
+ </section>
25
+ )
26
+ }
27
+ )
28
+
29
+ export default GiftContent
@@ -0,0 +1,22 @@
1
+ import type { HTMLAttributes } from 'react'
2
+ import React, { forwardRef } from 'react'
3
+
4
+ export interface GiftImageProps 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
+
11
+ const GiftImage = forwardRef<HTMLDivElement, GiftImageProps>(function GiftImage(
12
+ { testId = 'fs-gift-image', children, ...otherProps },
13
+ ref
14
+ ) {
15
+ return (
16
+ <div ref={ref} data-fs-gift-image data-testid={testId} {...otherProps}>
17
+ {children}
18
+ </div>
19
+ )
20
+ })
21
+
22
+ export default GiftImage
@@ -0,0 +1,8 @@
1
+ export { default } from './Gift'
2
+ export type { GiftProps } from './Gift'
3
+
4
+ export { default as GiftContent } from './GiftContent'
5
+ export type { GiftContentProps } from './GiftContent'
6
+
7
+ export { default as GiftImage } from './GiftImage'
8
+ export type { GiftImageProps } from './GiftImage'