@cloudscape-design/components 3.0.1127 → 3.0.1129

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 (161) hide show
  1. package/alert/styles.css.js +27 -27
  2. package/alert/styles.scoped.css +50 -50
  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 +30 -30
  14. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +87 -87
  15. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
  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 +27 -27
  20. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +54 -54
  21. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -27
  22. package/attribute-editor/index.d.ts.map +1 -1
  23. package/attribute-editor/index.js +2 -2
  24. package/attribute-editor/index.js.map +1 -1
  25. package/attribute-editor/interfaces.d.ts +8 -0
  26. package/attribute-editor/interfaces.d.ts.map +1 -1
  27. package/attribute-editor/interfaces.js.map +1 -1
  28. package/attribute-editor/internal.d.ts.map +1 -1
  29. package/attribute-editor/internal.js +9 -6
  30. package/attribute-editor/internal.js.map +1 -1
  31. package/attribute-editor/styles.css.js +15 -15
  32. package/attribute-editor/styles.scoped.css +28 -28
  33. package/attribute-editor/styles.selectors.js +15 -15
  34. package/breadcrumb-group/item/styles.css.js +7 -7
  35. package/breadcrumb-group/item/styles.scoped.css +28 -28
  36. package/breadcrumb-group/item/styles.selectors.js +7 -7
  37. package/button/styles.css.js +22 -22
  38. package/button/styles.scoped.css +256 -256
  39. package/button/styles.selectors.js +22 -22
  40. package/button-dropdown/item-element/styles.css.js +16 -16
  41. package/button-dropdown/item-element/styles.scoped.css +27 -27
  42. package/button-dropdown/item-element/styles.selectors.js +16 -16
  43. package/checkbox/styles.css.js +3 -3
  44. package/checkbox/styles.scoped.css +11 -11
  45. package/checkbox/styles.selectors.js +3 -3
  46. package/content-layout/styles.css.js +14 -14
  47. package/content-layout/styles.scoped.css +27 -27
  48. package/content-layout/styles.selectors.js +14 -14
  49. package/flashbar/styles.css.js +50 -50
  50. package/flashbar/styles.scoped.css +187 -187
  51. package/flashbar/styles.selectors.js +50 -50
  52. package/header/analytics/use-table-integration.d.ts +2 -1
  53. package/header/analytics/use-table-integration.d.ts.map +1 -1
  54. package/header/analytics/use-table-integration.js +8 -1
  55. package/header/analytics/use-table-integration.js.map +1 -1
  56. package/header/interfaces.d.ts +2 -2
  57. package/header/interfaces.d.ts.map +1 -1
  58. package/header/interfaces.js.map +1 -1
  59. package/help-panel/styles.css.js +6 -6
  60. package/help-panel/styles.scoped.css +73 -73
  61. package/help-panel/styles.selectors.js +6 -6
  62. package/icon/generated/icons.d.ts +1 -0
  63. package/icon/generated/icons.d.ts.map +1 -1
  64. package/icon/generated/icons.js +3 -0
  65. package/icon/generated/icons.js.map +1 -1
  66. package/icon/interfaces.d.ts +1 -1
  67. package/icon/interfaces.d.ts.map +1 -1
  68. package/icon/interfaces.js.map +1 -1
  69. package/icon-provider/interfaces.d.ts +1 -0
  70. package/icon-provider/interfaces.d.ts.map +1 -1
  71. package/icon-provider/interfaces.js.map +1 -1
  72. package/input/styles.css.js +13 -13
  73. package/input/styles.scoped.css +65 -65
  74. package/input/styles.selectors.js +13 -13
  75. package/internal/base-component/styles.scoped.css +1 -1
  76. package/internal/components/drag-handle-wrapper/styles.css.js +20 -20
  77. package/internal/components/drag-handle-wrapper/styles.scoped.css +48 -48
  78. package/internal/components/drag-handle-wrapper/styles.selectors.js +20 -20
  79. package/internal/components/dropdown/styles.css.js +20 -20
  80. package/internal/components/dropdown/styles.scoped.css +38 -38
  81. package/internal/components/dropdown/styles.selectors.js +20 -20
  82. package/internal/components/token-list/styles.css.js +10 -10
  83. package/internal/components/token-list/styles.scoped.css +25 -25
  84. package/internal/components/token-list/styles.selectors.js +10 -10
  85. package/internal/environment.js +2 -2
  86. package/internal/environment.json +2 -2
  87. package/internal/generated/custom-css-properties/index.d.ts +4 -0
  88. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  89. package/internal/generated/custom-css-properties/index.js +102 -98
  90. package/internal/generated/custom-css-properties/index.js.map +1 -1
  91. package/internal/generated/styles/tokens.d.ts +50 -75
  92. package/internal/generated/styles/tokens.js +50 -75
  93. package/internal/generated/theming/index.cjs +305 -461
  94. package/internal/generated/theming/index.js +305 -461
  95. package/internal/manifest.json +1 -1
  96. package/link/styles.css.js +20 -20
  97. package/link/styles.scoped.css +103 -103
  98. package/link/styles.selectors.js +20 -20
  99. package/package.json +1 -1
  100. package/progress-bar/index.d.ts.map +1 -1
  101. package/progress-bar/index.js +14 -54
  102. package/progress-bar/interfaces.d.ts +18 -0
  103. package/progress-bar/interfaces.d.ts.map +1 -1
  104. package/progress-bar/interfaces.js.map +1 -1
  105. package/progress-bar/internal-do-not-use-core.js +58 -0
  106. package/progress-bar/internal-do-not-use-core.js.map +1 -0
  107. package/progress-bar/internal.d.ts +3 -1
  108. package/progress-bar/internal.d.ts.map +1 -1
  109. package/progress-bar/internal.js +7 -3
  110. package/progress-bar/internal.js.map +1 -1
  111. package/progress-bar/styles.css.js +19 -19
  112. package/progress-bar/styles.d.ts +15 -0
  113. package/progress-bar/styles.d.ts.map +1 -0
  114. package/progress-bar/styles.js +33 -0
  115. package/progress-bar/styles.js.map +1 -0
  116. package/progress-bar/styles.scoped.css +56 -56
  117. package/progress-bar/styles.selectors.js +19 -19
  118. package/radio-group/analytics-metadata/interfaces.d.ts +1 -0
  119. package/radio-group/analytics-metadata/interfaces.d.ts.map +1 -1
  120. package/radio-group/analytics-metadata/interfaces.js.map +1 -1
  121. package/radio-group/analytics-metadata/styles.css.js +6 -0
  122. package/radio-group/analytics-metadata/styles.scoped.css +7 -0
  123. package/radio-group/analytics-metadata/styles.selectors.js +7 -0
  124. package/radio-group/index.d.ts.map +1 -1
  125. package/radio-group/internal-do-not-use-core.js +2 -0
  126. package/radio-group/internal-do-not-use-core.js.map +1 -1
  127. package/radio-group/internal.d.ts.map +1 -1
  128. package/radio-group/internal.js +2 -1
  129. package/radio-group/internal.js.map +1 -1
  130. package/radio-group/styles.css.js +10 -10
  131. package/radio-group/styles.scoped.css +22 -22
  132. package/radio-group/styles.selectors.js +10 -10
  133. package/s3-resource-selector/index.d.ts.map +1 -1
  134. package/s3-resource-selector/index.js +2 -2
  135. package/s3-resource-selector/index.js.map +1 -1
  136. package/s3-resource-selector/interfaces.d.ts +8 -0
  137. package/s3-resource-selector/interfaces.d.ts.map +1 -1
  138. package/s3-resource-selector/interfaces.js.map +1 -1
  139. package/s3-resource-selector/s3-in-context/index.d.ts +3 -0
  140. package/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
  141. package/s3-resource-selector/s3-in-context/index.js +8 -2
  142. package/s3-resource-selector/s3-in-context/index.js.map +1 -1
  143. package/slider/styles.css.js +26 -26
  144. package/slider/styles.scoped.css +86 -86
  145. package/slider/styles.selectors.js +26 -26
  146. package/spinner/styles.css.js +13 -13
  147. package/spinner/styles.scoped.css +39 -39
  148. package/spinner/styles.selectors.js +13 -13
  149. package/tag-editor/styles.css.js +3 -3
  150. package/tag-editor/styles.scoped.css +13 -13
  151. package/tag-editor/styles.selectors.js +3 -3
  152. package/text-content/styles.css.js +1 -1
  153. package/text-content/styles.scoped.css +66 -66
  154. package/text-content/styles.selectors.js +1 -1
  155. package/textarea/styles.css.js +5 -5
  156. package/textarea/styles.scoped.css +41 -41
  157. package/textarea/styles.selectors.js +5 -5
  158. package/toggle/styles.css.js +10 -10
  159. package/toggle/styles.scoped.css +23 -23
  160. package/toggle/styles.selectors.js +10 -10
  161. package/progress-bar/index.js.map +0 -1
