@cloudscape-design/components 3.0.1071 → 3.0.1072

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 (117) hide show
  1. package/alert/styles.css.js +27 -27
  2. package/alert/styles.scoped.css +46 -46
  3. package/alert/styles.selectors.js +27 -27
  4. package/annotation-context/annotation/styles.css.js +24 -24
  5. package/annotation-context/annotation/styles.scoped.css +32 -32
  6. package/annotation-context/annotation/styles.selectors.js +24 -24
  7. package/app-layout/notifications/styles.css.js +3 -3
  8. package/app-layout/notifications/styles.scoped.css +7 -7
  9. package/app-layout/notifications/styles.selectors.js +3 -3
  10. package/app-layout/visual-refresh/styles.css.js +86 -86
  11. package/app-layout/visual-refresh/styles.scoped.css +258 -258
  12. package/app-layout/visual-refresh/styles.selectors.js +86 -86
  13. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +17 -17
  14. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +39 -39
  15. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +17 -17
  16. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
  17. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
  18. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
  19. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +23 -23
  20. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +46 -46
  21. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +23 -23
  22. package/attribute-editor/styles.css.js +15 -15
  23. package/attribute-editor/styles.scoped.css +28 -28
  24. package/attribute-editor/styles.selectors.js +15 -15
  25. package/breadcrumb-group/item/styles.css.js +7 -7
  26. package/breadcrumb-group/item/styles.scoped.css +28 -28
  27. package/breadcrumb-group/item/styles.selectors.js +7 -7
  28. package/button/styles.css.js +22 -22
  29. package/button/styles.scoped.css +212 -212
  30. package/button/styles.selectors.js +22 -22
  31. package/button-dropdown/item-element/styles.css.js +16 -16
  32. package/button-dropdown/item-element/styles.scoped.css +27 -27
  33. package/button-dropdown/item-element/styles.selectors.js +16 -16
  34. package/button-group/index.d.ts.map +1 -1
  35. package/button-group/index.js +11 -44
  36. package/button-group/interfaces.d.ts +41 -1
  37. package/button-group/interfaces.d.ts.map +1 -1
  38. package/button-group/interfaces.js.map +1 -1
  39. package/button-group/internal-do-not-use-core.js +51 -0
  40. package/button-group/internal-do-not-use-core.js.map +1 -0
  41. package/button-group/internal.d.ts.map +1 -1
  42. package/button-group/internal.js +5 -3
  43. package/button-group/internal.js.map +1 -1
  44. package/button-group/item-element.d.ts +1 -0
  45. package/button-group/item-element.d.ts.map +1 -1
  46. package/button-group/item-element.js +4 -2
  47. package/button-group/item-element.js.map +1 -1
  48. package/button-group/style.d.ts +12 -0
  49. package/button-group/style.d.ts.map +1 -0
  50. package/button-group/style.js +37 -0
  51. package/button-group/style.js.map +1 -0
  52. package/checkbox/styles.css.js +3 -3
  53. package/checkbox/styles.scoped.css +11 -11
  54. package/checkbox/styles.selectors.js +3 -3
  55. package/content-layout/styles.css.js +14 -14
  56. package/content-layout/styles.scoped.css +27 -27
  57. package/content-layout/styles.selectors.js +14 -14
  58. package/flashbar/collapsible-flashbar.d.ts.map +1 -1
  59. package/flashbar/collapsible-flashbar.js +3 -5
  60. package/flashbar/collapsible-flashbar.js.map +1 -1
  61. package/flashbar/common.d.ts.map +1 -1
  62. package/flashbar/common.js +2 -5
  63. package/flashbar/common.js.map +1 -1
  64. package/flashbar/flash.d.ts +1 -1
  65. package/flashbar/flash.d.ts.map +1 -1
  66. package/flashbar/flash.js +4 -2
  67. package/flashbar/flash.js.map +1 -1
  68. package/flashbar/styles.css.js +50 -50
  69. package/flashbar/styles.scoped.css +187 -187
  70. package/flashbar/styles.selectors.js +50 -50
  71. package/flashbar/utils.d.ts +1 -1
  72. package/flashbar/utils.d.ts.map +1 -1
  73. package/flashbar/utils.js +1 -1
  74. package/flashbar/utils.js.map +1 -1
  75. package/help-panel/styles.css.js +6 -6
  76. package/help-panel/styles.scoped.css +73 -73
  77. package/help-panel/styles.selectors.js +6 -6
  78. package/internal/base-component/styles.scoped.css +1 -1
  79. package/internal/components/drag-handle-wrapper/styles.css.js +21 -21
  80. package/internal/components/drag-handle-wrapper/styles.scoped.css +44 -44
  81. package/internal/components/drag-handle-wrapper/styles.selectors.js +21 -21
  82. package/internal/components/dropdown/styles.css.js +20 -20
  83. package/internal/components/dropdown/styles.scoped.css +38 -38
  84. package/internal/components/dropdown/styles.selectors.js +20 -20
  85. package/internal/components/token-list/styles.css.js +10 -10
  86. package/internal/components/token-list/styles.scoped.css +25 -25
  87. package/internal/components/token-list/styles.selectors.js +10 -10
  88. package/internal/environment.js +2 -2
  89. package/internal/environment.json +2 -2
  90. package/internal/generated/custom-css-properties/index.d.ts +4 -0
  91. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  92. package/internal/generated/custom-css-properties/index.js +83 -79
  93. package/internal/generated/custom-css-properties/index.js.map +1 -1
  94. package/internal/manifest.json +1 -1
  95. package/link/styles.css.js +20 -20
  96. package/link/styles.scoped.css +103 -103
  97. package/link/styles.selectors.js +20 -20
  98. package/package.json +1 -1
  99. package/radio-group/styles.css.js +10 -10
  100. package/radio-group/styles.scoped.css +22 -22
  101. package/radio-group/styles.selectors.js +10 -10
  102. package/slider/styles.css.js +26 -26
  103. package/slider/styles.scoped.css +86 -86
  104. package/slider/styles.selectors.js +26 -26
  105. package/spinner/styles.css.js +13 -13
  106. package/spinner/styles.scoped.css +39 -39
  107. package/spinner/styles.selectors.js +13 -13
  108. package/tag-editor/styles.css.js +3 -3
  109. package/tag-editor/styles.scoped.css +13 -13
  110. package/tag-editor/styles.selectors.js +3 -3
  111. package/text-content/styles.css.js +1 -1
  112. package/text-content/styles.scoped.css +66 -66
  113. package/text-content/styles.selectors.js +1 -1
  114. package/toggle/styles.css.js +10 -10
  115. package/toggle/styles.scoped.css +23 -23
  116. package/toggle/styles.selectors.js +10 -10
  117. package/button-group/index.js.map +0 -1
