@faststore/components 2.0.49-alpha.0 → 2.0.52-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 (45) 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/index.d.ts +4 -0
  8. package/dist/index.js +2 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/molecules/Gift/Gift.d.ts +15 -0
  11. package/dist/molecules/Gift/Gift.js +9 -0
  12. package/dist/molecules/Gift/Gift.js.map +1 -0
  13. package/dist/molecules/Gift/GiftContent.d.ts +10 -0
  14. package/dist/molecules/Gift/GiftContent.js +6 -0
  15. package/dist/molecules/Gift/GiftContent.js.map +1 -0
  16. package/dist/molecules/Gift/GiftImage.d.ts +10 -0
  17. package/dist/molecules/Gift/GiftImage.js +6 -0
  18. package/dist/molecules/Gift/GiftImage.js.map +1 -0
  19. package/dist/molecules/Gift/index.d.ts +6 -0
  20. package/dist/molecules/Gift/index.js +4 -0
  21. package/dist/molecules/Gift/index.js.map +1 -0
  22. package/dist/molecules/RadioGroup/RadioGroup.d.ts +5 -0
  23. package/dist/molecules/RadioGroup/RadioGroup.js +10 -0
  24. package/dist/molecules/RadioGroup/RadioGroup.js.map +1 -0
  25. package/dist/molecules/RadioGroup/RadioOption.d.ts +19 -0
  26. package/dist/molecules/RadioGroup/RadioOption.js +11 -0
  27. package/dist/molecules/RadioGroup/RadioOption.js.map +1 -0
  28. package/dist/molecules/RadioGroup/index.d.ts +4 -0
  29. package/dist/molecules/RadioGroup/index.js +3 -0
  30. package/dist/molecules/RadioGroup/index.js.map +1 -0
  31. package/dist/molecules/RadioGroup/useRadioGroup.d.ts +17 -0
  32. package/dist/molecules/RadioGroup/useRadioGroup.js +10 -0
  33. package/dist/molecules/RadioGroup/useRadioGroup.js.map +1 -0
  34. package/package.json +2 -2
  35. package/src/assets/TagIcon.tsx +26 -0
  36. package/src/assets/index.ts +2 -1
  37. package/src/index.ts +18 -0
  38. package/src/molecules/Gift/Gift.tsx +30 -0
  39. package/src/molecules/Gift/GiftContent.tsx +29 -0
  40. package/src/molecules/Gift/GiftImage.tsx +22 -0
  41. package/src/molecules/Gift/index.tsx +8 -0
  42. package/src/molecules/RadioGroup/RadioGroup.tsx +25 -0
  43. package/src/molecules/RadioGroup/RadioOption.tsx +49 -0
  44. package/src/molecules/RadioGroup/index.tsx +5 -0
  45. package/src/molecules/RadioGroup/useRadioGroup.ts +33 -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":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,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,CAAC,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,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"}
package/dist/index.d.ts CHANGED
@@ -37,12 +37,16 @@ export { default as DiscountBadge } from './molecules/DiscountBadge';
37
37
  export type { DiscountBadgeProps } from './molecules/DiscountBadge';
38
38
  export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
39
39
  export type { DropdownProps, DropdownButtonProps, DropdownItemProps, DropdownMenuProps, } from './molecules/Dropdown';
40
+ export { default as Gift, GiftContent, GiftImage, } from './molecules/Gift';
41
+ export type { GiftProps, GiftContentProps, GiftImageProps, } from './molecules/Gift';
40
42
  export { default as InputField } from './molecules/InputField';
41
43
  export type { InputFieldProps } from './molecules/InputField';
42
44
  export { default as LinkButton } from './molecules/LinkButton';
43
45
  export type { LinkButtonProps } from './molecules/LinkButton';
44
46
  export { default as RadioField } from './molecules/RadioField';
45
47
  export type { RadioFieldProps } from './molecules/RadioField';
48
+ export { default as RadioGroup, RadioOption, } from './molecules/RadioGroup';
49
+ export type { RadioGroupProps, RadioOptionProps, } from './molecules/RadioGroup';
46
50
  export { default as Rating } from './molecules/Rating';
47
51
  export type { RatingProps } from './molecules/Rating';
48
52
  export { default as SelectField } from './molecules/SelectField';
package/dist/index.js CHANGED
@@ -22,9 +22,11 @@ export { default as CheckboxField } from './molecules/CheckboxField';
22
22
  export { default as IconButton } from './molecules/IconButton';
23
23
  export { default as DiscountBadge } from './molecules/DiscountBadge';
24
24
  export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
25
+ export { default as Gift, GiftContent, GiftImage, } from './molecules/Gift';
25
26
  export { default as InputField } from './molecules/InputField';
26
27
  export { default as LinkButton } from './molecules/LinkButton';
27
28
  export { default as RadioField } from './molecules/RadioField';
29
+ export { default as RadioGroup, RadioOption, } from './molecules/RadioGroup';
28
30
  export { default as Rating } from './molecules/Rating';
29
31
  export { default as SelectField } from './molecules/SelectField';
