@cloudscape-design/components-themeable 3.0.1239 → 3.0.1240

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 (64) 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/template/app-layout/index.d.ts.map +1 -1
  4. package/lib/internal/template/app-layout/index.js +3 -15
  5. package/lib/internal/template/app-layout/index.js.map +1 -1
  6. package/lib/internal/template/app-layout/utils/use-aria-labels.d.ts +3 -0
  7. package/lib/internal/template/app-layout/utils/use-aria-labels.d.ts.map +1 -0
  8. package/lib/internal/template/app-layout/utils/use-aria-labels.js +19 -0
  9. package/lib/internal/template/app-layout/utils/use-aria-labels.js.map +1 -0
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +17 -9
  12. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  13. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts +1 -0
  14. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.js +1 -0
  16. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.js.map +1 -1
  17. package/lib/internal/template/app-layout-toolbar/index.d.ts.map +1 -1
  18. package/lib/internal/template/app-layout-toolbar/index.js +1 -16
  19. package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
  20. package/lib/internal/template/button/index.d.ts.map +1 -1
  21. package/lib/internal/template/button/index.js +2 -2
  22. package/lib/internal/template/button/index.js.map +1 -1
  23. package/lib/internal/template/button/interfaces.d.ts +4 -0
  24. package/lib/internal/template/button/interfaces.d.ts.map +1 -1
  25. package/lib/internal/template/button/interfaces.js.map +1 -1
  26. package/lib/internal/template/button/internal.d.ts.map +1 -1
  27. package/lib/internal/template/button/internal.js +2 -1
  28. package/lib/internal/template/button/internal.js.map +1 -1
  29. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  30. package/lib/internal/template/button-dropdown/internal.js +2 -4
  31. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  32. package/lib/internal/template/i18n/dynamic.js +1 -1
  33. package/lib/internal/template/i18n/provider.d.ts +4 -12
  34. package/lib/internal/template/i18n/provider.d.ts.map +1 -1
  35. package/lib/internal/template/i18n/provider.js +4 -106
  36. package/lib/internal/template/i18n/provider.js.map +1 -1
  37. package/lib/internal/template/i18n/providers/local-provider.d.ts +9 -0
  38. package/lib/internal/template/i18n/providers/local-provider.d.ts.map +1 -0
  39. package/lib/internal/template/i18n/providers/local-provider.js +56 -0
  40. package/lib/internal/template/i18n/providers/local-provider.js.map +1 -0
  41. package/lib/internal/template/i18n/providers/remote-provider.d.ts +24 -0
  42. package/lib/internal/template/i18n/providers/remote-provider.d.ts.map +1 -0
  43. package/lib/internal/template/i18n/providers/remote-provider.js +42 -0
  44. package/lib/internal/template/i18n/providers/remote-provider.js.map +1 -0
  45. package/lib/internal/template/i18n/utils/i18n-formatter.d.ts +30 -0
  46. package/lib/internal/template/i18n/utils/i18n-formatter.d.ts.map +1 -0
  47. package/lib/internal/template/i18n/utils/i18n-formatter.js +61 -0
  48. package/lib/internal/template/i18n/utils/i18n-formatter.js.map +1 -0
  49. package/lib/internal/template/i18n/utils/locales.d.ts +3 -0
  50. package/lib/internal/template/i18n/utils/locales.d.ts.map +1 -0
  51. package/lib/internal/template/i18n/utils/locales.js +28 -0
  52. package/lib/internal/template/i18n/utils/locales.js.map +1 -0
  53. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  54. package/lib/internal/template/internal/environment.js +2 -2
  55. package/lib/internal/template/internal/environment.json +2 -2
  56. package/lib/internal/template/internal/widget-exports.d.ts +1 -0
  57. package/lib/internal/template/internal/widget-exports.d.ts.map +1 -1
  58. package/lib/internal/template/internal/widget-exports.js +2 -0
  59. package/lib/internal/template/internal/widget-exports.js.map +1 -1
  60. package/package.json +1 -1
  61. package/lib/internal/template/i18n/get-matchable-locales.d.ts +0 -2
  62. package/lib/internal/template/i18n/get-matchable-locales.d.ts.map +0 -1
  63. package/lib/internal/template/i18n/get-matchable-locales.js +0 -14
  64. package/lib/internal/template/i18n/get-matchable-locales.js.map +0 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "b398201ac3d12d73b034f2584f41d08c15ba5d11"
2
+ "commit": "41acf98edabd4c5afcb00bc56409cf4ee688064d"
3
3
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "b398201a";
3
+ $awsui-commit-hash: "41acf98e";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-n6lfw8;
6
6
  $minContentWidth: --awsui-min-content-width-n6lfw8;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAwGd,CAAC;AAGF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FA4Fd,CAAC;AAGF,eAAe,SAAS,CAAC"}
@@ -3,7 +3,6 @@
3
3
  'use client';
4
4
  import React from 'react';