@@ -2,27 +2,27 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "content": "awsui_content_vjswe_18qm7_153",
6
- "button": "awsui_button_vjswe_18qm7_157",
7
- "variant-normal": "awsui_variant-normal_vjswe_18qm7_206",
8
- "disabled": "awsui_disabled_vjswe_18qm7_224",
9
- "variant-primary": "awsui_variant-primary_vjswe_18qm7_231",
10
- "variant-link": "awsui_variant-link_vjswe_18qm7_256",
11
- "variant-icon": "awsui_variant-icon_vjswe_18qm7_281",
12
- "variant-inline-icon": "awsui_variant-inline-icon_vjswe_18qm7_306",
13
- "variant-inline-icon-pointer-target": "awsui_variant-inline-icon-pointer-target_vjswe_18qm7_331",
14
- "variant-inline-link": "awsui_variant-inline-link_vjswe_18qm7_356",
15
- "variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_18qm7_385",
16
- "variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_18qm7_410",
17
- "variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_18qm7_435",
18
- "variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_18qm7_465",
19
- "button-no-text": "awsui_button-no-text_vjswe_18qm7_557",
20
- "button-no-wrap": "awsui_button-no-wrap_vjswe_18qm7_561",
21
- "full-width": "awsui_full-width_vjswe_18qm7_564",
22
- "icon-left": "awsui_icon-left_vjswe_18qm7_586",
23
- "icon-right": "awsui_icon-right_vjswe_18qm7_591",
24
- "icon": "awsui_icon_vjswe_18qm7_586",
25
- "link": "awsui_link_vjswe_18qm7_610",
26
- "disabled-with-reason": "awsui_disabled-with-reason_vjswe_18qm7_610"
5
+ "content": "awsui_content_vjswe_fqla2_153",
6
+ "button": "awsui_button_vjswe_fqla2_157",
7
+ "variant-normal": "awsui_variant-normal_vjswe_fqla2_206",
8
+ "disabled": "awsui_disabled_vjswe_fqla2_224",
9
+ "variant-primary": "awsui_variant-primary_vjswe_fqla2_231",
10
+ "variant-link": "awsui_variant-link_vjswe_fqla2_256",
11
+ "variant-icon": "awsui_variant-icon_vjswe_fqla2_281",
12
+ "variant-inline-icon": "awsui_variant-inline-icon_vjswe_fqla2_306",
13
+ "variant-inline-icon-pointer-target": "awsui_variant-inline-icon-pointer-target_vjswe_fqla2_331",
14
+ "variant-inline-link": "awsui_variant-inline-link_vjswe_fqla2_356",
15
+ "variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_fqla2_385",
16
+ "variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_fqla2_410",
17
+ "variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_fqla2_435",
18
+ "variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_fqla2_465",
19
+ "button-no-text": "awsui_button-no-text_vjswe_fqla2_557",
20
+ "button-no-wrap": "awsui_button-no-wrap_vjswe_fqla2_561",
21
+ "full-width": "awsui_full-width_vjswe_fqla2_564",
22
+ "icon-left": "awsui_icon-left_vjswe_fqla2_586",
23
+ "icon-right": "awsui_icon-right_vjswe_fqla2_591",
24
+ "icon": "awsui_icon_vjswe_fqla2_586",
25
+ "link": "awsui_link_vjswe_fqla2_610",
26
+ "disabled-with-reason": "awsui_disabled-with-reason_vjswe_fqla2_610"
27
27
  };
