@faststore/ui 1.3.17 → 1.3.21

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 (42) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/molecules/Alert/Alert.d.ts +11 -0
  4. package/dist/molecules/Alert/index.d.ts +2 -0
  5. package/dist/molecules/Alert/stories/Alert.stories.d.ts +5 -0
  6. package/dist/molecules/Banner/Banner.d.ts +13 -0
  7. package/dist/molecules/Banner/BannerContent.d.ts +10 -0
  8. package/dist/molecules/Banner/BannerImage.d.ts +10 -0
  9. package/dist/molecules/Banner/BannerLink.d.ts +10 -0
  10. package/dist/molecules/Banner/index.d.ts +8 -0
  11. package/dist/molecules/Banner/stories/Banner.stories.d.ts +4 -0
  12. package/dist/molecules/PaymentMethods/PaymentMethods.d.ts +26 -0
  13. package/dist/molecules/PaymentMethods/index.d.ts +2 -0
  14. package/dist/molecules/PaymentMethods/stories/PaymentMethods.stories.d.ts +4 -0
  15. package/dist/molecules/PaymentMethods/stories/assets/Icons.d.ts +9 -0
  16. package/dist/ui.cjs.development.js +47 -0
  17. package/dist/ui.cjs.development.js.map +1 -1
  18. package/dist/ui.cjs.production.min.js +1 -1
  19. package/dist/ui.cjs.production.min.js.map +1 -1
  20. package/dist/ui.esm.js +45 -1
  21. package/dist/ui.esm.js.map +1 -1
  22. package/package.json +3 -3
  23. package/src/index.ts +9 -0
  24. package/src/molecules/Alert/Alert.test.tsx +23 -0
  25. package/src/molecules/Alert/Alert.tsx +30 -0
  26. package/src/molecules/Alert/index.ts +2 -0
  27. package/src/molecules/Alert/stories/Alert.mdx +26 -0
  28. package/src/molecules/Alert/stories/Alert.stories.tsx +36 -0
  29. package/src/molecules/Banner/Banner.test.tsx +63 -0
  30. package/src/molecules/Banner/Banner.tsx +26 -0
  31. package/src/molecules/Banner/BannerContent.tsx +31 -0
  32. package/src/molecules/Banner/BannerImage.tsx +29 -0
  33. package/src/molecules/Banner/BannerLink.tsx +29 -0
  34. package/src/molecules/Banner/index.ts +11 -0
  35. package/src/molecules/Banner/stories/Banner.mdx +63 -0
  36. package/src/molecules/Banner/stories/Banner.stories.tsx +66 -0
  37. package/src/molecules/PaymentMethods/PaymentMethods.test.tsx +37 -0
  38. package/src/molecules/PaymentMethods/PaymentMethods.tsx +58 -0
  39. package/src/molecules/PaymentMethods/index.tsx +2 -0
  40. package/src/molecules/PaymentMethods/stories/PaymentMethods.mdx +19 -0
  41. package/src/molecules/PaymentMethods/stories/PaymentMethods.stories.tsx +41 -0
  42. package/src/molecules/PaymentMethods/stories/assets/Icons.tsx +89 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.3.21 (2021-12-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * add docs ([#1058](https://github.com/vtex/faststore/issues/1058)) ([35f3e62](https://github.com/vtex/faststore/commit/35f3e62ae09c350632479742c9ce2c22e8862b23))
12
+
13
+
14
+
15
+
16
+
17
+ ## 1.3.20 (2021-12-07)
18
+
19
+
20
+ ### Features
21
+
22
+ * **store-ui:** Banner component ([#1048](https://github.com/vtex/faststore/issues/1048)) ([b65d8e5](https://github.com/vtex/faststore/commit/b65d8e574598f8bf8494aac478e4bec4d774ec86))
23
+
24
+
25
+
26
+
27
+
28
+ ## 1.3.19 (2021-12-07)
29
+
30
+
31
+ ### Features
32
+
33
+ * **ui:** PaymentMethods Component ([#1024](https://github.com/vtex/faststore/issues/1024)) ([f093025](https://github.com/vtex/faststore/commit/f093025c5b010b01f16349e2460611792cfff67f))
34
+
35
+
36
+
37
+
38
+
39
+ ## 1.3.18 (2021-12-06)
40
+
41
+
42
+ ### Features
43
+
44
+ * **store-ui:** Alert molecule ([#1020](https://github.com/vtex/faststore/issues/1020)) ([7764e0d](https://github.com/vtex/faststore/commit/7764e0d08270a3bb836038c4a9cd27e5cbef9667))
45
+
46
+
47
+
48
+
49
+
6
50
  ## 1.3.17 (2021-12-06)
7
51
 
8
52
  **Note:** Version bump only for package @faststore/ui
package/dist/index.d.ts CHANGED
@@ -40,11 +40,17 @@ export { default as IconButton } from './molecules/IconButton';
40
40
  export type { IconButtonProps } from './molecules/IconButton';
41
41
  export { default as Modal } from './molecules/Modal';
42
42
  export type { ModalProps } from './molecules/Modal';
43
+ export { default as Banner } from './molecules/Banner';
44
+ export type { BannerProps } from './molecules/Banner';
45
+ export { default as PaymentMethods } from './molecules/PaymentMethods';
46
+ export type { PaymentMethodsProps } from './molecules/PaymentMethods';
43
47
  export { default as Accordion, AccordionItem, AccordionButton, AccordionPanel, } from './molecules/Accordion';
44
48
  export type { AccordionProps, AccordionItemProps, AccordionButtonProps, AccordionPanelProps, } from './molecules/Accordion';
45
49
  export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './molecules/Table';
46
50
  export type { TableProps, TableBodyProps, TableCellProps, TableFooterProps, TableHeadProps, TableRowProps, } from './molecules/Table';
47
51
  export { default as Form } from './molecules/Form';
48
52
  export type { FormProps } from './molecules/Form';
53
+ export { default as Alert } from './molecules/Alert';
54
+ export type { AlertProps } from './molecules/Alert';
49
55
  export { default as useSlider } from './hooks/useSlider';
50
56
  export type { UseSliderArgs, SliderState, SliderDispatch, SlideDirection, } from './hooks/useSlider';
@@ -0,0 +1,11 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress,
6
+ * testing-library, and jest).
7
+ */
8
+ testId?: string;
9
+ }
10
+ declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
11
+ export default Alert;
@@ -0,0 +1,2 @@
1
+ export { default } from './Alert';
2
+ export type { AlertProps } from './Alert';
@@ -0,0 +1,5 @@
1
+ import type { AlertProps } from '../Alert';
2
+ export declare const Alert: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, AlertProps>;
3
+ export declare const AlertWithIcon: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, AlertProps>;
4
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
5
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare type BannerDirectionVariant = 'vertical' | 'horizontal';
3
+ export interface BannerProps {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress,
6
+ * testing-library, and jest).
7
+ */
8
+ testId?: string;
9
+ children: React.ReactNode;
10
+ variant?: BannerDirectionVariant;
11
+ }
12
+ declare const Banner: ({ testId, children, variant, }: BannerProps) => JSX.Element;
13
+ export default Banner;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface BannerContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
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 BannerContent: React.ForwardRefExoticComponent<BannerContentProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default BannerContent;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface BannerImageProps 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 BannerImage: React.ForwardRefExoticComponent<BannerImageProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default BannerImage;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface BannerLinkProps 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 BannerLink: React.ForwardRefExoticComponent<BannerLinkProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default BannerLink;
@@ -0,0 +1,8 @@
1
+ export { default } from './Banner';
2
+ export type { BannerProps } from './Banner';
3
+ export { default as BannerImage } from './BannerImage';
4
+ export type { BannerImageProps } from './BannerImage';
5
+ export { default as BannerContent } from './BannerContent';
6
+ export type { BannerContentProps } from './BannerContent';
7
+ export { default as BannerLink } from './BannerLink';
8
+ export type { BannerLinkProps } from './BannerLink';
@@ -0,0 +1,4 @@
1
+ import type { BannerProps } from '../Banner';
2
+ export declare const Banner: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BannerProps>;
3
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
4
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import type { ReactNode, AriaAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface PaymentMethodsProps {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress,
6
+ * testing-library, and jest).
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * Title of the payment methods section (e.g.: "Payment methods",
11
+ * "Accepted Cards").
12
+ */
13
+ title?: ReactNode;
14
+ /**
15
+ * Defines a string value that labels the current element when
16
+ * title is not used.
17
+ */
18
+ 'aria-label'?: AriaAttributes['aria-label'];
19
+ /**
20
+ * Children will receive the flags to be displayed in the payment
21
+ * methods section (e.g.:, visa, mastercard, etc).
22
+ */
23
+ children: ReactNode;
24
+ }
25
+ declare const PaymentMethods: React.ForwardRefExoticComponent<PaymentMethodsProps & React.RefAttributes<HTMLDivElement>>;
26
+ export default PaymentMethods;
@@ -0,0 +1,2 @@
1
+ export { default } from './PaymentMethods';
2
+ export type { PaymentMethodsProps } from './PaymentMethods';
@@ -0,0 +1,4 @@
1
+ import type { PaymentMethodsProps } from '../PaymentMethods';
2
+ export declare const PaymentMethods: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentMethodsProps>;
3
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
4
+ export default _default;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare function VisaCard(): JSX.Element;
3
+ export declare function MasterCard(): JSX.Element;
4
+ export declare function AmericanExpressCard(): JSX.Element;
5
+ export declare function MaestroCard(): JSX.Element;
6
+ export declare function EloCard(): JSX.Element;
7
+ export declare function HiperCard(): JSX.Element;
8
+ export declare function PayPal(): JSX.Element;
9
+ export declare function DinersClub(): JSX.Element;
@@ -1010,6 +1010,37 @@ const Modal = ({
1010
1010
  }), children)), document.body) : null;
1011
1011
  };
1012
1012
 
1013
+ const Banner = ({
1014
+ testId = 'store-banner',
1015
+ children,
1016
+ variant = 'vertical'
1017
+ }) => {
1018
+ return React__default.createElement("article", {
1019
+ "data-store-banner": variant,
1020
+ "data-testid": testId
1021
+ }, children);
1022
+ };
1023
+
1024
+ const PaymentMethods = /*#__PURE__*/React.forwardRef(function PaymentMethods({
1025
+ testId = 'store-payment-methods',
1026
+ title,
1027
+ 'aria-label': ariaLabel = 'Payment Methods',
1028
+ children,
1029
+ ...otherProps
1030
+ }, ref) {
1031
+ return React__default.createElement("div", Object.assign({
1032
+ ref: ref,
1033
+ "data-store-payment-methods": true,
1034
+ "data-testid": testId
1035
+ }, otherProps), !!title && React__default.createElement("div", {
1036
+ id: "payment-methods"
1037
+ }, title), React__default.createElement("div", {
1038
+ "data-payment-methods-flags": true,
1039
+ "aria-labelledby": title ? 'payment-methods' : undefined,
1040
+ "aria-label": title ? undefined : ariaLabel
1041
+ }, children));
1042
+ });
1043
+
1013
1044
  const AccordionContext = /*#__PURE__*/React.createContext(undefined);
1014
1045
  const Accordion = /*#__PURE__*/React.forwardRef(function Accordion({
1015
1046
  testId = 'store-accordion',
@@ -1239,11 +1270,26 @@ const TableFooter = /*#__PURE__*/React.forwardRef(function TableFooter({
1239
1270
  }, otherProps), children);
1240
1271
  });
1241
1272
 
1273
+ const Alert = /*#__PURE__*/React.forwardRef(function Alert({
1274
+ testId = 'store-alert',
1275
+ children,
1276
+ ...otherProps
1277
+ }, ref) {
1278
+ return React__default.createElement("div", Object.assign({
1279
+ ref: ref,
1280
+ role: "alert",
1281
+ "data-store-alert": true,
1282
+ "data-testid": testId
1283
+ }, otherProps), children);
1284
+ });
1285
+
1242
1286
  exports.Accordion = Accordion;
1243
1287
  exports.AccordionButton = AccordionButton;
1244
1288
  exports.AccordionItem = AccordionItem;
1245
1289
  exports.AccordionPanel = AccordionPanel;
1290
+ exports.Alert = Alert;
1246
1291
  exports.Badge = Badge;
1292
+ exports.Banner = Banner;
1247
1293
  exports.Bullets = Bullets;
1248
1294
  exports.Button = Button;
1249
1295
  exports.Carousel = Carousel;
@@ -1256,6 +1302,7 @@ exports.Label = Label;
1256
1302
  exports.List = List;
1257
1303
  exports.Modal = Modal;
1258
1304
  exports.Overlay = Overlay;
1305
+ exports.PaymentMethods = PaymentMethods;
1259
1306
  exports.Popover = Popover;
1260
1307
  exports.Price = Price;
1261
1308
  exports.Radio = Radio;