@cloudscape-design/components 3.0.1306 → 3.0.1308

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 (60) hide show
  1. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  2. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +4 -2
  3. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  4. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -1
  5. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +4 -2
  6. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
  7. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  8. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +3 -2
  9. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  10. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
  12. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  13. package/app-layout/visual-refresh-toolbar/interfaces.d.ts +1 -0
  14. package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  15. package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  16. package/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
  17. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +12 -1
  18. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  19. package/badge/styles.css.js +10 -10
  20. package/badge/styles.scoped.css +29 -16
  21. package/badge/styles.selectors.js +10 -10
  22. package/expandable-section/styles.css.js +35 -35
  23. package/expandable-section/styles.scoped.css +68 -68
  24. package/expandable-section/styles.selectors.js +35 -35
  25. package/file-token-group/file-token.js +1 -1
  26. package/file-token-group/file-token.js.map +1 -1
  27. package/icon/interfaces.d.ts +1 -1
  28. package/icon/interfaces.d.ts.map +1 -1
  29. package/icon/interfaces.js.map +1 -1
  30. package/icon/internal.js +2 -2
  31. package/icon/internal.js.map +1 -1
  32. package/icon/styles.css.js +41 -39
  33. package/icon/styles.scoped.css +104 -85
  34. package/icon/styles.selectors.js +41 -39
  35. package/internal/base-component/styles.scoped.css +35 -3
  36. package/internal/environment.js +2 -2
  37. package/internal/environment.json +2 -2
  38. package/internal/generated/styles/tokens.d.ts +23 -1
  39. package/internal/generated/styles/tokens.js +23 -1
  40. package/internal/generated/theming/index.cjs +476 -4
  41. package/internal/generated/theming/index.cjs.d.ts +216 -0
  42. package/internal/generated/theming/index.d.ts +216 -0
  43. package/internal/generated/theming/index.js +476 -4
  44. package/internal/hooks/use-width-change/index.d.ts +12 -0
  45. package/internal/hooks/use-width-change/index.d.ts.map +1 -0
  46. package/internal/hooks/use-width-change/index.js +33 -0
  47. package/internal/hooks/use-width-change/index.js.map +1 -0
  48. package/internal/manifest.json +1 -1
  49. package/manifest.json +2 -2
  50. package/package.json +1 -1
  51. package/prompt-input/internal.d.ts.map +1 -1
  52. package/prompt-input/internal.js +9 -2
  53. package/prompt-input/internal.js.map +1 -1
  54. package/prompt-input/tokens/use-token-mode.d.ts.map +1 -1
  55. package/prompt-input/tokens/use-token-mode.js +0 -9
  56. package/prompt-input/tokens/use-token-mode.js.map +1 -1
  57. package/test-utils/dom/code-editor/index.d.ts +1 -1
  58. package/test-utils/dom/code-editor/index.js +1 -1
  59. package/wizard/wizard-step-list.js +4 -4
  60. package/wizard/wizard-step-list.js.map +1 -1
@@ -158,10 +158,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
158
158
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
159
159
  SPDX-License-Identifier: Apache-2.0
160
160
  */
