@cloudscape-design/components 3.0.246 → 3.0.247

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 (108) hide show
  1. package/annotation-context/annotation/styles.css.js +24 -24
  2. package/annotation-context/annotation/styles.scoped.css +30 -30
  3. package/annotation-context/annotation/styles.selectors.js +24 -24
  4. package/app-layout/drawer/index.d.ts +3 -21
  5. package/app-layout/drawer/index.d.ts.map +1 -1
  6. package/app-layout/drawer/index.js +25 -5
  7. package/app-layout/drawer/index.js.map +1 -1
  8. package/app-layout/drawer/interfaces.d.ts +84 -0
  9. package/app-layout/drawer/interfaces.d.ts.map +1 -0
  10. package/app-layout/drawer/interfaces.js +2 -0
  11. package/app-layout/drawer/interfaces.js.map +1 -0
  12. package/app-layout/drawer/resizable-drawer.d.ts +4 -0
  13. package/app-layout/drawer/resizable-drawer.d.ts.map +1 -0
  14. package/app-layout/drawer/resizable-drawer.js +51 -0
  15. package/app-layout/drawer/resizable-drawer.js.map +1 -0
  16. package/app-layout/drawer/styles.css.js +10 -5
  17. package/app-layout/drawer/styles.scoped.css +46 -10
  18. package/app-layout/drawer/styles.selectors.js +10 -5
  19. package/app-layout/index.d.ts.map +1 -1
  20. package/app-layout/index.js +142 -17
  21. package/app-layout/index.js.map +1 -1
  22. package/app-layout/mobile-toolbar/index.d.ts +10 -1
  23. package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
  24. package/app-layout/mobile-toolbar/index.js +3 -2
  25. package/app-layout/mobile-toolbar/index.js.map +1 -1
  26. package/app-layout/mobile-toolbar/styles.css.js +5 -4
  27. package/app-layout/mobile-toolbar/styles.scoped.css +11 -7
  28. package/app-layout/mobile-toolbar/styles.selectors.js +5 -4
  29. package/app-layout/notifications/styles.css.js +3 -3
  30. package/app-layout/notifications/styles.scoped.css +7 -7
  31. package/app-layout/notifications/styles.selectors.js +3 -3
  32. package/app-layout/test-classes/styles.css.js +18 -13
  33. package/app-layout/test-classes/styles.scoped.css +33 -13
  34. package/app-layout/test-classes/styles.selectors.js +18 -13
  35. package/app-layout/toggles/index.d.ts.map +1 -1
  36. package/app-layout/toggles/index.js +2 -2
  37. package/app-layout/toggles/index.js.map +1 -1
  38. package/app-layout/toggles/interfaces.d.ts +3 -1
  39. package/app-layout/toggles/interfaces.d.ts.map +1 -1
  40. package/app-layout/toggles/interfaces.js.map +1 -1
  41. package/app-layout/utils/use-drawer-focus-control.d.ts +21 -0
  42. package/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -0
  43. package/app-layout/utils/use-drawer-focus-control.js +65 -0
  44. package/app-layout/utils/use-drawer-focus-control.js.map +1 -0
  45. package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
  46. package/app-layout/visual-refresh/app-bar.js +8 -6
  47. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  48. package/app-layout/visual-refresh/context.d.ts +13 -5
  49. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  50. package/app-layout/visual-refresh/context.js +104 -49
  51. package/app-layout/visual-refresh/context.js.map +1 -1
  52. package/app-layout/visual-refresh/drawers.d.ts +47 -0
  53. package/app-layout/visual-refresh/drawers.d.ts.map +1 -0
  54. package/app-layout/visual-refresh/drawers.js +127 -0
  55. package/app-layout/visual-refresh/drawers.js.map +1 -0
  56. package/app-layout/visual-refresh/header.js +2 -2
  57. package/app-layout/visual-refresh/header.js.map +1 -1
  58. package/app-layout/visual-refresh/index.d.ts.map +1 -1
  59. package/app-layout/visual-refresh/index.js +3 -1
  60. package/app-layout/visual-refresh/index.js.map +1 -1
  61. package/app-layout/visual-refresh/layout.d.ts.map +1 -1
  62. package/app-layout/visual-refresh/layout.js +5 -42
  63. package/app-layout/visual-refresh/layout.js.map +1 -1
  64. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  65. package/app-layout/visual-refresh/main.js +2 -3
  66. package/app-layout/visual-refresh/main.js.map +1 -1
  67. package/app-layout/visual-refresh/navigation.js +2 -2
  68. package/app-layout/visual-refresh/navigation.js.map +1 -1
  69. package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
  70. package/app-layout/visual-refresh/notifications.js +2 -2
  71. package/app-layout/visual-refresh/notifications.js.map +1 -1
  72. package/app-layout/visual-refresh/split-panel.js +2 -2
  73. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  74. package/app-layout/visual-refresh/styles.css.js +71 -61
  75. package/app-layout/visual-refresh/styles.scoped.css +437 -229
  76. package/app-layout/visual-refresh/styles.selectors.js +71 -61
  77. package/app-layout/visual-refresh/tools.d.ts.map +1 -1
  78. package/app-layout/visual-refresh/tools.js +7 -3
  79. package/app-layout/visual-refresh/tools.js.map +1 -1
  80. package/app-layout/visual-refresh/trigger-button.d.ts +4 -3
  81. package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  82. package/app-layout/visual-refresh/trigger-button.js +5 -4
  83. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  84. package/area-chart/internal.js +1 -1
  85. package/area-chart/internal.js.map +1 -1
  86. package/flashbar/styles.css.js +45 -45
  87. package/flashbar/styles.scoped.css +169 -169
  88. package/flashbar/styles.selectors.js +45 -45
  89. package/internal/base-component/styles.scoped.css +24 -0
  90. package/internal/environment.js +1 -1
  91. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  92. package/internal/generated/custom-css-properties/index.js +31 -30
  93. package/internal/generated/custom-css-properties/index.js.map +1 -1
  94. package/internal/generated/styles/tokens.d.ts +2 -0
  95. package/internal/generated/styles/tokens.js +2 -0
  96. package/internal/generated/theming/index.cjs +140 -0
  97. package/internal/generated/theming/index.js +140 -0
  98. package/internal/manifest.json +1 -1
  99. package/mixed-line-bar-chart/internal.js +1 -1
  100. package/mixed-line-bar-chart/internal.js.map +1 -1
  101. package/package.json +1 -1
  102. package/pie-chart/index.js +1 -1
  103. package/pie-chart/index.js.map +1 -1
  104. package/space-between/internal.js +1 -1
  105. package/space-between/internal.js.map +1 -1
  106. package/space-between/styles.css.js +20 -28
  107. package/space-between/styles.scoped.css +37 -101
  108. package/space-between/styles.selectors.js +20 -28
