@faststore/ui 1.3.15 → 1.3.19

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/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.19 (2021-12-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * **ui:** PaymentMethods Component ([#1024](https://github.com/vtex/faststore/issues/1024)) ([f093025](https://github.com/vtex/faststore/commit/f093025c5b010b01f16349e2460611792cfff67f))
12
+
13
+
14
+
15
+
16
+
17
+ ## 1.3.18 (2021-12-06)
18
+
19
+
20
+ ### Features
21
+
22
+ * **store-ui:** Alert molecule ([#1020](https://github.com/vtex/faststore/issues/1020)) ([7764e0d](https://github.com/vtex/faststore/commit/7764e0d08270a3bb836038c4a9cd27e5cbef9667))
23
+
24
+
25
+
26
+
27
+
28
+ ## 1.3.17 (2021-12-06)
29
+
30
+ **Note:** Version bump only for package @faststore/ui
31
+
32
+
33
+
34
+
35
+
36
+ ## 1.3.16 (2021-12-06)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * add fallback to prevent null facets attribute StoreSearchResult query ([#1056](https://github.com/vtex/faststore/issues/1056)) ([ae1483f](https://github.com/vtex/faststore/commit/ae1483fdb901328a7a7348746fd241b9ce7ea1da))
42
+
43
+
44
+
45
+
46
+
6
47
  ## 1.3.15 (2021-12-03)
7
48
 
8
49
  **Note:** Version bump only for package @faststore/ui
package/dist/index.d.ts CHANGED
@@ -40,11 +40,15 @@ 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 PaymentMethods } from './molecules/PaymentMethods';
44
+ export type { PaymentMethodsProps } from './molecules/PaymentMethods';
43
45
  export { default as Accordion, AccordionItem, AccordionButton, AccordionPanel, } from './molecules/Accordion';
44
46
  export type { AccordionProps, AccordionItemProps, AccordionButtonProps, AccordionPanelProps, } from './molecules/Accordion';
45
47
  export { Table, TableBody, TableCell, TableFooter, TableHead, TableRow, } from './molecules/Table';
46
48
  export type { TableProps, TableBodyProps, TableCellProps, TableFooterProps, TableHeadProps, TableRowProps, } from './molecules/Table';
47
49
  export { default as Form } from './molecules/Form';
48
50
  export type { FormProps } from './molecules/Form';
51
+ export { default as Alert } from './molecules/Alert';
52
+ export type { AlertProps } from './molecules/Alert';
49
53
  export { default as useSlider } from './hooks/useSlider';
50
54
  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,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,26 @@ const Modal = ({
1010
1010
  }), children)), document.body) : null;
1011
1011
  };
1012
1012
 
1013
+ const PaymentMethods = /*#__PURE__*/React.forwardRef(function PaymentMethods({
1014
+ testId = 'store-payment-methods',
1015
+ title,
1016
+ 'aria-label': ariaLabel = 'Payment Methods',
1017
+ children,
1018
+ ...otherProps
1019
+ }, ref) {
1020
+ return React__default.createElement("div", Object.assign({
1021
+ ref: ref,
1022
+ "data-store-payment-methods": true,
1023
+ "data-testid": testId
1024
+ }, otherProps), !!title && React__default.createElement("div", {
1025
+ id: "payment-methods"
1026
+ }, title), React__default.createElement("div", {
1027
+ "data-payment-methods-flags": true,
1028
+ "aria-labelledby": title ? 'payment-methods' : undefined,
1029
+ "aria-label": title ? undefined : ariaLabel
1030
+ }, children));
1031
+ });
1032
+
1013
1033
  const AccordionContext = /*#__PURE__*/React.createContext(undefined);
1014
1034
  const Accordion = /*#__PURE__*/React.forwardRef(function Accordion({
1015
1035
  testId = 'store-accordion',
@@ -1239,10 +1259,24 @@ const TableFooter = /*#__PURE__*/React.forwardRef(function TableFooter({
1239
1259
  }, otherProps), children);
1240
1260
  });
1241
1261
 
1262
+ const Alert = /*#__PURE__*/React.forwardRef(function Alert({
1263
+ testId = 'store-alert',
1264
+ children,
1265
+ ...otherProps
1266
+ }, ref) {
1267
+ return React__default.createElement("div", Object.assign({
1268
+ ref: ref,
1269
+ role: "alert",
1270
+ "data-store-alert": true,
1271
+ "data-testid": testId
1272
+ }, otherProps), children);
1273
+ });
1274
+
1242
1275
  exports.Accordion = Accordion;
1243
1276
  exports.AccordionButton = AccordionButton;
1244
1277
  exports.AccordionItem = AccordionItem;
1245
1278
  exports.AccordionPanel = AccordionPanel;
1279
+ exports.Alert = Alert;
1246
1280
  exports.Badge = Badge;
1247
1281
  exports.Bullets = Bullets;
1248
1282
  exports.Button = Button;
@@ -1256,6 +1290,7 @@ exports.Label = Label;
1256
1290
  exports.List = List;
1257
1291
  exports.Modal = Modal;
1258
1292
  exports.Overlay = Overlay;
1293
+ exports.PaymentMethods = PaymentMethods;
1259
1294
  exports.Popover = Popover;
1260
1295
  exports.Price = Price;
1261
1296
  exports.Radio = Radio;