@@ -150,7 +150,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
150
150
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
151
151
  SPDX-License-Identifier: Apache-2.0
152
152
  */
153
- .awsui_navigation-container_2p2ab_y36ks_153:not(#\9) {
153
+ .awsui_navigation-container_2p2ab_1053j_153:not(#\9) {
154
154
  position: sticky;
155
155
  z-index: 830;
156
156
  background-color: var(--color-background-container-content-6u8rvp, #ffffff);
@@ -161,27 +161,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
161
161
  display: flex;
162
162
  flex-direction: column;
163
163
  }
164
- .awsui_navigation-container_2p2ab_y36ks_153:not(#\9):not(.awsui_is-navigation-open_2p2ab_y36ks_164) {
164
+ .awsui_navigation-container_2p2ab_1053j_153:not(#\9):not(.awsui_is-navigation-open_2p2ab_1053j_164) {
165
165
  inline-size: 0px;
166
166
  display: none;
167
167
  }
168
- .awsui_navigation-container_2p2ab_y36ks_153 > .awsui_navigation_2p2ab_y36ks_153:not(#\9) {
168
+ .awsui_navigation-container_2p2ab_1053j_153 > .awsui_navigation_2p2ab_1053j_153:not(#\9) {
169
169
  flex-grow: 1;
170
170
  block-size: 100%;
171
171
  overflow-y: auto;
172
172
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
173
173
  overscroll-behavior-y: contain;
174
- inline-size: var(--awsui-navigation-width-b75yp7);
174
+ inline-size: var(--awsui-navigation-width-9t5olz);
175
175
  position: relative;
176
176
  }
177
177
  @media (max-width: 688px) {
178
- .awsui_navigation-container_2p2ab_y36ks_153:not(#\9) {
179
- --awsui-navigation-width-b75yp7: 100vw;
178
+ .awsui_navigation-container_2p2ab_1053j_153:not(#\9) {
179
+ --awsui-navigation-width-9t5olz: 100vw;
180
180
  z-index: 1001;
181
181
  }
182
182
  }
183
183
 
184
- .awsui_hide-navigation_2p2ab_y36ks_184:not(#\9) {
184
+ .awsui_hide-navigation_2p2ab_1053j_184:not(#\9) {
185
185
  position: absolute;
186
186
  inset-inline-end: var(--space-m-dsumyt, 16px);
187
187
  inset-block-start: 14px;
@@ -2,9 +2,9 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "navigation-container": "awsui_navigation-container_2p2ab_y36ks_153",
6
- "is-navigation-open": "awsui_is-navigation-open_2p2ab_y36ks_164",
7
- "navigation": "awsui_navigation_2p2ab_y36ks_153",
8
- "hide-navigation": "awsui_hide-navigation_2p2ab_y36ks_184"
5
+ "navigation-container": "awsui_navigation-container_2p2ab_1053j_153",
6
+ "is-navigation-open": "awsui_is-navigation-open_2p2ab_1053j_164",
7
+ "navigation": "awsui_navigation_2p2ab_1053j_153",
8
+ "hide-navigation": "awsui_hide-navigation_2p2ab_1053j_184"
9
9
  };
10
10
 
@@ -1,32 +1,32 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_7nfqu_11rwq_153",
5
- "has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_11rwq_197",
6
- "has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_11rwq_202",
7
- "drawer-expanded-mode": "awsui_drawer-expanded-mode_7nfqu_11rwq_217",
8
- "ai-drawer-expanded-mode": "awsui_ai-drawer-expanded-mode_7nfqu_11rwq_220",
9
- "bottom-drawer-expanded-mode": "awsui_bottom-drawer-expanded-mode_7nfqu_11rwq_223",
10
- "ai-drawer": "awsui_ai-drawer_7nfqu_11rwq_220",
11
- "navigation": "awsui_navigation_7nfqu_11rwq_230",
12
- "tools": "awsui_tools_7nfqu_11rwq_231",
13
- "global-tools": "awsui_global-tools_7nfqu_11rwq_232",
14
- "bottom-tool": "awsui_bottom-tool_7nfqu_11rwq_233",
15
- "tools-open": "awsui_tools-open_7nfqu_11rwq_290",
16
- "split-panel-side": "awsui_split-panel-side_7nfqu_11rwq_304",
17
- "split-panel-bottom": "awsui_split-panel-bottom_7nfqu_11rwq_311",
18
- "panel-hidden": "awsui_panel-hidden_7nfqu_11rwq_324",
19
- "toolbar-container": "awsui_toolbar-container_7nfqu_11rwq_334",
20
- "notifications-container": "awsui_notifications-container_7nfqu_11rwq_341",
21
- "notifications-background": "awsui_notifications-background_7nfqu_11rwq_345",
22
- "main-landmark": "awsui_main-landmark_7nfqu_11rwq_356",
23
- "main": "awsui_main_7nfqu_11rwq_356",
24
- "main-disable-paddings": "awsui_main-disable-paddings_7nfqu_11rwq_365",
25
- "content-header": "awsui_content-header_7nfqu_11rwq_375",
26
- "content": "awsui_content_7nfqu_11rwq_375",
27
- "unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_11rwq_385",
28
- "hidden": "awsui_hidden_7nfqu_11rwq_390",
29
- "breadcrumbs-own": "awsui_breadcrumbs-own_7nfqu_11rwq_394",
30
- "breadcrumbs-discovered": "awsui_breadcrumbs-discovered_7nfqu_11rwq_394"
4
+ "root": "awsui_root_7nfqu_1re3f_153",
5
+ "has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_1re3f_197",
6
+ "has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_1re3f_202",
7
+ "drawer-expanded-mode": "awsui_drawer-expanded-mode_7nfqu_1re3f_217",
8
+ "ai-drawer-expanded-mode": "awsui_ai-drawer-expanded-mode_7nfqu_1re3f_220",
9
+ "bottom-drawer-expanded-mode": "awsui_bottom-drawer-expanded-mode_7nfqu_1re3f_223",
10
+ "ai-drawer": "awsui_ai-drawer_7nfqu_1re3f_220",
11
+ "navigation": "awsui_navigation_7nfqu_1re3f_230",
12
+ "tools": "awsui_tools_7nfqu_1re3f_231",
13
+ "global-tools": "awsui_global-tools_7nfqu_1re3f_232",
14
+ "bottom-tool": "awsui_bottom-tool_7nfqu_1re3f_233",
15
+ "tools-open": "awsui_tools-open_7nfqu_1re3f_290",
16
+ "split-panel-side": "awsui_split-panel-side_7nfqu_1re3f_304",
17
+ "split-panel-bottom": "awsui_split-panel-bottom_7nfqu_1re3f_311",
18
+ "panel-hidden": "awsui_panel-hidden_7nfqu_1re3f_324",
19
+ "toolbar-container": "awsui_toolbar-container_7nfqu_1re3f_334",
20
+ "notifications-container": "awsui_notifications-container_7nfqu_1re3f_341",
21
+ "notifications-background": "awsui_notifications-background_7nfqu_1re3f_345",
22
+ "main-landmark": "awsui_main-landmark_7nfqu_1re3f_356",
23
+ "main": "awsui_main_7nfqu_1re3f_356",
24
+ "main-disable-paddings": "awsui_main-disable-paddings_7nfqu_1re3f_365",
25
+ "content-header": "awsui_content-header_7nfqu_1re3f_375",
26
+ "content": "awsui_content_7nfqu_1re3f_375",
27
+ "unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_1re3f_385",
28
+ "hidden": "awsui_hidden_7nfqu_1re3f_390",
29
+ "breadcrumbs-own": "awsui_breadcrumbs-own_7nfqu_1re3f_394",
30
+ "breadcrumbs-discovered": "awsui_breadcrumbs-discovered_7nfqu_1re3f_394"
31
31
  };
32
32
 
@@ -150,7 +150,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
150
150
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
151
151
  SPDX-License-Identifier: Apache-2.0
152
152
  */
153
- .awsui_root_7nfqu_11rwq_153:not(#\9) {
153
+ .awsui_root_7nfqu_1re3f_153:not(#\9) {
154
154
  border-collapse: separate;
155
155
  border-spacing: 0;
156
156
  box-sizing: border-box;
@@ -182,72 +182,72 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
182
182
  -moz-osx-font-smoothing: auto;
183
183
  color: var(--color-text-body-default-vvtq8u, #0f141a);
184
184
  background-color: var(--color-background-layout-main-5ilwcb, #ffffff);
185
- --awsui-max-content-width-b75yp7: 100%;
185
+ --awsui-max-content-width-9t5olz: 100%;
186
186
  display: grid;
187
187
  grid-template-areas: "toolbar toolbar toolbar" ". notifications ." ". main .";
188
188
  grid-template-columns: var(--space-layout-content-horizontal-buc0zz, 24px) minmax(0, 1fr) var(--space-layout-content-horizontal-buc0zz, 24px);
189
189
  grid-template-rows: min-content min-content 1fr;
190
190
  }
191
191
  @media (min-width: 689px) {
192
- .awsui_root_7nfqu_11rwq_153:not(#\9) {
192
+ .awsui_root_7nfqu_1re3f_153:not(#\9) {
193
193
  grid-template-areas: "ai-drawer toolbar toolbar toolbar toolbar toolbar toolbar toolbar" "ai-drawer navigation . notifications . sideSplitPanel tools global-tools" "ai-drawer navigation . main . sideSplitPanel tools global-tools" "ai-drawer bottom-tool bottom-tool bottom-tool bottom-tool bottom-tool bottom-tool global-tools";
194
- grid-template-columns: min-content min-content minmax(var(--space-layout-content-horizontal-buc0zz, 24px), 1fr) minmax(0, var(--awsui-max-content-width-b75yp7)) minmax(var(--space-layout-content-horizontal-buc0zz, 24px), 1fr) min-content min-content;
194
+ grid-template-columns: min-content min-content minmax(var(--space-layout-content-horizontal-buc0zz, 24px), 1fr) minmax(0, var(--awsui-max-content-width-9t5olz)) minmax(var(--space-layout-content-horizontal-buc0zz, 24px), 1fr) min-content min-content;
195
195
  grid-template-rows: min-content min-content 1fr min-content min-content;
196
196
  }
197
- .awsui_root_7nfqu_11rwq_153.awsui_has-adaptive-widths-default_7nfqu_11rwq_197:not(#\9) {
198
- --awsui-max-content-width-b75yp7: 1620px;
197
+ .awsui_root_7nfqu_1re3f_153.awsui_has-adaptive-widths-default_7nfqu_1re3f_197:not(#\9) {
198
+ --awsui-max-content-width-9t5olz: 1620px;
199
199
  }
200
200
  }
201
201
  @media (min-width: 689px) and (min-width: 1401px) {
202
- .awsui_root_7nfqu_11rwq_153.awsui_has-adaptive-widths-dashboard_7nfqu_11rwq_202:not(#\9) {
203
- --awsui-max-content-width-b75yp7: 1280px;
202
+ .awsui_root_7nfqu_1re3f_153.awsui_has-adaptive-widths-dashboard_7nfqu_1re3f_202:not(#\9) {
203
+ --awsui-max-content-width-9t5olz: 1280px;
204
204
  }
205
205
  }
206
206
  @media (min-width: 689px) and (min-width: 1921px) {
207
- .awsui_root_7nfqu_11rwq_153.awsui_has-adaptive-widths-dashboard_7nfqu_11rwq_202:not(#\9) {
208
- --awsui-max-content-width-b75yp7: 1620px;
207
+ .awsui_root_7nfqu_1re3f_153.awsui_has-adaptive-widths-dashboard_7nfqu_1re3f_202:not(#\9) {
208
+ --awsui-max-content-width-9t5olz: 1620px;
209
209
  }
210
210
  }
211
211
  @media (min-width: 689px) and (min-width: 2541px) {
212
- .awsui_root_7nfqu_11rwq_153.awsui_has-adaptive-widths-dashboard_7nfqu_11rwq_202:not(#\9) {
213
- --awsui-max-content-width-b75yp7: 2160px;
212
+ .awsui_root_7nfqu_1re3f_153.awsui_has-adaptive-widths-dashboard_7nfqu_1re3f_202:not(#\9) {
213
+ --awsui-max-content-width-9t5olz: 2160px;
214
214
  }
215
215
  }
216
216
  @media (min-width: 689px) {
217
- .awsui_root_7nfqu_11rwq_153.awsui_drawer-expanded-mode_7nfqu_11rwq_217:not(#\9) {
217
+ .awsui_root_7nfqu_1re3f_153.awsui_drawer-expanded-mode_7nfqu_1re3f_217:not(#\9) {
218
218
  grid-template-columns: 0 0 0 0 0 0 0 auto;
219
219
  }
220
- .awsui_root_7nfqu_11rwq_153.awsui_drawer-expanded-mode_7nfqu_11rwq_217.awsui_ai-drawer-expanded-mode_7nfqu_11rwq_220:not(#\9) {
220
+ .awsui_root_7nfqu_1re3f_153.awsui_drawer-expanded-mode_7nfqu_1re3f_217.awsui_ai-drawer-expanded-mode_7nfqu_1re3f_220:not(#\9) {
221
221
  grid-template-columns: auto 0 0 0 0 0 0 0;
222
222
  }
223
- .awsui_root_7nfqu_11rwq_153.awsui_drawer-expanded-mode_7nfqu_11rwq_217.awsui_bottom-drawer-expanded-mode_7nfqu_11rwq_223:not(#\9) {
223
+ .awsui_root_7nfqu_1re3f_153.awsui_drawer-expanded-mode_7nfqu_1re3f_217.awsui_bottom-drawer-expanded-mode_7nfqu_1re3f_223:not(#\9) {
224
224
  grid-template-rows: auto;
225
225
  grid-template-columns: 0 0 0 0 0 auto 0 0;
226
226
  }
227
227
  }
228
228
 
229
- .awsui_ai-drawer_7nfqu_11rwq_220:not(#\9),
230
- .awsui_navigation_7nfqu_11rwq_230:not(#\9),
231
- .awsui_tools_7nfqu_11rwq_231:not(#\9),
232
- .awsui_global-tools_7nfqu_11rwq_232:not(#\9),
233
- .awsui_bottom-tool_7nfqu_11rwq_233:not(#\9) {
229
+ .awsui_ai-drawer_7nfqu_1re3f_220:not(#\9),
230
+ .awsui_navigation_7nfqu_1re3f_230:not(#\9),
231
+ .awsui_tools_7nfqu_1re3f_231:not(#\9),
232
+ .awsui_global-tools_7nfqu_1re3f_232:not(#\9),
233
+ .awsui_bottom-tool_7nfqu_1re3f_233:not(#\9) {
234
234
  grid-row: 1/-1;
235
235
  grid-column: 1/-1;
236
236
  background: var(--color-background-container-content-6u8rvp, #ffffff);
237
237
  opacity: 1;
238
238
  }
239
239
  @media (max-width: 688px) {
240
- .awsui_ai-drawer_7nfqu_11rwq_220:not(#\9),
241
- .awsui_navigation_7nfqu_11rwq_230:not(#\9),
242
- .awsui_tools_7nfqu_11rwq_231:not(#\9),
243
- .awsui_global-tools_7nfqu_11rwq_232:not(#\9),
244
- .awsui_bottom-tool_7nfqu_11rwq_233:not(#\9) {
240
+ .awsui_ai-drawer_7nfqu_1re3f_220:not(#\9),
241
+ .awsui_navigation_7nfqu_1re3f_230:not(#\9),
242
+ .awsui_tools_7nfqu_1re3f_231:not(#\9),
243
+ .awsui_global-tools_7nfqu_1re3f_232:not(#\9),
244
+ .awsui_bottom-tool_7nfqu_1re3f_233:not(#\9) {
245
245
  inline-size: 100%;
246
246
  }
247
247
  }
248
248
 
249
249
  @media (min-width: 689px) {
250
- .awsui_bottom-tool_7nfqu_11rwq_233:not(#\9) {
250
+ .awsui_bottom-tool_7nfqu_1re3f_233:not(#\9) {
251
251
  grid-area: bottom-tool;
252
252
  position: sticky;
253
253
  inset-block-end: 0;
@@ -257,43 +257,43 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
257
257
  }
258
258
 
259
259
  @media (min-width: 689px) {
260
- .awsui_ai-drawer_7nfqu_11rwq_220:not(#\9) {
260
+ .awsui_ai-drawer_7nfqu_1re3f_220:not(#\9) {
261
261
  grid-area: ai-drawer;
262
262
  position: sticky;
263
263
  }
264
264
  }
265
265
 
266
- .awsui_navigation_7nfqu_11rwq_230:not(#\9) {
266
+ .awsui_navigation_7nfqu_1re3f_230:not(#\9) {
267
267
  z-index: 830;
268
268
  }
269
269
  @media (min-width: 689px) {
270
- .awsui_navigation_7nfqu_11rwq_230:not(#\9) {
270
+ .awsui_navigation_7nfqu_1re3f_230:not(#\9) {
271
271
  grid-area: navigation;
272
- inline-size: var(--awsui-navigation-width-b75yp7);
272
+ inline-size: var(--awsui-navigation-width-9t5olz);
273
273
  border-inline-end: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-ayg8vb, #c6c6cd);
274
274
  }
275
275
  }
276
276
  @media (max-width: 688px) {
277
- .awsui_navigation_7nfqu_11rwq_230:not(#\9) {
277
+ .awsui_navigation_7nfqu_1re3f_230:not(#\9) {
278
278
  z-index: 1001;
279
279
  }
280
280
  }
281
281
 
282
282
  @media (min-width: 689px) {
283
- .awsui_tools_7nfqu_11rwq_231:not(#\9) {
283
+ .awsui_tools_7nfqu_1re3f_231:not(#\9) {
284
284
  grid-area: tools;
285
285
  /* stylelint-disable plugin/no-unsupported-browser-features */
286
286
  }
287
- .awsui_tools_7nfqu_11rwq_231:not(#\9):not(:has(> [data-testid])) {
288
- inline-size: var(--awsui-tools-width-b75yp7);
287
+ .awsui_tools_7nfqu_1re3f_231:not(#\9):not(:has(> [data-testid])) {
288
+ inline-size: var(--awsui-tools-width-9t5olz);
289
289
  }
290
- .awsui_tools_7nfqu_11rwq_231:not(#\9):not(:has(> [data-testid])).awsui_tools-open_7nfqu_11rwq_290 {
290
+ .awsui_tools_7nfqu_1re3f_231:not(#\9):not(:has(> [data-testid])).awsui_tools-open_7nfqu_1re3f_290 {
291
291
  border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-ayg8vb, #c6c6cd);
292
292
  }
293
293
  }
294
294
 
295
295
  @media (min-width: 689px) {
296
- .awsui_global-tools_7nfqu_11rwq_232:not(#\9) {
296
+ .awsui_global-tools_7nfqu_1re3f_232:not(#\9) {
297
297
  display: flex;
298
298
  grid-area: global-tools;
299
299
  justify-content: flex-end;
@@ -301,14 +301,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
301
301
  }
302
302
 
303
303
  @media (min-width: 689px) {
304
- .awsui_split-panel-side_7nfqu_11rwq_304:not(#\9) {
304
+ .awsui_split-panel-side_7nfqu_1re3f_304:not(#\9) {
305
305
  grid-area: sideSplitPanel;
306
306
  border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-ayg8vb, #c6c6cd);
307
307
  opacity: 1;
308
308
  }
309
309
  }
310
310
 
311
- .awsui_split-panel-bottom_7nfqu_11rwq_311:not(#\9) {
311
+ .awsui_split-panel-bottom_7nfqu_1re3f_311:not(#\9) {
312
312
  position: sticky;
313
313
  z-index: 840;
314
314
  align-self: end;
@@ -316,81 +316,81 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
316
316
  grid-column: 1/-1;
317
317
  }
318
318
  @media (min-width: 689px) {
319
- .awsui_split-panel-bottom_7nfqu_11rwq_311:not(#\9) {
319
+ .awsui_split-panel-bottom_7nfqu_1re3f_311:not(#\9) {
320
320
  grid-column: 3/6;
321
321
  }
322
322
  }
323
323
 
324
- .awsui_panel-hidden_7nfqu_11rwq_324:not(#\9) {
324
+ .awsui_panel-hidden_7nfqu_1re3f_324:not(#\9) {
325
325
  border-block: none;
326
326
  border-inline: none;
327
327
  opacity: 0;
328
328
  z-index: 0;
329
329
  }
330
- .awsui_panel-hidden_7nfqu_11rwq_324.awsui_navigation_7nfqu_11rwq_230:not(#\9), .awsui_panel-hidden_7nfqu_11rwq_324.awsui_tools_7nfqu_11rwq_231:not(#\9), .awsui_panel-hidden_7nfqu_11rwq_324.awsui_global-tools_7nfqu_11rwq_232:not(#\9) {
330
+ .awsui_panel-hidden_7nfqu_1re3f_324.awsui_navigation_7nfqu_1re3f_230:not(#\9), .awsui_panel-hidden_7nfqu_1re3f_324.awsui_tools_7nfqu_1re3f_231:not(#\9), .awsui_panel-hidden_7nfqu_1re3f_324.awsui_global-tools_7nfqu_1re3f_232:not(#\9) {
331
331
  inline-size: 0px;
332
332
  }
333
333
 
334
- .awsui_toolbar-container_7nfqu_11rwq_334:not(#\9) {
334
+ .awsui_toolbar-container_7nfqu_1re3f_334:not(#\9) {
335
335
  grid-area: toolbar;
336
336
  block-size: 42px;
337
337
  border-block-end: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-ayg8vb, #c6c6cd);
338
338
  box-sizing: border-box;
339
339
  }
340
340
 
341
- .awsui_notifications-container_7nfqu_11rwq_341:not(#\9) {
341
+ .awsui_notifications-container_7nfqu_1re3f_341:not(#\9) {
342
342
  grid-area: notifications;
343
343
  }
344
344
 
345
- .awsui_notifications-background_7nfqu_11rwq_345:not(#\9) {
345
+ .awsui_notifications-background_7nfqu_1re3f_345:not(#\9) {
346
346
  background: var(--color-background-layout-main-5ilwcb, #ffffff);
347
347
  grid-area: notifications;
348
348
  grid-column: 1/-1;
349
349
  }
350
350
  @media (min-width: 689px) {
351
- .awsui_notifications-background_7nfqu_11rwq_345:not(#\9) {
351
+ .awsui_notifications-background_7nfqu_1re3f_345:not(#\9) {
352
352
  grid-column: 3/6;
353
353
  }
354
354
  }
355
355
 
356
- .awsui_main-landmark_7nfqu_11rwq_356:not(#\9) {
356
+ .awsui_main-landmark_7nfqu_1re3f_356:not(#\9) {
357
357
  display: contents;
358
358
  }
359
359
 
360
- .awsui_main_7nfqu_11rwq_356:not(#\9) {
360
+ .awsui_main_7nfqu_1re3f_356:not(#\9) {
361
361
  grid-area: main;
362
362
  margin-block-start: var(--space-scaled-s-8ozaad, 12px);
363
363
  margin-block-end: var(--space-layout-content-bottom-zeb1g9, 40px);
364
364
  }
365
- .awsui_main-disable-paddings_7nfqu_11rwq_365:not(#\9) {
365
+ .awsui_main-disable-paddings_7nfqu_1re3f_365:not(#\9) {
366
366
  margin-block: 0;
367
367
  grid-column: 1/-1;
368
368
  }
369
369
  @media (min-width: 689px) {
370
- .awsui_main-disable-paddings_7nfqu_11rwq_365:not(#\9) {
370
+ .awsui_main-disable-paddings_7nfqu_1re3f_365:not(#\9) {
371
371
  grid-column: 3/6;
372
372
  }
373
373
  }
374
374
 
375
- .awsui_content-header_7nfqu_11rwq_375:not(#\9) {
375
+ .awsui_content-header_7nfqu_1re3f_375:not(#\9) {
376
376
  margin-block-end: var(--space-content-header-padding-bottom-rvy5xz, 16px);
377
377
  }
378
378
 
379
- .awsui_content_7nfqu_11rwq_375:not(#\9) {
379
+ .awsui_content_7nfqu_1re3f_375:not(#\9) {
380
380
  display: contents;
381
381
  }
382
382
 
383
383
  /* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
384
384
  @media (max-width: 688px) {
385
- .awsui_unfocusable-mobile_7nfqu_11rwq_385 *:not(#\9) {
385
+ .awsui_unfocusable-mobile_7nfqu_1re3f_385 *:not(#\9) {
386
386
  visibility: hidden;
387
387
  }
388
388
  }
389
389
 
390
- .awsui_hidden_7nfqu_11rwq_390:not(#\9) {
390
+ .awsui_hidden_7nfqu_1re3f_390:not(#\9) {
391
391
  display: none;
392
392
  }
393
393
 
394
- .awsui_breadcrumbs-own_7nfqu_11rwq_394:not(#\9):not(:empty) + .awsui_breadcrumbs-discovered_7nfqu_11rwq_394 {
394
+ .awsui_breadcrumbs-own_7nfqu_1re3f_394:not(#\9):not(:empty) + .awsui_breadcrumbs-discovered_7nfqu_1re3f_394 {
395
395
  display: none;
396
396
  }
@@ -2,32 +2,32 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_7nfqu_11rwq_153",
6
- "has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_11rwq_197",
7
- "has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_11rwq_202",
8
- "drawer-expanded-mode": "awsui_drawer-expanded-mode_7nfqu_11rwq_217",
9
- "ai-drawer-expanded-mode": "awsui_ai-drawer-expanded-mode_7nfqu_11rwq_220",
10
- "bottom-drawer-expanded-mode": "awsui_bottom-drawer-expanded-mode_7nfqu_11rwq_223",
11
- "ai-drawer": "awsui_ai-drawer_7nfqu_11rwq_220",
12
- "navigation": "awsui_navigation_7nfqu_11rwq_230",
13
- "tools": "awsui_tools_7nfqu_11rwq_231",
14
- "global-tools": "awsui_global-tools_7nfqu_11rwq_232",
15
- "bottom-tool": "awsui_bottom-tool_7nfqu_11rwq_233",
16
- "tools-open": "awsui_tools-open_7nfqu_11rwq_290",
17
- "split-panel-side": "awsui_split-panel-side_7nfqu_11rwq_304",
18
- "split-panel-bottom": "awsui_split-panel-bottom_7nfqu_11rwq_311",
19
- "panel-hidden": "awsui_panel-hidden_7nfqu_11rwq_324",
20
- "toolbar-container": "awsui_toolbar-container_7nfqu_11rwq_334",
21
- "notifications-container": "awsui_notifications-container_7nfqu_11rwq_341",
22
- "notifications-background": "awsui_notifications-background_7nfqu_11rwq_345",
23
- "main-landmark": "awsui_main-landmark_7nfqu_11rwq_356",
24
- "main": "awsui_main_7nfqu_11rwq_356",
25
- "main-disable-paddings": "awsui_main-disable-paddings_7nfqu_11rwq_365",
26
- "content-header": "awsui_content-header_7nfqu_11rwq_375",
27
- "content": "awsui_content_7nfqu_11rwq_375",
28
- "unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_11rwq_385",
29
- "hidden": "awsui_hidden_7nfqu_11rwq_390",
30
- "breadcrumbs-own": "awsui_breadcrumbs-own_7nfqu_11rwq_394",
31
- "breadcrumbs-discovered": "awsui_breadcrumbs-discovered_7nfqu_11rwq_394"
5
+ "root": "awsui_root_7nfqu_1re3f_153",
6
+ "has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_1re3f_197",
7
+ "has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_1re3f_202",
8
+ "drawer-expanded-mode": "awsui_drawer-expanded-mode_7nfqu_1re3f_217",
9
+ "ai-drawer-expanded-mode": "awsui_ai-drawer-expanded-mode_7nfqu_1re3f_220",
10
+ "bottom-drawer-expanded-mode": "awsui_bottom-drawer-expanded-mode_7nfqu_1re3f_223",
11
+ "ai-drawer": "awsui_ai-drawer_7nfqu_1re3f_220",
12
+ "navigation": "awsui_navigation_7nfqu_1re3f_230",
13
+ "tools": "awsui_tools_7nfqu_1re3f_231",
14
+ "global-tools": "awsui_global-tools_7nfqu_1re3f_232",
15
+ "bottom-tool": "awsui_bottom-tool_7nfqu_1re3f_233",
16
+ "tools-open": "awsui_tools-open_7nfqu_1re3f_290",
17
+ "split-panel-side": "awsui_split-panel-side_7nfqu_1re3f_304",
18
+ "split-panel-bottom": "awsui_split-panel-bottom_7nfqu_1re3f_311",
19
+ "panel-hidden": "awsui_panel-hidden_7nfqu_1re3f_324",
20
+ "toolbar-container": "awsui_toolbar-container_7nfqu_1re3f_334",
21
+ "notifications-container": "awsui_notifications-container_7nfqu_1re3f_341",
22
+ "notifications-background": "awsui_notifications-background_7nfqu_1re3f_345",
23
+ "main-landmark": "awsui_main-landmark_7nfqu_1re3f_356",
24
+ "main": "awsui_main_7nfqu_1re3f_356",
25
+ "main-disable-paddings": "awsui_main-disable-paddings_7nfqu_1re3f_365",
26
+ "content-header": "awsui_content-header_7nfqu_1re3f_375",
27
+ "content": "awsui_content_7nfqu_1re3f_375",
28
+ "unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_1re3f_385",
29
+ "hidden": "awsui_hidden_7nfqu_1re3f_390",
30
+ "breadcrumbs-own": "awsui_breadcrumbs-own_7nfqu_1re3f_394",
31
+ "breadcrumbs-discovered": "awsui_breadcrumbs-discovered_7nfqu_1re3f_394"
32
32
  };
33
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGnF,QAAA,MAAM,eAAe,EA0BhB,6BAA6B,CAAC;AAInC,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGnF,QAAA,MAAM,eAAe,EAmChB,6BAA6B,CAAC;AAInC,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,eAAe,eAAe,CAAC"}
@@ -8,7 +8,7 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
8
8
  import InternalAttributeEditor from './internal';
9
9
  const AttributeEditor = React.forwardRef((_a, ref) => {
10
10
  var _b, _c;
11
- var { items = [], addButtonVariant = 'normal', isItemRemovable = () => true } = _a, props = __rest(_a, ["items", "addButtonVariant", "isItemRemovable"]);
11
+ var { items = [], addButtonVariant = 'normal', isItemRemovable = () => true, hideAddButton, additionalActions } = _a, props = __rest(_a, ["items", "addButtonVariant", "isItemRemovable", "hideAddButton", "additionalActions"]);
12
12
  const baseComponentProps = useBaseComponent('AttributeEditor', {
13
13
  props: {
14
14
  addButtonVariant: addButtonVariant,
@@ -19,7 +19,7 @@ const AttributeEditor = React.forwardRef((_a, ref) => {
19
19
  hasCustomRowActions: !!props.customRowActions,
20
20
  },
21
21
  });
22
- return (React.createElement(InternalAttributeEditor, Object.assign({ items: items, isItemRemovable: isItemRemovable, addButtonVariant: addButtonVariant }, props, baseComponentProps, { ref: ref })));
22
+ return (React.createElement(InternalAttributeEditor, Object.assign({ items: items, isItemRemovable: isItemRemovable, addButtonVariant: addButtonVariant, additionalActions: additionalActions, hideAddButton: hideAddButton }, props, baseComponentProps, { ref: ref })));
23
23
  });
24
24
  applyDisplayName(AttributeEditor, 'AttributeEditor');
25
25
  export default AttributeEditor;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attribute-editor/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,uBAAuB,MAAM,YAAY,CAAC;AAEjD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CACtC,CACE,EAA4G,EAC5G,GAAwC,EACxC,EAAE;;QAFF,EAAE,KAAK,GAAG,EAAE,EAAE,gBAAgB,GAAG,QAAQ,EAAE,eAAe,GAAG,GAAG,EAAE,CAAC,IAAI,OAAqC,EAAhC,KAAK,cAAjF,gDAAmF,CAAF;IAGjF,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE;QAC7D,KAAK,EAAE;YACL,gBAAgB,EAAE,gBAAgB;SACnC;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,MAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,mCAAI,IAAI;YACjD,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU;YACjC,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB;SAC9C;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,uBAAuB,kBACtB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,IAC9B,KAAK,EACL,kBAAkB,IACtB,GAAG,EAAE,GAAG,IACR,CACH,CAAC;AACJ,CAAC,CAC+B,CAAC;AAEnC,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AAGrD,eAAe,eAAe,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 useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AttributeEditorForwardRefType, AttributeEditorProps } from './interfaces';\nimport InternalAttributeEditor from './internal';\n\nconst AttributeEditor = React.forwardRef(\n <T,>(\n { items = [], addButtonVariant = 'normal', isItemRemovable = () => true, ...props }: AttributeEditorProps<T>,\n ref: React.Ref<AttributeEditorProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('AttributeEditor', {\n props: {\n addButtonVariant: addButtonVariant,\n },\n metadata: {\n definitionItems: props.definition?.length ?? null,\n hasGridLayout: !!props.gridLayout,\n hasCustomRowActions: !!props.customRowActions,\n },\n });\n return (\n <InternalAttributeEditor\n items={items}\n isItemRemovable={isItemRemovable}\n addButtonVariant={addButtonVariant}\n {...props}\n {...baseComponentProps}\n ref={ref}\n />\n );\n }\n) as AttributeEditorForwardRefType;\n\napplyDisplayName(AttributeEditor, 'AttributeEditor');\n\nexport { AttributeEditorProps };\nexport default AttributeEditor;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attribute-editor/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,uBAAuB,MAAM,YAAY,CAAC;AAEjD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CACtC,CACE,EAO0B,EAC1B,GAAwC,EACxC,EAAE;;QATF,EACE,KAAK,GAAG,EAAE,EACV,gBAAgB,GAAG,QAAQ,EAC3B,eAAe,GAAG,GAAG,EAAE,CAAC,IAAI,EAC5B,aAAa,EACb,iBAAiB,OAEO,EADrB,KAAK,cANV,sFAOC,CADS;IAIV,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE;QAC7D,KAAK,EAAE;YACL,gBAAgB,EAAE,gBAAgB;SACnC;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,MAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,mCAAI,IAAI;YACjD,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU;YACjC,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB;SAC9C;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,uBAAuB,kBACtB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,IACxB,KAAK,EACL,kBAAkB,IACtB,GAAG,EAAE,GAAG,IACR,CACH,CAAC;AACJ,CAAC,CAC+B,CAAC;AAEnC,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AAGrD,eAAe,eAAe,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 useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AttributeEditorForwardRefType, AttributeEditorProps } from './interfaces';\nimport InternalAttributeEditor from './internal';\n\nconst AttributeEditor = React.forwardRef(\n <T,>(\n {\n items = [],\n addButtonVariant = 'normal',\n isItemRemovable = () => true,\n hideAddButton,\n additionalActions,\n ...props\n }: AttributeEditorProps<T>,\n ref: React.Ref<AttributeEditorProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('AttributeEditor', {\n props: {\n addButtonVariant: addButtonVariant,\n },\n metadata: {\n definitionItems: props.definition?.length ?? null,\n hasGridLayout: !!props.gridLayout,\n hasCustomRowActions: !!props.customRowActions,\n },\n });\n return (\n <InternalAttributeEditor\n items={items}\n isItemRemovable={isItemRemovable}\n addButtonVariant={addButtonVariant}\n additionalActions={additionalActions}\n hideAddButton={hideAddButton}\n {...props}\n {...baseComponentProps}\n ref={ref}\n />\n );\n }\n) as AttributeEditorForwardRefType;\n\napplyDisplayName(AttributeEditor, 'AttributeEditor');\n\nexport { AttributeEditorProps };\nexport default AttributeEditor;\n"]}
@@ -108,6 +108,14 @@ export interface AttributeEditorProps<T> extends BaseComponentProps {
108
108
  * Determines whether the add button is disabled.
109
109
  */
110
110
  disableAddButton?: boolean;
111
+ /**
112
+ * Determines whether the add button is hidden
113
+ */
114
+ hideAddButton?: boolean;
115
+ /**
116
+ * Specifies additional actions displayed next to the add-button (or instead of the add-button if hidden).
117
+ */
118
+ additionalActions?: React.ReactNode;
111
119
  /**
112
120
  * Specifies the variant to use for the add button. By default a normal button is used.
113
121
  * Use `inline-link` when using an attribute editor nested inside complex attribute editing
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA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AC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAElE;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEpC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAC,gBAAgB,CAAC;IAEzD;;;;;;;;;;;;;OAaG;IACH,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAE5D;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAEvF;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAE9F;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { Breakpoint as InternalBreakpoint } from '../internal/breakpoints';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n description?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export type AddButtonVariant = 'normal' | 'inline-link';\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface RowActionsProps<T> {\n item: T;\n itemIndex: number;\n ref: React.Ref<ButtonDropdownProps.Ref>;\n breakpoint: Breakpoint | null;\n ownRow: boolean;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n /**\n * Provides a text alternative for the error icon in the error message.\n */\n errorIconAriaLabel?: string;\n\n /**\n * Provides a text alternative for the warning icon in the warning message.\n */\n warningIconAriaLabel?: string;\n\n /**\n * Announcement made to screen readers when an item is removed.\n */\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n\n export type Breakpoint = InternalBreakpoint;\n\n export interface GridLayout {\n breakpoint?: Breakpoint;\n rows: ReadonlyArray<ReadonlyArray<number>>;\n removeButton?: {\n ownRow?: boolean;\n width?: number | 'auto';\n };\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Specifies the variant to use for the add button. By default a normal button is used.\n * Use `inline-link` when using an attribute editor nested inside complex attribute editing\n * with expandable sections.\n */\n addButtonVariant?: AttributeEditorProps.AddButtonVariant;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * If more than 6 attributes are specified, a `gridLayout` must be provided.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `description` (ReactNode) - Additional description for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Optionally specifies the layout of the attributes. By default, all attributes will be\n * equally spaced and wrapped into multiple rows on smaller viewports.\n *\n * A `gridLayout` is an array of breakpoint definitions. Each definition consists of:\n * - `rows` (`number[][]`): the rows in which to display the attributes. Each row consists of a list of numbers indicating\n * the relative width of each attribute. For example, `[[1, 1, 1, 1]]` is a single row of four evenly-spaced attributes,\n * or `[[1, 2], [1, 1, 1]]` splits five attributes onto two rows.\n * - `breakpoint` (`string`): optionally specifies that the given entry should only be used when at least that much width is available.\n * - `removeButton`: optionally configures the remove (or row action) button placement. If this is not provided, the button will be\n * placed at the end of a single row, or below if multiple rows are present. The `removeButton` property supports contains two properties:\n * - `ownRow` (`boolean`): forces the remove button onto its own row.\n * - `width` (`number | 'auto'`): a number indicating the relative width (equivalent to a `rows` entry), or 'auto' to fit to the button width.\n */\n gridLayout?: ReadonlyArray<AttributeEditorProps.GridLayout>;\n\n /**\n * Specifies a custom action trigger for each row, in place of the remove button.\n * Only button and button dropdown components are supported.\n * If you provide this, `removeButtonText`, `removeButtonAriaLabel`,\n * and `onRemoveButtonClick` will be ignored.\n * The trigger must be given the provided `ref` in order for `focusRemoveButton`\n * to work.\n * The function receives the following properties:\n * - `item`: The item being rendered in the current row.\n * - `itemIndex` (`number`): The index of the item.\n * - `ref` (`ReactRef`): A React ref that should be passed to the rendered button.\n * - `breakpoint` (`Breakpoint`): The current breakpoint, for responsive behavior.\n * - `ownRow` (`boolean`): Whether the button is rendered on its own row.\n */\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { Breakpoint as InternalBreakpoint } from '../internal/breakpoints';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n description?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export type AddButtonVariant = 'normal' | 'inline-link';\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface RowActionsProps<T> {\n item: T;\n itemIndex: number;\n ref: React.Ref<ButtonDropdownProps.Ref>;\n breakpoint: Breakpoint | null;\n ownRow: boolean;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n /**\n * Provides a text alternative for the error icon in the error message.\n */\n errorIconAriaLabel?: string;\n\n /**\n * Provides a text alternative for the warning icon in the warning message.\n */\n warningIconAriaLabel?: string;\n\n /**\n * Announcement made to screen readers when an item is removed.\n */\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n\n export type Breakpoint = InternalBreakpoint;\n\n export interface GridLayout {\n breakpoint?: Breakpoint;\n rows: ReadonlyArray<ReadonlyArray<number>>;\n removeButton?: {\n ownRow?: boolean;\n width?: number | 'auto';\n };\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Determines whether the add button is hidden\n */\n hideAddButton?: boolean;\n\n /**\n * Specifies additional actions displayed next to the add-button (or instead of the add-button if hidden).\n */\n additionalActions?: React.ReactNode;\n\n /**\n * Specifies the variant to use for the add button. By default a normal button is used.\n * Use `inline-link` when using an attribute editor nested inside complex attribute editing\n * with expandable sections.\n */\n addButtonVariant?: AttributeEditorProps.AddButtonVariant;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * If more than 6 attributes are specified, a `gridLayout` must be provided.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `description` (ReactNode) - Additional description for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Optionally specifies the layout of the attributes. By default, all attributes will be\n * equally spaced and wrapped into multiple rows on smaller viewports.\n *\n * A `gridLayout` is an array of breakpoint definitions. Each definition consists of:\n * - `rows` (`number[][]`): the rows in which to display the attributes. Each row consists of a list of numbers indicating\n * the relative width of each attribute. For example, `[[1, 1, 1, 1]]` is a single row of four evenly-spaced attributes,\n * or `[[1, 2], [1, 1, 1]]` splits five attributes onto two rows.\n * - `breakpoint` (`string`): optionally specifies that the given entry should only be used when at least that much width is available.\n * - `removeButton`: optionally configures the remove (or row action) button placement. If this is not provided, the button will be\n * placed at the end of a single row, or below if multiple rows are present. The `removeButton` property supports contains two properties:\n * - `ownRow` (`boolean`): forces the remove button onto its own row.\n * - `width` (`number | 'auto'`): a number indicating the relative width (equivalent to a `rows` entry), or 'auto' to fit to the button width.\n */\n gridLayout?: ReadonlyArray<AttributeEditorProps.GridLayout>;\n\n /**\n * Specifies a custom action trigger for each row, in place of the remove button.\n * Only button and button dropdown components are supported.\n * If you provide this, `removeButtonText`, `removeButtonAriaLabel`,\n * and `onRemoveButtonClick` will be ignored.\n * The trigger must be given the provided `ref` in order for `focusRemoveButton`\n * to work.\n * The function receives the following properties:\n * - `item`: The item being rendered in the current row.\n * - `itemIndex` (`number`): The index of the item.\n * - `ref` (`ReactRef`): A React ref that should be passed to the rendered button.\n * - `breakpoint` (`Breakpoint`): The current breakpoint, for responsive behavior.\n * - `ownRow` (`boolean`): Whether the button is rendered on its own row.\n */\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/internal.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,6BAA6B,EAAwB,MAAM,cAAc,CAAC;AASnF,QAAA,MAAM,uBAAuB,EA+JxB,6BAA6B,CAAC;AAEnC,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/internal.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,6BAA6B,EAAwB,MAAM,cAAc,CAAC;AASnF,QAAA,MAAM,uBAAuB,EAwKxB,6BAA6B,CAAC;AAEnC,eAAe,uBAAuB,CAAC"}
@@ -11,13 +11,14 @@ import { matchBreakpointMapping } from '../internal/breakpoints';
11
11
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
12
12
  import { usePrevious } from '../internal/hooks/use-previous';
13
13
  import InternalLiveRegion from '../live-region/internal';
14
+ import InternalSpaceBetween from '../space-between/internal';
14
15
  import { AdditionalInfo } from './additional-info';
15
16
  import { gridDefaults } from './grid-defaults';
16
17
  import { Row } from './row';
17
18
  import { getGridTemplateColumns } from './utils';
18
19
  import styles from './styles.css.js';
19
20
  const InternalAttributeEditor = React.forwardRef((_a, ref) => {
20
- var { additionalInfo, disableAddButton, definition = [{}], gridLayout, items, isItemRemovable = () => true, empty, addButtonText, addButtonVariant, removeButtonText, removeButtonAriaLabel, customRowActions, i18nStrings, onAddButtonClick, onRemoveButtonClick, __internalRootRef } = _a, props = __rest(_a, ["additionalInfo", "disableAddButton", "definition", "gridLayout", "items", "isItemRemovable", "empty", "addButtonText", "addButtonVariant", "removeButtonText", "removeButtonAriaLabel", "customRowActions", "i18nStrings", "onAddButtonClick", "onRemoveButtonClick", "__internalRootRef"]);
21
+ var { additionalInfo, disableAddButton, definition = [{}], gridLayout, items, isItemRemovable = () => true, empty, addButtonText, addButtonVariant, removeButtonText, removeButtonAriaLabel, customRowActions, i18nStrings, onAddButtonClick, onRemoveButtonClick, __internalRootRef, hideAddButton, additionalActions } = _a, props = __rest(_a, ["additionalInfo", "disableAddButton", "definition", "gridLayout", "items", "isItemRemovable", "empty", "addButtonText", "addButtonVariant", "removeButtonText", "removeButtonAriaLabel", "customRowActions", "i18nStrings", "onAddButtonClick", "onRemoveButtonClick", "__internalRootRef", "hideAddButton", "additionalActions"]);
21
22
  const removeButtonRefs = useRef([]);
22
23
  const addButtonRef = useRef(null);
23
24
  const wasNonEmpty = useRef(false);
@@ -79,11 +80,13 @@ const InternalAttributeEditor = React.forwardRef((_a, ref) => {
79
80
  isEmpty && React.createElement("div", { className: clsx(styles.empty, wasNonEmpty.current && styles['empty-appear']) }, empty),
80
81
  items.map((item, index) => (React.createElement(Row, { key: index, index: index, breakpoint: breakpoint, layout: gridLayoutForBreakpoint, item: item, definition: definition, i18nStrings: i18nStrings, removable: isItemRemovable(item), removeButtonText: removeButtonText, removeButtonRefs: removeButtonRefs.current, customRowActions: customRowActions, onRemoveButtonClick: onRemoveButtonClick, removeButtonAriaLabel: removeButtonAriaLabel }))),
81
82
  React.createElement("div", { className: styles['add-row'] },
82
- React.createElement(InternalButton, { className: styles['add-button'], disabled: disableAddButton,
83
- // Using aria-disabled="true" and tabindex="-1" instead of "disabled"
84
- // because focus can be dynamically moved to this button by calling
85
- // `focusAddButton()` on the ref.
86
- nativeButtonAttributes: disableAddButton ? { tabIndex: -1 } : {}, __skipNativeAttributesWarnings: true, __focusable: true, onClick: onAddButtonClick, formAction: "none", ref: addButtonRef, ariaDescribedby: infoAriaDescribedBy, variant: addButtonVariant, iconName: addButtonVariant === 'inline-link' ? 'add-plus' : undefined }, addButtonText),
83
+ (!hideAddButton || additionalActions) && (React.createElement(InternalSpaceBetween, { size: "xs", direction: "horizontal" },
84
+ !hideAddButton && (React.createElement(InternalButton, { className: styles['add-button'], disabled: disableAddButton,
85
+ // Using aria-disabled="true" and tabindex="-1" instead of "disabled"
86
+ // because focus can be dynamically moved to this button by calling
87
+ // `focusAddButton()` on the ref.
88
+ nativeButtonAttributes: disableAddButton ? { tabIndex: -1 } : {}, __skipNativeAttributesWarnings: true, __focusable: true, onClick: onAddButtonClick, formAction: "none", ref: addButtonRef, ariaDescribedby: infoAriaDescribedBy, variant: addButtonVariant, iconName: addButtonVariant === 'inline-link' ? 'add-plus' : undefined }, addButtonText)),
89
+ additionalActions)),
87
90
  React.createElement(InternalLiveRegion, { "data-testid": "removal-announcement", tagName: "span", hidden: true, delay: 5, key: items.length }, removalAnnouncement),
88
91
  !!additionalInfo && React.createElement(AdditionalInfo, { id: infoAriaDescribedBy }, additionalInfo))));
89
92
  });