@cloudscape-design/components 3.0.730 → 3.0.731

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 (103) hide show
  1. package/app-layout/classic.js +1 -1
  2. package/app-layout/classic.js.map +1 -1
  3. package/app-layout/drawer/styles.css.js +13 -13
  4. package/app-layout/drawer/styles.scoped.css +22 -22
  5. package/app-layout/drawer/styles.selectors.js +13 -13
  6. package/app-layout/mobile-toolbar/styles.css.js +8 -8
  7. package/app-layout/mobile-toolbar/styles.scoped.css +10 -10
  8. package/app-layout/mobile-toolbar/styles.selectors.js +8 -8
  9. package/app-layout/resize/styles.css.js +9 -0
  10. package/app-layout/resize/styles.scoped.css +179 -0
  11. package/app-layout/resize/styles.selectors.js +10 -0
  12. package/app-layout/styles.css.js +12 -16
  13. package/app-layout/styles.scoped.css +12 -43
  14. package/app-layout/styles.selectors.js +12 -16
  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-pointer-events.js +1 -1
  18. package/app-layout/utils/use-pointer-events.js.map +1 -1
  19. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts +2 -1
  20. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  21. package/app-layout/visual-refresh-toolbar/compute-layout.js +2 -2
  22. package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  23. package/app-layout/visual-refresh-toolbar/drawer/index.d.ts.map +1 -1
  24. package/app-layout/visual-refresh-toolbar/drawer/index.js +4 -4
  25. package/app-layout/visual-refresh-toolbar/drawer/index.js.map +1 -1
  26. package/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts.map +1 -1
  27. package/app-layout/visual-refresh-toolbar/drawer/use-resize.js +1 -0
  28. package/app-layout/visual-refresh-toolbar/drawer/use-resize.js.map +1 -1
  29. package/app-layout/visual-refresh-toolbar/index.js +3 -3
  30. package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  31. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -6
  32. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +6 -29
  33. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -6
  34. package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
  35. package/app-layout/visual-refresh-toolbar/skeleton/index.js +4 -3
  36. package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
  37. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +16 -16
  38. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +45 -31
  39. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +16 -16
  40. package/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +13 -13
  41. package/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +15 -16
  42. package/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +13 -13
  43. package/expandable-section/analytics-metadata/interfaces.d.ts +17 -0
  44. package/expandable-section/analytics-metadata/interfaces.d.ts.map +1 -0
  45. package/expandable-section/analytics-metadata/interfaces.js +4 -0
  46. package/expandable-section/analytics-metadata/interfaces.js.map +1 -0
  47. package/expandable-section/analytics-metadata/styles.css.js +6 -0
  48. package/expandable-section/analytics-metadata/styles.scoped.css +7 -0
  49. package/expandable-section/analytics-metadata/styles.selectors.js +7 -0
  50. package/expandable-section/expandable-section-container.d.ts +2 -1
  51. package/expandable-section/expandable-section-container.d.ts.map +1 -1
  52. package/expandable-section/expandable-section-container.js +13 -3
  53. package/expandable-section/expandable-section-container.js.map +1 -1
  54. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  55. package/expandable-section/expandable-section-header.js +19 -7
  56. package/expandable-section/expandable-section-header.js.map +1 -1
  57. package/expandable-section/index.d.ts.map +1 -1
  58. package/expandable-section/index.js +1 -1
  59. package/expandable-section/index.js.map +1 -1
  60. package/expandable-section/internal.d.ts +2 -1
  61. package/expandable-section/internal.d.ts.map +1 -1
  62. package/expandable-section/internal.js +2 -2
  63. package/expandable-section/internal.js.map +1 -1
  64. package/flashbar/styles.css.js +47 -47
  65. package/flashbar/styles.scoped.css +158 -158
  66. package/flashbar/styles.selectors.js +47 -47
  67. package/internal/base-component/styles.scoped.css +10 -5
  68. package/internal/environment.js +1 -1
  69. package/internal/environment.json +1 -1
  70. package/internal/generated/styles/tokens.js +1 -1
  71. package/internal/generated/theming/index.cjs +15 -15
  72. package/internal/generated/theming/index.js +15 -15
  73. package/internal/manifest.json +1 -1
  74. package/package.json +1 -1
  75. package/split-panel/bottom.d.ts +1 -4
  76. package/split-panel/bottom.d.ts.map +1 -1
  77. package/split-panel/bottom.js +5 -7
  78. package/split-panel/bottom.js.map +1 -1
  79. package/split-panel/implementation.d.ts.map +1 -1
  80. package/split-panel/implementation.js +5 -5
  81. package/split-panel/implementation.js.map +1 -1
  82. package/split-panel/side.d.ts.map +1 -1
  83. package/split-panel/side.js +5 -3
  84. package/split-panel/side.js.map +1 -1
  85. package/split-panel/styles.css.js +26 -27
  86. package/split-panel/styles.scoped.css +50 -215
  87. package/split-panel/styles.selectors.js +26 -27
  88. package/tabs/analytics-metadata/interfaces.d.ts +33 -0
  89. package/tabs/analytics-metadata/interfaces.d.ts.map +1 -0
  90. package/tabs/analytics-metadata/interfaces.js +4 -0
  91. package/tabs/analytics-metadata/interfaces.js.map +1 -0
  92. package/tabs/analytics-metadata/styles.css.js +9 -0
  93. package/tabs/analytics-metadata/styles.scoped.css +10 -0
  94. package/tabs/analytics-metadata/styles.selectors.js +10 -0
  95. package/tabs/index.d.ts.map +1 -1
  96. package/tabs/index.js +16 -2
  97. package/tabs/index.js.map +1 -1
  98. package/tabs/tab-header-bar.d.ts.map +1 -1
  99. package/tabs/tab-header-bar.js +36 -9
  100. package/tabs/tab-header-bar.js.map +1 -1
  101. package/wizard/styles.css.js +30 -30
  102. package/wizard/styles.scoped.css +59 -59
  103. package/wizard/styles.selectors.js +30 -30
