@cloudscape-design/components-themeable 3.0.1241 → 3.0.1243

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 (29) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  3. package/lib/internal/scss/radio-group/styles.scss +0 -4
  4. package/lib/internal/template/i18n/providers/local-provider.d.ts.map +1 -1
  5. package/lib/internal/template/i18n/providers/local-provider.js +2 -26
  6. package/lib/internal/template/i18n/providers/local-provider.js.map +1 -1
  7. package/lib/internal/template/i18n/utils/i18n-formatter.d.ts.map +1 -1
  8. package/lib/internal/template/i18n/utils/i18n-formatter.js +3 -2
  9. package/lib/internal/template/i18n/utils/i18n-formatter.js.map +1 -1
  10. package/lib/internal/template/i18n/utils/messages.d.ts +3 -0
  11. package/lib/internal/template/i18n/utils/messages.d.ts.map +1 -0
  12. package/lib/internal/template/i18n/utils/messages.js +28 -0
  13. package/lib/internal/template/i18n/utils/messages.js.map +1 -0
  14. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  15. package/lib/internal/template/internal/environment.js +2 -2
  16. package/lib/internal/template/internal/environment.json +2 -2
  17. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  18. package/lib/internal/template/radio-group/internal.js +1 -1
  19. package/lib/internal/template/radio-group/internal.js.map +1 -1
  20. package/lib/internal/template/radio-group/styles.css.js +5 -6
  21. package/lib/internal/template/radio-group/styles.scoped.css +6 -10
  22. package/lib/internal/template/radio-group/styles.selectors.js +5 -6
  23. package/lib/internal/template/test-utils/dom/radio-group/index.d.ts +0 -1
  24. package/lib/internal/template/test-utils/dom/radio-group/index.js +3 -5
  25. package/lib/internal/template/test-utils/dom/radio-group/index.js.map +1 -1
  26. package/lib/internal/template/test-utils/selectors/radio-group/index.d.ts +0 -1
  27. package/lib/internal/template/test-utils/selectors/radio-group/index.js +3 -5
  28. package/lib/internal/template/test-utils/selectors/radio-group/index.js.map +1 -1
  29. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "a3d7548f0ee817ade0f7eb9ad37e4b4316a73ec0"
2
+ "commit": "967748eb66f807b95d45eadd3bd3575fd67d0e4f"
3
3
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "a3d7548f";
3
+ $awsui-commit-hash: "967748eb";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-n6lfw8;
6
6
  $minContentWidth: --awsui-min-content-width-n6lfw8;
@@ -6,10 +6,6 @@
6
6
  @use '../internal/styles' as styles;
7
7
  @use '../internal/styles/tokens' as awsui;
8
8
 
