@cloudscape-design/components-themeable 3.0.603 → 3.0.605

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 (83) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/box/text.scss +5 -0
  3. package/lib/internal/scss/table/body-cell/styles.scss +53 -16
  4. package/lib/internal/scss/table/expandable-rows/motion.scss +13 -0
  5. package/lib/internal/scss/table/expandable-rows/styles.scss +47 -0
  6. package/lib/internal/scss/table/header-cell/styles.scss +15 -6
  7. package/lib/internal/template/box/interfaces.d.ts +7 -3
  8. package/lib/internal/template/box/interfaces.d.ts.map +1 -1
  9. package/lib/internal/template/box/interfaces.js.map +1 -1
  10. package/lib/internal/template/box/internal.js +1 -1
  11. package/lib/internal/template/box/internal.js.map +1 -1
  12. package/lib/internal/template/box/styles.css.js +191 -190
  13. package/lib/internal/template/box/styles.scoped.css +242 -235
  14. package/lib/internal/template/box/styles.selectors.js +191 -190
  15. package/lib/internal/template/internal/base-component/styles.scoped.css +7 -0
  16. package/lib/internal/template/internal/environment.js +1 -1
  17. package/lib/internal/template/internal/environment.json +1 -1
  18. package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
  19. package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
  20. package/lib/internal/template/internal/generated/theming/index.cjs +38 -0
  21. package/lib/internal/template/internal/generated/theming/index.js +38 -0
  22. package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
  23. package/lib/internal/template/table/body-cell/disabled-inline-editor.js +1 -0
  24. package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
  25. package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
  26. package/lib/internal/template/table/body-cell/index.js +4 -3
  27. package/lib/internal/template/table/body-cell/index.js.map +1 -1
  28. package/lib/internal/template/table/body-cell/styles.css.js +42 -29
  29. package/lib/internal/template/table/body-cell/styles.scoped.css +312 -87
  30. package/lib/internal/template/table/body-cell/styles.selectors.js +42 -29
  31. package/lib/internal/template/table/body-cell/td-element.d.ts +2 -0
  32. package/lib/internal/template/table/body-cell/td-element.d.ts.map +1 -1
  33. package/lib/internal/template/table/body-cell/td-element.js +11 -4
  34. package/lib/internal/template/table/body-cell/td-element.js.map +1 -1
  35. package/lib/internal/template/table/expandable-rows/expand-toggle-button.d.ts +4 -0
  36. package/lib/internal/template/table/expandable-rows/expand-toggle-button.d.ts.map +1 -0
  37. package/lib/internal/template/table/expandable-rows/expand-toggle-button.js +19 -0
  38. package/lib/internal/template/table/expandable-rows/expand-toggle-button.js.map +1 -0
  39. package/lib/internal/template/table/expandable-rows/expandable-rows-utils.d.ts +24 -0
  40. package/lib/internal/template/table/expandable-rows/expandable-rows-utils.d.ts.map +1 -0
  41. package/lib/internal/template/table/expandable-rows/expandable-rows-utils.js +58 -0
  42. package/lib/internal/template/table/expandable-rows/expandable-rows-utils.js.map +1 -0
  43. package/lib/internal/template/table/expandable-rows/styles.css.js +8 -0
  44. package/lib/internal/template/table/expandable-rows/styles.scoped.css +197 -0
  45. package/lib/internal/template/table/expandable-rows/styles.selectors.js +9 -0
  46. package/lib/internal/template/table/header-cell/index.d.ts +2 -1
  47. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  48. package/lib/internal/template/table/header-cell/index.js +3 -2
  49. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  50. package/lib/internal/template/table/header-cell/styles.css.js +25 -24
  51. package/lib/internal/template/table/header-cell/styles.scoped.css +65 -46
  52. package/lib/internal/template/table/header-cell/styles.selectors.js +25 -24
  53. package/lib/internal/template/table/interfaces.d.ts +31 -3
  54. package/lib/internal/template/table/interfaces.d.ts.map +1 -1
  55. package/lib/internal/template/table/interfaces.js.map +1 -1
  56. package/lib/internal/template/table/internal.d.ts.map +1 -1
  57. package/lib/internal/template/table/internal.js +41 -15
  58. package/lib/internal/template/table/internal.js.map +1 -1
  59. package/lib/internal/template/table/table-role/grid-navigation.js +4 -1
  60. package/lib/internal/template/table/table-role/grid-navigation.js.map +1 -1
  61. package/lib/internal/template/table/table-role/interfaces.d.ts +1 -1
  62. package/lib/internal/template/table/table-role/interfaces.d.ts.map +1 -1
  63. package/lib/internal/template/table/table-role/interfaces.js.map +1 -1
  64. package/lib/internal/template/table/table-role/table-role-helper.d.ts +5 -0
  65. package/lib/internal/template/table/table-role/table-role-helper.d.ts.map +1 -1
  66. package/lib/internal/template/table/table-role/table-role-helper.js +11 -6
  67. package/lib/internal/template/table/table-role/table-role-helper.js.map +1 -1
  68. package/lib/internal/template/table/thead.d.ts +1 -0
  69. package/lib/internal/template/table/thead.d.ts.map +1 -1
  70. package/lib/internal/template/table/thead.js +5 -2
  71. package/lib/internal/template/table/thead.js.map +1 -1
  72. package/lib/internal/template/table/use-table-focus-navigation.d.ts +2 -3
  73. package/lib/internal/template/table/use-table-focus-navigation.d.ts.map +1 -1
  74. package/lib/internal/template/table/use-table-focus-navigation.js +3 -3
  75. package/lib/internal/template/table/use-table-focus-navigation.js.map +1 -1
  76. package/lib/internal/template/test-utils/dom/table/index.d.ts +12 -0
  77. package/lib/internal/template/test-utils/dom/table/index.js +28 -1
  78. package/lib/internal/template/test-utils/dom/table/index.js.map +1 -1
  79. package/lib/internal/template/test-utils/selectors/table/index.d.ts +6 -0
  80. package/lib/internal/template/test-utils/selectors/table/index.js +14 -0
  81. package/lib/internal/template/test-utils/selectors/table/index.js.map +1 -1
  82. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "d4d0eb7ce0096e4946546e94a72511fa7abbe571"
