@cloudscape-design/components 3.0.901 → 3.0.903

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 (42) hide show
  1. package/flashbar/flash.d.ts.map +1 -1
  2. package/flashbar/flash.js +6 -3
  3. package/flashbar/flash.js.map +1 -1
  4. package/i18n/provider.d.ts.map +1 -1
  5. package/i18n/provider.js +31 -16
  6. package/i18n/provider.js.map +1 -1
  7. package/internal/components/dropdown/dropdown-fit-handler.js +1 -1
  8. package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  9. package/internal/environment.js +1 -1
  10. package/internal/environment.json +1 -1
  11. package/internal/manifest.json +1 -1
  12. package/package.json +1 -1
  13. package/prompt-input/internal.d.ts.map +1 -1
  14. package/prompt-input/internal.js +1 -0
  15. package/prompt-input/internal.js.map +1 -1
  16. package/prompt-input/styles.css.js +15 -14
  17. package/prompt-input/styles.scoped.css +45 -39
  18. package/prompt-input/styles.selectors.js +15 -14
  19. package/select/parts/plain-list.d.ts.map +1 -1
  20. package/select/parts/plain-list.js +6 -2
  21. package/select/parts/plain-list.js.map +1 -1
  22. package/tabs/index.d.ts +1 -1
  23. package/tabs/index.d.ts.map +1 -1
  24. package/tabs/index.js +25 -7
  25. package/tabs/index.js.map +1 -1
  26. package/tabs/interfaces.d.ts +28 -0
  27. package/tabs/interfaces.d.ts.map +1 -1
  28. package/tabs/interfaces.js.map +1 -1
  29. package/tabs/styles.css.js +30 -28
  30. package/tabs/styles.scoped.css +64 -49
  31. package/tabs/styles.selectors.js +30 -28
  32. package/tabs/tab-header-bar.d.ts +3 -1
  33. package/tabs/tab-header-bar.d.ts.map +1 -1
  34. package/tabs/tab-header-bar.js +26 -12
  35. package/tabs/tab-header-bar.js.map +1 -1
  36. package/test-utils/dom/tabs/index.d.ts +1 -0
  37. package/test-utils/dom/tabs/index.js +3 -0
  38. package/test-utils/dom/tabs/index.js.map +1 -1
  39. package/test-utils/selectors/tabs/index.d.ts +1 -0
  40. package/test-utils/selectors/tabs/index.js +3 -0
  41. package/test-utils/selectors/tabs/index.js.map +1 -1
  42. package/test-utils/tsconfig.tsbuildinfo +1 -1
@@ -143,7 +143,7 @@
143
143
  */
