@cloudscape-design/components 3.0.72 → 3.0.73

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 (139) hide show
  1. package/app-layout/toggles/index.d.ts.map +1 -1
  2. package/app-layout/toggles/index.js +2 -2
  3. package/app-layout/toggles/index.js.map +1 -1
  4. package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
  5. package/app-layout/visual-refresh/app-bar.js +2 -2
  6. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  7. package/app-layout/visual-refresh/navigation.d.ts.map +1 -1
  8. package/app-layout/visual-refresh/navigation.js +1 -1
  9. package/app-layout/visual-refresh/navigation.js.map +1 -1
  10. package/app-layout/visual-refresh/tools.d.ts.map +1 -1
  11. package/app-layout/visual-refresh/tools.js +1 -1
  12. package/app-layout/visual-refresh/tools.js.map +1 -1
  13. package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  14. package/app-layout/visual-refresh/trigger-button.js +1 -1
  15. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  16. package/breadcrumb-group/item/styles.css.js +7 -7
  17. package/breadcrumb-group/item/styles.scoped.css +16 -15
  18. package/breadcrumb-group/item/styles.selectors.js +7 -7
  19. package/calendar/grid/index.d.ts +2 -2
  20. package/calendar/grid/index.d.ts.map +1 -1
  21. package/calendar/grid/index.js +64 -23
  22. package/calendar/grid/index.js.map +1 -1
  23. package/calendar/internal.d.ts.map +1 -1
  24. package/calendar/internal.js +3 -15
  25. package/calendar/internal.js.map +1 -1
  26. package/calendar/styles.css.js +18 -20
  27. package/calendar/styles.scoped.css +46 -58
  28. package/calendar/styles.selectors.js +18 -20
  29. package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  30. package/date-range-picker/calendar/grids/grid.js +61 -6
  31. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  32. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  33. package/date-range-picker/calendar/grids/index.js +1 -0
  34. package/date-range-picker/calendar/grids/index.js.map +1 -1
  35. package/date-range-picker/calendar/grids/styles.css.js +26 -0
  36. package/date-range-picker/calendar/grids/{day/styles.scoped.css → styles.scoped.css} +38 -38
  37. package/date-range-picker/calendar/grids/styles.selectors.js +27 -0
  38. package/date-range-picker/index.js +2 -2
  39. package/date-range-picker/index.js.map +1 -1
  40. package/date-range-picker/styles.css.js +41 -40
  41. package/date-range-picker/styles.scoped.css +56 -48
  42. package/date-range-picker/styles.selectors.js +41 -40
  43. package/expandable-section/expandable-section-header.d.ts +3 -2
  44. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  45. package/expandable-section/expandable-section-header.js +3 -3
  46. package/expandable-section/expandable-section-header.js.map +1 -1
  47. package/expandable-section/interfaces.d.ts +5 -0
  48. package/expandable-section/interfaces.d.ts.map +1 -1
  49. package/expandable-section/interfaces.js.map +1 -1
  50. package/expandable-section/internal.d.ts +1 -1
  51. package/expandable-section/internal.d.ts.map +1 -1
  52. package/expandable-section/internal.js +4 -3
  53. package/expandable-section/internal.js.map +1 -1
  54. package/internal/components/dropdown-status/index.d.ts +3 -1
  55. package/internal/components/dropdown-status/index.d.ts.map +1 -1
  56. package/internal/components/dropdown-status/index.js +7 -4
  57. package/internal/components/dropdown-status/index.js.map +1 -1
  58. package/internal/components/live-region/index.d.ts.map +1 -1
  59. package/internal/components/live-region/index.js +1 -0
  60. package/internal/components/live-region/index.js.map +1 -1
  61. package/internal/environment.js +1 -1
  62. package/modal/internal.d.ts.map +1 -1
  63. package/modal/internal.js +6 -10
  64. package/modal/internal.js.map +1 -1
  65. package/multiselect/internal.d.ts.map +1 -1
  66. package/multiselect/internal.js +3 -2
  67. package/multiselect/internal.js.map +1 -1
  68. package/package.json +1 -1
  69. package/property-filter/controller.d.ts +2 -0
  70. package/property-filter/controller.d.ts.map +1 -1
  71. package/property-filter/controller.js +37 -0
  72. package/property-filter/controller.js.map +1 -1
  73. package/property-filter/index.d.ts.map +1 -1
  74. package/property-filter/index.js +21 -6
  75. package/property-filter/index.js.map +1 -1
  76. package/property-filter/interfaces.d.ts +9 -2
  77. package/property-filter/interfaces.d.ts.map +1 -1
  78. package/property-filter/interfaces.js +2 -0
  79. package/property-filter/interfaces.js.map +1 -1
  80. package/property-filter/property-editor.d.ts +13 -0
  81. package/property-filter/property-editor.d.ts.map +1 -0
  82. package/property-filter/property-editor.js +18 -0
  83. package/property-filter/property-editor.js.map +1 -0
  84. package/property-filter/property-filter-autosuggest.d.ts +1 -0
  85. package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  86. package/property-filter/property-filter-autosuggest.js +17 -3
  87. package/property-filter/property-filter-autosuggest.js.map +1 -1
  88. package/property-filter/styles.css.js +32 -24
  89. package/property-filter/styles.scoped.css +45 -27
  90. package/property-filter/styles.selectors.js +32 -24
  91. package/property-filter/token-editor.d.ts.map +1 -1
  92. package/property-filter/token-editor.js +17 -4
  93. package/property-filter/token-editor.js.map +1 -1
  94. package/property-filter/token.d.ts.map +1 -1
  95. package/property-filter/token.js +6 -3
  96. package/property-filter/token.js.map +1 -1
  97. package/select/internal.d.ts.map +1 -1
  98. package/select/internal.js +3 -2
  99. package/select/internal.js.map +1 -1
  100. package/select/parts/filter.d.ts +1 -1
  101. package/select/utils/use-select.d.ts +15 -1
  102. package/select/utils/use-select.d.ts.map +1 -1
  103. package/select/utils/use-select.js +11 -1
  104. package/select/utils/use-select.js.map +1 -1
  105. package/split-panel/index.d.ts.map +1 -1
  106. package/split-panel/index.js +8 -6
  107. package/split-panel/index.js.map +1 -1
  108. package/split-panel/interfaces.d.ts +1 -0
  109. package/split-panel/interfaces.d.ts.map +1 -1
  110. package/split-panel/interfaces.js.map +1 -1
  111. package/split-panel/utils/use-pointer-events.d.ts +1 -1
  112. package/split-panel/utils/use-pointer-events.d.ts.map +1 -1
  113. package/split-panel/utils/use-pointer-events.js +9 -5
  114. package/split-panel/utils/use-pointer-events.js.map +1 -1
  115. package/table/internal.d.ts.map +1 -1
  116. package/table/internal.js +8 -1
  117. package/table/internal.js.map +1 -1
  118. package/table/use-mouse-down-target.d.ts +6 -0
  119. package/table/use-mouse-down-target.d.ts.map +1 -0
  120. package/table/use-mouse-down-target.js +30 -0
  121. package/table/use-mouse-down-target.js.map +1 -0
  122. package/tabs/styles.css.js +21 -21
  123. package/tabs/styles.scoped.css +38 -37
  124. package/tabs/styles.selectors.js +21 -21
  125. package/test-utils/dom/date-range-picker/index.js +1 -1
  126. package/test-utils/dom/date-range-picker/index.js.map +1 -1
  127. package/test-utils/selectors/date-range-picker/index.js +1 -1
  128. package/test-utils/selectors/date-range-picker/index.js.map +1 -1
  129. package/test-utils/tsconfig.tsbuildinfo +1 -1
  130. package/calendar/grid/day/index.d.ts +0 -15
  131. package/calendar/grid/day/index.d.ts.map +0 -1
  132. package/calendar/grid/day/index.js +0 -47
  133. package/calendar/grid/day/index.js.map +0 -1
  134. package/date-range-picker/calendar/grids/day/index.d.ts +0 -27
  135. package/date-range-picker/calendar/grids/day/index.d.ts.map +0 -1
  136. package/date-range-picker/calendar/grids/day/index.js +0 -95
  137. package/date-range-picker/calendar/grids/day/index.js.map +0 -1
  138. package/date-range-picker/calendar/grids/day/styles.css.js +0 -26
  139. package/date-range-picker/calendar/grids/day/styles.selectors.js +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/toggles/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,aAAa;;;;sCAIF,eAAe,MAAM;;;;;;;;;sCASrB,eAAe,MAAM;;;;;;CAMnC,CAAC;AAEX,eAAO,MAAM,eAAe,8FAmB3B,CAAC;AAEF,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,WAAW,0FAQvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/toggles/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,aAAa;;;;sCAIF,eAAe,MAAM;;;;;;;;;sCASrB,eAAe,MAAM;;;;;;CAMnC,CAAC;AAEX,eAAO,MAAM,eAAe,8FAoB3B,CAAC;AAEF,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,WAAW,0FAevB,CAAC"}
