@cloudscape-design/components 3.0.791 → 3.0.792
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/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +19 -19
- package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +40 -40
- package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +19 -19
- package/form/index.d.ts.map +1 -1
- package/form/index.js +3 -3
- package/form/index.js.map +1 -1
- package/internal/analytics/components/analytics-funnel.d.ts +2 -0
- package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/internal/analytics/components/analytics-funnel.js +48 -5
- package/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +6 -21
- package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
- package/internal/analytics/hooks/use-funnel.js +0 -7
- package/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/internal/analytics/interfaces.d.ts +3 -2
- package/internal/analytics/interfaces.d.ts.map +1 -1
- package/internal/analytics/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +23 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +5 -0
- package/internal/generated/styles/tokens.js +5 -0
- package/internal/generated/theming/index.cjs +134 -0
- package/internal/generated/theming/index.cjs.d.ts +16 -0
- package/internal/generated/theming/index.d.ts +16 -0
- package/internal/generated/theming/index.js +134 -0
- package/internal/manifest.json +1 -1
- package/modal/index.d.ts.map +1 -1
- package/modal/index.js +22 -2
- package/modal/index.js.map +1 -1
- package/modal/interfaces.d.ts +14 -0
- package/modal/interfaces.d.ts.map +1 -1
- package/modal/interfaces.js.map +1 -1
- package/modal/internal.d.ts +9 -0
- package/modal/internal.d.ts.map +1 -1
- package/modal/internal.js +20 -6
- package/modal/internal.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"has-adaptive-widths-default": "awsui_has-adaptive-widths-
|
|
6
|
-
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-
|
|
7
|
-
"navigation": "
|
|
8
|
-
"tools": "
|
|
9
|
-
"global-tools": "awsui_global-
|
|
10
|
-
"tools-open": "awsui_tools-
|
|
11
|
-
"split-panel-side": "awsui_split-panel-
|
|
12
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
13
|
-
"panel-hidden": "awsui_panel-
|
|
14
|
-
"toolbar-container": "awsui_toolbar-
|
|
15
|
-
"notifications-container": "awsui_notifications-
|
|
16
|
-
"notifications-background": "awsui_notifications-
|
|
17
|
-
"main-landmark": "awsui_main-
|
|
18
|
-
"main": "
|
|
19
|
-
"main-disable-paddings": "awsui_main-disable-
|
|
20
|
-
"content-header": "awsui_content-
|
|
21
|
-
"content": "
|
|
22
|
-
"unfocusable-mobile": "awsui_unfocusable-
|
|
4
|
+
"root": "awsui_root_7nfqu_jdfl5_149",
|
|
5
|
+
"has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_jdfl5_198",
|
|
6
|
+
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_jdfl5_213",
|
|
7
|
+
"navigation": "awsui_navigation_7nfqu_jdfl5_228",
|
|
8
|
+
"tools": "awsui_tools_7nfqu_jdfl5_229",
|
|
9
|
+
"global-tools": "awsui_global-tools_7nfqu_jdfl5_230",
|
|
10
|
+
"tools-open": "awsui_tools-open_7nfqu_jdfl5_268",
|
|
11
|
+
"split-panel-side": "awsui_split-panel-side_7nfqu_jdfl5_281",
|
|
12
|
+
"split-panel-bottom": "awsui_split-panel-bottom_7nfqu_jdfl5_288",
|
|
13
|
+
"panel-hidden": "awsui_panel-hidden_7nfqu_jdfl5_301",
|
|
14
|
+
"toolbar-container": "awsui_toolbar-container_7nfqu_jdfl5_311",
|
|
15
|
+
"notifications-container": "awsui_notifications-container_7nfqu_jdfl5_317",
|
|
16
|
+
"notifications-background": "awsui_notifications-background_7nfqu_jdfl5_321",
|
|
17
|
+
"main-landmark": "awsui_main-landmark_7nfqu_jdfl5_332",
|
|
18
|
+
"main": "awsui_main_7nfqu_jdfl5_332",
|
|
19
|
+
"main-disable-paddings": "awsui_main-disable-paddings_7nfqu_jdfl5_341",
|
|
20
|
+
"content-header": "awsui_content-header_7nfqu_jdfl5_351",
|
|
21
|
+
"content": "awsui_content_7nfqu_jdfl5_351",
|
|
22
|
+
"unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_jdfl5_361"
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -146,7 +146,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
146
146
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
147
147
|
SPDX-License-Identifier: Apache-2.0
|
|
148
148
|
*/
|
|
149
|
-
.
|
|
149
|
+
.awsui_root_7nfqu_jdfl5_149:not(#\9) {
|
|
150
150
|
border-collapse: separate;
|
|
151
151
|
border-spacing: 0;
|
|
152
152
|
box-sizing: border-box;
|
|
@@ -189,104 +189,104 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
189
189
|
grid-template-rows: min-content min-content 1fr;
|
|
190
190
|
}
|
|
191
191
|
@media (min-width: 689px) {
|
|
192
|
-
.
|
|
192
|
+
.awsui_root_7nfqu_jdfl5_149:not(#\9) {
|
|
193
193
|
grid-template-areas: "toolbar toolbar toolbar toolbar toolbar toolbar toolbar" "navigation . notifications . sideSplitPanel tools global-tools" "navigation . main . sideSplitPanel tools global-tools";
|
|
194
194
|
grid-template-columns: min-content minmax(var(--space-layout-content-horizontal-7l52k3, 24px), 1fr) minmax(0, var(--awsui-max-content-width-g964ok)) minmax(var(--space-layout-content-horizontal-7l52k3, 24px), 1fr) min-content min-content;
|
|
195
195
|
grid-template-rows: min-content min-content 1fr min-content;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
@media (min-width: 689px) and (min-width: 1401px) {
|
|
199
|
-
.
|
|
199
|
+
.awsui_root_7nfqu_jdfl5_149.awsui_has-adaptive-widths-default_7nfqu_jdfl5_198:not(#\9) {
|
|
200
200
|
--awsui-max-content-width-g964ok: 1280px;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
@media (min-width: 689px) and (min-width: 1921px) {
|
|
204
|
-
.
|
|
204
|
+
.awsui_root_7nfqu_jdfl5_149.awsui_has-adaptive-widths-default_7nfqu_jdfl5_198:not(#\9) {
|
|
205
205
|
--awsui-max-content-width-g964ok: 1440px;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
@media (min-width: 689px) and (min-width: 2541px) {
|
|
209
|
-
.
|
|
209
|
+
.awsui_root_7nfqu_jdfl5_149.awsui_has-adaptive-widths-default_7nfqu_jdfl5_198:not(#\9) {
|
|
210
210
|
--awsui-max-content-width-g964ok: 1620px;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
@media (min-width: 689px) and (min-width: 1401px) {
|
|
214
|
-
.
|
|
214
|
+
.awsui_root_7nfqu_jdfl5_149.awsui_has-adaptive-widths-dashboard_7nfqu_jdfl5_213:not(#\9) {
|
|
215
215
|
--awsui-max-content-width-g964ok: 1280px;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
@media (min-width: 689px) and (min-width: 1921px) {
|
|
219
|
-
.
|
|
219
|
+
.awsui_root_7nfqu_jdfl5_149.awsui_has-adaptive-widths-dashboard_7nfqu_jdfl5_213:not(#\9) {
|
|
220
220
|
--awsui-max-content-width-g964ok: 1620px;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
@media (min-width: 689px) and (min-width: 2541px) {
|
|
224
|
-
.
|
|
224
|
+
.awsui_root_7nfqu_jdfl5_149.awsui_has-adaptive-widths-dashboard_7nfqu_jdfl5_213:not(#\9) {
|
|
225
225
|
--awsui-max-content-width-g964ok: 2160px;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
.
|
|
230
|
-
.
|
|
231
|
-
.awsui_global-
|
|
229
|
+
.awsui_navigation_7nfqu_jdfl5_228:not(#\9),
|
|
230
|
+
.awsui_tools_7nfqu_jdfl5_229:not(#\9),
|
|
231
|
+
.awsui_global-tools_7nfqu_jdfl5_230:not(#\9) {
|
|
232
232
|
grid-row: 1/-1;
|
|
233
233
|
grid-column: 1/-1;
|
|
234
234
|
background: var(--color-background-container-content-z79u4u, #ffffff);
|
|
235
235
|
opacity: 1;
|
|
236
236
|
}
|
|
237
237
|
@media (max-width: 688px) {
|
|
238
|
-
.
|
|
239
|
-
.
|
|
240
|
-
.awsui_global-
|
|
238
|
+
.awsui_navigation_7nfqu_jdfl5_228:not(#\9),
|
|
239
|
+
.awsui_tools_7nfqu_jdfl5_229:not(#\9),
|
|
240
|
+
.awsui_global-tools_7nfqu_jdfl5_230:not(#\9) {
|
|
241
241
|
inline-size: 100%;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
.
|
|
245
|
+
.awsui_navigation_7nfqu_jdfl5_228:not(#\9) {
|
|
246
246
|
z-index: 830;
|
|
247
247
|
}
|
|
248
248
|
@media (min-width: 689px) {
|
|
249
|
-
.
|
|
249
|
+
.awsui_navigation_7nfqu_jdfl5_228:not(#\9) {
|
|
250
250
|
grid-area: navigation;
|
|
251
251
|
inline-size: var(--awsui-navigation-width-g964ok);
|
|
252
252
|
border-inline-end: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-layout-hrw5xj, #b4b4bb);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
@media (max-width: 688px) {
|
|
256
|
-
.
|
|
256
|
+
.awsui_navigation_7nfqu_jdfl5_228:not(#\9) {
|
|
257
257
|
z-index: 1001;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
@media (min-width: 689px) {
|
|
262
|
-
.
|
|
262
|
+
.awsui_tools_7nfqu_jdfl5_229:not(#\9) {
|
|
263
263
|
grid-area: tools;
|
|
264
264
|
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
265
265
|
}
|
|
266
|
-
.
|
|
266
|
+
.awsui_tools_7nfqu_jdfl5_229:not(#\9):not(:has(> [data-testid])) {
|
|
267
267
|
inline-size: var(--awsui-tools-width-g964ok);
|
|
268
268
|
}
|
|
269
|
-
.
|
|
269
|
+
.awsui_tools_7nfqu_jdfl5_229:not(#\9):not(:has(> [data-testid])).awsui_tools-open_7nfqu_jdfl5_268 {
|
|
270
270
|
border-inline-start: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-layout-hrw5xj, #b4b4bb);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
@media (min-width: 689px) {
|
|
275
|
-
.awsui_global-
|
|
275
|
+
.awsui_global-tools_7nfqu_jdfl5_230:not(#\9) {
|
|
276
276
|
display: flex;
|
|
277
277
|
grid-area: global-tools;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
@media (min-width: 689px) {
|
|
282
|
-
.awsui_split-panel-
|
|
282
|
+
.awsui_split-panel-side_7nfqu_jdfl5_281:not(#\9) {
|
|
283
283
|
grid-area: sideSplitPanel;
|
|
284
284
|
border-inline-start: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-layout-hrw5xj, #b4b4bb);
|
|
285
285
|
opacity: 1;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
.awsui_split-panel-
|
|
289
|
+
.awsui_split-panel-bottom_7nfqu_jdfl5_288:not(#\9) {
|
|
290
290
|
position: sticky;
|
|
291
291
|
z-index: 840;
|
|
292
292
|
align-self: end;
|
|
@@ -294,72 +294,72 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
294
294
|
grid-column: 1/-1;
|
|
295
295
|
}
|
|
296
296
|
@media (min-width: 689px) {
|
|
297
|
-
.awsui_split-panel-
|
|
298
|
-
grid-column: 2/
|
|
297
|
+
.awsui_split-panel-bottom_7nfqu_jdfl5_288:not(#\9) {
|
|
298
|
+
grid-column: 2/5;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
.awsui_panel-
|
|
302
|
+
.awsui_panel-hidden_7nfqu_jdfl5_301:not(#\9) {
|
|
303
303
|
border-block: none;
|
|
304
304
|
border-inline: none;
|
|
305
305
|
opacity: 0;
|
|
306
306
|
z-index: 0;
|
|
307
307
|
}
|
|
308
|
-
.awsui_panel-
|
|
308
|
+
.awsui_panel-hidden_7nfqu_jdfl5_301.awsui_navigation_7nfqu_jdfl5_228:not(#\9), .awsui_panel-hidden_7nfqu_jdfl5_301.awsui_tools_7nfqu_jdfl5_229:not(#\9), .awsui_panel-hidden_7nfqu_jdfl5_301.awsui_global-tools_7nfqu_jdfl5_230:not(#\9) {
|
|
309
309
|
inline-size: 0px;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
.awsui_toolbar-
|
|
312
|
+
.awsui_toolbar-container_7nfqu_jdfl5_311:not(#\9) {
|
|
313
313
|
grid-area: toolbar;
|
|
314
314
|
block-size: 42px;
|
|
315
315
|
border-block-end: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-layout-hrw5xj, #b4b4bb);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
.awsui_notifications-
|
|
318
|
+
.awsui_notifications-container_7nfqu_jdfl5_317:not(#\9) {
|
|
319
319
|
grid-area: notifications;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
.awsui_notifications-
|
|
322
|
+
.awsui_notifications-background_7nfqu_jdfl5_321:not(#\9) {
|
|
323
323
|
background: var(--color-background-layout-main-nqw91u, #ffffff);
|
|
324
324
|
grid-area: notifications;
|
|
325
325
|
grid-column: 1/-1;
|
|
326
326
|
}
|
|
327
327
|
@media (min-width: 689px) {
|
|
328
|
-
.awsui_notifications-
|
|
329
|
-
grid-column: 2/
|
|
328
|
+
.awsui_notifications-background_7nfqu_jdfl5_321:not(#\9) {
|
|
329
|
+
grid-column: 2/5;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
.awsui_main-
|
|
333
|
+
.awsui_main-landmark_7nfqu_jdfl5_332:not(#\9) {
|
|
334
334
|
display: contents;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
.
|
|
337
|
+
.awsui_main_7nfqu_jdfl5_332:not(#\9) {
|
|
338
338
|
grid-area: main;
|
|
339
339
|
margin-block-start: var(--space-scaled-s-aqzyko, 12px);
|
|
340
340
|
margin-block-end: var(--space-layout-content-bottom-noqzmw, 40px);
|
|
341
341
|
}
|
|
342
|
-
.awsui_main-disable-
|
|
342
|
+
.awsui_main-disable-paddings_7nfqu_jdfl5_341:not(#\9) {
|
|
343
343
|
margin-block: 0;
|
|
344
344
|
grid-column: 1/-1;
|
|
345
345
|
}
|
|
346
346
|
@media (min-width: 689px) {
|
|
347
|
-
.awsui_main-disable-
|
|
348
|
-
grid-column: 2/
|
|
347
|
+
.awsui_main-disable-paddings_7nfqu_jdfl5_341:not(#\9) {
|
|
348
|
+
grid-column: 2/5;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
.awsui_content-
|
|
352
|
+
.awsui_content-header_7nfqu_jdfl5_351:not(#\9) {
|
|
353
353
|
margin-block-end: var(--space-content-header-padding-bottom-y2enua, 16px);
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
.
|
|
356
|
+
.awsui_content_7nfqu_jdfl5_351:not(#\9) {
|
|
357
357
|
display: contents;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
/* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
|
|
361
361
|
@media (max-width: 688px) {
|
|
362
|
-
.awsui_unfocusable-
|
|
362
|
+
.awsui_unfocusable-mobile_7nfqu_jdfl5_361 *:not(#\9) {
|
|
363
363
|
visibility: hidden;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"has-adaptive-widths-default": "awsui_has-adaptive-widths-
|
|
7
|
-
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-
|
|
8
|
-
"navigation": "
|
|
9
|
-
"tools": "
|
|
10
|
-
"global-tools": "awsui_global-
|
|
11
|
-
"tools-open": "awsui_tools-
|
|
12
|
-
"split-panel-side": "awsui_split-panel-
|
|
13
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
14
|
-
"panel-hidden": "awsui_panel-
|
|
15
|
-
"toolbar-container": "awsui_toolbar-
|
|
16
|
-
"notifications-container": "awsui_notifications-
|
|
17
|
-
"notifications-background": "awsui_notifications-
|
|
18
|
-
"main-landmark": "awsui_main-
|
|
19
|
-
"main": "
|
|
20
|
-
"main-disable-paddings": "awsui_main-disable-
|
|
21
|
-
"content-header": "awsui_content-
|
|
22
|
-
"content": "
|
|
23
|
-
"unfocusable-mobile": "awsui_unfocusable-
|
|
5
|
+
"root": "awsui_root_7nfqu_jdfl5_149",
|
|
6
|
+
"has-adaptive-widths-default": "awsui_has-adaptive-widths-default_7nfqu_jdfl5_198",
|
|
7
|
+
"has-adaptive-widths-dashboard": "awsui_has-adaptive-widths-dashboard_7nfqu_jdfl5_213",
|
|
8
|
+
"navigation": "awsui_navigation_7nfqu_jdfl5_228",
|
|
9
|
+
"tools": "awsui_tools_7nfqu_jdfl5_229",
|
|
10
|
+
"global-tools": "awsui_global-tools_7nfqu_jdfl5_230",
|
|
11
|
+
"tools-open": "awsui_tools-open_7nfqu_jdfl5_268",
|
|
12
|
+
"split-panel-side": "awsui_split-panel-side_7nfqu_jdfl5_281",
|
|
13
|
+
"split-panel-bottom": "awsui_split-panel-bottom_7nfqu_jdfl5_288",
|
|
14
|
+
"panel-hidden": "awsui_panel-hidden_7nfqu_jdfl5_301",
|
|
15
|
+
"toolbar-container": "awsui_toolbar-container_7nfqu_jdfl5_311",
|
|
16
|
+
"notifications-container": "awsui_notifications-container_7nfqu_jdfl5_317",
|
|
17
|
+
"notifications-background": "awsui_notifications-background_7nfqu_jdfl5_321",
|
|
18
|
+
"main-landmark": "awsui_main-landmark_7nfqu_jdfl5_332",
|
|
19
|
+
"main": "awsui_main_7nfqu_jdfl5_332",
|
|
20
|
+
"main-disable-paddings": "awsui_main-disable-paddings_7nfqu_jdfl5_341",
|
|
21
|
+
"content-header": "awsui_content-header_7nfqu_jdfl5_351",
|
|
22
|
+
"content": "awsui_content_7nfqu_jdfl5_351",
|
|
23
|
+
"unfocusable-mobile": "awsui_unfocusable-mobile_7nfqu_jdfl5_361"
|
|
24
24
|
};
|
|
25
25
|
|
package/form/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAgDrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAgDrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,eAwC1E"}
|
package/form/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import useBaseComponent from '../internal/hooks/use-base-component';
|
|
|
11
11
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
12
12
|
import InternalForm from './internal';
|
|
13
13
|
import headerStyles from '../header/styles.css.js';
|
|
14
|
-
import
|
|
14
|
+
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
15
15
|
const FormWithAnalytics = (_a) => {
|
|
16
16
|
var { variant = 'full-page', actions, errorText } = _a, props = __rest(_a, ["variant", "actions", "errorText"]);
|
|
17
17
|
const { funnelIdentifier, funnelInteractionId, funnelProps, funnelSubmit, funnelNextOrSubmitAttempt, errorCount, submissionAttempt, funnelErrorContext, } = useFunnel();
|
|
@@ -49,8 +49,8 @@ export default function Form(_a) {
|
|
|
49
49
|
},
|
|
50
50
|
}, analyticsMetadata);
|
|
51
51
|
const inheritedFunnelNameSelector = useFunnelNameSelector();
|
|
52
|
-
const funnelNameSelector = inheritedFunnelNameSelector || `.${headerStyles['heading-text']}`;
|
|
53
|
-
return (React.createElement(AnalyticsFunnel, { funnelIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, funnelFlowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, funnelErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelResourceType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.resourceType, funnelType: "single-page", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelectors: [funnelNameSelector, `.${
|
|
52
|
+
const funnelNameSelector = inheritedFunnelNameSelector || `.${analyticsSelectors.header} .${headerStyles['heading-text']}`;
|
|
53
|
+
return (React.createElement(AnalyticsFunnel, { funnelIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, funnelFlowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, funnelErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelResourceType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.resourceType, funnelType: "single-page", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelectors: [funnelNameSelector, `.${analyticsSelectors.header}`] },
|
|
54
54
|
React.createElement(AnalyticsFunnelStep, { stepIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, stepErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, stepNumber: 1 },
|
|
55
55
|
React.createElement(FormWithAnalytics, Object.assign({ variant: variant }, props, baseComponentProps)))));
|
|
56
56
|
}
|
package/form/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACzG,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvG,OAAO,EAAE,aAAa,EAAsB,MAAM,oCAAoC,CAAC;AACvF,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,YAAY,MAAM,YAAY,CAAC;AAEtC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAA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YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;IAElG,OAAO,CACL,oBAAC,eAAe,IACd,gBAAgB,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB,EACvD,cAAc,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,QAAQ,EAC3C,kBAAkB,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,YAAY,EACnD,kBAAkB,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,YAAY,EACnD,UAAU,EAAC,aAAa,EACxB,mBAAmB,EAAE,EAAE,EACvB,gBAAgB,EAAE,CAAC,EACnB,mBAAmB,EAAE,CAAC,kBAAkB,EAAE,IAAI,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAE1E,oBAAC,mBAAmB,IAClB,cAAc,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB,EACrD,gBAAgB,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,YAAY,EACjD,UAAU,EAAE,CAAC;YAEb,oBAAC,iBAAiB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,EAAI,CACtD,CACN,CACnB,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { AnalyticsFunnel, AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';\nimport { useFunnel, useFunnelNameSelector, useFunnelStep } from '../internal/analytics/hooks/use-funnel';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { FormProps } from './interfaces';\nimport InternalForm from './internal';\n\nimport headerStyles from '../header/styles.css.js';\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { FormProps };\n\nconst FormWithAnalytics = ({ variant = 'full-page', actions, errorText, ...props }: FormProps) => {\n const {\n funnelIdentifier,\n funnelInteractionId,\n funnelProps,\n funnelSubmit,\n funnelNextOrSubmitAttempt,\n errorCount,\n submissionAttempt,\n funnelErrorContext,\n } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n\n const handleActionButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n useEffect(() => {\n if (funnelInteractionId && errorText) {\n errorCount.current++;\n FunnelMetrics.funnelError({ funnelInteractionId, funnelIdentifier, funnelErrorContext });\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n }, [funnelInteractionId, funnelIdentifier, errorText, submissionAttempt, errorCount, funnelErrorContext]);\n\n return (\n <ButtonContext.Provider value={{ onClick: handleActionButtonClick }}>\n <InternalForm\n variant={variant}\n actions={actions}\n errorText={errorText}\n {...props}\n {...funnelProps}\n {...funnelStepProps}\n __injectAnalyticsComponentMetadata={true}\n />\n </ButtonContext.Provider>\n );\n};\n\nexport default function Form({ variant = 'full-page', ...props }: FormProps) {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent(\n 'Form',\n {\n props: {\n variant,\n flowType: analyticsMetadata?.flowType,\n },\n metadata: {\n hasResourceType: Boolean(analyticsMetadata?.resourceType),\n hasInstanceIdentifier: Boolean(analyticsMetadata?.instanceIdentifier),\n },\n },\n analyticsMetadata\n );\n const inheritedFunnelNameSelector = useFunnelNameSelector();\n const funnelNameSelector =\n inheritedFunnelNameSelector || `.${analyticsSelectors.header} .${headerStyles['heading-text']}`;\n\n return (\n <AnalyticsFunnel\n funnelIdentifier={analyticsMetadata?.instanceIdentifier}\n funnelFlowType={analyticsMetadata?.flowType}\n funnelErrorContext={analyticsMetadata?.errorContext}\n funnelResourceType={analyticsMetadata?.resourceType}\n funnelType=\"single-page\"\n optionalStepNumbers={[]}\n totalFunnelSteps={1}\n funnelNameSelectors={[funnelNameSelector, `.${analyticsSelectors.header}`]}\n >\n <AnalyticsFunnelStep\n stepIdentifier={analyticsMetadata?.instanceIdentifier}\n stepErrorContext={analyticsMetadata?.errorContext}\n stepNumber={1}\n >\n <FormWithAnalytics variant={variant} {...props} {...baseComponentProps} />\n </AnalyticsFunnelStep>\n </AnalyticsFunnel>\n );\n}\n\napplyDisplayName(Form, 'Form');\n"]}
|
|
@@ -3,6 +3,7 @@ import { FunnelStepContextValue, FunnelSubStepContextValue } from '../context/an
|
|
|
3
3
|
import { AnalyticsMetadata, FunnelStartProps, FunnelStepProps, StepConfiguration } from '../interfaces';
|
|
4
4
|
export declare const FUNNEL_VERSION = "1.4";
|
|
5
5
|
interface AnalyticsFunnelProps {
|
|
6
|
+
mounted?: boolean;
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
stepConfiguration?: StepConfiguration[];
|
|
8
9
|
funnelNameSelectors?: string[];
|
|
@@ -17,6 +18,7 @@ interface AnalyticsFunnelProps {
|
|
|
17
18
|
export declare const AnalyticsFunnel: (props: AnalyticsFunnelProps) => JSX.Element;
|
|
18
19
|
export declare const CREATION_EDIT_FLOW_DONE_EVENT_NAME = "awsui-creation-edit-flow-done";
|
|
19
20
|
interface AnalyticsFunnelStepProps {
|
|
21
|
+
mounted?: boolean;
|
|
20
22
|
stepIdentifier?: AnalyticsMetadata['instanceIdentifier'];
|
|
21
23
|
stepErrorContext?: AnalyticsMetadata['errorContext'];
|
|
22
24
|
children?: React.ReactNode | ((props: FunnelStepContextValue) => React.ReactNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-funnel.d.ts","sourceRoot":"","sources":["../../../../../src/internal/analytics/components/analytics-funnel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAOvE,OAAO,EAKL,sBAAsB,EAEtB,yBAAyB,EAC1B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAWvB,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC7D,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IACvD,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC3D,cAAc,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC/C,kBAAkB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACvD,kBAAkB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,eAAe,UAAW,oBAAoB,gBAa1D,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics-funnel.d.ts","sourceRoot":"","sources":["../../../../../src/internal/analytics/components/analytics-funnel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAOvE,OAAO,EAKL,sBAAsB,EAEtB,yBAAyB,EAC1B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAGlB,M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U,2BAA2B;IACnC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,yBAAyB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACtF;AAED,eAAO,MAAM,sBAAsB,0DAIhC,2BAA2B,gBAmG7B,CAAC"}
|
|
@@ -56,7 +56,7 @@ function evaluateSelectors(selectors, defaultSelector) {
|
|
|
56
56
|
return defaultSelector;
|
|
57
57
|
}
|
|
58
58
|
const InnerAnalyticsFunnel = (_a) => {
|
|
59
|
-
var { children, stepConfiguration } = _a, props = __rest(_a, ["children", "stepConfiguration"]);
|
|
59
|
+
var { mounted = true, children, stepConfiguration } = _a, props = __rest(_a, ["mounted", "children", "stepConfiguration"]);
|
|
60
60
|
const [funnelInteractionId, setFunnelInteractionId] = useState('');
|
|
61
61
|
const [submissionAttempt, setSubmissionAttempt] = useState(0);
|
|
62
62
|
const isVisualRefresh = useVisualRefresh();
|
|
@@ -78,6 +78,9 @@ const InnerAnalyticsFunnel = (_a) => {
|
|
|
78
78
|
// The eslint-disable is required as we deliberately want this effect to run only once on mount and unmount,
|
|
79
79
|
// hence we do not provide any dependencies.
|
|
80
80
|
useEffect(() => {
|
|
81
|
+
if (!mounted) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
81
84
|
/*
|
|
82
85
|
We run this effect with a delay, in order to detect whether this funnel contains a Wizard.
|
|
83
86
|
If it does contain a Wizard, that Wizard should take precedence for handling the funnel, and
|
|
@@ -92,15 +95,17 @@ const InnerAnalyticsFunnel = (_a) => {
|
|
|
92
95
|
}
|
|
93
96
|
// Reset the state, in case the component was re-mounted.
|
|
94
97
|
funnelState.current = 'default';
|
|
98
|
+
const funnelName = (_a = getTextFromSelector(funnelNameSelector.current)) !== null && _a !== void 0 ? _a : '';
|
|
95
99
|
const singleStepFlowStepConfiguration = [
|
|
96
100
|
{
|
|
97
101
|
number: 1,
|
|
98
102
|
isOptional: false,
|
|
99
|
-
name:
|
|
103
|
+
name: funnelName,
|
|
100
104
|
stepIdentifier: props.funnelIdentifier,
|
|
101
105
|
},
|
|
102
106
|
];
|
|
103
107
|
funnelInteractionId = FunnelMetrics.funnelStart({
|
|
108
|
+
funnelName,
|
|
104
109
|
funnelIdentifier: props.funnelIdentifier,
|
|
105
110
|
flowType: props.funnelFlowType,
|
|
106
111
|
funnelNameSelector: funnelNameSelector.current,
|
|
@@ -140,11 +145,11 @@ const InnerAnalyticsFunnel = (_a) => {
|
|
|
140
145
|
FunnelMetrics.funnelSuccessful({ funnelInteractionId, funnelIdentifier: props.funnelIdentifier });
|
|
141
146
|
}
|
|
142
147
|
else {
|
|
143
|
-
onFunnelCancelled({ funnelInteractionId, funnelIdentifier: props.funnelIdentifier });
|
|
144
148
|
funnelState.current = 'cancelled';
|
|
149
|
+
onFunnelCancelled({ funnelInteractionId, funnelIdentifier: props.funnelIdentifier });
|
|
145
150
|
}
|
|
146
151
|
};
|
|
147
|
-
}, []);
|
|
152
|
+
}, [mounted]);
|
|
148
153
|
/* eslint-enable react-hooks/exhaustive-deps */
|
|
149
154
|
const funnelSubmit = () => {
|
|
150
155
|
funnelState.current = 'validating';
|
|
@@ -269,7 +274,7 @@ function useStepChangeListener(stepNumber, handler) {
|
|
|
269
274
|
return { onStepChange: stepChangeCallback, subStepConfiguration };
|
|
270
275
|
}
|
|
271
276
|
const InnerAnalyticsFunnelStep = (_a) => {
|
|
272
|
-
var { children, stepNumber, stepIdentifier, stepErrorContext } = _a, rest = __rest(_a, ["children", "stepNumber", "stepIdentifier", "stepErrorContext"]);
|
|
277
|
+
var { mounted = true, children, stepNumber, stepIdentifier, stepErrorContext } = _a, rest = __rest(_a, ["mounted", "children", "stepNumber", "stepIdentifier", "stepErrorContext"]);
|
|
273
278
|
const { funnelInteractionId, funnelIdentifier, funnelNameSelector, funnelState, funnelType } = useFunnel();
|
|
274
279
|
const parentStep = useFunnelStep();
|
|
275
280
|
const parentStepExists = parentStep.isInStep;
|
|
@@ -292,6 +297,44 @@ const InnerAnalyticsFunnelStep = (_a) => {
|
|
|
292
297
|
subStepConfiguration,
|
|
293
298
|
});
|
|
294
299
|
});
|
|
300
|
+
useEffect(() => {
|
|
301
|
+
if (!funnelInteractionId) {
|
|
302
|
+
// This step is not inside an active funnel.
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (mounted) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const stepName = getTextFromSelector(stepNameSelector);
|
|
309
|
+
const handler = setTimeout(() => {
|
|
310
|
+
if (funnelState.current !== 'cancelled') {
|
|
311
|
+
FunnelMetrics.funnelStepComplete({
|
|
312
|
+
funnelIdentifier,
|
|
313
|
+
funnelInteractionId,
|
|
314
|
+
stepIdentifier,
|
|
315
|
+
stepNumber,
|
|
316
|
+
stepName,
|
|
317
|
+
stepNameSelector,
|
|
318
|
+
subStepAllSelector: getSubStepAllSelector(),
|
|
319
|
+
totalSubSteps: subStepCount.current,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}, 0);
|
|
323
|
+
return () => {
|
|
324
|
+
clearTimeout(handler);
|
|
325
|
+
};
|
|
326
|
+
}, [
|
|
327
|
+
stepIdentifier,
|
|
328
|
+
funnelIdentifier,
|
|
329
|
+
funnelInteractionId,
|
|
330
|
+
stepNumber,
|
|
331
|
+
stepNameSelector,
|
|
332
|
+
funnelState,
|
|
333
|
+
parentStepExists,
|
|
334
|
+
funnelType,
|
|
335
|
+
parentStepFunnelInteractionId,
|
|
336
|
+
mounted,
|
|
337
|
+
]);
|
|
295
338
|
// This useEffect hook is used to track the start and completion of interaction with the step.
|
|
296
339
|
// On mount, if there is a valid funnel interaction id, it calls the 'funnelStepStart' method from FunnelMetrics
|
|
297
340
|
// to record the beginning of the interaction with the current step.
|