@cloudscape-design/components 3.0.640 → 3.0.641

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 (123) hide show
  1. package/app-layout/drawer/index.js +1 -1
  2. package/app-layout/drawer/index.js.map +1 -1
  3. package/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
  4. package/app-layout/drawer/resizable-drawer.js +2 -5
  5. package/app-layout/drawer/resizable-drawer.js.map +1 -1
  6. package/app-layout/drawer/styles.css.js +13 -12
  7. package/app-layout/drawer/styles.scoped.css +30 -20
  8. package/app-layout/drawer/styles.selectors.js +13 -12
  9. package/app-layout/utils/use-resize.d.ts.map +1 -1
  10. package/app-layout/utils/use-resize.js +3 -7
  11. package/app-layout/utils/use-resize.js.map +1 -1
  12. package/app-layout/visual-refresh/drawers.js +1 -1
  13. package/app-layout/visual-refresh/drawers.js.map +1 -1
  14. package/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
  15. package/app-layout/visual-refresh/split-panel.js +1 -3
  16. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  17. package/autosuggest/plain-list.d.ts.map +1 -1
  18. package/autosuggest/plain-list.js +1 -3
  19. package/autosuggest/plain-list.js.map +1 -1
  20. package/autosuggest/virtual-list.d.ts.map +1 -1
  21. package/autosuggest/virtual-list.js +1 -3
  22. package/autosuggest/virtual-list.js.map +1 -1
  23. package/calendar/utils/intl.d.ts.map +1 -1
  24. package/calendar/utils/intl.js +0 -3
  25. package/calendar/utils/intl.js.map +1 -1
  26. package/container/internal.d.ts.map +1 -1
  27. package/container/internal.js +3 -0
  28. package/container/internal.js.map +1 -1
  29. package/container/styles.css.js +29 -28
  30. package/container/styles.scoped.css +55 -52
  31. package/container/styles.selectors.js +29 -28
  32. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  33. package/date-range-picker/calendar/grids/index.js +0 -8
  34. package/date-range-picker/calendar/grids/index.js.map +1 -1
  35. package/form/interfaces.d.ts +3 -8
  36. package/form/interfaces.d.ts.map +1 -1
  37. package/form/interfaces.js.map +1 -1
  38. package/form/internal.d.ts +1 -1
  39. package/form/internal.d.ts.map +1 -1
  40. package/form/internal.js +14 -20
  41. package/form/internal.js.map +1 -1
  42. package/form/styles.css.js +8 -9
  43. package/form/styles.scoped.css +8 -8
  44. package/form/styles.selectors.js +8 -9
  45. package/header/internal.d.ts.map +1 -1
  46. package/header/internal.js +1 -3
  47. package/header/internal.js.map +1 -1
  48. package/header/styles.css.js +34 -35
  49. package/header/styles.scoped.css +50 -53
  50. package/header/styles.selectors.js +34 -35
  51. package/input/styles.css.js +13 -13
  52. package/input/styles.scoped.css +32 -35
  53. package/input/styles.selectors.js +13 -13
  54. package/internal/components/chart-plot/application-controller.js +3 -13
  55. package/internal/components/chart-plot/application-controller.js.map +1 -1
  56. package/internal/components/dropdown/index.d.ts.map +1 -1
  57. package/internal/components/dropdown/index.js +0 -2
  58. package/internal/components/dropdown/index.js.map +1 -1
  59. package/internal/components/dropdown/styles.css.js +20 -20
  60. package/internal/components/dropdown/styles.scoped.css +39 -45
  61. package/internal/components/dropdown/styles.selectors.js +20 -20
  62. package/internal/components/panel-resize-handle/icon.d.ts +5 -0
  63. package/internal/components/panel-resize-handle/icon.d.ts.map +1 -0
  64. package/internal/components/panel-resize-handle/icon.js +9 -0
  65. package/internal/components/panel-resize-handle/icon.js.map +1 -0
  66. package/internal/components/panel-resize-handle/index.d.ts +12 -0
  67. package/internal/components/panel-resize-handle/index.d.ts.map +1 -0
  68. package/internal/components/panel-resize-handle/index.js +11 -0
  69. package/internal/components/panel-resize-handle/index.js.map +1 -0
  70. package/internal/components/panel-resize-handle/styles.css.js +10 -0
  71. package/internal/components/panel-resize-handle/styles.scoped.css +153 -0
  72. package/internal/components/panel-resize-handle/styles.selectors.js +11 -0
  73. package/internal/context/single-tab-stop-navigation-context.js +2 -2
  74. package/internal/context/single-tab-stop-navigation-context.js.map +1 -1
  75. package/internal/environment.js +1 -1
  76. package/internal/environment.json +1 -1
  77. package/internal/manifest.json +1 -1
  78. package/internal/utils/content-header-utils.d.ts +0 -2
  79. package/internal/utils/content-header-utils.d.ts.map +1 -1
  80. package/internal/utils/content-header-utils.js +0 -3
  81. package/internal/utils/content-header-utils.js.map +1 -1
  82. package/internal/utils/dom.d.ts.map +1 -1
  83. package/internal/utils/dom.js +7 -27
  84. package/internal/utils/dom.js.map +1 -1
  85. package/internal/utils/global-flags.d.ts +0 -1
  86. package/internal/utils/global-flags.d.ts.map +1 -1
  87. package/internal/utils/global-flags.js.map +1 -1
  88. package/package.json +1 -1
  89. package/pie-chart/labels.d.ts.map +1 -1
  90. package/pie-chart/labels.js +1 -4
  91. package/pie-chart/labels.js.map +1 -1
  92. package/pie-chart/pie-chart.d.ts.map +1 -1
  93. package/pie-chart/pie-chart.js +0 -3
  94. package/pie-chart/pie-chart.js.map +1 -1
  95. package/pie-chart/utils.d.ts.map +1 -1
  96. package/pie-chart/utils.js +0 -4
  97. package/pie-chart/utils.js.map +1 -1
  98. package/popover/internal.js +3 -6
  99. package/popover/internal.js.map +1 -1
  100. package/popover/styles.css.js +49 -50
  101. package/popover/styles.scoped.css +66 -69
  102. package/popover/styles.selectors.js +49 -50
  103. package/segmented-control/styles.css.js +14 -14
  104. package/segmented-control/styles.scoped.css +33 -33
  105. package/segmented-control/styles.selectors.js +14 -14
  106. package/split-panel/implementation.d.ts.map +1 -1
  107. package/split-panel/implementation.js +6 -3
  108. package/split-panel/implementation.js.map +1 -1
  109. package/split-panel/styles.css.js +26 -31
  110. package/split-panel/styles.scoped.css +41 -97
  111. package/split-panel/styles.selectors.js +26 -31
  112. package/table/selection/selection-control.d.ts.map +1 -1
  113. package/table/selection/selection-control.js.map +1 -1
  114. package/table/table-role/utils.d.ts.map +1 -1
  115. package/table/table-role/utils.js +6 -1
  116. package/table/table-role/utils.js.map +1 -1
  117. package/tiles/styles.css.js +29 -29
  118. package/tiles/styles.scoped.css +82 -95
  119. package/tiles/styles.selectors.js +29 -29
  120. package/split-panel/icons/resize-handler.d.ts +0 -6
  121. package/split-panel/icons/resize-handler.d.ts.map +0 -1
  122. package/split-panel/icons/resize-handler.js +0 -8
  123. package/split-panel/icons/resize-handler.js.map +0 -1