@@ -31,11 +31,11 @@ export var togglesConfig = {
31
31
  };
32
32
  export var AppLayoutButton = React.forwardRef(function (_a, ref) {
33
33
  var className = _a.className, ariaLabel = _a.ariaLabel, ariaExpanded = _a.ariaExpanded, iconName = _a.iconName, disabled = _a.disabled, onClick = _a.onClick;
34
- return (React.createElement(InternalButton, { ref: ref, className: className, ariaLabel: ariaLabel, variant: "icon", formAction: "none", onClick: onClick, iconName: iconName, disabled: disabled, ariaExpanded: ariaExpanded }));
34
+ return (React.createElement(InternalButton, { ref: ref, className: className, ariaLabel: ariaLabel, variant: "icon", formAction: "none", onClick: onClick, iconName: iconName, disabled: disabled, ariaExpanded: ariaExpanded, __nativeAttributes: { 'aria-haspopup': true } }));
35
35
  });
36
36
  export var CloseButton = React.forwardRef(function (_a, ref) {
37
37
  var className = _a.className, ariaLabel = _a.ariaLabel, onClick = _a.onClick, iconName = _a.iconName;
38
38
  return (React.createElement("span", { className: styles['close-button'] },
39
- React.createElement(AppLayoutButton, { ref: ref, className: className, ariaLabel: ariaLabel, iconName: iconName, onClick: onClick })));
39
+ React.createElement(AppLayoutButton, { ref: ref, className: className, ariaExpanded: true, ariaLabel: ariaLabel, iconName: iconName, onClick: onClick })));
40
40
  });