30
32
  export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './molecules/Table';
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,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AM,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,GACT,MAAM,mBAAmB,CAAA;AAS1B,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAG1E,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,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"}
@@ -0,0 +1,5 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import { RadioGroupContext } from './useRadioGroup';
3
+ export type RadioGroupProps = PropsWithChildren<RadioGroupContext>;
4
+ declare const RadioGroup: ({ name, onChange, children, selectedValue, }: RadioGroupProps) => JSX.Element;
5
+ export default RadioGroup;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { RadioGroupContext } from './useRadioGroup';
3
+ const RadioGroup = ({ name, onChange, children, selectedValue, }) => {
4
+ const contextValues = React.useMemo(() => {
5
+ return { name, selectedValue, onChange };
6
+ }, [name, selectedValue, onChange]);
7
+ return (React.createElement(RadioGroupContext.Provider, { value: contextValues }, children));
8
+ };
9
+ export default RadioGroup;
10
+ //# sourceMappingURL=RadioGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/molecules/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAInD,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,aAAa,GACG,EAAE,EAAE;IACpB,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACvC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;IAC1C,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEnC,OAAO,CACL,oBAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,IAC7C,QAAQ,CACkB,CAC9B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { InputHTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface RadioOptionProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress,
6
+ * testing-library, and jest).
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * Attribute to set aria-label option as required.
11
+ */
12
+ label: string;
13
+ /**
14
+ * Value to be emitted when radio is clicked.
15
+ */
16
+ value: string | number;
17
+ }
18
+ declare const RadioOption: React.ForwardRefExoticComponent<RadioOptionProps & React.RefAttributes<HTMLInputElement>>;
19
+ export default RadioOption;
@@ -0,0 +1,11 @@
1
+ import React, { forwardRef } from 'react';
2
+ import Radio from '../../atoms/Radio';
3
+ import { useRadioGroup } from './useRadioGroup';
4
+ const RadioOption = forwardRef(function RadioOption({ label, value, children, testId = 'fs-radio-group-option', ...otherProps }, ref) {
5
+ const { name, selectedValue, onChange } = useRadioGroup();
6
+ return (React.createElement("label", { "aria-label": label, "data-fs-radio-group-option": true },
7
+ React.createElement(Radio, { "data-fs-radio-option-item": true, ref: ref, name: name, checked: value === selectedValue, onChange: onChange, value: value, testId: testId, ...otherProps }),
8
+ children));
9
+ });
10
+ export default RadioOption;
11
+ //# sourceMappingURL=RadioOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioOption.js","sourceRoot":"","sources":["../../../src/molecules/RadioGroup/RadioOption.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,MAAM,mBAAmB,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAmB/C,MAAM,WAAW,GAAG,UAAU,CAC5B,SAAS,WAAW,CAClB,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,uBAAuB,EAAE,GAAG,UAAU,EAAE,EAC3E,GAAG;IAEH,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAA;IAEzD,OAAO,CACL,6CAAmB,KAAK;QACtB,oBAAC,KAAK,uCAEJ,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,KAAK,KAAK,aAAa,EAChC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,KACV,UAAU,GACd;QACD,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { default } from './RadioGroup';
2
+ export type { RadioGroupProps } from './RadioGroup';
3
+ export { default as RadioOption } from './RadioOption';
4
+ export type { RadioOptionProps } from './RadioOption';
@@ -0,0 +1,3 @@
1
+ export { default } from './RadioGroup';
2
+ export { default as RadioOption } from './RadioOption';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molecules/RadioGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { ChangeEventHandler } from 'react';
2
+ export interface RadioGroupContext {
3
+ /**
4
+ * Name to link children by context.
5
+ */
6
+ name: string;
7
+ /**
8
+ * Value of checked child.
9
+ */
10
+ selectedValue?: string | number;
11
+ /**
12
+ * Function that is triggered when any children is checked.
13
+ */
14
+ onChange?: ChangeEventHandler<HTMLInputElement>;
15
+ }
16
+ export declare const RadioGroupContext: import("react").Context<RadioGroupContext | undefined>;
17
+ export declare function useRadioGroup(): RadioGroupContext;
@@ -0,0 +1,10 @@
1
+ import { createContext, useContext } from 'react';
2
+ export const RadioGroupContext = createContext(undefined);
3
+ export function useRadioGroup() {
4
+ const context = useContext(RadioGroupContext);
5
+ if (!context) {
6
+ throw new Error(`useRadioOption hook cannot be used outside the RadioGroup context`);
7
+ }
8
+ return context;
9
+ }
10
+ //# sourceMappingURL=useRadioGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRadioGroup.js","sourceRoot":"","sources":["../../../src/molecules/RadioGroup/useRadioGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAiBjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAC5C,SAAS,CACV,CAAA;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE7C,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAA;KACF;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/components",
3
- "version": "2.0.49-alpha.0",
3
+ "version": "2.0.52-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": "7046452f096b9b7e33b10db94e0213c3f10f91b5"
33
+ "gitHead": "fe474595d374d91b69063e0b2ed6e56eee0c36d0"
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'
package/src/index.ts CHANGED
@@ -62,12 +62,30 @@ export type {
62
62
  DropdownItemProps,
63
63
  DropdownMenuProps,
64
64
  } from './molecules/Dropdown'