144
144
  /* Style used for links in slots/components that are text heavy, to help links stand out among
145
145
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
146
- .awsui_root_55fkh_1cygr_146:not(#\9) {
146
+ .awsui_root_55fkh_14pjo_146:not(#\9) {
147
147
  border-collapse: separate;
148
148
  border-spacing: 0;
149
149
  box-sizing: border-box;
@@ -183,12 +183,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
183
183
  border-block: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-default-l7v83d, #8c8c94);
184
184
  border-inline: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-default-l7v83d, #8c8c94);
185
185
  }
186
- .awsui_root_55fkh_1cygr_146.awsui_textarea-readonly_55fkh_1cygr_185:not(#\9) {
186
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-readonly_55fkh_14pjo_185:not(#\9) {
187
187
  background-color: var(--color-background-input-default-u56ls1, #ffffff);
188
188
  border-block: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
189
189
  border-inline: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
190
190
  }
191
- .awsui_root_55fkh_1cygr_146.awsui_disabled_55fkh_1cygr_190:not(#\9) {
191
+ .awsui_root_55fkh_14pjo_146.awsui_disabled_55fkh_14pjo_190:not(#\9) {
192
192
  background-color: var(--color-background-input-disabled-gvxsk4, #ebebf0);
193
193
  border-block: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
194
194
  border-inline: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
@@ -196,57 +196,57 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
196
196
  cursor: auto;
197
197
  cursor: default;
198
198
  }
199
- .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9) {
199
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9) {
200
200
  color: var(--color-text-status-error-5676bj, #db0000);
201
201
  border-color: var(--color-text-status-error-5676bj, #db0000);
202
202
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
203
203
  border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
204
204
  }
205
- .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus {
205
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus {
206
206
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
207
207
  }
208
- .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9) {
208
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9) {
209
209
  padding-inline-start: 0;
210
210
  }
211
- .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus-within, .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus {
211
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus-within, .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus {
212
212
  color: var(--color-text-status-error-5676bj, #db0000);
213
213
  border-color: var(--color-text-status-error-5676bj, #db0000);
214
214
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
215
215
  border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
216
216
  }
217
- .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus-within:focus, .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus:focus {
217
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus-within:focus, .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus:focus {
218
218
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
219
219
  }
220
- .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus-within, .awsui_root_55fkh_1cygr_146.awsui_textarea-invalid_55fkh_1cygr_198:not(#\9):focus {
220
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus-within, .awsui_root_55fkh_14pjo_146.awsui_textarea-invalid_55fkh_14pjo_198:not(#\9):focus {
221
221
  padding-inline-start: 0;
222
222
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
223
223
  }
224
- .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9) {
224
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9) {
225
225
  color: var(--color-text-status-warning-csaw41, #855900);
226
226
  border-color: var(--color-text-status-warning-csaw41, #855900);
227
227
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
228
228
  border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
229
229
  }
230
- .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus {
230
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus {
231
231
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
232
232
  }
233
- .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9) {
233
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9) {
234
234
  padding-inline-start: 0;
235
235
  }
236
- .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus-within, .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus {
236
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus-within, .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus {
237
237
  color: var(--color-text-status-warning-csaw41, #855900);
238
238
  border-color: var(--color-text-status-warning-csaw41, #855900);
239
239
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
240
240
  border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
241
241
  }
242
- .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus-within:focus, .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus:focus {
242
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus-within:focus, .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus:focus {
243
243
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
244
244
  }
245
- .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus-within, .awsui_root_55fkh_1cygr_146.awsui_textarea-warning_55fkh_1cygr_223:not(#\9):focus {
245
+ .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus-within, .awsui_root_55fkh_14pjo_146.awsui_textarea-warning_55fkh_14pjo_223:not(#\9):focus {
246
246
  padding-inline-start: 0;
247
247
  box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
248
248
  }
249
- .awsui_root_55fkh_1cygr_146:not(#\9):focus-within, .awsui_root_55fkh_1cygr_146:not(#\9):focus {
249
+ .awsui_root_55fkh_14pjo_146:not(#\9):focus-within, .awsui_root_55fkh_14pjo_146:not(#\9):focus {
250
250
  outline: 2px dotted transparent;
251
251
  border-block: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-focused-c6w5i5, #002b66);
252
252
  border-inline: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-focused-c6w5i5, #002b66);
@@ -257,7 +257,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
257
257
  box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-nv6mhz, #006ce0);
258
258
  }
259
259
 
260
- .awsui_textarea_55fkh_1cygr_185:not(#\9) {
260
+ .awsui_textarea_55fkh_14pjo_185:not(#\9) {
261
261
  border-collapse: separate;
262
262
  border-spacing: 0;
263
263
  box-sizing: border-box;
@@ -307,25 +307,25 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
307
307
  box-sizing: border-box;
308
308
  border: 0;
309
309
  }
310
- .awsui_textarea_55fkh_1cygr_185:not(#\9)::placeholder {
310
+ .awsui_textarea_55fkh_14pjo_185:not(#\9)::placeholder {
311
311
  color: var(--color-text-input-placeholder-f3x213, #656871);
312
312
  font-style: italic;
313
313
  opacity: 1;
314
314
  }
315
- .awsui_textarea_55fkh_1cygr_185:not(#\9):-ms-input-placeholder {
315
+ .awsui_textarea_55fkh_14pjo_185:not(#\9):-ms-input-placeholder {
316
316
  color: var(--color-text-input-placeholder-f3x213, #656871);
317
317
  font-style: italic;
318
318
  }
319
- .awsui_textarea_55fkh_1cygr_185:not(#\9):focus {
319
+ .awsui_textarea_55fkh_14pjo_185:not(#\9):focus {
320
320
  outline: none;
321
321
  }
322
- .awsui_textarea_55fkh_1cygr_185:not(#\9):invalid {
322
+ .awsui_textarea_55fkh_14pjo_185:not(#\9):invalid {
323
323
  box-shadow: none;
324
324
  }
325
- .awsui_textarea_55fkh_1cygr_185.awsui_invalid_55fkh_1cygr_323:not(#\9), .awsui_textarea_55fkh_1cygr_185.awsui_warning_55fkh_1cygr_323:not(#\9) {
325
+ .awsui_textarea_55fkh_14pjo_185.awsui_invalid_55fkh_14pjo_323:not(#\9), .awsui_textarea_55fkh_14pjo_185.awsui_warning_55fkh_14pjo_323:not(#\9) {
326
326
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
327
327
  }
328
- .awsui_textarea_55fkh_1cygr_185:not(#\9):disabled {
328
+ .awsui_textarea_55fkh_14pjo_185:not(#\9):disabled {
329
329
  background-color: var(--color-background-input-disabled-gvxsk4, #ebebf0);
330
330
  border-block: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
331
331
  border-inline: var(--border-width-field-h1g7tw, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
@@ -334,33 +334,33 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
334
334
  border: 0;
335
335
  cursor: default;
336
336
  }
337
- .awsui_textarea_55fkh_1cygr_185:not(#\9):disabled::placeholder {
337
+ .awsui_textarea_55fkh_14pjo_185:not(#\9):disabled::placeholder {
338
338
  color: var(--color-text-input-placeholder-disabled-7v2f7f, #b4b4bb);
339
339
  opacity: 1;
340
340
  }
341
- .awsui_textarea_55fkh_1cygr_185:not(#\9):disabled:-ms-input-placeholder {
341
+ .awsui_textarea_55fkh_14pjo_185:not(#\9):disabled:-ms-input-placeholder {
342
342
  color: var(--color-text-input-placeholder-disabled-7v2f7f, #b4b4bb);
343
343
  }
344
- .awsui_textarea-wrapper_55fkh_1cygr_342:not(#\9) {
344
+ .awsui_textarea-wrapper_55fkh_14pjo_342:not(#\9) {
345
345
  display: flex;
346
346
  }
347
347
 
348
- .awsui_button_55fkh_1cygr_346:not(#\9) {
348
+ .awsui_button_55fkh_14pjo_346:not(#\9) {
349
349
  align-self: flex-end;
350
350
  padding-inline: calc(var(--space-field-horizontal-gg19kw, 12px) / 2);
351
351
  padding-block-end: var(--space-scaled-xxxs-27y4hv, 2px);
352
352
  }
353
- .awsui_button_55fkh_1cygr_346 > .awsui_action-button_55fkh_1cygr_351:not(#\9) {
353
+ .awsui_button_55fkh_14pjo_346 > .awsui_action-button_55fkh_14pjo_351:not(#\9) {
354
354
  padding: 0;
355
355
  }
356
- body[data-awsui-focus-visible=true] .awsui_button_55fkh_1cygr_346 > .awsui_action-button_55fkh_1cygr_351:not(#\9):focus {
356
+ body[data-awsui-focus-visible=true] .awsui_button_55fkh_14pjo_346 > .awsui_action-button_55fkh_14pjo_351:not(#\9):focus {
357
357
  position: relative;
358
358
  }
359
- body[data-awsui-focus-visible=true] .awsui_button_55fkh_1cygr_346 > .awsui_action-button_55fkh_1cygr_351:not(#\9):focus {
359
+ body[data-awsui-focus-visible=true] .awsui_button_55fkh_14pjo_346 > .awsui_action-button_55fkh_14pjo_351:not(#\9):focus {
360
360
  outline: 2px dotted transparent;
361
361
  outline-offset: calc(calc((var(--space-xxxs-zbmxqb, 2px)) - 1px) - 1px);
362
362
  }
363
- body[data-awsui-focus-visible=true] .awsui_button_55fkh_1cygr_346 > .awsui_action-button_55fkh_1cygr_351:not(#\9):focus::before {
363
+ body[data-awsui-focus-visible=true] .awsui_button_55fkh_14pjo_346 > .awsui_action-button_55fkh_14pjo_351:not(#\9):focus::before {
364
364
  content: " ";
365
365
  display: block;
366
366
  position: absolute;
@@ -375,7 +375,7 @@ body[data-awsui-focus-visible=true] .awsui_button_55fkh_1cygr_346 > .awsui_actio
375
375
  box-shadow: 0 0 0 2px var(--color-border-item-focused-nv6mhz, #006ce0);
376
376
  }
377
377
 
378
- .awsui_secondary-content_55fkh_1cygr_376:not(#\9) {
378
+ .awsui_secondary-content_55fkh_14pjo_376:not(#\9) {
379
379
  border-collapse: separate;
380
380
  border-spacing: 0;
381
381
  box-sizing: border-box;
@@ -411,17 +411,17 @@ body[data-awsui-focus-visible=true] .awsui_button_55fkh_1cygr_346 > .awsui_actio
411
411
  border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
412
412
  border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
413
413
  }
414
- .awsui_secondary-content_55fkh_1cygr_376.awsui_with-paddings_55fkh_1cygr_411:not(#\9) {
414
+ .awsui_secondary-content_55fkh_14pjo_376.awsui_with-paddings_55fkh_14pjo_411:not(#\9) {
415
415
  padding-block-start: var(--space-scaled-s-aqzyko, 12px);
416
416
  padding-block-end: var(--space-scaled-s-aqzyko, 12px);
417
417
  padding-inline-start: var(--space-field-horizontal-gg19kw, 12px);
418
418
  padding-inline-end: var(--space-field-horizontal-gg19kw, 12px);
419
419
  }
420
- .awsui_secondary-content_55fkh_1cygr_376.awsui_with-paddings_55fkh_1cygr_411.awsui_invalid_55fkh_1cygr_323:not(#\9), .awsui_secondary-content_55fkh_1cygr_376.awsui_with-paddings_55fkh_1cygr_411.awsui_warning_55fkh_1cygr_323:not(#\9) {
420
+ .awsui_secondary-content_55fkh_14pjo_376.awsui_with-paddings_55fkh_14pjo_411.awsui_invalid_55fkh_14pjo_323:not(#\9), .awsui_secondary-content_55fkh_14pjo_376.awsui_with-paddings_55fkh_14pjo_411.awsui_warning_55fkh_14pjo_323:not(#\9) {
421
421
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
422
422
  }
423
423
 
424
- .awsui_secondary-actions_55fkh_1cygr_421:not(#\9) {
424
+ .awsui_secondary-actions_55fkh_14pjo_421:not(#\9) {
425
425
  border-collapse: separate;
426
426
  border-spacing: 0;
427
427
  box-sizing: border-box;
@@ -460,17 +460,23 @@ body[data-awsui-focus-visible=true] .awsui_button_55fkh_1cygr_346 > .awsui_actio
460
460
  justify-content: space-between;
461
461
  align-items: flex-end;
462
462
  }
463
- .awsui_secondary-actions_55fkh_1cygr_421.awsui_with-paddings_55fkh_1cygr_411:not(#\9) {
463
+ .awsui_secondary-actions_55fkh_14pjo_421.awsui_with-paddings_55fkh_14pjo_411:not(#\9) {
464
464
  padding-inline-start: var(--space-field-horizontal-gg19kw, 12px);
465
465
  padding-block-start: var(--space-scaled-s-aqzyko, 12px);
466
466
  padding-block-end: var(--space-scaled-xxs-7597g1, 4px);
467
467
  }
468
- .awsui_secondary-actions_55fkh_1cygr_421.awsui_with-paddings_55fkh_1cygr_411.awsui_invalid_55fkh_1cygr_323:not(#\9), .awsui_secondary-actions_55fkh_1cygr_421.awsui_with-paddings_55fkh_1cygr_411.awsui_warning_55fkh_1cygr_323:not(#\9) {
468
+ .awsui_secondary-actions_55fkh_14pjo_421.awsui_with-paddings_55fkh_14pjo_411.awsui_invalid_55fkh_14pjo_323:not(#\9), .awsui_secondary-actions_55fkh_14pjo_421.awsui_with-paddings_55fkh_14pjo_411.awsui_warning_55fkh_14pjo_323:not(#\9) {
469
469
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-width-field-h1g7tw, 2px)));
470
470
  }
471
- .awsui_secondary-actions_55fkh_1cygr_421.awsui_with-paddings_55fkh_1cygr_411 > .awsui_button_55fkh_1cygr_346:not(#\9) {
471
+ .awsui_secondary-actions_55fkh_14pjo_421.awsui_with-paddings_55fkh_14pjo_411 > .awsui_button_55fkh_14pjo_346:not(#\9) {
472
472
  padding-block-end: 0;
473
473
  }
474
- .awsui_secondary-actions_55fkh_1cygr_421 > .awsui_button_55fkh_1cygr_346:not(#\9) {
474
+ .awsui_secondary-actions_55fkh_14pjo_421 > .awsui_button_55fkh_14pjo_346:not(#\9) {
475
475
  padding-block-end: var(--space-scaled-xxs-7597g1, 4px);
476
+ }
477
+
478
+ .awsui_buffer_55fkh_14pjo_474:not(#\9) {
479
+ flex: 1;
480
+ align-self: stretch;
481
+ cursor: text;
476
482
  }
@@ -2,19 +2,20 @@
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_55fkh_1cygr_146",
6
- "textarea-readonly": "awsui_textarea-readonly_55fkh_1cygr_185",
7
- "disabled": "awsui_disabled_55fkh_1cygr_190",
8
- "textarea-invalid": "awsui_textarea-invalid_55fkh_1cygr_198",
9
- "textarea-warning": "awsui_textarea-warning_55fkh_1cygr_223",
10
- "textarea": "awsui_textarea_55fkh_1cygr_185",
11
- "invalid": "awsui_invalid_55fkh_1cygr_323",
12
- "warning": "awsui_warning_55fkh_1cygr_323",
13
- "textarea-wrapper": "awsui_textarea-wrapper_55fkh_1cygr_342",
14
- "button": "awsui_button_55fkh_1cygr_346",
15
- "action-button": "awsui_action-button_55fkh_1cygr_351",
16
- "secondary-content": "awsui_secondary-content_55fkh_1cygr_376",
17
- "with-paddings": "awsui_with-paddings_55fkh_1cygr_411",
18
- "secondary-actions": "awsui_secondary-actions_55fkh_1cygr_421"
5
+ "root": "awsui_root_55fkh_14pjo_146",
6
+ "textarea-readonly": "awsui_textarea-readonly_55fkh_14pjo_185",
7
+ "disabled": "awsui_disabled_55fkh_14pjo_190",
8
+ "textarea-invalid": "awsui_textarea-invalid_55fkh_14pjo_198",
9
+ "textarea-warning": "awsui_textarea-warning_55fkh_14pjo_223",
10
+ "textarea": "awsui_textarea_55fkh_14pjo_185",
11
+ "invalid": "awsui_invalid_55fkh_14pjo_323",
12
+ "warning": "awsui_warning_55fkh_14pjo_323",
13
+ "textarea-wrapper": "awsui_textarea-wrapper_55fkh_14pjo_342",
14
+ "button": "awsui_button_55fkh_14pjo_346",
15
+ "action-button": "awsui_action-button_55fkh_14pjo_351",
16
+ "secondary-content": "awsui_secondary-content_55fkh_14pjo_376",
17
+ "with-paddings": "awsui_with-paddings_55fkh_14pjo_411",
18
+ "secondary-actions": "awsui_secondary-actions_55fkh_14pjo_421",
19
+ "buffer": "awsui_buffer_55fkh_14pjo_474"
19
20
  };
20
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"plain-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,mEAAmE,CAAC;AAGlG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhE,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,yBAAiB,eAAe,CAAC;IAC/B,KAAY,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;;AAkDD,wBAAqC"}
1
+ {"version":3,"file":"plain-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,mEAAmE,CAAC;AAGlG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhE,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,yBAAiB,eAAe,CAAC;IAC/B,KAAY,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;;AAsDD,wBAAqC"}
@@ -8,10 +8,14 @@ import styles from './styles.css.js';
8
8
  const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent, }, ref) => {
9
9
  const menuRef = menuProps.ref;
10
10
  useImperativeHandle(ref, () => (index) => {
11
- var _a;
11
+ var _a, _b, _c;
12
12
  const item = (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-mouse-target="${index}"]`);
13
13
  if (highlightType.moveFocus && item) {
14
- scrollElementIntoView(item);
14
+ // In edge case dropdown can be very small, scrolling can cause side effect AWSUI-60318
15
+ if (((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight) !== undefined && ((_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight) > 15) {
16
+ /* istanbul ignore next: clientHeight always returns 0 in JSDOM, the line is covered by integ tests */
17
+ scrollElementIntoView(item);
18
+ }
15
19
  }
