@cloudscape-design/components 3.0.664 → 3.0.665

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 (131) hide show
  1. package/app-layout/classic.d.ts.map +1 -1
  2. package/app-layout/classic.js +1 -0
  3. package/app-layout/classic.js.map +1 -1
  4. package/app-layout/drawer/drawers-helpers.d.ts +4 -1
  5. package/app-layout/drawer/drawers-helpers.d.ts.map +1 -1
  6. package/app-layout/drawer/drawers-helpers.js.map +1 -1
  7. package/app-layout/interfaces.d.ts +1 -1
  8. package/app-layout/interfaces.js.map +1 -1
  9. package/app-layout/internal.d.ts +6 -5
  10. package/app-layout/internal.d.ts.map +1 -1
  11. package/app-layout/internal.js +18 -2
  12. package/app-layout/internal.js.map +1 -1
  13. package/app-layout/utils/use-drawers.d.ts +1 -0
  14. package/app-layout/utils/use-drawers.d.ts.map +1 -1
  15. package/app-layout/utils/use-drawers.js +1 -1
  16. package/app-layout/utils/use-drawers.js.map +1 -1
  17. package/app-layout/utils/use-focus-control.d.ts +1 -2
  18. package/app-layout/utils/use-focus-control.d.ts.map +1 -1
  19. package/app-layout/utils/use-focus-control.js.map +1 -1
  20. package/app-layout/utils/use-split-panel-focus-control.d.ts +1 -2
  21. package/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -1
  22. package/app-layout/utils/use-split-panel-focus-control.js.map +1 -1
  23. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  24. package/app-layout/visual-refresh/context.js +1 -0
  25. package/app-layout/visual-refresh/context.js.map +1 -1
  26. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts +33 -0
  27. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -0
  28. package/app-layout/visual-refresh-toolbar/compute-layout.js +33 -0
  29. package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -0
  30. package/app-layout/visual-refresh-toolbar/drawer/index.d.ts +9 -0
  31. package/app-layout/visual-refresh-toolbar/drawer/index.d.ts.map +1 -0
  32. package/app-layout/visual-refresh-toolbar/drawer/index.js +55 -0
  33. package/app-layout/visual-refresh-toolbar/drawer/index.js.map +1 -0
  34. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +11 -0
  35. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +140 -0
  36. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +12 -0
  37. package/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts +16 -0
  38. package/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts.map +1 -0
  39. package/app-layout/visual-refresh-toolbar/drawer/use-resize.js +23 -0
  40. package/app-layout/visual-refresh-toolbar/drawer/use-resize.js.map +1 -0
  41. package/app-layout/visual-refresh-toolbar/exports.d.ts +6 -0
  42. package/app-layout/visual-refresh-toolbar/exports.d.ts.map +1 -0
  43. package/app-layout/visual-refresh-toolbar/exports.js +8 -0
  44. package/app-layout/visual-refresh-toolbar/exports.js.map +1 -0
  45. package/app-layout/visual-refresh-toolbar/index.d.ts +20 -0
  46. package/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -0
  47. package/app-layout/visual-refresh-toolbar/index.js +172 -0
  48. package/app-layout/visual-refresh-toolbar/index.js.map +1 -0
  49. package/app-layout/visual-refresh-toolbar/interfaces.d.ts +41 -0
  50. package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -0
  51. package/app-layout/visual-refresh-toolbar/interfaces.js +4 -0
  52. package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -0
  53. package/app-layout/visual-refresh-toolbar/internal.d.ts +7 -0
  54. package/app-layout/visual-refresh-toolbar/internal.d.ts.map +1 -0
  55. package/app-layout/visual-refresh-toolbar/internal.js +14 -0
  56. package/app-layout/visual-refresh-toolbar/internal.js.map +1 -0
  57. package/app-layout/visual-refresh-toolbar/navigation/index.d.ts +9 -0
  58. package/app-layout/visual-refresh-toolbar/navigation/index.d.ts.map +1 -0
  59. package/app-layout/visual-refresh-toolbar/navigation/index.js +32 -0
  60. package/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -0
  61. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +11 -0
  62. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +155 -0
  63. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +12 -0
  64. package/app-layout/visual-refresh-toolbar/notifications/index.d.ts +10 -0
  65. package/app-layout/visual-refresh-toolbar/notifications/index.d.ts.map +1 -0
  66. package/app-layout/visual-refresh-toolbar/notifications/index.js +17 -0
  67. package/app-layout/visual-refresh-toolbar/notifications/index.js.map +1 -0
  68. package/app-layout/visual-refresh-toolbar/notifications/styles.css.js +6 -0
  69. package/app-layout/visual-refresh-toolbar/notifications/styles.scoped.css +8 -0
  70. package/app-layout/visual-refresh-toolbar/notifications/styles.selectors.js +7 -0
  71. package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +12 -0
  72. package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -0
  73. package/app-layout/visual-refresh-toolbar/skeleton/index.js +32 -0
  74. package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -0
  75. package/app-layout/visual-refresh-toolbar/skeleton/slot-wrappers.d.ts +15 -0
  76. package/app-layout/visual-refresh-toolbar/skeleton/slot-wrappers.d.ts.map +1 -0
  77. package/app-layout/visual-refresh-toolbar/skeleton/slot-wrappers.js +8 -0
  78. package/app-layout/visual-refresh-toolbar/skeleton/slot-wrappers.js.map +1 -0
  79. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +20 -0
  80. package/app-layout/{skeleton → visual-refresh-toolbar/skeleton}/styles.scoped.css +58 -24
  81. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +21 -0
  82. package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +19 -0
  83. package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -0
  84. package/app-layout/visual-refresh-toolbar/split-panel/index.js +20 -0
  85. package/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -0
  86. package/app-layout/visual-refresh-toolbar/split-panel/styles.css.js +6 -0
  87. package/app-layout/visual-refresh-toolbar/split-panel/styles.scoped.css +100 -0
  88. package/app-layout/visual-refresh-toolbar/split-panel/styles.selectors.js +7 -0
  89. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +8 -0
  90. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -0
  91. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +60 -0
  92. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -0
  93. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +9 -0
  94. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -0
  95. package/app-layout/visual-refresh-toolbar/toolbar/index.js +52 -0
  96. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -0
  97. package/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +17 -0
  98. package/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +214 -0
  99. package/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +18 -0
  100. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts +20 -0
  101. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts.map +1 -0
  102. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +18 -0
  103. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -0
  104. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.css.js +11 -0
  105. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scoped.css +243 -0
  106. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.selectors.js +12 -0
  107. package/internal/base-component/styles.scoped.css +5 -0
  108. package/internal/components/tooltip/index.d.ts +2 -1
  109. package/internal/components/tooltip/index.d.ts.map +1 -1
  110. package/internal/components/tooltip/index.js +2 -2
  111. package/internal/components/tooltip/index.js.map +1 -1
  112. package/internal/environment.js +1 -1
  113. package/internal/environment.json +1 -1
  114. package/internal/generated/theming/index.cjs +3 -0
  115. package/internal/generated/theming/index.js +3 -0
  116. package/internal/manifest.json +1 -1
  117. package/package.json +1 -1
  118. package/app-layout/implementation.d.ts +0 -50
  119. package/app-layout/implementation.d.ts.map +0 -1
  120. package/app-layout/implementation.js +0 -13
  121. package/app-layout/implementation.js.map +0 -1
  122. package/app-layout/skeleton/index.d.ts +0 -4
  123. package/app-layout/skeleton/index.d.ts.map +0 -1
  124. package/app-layout/skeleton/index.js +0 -10
  125. package/app-layout/skeleton/index.js.map +0 -1
  126. package/app-layout/skeleton/layout.d.ts +0 -8
  127. package/app-layout/skeleton/layout.d.ts.map +0 -1
  128. package/app-layout/skeleton/layout.js +0 -28
  129. package/app-layout/skeleton/layout.js.map +0 -1
  130. package/app-layout/skeleton/styles.css.js +0 -16
  131. package/app-layout/skeleton/styles.selectors.js +0 -17