41
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/toggles/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,UAAC,MAAkC;YAAlC,uBAAA,EAAA,WAAkC;YAAK,OAAA,CAAC;gBAClD,SAAS,EAAE,MAAM,CAAC,UAAU;gBAC5B,SAAS,EAAE,MAAM,CAAC,gBAAgB;gBAClC,UAAU,EAAE,MAAM,CAAC,eAAe;aACnC,CAAC;QAJiD,CAIjD;KACH;IACD,KAAK,EAAE;QACL,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,aAAa;QACvB,SAAS,EAAE,UAAC,MAAkC;YAAlC,uBAAA,EAAA,WAAkC;YAAK,OAAA,CAAC;gBAClD,SAAS,EAAE,MAAM,CAAC,KAAK;gBACvB,SAAS,EAAE,MAAM,CAAC,WAAW;gBAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;aAC9B,CAAC;QAJiD,CAIjD;KACH;CACO,CAAC;AAEX,MAAM,CAAC,IAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAC7C,UACE,EAAyF,EACzF,GAA+B;QAD7B,SAAS,eAAA,EAAE,SAAS,eAAA,EAAE,YAAY,kBAAA,EAAE,QAAQ,cAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA;IAGjE,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AASF,MAAM,CAAC,IAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CACzC,UAAC,EAA6D,EAAE,GAA+B;QAA5F,SAAS,eAAA,EAAE,SAAS,eAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA;IACxC,OAAO,CACL,8BAAM,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC;QACrC,oBAAC,eAAe,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAI,CAC1G,CACR,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { InternalButton } from '../../button/internal';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutButtonProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const togglesConfig = {\n navigation: {\n TagName: 'nav',\n iconName: 'menu',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.navigation,\n openLabel: labels.navigationToggle,\n closeLabel: labels.navigationClose,\n }),\n },\n tools: {\n TagName: 'aside',\n iconName: 'status-info',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.tools,\n openLabel: labels.toolsToggle,\n closeLabel: labels.toolsClose,\n }),\n },\n} as const;\n\nexport const AppLayoutButton = React.forwardRef(\n (\n { className, ariaLabel, ariaExpanded, iconName, disabled, onClick }: AppLayoutButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n return (\n <InternalButton\n ref={ref}\n className={className}\n ariaLabel={ariaLabel}\n variant=\"icon\"\n formAction=\"none\"\n onClick={onClick}\n iconName={iconName}\n disabled={disabled}\n ariaExpanded={ariaExpanded}\n />\n );\n }\n);\n\ninterface CloseButtonProps {\n className?: string;\n ariaLabel: string | undefined;\n onClick: () => void;\n iconName: IconProps.Name;\n}\n\nexport const CloseButton = React.forwardRef(\n ({ className, ariaLabel, onClick, iconName }: CloseButtonProps, ref: React.Ref<ButtonProps.Ref>) => {\n return (\n <span className={styles['close-button']}>\n <AppLayoutButton ref={ref} className={className} ariaLabel={ariaLabel} iconName={iconName} onClick={onClick} />\n </span>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/toggles/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,UAAC,MAAkC;YAA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AAC,cAAc,CAAC;QACrC,oBAAC,eAAe,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,IAAI,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,GAChB,CACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { InternalButton } from '../../button/internal';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutButtonProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const togglesConfig = {\n navigation: {\n TagName: 'nav',\n iconName: 'menu',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.navigation,\n openLabel: labels.navigationToggle,\n closeLabel: labels.navigationClose,\n }),\n },\n tools: {\n TagName: 'aside',\n iconName: 'status-info',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.tools,\n openLabel: labels.toolsToggle,\n closeLabel: labels.toolsClose,\n }),\n },\n} as const;\n\nexport const AppLayoutButton = React.forwardRef(\n (\n { className, ariaLabel, ariaExpanded, iconName, disabled, onClick }: AppLayoutButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n return (\n <InternalButton\n ref={ref}\n className={className}\n ariaLabel={ariaLabel}\n variant=\"icon\"\n formAction=\"none\"\n onClick={onClick}\n iconName={iconName}\n disabled={disabled}\n ariaExpanded={ariaExpanded}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n );\n }\n);\n\ninterface CloseButtonProps {\n className?: string;\n ariaLabel: string | undefined;\n onClick: () => void;\n iconName: IconProps.Name;\n}\n\nexport const CloseButton = React.forwardRef(\n ({ className, ariaLabel, onClick, iconName }: CloseButtonProps, ref: React.Ref<ButtonProps.Ref>) => {\n return (\n <span className={styles['close-button']}>\n <AppLayoutButton\n ref={ref}\n className={className}\n ariaExpanded={true}\n ariaLabel={ariaLabel}\n iconName={iconName}\n onClick={onClick}\n />\n </span>\n );\n }\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"app-bar.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/app-bar.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,uBAyF7B"}
1
+ {"version":3,"file":"app-bar.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/app-bar.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,uBA2F7B"}
@@ -26,13 +26,13 @@ export default function AppBar() {
26
26
  _a[testutilStyles['mobile-bar']] = isMobile,
27
27
  _a), 'awsui-context-content-header') },
28
28
  !navigationHide && isMobile && (React.createElement("nav", { className: clsx(styles['appbar-nav'], (_b = {}, _b[testutilStyles['drawer-closed']] = !isNavigationOpen, _b)), "aria-hidden": isNavigationOpen },
29
- React.createElement(InternalButton, { ariaLabel: (_e = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _e !== void 0 ? _e : undefined, ariaExpanded: isNavigationOpen, iconName: "menu", formAction: "none", onClick: function () { return handleNavigationClick(true); }, variant: "icon", className: testutilStyles['navigation-toggle'], ref: focusRefsNav.toggle, disabled: isAnyPanelOpen }))),
29
+ React.createElement(InternalButton, { ariaLabel: (_e = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _e !== void 0 ? _e : undefined, ariaExpanded: isNavigationOpen, iconName: "menu", formAction: "none", onClick: function () { return handleNavigationClick(true); }, variant: "icon", className: testutilStyles['navigation-toggle'], ref: focusRefsNav.toggle, disabled: isAnyPanelOpen, __nativeAttributes: { 'aria-haspopup': true } }))),
30
30
  breadcrumbs && (React.createElement("div", { className: clsx(styles.breadcrumbs, styles["content-type-".concat(contentType)], testutilStyles.breadcrumbs, (_c = {},
31
31
  _c[styles['has-dynamic-overlap-height']] = dynamicOverlapHeight > 0,
32
32
  _c[styles['has-header']] = contentHeader,
33
33
  _c[styles['has-notifications-content']] = hasNotificationsContent,
34
34
  _c)) }, breadcrumbs)),
35
35
  !toolsHide && isMobile && (React.createElement("aside", { className: clsx(styles['appbar-tools'], (_d = {}, _d[testutilStyles['drawer-closed']] = !isToolsOpen, _d)), "aria-hidden": isToolsOpen, "aria-label": (_f = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _f !== void 0 ? _f : undefined },
36
- React.createElement(InternalButton, { className: testutilStyles['tools-toggle'], ariaExpanded: isToolsOpen, disabled: isAnyPanelOpen, ariaLabel: (_g = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle) !== null && _g !== void 0 ? _g : undefined, iconName: "status-info", formAction: "none", onClick: function () { return handleToolsClick(true); }, variant: "icon", ref: focusRefsTools.toggle })))));
36
+ React.createElement(InternalButton, { className: testutilStyles['tools-toggle'], ariaExpanded: isToolsOpen, disabled: isAnyPanelOpen, ariaLabel: (_g = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle) !== null && _g !== void 0 ? _g : undefined, iconName: "status-info", formAction: "none", onClick: function () { return handleToolsClick(true); }, variant: "icon", ref: focusRefsTools.toggle, __nativeAttributes: { 'aria-haspopup': true } })))));
37
37
  }
38
38
  //# sourceMappingURL=app-bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-bar.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/app-bar.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,E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,OAAO,EAAE,cAAM,OAAA,gBAAgB,CAAC,IAAI,CAAC,EAAtB,CAAsB,EACrC,OAAO,EAAC,MAAM,EACd,GAAG,EAAE,cAAc,CAAC,MAAM,GAC1B,CACI,CACT,CACO,CACX,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { AppLayoutContext } from './context';\nimport { InternalButton } from '../../button/internal';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useFocusControl } from '../utils/use-focus-control';\n\n/**\n * The CSS class 'awsui-context-content-header' needs to be added to the root element so\n * that the design tokens used are overridden with the appropriate values.\n */\nexport default function AppBar() {\n const {\n ariaLabels,\n breadcrumbs,\n contentHeader,\n contentType,\n dynamicOverlapHeight,\n handleNavigationClick,\n handleToolsClick,\n hasNotificationsContent,\n isMobile,\n navigationHide,\n isNavigationOpen,\n isToolsOpen,\n toolsHide,\n isAnyPanelOpen,\n } = useContext(AppLayoutContext);\n const focusRefsNav = useFocusControl(isNavigationOpen);\n const focusRefsTools = useFocusControl(isToolsOpen);\n\n if (navigationHide && !breadcrumbs && toolsHide) {\n return null;\n }\n\n return (\n <section\n aria-hidden={!isMobile && !breadcrumbs ? true : undefined}\n className={clsx(\n styles.appbar,\n {\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles.unfocusable]: isMobile && isAnyPanelOpen,\n [testutilStyles['mobile-bar']]: isMobile,\n },\n 'awsui-context-content-header'\n )}\n >\n {!navigationHide && isMobile && (\n <nav\n className={clsx(styles['appbar-nav'], { [testutilStyles['drawer-closed']]: !isNavigationOpen })}\n aria-hidden={isNavigationOpen}\n >\n <InternalButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={isNavigationOpen}\n iconName=\"menu\"\n formAction=\"none\"\n onClick={() => handleNavigationClick(true)}\n variant=\"icon\"\n className={testutilStyles['navigation-toggle']}\n ref={focusRefsNav.toggle}\n disabled={isAnyPanelOpen}\n />\n </nav>\n )}\n\n {breadcrumbs && (\n <div\n className={clsx(styles.breadcrumbs, styles[`content-type-${contentType}`], testutilStyles.breadcrumbs, {\n [styles['has-dynamic-overlap-height']]: dynamicOverlapHeight > 0,\n [styles['has-header']]: contentHeader,\n [styles['has-notifications-content']]: hasNotificationsContent,\n })}\n >\n {breadcrumbs}\n </div>\n )}\n\n {!toolsHide && isMobile && (\n <aside\n className={clsx(styles['appbar-tools'], { [testutilStyles['drawer-closed']]: !isToolsOpen })}\n aria-hidden={isToolsOpen}\n aria-label={ariaLabels?.tools ?? undefined}\n >\n <InternalButton\n className={testutilStyles['tools-toggle']}\n ariaExpanded={isToolsOpen}\n disabled={isAnyPanelOpen}\n ariaLabel={ariaLabels?.toolsToggle ?? undefined}\n iconName=\"status-info\"\n formAction=\"none\"\n onClick={() => handleToolsClick(true)}\n variant=\"icon\"\n ref={focusRefsTools.toggle}\n />\n </aside>\n )}\n </section>\n );\n}\n"]}