16
20
  }, [highlightType, menuRef]);
17
21
  return (React.createElement(OptionsList, Object.assign({}, menuProps),
@@ -1 +1 @@
1
- {"version":3,"file":"plain-list.js","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,WAAW,MAAM,wCAAwC,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAmBrC,MAAM,SAAS,GAAG,CAChB,EACE,SAAS,EACT,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,GACH,EAClB,GAA6C,EAC7C,EAAE;IACF,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC;IAC9B,mBAAmB,CACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE;;QACtB,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,aAAa,CAAc,uBAAuB,KAAK,IAAI,CAAC,CAAC;QAC3F,IAAI,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE;YACnC,qBAAqB,CAAC,IAAI,CAAC,CAAC;SAC7B;IACH,CAAC,EACD,CAAC,aAAa,EAAE,OAAO,CAAC,CACzB,CAAC;IAEF,OAAO,CACL,oBAAC,WAAW,oBAAK,SAAS;QACvB,aAAa,CAAC;YACb,OAAO,EAAE,eAAe;YACxB,cAAc;YACd,cAAc;YACd,aAAa;YACb,UAAU;YACV,iBAAiB;YACjB,oBAAoB;YACpB,mBAAmB;SACpB,CAAC;QACD,UAAU,CAAC,CAAC,CAAC,CACZ,4BAAI,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAC/C,UAAU,CACR,CACN,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,SAAS,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport OptionsList from '../../internal/components/options-list';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { renderOptions } from '../utils/render-options';\nimport { GetOptionProps, MenuProps } from '../utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface SelectListProps {\n menuProps: MenuProps;\n getOptionProps: GetOptionProps;\n filteredOptions: ReadonlyArray<DropdownOption>;\n filteringValue: string;\n highlightType: HighlightType;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n}\n\nexport namespace SelectListProps {\n export type SelectListRef = (index: number) => void;\n}\n\nconst PlainList = (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n) => {\n const menuRef = menuProps.ref;\n useImperativeHandle(\n ref,\n () => (index: number) => {\n const item = menuRef.current?.querySelector<HTMLElement>(`[data-mouse-target=\"${index}\"]`);\n if (highlightType.moveFocus && item) {\n scrollElementIntoView(item);\n }\n },\n [highlightType, menuRef]\n );\n\n return (\n <OptionsList {...menuProps}>\n {renderOptions({\n options: filteredOptions,\n getOptionProps,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n useInteractiveGroups,\n screenReaderContent,\n })}\n {listBottom ? (\n <li role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </li>\n ) : null}\n </OptionsList>\n );\n};\n\nexport default forwardRef(PlainList);\n"]}
1
+ {"version":3,"file":"plain-list.js","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,WAAW,MAAM,wCAAwC,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAmBrC,MAAM,SAAS,GAAG,CAChB,EACE,SAAS,EACT,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,GACH,EAClB,GAA6C,EAC7C,EAAE;IACF,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC;IAC9B,mBAAmB,CACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE;;QACtB,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,aAAa,CAAc,uBAAuB,KAAK,IAAI,CAAC,CAAC;QAC3F,IAAI,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE;YACnC,uFAAuF;YACvF,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,YAAY,MAAK,SAAS,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,YAAY,IAAG,EAAE,EAAE;gBACrF,sGAAsG;gBACtG,qBAAqB,CAAC,IAAI,CAAC,CAAC;aAC7B;SACF;IACH,CAAC,EACD,CAAC,aAAa,EAAE,OAAO,CAAC,CACzB,CAAC;IAEF,OAAO,CACL,oBAAC,WAAW,oBAAK,SAAS;QACvB,aAAa,CAAC;YACb,OAAO,EAAE,eAAe;YACxB,cAAc;YACd,cAAc;YACd,aAAa;YACb,UAAU;YACV,iBAAiB;YACjB,oBAAoB;YACpB,mBAAmB;SACpB,CAAC;QACD,UAAU,CAAC,CAAC,CAAC,CACZ,4BAAI,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAC/C,UAAU,CACR,CACN,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,SAAS,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport OptionsList from '../../internal/components/options-list';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { renderOptions } from '../utils/render-options';\nimport { GetOptionProps, MenuProps } from '../utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface SelectListProps {\n menuProps: MenuProps;\n getOptionProps: GetOptionProps;\n filteredOptions: ReadonlyArray<DropdownOption>;\n filteringValue: string;\n highlightType: HighlightType;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n}\n\nexport namespace SelectListProps {\n export type SelectListRef = (index: number) => void;\n}\n\nconst PlainList = (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n) => {\n const menuRef = menuProps.ref;\n useImperativeHandle(\n ref,\n () => (index: number) => {\n const item = menuRef.current?.querySelector<HTMLElement>(`[data-mouse-target=\"${index}\"]`);\n if (highlightType.moveFocus && item) {\n // In edge case dropdown can be very small, scrolling can cause side effect AWSUI-60318\n if (menuRef.current?.clientHeight !== undefined && menuRef.current?.clientHeight > 15) {\n /* istanbul ignore next: clientHeight always returns 0 in JSDOM, the line is covered by integ tests */\n scrollElementIntoView(item);\n }\n }\n },\n [highlightType, menuRef]\n );\n\n return (\n <OptionsList {...menuProps}>\n {renderOptions({\n options: filteredOptions,\n getOptionProps,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n useInteractiveGroups,\n screenReaderContent,\n })}\n {listBottom ? (\n <li role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </li>\n ) : null}\n </OptionsList>\n );\n};\n\nexport default forwardRef(PlainList);\n"]}
package/tabs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { TabsProps } from './interfaces';
3
3
  export { TabsProps };