28
28
 
@@ -1,21 +1,21 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "item-element": "awsui_item-element_93a1u_1j433_145",
5
- "disabled": "awsui_disabled_93a1u_1j433_157",
6
- "show-divider": "awsui_show-divider_93a1u_1j433_164",
7
- "highlighted": "awsui_highlighted_93a1u_1j433_167",
8
- "is-focused": "awsui_is-focused_93a1u_1j433_182",
9
- "visual-refresh": "awsui_visual-refresh_93a1u_1j433_185",
10
- "menu-item": "awsui_menu-item_93a1u_1j433_189",
11
- "link-style": "awsui_link-style_93a1u_1j433_201",
12
- "current-breadcrumb": "awsui_current-breadcrumb_93a1u_1j433_237",
13
- "link-style-highlighted": "awsui_link-style-highlighted_93a1u_1j433_245",
14
- "has-category-header": "awsui_has-category-header_93a1u_1j433_251",
15
- "item-tooltip-wrapper": "awsui_item-tooltip-wrapper_93a1u_1j433_251",
16
- "has-checkmark": "awsui_has-checkmark_93a1u_1j433_251",
17
- "icon": "awsui_icon_93a1u_1j433_255",
18
- "checkmark": "awsui_checkmark_93a1u_1j433_259",
19
- "external-icon": "awsui_external-icon_93a1u_1j433_266"
4
+ "item-element": "awsui_item-element_93a1u_j1gnt_145",
5
+ "disabled": "awsui_disabled_93a1u_j1gnt_157",
6
+ "show-divider": "awsui_show-divider_93a1u_j1gnt_164",
7
+ "highlighted": "awsui_highlighted_93a1u_j1gnt_167",
8
+ "is-focused": "awsui_is-focused_93a1u_j1gnt_182",
9
+ "visual-refresh": "awsui_visual-refresh_93a1u_j1gnt_185",
10
+ "menu-item": "awsui_menu-item_93a1u_j1gnt_189",
11
+ "link-style": "awsui_link-style_93a1u_j1gnt_201",
12
+ "current-breadcrumb": "awsui_current-breadcrumb_93a1u_j1gnt_237",
13
+ "link-style-highlighted": "awsui_link-style-highlighted_93a1u_j1gnt_245",
14
+ "has-category-header": "awsui_has-category-header_93a1u_j1gnt_251",
15
+ "item-tooltip-wrapper": "awsui_item-tooltip-wrapper_93a1u_j1gnt_251",
16
+ "has-checkmark": "awsui_has-checkmark_93a1u_j1gnt_251",
17
+ "icon": "awsui_icon_93a1u_j1gnt_255",
18
+ "checkmark": "awsui_checkmark_93a1u_j1gnt_259",
19
+ "external-icon": "awsui_external-icon_93a1u_j1gnt_266"
20
20
  };
21
21
 
