@faststore/ui 1.3.18 → 1.3.22

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 (34) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/molecules/Banner/Banner.d.ts +13 -0
  4. package/dist/molecules/Banner/BannerContent.d.ts +10 -0
  5. package/dist/molecules/Banner/BannerImage.d.ts +10 -0
  6. package/dist/molecules/Banner/BannerLink.d.ts +10 -0
  7. package/dist/molecules/Banner/index.d.ts +8 -0
  8. package/dist/molecules/Banner/stories/Banner.stories.d.ts +4 -0
  9. package/dist/molecules/PaymentMethods/PaymentMethods.d.ts +26 -0
  10. package/dist/molecules/PaymentMethods/index.d.ts +2 -0
  11. package/dist/molecules/PaymentMethods/stories/PaymentMethods.stories.d.ts +4 -0
  12. package/dist/molecules/PaymentMethods/stories/assets/Icons.d.ts +9 -0
  13. package/dist/ui.cjs.development.js +33 -0
  14. package/dist/ui.cjs.development.js.map +1 -1
  15. package/dist/ui.cjs.production.min.js +1 -1
  16. package/dist/ui.cjs.production.min.js.map +1 -1
  17. package/dist/ui.esm.js +32 -1
  18. package/dist/ui.esm.js.map +1 -1
  19. package/package.json +3 -3
  20. package/src/index.ts +6 -0
  21. package/src/molecules/Banner/Banner.test.tsx +63 -0
  22. package/src/molecules/Banner/Banner.tsx +26 -0
  23. package/src/molecules/Banner/BannerContent.tsx +31 -0
  24. package/src/molecules/Banner/BannerImage.tsx +29 -0
  25. package/src/molecules/Banner/BannerLink.tsx +29 -0
  26. package/src/molecules/Banner/index.ts +11 -0
  27. package/src/molecules/Banner/stories/Banner.mdx +63 -0
  28. package/src/molecules/Banner/stories/Banner.stories.tsx +66 -0
  29. package/src/molecules/PaymentMethods/PaymentMethods.test.tsx +37 -0
  30. package/src/molecules/PaymentMethods/PaymentMethods.tsx +58 -0
  31. package/src/molecules/PaymentMethods/index.tsx +2 -0
  32. package/src/molecules/PaymentMethods/stories/PaymentMethods.mdx +19 -0
  33. package/src/molecules/PaymentMethods/stories/PaymentMethods.stories.tsx +41 -0
  34. package/src/molecules/PaymentMethods/stories/assets/Icons.tsx +89 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
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.22 (2021-12-07)
7
+
8
+ **Note:** Version bump only for package @faststore/ui
9
+
10
+
11
+
12
+
13
+
14
+ ## 1.3.21 (2021-12-07)
15
+
16
+
17
+ ### Features
18
+
19
+ * add docs ([#1058](https://github.com/vtex/faststore/issues/1058)) ([35f3e62](https://github.com/vtex/faststore/commit/35f3e62ae09c350632479742c9ce2c22e8862b23))
20
+
21
+
22
+
23
+
24
+
25
+ ## 1.3.20 (2021-12-07)
26
+
27
+
28
+ ### Features
29
+
30
+ * **store-ui:** Banner component ([#1048](https://github.com/vtex/faststore/issues/1048)) ([b65d8e5](https://github.com/vtex/faststore/commit/b65d8e574598f8bf8494aac478e4bec4d774ec86))
31
+
32
+
33
+
34
+
35
+
36
+ ## 1.3.19 (2021-12-07)
37
+
38
+
39
+ ### Features
40
+
41
+ * **ui:** PaymentMethods Component ([#1024](https://github.com/vtex/faststore/issues/1024)) ([f093025](https://github.com/vtex/faststore/commit/f093025c5b010b01f16349e2460611792cfff67f))
42
+
43
+
44
+
45
+
46
+
6
47
  ## 1.3.18 (2021-12-06)
7
48
 
8
49
 
package/dist/index.d.ts CHANGED
@@ -40,6 +40,10 @@ 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';
@@ -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',
@@ -1258,6 +1289,7 @@ exports.AccordionItem = AccordionItem;
1258
1289
  exports.AccordionPanel = AccordionPanel;
1259
1290
  exports.Alert = Alert;
1260
1291
  exports.Badge = Badge;
1292
+ exports.Banner = Banner;
1261
1293
  exports.Bullets = Bullets;
1262
1294
  exports.Button = Button;
1263
1295
  exports.Carousel = Carousel;
@@ -1270,6 +1302,7 @@ exports.Label = Label;
1270
1302
  exports.List = List;
1271
1303
  exports.Modal = Modal;
1272
1304
  exports.Overlay = Overlay;
1305
+ exports.PaymentMethods = PaymentMethods;
1273
1306
  exports.Popover = Popover;
1274
1307
  exports.Price = Price;
1275
1308
  exports.Radio = Radio;