4
- export default function Tabs({ tabs, variant, onChange, activeTabId: controlledTabId, ariaLabel, ariaLabelledby, disableContentPaddings, i18nStrings, fitHeight, ...rest }: TabsProps): JSX.Element;
4
+ export default function Tabs({ tabs, variant, onChange, activeTabId: controlledTabId, ariaLabel, ariaLabelledby, disableContentPaddings, i18nStrings, fitHeight, keyboardActivationMode, actions, ...rest }: TabsProps): JSX.Element;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAUrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,IAAI,EACJ,OAAmB,EACnB,QAAQ,EACR,WAAW,EAAE,eAAe,EAC5B,SAAS,EACT,cAAc,EACd,sBAA8B,EAC9B,WAAW,EACX,SAAS,EACT,GAAG,IAAI,EACR,EAAE,SAAS,eAuHX"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAsBrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,IAAI,EACJ,OAAmB,EACnB,QAAQ,EACR,WAAW,EAAE,eAAe,EAC5B,SAAS,EACT,cAAc,EACd,sBAA8B,EAC9B,WAAW,EACX,SAAS,EACT,sBAAoC,EACpC,OAAO,EACP,GAAG,IAAI,EACR,EAAE,SAAS,eAkIX"}
package/tabs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import React from 'react';
4
+ import React, { useRef } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
7
7
  import InternalContainer from '../container/internal';
@@ -22,17 +22,31 @@ function firstEnabledTab(tabs) {
22
22
  }
23
23
  return null;
24
24
  }