@@ -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_item-element_93a1u_1j433_145:not(#\9) {
145
+ .awsui_item-element_93a1u_j1gnt_145:not(#\9) {
146
146
  position: relative;
147
147
  z-index: 1;
148
148
  border-block: var(--border-item-width-miijiw, 2px) solid transparent;
@@ -154,17 +154,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
154
154
  margin-block-start: calc(-1 * var(--border-width-dropdown-youcay, 2px));
155
155
  cursor: pointer;
156
156
  }
157
- .awsui_item-element_93a1u_1j433_145.awsui_disabled_93a1u_1j433_157:not(#\9) {
157
+ .awsui_item-element_93a1u_j1gnt_145.awsui_disabled_93a1u_j1gnt_157:not(#\9) {
158
158
  cursor: default;
159
159
  color: var(--color-text-dropdown-item-disabled-8m65hf, #b4b4bb);
160
160
  }
161
- .awsui_item-element_93a1u_1j433_145:not(#\9):first-child {
161
+ .awsui_item-element_93a1u_j1gnt_145:not(#\9):first-child {
162
162
  margin-block-start: 0;
163
163
  }
164
- .awsui_item-element_93a1u_1j433_145.awsui_show-divider_93a1u_1j433_164:not(#\9) {
164
+ .awsui_item-element_93a1u_j1gnt_145.awsui_show-divider_93a1u_j1gnt_164:not(#\9) {
165
165
  border-block-end: var(--border-item-width-miijiw, 2px) solid var(--color-border-dropdown-group-ylcnh8, #c6c6cd);
166
166
  }
167
- .awsui_item-element_93a1u_1j433_145.awsui_highlighted_93a1u_1j433_167:not(#\9) {
167
+ .awsui_item-element_93a1u_j1gnt_145.awsui_highlighted_93a1u_j1gnt_167:not(#\9) {
168
168
  color: var(--color-text-dropdown-item-highlighted-yr1px8, #0f141a);
169
169
  z-index: 2;
170
170
  background-color: var(--color-background-dropdown-item-hover-yunepc, #f3f3f7);
@@ -174,19 +174,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
174
174
  border-end-start-radius: var(--border-radius-item-iwaia5, 8px);
175
175
  border-end-end-radius: var(--border-radius-item-iwaia5, 8px);
176
176
  }
177
- .awsui_item-element_93a1u_1j433_145.awsui_highlighted_93a1u_1j433_167.awsui_disabled_93a1u_1j433_157:not(#\9) {
177
+ .awsui_item-element_93a1u_j1gnt_145.awsui_highlighted_93a1u_j1gnt_167.awsui_disabled_93a1u_j1gnt_157:not(#\9) {
178
178
  color: var(--color-text-dropdown-item-dimmed-tq8vh3, #b4b4bb);
179
179
  border-color: var(--color-border-dropdown-item-dimmed-hover-ga9sch, #8c8c94);
180
180
  background-color: var(--color-background-dropdown-item-dimmed-dhho03, transparent);
181
181
  }
182
- .awsui_item-element_93a1u_1j433_145.awsui_highlighted_93a1u_1j433_167.awsui_is-focused_93a1u_1j433_182:not(#\9) {
182
+ .awsui_item-element_93a1u_j1gnt_145.awsui_highlighted_93a1u_j1gnt_167.awsui_is-focused_93a1u_j1gnt_182:not(#\9) {
183
183
  border-color: var(--color-border-dropdown-item-focused-zacqlp, #424650);
184
184
  }
185
- .awsui_item-element_93a1u_1j433_145.awsui_highlighted_93a1u_1j433_167.awsui_is-focused_93a1u_1j433_182:not(#\9):not(.awsui_visual-refresh_93a1u_1j433_185) {
185
+ .awsui_item-element_93a1u_j1gnt_145.awsui_highlighted_93a1u_j1gnt_167.awsui_is-focused_93a1u_j1gnt_182:not(#\9):not(.awsui_visual-refresh_93a1u_j1gnt_185) {
186
186
  box-shadow: inset 0 0 0 var(--border-control-focus-ring-shadow-spread-9mjajk, 1px) var(--color-border-item-focused-uk47pl, #006ce0);
187
187
  }
188
188
 
189
- .awsui_menu-item_93a1u_1j433_189:not(#\9) {
189
+ .awsui_menu-item_93a1u_j1gnt_189:not(#\9) {
190
190
  min-inline-size: 0;
191
191
  word-break: break-word;
192
192
  display: flex;
@@ -198,11 +198,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
198
198
  /* stylelint-disable selector-max-type */
199
199
  /* stylelint-enable selector-max-type */
200
200
  }
201
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9) {
201
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9) {
202
202
  padding-block-end: calc(var(--space-xxs-hwfkai, 4px) + var(--space-xxxs-pajhad, 2px));
203
203
  text-underline-offset: 0.25em;
204
204
  text-decoration-thickness: 1px;
205
- color: var(--awsui-style-color-default-mdigke, var(--color-text-link-default-1dmm7z, #006ce0));
205
+ color: var(--awsui-style-color-default-kiajpc, var(--color-text-link-default-1dmm7z, #006ce0));
206
206
  font-weight: inherit;
207
207
  letter-spacing: normal;
208
208
  text-decoration-line: underline;
@@ -213,30 +213,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
213
213
  transition-duration: var(--motion-duration-refresh-only-medium-5rbn3k, 165ms);
214
214
  }
215
215
  @media (prefers-reduced-motion: reduce) {
216
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9) {
216
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9) {
217
217
  animation: none;
218
218
  transition: none;
219
219
  }
220
220
  }
221
- .awsui-motion-disabled .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9), .awsui-mode-entering .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9) {
221
+ .awsui-motion-disabled .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9), .awsui-mode-entering .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9) {
222
222
  animation: none;
223
223
  transition: none;
224
224
  }
225
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9):hover {
225
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9):hover {
226
226
  cursor: pointer;
227
- color: var(--awsui-style-color-hover-mdigke, var(--color-text-link-hover-sq1gxg, #002b66));
227
+ color: var(--awsui-style-color-hover-kiajpc, var(--color-text-link-hover-sq1gxg, #002b66));
228
228
  }
229
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9):focus {
229
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9):focus {
230
230
  outline: none;
231
231
  }
232
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9):active {
233
- color: var(--awsui-style-color-active-mdigke, var(--color-text-link-hover-sq1gxg, #002b66));
232
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9):active {
233
+ color: var(--awsui-style-color-active-kiajpc, var(--color-text-link-hover-sq1gxg, #002b66));
234
234
  }
235
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9):active, .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9):focus, .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201:not(#\9):hover {
235
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9):active, .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9):focus, .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201:not(#\9):hover {
236
236
  text-decoration-line: underline;
237
237
  text-decoration-color: currentColor;
238
238
  }
239
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201.awsui_current-breadcrumb_93a1u_1j433_237:not(#\9) {
239
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201.awsui_current-breadcrumb_93a1u_j1gnt_237:not(#\9) {
240
240
  font-weight: var(--font-weight-button-0eg20c, 700);
241
241
  -webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
242
242
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
@@ -244,27 +244,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
244
244
  font-weight: 700;
245
245
  text-decoration: none;
246
246
  }
247
- .awsui_menu-item_93a1u_1j433_189.awsui_link-style_93a1u_1j433_201.awsui_link-style-highlighted_93a1u_1j433_245:not(#\9) {
247
+ .awsui_menu-item_93a1u_j1gnt_189.awsui_link-style_93a1u_j1gnt_201.awsui_link-style-highlighted_93a1u_j1gnt_245:not(#\9) {
248
248
  color: var(--color-text-link-hover-sq1gxg, #002b66);
249
249
  }
250
- .awsui_menu-item_93a1u_1j433_189:not(#\9):focus {
250
+ .awsui_menu-item_93a1u_j1gnt_189:not(#\9):focus {
251
251
  outline: none;
252
252
  }
253
- .awsui_has-category-header_93a1u_1j433_251 > .awsui_menu-item_93a1u_1j433_189:not(#\9), .awsui_has-category-header_93a1u_1j433_251 > .awsui_item-tooltip-wrapper_93a1u_1j433_251 > .awsui_menu-item_93a1u_1j433_189:not(#\9), .awsui_has-category-header_93a1u_1j433_251:not(#\9):not(.awsui_has-checkmark_93a1u_1j433_251) > span > .awsui_menu-item_93a1u_1j433_189 {
253
+ .awsui_has-category-header_93a1u_j1gnt_251 > .awsui_menu-item_93a1u_j1gnt_189:not(#\9), .awsui_has-category-header_93a1u_j1gnt_251 > .awsui_item-tooltip-wrapper_93a1u_j1gnt_251 > .awsui_menu-item_93a1u_j1gnt_189:not(#\9), .awsui_has-category-header_93a1u_j1gnt_251:not(#\9):not(.awsui_has-checkmark_93a1u_j1gnt_251) > span > .awsui_menu-item_93a1u_j1gnt_189 {
254
254
  padding-inline-start: calc(var(--space-xs-ymlm0b, 8px) + var(--space-l-2ud1p3, 20px));
255
255
  }
256
256
 
257
- .awsui_icon_93a1u_1j433_255:not(#\9) {
257
+ .awsui_icon_93a1u_j1gnt_255:not(#\9) {
258
258
  padding-inline-end: var(--space-xxs-hwfkai, 4px);
259
259
  flex-shrink: 0;
260
260
  }
261
- .awsui_icon_93a1u_1j433_255.awsui_checkmark_93a1u_1j433_259:not(#\9) {
261
+ .awsui_icon_93a1u_j1gnt_255.awsui_checkmark_93a1u_j1gnt_259:not(#\9) {
262
262
  color: var(--color-text-status-info-ue8bd2, #006ce0);
263
263
  }
264
- .awsui_icon_93a1u_1j433_255.awsui_disabled_93a1u_1j433_157:not(#\9) {
264
+ .awsui_icon_93a1u_j1gnt_255.awsui_disabled_93a1u_j1gnt_157:not(#\9) {
265
265
  color: var(--color-text-interactive-disabled-1bqmrl, #b4b4bb);
266
266
  }
267
267
 
268
- .awsui_external-icon_93a1u_1j433_266:not(#\9) {
268
+ .awsui_external-icon_93a1u_j1gnt_266:not(#\9) {
269
269
  margin-inline-start: var(--space-xxs-hwfkai, 4px);
270
270
  }
@@ -2,21 +2,21 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "item-element": "awsui_item-element_93a1u_1j433_145",
6
- "disabled": "awsui_disabled_93a1u_1j433_157",
7
- "show-divider": "awsui_show-divider_93a1u_1j433_164",
8
- "highlighted": "awsui_highlighted_93a1u_1j433_167",
9
- "is-focused": "awsui_is-focused_93a1u_1j433_182",
10
- "visual-refresh": "awsui_visual-refresh_93a1u_1j433_185",
11
- "menu-item": "awsui_menu-item_93a1u_1j433_189",
12
- "link-style": "awsui_link-style_93a1u_1j433_201",
13
- "current-breadcrumb": "awsui_current-breadcrumb_93a1u_1j433_237",
14
- "link-style-highlighted": "awsui_link-style-highlighted_93a1u_1j433_245",
15
- "has-category-header": "awsui_has-category-header_93a1u_1j433_251",
16
- "item-tooltip-wrapper": "awsui_item-tooltip-wrapper_93a1u_1j433_251",
17
- "has-checkmark": "awsui_has-checkmark_93a1u_1j433_251",
18
- "icon": "awsui_icon_93a1u_1j433_255",
19
- "checkmark": "awsui_checkmark_93a1u_1j433_259",
20
- "external-icon": "awsui_external-icon_93a1u_1j433_266"
5
+ "item-element": "awsui_item-element_93a1u_j1gnt_145",
6
+ "disabled": "awsui_disabled_93a1u_j1gnt_157",
7
+ "show-divider": "awsui_show-divider_93a1u_j1gnt_164",
8
+ "highlighted": "awsui_highlighted_93a1u_j1gnt_167",
9
+ "is-focused": "awsui_is-focused_93a1u_j1gnt_182",
10
+ "visual-refresh": "awsui_visual-refresh_93a1u_j1gnt_185",
11
+ "menu-item": "awsui_menu-item_93a1u_j1gnt_189",
12
+ "link-style": "awsui_link-style_93a1u_j1gnt_201",
13
+ "current-breadcrumb": "awsui_current-breadcrumb_93a1u_j1gnt_237",
14
+ "link-style-highlighted": "awsui_link-style-highlighted_93a1u_j1gnt_245",
15
+ "has-category-header": "awsui_has-category-header_93a1u_j1gnt_251",
16
+ "item-tooltip-wrapper": "awsui_item-tooltip-wrapper_93a1u_j1gnt_251",
17
+ "has-checkmark": "awsui_has-checkmark_93a1u_j1gnt_251",
18
+ "icon": "awsui_icon_93a1u_j1gnt_255",
19
+ "checkmark": "awsui_checkmark_93a1u_j1gnt_259",
20
+ "external-icon": "awsui_external-icon_93a1u_j1gnt_266"
21
21
  };
22
22
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAqChB,CAAC;AAoBF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAyChB,CAAC;AAoBF,eAAe,WAAW,CAAC"}
@@ -1,51 +1,18 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- 'use client';
4
- import { __rest } from "tslib";
5
3
  import React from 'react';
6
- import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
7
- import { getBaseProps } from '../internal/base-component';
8
- import useBaseComponent from '../internal/hooks/use-base-component';
4
+
5
+ import CoreComponent from './internal-do-not-use-core';
9
6
  import { applyDisplayName } from '../internal/utils/apply-display-name';
10
- import { getExternalProps } from '../internal/utils/external-props';
11
- import InternalButtonGroup from './internal';
12
- const ButtonGroup = React.forwardRef((_a, ref) => {
13
- var { variant, dropdownExpandToViewport = false } = _a, rest = __rest(_a, ["variant", "dropdownExpandToViewport"]);
14
- const baseProps = getBaseProps(rest);
15
- const itemCounts = getItemCounts(rest.items);
16
- const baseComponentProps = useBaseComponent('ButtonGroup', {
17
- props: {
18
- variant,
19
- dropdownExpandToViewport,
20
- },
21
- metadata: {
22
- iconButtonsCount: itemCounts['icon-button'],
23
- iconToggleButtonsCount: itemCounts['icon-toggle-button'],
24
- iconFileInputsCount: itemCounts['icon-file-input'],
25
- menuDropdownsCount: itemCounts['menu-dropdown'],
26
- groupsCount: itemCounts.group,
27
- },
28
- });
29
- const externalProps = getExternalProps(rest);
30
- const componentMetadata = {
31
- name: 'awsui.ButtonGroup',
32
- label: { root: 'self' },
33
- };
34
- return (React.createElement(InternalButtonGroup, Object.assign({}, baseProps, baseComponentProps, externalProps, { ref: ref, variant: variant, dropdownExpandToViewport: dropdownExpandToViewport }, getAnalyticsMetadataAttribute({ component: componentMetadata }))));
7
+ import { validateProps } from '@cloudscape-design/component-toolkit/internal';
8
+
9
+
10
+
11
+ const ButtonGroup = React.forwardRef((props, ref) => {
12
+ validateProps('ButtonGroup', props, ["style"], {}, 'console');
13
+ return React.createElement(CoreComponent, {ref,...props});
35
14
  });
36
- function getItemCounts(allItems = []) {
37
- const counters = { 'icon-button': 0, 'icon-toggle-button': 0, 'icon-file-input': 0, 'menu-dropdown': 0, group: 0 };
38
- function count(items) {
39
- for (const item of items) {
40
- counters[item.type] += 1;
41
- if (item.type === 'group') {
42
- count(item.items);
43
- }
44
- }
45
- }
46
- count(allItems);
47
- return counters;
48
- }
15
+
16
+
49
17
  applyDisplayName(ButtonGroup, 'ButtonGroup');
50
18
  export default ButtonGroup;
51
- //# sourceMappingURL=index.js.map
@@ -96,8 +96,13 @@ export interface ButtonGroupProps extends BaseComponentProps {
96
96
  * Called when the user uploads files. The event detail object contains the id and files from the file input item.
97
97
  */
98
98
  onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;
99
+ /**
100
+ * @awsuiSystem core
101
+ */
102
+ }
103
+ export interface InternalButtonGroupProps extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>, InternalBaseComponentProps {
104
+ style?: ButtonGroupProps.Style;
99
105
  }
100
- export interface InternalButtonGroupProps extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>, InternalBaseComponentProps {}
101
106
  export declare namespace ButtonGroupProps {
102
107
  type Variant = 'icon';
103
108
  type ItemOrGroup = Item | Group;
@@ -171,4 +176,39 @@ export declare namespace ButtonGroupProps {
171
176
  */
172
177
  focus(itemId: string): void;
173
178
  }
179
+ interface Style {
180
+ root?: {
181
+ background?: string;
182
+ borderColor?: string;
183
+ borderRadius?: string;
184
+ borderWidth?: string;
185
+ paddingBlock?: string;
186
+ paddingInline?: string;
187
+ boxShadow?: string;
188
+ focusRing?: {
189
+ borderColor?: string;
190
+ borderRadius?: string;
191
+ borderWidth?: string;
192
+ };
193
+ };
194
+ item?: {
195
+ color?: {
196
+ active?: string;
197
+ default?: string;
198
+ disabled?: string;
199
+ hover?: string;
200
+ };
201
+ boxShadow?: {
202
+ active?: string;
203
+ default?: string;
204
+ disabled?: string;
205
+ hover?: string;
206
+ };
207
+ focusRing?: {
208
+ borderColor?: string;
209
+ borderRadius?: string;
210
+ borderWidth?: string;
211
+ };
212
+ };
213
+ }
174
214
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":";A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;gBAChB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,KAAK,CAAC,EAAE,MAAM,CAAC;aAChB,CAAC;YACF,SAAS,CAAC,EAAE;gBACV,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;KACH;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n}\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n /**\n * @awsuiSystem core\n */\n style?: ButtonGroupProps.Style;\n}\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {\n style?: ButtonGroupProps.Style;\n}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n paddingBlock?: string;\n paddingInline?: string;\n boxShadow?: string;\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n item?: {\n color?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n boxShadow?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
@@ -0,0 +1,51 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ 'use client';
4
+ import { __rest } from "tslib";
5
+ import React from 'react';
6
+ import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
7
+ import { getBaseProps } from '../internal/base-component';
8
+ import useBaseComponent from '../internal/hooks/use-base-component';
9
+ import { applyDisplayName } from '../internal/utils/apply-display-name';
10
+ import { getExternalProps } from '../internal/utils/external-props';
11
+ import InternalButtonGroup from './internal';
12
+ const ButtonGroup = React.forwardRef((_a, ref) => {
13
+ var { variant, dropdownExpandToViewport = false, style } = _a, rest = __rest(_a, ["variant", "dropdownExpandToViewport", "style"]);
14
+ const baseProps = getBaseProps(rest);
15
+ const itemCounts = getItemCounts(rest.items);
16
+ const baseComponentProps = useBaseComponent('ButtonGroup', {
17
+ props: {
18
+ variant,
19
+ dropdownExpandToViewport,
20
+ },
21
+ metadata: {
22
+ iconButtonsCount: itemCounts['icon-button'],
23
+ iconToggleButtonsCount: itemCounts['icon-toggle-button'],
24
+ iconFileInputsCount: itemCounts['icon-file-input'],
25
+ menuDropdownsCount: itemCounts['menu-dropdown'],
26
+ groupsCount: itemCounts.group,
27
+ },
28
+ });
29
+ const externalProps = getExternalProps(rest);
30
+ const componentMetadata = {
31
+ name: 'awsui.ButtonGroup',
32
+ label: { root: 'self' },
33
+ };
34
+ return (React.createElement(InternalButtonGroup, Object.assign({}, baseProps, baseComponentProps, externalProps, { ref: ref, variant: variant, dropdownExpandToViewport: dropdownExpandToViewport, style: style }, getAnalyticsMetadataAttribute({ component: componentMetadata }))));
35
+ });
36
+ function getItemCounts(allItems = []) {
37
+ const counters = { 'icon-button': 0, 'icon-toggle-button': 0, 'icon-file-input': 0, 'menu-dropdown': 0, group: 0 };
38
+ function count(items) {
39
+ for (const item of items) {
40
+ counters[item.type] += 1;
41
+ if (item.type === 'group') {
42
+ count(item.items);
43
+ }
44
+ }
45
+ }
46
+ count(allItems);
47
+ return counters;
48
+ }
49
+ applyDisplayName(ButtonGroup, 'ButtonGroup');
50
+ export default ButtonGroup;
51
+ //# sourceMappingURL=internal-do-not-use-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EAA+E,EAC/E,GAAoC,EACpC,EAA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H,SAAS,KAAK,CAAC,KAA8C;QAC3D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEzB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;gBACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACnB;SACF;IACH,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEhB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { GeneratedAnalyticsMetadataButtonGroupComponent } from './analytics-metadata/interfaces';\nimport { ButtonGroupProps } from './interfaces';\nimport InternalButtonGroup from './internal';\n\nexport { ButtonGroupProps };\n\nconst ButtonGroup = React.forwardRef(\n (\n { variant, dropdownExpandToViewport = false, style, ...rest }: ButtonGroupProps,\n ref: React.Ref<ButtonGroupProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const itemCounts = getItemCounts(rest.items);\n const baseComponentProps = useBaseComponent('ButtonGroup', {\n props: {\n variant,\n dropdownExpandToViewport,\n },\n metadata: {\n iconButtonsCount: itemCounts['icon-button'],\n iconToggleButtonsCount: itemCounts['icon-toggle-button'],\n iconFileInputsCount: itemCounts['icon-file-input'],\n menuDropdownsCount: itemCounts['menu-dropdown'],\n groupsCount: itemCounts.group,\n },\n });\n\n const externalProps = getExternalProps(rest);\n\n const componentMetadata: GeneratedAnalyticsMetadataButtonGroupComponent = {\n name: 'awsui.ButtonGroup',\n label: { root: 'self' },\n };\n\n return (\n <InternalButtonGroup\n {...baseProps}\n {...baseComponentProps}\n {...externalProps}\n ref={ref}\n variant={variant}\n dropdownExpandToViewport={dropdownExpandToViewport}\n style={style}\n {...getAnalyticsMetadataAttribute({ component: componentMetadata })}\n />\n );\n }\n);\n\nfunction getItemCounts(allItems: readonly ButtonGroupProps.ItemOrGroup[] = []) {\n const counters = { 'icon-button': 0, 'icon-toggle-button': 0, 'icon-file-input': 0, 'menu-dropdown': 0, group: 0 };\n\n function count(items: readonly ButtonGroupProps.ItemOrGroup[]) {\n for (const item of items) {\n counters[item.type] += 1;\n\n if (item.type === 'group') {\n count(item.items);\n }\n }\n }\n count(allItems);\n\n return counters;\n}\n\napplyDisplayName(ButtonGroup, 'ButtonGroup');\nexport default ButtonGroup;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAgB5F,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAM1E,QAAA,MAAM,mBAAmB,uGAuKxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAgB5F,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAO1E,QAAA,MAAM,mBAAmB,uGA4KxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -12,10 +12,11 @@ import { KeyCode } from '../internal/keycode';
12
12
  import { circleIndex } from '../internal/utils/circle-index';
13
13
  import handleKey from '../internal/utils/handle-key';
14
14
  import ItemElement from './item-element.js';
15
+ import { getButtonGroupStyles } from './style';
15
16
  import styles from './styles.css.js';
16
17
  import testUtilStyles from './test-classes/styles.css.js';
17
18
  const InternalButtonGroup = forwardRef((_a, ref) => {
18
- var { items = [], onItemClick, onFilesChange, ariaLabel, dropdownExpandToViewport, __internalRootRef } = _a, props = __rest(_a, ["items", "onItemClick", "onFilesChange", "ariaLabel", "dropdownExpandToViewport", "__internalRootRef"]);
19
+ var { items = [], onItemClick, onFilesChange, ariaLabel, dropdownExpandToViewport, style, __internalRootRef } = _a, props = __rest(_a, ["items", "onItemClick", "onFilesChange", "ariaLabel", "dropdownExpandToViewport", "style", "__internalRootRef"]);
19
20
  const baseProps = getBaseProps(props);
20
21
  const focusedIdRef = useRef(null);
21
22
  const navigationAPI = useRef(null);
@@ -102,10 +103,11 @@ const InternalButtonGroup = forwardRef((_a, ref) => {
102
103
  }
103
104
  return getAllFocusables(target).filter(el => isElementRegistered(el) && !isElementDisabled(el));
104
105
  }
105
- return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, testUtilStyles['button-group'], baseProps.className), ref: containerRef, role: "toolbar", "aria-label": ariaLabel, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown }),
106
+ const stylePropertiesAndVariables = getButtonGroupStyles(style);
107
+ return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, testUtilStyles['button-group'], baseProps.className), ref: containerRef, role: "toolbar", "aria-label": ariaLabel, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, style: stylePropertiesAndVariables }),
106
108
  React.createElement(SingleTabStopNavigationProvider, { ref: navigationAPI, navigationActive: true, getNextFocusTarget: getNextFocusTarget, onUnregisterActive: onUnregisterActive }, items.map((itemOrGroup, index) => {
107
109
  var _a;
108
- const itemContent = (item, position) => (React.createElement(ItemElement, { key: item.id, item: item, dropdownExpandToViewport: dropdownExpandToViewport, tooltip: tooltip, setTooltip: setTooltip, onItemClick: onItemClick, onFilesChange: onFilesChange, ref: element => (itemsRef.current[item.id] = element), position: position }));
110
+ const itemContent = (item, position) => (React.createElement(ItemElement, { key: item.id, item: item, dropdownExpandToViewport: dropdownExpandToViewport, tooltip: tooltip, setTooltip: setTooltip, onItemClick: onItemClick, onFilesChange: onFilesChange, ref: element => (itemsRef.current[item.id] = element), position: position, style: style }));
109
111
  const isGroupBefore = ((_a = items[index - 1]) === null || _a === void 0 ? void 0 : _a.type) === 'group';
110
112
  const currentItem = items[index];
111
113
  const isGroupNow = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.type) === 'group';