1
+ {"version":3,"file":"app-bar.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/app-bar.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM;;;IACtB,IAAA,KAeF,UAAU,CAAC,gBAAgB,CAAC,EAd9B,UAAU,gBAAA,EACV,WAAW,i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, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { AppLayoutContext } from './context';\nimport { InternalButton } from '../../button/internal';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useFocusControl } from '../utils/use-focus-control';\n\n/**\n * The CSS class 'awsui-context-content-header' needs to be added to the root element so\n * that the design tokens used are overridden with the appropriate values.\n */\nexport default function AppBar() {\n const {\n ariaLabels,\n breadcrumbs,\n contentHeader,\n contentType,\n dynamicOverlapHeight,\n handleNavigationClick,\n handleToolsClick,\n hasNotificationsContent,\n isMobile,\n navigationHide,\n isNavigationOpen,\n isToolsOpen,\n toolsHide,\n isAnyPanelOpen,\n } = useContext(AppLayoutContext);\n const focusRefsNav = useFocusControl(isNavigationOpen);\n const focusRefsTools = useFocusControl(isToolsOpen);\n\n if (navigationHide && !breadcrumbs && toolsHide) {\n return null;\n }\n\n return (\n <section\n aria-hidden={!isMobile && !breadcrumbs ? true : undefined}\n className={clsx(\n styles.appbar,\n {\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles.unfocusable]: isMobile && isAnyPanelOpen,\n [testutilStyles['mobile-bar']]: isMobile,\n },\n 'awsui-context-content-header'\n )}\n >\n {!navigationHide && isMobile && (\n <nav\n className={clsx(styles['appbar-nav'], { [testutilStyles['drawer-closed']]: !isNavigationOpen })}\n aria-hidden={isNavigationOpen}\n >\n <InternalButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={isNavigationOpen}\n iconName=\"menu\"\n formAction=\"none\"\n onClick={() => handleNavigationClick(true)}\n variant=\"icon\"\n className={testutilStyles['navigation-toggle']}\n ref={focusRefsNav.toggle}\n disabled={isAnyPanelOpen}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </nav>\n )}\n\n {breadcrumbs && (\n <div\n className={clsx(styles.breadcrumbs, styles[`content-type-${contentType}`], testutilStyles.breadcrumbs, {\n [styles['has-dynamic-overlap-height']]: dynamicOverlapHeight > 0,\n [styles['has-header']]: contentHeader,\n [styles['has-notifications-content']]: hasNotificationsContent,\n })}\n >\n {breadcrumbs}\n </div>\n )}\n\n {!toolsHide && isMobile && (\n <aside\n className={clsx(styles['appbar-tools'], { [testutilStyles['drawer-closed']]: !isToolsOpen })}\n aria-hidden={isToolsOpen}\n aria-label={ariaLabels?.tools ?? undefined}\n >\n <InternalButton\n className={testutilStyles['tools-toggle']}\n ariaExpanded={isToolsOpen}\n disabled={isAnyPanelOpen}\n ariaLabel={ariaLabels?.toolsToggle ?? undefined}\n iconName=\"status-info\"\n formAction=\"none\"\n onClick={() => handleToolsClick(true)}\n variant=\"icon\"\n ref={focusRefsTools.toggle}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </aside>\n )}\n </section>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,uBAmGjC"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,uBAqGjC"}
@@ -55,7 +55,7 @@ export default function Navigation() {
55
55
  } },
56
56
  React.createElement("div", { className: clsx(styles['animated-content']) },
57
57
  React.createElement("div", { className: clsx(styles['hide-navigation']) },
58
- React.createElement(InternalButton, { ariaLabel: (_g = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationClose) !== null && _g !== void 0 ? _g : undefined, iconName: isMobile ? 'close' : 'angle-left', onClick: function () { return handleNavigationClick(false); }, variant: "icon", formAction: "none", className: testutilStyles['navigation-close'], ref: focusRefs.close })),
58
+ React.createElement(InternalButton, { ariaLabel: (_g = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationClose) !== null && _g !== void 0 ? _g : undefined, iconName: isMobile ? 'close' : 'angle-left', onClick: function () { return handleNavigationClick(false); }, variant: "icon", formAction: "none", className: testutilStyles['navigation-close'], ref: focusRefs.close, ariaExpanded: true, __nativeAttributes: { 'aria-haspopup': true } })),
59
59
  navigation))));
60
60
  }));