@@ -0,0 +1,127 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React, { useRef } from 'react';
4
+ import clsx from 'clsx';
5
+ import customCssProps from '../../internal/generated/custom-css-properties';
6
+ import { InternalButton } from '../../button/internal';
7
+ import SplitPanel from './split-panel';
8
+ import TriggerButton from './trigger-button';
9
+ import { useAppLayoutInternals } from './context';
10
+ import splitPanelStyles from '../../split-panel/styles.css.js';
11
+ import styles from './styles.css.js';
12
+ import testutilStyles from '../test-classes/styles.css.js';
13
+ /**
14
+ * The Drawers root component is mounted in the AppLayout index file. It will only
15
+ * render if the drawers are defined, and it will take over the mounting of and
16
+ * rendering of the Tools and SplitPanel (side position) if they exist. If drawers
17
+ * do not exist then the Tools and SplitPanel will be handled by the Tools component.
18
+ */
19
+ export default function Drawers() {
20
+ const { drawers, hasDrawerViewportOverlay, hasOpenDrawer, isNavigationOpen, navigationHide } = useAppLayoutInternals();
21
+ const isUnfocusable = hasDrawerViewportOverlay && isNavigationOpen && !navigationHide;
22
+ if (!drawers) {
23
+ return null;
24
+ }
25
+ return (React.createElement("div", { className: clsx(styles['drawers-container'], {
26
+ [styles['has-open-drawer']]: hasOpenDrawer,
27
+ [styles.unfocusable]: isUnfocusable,
28
+ }) },
29
+ React.createElement(SplitPanel.Side, null),
30
+ React.createElement(ActiveDrawer, null),
31
+ React.createElement(DesktopTriggers, null)));
32
+ }
33
+ /**
34
+ * The ActiveDrawer component will render either the drawer content that corresponds
35
+ * to the activeDrawerId or the Tools content if it exists and isToolsOpen is true.
36
+ * The aria labels, click handling, and focus handling will be updated dynamically
37
+ * based on the active drawer or tools content.
38
+ */
39
+ function ActiveDrawer() {
40
+ var _a, _b, _c;
41
+ const { activeDrawerId, activeDrawerWidth, ariaLabels, drawers, drawersRefs, handleDrawersClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, isNavigationOpen, isToolsOpen, navigationHide, tools, toolsRefs, } = useAppLayoutInternals();
42
+ const activeDrawer = (_a = drawers === null || drawers === void 0 ? void 0 : drawers.items.find((item) => item.id === activeDrawerId)) !== null && _a !== void 0 ? _a : null;
43
+ const computedAriaLabels = {
44
+ closeButton: activeDrawerId ? (_b = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.closeButton : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose,
45
+ content: activeDrawerId ? (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.content : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools,
46
+ };
47
+ const isHidden = !activeDrawerId && !isToolsOpen;
48
+ const isUnfocusable = isHidden || (hasDrawerViewportOverlay && isNavigationOpen && !navigationHide);
49
+ return (React.createElement("aside", { "aria-hidden": isHidden, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, {
50
+ [styles['is-drawer-open']]: activeDrawerId || isToolsOpen,
51
+ [styles.unfocusable]: isUnfocusable,
52
+ [testutilStyles['active-drawer']]: activeDrawerId,
53
+ [testutilStyles.tools]: isToolsOpen,
54
+ }), style: Object.assign({}, (!isMobile && activeDrawerWidth && { [customCssProps.activeDrawerWidth]: `${activeDrawerWidth}px` })) },
55
+ React.createElement("div", { className: clsx(styles['drawer-close-button']) },
56
+ React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
57
+ [testutilStyles['active-drawer-close-button']]: activeDrawerId,
58
+ [testutilStyles['tools-close']]: isToolsOpen,
59
+ }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => (activeDrawerId ? handleDrawersClick(activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : null) : handleToolsClick(false)), ref: isToolsOpen ? toolsRefs.close : drawersRefs.close, variant: "icon" })),
60
+ React.createElement("div", { className: styles['drawer-content'] },
61
+ activeDrawerId && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content),
62
+ isToolsOpen && tools)));
63
+ }
64
+ /**
65
+ * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the
66
+ * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be
67
+ * tracked by the previousActiveDrawerId property in order to appropriately apply
68
+ * the ref required to manage focus control.
69
+ */
70
+ function DesktopTriggers() {
71
+ const { activeDrawerId, ariaLabels, drawers, drawersRefs, drawersTriggerCount, handleDrawersClick, handleSplitPanelClick, handleToolsClick, hasOpenDrawer, isMobile, isSplitPanelOpen, isToolsOpen, splitPanel, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, tools, toolsHide, toolsRefs, } = useAppLayoutInternals();
72
+ const hasMultipleTriggers = drawersTriggerCount > 1;
73
+ const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;
74
+ const previousActiveDrawerId = useRef(activeDrawerId);
75
+ if (activeDrawerId) {
76
+ previousActiveDrawerId.current = activeDrawerId;
77
+ }
78
+ if (isMobile) {
79
+ return null;
80
+ }
81
+ return (React.createElement("aside", { className: clsx(styles['drawers-desktop-triggers-container'], testutilStyles['drawers-desktop-triggers-container'], {
82
+ [styles['has-multiple-triggers']]: hasMultipleTriggers,
83
+ [styles['has-open-drawer']]: hasOpenDrawer,
84
+ }) },
85
+ React.createElement("div", { className: clsx(styles['drawers-trigger-content'], {
86
+ [styles['has-multiple-triggers']]: hasMultipleTriggers,
87
+ [styles['has-open-drawer']]: hasOpenDrawer,
88
+ }) },
89
+ !toolsHide && tools && (React.createElement(TriggerButton, { ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle, className: clsx(styles['drawers-trigger'], testutilStyles['tools-toggle']), iconName: "status-info", onClick: () => {
90
+ activeDrawerId && handleDrawersClick(null, true);
91
+ handleToolsClick(!isToolsOpen);
92
+ }, ref: toolsRefs.toggle, selected: isToolsOpen })),
93
+ drawers.items.map((item) => {
94
+ var _a;
95
+ return (React.createElement(TriggerButton, { ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, className: clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger']), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => {
96
+ isToolsOpen && handleToolsClick(!isToolsOpen, true);
97
+ handleDrawersClick(item.id);
98
+ }, ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined, selected: item.id === activeDrawerId }));
99
+ }),
100
+ hasSplitPanel && splitPanelToggle.displayed && (React.createElement(TriggerButton, { ariaLabel: splitPanelToggle.ariaLabel, className: clsx(styles['drawers-trigger'], splitPanelStyles['open-button']), iconName: "view-vertical", onClick: () => handleSplitPanelClick(), selected: hasSplitPanel && isSplitPanelOpen, ref: splitPanelRefs.toggle })))));
101
+ }
102
+ /**
103
+ * The MobileTriggers will be mounted inside of the AppBar component and
104
+ * only rendered when Drawers are defined in mobile viewports. The same logic
105
+ * will in the AppBar component will suppress the rendering of the legacy
106
+ * trigger button for the Tools drawer.
107
+ */
108
+ export function MobileTriggers() {
109
+ var _a;
110
+ const { activeDrawerId, ariaLabels, drawers, drawersRefs, handleDrawersClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, isToolsOpen, tools, toolsHide, toolsRefs, } = useAppLayoutInternals();
111
+ const previousActiveDrawerId = useRef(activeDrawerId);
112
+ if (activeDrawerId) {
113
+ previousActiveDrawerId.current = activeDrawerId;
114
+ }
115
+ if (!isMobile || !drawers) {
116
+ return null;
117
+ }
118
+ return (React.createElement("aside", { "aria-hidden": hasDrawerViewportOverlay, className: clsx(styles['drawers-mobile-triggers-container'], testutilStyles['drawers-mobile-triggers-container'], {
119
+ [styles.unfocusable]: hasDrawerViewportOverlay,
120
+ }) },
121
+ !toolsHide && tools && (React.createElement(InternalButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: isToolsOpen, className: testutilStyles['tools-toggle'], disabled: hasDrawerViewportOverlay, formAction: "none", iconName: "status-info", onClick: () => handleToolsClick(true), ref: toolsRefs.toggle, variant: "icon", __nativeAttributes: { 'aria-haspopup': true } })),
122
+ drawers.items.map((item) => {
123
+ var _a;
124
+ return (React.createElement(InternalButton, { ariaExpanded: item.id === activeDrawerId, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, className: testutilStyles['drawers-trigger'], disabled: hasDrawerViewportOverlay, formAction: "none", iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => handleDrawersClick(item.id), ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined, variant: "icon", __nativeAttributes: { 'aria-haspopup': true } }));
125
+ })));
126
+ }
127
+ //# sourceMappingURL=drawers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawers.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAiC3D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,MAAM,EAAE,OAAO,EAAE,wBAAwB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ACI,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { IconProps } from '../../icon/interfaces';\nimport { InternalButton } from '../../button/internal';\nimport { NonCancelableEventHandler } from '../../internal/events';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\nimport { useAppLayoutInternals } from './context';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport interface DrawersProps {\n activeDrawerId?: string;\n items: ReadonlyArray<DrawersProps.Drawer>;\n onChange?: NonCancelableEventHandler<DrawersProps.ChangeDetail>;\n}\n\nnamespace DrawersProps {\n export interface Drawer {\n ariaLabels?: Labels;\n content: React.ReactNode;\n id: string;\n trigger: Trigger;\n }\n\n export interface ChangeDetail {\n activeDrawerId: string | null;\n }\n\n interface Labels {\n closeButton?: string;\n content?: string;\n triggerButton?: string;\n resizeHandle?: string;\n }\n interface Trigger {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n iconUrl?: string;\n }\n}\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const { drawers, hasDrawerViewportOverlay, hasOpenDrawer, isNavigationOpen, navigationHide } =\n useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && isNavigationOpen && !navigationHide;\n\n if (!drawers) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['drawers-container'], {\n [styles['has-open-drawer']]: hasOpenDrawer,\n [styles.unfocusable]: isUnfocusable,\n })}\n >\n <SplitPanel.Side />\n <ActiveDrawer />\n <DesktopTriggers />\n </div>\n );\n}\n\n/**\n * The ActiveDrawer component will render either the drawer content that corresponds\n * to the activeDrawerId or the Tools content if it exists and isToolsOpen is true.\n * The aria labels, click handling, and focus handling will be updated dynamically\n * based on the active drawer or tools content.\n */\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n activeDrawerWidth,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n isNavigationOpen,\n isToolsOpen,\n navigationHide,\n tools,\n toolsRefs,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.items.find((item: any) => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.content : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId && !isToolsOpen;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && isNavigationOpen && !navigationHide);\n\n return (\n <aside\n aria-hidden={isHidden}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [styles['is-drawer-open']]: activeDrawerId || isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['active-drawer']]: activeDrawerId,\n [testutilStyles.tools]: isToolsOpen,\n })}\n style={{\n ...(!isMobile && activeDrawerWidth && { [customCssProps.activeDrawerWidth]: `${activeDrawerWidth}px` }),\n }}\n >\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n [testutilStyles['tools-close']]: isToolsOpen,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => (activeDrawerId ? handleDrawersClick(activeDrawerId ?? null) : handleToolsClick(false))}\n ref={isToolsOpen ? toolsRefs.close : drawersRefs.close}\n variant=\"icon\"\n />\n </div>\n\n <div className={styles['drawer-content']}>\n {activeDrawerId && activeDrawer?.content}\n {isToolsOpen && tools}\n </div>\n </aside>\n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n handleToolsClick,\n hasOpenDrawer,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanel,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsHide,\n toolsRefs,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n if (isMobile) {\n return null;\n }\n\n return (\n <aside\n className={clsx(\n styles['drawers-desktop-triggers-container'],\n testutilStyles['drawers-desktop-triggers-container'],\n {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n }\n )}\n >\n <div\n className={clsx(styles['drawers-trigger-content'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n >\n {!toolsHide && tools && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n className={clsx(styles['drawers-trigger'], testutilStyles['tools-toggle'])}\n iconName=\"status-info\"\n onClick={() => {\n activeDrawerId && handleDrawersClick(null, true);\n handleToolsClick(!isToolsOpen);\n }}\n ref={toolsRefs.toggle}\n selected={isToolsOpen}\n />\n )}\n\n {drawers.items.map((item: DrawersProps.Drawer) => (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'])}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n key={item.id}\n onClick={() => {\n isToolsOpen && handleToolsClick(!isToolsOpen, true);\n handleDrawersClick(item.id);\n }}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n selected={item.id === activeDrawerId}\n />\n ))}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n className={clsx(styles['drawers-trigger'], splitPanelStyles['open-button'])}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n />\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n isToolsOpen,\n tools,\n toolsHide,\n toolsRefs,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n if (!isMobile || !drawers) {\n return null;\n }\n\n return (\n <aside\n aria-hidden={hasDrawerViewportOverlay}\n className={clsx(\n styles['drawers-mobile-triggers-container'],\n testutilStyles['drawers-mobile-triggers-container'],\n {\n [styles.unfocusable]: hasDrawerViewportOverlay,\n }\n )}\n >\n {!toolsHide && tools && (\n <InternalButton\n ariaLabel={ariaLabels?.toolsToggle ?? undefined}\n ariaExpanded={isToolsOpen}\n className={testutilStyles['tools-toggle']}\n disabled={hasDrawerViewportOverlay}\n formAction=\"none\"\n iconName=\"status-info\"\n onClick={() => handleToolsClick(true)}\n ref={toolsRefs.toggle}\n variant=\"icon\"\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n )}\n\n {drawers.items.map((item: DrawersProps.Drawer) => (\n <InternalButton\n ariaExpanded={item.id === activeDrawerId}\n ariaLabel={item.ariaLabels?.triggerButton}\n className={testutilStyles['drawers-trigger']}\n disabled={hasDrawerViewportOverlay}\n formAction=\"none\"\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n variant=\"icon\"\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n ))}\n </aside>\n );\n}\n"]}
@@ -9,14 +9,14 @@ import styles from './styles.css.js';
9
9
  * that the design tokens used are overridden with the appropriate values.