@@ -0,0 +1,172 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import React, { useImperativeHandle, useState } from 'react';
5
+ import { useContainerQuery } from '@cloudscape-design/component-toolkit';
6
+ import { useControllable } from '../../internal/hooks/use-controllable';
7
+ import { fireNonCancelableEvent } from '../../internal/events';
8
+ import { useFocusControl } from '../utils/use-focus-control';
9
+ import { useMobile } from '../../internal/hooks/use-mobile';
10
+ import { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';
11
+ import { useDrawers } from '../utils/use-drawers';
12
+ import { useUniqueId } from '../../internal/hooks/use-unique-id';
13
+ import { computeHorizontalLayout, computeVerticalLayout } from './compute-layout';
14
+ import { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';
15
+ import globalVars from '../../internal/styles/global-vars';
16
+ import { SkeletonLayout } from './skeleton';
17
+ import { AppLayoutDrawer, AppLayoutNavigation, AppLayoutNotifications, AppLayoutSplitPanelBottom, AppLayoutSplitPanelSide, AppLayoutToolbar, } from './internal';
18
+ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
19
+ var _b;
20
+ var { ariaLabels, contentHeader, content, navigationOpen, navigationWidth, navigation, navigationHide, onNavigationChange, tools, toolsOpen: controlledToolsOpen, onToolsChange, toolsHide, toolsWidth, contentType, headerVariant, breadcrumbs, notifications, stickyNotifications, splitPanelPreferences: controlledSplitPanelPreferences, splitPanelOpen: controlledSplitPanelOpen, splitPanel, splitPanelSize: controlledSplitPanelSize, onSplitPanelToggle, onSplitPanelResize, onSplitPanelPreferencesChange, disableContentPaddings, minContentWidth, maxContentWidth, placement } = _a, rest = __rest(_a, ["ariaLabels", "contentHeader", "content", "navigationOpen", "navigationWidth", "navigation", "navigationHide", "onNavigationChange", "tools", "toolsOpen", "onToolsChange", "toolsHide", "toolsWidth", "contentType", "headerVariant", "breadcrumbs", "notifications", "stickyNotifications", "splitPanelPreferences", "splitPanelOpen", "splitPanel", "splitPanelSize", "onSplitPanelToggle", "onSplitPanelResize", "onSplitPanelPreferencesChange", "disableContentPaddings", "minContentWidth", "maxContentWidth", "placement"]);
21
+ const isMobile = useMobile();
22
+ const embeddedViewMode = rest.__embeddedViewMode;
23
+ const splitPanelControlId = useUniqueId('split-panel');
24
+ const [toolbarState, setToolbarState] = useState('show');
25
+ const onNavigationToggle = (open) => {
26
+ fireNonCancelableEvent(onNavigationChange, { open });
27
+ };
28
+ const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, {
29
+ componentName: 'AppLayout',
30
+ controlledProp: 'toolsOpen',
31
+ changeHandler: 'onToolsChange',
32
+ });
33
+ const onToolsToggle = (open) => {
34
+ setToolsOpen(open);
35
+ drawersFocusControl.setFocus();
36
+ fireNonCancelableEvent(onToolsChange, { open });
37
+ };
38
+ const { drawers, activeDrawer, minDrawerSize, activeDrawerSize, ariaLabelsWithDrawers, onActiveDrawerChange, onActiveDrawerResize, } = useDrawers(rest, ariaLabels, {
39
+ ariaLabels,
40
+ toolsHide,
41
+ toolsOpen,
42
+ tools,
43
+ toolsWidth,
44
+ onToolsToggle,
45
+ });
46
+ const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(controlledSplitPanelOpen, onSplitPanelToggle, false, {
47
+ componentName: 'AppLayout',
48
+ controlledProp: 'splitPanelOpen',
49
+ changeHandler: 'onSplitPanelToggle',
50
+ });
51
+ const onSplitPanelToggleHandler = () => {
52
+ setSplitPanelOpen(!splitPanelOpen);
53
+ fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });
54
+ };
55
+ const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(controlledSplitPanelPreferences, onSplitPanelPreferencesChange, undefined, {
56
+ componentName: 'AppLayout',
57
+ controlledProp: 'splitPanelPreferences',
58
+ changeHandler: 'onSplitPanelPreferencesChange',
59
+ });
60
+ const onSplitPanelPreferencesChangeHandler = (detail) => {
61
+ setSplitPanelPreferences(detail);
62
+ splitPanelFocusControl.setLastInteraction({ type: 'position' });
63
+ fireNonCancelableEvent(onSplitPanelPreferencesChange, detail);
64
+ };
65
+ const [splitPanelSize = 0, setSplitPanelSize] = useControllable(controlledSplitPanelSize, onSplitPanelResize, getSplitPanelDefaultSize((_b = splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position) !== null && _b !== void 0 ? _b : 'bottom'), { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' });
66
+ const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);
67
+ const onSplitPanelResizeHandler = (size) => {
68
+ setSplitPanelSize(size);
69
+ fireNonCancelableEvent(onSplitPanelResize, { size });
70
+ };
71
+ const [splitPanelToggleConfig, setSplitPanelToggleConfig] = useState({
72
+ ariaLabel: undefined,
73
+ displayed: false,
74
+ });
75
+ const drawersFocusControl = useFocusControl(!!(activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id));
76
+ const navigationFocusControl = useFocusControl(navigationOpen);
77
+ const splitPanelFocusControl = useSplitPanelFocusControl([splitPanelPreferences, splitPanelOpen]);
78
+ useImperativeHandle(forwardRef, () => ({
79
+ closeNavigationIfNecessary: () => isMobile && onNavigationToggle(false),
80
+ openTools: () => onToolsToggle(true),
81
+ focusToolsClose: () => drawersFocusControl.setFocus(true),
82
+ focusActiveDrawer: () => drawersFocusControl.setFocus(true),
83
+ focusSplitPanel: () => { var _a; return (_a = splitPanelFocusControl.refs.slider.current) === null || _a === void 0 ? void 0 : _a.focus(); },
84
+ }));
85
+ // TODO move into respective components
86
+ const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.borderBoxHeight);
87
+ const [toolbarHeight, toolbarRef] = useContainerQuery(rect => rect.borderBoxHeight);
88
+ const resolvedNavigation = navigationHide ? null : navigation !== null && navigation !== void 0 ? navigation : React.createElement(React.Fragment, null);
89
+ const { maxDrawerSize, maxSplitPanelSize, splitPanelForcedPosition, splitPanelPosition } = computeHorizontalLayout({
90
+ activeDrawerSize,
91
+ splitPanelSize,
92
+ minContentWidth,
93
+ navigationOpen: !!resolvedNavigation && navigationOpen,
94
+ navigationWidth,
95
+ placement,
96
+ splitPanelOpen,
97
+ splitPanelPosition: splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position,
98
+ });
99
+ const hasToolbar = !embeddedViewMode &&
100
+ (!!resolvedNavigation || !!breadcrumbs || splitPanelToggleConfig.displayed || drawers.length > 0);
101
+ const verticalOffsets = computeVerticalLayout({
102
+ topOffset: placement.insetBlockStart,
103
+ hasToolbar: hasToolbar && toolbarState !== 'hide',
104
+ notificationsHeight: notificationsHeight !== null && notificationsHeight !== void 0 ? notificationsHeight : 0,
105
+ toolbarHeight: toolbarHeight !== null && toolbarHeight !== void 0 ? toolbarHeight : 0,
106
+ stickyNotifications: !!stickyNotifications,
107
+ });
108
+ const appLayoutInternals = {
109
+ ariaLabels: ariaLabelsWithDrawers,
110
+ headerVariant,
111
+ isMobile,
112
+ breadcrumbs,
113
+ stickyNotifications,
114
+ navigationOpen,
115
+ navigation: resolvedNavigation,
116
+ navigationFocusControl,
117
+ activeDrawer,
118
+ activeDrawerSize,
119
+ minDrawerSize,
120
+ maxDrawerSize,
121
+ drawers: drawers,
122
+ drawersFocusControl,
123
+ splitPanelPosition,
124
+ splitPanelToggleConfig,
125
+ splitPanelOpen,
126
+ splitPanelControlId,
127
+ splitPanelFocusControl,
128
+ placement,
129
+ toolbarState,
130
+ setToolbarState,
131
+ verticalOffsets,
132
+ notificationsRef,
133
+ toolbarRef,
134
+ onSplitPanelToggle: onSplitPanelToggleHandler,
135
+ onNavigationToggle,
136
+ onActiveDrawerChange,
137
+ onActiveDrawerResize,
138
+ };
139
+ const splitPanelInternals = {
140
+ bottomOffset: 0,
141
+ getMaxHeight: () => {
142
+ const availableHeight = document.documentElement.clientHeight - placement.insetBlockStart - placement.insetBlockEnd;
143
+ // If the page is likely zoomed in at 200%, allow the split panel to fill the content area.
144
+ return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250;
145
+ },
146
+ maxWidth: maxSplitPanelSize,
147
+ isForcedPosition: splitPanelForcedPosition,
148
+ isOpen: splitPanelOpen,
149
+ leftOffset: 0,
150
+ onPreferencesChange: onSplitPanelPreferencesChangeHandler,
151
+ onResize: onSplitPanelResizeHandler,
152
+ onToggle: onSplitPanelToggleHandler,
153
+ position: splitPanelPosition,
154
+ reportSize: size => setSplitPanelReportedSize(size),
155
+ reportHeaderHeight: () => {
156
+ /*unused in this design*/
157
+ },
158
+ rightOffset: 0,
159
+ size: splitPanelSize,
160
+ topOffset: 0,
161
+ setSplitPanelToggle: setSplitPanelToggleConfig,
162
+ refs: splitPanelFocusControl.refs,
163
+ };
164
+ return (React.createElement(SkeletonLayout, { style: {
165
+ [globalVars.stickyVerticalTopOffset]: `${verticalOffsets.header}px`,
166
+ [globalVars.stickyVerticalBottomOffset]: `${placement.insetBlockEnd}px`,
167
+ paddingBlockEnd: splitPanelOpen ? splitPanelReportedSize : '',
168
+ }, toolbar: hasToolbar && React.createElement(AppLayoutToolbar, { appLayoutInternals: appLayoutInternals }), notifications: notifications && (React.createElement(AppLayoutNotifications, { appLayoutInternals: appLayoutInternals }, notifications)), contentHeader: contentHeader, content: content, navigation: resolvedNavigation && React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutInternals }), navigationOpen: navigationOpen, navigationWidth: navigationWidth, tools: activeDrawer && React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutInternals }), toolsOpen: !!activeDrawer, toolsWidth: activeDrawerSize, sideSplitPanel: splitPanelPosition === 'side' &&
169
+ splitPanel && (React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), bottomSplitPanel: splitPanelPosition === 'bottom' && (React.createElement(AppLayoutSplitPanelBottom, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), splitPanelOpen: splitPanelOpen, placement: placement, contentType: contentType, maxContentWidth: maxContentWidth, disableContentPaddings: disableContentPaddings }));
170
+ });
171
+ export default AppLayoutVisualRefreshToolbar;
172
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OA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AAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,YAAY,IAAI,oBAAC,eAAe,IAAC,kBAAkB,EAAE,kBAAkB,GAAI,EAClF,SAAS,EAAE,CAAC,CAAC,YAAY,EACzB,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EACZ,kBAAkB,KAAK,MAAM;YAC7B,UAAU,IAAI,CACZ,oBAAC,uBAAuB,IAAC,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,IACtG,UAAU,CACa,CAC3B,EAEH,gBAAgB,EACd,kBAAkB,KAAK,QAAQ,IAAI,CACjC,oBAAC,yBAAyB,IACxB,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,IAEvC,UAAU,CACe,CAC7B,EAEH,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,sBAAsB,GAC9C,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useImperativeHandle, useState } from 'react';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useFocusControl } from '../utils/use-focus-control';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { useDrawers } from '../utils/use-drawers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { computeHorizontalLayout, computeVerticalLayout } from './compute-layout';\nimport { SplitPanelProviderProps } from '../split-panel';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport globalVars from '../../internal/styles/global-vars';\nimport { SkeletonLayout } from './skeleton';\nimport {\n AppLayoutDrawer,\n AppLayoutNavigation,\n AppLayoutNotifications,\n AppLayoutSplitPanelBottom,\n AppLayoutSplitPanelSide,\n AppLayoutToolbar,\n} from './internal';\nimport { AppLayoutInternals } from './interfaces';\n\nconst AppLayoutVisualRefreshToolbar = React.forwardRef(\n (\n {\n ariaLabels,\n contentHeader,\n content,\n navigationOpen,\n navigationWidth,\n navigation,\n navigationHide,\n onNavigationChange,\n tools,\n toolsOpen: controlledToolsOpen,\n onToolsChange,\n toolsHide,\n toolsWidth,\n contentType,\n headerVariant,\n breadcrumbs,\n notifications,\n stickyNotifications,\n splitPanelPreferences: controlledSplitPanelPreferences,\n splitPanelOpen: controlledSplitPanelOpen,\n splitPanel,\n splitPanelSize: controlledSplitPanelSize,\n onSplitPanelToggle,\n onSplitPanelResize,\n onSplitPanelPreferencesChange,\n disableContentPaddings,\n minContentWidth,\n maxContentWidth,\n placement,\n ...rest\n }: AppLayoutPropsWithDefaults,\n forwardRef: React.Ref<AppLayoutProps.Ref>\n ) => {\n const isMobile = useMobile();\n const embeddedViewMode = (rest as any).__embeddedViewMode;\n const splitPanelControlId = useUniqueId('split-panel');\n const [toolbarState, setToolbarState] = useState<'show' | 'hide'>('show');\n\n const onNavigationToggle = (open: boolean) => {\n fireNonCancelableEvent(onNavigationChange, { open });\n };\n\n const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n const onToolsToggle = (open: boolean) => {\n setToolsOpen(open);\n drawersFocusControl.setFocus();\n fireNonCancelableEvent(onToolsChange, { open });\n };\n\n const {\n drawers,\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n ariaLabelsWithDrawers,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = useDrawers(rest, ariaLabels, {\n ariaLabels,\n toolsHide,\n toolsOpen,\n tools,\n toolsWidth,\n onToolsToggle,\n });\n\n const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(\n controlledSplitPanelOpen,\n onSplitPanelToggle,\n false,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelOpen',\n changeHandler: 'onSplitPanelToggle',\n }\n );\n\n const onSplitPanelToggleHandler = () => {\n setSplitPanelOpen(!splitPanelOpen);\n fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });\n };\n\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const onSplitPanelPreferencesChangeHandler = (detail: AppLayoutProps.SplitPanelPreferences) => {\n setSplitPanelPreferences(detail);\n splitPanelFocusControl.setLastInteraction({ type: 'position' });\n fireNonCancelableEvent(onSplitPanelPreferencesChange, detail);\n };\n\n const [splitPanelSize = 0, setSplitPanelSize] = useControllable(\n controlledSplitPanelSize,\n onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPreferences?.position ?? 'bottom'),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n\n const onSplitPanelResizeHandler = (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(onSplitPanelResize, { size });\n };\n\n const [splitPanelToggleConfig, setSplitPanelToggleConfig] = useState<SplitPanelSideToggleProps>({\n ariaLabel: undefined,\n displayed: false,\n });\n\n const drawersFocusControl = useFocusControl(!!activeDrawer?.id);\n const navigationFocusControl = useFocusControl(navigationOpen);\n const splitPanelFocusControl = useSplitPanelFocusControl([splitPanelPreferences, splitPanelOpen]);\n\n useImperativeHandle(forwardRef, () => ({\n closeNavigationIfNecessary: () => isMobile && onNavigationToggle(false),\n openTools: () => onToolsToggle(true),\n focusToolsClose: () => drawersFocusControl.setFocus(true),\n focusActiveDrawer: () => drawersFocusControl.setFocus(true),\n focusSplitPanel: () => splitPanelFocusControl.refs.slider.current?.focus(),\n }));\n\n // TODO move into respective components\n const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.borderBoxHeight);\n const [toolbarHeight, toolbarRef] = useContainerQuery(rect => rect.borderBoxHeight);\n\n const resolvedNavigation = navigationHide ? null : navigation ?? <></>;\n const { maxDrawerSize, maxSplitPanelSize, splitPanelForcedPosition, splitPanelPosition } = computeHorizontalLayout({\n activeDrawerSize,\n splitPanelSize,\n minContentWidth,\n navigationOpen: !!resolvedNavigation && navigationOpen,\n navigationWidth,\n placement,\n splitPanelOpen,\n splitPanelPosition: splitPanelPreferences?.position,\n });\n\n const hasToolbar =\n !embeddedViewMode &&\n (!!resolvedNavigation || !!breadcrumbs || splitPanelToggleConfig.displayed || drawers!.length > 0);\n\n const verticalOffsets = computeVerticalLayout({\n topOffset: placement.insetBlockStart,\n hasToolbar: hasToolbar && toolbarState !== 'hide',\n notificationsHeight: notificationsHeight ?? 0,\n toolbarHeight: toolbarHeight ?? 0,\n stickyNotifications: !!stickyNotifications,\n });\n\n const appLayoutInternals: AppLayoutInternals = {\n ariaLabels: ariaLabelsWithDrawers,\n headerVariant,\n isMobile,\n breadcrumbs,\n stickyNotifications,\n navigationOpen,\n navigation: resolvedNavigation,\n navigationFocusControl,\n activeDrawer,\n activeDrawerSize,\n minDrawerSize,\n maxDrawerSize,\n drawers: drawers!,\n drawersFocusControl,\n splitPanelPosition,\n splitPanelToggleConfig,\n splitPanelOpen,\n splitPanelControlId,\n splitPanelFocusControl,\n placement,\n toolbarState,\n setToolbarState,\n verticalOffsets,\n notificationsRef,\n toolbarRef,\n onSplitPanelToggle: onSplitPanelToggleHandler,\n onNavigationToggle,\n onActiveDrawerChange,\n onActiveDrawerResize,\n };\n\n const splitPanelInternals: SplitPanelProviderProps = {\n bottomOffset: 0,\n getMaxHeight: () => {\n const availableHeight =\n document.documentElement.clientHeight - placement.insetBlockStart - placement.insetBlockEnd;\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 maxWidth: maxSplitPanelSize,\n isForcedPosition: splitPanelForcedPosition,\n isOpen: splitPanelOpen,\n leftOffset: 0,\n onPreferencesChange: onSplitPanelPreferencesChangeHandler,\n onResize: onSplitPanelResizeHandler,\n onToggle: onSplitPanelToggleHandler,\n position: splitPanelPosition,\n reportSize: size => setSplitPanelReportedSize(size),\n reportHeaderHeight: () => {\n /*unused in this design*/\n },\n rightOffset: 0,\n size: splitPanelSize,\n topOffset: 0,\n setSplitPanelToggle: setSplitPanelToggleConfig,\n refs: splitPanelFocusControl.refs,\n };\n\n return (\n <SkeletonLayout\n style={{\n [globalVars.stickyVerticalTopOffset]: `${verticalOffsets.header}px`,\n [globalVars.stickyVerticalBottomOffset]: `${placement.insetBlockEnd}px`,\n paddingBlockEnd: splitPanelOpen ? splitPanelReportedSize : '',\n }}\n toolbar={hasToolbar && <AppLayoutToolbar appLayoutInternals={appLayoutInternals} />}\n notifications={\n notifications && (\n <AppLayoutNotifications appLayoutInternals={appLayoutInternals}>{notifications}</AppLayoutNotifications>\n )\n }\n contentHeader={contentHeader}\n content={content}\n navigation={resolvedNavigation && <AppLayoutNavigation appLayoutInternals={appLayoutInternals} />}\n navigationOpen={navigationOpen}\n navigationWidth={navigationWidth}\n tools={activeDrawer && <AppLayoutDrawer appLayoutInternals={appLayoutInternals} />}\n toolsOpen={!!activeDrawer}\n toolsWidth={activeDrawerSize}\n sideSplitPanel={\n splitPanelPosition === 'side' &&\n splitPanel && (\n <AppLayoutSplitPanelSide appLayoutInternals={appLayoutInternals} splitPanelInternals={splitPanelInternals}>\n {splitPanel}\n </AppLayoutSplitPanelSide>\n )\n }\n bottomSplitPanel={\n splitPanelPosition === 'bottom' && (\n <AppLayoutSplitPanelBottom\n appLayoutInternals={appLayoutInternals}\n splitPanelInternals={splitPanelInternals}\n >\n {splitPanel}\n </AppLayoutSplitPanelBottom>\n )\n }\n splitPanelOpen={splitPanelOpen}\n placement={placement}\n contentType={contentType}\n maxContentWidth={maxContentWidth}\n disableContentPaddings={disableContentPaddings}\n />\n );\n }\n);\n\nexport default AppLayoutVisualRefreshToolbar;\n"]}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';
3
+ import { FocusControlState } from '../utils/use-focus-control';
4
+ import { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control';
5
+ import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';
6
+ import { VerticalLayoutOutput } from './compute-layout';
7
+ export interface AppLayoutInternals {
8
+ ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];
9
+ headerVariant: AppLayoutPropsWithDefaults['headerVariant'];
10
+ placement: AppLayoutPropsWithDefaults['placement'];
11
+ navigationOpen: AppLayoutPropsWithDefaults['navigationOpen'];
12
+ navigationFocusControl: FocusControlState;
13
+ navigation: React.ReactNode;
14
+ splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];
15
+ splitPanelOpen: boolean;
16
+ splitPanelControlId: string;
17
+ splitPanelFocusControl: SplitPanelFocusControlState;
18
+ splitPanelToggleConfig: SplitPanelSideToggleProps;
19
+ isMobile: boolean;
20
+ activeDrawer: AppLayoutProps.Drawer | undefined;
21
+ activeDrawerSize: number;
22
+ minDrawerSize: number;
23
+ maxDrawerSize: number;
24
+ drawers: ReadonlyArray<AppLayoutProps.Drawer>;
25
+ drawersFocusControl: FocusControlState;
26
+ stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications'];
27
+ breadcrumbs: React.ReactNode;
28
+ toolbarState: 'show' | 'hide';
29
+ setToolbarState: (state: 'show' | 'hide') => void;
30
+ verticalOffsets: VerticalLayoutOutput;
31
+ notificationsRef: React.Ref<HTMLElement>;
32
+ toolbarRef: React.Ref<HTMLElement>;
33
+ onSplitPanelToggle: () => void;
34
+ onNavigationToggle: (open: boolean) => void;
35
+ onActiveDrawerChange: (newDrawerId: string | null) => void;
36
+ onActiveDrawerResize: (detail: {
37
+ id: string;
38
+ size: number;
39
+ }) => void;
40
+ }
41
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC;IACrD,aAAa,EAAE,0BAA0B,CAAC,eAAe,CAAC,CAAC;IAC3D,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,cAAc,EAAE,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;IAC7D,sBAAsB,EAAE,iBAAiB,CAAC;IAC1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,kBAAkB,EAAE,cAAc,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACrE,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,2BAA2B,CAAC;IACpD,sBAAsB,EAAE,yBAAyB,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9C,mBAAmB,EAAE,iBAAiB,CAAC;IACvC,mBAAmB,EAAE,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;IACvE,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,oBAAoB,CAAC;IACtC,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzC,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACnC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACtE"}
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { FocusControlState } from '../utils/use-focus-control';\nimport { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { VerticalLayoutOutput } from './compute-layout';\n\n// Widgetization notice: structures in this file are shared multiple app layout instances, possibly different minor versions.\n// Treat thsese structures as an API and do not make incompatible changes.\nexport interface AppLayoutInternals {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n headerVariant: AppLayoutPropsWithDefaults['headerVariant'];\n placement: AppLayoutPropsWithDefaults['placement'];\n navigationOpen: AppLayoutPropsWithDefaults['navigationOpen'];\n navigationFocusControl: FocusControlState;\n navigation: React.ReactNode;\n splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelOpen: boolean;\n splitPanelControlId: string;\n splitPanelFocusControl: SplitPanelFocusControlState;\n splitPanelToggleConfig: SplitPanelSideToggleProps;\n isMobile: boolean;\n activeDrawer: AppLayoutProps.Drawer | undefined;\n activeDrawerSize: number;\n minDrawerSize: number;\n maxDrawerSize: number;\n drawers: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusControl: FocusControlState;\n stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications'];\n breadcrumbs: React.ReactNode;\n toolbarState: 'show' | 'hide';\n setToolbarState: (state: 'show' | 'hide') => void;\n verticalOffsets: VerticalLayoutOutput;\n notificationsRef: React.Ref<HTMLElement>;\n toolbarRef: React.Ref<HTMLElement>;\n onSplitPanelToggle: () => void;\n onNavigationToggle: (open: boolean) => void;\n onActiveDrawerChange: (newDrawerId: string | null) => void;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export declare const AppLayoutNavigation: typeof import("./navigation").AppLayoutNavigationImplementation;
2
+ export declare const AppLayoutDrawer: typeof import("./drawer").AppLayoutDrawerImplementation;
3
+ export declare const AppLayoutNotifications: typeof import("./notifications").AppLayoutNotificationsImplementation;
4
+ export declare const AppLayoutToolbar: typeof import("./toolbar").AppLayoutToolbarImplementation;
5
+ export declare const AppLayoutSplitPanelBottom: typeof import("./split-panel").AppLayoutSplitPanelDrawerBottomImplementation;
6
+ export declare const AppLayoutSplitPanelSide: typeof import("./split-panel").AppLayoutSplitPanelDrawerSideImplementation;
7
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/internal.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB,iEAAwC,CAAC;AACzE,eAAO,MAAM,eAAe,yDAAoC,CAAC;AACjE,eAAO,MAAM,sBAAsB,uEAA2C,CAAC;AAC/E,eAAO,MAAM,gBAAgB,2DAAqC,CAAC;AACnE,eAAO,MAAM,yBAAyB,8EAAoD,CAAC;AAC3F,eAAO,MAAM,uBAAuB,4EAAkD,CAAC"}
@@ -0,0 +1,14 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { createWidgetizedAppLayoutDrawer } from './drawer';
4
+ import { createWidgetizedAppLayoutNavigation } from './navigation';
5
+ import { createWidgetizedAppLayoutNotifications } from './notifications';
6
+ import { createWidgetizedAppLayoutSplitPanelDrawerBottom, createWidgetizedAppLayoutSplitPanelDrawerSide, } from './split-panel';
7
+ import { createWidgetizedAppLayoutToolbar } from './toolbar';
8
+ export const AppLayoutNavigation = createWidgetizedAppLayoutNavigation();
9
+ export const AppLayoutDrawer = createWidgetizedAppLayoutDrawer();
10
+ export const AppLayoutNotifications = createWidgetizedAppLayoutNotifications();
11
+ export const AppLayoutToolbar = createWidgetizedAppLayoutToolbar();
12
+ export const AppLayoutSplitPanelBottom = createWidgetizedAppLayoutSplitPanelDrawerBottom();
13
+ export const AppLayoutSplitPanelSide = createWidgetizedAppLayoutSplitPanelDrawerSide();
14
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,+CAA+C,EAC/C,6CAA6C,GAC9C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,mCAAmC,EAAE,CAAC;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,+BAA+B,EAAE,CAAC;AACjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,sCAAsC,EAAE,CAAC;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,gCAAgC,EAAE,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,+CAA+C,EAAE,CAAC;AAC3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,6CAA6C,EAAE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createWidgetizedAppLayoutDrawer } from './drawer';\nimport { createWidgetizedAppLayoutNavigation } from './navigation';\nimport { createWidgetizedAppLayoutNotifications } from './notifications';\nimport {\n createWidgetizedAppLayoutSplitPanelDrawerBottom,\n createWidgetizedAppLayoutSplitPanelDrawerSide,\n} from './split-panel';\nimport { createWidgetizedAppLayoutToolbar } from './toolbar';\n\nexport const AppLayoutNavigation = createWidgetizedAppLayoutNavigation();\nexport const AppLayoutDrawer = createWidgetizedAppLayoutDrawer();\nexport const AppLayoutNotifications = createWidgetizedAppLayoutNotifications();\nexport const AppLayoutToolbar = createWidgetizedAppLayoutToolbar();\nexport const AppLayoutSplitPanelBottom = createWidgetizedAppLayoutSplitPanelDrawerBottom();\nexport const AppLayoutSplitPanelSide = createWidgetizedAppLayoutSplitPanelDrawerSide();\n"]}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { AppLayoutInternals } from '../interfaces';
3
+ interface AppLayoutNavigationImplementationProps {
4
+ appLayoutInternals: AppLayoutInternals;
5
+ }
6
+ export declare function AppLayoutNavigationImplementation({ appLayoutInternals }: AppLayoutNavigationImplementationProps): JSX.Element;
7
+ export declare const createWidgetizedAppLayoutNavigation: (Loader?: typeof AppLayoutNavigationImplementation | undefined) => typeof AppLayoutNavigationImplementation;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/navigation/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,UAAU,sCAAsC;IAC9C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,iCAAiC,CAAC,EAAE,kBAAkB,EAAE,EAAE,sCAAsC,eAgD/G;AAED,eAAO,MAAM,mCAAmC,6GAA+D,CAAC"}
@@ -0,0 +1,32 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+ import clsx from 'clsx';
5
+ import { InternalButton } from '../../../button/internal';
6
+ import { findUpUntil } from '../../../internal/utils/dom';
7
+ import styles from './styles.css.js';
8
+ import testutilStyles from '../../test-classes/styles.css.js';
9
+ import { createWidgetizedComponent } from '../../../internal/widgets';
10
+ export function AppLayoutNavigationImplementation({ appLayoutInternals }) {
11
+ var _a, _b;
12
+ const { ariaLabels, onNavigationToggle, isMobile, navigationOpen, navigation, navigationFocusControl, placement } = appLayoutInternals;
13
+ // Close the Navigation drawer on mobile when a user clicks a link inside.
14
+ const onNavigationClick = (event) => {
15
+ const hasLink = findUpUntil(event.target, node => node.tagName === 'A' && !!node.href);
16
+ if (hasLink && isMobile) {
17
+ onNavigationToggle(false);
18
+ }
19
+ };
20
+ return (React.createElement("nav", { "aria-label": (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigation) !== null && _a !== void 0 ? _a : undefined, className: clsx(styles.navigation, {
21
+ [styles['is-navigation-open']]: navigationOpen,
22
+ }, testutilStyles.navigation), "aria-hidden": !navigationOpen, onClick: onNavigationClick, style: {
23
+ blockSize: `calc(100vh - ${placement.insetBlockStart}px - ${placement.insetBlockEnd}px)`,
24
+ insetBlockStart: placement.insetBlockStart,
25
+ } },
26
+ React.createElement("div", { className: clsx(styles['animated-content']) },
27
+ React.createElement("div", { className: clsx(styles['hide-navigation']) },
28
+ React.createElement(InternalButton, { ariaLabel: (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationClose) !== null && _b !== void 0 ? _b : undefined, iconName: isMobile ? 'close' : 'angle-left', onClick: () => onNavigationToggle(false), variant: "icon", formAction: "none", className: testutilStyles['navigation-close'], ref: navigationFocusControl.refs.close })),
29
+ navigation)));
30
+ }
31
+ export const createWidgetizedAppLayoutNavigation = createWidgetizedComponent(AppLayoutNavigationImplementation);
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/navigation/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,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AAU,CAAE,eAAe,mCAAI,SAAS,EACnD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,EACxC,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,sBAAsB,CAAC,IAAI,CAAC,KAAK,GACtC,CACE;YACL,UAAU,CACP,CACF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG,yBAAyB,CAAC,iCAAiC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../../button/internal';\nimport { findUpUntil } from '../../../internal/utils/dom';\nimport styles from './styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutInternals } from '../interfaces';\n\ninterface AppLayoutNavigationImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutNavigationImplementation({ appLayoutInternals }: AppLayoutNavigationImplementationProps) {\n const { ariaLabels, onNavigationToggle, isMobile, navigationOpen, navigation, navigationFocusControl, placement } =\n appLayoutInternals;\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 onNavigationToggle(false);\n }\n };\n\n return (\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(\n styles.navigation,\n {\n [styles['is-navigation-open']]: navigationOpen,\n },\n testutilStyles.navigation\n )}\n aria-hidden={!navigationOpen}\n onClick={onNavigationClick}\n style={{\n blockSize: `calc(100vh - ${placement.insetBlockStart}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: placement.insetBlockStart,\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={() => onNavigationToggle(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationFocusControl.refs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n );\n}\n\nexport const createWidgetizedAppLayoutNavigation = createWidgetizedComponent(AppLayoutNavigationImplementation);\n"]}
@@ -0,0 +1,11 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "navigation": "awsui_navigation_2p2ab_1tgo2_97",
5
+ "is-navigation-open": "awsui_is-navigation-open_2p2ab_1tgo2_125",
6
+ "animating": "awsui_animating_2p2ab_1tgo2_129",
7
+ "openNavigation": "awsui_openNavigation_2p2ab_1tgo2_1",
8
+ "animated-content": "awsui_animated-content_2p2ab_1tgo2_142",
9
+ "hide-navigation": "awsui_hide-navigation_2p2ab_1tgo2_151"
10
+ };
11
+
@@ -0,0 +1,155 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /*
54
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
+ SPDX-License-Identifier: Apache-2.0
56
+ */
57
+ /*
58
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
+ SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ /*
62
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
+ SPDX-License-Identifier: Apache-2.0
64
+ */
65
+ /*
66
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
+ SPDX-License-Identifier: Apache-2.0
68
+ */
69
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
70
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
71
+ /*
72
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
73
+ SPDX-License-Identifier: Apache-2.0
74
+ */
75
+ /*
76
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77
+ SPDX-License-Identifier: Apache-2.0
78
+ */
79
+ /*
80
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
81
+ SPDX-License-Identifier: Apache-2.0
82
+ */
83
+ /*
84
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
85
+ SPDX-License-Identifier: Apache-2.0
86
+ */
87
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
88
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ /*
94
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
+ SPDX-License-Identifier: Apache-2.0
96
+ */
97
+ .awsui_navigation_2p2ab_1tgo2_97:not(#\9) {
98
+ position: sticky;
99
+ background-color: var(--color-background-container-content-4un1ap, #ffffff);
100
+ inset-block-end: 0;
101
+ block-size: 100%;
102
+ overflow-x: hidden;
103
+ overflow-y: auto;
104
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
105
+ overscroll-behavior-y: contain;
106
+ word-wrap: break-word;
107
+ pointer-events: auto;
108
+ z-index: 1001;
109
+ /*
110
+ A non-semantic node is added with a fixed width equal to the final Navigation
111
+ width. This will create the visual appearance of horizontal movement and
112
+ prevent unwanted text wrapping.
113
+ */
114
+ }
115
+ @keyframes awsui_openNavigation_2p2ab_1tgo2_1 {
116
+ from {
117
+ opacity: 0;
118
+ inline-size: calc(var(--space-layout-toggle-padding-lcu6qi, 12px) * 2 + var(--space-layout-toggle-diameter-hb85rk, 36px));
119
+ }
120
+ to {
121
+ opacity: 1;
122
+ inline-size: var(--awsui-navigation-width-9rhwr5);
123
+ }
124
+ }
125
+ .awsui_navigation_2p2ab_1tgo2_97:not(#\9):not(.awsui_is-navigation-open_2p2ab_1tgo2_125) {
126
+ inline-size: 0;
127
+ display: none;
128
+ }
129
+ .awsui_navigation_2p2ab_1tgo2_97.awsui_is-navigation-open_2p2ab_1tgo2_125.awsui_animating_2p2ab_1tgo2_129:not(#\9) {
130
+ animation: awsui_openNavigation_2p2ab_1tgo2_1 var(--motion-duration-refresh-only-fast-4jn2d7, 115ms);
131
+ }
132
+ @media (prefers-reduced-motion: reduce) {
133
+ .awsui_navigation_2p2ab_1tgo2_97.awsui_is-navigation-open_2p2ab_1tgo2_125.awsui_animating_2p2ab_1tgo2_129:not(#\9) {
134
+ animation: none;
135
+ transition: none;
136
+ }
137
+ }
138
+ .awsui-motion-disabled .awsui_navigation_2p2ab_1tgo2_97.awsui_is-navigation-open_2p2ab_1tgo2_125.awsui_animating_2p2ab_1tgo2_129:not(#\9), .awsui-mode-entering .awsui_navigation_2p2ab_1tgo2_97.awsui_is-navigation-open_2p2ab_1tgo2_125.awsui_animating_2p2ab_1tgo2_129:not(#\9) {
139
+ animation: none;
140
+ transition: none;
141
+ }
142
+ .awsui_navigation_2p2ab_1tgo2_97 > .awsui_animated-content_2p2ab_1tgo2_142:not(#\9) {
143
+ inline-size: var(--awsui-navigation-width-9rhwr5);
144
+ }
145
+ @media (max-width: 688px) {
146
+ .awsui_navigation_2p2ab_1tgo2_97:not(#\9) {
147
+ --awsui-navigation-width-9rhwr5: 100vw;
148
+ }
149
+ }
150
+
151
+ .awsui_hide-navigation_2p2ab_1tgo2_151:not(#\9) {
152
+ position: absolute;
153
+ inset-inline-end: var(--space-m-udix3p, 16px);
154
+ inset-block-start: var(--size-vertical-panel-icon-offset-wy8j08, 15px);
155
+ }
@@ -0,0 +1,12 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "navigation": "awsui_navigation_2p2ab_1tgo2_97",
6
+ "is-navigation-open": "awsui_is-navigation-open_2p2ab_1tgo2_125",
7
+ "animating": "awsui_animating_2p2ab_1tgo2_129",
8
+ "openNavigation": "awsui_openNavigation_2p2ab_1tgo2_1",
9
+ "animated-content": "awsui_animated-content_2p2ab_1tgo2_142",
10
+ "hide-navigation": "awsui_hide-navigation_2p2ab_1tgo2_151"
11
+ };
12
+
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AppLayoutInternals } from '../interfaces';
3
+ interface AppLayoutNotificationsImplementationProps {
4
+ appLayoutInternals: AppLayoutInternals;
5
+ children: React.ReactNode;
6
+ }
7
+ export declare function AppLayoutNotificationsImplementation({ appLayoutInternals, children, }: AppLayoutNotificationsImplementationProps): JSX.Element;
8
+ export declare const createWidgetizedAppLayoutNotifications: (Loader?: typeof AppLayoutNotificationsImplementation | undefined) => typeof AppLayoutNotificationsImplementation;
9
+ export {};
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/notifications/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAInD,UAAU,yCAAyC;IACjD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,oCAAoC,CAAC,EACnD,kBAAkB,EAClB,QAAQ,GACT,EAAE,yCAAyC,eAe3C;AAED,eAAO,MAAM,sCAAsC,mHAAkE,CAAC"}
@@ -0,0 +1,17 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+ import clsx from 'clsx';
5
+ import { NotificationsSlot } from '../skeleton/slot-wrappers';
6
+ import { createWidgetizedComponent } from '../../../internal/widgets';
7
+ import styles from './styles.css.js';
8
+ import testutilStyles from '../../test-classes/styles.css.js';
9
+ export function AppLayoutNotificationsImplementation({ appLayoutInternals, children, }) {
10
+ const { ariaLabels, stickyNotifications, notificationsRef, verticalOffsets } = appLayoutInternals;
11
+ return (React.createElement(NotificationsSlot, { ref: notificationsRef, className: clsx(stickyNotifications && styles['sticky-notifications']), style: {
12
+ insetBlockStart: stickyNotifications ? verticalOffsets.notifications : undefined,
13
+ } },
14
+ React.createElement("div", { className: testutilStyles.notifications, role: "region", "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.notifications }, children)));
15
+ }
16
+ export const createWidgetizedAppLayoutNotifications = createWidgetizedComponent(AppLayoutNotificationsImplementation);
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/notifications/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAO9D,MAAM,UAAU,oCAAoC,CAAC,EACnD,kBAAkB,EAClB,QAAQ,GACkC;IAC1C,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,kBAAkB,CAAC;IAClG,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,IAAI,CAAC,mBAAmB,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC,EACtE,KAAK,EAAE;YACL,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;SACjF;QAED,6BAAK,SAAS,EAAE,cAAc,CAAC,aAAa,EAAE,IAAI,EAAC,QAAQ,gBAAa,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,aAAa,IAC9F,QAAQ,CACL,CACY,CACrB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,oCAAoC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { NotificationsSlot } from '../skeleton/slot-wrappers';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutInternals } from '../interfaces';\nimport styles from './styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\n\ninterface AppLayoutNotificationsImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n children: React.ReactNode;\n}\n\nexport function AppLayoutNotificationsImplementation({\n appLayoutInternals,\n children,\n}: AppLayoutNotificationsImplementationProps) {\n const { ariaLabels, stickyNotifications, notificationsRef, verticalOffsets } = appLayoutInternals;\n return (\n <NotificationsSlot\n ref={notificationsRef}\n className={clsx(stickyNotifications && styles['sticky-notifications'])}\n style={{\n insetBlockStart: stickyNotifications ? verticalOffsets.notifications : undefined,\n }}\n >\n <div className={testutilStyles.notifications} role=\"region\" aria-label={ariaLabels?.notifications}>\n {children}\n </div>\n </NotificationsSlot>\n );\n}\n\nexport const createWidgetizedAppLayoutNotifications = createWidgetizedComponent(AppLayoutNotificationsImplementation);\n"]}
@@ -0,0 +1,6 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "sticky-notifications": "awsui_sticky-notifications_154bi_1h0wm_5"
5
+ };
6
+
@@ -0,0 +1,8 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_sticky-notifications_154bi_1h0wm_5:not(#\9) {
6
+ position: sticky;
7
+ z-index: 850;
8
+ }
@@ -0,0 +1,7 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "sticky-notifications": "awsui_sticky-notifications_154bi_1h0wm_5"
6
+ };
7
+