9
- .root {
10
- /* used for backwards-compatibility with older versions of test-utils */
11
- }
12
-
13
9
  .radio-group {
14
10
  @include styles.styles-reset;
15
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"local-provider.d.ts","sourceRoot":"","sources":["../../../../src/i18n/providers/local-provider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGtE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AASD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,cAAc,EACtB,QAAQ,GACT,EAAE,sBAAsB,eA0BxB"}
1
+ {"version":3,"file":"local-provider.d.ts","sourceRoot":"","sources":["../../../../src/i18n/providers/local-provider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAItE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AASD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,cAAc,EACtB,QAAQ,GACT,EAAE,sBAAsB,eA0BxB"}
@@ -5,6 +5,7 @@ import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
5
5
  import { InternalI18nContext } from '../context';
6
6
  import { I18nFormatter } from '../utils/i18n-formatter';
7
7
  import { determineAppLocale } from '../utils/locales';
8
+ import { normalizeMessages } from '../utils/messages';
8
9
  /**
9
10
  * Context to send parent messages down to child I18nProviders. This isn't
10
11
  * included in the InternalI18nContext to avoid components from depending on
@@ -19,7 +20,7 @@ export function LocalI18nProvider({ messages: messagesArray, locale: providedLoc
19
20
  // The provider accepts an array of configs. We merge parent messages and
20
21
  // flatten the tree early on so that accesses by key are simpler and faster.
21
22
  const parentMessages = useContext(I18nMessagesContext);
22
- const messages = mergeMessages([parentMessages, ...messagesArray]);
23
+ const messages = normalizeMessages([parentMessages, ...messagesArray]);
23
24
  // The formatter is recreated on every render to ensure it has access to the
24
25
  // latest messages. This is a trade-off between performance and correctness.
25
26
  // In practice, this should only happen when the messages change, which is
@@ -28,29 +29,4 @@ export function LocalI18nProvider({ messages: messagesArray, locale: providedLoc
28
29
  return (React.createElement(InternalI18nContext.Provider, { value: { locale, format: formatter.format.bind(formatter) } },
29
30
  React.createElement(I18nMessagesContext.Provider, { value: messages }, children)));
30
31
  }
31
- function mergeMessages(sources) {
32
- const result = {};
33
- for (const messages of sources) {
34
- for (const namespace in messages) {
35
- if (!(namespace in result)) {
36
- result[namespace] = {};
37
- }
38
- for (const casedLocale in messages[namespace]) {
39
- const locale = casedLocale.toLowerCase();
40
- if (!(locale in result[namespace])) {
41
- result[namespace][locale] = {};
42
- }
43
- for (const component in messages[namespace][casedLocale]) {
44
- if (!(component in result[namespace][locale])) {
45
- result[namespace][locale][component] = {};
46
- }
47
- for (const key in messages[namespace][casedLocale][component]) {
48
- result[namespace][locale][component][key] = messages[namespace][casedLocale][component][key];
49
- }
50
- }
51
- }
52
- }
53
- }
54
- return result;
55
- }
56
32
  //# sourceMappingURL=local-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-provider.js","sourceRoot":"","sources":["../../../../src/i18n/providers/local-provider.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAgB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAQtD;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAe,EAAE,CAAC,CAAC;AAElE,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,cAAc,EACtB,QAAQ,GACe;IACvB,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,CAAC,cAAc,EAAE,CAAC;QACvD,QAAQ,CACN,cAAc,EACd,mHAAmH,CACpH,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAElD,yEAAyE;IACzE,4EAA4E;IAC5E,MAAM,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC,cAAc,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC;IAEnE,4EAA4E;IAC5E,4EAA4E;IAC5E,0EAA0E;IAC1E,cAAc;IACd,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,MAAM,EAA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AAE,CAAC;wBAC9D,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC;oBAC/F,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useContext } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalI18nContext } from '../context';\nimport { I18nFormatter, I18nMessages } from '../utils/i18n-formatter';\nimport { determineAppLocale } from '../utils/locales';\n\nexport interface LocalI18nProviderProps {\n messages: ReadonlyArray<I18nMessages>;\n locale?: string;\n children: React.ReactNode;\n}\n\n/**\n * Context to send parent messages down to child I18nProviders. This isn't\n * included in the InternalI18nContext to avoid components from depending on\n * MessageFormatElement types.\n */\nconst I18nMessagesContext = React.createContext<I18nMessages>({});\n\nexport function LocalI18nProvider({\n messages: messagesArray,\n locale: providedLocale,\n children,\n}: LocalI18nProviderProps) {\n if (typeof document === 'undefined' && !providedLocale) {\n warnOnce(\n 'I18nProvider',\n 'An explicit locale was not provided during server rendering. This can lead to a hydration mismatch on the client.'\n );\n }\n\n const locale = determineAppLocale(providedLocale);\n\n // The provider accepts an array of configs. We merge parent messages and\n // flatten the tree early on so that accesses by key are simpler and faster.\n const parentMessages = useContext(I18nMessagesContext);\n const messages = mergeMessages([parentMessages, ...messagesArray]);\n\n // The formatter is recreated on every render to ensure it has access to the\n // latest messages. This is a trade-off between performance and correctness.\n // In practice, this should only happen when the messages change, which is\n // infrequent.\n const formatter = new I18nFormatter(locale, messages);\n\n return (\n <InternalI18nContext.Provider value={{ locale, format: formatter.format.bind(formatter) }}>\n <I18nMessagesContext.Provider value={messages}>{children}</I18nMessagesContext.Provider>\n </InternalI18nContext.Provider>\n );\n}\n\nfunction mergeMessages(sources: ReadonlyArray<I18nMessages>): I18nMessages {\n const result: I18nMessages = {};\n for (const messages of sources) {\n for (const namespace in messages) {\n if (!(namespace in result)) {\n result[namespace] = {};\n }\n for (const casedLocale in messages[namespace]) {\n const locale = casedLocale.toLowerCase();\n if (!(locale in result[namespace])) {\n result[namespace][locale] = {};\n }\n for (const component in messages[namespace][casedLocale]) {\n if (!(component in result[namespace][locale])) {\n result[namespace][locale][component] = {};\n }\n for (const key in messages[namespace][casedLocale][component]) {\n result[namespace][locale][component][key] = messages[namespace][casedLocale][component][key];\n }\n }\n }\n }\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"local-provider.js","sourceRoot":"","sources":["../../../../src/i18n/providers/local-provider.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAgB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAQtD;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAe,EAAE,CAAC,CAAC;AAElE,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,cAAc,EACtB,QAAQ,GACe;IACvB,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,CAAC,cAAc,EAAE,CAAC;QACvD,QAAQ,CACN,cAAc,EACd,mHAAmH,CACpH,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAElD,yEAAyE;IACzE,4EAA4E;IAC5E,MAAM,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,CAAC,cAAc,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC;IAEvE,4EAA4E;IAC5E,4EAA4E;IAC5E,0EAA0E;IAC1E,cAAc;IACd,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEtD,OAAO,CACL,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QACvF,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,IAAG,QAAQ,CAAgC,CAC3D,CAChC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useContext } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalI18nContext } from '../context';\nimport { I18nFormatter, I18nMessages } from '../utils/i18n-formatter';\nimport { determineAppLocale } from '../utils/locales';\nimport { normalizeMessages } from '../utils/messages';\n\nexport interface LocalI18nProviderProps {\n messages: ReadonlyArray<I18nMessages>;\n locale?: string;\n children: React.ReactNode;\n}\n\n/**\n * Context to send parent messages down to child I18nProviders. This isn't\n * included in the InternalI18nContext to avoid components from depending on\n * MessageFormatElement types.\n */\nconst I18nMessagesContext = React.createContext<I18nMessages>({});\n\nexport function LocalI18nProvider({\n messages: messagesArray,\n locale: providedLocale,\n children,\n}: LocalI18nProviderProps) {\n if (typeof document === 'undefined' && !providedLocale) {\n warnOnce(\n 'I18nProvider',\n 'An explicit locale was not provided during server rendering. This can lead to a hydration mismatch on the client.'\n );\n }\n\n const locale = determineAppLocale(providedLocale);\n\n // The provider accepts an array of configs. We merge parent messages and\n // flatten the tree early on so that accesses by key are simpler and faster.\n const parentMessages = useContext(I18nMessagesContext);\n const messages = normalizeMessages([parentMessages, ...messagesArray]);\n\n // The formatter is recreated on every render to ensure it has access to the\n // latest messages. This is a trade-off between performance and correctness.\n // In practice, this should only happen when the messages change, which is\n // infrequent.\n const formatter = new I18nFormatter(locale, messages);\n\n return (\n <InternalI18nContext.Provider value={{ locale, format: formatter.format.bind(formatter) }}>\n <I18nMessagesContext.Provider value={messages}>{children}</I18nMessagesContext.Provider>\n </InternalI18nContext.Provider>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-formatter.d.ts","sourceRoot":"","sources":["../../../../src/i18n/utils/i18n-formatter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,CAAC,MAAM,EAAE,MAAM,GAAG;YAChB,CAAC,SAAS,EAAE,MAAM,GAAG;gBACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAe;IAMhC,OAAO,CAAC,qBAAqB,CAAwC;gBAEzD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY;IAKlD,MAAM,CAAC,WAAW,EAAE,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACtE,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,WAAW,EACrB,aAAa,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,YAAY,CAAC,GACvD,WAAW;CA2Cf"}
1
+ {"version":3,"file":"i18n-formatter.d.ts","sourceRoot":"","sources":["../../../../src/i18n/utils/i18n-formatter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,CAAC,MAAM,EAAE,MAAM,GAAG;YAChB,CAAC,SAAS,EAAE,MAAM,GAAG;gBACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAe;IAMhC,OAAO,CAAC,qBAAqB,CAAwC;gBAEzD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY;IAKlD,MAAM,CAAC,WAAW,EAAE,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACtE,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,WAAW,EACrB,aAAa,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,YAAY,CAAC,GACvD,WAAW;CA2Cf"}
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import IntlMessageFormat from 'intl-messageformat';
4
4
  import { getMatchableLocales } from './locales';
5
+ import { normalizeMessages } from './messages';
5
6
  /**
6
7
  * A stateful container for formatting internal strings. Caches formatters
7
8
  * where possible; a new instance must be created if locale or messages may
@@ -14,8 +15,8 @@ export class I18nFormatter {
14
15
  // with potentially different locale or messages. We expect this component to
15
16
  // be placed above AppLayout and therefore rerender very infrequently.
16
17
  this._localeFormatterCache = new Map();
17
- this._locale = locale;
18
- this._messages = messages;
18
+ this._locale = locale.toLowerCase();
19
+ this._messages = normalizeMessages([messages]);
19
20
  }
20
21
  format(namespace, component, key, provided, customHandler) {
21
22
  var _a, _b, _c, _d;
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-formatter.js","sourceRoot":"","sources":["../../../../src/i18n/utils/i18n-formatter.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAkBhD;;;;GAIG;AACH,MAAM,OAAO,aAAa;IAUxB,YAAY,MAAc,EAAE,QAAsB;QANlD,yEAAyE;QACzE,6EAA6E;QAC7E,6EAA6E;QAC7E,sEAAsE;QAC9D,0BAAqB,GAAG,IAAI,GAAG,EAA6B,CAAC;QAGnE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,MAAM,CACJ,SAAiB,EACjB,SAAiB,EACjB,GAAW,EACX,QAAqB,EACrB,aAAwD;;QAExD,gEAAgE;QAChE,sEAAsE;QACtE,4DAA4D;QAC5D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,QAAQ,GAAG,GAAG,SAAS,IAAI,SAAS,IAAI,GAAG,EAAE,CAAC;QACpD,IAAI,iBAAoC,CAAC;QAEzC,MAAM,eAAe,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAI,eAAe,EAAE,CAAC;YACpB,8EAA8E;YAC9E,iBAAiB,GAAG,eAAe,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,oEAAoE;YACpE,qCAAqC;YACrC,IAAI,OAAoD,CAAC;YACzD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3D,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE,CAAC;gBAC/C,OAAO,GAAG,MAAA,MAAA,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAG,SAAS,CAAC,0CAAG,eAAe,CAAC,0CAAG,SAAS,CAAC,0CAAG,GAAG,CAAC,CAAC;gBAC7E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;oBAC1B,MAAM;gBACR,CAAC;YACH,CAAC;YAED,yCAAyC;YACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,0DAA0D;YAC1D,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAW,CAAC,CAAC;QACzE,CAAC;QACD,+EAA+E;QAC/E,OAAO,iBAAiB,CAAC,MAAM,EAAiB,CAAC;IACnD,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { MessageFormatElement } from '@formatjs/icu-messageformat-parser';\nimport IntlMessageFormat from 'intl-messageformat';\n\nimport { CustomHandler } from '../context';\nimport { getMatchableLocales } from './locales';\n\n/**\n * The expected shape of the fully resolved messages object.\n * Typescript ensures any static imports are properly typed, but since this\n * depends on types from formatjs, it should not be included in any files that\n * need to support older versions of TypeScript (3.7 and up).\n */\nexport interface I18nMessages {\n [namespace: string]: {\n [locale: string]: {\n [component: string]: {\n [key: string]: string | MessageFormatElement[];\n };\n };\n };\n}\n\n/**\n * A stateful container for formatting internal strings. Caches formatters\n * where possible; a new instance must be created if locale or messages may\n * have changed.\n */\nexport class I18nFormatter {\n private _locale: string;\n private _messages: I18nMessages;\n\n // Create a per-render cache of messages and IntlMessageFormat instances.\n // Not memoizing it allows us to reset the cache when the component rerenders\n // with potentially different locale or messages. We expect this component to\n // be placed above AppLayout and therefore rerender very infrequently.\n private _localeFormatterCache = new Map<string, IntlMessageFormat>();\n\n constructor(locale: string, messages: I18nMessages) {\n this._locale = locale;\n this._messages = messages;\n }\n\n format<ReturnValue, FormatFnArgs extends Record<string, string | number>>(\n namespace: string,\n component: string,\n key: string,\n provided: ReturnValue,\n customHandler?: CustomHandler<ReturnValue, FormatFnArgs>\n ): ReturnValue {\n // A general rule in this library is that undefined is basically\n // treated as \"not provided\". So even if a user explicitly provides an\n // undefined value, it will default to i18n provider values.\n if (provided !== undefined) {\n return provided;\n }\n\n const cacheKey = `${namespace}.${component}.${key}`;\n let intlMessageFormat: IntlMessageFormat;\n\n const cachedFormatter = this._localeFormatterCache.get(cacheKey);\n if (cachedFormatter) {\n // If an IntlMessageFormat instance was cached for this locale, just use that.\n intlMessageFormat = cachedFormatter;\n } else {\n // Widen the locale string (e.g. en-GB -> en) until we find a locale\n // that contains the message we need.\n let message: string | MessageFormatElement[] | undefined;\n const matchableLocales = getMatchableLocales(this._locale);\n for (const matchableLocale of matchableLocales) {\n message = this._messages?.[namespace]?.[matchableLocale]?.[component]?.[key];\n if (message !== undefined) {\n break;\n }\n }\n\n // If a message wasn't found, exit early.\n if (message === undefined) {\n return provided;\n }\n\n // Lazily create an IntlMessageFormat object for this key.\n intlMessageFormat = new IntlMessageFormat(message, this._locale);\n this._localeFormatterCache.set(cacheKey, intlMessageFormat);\n }\n\n if (customHandler) {\n return customHandler(args => intlMessageFormat.format(args) as string);\n }\n // Assuming `ReturnValue extends string` since a customHandler wasn't provided.\n return intlMessageFormat.format() as ReturnValue;\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,eAAe,IAAI,gBAAgB,EAAE,CAAC;gBAC/C,OAAO,GAAG,MAAA,MAAA,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAG,SAAS,CAAC,0CAAG,eAAe,CAAC,0CAAG,SAAS,CAAC,0CAAG,GAAG,CAAC,CAAC;gBAC7E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;oBAC1B,MAAM;gBACR,CAAC;YACH,CAAC;YAED,yCAAyC;YACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,0DAA0D;YAC1D,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAW,CAAC,CAAC;QACzE,CAAC;QACD,+EAA+E;QAC/E,OAAO,iBAAiB,CAAC,MAAM,EAAiB,CAAC;IACnD,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { MessageFormatElement } from '@formatjs/icu-messageformat-parser';\nimport IntlMessageFormat from 'intl-messageformat';\n\nimport { CustomHandler } from '../context';\nimport { getMatchableLocales } from './locales';\nimport { normalizeMessages } from './messages';\n\n/**\n * The expected shape of the fully resolved messages object.\n * Typescript ensures any static imports are properly typed, but since this\n * depends on types from formatjs, it should not be included in any files that\n * need to support older versions of TypeScript (3.7 and up).\n */\nexport interface I18nMessages {\n [namespace: string]: {\n [locale: string]: {\n [component: string]: {\n [key: string]: string | MessageFormatElement[];\n };\n };\n };\n}\n\n/**\n * A stateful container for formatting internal strings. Caches formatters\n * where possible; a new instance must be created if locale or messages may\n * have changed.\n */\nexport class I18nFormatter {\n private _locale: string;\n private _messages: I18nMessages;\n\n // Create a per-render cache of messages and IntlMessageFormat instances.\n // Not memoizing it allows us to reset the cache when the component rerenders\n // with potentially different locale or messages. We expect this component to\n // be placed above AppLayout and therefore rerender very infrequently.\n private _localeFormatterCache = new Map<string, IntlMessageFormat>();\n\n constructor(locale: string, messages: I18nMessages) {\n this._locale = locale.toLowerCase();\n this._messages = normalizeMessages([messages]);\n }\n\n format<ReturnValue, FormatFnArgs extends Record<string, string | number>>(\n namespace: string,\n component: string,\n key: string,\n provided: ReturnValue,\n customHandler?: CustomHandler<ReturnValue, FormatFnArgs>\n ): ReturnValue {\n // A general rule in this library is that undefined is basically\n // treated as \"not provided\". So even if a user explicitly provides an\n // undefined value, it will default to i18n provider values.\n if (provided !== undefined) {\n return provided;\n }\n\n const cacheKey = `${namespace}.${component}.${key}`;\n let intlMessageFormat: IntlMessageFormat;\n\n const cachedFormatter = this._localeFormatterCache.get(cacheKey);\n if (cachedFormatter) {\n // If an IntlMessageFormat instance was cached for this locale, just use that.\n intlMessageFormat = cachedFormatter;\n } else {\n // Widen the locale string (e.g. en-GB -> en) until we find a locale\n // that contains the message we need.\n let message: string | MessageFormatElement[] | undefined;\n const matchableLocales = getMatchableLocales(this._locale);\n for (const matchableLocale of matchableLocales) {\n message = this._messages?.[namespace]?.[matchableLocale]?.[component]?.[key];\n if (message !== undefined) {\n break;\n }\n }\n\n // If a message wasn't found, exit early.\n if (message === undefined) {\n return provided;\n }\n\n // Lazily create an IntlMessageFormat object for this key.\n intlMessageFormat = new IntlMessageFormat(message, this._locale);\n this._localeFormatterCache.set(cacheKey, intlMessageFormat);\n }\n\n if (customHandler) {\n return customHandler(args => intlMessageFormat.format(args) as string);\n }\n // Assuming `ReturnValue extends string` since a customHandler wasn't provided.\n return intlMessageFormat.format() as ReturnValue;\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { I18nMessages } from './i18n-formatter';
2
+ export declare function normalizeMessages(sources: ReadonlyArray<I18nMessages>): I18nMessages;
3
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/i18n/utils/messages.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,YAAY,CAwBpF"}
@@ -0,0 +1,28 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export function normalizeMessages(sources) {
4
+ const result = {};
5
+ for (const messages of sources) {
6
+ for (const namespace in messages) {
7
+ if (!(namespace in result)) {
8
+ result[namespace] = {};
9
+ }
10
+ for (const casedLocale in messages[namespace]) {
11
+ const locale = casedLocale.toLowerCase();
12
+ if (!(locale in result[namespace])) {
13
+ result[namespace][locale] = {};
14
+ }
15
+ for (const component in messages[namespace][casedLocale]) {
16
+ if (!(component in result[namespace][locale])) {
17
+ result[namespace][locale][component] = {};
18
+ }
19
+ for (const key in messages[namespace][casedLocale][component]) {
20
+ result[namespace][locale][component][key] = messages[namespace][casedLocale][component][key];
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ return result;
27
+ }
28
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/i18n/utils/messages.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,MAAM,UAAU,iBAAiB,CAAC,OAAoC;IACpE,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;QAC/B,KAAK,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;YACzB,CAAC;YACD,KAAK,MAAM,WAAW,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC9C,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;gBACzC,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;oBACnC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;gBACjC,CAAC;gBACD,KAAK,MAAM,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;oBACzD,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;wBAC9C,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;oBAC5C,CAAC;oBACD,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC9D,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC;oBAC/F,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { I18nMessages } from './i18n-formatter';\n\nexport function normalizeMessages(sources: ReadonlyArray<I18nMessages>): I18nMessages {\n const result: I18nMessages = {};\n for (const messages of sources) {\n for (const namespace in messages) {\n if (!(namespace in result)) {\n result[namespace] = {};\n }\n for (const casedLocale in messages[namespace]) {\n const locale = casedLocale.toLowerCase();\n if (!(locale in result[namespace])) {\n result[namespace][locale] = {};\n }\n for (const component in messages[namespace][casedLocale]) {\n if (!(component in result[namespace][locale])) {\n result[namespace][locale][component] = {};\n }\n for (const key in messages[namespace][casedLocale][component]) {\n result[namespace][locale][component][key] = messages[namespace][casedLocale][component][key];\n }\n }\n }\n }\n }\n return result;\n}\n"]}
@@ -3816,5 +3816,5 @@ body {
3816
3816
  }
3817
3817
  }
3818
3818
  :root {
3819
- --awsui-version-info-a3d7548f: true;
3819
+ --awsui-version-info-967748eb: true;
3820
3820
  }
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (a3d7548f)";
3
- export var GIT_SHA = "a3d7548f";
2
+ export var PACKAGE_VERSION = "3.0.0 (967748eb)";
3
+ export var GIT_SHA = "967748eb";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "core";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (a3d7548f)",
4
- "GIT_SHA": "a3d7548f",
3
+ "PACKAGE_VERSION": "3.0.0 (967748eb)",
4
+ "GIT_SHA": "967748eb",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HAgFvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HA+EvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -17,7 +17,7 @@ const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ar
17
17
  const baseProps = getBaseProps(props);
18
18
  const generatedName = useUniqueId('awsui-radio-');
19
19
  const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
20
- return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles.root, styles['radio-group'], direction === 'horizontal' && styles['horizontal-group']), ref: __internalRootRef }, items &&
20
+ return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles['radio-group'], direction === 'horizontal' && styles['horizontal-group']), ref: __internalRootRef }, items &&
21
21
  items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(styles.radio, item.description && styles['radio--has-description'], direction === 'horizontal' && styles.horizontal, item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, description: item.description, disabled: item.disabled, onSelect: () => fireNonCancelableEvent(onChange, { value: item.value }), controlId: item.controlId, readOnly: readOnly, style: style, ...getAnalyticsMetadataAttribute(!item.disabled && !readOnly
22
22
  ? {
23
23
  detail: {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAKpF,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,EACE,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACgB,EAC1B,GAAmC,EACnC,EAAE;IACF,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAElD,MAAM,CAAC,cAAc,EAAE,mBAAmB,CAAC,GAAG,yBAAyB,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAE3F,OAAO,CACL,6BAC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B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;gBACzB,CAAC,CAAC;oBACE,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAC+C;iBACnE;gBACH,CAAC,CAAC,EAAE,CACP,IAEA,IAAI,CAAC,KAAK,CACC,CACf,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n direction,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(\n baseProps.className,\n testUtilStyles.root,\n styles.root,\n styles['radio-group'],\n direction === 'horizontal' && styles['horizontal-group']\n )}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n direction === 'horizontal' && styles.horizontal,\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onSelect={() => fireNonCancelableEvent(onChange, { value: item.value })}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE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WAAW,IACV,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,GAAG,EAAE,KAAK,KAAK,mBAAmB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EAC/D,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,KAAK,EACZ,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,wBAAwB,CAAC,EACpD,SAAS,KAAK,YAAY,IAAI,MAAM,CAAC,UAAU,EAC/C,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,kBAAkB,CAAC,QAAQ,CACpD,EACD,OAAO,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,EAC7B,IAAI,EAAE,IAAI,IAAI,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EACvE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,KACR,6BAA6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;gBACzB,CAAC,CAAC;oBACE,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAC+C;iBACnE;gBACH,CAAC,CAAC,EAAE,CACP,IAEA,IAAI,CAAC,KAAK,CACC,CACf,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n direction,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(\n baseProps.className,\n testUtilStyles.root,\n styles['radio-group'],\n direction === 'horizontal' && styles['horizontal-group']\n )}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n direction === 'horizontal' && styles.horizontal,\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onSelect={() => fireNonCancelableEvent(onChange, { value: item.value })}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
@@ -1,11 +1,10 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1mabk_3hsov_145",
5
- "radio-group": "awsui_radio-group_1mabk_3hsov_149",
6
- "horizontal-group": "awsui_horizontal-group_1mabk_3hsov_180",
7
- "radio": "awsui_radio_1mabk_3hsov_149",
8
- "horizontal": "awsui_horizontal_1mabk_3hsov_180",
9
- "radio--has-description": "awsui_radio--has-description_1mabk_3hsov_194"
4
+ "radio-group": "awsui_radio-group_1mabk_cn4z5_145",
5
+ "horizontal-group": "awsui_horizontal-group_1mabk_cn4z5_176",
6
+ "radio": "awsui_radio_1mabk_cn4z5_145",
7
+ "horizontal": "awsui_horizontal_1mabk_cn4z5_176",
8
+ "radio--has-description": "awsui_radio--has-description_1mabk_cn4z5_190"
10
9
  };
11
10
 
@@ -142,11 +142,7 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_root_1mabk_3hsov_145:not(#\9) {
146
- /* used for backwards-compatibility with older versions of test-utils */
147
- }
148
-
149
- .awsui_radio-group_1mabk_3hsov_149:not(#\9) {
145
+ .awsui_radio-group_1mabk_cn4z5_145:not(#\9) {
150
146
  border-collapse: separate;
151
147
  border-spacing: 0;
152
148
  box-sizing: border-box;
@@ -177,24 +173,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
177
173
  -webkit-font-smoothing: auto;
178
174
  -moz-osx-font-smoothing: auto;
179
175
  }
180
- .awsui_radio-group_1mabk_3hsov_149:not(#\9):not(.awsui_horizontal-group_1mabk_3hsov_180) {
176
+ .awsui_radio-group_1mabk_cn4z5_145:not(#\9):not(.awsui_horizontal-group_1mabk_cn4z5_176) {
181
177
  display: block;
182
178
  }
183
- .awsui_radio-group_1mabk_3hsov_149.awsui_horizontal-group_1mabk_3hsov_180:not(#\9) {
179
+ .awsui_radio-group_1mabk_cn4z5_145.awsui_horizontal-group_1mabk_cn4z5_176:not(#\9) {
184
180
  display: flex;
185
181
  align-items: flex-start;
186
182
  flex-wrap: wrap;
187
183
  gap: var(--space-scaled-l-66n9sr, 20px);
188
184
  }
189
185
 
190
- .awsui_radio_1mabk_3hsov_149 + .awsui_radio_1mabk_3hsov_149:not(#\9):not(.awsui_horizontal_1mabk_3hsov_180) {
186
+ .awsui_radio_1mabk_cn4z5_145 + .awsui_radio_1mabk_cn4z5_145:not(#\9):not(.awsui_horizontal_1mabk_cn4z5_176) {
191
187
  margin-block-start: var(--space-scaled-xxs-jatbiv, 4px);
192
188
  }
193
189
 
194
- .awsui_radio--has-description_1mabk_3hsov_194 + .awsui_radio_1mabk_3hsov_149:not(#\9):not(.awsui_horizontal_1mabk_3hsov_180) {
190
+ .awsui_radio--has-description_1mabk_cn4z5_190 + .awsui_radio_1mabk_cn4z5_145:not(#\9):not(.awsui_horizontal_1mabk_cn4z5_176) {
195
191
  margin-block-start: var(--space-scaled-xs-sppte9, 8px);
196
192
  }
197
193
 
198
- .awsui_radio_1mabk_3hsov_149.awsui_horizontal_1mabk_3hsov_180:not(#\9) {
194
+ .awsui_radio_1mabk_cn4z5_145.awsui_horizontal_1mabk_cn4z5_176:not(#\9) {
199
195
  max-inline-size: calc(16 * var(--space-scaled-xxl-9ur2is, 32px));
200
196
  }
@@ -2,11 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_1mabk_3hsov_145",
6
- "radio-group": "awsui_radio-group_1mabk_3hsov_149",
7
- "horizontal-group": "awsui_horizontal-group_1mabk_3hsov_180",
8
- "radio": "awsui_radio_1mabk_3hsov_149",
9
- "horizontal": "awsui_horizontal_1mabk_3hsov_180",
10
- "radio--has-description": "awsui_radio--has-description_1mabk_3hsov_194"
5
+ "radio-group": "awsui_radio-group_1mabk_cn4z5_145",
6
+ "horizontal-group": "awsui_horizontal-group_1mabk_cn4z5_176",
7
+ "radio": "awsui_radio_1mabk_cn4z5_145",
8
+ "horizontal": "awsui_horizontal_1mabk_cn4z5_176",
9
+ "radio--has-description": "awsui_radio--has-description_1mabk_cn4z5_190"
11
10
  };
12
11
 
@@ -2,7 +2,6 @@ import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-
2
2
  import RadioButtonWrapper from '../radio-button';
3
3
  export default class RadioGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
- static legacyRootSelector: string;
6
5
  findButtons(): Array<RadioButtonWrapper>;
7
6
  findInputByValue(value: string): ElementWrapper<HTMLInputElement> | null;
8
7
  }
@@ -6,18 +6,16 @@ const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
6
  const utils_1 = require("@cloudscape-design/test-utils-core/utils");
7
7
  const radio_button_1 = require("../radio-button");
8
8
  const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
9
- const styles_selectors_js_2 = require("../../../radio-group/styles.selectors.js");
10
- const styles_selectors_js_3 = require("../../../radio-group/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../radio-group/test-classes/styles.selectors.js");
11
10
  class RadioGroupWrapper extends dom_1.ComponentWrapper {
12
11
  findButtons() {
13
- return this.findAll(`:is(.${styles_selectors_js_1.default.root}, .${styles_selectors_js_2.default.radio})`).map(r => new radio_button_1.default(r.getElement()));
12
+ return this.findAllByClassName(styles_selectors_js_1.default.root).map(r => new radio_button_1.default(r.getElement()));
14
13
  }
15
14
  findInputByValue(value) {
16
15
  const safeValue = (0, utils_1.escapeSelector)(value);
17
16
  return this.find(`input[value="${safeValue}"]`);
18
17
  }
19
18
  }
20
- RadioGroupWrapper.rootSelector = styles_selectors_js_3.default.root;
21
- RadioGroupWrapper.legacyRootSelector = styles_selectors_js_2.default.root;
19
+ RadioGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
22
20
  exports.default = RadioGroupWrapper;
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAC1F,oEAA0E;AAE1E,kDAAiD;AAEjD,oHAA2G;AAC3G,kFAAoE;AACpE,+FAA2E;AAE3E,MAAqB,iBAAkB,SAAQ,sBAAgB;IAI7D,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,6BAAiB,CAAC,IAAI,MAAM,6BAAY,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAChF,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAC5C,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AAZM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;AACnC,oCAAkB,GAAW,6BAAY,CAAC,IAAI,CAAC;kBAFnC,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAC1F,oEAA0E;AAE1E,kDAAiD;AAEjD,oHAA2G;AAC3G,+FAA2E;AAE3E,MAAqB,iBAAkB,SAAQ,sBAAgB;IAG7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AATM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
@@ -2,7 +2,6 @@ import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-
2
2
  import RadioButtonWrapper from '../radio-button';
3
3
  export default class RadioGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
- static legacyRootSelector: string;
6
5
  findButtons(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<RadioButtonWrapper>;
7
6
  findInputByValue(value: string): ElementWrapper;
8
7
  }
@@ -6,18 +6,16 @@ const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
6
  const utils_1 = require("@cloudscape-design/test-utils-core/utils");
7
7
  const radio_button_1 = require("../radio-button");
8
8
  const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
9
- const styles_selectors_js_2 = require("../../../radio-group/styles.selectors.js");
10
- const styles_selectors_js_3 = require("../../../radio-group/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../radio-group/test-classes/styles.selectors.js");
11
10
  class RadioGroupWrapper extends selectors_1.ComponentWrapper {
12
11
  findButtons() {
13
- return this.findAll(`:is(.${styles_selectors_js_1.default.root}, .${styles_selectors_js_2.default.radio})`).map(r => new radio_button_1.default(r.getElement()));
12
+ return this.findAllByClassName(styles_selectors_js_1.default.root).map(r => new radio_button_1.default(r.getElement()));
14
13
  }
15
14
  findInputByValue(value) {
16
15
  const safeValue = (0, utils_1.escapeSelector)(value);
17
16
  return this.find(`input[value="${safeValue}"]`);
18
17
  }
19
18
  }
20
- RadioGroupWrapper.rootSelector = styles_selectors_js_3.default.root;
21
- RadioGroupWrapper.legacyRootSelector = styles_selectors_js_2.default.root;
19
+ RadioGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
22
20
  exports.default = RadioGroupWrapper;
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oEAA0E;AAC1E,kDAAiD;AACjD,oHAA2G;AAC3G,kFAAoE;AACpE,+FAA2E;AAC3E,MAAqB,iBAAkB,SAAQ,4BAAgB;IAG7D,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,6BAAiB,CAAC,IAAI,MAAM,6BAAY,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAClI,CAAC;IACD,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AARM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;AACnC,oCAAkB,GAAW,6BAAY,CAAC,IAAI,CAAC;kBAFnC,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oEAA0E;AAC1E,kDAAiD;AACjD,oHAA2G;AAC3G,+FAA2E;AAC3E,MAAqB,iBAAkB,SAAQ,4BAAgB;IAE7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AAPM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.1241",
3
+ "version": "3.0.1243",
4
4
  "files": [
5
5
  "lib"
6
6
  ],