65
+ export {
66
+ default as Gift,
67
+ GiftContent,
68
+ GiftImage,
69
+ } from './molecules/Gift'
70
+ export type {
71
+ GiftProps,
72
+ GiftContentProps,
73
+ GiftImageProps,
74
+ } from './molecules/Gift'
65
75
  export { default as InputField } from './molecules/InputField'
66
76
  export type { InputFieldProps } from './molecules/InputField'
67
77
  export { default as LinkButton } from './molecules/LinkButton'
68
78
  export type { LinkButtonProps } from './molecules/LinkButton'
69
79
  export { default as RadioField } from './molecules/RadioField'
70
80
  export type { RadioFieldProps } from './molecules/RadioField'
81
+ export {
82
+ default as RadioGroup,
83
+ RadioOption,
84
+ } from './molecules/RadioGroup'
85
+ export type {
86
+ RadioGroupProps,
87
+ RadioOptionProps,
88
+ } from './molecules/RadioGroup'
71
89
  export { default as Rating } from './molecules/Rating'
72
90
  export type { RatingProps } from './molecules/Rating'
73
91
  export { default as SelectField } from './molecules/SelectField'
@@ -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'
@@ -0,0 +1,25 @@
1
+ import type { PropsWithChildren } from 'react'
2
+ import React from 'react'
3
+
4
+ import { RadioGroupContext } from './useRadioGroup'
5
+
6
+ export type RadioGroupProps = PropsWithChildren<RadioGroupContext>
7
+
8
+ const RadioGroup = ({
9
+ name,
10
+ onChange,
11
+ children,
12
+ selectedValue,
13
+ }: RadioGroupProps) => {
14
+ const contextValues = React.useMemo(() => {
15
+ return { name, selectedValue, onChange }
16
+ }, [name, selectedValue, onChange])
17
+
18
+ return (
19
+ <RadioGroupContext.Provider value={contextValues}>
20
+ {children}
21
+ </RadioGroupContext.Provider>
22
+ )
23
+ }
24
+
25
+ export default RadioGroup
@@ -0,0 +1,49 @@
1
+ import type { InputHTMLAttributes } from 'react'
2
+ import React, { forwardRef } from 'react'
3
+
4
+ import Radio from '../../atoms/Radio'
5
+ import { useRadioGroup } from './useRadioGroup'
6
+
7
+ export interface RadioOptionProps
8
+ extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
9
+ /**
10
+ * ID to find this component in testing tools (e.g.: cypress,
11
+ * testing-library, and jest).
12
+ */
13
+ testId?: string
14
+ /**
15
+ * Attribute to set aria-label option as required.
16
+ */
17
+ label: string
18
+ /**
19
+ * Value to be emitted when radio is clicked.
20
+ */
21
+ value: string | number
22
+ }
23
+
24
+ const RadioOption = forwardRef<HTMLInputElement, RadioOptionProps>(
25
+ function RadioOption(
26
+ { label, value, children, testId = 'fs-radio-group-option', ...otherProps },
27
+ ref
28
+ ) {
29
+ const { name, selectedValue, onChange } = useRadioGroup()
30
+
31
+ return (
32
+ <label aria-label={label} data-fs-radio-group-option>
33
+ <Radio
34
+ data-fs-radio-option-item
35
+ ref={ref}
36
+ name={name}
37
+ checked={value === selectedValue}
38
+ onChange={onChange}
39
+ value={value}
40
+ testId={testId}
41
+ {...otherProps}
42
+ />
43
+ {children}
44
+ </label>
45
+ )
46
+ }
47
+ )
48
+
49
+ export default RadioOption
@@ -0,0 +1,5 @@
1
+ export { default } from './RadioGroup'
2
+ export type { RadioGroupProps } from './RadioGroup'
3
+
4
+ export { default as RadioOption } from './RadioOption'
5
+ export type { RadioOptionProps } from './RadioOption'
@@ -0,0 +1,33 @@
1
+ import type { ChangeEventHandler } from 'react'
2
+ import { createContext, useContext } from 'react'
3
+
4
+ export interface RadioGroupContext {
5
+ /**
6
+ * Name to link children by context.
7
+ */
8
+ name: string
9
+ /**
10
+ * Value of checked child.
11
+ */
12
+ selectedValue?: string | number
13
+ /**
14
+ * Function that is triggered when any children is checked.
15
+ */
16
+ onChange?: ChangeEventHandler<HTMLInputElement>
17
+ }
18
+
19
+ export const RadioGroupContext = createContext<RadioGroupContext | undefined>(
20
+ undefined
21
+ )
22
+
23
+ export function useRadioGroup() {
24
+ const context = useContext(RadioGroupContext)
25
+
26
+ if (!context) {
27
+ throw new Error(
28
+ `useRadioOption hook cannot be used outside the RadioGroup context`
29
+ )
30
+ }
31
+
32
+ return context
33
+ }