@faststore/components 3.0.109 → 3.0.115

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,4 +1,4 @@
1
- import type { ReactNode, AriaAttributes } from 'react';
1
+ import type { AriaAttributes, ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  type Flag = {
4
4
  icon: {
@@ -4,8 +4,8 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const index_1 = require("../../index");
6
6
  const PaymentMethods = (0, react_1.forwardRef)(function PaymentMethods({ testId = 'fs-payment-methods', title, 'aria-label': ariaLabel = 'Payment Methods', flagList, ...otherProps }, ref) {
7
- return (react_1.default.createElement("div", { ref: ref, "data-fs-payment-methods": true, "data-testid": testId, ...otherProps },
8
- !!title && react_1.default.createElement("div", { "data-fs-payment-methods-title": true }, title),
7
+ return (react_1.default.createElement("div", { ref: ref, "data-fs-payment-methods": true, "data-testid": testId, "aria-labelledby": title ? 'payment-methods-title' : 'Payment Methods', ...otherProps },
8
+ !!title && (react_1.default.createElement("div", { "data-fs-payment-methods-title": true, id: "payment-methods-title" }, title)),
9
9
  react_1.default.createElement(index_1.List, { "data-fs-payment-methods-flags": true, "aria-label": title ? undefined : ariaLabel }, flagList.map(({ alt: text, icon: { icon } }, index) => (react_1.default.createElement("li", { "data-fs-payment-methods-flag": true, key: `fs-payment-method-${index}-${text}` },
10
10
  react_1.default.createElement(index_1.Icon, { width: 28, height: 18, name: icon }),
11
11
  text && react_1.default.createElement(index_1.SROnly, { text: text })))))));
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../../src/organisms/PaymentMethods/PaymentMethods.tsx"],"names":[],"mappings":";;;AACA,uDAAyC;AAEzC,uCAAgD;AA+BhD,MAAM,cAAc,GAAG,IAAA,kBAAU,EAC/B,SAAS,cAAc,CACrB,EACE,MAAM,GAAG,oBAAoB,EAC7B,KAAK,EACL,YAAY,EAAE,SAAS,GAAG,iBAAiB,EAC3C,QAAQ,EACR,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,uCACE,GAAG,EAAE,GAAG,kDAEK,MAAM,KACf,UAAU;QAEb,CAAC,CAAC,KAAK,IAAI,gFAAoC,KAAK,CAAO;QAC5D,8BAAC,YAAI,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,4EAEE,GAAG,EAAE,qBAAqB,KAAK,IAAI,IAAI,EAAE;YAEzC,8BAAC,YAAI,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI;YAC1C,IAAI,IAAI,8BAAC,cAAM,IAAC,IAAI,EAAE,IAAI,GAAI,CAC5B,CACN,CAAC,CACG,CACH,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,kBAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../../src/organisms/PaymentMethods/PaymentMethods.tsx"],"names":[],"mappings":";;;AACA,uDAAyC;AAEzC,uCAAgD;AA+BhD,MAAM,cAAc,GAAG,IAAA,kBAAU,EAC/B,SAAS,cAAc,CACrB,EACE,MAAM,GAAG,oBAAoB,EAC7B,KAAK,EACL,YAAY,EAAE,SAAS,GAAG,iBAAiB,EAC3C,QAAQ,EACR,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,uCACE,GAAG,EAAE,GAAG,kDAEK,MAAM,qBACF,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,iBAAiB,KAChE,UAAU;QAGb,CAAC,CAAC,KAAK,IAAI,CACV,8EAAmC,EAAE,EAAC,uBAAuB,IAC1D,KAAK,CACF,CACP;QACD,8BAAC,YAAI,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,4EAEE,GAAG,EAAE,qBAAqB,KAAK,IAAI,IAAI,EAAE;YAEzC,8BAAC,YAAI,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI;YAC1C,IAAI,IAAI,8BAAC,cAAM,IAAC,IAAI,EAAE,IAAI,GAAI,CAC5B,CACN,CAAC,CACG,CACH,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,kBAAe,cAAc,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { ReactNode, AriaAttributes } from 'react';
1
+ import type { AriaAttributes, ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  type Flag = {
4
4
  icon: {
@@ -1,8 +1,8 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { List, SROnly, Icon } from '../../index';
2
+ import { Icon, List, SROnly } from '../../index';
3
3
  const PaymentMethods = forwardRef(function PaymentMethods({ testId = 'fs-payment-methods', title, 'aria-label': ariaLabel = 'Payment Methods', flagList, ...otherProps }, ref) {
4
- return (React.createElement("div", { ref: ref, "data-fs-payment-methods": true, "data-testid": testId, ...otherProps },
5
- !!title && React.createElement("div", { "data-fs-payment-methods-title": true }, title),
4
+ return (React.createElement("div", { ref: ref, "data-fs-payment-methods": true, "data-testid": testId, "aria-labelledby": title ? 'payment-methods-title' : 'Payment Methods', ...otherProps },
5
+ !!title && (React.createElement("div", { "data-fs-payment-methods-title": true, id: "payment-methods-title" }, title)),
6
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
7
  React.createElement(Icon, { width: 28, height: 18, name: icon }),
8
8
  text && React.createElement(SROnly, { text: text })))))));
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../../src/organisms/PaymentMethods/PaymentMethods.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AA+BhD,MAAM,cAAc,GAAG,UAAU,CAC/B,SAAS,cAAc,CACrB,EACE,MAAM,GAAG,oBAAoB,EAC7B,KAAK,EACL,YAAY,EAAE,SAAS,GAAG,iBAAiB,EAC3C,QAAQ,EACR,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,6BACE,GAAG,EAAE,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,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI;YAC1C,IAAI,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,GAAI,CAC5B,CACN,CAAC,CACG,CACH,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../../src/organisms/PaymentMethods/PaymentMethods.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AA+BhD,MAAM,cAAc,GAAG,UAAU,CAC/B,SAAS,cAAc,CACrB,EACE,MAAM,GAAG,oBAAoB,EAC7B,KAAK,EACL,YAAY,EAAE,SAAS,GAAG,iBAAiB,EAC3C,QAAQ,EACR,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,kDAEK,MAAM,qBACF,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,iBAAiB,KAChE,UAAU;QAGb,CAAC,CAAC,KAAK,IAAI,CACV,oEAAmC,EAAE,EAAC,uBAAuB,IAC1D,KAAK,CACF,CACP;QACD,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,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI;YAC1C,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": "3.0.109",
3
+ "version": "3.0.115",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "typings": "dist/esm/index.d.ts",
@@ -35,8 +35,8 @@
35
35
  "react-dom": "^18.2.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@faststore/eslint-config": "^3.0.109",
39
- "@faststore/shared": "^3.0.109",
38
+ "@faststore/eslint-config": "^3.0.110",
39
+ "@faststore/shared": "^3.0.110",
40
40
  "@testing-library/jest-dom": "^6.5.0",
41
41
  "@testing-library/react": "^14.3.0",
42
42
  "@types/jest-axe": "^3.5.9",
@@ -52,5 +52,5 @@
52
52
  "volta": {
53
53
  "extends": "../../package.json"
54
54
  },
55
- "gitHead": "cfa2b7693376839605f8721356be2c589e480003"
55
+ "gitHead": "1cc987d52dfce0b3235e80662099a55c7acb9ba9"
56
56
  }
@@ -1,7 +1,7 @@
1
- import type { ReactNode, AriaAttributes } from 'react'
1
+ import type { AriaAttributes, ReactNode } from 'react'
2
2
  import React, { forwardRef } from 'react'
3
3
 
4
- import { List, SROnly, Icon } from '../../index'
4
+ import { Icon, List, SROnly } from '../../index'
5
5
 
6
6
  type Flag = {
7
7
  icon: {
@@ -48,9 +48,15 @@ const PaymentMethods = forwardRef<HTMLDivElement, PaymentMethodsProps>(
48
48
  ref={ref}
49
49
  data-fs-payment-methods
50
50
  data-testid={testId}
51
+ aria-labelledby={title ? 'payment-methods-title' : 'Payment Methods'}
51
52
  {...otherProps}
52
53
  >
53
- {!!title && <div data-fs-payment-methods-title>{title}</div>}
54
+ {/* TODO: We can consider removing and make title always required or add it via heading */}
55
+ {!!title && (
56
+ <div data-fs-payment-methods-title id="payment-methods-title">
57
+ {title}
58
+ </div>
59
+ )}
54
60
  <List
55
61
  data-fs-payment-methods-flags
56
62
  aria-label={title ? undefined : ariaLabel}