61
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU;IAC1B,IAAA,KAWF,UAAU,CAAC,gBAAgB,CAAC,EAV9B,UAAU,gBAAA,EACV,qBAAqB,2BAAA,EACrB,QAAQ,cAAA,EACR,gBAAgB,sBAAA,EAChB,UAAU,gBAAA,EACV,cAAc,oBAAA,EACd,eAAe,qBAAA,EACf,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,SAAS,eACqB,CAAC;IAEjC,IAAM,SAAS,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAEpD,IAAI,cAAc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,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,SAAS,CAAC,KAAK,GACpB,CACE;oBACL,UAAU,CACP,CACF,CACF,CACP,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { AppLayoutContext } from './context';\nimport { InternalButton } from '../../button/internal';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useFocusControl } from '../utils/use-focus-control';\nimport { Transition } from '../../internal/components/transition';\nimport { findUpUntil } from '../../internal/utils/dom';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n handleNavigationClick,\n isMobile,\n isNavigationOpen,\n navigation,\n navigationHide,\n navigationWidth,\n isToolsOpen,\n isAnyPanelOpen,\n toolsHide,\n } = useContext(AppLayoutContext);\n\n const focusRefs = useFocusControl(isNavigationOpen);\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isToolsOpen && !toolsHide;\n\n return (\n <Transition in={isNavigationOpen}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['navigation-container'], {\n [testutilStyles['drawer-closed']]: !isNavigationOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n // Overwrite the default nav width (depends on breakpoints) only when the `navigationWidth` property is set.\n style={{ ...(navigationWidth && { [customCssProps.navigationWidth]: `${navigationWidth}px` }) }}\n >\n {!isMobile && (\n <nav\n aria-hidden={isMobile || isNavigationOpen ? true : false}\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles['show-navigation'], {\n [styles.animating]: state === 'exiting',\n [styles['is-navigation-open']]: isNavigationOpen,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => handleNavigationClick(true)}\n ref={focusRefs.toggle}\n />\n </nav>\n )}\n\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(\n styles.navigation,\n {\n [styles.animating]: state === 'entering',\n [styles['is-navigation-open']]: isNavigationOpen,\n },\n testutilStyles.navigation\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n aria-hidden={!isNavigationOpen}\n onClick={event => {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-navigation'])}>\n <InternalButton\n ariaLabel={ariaLabels?.navigationClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={focusRefs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n </div>\n )}\n </Transition>\n );\n}\n"]}
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OA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AAC,MAAM,CAAC,oBAAoB,CAAC,IAAG,gBAAgB;yBAElD,cAAc,CAAC,UAAU,CAC1B,EACD,GAAG,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,iBAC7C,CAAC,gBAAgB,EAC9B,OAAO,EAAE,UAAA,KAAK;oBACZ,iBAAiB,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAChD,CAAC;gBAED,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;oBAC9C,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;wBAC7C,oBAAC,cAAc,IACb,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,mCAAI,SAAS,EACnD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAC3C,OAAO,EAAE,cAAM,OAAA,qBAAqB,CAAC,KAAK,CAAC,EAA5B,CAA4B,EAC3C,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,SAAS,CAAC,KAAK,EACpB,YAAY,EAAE,IAAI,EAClB,kBAAkB,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,GAC7C,CACE;oBACL,UAAU,CACP,CACF,CACF,CACP,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { AppLayoutContext } from './context';\nimport { InternalButton } from '../../button/internal';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useFocusControl } from '../utils/use-focus-control';\nimport { Transition } from '../../internal/components/transition';\nimport { findUpUntil } from '../../internal/utils/dom';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n handleNavigationClick,\n isMobile,\n isNavigationOpen,\n navigation,\n navigationHide,\n navigationWidth,\n isToolsOpen,\n isAnyPanelOpen,\n toolsHide,\n } = useContext(AppLayoutContext);\n\n const focusRefs = useFocusControl(isNavigationOpen);\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isToolsOpen && !toolsHide;\n\n return (\n <Transition in={isNavigationOpen}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['navigation-container'], {\n [testutilStyles['drawer-closed']]: !isNavigationOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n // Overwrite the default nav width (depends on breakpoints) only when the `navigationWidth` property is set.\n style={{ ...(navigationWidth && { [customCssProps.navigationWidth]: `${navigationWidth}px` }) }}\n >\n {!isMobile && (\n <nav\n aria-hidden={isMobile || isNavigationOpen ? true : false}\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles['show-navigation'], {\n [styles.animating]: state === 'exiting',\n [styles['is-navigation-open']]: isNavigationOpen,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => handleNavigationClick(true)}\n ref={focusRefs.toggle}\n />\n </nav>\n )}\n\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(\n styles.navigation,\n {\n [styles.animating]: state === 'entering',\n [styles['is-navigation-open']]: isNavigationOpen,\n },\n testutilStyles.navigation\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n aria-hidden={!isNavigationOpen}\n onClick={event => {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-navigation'])}>\n <InternalButton\n ariaLabel={ariaLabels?.navigationClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={focusRefs.close}\n ariaExpanded={true}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </div>\n {navigation}\n </div>\n </nav>\n </div>\n )}\n </Transition>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAa1C,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,sBA2HrD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,WAU/E"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAa1C,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,sBA6HrD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,WAU/E"}
@@ -51,7 +51,7 @@ export default function Tools(_a) {
51
51
  _c), testutilStyles.tools), ref: state !== 'exiting' ? transitionEventsRef : undefined },
52
52
  React.createElement("div", { className: clsx(styles['animated-content']) },
53
53
  React.createElement("div", { className: clsx(styles['hide-tools']) },
54
- React.createElement(InternalButton, { ariaLabel: (_f = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose) !== null && _f !== void 0 ? _f : undefined, iconName: isMobile ? 'close' : 'angle-right', onClick: function () { return handleToolsClick(false); }, variant: "icon", formAction: "none", className: testutilStyles['tools-close'], ref: focusRefs.close })),
54
+ React.createElement(InternalButton, { ariaLabel: (_f = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose) !== null && _f !== void 0 ? _f : undefined, iconName: isMobile ? 'close' : 'angle-right', onClick: function () { return handleToolsClick(false); }, variant: "icon", formAction: "none", className: testutilStyles['tools-close'], ref: focusRefs.close, ariaExpanded: true, __nativeAttributes: { 'aria-haspopup': true } })),
55
55
  tools))),
