@cloudscape-design/components-themeable 3.0.1325 → 3.0.1327

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 (153) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/action-card/styles.scss +4 -2
  3. package/lib/internal/scss/badge/styles.scss +4 -4
  4. package/lib/internal/scss/box/styles.scss +1 -0
  5. package/lib/internal/scss/box/visual-accent.scss +117 -0
  6. package/lib/internal/scss/button-dropdown/styles.scss +6 -0
  7. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  8. package/lib/internal/scss/link/constants.scss +2 -2
  9. package/lib/internal/scss/side-navigation/styles.scss +6 -0
  10. package/lib/internal/template/action-card/interfaces.d.ts +40 -1
  11. package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
  12. package/lib/internal/template/action-card/interfaces.js.map +1 -1
  13. package/lib/internal/template/action-card/internal.d.ts.map +1 -1
  14. package/lib/internal/template/action-card/internal.js +32 -9
  15. package/lib/internal/template/action-card/internal.js.map +1 -1
  16. package/lib/internal/template/action-card/styles.css.js +17 -17
  17. package/lib/internal/template/action-card/styles.scoped.css +96 -92
  18. package/lib/internal/template/action-card/styles.selectors.js +17 -17
  19. package/lib/internal/template/badge/styles.css.js +10 -10
  20. package/lib/internal/template/badge/styles.scoped.css +14 -14
  21. package/lib/internal/template/badge/styles.selectors.js +10 -10
  22. package/lib/internal/template/box/interfaces.d.ts +59 -0
  23. package/lib/internal/template/box/interfaces.d.ts.map +1 -1
  24. package/lib/internal/template/box/interfaces.js.map +1 -1
  25. package/lib/internal/template/box/internal.d.ts +1 -1
  26. package/lib/internal/template/box/internal.d.ts.map +1 -1
  27. package/lib/internal/template/box/internal.js +4 -2
  28. package/lib/internal/template/box/internal.js.map +1 -1
  29. package/lib/internal/template/box/styles.css.js +224 -193
  30. package/lib/internal/template/box/styles.scoped.css +424 -238
  31. package/lib/internal/template/box/styles.selectors.js +224 -193
  32. package/lib/internal/template/button-dropdown/category-elements/category-element.d.ts +1 -1
  33. package/lib/internal/template/button-dropdown/category-elements/category-element.d.ts.map +1 -1
  34. package/lib/internal/template/button-dropdown/category-elements/category-element.js +3 -3
  35. package/lib/internal/template/button-dropdown/category-elements/category-element.js.map +1 -1
  36. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts +1 -1
  37. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
  38. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js +22 -12
  39. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  40. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts +1 -1
  41. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
  42. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js +12 -10
  43. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  44. package/lib/internal/template/button-dropdown/filter.d.ts +8 -0
  45. package/lib/internal/template/button-dropdown/filter.d.ts.map +1 -0
  46. package/lib/internal/template/button-dropdown/filter.js +18 -0
  47. package/lib/internal/template/button-dropdown/filter.js.map +1 -0
  48. package/lib/internal/template/button-dropdown/index.d.ts.map +1 -1
  49. package/lib/internal/template/button-dropdown/index.js +3 -3
  50. package/lib/internal/template/button-dropdown/index.js.map +1 -1
  51. package/lib/internal/template/button-dropdown/interfaces.d.ts +41 -0
  52. package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
  53. package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
  54. package/lib/internal/template/button-dropdown/internal-interfaces.d.ts +12 -0
  55. package/lib/internal/template/button-dropdown/internal-interfaces.d.ts.map +1 -1
  56. package/lib/internal/template/button-dropdown/internal-interfaces.js.map +1 -1
  57. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  58. package/lib/internal/template/button-dropdown/internal.js +46 -7
  59. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  60. package/lib/internal/template/button-dropdown/item-element/index.d.ts +1 -1
  61. package/lib/internal/template/button-dropdown/item-element/index.d.ts.map +1 -1
  62. package/lib/internal/template/button-dropdown/item-element/index.js +35 -16
  63. package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
  64. package/lib/internal/template/button-dropdown/items-list.d.ts +1 -1
  65. package/lib/internal/template/button-dropdown/items-list.d.ts.map +1 -1
  66. package/lib/internal/template/button-dropdown/items-list.js +4 -4
  67. package/lib/internal/template/button-dropdown/items-list.js.map +1 -1
  68. package/lib/internal/template/button-dropdown/styles.css.js +23 -22
  69. package/lib/internal/template/button-dropdown/styles.scoped.css +38 -32
  70. package/lib/internal/template/button-dropdown/styles.selectors.js +23 -22
  71. package/lib/internal/template/button-dropdown/tooltip.d.ts +2 -1
  72. package/lib/internal/template/button-dropdown/tooltip.d.ts.map +1 -1
  73. package/lib/internal/template/button-dropdown/tooltip.js +22 -14
  74. package/lib/internal/template/button-dropdown/tooltip.js.map +1 -1
  75. package/lib/internal/template/button-dropdown/utils/filter-items.d.ts +4 -0
  76. package/lib/internal/template/button-dropdown/utils/filter-items.d.ts.map +1 -0
  77. package/lib/internal/template/button-dropdown/utils/filter-items.js +55 -0
  78. package/lib/internal/template/button-dropdown/utils/filter-items.js.map +1 -0
  79. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +7 -1
  80. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
  81. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js +77 -13
  82. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
  83. package/lib/internal/template/code-editor/interfaces.js.map +1 -1
  84. package/lib/internal/template/error-boundary/internal.d.ts.map +1 -1
  85. package/lib/internal/template/error-boundary/internal.js +1 -0
  86. package/lib/internal/template/error-boundary/internal.js.map +1 -1
  87. package/lib/internal/template/help-panel/styles.css.js +6 -6
  88. package/lib/internal/template/help-panel/styles.scoped.css +69 -69
  89. package/lib/internal/template/help-panel/styles.selectors.js +6 -6
  90. package/lib/internal/template/icon/generated/icons.d.ts +1 -0
  91. package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
  92. package/lib/internal/template/icon/generated/icons.js +2 -0
  93. package/lib/internal/template/icon/generated/icons.js.map +1 -1
  94. package/lib/internal/template/icon-provider/interfaces.d.ts +1 -1
  95. package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
  96. package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
  97. package/lib/internal/template/internal/base-component/index.js +3 -3
  98. package/lib/internal/template/internal/base-component/index.js.map +1 -1
  99. package/lib/internal/template/internal/base-component/styles.scoped.css +33 -1
  100. package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
  101. package/lib/internal/template/internal/components/token-list/styles.scoped.css +24 -24
  102. package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
  103. package/lib/internal/template/internal/environment.js +2 -2
  104. package/lib/internal/template/internal/environment.json +2 -2
  105. package/lib/internal/template/internal/generated/styles/tokens.d.ts +140 -0
  106. package/lib/internal/template/internal/generated/styles/tokens.js +140 -0
  107. package/lib/internal/template/internal/generated/theming/index.cjs +2080 -20
  108. package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +45 -0
  109. package/lib/internal/template/internal/generated/theming/index.d.ts +45 -0
  110. package/lib/internal/template/internal/generated/theming/index.js +2080 -20
  111. package/lib/internal/template/internal/utils/external-props.js +7 -5
  112. package/lib/internal/template/internal/utils/external-props.js.map +1 -1
  113. package/lib/internal/template/item-card/internal.js +1 -1
  114. package/lib/internal/template/item-card/internal.js.map +1 -1
  115. package/lib/internal/template/link/styles.css.js +21 -21
  116. package/lib/internal/template/link/styles.scoped.css +86 -86
  117. package/lib/internal/template/link/styles.selectors.js +21 -21
  118. package/lib/internal/template/multiselect/embedded.d.ts +2 -2
  119. package/lib/internal/template/multiselect/internal.d.ts +1 -1
  120. package/lib/internal/template/pagination/internal.d.ts.map +1 -1
  121. package/lib/internal/template/pagination/internal.js +2 -2
  122. package/lib/internal/template/pagination/internal.js.map +1 -1
  123. package/lib/internal/template/select/parts/filter.d.ts +1 -1
  124. package/lib/internal/template/select/utils/connect-options.d.ts.map +1 -1
  125. package/lib/internal/template/select/utils/connect-options.js +11 -7
  126. package/lib/internal/template/select/utils/connect-options.js.map +1 -1
  127. package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
  128. package/lib/internal/template/select/utils/use-select.js +5 -4
  129. package/lib/internal/template/select/utils/use-select.js.map +1 -1
  130. package/lib/internal/template/side-navigation/parts.js +4 -3
  131. package/lib/internal/template/side-navigation/parts.js.map +1 -1
  132. package/lib/internal/template/side-navigation/styles.css.js +47 -46
  133. package/lib/internal/template/side-navigation/styles.scoped.css +76 -70
  134. package/lib/internal/template/side-navigation/styles.selectors.js +47 -46
  135. package/lib/internal/template/table/index.d.ts.map +1 -1
  136. package/lib/internal/template/table/index.js +5 -3
  137. package/lib/internal/template/table/index.js.map +1 -1
  138. package/lib/internal/template/test-utils/dom/action-card/index.d.ts +4 -2
  139. package/lib/internal/template/test-utils/dom/action-card/index.js +5 -3
  140. package/lib/internal/template/test-utils/dom/action-card/index.js.map +1 -1
  141. package/lib/internal/template/test-utils/dom/button-dropdown/index.d.ts +16 -0
  142. package/lib/internal/template/test-utils/dom/button-dropdown/index.js +24 -0
  143. package/lib/internal/template/test-utils/dom/button-dropdown/index.js.map +1 -1
  144. package/lib/internal/template/test-utils/dom/pagination/index.d.ts +9 -6
  145. package/lib/internal/template/test-utils/dom/pagination/index.js +15 -5
  146. package/lib/internal/template/test-utils/dom/pagination/index.js.map +1 -1
  147. package/lib/internal/template/test-utils/selectors/button-dropdown/index.d.ts +16 -0
  148. package/lib/internal/template/test-utils/selectors/button-dropdown/index.js +24 -0
  149. package/lib/internal/template/test-utils/selectors/button-dropdown/index.js.map +1 -1
  150. package/lib/internal/template/test-utils/selectors/pagination/index.d.ts +8 -6
  151. package/lib/internal/template/test-utils/selectors/pagination/index.js +9 -5
  152. package/lib/internal/template/test-utils/selectors/pagination/index.js.map +1 -1
  153. package/package.json +1 -1
