@faststore/components 2.0.132-alpha.0 → 2.0.133-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.
@@ -1,8 +1,10 @@
1
1
  import type { ReactNode, AriaAttributes } from 'react';
2
2
  import React from 'react';
3
3
  type Flag = {
4
- image: ReactNode;
5
- text?: string;
4
+ icon: {
5
+ icon: string;
6
+ };
7
+ alt: string;
6
8
  };
7
9
  export interface PaymentMethodsProps {
8
10
  /**
@@ -1,11 +1,11 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { List, SROnly } from '../../index';
2
+ import { List, SROnly, Icon } from '../../index';
3
3
  const PaymentMethods = forwardRef(function PaymentMethods({ testId = 'fs-payment-methods', title, 'aria-label': ariaLabel = 'Payment Methods', flagList, ...otherProps }, ref) {
4
4
  return (React.createElement("div", { ref: ref, "data-fs-payment-methods": true, "data-testid": testId, ...otherProps },
5
5
  !!title && React.createElement("div", { "data-fs-payment-methods-title": true }, title),
6
- React.createElement(List, { "data-fs-payment-methods-flags": true, "aria-label": title ? undefined : ariaLabel }, flagList.map((item, index) => (React.createElement("li", { "data-fs-payment-methods-flag": true, key: `fs-payment-method-${index}-${item.text}` },
7
- item.image,
8
- item.text && React.createElement(SROnly, { text: item.text })))))));
6
+ React.createElement(List, { "data-fs-payment-methods-flags": true, "aria-label": title ? undefined : ariaLabel }, flagList.map(({ alt: text, icon: { icon } }, index) => (React.createElement("li", { "data-fs-payment-methods-flag": true, key: `fs-payment-method-${index}-${text}` },
7
+ React.createElement(Icon, { width: 32, height: 22.5, name: icon }),
8
+ text && React.createElement(SROnly, { text: text })))))));
9
9
  });
10
10
  export default PaymentMethods;
11
11
  //# sourceMappingURL=PaymentMethods.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../src/organisms/PaymentMethods/PaymentMethods.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE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AAE,GAAG,kDAEK,MAAM,KACf,UAAU;QAEb,CAAC,CAAC,KAAK,IAAI,sEAAoC,KAAK,CAAO;QAC5D,oBAAC,IAAI,yDAES,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IAExC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CACtD,kEAEE,GAAG,EAAE,qBAAqB,KAAK,IAAI,IAAI,EAAE;YAEzC,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAI;YAC5C,IAAI,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,GAAI,CAC5B,CACN,CAAC,CACG,CACH,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/components",
3
- "version": "2.0.132-alpha.0",
3
+ "version": "2.0.133-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": "e6d7561f0783b20ba4966d9e7c971146300ff129"
33
+ "gitHead": "d6ccdde94a4a7210b6e2ebf77a6caf358ecb07b2"
34
34
  }
@@ -1,11 +1,13 @@
1
1
  import type { ReactNode, AriaAttributes } from 'react'
2
2
  import React, { forwardRef } from 'react'
3
3
 
4
- import { List, SROnly } from '../../index'
4
+ import { List, SROnly, Icon } from '../../index'
5
5
 
6
6
  type Flag = {
7
- image: ReactNode
8
- text?: string
7
+ icon: {
8
+ icon: string
9
+ }
10
+ alt: string
9
11
  }
10
12
  export interface PaymentMethodsProps {
11
13
  /**
@@ -53,13 +55,13 @@ const PaymentMethods = forwardRef<HTMLDivElement, PaymentMethodsProps>(
53
55
  data-fs-payment-methods-flags
54
56
  aria-label={title ? undefined : ariaLabel}
55
57
  >
56
- {flagList.map((item, index) => (
58
+ {flagList.map(({ alt: text, icon: { icon } }, index) => (
57
59
  <li
58
60
  data-fs-payment-methods-flag
59
- key={`fs-payment-method-${index}-${item.text}`}
61
+ key={`fs-payment-method-${index}-${text}`}
60
62
  >
61
- {item.image}
62
- {item.text && <SROnly text={item.text} />}
63
+ <Icon width={32} height={22.5} name={icon} />
64
+ {text && <SROnly text={text} />}
63
65
  </li>
64
66
  ))}
65
67
  </List>