56
56
  !isMobile && (React.createElement("aside", { "aria-hidden": !hasToolsForm ? true : false, "aria-label": (_g = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _g !== void 0 ? _g : undefined, className: clsx(styles['show-tools'], (_d = {},
57
57
  _d[styles.animating] = state === 'exiting',
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,C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AAS,EAAE;YACnD,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { AppLayoutContext } from './context';\nimport { SplitPanelContext } from '../../internal/context/split-panel-context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useFocusControl } from '../utils/use-focus-control';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n isNavigationOpen,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanel,\n tools,\n toolsHide,\n toolsWidth,\n isAnyPanelOpen,\n navigationHide,\n } = useContext(AppLayoutContext);\n\n const { position: splitPanelPosition, openButtonAriaLabel } = useContext(SplitPanelContext);\n\n const hasSplitPanel = getSplitPanelStatus(splitPanel, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n\n const focusRefs = useFocusControl(isToolsOpen);\n\n if (toolsHide && !hasSplitPanel) {\n return null;\n }\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isNavigationOpen && !navigationHide;\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={focusRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles['show-tools'],\n {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n },\n splitPanelStyles.root\n )}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={focusRefs.toggle}\n />\n )}\n\n {hasSplitPanel && (\n <TriggerButton\n ariaLabel={openButtonAriaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n // TODO should this button also get focus handling? (i.e. when the split panel is toggled)\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanel: React.ReactNode, splitPanelPosition: string) {\n return splitPanel && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO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AE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { AppLayoutContext } from './context';\nimport { SplitPanelContext } from '../../internal/context/split-panel-context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useFocusControl } from '../utils/use-focus-control';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n isNavigationOpen,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanel,\n tools,\n toolsHide,\n toolsWidth,\n isAnyPanelOpen,\n navigationHide,\n } = useContext(AppLayoutContext);\n\n const { position: splitPanelPosition, openButtonAriaLabel } = useContext(SplitPanelContext);\n\n const hasSplitPanel = getSplitPanelStatus(splitPanel, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n\n const focusRefs = useFocusControl(isToolsOpen);\n\n if (toolsHide && !hasSplitPanel) {\n return null;\n }\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isNavigationOpen && !navigationHide;\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={focusRefs.close}\n ariaExpanded={true}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles['show-tools'],\n {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n },\n splitPanelStyles.root\n )}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={focusRefs.toggle}\n />\n )}\n\n {hasSplitPanel && (\n <TriggerButton\n ariaLabel={openButtonAriaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n // TODO should this button also get focus handling? (i.e. when the split panel is toggled)\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanel: React.ReactNode, splitPanelPosition: string) {\n return splitPanel && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"trigger-button.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;;AA6BD,wBAA+C"}
1
+ {"version":3,"file":"trigger-button.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;;AA8BD,wBAA+C"}
@@ -10,7 +10,7 @@ function TriggerButton(_a, ref) {
10
10
  var _b;
11
11
  var ariaLabel = _a.ariaLabel, iconName = _a.iconName, onClick = _a.onClick, _c = _a.selected, selected = _c === void 0 ? false : _c, className = _a.className;
12
12
  var focusVisible = useFocusVisible();
13
- return (React.createElement("button", __assign({ "aria-label": ariaLabel, "aria-expanded": false, className: clsx(styles.trigger, (_b = {},
13
+ return (React.createElement("button", __assign({ "aria-label": ariaLabel, "aria-expanded": false, "aria-haspopup": true, className: clsx(styles.trigger, (_b = {},
14
14
  _b[styles.selected] = selected,
15
15
  _b), className), onClick: onClick, type: "button", ref: ref }, focusVisible),
16
16
  React.createElement(Icon, { name: iconName })));
@@ -1 +1 @@
1
- {"version":3,"file":"trigger-button.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAYrC,SAAS,aAAa,CACpB,EAAiF,EACjF,GAA+B;;QAD7B,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,SAAS,eAAA;IAG3D,IAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,OAAO,CACL,uDACc,SAAS,mBACN,KAAK,EACpB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO;YAEZ,GAAC,MAAM,CAAC,QAAQ,IAAG,QAAQ;iBAE7B,SAAS,CACV,EACD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,GAAmC,IACpC,YAAY;QAEhB,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,GAAI,CACjB,CACV,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport useFocusVisible from '../../internal/hooks/focus-visible';\nimport Icon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\n\ninterface TriggerButtonProps {\n ariaLabel?: string;\n iconName: IconProps.Name;\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n selected?: boolean;\n className?: string;\n}\n\nfunction TriggerButton(\n { ariaLabel, iconName, onClick, selected = false, className }: TriggerButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n) {\n const focusVisible = useFocusVisible();\n\n return (\n <button\n aria-label={ariaLabel}\n aria-expanded={false}\n className={clsx(\n styles.trigger,\n {\n [styles.selected]: selected,\n },\n className\n )}\n onClick={onClick}\n type=\"button\"\n ref={ref as React.Ref<HTMLButtonElement>}\n {...focusVisible}\n >\n <Icon name={iconName} />\n </button>\n );\n}\n\nexport default React.forwardRef(TriggerButton);\n"]}
1
+ {"version":3,"file":"trigger-button.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAYrC,SAAS,aAAa,CACpB,EAAiF,EACjF,GAA+B;;QAD7B,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,SAAS,eAAA;IAG3D,IAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,OAAO,CACL,uDACc,SAAS,mBACN,KAAK,mBACL,IAAI,EACnB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO;YAEZ,GAAC,MAAM,CAAC,QAAQ,IAAG,QAAQ;iBAE7B,SAAS,CACV,EACD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,GAAmC,IACpC,YAAY;QAEhB,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,GAAI,CACjB,CACV,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport useFocusVisible from '../../internal/hooks/focus-visible';\nimport Icon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\n\ninterface TriggerButtonProps {\n ariaLabel?: string;\n iconName: IconProps.Name;\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n selected?: boolean;\n className?: string;\n}\n\nfunction TriggerButton(\n { ariaLabel, iconName, onClick, selected = false, className }: TriggerButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n) {\n const focusVisible = useFocusVisible();\n\n return (\n <button\n aria-label={ariaLabel}\n aria-expanded={false}\n aria-haspopup={true}\n className={clsx(\n styles.trigger,\n {\n [styles.selected]: selected,\n },\n className\n )}\n onClick={onClick}\n type=\"button\"\n ref={ref as React.Ref<HTMLButtonElement>}\n {...focusVisible}\n >\n <Icon name={iconName} />\n </button>\n );\n}\n\nexport default React.forwardRef(TriggerButton);\n"]}
@@ -1,12 +1,12 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "link": "awsui_link_1kosq_10si8_93",
5
- "breadcrumb": "awsui_breadcrumb_1kosq_10si8_97",
6
- "icon": "awsui_icon_1kosq_10si8_100",
7
- "anchor": "awsui_anchor_1kosq_10si8_104",
8
- "last": "awsui_last_1kosq_10si8_147",
9
- "compressed": "awsui_compressed_1kosq_10si8_157",
10
- "text": "awsui_text_1kosq_10si8_161"
4
+ "link": "awsui_link_1kosq_6hzx7_93",
5
+ "breadcrumb": "awsui_breadcrumb_1kosq_6hzx7_97",
6
+ "icon": "awsui_icon_1kosq_6hzx7_100",
7
+ "anchor": "awsui_anchor_1kosq_6hzx7_104",
8
+ "last": "awsui_last_1kosq_6hzx7_147",
9
+ "compressed": "awsui_compressed_1kosq_6hzx7_158",
10
+ "text": "awsui_text_1kosq_6hzx7_162"
11
11
  };
12
12
 
@@ -90,18 +90,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
90
90
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
91
  SPDX-License-Identifier: Apache-2.0
92
92
  */
93
- .awsui_link_1kosq_10si8_93:not(#\9):after {
93
+ .awsui_link_1kosq_6hzx7_93:not(#\9):after {
94
94
  display: none;
95
95
  }
96
96
 
97
- .awsui_breadcrumb_1kosq_10si8_97:not(#\9) {
97
+ .awsui_breadcrumb_1kosq_6hzx7_97:not(#\9) {
98
98
  display: flex;
99
99
  }
100
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_icon_1kosq_10si8_100:not(#\9) {
100
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_icon_1kosq_6hzx7_100:not(#\9) {
101
101
  margin: 0 var(--space-xs-rsr2qu, 8px);
102
102
  color: var(--color-text-breadcrumb-icon-mlugp6, #7d8998);
103
103
  }
104
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9) {
104
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9) {
105
105
  color: var(--color-text-link-default-5f186r, #0972d3);
106
106
  font-weight: inherit;
107
107
  letter-spacing: normal;
@@ -114,31 +114,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
114
114
  transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
115
115
  }
116
116
  @media (prefers-reduced-motion: reduce) {
117
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9) {
117
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9) {
118
118
  animation: none;
119
119
  transition: none;
120
120
  }
121
121
  }
122
- .awsui-motion-disabled .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9), .awsui-mode-entering .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9) {
122
+ .awsui-motion-disabled .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9), .awsui-mode-entering .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9) {
123
123
  animation: none;
124
124
  transition: none;
125
125
  }
126
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9):hover {
126
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9):hover {
127
127
  cursor: pointer;
128
128
  color: var(--color-text-link-hover-kololx, #033160);
129
129
  }
130
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9):focus {
130
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9):focus {
131
131
  outline: none;
132
132
  }
133
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9):active {
133
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9):active {
134
134
  color: var(--color-text-link-hover-kololx, #033160);
135
135
  }
136
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9):active, .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9):focus, .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104:not(#\9):hover {
136
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9):active, .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9):focus, .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104:not(#\9):hover {
137
137
  text-decoration: underline;
138
138
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
139
139
  text-decoration-color: currentColor;
140
140
  }
141
- .awsui_breadcrumb_1kosq_10si8_97 > .awsui_anchor_1kosq_10si8_104[data-awsui-focus-visible=true]:not(#\9):focus {
141
+ .awsui_breadcrumb_1kosq_6hzx7_97 > .awsui_anchor_1kosq_6hzx7_104[data-awsui-focus-visible=true]:not(#\9):focus {
142
142
  outline: thin dotted;
143
143
  outline: var(--border-link-focus-ring-outline-k2wccv, 0);
144
144
  outline-offset: 2px;
@@ -146,21 +146,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
146
146
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
147
147
  box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-nv4ahb, 2px) var(--color-border-item-focused-ap3b6s, #0972d3);
148
148
  }
149
- .awsui_breadcrumb_1kosq_10si8_97.awsui_last_1kosq_10si8_147 > .awsui_icon_1kosq_10si8_100:not(#\9) {
149
+ .awsui_breadcrumb_1kosq_6hzx7_97.awsui_last_1kosq_6hzx7_147 > .awsui_icon_1kosq_6hzx7_100:not(#\9) {
150
150
  display: none;
151
151
  }
152
- .awsui_breadcrumb_1kosq_10si8_97.awsui_last_1kosq_10si8_147 > .awsui_anchor_1kosq_10si8_104:not(#\9) {
152
+ .awsui_breadcrumb_1kosq_6hzx7_97.awsui_last_1kosq_6hzx7_147 > .awsui_anchor_1kosq_6hzx7_104:not(#\9) {
153
153
  color: var(--color-text-breadcrumb-current-mum16s, #5f6b7a);
154
+ font-weight: 700;
154
155
  text-decoration: none;
155
156
  cursor: default;
156
157
  pointer-events: none;
157
158
  }
158
159
 
159
- .awsui_compressed_1kosq_10si8_157:not(#\9) {
160
+ .awsui_compressed_1kosq_6hzx7_158:not(#\9) {
160
161
  min-width: 0;
161
162
  overflow: hidden;
162
163
  }
163
- .awsui_compressed_1kosq_10si8_157 > .awsui_text_1kosq_10si8_161:not(#\9) {
164
+ .awsui_compressed_1kosq_6hzx7_158 > .awsui_text_1kosq_6hzx7_162:not(#\9) {
164
165
  overflow: hidden;
165
166
  text-overflow: ellipsis;
166
167
  white-space: nowrap;
@@ -2,12 +2,12 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "link": "awsui_link_1kosq_10si8_93",
6
- "breadcrumb": "awsui_breadcrumb_1kosq_10si8_97",
7
- "icon": "awsui_icon_1kosq_10si8_100",
8
- "anchor": "awsui_anchor_1kosq_10si8_104",
9
- "last": "awsui_last_1kosq_10si8_147",
10
- "compressed": "awsui_compressed_1kosq_10si8_157",
11
- "text": "awsui_text_1kosq_10si8_161"
5
+ "link": "awsui_link_1kosq_6hzx7_93",
6
+ "breadcrumb": "awsui_breadcrumb_1kosq_6hzx7_97",
7
+ "icon": "awsui_icon_1kosq_6hzx7_100",
8
+ "anchor": "awsui_anchor_1kosq_6hzx7_104",
9
+ "last": "awsui_last_1kosq_6hzx7_147",
10
+ "compressed": "awsui_compressed_1kosq_6hzx7_158",
11
+ "text": "awsui_text_1kosq_6hzx7_162"
12
12
  };
13
13
 
@@ -6,6 +6,7 @@ export interface GridProps {
6
6
  baseDate: Date;
7
7
  isDateEnabled: DatePickerProps.IsDateEnabledFunction;
8
8
  focusedDate: Date | null;
9
+ focusableDate: Date | null;
9
10
  onSelectDate: (date: Date) => void;
10
11
  onFocusDate: (date: null | Date) => void;
11
12
  onChangeMonth: (date: Date) => void;
@@ -14,6 +15,5 @@ export interface GridProps {
14
15
  selectedDate: Date | null;
15
16
  handleFocusMove: MoveFocusHandler;
16
17
  }
17
- declare const Grid: ({ locale, baseDate, isDateEnabled, focusedDate, onSelectDate, onFocusDate, onChangeMonth, startOfWeek, todayAriaLabel, selectedDate, handleFocusMove, }: GridProps) => JSX.Element;
18
- export default Grid;
18
+ export default function Grid({ locale, baseDate, isDateEnabled, focusedDate, focusableDate, onSelectDate, onFocusDate, onChangeMonth, startOfWeek, todayAriaLabel, selectedDate, handleFocusMove, }: GridProps): JSX.Element;
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/grid/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAA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E,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,QAAQ,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,gBAAgB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,eAAe,GAChB,EAAE,SAAS,eAuIX"}
@@ -1,43 +1,48 @@
1
+ import { __assign } from "tslib";
1
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
3
  // SPDX-License-Identifier: Apache-2.0
3
- import React, { useMemo } from 'react';
4
+ import React, { useMemo, useRef } from 'react';
4
5
  import styles from '../styles.css.js';
5
- import GridDay from './day';
6
6
  import { KeyCode } from '../../internal/keycode';
7
- import { addDays, addWeeks, isSameMonth } from 'date-fns';
7
+ import { addDays, addWeeks, isSameDay, isSameMonth } from 'date-fns';
8
8
  import { getCalendarMonth } from 'mnth';
9
9
  import rotateDayIndexes from '../utils/rotate-day-indexes';
10
- import { renderDayName } from '../utils/intl';
11
- var Grid = function (_a) {
12
- var locale = _a.locale, baseDate = _a.baseDate, isDateEnabled = _a.isDateEnabled, focusedDate = _a.focusedDate, onSelectDate = _a.onSelectDate, onFocusDate = _a.onFocusDate, onChangeMonth = _a.onChangeMonth, startOfWeek = _a.startOfWeek, todayAriaLabel = _a.todayAriaLabel, selectedDate = _a.selectedDate, handleFocusMove = _a.handleFocusMove;
10
+ import { getDateLabel, renderDayName } from '../utils/intl';
11
+ import useFocusVisible from '../../internal/hooks/focus-visible/index.js';
12
+ import clsx from 'clsx';
13
+ import { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update.js';
14
+ export default function Grid(_a) {
15
+ var locale = _a.locale, baseDate = _a.baseDate, isDateEnabled = _a.isDateEnabled, focusedDate = _a.focusedDate, focusableDate = _a.focusableDate, onSelectDate = _a.onSelectDate, onFocusDate = _a.onFocusDate, onChangeMonth = _a.onChangeMonth, startOfWeek = _a.startOfWeek, todayAriaLabel = _a.todayAriaLabel, selectedDate = _a.selectedDate, handleFocusMove = _a.handleFocusMove;
16
+ var focusedDateRef = useRef(null);
13
17
  var onGridKeyDownHandler = function (event) {
14
18
  var updatedFocusDate;
15
- if (focusedDate === null) {
19
+ if (focusableDate === null) {
16
20
  return;
17
21
  }
18
22
  switch (event.keyCode) {
23
+ case KeyCode.space:
19
24
  case KeyCode.enter:
20
25
  event.preventDefault();
21
- if (focusedDate) {
26
+ if (focusableDate) {
22
27
  onFocusDate(null);
23
- onSelectDate(focusedDate);
28
+ onSelectDate(focusableDate);
24
29
  }
25
30
  return;
26
31
  case KeyCode.right:
27
32
  event.preventDefault();
28
- updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, function (date) { return addDays(date, 1); });
33
+ updatedFocusDate = handleFocusMove(focusableDate, isDateEnabled, function (date) { return addDays(date, 1); });
29
34
  break;
30
35
  case KeyCode.left:
31
36
  event.preventDefault();
32
- updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, function (date) { return addDays(date, -1); });
37
+ updatedFocusDate = handleFocusMove(focusableDate, isDateEnabled, function (date) { return addDays(date, -1); });
33
38
  break;
34
39
  case KeyCode.up:
35
40
  event.preventDefault();
36
- updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, function (date) { return addWeeks(date, -1); });
41
+ updatedFocusDate = handleFocusMove(focusableDate, isDateEnabled, function (date) { return addWeeks(date, -1); });
37
42
  break;
38
43
  case KeyCode.down:
39
44
  event.preventDefault();
40
- updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, function (date) { return addWeeks(date, 1); });
45
+ updatedFocusDate = handleFocusMove(focusableDate, isDateEnabled, function (date) { return addWeeks(date, 1); });
41
46
  break;
42
47
  default:
43
48
  return;
@@ -47,15 +52,51 @@ var Grid = function (_a) {
47
52
  }
48
53
  onFocusDate(updatedFocusDate);
49
54
  };
55
+ // The focused date changes as a feedback to keyboard navigation in the grid.
56
+ // Once changed, the corresponding day button needs to receive the actual focus.
57
+ useEffectOnUpdate(function () {
58
+ if (focusedDate && focusedDateRef.current) {
59
+ focusedDateRef.current.focus();
60
+ }
61
+ }, [focusedDate]);
50
62
  var weeks = useMemo(function () { return getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }); }, [baseDate, startOfWeek]);
51
- return (React.createElement("div", null,
52
- React.createElement("div", { className: styles['calendar-day-names'] }, rotateDayIndexes(startOfWeek).map(function (i) { return (React.createElement("div", { key: "day-name-".concat(i), className: styles['calendar-day-name'] }, renderDayName(locale, i))); })),
53
- React.createElement("div", { className: styles['calendar-dates'], onKeyDown: onGridKeyDownHandler }, weeks.map(function (week, weekIndex) {
54
- var isDateInLastWeek = weeks.length - 1 === weekIndex;
55
- return (React.createElement("div", { key: "week-".concat(weekIndex), className: styles['calendar-week'] }, week.map(function (date, dateIndex) {
56
- return (React.createElement(GridDay, { key: "date-".concat(weekIndex, "-").concat(dateIndex), locale: locale, baseDate: baseDate, selectedDate: selectedDate, date: date, focusedDate: focusedDate, todayAriaLabel: todayAriaLabel, onSelectDate: function (date) { return onSelectDate(date); }, isDateEnabled: isDateEnabled, isDateInLastWeek: isDateInLastWeek }));
57
- })));
58
- }))));
59
- };
60
- export default Grid;
63
+ var focusVisible = useFocusVisible();
64
+ return (React.createElement("table", { role: "none", className: styles['calendar-grid'] },
65
+ React.createElement("thead", null,
66
+ React.createElement("tr", null, rotateDayIndexes(startOfWeek).map(function (dayIndex) { return (React.createElement("th", { key: dayIndex, scope: "col", className: clsx(styles['calendar-grid-cell'], styles['calendar-day-header']) }, renderDayName(locale, dayIndex))); }))),
67
+ React.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, weeks.map(function (week, weekIndex) { return (React.createElement("tr", { key: weekIndex, className: styles['calendar-week'] }, week.map(function (date, dateIndex) {
68
+ var _a;
69
+ var isFocusable = !!focusableDate && isSameDay(date, focusableDate);
70
+ var isSelected = !!selectedDate && isSameDay(date, selectedDate);
71
+ var isEnabled = !isDateEnabled || isDateEnabled(date);
72
+ var isDateOnSameDay = isSameDay(date, new Date());
73
+ // Can't be focused.
74
+ var tabIndex = undefined;
75
+ if (isFocusable && isEnabled) {
76
+ // Next focus target.
77
+ tabIndex = 0;
78
+ }
79
+ else if (isEnabled) {
80
+ // Can be focused programmatically.
81
+ tabIndex = -1;
82
+ }
83
+ // Screen-reader announcement for the focused day.
84
+ var dayAnnouncement = getDateLabel(locale, date);
85
+ if (isDateOnSameDay) {
86
+ dayAnnouncement += '. ' + todayAriaLabel;
87
+ }
88
+ var onClick = function () {
89
+ if (isEnabled) {
90
+ onSelectDate(date);
91
+ }
92
+ };
93
+ return (React.createElement("td", __assign({ key: "".concat(weekIndex, ":").concat(dateIndex), ref: tabIndex === 0 ? focusedDateRef : undefined, role: "button", tabIndex: tabIndex, "aria-label": dayAnnouncement, "aria-current": isSelected ? 'date' : undefined, "aria-disabled": !isEnabled, onClick: onClick, className: clsx(styles['calendar-grid-cell'], styles['calendar-day'], (_a = {},
94
+ _a[styles['calendar-day-current-month']] = isSameMonth(date, baseDate),
95
+ _a[styles['calendar-day-enabled']] = isEnabled,
96
+ _a[styles['calendar-day-selected']] = isSelected,
97
+ _a[styles['calendar-day-today']] = isDateOnSameDay,
98
+ _a)) }, focusVisible),
99
+ React.createElement("span", { className: styles['day-inner'], "aria-hidden": "true" }, date.getDate())));
100
+ }))); }))));
101
+ }
61
102
  //# sourceMappingURL=index.js.map