@cloudscape-design/components 3.0.936 → 3.0.938
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/alert/actions-wrapper/index.d.ts +3 -1
- package/alert/actions-wrapper/index.d.ts.map +1 -1
- package/alert/actions-wrapper/index.js +24 -3
- package/alert/actions-wrapper/index.js.map +1 -1
- package/alert/index.d.ts.map +1 -1
- package/alert/index.js +21 -3
- package/alert/index.js.map +1 -1
- package/alert/internal.d.ts +3 -1
- package/alert/internal.d.ts.map +1 -1
- package/alert/internal.js +19 -18
- package/alert/internal.js.map +1 -1
- package/alert/styles.css.js +27 -28
- package/alert/styles.scoped.css +54 -54
- package/alert/styles.selectors.js +27 -28
- package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +2 -2
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/common.d.ts +0 -1
- package/flashbar/common.d.ts.map +1 -1
- package/flashbar/common.js +1 -4
- package/flashbar/common.js.map +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +4 -2
- package/flashbar/flash.js.map +1 -1
- package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/non-collapsible-flashbar.js +2 -2
- package/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +152 -153
- package/flashbar/styles.selectors.js +50 -50
- package/form/index.d.ts.map +1 -1
- package/form/index.js +34 -6
- package/form/index.js.map +1 -1
- package/form/internal.d.ts +2 -1
- package/form/internal.d.ts.map +1 -1
- package/form/internal.js +2 -2
- package/form/internal.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +4 -0
- package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
- package/internal/analytics/hooks/use-funnel.js +10 -1
- package/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/internal/base-component/styles.scoped.css +3 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/events/index.js.map +1 -1
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +15 -4
- package/internal/generated/theming/index.js +15 -4
- package/internal/manifest.json +1 -1
- package/internal/plugins/api.d.ts.map +1 -1
- package/internal/plugins/api.js +2 -0
- package/internal/plugins/api.js.map +1 -1
- package/internal/utils/check-safe-url.d.ts.map +1 -1
- package/internal/utils/check-safe-url.js +2 -0
- package/internal/utils/check-safe-url.js.map +1 -1
- package/package.json +3 -3
- package/split-panel/bottom.d.ts +3 -2
- package/split-panel/bottom.d.ts.map +1 -1
- package/split-panel/bottom.js +11 -8
- package/split-panel/bottom.js.map +1 -1
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +5 -5
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/side.d.ts +3 -2
- package/split-panel/side.d.ts.map +1 -1
- package/split-panel/side.js +4 -3
- package/split-panel/side.js.map +1 -1
- package/split-panel/styles.css.js +27 -26
- package/split-panel/styles.scoped.css +46 -44
- package/split-panel/styles.selectors.js +27 -26
- package/table/body-cell/inline-editor.d.ts.map +1 -1
- package/table/body-cell/inline-editor.js +2 -0
- package/table/body-cell/inline-editor.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +22 -9
- package/wizard/wizard-form.js.map +1 -1
|
@@ -2,55 +2,55 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"flash-with-motion": "awsui_flash-with-
|
|
6
|
-
"enter": "
|
|
7
|
-
"flash-body": "awsui_flash-
|
|
8
|
-
"flash-message": "awsui_flash-
|
|
9
|
-
"flash-header": "awsui_flash-
|
|
10
|
-
"flash-content": "awsui_flash-
|
|
11
|
-
"action-button-wrapper": "awsui_action-button-
|
|
12
|
-
"dismiss-button-wrapper": "awsui_dismiss-button-
|
|
13
|
-
"flash-icon": "awsui_flash-
|
|
14
|
-
"entering": "
|
|
15
|
-
"entered": "
|
|
16
|
-
"exiting": "
|
|
17
|
-
"stack": "
|
|
18
|
-
"animation-running": "awsui_animation-
|
|
19
|
-
"item": "
|
|
20
|
-
"flash-list-item": "awsui_flash-list-
|
|
21
|
-
"notification-bar": "awsui_notification-
|
|
22
|
-
"collapsed": "
|
|
23
|
-
"animation-ready": "awsui_animation-
|
|
24
|
-
"expanded-only": "awsui_expanded-
|
|
25
|
-
"expanded": "
|
|
26
|
-
"flash": "
|
|
27
|
-
"collapsible": "
|
|
28
|
-
"short-list": "awsui_short-
|
|
29
|
-
"visual-refresh": "awsui_visual-
|
|
30
|
-
"status": "
|
|
31
|
-
"header": "
|
|
32
|
-
"item-count": "awsui_item-
|
|
33
|
-
"button": "
|
|
34
|
-
"type-count": "awsui_type-
|
|
35
|
-
"count-number": "awsui_count-
|
|
36
|
-
"icon": "
|
|
37
|
-
"floating": "
|
|
38
|
-
"flashbar": "
|
|
39
|
-
"initial-hidden": "awsui_initial-
|
|
40
|
-
"flash-list": "awsui_flash-
|
|
41
|
-
"flash-focus-container": "awsui_flash-focus-
|
|
42
|
-
"flash-text": "awsui_flash-
|
|
43
|
-
"hidden": "
|
|
44
|
-
"header-replacement": "awsui_header-
|
|
45
|
-
"content-replacement": "awsui_content-
|
|
46
|
-
"dismiss-button": "awsui_dismiss-
|
|
47
|
-
"
|
|
48
|
-
"action-button": "awsui_action-
|
|
49
|
-
"action-slot": "awsui_action-
|
|
50
|
-
"flash-type-success": "awsui_flash-type-
|
|
51
|
-
"flash-type-error": "awsui_flash-type-
|
|
52
|
-
"flash-type-info": "awsui_flash-type-
|
|
53
|
-
"flash-type-in-progress": "awsui_flash-type-in-
|
|
54
|
-
"flash-type-warning": "awsui_flash-type-
|
|
5
|
+
"flash-with-motion": "awsui_flash-with-motion_1q84n_tmdyd_157",
|
|
6
|
+
"enter": "awsui_enter_1q84n_tmdyd_157",
|
|
7
|
+
"flash-body": "awsui_flash-body_1q84n_tmdyd_171",
|
|
8
|
+
"flash-message": "awsui_flash-message_1q84n_tmdyd_171",
|
|
9
|
+
"flash-header": "awsui_flash-header_1q84n_tmdyd_171",
|
|
10
|
+
"flash-content": "awsui_flash-content_1q84n_tmdyd_172",
|
|
11
|
+
"action-button-wrapper": "awsui_action-button-wrapper_1q84n_tmdyd_173",
|
|
12
|
+
"dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_tmdyd_174",
|
|
13
|
+
"flash-icon": "awsui_flash-icon_1q84n_tmdyd_197",
|
|
14
|
+
"entering": "awsui_entering_1q84n_tmdyd_210",
|
|
15
|
+
"entered": "awsui_entered_1q84n_tmdyd_231",
|
|
16
|
+
"exiting": "awsui_exiting_1q84n_tmdyd_336",
|
|
17
|
+
"stack": "awsui_stack_1q84n_tmdyd_370",
|
|
18
|
+
"animation-running": "awsui_animation-running_1q84n_tmdyd_370",
|
|
19
|
+
"item": "awsui_item_1q84n_tmdyd_370",
|
|
20
|
+
"flash-list-item": "awsui_flash-list-item_1q84n_tmdyd_371",
|
|
21
|
+
"notification-bar": "awsui_notification-bar_1q84n_tmdyd_372",
|
|
22
|
+
"collapsed": "awsui_collapsed_1q84n_tmdyd_392",
|
|
23
|
+
"animation-ready": "awsui_animation-ready_1q84n_tmdyd_392",
|
|
24
|
+
"expanded-only": "awsui_expanded-only_1q84n_tmdyd_392",
|
|
25
|
+
"expanded": "awsui_expanded_1q84n_tmdyd_392",
|
|
26
|
+
"flash": "awsui_flash_1q84n_tmdyd_157",
|
|
27
|
+
"collapsible": "awsui_collapsible_1q84n_tmdyd_448",
|
|
28
|
+
"short-list": "awsui_short-list_1q84n_tmdyd_454",
|
|
29
|
+
"visual-refresh": "awsui_visual-refresh_1q84n_tmdyd_454",
|
|
30
|
+
"status": "awsui_status_1q84n_tmdyd_601",
|
|
31
|
+
"header": "awsui_header_1q84n_tmdyd_601",
|
|
32
|
+
"item-count": "awsui_item-count_1q84n_tmdyd_602",
|
|
33
|
+
"button": "awsui_button_1q84n_tmdyd_603",
|
|
34
|
+
"type-count": "awsui_type-count_1q84n_tmdyd_636",
|
|
35
|
+
"count-number": "awsui_count-number_1q84n_tmdyd_636",
|
|
36
|
+
"icon": "awsui_icon_1q84n_tmdyd_670",
|
|
37
|
+
"floating": "awsui_floating_1q84n_tmdyd_711",
|
|
38
|
+
"flashbar": "awsui_flashbar_1q84n_tmdyd_715",
|
|
39
|
+
"initial-hidden": "awsui_initial-hidden_1q84n_tmdyd_773",
|
|
40
|
+
"flash-list": "awsui_flash-list_1q84n_tmdyd_371",
|
|
41
|
+
"flash-focus-container": "awsui_flash-focus-container_1q84n_tmdyd_797",
|
|
42
|
+
"flash-text": "awsui_flash-text_1q84n_tmdyd_828",
|
|
43
|
+
"hidden": "awsui_hidden_1q84n_tmdyd_847",
|
|
44
|
+
"header-replacement": "awsui_header-replacement_1q84n_tmdyd_852",
|
|
45
|
+
"content-replacement": "awsui_content-replacement_1q84n_tmdyd_857",
|
|
46
|
+
"dismiss-button": "awsui_dismiss-button_1q84n_tmdyd_174",
|
|
47
|
+
"action-wrapped": "awsui_action-wrapped_1q84n_tmdyd_875",
|
|
48
|
+
"action-button": "awsui_action-button_1q84n_tmdyd_173",
|
|
49
|
+
"action-slot": "awsui_action-slot_1q84n_tmdyd_882",
|
|
50
|
+
"flash-type-success": "awsui_flash-type-success_1q84n_tmdyd_886",
|
|
51
|
+
"flash-type-error": "awsui_flash-type-error_1q84n_tmdyd_890",
|
|
52
|
+
"flash-type-info": "awsui_flash-type-info_1q84n_tmdyd_894",
|
|
53
|
+
"flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_tmdyd_895",
|
|
54
|
+
"flash-type-warning": "awsui_flash-type-warning_1q84n_tmdyd_899"
|
|
55
55
|
};
|
|
56
56
|
|
package/form/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAwFrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,eAwC1E"}
|
package/form/index.js
CHANGED
|
@@ -4,36 +4,64 @@ import { __rest } from "tslib";
|
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
import { FunnelMetrics } from '../internal/analytics';
|
|
6
6
|
import { AnalyticsFunnel, AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';
|
|
7
|
-
import { useFunnel, useFunnelNameSelector,
|
|
7
|
+
import { useFunnel, useFunnelNameSelector, useFunnelStepRef } from '../internal/analytics/hooks/use-funnel';
|
|
8
|
+
import { getSubStepAllSelector, getTextFromSelector } from '../internal/analytics/selectors';
|
|
8
9
|
import { getAnalyticsMetadataProps } from '../internal/base-component';
|
|
9
10
|
import { ButtonContext } from '../internal/context/button-context';
|
|
10
11
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
12
|
+
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
11
13
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
12
14
|
import InternalForm from './internal';
|
|
13
15
|
import headerStyles from '../header/styles.css.js';
|
|
14
16
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
15
17
|
const FormWithAnalytics = (_a) => {
|
|
16
|
-
var { variant = 'full-page', actions, errorText } = _a, props = __rest(_a, ["variant", "actions", "errorText"]);
|
|
18
|
+
var { variant = 'full-page', actions, errorText, __internalRootRef } = _a, props = __rest(_a, ["variant", "actions", "errorText", "__internalRootRef"]);
|
|
17
19
|
const { funnelIdentifier, funnelInteractionId, funnelProps, funnelSubmit, funnelNextOrSubmitAttempt, errorCount, submissionAttempt, funnelErrorContext, } = useFunnel();
|
|
18
|
-
const
|
|
20
|
+
const funnelStepInfo = useFunnelStepRef();
|
|
19
21
|
const handleActionButtonClick = ({ variant }) => {
|
|
20
22
|
if (variant === 'primary') {
|
|
21
23
|
funnelNextOrSubmitAttempt();
|
|
22
24
|
funnelSubmit();
|
|
23
25
|
}
|
|
24
26
|
};
|
|
27
|
+
const errorSlotId = useUniqueId('form-error-');
|
|
25
28
|
useEffect(() => {
|
|
29
|
+
var _a, _b;
|
|
26
30
|
if (funnelInteractionId && errorText) {
|
|
27
31
|
errorCount.current++;
|
|
28
|
-
|
|
32
|
+
const stepName = getTextFromSelector(funnelStepInfo.current.stepNameSelector);
|
|
33
|
+
FunnelMetrics.funnelStepError({
|
|
34
|
+
funnelInteractionId,
|
|
35
|
+
stepNumber: funnelStepInfo.current.stepNumber,
|
|
36
|
+
stepNameSelector: funnelStepInfo.current.stepNameSelector,
|
|
37
|
+
stepName,
|
|
38
|
+
stepIdentifier: funnelStepInfo.current.stepIdentifier,
|
|
39
|
+
currentDocument: (_a = __internalRootRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument,
|
|
40
|
+
totalSubSteps: funnelStepInfo.current.subStepCount.current,
|
|
41
|
+
funnelIdentifier,
|
|
42
|
+
subStepAllSelector: getSubStepAllSelector(),
|
|
43
|
+
stepErrorContext: funnelStepInfo.current.stepErrorContext,
|
|
44
|
+
subStepConfiguration: (_b = funnelStepInfo.current.subStepConfiguration.current) === null || _b === void 0 ? void 0 : _b.get(funnelStepInfo.current.stepNumber),
|
|
45
|
+
stepErrorSelector: '#' + errorSlotId,
|
|
46
|
+
});
|
|
29
47
|
return () => {
|
|
30
48
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
49
|
errorCount.current--;
|
|
32
50
|
};
|
|
33
51
|
}
|
|
34
|
-
}, [
|
|
52
|
+
}, [
|
|
53
|
+
funnelInteractionId,
|
|
54
|
+
funnelIdentifier,
|
|
55
|
+
errorText,
|
|
56
|
+
submissionAttempt,
|
|
57
|
+
errorCount,
|
|
58
|
+
funnelErrorContext,
|
|
59
|
+
errorSlotId,
|
|
60
|
+
__internalRootRef,
|
|
61
|
+
funnelStepInfo,
|
|
62
|
+
]);
|
|
35
63
|
return (React.createElement(ButtonContext.Provider, { value: { onClick: handleActionButtonClick } },
|
|
36
|
-
React.createElement(InternalForm, Object.assign({ variant: variant, actions: actions, errorText: errorText }, props, funnelProps, funnelStepProps, { __injectAnalyticsComponentMetadata: true }))));
|
|
64
|
+
React.createElement(InternalForm, Object.assign({ variant: variant, actions: actions, errorText: errorText, __errorSlotId: errorSlotId }, props, funnelProps, funnelStepInfo.current.funnelStepProps, { __internalRootRef: __internalRootRef, __injectAnalyticsComponentMetadata: true }))));
|
|
37
65
|
};
|
|
38
66
|
export default function Form(_a) {
|
|
39
67
|
var { variant = 'full-page' } = _a, props = __rest(_a, ["variant"]);
|
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,
|
|
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,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EAAC,aAAa,EACxB,mBAAmB,EAAE,EAAE,EACvB,gBAAgB,EAAE,CAAC,EACnB,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,kBAAkB,EAAE,IAAI,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAEhF,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, useFunnelStepRef } from '../internal/analytics/hooks/use-funnel';\nimport { getSubStepAllSelector, getTextFromSelector } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\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 = ({\n variant = 'full-page',\n actions,\n errorText,\n __internalRootRef,\n ...props\n}: FormProps & ReturnType<typeof useBaseComponent<HTMLElement>>) => {\n const {\n funnelIdentifier,\n funnelInteractionId,\n funnelProps,\n funnelSubmit,\n funnelNextOrSubmitAttempt,\n errorCount,\n submissionAttempt,\n funnelErrorContext,\n } = useFunnel();\n\n const funnelStepInfo = useFunnelStepRef();\n\n const handleActionButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n const errorSlotId = useUniqueId('form-error-');\n\n useEffect(() => {\n if (funnelInteractionId && errorText) {\n errorCount.current++;\n\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 return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n }, [\n funnelInteractionId,\n funnelIdentifier,\n errorText,\n submissionAttempt,\n errorCount,\n funnelErrorContext,\n errorSlotId,\n __internalRootRef,\n funnelStepInfo,\n ]);\n\n return (\n <ButtonContext.Provider value={{ onClick: handleActionButtonClick }}>\n <InternalForm\n variant={variant}\n actions={actions}\n errorText={errorText}\n __errorSlotId={errorSlotId}\n {...props}\n {...funnelProps}\n {...funnelStepInfo.current.funnelStepProps}\n __internalRootRef={__internalRootRef}\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<HTMLElement>(\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"]}
|
package/form/internal.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component
|
|
|
3
3
|
import { FormProps } from './interfaces';
|
|
4
4
|
type InternalFormProps = {
|
|
5
5
|
__injectAnalyticsComponentMetadata?: boolean;
|
|
6
|
+
__errorSlotId?: string;
|
|
6
7
|
} & FormProps & InternalBaseComponentProps;
|
|
7
|
-
export default function InternalForm({ children, header, errorText, errorIconAriaLabel: errorIconAriaLabelOverride, actions, secondaryActions, __internalRootRef, __injectAnalyticsComponentMetadata, ...props }: InternalFormProps): JSX.Element;
|
|
8
|
+
export default function InternalForm({ children, header, errorText, errorIconAriaLabel: errorIconAriaLabelOverride, actions, secondaryActions, __internalRootRef, __injectAnalyticsComponentMetadata, __errorSlotId, ...props }: InternalFormProps): JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=internal.d.ts.map
|
package/form/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/form/internal.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,KAAK,iBAAiB,GAAG;IACvB,kCAAkC,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/form/internal.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,KAAK,iBAAiB,GAAG;IACvB,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,SAAS,GACX,0BAA0B,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,MAAM,EACN,SAAS,EACT,kBAAkB,EAAE,0BAA0B,EAC9C,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,kCAAkC,EAClC,aAAa,EACb,GAAG,KAAK,EACT,EAAE,iBAAiB,eA8CnB"}
|
package/form/internal.js
CHANGED
|
@@ -12,7 +12,7 @@ import InternalLiveRegion from '../live-region/internal';
|
|
|
12
12
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
13
13
|
import styles from './styles.css.js';
|
|
14
14
|
export default function InternalForm(_a) {
|
|
15
|
-
var { children, header, errorText, errorIconAriaLabel: errorIconAriaLabelOverride, actions, secondaryActions, __internalRootRef, __injectAnalyticsComponentMetadata } = _a, props = __rest(_a, ["children", "header", "errorText", "errorIconAriaLabel", "actions", "secondaryActions", "__internalRootRef", "__injectAnalyticsComponentMetadata"]);
|
|
15
|
+
var { children, header, errorText, errorIconAriaLabel: errorIconAriaLabelOverride, actions, secondaryActions, __internalRootRef, __injectAnalyticsComponentMetadata, __errorSlotId } = _a, props = __rest(_a, ["children", "header", "errorText", "errorIconAriaLabel", "actions", "secondaryActions", "__internalRootRef", "__injectAnalyticsComponentMetadata", "__errorSlotId"]);
|
|
16
16
|
const baseProps = getBaseProps(props);
|
|
17
17
|
const i18n = useInternalI18n('form');
|
|
18
18
|
const errorIconAriaLabel = i18n('errorIconAriaLabel', errorIconAriaLabelOverride);
|
|
@@ -29,7 +29,7 @@ export default function InternalForm(_a) {
|
|
|
29
29
|
children && React.createElement("div", { className: styles.content }, children),
|
|
30
30
|
errorText && (React.createElement(InternalBox, { margin: { top: 'l' } },
|
|
31
31
|
React.createElement(InternalAlert, { type: "error", statusIconAriaLabel: errorIconAriaLabel },
|
|
32
|
-
React.createElement("div", { className: styles.error }, errorText)))),
|
|
32
|
+
React.createElement("div", { className: styles.error, id: __errorSlotId }, errorText)))),
|
|
33
33
|
(actions || secondaryActions) && (React.createElement("div", { className: styles.footer },
|
|
34
34
|
React.createElement("div", { className: styles['actions-section'] },
|
|
35
35
|
actions && React.createElement("div", { className: styles.actions }, actions),
|
package/form/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/form/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAA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,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,IAAI;YAC7D,kBAAkB;;YAAI,SAAS,CACb,CACtB,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalAlert from '../alert/internal';\nimport InternalBox from '../box/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport InternalLiveRegion from '../live-region/internal';\nimport { GeneratedAnalyticsMetadataFormFragment } from './analytics-metadata/interfaces';\nimport { FormProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ntype InternalFormProps = {\n __injectAnalyticsComponentMetadata?: boolean;\n __errorSlotId?: string;\n} & FormProps &\n InternalBaseComponentProps;\n\nexport default function InternalForm({\n children,\n header,\n errorText,\n errorIconAriaLabel: errorIconAriaLabelOverride,\n actions,\n secondaryActions,\n __internalRootRef,\n __injectAnalyticsComponentMetadata,\n __errorSlotId,\n ...props\n}: InternalFormProps) {\n const baseProps = getBaseProps(props);\n const i18n = useInternalI18n('form');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', errorIconAriaLabelOverride);\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataFormFragment = {\n component: {\n name: 'awsui.Form',\n label: {\n selector: ['h1', 'h2', 'h3'].map(heading => `.${analyticsSelectors.header} ${heading}`),\n },\n },\n };\n\n return (\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...(__injectAnalyticsComponentMetadata ? getAnalyticsMetadataAttribute(analyticsComponentMetadata) : {})}\n >\n {header && <div className={clsx(styles.header, analyticsSelectors.header)}>{header}</div>}\n {children && <div className={styles.content}>{children}</div>}\n {errorText && (\n <InternalBox margin={{ top: 'l' }}>\n <InternalAlert type=\"error\" statusIconAriaLabel={errorIconAriaLabel}>\n <div className={styles.error} id={__errorSlotId}>\n {errorText}\n </div>\n </InternalAlert>\n </InternalBox>\n )}\n {(actions || secondaryActions) && (\n <div className={styles.footer}>\n <div className={styles['actions-section']}>\n {actions && <div className={styles.actions}>{actions}</div>}\n {secondaryActions && <div className={styles['secondary-actions']}>{secondaryActions}</div>}\n </div>\n </div>\n )}\n {errorText && (\n <InternalLiveRegion hidden={true} tagName=\"span\" assertive={true}>\n {errorIconAriaLabel}, {errorText}\n </InternalLiveRegion>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -32,6 +32,10 @@ export declare const useFunnelSubStep: () => import("../context/analytics-contex
|
|
|
32
32
|
* The context contains additional properties of the FunnelStep.
|
|
33
33
|
*/
|
|
34
34
|
export declare const useFunnelStep: () => import("../context/analytics-context").FunnelStepContextValue;
|
|
35
|
+
/**
|
|
36
|
+
* This function provides a stable React ref to the current funnel step information.
|
|
37
|
+
*/
|
|
38
|
+
export declare const useFunnelStepRef: () => import("react").MutableRefObject<import("../context/analytics-context").FunnelStepContextValue>;
|
|
35
39
|
/**
|
|
36
40
|
* Custom React Hook to manage and interact with Funnel.
|
|
37
41
|
* This hook will provide necessary properties required to track
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-funnel.d.ts","sourceRoot":"","sources":["../../../../../src/internal/analytics/hooks/use-funnel.ts"],"names":[],"mappings":";AAOA,OAAO,EAEL,kBAAkB,EAInB,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;CAuI5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,qEAGzB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;AAChF,KAAK,SAAS,GAAG,MAAM,kBAAkB,GAAG;IAC1C,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,0BAGjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"use-funnel.d.ts","sourceRoot":"","sources":["../../../../../src/internal/analytics/hooks/use-funnel.ts"],"names":[],"mappings":";AAOA,OAAO,EAEL,kBAAkB,EAInB,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;CAuI5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,qEAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,uGAK5B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;AAChF,KAAK,SAAS,GAAG,MAAM,kBAAkB,GAAG;IAC1C,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,0BAGjC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { __awaiter } from "tslib";
|
|
4
|
-
import { useContext } from 'react';
|
|
4
|
+
import { useContext, useRef } from 'react';
|
|
5
5
|
import { nodeBelongs } from '../../utils/node-belongs';
|
|
6
6
|
import { FunnelMetrics } from '../';
|
|
7
7
|
import { FunnelContext, FunnelNameSelectorContext, FunnelStepContext, FunnelSubStepContext, } from '../context/analytics-context';
|
|
@@ -141,6 +141,15 @@ export const useFunnelStep = () => {
|
|
|
141
141
|
const context = useContext(FunnelStepContext);
|
|
142
142
|
return context;
|
|
143
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* This function provides a stable React ref to the current funnel step information.
|
|
146
|
+
*/
|
|
147
|
+
export const useFunnelStepRef = () => {
|
|
148
|
+
const funnelStep = useFunnelStep();
|
|
149
|
+
const funnelStepRef = useRef(funnelStep);
|
|
150
|
+
funnelStepRef.current = funnelStep;
|
|
151
|
+
return funnelStepRef;
|
|
152
|
+
};
|
|
144
153
|
export const useFunnel = () => {
|
|
145
154
|
const context = useContext(FunnelContext);
|
|
146
155
|
const funnelProps = context.funnelInteractionId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-funnel.js","sourceRoot":"","sources":["../../../../../src/internal/analytics/hooks/use-funnel.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EACL,aAAa,EAEb,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,0BAA0B,EAAE,GAAG,SAAS,EAAE,CAAC;IACvG,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,GAAG,aAAa,EAAE,CAAC;IAE/F,MAAM,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F;IACH,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAwB,mBAAmB;QACjE,CAAC,CAAC;YACE,CAAC,wBAAwB,CAAC,EAAE,SAAS;YACrC,OAAO;YACP,MAAM;SACP;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,uBAAS,kBAAkB,IAAK,OAAO,EAAG;AAC5C,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAcF,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,EAAE;IACvC,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAgB,OAAO,CAAC,mBAAmB;QAC1D,CAAC,CAAC;YACE,CAAC,+BAA+B,CAAC,EAAE,OAAO,CAAC,mBAAmB;SAC/D;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,uBAAS,WAAW,IAAK,OAAO,EAAG;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext } from 'react';\n\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { FunnelMetrics } from '../';\nimport {\n FunnelContext,\n FunnelContextValue,\n FunnelNameSelectorContext,\n FunnelStepContext,\n FunnelSubStepContext,\n} from '../context/analytics-context';\nimport {\n DATA_ATTR_FUNNEL_INTERACTION_ID,\n DATA_ATTR_FUNNEL_SUBSTEP,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../selectors';\n\n/**\n * Custom React Hook to manage and interact with FunnelSubStep.\n * This hook will provide necessary properties and methods required\n * to track and manage interactions with a FunnelSubStep component.\n *\n * The `onFocus` method is used to track the beginning of interaction with the FunnelSubStep.\n * The `onBlur` method is used to track the completion of interaction with the FunnelSubStep.\n * The subStepId is a unique identifier for the funnel sub-step.\n * The subStepRef is a reference to the DOM element of the funnel sub-step.\n */\nexport const useFunnelSubStep = () => {\n const context = useContext(FunnelSubStepContext);\n const { funnelInteractionId, funnelIdentifier, funnelState, latestFocusCleanupFunction } = useFunnel();\n const { stepNumber, stepIdentifier, stepNameSelector, subStepConfiguration } = useFunnelStep();\n\n const {\n subStepIdentifier,\n subStepId,\n subStepSelector,\n subStepNameSelector,\n subStepRef,\n isNestedSubStep,\n mousePressed,\n isFocusedSubStep,\n focusCleanupFunction,\n } = context;\n\n if (isNestedSubStep) {\n return context;\n }\n\n const onFocus = async (event: React.FocusEvent<HTMLDivElement>) => {\n const element = event.target;\n // Ignore spurious focus events, such as when the browser window is focused again.\n await new Promise(r => setTimeout(r, 1));\n if (document.activeElement !== element) {\n return;\n }\n\n if (isFocusedSubStep.current) {\n return;\n }\n isFocusedSubStep.current = true;\n\n if (funnelInteractionId && subStepId) {\n /*\n If the previously focused substep has provided a cleanup function, we\n call it here on behalf of the previously focused substep.\n */\n latestFocusCleanupFunction.current?.();\n\n const subStepName = getTextFromSelector(subStepNameSelector);\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepNumber = subStepConfiguration.current\n ?.get(stepNumber)\n ?.find(step => step.name === subStepName)?.number;\n FunnelMetrics.funnelSubStepStart({\n funnelIdentifier,\n funnelInteractionId,\n subStepIdentifier,\n subStepSelector,\n subStepNameSelector,\n subStepName,\n subStepNumber,\n stepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n\n /*\n This cleanup function will be called when the user leaves this substep.\n The function might be called either:\n\n - by the next focused substep as `latestFocusCleanupFunction`\n (through a separate instance of the function we're currently in), or\n\n - by the same substep as `focusCleanupFunction`\n (through the `onMouseUp` handler or the `onBlur` handler).\n */\n let cleanupFunctionHasBeenRun = false;\n focusCleanupFunction.current = () => {\n if (cleanupFunctionHasBeenRun) {\n return;\n }\n cleanupFunctionHasBeenRun = true;\n\n const subStepNumber = subStepConfiguration.current?.get(stepNumber)?.find(s => s.name === subStepName)?.number;\n\n if (funnelState.current !== 'cancelled') {\n FunnelMetrics.funnelSubStepComplete({\n funnelIdentifier,\n funnelInteractionId,\n subStepIdentifier,\n subStepSelector,\n subStepNameSelector,\n subStepName,\n subStepNumber,\n stepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n latestFocusCleanupFunction.current = focusCleanupFunction.current;\n }\n };\n\n const onBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (mousePressed.current) {\n /*\n Ignore blur events that are caused by mouse interaction, because these events don't\n always reflect user intention. For example, clicking the label of an interactive form\n element will briefly blur it.\n The mouse-caused events are handled in the global `onMouseUp` handler of the substep\n context instead.\n */\n return;\n }\n\n if (!subStepRef.current || !event.relatedTarget || !nodeBelongs(subStepRef.current, event.relatedTarget)) {\n isFocusedSubStep.current = false;\n\n if (funnelInteractionId && subStepId && funnelState.current !== 'cancelled') {\n /*\n Run this substep's own focus cleanup function if another substep\n hasn't already done it for us.\n */\n focusCleanupFunction.current?.();\n }\n }\n };\n\n const funnelSubStepProps: Record<string, any> = funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_SUBSTEP]: subStepId,\n onFocus,\n onBlur,\n }\n : {};\n\n return { funnelSubStepProps, ...context };\n};\n\n/**\n * Custom React Hook to manage and interact with FunnelStep.\n * This hook will provide necessary properties required to track\n * and manage interactions with a FunnelStep component.\n *\n * The 'data-analytics-funnel-step' property of funnelStepProps is used to track the index of the current step in the funnel.\n * The context contains additional properties of the FunnelStep.\n */\nexport const useFunnelStep = () => {\n const context = useContext(FunnelStepContext);\n return context;\n};\n\n/**\n * Custom React Hook to manage and interact with Funnel.\n * This hook will provide necessary properties required to track\n * and manage interactions with a Funnel component.\n *\n * The 'data-analytics-funnel-interaction-id' property of funnelProps is used to track the unique identifier of the current interaction with the funnel.\n */\nexport type FunnelProps = Record<string, string | number | boolean | undefined>;\ntype UseFunnel = () => FunnelContextValue & {\n funnelProps: FunnelProps;\n};\n\nexport const useFunnel: UseFunnel = () => {\n const context = useContext(FunnelContext);\n const funnelProps: FunnelProps = context.funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_INTERACTION_ID]: context.funnelInteractionId,\n }\n : {};\n\n return { funnelProps, ...context };\n};\n\nexport const useFunnelNameSelector = () => {\n const context = useContext(FunnelNameSelectorContext);\n return context;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"use-funnel.js","sourceRoot":"","sources":["../../../../../src/internal/analytics/hooks/use-funnel.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EACL,aAAa,EAEb,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,0BAA0B,EAAE,GAAG,SAAS,EAAE,CAAC;IACvG,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,GAAG,aAAa,EAA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oEAAI,CAAC;aAClC;SACF;IACH,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAwB,mBAAmB;QACjE,CAAC,CAAC;YACE,CAAC,wBAAwB,CAAC,EAAE,SAAS;YACrC,OAAO;YACP,MAAM;SACP;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,uBAAS,kBAAkB,IAAK,OAAO,EAAG;AAC5C,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,aAAa,GAAG,MAAM,CAAmC,UAAU,CAAC,CAAC;IAC3E,aAAa,CAAC,OAAO,GAAG,UAAU,CAAC;IACnC,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAcF,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,EAAE;IACvC,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAgB,OAAO,CAAC,mBAAmB;QAC1D,CAAC,CAAC;YACE,CAAC,+BAA+B,CAAC,EAAE,OAAO,CAAC,mBAAmB;SAC/D;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,uBAAS,WAAW,IAAK,OAAO,EAAG;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext, useRef } from 'react';\n\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { FunnelMetrics } from '../';\nimport {\n FunnelContext,\n FunnelContextValue,\n FunnelNameSelectorContext,\n FunnelStepContext,\n FunnelSubStepContext,\n} from '../context/analytics-context';\nimport {\n DATA_ATTR_FUNNEL_INTERACTION_ID,\n DATA_ATTR_FUNNEL_SUBSTEP,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../selectors';\n\n/**\n * Custom React Hook to manage and interact with FunnelSubStep.\n * This hook will provide necessary properties and methods required\n * to track and manage interactions with a FunnelSubStep component.\n *\n * The `onFocus` method is used to track the beginning of interaction with the FunnelSubStep.\n * The `onBlur` method is used to track the completion of interaction with the FunnelSubStep.\n * The subStepId is a unique identifier for the funnel sub-step.\n * The subStepRef is a reference to the DOM element of the funnel sub-step.\n */\nexport const useFunnelSubStep = () => {\n const context = useContext(FunnelSubStepContext);\n const { funnelInteractionId, funnelIdentifier, funnelState, latestFocusCleanupFunction } = useFunnel();\n const { stepNumber, stepIdentifier, stepNameSelector, subStepConfiguration } = useFunnelStep();\n\n const {\n subStepIdentifier,\n subStepId,\n subStepSelector,\n subStepNameSelector,\n subStepRef,\n isNestedSubStep,\n mousePressed,\n isFocusedSubStep,\n focusCleanupFunction,\n } = context;\n\n if (isNestedSubStep) {\n return context;\n }\n\n const onFocus = async (event: React.FocusEvent<HTMLDivElement>) => {\n const element = event.target;\n // Ignore spurious focus events, such as when the browser window is focused again.\n await new Promise(r => setTimeout(r, 1));\n if (document.activeElement !== element) {\n return;\n }\n\n if (isFocusedSubStep.current) {\n return;\n }\n isFocusedSubStep.current = true;\n\n if (funnelInteractionId && subStepId) {\n /*\n If the previously focused substep has provided a cleanup function, we\n call it here on behalf of the previously focused substep.\n */\n latestFocusCleanupFunction.current?.();\n\n const subStepName = getTextFromSelector(subStepNameSelector);\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepNumber = subStepConfiguration.current\n ?.get(stepNumber)\n ?.find(step => step.name === subStepName)?.number;\n FunnelMetrics.funnelSubStepStart({\n funnelIdentifier,\n funnelInteractionId,\n subStepIdentifier,\n subStepSelector,\n subStepNameSelector,\n subStepName,\n subStepNumber,\n stepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n\n /*\n This cleanup function will be called when the user leaves this substep.\n The function might be called either:\n\n - by the next focused substep as `latestFocusCleanupFunction`\n (through a separate instance of the function we're currently in), or\n\n - by the same substep as `focusCleanupFunction`\n (through the `onMouseUp` handler or the `onBlur` handler).\n */\n let cleanupFunctionHasBeenRun = false;\n focusCleanupFunction.current = () => {\n if (cleanupFunctionHasBeenRun) {\n return;\n }\n cleanupFunctionHasBeenRun = true;\n\n const subStepNumber = subStepConfiguration.current?.get(stepNumber)?.find(s => s.name === subStepName)?.number;\n\n if (funnelState.current !== 'cancelled') {\n FunnelMetrics.funnelSubStepComplete({\n funnelIdentifier,\n funnelInteractionId,\n subStepIdentifier,\n subStepSelector,\n subStepNameSelector,\n subStepName,\n subStepNumber,\n stepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n latestFocusCleanupFunction.current = focusCleanupFunction.current;\n }\n };\n\n const onBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (mousePressed.current) {\n /*\n Ignore blur events that are caused by mouse interaction, because these events don't\n always reflect user intention. For example, clicking the label of an interactive form\n element will briefly blur it.\n The mouse-caused events are handled in the global `onMouseUp` handler of the substep\n context instead.\n */\n return;\n }\n\n if (!subStepRef.current || !event.relatedTarget || !nodeBelongs(subStepRef.current, event.relatedTarget)) {\n isFocusedSubStep.current = false;\n\n if (funnelInteractionId && subStepId && funnelState.current !== 'cancelled') {\n /*\n Run this substep's own focus cleanup function if another substep\n hasn't already done it for us.\n */\n focusCleanupFunction.current?.();\n }\n }\n };\n\n const funnelSubStepProps: Record<string, any> = funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_SUBSTEP]: subStepId,\n onFocus,\n onBlur,\n }\n : {};\n\n return { funnelSubStepProps, ...context };\n};\n\n/**\n * Custom React Hook to manage and interact with FunnelStep.\n * This hook will provide necessary properties required to track\n * and manage interactions with a FunnelStep component.\n *\n * The 'data-analytics-funnel-step' property of funnelStepProps is used to track the index of the current step in the funnel.\n * The context contains additional properties of the FunnelStep.\n */\nexport const useFunnelStep = () => {\n const context = useContext(FunnelStepContext);\n return context;\n};\n\n/**\n * This function provides a stable React ref to the current funnel step information.\n */\nexport const useFunnelStepRef = () => {\n const funnelStep = useFunnelStep();\n const funnelStepRef = useRef<ReturnType<typeof useFunnelStep>>(funnelStep);\n funnelStepRef.current = funnelStep;\n return funnelStepRef;\n};\n\n/**\n * Custom React Hook to manage and interact with Funnel.\n * This hook will provide necessary properties required to track\n * and manage interactions with a Funnel component.\n *\n * The 'data-analytics-funnel-interaction-id' property of funnelProps is used to track the unique identifier of the current interaction with the funnel.\n */\nexport type FunnelProps = Record<string, string | number | boolean | undefined>;\ntype UseFunnel = () => FunnelContextValue & {\n funnelProps: FunnelProps;\n};\n\nexport const useFunnel: UseFunnel = () => {\n const context = useContext(FunnelContext);\n const funnelProps: FunnelProps = context.funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_INTERACTION_ID]: context.funnelInteractionId,\n }\n : {};\n\n return { funnelProps, ...context };\n};\n\nexport const useFunnelNameSelector = () => {\n const context = useContext(FunnelNameSelectorContext);\n return context;\n};\n"]}
|
|
@@ -588,6 +588,7 @@
|
|
|
588
588
|
--space-flashbar-action-left-qkhz5m:12px;
|
|
589
589
|
--space-flashbar-dismiss-right-tcpfax:0px;
|
|
590
590
|
--space-flashbar-horizontal-xmjla3:16px;
|
|
591
|
+
--space-flashbar-vertical-cgkvxy:8px;
|
|
591
592
|
--space-grid-gutter-ieqn7e:20px;
|
|
592
593
|
--space-key-value-gap-0517k5:0px;
|
|
593
594
|
--space-layout-content-bottom-noqzmw:40px;
|
|
@@ -1061,6 +1062,7 @@
|
|
|
1061
1062
|
--space-content-header-padding-bottom-y2enua:12px;
|
|
1062
1063
|
--space-dark-header-overlap-distance-lxpp0s:32px;
|
|
1063
1064
|
--space-expandable-section-icon-offset-top-ekk5vc:0px;
|
|
1065
|
+
--space-flashbar-vertical-cgkvxy:4px;
|
|
1064
1066
|
--space-grid-gutter-ieqn7e:16px;
|
|
1065
1067
|
--space-layout-content-bottom-noqzmw:24px;
|
|
1066
1068
|
--space-layout-content-horizontal-7l52k3:16px;
|
|
@@ -1119,6 +1121,7 @@
|
|
|
1119
1121
|
--space-card-vertical-m591he:12px;
|
|
1120
1122
|
--space-container-header-bottom-vj01hn:4px;
|
|
1121
1123
|
--space-content-header-padding-bottom-y2enua:12px;
|
|
1124
|
+
--space-flashbar-vertical-cgkvxy:4px;
|
|
1122
1125
|
--space-panel-content-bottom-7k6er3:32px;
|
|
1123
1126
|
--space-panel-content-top-wac3yp:16px;
|
|
1124
1127
|
--space-panel-header-vertical-gv9pti:16px;
|
package/internal/environment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAYA,MAAM,eAAe;IAGnB,YACS,aAAsB,KAAK,EAC3B,SAAmB,IAAI;QADvB,eAAU,GAAV,UAAU,CAAiB;QAC3B,WAAM,GAAN,MAAM,CAAiB;QAJhC,qBAAgB,GAAG,KAAK,CAAC;QACzB,iBAAY,GAAG,KAAK,CAAC;IAIlB,CAAC;IAEJ,cAAc;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AA0BD,MAAM,UAAU,iBAAiB,CAAI,EAAE,UAAU,EAAE,MAAM,EAAsB;IAC7E,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAgB,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAW,OAAiD,EA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C,KAA6C;IAC3E,OAAO,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAA6C;IAC5E,OAAO,KAAK,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\n// This is a part of our public types API. We cannot change this in the current major version\n// eslint-disable-next-line @typescript-eslint/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAYA,MAAM,eAAe;IAGnB,YACS,aAAsB,KAAK,EAC3B,SAAmB,IAAI;QADvB,eAAU,GAAV,UAAU,CAAiB;QAC3B,WAAM,GAAN,MAAM,CAAiB;QAJhC,qBAAgB,GAAG,KAAK,CAAC;QACzB,iBAAY,GAAG,KAAK,CAAC;IAIlB,CAAC;IAEJ,cAAc;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AA0BD,MAAM,UAAU,iBAAiB,CAAI,EAAE,UAAU,EAAE,MAAM,EAAsB;IAC7E,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAgB,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAW,OAAiD,EAAE,MAAU;IAC5G,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;I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gBAAgB,CAAC,KAA6C;IAC5E,OAAO,KAAK,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\n// This is a part of our public types API. We cannot change this in the current major version\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type NonCancelableEventHandler<Detail = {}> = (event: NonCancelableCustomEvent<Detail>) => void;\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type CancelableEventHandler<Detail = {}> = (event: CustomEvent<Detail>) => void;\n\nexport type NonCancelableCustomEvent<DetailType> = Omit<CustomEvent<DetailType>, 'preventDefault'>;\n\nclass CustomEventStub<T> {\n defaultPrevented = false;\n cancelBubble = false;\n constructor(\n public cancelable: boolean = false,\n public detail: T | null = null\n ) {}\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n stopPropagation() {\n this.cancelBubble = true;\n }\n}\n\nexport interface BaseKeyDetail {\n keyCode: number;\n key: string;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n isComposing: boolean;\n}\n\nexport interface ClickDetail {\n button: number;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport interface BaseNavigationDetail {\n href: string | undefined;\n external?: boolean;\n target?: string;\n}\n\nexport function createCustomEvent<T>({ cancelable, detail }: CustomEventInit<T>): CustomEvent<T> {\n return new CustomEventStub(cancelable, detail) as CustomEvent;\n}\n\nexport function fireNonCancelableEvent<T = null>(handler: NonCancelableEventHandler<T> | undefined, detail?: T) {\n if (!handler) {\n return;\n }\n const event = createCustomEvent({ cancelable: false, detail });\n handler(event);\n}\n\nexport function fireCancelableEvent<T>(\n handler: CancelableEventHandler<T> | undefined,\n detail: T,\n sourceEvent?: React.SyntheticEvent | Event\n) {\n if (!handler) {\n return false;\n }\n const event = createCustomEvent({ cancelable: true, detail });\n handler(event);\n if (event.defaultPrevented && sourceEvent) {\n sourceEvent.preventDefault();\n }\n if (event.cancelBubble && sourceEvent) {\n sourceEvent.stopPropagation();\n }\n return event.defaultPrevented;\n}\n\nexport function fireKeyboardEvent(\n handler: CancelableEventHandler<BaseKeyDetail> | undefined,\n reactEvent: React.KeyboardEvent\n) {\n return fireCancelableEvent(\n handler,\n {\n keyCode: reactEvent.keyCode,\n key: reactEvent.key,\n ctrlKey: reactEvent.ctrlKey,\n shiftKey: reactEvent.shiftKey,\n altKey: reactEvent.altKey,\n metaKey: reactEvent.metaKey,\n isComposing: reactEvent.nativeEvent.isComposing,\n },\n reactEvent\n );\n}\n\nconst isMouseEvent = (e: React.MouseEvent | React.KeyboardEvent): e is React.MouseEvent => {\n return (e as React.MouseEvent).button !== undefined;\n};\n\nexport function hasModifierKeys(event: React.MouseEvent | React.KeyboardEvent) {\n return event.ctrlKey || event.altKey || event.shiftKey || event.metaKey;\n}\n\nexport function isPlainLeftClick(event: React.MouseEvent | React.KeyboardEvent) {\n return event && (!isMouseEvent(event) || event.button === 0) && !hasModifierKeys(event);\n}\n"]}
|
|
@@ -658,6 +658,7 @@ export const spaceFilteringTokenOperationSelectFocusOutlineGutter: string;
|
|
|
658
658
|
export const spaceFlashbarActionLeft: string;
|
|
659
659
|
export const spaceFlashbarDismissRight: string;
|
|
660
660
|
export const spaceFlashbarHorizontal: string;
|
|
661
|
+
export const spaceFlashbarVertical: string;
|
|
661
662
|
export const spaceGridGutter: string;
|
|
662
663
|
export const spaceKeyValueGap: string;
|
|
663
664
|
export const spaceLayoutContentBottom: string;
|
|
@@ -658,6 +658,7 @@ export var spaceFilteringTokenOperationSelectFocusOutlineGutter = "var(--space-f
|
|
|
658
658
|
export var spaceFlashbarActionLeft = "var(--space-flashbar-action-left-qkhz5m, 12px)";
|
|
659
659
|
export var spaceFlashbarDismissRight = "var(--space-flashbar-dismiss-right-tcpfax, 0px)";
|
|
660
660
|
export var spaceFlashbarHorizontal = "var(--space-flashbar-horizontal-xmjla3, 16px)";
|
|
661
|
+
export var spaceFlashbarVertical = "var(--space-flashbar-vertical-cgkvxy, 8px)";
|
|
661
662
|
export var spaceGridGutter = "var(--space-grid-gutter-ieqn7e, 20px)";
|
|
662
663
|
export var spaceKeyValueGap = "var(--space-key-value-gap-0517k5, 0px)";
|
|
663
664
|
export var spaceLayoutContentBottom = "var(--space-layout-content-bottom-noqzmw, 40px)";
|
|
@@ -2143,8 +2143,8 @@ module.exports.preset = {
|
|
|
2143
2143
|
"compact": "{spaceXxs}"
|
|
2144
2144
|
},
|
|
2145
2145
|
"spaceAlertVertical": {
|
|
2146
|
-
"comfortable": "{
|
|
2147
|
-
"compact": "{
|
|
2146
|
+
"comfortable": "{spaceFlashbarVertical}",
|
|
2147
|
+
"compact": "{spaceFlashbarVertical}"
|
|
2148
2148
|
},
|
|
2149
2149
|
"spaceButtonFocusOutlineGutter": {
|
|
2150
2150
|
"comfortable": "4px",
|
|
@@ -2250,6 +2250,10 @@ module.exports.preset = {
|
|
|
2250
2250
|
"comfortable": "{spaceM}",
|
|
2251
2251
|
"compact": "{spaceM}"
|
|
2252
2252
|
},
|
|
2253
|
+
"spaceFlashbarVertical": {
|
|
2254
|
+
"comfortable": "{spaceScaledXs}",
|
|
2255
|
+
"compact": "{spaceScaledXs}"
|
|
2256
|
+
},
|
|
2253
2257
|
"spaceGridGutter": {
|
|
2254
2258
|
"comfortable": "{spaceL}",
|
|
2255
2259
|
"compact": "{spaceM}"
|
|
@@ -2613,8 +2617,8 @@ module.exports.preset = {
|
|
|
2613
2617
|
"compact": "{spaceXxs}"
|
|
2614
2618
|
},
|
|
2615
2619
|
"spaceAlertVertical": {
|
|
2616
|
-
"comfortable": "{
|
|
2617
|
-
"compact": "{
|
|
2620
|
+
"comfortable": "{spaceFlashbarVertical}",
|
|
2621
|
+
"compact": "{spaceFlashbarVertical}"
|
|
2618
2622
|
},
|
|
2619
2623
|
"spaceButtonFocusOutlineGutter": {
|
|
2620
2624
|
"comfortable": "4px",
|
|
@@ -2720,6 +2724,10 @@ module.exports.preset = {
|
|
|
2720
2724
|
"comfortable": "{spaceM}",
|
|
2721
2725
|
"compact": "{spaceM}"
|
|
2722
2726
|
},
|
|
2727
|
+
"spaceFlashbarVertical": {
|
|
2728
|
+
"comfortable": "{spaceScaledXs}",
|
|
2729
|
+
"compact": "{spaceScaledXs}"
|
|
2730
|
+
},
|
|
2723
2731
|
"spaceGridGutter": {
|
|
2724
2732
|
"comfortable": "{spaceL}",
|
|
2725
2733
|
"compact": "{spaceM}"
|
|
@@ -10059,6 +10067,7 @@ module.exports.preset = {
|
|
|
10059
10067
|
"spaceFlashbarActionLeft": "density",
|
|
10060
10068
|
"spaceFlashbarDismissRight": "density",
|
|
10061
10069
|
"spaceFlashbarHorizontal": "density",
|
|
10070
|
+
"spaceFlashbarVertical": "density",
|
|
10062
10071
|
"spaceGridGutter": "density",
|
|
10063
10072
|
"spaceKeyValueGap": "density",
|
|
10064
10073
|
"spaceLayoutContentBottom": "density",
|
|
@@ -11437,6 +11446,7 @@ module.exports.preset = {
|
|
|
11437
11446
|
"spaceFlashbarActionLeft": "space-flashbar-action-left",
|
|
11438
11447
|
"spaceFlashbarDismissRight": "space-flashbar-dismiss-right",
|
|
11439
11448
|
"spaceFlashbarHorizontal": "space-flashbar-horizontal",
|
|
11449
|
+
"spaceFlashbarVertical": "space-flashbar-vertical",
|
|
11440
11450
|
"spaceGridGutter": "space-grid-gutter",
|
|
11441
11451
|
"spaceKeyValueGap": "space-key-value-gap",
|
|
11442
11452
|
"spaceLayoutContentBottom": "space-layout-content-bottom",
|
|
@@ -12185,6 +12195,7 @@ module.exports.preset = {
|
|
|
12185
12195
|
"spaceFlashbarActionLeft": "--space-flashbar-action-left-qkhz5m",
|
|
12186
12196
|
"spaceFlashbarDismissRight": "--space-flashbar-dismiss-right-tcpfax",
|
|
12187
12197
|
"spaceFlashbarHorizontal": "--space-flashbar-horizontal-xmjla3",
|
|
12198
|
+
"spaceFlashbarVertical": "--space-flashbar-vertical-cgkvxy",
|
|
12188
12199
|
"spaceGridGutter": "--space-grid-gutter-ieqn7e",
|
|
12189
12200
|
"spaceKeyValueGap": "--space-key-value-gap-0517k5",
|
|
12190
12201
|
"spaceLayoutContentBottom": "--space-layout-content-bottom-noqzmw",
|