2
+ "commit": "04e74f65b28e68e095bb2e7e48e599a2f39f3e86"
3
3
  }
@@ -43,6 +43,11 @@
43
43
  color: awsui.$color-text-label;
44
44
  margin-block-end: awsui.$space-key-value-gap;
45
45
  }
46
+ &.gen-ai-label-variant {
47
+ @include styles.font-body-s;
48
+ font-style: italic;
49
+ color: awsui.$color-text-label-gen-ai;
50
+ }
46
51
  &.value-large-variant {
47
52
  @include styles.font-display-l;
48
53
  font-weight: awsui.$font-box-value-large-weight;
@@ -26,11 +26,33 @@ $edit-button-padding-right: calc(
26
26
  ); // Cell vertical padding + xxs space that would normally come from the button.
27
27
  $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-with-spacing});
28
28
 
29
+ .expandable-toggle-wrapper {
30
+ position: absolute;
31
+ inset-block: 0;
32
+ display: flex;
33
+ align-items: center;
34
+ margin-inline-start: calc(-1 * (#{awsui.$space-m} + #{awsui.$space-xs}));
35
+ }
36
+
37
+ @mixin cell-offset($padding) {
38
+ padding-inline-start: $padding;
39
+
40
+ @for $i from 1 through 9 {
41
+ &.body-cell-expandable-level-#{$i} {
42
+ padding-inline-start: calc($padding + $i * (#{awsui.$space-m} + #{awsui.$space-xs}));
43
+ }
44
+ }
45
+ &.body-cell-expandable-level-next {
46
+ padding-inline-start: calc($padding + 9 * (#{awsui.$space-m} + #{awsui.$space-xs}));
47
+ }
48
+ }
49
+
29
50
  .body-cell {
30
51
  box-sizing: border-box;
31
52
  padding-block-start: $cell-vertical-padding;
32
53
  padding-block-end: $cell-vertical-padding-w-border;
33
- padding-inline: $cell-horizontal-padding;
54
+ @include cell-offset($cell-horizontal-padding);
55
+ padding-inline-end: $cell-horizontal-padding;
34
56
  border-block-start: awsui.$border-divider-list-width solid transparent;
35
57
  word-wrap: break-word;
36
58
  border-block-end: awsui.$border-divider-list-width solid awsui.$color-border-divider-secondary;
@@ -65,9 +87,9 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
65
87
  }
66
88
  &.is-visual-refresh:first-child {
67
89
  &:not(.has-striped-rows) {
68
- padding-inline-start: awsui.$space-xxxs;
69
- &:not(.body-cell-edit-active).body-cell-editable:hover {
70
- padding-inline-start: calc(#{awsui.$space-xxxs} + #{awsui.$border-divider-list-width});
90
+ @include cell-offset(awsui.$space-xxxs);
91
+ &:not(.body-cell-edit-active).body-cell-interactive.body-cell-editable:hover {
92
+ @include cell-offset(calc(#{awsui.$space-xxxs} + #{awsui.$border-divider-list-width}));
71
93
  }
72
94
  }
73
95
 
@@ -77,9 +99,9 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
77
99
  to the table edge.
78
100
  */
79
101
  &:first-child.has-striped-rows {
80
- padding-inline-start: awsui.$space-xxs;
102
+ @include cell-offset(awsui.$space-xxs);
81
103
  &-sticky-cell-pad-left {
82
- padding-inline-start: awsui.$space-table-horizontal;
104
+ @include cell-offset(awsui.$space-table-horizontal);
83
105
  }
84
106
  }
85
107
 
@@ -93,7 +115,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
93
115
  }
94
116
  }
95
117
  &:first-child:not(.is-visual-refresh) {
96
- padding-inline-start: $cell-edge-horizontal-padding;
118
+ @include cell-offset($cell-edge-horizontal-padding);
97
119
  }
98
120
  &-first-row {
99
121
  border-block-start: $border-placeholder;
@@ -148,7 +170,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
148
170
  background: awsui.$color-background-container-content;
149
171
  z-index: 798; // Our sticky elements should have z-index in the range of 800-850, this value needs to be lower
150
172
  &-pad-left:not(.has-selection):not(.is-visual-refresh.body-cell:first-child.has-striped-rows) {
151
- padding-inline-start: awsui.$space-table-horizontal;
173
+ @include cell-offset(awsui.$space-table-horizontal);
152
174
  }
153
175
  &.body-cell-shaded {
154
176
  background: awsui.$color-background-cell-shaded;
@@ -295,6 +317,14 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
295
317
  }
296
318
  }
297
319
 
320
+ &.body-cell-expandable {
321
+ position: relative;
322
+
323
+ &.sticky-cell {
324
+ position: sticky;
325
+ }
326
+ }
327
+
298
328
  &.body-cell-editable {
299
329
  position: relative;
300
330
 
@@ -310,25 +340,29 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
310
340
  }
311
341
 
312
342
  &:not(.body-cell-edit-active) {
313
- cursor: pointer;
343
+ &.body-cell-interactive {
344
+ cursor: pointer;
345
+ }
314
346
 
315
347
  @mixin focused-editor-styles {
316
348
  padding-inline-end: calc(#{$cell-horizontal-padding} + #{awsui.$space-l});
317
- & > .body-cell-editor-wrapper {
349
+ & > .body-cell-editor-wrapper,
350
+ & > .expandable-cell-content > .body-cell-editor-wrapper {
318
351
  opacity: 1;
319
352
  }
320
353
  & > .body-cell-success {
321
354
  opacity: 1;
322
355
  }
323
356
  }
324
- & > .body-cell-editor-wrapper {
357
+ & > .body-cell-editor-wrapper,
358
+ & > .expandable-cell-content > .body-cell-editor-wrapper {
325
359
  opacity: 0;
326
360
  }
327
361
 
328
362
  // Showing focus outline for the cell.
329
363
  // We don't use our focus-visible polyfill here because it doesn't work properly with screen readers.
330
364
  // These edit buttons are special because they are visually hidden (opacity: 0), but exposed to assistive technology.
331
- // It's therefore important to display the focus outline, even when a keyboard user wasn't detected.
365
+ // It's therefore important to display the focus outline, even when a keyboard use wasn't detected.
332
366
  // For example, when an edit button is selected from the VoiceOver rotor menu.
333
367
  &.body-cell-interactive:focus-within {
334
368
  @include styles.focus-highlight(
@@ -339,7 +373,8 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
339
373
  );
340
374
  }
341
375
  // When a cell is not interactive the focus outline must be present for the editor button.
342
- &:not(.body-cell-interactive) > .body-cell-editor-wrapper > .body-cell-editor {
376
+ &:not(.body-cell-interactive) > .body-cell-editor-wrapper > .body-cell-editor,
377
+ &:not(.body-cell-interactive) > .expandable-cell-content > .body-cell-editor-wrapper > .body-cell-editor {
343
378
  @include focus-visible.when-visible {
344
379
  @include styles.focus-highlight(awsui.$space-button-inline-icon-focus-outline-gutter);
345
380
  }
@@ -370,7 +405,8 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
370
405
  inset-inline: 0;
371
406
  }
372
407
 
373
- & > .body-cell-editor-wrapper {
408
+ & > .body-cell-editor-wrapper,
409
+ & > .expandable-cell-content > .body-cell-editor-wrapper {
374
410
  padding-inline-end: calc(#{$edit-button-padding-right} - (2 * #{awsui.$border-divider-list-width}));
375
411
  }
376
412
  & > .body-cell-success {
@@ -394,7 +430,7 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
394
430
  }
395
431
  }
396
432
  }
397
- &-editable.is-visual-refresh:not(.body-cell-edit-active):hover {
433
+ &-editable.is-visual-refresh:not(.body-cell-edit-active).body-cell-interactive:hover {
398
434
  &:first-child {
399
435
  border-start-start-radius: awsui.$border-radius-item;
400
436
  border-end-start-radius: awsui.$border-radius-item;
@@ -404,7 +440,8 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
404
440
  border-end-end-radius: awsui.$border-radius-item;
405
441
  }
406
442
  &.body-cell-first-row > .body-cell-success,
407
- &.body-cell-first-row > .body-cell-editor-wrapper {
443
+ &.body-cell-first-row > .body-cell-editor-wrapper,
444
+ &.body-cell-first-row > .expandable-cell-content > .body-cell-editor-wrapper {
408
445
  padding-block-start: awsui.$border-divider-list-width;
409
446
  }
410
447
  }
@@ -0,0 +1,13 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ @use '../../internal/styles' as styles;
7
+ @use '../../internal/styles/tokens' as tokens;
8
+
9
+ .expand-toggle-icon {
10
+ @include styles.with-motion {
11
+ transition: transform tokens.$motion-duration-rotate-90 tokens.$motion-easing-rotate-90;
12
+ }
13
+ }
@@ -0,0 +1,47 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ @use '../../internal/styles/index' as styles;
7
+ @use '../../internal/styles/tokens' as awsui;
8
+ @use '../../internal/hooks/focus-visible' as focus-visible;
9
+ @use '../../internal/styles/tokens' as tokens;
10
+
11
+ @use './motion';
12
+
13
+ .expand-toggle-icon {
14
+ transform: rotate(-90deg);
15
+
16
+ &-expanded {
17
+ transform: rotate(0deg);
18
+ }
19
+ }
20
+
21
+ .expand-toggle {
22
+ @include styles.styles-reset;
23
+ cursor: pointer;
24
+ inline-size: awsui.$space-m;
25
+ block-size: awsui.$space-m;
26
+ border-block: 0;
27
+ border-inline: 0;
28
+ margin-block: 0;
29
+ margin-inline: 0;
30
+ padding-block: 0;
31
+ padding-inline: 0;
32
+ background: none;
33
+ outline: 0;
34
+
35
+ @include focus-visible.when-visible {
36
+ @include styles.focus-highlight(awsui.$space-button-inline-icon-focus-outline-gutter);
37
+ }
38
+
39
+ color: awsui.$color-text-interactive-default;
40
+
41
+ &:hover {
42
+ color: awsui.$color-text-interactive-hover;
43
+ }
44
+ &:active {
45
+ color: awsui.$color-text-interactive-active;
46
+ }
47
+ }
@@ -7,6 +7,14 @@
7
7
  @use '../../internal/styles/tokens' as awsui;
8
8
  @use '../../internal/styles' as styles;
9
9
 
10
+ @mixin cell-offset($padding) {
11
+ padding-inline-start: $padding;
12
+
13
+ &.header-cell-content-expandable {
14
+ padding-inline-start: calc(#{$padding} + #{awsui.$space-m} + #{awsui.$space-xs});
15
+ }
16
+ }
17
+
10
18
  .header-cell {
11
19
  position: relative;
12
20
  text-align: start;
@@ -94,7 +102,8 @@
94
102
  .header-cell-content {
95
103
  position: relative;
96
104
  padding-block: awsui.$space-scaled-xxs;
97
- padding-inline: awsui.$space-s;
105
+ @include cell-offset(awsui.$space-s);
106
+ padding-inline-end: awsui.$space-s;
98
107
 
99
108
  .header-cell-sortable > & {
100
109
  padding-inline-end: calc(#{awsui.$space-xl} + #{awsui.$space-xxs});
@@ -158,15 +167,15 @@ settings icon in the pagination slot.
158
167
  */
159
168
  .header-cell:not(.is-visual-refresh) {
160
169
  &:first-child {
161
- padding-inline-start: awsui.$space-xs;
170
+ @include cell-offset(awsui.$space-xs);
162
171
  }
163
172
  }
164
173
 
165
174
  .header-cell.is-visual-refresh {
166
175
  &:first-child:not(.has-striped-rows) {
167
- padding-inline-start: awsui.$space-xxxs;
176
+ @include cell-offset(awsui.$space-xxxs);
168
177
  &.sticky-cell-pad-left {
169
- padding-inline-start: awsui.$space-table-horizontal;
178
+ @include cell-offset(awsui.$space-table-horizontal);
170
179
  }
171
180
  }
172
181
 
@@ -176,11 +185,11 @@ settings icon in the pagination slot.
176
185
  to the table edge.
177
186
  */
178
187
  &:first-child.has-striped-rows {
179
- padding-inline-start: awsui.$space-xxs;
188
+ @include cell-offset(awsui.$space-xxs);
180
189
  }
181
190
 
182
191
  &:first-child > .header-cell-content {
183
- padding-inline-start: 0;
192
+ @include cell-offset(0px);
184
193
  }
185
194
 
186
195
  &:last-child.header-cell-sortable {
@@ -5,8 +5,12 @@ export interface BoxProps extends BaseComponentProps {
5
5
  * Defines the style of element to display.
6
6
  *
7
7
  * - If you set it to `'div'`, `'span'`, `'h1'`, `'h2'`, `'h3'`, `'h4'`, `'h5'`, `'p'`, `'strong'`, `'small'`, `'code'`, `'pre'`, or `'samp'`, the variant is also used as the HTML tag name.
8
- * - If you set it to `awsui-key-label`, the component will display as a `div`.
9
- * - If you set it to `awsui-value-large`, the component will display as a `span`.
8
+ * - If you set it to `awsui-key-label`, the component will render a `div`,
9
+ * styled for use as a key label in key-value pairs.
10
+ * - If you set it to `awsui-gen-ai-label`, the component will render a `div`,
11
+ * styled for use as a label indicating that content is produced by generative AI.
12
+ * - If you set it to `awsui-value-large`, the component will render a `span`,
13
+ * styled using "Display large light" typography.
10
14
  *
11
15
  * Override the HTML tag by using property `tagOverride`.
12
16
  */
@@ -112,7 +116,7 @@ export interface BoxProps extends BaseComponentProps {
112
116
  children?: React.ReactNode;
113
117
  }
114
118
  export declare namespace BoxProps {
115
- type Variant = 'div' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'p' | 'strong' | 'small' | 'code' | 'pre' | 'samp' | 'awsui-key-label' | 'awsui-value-large';
119
+ type Variant = 'div' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'p' | 'strong' | 'small' | 'code' | 'pre' | 'samp' | 'awsui-key-label' | 'awsui-gen-ai-label' | 'awsui-value-large';
116
120
  type Display = 'block' | 'inline' | 'inline-block' | 'none';
117
121
  type TextAlign = 'left' | 'center' | 'right';
118
122
  type Float = 'left' | 'right';
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/box/interfaces.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,QAAS,SAAQ,kBAAkB;IAClD;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC;IACjD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC;IAClD;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,yBAAiB,QAAQ,CAAC;IACxB,KA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AAM,CAAC;IACnE,KAAY,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpD,KAAY,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACrC,KAAY,QAAQ,GAChB,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,GACZ,WAAW,CAAC;IAChB,KAAY,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/D,KAAY,KAAK,GACb,SAAS,GACT,YAAY,GACZ,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,GAClB,sBAAsB,GACtB,qBAAqB,CAAC;IAC1B,KAAY,WAAW,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IAChG,UAAiB,OAAO;QACtB,GAAG,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;QAC3B,KAAK,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;QAC7B,MAAM,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;QAC9B,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;QAC5B,UAAU,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;QAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC;KACjC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/box/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface BoxProps extends BaseComponentProps {\n /**\n * Defines the style of element to display.\n *\n * - If you set it to `'div'`, `'span'`, `'h1'`, `'h2'`, `'h3'`, `'h4'`, `'h5'`, `'p'`, `'strong'`, `'small'`, `'code'`, `'pre'`, or `'samp'`, the variant is also used as the HTML tag name.\n * - If you set it to `awsui-key-label`, the component will display as a `div`.\n * - If you set it to `awsui-value-large`, the component will display as a `span`.\n *\n * Override the HTML tag by using property `tagOverride`.\n */\n variant?: BoxProps.Variant;\n /**\n * Overrides the default HTML tag provided by the variant.\n */\n tagOverride?: string;\n /**\n * Overrides the display of the element. You can set it to the following values:\n *\n * - `block` - Specifies block display.\n * - `inline` - Specifies inline display.\n * - `inline-block` - Specifies inline-block display.\n * - `none` - Hides the box.\n *\n * Note: If you don't set it, the display depends on the variant.\n */\n display?: BoxProps.Display;\n /**\n * Adds margins to the element. It can be the following:\n *\n * - A single string with a size. This applies the same margin to all sides (that is, top, right, bottom, left).\n * - An object specifying the size of the margin per side. The object has the following format:\n * ```\n * {\n * top: \"size of top margin\",\n * right: \"size of right margin\",\n * bottom: \"size of bottom margin\",\n * left: \"size of left margin\",\n * horizontal: \"size of left and right margin\",\n * vertical: \"size of top and bottom margin\",\n * }\n * ```\n *\n * The size can be `n`, `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`, where `n` stands for none.\n * Sizes are automatically scaled down in compact mode.\n *\n * For example, `margin=\"s\"` adds a small margin to all sides.\n * `margin={{ right: \"l\", bottom: \"s\" }}` adds a small margin to the bottom and a large margin to the right.\n */\n margin?: BoxProps.SpacingSize | BoxProps.Spacing;\n /**\n * Adds padding to the element. It can be the following:\n *\n * - A single string with a size. This applies the same padding to all sides (that is, top, right, bottom, left).\n * - An object specifying the size of padding per side. The object has the following format:\n * ```\n * {\n * top: \"size of top padding\",\n * right: \"size of right padding\",\n * bottom: \"size of bottom padding\",\n * left: \"size of left padding\",\n * horizontal: \"size of left and right padding\",\n * vertical: \"size of top and bottom padding\",\n * }\n * ```\n *\n * The size can be `n`, `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`, where `n` stands for none.\n * Sizes are automatically scaled down in compact mode.\n *\n * For example, `padding=\"s\"` adds small padding to all sides.\n * `padding={{ right: \"l\", bottom: \"s\" }}` adds small padding to the bottom and large padding to the right.\n */\n padding?: BoxProps.SpacingSize | BoxProps.Spacing;\n /**\n * Defines the text alignment within the element. You can set it to `left`, `center`, or `right`.\n */\n textAlign?: BoxProps.TextAlign;\n /**\n * Defines the floating behavior. You can set it to `left` or `right`.\n */\n float?: BoxProps.Float;\n /**\n * Overrides the font size and line height. If not set, the font size and line height depend on the variant.\n */\n fontSize?: BoxProps.FontSize;\n /**\n * Overrides the font weight. If not set, the value depends on the variant.\n * @visualrefresh 'heavy'\n */\n fontWeight?: BoxProps.FontWeight;\n /**\n * Overrides the text color. You can set it to the following values:\n *\n * - `inherit` - Inherits the color from the parent element. For example, use this to style content\n * in Flashbars and to style the `empty` and `noMatch` slots of the Table and Cards components.\n * - `text-label` - Specifies the text color for non-form labels. For example, use it for the key in key/value pairs.\n * - `text-body-secondary` - Specifies the color for secondary text.\n * - `text-status-error` - Specifies the color for error text and icons.\n * - `text-status-success` - Specifies the color for success text and icons.\n * - `text-status-info` - Specifies the color for info text and icon.\n * - `text-status-inactive` - Specifies the color for inactive and loading text and icons.\n * - `text-status-warning` - Specifies the color for warning text and icons.\n *\n * Note: If you don't set it, the text color depends on the variant.\n */\n color?: BoxProps.Color;\n /**\n * Content of the box.\n * @displayname content\n */\n children?: React.ReactNode;\n}\n\nexport namespace BoxProps {\n export type Variant =\n | 'div'\n | 'span'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'p'\n | 'strong'\n | 'small'\n | 'code'\n | 'pre'\n | 'samp'\n | 'awsui-key-label'\n | 'awsui-value-large';\n\n export type Display = 'block' | 'inline' | 'inline-block' | 'none';\n export type TextAlign = 'left' | 'center' | 'right';\n export type Float = 'left' | 'right';\n export type FontSize =\n | 'body-s'\n | 'body-m'\n | 'heading-xs'\n | 'heading-s'\n | 'heading-m'\n | 'heading-l'\n | 'heading-xl'\n | 'display-l';\n export type FontWeight = 'light' | 'normal' | 'bold' | 'heavy';\n export type Color =\n | 'inherit'\n | 'text-label'\n | 'text-body-secondary'\n | 'text-status-error'\n | 'text-status-success'\n | 'text-status-info'\n | 'text-status-inactive'\n | 'text-status-warning';\n export type SpacingSize = 'n' | 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';\n export interface Spacing {\n top?: BoxProps.SpacingSize;\n right?: BoxProps.SpacingSize;\n bottom?: BoxProps.SpacingSize;\n left?: BoxProps.SpacingSize;\n horizontal?: BoxProps.SpacingSize;\n vertical?: BoxProps.SpacingSize;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/box/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface BoxProps extends BaseComponentProps {\n /**\n * Defines the style of element to display.\n *\n * - If you set it to `'div'`, `'span'`, `'h1'`, `'h2'`, `'h3'`, `'h4'`, `'h5'`, `'p'`, `'strong'`, `'small'`, `'code'`, `'pre'`, or `'samp'`, the variant is also used as the HTML tag name.\n * - If you set it to `awsui-key-label`, the component will render a `div`,\n * styled for use as a key label in key-value pairs.\n * - If you set it to `awsui-gen-ai-label`, the component will render a `div`,\n * styled for use as a label indicating that content is produced by generative AI.\n * - If you set it to `awsui-value-large`, the component will render a `span`,\n * styled using \"Display large light\" typography.\n *\n * Override the HTML tag by using property `tagOverride`.\n */\n variant?: BoxProps.Variant;\n /**\n * Overrides the default HTML tag provided by the variant.\n */\n tagOverride?: string;\n /**\n * Overrides the display of the element. You can set it to the following values:\n *\n * - `block` - Specifies block display.\n * - `inline` - Specifies inline display.\n * - `inline-block` - Specifies inline-block display.\n * - `none` - Hides the box.\n *\n * Note: If you don't set it, the display depends on the variant.\n */\n display?: BoxProps.Display;\n /**\n * Adds margins to the element. It can be the following:\n *\n * - A single string with a size. This applies the same margin to all sides (that is, top, right, bottom, left).\n * - An object specifying the size of the margin per side. The object has the following format:\n * ```\n * {\n * top: \"size of top margin\",\n * right: \"size of right margin\",\n * bottom: \"size of bottom margin\",\n * left: \"size of left margin\",\n * horizontal: \"size of left and right margin\",\n * vertical: \"size of top and bottom margin\",\n * }\n * ```\n *\n * The size can be `n`, `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`, where `n` stands for none.\n * Sizes are automatically scaled down in compact mode.\n *\n * For example, `margin=\"s\"` adds a small margin to all sides.\n * `margin={{ right: \"l\", bottom: \"s\" }}` adds a small margin to the bottom and a large margin to the right.\n */\n margin?: BoxProps.SpacingSize | BoxProps.Spacing;\n /**\n * Adds padding to the element. It can be the following:\n *\n * - A single string with a size. This applies the same padding to all sides (that is, top, right, bottom, left).\n * - An object specifying the size of padding per side. The object has the following format:\n * ```\n * {\n * top: \"size of top padding\",\n * right: \"size of right padding\",\n * bottom: \"size of bottom padding\",\n * left: \"size of left padding\",\n * horizontal: \"size of left and right padding\",\n * vertical: \"size of top and bottom padding\",\n * }\n * ```\n *\n * The size can be `n`, `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`, where `n` stands for none.\n * Sizes are automatically scaled down in compact mode.\n *\n * For example, `padding=\"s\"` adds small padding to all sides.\n * `padding={{ right: \"l\", bottom: \"s\" }}` adds small padding to the bottom and large padding to the right.\n */\n padding?: BoxProps.SpacingSize | BoxProps.Spacing;\n /**\n * Defines the text alignment within the element. You can set it to `left`, `center`, or `right`.\n */\n textAlign?: BoxProps.TextAlign;\n /**\n * Defines the floating behavior. You can set it to `left` or `right`.\n */\n float?: BoxProps.Float;\n /**\n * Overrides the font size and line height. If not set, the font size and line height depend on the variant.\n */\n fontSize?: BoxProps.FontSize;\n /**\n * Overrides the font weight. If not set, the value depends on the variant.\n * @visualrefresh 'heavy'\n */\n fontWeight?: BoxProps.FontWeight;\n /**\n * Overrides the text color. You can set it to the following values:\n *\n * - `inherit` - Inherits the color from the parent element. For example, use this to style content\n * in Flashbars and to style the `empty` and `noMatch` slots of the Table and Cards components.\n * - `text-label` - Specifies the text color for non-form labels. For example, use it for the key in key/value pairs.\n * - `text-body-secondary` - Specifies the color for secondary text.\n * - `text-status-error` - Specifies the color for error text and icons.\n * - `text-status-success` - Specifies the color for success text and icons.\n * - `text-status-info` - Specifies the color for info text and icon.\n * - `text-status-inactive` - Specifies the color for inactive and loading text and icons.\n * - `text-status-warning` - Specifies the color for warning text and icons.\n *\n * Note: If you don't set it, the text color depends on the variant.\n */\n color?: BoxProps.Color;\n /**\n * Content of the box.\n * @displayname content\n */\n children?: React.ReactNode;\n}\n\nexport namespace BoxProps {\n export type Variant =\n | 'div'\n | 'span'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'p'\n | 'strong'\n | 'small'\n | 'code'\n | 'pre'\n | 'samp'\n | 'awsui-key-label'\n | 'awsui-gen-ai-label'\n | 'awsui-value-large';\n\n export type Display = 'block' | 'inline' | 'inline-block' | 'none';\n export type TextAlign = 'left' | 'center' | 'right';\n export type Float = 'left' | 'right';\n export type FontSize =\n | 'body-s'\n | 'body-m'\n | 'heading-xs'\n | 'heading-s'\n | 'heading-m'\n | 'heading-l'\n | 'heading-xl'\n | 'display-l';\n export type FontWeight = 'light' | 'normal' | 'bold' | 'heavy';\n export type Color =\n | 'inherit'\n | 'text-label'\n | 'text-body-secondary'\n | 'text-status-error'\n | 'text-status-success'\n | 'text-status-info'\n | 'text-status-inactive'\n | 'text-status-warning';\n export type SpacingSize = 'n' | 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';\n export interface Spacing {\n top?: BoxProps.SpacingSize;\n right?: BoxProps.SpacingSize;\n bottom?: BoxProps.SpacingSize;\n left?: BoxProps.SpacingSize;\n horizontal?: BoxProps.SpacingSize;\n vertical?: BoxProps.SpacingSize;\n }\n}\n"]}
@@ -30,7 +30,7 @@ const getTag = (variant, tagOverride) => {
30
30
  if (variant === 'awsui-value-large') {
31
31
  return 'span';
32
32
  }
33
- if (variant === 'awsui-key-label') {
33
+ if (variant === 'awsui-key-label' || variant === 'awsui-gen-ai-label') {
34
34
  return 'div';
35
35
  }
36
36
  return variant;
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/box/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAcjB;QAdiB,EAClC,OAAO,GAAG,KAAK,EACf,WAAW,EACX,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,QAAQ,EACR,iBAAiB,GAAG,IAAI,OAEP,EADd,KAAK,cAb0B,oJAcnC,CADS;IAER,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAChE,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAClE,+DAA+D;IAC/D,kDAAkD;IAClD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,CAAU,CAAC;IAElD,MAAM,SAAS,GAAG,IAAI,CACpB,SAAS,CAAC,SAAS,EACnB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,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ED,IAAI,OAAO,KAAK,mBAAmB,EAAE;QACnC,OAAO,MAAM,CAAC;KACf;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE;QACjC,OAAO,KAAK,CAAC;KACd;IAED,OAAO,OAAO,CAAC;AACjB,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 { getBaseProps } from '../internal/base-component';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { BoxProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalBoxProps = BoxProps & InternalBaseComponentProps;\n\nexport default function InternalBox({\n variant = 'div',\n tagOverride,\n margin = {},\n padding = {},\n display,\n textAlign,\n float,\n fontSize,\n fontWeight,\n color,\n children,\n __internalRootRef = null,\n ...props\n}: InternalBoxProps) {\n const baseProps = getBaseProps(props);\n const marginsClassNamesSuffices = getClassNamesSuffixes(margin);\n const paddingsClassNamesSuffices = getClassNamesSuffixes(padding);\n // This can be any arbitrary string if passed into tagOverride.\n // We appease the compiler with an incorrect type.\n const Tag = getTag(variant, tagOverride) as 'div';\n\n const className = clsx(\n baseProps.className,\n styles.root,\n styles.box,\n styles[`${variant.replace(/^awsui-/, '')}-variant`],\n marginsClassNamesSuffices.map(suffix => styles[`m-${suffix}`]),\n paddingsClassNamesSuffices.map(suffix => styles[`p-${suffix}`]),\n styles[`d-${display}`],\n styles[`f-${float}`],\n styles[`color-${color || 'default'}`],\n styles[`font-size-${fontSize || 'default'}`],\n styles[`font-weight-${fontWeight || 'default'}`],\n styles[`t-${textAlign}`]\n );\n\n return (\n <Tag {...baseProps} className={className} ref={__internalRootRef}>\n {children}\n </Tag>\n );\n}\n\nconst getClassNamesSuffixes = (value: BoxProps.SpacingSize | BoxProps.Spacing) => {\n if (typeof value === 'string') {\n return [value];\n }\n const sides = ['top', 'right', 'bottom', 'left', 'horizontal', 'vertical'] as const;\n return sides.filter(side => !!value[side]).map(side => `${side}-${value[side]}`);\n};\n\nconst getTag = (variant: BoxProps.Variant, tagOverride: BoxProps['tagOverride']) => {\n if (tagOverride) {\n return tagOverride;\n }\n\n if (variant === 'awsui-value-large') {\n return 'span';\n }\n\n if (variant === 'awsui-key-label') {\n return 'div';\n }\n\n return variant;\n};\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/box/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAcjB;QAdiB,EAClC,OAAO,GAAG,KAAK,EACf,WAAW,EACX,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,QAAQ,EACR,iBAAiB,GAAG,IAAI,OAEP,EADd,KAAK,cAb0B,oJAcnC,CADS;IAER,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAChE,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAClE,+DAA+D;IAC/D,kDAAkD;IAClD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,CAAU,CAAC;IAElD,MAAM,SAAS,GAAG,IAAI,CACpB,SAAS,CAAC,SAAS,EACnB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,EACnD,yBAAyB,CAAC,GAAG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AE;QACnC,OAAO,MAAM,CAAC;KACf;IAED,IAAI,OAAO,KAAK,iBAAiB,IAAI,OAAO,KAAK,oBAAoB,EAAE;QACrE,OAAO,KAAK,CAAC;KACd;IAED,OAAO,OAAO,CAAC;AACjB,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 { getBaseProps } from '../internal/base-component';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { BoxProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalBoxProps = BoxProps & InternalBaseComponentProps;\n\nexport default function InternalBox({\n variant = 'div',\n tagOverride,\n margin = {},\n padding = {},\n display,\n textAlign,\n float,\n fontSize,\n fontWeight,\n color,\n children,\n __internalRootRef = null,\n ...props\n}: InternalBoxProps) {\n const baseProps = getBaseProps(props);\n const marginsClassNamesSuffices = getClassNamesSuffixes(margin);\n const paddingsClassNamesSuffices = getClassNamesSuffixes(padding);\n // This can be any arbitrary string if passed into tagOverride.\n // We appease the compiler with an incorrect type.\n const Tag = getTag(variant, tagOverride) as 'div';\n\n const className = clsx(\n baseProps.className,\n styles.root,\n styles.box,\n styles[`${variant.replace(/^awsui-/, '')}-variant`],\n marginsClassNamesSuffices.map(suffix => styles[`m-${suffix}`]),\n paddingsClassNamesSuffices.map(suffix => styles[`p-${suffix}`]),\n styles[`d-${display}`],\n styles[`f-${float}`],\n styles[`color-${color || 'default'}`],\n styles[`font-size-${fontSize || 'default'}`],\n styles[`font-weight-${fontWeight || 'default'}`],\n styles[`t-${textAlign}`]\n );\n\n return (\n <Tag {...baseProps} className={className} ref={__internalRootRef}>\n {children}\n </Tag>\n );\n}\n\nconst getClassNamesSuffixes = (value: BoxProps.SpacingSize | BoxProps.Spacing) => {\n if (typeof value === 'string') {\n return [value];\n }\n const sides = ['top', 'right', 'bottom', 'left', 'horizontal', 'vertical'] as const;\n return sides.filter(side => !!value[side]).map(side => `${side}-${value[side]}`);\n};\n\nconst getTag = (variant: BoxProps.Variant, tagOverride: BoxProps['tagOverride']) => {\n if (tagOverride) {\n return tagOverride;\n }\n\n if (variant === 'awsui-value-large') {\n return 'span';\n }\n\n if (variant === 'awsui-key-label' || variant === 'awsui-gen-ai-label') {\n return 'div';\n }\n\n return variant;\n};\n"]}