@@ -142,7 +142,7 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_badge_1yjyg_zpkv4_145:not(#\9) {
145
+ .awsui_badge_1yjyg_10cmu_145:not(#\9) {
146
146
  border-collapse: separate;
147
147
  border-spacing: 0;
148
148
  box-sizing: border-box;
@@ -188,47 +188,47 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
188
188
  padding-inline: var(--space-xs-kw7k3v, 8px);
189
189
  color: var(--color-text-notification-default-fmebm4, #fafafa);
190
190
  }
191
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-grey_1yjyg_zpkv4_191:not(#\9) {
192
- background-color: var(--color-background-notification-grey-yzex9c, #545b64);
191
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-grey_1yjyg_10cmu_191:not(#\9) {
192
+ background-color: var(--color-background-badge-grey-0gre59, #545b64);
193
193
  border-color: var(--color-border-badge-grey-7x1xit, transparent);
194
194
  color: var(--color-text-badge-grey-5hljh0, #fafafa);
195
195
  }
196
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-green_1yjyg_zpkv4_196:not(#\9) {
197
- background-color: var(--color-background-notification-green-7yuv70, #1d8102);
196
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-green_1yjyg_10cmu_196:not(#\9) {
197
+ background-color: var(--color-background-badge-green-aahq3n, #1d8102);
198
198
  border-color: var(--color-border-badge-green-t7n2iz, transparent);
199
199
  color: var(--color-text-badge-green-i688l8, #fafafa);
200
200
  }
201
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-blue_1yjyg_zpkv4_201:not(#\9) {
202
- background-color: var(--color-background-notification-blue-jgc5fr, #0073bb);
201
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-blue_1yjyg_10cmu_201:not(#\9) {
202
+ background-color: var(--color-background-badge-blue-89he01, #0073bb);
203
203
  border-color: var(--color-border-badge-blue-p28tag, transparent);
204
204
  color: var(--color-text-badge-blue-pfnjhv, #fafafa);
205
205
  }
206
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-red_1yjyg_zpkv4_206:not(#\9) {
207
- background-color: var(--color-background-notification-red-k51keq, #d13212);
206
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-red_1yjyg_10cmu_206:not(#\9) {
207
+ background-color: var(--color-background-badge-red-lfiebe, #d13212);
208
208
  border-color: var(--color-border-badge-red-w6mok2, transparent);
209
209
  color: var(--color-text-badge-red-e7xtdk, #fafafa);
210
210
  }
211
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-severity-critical_1yjyg_zpkv4_211:not(#\9) {
211
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-severity-critical_1yjyg_10cmu_211:not(#\9) {
212
212
  background-color: var(--color-background-notification-severity-critical-gsxtat, #870303);
213
213
  color: var(--color-text-badge-severity-critical-9m2t9l, #fafafa);
214
214
  border-color: var(--color-border-badge-severity-critical-afw1t4, transparent);
215
215
  }
216
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-severity-high_1yjyg_zpkv4_216:not(#\9) {
216
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-severity-high_1yjyg_10cmu_216:not(#\9) {
217
217
  background-color: var(--color-background-notification-severity-high-hz1dy0, #ce3311);
218
218
  color: var(--color-text-badge-severity-high-yhnb3j, #fafafa);
219
219
  border-color: var(--color-border-badge-severity-high-xpyb3z, transparent);
220
220
  }
221
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-severity-medium_1yjyg_zpkv4_221:not(#\9) {
221
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-severity-medium_1yjyg_10cmu_221:not(#\9) {
222
222
  background-color: var(--color-background-notification-severity-medium-f2pwwo, #f89256);
223
223
  color: var(--color-text-badge-severity-medium-seazfm, #000000);
224
224
  border-color: var(--color-border-badge-severity-medium-lglq87, transparent);
225
225
  }
226
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-severity-low_1yjyg_zpkv4_226:not(#\9) {
226
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-severity-low_1yjyg_10cmu_226:not(#\9) {
227
227
  background-color: var(--color-background-notification-severity-low-11rcv3, #f2cd54);
228
228
  color: var(--color-text-badge-severity-low-ixtax4, #16191f);
229
229
  border-color: var(--color-border-badge-severity-low-w6znea, transparent);
230
230
  }
231
- .awsui_badge_1yjyg_zpkv4_145.awsui_badge-color-severity-neutral_1yjyg_zpkv4_231:not(#\9) {
231
+ .awsui_badge_1yjyg_10cmu_145.awsui_badge-color-severity-neutral_1yjyg_10cmu_231:not(#\9) {
232
232
  background-color: var(--color-background-notification-severity-neutral-1tqomh, #687078);
233
233
  color: var(--color-text-badge-severity-neutral-vfdy0w, #fafafa);
234
234
  border-color: var(--color-border-badge-severity-neutral-kdj4l5, transparent);
@@ -2,15 +2,15 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "badge": "awsui_badge_1yjyg_zpkv4_145",
6
- "badge-color-grey": "awsui_badge-color-grey_1yjyg_zpkv4_191",
7
- "badge-color-green": "awsui_badge-color-green_1yjyg_zpkv4_196",
8
- "badge-color-blue": "awsui_badge-color-blue_1yjyg_zpkv4_201",
9
- "badge-color-red": "awsui_badge-color-red_1yjyg_zpkv4_206",
10
- "badge-color-severity-critical": "awsui_badge-color-severity-critical_1yjyg_zpkv4_211",
11
- "badge-color-severity-high": "awsui_badge-color-severity-high_1yjyg_zpkv4_216",
12
- "badge-color-severity-medium": "awsui_badge-color-severity-medium_1yjyg_zpkv4_221",
13
- "badge-color-severity-low": "awsui_badge-color-severity-low_1yjyg_zpkv4_226",
14
- "badge-color-severity-neutral": "awsui_badge-color-severity-neutral_1yjyg_zpkv4_231"
5
+ "badge": "awsui_badge_1yjyg_10cmu_145",
6
+ "badge-color-grey": "awsui_badge-color-grey_1yjyg_10cmu_191",
7
+ "badge-color-green": "awsui_badge-color-green_1yjyg_10cmu_196",
8
+ "badge-color-blue": "awsui_badge-color-blue_1yjyg_10cmu_201",
9
+ "badge-color-red": "awsui_badge-color-red_1yjyg_10cmu_206",
10
+ "badge-color-severity-critical": "awsui_badge-color-severity-critical_1yjyg_10cmu_211",
11
+ "badge-color-severity-high": "awsui_badge-color-severity-high_1yjyg_10cmu_216",
12
+ "badge-color-severity-medium": "awsui_badge-color-severity-medium_1yjyg_10cmu_221",
13
+ "badge-color-severity-low": "awsui_badge-color-severity-low_1yjyg_10cmu_226",
14
+ "badge-color-severity-neutral": "awsui_badge-color-severity-neutral_1yjyg_10cmu_231"
15
15
  };
16
16
 
@@ -20,6 +20,29 @@ export interface BoxProps extends BaseComponentProps {
20
20
  * Override the HTML tag by using property `tagOverride`.
21
21
  */
22
22
  variant?: BoxProps.Variant;
23
+ /**
24
+ * Renders the box as a visual accent wrapper to emphasize its content.
25
+ *
26
+ * Setting this property activates the accent styling: a coordinated background and content
27
+ * color combination that works in both light and dark modes. A `variant` is not required to
28
+ * activate the accent. The accent styling is applied on top of the element determined by
29
+ * `variant` (or `tagOverride`), so the rendered HTML tag is unaffected.
30
+ *
31
+ * The object accepts the following fields:
32
+ * - `color` (required) — the coordinated background and foreground color pair. The foreground
33
+ * color is applied as the wrapper's CSS `color`, so it only affects content that inherits
34
+ * the current color (for example an `Icon`, or a nested `Box` with `color="inherit"`).
35
+ * Content that sets its own color is not overridden.
36
+ * - `aspectRatio` — `auto` (default) lets the wrapper's width follow its content;
37
+ * `equal` forces equal width and height, suitable for wrapping icons.
38
+ * - `borderRadius` — the corner rounding applied to the wrapper, using a t-shirt size keyword
39
+ * from the Box spacing scale (`xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`), or
40
+ * `full` for fully rounded corners. When not set, the wrapper has no border radius. Set it to
41
+ * `full` together with `aspectRatio: 'equal'` to render a circle.
42
+ *
43
+ * Composes with existing Box props such as `padding` and `margin`.
44
+ */
45
+ visualAccent?: BoxProps.VisualAccent;
23
46
  /**
24
47
  * Overrides the default HTML tag provided by the variant.
25
48
  */
@@ -133,6 +156,42 @@ export interface BoxProps extends BaseComponentProps {
133
156
  }
134
157
  export declare namespace BoxProps {
135
158
  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' | 'awsui-inline-code';
159
+ interface VisualAccent {
160
+ /**
161
+ * The coordinated background and foreground color pair applied to the accent wrapper.
162
+ * Each color works in both light and dark modes.
163
+ *
164
+ * The background color is applied directly to the wrapper. The foreground color is applied
165
+ * as the wrapper's CSS `color` and is therefore only picked up by content that inherits the
166
+ * current color, such as an `Icon` or a nested `Box` with `color="inherit"`. Content that
167
+ * defines its own color (for example a `Box` with an explicit `color`, or a `Link`) keeps that
168
+ * color and is not recolored by the accent.
169
+ */
170
+ color: BoxProps.VisualAccent.Color;
171
+ /**
172
+ * Controls the aspect ratio of the accent wrapper.
173
+ *
174
+ * - `auto` (default) — the wrapper's width follows its content.
175
+ * - `equal` — the wrapper has equal width and height, suitable for wrapping icons.
176
+ *
177
+ * Combine `aspectRatio: 'equal'` with `borderRadius: 'full'` to render a circle.
178
+ */
179
+ aspectRatio?: BoxProps.VisualAccent.AspectRatio;
180
+ /**
181
+ * The corner rounding applied to the accent wrapper. When not set, the wrapper has no
182
+ * border radius.
183
+ *
184
+ * Use one of the curated t-shirt size keywords, which map to the same spacing scale used by
185
+ * `padding` and `margin`: `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, or `xxxl`. Use
186
+ * `full` for fully rounded corners; combine it with `aspectRatio: 'equal'` to render a circle.
187
+ */
188
+ borderRadius?: BoxProps.VisualAccent.BorderRadius;
189
+ }
190
+ namespace VisualAccent {
191
+ type Color = 'red' | 'yellow' | 'indigo' | 'green' | 'orange' | 'purple' | 'mint' | 'lime' | 'grey' | 'teal' | 'cyan' | 'blue' | 'violet' | 'fuchsia' | 'magenta' | 'pink' | 'rose' | 'amber';
192
+ type AspectRatio = 'auto' | 'equal';
193
+ type BorderRadius = 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' | 'full';
194
+ }
136
195
  type Display = 'block' | 'inline' | 'inline-block' | 'none';
137
196
  type TextAlign = 'left' | 'center' | 'right';
138
197
  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,yBAAyB,CAAC;AAC7D;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,QAAS,SAAQ,kBAAkB;IAClD;;;;;;;;;;;;;;OAcG;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,C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appings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../types/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\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 * - If you set it to `awsui-inline-code`, the component will render a `code` element,\n * styled with a background and padding for inline code snippets.\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 /**\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 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 | 'awsui-inline-code';\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 | 'display-xl';\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 '../types/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\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 * - If you set it to `awsui-inline-code`, the component will render a `code` element,\n * styled with a background and padding for inline code snippets.\n *\n * Override the HTML tag by using property `tagOverride`.\n */\n variant?: BoxProps.Variant;\n /**\n * Renders the box as a visual accent wrapper to emphasize its content.\n *\n * Setting this property activates the accent styling: a coordinated background and content\n * color combination that works in both light and dark modes. A `variant` is not required to\n * activate the accent. The accent styling is applied on top of the element determined by\n * `variant` (or `tagOverride`), so the rendered HTML tag is unaffected.\n *\n * The object accepts the following fields:\n * - `color` (required) — the coordinated background and foreground color pair. The foreground\n * color is applied as the wrapper's CSS `color`, so it only affects content that inherits\n * the current color (for example an `Icon`, or a nested `Box` with `color=\"inherit\"`).\n * Content that sets its own color is not overridden.\n * - `aspectRatio` — `auto` (default) lets the wrapper's width follow its content;\n * `equal` forces equal width and height, suitable for wrapping icons.\n * - `borderRadius` — the corner rounding applied to the wrapper, using a t-shirt size keyword\n * from the Box spacing scale (`xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, `xxxl`), or\n * `full` for fully rounded corners. When not set, the wrapper has no border radius. Set it to\n * `full` together with `aspectRatio: 'equal'` to render a circle.\n *\n * Composes with existing Box props such as `padding` and `margin`.\n */\n visualAccent?: BoxProps.VisualAccent;\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 /**\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 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 | 'awsui-inline-code';\n\n export interface VisualAccent {\n /**\n * The coordinated background and foreground color pair applied to the accent wrapper.\n * Each color works in both light and dark modes.\n *\n * The background color is applied directly to the wrapper. The foreground color is applied\n * as the wrapper's CSS `color` and is therefore only picked up by content that inherits the\n * current color, such as an `Icon` or a nested `Box` with `color=\"inherit\"`. Content that\n * defines its own color (for example a `Box` with an explicit `color`, or a `Link`) keeps that\n * color and is not recolored by the accent.\n */\n color: BoxProps.VisualAccent.Color;\n /**\n * Controls the aspect ratio of the accent wrapper.\n *\n * - `auto` (default) — the wrapper's width follows its content.\n * - `equal` — the wrapper has equal width and height, suitable for wrapping icons.\n *\n * Combine `aspectRatio: 'equal'` with `borderRadius: 'full'` to render a circle.\n */\n aspectRatio?: BoxProps.VisualAccent.AspectRatio;\n /**\n * The corner rounding applied to the accent wrapper. When not set, the wrapper has no\n * border radius.\n *\n * Use one of the curated t-shirt size keywords, which map to the same spacing scale used by\n * `padding` and `margin`: `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`, or `xxxl`. Use\n * `full` for fully rounded corners; combine it with `aspectRatio: 'equal'` to render a circle.\n */\n borderRadius?: BoxProps.VisualAccent.BorderRadius;\n }\n\n export namespace VisualAccent {\n export type Color =\n | 'red'\n | 'yellow'\n | 'indigo'\n | 'green'\n | 'orange'\n | 'purple'\n | 'mint'\n | 'lime'\n | 'grey'\n | 'teal'\n | 'cyan'\n | 'blue'\n | 'violet'\n | 'fuchsia'\n | 'magenta'\n | 'pink'\n | 'rose'\n | 'amber';\n export type AspectRatio = 'auto' | 'equal';\n export type BorderRadius = 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' | 'full';\n }\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 | 'display-xl';\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,6 +1,6 @@
1
1
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
2
  import { BoxProps } from './interfaces';
3
3
  type InternalBoxProps = BoxProps & InternalBaseComponentProps;
4
- export default function InternalBox({ variant, tagOverride, margin, padding, display, textAlign, float, fontSize, fontWeight, color, children, nativeAttributes, __internalRootRef, ...props }: InternalBoxProps): JSX.Element;
4
+ export default function InternalBox({ variant, tagOverride, margin, padding, display, textAlign, float, fontSize, fontWeight, color, visualAccent, children, nativeAttributes, __internalRootRef, ...props }: InternalBoxProps): JSX.Element;
5
5
  export {};
6
6
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/box/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,KAAK,gBAAgB,GAAG,QAAQ,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAe,EACf,WAAW,EACX,MAAW,EACX,OAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,gBAAgB,eAoClB"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/box/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,KAAK,gBAAgB,GAAG,QAAQ,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAe,EACf,WAAW,EACX,MAAW,EACX,OAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,gBAAgB,eA0ClB"}
@@ -5,11 +5,13 @@ import clsx from 'clsx';
5
5
  import { getBaseProps } from '../internal/base-component';
6
6
  import WithNativeAttributes from '../internal/utils/with-native-attributes';
7
7
  import styles from './styles.css.js';
8
- export default function InternalBox({ variant = 'div', tagOverride, margin = {}, padding = {}, display, textAlign, float, fontSize, fontWeight, color, children, nativeAttributes, __internalRootRef, ...props }) {
8
+ export default function InternalBox({ variant = 'div', tagOverride, margin = {}, padding = {}, display, textAlign, float, fontSize, fontWeight, color, visualAccent, children, nativeAttributes, __internalRootRef, ...props }) {
9
+ var _a;
9
10
  const baseProps = getBaseProps(props);
10
11
  const marginsClassNamesSuffices = getClassNamesSuffixes(margin);
11
12
  const paddingsClassNamesSuffices = getClassNamesSuffixes(padding);
12
- const className = clsx(baseProps.className, styles.root, styles.box, styles[`${variant.replace(/^awsui-/, '')}-variant`], marginsClassNamesSuffices.map(suffix => styles[`m-${suffix}`]), paddingsClassNamesSuffices.map(suffix => styles[`p-${suffix}`]), styles[`d-${display}`], styles[`f-${float}`], styles[`color-${color || 'default'}`], styles[`font-size-${fontSize || 'default'}`], styles[`font-weight-${fontWeight || 'default'}`], styles[`t-${textAlign}`]);
13
+ const accentAspectRatio = (_a = visualAccent === null || visualAccent === void 0 ? void 0 : visualAccent.aspectRatio) !== null && _a !== void 0 ? _a : 'auto';
14
+ const className = clsx(baseProps.className, styles.root, styles.box, styles[`${variant.replace(/^awsui-/, '')}-variant`], visualAccent && styles['visual-accent'], visualAccent && styles[`visual-accent-${visualAccent.color}`], visualAccent && styles[`visual-accent-aspect-${accentAspectRatio}`], (visualAccent === null || visualAccent === void 0 ? void 0 : visualAccent.borderRadius) && styles[`visual-accent-radius-${visualAccent.borderRadius}`], marginsClassNamesSuffices.map(suffix => styles[`m-${suffix}`]), paddingsClassNamesSuffices.map(suffix => styles[`p-${suffix}`]), styles[`d-${display}`], styles[`f-${float}`], styles[`color-${color || 'default'}`], styles[`font-size-${fontSize || 'default'}`], styles[`font-weight-${fontWeight || 'default'}`], styles[`t-${textAlign}`]);
13
15
  // allow auto-focusing of h1 boxes from flashbar
14
16
  const tabindex = variant === 'h1' ? -1 : undefined;
15
17
  return (React.createElement(WithNativeAttributes, { ...baseProps, tag: getTag(variant, tagOverride), componentName: "Box", tabIndex: tabindex, nativeAttributes: nativeAttributes, className: className, ref: __internalRootRef }, children));
@@ -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,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,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,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,KAAK,EACS;IACjB,MAAM,SAAS,G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MAAM,qBAAqB,GAAG,CAAC,KAA8C,EAAE,EAAE;IAC/E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;IACpF,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,OAAyB,EAAE,WAAoC,EAAE,EAAE;IACjF,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,KAAK,mBAAmB,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,IAAI,OAAO,KAAK,oBAAoB,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,mBAAmB,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;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 clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport { BoxProps } from './interfaces';\n\nimport styles from './styles.css.js';\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 nativeAttributes,\n __internalRootRef,\n ...props\n}: InternalBoxProps) {\n const baseProps = getBaseProps(props);\n const marginsClassNamesSuffices = getClassNamesSuffixes(margin);\n const paddingsClassNamesSuffices = getClassNamesSuffixes(padding);\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 // allow auto-focusing of h1 boxes from flashbar\n const tabindex = variant === 'h1' ? -1 : undefined;\n\n return (\n <WithNativeAttributes\n {...baseProps}\n tag={getTag(variant, tagOverride)}\n componentName=\"Box\"\n tabIndex={tabindex}\n nativeAttributes={nativeAttributes}\n className={className}\n ref={__internalRootRef}\n >\n {children}\n </WithNativeAttributes>\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 if (variant === 'awsui-inline-code') {\n return 'code';\n }\n\n return variant;\n};\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/box/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,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C,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,OAAyB,EAAE,WAAoC,EAAE,EAAE;IACjF,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,KAAK,mBAAmB,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,IAAI,OAAO,KAAK,oBAAoB,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,mBAAmB,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;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 clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport { BoxProps } from './interfaces';\n\nimport styles from './styles.css.js';\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 visualAccent,\n children,\n nativeAttributes,\n __internalRootRef,\n ...props\n}: InternalBoxProps) {\n const baseProps = getBaseProps(props);\n const marginsClassNamesSuffices = getClassNamesSuffixes(margin);\n const paddingsClassNamesSuffices = getClassNamesSuffixes(padding);\n\n const accentAspectRatio = visualAccent?.aspectRatio ?? 'auto';\n\n const className = clsx(\n baseProps.className,\n styles.root,\n styles.box,\n styles[`${variant.replace(/^awsui-/, '')}-variant`],\n visualAccent && styles['visual-accent'],\n visualAccent && styles[`visual-accent-${visualAccent.color}`],\n visualAccent && styles[`visual-accent-aspect-${accentAspectRatio}`],\n visualAccent?.borderRadius && styles[`visual-accent-radius-${visualAccent.borderRadius}`],\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 // allow auto-focusing of h1 boxes from flashbar\n const tabindex = variant === 'h1' ? -1 : undefined;\n\n return (\n <WithNativeAttributes\n {...baseProps}\n tag={getTag(variant, tagOverride)}\n componentName=\"Box\"\n tabIndex={tabindex}\n nativeAttributes={nativeAttributes}\n className={className}\n ref={__internalRootRef}\n >\n {children}\n </WithNativeAttributes>\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 if (variant === 'awsui-inline-code') {\n return 'code';\n }\n\n return variant;\n};\n"]}