@@ -0,0 +1,179 @@
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
+ /*
70
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
71
+ SPDX-License-Identifier: Apache-2.0
72
+ */
73
+ /*
74
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
75
+ SPDX-License-Identifier: Apache-2.0
76
+ */
77
+ /*
78
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
79
+ SPDX-License-Identifier: Apache-2.0
80
+ */
81
+ /*
82
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
83
+ SPDX-License-Identifier: Apache-2.0
84
+ */
85
+ /*
86
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
+ SPDX-License-Identifier: Apache-2.0
88
+ */
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
+ /*
98
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
99
+ SPDX-License-Identifier: Apache-2.0
100
+ */
101
+ /*
102
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
103
+ SPDX-License-Identifier: Apache-2.0
104
+ */
105
+ /*
106
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
107
+ SPDX-License-Identifier: Apache-2.0
108
+ */
109
+ /*
110
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
111
+ SPDX-License-Identifier: Apache-2.0
112
+ */
113
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
114
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
115
+ /*
116
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
117
+ SPDX-License-Identifier: Apache-2.0
118
+ */
119
+ /*
120
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
121
+ SPDX-License-Identifier: Apache-2.0
122
+ */
123
+ /*
124
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
125
+ SPDX-License-Identifier: Apache-2.0
126
+ */
127
+ /*
128
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
129
+ SPDX-License-Identifier: Apache-2.0
130
+ */
131
+ /*
132
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
133
+ SPDX-License-Identifier: Apache-2.0
134
+ */
135
+ /*
136
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
137
+ SPDX-License-Identifier: Apache-2.0
138
+ */
139
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
140
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
141
+ @media (min-width: 689px) {
142
+ .awsui_with-motion_b18tp_1fglm_142:not(#\9) {
143
+ transition: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
144
+ transition-property: border-color, opacity, block-size, inline-size;
145
+ }
146
+ }
147
+ @media (min-width: 689px) and (prefers-reduced-motion: reduce) {
148
+ .awsui_with-motion_b18tp_1fglm_142:not(#\9) {
149
+ animation: none;
150
+ transition: none;
151
+ }
152
+ }
153
+ @media (min-width: 689px) {
154
+ .awsui-motion-disabled .awsui_with-motion_b18tp_1fglm_142:not(#\9), .awsui-mode-entering .awsui_with-motion_b18tp_1fglm_142:not(#\9) {
155
+ animation: none;
156
+ transition: none;
157
+ }
158
+ }
159
+
160
+ /* stylelint-disable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
161
+ .awsui_resize-active_b18tp_1fglm_161 *:not(#\9) {
162
+ -webkit-user-select: none;
163
+ user-select: none;
164
+ }
165
+ .awsui_resize-active_b18tp_1fglm_161 * .awsui_with-motion_b18tp_1fglm_142:not(#\9) {
166
+ transition: none;
167
+ animation: none;
168
+ }
169
+ .awsui_resize-active_b18tp_1fglm_161 iframe:not(#\9) {
170
+ pointer-events: none;
171
+ }
172
+ .awsui_resize-side_b18tp_1fglm_171 *:not(#\9) {
173
+ cursor: ew-resize;
174
+ }
175
+ .awsui_resize-bottom_b18tp_1fglm_174 *:not(#\9) {
176
+ cursor: ns-resize;
177
+ }
178
+
179
+ /* stylelint-enable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
@@ -0,0 +1,10 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "with-motion": "awsui_with-motion_b18tp_1fglm_142",
6
+ "resize-active": "awsui_resize-active_b18tp_1fglm_161",
7
+ "resize-side": "awsui_resize-side_b18tp_1fglm_171",
8
+ "resize-bottom": "awsui_resize-bottom_b18tp_1fglm_174"
9
+ };
10
+
@@ -1,21 +1,17 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "resize-active": "awsui_resize-active_lm6vo_lnp81_150",
5
- "resize-side": "awsui_resize-side_lm6vo_lnp81_156",
6
- "resize-bottom": "awsui_resize-bottom_lm6vo_lnp81_159",
7
- "with-motion": "awsui_with-motion_lm6vo_lnp81_164",
8
- "root": "awsui_root_lm6vo_lnp81_179",
9
- "root-no-scroll": "awsui_root-no-scroll_lm6vo_lnp81_186",
10
- "layout": "awsui_layout_lm6vo_lnp81_191",
11
- "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_lnp81_197",
12
- "layout-main": "awsui_layout-main_lm6vo_lnp81_201",
13
- "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_lnp81_207",
14
- "unfocusable": "awsui_unfocusable_lm6vo_lnp81_212",
15
- "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_lnp81_216",
16
- "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_lnp81_221",
17
- "content-wrapper": "awsui_content-wrapper_lm6vo_lnp81_225",
18
- "content-overlapped": "awsui_content-overlapped_lm6vo_lnp81_229",
19
- "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_lnp81_233"
4
+ "root": "awsui_root_lm6vo_1sk5h_149",
5
+ "root-no-scroll": "awsui_root-no-scroll_lm6vo_1sk5h_156",
6
+ "layout": "awsui_layout_lm6vo_1sk5h_161",
7
+ "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_1sk5h_167",
8
+ "layout-main": "awsui_layout-main_lm6vo_1sk5h_171",
9
+ "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_1sk5h_177",
10
+ "unfocusable": "awsui_unfocusable_lm6vo_1sk5h_182",
11
+ "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_1sk5h_186",
12
+ "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_1sk5h_191",
13
+ "content-wrapper": "awsui_content-wrapper_lm6vo_1sk5h_195",
14
+ "content-overlapped": "awsui_content-overlapped_lm6vo_1sk5h_199",
15
+ "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_1sk5h_203"
20
16
  };
21
17
 
@@ -146,91 +146,60 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
146
146
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
147
147
  SPDX-License-Identifier: Apache-2.0
148
148
  */