10
10
  */
11
11
  export default function Header() {
12
- const { breadcrumbs, contentHeader, hasNotificationsContent, isMobile, isAnyPanelOpen } = useAppLayoutInternals();
12
+ const { breadcrumbs, contentHeader, hasDrawerViewportOverlay, hasNotificationsContent } = useAppLayoutInternals();
13
13
  if (!contentHeader) {
14
14
  return null;
15
15
  }
16
16
  return (React.createElement("header", { className: clsx(styles.content, {
17
17
  [styles['has-breadcrumbs']]: breadcrumbs,
18
18
  [styles['has-notifications-content']]: hasNotificationsContent,
19
- [styles.unfocusable]: isMobile && isAnyPanelOpen,
19
+ [styles.unfocusable]: hasDrawerViewportOverlay,
20
20
  }, 'awsui-context-content-header') }, contentHeader));
21
21
  }
22
22
  //# sourceMappingURL=header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/header.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM;IAC5B,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,uBAAuB,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAElH,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,gCACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO,EACd;YACE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW;YACxC,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,uBAAuB;YAC9D,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,IAAI,cAAc;SACjD,EACD,8BAA8B,CAC/B,IAEA,aAAa,CACP,CACV,CAAC;AACJ,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 { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\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 Header() {\n const { breadcrumbs, contentHeader, hasNotificationsContent, isMobile, isAnyPanelOpen } = useAppLayoutInternals();\n\n if (!contentHeader) {\n return null;\n }\n\n return (\n <header\n className={clsx(\n styles.content,\n {\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles.unfocusable]: isMobile && isAnyPanelOpen,\n },\n 'awsui-context-content-header'\n )}\n >\n {contentHeader}\n </header>\n );\n}\n"]}
1
+ {"version":3,"file":"header.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/header.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM;IAC5B,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAElH,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,gCACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO,EACd;YACE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW;YACxC,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,uBAAuB;YAC9D,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,wBAAwB;SAC/C,EACD,8BAA8B,CAC/B,IAEA,aAAa,CACP,CACV,CAAC;AACJ,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 { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\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 Header() {\n const { breadcrumbs, contentHeader, hasDrawerViewportOverlay, hasNotificationsContent } = useAppLayoutInternals();\n\n if (!contentHeader) {\n return null;\n }\n\n return (\n <header\n className={clsx(\n styles.content,\n {\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles.unfocusable]: hasDrawerViewportOverlay,\n },\n 'awsui-context-content-header'\n )}\n >\n {contentHeader}\n </header>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAW/C;;;;;;;GAOG;AACH,QAAA,MAAM,gBAAgB,2FAiCpB,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAY/C;;;;;;;GAOG;AACH,QAAA,MAAM,gBAAgB,2FAmCpB,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -4,6 +4,7 @@ import React from 'react';
4
4
  import AppBar from './app-bar';
5
5
  import { AppLayoutInternalsProvider } from './context';
6
6
  import Background from './background';
7
+ import Drawers from './drawers';
7
8
  import Header from './header';
8
9
  import Layout from './layout';
9
10
  import Main from './main';
@@ -34,7 +35,8 @@ const AppLayoutWithRef = React.forwardRef(function AppLayout(props, ref) {
34
35
  React.createElement(Main, null),
35
36
  React.createElement(SplitPanel.Bottom, null),
36
37
  React.createElement(Tools, null,
37
- React.createElement(SplitPanel.Side, null))))));
38
+ React.createElement(SplitPanel.Side, null)),
39
+ React.createElement(Drawers, null)))));
38
40
  });
39
41
  export default AppLayoutWithRef;
40
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,SAAS,CAC1D,KAAqB,EACrB,GAAkC;IAElC,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAE7B,OAAO,CACL,oBAAC,0BAA0B,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG;QAC7C,oBAAC,UAAU;YACT,oBAAC,MAAM;gBACL,oBAAC,UAAU,OAAG;gBAEd,oBAAC,UAAU,OAAG;gBAEb,QAAQ,IAAI,oBAAC,MAAM,OAAG;gBAEvB,oBAAC,aAAa,OAAG;gBAEhB,CAAC,QAAQ,IAAI,oBAAC,MAAM,OAAG;gBAExB,oBAAC,MAAM,OAAG;gBAEV,oBAAC,IAAI,OAAG;gBAER,oBAAC,UAAU,CAAC,MAAM,OAAG;gBAErB,oBAAC,KAAK;oBACJ,oBAAC,UAAU,CAAC,IAAI,OAAG,CACb,CACD,CACE,CACc,CAC9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport AppBar from './app-bar';\nimport { AppLayoutInternalsProvider } from './context';\nimport { AppLayoutProps } from '../interfaces';\nimport Background from './background';\nimport Header from './header';\nimport Layout from './layout';\nimport Main from './main';\nimport Navigation from './navigation';\nimport Notifications from './notifications';\nimport SplitPanel from './split-panel';\nimport Tools from './tools';\nimport { useMobile } from '../../internal/hooks/use-mobile';\n\n/**\n * In mobile viewports the AppBar position changes to sticky and is placed\n * above the notifications. This is handled by adjusting the row positions\n * in CSS for the AppBar and Notifications components relative to the grid\n * definition in the Layout component. In order to keep alignment between\n * the visual ordering and logical ordering of the document the logical order\n * of these components is also modified in the markup below.\n */\nconst AppLayoutWithRef = React.forwardRef(function AppLayout(\n props: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n) {\n const isMobile = useMobile();\n\n return (\n <AppLayoutInternalsProvider {...props} ref={ref}>\n <SplitPanel>\n <Layout>\n <Background />\n\n <Navigation />\n\n {isMobile && <AppBar />}\n\n <Notifications />\n\n {!isMobile && <AppBar />}\n\n <Header />\n\n <Main />\n\n <SplitPanel.Bottom />\n\n <Tools>\n <SplitPanel.Side />\n </Tools>\n </Layout>\n </SplitPanel>\n </AppLayoutInternalsProvider>\n );\n});\n\nexport default AppLayoutWithRef;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,SAAS,CAC1D,KAAqB,EACrB,GAAkC;IAElC,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAE7B,OAAO,CACL,oBAAC,0BAA0B,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG;QAC7C,oBAAC,UAAU;YACT,oBAAC,MAAM;gBACL,oBAAC,UAAU,OAAG;gBAEd,oBAAC,UAAU,OAAG;gBAEb,QAAQ,IAAI,oBAAC,MAAM,OAAG;gBAEvB,oBAAC,aAAa,OAAG;gBAEhB,CAAC,QAAQ,IAAI,oBAAC,MAAM,OAAG;gBAExB,oBAAC,MAAM,OAAG;gBAEV,oBAAC,IAAI,OAAG;gBAER,oBAAC,UAAU,CAAC,MAAM,OAAG;gBAErB,oBAAC,KAAK;oBACJ,oBAAC,UAAU,CAAC,IAAI,OAAG,CACb;gBAER,oBAAC,OAAO,OAAG,CACJ,CACE,CACc,CAC9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport AppBar from './app-bar';\nimport { AppLayoutInternalsProvider } from './context';\nimport { AppLayoutProps } from '../interfaces';\nimport Background from './background';\nimport Drawers from './drawers';\nimport Header from './header';\nimport Layout from './layout';\nimport Main from './main';\nimport Navigation from './navigation';\nimport Notifications from './notifications';\nimport SplitPanel from './split-panel';\nimport Tools from './tools';\nimport { useMobile } from '../../internal/hooks/use-mobile';\n\n/**\n * In mobile viewports the AppBar position changes to sticky and is placed\n * above the notifications. This is handled by adjusting the row positions\n * in CSS for the AppBar and Notifications components relative to the grid\n * definition in the Layout component. In order to keep alignment between\n * the visual ordering and logical ordering of the document the logical order\n * of these components is also modified in the markup below.\n */\nconst AppLayoutWithRef = React.forwardRef(function AppLayout(\n props: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n) {\n const isMobile = useMobile();\n\n return (\n <AppLayoutInternalsProvider {...props} ref={ref}>\n <SplitPanel>\n <Layout>\n <Background />\n\n <Navigation />\n\n {isMobile && <AppBar />}\n\n <Notifications />\n\n {!isMobile && <AppBar />}\n\n <Header />\n\n <Main />\n\n <SplitPanel.Bottom />\n\n <Tools>\n <SplitPanel.Side />\n </Tools>\n\n <Drawers />\n </Layout>\n </SplitPanel>\n </AppLayoutInternalsProvider>\n );\n});\n\nexport default AppLayoutWithRef;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,WAAW;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,eAwEvD"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,WAAW;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,eAgEvD"}
@@ -2,10 +2,10 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
4
  import clsx from 'clsx';