25
+ function shouldRenderTabContent(tab, viewedTabs) {
26
+ switch (tab.contentRenderStrategy) {
27
+ case 'active':
28
+ return false; // rendering active tab is handled directly in component
29
+ case 'eager':
30
+ return true;
31
+ case 'lazy':
32
+ return viewedTabs.has(tab.id);
33
+ }
34
+ return false;
35
+ }
25
36
  export default function Tabs(_a) {
26
37
  var _b, _c;
27
- var { tabs, variant = 'default', onChange, activeTabId: controlledTabId, ariaLabel, ariaLabelledby, disableContentPaddings = false, i18nStrings, fitHeight } = _a, rest = __rest(_a, ["tabs", "variant", "onChange", "activeTabId", "ariaLabel", "ariaLabelledby", "disableContentPaddings", "i18nStrings", "fitHeight"]);
38
+ var { tabs, variant = 'default', onChange, activeTabId: controlledTabId, ariaLabel, ariaLabelledby, disableContentPaddings = false, i18nStrings, fitHeight, keyboardActivationMode = 'automatic', actions } = _a, rest = __rest(_a, ["tabs", "variant", "onChange", "activeTabId", "ariaLabel", "ariaLabelledby", "disableContentPaddings", "i18nStrings", "fitHeight", "keyboardActivationMode", "actions"]);
28
39
  for (const tab of tabs) {
29
40
  checkSafeUrl('Tabs', tab.href);
30
41
  }
31
42
  const { __internalRootRef } = useBaseComponent('Tabs', {
32
- props: { disableContentPaddings, variant, fitHeight },
43
+ props: { disableContentPaddings, variant, fitHeight, keyboardActivationMode },
33
44
  metadata: {
34
45
  hasActions: tabs.some(tab => !!tab.action),
46
+ hasHeaderActions: !!actions,
35
47
  hasDisabledReasons: tabs.some(tab => !!tab.disabledReason),
48
+ hasEagerLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'eager'),
49
+ hasLazyLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'lazy'),
36
50
  },
37
51
  });
38
52
  const idNamespace = useUniqueId('awsui-tabs-');
@@ -41,6 +55,10 @@ export default function Tabs(_a) {
41
55
  controlledProp: 'activeTabId',
42
56
  changeHandler: 'onChange',
43
57
  });
58
+ const viewedTabs = useRef(new Set());
59
+ if (activeTabId !== undefined) {
60
+ viewedTabs.current.add(activeTabId);
61
+ }
44
62
  const baseProps = getBaseProps(rest);
45
63
  const analyticsComponentMetadata = {
46
64
  name: 'awsui.Tabs',
@@ -70,8 +88,8 @@ export default function Tabs(_a) {
70
88
  tabIndex: 0,
71
89
  'aria-labelledby': getTabElementId({ namespace: idNamespace, tabId: tab.id }),
72
90
  };
73
- const isContentShown = isTabSelected && !selectedTab.disabled;
74
- return React.createElement("div", Object.assign({}, contentAttributes), isContentShown && selectedTab.content);
91
+ const isContentShown = !tab.disabled && (isTabSelected || shouldRenderTabContent(tab, viewedTabs.current));
92
+ return React.createElement("div", Object.assign({}, contentAttributes), isContentShown && tab.content);
75
93
  };
76
94
  return (React.createElement("div", { className: clsx(variant === 'container' || variant === 'stacked'
77
95
  ? styles['tabs-container-content-wrapper']
@@ -79,10 +97,10 @@ export default function Tabs(_a) {
79
97
  [styles['with-paddings']]: !disableContentPaddings,
80
98
  }) }, tabs.map(renderContent)));
81
99
  };
82
- const header = (React.createElement(TabHeaderBar, { activeTabId: activeTabId, variant: variant, idNamespace: idNamespace, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, tabs: tabs, onChange: changeDetail => {
100
+ const header = (React.createElement(TabHeaderBar, { activeTabId: activeTabId, variant: variant, idNamespace: idNamespace, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, tabs: tabs, actions: actions, onChange: changeDetail => {
83
101
  setActiveTabId(changeDetail.activeTabId);
84
102
  fireNonCancelableEvent(onChange, changeDetail);
85
- }, i18nStrings: i18nStrings }));
103
+ }, i18nStrings: i18nStrings, keyboardActivationMode: keyboardActivationMode }));
86
104
  if (variant === 'container' || variant === 'stacked') {
87
105
  return (React.createElement(InternalContainer, Object.assign({ header: header, disableHeaderPaddings: true }, baseProps, { className: clsx(baseProps.className, styles.root), __internalRootRef: __internalRootRef, disableContentPaddings: true, variant: variant === 'stacked' ? 'stacked' : 'default', fitHeight: fitHeight }, getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })), content()));
88
106
  }