161
- .awsui_content-enter_gwq0h_1tk4s_161:not(#\9) {
162
- animation: awsui_awsui-motion-fade-in_gwq0h_1tk4s_1 var(--motion-duration-show-paced-otsjh8, 180ms) var(--motion-easing-show-paced-ym6eyn, ease-out);
161
+ .awsui_content-enter_gwq0h_1sjri_161:not(#\9) {
162
+ animation: awsui_awsui-motion-fade-in_gwq0h_1sjri_1 var(--motion-duration-show-paced-otsjh8, 180ms) var(--motion-easing-show-paced-ym6eyn, ease-out);
163
163
  }
164
- @keyframes awsui_awsui-motion-fade-in_gwq0h_1tk4s_1 {
164
+ @keyframes awsui_awsui-motion-fade-in_gwq0h_1sjri_1 {
165
165
  from {
166
166
  opacity: 0.2;
167
167
  }
@@ -170,45 +170,45 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
170
170
  }
171
171
  }
172
172
  @media (prefers-reduced-motion: reduce) {
173
- .awsui_content-enter_gwq0h_1tk4s_161:not(#\9) {
173
+ .awsui_content-enter_gwq0h_1sjri_161:not(#\9) {
174
174
  animation: none;
175
175
  transition: none;
176
176
  }
177
177
  }
178
- .awsui-motion-disabled .awsui_content-enter_gwq0h_1tk4s_161:not(#\9), .awsui-mode-entering .awsui_content-enter_gwq0h_1tk4s_161:not(#\9) {
178
+ .awsui-motion-disabled .awsui_content-enter_gwq0h_1sjri_161:not(#\9), .awsui-mode-entering .awsui_content-enter_gwq0h_1sjri_161:not(#\9) {
179
179
  animation: none;
180
180
  transition: none;
181
181
  }
182
182
 
183
- .awsui_trigger-expanded_gwq0h_1tk4s_183:not(#\9) {
183
+ .awsui_trigger-expanded_gwq0h_1sjri_183:not(#\9) {
184
184
  transition: border-bottom-color var(--motion-duration-show-paced-otsjh8, 180ms) var(--motion-easing-show-paced-ym6eyn, ease-out);
185
185
  }
186
186
  @media (prefers-reduced-motion: reduce) {
187
- .awsui_trigger-expanded_gwq0h_1tk4s_183:not(#\9) {
187
+ .awsui_trigger-expanded_gwq0h_1sjri_183:not(#\9) {
188
188
  animation: none;
189
189
  transition: none;
190
190
  }
191
191
  }
192
- .awsui-motion-disabled .awsui_trigger-expanded_gwq0h_1tk4s_183:not(#\9), .awsui-mode-entering .awsui_trigger-expanded_gwq0h_1tk4s_183:not(#\9) {
192
+ .awsui-motion-disabled .awsui_trigger-expanded_gwq0h_1sjri_183:not(#\9), .awsui-mode-entering .awsui_trigger-expanded_gwq0h_1sjri_183:not(#\9) {
193
193
  animation: none;
194
194
  transition: none;
195
195
  }
196
196
 
197
- .awsui_icon_gwq0h_1tk4s_197:not(#\9) {
197
+ .awsui_icon_gwq0h_1sjri_197:not(#\9) {
198
198
  transition: transform var(--motion-duration-rotate-90-lyzb0k, 135ms) var(--motion-easing-rotate-90-jhbqg9, cubic-bezier(0.165, 0.84, 0.44, 1));
199
199
  }
200
200
  @media (prefers-reduced-motion: reduce) {
201
- .awsui_icon_gwq0h_1tk4s_197:not(#\9) {
201
+ .awsui_icon_gwq0h_1sjri_197:not(#\9) {
202
202
  animation: none;
203
203
  transition: none;
204
204
  }
205
205
  }
206
- .awsui-motion-disabled .awsui_icon_gwq0h_1tk4s_197:not(#\9), .awsui-mode-entering .awsui_icon_gwq0h_1tk4s_197:not(#\9) {
206
+ .awsui-motion-disabled .awsui_icon_gwq0h_1sjri_197:not(#\9), .awsui-mode-entering .awsui_icon_gwq0h_1sjri_197:not(#\9) {
207
207
  animation: none;
208
208
  transition: none;
209
209
  }
210
210
 
211
- .awsui_root_gwq0h_1tk4s_211:not(#\9) {
211
+ .awsui_root_gwq0h_1sjri_211:not(#\9) {
212
212
  border-collapse: separate;
213
213
  border-spacing: 0;
214
214
  box-sizing: border-box;
@@ -243,33 +243,33 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
243
243
  display: block;
244
244
  }
245
245
 
246
- .awsui_expand-button_gwq0h_1tk4s_246:not(#\9) {
246
+ .awsui_expand-button_gwq0h_1sjri_246:not(#\9) {
247
247
  outline: none;
248
248
  }
249
249
 
250
- .awsui_icon_gwq0h_1tk4s_197:not(#\9) {
250
+ .awsui_icon_gwq0h_1sjri_197:not(#\9) {
251
251
  transform: rotate(-90deg);
252
252
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
253
253
  }
254
- .awsui_icon_gwq0h_1tk4s_197.awsui_expanded_gwq0h_1tk4s_254:not(#\9) {
254
+ .awsui_icon_gwq0h_1sjri_197.awsui_expanded_gwq0h_1sjri_254:not(#\9) {
255
255
  transform: rotate(0deg);
256
256
  }
257
- .awsui_icon_gwq0h_1tk4s_197:not(#\9):dir(rtl) {
257
+ .awsui_icon_gwq0h_1sjri_197:not(#\9):dir(rtl) {
258
258
  transform: rotate(90deg);
259
259
  }
260
- .awsui_icon_gwq0h_1tk4s_197:not(#\9):dir(rtl).awsui_expanded_gwq0h_1tk4s_254 {
260
+ .awsui_icon_gwq0h_1sjri_197:not(#\9):dir(rtl).awsui_expanded_gwq0h_1sjri_254 {
261
261
  transform: rotate(0deg);
262
262
  }
263
263
 
264
- .awsui_icon-container_gwq0h_1tk4s_264:not(#\9) {
264
+ .awsui_icon-container_gwq0h_1sjri_264:not(#\9) {
265
265
  position: relative;
266
266
  margin-inline: calc((var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2) calc(var(--space-xxs-hwfkai, 4px) + var(--border-divider-list-width-tdfx1x, 1px));
267
267
  }
268
- .awsui_icon-container-container_gwq0h_1tk4s_268:not(#\9) {
268
+ .awsui_icon-container-container_gwq0h_1sjri_268:not(#\9) {
269
269
  margin-inline-end: var(--space-xs-ymlm0b, 8px);
270
270
  }
271
271
 
272
- .awsui_wrapper_gwq0h_1tk4s_272:not(#\9) {
272
+ .awsui_wrapper_gwq0h_1sjri_272:not(#\9) {
273
273
  box-sizing: border-box;
274
274
  border-block: none;
275
275
  border-inline: none;
@@ -277,81 +277,81 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
277
277
  line-height: var(--line-height-body-m-2mh3ke, 20px);
278
278
  text-align: start;
279
279
  }
280
- .awsui_wrapper-default_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-inline_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-footer_gwq0h_1tk4s_280:not(#\9) {
280
+ .awsui_wrapper-default_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-inline_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-footer_gwq0h_1sjri_280:not(#\9) {
281
281
  border-block: var(--border-divider-section-width-uwo8my, 1px) solid transparent;
282
282
  border-inline: var(--border-divider-section-width-uwo8my, 1px) solid transparent;
283
283
  }
284
- .awsui_wrapper-navigation_gwq0h_1tk4s_284:not(#\9) {
284
+ .awsui_wrapper-navigation_gwq0h_1sjri_284:not(#\9) {
285
285
  border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid transparent;
286
286
  }
287
- .awsui_wrapper-navigation_gwq0h_1tk4s_284:not(#\9), .awsui_wrapper-container_gwq0h_1tk4s_287:not(#\9) {
287
+ .awsui_wrapper-navigation_gwq0h_1sjri_284:not(#\9), .awsui_wrapper-container_gwq0h_1sjri_287:not(#\9) {
288
288
  display: flex;
289
289
  font-weight: var(--font-weight-heading-s-lcx0ai, 700);
290
290
  }
291
- .awsui_wrapper-default_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-inline_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-navigation_gwq0h_1tk4s_284:not(#\9), .awsui_wrapper-footer_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-compact_gwq0h_1tk4s_291:not(#\9) {
291
+ .awsui_wrapper-default_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-inline_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-navigation_gwq0h_1sjri_284:not(#\9), .awsui_wrapper-footer_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-compact_gwq0h_1sjri_291:not(#\9) {
292
292
  color: var(--color-text-expandable-section-default-ynw8my, #0f141a);
293
293
  -webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
294
294
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
295
295
  }
296
- .awsui_wrapper-default_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-inline_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-navigation_gwq0h_1tk4s_284:not(#\9), .awsui_wrapper-footer_gwq0h_1tk4s_280:not(#\9) {
297
- font-size: var(--font-expandable-heading-size-0uk059, 16px);
296
+ .awsui_wrapper-default_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-inline_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-navigation_gwq0h_1sjri_284:not(#\9), .awsui_wrapper-footer_gwq0h_1sjri_280:not(#\9) {
297
+ font-size: var(--font-size-expandable-heading-duh2ta, 16px);
298
298
  letter-spacing: var(--letter-spacing-heading-s-4st9ep, -0.005em);
299
299
  }
300
- .awsui_wrapper-default_gwq0h_1tk4s_280:not(#\9) {
300
+ .awsui_wrapper-default_gwq0h_1sjri_280:not(#\9) {
301
301
  padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
302
302
  padding-inline-end: var(--space-xxs-hwfkai, 4px);
303
303
  }
304
- .awsui_wrapper-default_gwq0h_1tk4s_280.awsui_header-deprecated_gwq0h_1tk4s_304:not(#\9) {
304
+ .awsui_wrapper-default_gwq0h_1sjri_280.awsui_header-deprecated_gwq0h_1sjri_304:not(#\9) {
305
305
  padding-inline-start: var(--space-xxs-hwfkai, 4px);
306
306
  }
307
- .awsui_wrapper-default_gwq0h_1tk4s_280:not(#\9):not(.awsui_header-deprecated_gwq0h_1tk4s_304), .awsui_wrapper-inline_gwq0h_1tk4s_280:not(#\9):not(.awsui_header-deprecated_gwq0h_1tk4s_304) {
307
+ .awsui_wrapper-default_gwq0h_1sjri_280:not(#\9):not(.awsui_header-deprecated_gwq0h_1sjri_304), .awsui_wrapper-inline_gwq0h_1sjri_280:not(#\9):not(.awsui_header-deprecated_gwq0h_1sjri_304) {
308
308
  padding-inline-start: calc(var(--size-icon-normal-levt08, 16px) + (var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2 + var(--space-xxs-hwfkai, 4px) + var(--border-divider-list-width-tdfx1x, 1px));
309
309
  }
310
- .awsui_wrapper-default_gwq0h_1tk4s_280.awsui_wrapper-expanded_gwq0h_1tk4s_310:not(#\9), .awsui_wrapper-inline_gwq0h_1tk4s_280.awsui_wrapper-expanded_gwq0h_1tk4s_310:not(#\9) {
310
+ .awsui_wrapper-default_gwq0h_1sjri_280.awsui_wrapper-expanded_gwq0h_1sjri_310:not(#\9), .awsui_wrapper-inline_gwq0h_1sjri_280.awsui_wrapper-expanded_gwq0h_1sjri_310:not(#\9) {
311
311
  padding-block-end: var(--space-scaled-xxs-pfm1nx, 4px);
312
- border-block-end-color: var(--color-border-divider-default-nr68jt, #c6c6cd);
312
+ border-block-end-color: var(--color-border-expandable-section-default-inl8g4, #c6c6cd);
313
313
  }
314
- .awsui_wrapper-footer_gwq0h_1tk4s_280:not(#\9) {
314
+ .awsui_wrapper-footer_gwq0h_1sjri_280:not(#\9) {
315
315
  padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
316
316
  }
317
- .awsui_wrapper-footer_gwq0h_1tk4s_280:not(#\9), .awsui_wrapper-compact_gwq0h_1tk4s_291:not(#\9) {
317
+ .awsui_wrapper-footer_gwq0h_1sjri_280:not(#\9), .awsui_wrapper-compact_gwq0h_1sjri_291:not(#\9) {
318
318
  padding-inline-end: 0;
319
319
  }
320
- .awsui_wrapper-footer_gwq0h_1tk4s_280.awsui_header-deprecated_gwq0h_1tk4s_304:not(#\9), .awsui_wrapper-compact_gwq0h_1tk4s_291.awsui_header-deprecated_gwq0h_1tk4s_304:not(#\9) {
320
+ .awsui_wrapper-footer_gwq0h_1sjri_280.awsui_header-deprecated_gwq0h_1sjri_304:not(#\9), .awsui_wrapper-compact_gwq0h_1sjri_291.awsui_header-deprecated_gwq0h_1sjri_304:not(#\9) {
321
321
  padding-inline-start: 0;
322
322
  }
323
- .awsui_wrapper-footer_gwq0h_1tk4s_280:not(#\9):not(.awsui_header-deprecated_gwq0h_1tk4s_304), .awsui_wrapper-compact_gwq0h_1tk4s_291:not(#\9):not(.awsui_header-deprecated_gwq0h_1tk4s_304) {
323
+ .awsui_wrapper-footer_gwq0h_1sjri_280:not(#\9):not(.awsui_header-deprecated_gwq0h_1sjri_304), .awsui_wrapper-compact_gwq0h_1sjri_291:not(#\9):not(.awsui_header-deprecated_gwq0h_1sjri_304) {
324
324
  padding-inline-start: calc(var(--size-icon-normal-levt08, 16px) + (var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2 + var(--space-xxs-hwfkai, 4px) + var(--border-divider-list-width-tdfx1x, 1px));
325
325
  }
326
- .awsui_wrapper-container_gwq0h_1tk4s_287:not(#\9) {
326
+ .awsui_wrapper-container_gwq0h_1sjri_287:not(#\9) {
327
327
  padding-block: var(--space-container-header-top-am4vzw, 12px) var(--space-container-header-bottom-2taq8v, 8px);
328
328
  padding-inline-end: var(--space-container-horizontal-nqrzyh, 20px);
329
329
  }
330
- .awsui_wrapper-container_gwq0h_1tk4s_287:not(#\9):not(.awsui_wrapper-expanded_gwq0h_1tk4s_310) {
330
+ .awsui_wrapper-container_gwq0h_1sjri_287:not(#\9):not(.awsui_wrapper-expanded_gwq0h_1sjri_310) {
331
331
  padding-block-end: var(--space-container-header-top-am4vzw, 12px);
332
332
  }
333
- .awsui_wrapper-container_gwq0h_1tk4s_287.awsui_wrapper-not-expanded-without-actions_gwq0h_1tk4s_333:not(#\9) {
333
+ .awsui_wrapper-container_gwq0h_1sjri_287.awsui_wrapper-not-expanded-without-actions_gwq0h_1sjri_333:not(#\9) {
334
334
  padding-block-end: calc(var(--space-container-header-top-am4vzw, 12px) + var(--space-scaled-xxs-pfm1nx, 4px));
335
335
  }
336
- .awsui_wrapper-container_gwq0h_1tk4s_287.awsui_header-deprecated_gwq0h_1tk4s_304:not(#\9) {
336
+ .awsui_wrapper-container_gwq0h_1sjri_287.awsui_header-deprecated_gwq0h_1sjri_304:not(#\9) {
337
337
  padding-inline-start: var(--space-container-horizontal-nqrzyh, 20px);
338
338
  }
339
- .awsui_wrapper-container_gwq0h_1tk4s_287:not(#\9):not(.awsui_header-deprecated_gwq0h_1tk4s_304) {
339
+ .awsui_wrapper-container_gwq0h_1sjri_287:not(#\9):not(.awsui_header-deprecated_gwq0h_1sjri_304) {
340
340
  padding-inline-start: calc(var(--space-container-horizontal-nqrzyh, 20px) + calc(var(--size-icon-medium-uv8xcz, 20px) + (var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2 + var(--space-xs-ymlm0b, 8px)));
341
341
  }
342
- body[data-awsui-focus-visible=true] .awsui_wrapper-container_gwq0h_1tk4s_287:not(#\9):focus {
342
+ body[data-awsui-focus-visible=true] .awsui_wrapper-container_gwq0h_1sjri_287:not(#\9):focus {
343
343
  padding-block: calc(var(--space-scaled-s-8ozaad, 12px) - var(--border-divider-section-width-uwo8my, 1px));
344
344
  padding-inline: calc(var(--space-l-2ud1p3, 20px) - var(--border-divider-section-width-uwo8my, 1px));
345
345
  }
346
346
 
347
- .awsui_header_gwq0h_1tk4s_304:not(#\9) {
347
+ .awsui_header_gwq0h_1sjri_304:not(#\9) {
348
348
  /* used in test-utils */
349
349
  }
350
- .awsui_header-wrapper_gwq0h_1tk4s_350:not(#\9), .awsui_header-deprecated_gwq0h_1tk4s_304:not(#\9) {
350
+ .awsui_header-wrapper_gwq0h_1sjri_350:not(#\9), .awsui_header-deprecated_gwq0h_1sjri_304:not(#\9) {
351
351
  display: flex;
352
352
  font-weight: var(--font-weight-heading-s-lcx0ai, 700);
353
353
  }
354
- .awsui_header-wrapper_gwq0h_1tk4s_350:not(#\9) {
354
+ .awsui_header-wrapper_gwq0h_1sjri_350:not(#\9) {
355
355
  font-size: inherit;
356
356
  letter-spacing: inherit;
357
357
  margin-block: 0;
@@ -359,20 +359,20 @@ body[data-awsui-focus-visible=true] .awsui_wrapper-container_gwq0h_1tk4s_287:not
359
359
  padding-block: 0;
360
360
  padding-inline: 0;
361
361
  }
362
- .awsui_header-actions-wrapper_gwq0h_1tk4s_362:not(#\9) {
362
+ .awsui_header-actions-wrapper_gwq0h_1sjri_362:not(#\9) {
363
363
  display: flex;
364
364
  flex-direction: row;
365
365
  justify-content: space-between;
366
366
  align-items: center;
367
367
  }
368
- body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1tk4s_368:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_1tk4s_368:not(#\9):focus {
368
+ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1sjri_368:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_1sjri_368:not(#\9):focus {
369
369
  position: relative;
370
370
  }
371
- body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1tk4s_368:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_1tk4s_368:not(#\9):focus {
371
+ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1sjri_368:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_1sjri_368:not(#\9):focus {
372
372
  outline: 2px dotted transparent;
373
373
  outline-offset: calc(0px - 1px);
374
374
  }
375
- body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1tk4s_368:not(#\9):focus::before, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_1tk4s_368:not(#\9):focus::before {
375
+ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1sjri_368:not(#\9):focus::before, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_1sjri_368:not(#\9):focus::before {
376
376
  content: " ";
377
377
  display: block;
378
378
  position: absolute;
@@ -386,21 +386,21 @@ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1tk4s_368:not(#\9
386
386
  border-end-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
387
387
  box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
388
388
  }
389
- .awsui_header-button_gwq0h_1tk4s_368:not(#\9) {
389
+ .awsui_header-button_gwq0h_1sjri_368:not(#\9) {
390
390
  box-sizing: border-box;
391
391
  display: flex;
392
392
  margin-inline-start: calc(-1 * calc(var(--size-icon-normal-levt08, 16px) + (var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2 + var(--space-xxs-hwfkai, 4px) + var(--border-divider-list-width-tdfx1x, 1px)));
393
393
  }
394
- .awsui_header-container-button_gwq0h_1tk4s_368:not(#\9) {
394
+ .awsui_header-container-button_gwq0h_1sjri_368:not(#\9) {
395
395
  margin-inline-start: calc(-1 * calc(var(--size-icon-medium-uv8xcz, 20px) + (var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2 + var(--space-xs-ymlm0b, 8px)));
396
396
  }
397
- .awsui_header-container_gwq0h_1tk4s_368:not(#\9) {
397
+ .awsui_header-container_gwq0h_1sjri_368:not(#\9) {
398
398
  inline-size: 100%;
399
399
  }
400
- .awsui_header-container_gwq0h_1tk4s_368 > .awsui_icon-container_gwq0h_1tk4s_264:not(#\9) {
400
+ .awsui_header-container_gwq0h_1sjri_368 > .awsui_icon-container_gwq0h_1sjri_264:not(#\9) {
401
401
  margin-block-start: var(--space-expandable-section-icon-offset-top-cntyn8, 4px);
402
402
  }
403
- .awsui_header-navigation_gwq0h_1tk4s_403 > .awsui_icon-container_gwq0h_1tk4s_264:not(#\9) {
403
+ .awsui_header-navigation_gwq0h_1sjri_403 > .awsui_icon-container_gwq0h_1sjri_264:not(#\9) {
404
404
  display: inline-flex;
405
405
  cursor: pointer;
406
406
  color: var(--color-text-expandable-section-navigation-icon-default-mklu1s, #424650);
@@ -413,17 +413,17 @@ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_1tk4s_368:not(#\9
413
413
  text-decoration: none;
414
414
  flex-direction: column;
415
415
  }
416
- .awsui_header-navigation_gwq0h_1tk4s_403 > .awsui_icon-container_gwq0h_1tk4s_264:not(#\9):hover {
416
+ .awsui_header-navigation_gwq0h_1sjri_403 > .awsui_icon-container_gwq0h_1sjri_264:not(#\9):hover {
417
417
  color: var(--color-text-expandable-section-hover-ojzwhd, #006ce0);
418
418
  }
419
- body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1tk4s_403 > .awsui_icon-container_gwq0h_1tk4s_264:not(#\9):focus {
419
+ body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1sjri_403 > .awsui_icon-container_gwq0h_1sjri_264:not(#\9):focus {
420
420
  position: relative;
421
421
  }
422
- body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1tk4s_403 > .awsui_icon-container_gwq0h_1tk4s_264:not(#\9):focus {
422
+ body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1sjri_403 > .awsui_icon-container_gwq0h_1sjri_264:not(#\9):focus {
423
423
  outline: 2px dotted transparent;
424
424
  outline-offset: calc(2px - 1px);
425
425
  }
426
- body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1tk4s_403 > .awsui_icon-container_gwq0h_1tk4s_264:not(#\9):focus::before {
426
+ body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1sjri_403 > .awsui_icon-container_gwq0h_1sjri_264:not(#\9):focus::before {
427
427
  content: " ";
428
428
  display: block;
429
429
  position: absolute;
@@ -437,39 +437,39 @@ body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_1tk4s_403 > .
437
437
  border-end-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
438
438
  box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
439
439
  }
440
- .awsui_header-text_gwq0h_1tk4s_440:not(#\9) {
440
+ .awsui_header-text_gwq0h_1sjri_440:not(#\9) {
441
441
  /* used in test-utils */
442
442
  }
443
443
 
444
- :not(#\9):not(.awsui_wrapper-compact_gwq0h_1tk4s_291) > .awsui_header-actions-wrapper_gwq0h_1tk4s_362 {
444
+ :not(#\9):not(.awsui_wrapper-compact_gwq0h_1sjri_291) > .awsui_header-actions-wrapper_gwq0h_1sjri_362 {
445
445
  flex-wrap: wrap;
446
446
  column-gap: var(--space-xs-ymlm0b, 8px);
447
447
  row-gap: var(--space-scaled-xxxs-oo06c7, 2px);
448
448
  }
449
449
 
450
- .awsui_content_gwq0h_1tk4s_161:not(#\9) {
450
+ .awsui_content_gwq0h_1sjri_161:not(#\9) {
451
451
  display: none;
452
452
  }
453
- .awsui_content-default_gwq0h_1tk4s_453:not(#\9), .awsui_content-inline_gwq0h_1tk4s_453:not(#\9) {
453
+ .awsui_content-default_gwq0h_1sjri_453:not(#\9), .awsui_content-inline_gwq0h_1sjri_453:not(#\9) {
454
454
  padding-block: var(--space-scaled-xs-xwoogq, 8px);
455
455
  padding-inline: 0;
456
456
  }
457
- .awsui_content-footer_gwq0h_1tk4s_457:not(#\9) {
457
+ .awsui_content-footer_gwq0h_1sjri_457:not(#\9) {
458
458
  padding-block: var(--space-xs-ymlm0b, 8px);
459
459
  padding-inline: 0;
460
460
  }
461
- .awsui_content-expanded_gwq0h_1tk4s_461:not(#\9) {
461
+ .awsui_content-expanded_gwq0h_1sjri_461:not(#\9) {
462
462
  display: block;
463
463
  }
464
- .awsui_content-compact_gwq0h_1tk4s_464:not(#\9) {
464
+ .awsui_content-compact_gwq0h_1sjri_464:not(#\9) {
465
465
  padding-inline-start: calc(var(--size-icon-normal-levt08, 16px) + (var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / -2 + var(--space-xxs-hwfkai, 4px) + var(--border-divider-list-width-tdfx1x, 1px));
466
466
  }
467
467
 
468
- .awsui_focusable_gwq0h_1tk4s_468:not(#\9):focus {
468
+ .awsui_focusable_gwq0h_1sjri_468:not(#\9):focus {
469
469
  outline: none;
470
470
  text-decoration: none;
471
471
  }
472
- body[data-awsui-focus-visible=true] .awsui_focusable_gwq0h_1tk4s_468:not(#\9):focus {
472
+ body[data-awsui-focus-visible=true] .awsui_focusable_gwq0h_1sjri_468:not(#\9):focus {
473
473
  outline: 2px dotted transparent;
474
474
  border-block: var(--border-width-button-jm0qg7, 2px) solid var(--color-border-item-focused-uk47pl, #006ce0);
475
475
  border-inline: var(--border-width-button-jm0qg7, 2px) solid var(--color-border-item-focused-uk47pl, #006ce0);
@@ -480,9 +480,9 @@ body[data-awsui-focus-visible=true] .awsui_focusable_gwq0h_1tk4s_468:not(#\9):fo
480
480
  box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-9mjajk, 1px) var(--color-border-item-focused-uk47pl, #006ce0);
481
481
  }
482
482
 
483
- .awsui_click-target_gwq0h_1tk4s_483:not(#\9) {
483
+ .awsui_click-target_gwq0h_1sjri_483:not(#\9) {
484
484
  cursor: pointer;
485
485
  }
486
- .awsui_click-target_gwq0h_1tk4s_483:not(#\9):not(.awsui_wrapper-container_gwq0h_1tk4s_287):not(.awsui_header-container-button_gwq0h_1tk4s_368):hover {
486
+ .awsui_click-target_gwq0h_1sjri_483:not(#\9):not(.awsui_wrapper-container_gwq0h_1sjri_287):not(.awsui_header-container-button_gwq0h_1sjri_368):hover {
487
487
  color: var(--color-text-expandable-section-hover-ojzwhd, #006ce0);
488
488
  }
@@ -2,40 +2,40 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "content-enter": "awsui_content-enter_gwq0h_1tk4s_161",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_1tk4s_1",
7
- "trigger-expanded": "awsui_trigger-expanded_gwq0h_1tk4s_183",
8
- "icon": "awsui_icon_gwq0h_1tk4s_197",
9
- "root": "awsui_root_gwq0h_1tk4s_211",
10
- "expand-button": "awsui_expand-button_gwq0h_1tk4s_246",
11
- "expanded": "awsui_expanded_gwq0h_1tk4s_254",
12
- "icon-container": "awsui_icon-container_gwq0h_1tk4s_264",
13
- "icon-container-container": "awsui_icon-container-container_gwq0h_1tk4s_268",
14
- "wrapper": "awsui_wrapper_gwq0h_1tk4s_272",
15
- "wrapper-default": "awsui_wrapper-default_gwq0h_1tk4s_280",
16
- "wrapper-inline": "awsui_wrapper-inline_gwq0h_1tk4s_280",
17
- "wrapper-footer": "awsui_wrapper-footer_gwq0h_1tk4s_280",
18
- "wrapper-navigation": "awsui_wrapper-navigation_gwq0h_1tk4s_284",
19
- "wrapper-container": "awsui_wrapper-container_gwq0h_1tk4s_287",
20
- "wrapper-compact": "awsui_wrapper-compact_gwq0h_1tk4s_291",
21
- "header-deprecated": "awsui_header-deprecated_gwq0h_1tk4s_304",
22
- "wrapper-expanded": "awsui_wrapper-expanded_gwq0h_1tk4s_310",
23
- "wrapper-not-expanded-without-actions": "awsui_wrapper-not-expanded-without-actions_gwq0h_1tk4s_333",
24
- "header": "awsui_header_gwq0h_1tk4s_304",
25
- "header-wrapper": "awsui_header-wrapper_gwq0h_1tk4s_350",
26
- "header-actions-wrapper": "awsui_header-actions-wrapper_gwq0h_1tk4s_362",
27
- "header-button": "awsui_header-button_gwq0h_1tk4s_368",
28
- "header-container-button": "awsui_header-container-button_gwq0h_1tk4s_368",
29
- "header-container": "awsui_header-container_gwq0h_1tk4s_368",
30
- "header-navigation": "awsui_header-navigation_gwq0h_1tk4s_403",
31
- "header-text": "awsui_header-text_gwq0h_1tk4s_440",
32
- "content": "awsui_content_gwq0h_1tk4s_161",
33
- "content-default": "awsui_content-default_gwq0h_1tk4s_453",
34
- "content-inline": "awsui_content-inline_gwq0h_1tk4s_453",
35
- "content-footer": "awsui_content-footer_gwq0h_1tk4s_457",
36
- "content-expanded": "awsui_content-expanded_gwq0h_1tk4s_461",
37
- "content-compact": "awsui_content-compact_gwq0h_1tk4s_464",
38
- "focusable": "awsui_focusable_gwq0h_1tk4s_468",
39
- "click-target": "awsui_click-target_gwq0h_1tk4s_483"
5
+ "content-enter": "awsui_content-enter_gwq0h_1sjri_161",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_1sjri_1",
7
+ "trigger-expanded": "awsui_trigger-expanded_gwq0h_1sjri_183",
8
+ "icon": "awsui_icon_gwq0h_1sjri_197",
9
+ "root": "awsui_root_gwq0h_1sjri_211",
10
+ "expand-button": "awsui_expand-button_gwq0h_1sjri_246",
11
+ "expanded": "awsui_expanded_gwq0h_1sjri_254",
12
+ "icon-container": "awsui_icon-container_gwq0h_1sjri_264",
13
+ "icon-container-container": "awsui_icon-container-container_gwq0h_1sjri_268",
14
+ "wrapper": "awsui_wrapper_gwq0h_1sjri_272",
15
+ "wrapper-default": "awsui_wrapper-default_gwq0h_1sjri_280",
16
+ "wrapper-inline": "awsui_wrapper-inline_gwq0h_1sjri_280",
17
+ "wrapper-footer": "awsui_wrapper-footer_gwq0h_1sjri_280",
18
+ "wrapper-navigation": "awsui_wrapper-navigation_gwq0h_1sjri_284",
19
+ "wrapper-container": "awsui_wrapper-container_gwq0h_1sjri_287",
20
+ "wrapper-compact": "awsui_wrapper-compact_gwq0h_1sjri_291",
21
+ "header-deprecated": "awsui_header-deprecated_gwq0h_1sjri_304",
22
+ "wrapper-expanded": "awsui_wrapper-expanded_gwq0h_1sjri_310",
23
+ "wrapper-not-expanded-without-actions": "awsui_wrapper-not-expanded-without-actions_gwq0h_1sjri_333",
24
+ "header": "awsui_header_gwq0h_1sjri_304",
25
+ "header-wrapper": "awsui_header-wrapper_gwq0h_1sjri_350",
26
+ "header-actions-wrapper": "awsui_header-actions-wrapper_gwq0h_1sjri_362",
27
+ "header-button": "awsui_header-button_gwq0h_1sjri_368",
28
+ "header-container-button": "awsui_header-container-button_gwq0h_1sjri_368",
29
+ "header-container": "awsui_header-container_gwq0h_1sjri_368",
30
+ "header-navigation": "awsui_header-navigation_gwq0h_1sjri_403",
31
+ "header-text": "awsui_header-text_gwq0h_1sjri_440",
32
+ "content": "awsui_content_gwq0h_1sjri_161",
33
+ "content-default": "awsui_content-default_gwq0h_1sjri_453",
34
+ "content-inline": "awsui_content-inline_gwq0h_1sjri_453",
35
+ "content-footer": "awsui_content-footer_gwq0h_1sjri_457",
36
+ "content-expanded": "awsui_content-expanded_gwq0h_1sjri_461",
37
+ "content-compact": "awsui_content-compact_gwq0h_1sjri_464",
38
+ "focusable": "awsui_focusable_gwq0h_1sjri_468",
39
+ "click-target": "awsui_click-target_gwq0h_1sjri_483"
40
40
  };
41
41
 
@@ -53,7 +53,7 @@ function InternalFileToken({ file, showFileLastModified, showFileSize, showFileT
53
53
  loading && (React.createElement("div", { className: clsx(styles['file-loading-overlay'], {
54
54
  [styles['file-loading-overlay-single-row']]: loading && fileIsSingleRow,
55
55
  }) },
56
- React.createElement(InternalSpinner, { variant: "disabled", size: "normal" }))),
56
+ React.createElement(InternalSpinner, { variant: "normal", size: "normal" }))),
57
57
  React.createElement(InternalBox, { className: styles['file-option'] },
58
58
  showFileThumbnail && isImage && React.createElement(FileOptionThumbnail, { file: file }),
59
59
  React.createElement("div", { className: clsx(styles['file-option-metadata'], {
@@ -1 +1 @@
1
- {"version":3,"file":"file-token.js","sourceRoot":"","sources":["../../../src/file-token-group/file-token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,eAAe,MAAM,wBAAwB,CAAC;AACrD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,E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,WAAW,CAAE,kBAAkB,IAC7E,SAAS,CACK,CAClB;QACA,WAAW,IAAI,CACd,oBAAC,gBAAgB,IAAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,IACrF,WAAW,CACK,CACpB;QACA,WAAW,IAAI,WAAW,IAAI,CAC7B,oBAAC,OAAO,IACN,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EACpC,OAAO,EAAE,oBAAC,WAAW,IAAC,UAAU,EAAC,QAAQ,IAAE,IAAI,CAAC,IAAI,CAAe,EACnE,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,GACrC,CACH,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalBox from '../box/internal.js';\nimport { FormFieldError, FormFieldWarning } from '../form-field/internal';\nimport { BaseComponentProps } from '../internal/base-component/index.js';\nimport InternalSpaceBetween from '../space-between/internal.js';\nimport InternalSpinner from '../spinner/internal.js';\nimport DismissButton from '../token/dismiss-button.js';\nimport { TokenGroupProps } from '../token-group/interfaces.js';\nimport Tooltip from '../tooltip/internal.js';\nimport * as defaultFormatters from './default-formatters.js';\nimport { FileOptionThumbnail } from './thumbnail.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport namespace FileTokenProps {\n export interface I18nStrings {\n removeFileAriaLabel?: (fileIndex: number, fileName: string) => string;\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n formatFileSize?: (sizeInBytes: number) => string;\n formatFileLastModified?: (date: Date) => string;\n }\n}\n\ninterface FileTokenProps extends BaseComponentProps {\n file: File;\n onDismiss: () => void;\n showFileSize?: boolean;\n showFileLastModified?: boolean;\n showFileThumbnail?: boolean;\n errorText?: React.ReactNode;\n warningText?: React.ReactNode;\n loading?: boolean;\n readOnly?: boolean;\n i18nStrings?: FileTokenProps.I18nStrings;\n dismissLabel?: string;\n alignment?: TokenGroupProps.Alignment;\n groupContainsImage?: boolean;\n isImage: boolean;\n index: number;\n}\n\nfunction InternalFileToken({\n file,\n showFileLastModified,\n showFileSize,\n showFileThumbnail,\n i18nStrings,\n onDismiss,\n errorText,\n warningText,\n readOnly,\n loading,\n alignment,\n groupContainsImage,\n isImage,\n index,\n}: FileTokenProps) {\n const formatFileSize = i18nStrings?.formatFileSize ?? defaultFormatters.formatFileSize;\n const formatFileLastModified = i18nStrings?.formatFileLastModified ?? defaultFormatters.formatFileLastModified;\n\n const errorId = useUniqueId('error');\n const warningId = useUniqueId('warning');\n\n const showWarning = warningText && !errorText;\n const containerRef = useRef<HTMLDivElement>(null);\n const fileNameRef = useRef<HTMLSpanElement>(null);\n const fileNameContainerRef = useRef<HTMLDivElement>(null);\n const [showTooltip, setShowTooltip] = useState(false);\n const [isTruncated, setIsTruncated] = useState(false);\n\n const getDismissLabel = (fileIndex: number) => {\n return i18nStrings?.removeFileAriaLabel?.(fileIndex, file.name);\n };\n\n function isEllipsisActive() {\n const span = fileNameRef.current;\n const container = fileNameContainerRef.current;\n\n if (span && container) {\n return span.offsetWidth >= container.offsetWidth;\n }\n return false;\n }\n\n useResizeObserver(\n () => fileNameContainerRef.current,\n () => setIsTruncated(isEllipsisActive())\n );\n\n const fileIsSingleRow =\n !showFileLastModified && !showFileSize && (!groupContainsImage || (groupContainsImage && !showFileThumbnail));\n\n return (\n <div\n ref={containerRef}\n className={clsx(styles.token, {\n [styles['token-grid']]: alignment === 'horizontal',\n [styles['token-contains-image']]: groupContainsImage && showFileThumbnail,\n })}\n role=\"group\"\n aria-label={file.name}\n aria-describedby={errorText ? errorId : warningText ? warningId : undefined}\n aria-disabled={loading}\n data-index={index}\n >\n <div\n className={clsx(styles['token-box'], {\n [styles.loading]: loading,\n [styles.error]: errorText,\n [styles.warning]: showWarning,\n [styles.horizontal]: alignment === 'horizontal',\n [styles['read-only']]: readOnly,\n })}\n >\n {loading && (\n <div\n className={clsx(styles['file-loading-overlay'], {\n [styles['file-loading-overlay-single-row']]: loading && fileIsSingleRow,\n })}\n >\n <InternalSpinner variant=\"disabled\" size=\"normal\" />\n </div>\n )}\n <InternalBox className={styles['file-option']}>\n {showFileThumbnail && isImage && <FileOptionThumbnail file={file} />}\n\n <div\n className={clsx(styles['file-option-metadata'], {\n [styles['with-image']]: showFileThumbnail && isImage,\n [styles['single-row-loading']]: loading && fileIsSingleRow,\n })}\n >\n <InternalSpaceBetween direction=\"vertical\" size=\"xxxs\">\n <div\n className={styles['file-name-container']}\n onMouseOver={() => setShowTooltip(true)}\n onMouseOut={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n role={isTruncated ? 'button' : undefined}\n aria-expanded={isTruncated ? showTooltip : undefined}\n tabIndex={isTruncated ? 0 : -1}\n ref={fileNameContainerRef}\n >\n <InternalBox\n fontWeight=\"normal\"\n className={clsx(styles['file-option-name'], testUtilStyles['file-option-name'], {\n [testUtilStyles['ellipsis-active']]: isTruncated,\n })}\n >\n <span ref={fileNameRef}>{file.name}</span>\n </InternalBox>\n </div>\n\n {showFileSize && file.size ? (\n <InternalBox\n fontSize=\"body-s\"\n color={'text-body-secondary'}\n className={clsx(styles['file-option-size'], testUtilStyles['file-option-size'])}\n >\n {formatFileSize(file.size)}\n </InternalBox>\n ) : null}\n\n {showFileLastModified && file.lastModified ? (\n <InternalBox\n fontSize=\"body-s\"\n color={'text-body-secondary'}\n className={clsx(styles['file-option-last-modified'], testUtilStyles['file-option-last-modified'])}\n >\n {formatFileLastModified(new Date(file.lastModified))}\n </InternalBox>\n ) : null}\n </InternalSpaceBetween>\n </div>\n </InternalBox>\n {onDismiss && !readOnly && <DismissButton dismissLabel={getDismissLabel(index)} onDismiss={onDismiss} />}\n </div>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={warningId} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {showTooltip && isTruncated && (\n <Tooltip\n getTrack={() => containerRef.current}\n content={<InternalBox fontWeight=\"normal\">{file.name}</InternalBox>}\n onEscape={() => setShowTooltip(false)}\n />\n )}\n </div>\n );\n}\n\nexport default InternalFileToken;\n"]}
1
+ {"version":3,"file":"file-token.js","sourceRoot":"","sources":["../../../src/file-token-group/file-token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,eAAe,MAAM,wBAAwB,CAAC;AACrD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AA8B1D,SAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,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WAAW,IAAI,CAC7B,oBAAC,OAAO,IACN,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EACpC,OAAO,EAAE,oBAAC,WAAW,IAAC,UAAU,EAAC,QAAQ,IAAE,IAAI,CAAC,IAAI,CAAe,EACnE,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,GACrC,CACH,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalBox from '../box/internal.js';\nimport { FormFieldError, FormFieldWarning } from '../form-field/internal';\nimport { BaseComponentProps } from '../internal/base-component/index.js';\nimport InternalSpaceBetween from '../space-between/internal.js';\nimport InternalSpinner from '../spinner/internal.js';\nimport DismissButton from '../token/dismiss-button.js';\nimport { TokenGroupProps } from '../token-group/interfaces.js';\nimport Tooltip from '../tooltip/internal.js';\nimport * as defaultFormatters from './default-formatters.js';\nimport { FileOptionThumbnail } from './thumbnail.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport namespace FileTokenProps {\n export interface I18nStrings {\n removeFileAriaLabel?: (fileIndex: number, fileName: string) => string;\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n formatFileSize?: (sizeInBytes: number) => string;\n formatFileLastModified?: (date: Date) => string;\n }\n}\n\ninterface FileTokenProps extends BaseComponentProps {\n file: File;\n onDismiss: () => void;\n showFileSize?: boolean;\n showFileLastModified?: boolean;\n showFileThumbnail?: boolean;\n errorText?: React.ReactNode;\n warningText?: React.ReactNode;\n loading?: boolean;\n readOnly?: boolean;\n i18nStrings?: FileTokenProps.I18nStrings;\n dismissLabel?: string;\n alignment?: TokenGroupProps.Alignment;\n groupContainsImage?: boolean;\n isImage: boolean;\n index: number;\n}\n\nfunction InternalFileToken({\n file,\n showFileLastModified,\n showFileSize,\n showFileThumbnail,\n i18nStrings,\n onDismiss,\n errorText,\n warningText,\n readOnly,\n loading,\n alignment,\n groupContainsImage,\n isImage,\n index,\n}: FileTokenProps) {\n const formatFileSize = i18nStrings?.formatFileSize ?? defaultFormatters.formatFileSize;\n const formatFileLastModified = i18nStrings?.formatFileLastModified ?? defaultFormatters.formatFileLastModified;\n\n const errorId = useUniqueId('error');\n const warningId = useUniqueId('warning');\n\n const showWarning = warningText && !errorText;\n const containerRef = useRef<HTMLDivElement>(null);\n const fileNameRef = useRef<HTMLSpanElement>(null);\n const fileNameContainerRef = useRef<HTMLDivElement>(null);\n const [showTooltip, setShowTooltip] = useState(false);\n const [isTruncated, setIsTruncated] = useState(false);\n\n const getDismissLabel = (fileIndex: number) => {\n return i18nStrings?.removeFileAriaLabel?.(fileIndex, file.name);\n };\n\n function isEllipsisActive() {\n const span = fileNameRef.current;\n const container = fileNameContainerRef.current;\n\n if (span && container) {\n return span.offsetWidth >= container.offsetWidth;\n }\n return false;\n }\n\n useResizeObserver(\n () => fileNameContainerRef.current,\n () => setIsTruncated(isEllipsisActive())\n );\n\n const fileIsSingleRow =\n !showFileLastModified && !showFileSize && (!groupContainsImage || (groupContainsImage && !showFileThumbnail));\n\n return (\n <div\n ref={containerRef}\n className={clsx(styles.token, {\n [styles['token-grid']]: alignment === 'horizontal',\n [styles['token-contains-image']]: groupContainsImage && showFileThumbnail,\n })}\n role=\"group\"\n aria-label={file.name}\n aria-describedby={errorText ? errorId : warningText ? warningId : undefined}\n aria-disabled={loading}\n data-index={index}\n >\n <div\n className={clsx(styles['token-box'], {\n [styles.loading]: loading,\n [styles.error]: errorText,\n [styles.warning]: showWarning,\n [styles.horizontal]: alignment === 'horizontal',\n [styles['read-only']]: readOnly,\n })}\n >\n {loading && (\n <div\n className={clsx(styles['file-loading-overlay'], {\n [styles['file-loading-overlay-single-row']]: loading && fileIsSingleRow,\n })}\n >\n <InternalSpinner variant=\"normal\" size=\"normal\" />\n </div>\n )}\n <InternalBox className={styles['file-option']}>\n {showFileThumbnail && isImage && <FileOptionThumbnail file={file} />}\n\n <div\n className={clsx(styles['file-option-metadata'], {\n [styles['with-image']]: showFileThumbnail && isImage,\n [styles['single-row-loading']]: loading && fileIsSingleRow,\n })}\n >\n <InternalSpaceBetween direction=\"vertical\" size=\"xxxs\">\n <div\n className={styles['file-name-container']}\n onMouseOver={() => setShowTooltip(true)}\n onMouseOut={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n role={isTruncated ? 'button' : undefined}\n aria-expanded={isTruncated ? showTooltip : undefined}\n tabIndex={isTruncated ? 0 : -1}\n ref={fileNameContainerRef}\n >\n <InternalBox\n fontWeight=\"normal\"\n className={clsx(styles['file-option-name'], testUtilStyles['file-option-name'], {\n [testUtilStyles['ellipsis-active']]: isTruncated,\n })}\n >\n <span ref={fileNameRef}>{file.name}</span>\n </InternalBox>\n </div>\n\n {showFileSize && file.size ? (\n <InternalBox\n fontSize=\"body-s\"\n color={'text-body-secondary'}\n className={clsx(styles['file-option-size'], testUtilStyles['file-option-size'])}\n >\n {formatFileSize(file.size)}\n </InternalBox>\n ) : null}\n\n {showFileLastModified && file.lastModified ? (\n <InternalBox\n fontSize=\"body-s\"\n color={'text-body-secondary'}\n className={clsx(styles['file-option-last-modified'], testUtilStyles['file-option-last-modified'])}\n >\n {formatFileLastModified(new Date(file.lastModified))}\n </InternalBox>\n ) : null}\n </InternalSpaceBetween>\n </div>\n </InternalBox>\n {onDismiss && !readOnly && <DismissButton dismissLabel={getDismissLabel(index)} onDismiss={onDismiss} />}\n </div>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={warningId} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {showTooltip && isTruncated && (\n <Tooltip\n getTrack={() => containerRef.current}\n content={<InternalBox fontWeight=\"normal\">{file.name}</InternalBox>}\n onEscape={() => setShowTooltip(false)}\n />\n )}\n </div>\n );\n}\n\nexport default InternalFileToken;\n"]}
@@ -79,5 +79,5 @@ export interface IconProps extends BaseComponentProps {
79
79
  export declare namespace IconProps {
80
80
  type Name = BuiltInIconName | IconRegistryIconName;
81
81
  type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';
82
- type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';
82
+ type Size = 'x-small' | 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';
83
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAEtB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,EAAE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OASG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;CACxE;AAED,yBAAiB,SAAS,CAAC;IACzB,KAAY,IAAI,GAAG,eAAe,GAAG,oBAAoB,CAAC;IAE1D,KAAY,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAE/G,KAAY,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BuiltInIconName, IconRegistryIconName } from '../icon-provider/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface IconProps extends BaseComponentProps {\n /**\n * Specifies the icon to be displayed.\n */\n name?: IconProps.Name;\n\n /**\n * Specifies the size of the icon.\n *\n * If you set size to `inherit`, an icon size will be assigned based on the icon's inherited line height.\n * For icons used alongside text, ensure the icon is placed inside the acompanying text tag.\n * The icon will be vertically centered based on the height.\n *\n * @visualrefresh `medium` size\n */\n size?: IconProps.Size;\n\n /**\n * Specifies the color variant of the icon. The `normal` variant picks up the current color of its context.\n */\n variant?: IconProps.Variant;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon cannot be an SVG.\n * For SVG icons, use the `svg` slot instead.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n */\n url?: string;\n\n /**\n * Specifies alternate text for a custom icon (using the `url` attribute).\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `svg` slot.\n *\n * @deprecated Use `ariaLabel` instead.\n */\n alt?: string;\n\n /**\n * Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n */\n ariaLabel?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available, and you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span` and ensure icon `size` is not set to `inherit`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n svg?: React.ReactNode;\n\n /**\n * Attributes to add to the native element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace IconProps {\n export type Name = BuiltInIconName | IconRegistryIconName;\n\n export type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';\n\n export type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BuiltInIconName, IconRegistryIconName } from '../icon-provider/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface IconProps extends BaseComponentProps {\n /**\n * Specifies the icon to be displayed.\n */\n name?: IconProps.Name;\n\n /**\n * Specifies the size of the icon.\n *\n * If you set size to `inherit`, an icon size will be assigned based on the icon's inherited line height.\n * For icons used alongside text, ensure the icon is placed inside the acompanying text tag.\n * The icon will be vertically centered based on the height.\n *\n * @visualrefresh `medium` size\n */\n size?: IconProps.Size;\n\n /**\n * Specifies the color variant of the icon. The `normal` variant picks up the current color of its context.\n */\n variant?: IconProps.Variant;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon cannot be an SVG.\n * For SVG icons, use the `svg` slot instead.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n */\n url?: string;\n\n /**\n * Specifies alternate text for a custom icon (using the `url` attribute).\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `svg` slot.\n *\n * @deprecated Use `ariaLabel` instead.\n */\n alt?: string;\n\n /**\n * Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n */\n ariaLabel?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available, and you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span` and ensure icon `size` is not set to `inherit`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n svg?: React.ReactNode;\n\n /**\n * Attributes to add to the native element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace IconProps {\n export type Name = BuiltInIconName | IconRegistryIconName;\n\n export type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';\n\n export type Size = 'x-small' | 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';\n}\n"]}
package/icon/internal.js CHANGED
@@ -25,7 +25,7 @@ function iconSizeMap(height, fontSize) {
25
25
  return 'medium';
26
26
  }
27
27
  else if (height <= 16) {
28
- return 'small';
28
+ return !!fontSize && fontSize <= 12 ? 'x-small' : 'small';
29
29
  }
30
30
  else {
31
31
  return 'normal';
@@ -72,7 +72,7 @@ const InternalIcon = ({ name, size = 'normal', variant = 'normal', url, alt, ari
72
72
  }
73
73
  const validIcon = name && Object.prototype.hasOwnProperty.call(icons, name);
74
74
  function iconMap(name) {
75
- if (name === 'gen-ai' && iconSize === 'small') {
75
+ if (name === 'gen-ai' && (iconSize === 'small' || iconSize === 'x-small')) {
76
76
  return (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true", "data-testid": "gen-ai-filled" },
77
77
  React.createElement("path", { d: "m8 4.4 1.018 2.582L11.6 8 9.018 9.018 8 11.6 6.982 9.018 4.4 8l2.582-1.018L8 4.4ZM2.405 2.41l.002-.003.003-.002-.003-.002-.002-.003-.002.003-.003.002.003.002.002.003Z", className: "filled" })));
78
78
  }