5
+ import customCssProps from '../../internal/generated/custom-css-properties';
5
6
  import { useAppLayoutInternals } from './context';
6
7
  import styles from './styles.css.js';
7
8
  import testutilStyles from '../test-classes/styles.css.js';
8
- import customCssProps from '../../internal/generated/custom-css-properties';
9
9
  /**
10
10
  * The layoutElement ref will be used by the resize observers to calculate the offset from
11
11
  * the top and bottom of the viewport based on the header and footer elements. This is to
@@ -13,11 +13,11 @@ import customCssProps from '../../internal/generated/custom-css-properties';
13
13
  * cumulative heights.
14
14
  */
15
15
  export default function Layout({ children }) {
16
- const { contentHeader, contentType, disableBodyScroll, disableContentHeaderOverlap, dynamicOverlapHeight, footerHeight, hasNotificationsContent, headerHeight, isNavigationOpen, isSplitPanelOpen, isToolsOpen, layoutElement, layoutWidth, mainOffsetLeft, maxContentWidth, minContentWidth, navigationHide, notificationsHeight, splitPanelPosition, stickyNotifications, splitPanelDisplayed, toolsHide, } = useAppLayoutInternals();
17
- const isOverlapDisabled = getOverlapDisabled(dynamicOverlapHeight, contentHeader, disableContentHeaderOverlap);
16
+ const { contentHeader, contentType, disableBodyScroll, disableContentHeaderOverlap, drawersTriggerCount, dynamicOverlapHeight, footerHeight, hasNotificationsContent, hasOpenDrawer, headerHeight, isNavigationOpen, layoutElement, layoutWidth, mainOffsetLeft, maxContentWidth, minContentWidth, navigationHide, notificationsHeight, splitPanelPosition, stickyNotifications, splitPanelDisplayed, } = useAppLayoutInternals();
18
17
  // Content gaps on the left and right are used with the minmax function in the CSS grid column definition
19
- const hasContentGapLeft = getContentGapLeft(isNavigationOpen, navigationHide);
20
- const hasContentGapRight = getContentGapRight(splitPanelPosition, isSplitPanelOpen, isToolsOpen, splitPanelDisplayed, toolsHide);
18
+ const hasContentGapLeft = isNavigationOpen || navigationHide;
19
+ const hasContentGapRight = drawersTriggerCount <= 0 || hasOpenDrawer;
20
+ const isOverlapDisabled = getOverlapDisabled(dynamicOverlapHeight, contentHeader, disableContentHeaderOverlap);
21
21
  return (React.createElement("main", { className: clsx(styles.layout, styles[`content-type-${contentType}`], styles[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : 'bottom'}`], {
22
22
  [styles['disable-body-scroll']]: disableBodyScroll,
23
23
  [testutilStyles['disable-body-scroll-root']]: disableBodyScroll,
@@ -30,43 +30,6 @@ export default function Layout({ children }) {
30
30
  }, testutilStyles.root), ref: layoutElement, style: Object.assign(Object.assign(Object.assign(Object.assign({ [customCssProps.headerHeight]: `${headerHeight}px`, [customCssProps.footerHeight]: `${footerHeight}px`, [customCssProps.layoutWidth]: `${layoutWidth}px`, [customCssProps.mainOffsetLeft]: `${mainOffsetLeft}px` }, (maxContentWidth && { [customCssProps.maxContentWidth]: `${maxContentWidth}px` })), (minContentWidth && { [customCssProps.minContentWidth]: `${minContentWidth}px` })), { [customCssProps.notificationsHeight]: `${notificationsHeight}px` }), (!isOverlapDisabled &&
31
31
  dynamicOverlapHeight > 0 && { [customCssProps.overlapHeight]: `${dynamicOverlapHeight}px` })) }, children));
32
32
  }
33
- /**
34
- * When the Navigation and Tools are present the grid definition has the center column
35
- * touch the first and last columns with no gap. The forms with the circular buttons
36
- * for Navigation and Tools have internal padding which creates the necessary
37
- * horizontal space when the drawers are closed. The remaining conditions below
38
- * determine the necessity of utilizing the content gap left property to create
39
- * horizontal space between the center column and its adjacent siblings.
40
- */
41
- function getContentGapRight(splitPanelPosition, isSplitPanelOpen, isToolsOpen, splitPanelDisplayed, toolsHide) {
42
- let hasContentGapRight = false;
43
- // Main is touching the edge of the Layout and needs a content gap
44
- if (!splitPanelDisplayed && toolsHide) {
45
- hasContentGapRight = true;
46
- }
47
- // Main is touching the Tools drawer and needs a content gap
48
- if ((!splitPanelDisplayed || !isSplitPanelOpen) && !toolsHide && isToolsOpen) {
49
- hasContentGapRight = true;
50
- }
51
- // Main is touching the edge of the Layout and needs a content gap
52
- if (splitPanelDisplayed && splitPanelPosition === 'bottom' && (isToolsOpen || toolsHide)) {
53
- hasContentGapRight = true;
54
- }
55
- // Main is touching the Split Panel drawer and needs a content gap
56
- if (splitPanelDisplayed && isSplitPanelOpen && splitPanelPosition === 'side') {
57
- hasContentGapRight = true;
58
- }
59
- return hasContentGapRight;
60
- }
61
- /**
62
- * Additional function to determine whether or not a content gap is needed
63
- * on the left (see the getContentGapRight function). The same render logic applies
64
- * regarding the center column touching an adjacent sibling but the only
65
- * component state that needs to be tracked is the Navigation.
66
- */
67
- function getContentGapLeft(isNavigationOpen, navigationHide) {
68
- return isNavigationOpen || navigationHide ? true : false;
69
- }
70
33
  /**
71
34
  * Determine whether the overlap between the contentHeader and content slots should be disabled.
72
35
  * The disableContentHeaderOverlap property is absolute and will always disable the overlap
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/layout.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAM5E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAe;IACtD,MAAM,EACJ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,GACV,GAAG,qBAAqB,EAAE,CAAC;IAE5B,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,oBAAoB,EAAE,aAAa,EAAE,2BAA2B,CAAC,CAAC;IAE/G,yGAAyG;IACzG,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC9E,MAAM,kBAAkB,GAAG,kBAAkB,CAC3C,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,MAAM,EACb,MA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a,IAAI,oBAAoB,IAAI,CAAC,EAAE;QACtD,iBAAiB,GAAG,IAAI,CAAC;KAC1B;IAED,OAAO,iBAAiB,CAAC;AAC3B,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 { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface LayoutProps {\n children: React.ReactNode;\n}\n\n/**\n * The layoutElement ref will be used by the resize observers to calculate the offset from\n * the top and bottom of the viewport based on the header and footer elements. This is to\n * ensure the Layout component minimum height will fill 100% of the viewport less those\n * cumulative heights.\n */\nexport default function Layout({ children }: LayoutProps) {\n const {\n contentHeader,\n contentType,\n disableBodyScroll,\n disableContentHeaderOverlap,\n dynamicOverlapHeight,\n footerHeight,\n hasNotificationsContent,\n headerHeight,\n isNavigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n notificationsHeight,\n splitPanelPosition,\n stickyNotifications,\n splitPanelDisplayed,\n toolsHide,\n } = useAppLayoutInternals();\n\n const isOverlapDisabled = getOverlapDisabled(dynamicOverlapHeight, contentHeader, disableContentHeaderOverlap);\n\n // Content gaps on the left and right are used with the minmax function in the CSS grid column definition\n const hasContentGapLeft = getContentGapLeft(isNavigationOpen, navigationHide);\n const hasContentGapRight = getContentGapRight(\n splitPanelPosition,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanelDisplayed,\n toolsHide\n );\n\n return (\n <main\n className={clsx(\n styles.layout,\n styles[`content-type-${contentType}`],\n styles[`split-panel-position-${splitPanelPosition ?? 'bottom'}`],\n {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [testutilStyles['disable-body-scroll-root']]: disableBodyScroll,\n [styles['has-content-gap-left']]: hasContentGapLeft,\n [styles['has-content-gap-right']]: hasContentGapRight,\n [styles['has-max-content-width']]: maxContentWidth && maxContentWidth > 0,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['has-sticky-notifications']]: stickyNotifications && hasNotificationsContent,\n [styles['is-overlap-disabled']]: isOverlapDisabled,\n },\n testutilStyles.root\n )}\n ref={layoutElement}\n style={{\n [customCssProps.headerHeight]: `${headerHeight}px`,\n [customCssProps.footerHeight]: `${footerHeight}px`,\n [customCssProps.layoutWidth]: `${layoutWidth}px`,\n [customCssProps.mainOffsetLeft]: `${mainOffsetLeft}px`,\n ...(maxContentWidth && { [customCssProps.maxContentWidth]: `${maxContentWidth}px` }),\n ...(minContentWidth && { [customCssProps.minContentWidth]: `${minContentWidth}px` }),\n [customCssProps.notificationsHeight]: `${notificationsHeight}px`,\n ...(!isOverlapDisabled &&\n dynamicOverlapHeight > 0 && { [customCssProps.overlapHeight]: `${dynamicOverlapHeight}px` }),\n }}\n >\n {children}\n </main>\n );\n}\n\n/**\n * When the Navigation and Tools are present the grid definition has the center column\n * touch the first and last columns with no gap. The forms with the circular buttons\n * for Navigation and Tools have internal padding which creates the necessary\n * horizontal space when the drawers are closed. The remaining conditions below\n * determine the necessity of utilizing the content gap left property to create\n * horizontal space between the center column and its adjacent siblings.\n */\nfunction getContentGapRight(\n splitPanelPosition: AppLayoutProps.SplitPanelPosition,\n isSplitPanelOpen: boolean | undefined,\n isToolsOpen: boolean,\n splitPanelDisplayed: boolean,\n toolsHide?: boolean\n) {\n let hasContentGapRight = false;\n\n // Main is touching the edge of the Layout and needs a content gap\n if (!splitPanelDisplayed && toolsHide) {\n hasContentGapRight = true;\n }\n\n // Main is touching the Tools drawer and needs a content gap\n if ((!splitPanelDisplayed || !isSplitPanelOpen) && !toolsHide && isToolsOpen) {\n hasContentGapRight = true;\n }\n\n // Main is touching the edge of the Layout and needs a content gap\n if (splitPanelDisplayed && splitPanelPosition === 'bottom' && (isToolsOpen || toolsHide)) {\n hasContentGapRight = true;\n }\n\n // Main is touching the Split Panel drawer and needs a content gap\n if (splitPanelDisplayed && isSplitPanelOpen && splitPanelPosition === 'side') {\n hasContentGapRight = true;\n }\n\n return hasContentGapRight;\n}\n\n/**\n * Additional function to determine whether or not a content gap is needed\n * on the left (see the getContentGapRight function). The same render logic applies\n * regarding the center column touching an adjacent sibling but the only\n * component state that needs to be tracked is the Navigation.\n */\nfunction getContentGapLeft(isNavigationOpen: boolean, navigationHide?: boolean) {\n return isNavigationOpen || navigationHide ? true : false;\n}\n\n/**\n * Determine whether the overlap between the contentHeader and content slots should be disabled.\n * The disableContentHeaderOverlap property is absolute and will always disable the overlap\n * if it is set to true. If there is no contentHeader then the overlap should be disabled\n * unless there is a dynamicOverlapHeight. The dynamicOverlapHeight property is set by a\n * component in the content slot that needs to manually control the overlap height. Components\n * such as the Table (full page variant), Wizard, ContentLayout use this property and will\n * retain the overlap even if there is nothing rendered in the contentHeader slot.\n */\nfunction getOverlapDisabled(\n dynamicOverlapHeight: number,\n contentHeader?: React.ReactNode,\n disableContentHeaderOverlap?: boolean\n) {\n let isOverlapDisabled = false;\n\n if (disableContentHeaderOverlap) {\n isOverlapDisabled = true;\n } else if (!contentHeader && dynamicOverlapHeight <= 0) {\n isOverlapDisabled = true;\n }\n\n return isOverlapDisabled;\n}\n"]}
1
+ {"version":3,"file":"layout.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/layout.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAM3D;;;;;GAKG;AACH,MAAM,CAAC,OAA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F,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,iBAAiB;SACnD,EACD,cAAc,CAAC,IAAI,CACpB,EACD,GAAG,EAAE,aAAa,EAClB,KAAK,4DACH,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,GAAG,YAAY,IAAI,EAClD,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,GAAG,YAAY,IAAI,EAClD,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,GAAG,WAAW,IAAI,EAChD,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,GAAG,cAAc,IAAI,IACnD,CAAC,eAAe,IAAI,EAAE,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,GAAG,eAAe,IAAI,EAAE,CAAC,GACjF,CAAC,eAAe,IAAI,EAAE,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,GAAG,eAAe,IAAI,EAAE,CAAC,KACpF,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,GAAG,mBAAmB,IAAI,KAC7D,CAAC,CAAC,iBAAiB;YACpB,oBAAoB,GAAG,CAAC,IAAI,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,oBAAoB,IAAI,EAAE,CAAC,KAG/F,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,kBAAkB,CACzB,oBAA4B,EAC5B,aAA+B,EAC/B,2BAAqC;IAErC,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAE9B,IAAI,2BAA2B,EAAE;QAC/B,iBAAiB,GAAG,IAAI,CAAC;KAC1B;SAAM,IAAI,CAAC,aAAa,IAAI,oBAAoB,IAAI,CAAC,EAAE;QACtD,iBAAiB,GAAG,IAAI,CAAC;KAC1B;IAED,OAAO,iBAAiB,CAAC;AAC3B,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 customCssProps from '../../internal/generated/custom-css-properties';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\ninterface LayoutProps {\n children: React.ReactNode;\n}\n\n/**\n * The layoutElement ref will be used by the resize observers to calculate the offset from\n * the top and bottom of the viewport based on the header and footer elements. This is to\n * ensure the Layout component minimum height will fill 100% of the viewport less those\n * cumulative heights.\n */\nexport default function Layout({ children }: LayoutProps) {\n const {\n contentHeader,\n contentType,\n disableBodyScroll,\n disableContentHeaderOverlap,\n drawersTriggerCount,\n dynamicOverlapHeight,\n footerHeight,\n hasNotificationsContent,\n hasOpenDrawer,\n headerHeight,\n isNavigationOpen,\n layoutElement,\n layoutWidth,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n notificationsHeight,\n splitPanelPosition,\n stickyNotifications,\n splitPanelDisplayed,\n } = useAppLayoutInternals();\n\n // Content gaps on the left and right are used with the minmax function in the CSS grid column definition\n const hasContentGapLeft = isNavigationOpen || navigationHide;\n const hasContentGapRight = drawersTriggerCount <= 0 || hasOpenDrawer;\n const isOverlapDisabled = getOverlapDisabled(dynamicOverlapHeight, contentHeader, disableContentHeaderOverlap);\n\n return (\n <main\n className={clsx(\n styles.layout,\n styles[`content-type-${contentType}`],\n styles[`split-panel-position-${splitPanelPosition ?? 'bottom'}`],\n {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [testutilStyles['disable-body-scroll-root']]: disableBodyScroll,\n [styles['has-content-gap-left']]: hasContentGapLeft,\n [styles['has-content-gap-right']]: hasContentGapRight,\n [styles['has-max-content-width']]: maxContentWidth && maxContentWidth > 0,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['has-sticky-notifications']]: stickyNotifications && hasNotificationsContent,\n [styles['is-overlap-disabled']]: isOverlapDisabled,\n },\n testutilStyles.root\n )}\n ref={layoutElement}\n style={{\n [customCssProps.headerHeight]: `${headerHeight}px`,\n [customCssProps.footerHeight]: `${footerHeight}px`,\n [customCssProps.layoutWidth]: `${layoutWidth}px`,\n [customCssProps.mainOffsetLeft]: `${mainOffsetLeft}px`,\n ...(maxContentWidth && { [customCssProps.maxContentWidth]: `${maxContentWidth}px` }),\n ...(minContentWidth && { [customCssProps.minContentWidth]: `${minContentWidth}px` }),\n [customCssProps.notificationsHeight]: `${notificationsHeight}px`,\n ...(!isOverlapDisabled &&\n dynamicOverlapHeight > 0 && { [customCssProps.overlapHeight]: `${dynamicOverlapHeight}px` }),\n }}\n >\n {children}\n </main>\n );\n}\n\n/**\n * Determine whether the overlap between the contentHeader and content slots should be disabled.\n * The disableContentHeaderOverlap property is absolute and will always disable the overlap\n * if it is set to true. If there is no contentHeader then the overlap should be disabled\n * unless there is a dynamicOverlapHeight. The dynamicOverlapHeight property is set by a\n * component in the content slot that needs to manually control the overlap height. Components\n * such as the Table (full page variant), Wizard, ContentLayout use this property and will\n * retain the overlap even if there is nothing rendered in the contentHeader slot.\n */\nfunction getOverlapDisabled(\n dynamicOverlapHeight: number,\n contentHeader?: React.ReactNode,\n disableContentHeaderOverlap?: boolean\n) {\n let isOverlapDisabled = false;\n\n if (disableContentHeaderOverlap) {\n isOverlapDisabled = true;\n } else if (!contentHeader && dynamicOverlapHeight <= 0) {\n isOverlapDisabled = true;\n }\n\n return isOverlapDisabled;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/main.tsx"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,IAAI,gBAoD3B"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/main.tsx"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,IAAI,gBAkD3B"}
@@ -7,8 +7,7 @@ import customCssProps from '../../internal/generated/custom-css-properties';
7
7
  import styles from './styles.css.js';
8
8
  import testutilStyles from '../test-classes/styles.css.js';
9
9
  export default function Main() {
10
- const { breadcrumbs, content, contentHeader, contentType, disableContentPaddings, dynamicOverlapHeight, hasNotificationsContent, isNavigationOpen, isSplitPanelOpen, isToolsOpen, isMobile, isAnyPanelOpen, mainElement, splitPanelDisplayed, offsetBottom, footerHeight, splitPanelPosition, } = useAppLayoutInternals();
11
- const isUnfocusable = isMobile && isAnyPanelOpen;
10
+ const { breadcrumbs, content, contentHeader, contentType, disableContentPaddings, dynamicOverlapHeight, hasDrawerViewportOverlay, hasNotificationsContent, isNavigationOpen, isSplitPanelOpen, isToolsOpen, mainElement, splitPanelDisplayed, offsetBottom, footerHeight, splitPanelPosition, } = useAppLayoutInternals();
12
11
  const splitPanelHeight = offsetBottom - footerHeight;
13
12
  return (React.createElement("div", { className: clsx(styles.container, styles[`content-type-${contentType}`], styles[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : 'bottom'}`], {
14
13
  [styles['disable-content-paddings']]: disableContentPaddings,
@@ -20,7 +19,7 @@ export default function Main() {
20
19
  [styles['is-navigation-open']]: isNavigationOpen,
21
20
  [styles['is-tools-open']]: isToolsOpen,
22
21
  [styles['is-split-panel-open']]: isSplitPanelOpen,
23
- [styles.unfocusable]: isUnfocusable,
22
+ [styles.unfocusable]: hasDrawerViewportOverlay,
24
23
  }, testutilStyles.content), ref: mainElement, style: {
25
24
  [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`,
26
25
  } }, content));
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/main.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;A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,WAAW,EAChB,KAAK,EAAE;YACL,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,IAAI;SAC3D,IAEA,OAAO,CACJ,CACP,CAAC;AACJ,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 { useAppLayoutInternals } from './context';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Main() {\n const {\n breadcrumbs,\n content,\n contentHeader,\n contentType,\n disableContentPaddings,\n dynamicOverlapHeight,\n hasNotificationsContent,\n isNavigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n isMobile,\n isAnyPanelOpen,\n mainElement,\n splitPanelDisplayed,\n offsetBottom,\n footerHeight,\n splitPanelPosition,\n } = useAppLayoutInternals();\n\n const isUnfocusable = isMobile && isAnyPanelOpen;\n const splitPanelHeight = offsetBottom - footerHeight;\n\n return (\n <div\n className={clsx(\n styles.container,\n styles[`content-type-${contentType}`],\n styles[`split-panel-position-${splitPanelPosition ?? 'bottom'}`],\n {\n [styles['disable-content-paddings']]: disableContentPaddings,\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles['has-dynamic-overlap-height']]: dynamicOverlapHeight > 0,\n [styles['has-header']]: contentHeader,\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['is-navigation-open']]: isNavigationOpen,\n [styles['is-tools-open']]: isToolsOpen,\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n [styles.unfocusable]: isUnfocusable,\n },\n testutilStyles.content\n )}\n ref={mainElement}\n style={{\n [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`,\n }}\n >\n {content}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"main.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/main.tsx"],"names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AE,gBAAgB;YAChD,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,WAAW;YACtC,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,gBAAgB;YACjD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,wBAAwB;SAC/C,EACD,cAAc,CAAC,OAAO,CACvB,EACD,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE;YACL,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,IAAI;SAC3D,IAEA,OAAO,CACJ,CACP,CAAC;AACJ,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 { useAppLayoutInternals } from './context';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Main() {\n const {\n breadcrumbs,\n content,\n contentHeader,\n contentType,\n disableContentPaddings,\n dynamicOverlapHeight,\n hasDrawerViewportOverlay,\n hasNotificationsContent,\n isNavigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n mainElement,\n splitPanelDisplayed,\n offsetBottom,\n footerHeight,\n splitPanelPosition,\n } = useAppLayoutInternals();\n\n const splitPanelHeight = offsetBottom - footerHeight;\n\n return (\n <div\n className={clsx(\n styles.container,\n styles[`content-type-${contentType}`],\n styles[`split-panel-position-${splitPanelPosition ?? 'bottom'}`],\n {\n [styles['disable-content-paddings']]: disableContentPaddings,\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles['has-dynamic-overlap-height']]: dynamicOverlapHeight > 0,\n [styles['has-header']]: contentHeader,\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['is-navigation-open']]: isNavigationOpen,\n [styles['is-tools-open']]: isToolsOpen,\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n [styles.unfocusable]: hasDrawerViewportOverlay,\n },\n testutilStyles.content\n )}\n ref={mainElement}\n style={{\n [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`,\n }}\n >\n {content}\n </div>\n );\n}\n"]}
@@ -18,7 +18,7 @@ import customCssProps from '../../internal/generated/custom-css-properties';
18
18
  * passed through the API;
19
19
  */
20
20
  export default function Navigation() {
21
- const { ariaLabels, handleNavigationClick, isMobile, isNavigationOpen, navigation, navigationHide, navigationWidth, isToolsOpen, isAnyPanelOpen, toolsHide, navigationRefs, } = useAppLayoutInternals();
21
+ const { ariaLabels, handleNavigationClick, hasDrawerViewportOverlay, isMobile, isNavigationOpen, navigation, navigationHide, navigationWidth, isToolsOpen, toolsHide, navigationRefs, } = useAppLayoutInternals();
22
22
  if (navigationHide) {
23
23
  return null;
24
24
  }
@@ -29,7 +29,7 @@ export default function Navigation() {
29
29
  handleNavigationClick(false);
30
30
  }
31
31
  };
32
- const isUnfocusable = isMobile && isAnyPanelOpen && isToolsOpen && !toolsHide;
32
+ const isUnfocusable = hasDrawerViewportOverlay && isToolsOpen && !toolsHide;
33
33
  return (React.createElement(Transition, { in: isNavigationOpen }, (state, transitionEventsRef) => {
34
34
  var _a, _b, _c;
35
35
  return (React.createElement("div", { className: clsx(styles['navigation-container'], {
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,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,UAAU,EAA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,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,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAC3C,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,cAAc,CAAC,KAAK,GACzB,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 from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } 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 { 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 navigationRefs,\n } = useAppLayoutInternals();\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={navigationRefs.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={navigationRefs.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":"lib/default/","sources":["app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,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,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;IAChC,MAAM,EACJ,UAAU,EACV,qBAAqB,EACrB,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,GACf,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,cAAc,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,0EAA0E;IAC1E,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,WAAW,CACzB,KAAK,CAAC,MAAqB,EAC3B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAE,IAA0B,CAAC,IAAI,CACnE,CAAC;QACF,IAAI,OAAO,IAAI,QAAQ,EAAE;YACvB,qBAAqB,CAAC,KAAK,C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G,EAAE,cAAc,CAAC,MAAM,GAC1B,CACE,CACP;YAED,2CACc,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,mCAAI,SAAS,EAC/C,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,UAAU,EACjB;oBACE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,KAAK,UAAU;oBACxC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,gBAAgB;iBACjD,EACD,cAAc,CAAC,UAAU,CAC1B,EACD,GAAG,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,iBAC7C,CAAC,gBAAgB,EAC9B,OAAO,EAAE,KAAK,CAAC,EAAE;oBACf,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,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAC3C,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,cAAc,CAAC,KAAK,GACzB,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 from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } 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 { 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 hasDrawerViewportOverlay,\n isMobile,\n isNavigationOpen,\n navigation,\n navigationHide,\n navigationWidth,\n isToolsOpen,\n toolsHide,\n navigationRefs,\n } = useAppLayoutInternals();\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 = hasDrawerViewportOverlay && 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={navigationRefs.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={navigationRefs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n </div>\n )}\n </Transition>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/notifications.tsx"],"names":[],"mappings":";AAQA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,uBAsCpC"}
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/notifications.tsx"],"names":[],"mappings":";AAQA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,uBAqCpC"}
@@ -11,7 +11,7 @@ import testutilStyles from '../test-classes/styles.css.js';
11
11
  */
12
12
  export default function Notifications() {
13
13
  var _a;
14
- const { ariaLabels, hasNotificationsContent, notifications, notificationsElement, stickyNotifications, isMobile, isAnyPanelOpen, } = useAppLayoutInternals();
14
+ const { ariaLabels, hasDrawerViewportOverlay, hasNotificationsContent, notifications, notificationsElement, stickyNotifications, } = useAppLayoutInternals();
15
15
  if (!notifications) {
16
16
  return null;
17
17
  }
@@ -22,7 +22,7 @@ export default function Notifications() {
22
22
  return (React.createElement("div", { role: "region", "aria-label": (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.notifications) !== null && _a !== void 0 ? _a : undefined, className: clsx(styles.notifications, {
23
23
  [styles['has-notifications-content']]: hasNotificationsContent,
24
24
  [styles['sticky-notifications']]: stickyNotifications,
25
- [styles.unfocusable]: isMobile && isAnyPanelOpen,
25
+ [styles.unfocusable]: hasDrawerViewportOverlay,
26
26
  }, testutilStyles.notifications, 'awsui-context-content-header') },
27
27
  React.createElement("div", { ref: notificationsElement }, notifications)));
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/notifications.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa;;IACnC,MAAM,EACJ,UAAU,EACV,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,cAAc,GACf,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED;;;OAGG;IAEH,OAAO,CACL,6BACE,IAAI,EAAC,QAAQ,gBACD,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,aAAa,mCAAI,SAAS,EAClD,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,aAAa,EACpB;YACE,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,uBAAuB;YAC9D,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAAE,mBAAmB;YACrD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,IAAI,cAAc;SACjD,EACD,cAAc,CAAC,aAAa,EAC5B,8BAA8B,CAC/B;QAED,6BAAK,GAAG,EAAE,oBAAoB,IAAG,aAAa,CAAO,CACjD,CACP,CAAC;AACJ,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 { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\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 Notifications() {\n const {\n ariaLabels,\n hasNotificationsContent,\n notifications,\n notificationsElement,\n stickyNotifications,\n isMobile,\n isAnyPanelOpen,\n } = useAppLayoutInternals();\n\n if (!notifications) {\n return null;\n }\n\n /*\n The notificationsElement ref is assigned to an inner div to prevent internal bottom margin from affecting the\n calculated height, which is used for sticky elements below.\n */\n\n return (\n <div\n role=\"region\"\n aria-label={ariaLabels?.notifications ?? undefined}\n className={clsx(\n styles.notifications,\n {\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles['sticky-notifications']]: stickyNotifications,\n [styles.unfocusable]: isMobile && isAnyPanelOpen,\n },\n testutilStyles.notifications,\n 'awsui-context-content-header'\n )}\n >\n <div ref={notificationsElement}>{notifications}</div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"notifications.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/notifications.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa;;IACnC,MAAM,EACJ,UAAU,EACV,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,GACpB,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED;;;OAGG;IAEH,OAAO,CACL,6BACE,IAAI,EAAC,QAAQ,gBACD,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,aAAa,mCAAI,SAAS,EAClD,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,aAAa,EACpB;YACE,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,uBAAuB;YAC9D,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAAE,mBAAmB;YACrD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,wBAAwB;SAC/C,EACD,cAAc,CAAC,aAAa,EAC5B,8BAA8B,CAC/B;QAED,6BAAK,GAAG,EAAE,oBAAoB,IAAG,aAAa,CAAO,CACjD,CACP,CAAC;AACJ,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 { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\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 Notifications() {\n const {\n ariaLabels,\n hasDrawerViewportOverlay,\n hasNotificationsContent,\n notifications,\n notificationsElement,\n stickyNotifications,\n } = useAppLayoutInternals();\n\n if (!notifications) {\n return null;\n }\n\n /*\n The notificationsElement ref is assigned to an inner div to prevent internal bottom margin from affecting the\n calculated height, which is used for sticky elements below.\n */\n\n return (\n <div\n role=\"region\"\n aria-label={ariaLabels?.notifications ?? undefined}\n className={clsx(\n styles.notifications,\n {\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles['sticky-notifications']]: stickyNotifications,\n [styles.unfocusable]: hasDrawerViewportOverlay,\n },\n testutilStyles.notifications,\n 'awsui-context-content-header'\n )}\n >\n <div ref={notificationsElement}>{notifications}</div>\n </div>\n );\n}\n"]}
@@ -46,16 +46,16 @@ function SplitPanel({ children }) {
46
46
  * on the presence and state of the Navigation and Tools components.
47
47
  */
48
48
  function SplitPanelBottom() {
49
- const { disableBodyScroll, isNavigationOpen, isSplitPanelOpen, isToolsOpen, splitPanel, splitPanelPosition, splitPanelReportedSize, splitPanelReportedHeaderHeight, } = useAppLayoutInternals();
49
+ const { disableBodyScroll, hasOpenDrawer, isNavigationOpen, isSplitPanelOpen, splitPanel, splitPanelPosition, splitPanelReportedSize, splitPanelReportedHeaderHeight, } = useAppLayoutInternals();
50
50
  if (!splitPanel) {
51
51
  return null;
52
52
  }
53
53
  return (React.createElement(Transition, { in: isSplitPanelOpen !== null && isSplitPanelOpen !== void 0 ? isSplitPanelOpen : false, exit: false }, (state, transitionEventsRef) => (React.createElement("section", { className: clsx(styles['split-panel-bottom'], styles[`position-${splitPanelPosition}`], {
54
54
  [styles.animating]: state === 'entering',
55
55
  [styles['disable-body-scroll']]: disableBodyScroll,
56
+ [styles['has-open-drawer']]: hasOpenDrawer,
56
57
  [styles['is-navigation-open']]: isNavigationOpen,
57
58
  [styles['is-split-panel-open']]: isSplitPanelOpen,
58
- [styles['is-tools-open']]: isToolsOpen,
59
59
  }), ref: transitionEventsRef, style: {
60
60
  [customCssProps.splitPanelReportedSize]: `${splitPanelReportedSize}px`,
61
61
  [customCssProps.splitPanelReportedHeaderSize]: `${splitPanelReportedHeaderHeight}px`,
@@ -1 +1 @@
1
- {"version":3,"file":"split-panel.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/split-panel.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,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CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,0BAAmC,EACnC,qBAAuE;IAEvE,IAAI,kBAAkB,GAAsC,QAAQ,CAAC;IAErE,IAAI,CAAC,0BAA0B,IAAI,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,QAAQ,MAAK,MAAM,EAAE;QAC7E,kBAAkB,GAAG,MAAM,CAAC;KAC7B;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AACD,UAAU,CAAC,MAAM,GAAG,gBAAgB,CAAC;AACrC,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC;AAEjC,eAAe,UAAU,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 { useAppLayoutInternals } from './context';\nimport { SplitPanelContextProvider, SplitPanelContextProps } from '../../internal/context/split-panel-context';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * If there is no Split Panel in the AppLayout context then the SplitPanel\n * will pass through the AppLayout children without the context.\n */\nfunction SplitPanel({ children }: React.PropsWithChildren<unknown>) {\n const {\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n isMobile,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanelPosition,\n splitPanelSize,\n setSplitPanelToggle,\n splitPanelRefs,\n headerHeight,\n footerHeight,\n } = useAppLayoutInternals();\n\n const context: SplitPanelContextProps = {\n bottomOffset: 0,\n getMaxHeight: () => {\n const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight;\n // If the page is likely zoomed in at 200%, allow the split panel to fill the content area.\n return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250;\n },\n getMaxWidth: () => document.documentElement.clientWidth,\n isForcedPosition: isSplitPanelForcedPosition,\n isMobile,\n isOpen: isSplitPanelOpen,\n leftOffset: 0,\n onPreferencesChange: handleSplitPanelPreferencesChange,\n onResize: handleSplitPanelResize,\n onToggle: handleSplitPanelClick,\n position: splitPanelPosition,\n reportSize: setSplitPanelReportedSize,\n reportHeaderHeight: setSplitPanelReportedHeaderHeight,\n rightOffset: 0,\n size: splitPanelSize || 0,\n topOffset: 0,\n setSplitPanelToggle,\n refs: splitPanelRefs,\n };\n\n return <SplitPanelContextProvider value={context}>{children}</SplitPanelContextProvider>;\n}\n\n/**\n * This is the render function for the SplitPanel when it is in bottom position.\n * The Split Panel container will be another row entry in the grid definition in\n * the Layout component. The start and finish columns will be variable based\n * on the presence and state of the Navigation and Tools components.\n */\nfunction SplitPanelBottom() {\n const {\n disableBodyScroll,\n isNavigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n <Transition in={isSplitPanelOpen ?? false} exit={false}>\n {(state, transitionEventsRef) => (\n <section\n className={clsx(styles['split-panel-bottom'], styles[`position-${splitPanelPosition}`], {\n [styles.animating]: state === 'entering',\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles['is-navigation-open']]: isNavigationOpen,\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n [styles['is-tools-open']]: isToolsOpen,\n })}\n ref={transitionEventsRef}\n style={{\n [customCssProps.splitPanelReportedSize]: `${splitPanelReportedSize}px`,\n [customCssProps.splitPanelReportedHeaderSize]: `${splitPanelReportedHeaderHeight}px`,\n }}\n >\n <SplitPanel></SplitPanel>\n {splitPanelPosition === 'bottom' && splitPanel}\n </section>\n )}\n </Transition>\n );\n}\n\n/**\n * This is the render function for the SplitPanel when it is side position.\n * The Split Panel will not be within the grid defined in the Layout component\n * but instead a direct child of the Tools component. The width constraints\n * for this position are computed in the Tools component.\n */\nfunction SplitPanelSide() {\n const {\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelMaxWidth,\n splitPanelMinWidth,\n splitPanelReportedSize,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n <Transition in={isSplitPanelOpen ?? false} exit={false}>\n {(state, transitionEventsRef) => (\n <section\n aria-hidden={!isSplitPanelOpen || splitPanelPosition === 'bottom' ? true : false}\n className={clsx(styles['split-panel-side'], styles[`position-${splitPanelPosition}`], {\n [styles.animating]: state === 'entering',\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n })}\n ref={transitionEventsRef}\n style={{\n [customCssProps.splitPanelMaxWidth]: `${splitPanelMaxWidth}px`,\n [customCssProps.splitPanelMinWidth]: `${splitPanelMinWidth}px`,\n [customCssProps.splitPanelReportedHeaderSize]: `${splitPanelReportedSize}px`,\n }}\n >\n <div className={clsx(styles['animated-content'])}>{splitPanelPosition === 'side' && splitPanel}</div>\n </section>\n )}\n </Transition>\n );\n}\n\n/**\n * This logic will determine what the Split Panel position should be. It reconciles the possibility\n * of being in forced position with the current selected position in the settings.\n */\nexport function getSplitPanelPosition(\n isSplitPanelForcedPosition: boolean,\n splitPanelPreferences: AppLayoutProps.SplitPanelPreferences | undefined\n) {\n let splitPanelPosition: AppLayoutProps.SplitPanelPosition = 'bottom';\n\n if (!isSplitPanelForcedPosition && splitPanelPreferences?.position === 'side') {\n splitPanelPosition = 'side';\n }\n\n return splitPanelPosition;\n}\nSplitPanel.Bottom = SplitPanelBottom;\nSplitPanel.Side = SplitPanelSide;\n\nexport default SplitPanel;\n"]}
1
+ {"version":3,"file":"split-panel.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/split-panel.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,E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,IAAI,kBAAkB,GAAsC,QAAQ,CAAC;IAErE,IAAI,CAAC,0BAA0B,IAAI,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,QAAQ,MAAK,MAAM,EAAE;QAC7E,kBAAkB,GAAG,MAAM,CAAC;KAC7B;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AACD,UAAU,CAAC,MAAM,GAAG,gBAAgB,CAAC;AACrC,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC;AAEjC,eAAe,UAAU,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 { useAppLayoutInternals } from './context';\nimport { SplitPanelContextProvider, SplitPanelContextProps } from '../../internal/context/split-panel-context';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * If there is no Split Panel in the AppLayout context then the SplitPanel\n * will pass through the AppLayout children without the context.\n */\nfunction SplitPanel({ children }: React.PropsWithChildren<unknown>) {\n const {\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n isMobile,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanelPosition,\n splitPanelSize,\n setSplitPanelToggle,\n splitPanelRefs,\n headerHeight,\n footerHeight,\n } = useAppLayoutInternals();\n\n const context: SplitPanelContextProps = {\n bottomOffset: 0,\n getMaxHeight: () => {\n const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight;\n // If the page is likely zoomed in at 200%, allow the split panel to fill the content area.\n return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250;\n },\n getMaxWidth: () => document.documentElement.clientWidth,\n isForcedPosition: isSplitPanelForcedPosition,\n isMobile,\n isOpen: isSplitPanelOpen,\n leftOffset: 0,\n onPreferencesChange: handleSplitPanelPreferencesChange,\n onResize: handleSplitPanelResize,\n onToggle: handleSplitPanelClick,\n position: splitPanelPosition,\n reportSize: setSplitPanelReportedSize,\n reportHeaderHeight: setSplitPanelReportedHeaderHeight,\n rightOffset: 0,\n size: splitPanelSize || 0,\n topOffset: 0,\n setSplitPanelToggle,\n refs: splitPanelRefs,\n };\n\n return <SplitPanelContextProvider value={context}>{children}</SplitPanelContextProvider>;\n}\n\n/**\n * This is the render function for the SplitPanel when it is in bottom position.\n * The Split Panel container will be another row entry in the grid definition in\n * the Layout component. The start and finish columns will be variable based\n * on the presence and state of the Navigation and Tools components.\n */\nfunction SplitPanelBottom() {\n const {\n disableBodyScroll,\n hasOpenDrawer,\n isNavigationOpen,\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n <Transition in={isSplitPanelOpen ?? false} exit={false}>\n {(state, transitionEventsRef) => (\n <section\n className={clsx(styles['split-panel-bottom'], styles[`position-${splitPanelPosition}`], {\n [styles.animating]: state === 'entering',\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles['has-open-drawer']]: hasOpenDrawer,\n [styles['is-navigation-open']]: isNavigationOpen,\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n })}\n ref={transitionEventsRef}\n style={{\n [customCssProps.splitPanelReportedSize]: `${splitPanelReportedSize}px`,\n [customCssProps.splitPanelReportedHeaderSize]: `${splitPanelReportedHeaderHeight}px`,\n }}\n >\n <SplitPanel></SplitPanel>\n {splitPanelPosition === 'bottom' && splitPanel}\n </section>\n )}\n </Transition>\n );\n}\n\n/**\n * This is the render function for the SplitPanel when it is side position.\n * The Split Panel will not be within the grid defined in the Layout component\n * but instead a direct child of the Tools component. The width constraints\n * for this position are computed in the Tools component.\n */\nfunction SplitPanelSide() {\n const {\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelMaxWidth,\n splitPanelMinWidth,\n splitPanelReportedSize,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n <Transition in={isSplitPanelOpen ?? false} exit={false}>\n {(state, transitionEventsRef) => (\n <section\n aria-hidden={!isSplitPanelOpen || splitPanelPosition === 'bottom' ? true : false}\n className={clsx(styles['split-panel-side'], styles[`position-${splitPanelPosition}`], {\n [styles.animating]: state === 'entering',\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n })}\n ref={transitionEventsRef}\n style={{\n [customCssProps.splitPanelMaxWidth]: `${splitPanelMaxWidth}px`,\n [customCssProps.splitPanelMinWidth]: `${splitPanelMinWidth}px`,\n [customCssProps.splitPanelReportedHeaderSize]: `${splitPanelReportedSize}px`,\n }}\n >\n <div className={clsx(styles['animated-content'])}>{splitPanelPosition === 'side' && splitPanel}</div>\n </section>\n )}\n </Transition>\n );\n}\n\n/**\n * This logic will determine what the Split Panel position should be. It reconciles the possibility\n * of being in forced position with the current selected position in the settings.\n */\nexport function getSplitPanelPosition(\n isSplitPanelForcedPosition: boolean,\n splitPanelPreferences: AppLayoutProps.SplitPanelPreferences | undefined\n) {\n let splitPanelPosition: AppLayoutProps.SplitPanelPosition = 'bottom';\n\n if (!isSplitPanelForcedPosition && splitPanelPreferences?.position === 'side') {\n splitPanelPosition = 'side';\n }\n\n return splitPanelPosition;\n}\nSplitPanel.Bottom = SplitPanelBottom;\nSplitPanel.Side = SplitPanelSide;\n\nexport default SplitPanel;\n"]}