@cloudscape-design/components-themeable 3.0.1312 → 3.0.1313
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.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/button-dropdown/category-elements/styles.scss +5 -0
- package/lib/internal/scss/button-dropdown/styles.scss +14 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/utils/theming.scss +6 -0
- package/lib/internal/scss/segmented-control/styles.scss +2 -2
- package/lib/internal/scss/steps/styles.scss +39 -0
- package/lib/internal/scss/table/header-cell/styles.scss +13 -2
- package/lib/internal/scss/table/resizer/styles.scss +9 -1
- package/lib/internal/scss/toggle/styles.scss +1 -1
- package/lib/internal/scss/toggle-button/styles.scss +7 -1
- package/lib/internal/scss/token/mixins.scss +4 -4
- package/lib/internal/scss/token/styles.scss +7 -0
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js +4 -2
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js +4 -2
- package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/styles.css.js +19 -18
- package/lib/internal/template/button-dropdown/category-elements/styles.scoped.css +32 -28
- package/lib/internal/template/button-dropdown/category-elements/styles.selectors.js +19 -18
- package/lib/internal/template/button-dropdown/index.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/index.js +4 -3
- package/lib/internal/template/button-dropdown/index.js.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.d.ts +22 -0
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/internal.js +14 -6
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/styles.css.js +23 -22
- package/lib/internal/template/button-dropdown/styles.scoped.css +36 -30
- package/lib/internal/template/button-dropdown/styles.selectors.js +23 -22
- package/lib/internal/template/button-group/interfaces.d.ts +12 -1
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js +2 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +59 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.js +11 -2
- package/lib/internal/template/internal/components/checkbox-icon/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +7 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +7 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +203 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +63 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +63 -0
- package/lib/internal/template/internal/generated/theming/index.js +203 -0
- package/lib/internal/template/internal/utils/throttle.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/throttle.js +3 -1
- package/lib/internal/template/internal/utils/throttle.js.map +1 -1
- package/lib/internal/template/progress-bar/index.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/index.js +1 -0
- package/lib/internal/template/progress-bar/index.js.map +1 -1
- package/lib/internal/template/segmented-control/styles.css.js +16 -16
- package/lib/internal/template/segmented-control/styles.scoped.css +34 -34
- package/lib/internal/template/segmented-control/styles.selectors.js +16 -16
- package/lib/internal/template/steps/internal.d.ts.map +1 -1
- package/lib/internal/template/steps/internal.js +20 -6
- package/lib/internal/template/steps/internal.js.map +1 -1
- package/lib/internal/template/steps/styles.css.js +12 -9
- package/lib/internal/template/steps/styles.scoped.css +43 -15
- package/lib/internal/template/steps/styles.selectors.js +12 -9
- package/lib/internal/template/table/header-cell/group-header-cell.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/group-header-cell.js +1 -1
- package/lib/internal/template/table/header-cell/group-header-cell.js.map +1 -1
- package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/index.js +2 -1
- package/lib/internal/template/table/header-cell/index.js.map +1 -1
- package/lib/internal/template/table/header-cell/styles.css.js +33 -33
- package/lib/internal/template/table/header-cell/styles.scoped.css +81 -74
- package/lib/internal/template/table/header-cell/styles.selectors.js +33 -33
- package/lib/internal/template/table/resizer/index.d.ts +4 -2
- package/lib/internal/template/table/resizer/index.d.ts.map +1 -1
- package/lib/internal/template/table/resizer/index.js +4 -4
- package/lib/internal/template/table/resizer/index.js.map +1 -1
- package/lib/internal/template/table/resizer/styles.css.js +17 -16
- package/lib/internal/template/table/resizer/styles.scoped.css +32 -24
- package/lib/internal/template/table/resizer/styles.selectors.js +17 -16
- package/lib/internal/template/table/selection/selection-cell.d.ts +2 -1
- package/lib/internal/template/table/selection/selection-cell.d.ts.map +1 -1
- package/lib/internal/template/table/selection/selection-cell.js +2 -2
- package/lib/internal/template/table/selection/selection-cell.js.map +1 -1
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js +1 -1
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +18 -18
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/toggle-button/internal.d.ts.map +1 -1
- package/lib/internal/template/toggle-button/internal.js +3 -1
- package/lib/internal/template/toggle-button/internal.js.map +1 -1
- package/lib/internal/template/toggle-button/styles.css.js +4 -3
- package/lib/internal/template/toggle-button/styles.scoped.css +8 -3
- package/lib/internal/template/toggle-button/styles.selectors.js +4 -3
- package/lib/internal/template/token/dismiss-button.d.ts.map +1 -1
- package/lib/internal/template/token/dismiss-button.js +3 -1
- package/lib/internal/template/token/dismiss-button.js.map +1 -1
- package/lib/internal/template/token/internal.d.ts.map +1 -1
- package/lib/internal/template/token/internal.js +11 -3
- package/lib/internal/template/token/internal.js.map +1 -1
- package/lib/internal/template/token/styles.css.js +14 -14
- package/lib/internal/template/token/styles.scoped.css +33 -30
- package/lib/internal/template/token/styles.selectors.js +14 -14
- package/package.json +1 -1
|
@@ -142,52 +142,52 @@
|
|
|
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_button-
|
|
145
|
+
.awsui_button-dropdown_sne0l_1sbhr_145:not(#\9) {
|
|
146
146
|
display: inline-block;
|
|
147
147
|
}
|
|
148
|
-
.awsui_button-
|
|
148
|
+
.awsui_button-dropdown_sne0l_1sbhr_145.awsui_full-width_sne0l_1sbhr_148:not(#\9) {
|
|
149
149
|
inline-size: 100%;
|
|
150
150
|
display: block;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
.awsui_items-list-
|
|
153
|
+
.awsui_items-list-container_sne0l_1sbhr_153:not(#\9) {
|
|
154
154
|
padding-block: 0;
|
|
155
155
|
padding-inline: 0;
|
|
156
156
|
margin-block: 0;
|
|
157
157
|
margin-inline: 0;
|
|
158
|
-
animation: awsui_awsui-motion-fade-in-
|
|
158
|
+
animation: awsui_awsui-motion-fade-in-0_sne0l_1sbhr_1 500ms var(--motion-easing-show-quick-xucy9w, ease-out);
|
|
159
159
|
animation-fill-mode: none;
|
|
160
160
|
}
|
|
161
161
|
@media (prefers-reduced-motion: reduce) {
|
|
162
|
-
.awsui_items-list-
|
|
162
|
+
.awsui_items-list-container_sne0l_1sbhr_153:not(#\9) {
|
|
163
163
|
animation: none;
|
|
164
164
|
transition: none;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
.awsui-motion-disabled .awsui_items-list-
|
|
167
|
+
.awsui-motion-disabled .awsui_items-list-container_sne0l_1sbhr_153:not(#\9), .awsui-mode-entering .awsui_items-list-container_sne0l_1sbhr_153:not(#\9) {
|
|
168
168
|
animation: none;
|
|
169
169
|
transition: none;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
.
|
|
172
|
+
.awsui_rotate_sne0l_1sbhr_172:not(#\9) {
|
|
173
173
|
transform: rotate(0deg);
|
|
174
174
|
transition: transform var(--motion-duration-rotate-180-4er9qu, 135ms) var(--motion-easing-rotate-180-xlspcm, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
175
175
|
}
|
|
176
176
|
@media (prefers-reduced-motion: reduce) {
|
|
177
|
-
.
|
|
177
|
+
.awsui_rotate_sne0l_1sbhr_172:not(#\9) {
|
|
178
178
|
animation: none;
|
|
179
179
|
transition: none;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
.awsui-motion-disabled .
|
|
182
|
+
.awsui-motion-disabled .awsui_rotate_sne0l_1sbhr_172:not(#\9), .awsui-mode-entering .awsui_rotate_sne0l_1sbhr_172:not(#\9) {
|
|
183
183
|
animation: none;
|
|
184
184
|
transition: none;
|
|
185
185
|
}
|
|
186
|
-
.awsui_rotate-
|
|
186
|
+
.awsui_rotate-open_sne0l_1sbhr_186:not(#\9) {
|
|
187
187
|
transform: rotate(-180deg);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
.
|
|
190
|
+
.awsui_header_sne0l_1sbhr_190:not(#\9) {
|
|
191
191
|
display: flex;
|
|
192
192
|
flex-direction: column;
|
|
193
193
|
list-style: none;
|
|
@@ -198,72 +198,78 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
198
198
|
border-inline: var(--border-width-dropdown-qic2p4, 1px) solid transparent;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
.
|
|
202
|
-
.
|
|
201
|
+
.awsui_title_sne0l_1sbhr_201:not(#\9),
|
|
202
|
+
.awsui_description_sne0l_1sbhr_202:not(#\9) {
|
|
203
203
|
color: var(--color-text-top-navigation-title-4lkrln, #16191f);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
.awsui_trigger-
|
|
206
|
+
.awsui_trigger-button_sne0l_1sbhr_206.awsui_one-theme_sne0l_1sbhr_206:not(#\9) {
|
|
207
207
|
display: flex;
|
|
208
208
|
align-items: center;
|
|
209
209
|
}
|
|
210
|
-
.awsui_trigger-
|
|
210
|
+
.awsui_trigger-button_sne0l_1sbhr_206.awsui_full-width_sne0l_1sbhr_148:not(#\9) {
|
|
211
211
|
display: grid;
|
|
212
212
|
grid-template-columns: 1fr auto;
|
|
213
213
|
}
|
|
214
|
-
.awsui_trigger-
|
|
214
|
+
.awsui_trigger-button_sne0l_1sbhr_206.awsui_full-width_sne0l_1sbhr_148.awsui_loading_sne0l_1sbhr_214:not(#\9) {
|
|
215
215
|
grid-template-columns: auto 1fr auto;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
.awsui_split-trigger-
|
|
218
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218:not(#\9) {
|
|
219
219
|
display: flex;
|
|
220
220
|
}
|
|
221
|
-
.awsui_split-trigger-
|
|
221
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221 > .awsui_trigger-button_sne0l_1sbhr_206:not(#\9):focus, .awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221 > .awsui_trigger-button_sne0l_1sbhr_206:not(#\9):hover {
|
|
222
222
|
z-index: 1;
|
|
223
223
|
}
|
|
224
|
-
.awsui_split-trigger-
|
|
224
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
225
225
|
border-start-end-radius: 0;
|
|
226
226
|
border-end-end-radius: 0;
|
|
227
227
|
padding-inline-end: var(--space-m-n2lypl, 16px);
|
|
228
228
|
margin-inline-end: var(--space-xxxs-3w1kr2, 2px);
|
|
229
229
|
}
|
|
230
|
-
.awsui_split-trigger-
|
|
230
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_1sbhr_206.awsui_has-no-text_sne0l_1sbhr_230 {
|
|
231
231
|
padding-inline: var(--space-button-icon-only-horizontal-67q6rd, 16px);
|
|
232
232
|
}
|
|
233
|
-
.awsui_split-trigger-
|
|
233
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_1sbhr_206.awsui_has-no-text_sne0l_1sbhr_230.awsui_visual-refresh_sne0l_1sbhr_233 {
|
|
234
234
|
padding-inline-start: calc(var(--space-s-4a5hs8, 12px) - 2px);
|
|
235
235
|
}
|
|
236
|
-
.awsui_split-trigger-
|
|
236
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:first-child) > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
237
237
|
border-start-start-radius: 0;
|
|
238
238
|
border-end-start-radius: 0;
|
|
239
239
|
padding-inline: calc(var(--space-xs-kw7k3v, 8px) - 2px);
|
|
240
240
|
}
|
|
241
|
-
.awsui_split-trigger-
|
|
241
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:first-child).awsui_visual-refresh_sne0l_1sbhr_233 > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
242
242
|
padding-inline-end: calc(var(--space-s-4a5hs8, 12px) - 2px);
|
|
243
243
|
}
|
|
244
|
-
.awsui_split-trigger-
|
|
244
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221.awsui_variant-normal_sne0l_1sbhr_244:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
245
245
|
margin-inline-end: 0;
|
|
246
246
|
}
|
|
247
|
-
.awsui_split-trigger-
|
|
247
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221.awsui_variant-normal_sne0l_1sbhr_244:not(#\9):not(:first-child) > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
248
248
|
margin-inline-start: calc(var(--border-width-button-40y1n5, 1px) * -1);
|
|
249
249
|
}
|
|
250
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:first-child).awsui_one-theme_sne0l_1sbhr_206 > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
251
|
+
padding-inline: calc(var(--space-xs-kw7k3v, 8px) - 2px);
|
|
252
|
+
}
|
|
253
|
+
.awsui_split-trigger-wrapper_sne0l_1sbhr_218 > .awsui_trigger-item_sne0l_1sbhr_221:not(#\9):not(:first-child).awsui_one-theme_sne0l_1sbhr_206.awsui_has-trigger-text_sne0l_1sbhr_253 > .awsui_trigger-button_sne0l_1sbhr_206 {
|
|
254
|
+
padding-inline: calc(var(--space-xs-kw7k3v, 8px) + 2px);
|
|
255
|
+
}
|
|
250
256
|
|
|
251
|
-
.awsui_split-
|
|
257
|
+
.awsui_split-trigger_sne0l_1sbhr_218:not(#\9) {
|
|
252
258
|
display: contents;
|
|
253
259
|
}
|
|
254
260
|
|
|
255
|
-
.awsui_dropdown-
|
|
261
|
+
.awsui_dropdown-trigger_sne0l_1sbhr_261:not(#\9) {
|
|
256
262
|
display: contents;
|
|
257
263
|
}
|
|
258
264
|
|
|
259
|
-
.awsui_main-action-full-
|
|
265
|
+
.awsui_main-action-full-width_sne0l_1sbhr_265:not(#\9) {
|
|
260
266
|
flex: 1 1 0;
|
|
261
267
|
}
|
|
262
268
|
|
|
263
|
-
.awsui_main-action-trigger-full-
|
|
269
|
+
.awsui_main-action-trigger-full-width_sne0l_1sbhr_269:not(#\9) {
|
|
264
270
|
flex: 0 0 auto;
|
|
265
271
|
}
|
|
266
272
|
|
|
267
|
-
.awsui_test-utils-button-
|
|
273
|
+
.awsui_test-utils-button-trigger_sne0l_1sbhr_273:not(#\9) {
|
|
268
274
|
/* used in test-utils */
|
|
269
275
|
}
|
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"button-dropdown": "awsui_button-
|
|
6
|
-
"full-width": "awsui_full-
|
|
7
|
-
"items-list-container": "awsui_items-list-
|
|
8
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
9
|
-
"rotate": "
|
|
10
|
-
"rotate-open": "awsui_rotate-
|
|
11
|
-
"header": "
|
|
12
|
-
"title": "
|
|
13
|
-
"description": "
|
|
14
|
-
"trigger-button": "awsui_trigger-
|
|
15
|
-
"one-theme": "awsui_one-
|
|
16
|
-
"loading": "
|
|
17
|
-
"split-trigger-wrapper": "awsui_split-trigger-
|
|
18
|
-
"trigger-item": "awsui_trigger-
|
|
19
|
-
"has-no-text": "awsui_has-no-
|
|
20
|
-
"visual-refresh": "awsui_visual-
|
|
21
|
-
"variant-normal": "awsui_variant-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"main-action-
|
|
26
|
-
"
|
|
5
|
+
"button-dropdown": "awsui_button-dropdown_sne0l_1sbhr_145",
|
|
6
|
+
"full-width": "awsui_full-width_sne0l_1sbhr_148",
|
|
7
|
+
"items-list-container": "awsui_items-list-container_sne0l_1sbhr_153",
|
|
8
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_sne0l_1sbhr_1",
|
|
9
|
+
"rotate": "awsui_rotate_sne0l_1sbhr_172",
|
|
10
|
+
"rotate-open": "awsui_rotate-open_sne0l_1sbhr_186",
|
|
11
|
+
"header": "awsui_header_sne0l_1sbhr_190",
|
|
12
|
+
"title": "awsui_title_sne0l_1sbhr_201",
|
|
13
|
+
"description": "awsui_description_sne0l_1sbhr_202",
|
|
14
|
+
"trigger-button": "awsui_trigger-button_sne0l_1sbhr_206",
|
|
15
|
+
"one-theme": "awsui_one-theme_sne0l_1sbhr_206",
|
|
16
|
+
"loading": "awsui_loading_sne0l_1sbhr_214",
|
|
17
|
+
"split-trigger-wrapper": "awsui_split-trigger-wrapper_sne0l_1sbhr_218",
|
|
18
|
+
"trigger-item": "awsui_trigger-item_sne0l_1sbhr_221",
|
|
19
|
+
"has-no-text": "awsui_has-no-text_sne0l_1sbhr_230",
|
|
20
|
+
"visual-refresh": "awsui_visual-refresh_sne0l_1sbhr_233",
|
|
21
|
+
"variant-normal": "awsui_variant-normal_sne0l_1sbhr_244",
|
|
22
|
+
"has-trigger-text": "awsui_has-trigger-text_sne0l_1sbhr_253",
|
|
23
|
+
"split-trigger": "awsui_split-trigger_sne0l_1sbhr_218",
|
|
24
|
+
"dropdown-trigger": "awsui_dropdown-trigger_sne0l_1sbhr_261",
|
|
25
|
+
"main-action-full-width": "awsui_main-action-full-width_sne0l_1sbhr_265",
|
|
26
|
+
"main-action-trigger-full-width": "awsui_main-action-trigger-full-width_sne0l_1sbhr_269",
|
|
27
|
+
"test-utils-button-trigger": "awsui_test-utils-button-trigger_sne0l_1sbhr_273"
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -79,6 +79,10 @@ export interface ButtonGroupProps extends BaseComponentProps {
|
|
|
79
79
|
* * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.
|
|
80
80
|
* * `loading` (optional, boolean) - The loading state indication for the menu button.
|
|
81
81
|
* * `loadingText` (optional, string) - The loading text announced to screen readers.
|
|
82
|
+
* * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/). Defaults to `ellipsis`.
|
|
83
|
+
* * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.
|
|
84
|
+
* * `iconUrl` (optional, string) - Specifies the URL of a custom icon.
|
|
85
|
+
* * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).
|
|
82
86
|
* * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.
|
|
83
87
|
*
|
|
84
88
|
* ### group
|
|
@@ -115,8 +119,11 @@ export interface IconToggleButtonRuntime extends Omit<ButtonGroupProps.IconToggl
|
|
|
115
119
|
iconSvg?: string;
|
|
116
120
|
pressedIconSvg?: string;
|
|
117
121
|
}
|
|
122
|
+
export interface MenuDropdownRuntime extends Omit<ButtonGroupProps.MenuDropdown, 'iconSvg'> {
|
|
123
|
+
iconSvg?: string;
|
|
124
|
+
}
|
|
118
125
|
export type ItemOrGroupRuntime = ItemRuntime | ButtonGroupProps.Group;
|
|
119
|
-
export type ItemRuntime = IconButtonRuntime | IconToggleButtonRuntime | ButtonGroupProps.IconFileInput |
|
|
126
|
+
export type ItemRuntime = IconButtonRuntime | IconToggleButtonRuntime | ButtonGroupProps.IconFileInput | MenuDropdownRuntime;
|
|
120
127
|
export type InternalItemOrGroup = InternalItem | ButtonGroupProps.Group;
|
|
121
128
|
export type InternalItem = InternalIconButton | InternalIconToggleButton | ButtonGroupProps.IconFileInput | ButtonGroupProps.MenuDropdown;
|
|
122
129
|
export interface InternalButtonGroupProps extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>, InternalBaseComponentProps {
|
|
@@ -174,6 +181,10 @@ export declare namespace ButtonGroupProps {
|
|
|
174
181
|
disabledReason?: string;
|
|
175
182
|
loading?: boolean;
|
|
176
183
|
loadingText?: string;
|
|
184
|
+
iconName?: IconProps.Name;
|
|
185
|
+
iconAlt?: string;
|
|
186
|
+
iconUrl?: string;
|
|
187
|
+
iconSvg?: React.ReactNode;
|
|
177
188
|
items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;
|
|
178
189
|
}
|
|
179
190
|
interface Group {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAA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ACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,KAAK,CAAC,EAAE,MAAM,CAAC;aAChB,CAAC;YACF,SAAS,CAAC,EAAE;gBACV,MAAM,CAAC,EAAE,MAAM,CAAC;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 * An object containing CSS properties to customize the button group's visual appearance.\n * Refer to the [style](/components/button-group/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ButtonGroupProps.Style;\n}\n\nexport interface InternalIconButton extends ButtonGroupProps.IconButton {\n analyticsAction?: string;\n}\nexport interface InternalIconToggleButton extends ButtonGroupProps.IconToggleButton {\n analyticsAction?: string;\n}\n\nexport interface IconButtonRuntime extends Omit<ButtonGroupProps.IconButton, 'iconSvg' | 'popoverFeedback'> {\n iconSvg?: string;\n}\nexport interface IconToggleButtonRuntime\n extends Omit<\n ButtonGroupProps.IconToggleButton,\n 'iconSvg' | 'pressedIconSvg' | 'popoverFeedback' | 'pressedPopoverFeedback'\n > {\n iconSvg?: string;\n pressedIconSvg?: string;\n}\nexport type ItemOrGroupRuntime = ItemRuntime | ButtonGroupProps.Group;\nexport type ItemRuntime =\n | IconButtonRuntime\n | IconToggleButtonRuntime\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport type InternalItemOrGroup = InternalItem | ButtonGroupProps.Group;\nexport type InternalItem =\n | InternalIconButton\n | InternalIconToggleButton\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {\n style?: ButtonGroupProps.Style;\n items: ReadonlyArray<InternalItemOrGroup>;\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"]}
|
|
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 * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/). Defaults to `ellipsis`.\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 * * `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 * An object containing CSS properties to customize the button group's visual appearance.\n * Refer to the [style](/components/button-group/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ButtonGroupProps.Style;\n}\n\nexport interface InternalIconButton extends ButtonGroupProps.IconButton {\n analyticsAction?: string;\n}\nexport interface InternalIconToggleButton extends ButtonGroupProps.IconToggleButton {\n analyticsAction?: string;\n}\n\nexport interface IconButtonRuntime extends Omit<ButtonGroupProps.IconButton, 'iconSvg' | 'popoverFeedback'> {\n iconSvg?: string;\n}\nexport interface IconToggleButtonRuntime\n extends Omit<\n ButtonGroupProps.IconToggleButton,\n 'iconSvg' | 'pressedIconSvg' | 'popoverFeedback' | 'pressedPopoverFeedback'\n > {\n iconSvg?: string;\n pressedIconSvg?: string;\n}\nexport interface MenuDropdownRuntime extends Omit<ButtonGroupProps.MenuDropdown, 'iconSvg'> {\n iconSvg?: string;\n}\nexport type ItemOrGroupRuntime = ItemRuntime | ButtonGroupProps.Group;\nexport type ItemRuntime =\n | IconButtonRuntime\n | IconToggleButtonRuntime\n | ButtonGroupProps.IconFileInput\n | MenuDropdownRuntime;\n\nexport type InternalItemOrGroup = InternalItem | ButtonGroupProps.Group;\nexport type InternalItem =\n | InternalIconButton\n | InternalIconToggleButton\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {\n style?: ButtonGroupProps.Style;\n items: ReadonlyArray<InternalItemOrGroup>;\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 iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-dropdown-item.d.ts","sourceRoot":"","sources":["../../../src/button-group/menu-dropdown-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAuB,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,gBAAgB,CAAC,YAAY,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"menu-dropdown-item.d.ts","sourceRoot":"","sources":["../../../src/button-group/menu-dropdown-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAuB,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,gBAAgB,CAAC,YAAY,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,gBAAgB,uGAwDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -10,12 +10,13 @@ import Tooltip from '../tooltip/internal.js';
|
|
|
10
10
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
11
11
|
const MenuDropdownItem = React.forwardRef(({ item, showTooltip, onItemClick, onTooltipDismiss, expandToViewport, position }, ref) => {
|
|
12
12
|
const containerRef = React.useRef(null);
|
|
13
|
+
const hasCustomIcon = item.iconName || item.iconUrl || item.iconSvg;
|
|
13
14
|
const onClickHandler = (event) => {
|
|
14
15
|
fireCancelableEvent(onItemClick, { id: event.detail.id, checked: event.detail.checked }, event);
|
|
15
16
|
};
|
|
16
17
|
return (React.createElement(ButtonDropdown, { ref: ref, variant: "icon", items: item.items, onItemClick: onClickHandler, expandToViewport: expandToViewport, ariaLabel: item.text, className: testUtilStyles['button-group-item'], position: position, "data-testid": item.id, disabled: item.disabled, customTriggerBuilder: ({ onClick, isOpen, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (React.createElement("div", { ref: containerRef, ...(item.disabled ? {} : getAnalyticsMetadataAttribute({ detail: { position } })) },
|
|
17
18
|
!isOpen && showTooltip && !item.disabled && !item.loading && (React.createElement(Tooltip, { className: testUtilStyles['button-group-tooltip'], getTrack: () => containerRef.current, content: item.text, onEscape: onTooltipDismiss })),
|
|
18
|
-
React.createElement(InternalButton, { ref: triggerRef, variant: "icon", ariaLabel: ariaLabel, "data-itemid": item.id, ariaExpanded: ariaExpanded, className: clsx(testUtilStyles.item, testUtilsClass), iconName:
|
|
19
|
+
React.createElement(InternalButton, { ref: triggerRef, variant: "icon", ariaLabel: ariaLabel, "data-itemid": item.id, ariaExpanded: ariaExpanded, className: clsx(testUtilStyles.item, testUtilsClass), iconName: hasCustomIcon ? item.iconName : 'ellipsis', iconAlt: item.iconAlt, iconUrl: item.iconUrl, iconSvg: item.iconSvg, loading: item.loading, loadingText: item.loadingText, disabled: item.disabled, disabledReason: item.disabledReason, onClick: onClick, __title: "" }))) }));
|
|
19
20
|
});
|
|
20
21
|
export default MenuDropdownItem;
|
|
21
22
|
//# sourceMappingURL=menu-dropdown-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-dropdown-item.js","sourceRoot":"","sources":["../../../src/button-group/menu-dropdown-item.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAEhD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAA0B,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAG7C,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAW1D,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,EAAyB,EACvG,GAAuC,EACvC,EAAE;IACF,MAAM,YAAY,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AO,EAAE,IAAI,CAAC,OAAO,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAC,EAAE,GACV,CACE,CACP,GACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport ButtonDropdown from '../button-dropdown/internal';\nimport { CancelableEventHandler, fireCancelableEvent } from '../internal/events';\nimport Tooltip from '../tooltip/internal.js';\nimport { ButtonGroupProps } from './interfaces';\n\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface MenuDropdownItemProps {\n item: ButtonGroupProps.MenuDropdown;\n showTooltip: boolean;\n onTooltipDismiss: () => void;\n onItemClick?: CancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n expandToViewport?: boolean;\n position: string;\n}\n\nconst MenuDropdownItem = React.forwardRef(\n (\n { item, showTooltip, onItemClick, onTooltipDismiss, expandToViewport, position }: MenuDropdownItemProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const hasCustomIcon = item.iconName || item.iconUrl || item.iconSvg;\n const onClickHandler = (event: CustomEvent<ButtonDropdownProps.ItemClickDetails>) => {\n fireCancelableEvent(onItemClick, { id: event.detail.id, checked: event.detail.checked }, event);\n };\n\n return (\n <ButtonDropdown\n ref={ref}\n variant=\"icon\"\n items={item.items}\n onItemClick={onClickHandler}\n expandToViewport={expandToViewport}\n ariaLabel={item.text}\n className={testUtilStyles['button-group-item']}\n position={position}\n data-testid={item.id}\n disabled={item.disabled}\n customTriggerBuilder={({ onClick, isOpen, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (\n <div ref={containerRef} {...(item.disabled ? {} : getAnalyticsMetadataAttribute({ detail: { position } }))}>\n {!isOpen && showTooltip && !item.disabled && !item.loading && (\n <Tooltip\n className={testUtilStyles['button-group-tooltip']}\n getTrack={() => containerRef.current}\n content={item.text}\n onEscape={onTooltipDismiss}\n />\n )}\n <InternalButton\n ref={triggerRef}\n variant=\"icon\"\n ariaLabel={ariaLabel}\n data-itemid={item.id}\n ariaExpanded={ariaExpanded}\n className={clsx(testUtilStyles.item, testUtilsClass)}\n iconName={hasCustomIcon ? item.iconName : 'ellipsis'}\n iconAlt={item.iconAlt}\n iconUrl={item.iconUrl}\n iconSvg={item.iconSvg}\n loading={item.loading}\n loadingText={item.loadingText}\n disabled={item.disabled}\n disabledReason={item.disabledReason}\n onClick={onClick}\n __title=\"\"\n />\n </div>\n )}\n />\n );\n }\n);\n\nexport default MenuDropdownItem;\n"]}
|