149
- /* stylelint-disable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
150
- .awsui_resize-active_lm6vo_lnp81_150 *:not(#\9) {
151
- -webkit-user-select: none;
152
- user-select: none;
153
- }
154
- .awsui_resize-active_lm6vo_lnp81_150 iframe:not(#\9) {
155
- pointer-events: none;
156
- }
157
- .awsui_resize-side_lm6vo_lnp81_156 *:not(#\9) {
158
- cursor: ew-resize;
159
- }
160
- .awsui_resize-bottom_lm6vo_lnp81_159 *:not(#\9) {
161
- cursor: ns-resize;
162
- }
163
-
164
- /* stylelint-enable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
165
- .awsui_with-motion_lm6vo_lnp81_164:not(#\9) {
166
- transition: var(--motion-duration-refresh-only-fast-4jn2d7, 115ms);
167
- transition-property: border-color, opacity, width;
168
- }
169
- @media (prefers-reduced-motion: reduce) {
170
- .awsui_with-motion_lm6vo_lnp81_164:not(#\9) {
171
- animation: none;
172
- transition: none;
173
- }
174
- }
175
- .awsui-motion-disabled .awsui_with-motion_lm6vo_lnp81_164:not(#\9), .awsui-mode-entering .awsui_with-motion_lm6vo_lnp81_164:not(#\9) {
176
- animation: none;
177
- transition: none;
178
- }
179
-
180
- .awsui_root_lm6vo_lnp81_179:not(#\9) {
149
+ .awsui_root_lm6vo_1sk5h_149:not(#\9) {
181
150
  display: flex;
182
151
  flex-direction: column;
183
152
  position: relative;
184
153
  color: var(--color-text-body-default-at06ol, #000716);
185
154
  }
186
155
 
187
- .awsui_root-no-scroll_lm6vo_lnp81_186:not(#\9) {
156
+ .awsui_root-no-scroll_lm6vo_1sk5h_156:not(#\9) {
188
157
  position: relative;
189
158
  z-index: 1;
190
159
  }
191
160
 
192
- .awsui_layout_lm6vo_lnp81_191:not(#\9) {
161
+ .awsui_layout_lm6vo_1sk5h_161:not(#\9) {
193
162
  flex: 1 1 auto;
194
163
  display: flex;
195
164
  align-items: stretch;
196
165
  background-color: var(--color-background-layout-main-nx09lr, #ffffff);
197
166
  }
198
- .awsui_layout-no-scroll_lm6vo_lnp81_197:not(#\9) {
167
+ .awsui_layout-no-scroll_lm6vo_1sk5h_167:not(#\9) {
199
168
  overflow: hidden;
200
169
  }
201
170
 
202
- .awsui_layout-main_lm6vo_lnp81_201:not(#\9) {
171
+ .awsui_layout-main_lm6vo_1sk5h_171:not(#\9) {
203
172
  flex: 1;
204
173
  min-inline-size: 0;
205
174
  background-color: var(--color-background-layout-main-nx09lr, #ffffff);
206
175
  position: relative;
207
176
  }
208
- .awsui_layout-main-scrollable_lm6vo_lnp81_207:not(#\9) {
177
+ .awsui_layout-main-scrollable_lm6vo_1sk5h_177:not(#\9) {
209
178
  overflow: auto;
210
179
  }
211
180
 
212
181
  /* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
213
- .awsui_unfocusable_lm6vo_lnp81_212 *:not(#\9) {
182
+ .awsui_unfocusable_lm6vo_1sk5h_182 *:not(#\9) {
214
183
  visibility: hidden;
215
184
  }
216
185
 
217
- .awsui_breadcrumbs-desktop_lm6vo_lnp81_216:not(#\9) {
186
+ .awsui_breadcrumbs-desktop_lm6vo_1sk5h_186:not(#\9) {
218
187
  padding-block-start: var(--space-scaled-m-mo5yse, 16px);
219
188
  padding-block-end: var(--space-scaled-s-aqzyko, 12px);
220
189
  }
221
190
 
222
- .awsui_content-header-wrapper_lm6vo_lnp81_221:not(#\9) {
191
+ .awsui_content-header-wrapper_lm6vo_1sk5h_191:not(#\9) {
223
192
  padding-block-end: var(--space-content-header-padding-bottom-y2enua, 16px);
224
193
  }
225
194
 
226
- .awsui_content-wrapper_lm6vo_lnp81_225:not(#\9) {
195
+ .awsui_content-wrapper_lm6vo_1sk5h_195:not(#\9) {
227
196
  padding-block-end: var(--space-layout-content-bottom-noqzmw, 40px);
228
197
  }
229
198
 
230
- .awsui_content-overlapped_lm6vo_lnp81_229:not(#\9) {
199
+ .awsui_content-overlapped_lm6vo_1sk5h_199:not(#\9) {
231
200
  margin-block-start: calc(-1 * var(--space-dark-header-overlap-distance-lxpp0s, 36px));
232
201
  }
233
202
 
234
- .awsui_content-extra-top-padding_lm6vo_lnp81_233:not(#\9) {
203
+ .awsui_content-extra-top-padding_lm6vo_1sk5h_203:not(#\9) {
235
204
  padding-block-start: var(--space-scaled-m-mo5yse, 16px);
236
205
  }
@@ -2,21 +2,17 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "resize-active": "awsui_resize-active_lm6vo_lnp81_150",
6
- "resize-side": "awsui_resize-side_lm6vo_lnp81_156",
7
- "resize-bottom": "awsui_resize-bottom_lm6vo_lnp81_159",
8
- "with-motion": "awsui_with-motion_lm6vo_lnp81_164",
9
- "root": "awsui_root_lm6vo_lnp81_179",
10
- "root-no-scroll": "awsui_root-no-scroll_lm6vo_lnp81_186",
11
- "layout": "awsui_layout_lm6vo_lnp81_191",
12
- "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_lnp81_197",
13
- "layout-main": "awsui_layout-main_lm6vo_lnp81_201",
14
- "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_lnp81_207",
15
- "unfocusable": "awsui_unfocusable_lm6vo_lnp81_212",
16
- "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_lnp81_216",
17
- "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_lnp81_221",
18
- "content-wrapper": "awsui_content-wrapper_lm6vo_lnp81_225",
19
- "content-overlapped": "awsui_content-overlapped_lm6vo_lnp81_229",
20
- "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_lnp81_233"
5
+ "root": "awsui_root_lm6vo_1sk5h_149",
6
+ "root-no-scroll": "awsui_root-no-scroll_lm6vo_1sk5h_156",
7
+ "layout": "awsui_layout_lm6vo_1sk5h_161",
8
+ "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_1sk5h_167",
9
+ "layout-main": "awsui_layout-main_lm6vo_1sk5h_171",
10
+ "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_1sk5h_177",
11
+ "unfocusable": "awsui_unfocusable_lm6vo_1sk5h_182",
12
+ "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_1sk5h_186",
13
+ "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_1sk5h_191",
14
+ "content-wrapper": "awsui_content-wrapper_lm6vo_1sk5h_195",
15
+ "content-overlapped": "awsui_content-overlapped_lm6vo_1sk5h_199",
16
+ "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_1sk5h_203"
21
17
  };
22
18
 
@@ -98,7 +98,7 @@ export function useDrawers({ drawers, activeDrawerId: controlledActiveDrawerId,
98
98
  activeDrawerIdResolved = (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== null && _a !== void 0 ? _a : null;
99
99
  const activeDrawerSize = activeDrawerIdResolved
100
100
  ? (_c = (_b = drawerSizes[activeDrawerIdResolved]) !== null && _b !== void 0 ? _b : activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _c !== void 0 ? _c : toolsProps.toolsWidth
101
- : 0;
101
+ : toolsProps.toolsWidth;
102
102
  const minDrawerSize = Math.min((_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _d !== void 0 ? _d : 290, 290);
103
103
  return {
104
104
  ariaLabelsWithDrawers: ariaLabels,
@@ -1 +1 @@
1
- {"version":3,"file":"use-drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-drawers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAiB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY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AAC,CAAC,cAAc,CAAC;IACxG,MAAM,YAAY,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,sBAAsB,CAAC,CAAC;IAC3F,wDAAwD;IACxD,sBAAsB,GAAG,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,mCAAI,IAAI,CAAC;IAElD,MAAM,gBAAgB,GAAG,sBAAsB;QAC7C,CAAC,CAAC,MAAA,MAAA,WAAW,CAAC,sBAAsB,CAAC,mCAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,mCAAI,UAAU,CAAC,UAAU;QAC3F,CAAC,CAAC,CAAC,CAAC;IACN,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,mCAAI,GAAG,EAAE,GAAG,CAAC,CAAC;IAEtE,OAAO;QACL,qBAAqB,EAAE,UAAU;QACjC,OAAO,EAAE,eAAe,IAAI,SAAS;QACrC,YAAY;QACZ,cAAc,EAAE,sBAAsB;QACtC,gBAAgB;QAChB,aAAa;QACb,oBAAoB;QACpB,oBAAoB;KACrB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { AppLayoutProps } from '../interfaces';\nimport { convertRuntimeDrawers, DrawersLayout } from '../runtime-api';\nimport { togglesConfig } from '../toggles';\n\nexport const TOOLS_DRAWER_ID = 'awsui-internal-tools';\n\ninterface ToolsProps {\n toolsHide: boolean | undefined;\n toolsOpen: boolean | undefined;\n toolsWidth: number;\n tools: React.ReactNode | undefined;\n onToolsToggle: (newOpen: boolean) => void;\n ariaLabels: AppLayoutProps.Labels | undefined;\n disableDrawersMerge?: boolean;\n}\n\nfunction getToolsDrawerItem(props: ToolsProps): AppLayoutProps.Drawer | null {\n if (props.toolsHide) {\n return null;\n }\n const { iconName, getLabels } = togglesConfig.tools;\n const { mainLabel, closeLabel, openLabel } = getLabels(props.ariaLabels);\n return {\n id: TOOLS_DRAWER_ID,\n content: props.tools,\n resizable: false,\n ariaLabels: {\n triggerButton: openLabel,\n closeButton: closeLabel,\n drawerName: mainLabel ?? '',\n },\n trigger: {\n iconName: iconName,\n },\n };\n}\n\nfunction useRuntimeDrawers(\n disableRuntimeDrawers: boolean | undefined,\n activeDrawerId: string | null,\n onActiveDrawerChange: (newDrawerId: string | null) => void\n) {\n const [runtimeDrawers, setRuntimeDrawers] = useState<DrawersLayout>({ before: [], after: [] });\n const onActiveDrawerChangeStable = useStableCallback(onActiveDrawerChange);\n\n const drawerWasOpenRef = useRef(false);\n drawerWasOpenRef.current = drawerWasOpenRef.current || !!activeDrawerId;\n\n useEffect(() => {\n if (disableRuntimeDrawers) {\n return;\n }\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered(drawers => {\n setRuntimeDrawers(convertRuntimeDrawers(drawers));\n if (!drawerWasOpenRef.current) {\n const defaultActiveDrawer = sortByPriority(drawers).find(drawer => drawer.defaultActive);\n if (defaultActiveDrawer) {\n onActiveDrawerChangeStable(defaultActiveDrawer.id);\n }\n }\n });\n return () => {\n unsubscribe();\n setRuntimeDrawers({ before: [], after: [] });\n };\n }, [disableRuntimeDrawers, onActiveDrawerChangeStable]);\n\n return runtimeDrawers;\n}\n\nfunction applyToolsDrawer(toolsProps: ToolsProps, runtimeDrawers: DrawersLayout) {\n const drawers = [...runtimeDrawers.before, ...runtimeDrawers.after];\n if (drawers.length === 0 && toolsProps.disableDrawersMerge) {\n return null;\n }\n const toolsItem = getToolsDrawerItem(toolsProps);\n if (toolsItem) {\n drawers.unshift(toolsItem);\n }\n\n return drawers;\n}\n\ntype UseDrawersProps = Pick<AppLayoutProps, 'drawers' | 'activeDrawerId' | 'onDrawerChange'> & {\n __disableRuntimeDrawers?: boolean;\n};\n\nexport function useDrawers(\n {\n drawers,\n activeDrawerId: controlledActiveDrawerId,\n onDrawerChange,\n __disableRuntimeDrawers: disableRuntimeDrawers,\n }: UseDrawersProps,\n ariaLabels: AppLayoutProps['ariaLabels'],\n toolsProps: ToolsProps\n) {\n const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'activeDrawerId',\n changeHandler: 'onChange',\n });\n const [drawerSizes, setDrawerSizes] = useState<Record<string, number>>({});\n\n function onActiveDrawerResize({ id, size }: { id: string; size: number }) {\n setDrawerSizes(oldSizes => ({ ...oldSizes, [id]: size }));\n fireNonCancelableEvent(activeDrawer?.onResize, { id, size });\n }\n\n function onActiveDrawerChange(newDrawerId: string | null) {\n setActiveDrawerId(newDrawerId);\n if (hasOwnDrawers) {\n fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId });\n } else if (!toolsProps.toolsHide) {\n toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID);\n }\n }\n\n const hasOwnDrawers = !!drawers;\n const runtimeDrawers = useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange);\n const combinedDrawers = drawers\n ? [...runtimeDrawers.before, ...drawers, ...runtimeDrawers.after]\n : applyToolsDrawer(toolsProps, runtimeDrawers);\n // support toolsOpen in runtime-drawers-only mode\n let activeDrawerIdResolved = toolsProps?.toolsOpen && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId;\n const activeDrawer = combinedDrawers?.find(drawer => drawer.id === activeDrawerIdResolved);\n // ensure that id is only defined when the drawer exists\n activeDrawerIdResolved = activeDrawer?.id ?? null;\n\n const activeDrawerSize = activeDrawerIdResolved\n ? drawerSizes[activeDrawerIdResolved] ?? activeDrawer?.defaultSize ?? toolsProps.toolsWidth\n : 0;\n const minDrawerSize = Math.min(activeDrawer?.defaultSize ?? 290, 290);\n\n return {\n ariaLabelsWithDrawers: ariaLabels,\n drawers: combinedDrawers || undefined,\n activeDrawer,\n activeDrawerId: activeDrawerIdResolved,\n activeDrawerSize,\n minDrawerSize,\n onActiveDrawerChange,\n onActiveDrawerResize,\n };\n}\n"]}
1
+ {"version":3,"file":"use-drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-drawers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAiB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAYtD,SAAS,kBAAkB,CAAC,KAAiB;IAC3C,IAAI,KAAK,CAAC,SAAS,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC;IACpD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzE,OAAO;QACL,EAAE,EAAE,eAA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AAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,mCAAI,UAAU,CAAC,UAAU;QAC3F,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IAC1B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,mCAAI,GAAG,EAAE,GAAG,CAAC,CAAC;IAEtE,OAAO;QACL,qBAAqB,EAAE,UAAU;QACjC,OAAO,EAAE,eAAe,IAAI,SAAS;QACrC,YAAY;QACZ,cAAc,EAAE,sBAAsB;QACtC,gBAAgB;QAChB,aAAa;QACb,oBAAoB;QACpB,oBAAoB;KACrB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { AppLayoutProps } from '../interfaces';\nimport { convertRuntimeDrawers, DrawersLayout } from '../runtime-api';\nimport { togglesConfig } from '../toggles';\n\nexport const TOOLS_DRAWER_ID = 'awsui-internal-tools';\n\ninterface ToolsProps {\n toolsHide: boolean | undefined;\n toolsOpen: boolean | undefined;\n toolsWidth: number;\n tools: React.ReactNode | undefined;\n onToolsToggle: (newOpen: boolean) => void;\n ariaLabels: AppLayoutProps.Labels | undefined;\n disableDrawersMerge?: boolean;\n}\n\nfunction getToolsDrawerItem(props: ToolsProps): AppLayoutProps.Drawer | null {\n if (props.toolsHide) {\n return null;\n }\n const { iconName, getLabels } = togglesConfig.tools;\n const { mainLabel, closeLabel, openLabel } = getLabels(props.ariaLabels);\n return {\n id: TOOLS_DRAWER_ID,\n content: props.tools,\n resizable: false,\n ariaLabels: {\n triggerButton: openLabel,\n closeButton: closeLabel,\n drawerName: mainLabel ?? '',\n },\n trigger: {\n iconName: iconName,\n },\n };\n}\n\nfunction useRuntimeDrawers(\n disableRuntimeDrawers: boolean | undefined,\n activeDrawerId: string | null,\n onActiveDrawerChange: (newDrawerId: string | null) => void\n) {\n const [runtimeDrawers, setRuntimeDrawers] = useState<DrawersLayout>({ before: [], after: [] });\n const onActiveDrawerChangeStable = useStableCallback(onActiveDrawerChange);\n\n const drawerWasOpenRef = useRef(false);\n drawerWasOpenRef.current = drawerWasOpenRef.current || !!activeDrawerId;\n\n useEffect(() => {\n if (disableRuntimeDrawers) {\n return;\n }\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered(drawers => {\n setRuntimeDrawers(convertRuntimeDrawers(drawers));\n if (!drawerWasOpenRef.current) {\n const defaultActiveDrawer = sortByPriority(drawers).find(drawer => drawer.defaultActive);\n if (defaultActiveDrawer) {\n onActiveDrawerChangeStable(defaultActiveDrawer.id);\n }\n }\n });\n return () => {\n unsubscribe();\n setRuntimeDrawers({ before: [], after: [] });\n };\n }, [disableRuntimeDrawers, onActiveDrawerChangeStable]);\n\n return runtimeDrawers;\n}\n\nfunction applyToolsDrawer(toolsProps: ToolsProps, runtimeDrawers: DrawersLayout) {\n const drawers = [...runtimeDrawers.before, ...runtimeDrawers.after];\n if (drawers.length === 0 && toolsProps.disableDrawersMerge) {\n return null;\n }\n const toolsItem = getToolsDrawerItem(toolsProps);\n if (toolsItem) {\n drawers.unshift(toolsItem);\n }\n\n return drawers;\n}\n\ntype UseDrawersProps = Pick<AppLayoutProps, 'drawers' | 'activeDrawerId' | 'onDrawerChange'> & {\n __disableRuntimeDrawers?: boolean;\n};\n\nexport function useDrawers(\n {\n drawers,\n activeDrawerId: controlledActiveDrawerId,\n onDrawerChange,\n __disableRuntimeDrawers: disableRuntimeDrawers,\n }: UseDrawersProps,\n ariaLabels: AppLayoutProps['ariaLabels'],\n toolsProps: ToolsProps\n) {\n const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'activeDrawerId',\n changeHandler: 'onChange',\n });\n const [drawerSizes, setDrawerSizes] = useState<Record<string, number>>({});\n\n function onActiveDrawerResize({ id, size }: { id: string; size: number }) {\n setDrawerSizes(oldSizes => ({ ...oldSizes, [id]: size }));\n fireNonCancelableEvent(activeDrawer?.onResize, { id, size });\n }\n\n function onActiveDrawerChange(newDrawerId: string | null) {\n setActiveDrawerId(newDrawerId);\n if (hasOwnDrawers) {\n fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId });\n } else if (!toolsProps.toolsHide) {\n toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID);\n }\n }\n\n const hasOwnDrawers = !!drawers;\n const runtimeDrawers = useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange);\n const combinedDrawers = drawers\n ? [...runtimeDrawers.before, ...drawers, ...runtimeDrawers.after]\n : applyToolsDrawer(toolsProps, runtimeDrawers);\n // support toolsOpen in runtime-drawers-only mode\n let activeDrawerIdResolved = toolsProps?.toolsOpen && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId;\n const activeDrawer = combinedDrawers?.find(drawer => drawer.id === activeDrawerIdResolved);\n // ensure that id is only defined when the drawer exists\n activeDrawerIdResolved = activeDrawer?.id ?? null;\n\n const activeDrawerSize = activeDrawerIdResolved\n ? drawerSizes[activeDrawerIdResolved] ?? activeDrawer?.defaultSize ?? toolsProps.toolsWidth\n : toolsProps.toolsWidth;\n const minDrawerSize = Math.min(activeDrawer?.defaultSize ?? 290, 290);\n\n return {\n ariaLabelsWithDrawers: ariaLabels,\n drawers: combinedDrawers || undefined,\n activeDrawer,\n activeDrawerId: activeDrawerIdResolved,\n activeDrawerSize,\n minDrawerSize,\n onActiveDrawerChange,\n onActiveDrawerResize,\n };\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { useCallback } from 'react';
4
4
  import { getIsRtl, getLogicalBoundingClientRect, getLogicalClientX, } from '@cloudscape-design/component-toolkit/internal';
5
- import styles from '../styles.css.js';
5
+ import styles from '../resize/styles.css.js';
6
6
  export const usePointerEvents = ({ position, panelRef, handleRef, onResize, hasTransitions = false, }) => {
7
7
  const onDocumentPointerMove = useCallback((event) => {
8
8
  if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {
@@ -1 +1 @@
1
- {"version":3,"file":"use-pointer-events.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,+CAA+C,CAAC;AAIvD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,GAAG,KAAK,GACL,EAAE,EAAE;IACrB,MAAM,qBAAqB,GAAG,WAAW,CACvC,CAAC,KAAmB,EAAE,EAAE;QACtB,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;YACtE,OAAO;SACR;QAED,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAEzD,IAAI,QAAQ,KAAK,MAAM,EAAE;YACvB,MAAM,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;YAE/E,4EAA4E;YAC5E,MAAM,YAAY,GAAG,4BAA4B,CAAC,SAAS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AqB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;IAEhE,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3C,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC1D,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC5D,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAClE,CAAC,EAAE,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3D,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\n\nimport {\n getIsRtl,\n getLogicalBoundingClientRect,\n getLogicalClientX,\n} from '@cloudscape-design/component-toolkit/internal';\n\nimport { SizeControlProps } from './interfaces';\n\nimport styles from '../styles.css.js';\n\nexport const usePointerEvents = ({\n position,\n panelRef,\n handleRef,\n onResize,\n hasTransitions = false,\n}: SizeControlProps) => {\n const onDocumentPointerMove = useCallback(\n (event: PointerEvent) => {\n if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {\n return;\n }\n\n panelRef.current.classList.remove(styles['with-motion']);\n\n if (position === 'side') {\n const mouseClientX = getLogicalClientX(event, getIsRtl(panelRef.current)) || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = getLogicalBoundingClientRect(handleRef.current).inlineSize / 2;\n const width = getLogicalBoundingClientRect(panelRef.current).insetInlineEnd - mouseClientX + handleOffset;\n\n onResize(width);\n } else {\n const mouseClientY = event.clientY || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = getLogicalBoundingClientRect(handleRef.current).blockSize / 2;\n const height = getLogicalBoundingClientRect(panelRef.current).insetBlockEnd - mouseClientY + handleOffset;\n\n onResize(height);\n }\n },\n [position, panelRef, handleRef, onResize]\n );\n\n const onDocumentPointerUp = useCallback(() => {\n if (!panelRef || !panelRef.current) {\n return;\n }\n\n if (hasTransitions) {\n panelRef.current.classList.add(styles['with-motion']);\n }\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles[`resize-${position}`]);\n document.removeEventListener('pointerup', onDocumentPointerUp);\n document.removeEventListener('pointermove', onDocumentPointerMove);\n }, [panelRef, onDocumentPointerMove, position, hasTransitions]);\n\n const onSliderPointerDown = useCallback(() => {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles[`resize-${position}`]);\n document.addEventListener('pointerup', onDocumentPointerUp);\n document.addEventListener('pointermove', onDocumentPointerMove);\n }, [onDocumentPointerMove, onDocumentPointerUp, position]);\n\n return onSliderPointerDown;\n};\n"]}
1
+ {"version":3,"file":"use-pointer-events.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,+CAA+C,CAAC;AAIvD,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,GAAG,KAAK,GACL,EAAE,EAAE;IACrB,MAAM,qBAAqB,GAAG,WAAW,CACvC,CAAC,KAAmB,EAAE,EAAE;QACtB,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,OAA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AAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;QACxD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC7D,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC/D,QAAQ,CAAC,mBAAmB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;IAEhE,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3C,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC1D,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC5D,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAClE,CAAC,EAAE,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3D,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\n\nimport {\n getIsRtl,\n getLogicalBoundingClientRect,\n getLogicalClientX,\n} from '@cloudscape-design/component-toolkit/internal';\n\nimport { SizeControlProps } from './interfaces';\n\nimport styles from '../resize/styles.css.js';\n\nexport const usePointerEvents = ({\n position,\n panelRef,\n handleRef,\n onResize,\n hasTransitions = false,\n}: SizeControlProps) => {\n const onDocumentPointerMove = useCallback(\n (event: PointerEvent) => {\n if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {\n return;\n }\n\n panelRef.current.classList.remove(styles['with-motion']);\n\n if (position === 'side') {\n const mouseClientX = getLogicalClientX(event, getIsRtl(panelRef.current)) || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = getLogicalBoundingClientRect(handleRef.current).inlineSize / 2;\n const width = getLogicalBoundingClientRect(panelRef.current).insetInlineEnd - mouseClientX + handleOffset;\n\n onResize(width);\n } else {\n const mouseClientY = event.clientY || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = getLogicalBoundingClientRect(handleRef.current).blockSize / 2;\n const height = getLogicalBoundingClientRect(panelRef.current).insetBlockEnd - mouseClientY + handleOffset;\n\n onResize(height);\n }\n },\n [position, panelRef, handleRef, onResize]\n );\n\n const onDocumentPointerUp = useCallback(() => {\n if (!panelRef || !panelRef.current) {\n return;\n }\n\n if (hasTransitions) {\n panelRef.current.classList.add(styles['with-motion']);\n }\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles[`resize-${position}`]);\n document.removeEventListener('pointerup', onDocumentPointerUp);\n document.removeEventListener('pointermove', onDocumentPointerMove);\n }, [panelRef, onDocumentPointerMove, position, hasTransitions]);\n\n const onSliderPointerDown = useCallback(() => {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles[`resize-${position}`]);\n document.addEventListener('pointerup', onDocumentPointerUp);\n document.addEventListener('pointermove', onDocumentPointerMove);\n }, [onDocumentPointerMove, onDocumentPointerUp, position]);\n\n return onSliderPointerDown;\n};\n"]}
@@ -8,8 +8,9 @@ interface HorizontalLayoutInput {
8
8
  splitPanelOpen: boolean;
9
9
  splitPanelPosition: 'side' | 'bottom' | undefined;
10
10
  splitPanelSize: number;
11
+ isMobile: boolean;
11
12
  }
12
- export declare function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, }: HorizontalLayoutInput): {
13
+ export declare function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, }: HorizontalLayoutInput): {
13
14
  splitPanelPosition: "bottom" | "side";
14
15
  splitPanelForcedPosition: boolean;
15
16
  sideSplitPanelSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,UAAU,qBAAqB;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,EAAE,qBAAqB;;;;;;EAsBvB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACpB,EAAE,mBAAmB,GAAG,oBAAoB,CAY5C"}
1
+ {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,UAAU,qBAAqB;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,GACT,EAAE,qBAAqB;;;;;;EAsBvB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACpB,EAAE,mBAAmB,GAAG,oBAAoB,CAY5C"}
@@ -1,11 +1,11 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';
4
- export function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, }) {
4
+ export function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, }) {
5
5
  const contentPadding = 2 * 24; // space-xl
6
6
  const activeNavigationWidth = navigationOpen ? navigationWidth : 0;
7
7
  const resizableSpaceAvailable = Math.max(0, placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth);
8
- const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH;
8
+ const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH || isMobile;
9
9
  const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : 'bottom';
10
10
  const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? splitPanelSize !== null && splitPanelSize !== void 0 ? splitPanelSize : 0 : 0;
11
11
  const maxSplitPanelSize = resizableSpaceAvailable - activeDrawerSize;
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAavD,MAAM,UAAU,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,GACQ;IACtB,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW;IAC1C,MAAM,qBAAqB,GAAG,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rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\n\ninterface HorizontalLayoutInput {\n navigationOpen: boolean;\n navigationWidth: number;\n placement: AppLayoutPropsWithDefaults['placement'];\n minContentWidth: number;\n activeDrawerSize: number;\n splitPanelOpen: boolean;\n splitPanelPosition: 'side' | 'bottom' | undefined;\n splitPanelSize: number;\n}\n\nexport function computeHorizontalLayout({\n navigationOpen,\n navigationWidth,\n placement,\n minContentWidth,\n activeDrawerSize,\n splitPanelOpen,\n splitPanelPosition,\n splitPanelSize,\n}: HorizontalLayoutInput) {\n const contentPadding = 2 * 24; // space-xl\n const activeNavigationWidth = navigationOpen ? navigationWidth : 0;\n\n const resizableSpaceAvailable = Math.max(\n 0,\n placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth\n );\n\n const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH;\n const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : splitPanelPosition ?? 'bottom';\n const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? splitPanelSize ?? 0 : 0;\n const maxSplitPanelSize = resizableSpaceAvailable - activeDrawerSize;\n const maxDrawerSize = resizableSpaceAvailable - sideSplitPanelSize;\n\n return {\n splitPanelPosition: resolvedSplitPanelPosition,\n splitPanelForcedPosition,\n sideSplitPanelSize,\n maxSplitPanelSize,\n maxDrawerSize,\n };\n}\n\ninterface VerticalLayoutInput {\n topOffset: number;\n hasVisibleToolbar: boolean;\n toolbarHeight: number;\n stickyNotifications: boolean;\n notificationsHeight: number;\n}\n\nexport interface VerticalLayoutOutput {\n toolbar: number;\n notifications: number;\n header: number;\n}\n\nexport function computeVerticalLayout({\n topOffset,\n hasVisibleToolbar,\n toolbarHeight,\n stickyNotifications,\n notificationsHeight,\n}: VerticalLayoutInput): VerticalLayoutOutput {\n const toolbar = topOffset;\n let notifications = topOffset;\n if (hasVisibleToolbar) {\n notifications += toolbarHeight;\n }\n let header = notifications;\n if (stickyNotifications) {\n header += notificationsHeight;\n }\n\n return { toolbar, notifications, header };\n}\n"]}
1
+ {"version":3,"file":"compute-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAcvD,MAAM,UAAU,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,GACc;IACtB,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW;IAC1C,MAAM,qBAAqB,GAAG,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,CACtC,CAAC,EACD,SAAS,CAAC,UAAU,GAAG,eAAe,GAAG,cAAc,GAAG,qBAAqB,CAChF,CAAC;IAEF,MAAM,wBAAwB,GAAG,uBAAuB,GAAG,gBAAgB,GAAG,qBAAqB,IAAI,QAAQ,CAAC;IAChH,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,QAAQ,CAAC;IACxG,MAAM,kBAAkB,GAAG,0BAA0B,KAAK,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7G,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,gBAAgB,CAAC;IACrE,MAAM,aAAa,GAAG,uBAAuB,GAAG,kBAAkB,CAAC;IAEnE,OAAO;QACL,kBAAkB,EAAE,0BAA0B;QAC9C,wBAAwB;QACxB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;KACd,CAAC;AACJ,CAAC;AAgBD,MAAM,UAAU,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACC;IACpB,MAAM,OAAO,GAAG,SAAS,CAAC;IAC1B,IAAI,aAAa,GAAG,SAAS,CAAC;IAC9B,IAAI,iBAAiB,EAAE;QACrB,aAAa,IAAI,aAAa,CAAC;KAChC;IACD,IAAI,MAAM,GAAG,aAAa,CAAC;IAC3B,IAAI,mBAAmB,EAAE;QACvB,MAAM,IAAI,mBAAmB,CAAC;KAC/B;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\n\ninterface HorizontalLayoutInput {\n navigationOpen: boolean;\n navigationWidth: number;\n placement: AppLayoutPropsWithDefaults['placement'];\n minContentWidth: number;\n activeDrawerSize: number;\n splitPanelOpen: boolean;\n splitPanelPosition: 'side' | 'bottom' | undefined;\n splitPanelSize: number;\n isMobile: boolean;\n}\n\nexport function computeHorizontalLayout({\n navigationOpen,\n navigationWidth,\n placement,\n minContentWidth,\n activeDrawerSize,\n splitPanelOpen,\n splitPanelPosition,\n splitPanelSize,\n isMobile,\n}: HorizontalLayoutInput) {\n const contentPadding = 2 * 24; // space-xl\n const activeNavigationWidth = navigationOpen ? navigationWidth : 0;\n\n const resizableSpaceAvailable = Math.max(\n 0,\n placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth\n );\n\n const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH || isMobile;\n const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : splitPanelPosition ?? 'bottom';\n const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? splitPanelSize ?? 0 : 0;\n const maxSplitPanelSize = resizableSpaceAvailable - activeDrawerSize;\n const maxDrawerSize = resizableSpaceAvailable - sideSplitPanelSize;\n\n return {\n splitPanelPosition: resolvedSplitPanelPosition,\n splitPanelForcedPosition,\n sideSplitPanelSize,\n maxSplitPanelSize,\n maxDrawerSize,\n };\n}\n\ninterface VerticalLayoutInput {\n topOffset: number;\n hasVisibleToolbar: boolean;\n toolbarHeight: number;\n stickyNotifications: boolean;\n notificationsHeight: number;\n}\n\nexport interface VerticalLayoutOutput {\n toolbar: number;\n notifications: number;\n header: number;\n}\n\nexport function computeVerticalLayout({\n topOffset,\n hasVisibleToolbar,\n toolbarHeight,\n stickyNotifications,\n notificationsHeight,\n}: VerticalLayoutInput): VerticalLayoutOutput {\n const toolbar = topOffset;\n let notifications = topOffset;\n if (hasVisibleToolbar) {\n notifications += toolbarHeight;\n }\n let header = notifications;\n if (stickyNotifications) {\n header += notificationsHeight;\n }\n\n return { toolbar, notifications, header };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eAgGvG;AAED,eAAO,MAAM,+BAA+B,qGAA2D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eAiGvG;AAED,eAAO,MAAM,+BAA+B,qGAA2D,CAAC"}
@@ -7,7 +7,7 @@ import PanelResizeHandle from '../../../internal/components/panel-resize-handle'
7
7
  import { createWidgetizedComponent } from '../../../internal/widgets';
8
8
  import { TOOLS_DRAWER_ID } from '../../utils/use-drawers';
9
9
  import { useResize } from './use-resize';
10
- import sharedStyles from '../../styles.css.js';
10
+ import sharedStyles from '../../resize/styles.css.js';
11
11
  import testutilStyles from '../../test-classes/styles.css.js';
12
12
  import styles from './styles.css.js';
13
13
  export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
@@ -30,7 +30,7 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
30
30
  handleRef: drawersFocusControl.refs.slider,
31
31
  onResize: size => onActiveDrawerResize({ id: activeDrawerId, size }),
32
32
  });
33
- return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, sharedStyles['with-motion'], {
33
+ return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, {
34
34
  [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,
35
35
  [testutilStyles.tools]: isToolsDrawer,
36
36
  }), ref: drawerRef, onBlur: e => {
@@ -43,13 +43,13 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
43
43
  } },
44
44
  !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && (React.createElement("div", { className: styles['drawer-slider'] },
45
45
  React.createElement(PanelResizeHandle, { ref: drawersFocusControl.refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.resizeHandle, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onPointerDown: resizeProps.onPointerDown }))),
46
- React.createElement("div", { className: styles['drawer-content-container'] },
46
+ React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion']), style: { width: isMobile ? '100%' : `${activeDrawerSize}px` } },
47
47
  React.createElement("div", { className: clsx(styles['drawer-close-button']) },
48
48
  React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
49
49
  [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,
50
50
  [testutilStyles['tools-close']]: isToolsDrawer,
51
51
  }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => onActiveDrawerChange(null), ref: drawersFocusControl.refs.close, variant: "icon" })),
52
- toolsContent && (React.createElement("div", { className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']) }, toolsContent)),
52
+ React.createElement("div", { className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']) }, toolsContent),
53
53
  activeDrawerId !== TOOLS_DRAWER_ID && React.createElement("div", { className: styles['drawer-content'] }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content))));
54
54
  }
55
55
  export const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAA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AAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,6BAA6B,CAAC,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';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID;\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, sharedStyles['with-motion'], {\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${placement.insetBlockStart}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: placement.insetBlockStart,\n }}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={styles['drawer-content-container']}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null)}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n />\n </div>\n {toolsContent && (\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && <div className={styles['drawer-content']}>{activeDrawer?.content}</div>}\n </div>\n </aside>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual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G,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,EACnC,OAAO,EAAC,MAAM,GACd,CACE;YACN,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,KAAK,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,IAEA,YAAY,CACT;YACL,cAAc,KAAK,eAAe,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAO,CAC1G,CACA,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,6BAA6B,CAAC,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';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID;\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${placement.insetBlockStart}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: placement.insetBlockStart,\n }}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion'])}\n style={{ width: isMobile ? '100%' : `${activeDrawerSize}px` }}\n >\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null)}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n />\n </div>\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && <div className={styles['drawer-content']}>{activeDrawer?.content}</div>}\n </div>\n </aside>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-resize.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/use-resize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,SAAS,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,WAAW;;;;EAuBzG"}
1
+ {"version":3,"file":"use-resize.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/use-resize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,SAAS,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,WAAW;;;;EAwBzG"}
@@ -13,6 +13,7 @@ export function useResize({ currentWidth, minWidth, maxWidth, panelRef, handleRe
13
13
  panelRef,
14
14
  handleRef,
15
15
  onResize: onResizeHandler,
16
+ hasTransitions: true,
16
17
  };
17
18
  const clampedWidth = getLimitedValue(minWidth, currentWidth, maxWidth);
18
19
  const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;