@@ -96,11 +96,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
96
96
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
97
97
  SPDX-License-Identifier: Apache-2.0
98
98
  */
99
- .awsui_root_2rhyz_deb6p_99:not(#\9) {
99
+ .awsui_root_2rhyz_1yq0b_99:not(#\9) {
100
100
  /* used in test-utils for component to distinguish input from other input-like components, for example autosuggest */
101
101
  }
102
102
 
103
- .awsui_input_2rhyz_deb6p_103:not(#\9) {
103
+ .awsui_input_2rhyz_1yq0b_103:not(#\9) {
104
104
  border-collapse: separate;
105
105
  border-spacing: 0;
106
106
  box-sizing: border-box;
@@ -151,36 +151,36 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
151
151
  line-height: var(--line-height-body-m-30ar75, 20px);
152
152
  block-size: var(--size-vertical-input-v5iwwf, 32px);
153
153
  }
154
- .awsui_input_2rhyz_deb6p_103.awsui_input-readonly_2rhyz_deb6p_153:not(#\9) {
154
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-readonly_2rhyz_1yq0b_153:not(#\9) {
155
155
  background-color: var(--color-background-input-default-igdh5e, #ffffff);
156
156
  border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-rx2aau, #e9ebed);
157
157
  border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-rx2aau, #e9ebed);
158
158
  }
159
- .awsui_input_2rhyz_deb6p_103:not(#\9)::-webkit-input-placeholder {
159
+ .awsui_input_2rhyz_1yq0b_103:not(#\9)::-webkit-input-placeholder {
160
160
  color: var(--color-text-input-placeholder-mx1ygd, #5f6b7a);
161
161
  font-style: italic;
162
162
  -webkit-user-select: none;
163
163
  user-select: none;
164
164
  }
165
- .awsui_input_2rhyz_deb6p_103:not(#\9)::-ms-input-placeholder {
165
+ .awsui_input_2rhyz_1yq0b_103:not(#\9)::-ms-input-placeholder {
166
166
  color: var(--color-text-input-placeholder-mx1ygd, #5f6b7a);
167
167
  font-style: italic;
168
168
  }
169
- .awsui_input_2rhyz_deb6p_103:not(#\9)::-moz-placeholder {
169
+ .awsui_input_2rhyz_1yq0b_103:not(#\9)::-moz-placeholder {
170
170
  color: var(--color-text-input-placeholder-mx1ygd, #5f6b7a);
171
171
  font-style: italic;
172
172
  opacity: 1;
173
173
  }
174
- .awsui_input_2rhyz_deb6p_103:not(#\9):-ms-input-placeholder {
174
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):-ms-input-placeholder {
175
175
  color: var(--color-text-input-placeholder-mx1ygd, #5f6b7a);
176
176
  font-style: italic;
177
177
  }
178
- .awsui_input_2rhyz_deb6p_103:not(#\9):-moz-placeholder {
178
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):-moz-placeholder {
179
179
  color: var(--color-text-input-placeholder-mx1ygd, #5f6b7a);
180
180
  font-style: italic;
181
181
  opacity: 1;
182
182
  }
183
- .awsui_input_2rhyz_deb6p_103:not(#\9):focus {
183
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):focus {
184
184
  outline: 2px dotted transparent;
185
185
  border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-focused-3d15sl, #033160);
186
186
  border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-focused-3d15sl, #033160);
@@ -190,7 +190,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
190
190
  border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
191
191
  box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-b2ntyl, #0972d3);
192
192
  }
193
- .awsui_input_2rhyz_deb6p_103:not(#\9):disabled {
193
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):disabled {
194
194
  background-color: var(--color-background-input-disabled-ab59a3, #e9ebed);
195
195
  border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-rx2aau, #e9ebed);
196
196
  border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-rx2aau, #e9ebed);
@@ -198,29 +198,29 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
198
198
  cursor: auto;
199
199
  cursor: default;
200
200
  }
201
- .awsui_input_2rhyz_deb6p_103:not(#\9):disabled::-webkit-input-placeholder {
201
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):disabled::-webkit-input-placeholder {
202
202
  color: var(--color-text-input-placeholder-disabled-abhb0d, #9ba7b6);
203
203
  -webkit-user-select: none;
204
204
  user-select: none;
205
205
  }
206
- .awsui_input_2rhyz_deb6p_103:not(#\9):disabled::-ms-input-placeholder {
206
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):disabled::-ms-input-placeholder {
207
207
  color: var(--color-text-input-placeholder-disabled-abhb0d, #9ba7b6);
208
208
  }
209
- .awsui_input_2rhyz_deb6p_103:not(#\9):disabled::-moz-placeholder {
209
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):disabled::-moz-placeholder {
210
210
  color: var(--color-text-input-placeholder-disabled-abhb0d, #9ba7b6);
211
211
  opacity: 1;
212
212
  }
213
- .awsui_input_2rhyz_deb6p_103:not(#\9):disabled:-ms-input-placeholder {
213
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):disabled:-ms-input-placeholder {
214
214
  color: var(--color-text-input-placeholder-disabled-abhb0d, #9ba7b6);
215
215
  }
216
- .awsui_input_2rhyz_deb6p_103:not(#\9):disabled:-moz-placeholder {
216
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):disabled:-moz-placeholder {
217
217
  color: var(--color-text-input-placeholder-disabled-abhb0d, #9ba7b6);
218
218
  opacity: 1;
219
219
  }
220
- .awsui_input_2rhyz_deb6p_103:not(#\9):invalid {
220
+ .awsui_input_2rhyz_1yq0b_103:not(#\9):invalid {
221
221
  box-shadow: none;
222
222
  }
223
- .awsui_input_2rhyz_deb6p_103.awsui_input-invalid_2rhyz_deb6p_220:not(#\9) {
223
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-invalid_2rhyz_1yq0b_220:not(#\9) {
224
224
  color: var(--color-text-status-error-wdvepn, #d91515);
225
225
  border-color: var(--color-text-status-error-wdvepn, #d91515);
226
226
  padding-inline-start: calc(
@@ -228,15 +228,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
228
228
  );
229
229
  border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
230
230
  }
231
- .awsui_input_2rhyz_deb6p_103.awsui_input-invalid_2rhyz_deb6p_220:not(#\9):focus {
231
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-invalid_2rhyz_1yq0b_220:not(#\9):focus {
232
232
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-b2ntyl, #0972d3);
233
233
  }
234
- .awsui_input_2rhyz_deb6p_103.awsui_input-invalid_2rhyz_deb6p_220.awsui_input-has-icon-left_2rhyz_deb6p_231:not(#\9) {
234
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-invalid_2rhyz_1yq0b_220.awsui_input-has-icon-left_2rhyz_1yq0b_231:not(#\9) {
235
235
  padding-inline-start: calc(
236
236
  var(--space-field-icon-offset-csk9vw, 36px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px))
237
237
  );
238
238
  }
239
- .awsui_input_2rhyz_deb6p_103.awsui_input-warning_2rhyz_deb6p_236:not(#\9) {
239
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-warning_2rhyz_1yq0b_236:not(#\9) {
240
240
  color: var(--color-text-status-warning-yik8vi, #8d6605);
241
241
  border-color: var(--color-text-status-warning-yik8vi, #8d6605);
242
242
  padding-inline-start: calc(
@@ -244,58 +244,55 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
244
244
  );
245
245
  border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
246
246
  }
247
- .awsui_input_2rhyz_deb6p_103.awsui_input-warning_2rhyz_deb6p_236:not(#\9):focus {
247
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-warning_2rhyz_1yq0b_236:not(#\9):focus {
248
248
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-b2ntyl, #0972d3);
249
249
  }
250
- .awsui_input_2rhyz_deb6p_103.awsui_input-warning_2rhyz_deb6p_236.awsui_input-has-icon-left_2rhyz_deb6p_231:not(#\9) {
250
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-warning_2rhyz_1yq0b_236.awsui_input-has-icon-left_2rhyz_1yq0b_231:not(#\9) {
251
251
  padding-inline-start: calc(
252
252
  var(--space-field-icon-offset-csk9vw, 36px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px))
253
253
  );
254
254
  }
255
- .awsui_input_2rhyz_deb6p_103.awsui_input-type-search_2rhyz_deb6p_252:not(#\9) {
255
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-type-search_2rhyz_1yq0b_252:not(#\9) {
256
256
  box-sizing: border-box;
257
257
  -webkit-appearance: none; /* stylelint-disable-line plugin/no-unsupported-browser-features */
258
258
  }
259
- .awsui_input_2rhyz_deb6p_103.awsui_input-type-search_2rhyz_deb6p_252:not(#\9)::-ms-clear {
260
- display: none;
261
- }
262
- .awsui_input_2rhyz_deb6p_103.awsui_input-type-search_2rhyz_deb6p_252:not(#\9)::-webkit-search-decoration {
259
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-type-search_2rhyz_1yq0b_252:not(#\9)::-webkit-search-decoration {
263
260
  -webkit-appearance: none; /* stylelint-disable-line plugin/no-unsupported-browser-features */
264
261
  }
265
- .awsui_input_2rhyz_deb6p_103.awsui_input-type-search_2rhyz_deb6p_252:not(#\9)::-webkit-search-cancel-button {
262
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-type-search_2rhyz_1yq0b_252:not(#\9)::-webkit-search-cancel-button {
266
263
  display: none;
267
264
  }
268
- .awsui_input_2rhyz_deb6p_103.awsui_input-has-icon-left_2rhyz_deb6p_231:not(#\9) {
265
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-has-icon-left_2rhyz_1yq0b_231:not(#\9) {
269
266
  padding-inline-start: var(--space-field-icon-offset-csk9vw, 36px);
270
267
  }
271
- .awsui_input_2rhyz_deb6p_103.awsui_input-has-icon-right_2rhyz_deb6p_268:not(#\9) {
268
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-has-icon-right_2rhyz_1yq0b_265:not(#\9) {
272
269
  padding-inline-end: var(--space-field-icon-offset-csk9vw, 36px);
273
270
  }
274
- .awsui_input_2rhyz_deb6p_103.awsui_input-has-no-border-radius_2rhyz_deb6p_271:not(#\9) {
271
+ .awsui_input_2rhyz_1yq0b_103.awsui_input-has-no-border-radius_2rhyz_1yq0b_268:not(#\9) {
275
272
  border-start-start-radius: var(--border-radius-dropdown-0dhh79, 8px);
276
273
  border-start-end-radius: var(--border-radius-dropdown-0dhh79, 8px);
277
274
  border-end-start-radius: var(--border-radius-dropdown-0dhh79, 8px);
278
275
  border-end-end-radius: var(--border-radius-dropdown-0dhh79, 8px);
279
276
  }
280
277
 
281
- .awsui_input-container_2rhyz_deb6p_278:not(#\9) {
278
+ .awsui_input-container_2rhyz_1yq0b_275:not(#\9) {
282
279
  display: flex;
283
280
  position: relative;
284
281
  }
285
282
 
286
- .awsui_input-icon-left_2rhyz_deb6p_283:not(#\9) {
283
+ .awsui_input-icon-left_2rhyz_1yq0b_280:not(#\9) {
287
284
  position: absolute;
288
285
  pointer-events: none;
289
286
  inset-inline-start: var(--space-field-horizontal-gg19kw, 12px);
290
287
  inset-block-start: calc(50% - var(--line-height-body-m-30ar75, 20px) / 2);
291
288
  }
292
289
 
293
- .awsui_input-icon-right_2rhyz_deb6p_290:not(#\9) {
290
+ .awsui_input-icon-right_2rhyz_1yq0b_287:not(#\9) {
294
291
  position: absolute;
295
292
  inset-block-start: calc(50% - var(--line-height-body-m-30ar75, 20px) / 2);
296
293
  inset-inline-end: calc(var(--space-field-horizontal-gg19kw, 12px) - var(--space-xxs-p8yyaw, 4px));
297
294
  }
298
295
 
299
- .awsui_input-button-right_2rhyz_deb6p_296:not(#\9) {
296
+ .awsui_input-button-right_2rhyz_1yq0b_293:not(#\9) {
300
297
  /* used in test-utils */
301
298
  }
@@ -2,18 +2,18 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_2rhyz_deb6p_99",
6
- "input": "awsui_input_2rhyz_deb6p_103",
7
- "input-readonly": "awsui_input-readonly_2rhyz_deb6p_153",
8
- "input-invalid": "awsui_input-invalid_2rhyz_deb6p_220",
9
- "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_deb6p_231",
10
- "input-warning": "awsui_input-warning_2rhyz_deb6p_236",
11
- "input-type-search": "awsui_input-type-search_2rhyz_deb6p_252",
12
- "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_deb6p_268",
13
- "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_deb6p_271",
14
- "input-container": "awsui_input-container_2rhyz_deb6p_278",
15
- "input-icon-left": "awsui_input-icon-left_2rhyz_deb6p_283",
16
- "input-icon-right": "awsui_input-icon-right_2rhyz_deb6p_290",
17
- "input-button-right": "awsui_input-button-right_2rhyz_deb6p_296"
5
+ "root": "awsui_root_2rhyz_1yq0b_99",
6
+ "input": "awsui_input_2rhyz_1yq0b_103",
7
+ "input-readonly": "awsui_input-readonly_2rhyz_1yq0b_153",
8
+ "input-invalid": "awsui_input-invalid_2rhyz_1yq0b_220",
9
+ "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_1yq0b_231",
10
+ "input-warning": "awsui_input-warning_2rhyz_1yq0b_236",
11
+ "input-type-search": "awsui_input-type-search_2rhyz_1yq0b_252",
12
+ "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_1yq0b_265",
13
+ "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_1yq0b_268",
14
+ "input-container": "awsui_input-container_2rhyz_1yq0b_275",
15
+ "input-icon-left": "awsui_input-icon-left_2rhyz_1yq0b_280",
16
+ "input-icon-right": "awsui_input-icon-right_2rhyz_1yq0b_287",
17
+ "input-button-right": "awsui_input-button-right_2rhyz_1yq0b_293"
18
18
  };
19
19
 
@@ -48,14 +48,14 @@ function ApplicationController({ activeElementKey, activeElementRef, onFocus, on
48
48
  // Focuses application but before copies aria-attributes from the target.
49
49
  function focusApplication(app, target) {
50
50
  // Remove prev attributes.
51
- for (const attributeName of getAttributeNames(app)) {
51
+ for (const attributeName of app.getAttributeNames()) {
52
52
  if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {
53
53
  app.removeAttribute(attributeName);
54
54
  }
55
55
  }
56
56
  // Copy new attributes.
57
57
  if (target) {
58
- for (const attributeName of getAttributeNames(target)) {
58
+ for (const attributeName of target.getAttributeNames()) {
59
59
  if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {
60
60
  const attributeValue = target.getAttribute(attributeName);
61
61
  attributeValue && app.setAttribute(attributeName, attributeValue);
@@ -72,7 +72,7 @@ function focusApplication(app, target) {
72
72
  // The application is to be only focused programmatically.
73
73
  function muteApplication(app) {
74
74
  // Remove prev attributes.
75
- for (const attributeName of getAttributeNames(app)) {
75
+ for (const attributeName of app.getAttributeNames()) {
76
76
  if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {
77
77
  app.removeAttribute(attributeName);
78
78
  }
@@ -82,14 +82,4 @@ function muteApplication(app) {
82
82
  app.setAttribute('focusable', 'false');
83
83
  app.setAttribute('aria-hidden', 'true');
84
84
  }
85
- // Polyfill for element.getAttributeNames(), IE11
86
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames#polyfill
87
- function getAttributeNames(element) {
88
- const attributes = element.attributes;
89
- const result = new Array(attributes.length);
90
- for (let i = 0; i < attributes.length; i++) {
91
- result[i] = attributes[i].name;
92
- }
93
- return result;
94
- }
95
85
  //# sourceMappingURL=application-controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"application-controller.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/application-controller.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAEjD,SAAS,qBAAqB,CAC5B,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAA8B,EAC9F,GAA8B;IAE9B,MAAM,YAAY,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IACjD,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,uGAAuG;IACvG,MAAM,kBAAkB,GAAG,WAAW,CACpC,CAAC,KAAoC,EAAE,EAAE;QACvC,IAAI,kBAAkB,CAAC,OAAO,KAAK,KAAK,EAAE;YACxC,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;SAC3B;aAAM;YACL,kBAAkB,CAAC,OAAO,GAAG,KAAK,CAAC;SACpC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC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,GAAG,CAAC,EAAE;QAClD,IAAI,aAAa,KAAK,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,EAAE;YACpE,GAAG,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACpC;KACF;IAED,0BAA0B;IAC1B,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACvC,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED,iDAAiD;AACjD,sFAAsF;AACtF,SAAS,iBAAiB,CAAC,OAAgB;IACzC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,MAAM,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KAChC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport styles from './styles.css.js';\n\nexport interface ApplicationRef {\n focus(): void;\n}\n\nexport interface ApplicationControllerProps {\n activeElementKey: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n onFocus?: (event: React.FocusEvent<SVGGElement>) => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n}\n\nexport default forwardRef(ApplicationController);\n\nfunction ApplicationController(\n { activeElementKey, activeElementRef, onFocus, onBlur, onKeyDown }: ApplicationControllerProps,\n ref: React.Ref<ApplicationRef>\n) {\n const containerRef = useRef<SVGGElement>(null);\n const applicationRef = useRef<SVGGElement>(null);\n const focusTransitionRef = useRef(false);\n const [isFocused, setFocused] = useState(false);\n\n // Calls provided onFocus handler when the application obtains focus, ignoring internal focus juggling.\n const onApplicationFocus = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(true);\n onFocus && onFocus(event);\n } else {\n focusTransitionRef.current = false;\n }\n },\n [onFocus]\n );\n // Calls provided onBlur handler when the application loses focus, ignoring internal focus juggling.\n const onApplicationBlur = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(false);\n onBlur && onBlur(event);\n // The application controller can only be focused programmatically.\n muteApplication(applicationRef.current!);\n }\n },\n [onBlur]\n );\n const onApplicationKeyDown = onKeyDown;\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => focusApplication(applicationRef.current!, activeElementRef?.current || null),\n }),\n [activeElementRef]\n );\n\n // Re-attaches and re-focuses the application for screen readers to treat it as an update.\n useEffect(() => {\n // Skip if not focused or if the transition is already happening.\n if (!isFocused || focusTransitionRef.current === true) {\n return;\n }\n focusTransitionRef.current = true;\n containerRef.current!.removeChild(applicationRef.current!);\n containerRef.current!.appendChild(applicationRef.current!);\n focusApplication(applicationRef.current!, activeElementRef?.current || null);\n }, [isFocused, activeElementKey, activeElementRef]);\n\n return (\n <g ref={containerRef}>\n <g\n tabIndex={-1}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n className={styles.application}\n ></g>\n </g>\n );\n}\n\n// Focuses application but before copies aria-attributes from the target.\nfunction focusApplication(app: SVGGElement, target: null | SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of getAttributeNames(app)) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Copy new attributes.\n if (target) {\n for (const attributeName of getAttributeNames(target)) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n const attributeValue = target.getAttribute(attributeName);\n attributeValue && app.setAttribute(attributeName, attributeValue);\n }\n }\n }\n\n // Make app focusable.\n app.tabIndex = 0;\n app.setAttribute('focusable', 'true');\n app.setAttribute('aria-hidden', 'false');\n\n // Focus app.\n app.focus({ preventScroll: true });\n}\n\n// The application is to be only focused programmatically.\nfunction muteApplication(app: SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of getAttributeNames(app)) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Make app non-focusable.\n app.tabIndex = -1;\n app.setAttribute('focusable', 'false');\n app.setAttribute('aria-hidden', 'true');\n}\n\n// Polyfill for element.getAttributeNames(), IE11\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames#polyfill\nfunction getAttributeNames(element: Element) {\n const attributes = element.attributes;\n const result = new Array(attributes.length);\n for (let i = 0; i < attributes.length; i++) {\n result[i] = attributes[i].name;\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"application-controller.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/application-controller.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAEjD,SAAS,qBAAqB,CAC5B,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAA8B,EAC9F,GAA8B;IAE9B,MAAM,YAAY,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAM,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CAAC,CAAC;gBAC1D,cAAc,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;aACnE;SACF;KACF;IAED,sBAAsB;IACtB,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC;IACjB,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACtC,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEzC,aAAa;IACb,GAAG,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,0DAA0D;AAC1D,SAAS,eAAe,CAAC,GAAgB;IACvC,0BAA0B;IAC1B,KAAK,MAAM,aAAa,IAAI,GAAG,CAAC,iBAAiB,EAAE,EAAE;QACnD,IAAI,aAAa,KAAK,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,EAAE;YACpE,GAAG,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACpC;KACF;IAED,0BAA0B;IAC1B,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACvC,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport styles from './styles.css.js';\n\nexport interface ApplicationRef {\n focus(): void;\n}\n\nexport interface ApplicationControllerProps {\n activeElementKey: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n onFocus?: (event: React.FocusEvent<SVGGElement>) => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n}\n\nexport default forwardRef(ApplicationController);\n\nfunction ApplicationController(\n { activeElementKey, activeElementRef, onFocus, onBlur, onKeyDown }: ApplicationControllerProps,\n ref: React.Ref<ApplicationRef>\n) {\n const containerRef = useRef<SVGGElement>(null);\n const applicationRef = useRef<SVGGElement>(null);\n const focusTransitionRef = useRef(false);\n const [isFocused, setFocused] = useState(false);\n\n // Calls provided onFocus handler when the application obtains focus, ignoring internal focus juggling.\n const onApplicationFocus = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(true);\n onFocus && onFocus(event);\n } else {\n focusTransitionRef.current = false;\n }\n },\n [onFocus]\n );\n // Calls provided onBlur handler when the application loses focus, ignoring internal focus juggling.\n const onApplicationBlur = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(false);\n onBlur && onBlur(event);\n // The application controller can only be focused programmatically.\n muteApplication(applicationRef.current!);\n }\n },\n [onBlur]\n );\n const onApplicationKeyDown = onKeyDown;\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => focusApplication(applicationRef.current!, activeElementRef?.current || null),\n }),\n [activeElementRef]\n );\n\n // Re-attaches and re-focuses the application for screen readers to treat it as an update.\n useEffect(() => {\n // Skip if not focused or if the transition is already happening.\n if (!isFocused || focusTransitionRef.current === true) {\n return;\n }\n focusTransitionRef.current = true;\n containerRef.current!.removeChild(applicationRef.current!);\n containerRef.current!.appendChild(applicationRef.current!);\n focusApplication(applicationRef.current!, activeElementRef?.current || null);\n }, [isFocused, activeElementKey, activeElementRef]);\n\n return (\n <g ref={containerRef}>\n <g\n tabIndex={-1}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n className={styles.application}\n ></g>\n </g>\n );\n}\n\n// Focuses application but before copies aria-attributes from the target.\nfunction focusApplication(app: SVGGElement, target: null | SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of app.getAttributeNames()) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Copy new attributes.\n if (target) {\n for (const attributeName of target.getAttributeNames()) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n const attributeValue = target.getAttribute(attributeName);\n attributeValue && app.setAttribute(attributeName, attributeValue);\n }\n }\n }\n\n // Make app focusable.\n app.tabIndex = 0;\n app.setAttribute('focusable', 'true');\n app.setAttribute('aria-hidden', 'false');\n\n // Focus app.\n app.focus({ preventScroll: true });\n}\n\n// The application is to be only focused programmatically.\nfunction muteApplication(app: SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of app.getAttributeNames()) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Make app non-focusable.\n app.tabIndex = -1;\n app.setAttribute('focusable', 'false');\n app.setAttribute('aria-hidden', 'true');\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAuI7C,QAAA,MAAM,QAAQ,iXA2BX,aAAa,gBAqTf,CAAC;AAMF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAuI7C,QAAA,MAAM,QAAQ,iXA2BX,aAAa,gBAmTf,CAAC;AAMF,eAAe,QAAQ,CAAC"}
@@ -55,8 +55,6 @@ const Dropdown = ({ children, trigger, open, onDropdownClose, onMouseDown, heade
55
55
  const triggerRef = useRef(null);
56
56
  const dropdownRef = useRef(null);
57
57
  const dropdownContainerRef = useRef(null);
58
- // This container is only needed to apply max-height to. We can't move max-height to it's parent
59
- // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216
60
58
  const verticalContainerRef = useRef(null);
61
59
  // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning
62
60
  const fixedPosition = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAGL,iBAAiB,EACjB,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAoB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAgC,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,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EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-block-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={\n stretchBeyondTriggerWidth ? { [customCssProps.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}\n }\n onMouseDown={onMouseDown}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !children && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxBlockSize = `${parseInt(position.blockSize) + 1}px`;\n } else {\n verticalContainer.style.maxBlockSize = position.blockSize;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.insetBlockStart = `${triggerBox.bottom}px`;\n }\n if (position.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerBox.left}px`;\n }\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n const fixStretching = () => {\n const classNameToRemove = styles['stretch-beyond-trigger-width'];\n if (\n open &&\n stretchBeyondTriggerWidth &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {\n const triggerRect = getLogicalBoundingClientRect(triggerRef.current);\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropBlockStart) {\n dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`;\n } else {\n target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`;\n }\n if (fixedPosition.current.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4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,OAAA,UAAU,CAAC,OAAO,KAAI,MAAA,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC5F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B;gBAEF,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,GAAG,EAClB,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,yBAAyB,EAAE,yBAAyB,EACpD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,mBAAmB,EACzB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,IAE/B,QAAQ,CACS;gBAEpB,oBAAC,OAAO,IACN,iBAAiB,EAAE,GAAG,EAAE,WAAC,OAAA,UAAU,CAAC,OAAO,KAAI,MAAA,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-block-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={\n stretchBeyondTriggerWidth ? { [customCssProps.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}\n }\n onMouseDown={onMouseDown}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !children && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxBlockSize = `${parseInt(position.blockSize) + 1}px`;\n } else {\n verticalContainer.style.maxBlockSize = position.blockSize;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.insetBlockStart = `${triggerBox.bottom}px`;\n }\n if (position.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerBox.left}px`;\n }\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n const fixStretching = () => {\n const classNameToRemove = styles['stretch-beyond-trigger-width'];\n if (\n open &&\n stretchBeyondTriggerWidth &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {\n const triggerRect = getLogicalBoundingClientRect(triggerRef.current);\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropBlockStart) {\n dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`;\n } else {\n target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`;\n }\n if (fixedPosition.current.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n"]}
@@ -1,25 +1,25 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_ori7u_99",
5
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_ori7u_1",
6
- "refresh": "awsui_refresh_qwoo0_ori7u_120",
7
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_ori7u_1",
8
- "root": "awsui_root_qwoo0_ori7u_149",
9
- "interior": "awsui_interior_qwoo0_ori7u_185",
10
- "dropdown": "awsui_dropdown_qwoo0_ori7u_99",
11
- "use-portal": "awsui_use-portal_qwoo0_ori7u_196",
12
- "is-empty": "awsui_is-empty_qwoo0_ori7u_248",
13
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_ori7u_255",
14
- "with-limited-width": "awsui_with-limited-width_qwoo0_ori7u_259",
15
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_ori7u_262",
16
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_ori7u_268",
17
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_ori7u_274",
18
- "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_ori7u_277",
19
- "hide-block-border": "awsui_hide-block-border_qwoo0_ori7u_284",
20
- "open": "awsui_open_qwoo0_ori7u_293",
21
- "nowrap": "awsui_nowrap_qwoo0_ori7u_302",
22
- "dropdown-content": "awsui_dropdown-content_qwoo0_ori7u_99",
23
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_ori7u_313"
4
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_13u58_99",
5
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_13u58_1",
6
+ "refresh": "awsui_refresh_qwoo0_13u58_120",
7
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_13u58_1",
8
+ "root": "awsui_root_qwoo0_13u58_149",
9
+ "interior": "awsui_interior_qwoo0_13u58_185",
10
+ "dropdown": "awsui_dropdown_qwoo0_13u58_99",
11
+ "use-portal": "awsui_use-portal_qwoo0_13u58_196",
12
+ "is-empty": "awsui_is-empty_qwoo0_13u58_242",
13
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_13u58_249",
14
+ "with-limited-width": "awsui_with-limited-width_qwoo0_13u58_253",
15
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_13u58_256",
16
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_13u58_262",
17
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_13u58_268",
18
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_13u58_271",
19
+ "hide-block-border": "awsui_hide-block-border_qwoo0_13u58_278",
20
+ "open": "awsui_open_qwoo0_13u58_287",
21
+ "nowrap": "awsui_nowrap_qwoo0_13u58_296",
22
+ "dropdown-content": "awsui_dropdown-content_qwoo0_13u58_99",
23
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_13u58_307"
24
24
  };
25
25