package/tabs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;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gB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalContainer from '../container/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { GeneratedAnalyticsMetadataTabsComponent } from './analytics-metadata/interfaces';\nimport { TabsProps } from './interfaces';\nimport { getTabElementId, TabHeaderBar } from './tab-header-bar';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { TabsProps };\n\nfunction firstEnabledTab(tabs: ReadonlyArray<TabsProps.Tab>) {\n const enabledTabs = tabs.filter(tab => !tab.disabled);\n if (enabledTabs.length > 0) {\n return enabledTabs[0];\n }\n return null;\n}\n\nexport default function Tabs({\n tabs,\n variant = 'default',\n onChange,\n activeTabId: controlledTabId,\n ariaLabel,\n ariaLabelledby,\n disableContentPaddings = false,\n i18nStrings,\n fitHeight,\n ...rest\n}: TabsProps) {\n for (const tab of tabs) {\n checkSafeUrl('Tabs', tab.href);\n }\n const { __internalRootRef } = useBaseComponent('Tabs', {\n props: { disableContentPaddings, variant, fitHeight },\n metadata: {\n hasActions: tabs.some(tab => !!tab.action),\n hasDisabledReasons: tabs.some(tab => !!tab.disabledReason),\n },\n });\n const idNamespace = useUniqueId('awsui-tabs-');\n\n const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, firstEnabledTab(tabs)?.id ?? '', {\n componentName: 'Tabs',\n controlledProp: 'activeTabId',\n changeHandler: 'onChange',\n });\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataTabsComponent = {\n name: 'awsui.Tabs',\n label: `.${analyticsSelectors['tabs-header-list']}`,\n };\n\n if (activeTabId) {\n analyticsComponentMetadata.properties = {\n activeTabId,\n activeTabLabel: `.${analyticsSelectors['active-tab-header']} .${analyticsSelectors['tab-label']}`,\n activeTabPosition: `${tabs.findIndex(tab => tab.id === activeTabId) + 1}`,\n tabsCount: `${tabs.length}`,\n };\n }\n\n const content = () => {\n const selectedTab = tabs.filter(tab => tab.id === activeTabId)[0];\n const renderContent = (tab: TabsProps.Tab) => {\n const isTabSelected = tab === selectedTab;\n\n const classes = clsx({\n [styles['tabs-content']]: true,\n [styles['tabs-content-active']]: isTabSelected,\n });\n\n const contentAttributes: JSX.IntrinsicElements['div'] = {\n className: classes,\n role: 'tabpanel',\n id: `${idNamespace}-${tab.id}-panel`,\n key: `${idNamespace}-${tab.id}-panel`,\n tabIndex: 0,\n 'aria-labelledby': getTabElementId({ namespace: idNamespace, tabId: tab.id }),\n };\n\n const isContentShown = isTabSelected && !selectedTab.disabled;\n return <div {...contentAttributes}>{isContentShown && selectedTab.content}</div>;\n };\n\n return (\n <div\n className={clsx(\n variant === 'container' || variant === 'stacked'\n ? styles['tabs-container-content-wrapper']\n : styles['tabs-content-wrapper'],\n {\n [styles['with-paddings']]: !disableContentPaddings,\n }\n )}\n >\n {tabs.map(renderContent)}\n </div>\n );\n };\n\n const header = (\n <TabHeaderBar\n activeTabId={activeTabId}\n variant={variant}\n idNamespace={idNamespace}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n tabs={tabs}\n onChange={changeDetail => {\n setActiveTabId(changeDetail.activeTabId);\n fireNonCancelableEvent(onChange, changeDetail);\n }}\n i18nStrings={i18nStrings}\n />\n );\n\n if (variant === 'container' || variant === 'stacked') {\n return (\n <InternalContainer\n header={header}\n disableHeaderPaddings={true}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n __internalRootRef={__internalRootRef}\n disableContentPaddings={true}\n variant={variant === 'stacked' ? 'stacked' : 'default'}\n fitHeight={fitHeight}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n >\n {content()}\n </InternalContainer>\n );\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root, styles.tabs, { [styles['fit-height']]: fitHeight })}\n ref={__internalRootRef}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n >\n {header}\n {content()}\n </div>\n );\n}\n\napplyDisplayName(Tabs, 'Tabs');\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tabs/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,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,SAAS,eAAe,CAAC,IAAkC;IACzD,MAAM,WAAW,GAAG,IA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IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EACrG,GAAG,EAAE,iBAAiB,IAClB,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC;QAE3E,MAAM;QACN,OAAO,EAAE,CACN,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,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 { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalContainer from '../container/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { GeneratedAnalyticsMetadataTabsComponent } from './analytics-metadata/interfaces';\nimport { TabsProps } from './interfaces';\nimport { getTabElementId, TabHeaderBar } from './tab-header-bar';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { TabsProps };\n\nfunction firstEnabledTab(tabs: ReadonlyArray<TabsProps.Tab>) {\n const enabledTabs = tabs.filter(tab => !tab.disabled);\n if (enabledTabs.length > 0) {\n return enabledTabs[0];\n }\n return null;\n}\n\nfunction shouldRenderTabContent(tab: TabsProps.Tab, viewedTabs: Set<string>) {\n switch (tab.contentRenderStrategy) {\n case 'active':\n return false; // rendering active tab is handled directly in component\n case 'eager':\n return true;\n case 'lazy':\n return viewedTabs.has(tab.id);\n }\n return false;\n}\n\nexport default function Tabs({\n tabs,\n variant = 'default',\n onChange,\n activeTabId: controlledTabId,\n ariaLabel,\n ariaLabelledby,\n disableContentPaddings = false,\n i18nStrings,\n fitHeight,\n keyboardActivationMode = 'automatic',\n actions,\n ...rest\n}: TabsProps) {\n for (const tab of tabs) {\n checkSafeUrl('Tabs', tab.href);\n }\n const { __internalRootRef } = useBaseComponent('Tabs', {\n props: { disableContentPaddings, variant, fitHeight, keyboardActivationMode },\n metadata: {\n hasActions: tabs.some(tab => !!tab.action),\n hasHeaderActions: !!actions,\n hasDisabledReasons: tabs.some(tab => !!tab.disabledReason),\n hasEagerLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'eager'),\n hasLazyLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'lazy'),\n },\n });\n const idNamespace = useUniqueId('awsui-tabs-');\n\n const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, firstEnabledTab(tabs)?.id ?? '', {\n componentName: 'Tabs',\n controlledProp: 'activeTabId',\n changeHandler: 'onChange',\n });\n\n const viewedTabs = useRef(new Set<string>());\n if (activeTabId !== undefined) {\n viewedTabs.current.add(activeTabId);\n }\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataTabsComponent = {\n name: 'awsui.Tabs',\n label: `.${analyticsSelectors['tabs-header-list']}`,\n };\n\n if (activeTabId) {\n analyticsComponentMetadata.properties = {\n activeTabId,\n activeTabLabel: `.${analyticsSelectors['active-tab-header']} .${analyticsSelectors['tab-label']}`,\n activeTabPosition: `${tabs.findIndex(tab => tab.id === activeTabId) + 1}`,\n tabsCount: `${tabs.length}`,\n };\n }\n\n const content = () => {\n const selectedTab = tabs.filter(tab => tab.id === activeTabId)[0];\n const renderContent = (tab: TabsProps.Tab) => {\n const isTabSelected = tab === selectedTab;\n\n const classes = clsx({\n [styles['tabs-content']]: true,\n [styles['tabs-content-active']]: isTabSelected,\n });\n\n const contentAttributes: JSX.IntrinsicElements['div'] = {\n className: classes,\n role: 'tabpanel',\n id: `${idNamespace}-${tab.id}-panel`,\n key: `${idNamespace}-${tab.id}-panel`,\n tabIndex: 0,\n 'aria-labelledby': getTabElementId({ namespace: idNamespace, tabId: tab.id }),\n };\n\n const isContentShown = !tab.disabled && (isTabSelected || shouldRenderTabContent(tab, viewedTabs.current));\n\n return <div {...contentAttributes}>{isContentShown && tab.content}</div>;\n };\n\n return (\n <div\n className={clsx(\n variant === 'container' || variant === 'stacked'\n ? styles['tabs-container-content-wrapper']\n : styles['tabs-content-wrapper'],\n {\n [styles['with-paddings']]: !disableContentPaddings,\n }\n )}\n >\n {tabs.map(renderContent)}\n </div>\n );\n };\n\n const header = (\n <TabHeaderBar\n activeTabId={activeTabId}\n variant={variant}\n idNamespace={idNamespace}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n tabs={tabs}\n actions={actions}\n onChange={changeDetail => {\n setActiveTabId(changeDetail.activeTabId);\n fireNonCancelableEvent(onChange, changeDetail);\n }}\n i18nStrings={i18nStrings}\n keyboardActivationMode={keyboardActivationMode}\n />\n );\n\n if (variant === 'container' || variant === 'stacked') {\n return (\n <InternalContainer\n header={header}\n disableHeaderPaddings={true}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n __internalRootRef={__internalRootRef}\n disableContentPaddings={true}\n variant={variant === 'stacked' ? 'stacked' : 'default'}\n fitHeight={fitHeight}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n >\n {content()}\n </InternalContainer>\n );\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root, styles.tabs, { [styles['fit-height']]: fitHeight })}\n ref={__internalRootRef}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n >\n {header}\n {content()}\n </div>\n );\n}\n\napplyDisplayName(Tabs, 'Tabs');\n"]}
@@ -23,8 +23,19 @@ export interface TabsProps extends BaseComponentProps {
23
23
  * ALT, SHIFT, META). This enables the user to open new browser tabs with an initially selected component tab,
24
24
  * if your application routing can handle such deep links. You can manually update routing on the current page
25
25
  * using the `activeTabHref` property of the `change` event's detail.
26
+ * - `contentRenderStrategy` (string) - (Optional) Determines when tab content is rendered:
27
+ - `'active'`: (Default) Only render content when the tab is active.
28
+ * - `'eager'`: Always render tab content (hidden when the tab is not active).
29
+ * - `'lazy'`: Like 'eager', but content is only rendered after the tab is first activated.
26
30
  */
27
31
  tabs: ReadonlyArray<TabsProps.Tab>;
32
+ /**
33
+ * Actions for the tabs header, displayed next to the list of tabs.
34
+ * Use this to add a button or button dropdown that performs actions on the
35
+ * entire tab list. We recommend a maximum of one interactive element to
36
+ * minimize the number of keyboard tab stops between the tab list and content.
37
+ */
38
+ actions?: React.ReactNode;
28
39
  /**
29
40
  * The possible visual variants of tabs are the following:
30
41
  * * `default` - Use in any context.
@@ -69,6 +80,16 @@ export interface TabsProps extends BaseComponentProps {
69
80
  * If the tab content is too short, it will stretch. If the tab content is too long, a vertical scrollbar will be shown.
70
81
  */
71
82
  fitHeight?: boolean;
83
+ /**
84
+ * Determines how the active tab is switched when navigating using
85
+ * the keyboard. The options are:
86
+ * - 'automatic' (default): the active tab is switched using the arrow keys.
87
+ * - 'manual': a tab must be explicitly activated using the enter/space key.
88
+ * We recommend using 'automatic' in most situations to provide consistent
89
+ * and quick switching between tabs. Use 'manual' only if there is a specific
90
+ * need to introduce friction to the switching of tabs.
91
+ */
92
+ keyboardActivationMode?: 'automatic' | 'manual';
72
93
  }
73
94
  export declare namespace TabsProps {
74
95
  type Variant = 'default' | 'container' | 'stacked';
@@ -124,6 +145,13 @@ export declare namespace TabsProps {
124
145
  * using the `activeTabHref` property of the `change` event's detail.
125
146
  */
126
147
  href?: string;
148
+ /**
149
+ * Determines when tab content is rendered:
150
+ * - 'active' (default): Only render content when the tab is active.
151
+ * - 'eager': Always render tab content (hidden when the tab is not active).
152
+ * - 'lazy': Like 'eager', but content is only rendered after the tab is first activated.
153
+ */
154
+ contentRenderStrategy?: 'active' | 'eager' | 'lazy';
127
155
  }
128
156
  interface Change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AEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;IAED,UAAiB,WAAW;QAC1B;;WAEG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B;;WAEG;QACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B;;;WAGG;QACH,kCAAkC,CAAC,EAAE,MAAM,CAAC;KAC7C;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tabs/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from '../button/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TabsProps extends BaseComponentProps {\n /**\n * Specifies the tabs to display. Each tab object has the following properties:\n *\n * - `id` (string) - The tab identifier. This value needs to be passed to the Tabs component as `activeTabId` to select this tab.\n * - `label` (ReactNode) - Tab label shown in the UI.\n * - `content` (ReactNode) - (Optional) Tab content to render in the container.\n * - `disabled` (boolean) - (Optional) Specifies if this tab is disabled.\n * - `disabledReason` (string) - (Optional) Displays tooltip near the tab when disabled. Use to provide additional context.\n * - `dismissible` (boolean) - (Optional) Determines whether the tab includes a dismiss icon button. By default, the dismiss button is not included.\n * - `dismissLabel` (boolean) - (Optional) Specifies an aria-label for the dismiss icon button.\n * - `dismissDisabled` (boolean) - (Optional) Determines whether the dismiss button is disabled.\n * - `action` (ReactNode) - (Optional) Action for the tab, rendered next to its corresponding label.\n * Although it is technically possible to insert any content, our UX guidelines only allow you to add\n * an icon button or icon button dropdown.\n * - `onDismiss` (ButtonProps['onClick']) - (Optional) Called when a user clicks on the dismiss button.\n * - `href` (string) - (Optional) You can use this parameter to change the default `href` of the internal tab anchor. The\n * `click` event default behavior is prevented, unless the user clicks the tab with a key modifier (that is, CTRL,\n * ALT, SHIFT, META). This enables the user to open new browser tabs with an initially selected component tab,\n * if your application routing can handle such deep links. You can manually update routing on the current page\n * using the `activeTabHref` property of the `change` event's detail.\n */\n tabs: ReadonlyArray<TabsProps.Tab>;\n\n /**\n * The possible visual variants of tabs are the following:\n * * `default` - Use in any context.\n * * `container` - Use this variant to have the tabs displayed within a container header.\n * * `stacked` - Use this variant directly adjacent to other stacked containers (such as a container, table).\n * @visualrefresh `stacked` variant\n */\n variant?: TabsProps.Variant;\n\n /**\n * Called whenever the user selects a different tab.\n * The event's `detail` contains the new `activeTabId`.\n */\n onChange?: NonCancelableEventHandler<TabsProps.ChangeDetail>;\n\n /**\n * The `id` of the currently active tab.\n * * If you don't set this property, the component activates the first tab and switches tabs automatically when a tab header is clicked (that is, uncontrolled behavior).\n * * If you explicitly set this property, you must set define an `onChange` handler to update the property when a tab header is clicked (that is, controlled behavior).\n */\n activeTabId?: string;\n\n /**\n * Provides an `aria-label` to the tab container.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n\n /**\n * Sets the `aria-labelledby` property on the tab container.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Determines whether the tab content has padding. If `true`, removes the default padding from the tab content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: TabsProps.I18nStrings;\n /**\n * Enabling this property makes the tab content fit to the available height.\n * If the tab content is too short, it will stretch. If the tab content is too long, a vertical scrollbar will be shown.\n */\n fitHeight?: boolean;\n}\nexport namespace TabsProps {\n export type Variant = 'default' | 'container' | 'stacked';\n\n export interface Tab {\n /**\n * The tab id. This value will be need to be passed to the Tabs component as `activeTabId` to select this tab.\n */\n id: string;\n /**\n * Tab label shown in the UI.\n */\n label: React.ReactNode;\n /**\n * Tab content to render in the container.\n */\n content?: React.ReactNode;\n /**\n * Whether this tab is disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why this tab is disabled.\n */\n disabledReason?: string;\n /**\n * (Optional) Determines whether the tab includes a dismiss icon button. By default, the dismiss button is not included.\n * When a user clicks on this button the onDismiss handler is called.\n */\n dismissible?: boolean;\n /**\n * (Optional) Specifies an aria-label for the dismiss icon button.\n */\n dismissLabel?: string;\n /**\n * (Optional) Determines whether the dismiss button is disabled.\n */\n dismissDisabled?: boolean;\n /**\n * (Optional) Action for the tab, rendered next to its corresponding label.\n * Although it is technically possible to insert any content, our UX guidelines only allow you to add\n * an icon button or icon button dropdown.\n */\n action?: React.ReactNode;\n /**\n * (event => void) Called when a user clicks on the dismiss button.\n */\n onDismiss?: ButtonProps['onClick'];\n /**\n * You can use this parameter to change the default `href` of the internal tab anchor. The\n * `click` event default behavior is prevented, unless the user clicks the tab with a key modifier (CTRL,\n * ALT, SHIFT, META). This allows to open new browser tabs with an initially selected component tab,\n * when the routing can handle such deep links. You can manually update routing on the current page\n * using the `activeTabHref` property of the `change` event's detail.\n */\n href?: string;\n }\n\n export interface ChangeDetail {\n /**\n * The ID of the clicked tab.\n */\n activeTabId: string;\n /**\n * The `href` attribute of the clicked tab, if defined.\n */\n activeTabHref?: string;\n }\n\n export interface I18nStrings {\n /**\n * ARIA label for the scroll left button that appears when the tab header is wider than the container.\n */\n scrollLeftAriaLabel?: string;\n /**\n * ARIA label for the scroll right button that appears when the tab header is wider than the container.\n */\n scrollRightAriaLabel?: string;\n /**\n * ARIA role description for the Tabs component when an action or dismissible prop is in use. This is used\n * with role=\"application\" to provide further information on the purpose of this component\n */\n tabsWithActionsAriaRoleDescription?: string;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tabs/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from '../button/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TabsProps extends BaseComponentProps {\n /**\n * Specifies the tabs to display. Each tab object has the following properties:\n *\n * - `id` (string) - The tab identifier. This value needs to be passed to the Tabs component as `activeTabId` to select this tab.\n * - `label` (ReactNode) - Tab label shown in the UI.\n * - `content` (ReactNode) - (Optional) Tab content to render in the container.\n * - `disabled` (boolean) - (Optional) Specifies if this tab is disabled.\n * - `disabledReason` (string) - (Optional) Displays tooltip near the tab when disabled. Use to provide additional context.\n * - `dismissible` (boolean) - (Optional) Determines whether the tab includes a dismiss icon button. By default, the dismiss button is not included.\n * - `dismissLabel` (boolean) - (Optional) Specifies an aria-label for the dismiss icon button.\n * - `dismissDisabled` (boolean) - (Optional) Determines whether the dismiss button is disabled.\n * - `action` (ReactNode) - (Optional) Action for the tab, rendered next to its corresponding label.\n * Although it is technically possible to insert any content, our UX guidelines only allow you to add\n * an icon button or icon button dropdown.\n * - `onDismiss` (ButtonProps['onClick']) - (Optional) Called when a user clicks on the dismiss button.\n * - `href` (string) - (Optional) You can use this parameter to change the default `href` of the internal tab anchor. The\n * `click` event default behavior is prevented, unless the user clicks the tab with a key modifier (that is, CTRL,\n * ALT, SHIFT, META). This enables the user to open new browser tabs with an initially selected component tab,\n * if your application routing can handle such deep links. You can manually update routing on the current page\n * using the `activeTabHref` property of the `change` event's detail.\n * - `contentRenderStrategy` (string) - (Optional) Determines when tab content is rendered:\n - `'active'`: (Default) Only render content when the tab is active.\n * - `'eager'`: Always render tab content (hidden when the tab is not active).\n * - `'lazy'`: Like 'eager', but content is only rendered after the tab is first activated.\n */\n tabs: ReadonlyArray<TabsProps.Tab>;\n\n /**\n * Actions for the tabs header, displayed next to the list of tabs.\n * Use this to add a button or button dropdown that performs actions on the\n * entire tab list. We recommend a maximum of one interactive element to\n * minimize the number of keyboard tab stops between the tab list and content.\n */\n actions?: React.ReactNode;\n\n /**\n * The possible visual variants of tabs are the following:\n * * `default` - Use in any context.\n * * `container` - Use this variant to have the tabs displayed within a container header.\n * * `stacked` - Use this variant directly adjacent to other stacked containers (such as a container, table).\n * @visualrefresh `stacked` variant\n */\n variant?: TabsProps.Variant;\n\n /**\n * Called whenever the user selects a different tab.\n * The event's `detail` contains the new `activeTabId`.\n */\n onChange?: NonCancelableEventHandler<TabsProps.ChangeDetail>;\n\n /**\n * The `id` of the currently active tab.\n * * If you don't set this property, the component activates the first tab and switches tabs automatically when a tab header is clicked (that is, uncontrolled behavior).\n * * If you explicitly set this property, you must set define an `onChange` handler to update the property when a tab header is clicked (that is, controlled behavior).\n */\n activeTabId?: string;\n\n /**\n * Provides an `aria-label` to the tab container.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n\n /**\n * Sets the `aria-labelledby` property on the tab container.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Determines whether the tab content has padding. If `true`, removes the default padding from the tab content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: TabsProps.I18nStrings;\n /**\n * Enabling this property makes the tab content fit to the available height.\n * If the tab content is too short, it will stretch. If the tab content is too long, a vertical scrollbar will be shown.\n */\n fitHeight?: boolean;\n /**\n * Determines how the active tab is switched when navigating using\n * the keyboard. The options are:\n * - 'automatic' (default): the active tab is switched using the arrow keys.\n * - 'manual': a tab must be explicitly activated using the enter/space key.\n * We recommend using 'automatic' in most situations to provide consistent\n * and quick switching between tabs. Use 'manual' only if there is a specific\n * need to introduce friction to the switching of tabs.\n */\n keyboardActivationMode?: 'automatic' | 'manual';\n}\nexport namespace TabsProps {\n export type Variant = 'default' | 'container' | 'stacked';\n\n export interface Tab {\n /**\n * The tab id. This value will be need to be passed to the Tabs component as `activeTabId` to select this tab.\n */\n id: string;\n /**\n * Tab label shown in the UI.\n */\n label: React.ReactNode;\n /**\n * Tab content to render in the container.\n */\n content?: React.ReactNode;\n /**\n * Whether this tab is disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why this tab is disabled.\n */\n disabledReason?: string;\n /**\n * (Optional) Determines whether the tab includes a dismiss icon button. By default, the dismiss button is not included.\n * When a user clicks on this button the onDismiss handler is called.\n */\n dismissible?: boolean;\n /**\n * (Optional) Specifies an aria-label for the dismiss icon button.\n */\n dismissLabel?: string;\n /**\n * (Optional) Determines whether the dismiss button is disabled.\n */\n dismissDisabled?: boolean;\n /**\n * (Optional) Action for the tab, rendered next to its corresponding label.\n * Although it is technically possible to insert any content, our UX guidelines only allow you to add\n * an icon button or icon button dropdown.\n */\n action?: React.ReactNode;\n /**\n * (event => void) Called when a user clicks on the dismiss button.\n */\n onDismiss?: ButtonProps['onClick'];\n /**\n * You can use this parameter to change the default `href` of the internal tab anchor. The\n * `click` event default behavior is prevented, unless the user clicks the tab with a key modifier (CTRL,\n * ALT, SHIFT, META). This allows to open new browser tabs with an initially selected component tab,\n * when the routing can handle such deep links. You can manually update routing on the current page\n * using the `activeTabHref` property of the `change` event's detail.\n */\n href?: string;\n /**\n * Determines when tab content is rendered:\n * - 'active' (default): Only render content when the tab is active.\n * - 'eager': Always render tab content (hidden when the tab is not active).\n * - 'lazy': Like 'eager', but content is only rendered after the tab is first activated.\n */\n contentRenderStrategy?: 'active' | 'eager' | 'lazy';\n }\n\n export interface ChangeDetail {\n /**\n * The ID of the clicked tab.\n */\n activeTabId: string;\n /**\n * The `href` attribute of the clicked tab, if defined.\n */\n activeTabHref?: string;\n }\n\n export interface I18nStrings {\n /**\n * ARIA label for the scroll left button that appears when the tab header is wider than the container.\n */\n scrollLeftAriaLabel?: string;\n /**\n * ARIA label for the scroll right button that appears when the tab header is wider than the container.\n */\n scrollRightAriaLabel?: string;\n /**\n * ARIA role description for the Tabs component when an action or dismissible prop is in use. This is used\n * with role=\"application\" to provide further information on the purpose of this component\n */\n tabsWithActionsAriaRoleDescription?: string;\n }\n}\n"]}