5
5
  import { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';
6
- import { useInternalI18n } from '../i18n/context';
7
6
  import { getBaseProps } from '../internal/base-component';
8
7
  import useBaseComponent from '../internal/hooks/use-base-component';
9
8
  import { useControllable } from '../internal/hooks/use-controllable';
@@ -14,8 +13,9 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
14
13
  import { applyDefaults } from './defaults';
15
14
  import { AppLayoutInternal } from './internal';
16
15
  import { useAppLayoutPlacement } from './utils/use-app-layout-placement';
16
+ import { useAriaLabels } from './utils/use-aria-labels';
17
17
  const AppLayout = React.forwardRef(({ contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f', navigationWidth = 280, toolsWidth = 290, maxContentWidth, minContentWidth, navigationOpen: controlledNavigationOpen, onNavigationChange: controlledOnNavigationChange, analyticsMetadata, ...rest }, ref) => {
18
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
18
+ var _a, _b;
19
19
  if (isDevelopment) {
20
20
  if (rest.toolsOpen && rest.toolsHide) {
21
21
  warnOnce('AppLayout', `You have enabled both the \`toolsOpen\` prop and the \`toolsHide\` prop. This is not supported. Set \`toolsOpen\` to \`false\` when you set \`toolsHide\` to \`true\`.`);
@@ -42,19 +42,7 @@ const AppLayout = React.forwardRef(({ contentType = 'default', headerSelector =
42
42
  }, analyticsMetadata);
43
43
  const isRefresh = useVisualRefresh();
44
44
  const isMobile = useMobile();
45
- const i18n = useInternalI18n('app-layout');
46
- const ariaLabels = {
47
- navigation: i18n('ariaLabels.navigation', (_c = rest.ariaLabels) === null || _c === void 0 ? void 0 : _c.navigation),
48
- navigationClose: i18n('ariaLabels.navigationClose', (_d = rest.ariaLabels) === null || _d === void 0 ? void 0 : _d.navigationClose),
49
- navigationToggle: i18n('ariaLabels.navigationToggle', (_e = rest.ariaLabels) === null || _e === void 0 ? void 0 : _e.navigationToggle),
50
- notifications: i18n('ariaLabels.notifications', (_f = rest.ariaLabels) === null || _f === void 0 ? void 0 : _f.notifications),
51
- tools: i18n('ariaLabels.tools', (_g = rest.ariaLabels) === null || _g === void 0 ? void 0 : _g.tools),
52
- toolsClose: i18n('ariaLabels.toolsClose', (_h = rest.ariaLabels) === null || _h === void 0 ? void 0 : _h.toolsClose),
53
- toolsToggle: i18n('ariaLabels.toolsToggle', (_j = rest.ariaLabels) === null || _j === void 0 ? void 0 : _j.toolsToggle),
54
- drawers: i18n('ariaLabels.drawers', (_k = rest.ariaLabels) === null || _k === void 0 ? void 0 : _k.drawers),
55
- drawersOverflow: i18n('ariaLabels.drawersOverflow', (_l = rest.ariaLabels) === null || _l === void 0 ? void 0 : _l.drawersOverflow),
56
- drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', (_m = rest.ariaLabels) === null || _m === void 0 ? void 0 : _m.drawersOverflowWithBadge),
57
- };
45
+ const ariaLabels = useAriaLabels(rest.ariaLabels);
58
46
  const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(contentType, { maxContentWidth, minContentWidth }, isRefresh);
59
47
  const [navigationOpen = false, setNavigationOpen] = useControllable(controlledNavigationOpen, controlledOnNavigationChange, isMobile ? false : defaultNavigationOpen, { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' });
60
48
  const onNavigationChange = (event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAm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ACX,EAAE,eAAe,EAAE,eAAe,EAAE,EACpC,SAAS,CACV,CAAC;IAEF,MAAM,CAAC,cAAc,GAAG,KAAK,EAAE,iBAAiB,CAAC,GAAG,eAAe,CACjE,wBAAwB,EACxB,4BAA4B,EAC5B,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB,EACxC,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CACtG,CAAC;IACF,MAAM,kBAAkB,GAAG,CAAC,KAA4D,EAAE,EAAE;QAC1F,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrC,4BAA4B,aAA5B,4BAA4B,uBAA5B,4BAA4B,CAAG,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,qBAAqB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAEnF,wDAAwD;IACxD,MAAM,KAAK,GAAG;QACZ,WAAW;QACX,eAAe;QACf,UAAU;QACV,cAAc;QACd,kBAAkB;QAClB,GAAG,YAAY;QACf,GAAG,IAAI;QACP,UAAU;QACV,SAAS;KACV,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAM,SAAS;QAC/D,oBAAC,iBAAiB,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CACtC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { isDevelopment } from '../internal/is-development';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { applyDefaults } from './defaults';\nimport { AppLayoutProps } from './interfaces';\nimport { AppLayoutInternal } from './internal';\nimport { useAppLayoutPlacement } from './utils/use-app-layout-placement';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n analyticsMetadata,\n ...rest\n }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n if (isDevelopment) {\n if (rest.toolsOpen && rest.toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const { __internalRootRef } = useBaseComponent(\n 'AppLayout',\n {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n disableBodyScroll: rest.disableBodyScroll,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n },\n analyticsMetadata\n );\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const i18n = useInternalI18n('app-layout');\n const ariaLabels = {\n navigation: i18n('ariaLabels.navigation', rest.ariaLabels?.navigation),\n navigationClose: i18n('ariaLabels.navigationClose', rest.ariaLabels?.navigationClose),\n navigationToggle: i18n('ariaLabels.navigationToggle', rest.ariaLabels?.navigationToggle),\n notifications: i18n('ariaLabels.notifications', rest.ariaLabels?.notifications),\n tools: i18n('ariaLabels.tools', rest.ariaLabels?.tools),\n toolsClose: i18n('ariaLabels.toolsClose', rest.ariaLabels?.toolsClose),\n toolsToggle: i18n('ariaLabels.toolsToggle', rest.ariaLabels?.toolsToggle),\n drawers: i18n('ariaLabels.drawers', rest.ariaLabels?.drawers),\n drawersOverflow: i18n('ariaLabels.drawersOverflow', rest.ariaLabels?.drawersOverflow),\n drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', rest.ariaLabels?.drawersOverflowWithBadge),\n };\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent<AppLayoutProps.ChangeDetail>) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n ariaLabels,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <div ref={useMergeRefs(__internalRootRef, rootRef)} {...baseProps}>\n <AppLayoutInternal ref={ref} {...props} />\n </div>\n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxD,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CACE,EACE,WAAW,GAAG,SAAS,EACvB,cAAc,GAAG,OAAO,EACxB,cAAc,GAAG,OAAO,EACxB,eAAe,GAAG,GAAG,EACrB,UAAU,GAAG,GAAG,EAChB,eAAe,EACf,eAAe,EACf,cAAc,EAAE,wBAAwB,EACxC,kBAAkB,EAAE,4BAA4B,EAChD,iBAAiB,EACjB,GAAG,IAAI,EACQ,EACjB,GAAkC,EAClC,EAAE;;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACrC,QAAQ,CACN,WAAW,EACX,w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C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrC,4BAA4B,aAA5B,4BAA4B,uBAA5B,4BAA4B,CAAG,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,qBAAqB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAEnF,wDAAwD;IACxD,MAAM,KAAK,GAAG;QACZ,WAAW;QACX,eAAe;QACf,UAAU;QACV,cAAc;QACd,kBAAkB;QAClB,GAAG,YAAY;QACf,GAAG,IAAI;QACP,UAAU;QACV,SAAS;KACV,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAM,SAAS;QAC/D,oBAAC,iBAAiB,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CACtC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { isDevelopment } from '../internal/is-development';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { applyDefaults } from './defaults';\nimport { AppLayoutProps } from './interfaces';\nimport { AppLayoutInternal } from './internal';\nimport { useAppLayoutPlacement } from './utils/use-app-layout-placement';\nimport { useAriaLabels } from './utils/use-aria-labels';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n analyticsMetadata,\n ...rest\n }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n if (isDevelopment) {\n if (rest.toolsOpen && rest.toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const { __internalRootRef } = useBaseComponent(\n 'AppLayout',\n {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n disableBodyScroll: rest.disableBodyScroll,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n },\n analyticsMetadata\n );\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const ariaLabels = useAriaLabels(rest.ariaLabels);\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent<AppLayoutProps.ChangeDetail>) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n ariaLabels,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <div ref={useMergeRefs(__internalRootRef, rootRef)} {...baseProps}>\n <AppLayoutInternal ref={ref} {...props} />\n </div>\n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n"]}
@@ -0,0 +1,3 @@
1
+ import { AppLayoutProps } from '../interfaces';
2
+ export declare function useAriaLabels(ariaLabelsOverride: AppLayoutProps.Labels | undefined): AppLayoutProps.Labels;
3
+ //# sourceMappingURL=use-aria-labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-aria-labels.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-aria-labels.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,wBAAgB,aAAa,CAAC,kBAAkB,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC,MAAM,CAc1G"}
@@ -0,0 +1,19 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { useInternalI18n } from '../../i18n/context';
4
+ export function useAriaLabels(ariaLabelsOverride) {
5
+ const i18n = useInternalI18n('app-layout');
6
+ return {
7
+ navigation: i18n('ariaLabels.navigation', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.navigation),
8
+ navigationClose: i18n('ariaLabels.navigationClose', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.navigationClose),
9
+ navigationToggle: i18n('ariaLabels.navigationToggle', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.navigationToggle),
10
+ notifications: i18n('ariaLabels.notifications', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.notifications),
11
+ tools: i18n('ariaLabels.tools', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.tools),
12
+ toolsClose: i18n('ariaLabels.toolsClose', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.toolsClose),
13
+ toolsToggle: i18n('ariaLabels.toolsToggle', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.toolsToggle),
14
+ drawers: i18n('ariaLabels.drawers', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.drawers),
15
+ drawersOverflow: i18n('ariaLabels.drawersOverflow', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.drawersOverflow),
16
+ drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', ariaLabelsOverride === null || ariaLabelsOverride === void 0 ? void 0 : ariaLabelsOverride.drawersOverflowWithBadge),
17
+ };
18
+ }
19
+ //# sourceMappingURL=use-aria-labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-aria-labels.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-aria-labels.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,UAAU,aAAa,CAAC,kBAAqD;IACjF,MAAM,IAAI,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,OAAO;QACL,UAAU,EAAE,IAAI,CAAC,uBAAuB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,UAAU,CAAC;QACzE,eAAe,EAAE,IAAI,CAAC,4BAA4B,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,eAAe,CAAC;QACxF,gBAAgB,EAAE,IAAI,CAAC,6BAA6B,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,gBAAgB,CAAC;QAC3F,aAAa,EAAE,IAAI,CAAC,0BAA0B,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,aAAa,CAAC;QAClF,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,KAAK,CAAC;QAC1D,UAAU,EAAE,IAAI,CAAC,uBAAuB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,UAAU,CAAC;QACzE,WAAW,EAAE,IAAI,CAAC,wBAAwB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,WAAW,CAAC;QAC5E,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAC;QAChE,eAAe,EAAE,IAAI,CAAC,4BAA4B,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,eAAe,CAAC;QACxF,wBAAwB,EAAE,IAAI,CAAC,qCAAqC,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,wBAAwB,CAAC;KACpH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useInternalI18n } from '../../i18n/context';\nimport { AppLayoutProps } from '../interfaces';\n\nexport function useAriaLabels(ariaLabelsOverride: AppLayoutProps.Labels | undefined): AppLayoutProps.Labels {\n const i18n = useInternalI18n('app-layout');\n return {\n navigation: i18n('ariaLabels.navigation', ariaLabelsOverride?.navigation),\n navigationClose: i18n('ariaLabels.navigationClose', ariaLabelsOverride?.navigationClose),\n navigationToggle: i18n('ariaLabels.navigationToggle', ariaLabelsOverride?.navigationToggle),\n notifications: i18n('ariaLabels.notifications', ariaLabelsOverride?.notifications),\n tools: i18n('ariaLabels.tools', ariaLabelsOverride?.tools),\n toolsClose: i18n('ariaLabels.toolsClose', ariaLabelsOverride?.toolsClose),\n toolsToggle: i18n('ariaLabels.toolsToggle', ariaLabelsOverride?.toolsToggle),\n drawers: i18n('ariaLabels.drawers', ariaLabelsOverride?.drawers),\n drawersOverflow: i18n('ariaLabels.drawersOverflow', ariaLabelsOverride?.drawersOverflow),\n drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', ariaLabelsOverride?.drawersOverflowWithBadge),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAyB,MAAM,cAAc,CAAC;AAsD7E,QAAA,MAAM,6BAA6B,mGAkClC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAM5E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,sBAAsB,EAAyB,MAAM,cAAc,CAAC;AAsD7E,QAAA,MAAM,6BAA6B,mGAclC,CAAC;AAmDF,eAAe,6BAA6B,CAAC"}
@@ -3,9 +3,11 @@
3
3
  import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
4
4
  import { unstable_batchedUpdates } from 'react-dom';
5
5
  import { AppLayoutBuiltInErrorBoundary } from '../../error-boundary/internal';
6
+ import RemoteI18nProvider from '../../i18n/providers/remote-provider';
6
7
  import ScreenreaderOnly from '../../internal/components/screenreader-only';
8
+ import { useAriaLabels } from '../utils/use-aria-labels';
7
9
  import { AppLayoutVisibilityContext } from './contexts';
8
- import { AppLayoutWidgetizedState } from './internal';
10
+ import { AppLayoutWidgetizedState, loadFormatter } from './internal';
9
11
  import { SkeletonLayout } from './skeleton';
10
12
  import { useMultiAppLayout } from './skeleton/multi-layout';
11
13
  import { getPropsToMerge, mergeProps } from './state/props-merger';
@@ -35,14 +37,20 @@ const AppLayoutStateProvider = ({ forceDeduplicationType, appLayoutProps, stateM
35
37
  return React.createElement(React.Fragment, null, children(registered, appLayoutState, toolbarProps, skeletonAttributes));
36
38
  };
37
39
  const AppLayoutVisualRefreshToolbar = React.forwardRef((props, forwardRef) => {
38
- const stateManager = useRef({ setState: undefined, hasToolbar: false, setToolbar: undefined });
39
- const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } = props;
40
- return (React.createElement(React.Fragment, null,
41
- React.createElement(AppLayoutStateProvider, { forceDeduplicationType: forceDeduplicationType, appLayoutProps: props, stateManager: stateManager }, (registered, appLayoutState, toolbarProps, skeletonAttributes) => (React.createElement(AppLayoutVisibilityContext.Provider, { value: appLayoutState.isIntersecting },
42
- (embeddedViewMode || !toolbarProps) && props.breadcrumbs ? (React.createElement(AppLayoutBuiltInErrorBoundary, null,
43
- React.createElement(ScreenreaderOnly, null, props.breadcrumbs))) : null,
44
- React.createElement(SkeletonLayout, { registered: registered, toolbarProps: toolbarProps, appLayoutProps: props, appLayoutState: appLayoutState, skeletonSlotsAttributes: skeletonAttributes })))),
45
- React.createElement(AppLayoutWidgetizedState, { forwardRef: forwardRef, appLayoutProps: props, stateManager: stateManager })));
40
+ const stateManagerRef = useRef({ setState: undefined, hasToolbar: false, setToolbar: undefined });
41
+ return (React.createElement(RemoteI18nProvider, { loadFormatter: loadFormatter },
42
+ React.createElement(AppLayoutVisualRefreshToolbarWithI18n, { appLayoutRef: forwardRef, stateManagerRef: stateManagerRef, appLayoutProps: props })));
46
43
  });
44
+ function AppLayoutVisualRefreshToolbarWithI18n({ appLayoutRef, stateManagerRef, appLayoutProps, }) {
45
+ const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } = appLayoutProps;
46
+ const ariaLabels = useAriaLabels(appLayoutProps.ariaLabels);
47
+ const appLayoutPropsWithI18n = { ...appLayoutProps, ariaLabels };
48
+ return (React.createElement(React.Fragment, null,
49
+ React.createElement(AppLayoutStateProvider, { forceDeduplicationType: forceDeduplicationType, appLayoutProps: appLayoutPropsWithI18n, stateManager: stateManagerRef }, (registered, appLayoutState, toolbarProps, skeletonAttributes) => (React.createElement(AppLayoutVisibilityContext.Provider, { value: appLayoutState.isIntersecting },
50
+ (embeddedViewMode || !toolbarProps) && appLayoutPropsWithI18n.breadcrumbs ? (React.createElement(AppLayoutBuiltInErrorBoundary, null,
51
+ React.createElement(ScreenreaderOnly, null, appLayoutPropsWithI18n.breadcrumbs))) : null,
52
+ React.createElement(SkeletonLayout, { registered: registered, toolbarProps: toolbarProps, appLayoutProps: appLayoutPropsWithI18n, appLayoutState: appLayoutState, skeletonSlotsAttributes: skeletonAttributes })))),
53
+ React.createElement(AppLayoutWidgetizedState, { forwardRef: appLayoutRef, appLayoutProps: appLayoutPropsWithI18n, stateManager: stateManagerRef })));
54
+ }
47
55
  export default AppLayoutVisualRefreshToolbar;
48
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,gBAAgB,MAAM,6CAA6C,CA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C,WAAW,CAAC,CAAC,CAAC,CAC1D,oBAAC,6BAA6B;gBAC5B,oBAAC,gBAAgB,QAAE,KAAK,CAAC,WAAW,CAAoB,CAC1B,CACjC,CAAC,CAAC,CAAC,IAAI;YACR,oBAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,KAAK,EACrB,cAAc,EAAE,cAAc,EAC9B,uBAAuB,EAAE,kBAAkB,GAC3C,CACkC,CACvC,CACsB;QACzB,oBAAC,wBAAwB,IAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,CACtG,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { unstable_batchedUpdates } from 'react-dom';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../error-boundary/internal';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutVisibilityContext } from './contexts';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from './interfaces';\nimport { AppLayoutWidgetizedState } from './internal';\nimport { SkeletonLayout } from './skeleton';\nimport { SkeletonSlotsAttributes } from './skeleton/interfaces';\nimport { DeduplicationType, useMultiAppLayout } from './skeleton/multi-layout';\nimport { StateManager } from './state';\nimport { SharedProps } from './state/interfaces';\nimport { getPropsToMerge, mergeProps } from './state/props-merger';\nimport { ToolbarProps } from './toolbar';\n\nconst AppLayoutStateProvider: React.FC<{\n forceDeduplicationType: DeduplicationType;\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n children: (\n registered: boolean,\n appLayoutState: AppLayoutPendingState,\n toolbarProps: ToolbarProps | null,\n skeletonAttributes: SkeletonSlotsAttributes\n ) => React.ReactNode;\n}> = ({ forceDeduplicationType, appLayoutProps, stateManager, children }) => {\n const [appLayoutState, setAppLayoutState] = useState<AppLayoutPendingState>({ isIntersecting: true });\n const [skeletonAttributes, setSkeletonAttributes] = useState<SkeletonSlotsAttributes>({});\n // use { fn: } object wrapper to avoid confusion with callback form of setState\n const [deduplicator, setDeduplicator] = useState({ fn: mergeProps });\n const [deduplicationProps, setDeduplicationProps] = useState<SharedProps | undefined>(undefined);\n\n const { registered, toolbarProps } = useMultiAppLayout(\n forceDeduplicationType,\n appLayoutState.isIntersecting,\n deduplicationProps ?? getPropsToMerge(appLayoutProps, appLayoutState),\n deduplicator.fn\n );\n\n useLayoutEffect(() => {\n stateManager.current.setState = (appLayoutState, skeletonAttributes, deduplicationProps, mergeProps) => {\n unstable_batchedUpdates(() => {\n setAppLayoutState(appLayoutState);\n setSkeletonAttributes(skeletonAttributes);\n setDeduplicationProps(deduplicationProps);\n setDeduplicator({ fn: mergeProps });\n });\n };\n }, [stateManager]);\n\n const hasToolbar = !!toolbarProps;\n useEffect(() => {\n stateManager.current.hasToolbar = hasToolbar;\n stateManager.current.setToolbar?.(hasToolbar);\n }, [stateManager, hasToolbar]);\n\n return <>{children(registered, appLayoutState, toolbarProps, skeletonAttributes)}</>;\n};\n\nconst AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLayoutInternalProps>(\n (props, forwardRef) => {\n const stateManager = useRef<StateManager>({ setState: undefined, hasToolbar: false, setToolbar: undefined });\n const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } = props as any;\n\n return (\n <>\n <AppLayoutStateProvider\n forceDeduplicationType={forceDeduplicationType}\n appLayoutProps={props}\n stateManager={stateManager}\n >\n {(registered, appLayoutState, toolbarProps, skeletonAttributes) => (\n <AppLayoutVisibilityContext.Provider value={appLayoutState.isIntersecting}>\n {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */}\n {(embeddedViewMode || !toolbarProps) && props.breadcrumbs ? (\n <AppLayoutBuiltInErrorBoundary>\n <ScreenreaderOnly>{props.breadcrumbs}</ScreenreaderOnly>\n </AppLayoutBuiltInErrorBoundary>\n ) : null}\n <SkeletonLayout\n registered={registered}\n toolbarProps={toolbarProps}\n appLayoutProps={props}\n appLayoutState={appLayoutState}\n skeletonSlotsAttributes={skeletonAttributes}\n />\n </AppLayoutVisibilityContext.Provider>\n )}\n </AppLayoutStateProvider>\n <AppLayoutWidgetizedState forwardRef={forwardRef} appLayoutProps={props} stateManager={stateManager} />\n </>\n );\n }\n);\n\nexport default AppLayoutVisualRefreshToolbar;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAqB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGnE,MAAM,sBAAsB,GAUvB,CAAC,EAAE,sBAAsB,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE;I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YAAY,CAAC,IAAI,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,CAC3E,oBAAC,6BAA6B;gBAC5B,oBAAC,gBAAgB,QAAE,sBAAsB,CAAC,WAAW,CAAoB,CAC3C,CACjC,CAAC,CAAC,CAAC,IAAI;YACR,oBAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,sBAAsB,EACtC,cAAc,EAAE,cAAc,EAC9B,uBAAuB,EAAE,kBAAkB,GAC3C,CACkC,CACvC,CACsB;QACzB,oBAAC,wBAAwB,IACvB,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,sBAAsB,EACtC,YAAY,EAAE,eAAe,GAC7B,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { unstable_batchedUpdates } from 'react-dom';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../error-boundary/internal';\nimport RemoteI18nProvider from '../../i18n/providers/remote-provider';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { AppLayoutProps } from '../interfaces';\nimport { useAriaLabels } from '../utils/use-aria-labels';\nimport { AppLayoutVisibilityContext } from './contexts';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from './interfaces';\nimport { AppLayoutWidgetizedState, loadFormatter } from './internal';\nimport { SkeletonLayout } from './skeleton';\nimport { SkeletonSlotsAttributes } from './skeleton/interfaces';\nimport { DeduplicationType, useMultiAppLayout } from './skeleton/multi-layout';\nimport { StateManager } from './state';\nimport { SharedProps } from './state/interfaces';\nimport { getPropsToMerge, mergeProps } from './state/props-merger';\nimport { ToolbarProps } from './toolbar';\n\nconst AppLayoutStateProvider: React.FC<{\n forceDeduplicationType: DeduplicationType;\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n children: (\n registered: boolean,\n appLayoutState: AppLayoutPendingState,\n toolbarProps: ToolbarProps | null,\n skeletonAttributes: SkeletonSlotsAttributes\n ) => React.ReactNode;\n}> = ({ forceDeduplicationType, appLayoutProps, stateManager, children }) => {\n const [appLayoutState, setAppLayoutState] = useState<AppLayoutPendingState>({ isIntersecting: true });\n const [skeletonAttributes, setSkeletonAttributes] = useState<SkeletonSlotsAttributes>({});\n // use { fn: } object wrapper to avoid confusion with callback form of setState\n const [deduplicator, setDeduplicator] = useState({ fn: mergeProps });\n const [deduplicationProps, setDeduplicationProps] = useState<SharedProps | undefined>(undefined);\n\n const { registered, toolbarProps } = useMultiAppLayout(\n forceDeduplicationType,\n appLayoutState.isIntersecting,\n deduplicationProps ?? getPropsToMerge(appLayoutProps, appLayoutState),\n deduplicator.fn\n );\n\n useLayoutEffect(() => {\n stateManager.current.setState = (appLayoutState, skeletonAttributes, deduplicationProps, mergeProps) => {\n unstable_batchedUpdates(() => {\n setAppLayoutState(appLayoutState);\n setSkeletonAttributes(skeletonAttributes);\n setDeduplicationProps(deduplicationProps);\n setDeduplicator({ fn: mergeProps });\n });\n };\n }, [stateManager]);\n\n const hasToolbar = !!toolbarProps;\n useEffect(() => {\n stateManager.current.hasToolbar = hasToolbar;\n stateManager.current.setToolbar?.(hasToolbar);\n }, [stateManager, hasToolbar]);\n\n return <>{children(registered, appLayoutState, toolbarProps, skeletonAttributes)}</>;\n};\n\nconst AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLayoutInternalProps>(\n (props, forwardRef) => {\n const stateManagerRef = useRef<StateManager>({ setState: undefined, hasToolbar: false, setToolbar: undefined });\n\n return (\n <RemoteI18nProvider loadFormatter={loadFormatter}>\n <AppLayoutVisualRefreshToolbarWithI18n\n appLayoutRef={forwardRef}\n stateManagerRef={stateManagerRef}\n appLayoutProps={props}\n />\n </RemoteI18nProvider>\n );\n }\n);\n\nfunction AppLayoutVisualRefreshToolbarWithI18n({\n appLayoutRef,\n stateManagerRef,\n appLayoutProps,\n}: {\n appLayoutRef: React.ForwardedRef<AppLayoutProps.Ref>;\n stateManagerRef: React.MutableRefObject<StateManager>;\n appLayoutProps: AppLayoutInternalProps;\n}) {\n const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } =\n appLayoutProps as any;\n\n const ariaLabels = useAriaLabels(appLayoutProps.ariaLabels);\n const appLayoutPropsWithI18n = { ...appLayoutProps, ariaLabels };\n\n return (\n <>\n <AppLayoutStateProvider\n forceDeduplicationType={forceDeduplicationType}\n appLayoutProps={appLayoutPropsWithI18n}\n stateManager={stateManagerRef}\n >\n {(registered, appLayoutState, toolbarProps, skeletonAttributes) => (\n <AppLayoutVisibilityContext.Provider value={appLayoutState.isIntersecting}>\n {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */}\n {(embeddedViewMode || !toolbarProps) && appLayoutPropsWithI18n.breadcrumbs ? (\n <AppLayoutBuiltInErrorBoundary>\n <ScreenreaderOnly>{appLayoutPropsWithI18n.breadcrumbs}</ScreenreaderOnly>\n </AppLayoutBuiltInErrorBoundary>\n ) : null}\n <SkeletonLayout\n registered={registered}\n toolbarProps={toolbarProps}\n appLayoutProps={appLayoutPropsWithI18n}\n appLayoutState={appLayoutState}\n skeletonSlotsAttributes={skeletonAttributes}\n />\n </AppLayoutVisibilityContext.Provider>\n )}\n </AppLayoutStateProvider>\n <AppLayoutWidgetizedState\n forwardRef={appLayoutRef}\n appLayoutProps={appLayoutPropsWithI18n}\n stateManager={stateManagerRef}\n />\n </>\n );\n}\n\nexport default AppLayoutVisualRefreshToolbar;\n"]}
@@ -3,4 +3,5 @@ export declare const AppLayoutAfterMainSlot: (props: import("./skeleton/interfac
3
3
  export declare const AppLayoutTopContentSlot: (props: import("./skeleton/interfaces").SkeletonPartProps) => JSX.Element;
4
4
  export declare const AppLayoutBottomContentSlot: (props: import("./skeleton/interfaces").SkeletonPartProps) => JSX.Element;
5
5
  export declare const AppLayoutWidgetizedState: (props: import("./state").AppLayoutStateProps) => JSX.Element;
6
+ export declare const loadFormatter: () => Promise<null>;
6
7
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/internal.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,uBAAuB,2EAEnC,CAAC;AACF,eAAO,MAAM,sBAAsB,2EAElC,CAAC;AACF,eAAO,MAAM,uBAAuB,2EAEnC,CAAC;AACF,eAAO,MAAM,0BAA0B,2EAEtC,CAAC;AACF,eAAO,MAAM,wBAAwB,+DAEpC,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/internal.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,uBAAuB,2EAEnC,CAAC;AACF,eAAO,MAAM,sBAAsB,2EAElC,CAAC;AACF,eAAO,MAAM,uBAAuB,2EAEnC,CAAC;AACF,eAAO,MAAM,0BAA0B,2EAEtC,CAAC;AACF,eAAO,MAAM,wBAAwB,+DAEpC,CAAC;AACF,eAAO,MAAM,aAAa,qBAA8B,CAAC"}
@@ -11,4 +11,5 @@ export const AppLayoutAfterMainSlot = createWidgetizedAppLayoutAfterMainSlot(cre
11
11
  export const AppLayoutTopContentSlot = createWidgetizedAppLayoutTopContentSlot(createLoadableComponent(TopContentSlotImplementation));
12
12
  export const AppLayoutBottomContentSlot = createWidgetizedAppLayoutBottomContentSlot(createLoadableComponent(BottomContentSlotImplementation));
13
13
  export const AppLayoutWidgetizedState = createWidgetizedAppLayoutState(createLoadableComponent(AppLayoutStateImplementation));
14
+ export const loadFormatter = () => Promise.resolve(null);
14
15
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,IAAI,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,4BAA4B,EAAE,uCAAuC,EAAE,MAAM,iCAAiC,CAAC;AACxH,OAAO,EACL,+BAA+B,EAC/B,0CAA0C,GAC3C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,uCAAuC,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAExH,MAAM,CAAC,MAAM,uBAAuB,GAAG,uCAAuC,CAC5E,uBAAuB,CAAC,4BAA4B,CAAC,CACtD,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,sCAAsC,CAC1E,uBAAuB,CAAC,2BAA2B,CAAC,CACrD,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,uCAAuC,CAC5E,uBAAuB,CAAC,4BAA4B,CAAC,CACtD,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,0CAA0C,CAClF,uBAAuB,CAAC,+BAA+B,CAAC,CACzD,CAAC;AACF,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CACpE,uBAAuB,CAAC,4BAA4B,CAAC,CACtD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { createLoadableComponent } from '../../internal/widgets/loader-mock';\nimport { AppLayoutStateProvider as AppLayoutStateImplementation, createWidgetizedAppLayoutState } from './state';\nimport { AfterMainSlotImplementation, createWidgetizedAppLayoutAfterMainSlot } from './widget-areas/after-main-slot';\nimport { BeforeMainSlotImplementation, createWidgetizedAppLayoutBeforeMainSlot } from './widget-areas/before-main-slot';\nimport {\n BottomContentSlotImplementation,\n createWidgetizedAppLayoutBottomContentSlot,\n} from './widget-areas/bottom-content-slot';\nimport { createWidgetizedAppLayoutTopContentSlot, TopContentSlotImplementation } from './widget-areas/top-content-slot';\n\nexport const AppLayoutBeforeMainSlot = createWidgetizedAppLayoutBeforeMainSlot(\n createLoadableComponent(BeforeMainSlotImplementation)\n);\nexport const AppLayoutAfterMainSlot = createWidgetizedAppLayoutAfterMainSlot(\n createLoadableComponent(AfterMainSlotImplementation)\n);\nexport const AppLayoutTopContentSlot = createWidgetizedAppLayoutTopContentSlot(\n createLoadableComponent(TopContentSlotImplementation)\n);\nexport const AppLayoutBottomContentSlot = createWidgetizedAppLayoutBottomContentSlot(\n createLoadableComponent(BottomContentSlotImplementation)\n);\nexport const AppLayoutWidgetizedState = createWidgetizedAppLayoutState(\n createLoadableComponent(AppLayoutStateImplementation)\n);\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,IAAI,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,4BAA4B,EAAE,uCAAuC,EAAE,MAAM,iCAAiC,CAAC;AACxH,OAAO,EACL,+BAA+B,EAC/B,0CAA0C,GAC3C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,uCAAuC,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAExH,MAAM,CAAC,MAAM,uBAAuB,GAAG,uCAAuC,CAC5E,uBAAuB,CAAC,4BAA4B,CAAC,CACtD,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,sCAAsC,CAC1E,uBAAuB,CAAC,2BAA2B,CAAC,CACrD,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,uCAAuC,CAC5E,uBAAuB,CAAC,4BAA4B,CAAC,CACtD,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,0CAA0C,CAClF,uBAAuB,CAAC,+BAA+B,CAAC,CACzD,CAAC;AACF,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CACpE,uBAAuB,CAAC,4BAA4B,CAAC,CACtD,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { createLoadableComponent } from '../../internal/widgets/loader-mock';\nimport { AppLayoutStateProvider as AppLayoutStateImplementation, createWidgetizedAppLayoutState } from './state';\nimport { AfterMainSlotImplementation, createWidgetizedAppLayoutAfterMainSlot } from './widget-areas/after-main-slot';\nimport { BeforeMainSlotImplementation, createWidgetizedAppLayoutBeforeMainSlot } from './widget-areas/before-main-slot';\nimport {\n BottomContentSlotImplementation,\n createWidgetizedAppLayoutBottomContentSlot,\n} from './widget-areas/bottom-content-slot';\nimport { createWidgetizedAppLayoutTopContentSlot, TopContentSlotImplementation } from './widget-areas/top-content-slot';\n\nexport const AppLayoutBeforeMainSlot = createWidgetizedAppLayoutBeforeMainSlot(\n createLoadableComponent(BeforeMainSlotImplementation)\n);\nexport const AppLayoutAfterMainSlot = createWidgetizedAppLayoutAfterMainSlot(\n createLoadableComponent(AfterMainSlotImplementation)\n);\nexport const AppLayoutTopContentSlot = createWidgetizedAppLayoutTopContentSlot(\n createLoadableComponent(TopContentSlotImplementation)\n);\nexport const AppLayoutBottomContentSlot = createWidgetizedAppLayoutBottomContentSlot(\n createLoadableComponent(BottomContentSlotImplementation)\n);\nexport const AppLayoutWidgetizedState = createWidgetizedAppLayoutState(\n createLoadableComponent(AppLayoutStateImplementation)\n);\nexport const loadFormatter = () => Promise.resolve(null);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout-toolbar/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAa1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,QAAA,MAAM,gBAAgB,kGA+GrB,CAAC;AAGF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout-toolbar/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAY1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,QAAA,MAAM,gBAAgB,kGAiGrB,CAAC;AAGF,eAAe,gBAAgB,CAAC"}
@@ -7,7 +7,6 @@ import { applyDefaults } from '../app-layout/defaults';
7
7
  import { useAppLayoutPlacement } from '../app-layout/utils/use-app-layout-placement';
8
8
  import AppLayoutToolbarInternal from '../app-layout/visual-refresh-toolbar';
9
9
  import { AppLayoutToolbarPublicContext } from '../app-layout/visual-refresh-toolbar/contexts';
10
- import { useInternalI18n } from '../i18n/context';
11
10
  import { getBaseProps } from '../internal/base-component';
12
11
  import useBaseComponent from '../internal/hooks/use-base-component';
13
12
  import { useControllable } from '../internal/hooks/use-controllable';
@@ -16,7 +15,7 @@ import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
16
15
  import { isDevelopment } from '../internal/is-development';
17
16
  import { applyDisplayName } from '../internal/utils/apply-display-name';
18
17
  const AppLayoutToolbar = React.forwardRef(({ contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f', navigationWidth = 280, toolsWidth = 290, maxContentWidth, minContentWidth, navigationOpen: controlledNavigationOpen, onNavigationChange: controlledOnNavigationChange, analyticsMetadata, ...rest }, ref) => {
19
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
18
+ var _a, _b;
20
19
  const isRefresh = useVisualRefresh();
21
20
  if (!isRefresh) {
22
21
  throw new Error(`AppLayoutToolbar component is not supported in the Classic theme. Please switch to the Refresh theme. For more details, refer to the documentation.`);
@@ -46,19 +45,6 @@ const AppLayoutToolbar = React.forwardRef(({ contentType = 'default', headerSele
46
45
  },
47
46
  }, analyticsMetadata);
48
47
  const isMobile = useMobile();
49
- const i18n = useInternalI18n('app-layout');
50
- const ariaLabels = {
51
- navigation: i18n('ariaLabels.navigation', (_c = rest.ariaLabels) === null || _c === void 0 ? void 0 : _c.navigation),
52
- navigationClose: i18n('ariaLabels.navigationClose', (_d = rest.ariaLabels) === null || _d === void 0 ? void 0 : _d.navigationClose),
53
- navigationToggle: i18n('ariaLabels.navigationToggle', (_e = rest.ariaLabels) === null || _e === void 0 ? void 0 : _e.navigationToggle),
54
- notifications: i18n('ariaLabels.notifications', (_f = rest.ariaLabels) === null || _f === void 0 ? void 0 : _f.notifications),
55
- tools: i18n('ariaLabels.tools', (_g = rest.ariaLabels) === null || _g === void 0 ? void 0 : _g.tools),
56
- toolsClose: i18n('ariaLabels.toolsClose', (_h = rest.ariaLabels) === null || _h === void 0 ? void 0 : _h.toolsClose),
57
- toolsToggle: i18n('ariaLabels.toolsToggle', (_j = rest.ariaLabels) === null || _j === void 0 ? void 0 : _j.toolsToggle),
58
- drawers: i18n('ariaLabels.drawers', (_k = rest.ariaLabels) === null || _k === void 0 ? void 0 : _k.drawers),
59
- drawersOverflow: i18n('ariaLabels.drawersOverflow', (_l = rest.ariaLabels) === null || _l === void 0 ? void 0 : _l.drawersOverflow),
60
- drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', (_m = rest.ariaLabels) === null || _m === void 0 ? void 0 : _m.drawersOverflowWithBadge),
61
- };
62
48
  const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(contentType, { maxContentWidth, minContentWidth }, isRefresh);
63
49
  const [navigationOpen = false, setNavigationOpen] = useControllable(controlledNavigationOpen, controlledOnNavigationChange, isMobile ? false : defaultNavigationOpen, { componentName: 'AppLayoutToolbar', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' });
64
50
  const onNavigationChange = (event) => {
@@ -75,7 +61,6 @@ const AppLayoutToolbar = React.forwardRef(({ contentType = 'default', headerSele
75
61
  onNavigationChange,
76
62
  ...restDefaults,
77
63
  ...rest,
78
- ariaLabels,
79
64
  placement,
80
65
  };
81
66
  const baseProps = getBaseProps(rest);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,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EAAE,iBAAiB,CAAC,GAAG,eAAe,CACjE,wBAAwB,EACxB,4BAA4B,EAC5B,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB,EACxC,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAC7G,CAAC;IACF,MAAM,kBAAkB,GAAG,CAAC,KAA4D,EAAE,EAAE;QAC1F,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrC,4BAA4B,aAA5B,4BAA4B,uBAA5B,4BAA4B,CAAG,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,qBAAqB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAEnF,wDAAwD;IACxD,MAAM,KAAK,GAAG;QACZ,WAAW;QACX,eAAe;QACf,UAAU;QACV,cAAc;QACd,kBAAkB;QAClB,GAAG,YAAY;QACf,GAAG,IAAI;QACP,UAAU;QACV,SAAS;KACV,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CACL,oBAAC,6BAA6B,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;QACjD,6BAAK,GAAG,EAAE,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAM,SAAS;YAC/D,oBAAC,wBAAwB,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAC7C,CACiC,CAC1C,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;AACvD,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { applyDefaults } from '../app-layout/defaults';\nimport { AppLayoutProps } from '../app-layout/interfaces';\nimport { useAppLayoutPlacement } from '../app-layout/utils/use-app-layout-placement';\nimport AppLayoutToolbarInternal from '../app-layout/visual-refresh-toolbar';\nimport { AppLayoutToolbarPublicContext } from '../app-layout/visual-refresh-toolbar/contexts';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { isDevelopment } from '../internal/is-development';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AppLayoutToolbarProps } from './interfaces';\n\nexport { AppLayoutToolbarProps };\n\nconst AppLayoutToolbar = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n analyticsMetadata,\n ...rest\n }: AppLayoutToolbarProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n const isRefresh = useVisualRefresh();\n if (!isRefresh) {\n throw new Error(\n `AppLayoutToolbar component is not supported in the Classic theme. Please switch to the Refresh theme. For more details, refer to the documentation.`\n );\n }\n if (isDevelopment) {\n if (rest.toolsOpen && rest.toolsHide) {\n warnOnce(\n 'AppLayoutToolbar',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const { __internalRootRef } = useBaseComponent(\n 'AppLayoutToolbar',\n {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n navigationTriggerHide: rest.navigationTriggerHide,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n },\n analyticsMetadata\n );\n const isMobile = useMobile();\n\n const i18n = useInternalI18n('app-layout');\n const ariaLabels = {\n navigation: i18n('ariaLabels.navigation', rest.ariaLabels?.navigation),\n navigationClose: i18n('ariaLabels.navigationClose', rest.ariaLabels?.navigationClose),\n navigationToggle: i18n('ariaLabels.navigationToggle', rest.ariaLabels?.navigationToggle),\n notifications: i18n('ariaLabels.notifications', rest.ariaLabels?.notifications),\n tools: i18n('ariaLabels.tools', rest.ariaLabels?.tools),\n toolsClose: i18n('ariaLabels.toolsClose', rest.ariaLabels?.toolsClose),\n toolsToggle: i18n('ariaLabels.toolsToggle', rest.ariaLabels?.toolsToggle),\n drawers: i18n('ariaLabels.drawers', rest.ariaLabels?.drawers),\n drawersOverflow: i18n('ariaLabels.drawersOverflow', rest.ariaLabels?.drawersOverflow),\n drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', rest.ariaLabels?.drawersOverflowWithBadge),\n };\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayoutToolbar', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent<AppLayoutProps.ChangeDetail>) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n ariaLabels,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <AppLayoutToolbarPublicContext.Provider value={true}>\n <div ref={useMergeRefs(__internalRootRef, rootRef)} {...baseProps}>\n <AppLayoutToolbarInternal ref={ref} {...props} />\n </div>\n </AppLayoutToolbarPublicContext.Provider>\n );\n }\n);\n\napplyDisplayName(AppLayoutToolbar, 'AppLayoutToolbar');\nexport default AppLayoutToolbar;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAKxE,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,EACE,WAAW,GAAG,SAAS,EACvB,cAAc,GAAG,OAAO,EACxB,cA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import React from 'react';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { applyDefaults } from '../app-layout/defaults';\nimport { AppLayoutProps } from '../app-layout/interfaces';\nimport { useAppLayoutPlacement } from '../app-layout/utils/use-app-layout-placement';\nimport AppLayoutToolbarInternal from '../app-layout/visual-refresh-toolbar';\nimport { AppLayoutToolbarPublicContext } from '../app-layout/visual-refresh-toolbar/contexts';\nimport { getBaseProps } from '../internal/base-component';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { isDevelopment } from '../internal/is-development';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AppLayoutToolbarProps } from './interfaces';\n\nexport { AppLayoutToolbarProps };\n\nconst AppLayoutToolbar = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n analyticsMetadata,\n ...rest\n }: AppLayoutToolbarProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n const isRefresh = useVisualRefresh();\n if (!isRefresh) {\n throw new Error(\n `AppLayoutToolbar component is not supported in the Classic theme. Please switch to the Refresh theme. For more details, refer to the documentation.`\n );\n }\n if (isDevelopment) {\n if (rest.toolsOpen && rest.toolsHide) {\n warnOnce(\n 'AppLayoutToolbar',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const { __internalRootRef } = useBaseComponent(\n 'AppLayoutToolbar',\n {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n navigationTriggerHide: rest.navigationTriggerHide,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n },\n analyticsMetadata\n );\n const isMobile = useMobile();\n\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayoutToolbar', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent<AppLayoutProps.ChangeDetail>) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <AppLayoutToolbarPublicContext.Provider value={true}>\n <div ref={useMergeRefs(__internalRootRef, rootRef)} {...baseProps}>\n <AppLayoutToolbarInternal ref={ref} {...props} />\n </div>\n </AppLayoutToolbarPublicContext.Provider>\n );\n }\n);\n\napplyDisplayName(AppLayoutToolbar, 'AppLayoutToolbar');\nexport default AppLayoutToolbar;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,QAAA,MAAM,MAAM,qFAkFX,CAAC;AAGF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,QAAA,MAAM,MAAM,qFAoFX,CAAC;AAGF,eAAe,MAAM,CAAC"}
@@ -6,13 +6,13 @@ import { getBaseProps } from '../internal/base-component';
6
6
  import useBaseComponent from '../internal/hooks/use-base-component';
7
7
  import { applyDisplayName } from '../internal/utils/apply-display-name';
8
8
  import { InternalButton } from './internal';
9
- const Button = React.forwardRef(({ children, iconName, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, wrapText = true, href, target, rel, external = false, download, formAction = 'submit', ariaLabel, ariaDescribedby, onClick, onFollow, ariaExpanded, ariaControls, fullWidth, form, i18nStrings, style, nativeButtonAttributes, nativeAnchorAttributes, ...props }, ref) => {
9
+ const Button = React.forwardRef(({ children, iconName, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, wrapText = true, href, target, rel, external = false, download, formAction = 'submit', ariaLabel, ariaDescribedby, onClick, onFollow, ariaExpanded, ariaHaspopup, ariaControls, fullWidth, form, i18nStrings, style, nativeButtonAttributes, nativeAnchorAttributes, ...props }, ref) => {
10
10
  const baseComponentProps = useBaseComponent('Button', {
11
11
  props: { formAction, fullWidth, iconAlign, iconName, rel, target, external, variant, wrapText },
12
12
  metadata: { hasDisabledReason: Boolean(disabledReason) },
13
13
  });
14
14
  const baseProps = getBaseProps(props);
15
- return (React.createElement(InternalButton, { ...baseProps, ...baseComponentProps, ref: ref, iconName: iconName, iconAlign: iconAlign, iconUrl: iconUrl, iconSvg: iconSvg, iconAlt: iconAlt, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, disabledReason: disabledReason, wrapText: wrapText, href: href, target: target, rel: rel, external: external, download: download, formAction: formAction, ariaLabel: ariaLabel, ariaDescribedby: ariaDescribedby, onClick: onClick, onFollow: onFollow, ariaExpanded: ariaExpanded, ariaControls: ariaControls, fullWidth: fullWidth, form: form, i18nStrings: i18nStrings, style: style, nativeButtonAttributes: nativeButtonAttributes, nativeAnchorAttributes: nativeAnchorAttributes, __injectAnalyticsComponentMetadata: true }, children));
15
+ return (React.createElement(InternalButton, { ...baseProps, ...baseComponentProps, ref: ref, iconName: iconName, iconAlign: iconAlign, iconUrl: iconUrl, iconSvg: iconSvg, iconAlt: iconAlt, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, disabledReason: disabledReason, wrapText: wrapText, href: href, target: target, rel: rel, external: external, download: download, formAction: formAction, ariaLabel: ariaLabel, ariaDescribedby: ariaDescribedby, onClick: onClick, onFollow: onFollow, ariaExpanded: ariaExpanded, ariaHaspopup: ariaHaspopup, ariaControls: ariaControls, fullWidth: fullWidth, form: form, i18nStrings: i18nStrings, style: style, nativeButtonAttributes: nativeButtonAttributes, nativeAnchorAttributes: nativeAnchorAttributes, __injectAnalyticsComponentMetadata: true }, children));
16
16
  });
17
17
  applyDisplayName(Button, 'Button');
18
18
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C,MAAM,MAAM,GAAG,KAAK,C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AM,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,sBAAsB,EAAE,sBAAsB,EAC9C,sBAAsB,EAAE,sBAAsB,EAC9C,kCAAkC,EAAE,IAAI,IAEvC,QAAQ,CACM,CAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAe,MAAM,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ButtonProps } from './interfaces';\nimport { InternalButton } from './internal';\n\nexport { ButtonProps };\n\nconst Button = React.forwardRef(\n (\n {\n children,\n iconName,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n wrapText = true,\n href,\n target,\n rel,\n external = false,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n onClick,\n onFollow,\n ariaExpanded,\n ariaControls,\n fullWidth,\n form,\n i18nStrings,\n style,\n nativeButtonAttributes,\n nativeAnchorAttributes,\n ...props\n }: ButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Button', {\n props: { formAction, fullWidth, iconAlign, iconName, rel, target, external, variant, wrapText },\n metadata: { hasDisabledReason: Boolean(disabledReason) },\n });\n const baseProps = getBaseProps(props);\n return (\n <InternalButton\n {...baseProps}\n {...baseComponentProps}\n ref={ref}\n iconName={iconName}\n iconAlign={iconAlign}\n iconUrl={iconUrl}\n iconSvg={iconSvg}\n iconAlt={iconAlt}\n variant={variant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n disabledReason={disabledReason}\n wrapText={wrapText}\n href={href}\n target={target}\n rel={rel}\n external={external}\n download={download}\n formAction={formAction}\n ariaLabel={ariaLabel}\n ariaDescribedby={ariaDescribedby}\n onClick={onClick}\n onFollow={onFollow}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n fullWidth={fullWidth}\n form={form}\n i18nStrings={i18nStrings}\n style={style}\n nativeButtonAttributes={nativeButtonAttributes}\n nativeAnchorAttributes={nativeAnchorAttributes}\n __injectAnalyticsComponentMetadata={true}\n >\n {children}\n </InternalButton>\n );\n }\n);\n\napplyDisplayName(Button, 'Button');\nexport default Button;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,CACE,EACE,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,MAAM,EAClB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GAAG,QAAQ,EAClB,OAAO,GAAG,KAAK,EACf,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,cAAc,EACd,QAAQ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Q,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,sBAAsB,EAAE,sBAAsB,EAC9C,sBAAsB,EAAE,sBAAsB,EAC9C,kCAAkC,EAAE,IAAI,IAEvC,QAAQ,CACM,CAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAe,MAAM,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ButtonProps } from './interfaces';\nimport { InternalButton } from './internal';\n\nexport { ButtonProps };\n\nconst Button = React.forwardRef(\n (\n {\n children,\n iconName,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n wrapText = true,\n href,\n target,\n rel,\n external = false,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n onClick,\n onFollow,\n ariaExpanded,\n ariaHaspopup,\n ariaControls,\n fullWidth,\n form,\n i18nStrings,\n style,\n nativeButtonAttributes,\n nativeAnchorAttributes,\n ...props\n }: ButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Button', {\n props: { formAction, fullWidth, iconAlign, iconName, rel, target, external, variant, wrapText },\n metadata: { hasDisabledReason: Boolean(disabledReason) },\n });\n const baseProps = getBaseProps(props);\n return (\n <InternalButton\n {...baseProps}\n {...baseComponentProps}\n ref={ref}\n iconName={iconName}\n iconAlign={iconAlign}\n iconUrl={iconUrl}\n iconSvg={iconSvg}\n iconAlt={iconAlt}\n variant={variant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n disabledReason={disabledReason}\n wrapText={wrapText}\n href={href}\n target={target}\n rel={rel}\n external={external}\n download={download}\n formAction={formAction}\n ariaLabel={ariaLabel}\n ariaDescribedby={ariaDescribedby}\n onClick={onClick}\n onFollow={onFollow}\n ariaExpanded={ariaExpanded}\n ariaHaspopup={ariaHaspopup}\n ariaControls={ariaControls}\n fullWidth={fullWidth}\n form={form}\n i18nStrings={i18nStrings}\n style={style}\n nativeButtonAttributes={nativeButtonAttributes}\n nativeAnchorAttributes={nativeAnchorAttributes}\n __injectAnalyticsComponentMetadata={true}\n >\n {children}\n </InternalButton>\n );\n }\n);\n\napplyDisplayName(Button, 'Button');\nexport default Button;\n"]}
@@ -154,6 +154,10 @@ export interface ButtonProps extends BaseComponentProps, BaseButtonProps {
154
154
  * Adds aria-expanded to the button element. Use when the button controls an expandable element.
155
155
  */
156
156
  ariaExpanded?: boolean;
157
+ /**
158
+ * Adds `aria-haspopup` to the button element. Use when the button triggers a popup element such as a menu, listbox, tree, grid, or dialog.
159
+ */
160
+ ariaHaspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
157
161
  /**
158
162
  * Called when the user clicks on the button and the button is not disabled or in loading state.
159
163
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC/G;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE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MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;KACH;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler, ClickDetail as _ClickDetail } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface BaseButtonProps {\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button is disabled (only when `disabled` is `true`).\n * If provided, the button becomes focusable.\n * Applicable for all button variants, except link.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents users from clicking the button, but it can still be focused.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button is in a loading state.\n */\n loadingText?: string;\n /**\n * Displays an icon next to the text. You can use the `iconAlign` property to position the icon.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n iconSvg?: React.ReactNode;\n\n /**\n * Adds `aria-label` to the button element. Use this to provide an accessible name for buttons\n * that don't have visible text, and to distinguish between multiple buttons with identical visible text.\n * The text will also be added to the `title` attribute of the button.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /**\n * Specifies if the `text` content wraps. If you set it to `false`, it prevents the text from wrapping.\n */\n wrapText?: boolean;\n\n /**\n * Text displayed in the button element.\n * @displayname text\n */\n children?: React.ReactNode;\n\n /**\n * Adds `aria-controls` to the button. Use when the button controls the contents or presence of an element.\n */\n ariaControls?: string;\n\n /**\n * Adds an external icon after the button label text.\n * If an href is provided, it opens the link in a new tab.\n */\n external?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component. The object should contain:\n *\n * * `externalIconAriaLabel` - (optional) Specifies the aria-label for the external icon when `external` is set to `true`.\n * @i18n\n */\n i18nStrings?: ButtonProps.I18nStrings;\n\n /**\n * Attributes to add to the native `button` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeButtonAttributes?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Attributes to add to the native `a` element (when `href` is provided).\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAnchorAttributes?: NativeAttributes<React.AnchorHTMLAttributes<HTMLAnchorElement>>;\n}\n\nexport interface ButtonProps extends BaseComponentProps, BaseButtonProps {\n /**\n * Specifies the alignment of the icon.\n */\n iconAlign?: ButtonProps.IconAlign;\n\n /**\n * The form action that is performed by a button click.\n */\n formAction?: ButtonProps.FormAction;\n\n /**\n * Applies button styling to a link. Use this property if you need a link styled as a button (`variant=link`).\n * For example, if you have a 'help' button that links to a documentation page.\n */\n href?: string;\n\n /**\n * Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`).\n * This property only applies when an `href` is provided.\n */\n target?: string;\n\n /**\n * Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`.\n * If the `rel` property is provided, it overrides the default behavior.\n */\n rel?: string;\n\n /**\n * Specifies whether the linked URL, when selected, will prompt the user to download instead of navigate.\n * You can specify a string value that will be suggested as the name of the downloaded file.\n * This property only applies when an `href` is provided.\n **/\n download?: boolean | string;\n\n /** The id of the <form> element to associate with the button. The value of this attribute must be the id of a <form> in the same document.\n * Use when a button is not the descendant of a form element, such as when used in a modal.\n */\n form?: string;\n\n /**\n * Adds aria-expanded to the button element. Use when the button controls an expandable element.\n */\n ariaExpanded?: boolean;\n\n /**\n * Called when the user clicks on the button and the button is not disabled or in loading state.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Called when the user clicks on the button with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the button has an `href` set.\n */\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n\n /** Determines the general styling of the button as follows:\n * * `primary` for primary buttons.\n * * `normal` for secondary buttons.\n * * `link` for tertiary buttons.\n * * `icon` to display an icon only (no text).\n * * `inline-icon` to display an icon-only (no text) button within a text context.\n * * `inline-link` to display a tertiary button with no outer padding.\n */\n variant?: ButtonProps.Variant;\n\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n iconAlt?: string;\n\n /**\n * An object containing CSS properties to customize the button's visual appearance.\n * Refer to the [style](/components/button/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ButtonProps.Style;\n}\n\nexport namespace ButtonProps {\n export type Variant = 'normal' | 'primary' | 'link' | 'icon' | 'inline-icon' | 'inline-link';\n export type ClickDetail = _ClickDetail;\n export type FollowDetail = BaseNavigationDetail;\n\n export type FormAction = 'submit' | 'none';\n\n export type IconAlign = 'left' | 'right';\n\n export interface I18nStrings {\n /**\n * Specifies the aria-label for the external icon when `external` is set to `true`.\n */\n externalIconAriaLabel?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(options?: FocusOptions): void;\n }\n\n export interface Style {\n root?: {\n background?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n borderColor?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n color?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n paddingBlock?: string;\n paddingInline?: string;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler, ClickDetail as _ClickDetail } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface BaseButtonProps {\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button is disabled (only when `disabled` is `true`).\n * If provided, the button becomes focusable.\n * Applicable for all button variants, except link.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents users from clicking the button, but it can still be focused.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button is in a loading state.\n */\n loadingText?: string;\n /**\n * Displays an icon next to the text. You can use the `iconAlign` property to position the icon.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n iconSvg?: React.ReactNode;\n\n /**\n * Adds `aria-label` to the button element. Use this to provide an accessible name for buttons\n * that don't have visible text, and to distinguish between multiple buttons with identical visible text.\n * The text will also be added to the `title` attribute of the button.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /**\n * Specifies if the `text` content wraps. If you set it to `false`, it prevents the text from wrapping.\n */\n wrapText?: boolean;\n\n /**\n * Text displayed in the button element.\n * @displayname text\n */\n children?: React.ReactNode;\n\n /**\n * Adds `aria-controls` to the button. Use when the button controls the contents or presence of an element.\n */\n ariaControls?: string;\n\n /**\n * Adds an external icon after the button label text.\n * If an href is provided, it opens the link in a new tab.\n */\n external?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component. The object should contain:\n *\n * * `externalIconAriaLabel` - (optional) Specifies the aria-label for the external icon when `external` is set to `true`.\n * @i18n\n */\n i18nStrings?: ButtonProps.I18nStrings;\n\n /**\n * Attributes to add to the native `button` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeButtonAttributes?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Attributes to add to the native `a` element (when `href` is provided).\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAnchorAttributes?: NativeAttributes<React.AnchorHTMLAttributes<HTMLAnchorElement>>;\n}\n\nexport interface ButtonProps extends BaseComponentProps, BaseButtonProps {\n /**\n * Specifies the alignment of the icon.\n */\n iconAlign?: ButtonProps.IconAlign;\n\n /**\n * The form action that is performed by a button click.\n */\n formAction?: ButtonProps.FormAction;\n\n /**\n * Applies button styling to a link. Use this property if you need a link styled as a button (`variant=link`).\n * For example, if you have a 'help' button that links to a documentation page.\n */\n href?: string;\n\n /**\n * Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`).\n * This property only applies when an `href` is provided.\n */\n target?: string;\n\n /**\n * Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`.\n * If the `rel` property is provided, it overrides the default behavior.\n */\n rel?: string;\n\n /**\n * Specifies whether the linked URL, when selected, will prompt the user to download instead of navigate.\n * You can specify a string value that will be suggested as the name of the downloaded file.\n * This property only applies when an `href` is provided.\n **/\n download?: boolean | string;\n\n /** The id of the <form> element to associate with the button. The value of this attribute must be the id of a <form> in the same document.\n * Use when a button is not the descendant of a form element, such as when used in a modal.\n */\n form?: string;\n\n /**\n * Adds aria-expanded to the button element. Use when the button controls an expandable element.\n */\n ariaExpanded?: boolean;\n\n /**\n * Adds `aria-haspopup` to the button element. Use when the button triggers a popup element such as a menu, listbox, tree, grid, or dialog.\n */\n ariaHaspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\n\n /**\n * Called when the user clicks on the button and the button is not disabled or in loading state.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Called when the user clicks on the button with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the button has an `href` set.\n */\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n\n /** Determines the general styling of the button as follows:\n * * `primary` for primary buttons.\n * * `normal` for secondary buttons.\n * * `link` for tertiary buttons.\n * * `icon` to display an icon only (no text).\n * * `inline-icon` to display an icon-only (no text) button within a text context.\n * * `inline-link` to display a tertiary button with no outer padding.\n */\n variant?: ButtonProps.Variant;\n\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n iconAlt?: string;\n\n /**\n * An object containing CSS properties to customize the button's visual appearance.\n * Refer to the [style](/components/button/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ButtonProps.Style;\n}\n\nexport namespace ButtonProps {\n export type Variant = 'normal' | 'primary' | 'link' | 'icon' | 'inline-icon' | 'inline-link';\n export type ClickDetail = _ClickDetail;\n export type FollowDetail = BaseNavigationDetail;\n\n export type FormAction = 'submit' | 'none';\n\n export type IconAlign = 'left' | 'right';\n\n export interface I18nStrings {\n /**\n * Specifies the aria-label for the external icon when `external` is set to `true`.\n */\n externalIconAriaLabel?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(options?: FocusOptions): void;\n }\n\n export interface Style {\n root?: {\n background?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n borderColor?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n color?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n paddingBlock?: string;\n paddingInline?: string;\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAuB3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAUlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAO3C,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAC/D,OAAO,CAAC,EACJ,WAAW,CAAC,SAAS,CAAC,GACtB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,4BAA4B,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C,GAAG,0BAA0B,CAAC;AAE/B,eAAO,MAAM,cAAc;cAhBrB,WAAW,CAAC,SAAS,CAAC,GACtB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,4BAA4B;YACxB,OAAO;sBACG,MAAM;kBACV,MAAM;kBACN,OAAO;yCACgB,OAAO;cAClC,MAAM;6BACS,OAAO;qCACC,OAAO;sEAgTzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAuB3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAUlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAO3C,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAC/D,OAAO,CAAC,EACJ,WAAW,CAAC,SAAS,CAAC,GACtB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,4BAA4B,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C,GAAG,0BAA0B,CAAC;AAE/B,eAAO,MAAM,cAAc;cAhBrB,WAAW,CAAC,SAAS,CAAC,GACtB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,4BAA4B;YACxB,OAAO;sBACG,MAAM;kBACV,MAAM;kBACN,OAAO;yCACgB,OAAO;cAClC,MAAM;6BACS,OAAO;qCACC,OAAO;sEAkTzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -25,7 +25,7 @@ import { getButtonStyles } from './style';
25
25
  import analyticsSelectors from './analytics-metadata/styles.css.js';
26
26
  import styles from './styles.css.js';
27
27
  import testUtilStyles from './test-classes/styles.css.js';
28
- export const InternalButton = React.forwardRef(({ children, iconName, __iconClass, onClick, onFollow, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, wrapText = true, href, external, target: targetOverride, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, ariaExpanded, ariaControls, fullWidth, badge, i18nStrings, style, nativeButtonAttributes, nativeAnchorAttributes, __internalRootRef, __focusable = false, __injectAnalyticsComponentMetadata = false, __title, __emitPerformanceMarks = true, __skipNativeAttributesWarnings, analyticsAction = 'click', ...props }, ref) => {
28
+ export const InternalButton = React.forwardRef(({ children, iconName, __iconClass, onClick, onFollow, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, wrapText = true, href, external, target: targetOverride, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, ariaExpanded, ariaHaspopup, ariaControls, fullWidth, badge, i18nStrings, style, nativeButtonAttributes, nativeAnchorAttributes, __internalRootRef, __focusable = false, __injectAnalyticsComponentMetadata = false, __title, __emitPerformanceMarks = true, __skipNativeAttributesWarnings, analyticsAction = 'click', ...props }, ref) => {
29
29
  var _a;
30
30
  const [showTooltip, setShowTooltip] = useState(false);
31
31
  checkSafeUrl('Button', href);
@@ -117,6 +117,7 @@ export const InternalButton = React.forwardRef(({ children, iconName, __iconClas
117
117
  'aria-label': ariaLabel,
118
118
  'aria-describedby': ariaDescribedby,
119
119
  'aria-expanded': ariaExpanded,
120
+ 'aria-haspopup': ariaHaspopup,
120
121
  'aria-controls': ariaControls,
121
122
  // add ariaLabel as `title` as visible hint text
122
123
  title: __title !== null && __title !== void 0 ? __title : ariaLabel,