@cloudscape-design/components-themeable 3.0.976 → 3.0.977
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/internal/components/selectable-item/styles.scss +21 -8
- package/lib/internal/template/alert/index.js +3 -3
- package/lib/internal/template/alert/index.js.map +1 -1
- package/lib/internal/template/alert/interfaces.d.ts +10 -0
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- package/lib/internal/template/flashbar/flash.js +3 -5
- package/lib/internal/template/flashbar/flash.js.map +1 -1
- package/lib/internal/template/flashbar/interfaces.d.ts +2 -0
- package/lib/internal/template/flashbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/flashbar/interfaces.js.map +1 -1
- package/lib/internal/template/form/index.js +1 -1
- package/lib/internal/template/form/index.js.map +1 -1
- package/lib/internal/template/form/interfaces.d.ts +3 -1
- package/lib/internal/template/form/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/index.d.ts.map +1 -1
- package/lib/internal/template/form-field/index.js +1 -0
- package/lib/internal/template/form-field/index.js.map +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts +3 -1
- package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form-field/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/internal.d.ts.map +1 -1
- package/lib/internal/template/form-field/internal.js +2 -3
- package/lib/internal/template/form-field/internal.js.map +1 -1
- package/lib/internal/template/internal/analytics/hooks/use-funnel.d.ts +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +12 -5
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/hooks/interfaces.d.ts +66 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/interfaces.js +4 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.d.ts +35 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.d.ts.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.js +259 -0
- package/lib/internal/template/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +2 -2
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +1 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.js +4 -4
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/interfaces.d.ts +1 -0
- package/lib/internal/template/internal/components/drag-handle-wrapper/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/portal-overlay.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/portal-overlay.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/portal-overlay.js +3 -3
- package/lib/internal/template/internal/components/drag-handle-wrapper/portal-overlay.js.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/styles.css.js +21 -21
- package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +56 -43
- package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +21 -21
- package/lib/internal/template/internal/do-not-use/drag-handle.d.ts +5 -0
- package/lib/internal/template/internal/do-not-use/drag-handle.d.ts.map +1 -0
- package/lib/internal/template/internal/do-not-use/drag-handle.js +6 -0
- package/lib/internal/template/internal/do-not-use/drag-handle.js.map +1 -0
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/package.json +1 -0
- package/lib/internal/template/wizard/interfaces.d.ts +3 -1
- package/lib/internal/template/wizard/interfaces.d.ts.map +1 -1
- package/lib/internal/template/wizard/interfaces.js.map +1 -1
- package/lib/internal/template/wizard/wizard-form.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-form.js +2 -2
- package/lib/internal/template/wizard/wizard-form.js.map +1 -1
- package/package.json +1 -1
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.awsui_selectable-
|
|
145
|
+
.awsui_selectable-item_15o6u_1ppzm_145:not(#\9) {
|
|
146
146
|
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
147
147
|
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
148
148
|
color: var(--color-text-body-default-1tki40, #16191f);
|
|
@@ -164,17 +164,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
164
164
|
padding-block: calc(var(--space-xxs-jnczic, 4px) + var(--border-item-width-acvlhx, 1px) - var(--border-divider-list-width-8ggz94, 1px));
|
|
165
165
|
padding-inline: calc(var(--space-field-horizontal-n5peob, 8px) + var(--border-item-width-acvlhx, 1px));
|
|
166
166
|
}
|
|
167
|
-
.awsui_selectable-
|
|
167
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_pad-bottom_15o6u_1ppzm_167:not(#\9) {
|
|
168
168
|
padding-block-end: calc(calc(var(--space-xxs-jnczic, 4px) + var(--border-item-width-acvlhx, 1px) - var(--border-divider-list-width-8ggz94, 1px)) + var(--space-xxxs-3w1kr2, 2px));
|
|
169
169
|
border-block-end-color: transparent;
|
|
170
170
|
}
|
|
171
|
-
.awsui_selectable-
|
|
171
|
+
.awsui_selectable-item_15o6u_1ppzm_145:not(#\9):not(:first-child), .awsui_selectable-item_15o6u_1ppzm_145.awsui_virtual_15o6u_1ppzm_171:not(#\9) {
|
|
172
172
|
margin-block-start: calc(-1 * var(--border-item-width-acvlhx, 1px));
|
|
173
173
|
}
|
|
174
|
-
.awsui_selectable-
|
|
174
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_has-background_15o6u_1ppzm_174:not(#\9) {
|
|
175
175
|
background-color: var(--color-background-dropdown-item-hover-8liz26, #f2f3f3);
|
|
176
176
|
}
|
|
177
|
-
.awsui_selectable-
|
|
177
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_highlighted_15o6u_1ppzm_177:not(#\9), .awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177:not(#\9) {
|
|
178
178
|
color: var(--color-text-dropdown-item-highlighted-c6ndhl, #16191f);
|
|
179
179
|
border-width: var(--border-item-width-acvlhx, 1px);
|
|
180
180
|
border-start-start-radius: var(--border-radius-item-xggxkd, 0px);
|
|
@@ -184,122 +184,135 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
184
184
|
padding-block: var(--space-xxs-jnczic, 4px);
|
|
185
185
|
padding-inline: var(--space-field-horizontal-n5peob, 8px);
|
|
186
186
|
}
|
|
187
|
-
.awsui_selectable-
|
|
187
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_highlighted_15o6u_1ppzm_177.awsui_pad-bottom_15o6u_1ppzm_167:not(#\9), .awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177.awsui_pad-bottom_15o6u_1ppzm_167:not(#\9) {
|
|
188
188
|
padding-block-end: calc(var(--space-xxs-jnczic, 4px) + var(--space-xxxs-3w1kr2, 2px));
|
|
189
189
|
}
|
|
190
|
-
.awsui_selectable-
|
|
190
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_highlighted_15o6u_1ppzm_177:not(#\9) {
|
|
191
191
|
z-index: 3;
|
|
192
192
|
background-color: var(--color-background-dropdown-item-hover-8liz26, #f2f3f3);
|
|
193
193
|
border-color: var(--color-border-dropdown-item-hover-4796ds, #879596);
|
|
194
194
|
}
|
|
195
|
-
.awsui_selectable-
|
|
195
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_highlighted_15o6u_1ppzm_177.awsui_disabled_15o6u_1ppzm_195:not(#\9) {
|
|
196
196
|
color: var(--color-text-dropdown-item-dimmed-7akr3u, #aab7b8);
|
|
197
197
|
border-color: var(--color-border-dropdown-item-dimmed-hover-twsd8z, #879596);
|
|
198
198
|
background-color: var(--color-background-dropdown-item-dimmed-2hwvu9, transparent);
|
|
199
199
|
}
|
|
200
|
-
.awsui_selectable-
|
|
200
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_highlighted_15o6u_1ppzm_177.awsui_is-keyboard_15o6u_1ppzm_200:not(#\9) {
|
|
201
|
+
border-color: var(--color-border-dropdown-item-focused-am1kt4, #0073bb);
|
|
202
|
+
}
|
|
203
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_highlighted_15o6u_1ppzm_177.awsui_is-keyboard_15o6u_1ppzm_200:not(#\9):not(.awsui_visual-refresh_15o6u_1ppzm_203) {
|
|
204
|
+
box-shadow: inset 0 0 0 var(--border-control-focus-ring-shadow-spread-ql2vj7, 1px) var(--color-border-item-focused-vx5mpq, #0073bb);
|
|
205
|
+
}
|
|
206
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177:not(#\9) {
|
|
201
207
|
z-index: 2;
|
|
202
208
|
background-color: var(--color-background-dropdown-item-selected-rknjid, #f1faff);
|
|
203
209
|
border-color: var(--color-border-dropdown-item-selected-i0krgy, #eaeded);
|
|
204
210
|
}
|
|
205
|
-
.awsui_selectable-
|
|
211
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177.awsui_next-item-selected_15o6u_1ppzm_211:not(#\9) {
|
|
206
212
|
border-end-start-radius: 0;
|
|
207
213
|
border-end-end-radius: 0;
|
|
208
214
|
}
|
|
209
|
-
.awsui_selectable-
|
|
210
|
-
border-color: var(--color-border-dropdown-item-
|
|
215
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177.awsui_highlighted_15o6u_1ppzm_177:not(#\9) {
|
|
216
|
+
border-color: var(--color-border-dropdown-item-selected-i0krgy, #eaeded);
|
|
211
217
|
z-index: 3;
|
|
218
|
+
outline: var(--border-item-width-acvlhx, 1px) solid var(--color-border-dropdown-item-hover-4796ds, #879596);
|
|
219
|
+
outline-offset: calc(-2 * var(--border-item-width-acvlhx, 1px));
|
|
212
220
|
}
|
|
213
|
-
.awsui_selectable-
|
|
214
|
-
border-
|
|
215
|
-
border-
|
|
221
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177.awsui_highlighted_15o6u_1ppzm_177.awsui_is-keyboard_15o6u_1ppzm_200:not(#\9) {
|
|
222
|
+
border-color: var(--color-border-dropdown-item-selected-i0krgy, #eaeded);
|
|
223
|
+
outline-color: var(--color-border-dropdown-item-focused-am1kt4, #0073bb);
|
|
224
|
+
}
|
|
225
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177.awsui_highlighted_15o6u_1ppzm_177:not(#\9):not(.awsui_visual-refresh_15o6u_1ppzm_203) {
|
|
226
|
+
border-color: var(--color-border-dropdown-item-hover-4796ds, #879596);
|
|
227
|
+
outline: none;
|
|
216
228
|
}
|
|
217
|
-
.awsui_selectable-
|
|
229
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177.awsui_highlighted_15o6u_1ppzm_177:not(#\9):not(.awsui_visual-refresh_15o6u_1ppzm_203).awsui_is-keyboard_15o6u_1ppzm_200 {
|
|
218
230
|
border-color: var(--color-border-dropdown-item-focused-am1kt4, #0073bb);
|
|
219
231
|
}
|
|
220
|
-
.awsui_selectable-
|
|
221
|
-
|
|
232
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177 + .awsui_selectable-item_15o6u_1ppzm_145.awsui_selected_15o6u_1ppzm_177:not(#\9) {
|
|
233
|
+
border-start-start-radius: 0;
|
|
234
|
+
border-start-end-radius: 0;
|
|
222
235
|
}
|
|
223
|
-
.awsui_selectable-
|
|
236
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_parent_15o6u_1ppzm_236:not(#\9) {
|
|
224
237
|
font-weight: bold;
|
|
225
238
|
color: var(--color-text-dropdown-group-label-8bba32, #545b64);
|
|
226
239
|
}
|
|
227
|
-
.awsui_selectable-
|
|
240
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_parent_15o6u_1ppzm_236:not(#\9):not(.awsui_interactiveGroups_15o6u_1ppzm_240) {
|
|
228
241
|
border-block-start-color: var(--color-border-dropdown-group-dxavhr, #eaeded);
|
|
229
242
|
padding-block: var(--space-xs-kw7k3v, 8px);
|
|
230
243
|
padding-inline: var(--space-xs-kw7k3v, 8px);
|
|
231
244
|
}
|
|
232
|
-
.awsui_selectable-
|
|
245
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_parent_15o6u_1ppzm_236.awsui_interactiveGroups_15o6u_1ppzm_240:not(#\9) {
|
|
233
246
|
padding-block: calc(var(--space-xs-kw7k3v, 8px) + var(--border-item-width-acvlhx, 1px) - var(--border-divider-list-width-8ggz94, 1px));
|
|
234
247
|
padding-inline: calc(var(--space-field-horizontal-n5peob, 8px) + var(--border-item-width-acvlhx, 1px));
|
|
235
248
|
}
|
|
236
|
-
.awsui_selectable-
|
|
249
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_parent_15o6u_1ppzm_236.awsui_interactiveGroups_15o6u_1ppzm_240.awsui_highlighted_15o6u_1ppzm_177:not(#\9) {
|
|
237
250
|
color: var(--color-text-dropdown-item-highlighted-c6ndhl, #16191f);
|
|
238
251
|
}
|
|
239
|
-
.awsui_selectable-
|
|
252
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_parent_15o6u_1ppzm_236.awsui_interactiveGroups_15o6u_1ppzm_240.awsui_highlighted_15o6u_1ppzm_177:not(#\9), .awsui_selectable-item_15o6u_1ppzm_145.awsui_parent_15o6u_1ppzm_236.awsui_interactiveGroups_15o6u_1ppzm_240.awsui_selected_15o6u_1ppzm_177:not(#\9) {
|
|
240
253
|
padding-block: var(--space-xs-kw7k3v, 8px);
|
|
241
254
|
padding-inline: var(--space-field-horizontal-n5peob, 8px);
|
|
242
255
|
}
|
|
243
|
-
.awsui_selectable-
|
|
256
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_child_15o6u_1ppzm_256:not(#\9) {
|
|
244
257
|
padding-inline-start: calc(var(--space-xxl-q0lyvp, 32px) + var(--border-item-width-acvlhx, 1px));
|
|
245
258
|
}
|
|
246
|
-
.awsui_selectable-
|
|
259
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_child_15o6u_1ppzm_256.awsui_highlighted_15o6u_1ppzm_177:not(#\9), .awsui_selectable-item_15o6u_1ppzm_145.awsui_child_15o6u_1ppzm_256.awsui_selected_15o6u_1ppzm_177:not(#\9) {
|
|
247
260
|
padding-inline-start: var(--space-xxl-q0lyvp, 32px);
|
|
248
261
|
}
|
|
249
|
-
.awsui_selectable-
|
|
262
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9) {
|
|
250
263
|
position: sticky;
|
|
251
264
|
inset-block-start: 0;
|
|
252
265
|
margin-block-end: calc(var(--border-item-width-acvlhx, 1px) - var(--border-divider-list-width-8ggz94, 1px));
|
|
253
266
|
z-index: 4;
|
|
254
267
|
}
|
|
255
|
-
.awsui_selectable-
|
|
268
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9):not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177) {
|
|
256
269
|
border-inline-start-width: var(--border-item-width-acvlhx, 1px);
|
|
257
270
|
border-inline-start-color: var(--color-border-dropdown-container-eiy251, transparent);
|
|
258
271
|
border-inline-end-color: var(--color-border-dropdown-container-eiy251, transparent);
|
|
259
272
|
padding-inline: var(--space-field-horizontal-n5peob, 8px);
|
|
260
273
|
}
|
|
261
|
-
.awsui_selectable-
|
|
274
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9):not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177):not(.awsui_with-scrollbar_15o6u_1ppzm_274) {
|
|
262
275
|
border-inline-end-width: var(--border-item-width-acvlhx, 1px);
|
|
263
276
|
}
|
|
264
|
-
.awsui_selectable-
|
|
277
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9):not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177).awsui_with-scrollbar_15o6u_1ppzm_274 {
|
|
265
278
|
border-inline-end-width: 0;
|
|
266
279
|
}
|
|
267
|
-
.awsui_selectable-
|
|
280
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9):not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177):not(.awsui_after-header_15o6u_1ppzm_280) {
|
|
268
281
|
border-start-start-radius: var(--border-radius-item-xggxkd, 0px);
|
|
269
282
|
}
|
|
270
|
-
.awsui_selectable-
|
|
283
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9):not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177):not(.awsui_after-header_15o6u_1ppzm_280):not(.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177):not(.awsui_after-header_15o6u_1ppzm_280).awsui_with-scrollbar_15o6u_1ppzm_274) {
|
|
271
284
|
border-start-end-radius: var(--border-radius-item-xggxkd, 0px);
|
|
272
285
|
}
|
|
273
|
-
.awsui_selectable-
|
|
286
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262:not(#\9):not(.awsui_highlighted_15o6u_1ppzm_177):not(.awsui_selected_15o6u_1ppzm_177).awsui_after-header_15o6u_1ppzm_280 {
|
|
274
287
|
border-block-start-color: var(--color-background-dropdown-item-default-79esq0, #ffffff);
|
|
275
288
|
}
|
|
276
|
-
.awsui_selectable-
|
|
289
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262.awsui_disabled_15o6u_1ppzm_195.awsui_highlighted_15o6u_1ppzm_177:not(#\9), .awsui_selectable-item_15o6u_1ppzm_145.awsui_sticky_15o6u_1ppzm_262.awsui_disabled_15o6u_1ppzm_195.awsui_selected_15o6u_1ppzm_177:not(#\9) {
|
|
277
290
|
border-block-end-color: transparent;
|
|
278
291
|
border-block-start-color: transparent;
|
|
279
292
|
border-inline-start-color: transparent;
|
|
280
293
|
border-inline-end-color: transparent;
|
|
281
294
|
}
|
|
282
|
-
.awsui_selectable-
|
|
295
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_disabled_15o6u_1ppzm_195:not(#\9) {
|
|
283
296
|
color: var(--color-text-dropdown-item-disabled-g8nr7t, #aab7b8);
|
|
284
297
|
}
|
|
285
|
-
.awsui_selectable-
|
|
298
|
+
.awsui_selectable-item_15o6u_1ppzm_145:not(#\9):not(.awsui_disabled_15o6u_1ppzm_195):not(.awsui_parent_15o6u_1ppzm_236) {
|
|
286
299
|
cursor: pointer;
|
|
287
300
|
}
|
|
288
|
-
.awsui_selectable-
|
|
301
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_interactiveGroups_15o6u_1ppzm_240:not(#\9):not(.awsui_disabled_15o6u_1ppzm_195) {
|
|
289
302
|
cursor: pointer;
|
|
290
303
|
}
|
|
291
|
-
.awsui_selectable-
|
|
304
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_virtual_15o6u_1ppzm_171:not(#\9) {
|
|
292
305
|
position: absolute;
|
|
293
306
|
inset-block-start: var(--border-dropdown-virtual-offset-width-1fzwg5, 0px);
|
|
294
307
|
inset-inline-start: 0;
|
|
295
308
|
inline-size: 100%;
|
|
296
309
|
box-sizing: border-box;
|
|
297
310
|
}
|
|
298
|
-
.awsui_selectable-
|
|
311
|
+
.awsui_selectable-item_15o6u_1ppzm_145.awsui_virtual_15o6u_1ppzm_171:not(#\9):first-of-type:not(.awsui_selected_15o6u_1ppzm_177, .awsui_highlighted_15o6u_1ppzm_177) {
|
|
299
312
|
border-block-start-color: var(--color-border-dropdown-item-top-znzfoj, #eaeded);
|
|
300
313
|
}
|
|
301
314
|
|
|
302
|
-
.awsui_measure-
|
|
315
|
+
.awsui_measure-strut_15o6u_1ppzm_315:not(#\9) {
|
|
303
316
|
position: absolute;
|
|
304
317
|
pointer-events: none;
|
|
305
318
|
block-size: 100%;
|
|
@@ -308,20 +321,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
308
321
|
inset-inline-start: 0;
|
|
309
322
|
padding-block-start: var(--border-divider-list-width-8ggz94, 1px);
|
|
310
323
|
}
|
|
311
|
-
.awsui_measure-strut-
|
|
324
|
+
.awsui_measure-strut-first_15o6u_1ppzm_324:not(#\9) {
|
|
312
325
|
padding-block-end: var(--border-divider-list-width-8ggz94, 1px);
|
|
313
326
|
}
|
|
314
327
|
|
|
315
|
-
.awsui_screenreader-
|
|
328
|
+
.awsui_screenreader-content_15o6u_1ppzm_328:not(#\9) {
|
|
316
329
|
position: absolute !important;
|
|
317
330
|
inset-block-start: -9999px !important;
|
|
318
331
|
inset-inline-start: -9999px !important;
|
|
319
332
|
}
|
|
320
333
|
|
|
321
|
-
.awsui_option-
|
|
334
|
+
.awsui_option-content_15o6u_1ppzm_334:not(#\9) {
|
|
322
335
|
/* used in test-utils */
|
|
323
336
|
}
|
|
324
337
|
|
|
325
|
-
.awsui_select-
|
|
338
|
+
.awsui_select-all_15o6u_1ppzm_338:not(#\9) {
|
|
326
339
|
/* used in test-utils */
|
|
327
340
|
}
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"selectable-item": "awsui_selectable-
|
|
6
|
-
"pad-bottom": "awsui_pad-
|
|
7
|
-
"virtual": "
|
|
8
|
-
"has-background": "awsui_has-
|
|
9
|
-
"highlighted": "
|
|
10
|
-
"selected": "
|
|
11
|
-
"disabled": "
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"parent": "
|
|
16
|
-
"interactiveGroups": "
|
|
17
|
-
"child": "
|
|
18
|
-
"sticky": "
|
|
19
|
-
"with-scrollbar": "awsui_with-
|
|
20
|
-
"after-header": "awsui_after-
|
|
21
|
-
"measure-strut": "awsui_measure-
|
|
22
|
-
"measure-strut-first": "awsui_measure-strut-
|
|
23
|
-
"screenreader-content": "awsui_screenreader-
|
|
24
|
-
"option-content": "awsui_option-
|
|
25
|
-
"select-all": "awsui_select-
|
|
5
|
+
"selectable-item": "awsui_selectable-item_15o6u_1ppzm_145",
|
|
6
|
+
"pad-bottom": "awsui_pad-bottom_15o6u_1ppzm_167",
|
|
7
|
+
"virtual": "awsui_virtual_15o6u_1ppzm_171",
|
|
8
|
+
"has-background": "awsui_has-background_15o6u_1ppzm_174",
|
|
9
|
+
"highlighted": "awsui_highlighted_15o6u_1ppzm_177",
|
|
10
|
+
"selected": "awsui_selected_15o6u_1ppzm_177",
|
|
11
|
+
"disabled": "awsui_disabled_15o6u_1ppzm_195",
|
|
12
|
+
"is-keyboard": "awsui_is-keyboard_15o6u_1ppzm_200",
|
|
13
|
+
"visual-refresh": "awsui_visual-refresh_15o6u_1ppzm_203",
|
|
14
|
+
"next-item-selected": "awsui_next-item-selected_15o6u_1ppzm_211",
|
|
15
|
+
"parent": "awsui_parent_15o6u_1ppzm_236",
|
|
16
|
+
"interactiveGroups": "awsui_interactiveGroups_15o6u_1ppzm_240",
|
|
17
|
+
"child": "awsui_child_15o6u_1ppzm_256",
|
|
18
|
+
"sticky": "awsui_sticky_15o6u_1ppzm_262",
|
|
19
|
+
"with-scrollbar": "awsui_with-scrollbar_15o6u_1ppzm_274",
|
|
20
|
+
"after-header": "awsui_after-header_15o6u_1ppzm_280",
|
|
21
|
+
"measure-strut": "awsui_measure-strut_15o6u_1ppzm_315",
|
|
22
|
+
"measure-strut-first": "awsui_measure-strut-first_15o6u_1ppzm_324",
|
|
23
|
+
"screenreader-content": "awsui_screenreader-content_15o6u_1ppzm_328",
|
|
24
|
+
"option-content": "awsui_option-content_15o6u_1ppzm_334",
|
|
25
|
+
"select-all": "awsui_select-all_15o6u_1ppzm_338"
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import useInternalDragHandleInteractionState, { UseDragHandleInteractionStateProps as UseInternalDragHandleInteractionStateProps } from '../components/drag-handle/hooks/use-drag-handle-interaction-state';
|
|
2
|
+
import InternalDragHandle, { DragHandleProps as InternalDragHandleProps } from '../components/drag-handle/index.js';
|
|
3
|
+
export type { InternalDragHandleProps, UseInternalDragHandleInteractionStateProps };
|
|
4
|
+
export { InternalDragHandle, useInternalDragHandleInteractionState };
|
|
5
|
+
//# sourceMappingURL=drag-handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-handle.d.ts","sourceRoot":"","sources":["../../../../src/internal/do-not-use/drag-handle.ts"],"names":[],"mappings":"AAGA,OAAO,qCAAqC,EAAE,EAC5C,kCAAkC,IAAI,0CAA0C,EACjF,MAAM,mEAAmE,CAAC;AAC3E,OAAO,kBAAkB,EAAE,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAEpH,YAAY,EAAE,uBAAuB,EAAE,0CAA0C,EAAE,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,qCAAqC,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import useInternalDragHandleInteractionState from '../components/drag-handle/hooks/use-drag-handle-interaction-state';
|
|
4
|
+
import InternalDragHandle from '../components/drag-handle/index.js';
|
|
5
|
+
export { InternalDragHandle, useInternalDragHandleInteractionState };
|
|
6
|
+
//# sourceMappingURL=drag-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-handle.js","sourceRoot":"","sources":["../../../../src/internal/do-not-use/drag-handle.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,qCAEN,MAAM,mEAAmE,CAAC;AAC3E,OAAO,kBAAkE,MAAM,oCAAoC,CAAC;AAGpH,OAAO,EAAE,kBAAkB,EAAE,qCAAqC,EAAE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport useInternalDragHandleInteractionState, {\n UseDragHandleInteractionStateProps as UseInternalDragHandleInteractionStateProps,\n} from '../components/drag-handle/hooks/use-drag-handle-interaction-state';\nimport InternalDragHandle, { DragHandleProps as InternalDragHandleProps } from '../components/drag-handle/index.js';\n\nexport type { InternalDragHandleProps, UseInternalDragHandleInteractionStateProps };\nexport { InternalDragHandle, useInternalDragHandleInteractionState };\n"]}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"./internal/do-not-use/expandable-section": "./internal/do-not-use/expandable-section.js",
|
|
19
19
|
"./internal/do-not-use/i18n": "./internal/do-not-use/i18n.js",
|
|
20
20
|
"./internal/do-not-use/tooltip": "./internal/do-not-use/tooltip.js",
|
|
21
|
+
"./internal/do-not-use/drag-handle": "./internal/do-not-use/drag-handle.js",
|
|
21
22
|
"./internal/widget-exports": "./internal/widget-exports.js",
|
|
22
23
|
"./test-utils/dom/internal/tooltip": "./test-utils/dom/internal/tooltip.js",
|
|
23
24
|
"./test-utils/selectors/internal/tooltip": "./test-utils/selectors/internal/tooltip.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FlowType } from '../internal/analytics/interfaces';
|
|
2
|
+
import { ErrorContext, FlowType } from '../internal/analytics/interfaces';
|
|
3
3
|
import { BaseComponentProps } from '../internal/base-component';
|
|
4
4
|
import { NonCancelableEventHandler } from '../internal/events';
|
|
5
5
|
export declare namespace WizardProps {
|
|
@@ -7,6 +7,7 @@ export declare namespace WizardProps {
|
|
|
7
7
|
instanceIdentifier?: string;
|
|
8
8
|
flowType?: FlowType;
|
|
9
9
|
resourceType?: string;
|
|
10
|
+
errorContext?: ErrorContext;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
export interface WizardProps extends BaseComponentProps {
|
|
@@ -117,6 +118,7 @@ export interface WizardProps extends BaseComponentProps {
|
|
|
117
118
|
export declare namespace WizardProps {
|
|
118
119
|
interface StepAnalyticsMetadata {
|
|
119
120
|
instanceIdentifier?: string;
|
|
121
|
+
errorContext?: ErrorContext;
|
|
120
122
|
}
|
|
121
123
|
interface Step {
|
|
122
124
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/wizard/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/wizard/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,yBAAiB,WAAW,CAAC;IAC3B,UAAiB,iBAAiB;QAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;CACF;AAED,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC;IAElD;;;;;;;;;;;;;;OAcG;IACH,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC;IAEtC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;I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ACvC,+BAA+B,CAAC,EAAE,MAAM,CAAC;KAC1C;IAED,UAAiB,cAAc;QAC7B,kBAAkB,EAAE,MAAM,CAAC;QAC3B,MAAM,EAAE,WAAW,CAAC,gBAAgB,CAAC;KACtC;IAED,KAAY,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;CACtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/wizard/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 { FlowType } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace WizardProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n resourceType?: string;\n }\n}\n\nexport interface WizardProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * * `resourceType` - Identifies the type of resource represented by the flow. **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: WizardProps.AnalyticsMetadata;\n\n /**\n * Array of step objects. Each object represents a step in the wizard with the following properties:\n *\n * - `title` (string) - Text that's displayed as the title in the navigation pane and form header.\n * - `info` (ReactNode) - (Optional) Area for a page level info link that's displayed in the form header.\n * The page level info link should trigger the default help panel content for the step. Use the [link component](/components/link/) to display the link.\n * - `description` (ReactNode) - (Optional) Area below the form header for a page level description text to further explain the purpose, goal, or main actions of the step.\n * - `content` (ReactNode) - Main content area to display form sections, form fields, and controls.\n * - `errorText` (ReactNode) - (Optional) Error text that's displayed in a page level error alert.\n * Use this for rendering actionable server-side validation failure messages.\n * - `isOptional` (boolean) - Specifies whether the step is optional or required. If set to `true`, the text from `i18nStrings.optional`\n * is rendered next to the `title` in the navigation step label and the form header title.\n * - `analyticsMetadata` (WizardProps.StepAnalyticsMetadata) - (Optional) Specifies additional analytics-related metadata.\n * @analytics\n */\n steps: ReadonlyArray<WizardProps.Step>;\n\n /**\n * Index of the step that's currently displayed. The first step has an index of zero (0).\n *\n * If you don't set this property, the component starts on the first step and switches step automatically\n * when a user navigates using the buttons or an enabled step link in the navigation pane (that is, uncontrolled behavior).\n *\n * If you provide a value for this property, you must also set an `onNavigate` listener to update the property when\n * a user navigates (that is, controlled behavior).\n *\n * If you set it to a value that exceeds the maximum value (that is, the number of steps minus 1), its value is ignored and the component uses the maximum value.\n */\n activeStepIndex?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n *\n * - `stepNumberLabel` ((stepNumber: number) => string) - A function that accepts a number (1-based indexing),\n * and returns a human-readable, localized string displaying the step number in the navigation pane. For example, \"Step 1\" or \"Step 2\".\n * - `collapsedStepsLabel` ((stepNumber: number, stepsCount: number) => string) - A function that accepts two number parameters (1-based indexing),\n * and returns a string responsible for the navigation summary on smaller screens. For example, \"Step 1 of 3\". The parameters are as follows:\n * - `stepNumber` (number) - The step number that the user is currently on.\n * - `stepsCount` (number) - The total number of steps in the wizard.\n * - `skipToButtonLabel`: ((targetStep: WizardProps.Step, targetStepNumber: number) => string) - An optional function that accepts the target step object\n * and the target step number (1-based indexing), and returns a string to be used as the *skip-to* button label. For example, \"Skip to Step 2\" or \"Skip to end\".\n * - `navigationAriaLabel` (string) - The aria label for the navigation pane.\n * - `cancelButton` (string) - The text of the button that enables the user to exit the flow.\n * - `previousButton` (string) - The text of the button that enables the user to return to the previous step.\n * - `nextButton` (string) - The text of the button that enables the user to move to the next step.\n * - `submitButton` (string) - The text of the button that enables the user to submit the form. **Deprecated**, replaced by the `submitButtonText` component property. `submitButton` is not supported by the I18nProvider.\n * - `optional` (string) - The text displayed next to the step title and form header title when a step is declared optional.\n * - `nextButtonLoadingAnnouncement` (string) - The text that a screen reader announces when the *next* button is in a loading state.\n * - `submitButtonLoadingAnnouncement` (string) - The text that a screen reader announces when the *submit* button is in a loading state.\n * @i18n\n */\n i18nStrings?: WizardProps.I18nStrings;\n\n /**\n * The text of the button that enables the user to submit the form.\n */\n submitButtonText?: string;\n\n /**\n * Renders the *next* or *submit* button in a loading state.\n *\n * Use this if you need to wait for a response from the server before the user can proceed to the next step, such as during server-side validation or retrieving the next step's information.\n */\n isLoadingNextStep?: boolean;\n\n /**\n * When set to `false`, the *skip-to* button is never shown.\n * When set to `true`, the *skip-to* button may appear to offer faster navigation for the user.\n *\n * The *skip-to* button only allows to skip optional steps. It is shown when there is one or more optional\n * steps ahead having no required steps in-between.\n *\n * Note: the *skip-to* button requires the function i18nStrings.skipToButtonLabel to be defined.\n *\n * Defaults to `false`.\n */\n allowSkipTo?: boolean;\n\n /**\n * Specifies left-aligned secondary actions for the wizard. Use a button dropdown if multiple actions are required.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Called when a user clicks the *cancel* button.\n * If a user has entered data in the form, you should prompt the user with a modal before exiting the wizard flow.\n */\n onCancel?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *submit* button.\n */\n onSubmit?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *next* button, the *previous* button, or an enabled step link in the navigation pane.\n *\n * The event `detail` includes the following:\n * - `requestedStepIndex` - The index of the requested step.\n * - `reason` - The user action that triggered the navigation event. It can be `next` (when the user clicks the *next* button),\n * `previous` (when the user clicks the *previous* button), `step` (an enabled step link in the navigation pane),\n * or `skip` (when navigated using navigation pane or the *skip-to* button to the previously unvisited step).\n */\n onNavigate?: NonCancelableEventHandler<WizardProps.NavigateDetail>;\n}\n\nexport namespace WizardProps {\n export interface StepAnalyticsMetadata {\n instanceIdentifier?: string;\n }\n export interface Step {\n title: string;\n info?: React.ReactNode;\n description?: React.ReactNode;\n content: React.ReactNode;\n errorText?: React.ReactNode;\n isOptional?: boolean;\n analyticsMetadata?: StepAnalyticsMetadata;\n }\n\n export interface I18nStrings {\n /**\n * @deprecated Use `submitButtonText` on the component instead.\n */\n submitButton?: string;\n\n stepNumberLabel?(stepNumber: number): string;\n collapsedStepsLabel?(stepNumber: number, stepsCount: number): string;\n skipToButtonLabel?(targetStep: WizardProps.Step, targetStepNumber: number): string;\n navigationAriaLabel?: string;\n errorIconAriaLabel?: string;\n cancelButton?: string;\n previousButton?: string;\n nextButton?: string;\n optional?: string;\n nextButtonLoadingAnnouncement?: string;\n submitButtonLoadingAnnouncement?: string;\n }\n\n export interface NavigateDetail {\n requestedStepIndex: number;\n reason: WizardProps.NavigationReason;\n }\n\n export type NavigationReason = 'next' | 'previous' | 'step' | 'skip';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/wizard/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 { ErrorContext, FlowType } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace WizardProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n resourceType?: string;\n errorContext?: ErrorContext;\n }\n}\n\nexport interface WizardProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * * `resourceType` - Identifies the type of resource represented by the flow. **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: WizardProps.AnalyticsMetadata;\n\n /**\n * Array of step objects. Each object represents a step in the wizard with the following properties:\n *\n * - `title` (string) - Text that's displayed as the title in the navigation pane and form header.\n * - `info` (ReactNode) - (Optional) Area for a page level info link that's displayed in the form header.\n * The page level info link should trigger the default help panel content for the step. Use the [link component](/components/link/) to display the link.\n * - `description` (ReactNode) - (Optional) Area below the form header for a page level description text to further explain the purpose, goal, or main actions of the step.\n * - `content` (ReactNode) - Main content area to display form sections, form fields, and controls.\n * - `errorText` (ReactNode) - (Optional) Error text that's displayed in a page level error alert.\n * Use this for rendering actionable server-side validation failure messages.\n * - `isOptional` (boolean) - Specifies whether the step is optional or required. If set to `true`, the text from `i18nStrings.optional`\n * is rendered next to the `title` in the navigation step label and the form header title.\n * - `analyticsMetadata` (WizardProps.StepAnalyticsMetadata) - (Optional) Specifies additional analytics-related metadata.\n * @analytics\n */\n steps: ReadonlyArray<WizardProps.Step>;\n\n /**\n * Index of the step that's currently displayed. The first step has an index of zero (0).\n *\n * If you don't set this property, the component starts on the first step and switches step automatically\n * when a user navigates using the buttons or an enabled step link in the navigation pane (that is, uncontrolled behavior).\n *\n * If you provide a value for this property, you must also set an `onNavigate` listener to update the property when\n * a user navigates (that is, controlled behavior).\n *\n * If you set it to a value that exceeds the maximum value (that is, the number of steps minus 1), its value is ignored and the component uses the maximum value.\n */\n activeStepIndex?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n *\n * - `stepNumberLabel` ((stepNumber: number) => string) - A function that accepts a number (1-based indexing),\n * and returns a human-readable, localized string displaying the step number in the navigation pane. For example, \"Step 1\" or \"Step 2\".\n * - `collapsedStepsLabel` ((stepNumber: number, stepsCount: number) => string) - A function that accepts two number parameters (1-based indexing),\n * and returns a string responsible for the navigation summary on smaller screens. For example, \"Step 1 of 3\". The parameters are as follows:\n * - `stepNumber` (number) - The step number that the user is currently on.\n * - `stepsCount` (number) - The total number of steps in the wizard.\n * - `skipToButtonLabel`: ((targetStep: WizardProps.Step, targetStepNumber: number) => string) - An optional function that accepts the target step object\n * and the target step number (1-based indexing), and returns a string to be used as the *skip-to* button label. For example, \"Skip to Step 2\" or \"Skip to end\".\n * - `navigationAriaLabel` (string) - The aria label for the navigation pane.\n * - `cancelButton` (string) - The text of the button that enables the user to exit the flow.\n * - `previousButton` (string) - The text of the button that enables the user to return to the previous step.\n * - `nextButton` (string) - The text of the button that enables the user to move to the next step.\n * - `submitButton` (string) - The text of the button that enables the user to submit the form. **Deprecated**, replaced by the `submitButtonText` component property. `submitButton` is not supported by the I18nProvider.\n * - `optional` (string) - The text displayed next to the step title and form header title when a step is declared optional.\n * - `nextButtonLoadingAnnouncement` (string) - The text that a screen reader announces when the *next* button is in a loading state.\n * - `submitButtonLoadingAnnouncement` (string) - The text that a screen reader announces when the *submit* button is in a loading state.\n * @i18n\n */\n i18nStrings?: WizardProps.I18nStrings;\n\n /**\n * The text of the button that enables the user to submit the form.\n */\n submitButtonText?: string;\n\n /**\n * Renders the *next* or *submit* button in a loading state.\n *\n * Use this if you need to wait for a response from the server before the user can proceed to the next step, such as during server-side validation or retrieving the next step's information.\n */\n isLoadingNextStep?: boolean;\n\n /**\n * When set to `false`, the *skip-to* button is never shown.\n * When set to `true`, the *skip-to* button may appear to offer faster navigation for the user.\n *\n * The *skip-to* button only allows to skip optional steps. It is shown when there is one or more optional\n * steps ahead having no required steps in-between.\n *\n * Note: the *skip-to* button requires the function i18nStrings.skipToButtonLabel to be defined.\n *\n * Defaults to `false`.\n */\n allowSkipTo?: boolean;\n\n /**\n * Specifies left-aligned secondary actions for the wizard. Use a button dropdown if multiple actions are required.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Called when a user clicks the *cancel* button.\n * If a user has entered data in the form, you should prompt the user with a modal before exiting the wizard flow.\n */\n onCancel?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *submit* button.\n */\n onSubmit?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *next* button, the *previous* button, or an enabled step link in the navigation pane.\n *\n * The event `detail` includes the following:\n * - `requestedStepIndex` - The index of the requested step.\n * - `reason` - The user action that triggered the navigation event. It can be `next` (when the user clicks the *next* button),\n * `previous` (when the user clicks the *previous* button), `step` (an enabled step link in the navigation pane),\n * or `skip` (when navigated using navigation pane or the *skip-to* button to the previously unvisited step).\n */\n onNavigate?: NonCancelableEventHandler<WizardProps.NavigateDetail>;\n}\n\nexport namespace WizardProps {\n export interface StepAnalyticsMetadata {\n instanceIdentifier?: string;\n errorContext?: ErrorContext;\n }\n export interface Step {\n title: string;\n info?: React.ReactNode;\n description?: React.ReactNode;\n content: React.ReactNode;\n errorText?: React.ReactNode;\n isOptional?: boolean;\n analyticsMetadata?: StepAnalyticsMetadata;\n }\n\n export interface I18nStrings {\n /**\n * @deprecated Use `submitButtonText` on the component instead.\n */\n submitButton?: string;\n\n stepNumberLabel?(stepNumber: number): string;\n collapsedStepsLabel?(stepNumber: number, stepsCount: number): string;\n skipToButtonLabel?(targetStep: WizardProps.Step, targetStepNumber: number): string;\n navigationAriaLabel?: string;\n errorIconAriaLabel?: string;\n cancelButton?: string;\n previousButton?: string;\n nextButton?: string;\n optional?: string;\n nextButtonLoadingAnnouncement?: string;\n submitButtonLoadingAnnouncement?: string;\n }\n\n export interface NavigateDetail {\n requestedStepIndex: number;\n reason: WizardProps.NavigationReason;\n }\n\n export type NavigationReason = 'next' | 'previous' | 'step' | 'skip';\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard-form.d.ts","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"wizard-form.d.ts","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAmBnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAM3C,UAAU,eAAgB,SAAQ,0BAA0B;IAC1D,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,kBAAkB,QAAwD,CAAC;AAExF,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,KAAK,EAAE,eAAe,eAwBrE"}
|
|
@@ -19,7 +19,7 @@ import styles from './styles.css.js';
|
|
|
19
19
|
export const STEP_NAME_SELECTOR = `[${DATA_ATTR_FUNNEL_KEY}="${FUNNEL_KEY_STEP_NAME}"]`;
|
|
20
20
|
export default function WizardFormWithAnalytics(props) {
|
|
21
21
|
const analyticsMetadata = getAnalyticsMetadataProps(props.steps[props.activeStepIndex]);
|
|
22
|
-
const __internalRootRef = useComponentMetadata('WizardForm', PACKAGE_VERSION,
|
|
22
|
+
const __internalRootRef = useComponentMetadata('WizardForm', PACKAGE_VERSION, analyticsMetadata);
|
|
23
23
|
const stepHeaderRef = useRef(null);
|
|
24
24
|
useEffectOnUpdate(() => {
|
|
25
25
|
var _a;
|
|
@@ -56,7 +56,7 @@ function WizardForm({ __internalRootRef, stepHeaderRef, steps, activeStepIndex,
|
|
|
56
56
|
totalSubSteps: funnelStepInfo.current.subStepCount.current,
|
|
57
57
|
funnelIdentifier,
|
|
58
58
|
subStepAllSelector: getSubStepAllSelector(),
|
|
59
|
-
|
|
59
|
+
errorContext: funnelStepInfo.current.stepErrorContext,
|
|
60
60
|
subStepConfiguration: (_b = funnelStepInfo.current.subStepConfiguration.current) === null || _b === void 0 ? void 0 : _b.get(funnelStepInfo.current.stepNumber),
|
|
61
61
|
stepErrorSelector: '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,kBAAkB,EAAE,WAAW,CAAC,cAAc,EAC9C,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,EACrD,YAAY,EAAE,eAAe,KAAK,CAAC,EACnC,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,iBAAiB,GAClC,EAEJ,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,WAAW,EAC1B,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,IAC9C,cAAc,CAAC,OAAO,CAAC,eAAe,GAEzC,OAAO,CACK,CACd,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsC,EAAE,eAAuB;IAC5F,IAAI,qBAAqB,GAAG,eAAe,CAAC;IAC5C,GAAG;QACD,qBAAqB,EAAE,CAAC;KACzB,QAAQ,qBAAqB,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,UAAU,EAAE;IAE9F,OAAO,qBAAqB,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MutableRefObject, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useComponentMetadata } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalForm from '../form/internal';\nimport InternalHeader from '../header/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';\nimport { useFunnel, useFunnelStepRef } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_KEY,\n FUNNEL_KEY_STEP_NAME,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport { PACKAGE_VERSION } from '../internal/environment';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { WizardProps } from './interfaces';\nimport WizardActions from './wizard-actions';\nimport WizardFormHeader from './wizard-form-header';\n\nimport styles from './styles.css.js';\n\ninterface WizardFormProps extends InternalBaseComponentProps {\n steps: ReadonlyArray<WizardProps.Step>;\n activeStepIndex: number;\n showCollapsedSteps: boolean;\n i18nStrings: WizardProps.I18nStrings;\n submitButtonText?: string;\n isPrimaryLoading: boolean;\n allowSkipTo: boolean;\n secondaryActions?: React.ReactNode;\n onCancelClick: () => void;\n onPreviousClick: () => void;\n onPrimaryClick: () => void;\n onSkipToClick: (stepIndex: number) => void;\n}\n\nexport const STEP_NAME_SELECTOR = `[${DATA_ATTR_FUNNEL_KEY}=\"${FUNNEL_KEY_STEP_NAME}\"]`;\n\nexport default function WizardFormWithAnalytics(props: WizardFormProps) {\n const analyticsMetadata = getAnalyticsMetadataProps(\n props.steps[props.activeStepIndex] as BasePropsWithAnalyticsMetadata\n );\n const __internalRootRef = useComponentMetadata('WizardForm', PACKAGE_VERSION, { ...analyticsMetadata });\n const stepHeaderRef = useRef<HTMLDivElement | null>(null);\n\n useEffectOnUpdate(() => {\n if (stepHeaderRef && stepHeaderRef.current) {\n stepHeaderRef.current?.focus();\n }\n }, [props.activeStepIndex]);\n\n return (\n <AnalyticsFunnelStep\n stepIdentifier={analyticsMetadata?.instanceIdentifier}\n stepErrorContext={analyticsMetadata?.errorContext}\n stepNameSelector={STEP_NAME_SELECTOR}\n stepNumber={props.activeStepIndex + 1}\n >\n <WizardForm stepHeaderRef={stepHeaderRef} __internalRootRef={__internalRootRef} {...props} />\n </AnalyticsFunnelStep>\n );\n}\n\nfunction WizardForm({\n __internalRootRef,\n stepHeaderRef,\n steps,\n activeStepIndex,\n showCollapsedSteps,\n i18nStrings,\n submitButtonText,\n isPrimaryLoading,\n allowSkipTo,\n secondaryActions,\n onCancelClick,\n onPreviousClick,\n onPrimaryClick,\n onSkipToClick,\n}: WizardFormProps & { stepHeaderRef: MutableRefObject<HTMLDivElement | null> }) {\n const { title, info, description, content, errorText, isOptional } = steps[activeStepIndex] || {};\n const isLastStep = activeStepIndex >= steps.length - 1;\n const skipToTargetIndex = findSkipToTargetIndex(steps, activeStepIndex);\n\n const { funnelInteractionId, funnelIdentifier } = useFunnel();\n\n const funnelStepInfo = useFunnelStepRef();\n\n const errorSlotId = useUniqueId('wizard-error-');\n\n const showSkipTo = allowSkipTo && skipToTargetIndex !== -1;\n const skipToButtonText =\n skipToTargetIndex !== -1 && i18nStrings.skipToButtonLabel\n ? i18nStrings.skipToButtonLabel(steps[skipToTargetIndex], skipToTargetIndex + 1)\n : undefined;\n\n useEffect(() => {\n if (funnelInteractionId && errorText) {\n const stepName = getTextFromSelector(funnelStepInfo.current.stepNameSelector);\n\n FunnelMetrics.funnelStepError({\n funnelInteractionId,\n stepNumber: funnelStepInfo.current.stepNumber,\n stepNameSelector: funnelStepInfo.current.stepNameSelector,\n stepName,\n stepIdentifier: funnelStepInfo.current.stepIdentifier,\n currentDocument: __internalRootRef?.current?.ownerDocument,\n totalSubSteps: funnelStepInfo.current.subStepCount.current,\n funnelIdentifier,\n subStepAllSelector: getSubStepAllSelector(),\n stepErrorContext: funnelStepInfo.current.stepErrorContext,\n subStepConfiguration: funnelStepInfo.current.subStepConfiguration.current?.get(\n funnelStepInfo.current.stepNumber\n ),\n stepErrorSelector: '#' + errorSlotId,\n });\n }\n }, [funnelInteractionId, funnelIdentifier, isLastStep, errorText, __internalRootRef, errorSlotId, funnelStepInfo]);\n\n return (\n <>\n <WizardFormHeader>\n <div className={clsx(styles['collapsed-steps'], !showCollapsedSteps && styles['collapsed-steps-hidden'])}>\n {i18nStrings.collapsedStepsLabel?.(activeStepIndex + 1, steps.length)}\n </div>\n <InternalHeader\n className={styles['form-header-component']}\n variant=\"h1\"\n description={description}\n info={info}\n __headingTagRef={stepHeaderRef}\n __headingTagTabIndex={-1}\n >\n <span className={styles['form-header-component-wrapper']}>\n <span {...{ [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_STEP_NAME }}>{title}</span>\n {isOptional && <i>{` - ${i18nStrings.optional}`}</i>}\n </span>\n </InternalHeader>\n </WizardFormHeader>\n\n <InternalForm\n __internalRootRef={__internalRootRef}\n className={styles['form-component']}\n actions={\n <WizardActions\n cancelButtonText={i18nStrings.cancelButton}\n primaryButtonText={isLastStep ? submitButtonText ?? i18nStrings.submitButton : i18nStrings.nextButton}\n primaryButtonLoadingText={\n isLastStep ? i18nStrings.submitButtonLoadingAnnouncement : i18nStrings.nextButtonLoadingAnnouncement\n }\n previousButtonText={i18nStrings.previousButton}\n onCancelClick={onCancelClick}\n onPreviousClick={onPreviousClick}\n onPrimaryClick={onPrimaryClick}\n onSkipToClick={() => onSkipToClick(skipToTargetIndex)}\n showPrevious={activeStepIndex !== 0}\n isPrimaryLoading={isPrimaryLoading}\n showSkipTo={showSkipTo}\n skipToButtonText={skipToButtonText}\n isLastStep={isLastStep}\n activeStepIndex={activeStepIndex}\n skipToStepIndex={skipToTargetIndex}\n />\n }\n secondaryActions={secondaryActions}\n errorText={errorText}\n __errorSlotId={errorSlotId}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n {...funnelStepInfo.current.funnelStepProps}\n >\n {content}\n </InternalForm>\n </>\n );\n}\n\nfunction findSkipToTargetIndex(steps: ReadonlyArray<WizardProps.Step>, activeStepIndex: number): number {\n let nextRequiredStepIndex = activeStepIndex;\n do {\n nextRequiredStepIndex++;\n } while (nextRequiredStepIndex < steps.length - 1 && steps[nextRequiredStepIndex].isOptional);\n\n return nextRequiredStepIndex > activeStepIndex + 1 ? nextRequiredStepIndex : -1;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"wizard-form.js","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAoB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAGrF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAiBrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,oBAAoB,KAAK,oBAAoB,IAAI,CAAC;AAExF,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,KAAsB;IACpE,MAAM,iBAAiB,GAAG,yBAAyB,C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CAAC,+BAA+B,CAAC,CAAC,CAAC,WAAW,CAAC,6BAA6B,EAEtG,kBAAkB,EAAE,WAAW,CAAC,cAAc,EAC9C,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,EACrD,YAAY,EAAE,eAAe,KAAK,CAAC,EACnC,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,iBAAiB,GAClC,EAEJ,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,WAAW,EAC1B,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,IAC9C,cAAc,CAAC,OAAO,CAAC,eAAe,GAEzC,OAAO,CACK,CACd,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsC,EAAE,eAAuB;IAC5F,IAAI,qBAAqB,GAAG,eAAe,CAAC;IAC5C,GAAG;QACD,qBAAqB,EAAE,CAAC;KACzB,QAAQ,qBAAqB,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,UAAU,EAAE;IAE9F,OAAO,qBAAqB,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MutableRefObject, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useComponentMetadata } from '@cloudscape-design/component-toolkit/internal';\nimport { AnalyticsMetadata } from '@cloudscape-design/component-toolkit/internal/base-component/metrics/interfaces';\n\nimport InternalForm from '../form/internal';\nimport InternalHeader from '../header/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';\nimport { useFunnel, useFunnelStepRef } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_KEY,\n FUNNEL_KEY_STEP_NAME,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport { PACKAGE_VERSION } from '../internal/environment';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { WizardProps } from './interfaces';\nimport WizardActions from './wizard-actions';\nimport WizardFormHeader from './wizard-form-header';\n\nimport styles from './styles.css.js';\n\ninterface WizardFormProps extends InternalBaseComponentProps {\n steps: ReadonlyArray<WizardProps.Step>;\n activeStepIndex: number;\n showCollapsedSteps: boolean;\n i18nStrings: WizardProps.I18nStrings;\n submitButtonText?: string;\n isPrimaryLoading: boolean;\n allowSkipTo: boolean;\n secondaryActions?: React.ReactNode;\n onCancelClick: () => void;\n onPreviousClick: () => void;\n onPrimaryClick: () => void;\n onSkipToClick: (stepIndex: number) => void;\n}\n\nexport const STEP_NAME_SELECTOR = `[${DATA_ATTR_FUNNEL_KEY}=\"${FUNNEL_KEY_STEP_NAME}\"]`;\n\nexport default function WizardFormWithAnalytics(props: WizardFormProps) {\n const analyticsMetadata = getAnalyticsMetadataProps(\n props.steps[props.activeStepIndex] as BasePropsWithAnalyticsMetadata\n );\n\n const __internalRootRef = useComponentMetadata('WizardForm', PACKAGE_VERSION, analyticsMetadata as AnalyticsMetadata);\n const stepHeaderRef = useRef<HTMLDivElement | null>(null);\n\n useEffectOnUpdate(() => {\n if (stepHeaderRef && stepHeaderRef.current) {\n stepHeaderRef.current?.focus();\n }\n }, [props.activeStepIndex]);\n\n return (\n <AnalyticsFunnelStep\n stepIdentifier={analyticsMetadata?.instanceIdentifier}\n stepErrorContext={analyticsMetadata?.errorContext}\n stepNameSelector={STEP_NAME_SELECTOR}\n stepNumber={props.activeStepIndex + 1}\n >\n <WizardForm stepHeaderRef={stepHeaderRef} __internalRootRef={__internalRootRef} {...props} />\n </AnalyticsFunnelStep>\n );\n}\n\nfunction WizardForm({\n __internalRootRef,\n stepHeaderRef,\n steps,\n activeStepIndex,\n showCollapsedSteps,\n i18nStrings,\n submitButtonText,\n isPrimaryLoading,\n allowSkipTo,\n secondaryActions,\n onCancelClick,\n onPreviousClick,\n onPrimaryClick,\n onSkipToClick,\n}: WizardFormProps & { stepHeaderRef: MutableRefObject<HTMLDivElement | null> }) {\n const { title, info, description, content, errorText, isOptional } = steps[activeStepIndex] || {};\n const isLastStep = activeStepIndex >= steps.length - 1;\n const skipToTargetIndex = findSkipToTargetIndex(steps, activeStepIndex);\n\n const { funnelInteractionId, funnelIdentifier } = useFunnel();\n\n const funnelStepInfo = useFunnelStepRef();\n\n const errorSlotId = useUniqueId('wizard-error-');\n\n const showSkipTo = allowSkipTo && skipToTargetIndex !== -1;\n const skipToButtonText =\n skipToTargetIndex !== -1 && i18nStrings.skipToButtonLabel\n ? i18nStrings.skipToButtonLabel(steps[skipToTargetIndex], skipToTargetIndex + 1)\n : undefined;\n\n useEffect(() => {\n if (funnelInteractionId && errorText) {\n const stepName = getTextFromSelector(funnelStepInfo.current.stepNameSelector);\n\n FunnelMetrics.funnelStepError({\n funnelInteractionId,\n stepNumber: funnelStepInfo.current.stepNumber,\n stepNameSelector: funnelStepInfo.current.stepNameSelector,\n stepName,\n stepIdentifier: funnelStepInfo.current.stepIdentifier,\n currentDocument: __internalRootRef?.current?.ownerDocument,\n totalSubSteps: funnelStepInfo.current.subStepCount.current,\n funnelIdentifier,\n subStepAllSelector: getSubStepAllSelector(),\n errorContext: funnelStepInfo.current.stepErrorContext,\n subStepConfiguration: funnelStepInfo.current.subStepConfiguration.current?.get(\n funnelStepInfo.current.stepNumber\n ),\n stepErrorSelector: '#' + errorSlotId,\n });\n }\n }, [funnelInteractionId, funnelIdentifier, isLastStep, errorText, __internalRootRef, errorSlotId, funnelStepInfo]);\n\n return (\n <>\n <WizardFormHeader>\n <div className={clsx(styles['collapsed-steps'], !showCollapsedSteps && styles['collapsed-steps-hidden'])}>\n {i18nStrings.collapsedStepsLabel?.(activeStepIndex + 1, steps.length)}\n </div>\n <InternalHeader\n className={styles['form-header-component']}\n variant=\"h1\"\n description={description}\n info={info}\n __headingTagRef={stepHeaderRef}\n __headingTagTabIndex={-1}\n >\n <span className={styles['form-header-component-wrapper']}>\n <span {...{ [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_STEP_NAME }}>{title}</span>\n {isOptional && <i>{` - ${i18nStrings.optional}`}</i>}\n </span>\n </InternalHeader>\n </WizardFormHeader>\n\n <InternalForm\n __internalRootRef={__internalRootRef}\n className={styles['form-component']}\n actions={\n <WizardActions\n cancelButtonText={i18nStrings.cancelButton}\n primaryButtonText={isLastStep ? submitButtonText ?? i18nStrings.submitButton : i18nStrings.nextButton}\n primaryButtonLoadingText={\n isLastStep ? i18nStrings.submitButtonLoadingAnnouncement : i18nStrings.nextButtonLoadingAnnouncement\n }\n previousButtonText={i18nStrings.previousButton}\n onCancelClick={onCancelClick}\n onPreviousClick={onPreviousClick}\n onPrimaryClick={onPrimaryClick}\n onSkipToClick={() => onSkipToClick(skipToTargetIndex)}\n showPrevious={activeStepIndex !== 0}\n isPrimaryLoading={isPrimaryLoading}\n showSkipTo={showSkipTo}\n skipToButtonText={skipToButtonText}\n isLastStep={isLastStep}\n activeStepIndex={activeStepIndex}\n skipToStepIndex={skipToTargetIndex}\n />\n }\n secondaryActions={secondaryActions}\n errorText={errorText}\n __errorSlotId={errorSlotId}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n {...funnelStepInfo.current.funnelStepProps}\n >\n {content}\n </InternalForm>\n </>\n );\n}\n\nfunction findSkipToTargetIndex(steps: ReadonlyArray<WizardProps.Step>, activeStepIndex: number): number {\n let nextRequiredStepIndex = activeStepIndex;\n do {\n nextRequiredStepIndex++;\n } while (nextRequiredStepIndex < steps.length - 1 && steps[nextRequiredStepIndex].isOptional);\n\n return nextRequiredStepIndex > activeStepIndex + 1 ? nextRequiredStepIndex : -1;\n}\n"]}
|