@cloudscape-design/components-themeable 3.0.1073 → 3.0.1075
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/alert/styles.scss +5 -5
- package/lib/internal/scss/internal/components/drag-handle/styles.scss +4 -0
- package/lib/internal/scss/internal/components/sortable-area/styles.scss +1 -3
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +80 -76
- package/lib/internal/template/alert/index.d.ts.map +1 -1
- package/lib/internal/template/alert/index.js +7 -5
- package/lib/internal/template/alert/index.js.map +1 -1
- package/lib/internal/template/alert/internal.d.ts +1 -1
- package/lib/internal/template/alert/internal.js +1 -1
- package/lib/internal/template/alert/internal.js.map +1 -1
- package/lib/internal/template/alert/style.js +3 -3
- package/lib/internal/template/alert/style.js.map +1 -1
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +46 -46
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/anchor-navigation/internal.d.ts.map +1 -1
- package/lib/internal/template/anchor-navigation/internal.js +1 -1
- package/lib/internal/template/anchor-navigation/internal.js.map +1 -1
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +32 -32
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
- package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +17 -17
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +39 -39
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +17 -17
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +23 -23
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +46 -46
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +23 -23
- package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
- package/lib/internal/template/area-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/area-chart/internal.js +1 -1
- package/lib/internal/template/area-chart/internal.js.map +1 -1
- package/lib/internal/template/attribute-editor/internal.js +1 -1
- package/lib/internal/template/attribute-editor/internal.js.map +1 -1
- package/lib/internal/template/attribute-editor/styles.css.js +15 -15
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -28
- package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
- package/lib/internal/template/box/internal.d.ts.map +1 -1
- package/lib/internal/template/box/internal.js +1 -1
- package/lib/internal/template/box/internal.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +28 -28
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/breadcrumb-group/skeleton.d.ts +1 -1
- package/lib/internal/template/button/internal.d.ts +2 -2
- package/lib/internal/template/button/internal.d.ts.map +1 -1
- package/lib/internal/template/button/internal.js +1 -1
- package/lib/internal/template/button/internal.js.map +1 -1
- package/lib/internal/template/button/styles.css.js +22 -22
- package/lib/internal/template/button/styles.scoped.css +212 -212
- package/lib/internal/template/button/styles.selectors.js +22 -22
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +16 -16
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +27 -27
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +16 -16
- package/lib/internal/template/button-group/internal.js +1 -1
- package/lib/internal/template/button-group/internal.js.map +1 -1
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +11 -11
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/container/internal.d.ts.map +1 -1
- package/lib/internal/template/container/internal.js +1 -1
- package/lib/internal/template/container/internal.js.map +1 -1
- package/lib/internal/template/content-layout/styles.css.js +14 -14
- package/lib/internal/template/content-layout/styles.scoped.css +27 -27
- package/lib/internal/template/content-layout/styles.selectors.js +14 -14
- package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
- package/lib/internal/template/date-input/internal.d.ts +1 -1
- package/lib/internal/template/date-input/internal.js +1 -1
- package/lib/internal/template/date-input/internal.js.map +1 -1
- package/lib/internal/template/file-dropzone/internal.d.ts.map +1 -1
- package/lib/internal/template/file-dropzone/internal.js +1 -1
- package/lib/internal/template/file-dropzone/internal.js.map +1 -1
- package/lib/internal/template/file-input/internal.d.ts +1 -1
- package/lib/internal/template/file-input/internal.d.ts.map +1 -1
- package/lib/internal/template/file-input/internal.js +1 -1
- package/lib/internal/template/file-input/internal.js.map +1 -1
- package/lib/internal/template/file-upload/internal.d.ts +1 -1
- package/lib/internal/template/file-upload/internal.js +1 -1
- package/lib/internal/template/file-upload/internal.js.map +1 -1
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +187 -187
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/form/index.d.ts.map +1 -1
- package/lib/internal/template/form/index.js +6 -5
- package/lib/internal/template/form/index.js.map +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts +1 -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 +6 -4
- package/lib/internal/template/form-field/internal.js.map +1 -1
- package/lib/internal/template/grid/internal.js +1 -1
- package/lib/internal/template/grid/internal.js.map +1 -1
- package/lib/internal/template/header/internal.d.ts.map +1 -1
- package/lib/internal/template/header/internal.js +1 -1
- package/lib/internal/template/header/internal.js.map +1 -1
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +73 -73
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/icon/internal.js +1 -1
- package/lib/internal/template/icon/internal.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.js +8 -4
- package/lib/internal/template/internal/components/drag-handle/button.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +3 -3
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +3 -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/styles.css.js +14 -13
- package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +22 -18
- package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +14 -13
- 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 +10 -9
- 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 +2 -1
- 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/styles.css.js +21 -21
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +44 -44
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +21 -21
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +38 -38
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/sortable-area/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/index.js +20 -5
- package/lib/internal/template/internal/components/sortable-area/index.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.d.ts +20 -5
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.js +60 -36
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.d.ts +3 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.js +2 -0
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.d.ts +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.js +4 -9
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/styles.css.js +8 -8
- package/lib/internal/template/internal/components/sortable-area/styles.scoped.css +15 -19
- package/lib/internal/template/internal/components/sortable-area/styles.selectors.js +8 -8
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts +4 -2
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js +36 -40
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +25 -25
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts +4 -0
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/lib/internal/template/internal/generated/custom-css-properties/index.js +79 -75
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +14 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +63 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +63 -0
- package/lib/internal/template/internal/generated/theming/index.js +14 -0
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts +5 -5
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.js.map +1 -1
- package/lib/internal/template/link/internal.d.ts +1 -1
- package/lib/internal/template/link/internal.d.ts.map +1 -1
- package/lib/internal/template/link/internal.js +2 -4
- package/lib/internal/template/link/internal.js.map +1 -1
- package/lib/internal/template/link/styles.css.js +20 -20
- package/lib/internal/template/link/styles.scoped.css +103 -103
- package/lib/internal/template/link/styles.selectors.js +20 -20
- package/lib/internal/template/list/internal.d.ts.map +1 -1
- package/lib/internal/template/list/internal.js +1 -1
- package/lib/internal/template/list/internal.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.js +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.js.map +1 -1
- package/lib/internal/template/modal/internal.js +1 -1
- package/lib/internal/template/modal/internal.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts +1 -1
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +1 -1
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/pagination/internal.d.ts.map +1 -1
- package/lib/internal/template/pagination/internal.js +1 -1
- package/lib/internal/template/pagination/internal.js.map +1 -1
- package/lib/internal/template/popover/internal.js +1 -1
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/prompt-input/internal.js +1 -1
- package/lib/internal/template/prompt-input/internal.js.map +1 -1
- package/lib/internal/template/property-filter/interfaces.d.ts +2 -1
- package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/property-filter/interfaces.js.map +1 -1
- package/lib/internal/template/property-filter/internal.d.ts +1 -1
- package/lib/internal/template/property-filter/internal.d.ts.map +1 -1
- package/lib/internal/template/radio-group/internal.d.ts +1 -1
- package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
- package/lib/internal/template/radio-group/internal.js +1 -1
- package/lib/internal/template/radio-group/internal.js.map +1 -1
- package/lib/internal/template/radio-group/styles.css.js +10 -10
- package/lib/internal/template/radio-group/styles.scoped.css +22 -22
- package/lib/internal/template/radio-group/styles.selectors.js +10 -10
- package/lib/internal/template/segmented-control/internal.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/internal.js +1 -1
- package/lib/internal/template/segmented-control/internal.js.map +1 -1
- package/lib/internal/template/select/internal.js +1 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/slider/internal.d.ts.map +1 -1
- package/lib/internal/template/slider/internal.js +1 -1
- package/lib/internal/template/slider/internal.js.map +1 -1
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +86 -86
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/space-between/internal.d.ts +1 -1
- package/lib/internal/template/space-between/internal.d.ts.map +1 -1
- package/lib/internal/template/spinner/styles.css.js +13 -13
- package/lib/internal/template/spinner/styles.scoped.css +39 -39
- package/lib/internal/template/spinner/styles.selectors.js +13 -13
- package/lib/internal/template/steps/internal.d.ts +1 -1
- package/lib/internal/template/steps/internal.d.ts.map +1 -1
- package/lib/internal/template/steps/internal.js.map +1 -1
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +13 -13
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +66 -66
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/text-filter/internal.d.ts +1 -1
- package/lib/internal/template/text-filter/internal.d.ts.map +1 -1
- package/lib/internal/template/tiles/internal.d.ts +1 -1
- package/lib/internal/template/tiles/internal.d.ts.map +1 -1
- package/lib/internal/template/tiles/internal.js +1 -1
- package/lib/internal/template/tiles/internal.js.map +1 -1
- package/lib/internal/template/time-input/internal.d.ts +1 -1
- package/lib/internal/template/time-input/internal.d.ts.map +1 -1
- package/lib/internal/template/time-input/internal.js +1 -1
- package/lib/internal/template/time-input/internal.js.map +1 -1
- package/lib/internal/template/toggle/internal.js +1 -1
- package/lib/internal/template/toggle/internal.js.map +1 -1
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +23 -23
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/wizard/wizard-form.js +5 -3
- package/lib/internal/template/wizard/wizard-form.js.map +1 -1
- package/package.json +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
|
-
"action-wrapped": "awsui_action-
|
|
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_1fkye_157",
|
|
6
|
+
"enter": "awsui_enter_1q84n_1fkye_157",
|
|
7
|
+
"flash-body": "awsui_flash-body_1q84n_1fkye_171",
|
|
8
|
+
"flash-message": "awsui_flash-message_1q84n_1fkye_171",
|
|
9
|
+
"flash-header": "awsui_flash-header_1q84n_1fkye_171",
|
|
10
|
+
"flash-content": "awsui_flash-content_1q84n_1fkye_172",
|
|
11
|
+
"action-button-wrapper": "awsui_action-button-wrapper_1q84n_1fkye_173",
|
|
12
|
+
"dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_1fkye_174",
|
|
13
|
+
"flash-icon": "awsui_flash-icon_1q84n_1fkye_197",
|
|
14
|
+
"entering": "awsui_entering_1q84n_1fkye_210",
|
|
15
|
+
"entered": "awsui_entered_1q84n_1fkye_231",
|
|
16
|
+
"exiting": "awsui_exiting_1q84n_1fkye_336",
|
|
17
|
+
"stack": "awsui_stack_1q84n_1fkye_370",
|
|
18
|
+
"animation-running": "awsui_animation-running_1q84n_1fkye_370",
|
|
19
|
+
"item": "awsui_item_1q84n_1fkye_370",
|
|
20
|
+
"flash-list-item": "awsui_flash-list-item_1q84n_1fkye_371",
|
|
21
|
+
"notification-bar": "awsui_notification-bar_1q84n_1fkye_372",
|
|
22
|
+
"collapsed": "awsui_collapsed_1q84n_1fkye_392",
|
|
23
|
+
"animation-ready": "awsui_animation-ready_1q84n_1fkye_392",
|
|
24
|
+
"expanded-only": "awsui_expanded-only_1q84n_1fkye_392",
|
|
25
|
+
"expanded": "awsui_expanded_1q84n_1fkye_392",
|
|
26
|
+
"flash": "awsui_flash_1q84n_1fkye_157",
|
|
27
|
+
"collapsible": "awsui_collapsible_1q84n_1fkye_448",
|
|
28
|
+
"short-list": "awsui_short-list_1q84n_1fkye_454",
|
|
29
|
+
"visual-refresh": "awsui_visual-refresh_1q84n_1fkye_454",
|
|
30
|
+
"status": "awsui_status_1q84n_1fkye_601",
|
|
31
|
+
"header": "awsui_header_1q84n_1fkye_601",
|
|
32
|
+
"item-count": "awsui_item-count_1q84n_1fkye_602",
|
|
33
|
+
"button": "awsui_button_1q84n_1fkye_603",
|
|
34
|
+
"type-count": "awsui_type-count_1q84n_1fkye_636",
|
|
35
|
+
"count-number": "awsui_count-number_1q84n_1fkye_636",
|
|
36
|
+
"icon": "awsui_icon_1q84n_1fkye_674",
|
|
37
|
+
"floating": "awsui_floating_1q84n_1fkye_715",
|
|
38
|
+
"flashbar": "awsui_flashbar_1q84n_1fkye_719",
|
|
39
|
+
"initial-hidden": "awsui_initial-hidden_1q84n_1fkye_778",
|
|
40
|
+
"flash-list": "awsui_flash-list_1q84n_1fkye_371",
|
|
41
|
+
"flash-focus-container": "awsui_flash-focus-container_1q84n_1fkye_802",
|
|
42
|
+
"flash-text": "awsui_flash-text_1q84n_1fkye_832",
|
|
43
|
+
"hidden": "awsui_hidden_1q84n_1fkye_851",
|
|
44
|
+
"header-replacement": "awsui_header-replacement_1q84n_1fkye_856",
|
|
45
|
+
"content-replacement": "awsui_content-replacement_1q84n_1fkye_861",
|
|
46
|
+
"dismiss-button": "awsui_dismiss-button_1q84n_1fkye_174",
|
|
47
|
+
"action-wrapped": "awsui_action-wrapped_1q84n_1fkye_879",
|
|
48
|
+
"action-button": "awsui_action-button_1q84n_1fkye_173",
|
|
49
|
+
"action-slot": "awsui_action-slot_1q84n_1fkye_886",
|
|
50
|
+
"flash-type-success": "awsui_flash-type-success_1q84n_1fkye_890",
|
|
51
|
+
"flash-type-error": "awsui_flash-type-error_1q84n_1fkye_894",
|
|
52
|
+
"flash-type-info": "awsui_flash-type-info_1q84n_1fkye_898",
|
|
53
|
+
"flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_1fkye_899",
|
|
54
|
+
"flash-type-warning": "awsui_flash-type-warning_1q84n_1fkye_903"
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAyFrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,eAwC1E"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
'use client';
|
|
4
4
|
import { __rest } from "tslib";
|
|
5
|
-
import React, { useEffect } from 'react';
|
|
6
|
-
import { useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
|
6
|
+
import { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
7
7
|
import { FunnelMetrics } from '../internal/analytics';
|
|
8
8
|
import { AnalyticsFunnel, AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';
|
|
9
9
|
import { useFunnel, useFunnelNameSelector, useFunnelStepRef } from '../internal/analytics/hooks/use-funnel';
|
|
@@ -17,6 +17,8 @@ import headerStyles from '../header/styles.css.js';
|
|
|
17
17
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
18
18
|
const FormWithAnalytics = (_a) => {
|
|
19
19
|
var { variant = 'full-page', actions, errorText, __internalRootRef } = _a, props = __rest(_a, ["variant", "actions", "errorText", "__internalRootRef"]);
|
|
20
|
+
const rootRef = useRef(null);
|
|
21
|
+
const ref = useMergeRefs(rootRef, __internalRootRef);
|
|
20
22
|
const { funnelIdentifier, funnelInteractionId, funnelProps, funnelSubmit, funnelNextOrSubmitAttempt, errorCount, submissionAttempt, funnelErrorContext, } = useFunnel();
|
|
21
23
|
const funnelStepInfo = useFunnelStepRef();
|
|
22
24
|
const handleActionButtonClick = ({ variant }) => {
|
|
@@ -37,7 +39,7 @@ const FormWithAnalytics = (_a) => {
|
|
|
37
39
|
stepNameSelector: funnelStepInfo.current.stepNameSelector,
|
|
38
40
|
stepName,
|
|
39
41
|
stepIdentifier: funnelStepInfo.current.stepIdentifier,
|
|
40
|
-
currentDocument: (_a =
|
|
42
|
+
currentDocument: (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument,
|
|
41
43
|
totalSubSteps: funnelStepInfo.current.subStepCount.current,
|
|
42
44
|
funnelIdentifier,
|
|
43
45
|
subStepAllSelector: getSubStepAllSelector(),
|
|
@@ -58,11 +60,10 @@ const FormWithAnalytics = (_a) => {
|
|
|
58
60
|
errorCount,
|
|
59
61
|
funnelErrorContext,
|
|
60
62
|
errorSlotId,
|
|
61
|
-
__internalRootRef,
|
|
62
63
|
funnelStepInfo,
|
|
63
64
|
]);
|
|
64
65
|
return (React.createElement(ButtonContext.Provider, { value: { onClick: handleActionButtonClick } },
|
|
65
|
-
React.createElement(InternalForm, Object.assign({ variant: variant, actions: actions, errorText: errorText, __errorSlotId: errorSlotId }, props, funnelProps, funnelStepInfo.current.funnelStepProps, { __internalRootRef:
|
|
66
|
+
React.createElement(InternalForm, Object.assign({ variant: variant, actions: actions, errorText: errorText, __errorSlotId: errorSlotId }, props, funnelProps, funnelStepInfo.current.funnelStepProps, { __internalRootRef: ref, __injectAnalyticsComponentMetadata: true }))));
|
|
66
67
|
};
|
|
67
68
|
export default function Form(_a) {
|
|
68
69
|
var { variant = 'full-page' } = _a, props = __rest(_a, ["variant"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/form/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvG,OAAO,EAAE,aAAa,EAAsB,MAAM,oCAAoC,CAAC;AACvF,OAAO,gBAAgD,MAAM,sCAAsC,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,YAAY,MAAM,YAAY,CAAC;AAEtC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,kBAAkB,MAAM,oCAAoC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,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { useEffect, useRef } from 'react';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\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, { InternalBaseComponentProps } 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 = ({\n variant = 'full-page',\n actions,\n errorText,\n __internalRootRef,\n ...props\n}: FormProps & InternalBaseComponentProps) => {\n const rootRef = useRef<HTMLElement>(null);\n const ref = useMergeRefs(rootRef, __internalRootRef);\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: rootRef.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 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 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={ref}\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"]}
|
|
@@ -89,7 +89,7 @@ export declare namespace FormFieldProps {
|
|
|
89
89
|
warningIconAriaLabel?: string;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
export interface InternalFormFieldProps extends FormFieldProps, InternalBaseComponentProps
|
|
92
|
+
export interface InternalFormFieldProps extends FormFieldProps, InternalBaseComponentProps {
|
|
93
93
|
/**
|
|
94
94
|
* Visually hide the label.
|
|
95
95
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,WAAW,C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@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { CSSProperties } from 'react';\n\nimport { AnalyticsMetadata, ErrorContext } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface FormFieldProps extends BaseComponentProps {\n /**\n * The ID of the primary form control. You can use this to set the\n * `for` attribute of a label for accessibility.\n *\n * If you don't set this property, the control group automatically sets\n * the label to the ID of an inner form control (for example, an [input](/components/input) component).\n * This only works well if you're using a single control in the form field.\n */\n controlId?: string;\n\n /**\n * Determines whether the primary control should expand to 12 columns.\n *\n * By default (or when this property is set to `false`), the primary control\n * occupies 9 columns. The secondary control uses the remaining 3 columns.\n * On smaller viewports, both components occupy 12 columns and stack on top of each other.\n *\n * If this property is set to `true`, the primary control uses the full\n * 12 columns. The secondary control (if present) also uses 12 columns, and the two\n * controls stack on top of each other.\n */\n stretch?: boolean;\n\n /**\n * The main label for the form field.\n */\n label?: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: FormFieldProps.I18nStrings;\n\n /**\n * Use to display an 'Info' link next to the label.\n */\n info?: React.ReactNode;\n\n /**\n * The primary form control (for example, input, textarea, etc.).\n * @displayname control\n */\n children?: React.ReactNode;\n\n /**\n * A secondary control. You can use this for custom actions and content.\n */\n secondaryControl?: React.ReactNode;\n\n /**\n * Detailed information about the form field that's displayed below the label.\n */\n description?: React.ReactNode;\n\n /**\n * Constraint text that's displayed below the control. Use this to provide\n * additional information about valid formats, etc.\n */\n constraintText?: React.ReactNode;\n\n /**\n * Text that displays as a validation error message. If this is set to a\n * non-empty string, it will render the form field as invalid.\n */\n errorText?: React.ReactNode;\n\n /**\n * Text that displays as a validation warning message. If this is set to a\n * non-empty string, it will render the form field in a warning state.\n */\n warningText?: React.ReactNode;\n\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `errorContext` - Identifies the error category and sub-category.\n * @analytics\n */\n analyticsMetadata?: FormFieldProps.AnalyticsMetadata;\n}\n\nexport namespace FormFieldProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n errorContext?: ErrorContext;\n }\n\n export interface I18nStrings {\n /**\n * Provides a text alternative for the error icon in the error message.\n */\n errorIconAriaLabel?: string;\n\n /**\n * Provides a text alternative for the warning icon in the warning message.\n */\n warningIconAriaLabel?: string;\n }\n}\n\nexport interface InternalFormFieldProps extends FormFieldProps, InternalBaseComponentProps
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { CSSProperties } from 'react';\n\nimport { AnalyticsMetadata, ErrorContext } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface FormFieldProps extends BaseComponentProps {\n /**\n * The ID of the primary form control. You can use this to set the\n * `for` attribute of a label for accessibility.\n *\n * If you don't set this property, the control group automatically sets\n * the label to the ID of an inner form control (for example, an [input](/components/input) component).\n * This only works well if you're using a single control in the form field.\n */\n controlId?: string;\n\n /**\n * Determines whether the primary control should expand to 12 columns.\n *\n * By default (or when this property is set to `false`), the primary control\n * occupies 9 columns. The secondary control uses the remaining 3 columns.\n * On smaller viewports, both components occupy 12 columns and stack on top of each other.\n *\n * If this property is set to `true`, the primary control uses the full\n * 12 columns. The secondary control (if present) also uses 12 columns, and the two\n * controls stack on top of each other.\n */\n stretch?: boolean;\n\n /**\n * The main label for the form field.\n */\n label?: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: FormFieldProps.I18nStrings;\n\n /**\n * Use to display an 'Info' link next to the label.\n */\n info?: React.ReactNode;\n\n /**\n * The primary form control (for example, input, textarea, etc.).\n * @displayname control\n */\n children?: React.ReactNode;\n\n /**\n * A secondary control. You can use this for custom actions and content.\n */\n secondaryControl?: React.ReactNode;\n\n /**\n * Detailed information about the form field that's displayed below the label.\n */\n description?: React.ReactNode;\n\n /**\n * Constraint text that's displayed below the control. Use this to provide\n * additional information about valid formats, etc.\n */\n constraintText?: React.ReactNode;\n\n /**\n * Text that displays as a validation error message. If this is set to a\n * non-empty string, it will render the form field as invalid.\n */\n errorText?: React.ReactNode;\n\n /**\n * Text that displays as a validation warning message. If this is set to a\n * non-empty string, it will render the form field in a warning state.\n */\n warningText?: React.ReactNode;\n\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `errorContext` - Identifies the error category and sub-category.\n * @analytics\n */\n analyticsMetadata?: FormFieldProps.AnalyticsMetadata;\n}\n\nexport namespace FormFieldProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n errorContext?: ErrorContext;\n }\n\n export interface I18nStrings {\n /**\n * Provides a text alternative for the error icon in the error message.\n */\n errorIconAriaLabel?: string;\n\n /**\n * Provides a text alternative for the warning icon in the warning message.\n */\n warningIconAriaLabel?: string;\n }\n}\n\nexport interface InternalFormFieldProps extends FormFieldProps, InternalBaseComponentProps {\n /**\n * Visually hide the label.\n */\n __hideLabel?: boolean;\n\n /**\n * Disable the gutter applied by default.\n */\n __disableGutters?: boolean;\n __analyticsMetadata?: AnalyticsMetadata;\n __style?: CSSProperties;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/form-field/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAwBjD,OAAO,EAAE,sBAAsB,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AC7B;AAED,UAAU,qBAAqB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,eAqBvF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EAAE,qBAAqB,eAqB7F;AAED,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,iBAAiB,EACjB,QAAQ,GACT,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,eAMA;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,SAAS,EACT,OAAe,EACf,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,SAAS,EACT,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,gBAAwB,EACxB,mBAA+B,EAC/B,OAAY,EACZ,GAAG,IAAI,EACR,EAAE,sBAAsB,eAiKxB"}
|
|
@@ -3,7 +3,7 @@ import { __rest } from "tslib";
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
+
import { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
7
7
|
import { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
|
|
8
8
|
import InternalGrid from '../grid/internal';
|
|
9
9
|
import { useInternalI18n } from '../i18n/context';
|
|
@@ -48,7 +48,9 @@ export function ConstraintText({ id, hasValidationText, children, }) {
|
|
|
48
48
|
return (React.createElement("div", { id: id, className: clsx(styles.constraint, hasValidationText && styles['constraint-has-validation-text']) }, children));
|
|
49
49
|
}
|
|
50
50
|
export default function InternalFormField(_a) {
|
|
51
|
-
var { controlId, stretch = false, label, info, i18nStrings, children, secondaryControl, description, constraintText, errorText, warningText, __hideLabel, __internalRootRef
|
|
51
|
+
var { controlId, stretch = false, label, info, i18nStrings, children, secondaryControl, description, constraintText, errorText, warningText, __hideLabel, __internalRootRef, __disableGutters = false, __analyticsMetadata = undefined, __style = {} } = _a, rest = __rest(_a, ["controlId", "stretch", "label", "info", "i18nStrings", "children", "secondaryControl", "description", "constraintText", "errorText", "warningText", "__hideLabel", "__internalRootRef", "__disableGutters", "__analyticsMetadata", "__style"]);
|
|
52
|
+
const rootRef = useRef();
|
|
53
|
+
const ref = useMergeRefs(rootRef, __internalRootRef);
|
|
52
54
|
const baseProps = getBaseProps(rest);
|
|
53
55
|
const isRefresh = useVisualRefresh();
|
|
54
56
|
const instanceUniqueId = useUniqueId('formField');
|
|
@@ -82,7 +84,7 @@ export default function InternalFormField(_a) {
|
|
|
82
84
|
const subStepName = getTextFromSelector(subStepNameSelector);
|
|
83
85
|
errorCount.current++;
|
|
84
86
|
// We don't want to report an error if it is hidden, e.g. inside an Expandable Section.
|
|
85
|
-
const errorIsVisible = ((_c = (_b = (_a =
|
|
87
|
+
const errorIsVisible = ((_c = (_b = (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 0) > 0;
|
|
86
88
|
if (errorIsVisible) {
|
|
87
89
|
FunnelMetrics.funnelSubStepError({
|
|
88
90
|
funnelInteractionId,
|
|
@@ -109,7 +111,7 @@ export default function InternalFormField(_a) {
|
|
|
109
111
|
}
|
|
110
112
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
113
|
}, [funnelInteractionId, errorText, submissionAttempt, errorCount]);
|
|
112
|
-
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(baseProps.className, styles.root), style: __style, ref:
|
|
114
|
+
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(baseProps.className, styles.root), style: __style, ref: ref }, analyticsAttributes, copyAnalyticsMetadataAttribute(rest)),
|
|
113
115
|
React.createElement("div", { className: clsx(styles['label-wrapper'], __hideLabel && styles['visually-hidden']) },
|
|
114
116
|
label && (React.createElement("label", { className: clsx(styles.label, analyticsSelectors.label), id: slotIds.label, htmlFor: generatedControlId }, label)),
|
|
115
117
|
React.createElement(InfoLinkLabelContext.Provider, { value: slotIds.label }, !__hideLabel && info && React.createElement("span", { className: styles.info }, info))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/form-field/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,4B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E,oBAAoB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,IAC3F,WAAW,CACK,CACpB;YACA,cAAc,IAAI,CACjB,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW,IACpF,cAAc,CACA,CAClB,CACG,CACP,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, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalGrid from '../grid/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FIELD_ERROR,\n DATA_ATTR_FIELD_LABEL,\n getFieldSlotSeletor,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalLiveRegion from '../live-region/internal';\nimport { InternalFormFieldProps } from './interfaces';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\ninterface FormFieldWarningProps {\n id?: string;\n children?: React.ReactNode;\n warningIconAriaLabel?: string;\n}\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nErrorIconAriaLabel = i18n('i18nStrings.errorIconAriaLabel', errorIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.error}>\n <div className={styles['error-icon-shake-wrapper']}>\n <div className={styles['error-icon-scale-wrapper']}>\n <InternalIcon name=\"status-negative\" size=\"small\" ariaLabel={i18nErrorIconAriaLabel} />\n </div>\n </div>\n <span className={styles.error__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nErrorIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function FormFieldWarning({ id, children, warningIconAriaLabel }: FormFieldWarningProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nWarningIconAriaLabel = i18n('i18nStrings.warningIconAriaLabel', warningIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.warning}>\n <div className={styles['warning-icon-shake-wrapper']}>\n <div className={styles['warning-icon-scale-wrapper']}>\n <InternalIcon name=\"status-warning\" size=\"small\" ariaLabel={i18nWarningIconAriaLabel} />\n </div>\n </div>\n <span className={styles.warning__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nWarningIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function ConstraintText({\n id,\n hasValidationText,\n children,\n}: {\n id?: string;\n hasValidationText: boolean;\n children: React.ReactNode;\n}) {\n return (\n <div id={id} className={clsx(styles.constraint, hasValidationText && styles['constraint-has-validation-text'])}>\n {children}\n </div>\n );\n}\n\nexport default function InternalFormField({\n controlId,\n stretch = false,\n label,\n info,\n i18nStrings,\n children,\n secondaryControl,\n description,\n constraintText,\n errorText,\n warningText,\n __hideLabel,\n __internalRootRef = null,\n __disableGutters = false,\n __analyticsMetadata = undefined,\n __style = {},\n ...rest\n}: InternalFormFieldProps) {\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n\n const instanceUniqueId = useUniqueId('formField');\n const generatedControlId = controlId || instanceUniqueId;\n const formFieldId = controlId || generatedControlId;\n\n const { funnelIdentifier, funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepIdentifier, stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepIdentifier, subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const showWarning = warningText && !errorText;\n\n if (warningText && errorText) {\n warnOnce('FileUpload', 'Both `errorText` and `warningText` exist. `warningText` will not be shown.');\n }\n\n const slotIds = getSlotIds(\n formFieldId,\n label,\n description,\n constraintText,\n errorText,\n showWarning ? warningText : undefined\n );\n\n const ariaDescribedBy = getAriaDescribedBy(slotIds);\n\n const gridDefinition = getGridDefinition(stretch, !!secondaryControl, isRefresh);\n\n const {\n ariaLabelledby: parentAriaLabelledby,\n ariaDescribedby: parentAriaDescribedby,\n invalid: parentInvalid,\n warning: parentWarning,\n } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!parentInvalid,\n warning: (!!warningText && !errorText) || (!!parentWarning && !parentInvalid),\n };\n\n const analyticsAttributes = {\n [DATA_ATTR_FIELD_LABEL]: slotIds.label ? getFieldSlotSeletor(slotIds.label) : undefined,\n [DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : undefined,\n };\n\n useEffect(() => {\n if (funnelInteractionId && errorText && funnelState.current !== 'complete') {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (__internalRootRef?.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n funnelIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n subStepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n stepIdentifier,\n fieldErrorSelector: `${getFieldSlotSeletor(slotIds.error)} .${styles.error__message}`,\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\n fieldIdentifier: __analyticsMetadata?.instanceIdentifier,\n errorContext: __analyticsMetadata?.errorContext,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, errorText, submissionAttempt, errorCount]);\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n style={__style}\n ref={__internalRootRef}\n {...analyticsAttributes}\n {...copyAnalyticsMetadataAttribute(rest)}\n >\n <div className={clsx(styles['label-wrapper'], __hideLabel && styles['visually-hidden'])}>\n {label && (\n <label\n className={clsx(styles.label, analyticsSelectors.label)}\n id={slotIds.label}\n htmlFor={generatedControlId}\n >\n {label}\n </label>\n )}\n <InfoLinkLabelContext.Provider value={slotIds.label}>\n {!__hideLabel && info && <span className={styles.info}>{info}</span>}\n </InfoLinkLabelContext.Provider>\n </div>\n\n {description && (\n <div className={styles.description} id={slotIds.description}>\n {description}\n </div>\n )}\n\n <div className={clsx(styles.controls, __hideLabel && styles['label-hidden'])}>\n <InternalGrid gridDefinition={gridDefinition} disableGutters={__disableGutters}>\n <FormFieldContext.Provider\n value={{\n controlId: generatedControlId,\n ...contextValuesWithoutControlId,\n }}\n >\n {children && <div className={styles.control}>{children}</div>}\n </FormFieldContext.Provider>\n\n {secondaryControl && (\n <FormFieldContext.Provider value={contextValuesWithoutControlId}>\n <div className={styles['secondary-control']}>{secondaryControl}</div>\n </FormFieldContext.Provider>\n )}\n </InternalGrid>\n </div>\n\n {(constraintText || errorText || warningText) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={slotIds.error} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={slotIds.warning} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {constraintText && (\n <ConstraintText id={slotIds.constraint} hasValidationText={!!errorText || !!warningText}>\n {constraintText}\n </ConstraintText>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/form-field/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,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X,WAAW,CAAE,oBAAoB,IAC3F,WAAW,CACK,CACpB;YACA,cAAc,IAAI,CACjB,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW,IACpF,cAAc,CACA,CAClB,CACG,CACP,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, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalGrid from '../grid/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FIELD_ERROR,\n DATA_ATTR_FIELD_LABEL,\n getFieldSlotSeletor,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalLiveRegion from '../live-region/internal';\nimport { InternalFormFieldProps } from './interfaces';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\ninterface FormFieldWarningProps {\n id?: string;\n children?: React.ReactNode;\n warningIconAriaLabel?: string;\n}\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nErrorIconAriaLabel = i18n('i18nStrings.errorIconAriaLabel', errorIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.error}>\n <div className={styles['error-icon-shake-wrapper']}>\n <div className={styles['error-icon-scale-wrapper']}>\n <InternalIcon name=\"status-negative\" size=\"small\" ariaLabel={i18nErrorIconAriaLabel} />\n </div>\n </div>\n <span className={styles.error__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nErrorIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function FormFieldWarning({ id, children, warningIconAriaLabel }: FormFieldWarningProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nWarningIconAriaLabel = i18n('i18nStrings.warningIconAriaLabel', warningIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.warning}>\n <div className={styles['warning-icon-shake-wrapper']}>\n <div className={styles['warning-icon-scale-wrapper']}>\n <InternalIcon name=\"status-warning\" size=\"small\" ariaLabel={i18nWarningIconAriaLabel} />\n </div>\n </div>\n <span className={styles.warning__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nWarningIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function ConstraintText({\n id,\n hasValidationText,\n children,\n}: {\n id?: string;\n hasValidationText: boolean;\n children: React.ReactNode;\n}) {\n return (\n <div id={id} className={clsx(styles.constraint, hasValidationText && styles['constraint-has-validation-text'])}>\n {children}\n </div>\n );\n}\n\nexport default function InternalFormField({\n controlId,\n stretch = false,\n label,\n info,\n i18nStrings,\n children,\n secondaryControl,\n description,\n constraintText,\n errorText,\n warningText,\n __hideLabel,\n __internalRootRef,\n __disableGutters = false,\n __analyticsMetadata = undefined,\n __style = {},\n ...rest\n}: InternalFormFieldProps) {\n const rootRef = useRef<HTMLElement>();\n const ref = useMergeRefs(rootRef, __internalRootRef);\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n\n const instanceUniqueId = useUniqueId('formField');\n const generatedControlId = controlId || instanceUniqueId;\n const formFieldId = controlId || generatedControlId;\n\n const { funnelIdentifier, funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepIdentifier, stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepIdentifier, subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const showWarning = warningText && !errorText;\n\n if (warningText && errorText) {\n warnOnce('FileUpload', 'Both `errorText` and `warningText` exist. `warningText` will not be shown.');\n }\n\n const slotIds = getSlotIds(\n formFieldId,\n label,\n description,\n constraintText,\n errorText,\n showWarning ? warningText : undefined\n );\n\n const ariaDescribedBy = getAriaDescribedBy(slotIds);\n\n const gridDefinition = getGridDefinition(stretch, !!secondaryControl, isRefresh);\n\n const {\n ariaLabelledby: parentAriaLabelledby,\n ariaDescribedby: parentAriaDescribedby,\n invalid: parentInvalid,\n warning: parentWarning,\n } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!parentInvalid,\n warning: (!!warningText && !errorText) || (!!parentWarning && !parentInvalid),\n };\n\n const analyticsAttributes = {\n [DATA_ATTR_FIELD_LABEL]: slotIds.label ? getFieldSlotSeletor(slotIds.label) : undefined,\n [DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : undefined,\n };\n\n useEffect(() => {\n if (funnelInteractionId && errorText && funnelState.current !== 'complete') {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (rootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n funnelIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n subStepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n stepIdentifier,\n fieldErrorSelector: `${getFieldSlotSeletor(slotIds.error)} .${styles.error__message}`,\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\n fieldIdentifier: __analyticsMetadata?.instanceIdentifier,\n errorContext: __analyticsMetadata?.errorContext,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, errorText, submissionAttempt, errorCount]);\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n style={__style}\n ref={ref}\n {...analyticsAttributes}\n {...copyAnalyticsMetadataAttribute(rest)}\n >\n <div className={clsx(styles['label-wrapper'], __hideLabel && styles['visually-hidden'])}>\n {label && (\n <label\n className={clsx(styles.label, analyticsSelectors.label)}\n id={slotIds.label}\n htmlFor={generatedControlId}\n >\n {label}\n </label>\n )}\n <InfoLinkLabelContext.Provider value={slotIds.label}>\n {!__hideLabel && info && <span className={styles.info}>{info}</span>}\n </InfoLinkLabelContext.Provider>\n </div>\n\n {description && (\n <div className={styles.description} id={slotIds.description}>\n {description}\n </div>\n )}\n\n <div className={clsx(styles.controls, __hideLabel && styles['label-hidden'])}>\n <InternalGrid gridDefinition={gridDefinition} disableGutters={__disableGutters}>\n <FormFieldContext.Provider\n value={{\n controlId: generatedControlId,\n ...contextValuesWithoutControlId,\n }}\n >\n {children && <div className={styles.control}>{children}</div>}\n </FormFieldContext.Provider>\n\n {secondaryControl && (\n <FormFieldContext.Provider value={contextValuesWithoutControlId}>\n <div className={styles['secondary-control']}>{secondaryControl}</div>\n </FormFieldContext.Provider>\n )}\n </InternalGrid>\n </div>\n\n {(constraintText || errorText || warningText) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={slotIds.error} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={slotIds.warning} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {constraintText && (\n <ConstraintText id={slotIds.constraint} hasValidationText={!!errorText || !!warningText}>\n {constraintText}\n </ConstraintText>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
|
11
11
|
import { isDevelopment } from '../internal/is-development';
|
|
12
12
|
import styles from './styles.css.js';
|
|
13
13
|
const InternalGrid = React.forwardRef((_a, ref) => {
|
|
14
|
-
var { __breakpoint, gridDefinition = [], disableGutters = false, children, __tagOverride, __responsiveClassName, __internalRootRef
|
|
14
|
+
var { __breakpoint, gridDefinition = [], disableGutters = false, children, __tagOverride, __responsiveClassName, __internalRootRef } = _a, restProps = __rest(_a, ["__breakpoint", "gridDefinition", "disableGutters", "children", "__tagOverride", "__responsiveClassName", "__internalRootRef"]);
|
|
15
15
|
let [defaultBreakpoint, defaultRef] = useContainerBreakpoints(undefined);
|
|
16
16
|
if (__breakpoint !== undefined) {
|
|
17
17
|
defaultBreakpoint = __breakpoint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/grid/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,IAAoB,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,O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EAClC,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,aAAa,CAAC,EACrB,mBAAmB,CAAC,SAAS,EAAE,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,OAAO,EAAE,iBAAiB,CAAC,EAC7E,mBAAmB,CAAC,QAAQ,EAAE,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,MAAM,EAAE,iBAAiB,CAAC,EAC3E,mBAAmB,CAAC,MAAM,EAAE,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,IAAI,EAAE,iBAAiB,CAAC,EACvE,mBAAmB,CAAC,MAAM,EAAE,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,IAAI,EAAE,iBAAiB,CAAC,CACxE;YAED,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,IAAG,KAAK,CAAO,CAC3D,CACP,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,mBAAmB,CAC1B,IAAY,EACZ,OAAyD,EACzD,UAA6B;IAE7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,MAAM,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;KACrC;IACD,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE;QAChD,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,GAAG,IAAI,IAAI,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport clsx, { ClassValue } from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { Breakpoint, matchBreakpointMapping } from '../internal/breakpoints';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { isDevelopment } from '../internal/is-development';\nimport { GridProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalGridProps extends GridProps, InternalBaseComponentProps {\n __breakpoint?: Breakpoint | null;\n\n /**\n * The handler that fires when the grid breakpoint changes.\n */\n __responsiveClassName?: (breakpoint: Breakpoint | null) => ClassValue;\n /**\n * Overrides the default wrapper HTML tag.\n */\n __tagOverride?: string;\n}\n\nconst InternalGrid = React.forwardRef(\n (\n {\n __breakpoint,\n gridDefinition = [],\n disableGutters = false,\n children,\n __tagOverride,\n __responsiveClassName,\n __internalRootRef,\n ...restProps\n }: InternalGridProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n let [defaultBreakpoint, defaultRef]: [Breakpoint | null, React.Ref<HTMLDivElement>] =\n useContainerBreakpoints(undefined);\n if (__breakpoint !== undefined) {\n defaultBreakpoint = __breakpoint;\n defaultRef = ref;\n }\n\n const baseProps = getBaseProps(restProps);\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n const Tag = (__tagOverride ?? 'div') as 'div';\n\n if (isDevelopment) {\n const columnCount = gridDefinition.length;\n const childCount = flattenedChildren.length;\n if (columnCount !== childCount) {\n warnOnce(\n 'Grid',\n `The number of children (${childCount}) does not match the number of columns defined (${columnCount}).`\n );\n }\n }\n\n const mergedRef = useMergeRefs(defaultRef, __internalRootRef);\n\n return (\n <Tag\n {...baseProps}\n className={clsx(\n styles.grid,\n baseProps.className,\n { [styles['no-gutters']]: disableGutters },\n __responsiveClassName ? __responsiveClassName(defaultBreakpoint) : null\n )}\n ref={mergedRef}\n >\n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n const key = (child as Record<'key', unknown>).key;\n\n return (\n <div\n key={key ? String(key) : undefined}\n className={clsx(\n styles['grid-column'],\n getColumnClassNames('colspan', gridDefinition[i]?.colspan, defaultBreakpoint),\n getColumnClassNames('offset', gridDefinition[i]?.offset, defaultBreakpoint),\n getColumnClassNames('pull', gridDefinition[i]?.pull, defaultBreakpoint),\n getColumnClassNames('push', gridDefinition[i]?.push, defaultBreakpoint)\n )}\n >\n <div className={styles['restore-pointer-events']}>{child}</div>\n </div>\n );\n })}\n </Tag>\n );\n }\n);\n\nfunction getColumnClassNames(\n prop: string,\n mapping: undefined | number | GridProps.BreakpointMapping,\n breakpoint: Breakpoint | null\n): string | null {\n if (typeof mapping === 'number') {\n return styles[`${prop}-${mapping}`];\n }\n if (breakpoint === null || mapping === undefined) {\n return null;\n }\n return styles[`${prop}-${matchBreakpointMapping(mapping, breakpoint)}`];\n}\n\nexport default InternalGrid;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/header/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAc,MAAM,OAAO,CAAC;AAY5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,UAAU,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACpG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9D,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,WAAW,EACX,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/header/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAc,MAAM,OAAO,CAAC;AAY5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,UAAU,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACpG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9D,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,GAAG,SAAS,EACb,EAAE,mBAAmB,eAoFrB;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,sBAgBhH"}
|
|
@@ -17,7 +17,7 @@ import { useTableIntegration } from './analytics/use-table-integration';
|
|
|
17
17
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
18
18
|
import styles from './styles.css.js';
|
|
19
19
|
export default function InternalHeader(_a) {
|
|
20
|
-
var { variant, headingTagOverride, children, actions, counter, description, info, __internalRootRef
|
|
20
|
+
var { variant, headingTagOverride, children, actions, counter, description, info, __internalRootRef, __disableActionsWrapping, __headingTagRef, __headingTagTabIndex } = _a, restProps = __rest(_a, ["variant", "headingTagOverride", "children", "actions", "counter", "description", "info", "__internalRootRef", "__disableActionsWrapping", "__headingTagRef", "__headingTagTabIndex"]);
|
|
21
21
|
const isMobile = useMobile();
|
|
22
22
|
const HeadingTag = headingTagOverride !== null && headingTagOverride !== void 0 ? headingTagOverride : (variant === 'awsui-h1-sticky' ? 'h1' : variant);
|
|
23
23
|
const { isStuck } = useContext(StickyHeaderContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/header/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAoB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAajB;QAbiB,EACrC,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,WA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e,EAAE,CAAC,EAC5C,SAAS,IAAI,MAAM,CAAC,OAAO,EAC3B,CAAC,wBAAwB,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAC1D,IAEA,OAAO,CACJ,CACP,CACG;QACN,oBAAC,WAAW,IAAC,eAAe,EAAE,eAAe,IAAG,WAAW,CAAe,CACtE,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,eAAe,EAA0D;IAC/G,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,OAAO,CACL,CAAC,QAAQ,IAAI,CACX,2BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,uBAAuB,eAAe,EAAE,CAAC,EAChD,SAAS,IAAI,MAAM,CAAC,OAAO,CAC5B,IAEA,QAAQ,CACP,CACL,CAAC;QACF,IAAI,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MutableRefObject, useContext } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsLabelAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { StickyHeaderContext } from '../container/use-sticky-header';\nimport { DATA_ATTR_FUNNEL_KEY, FUNNEL_KEY_SUBSTEP_NAME } from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport { CollectionLabelContext } from '../internal/context/collection-label-context';\nimport { useContainerHeader } from '../internal/context/container-header';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SomeRequired } from '../internal/types';\nimport { useTableIntegration } from './analytics/use-table-integration';\nimport { HeaderProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface InternalHeaderProps extends SomeRequired<HeaderProps, 'variant'>, InternalBaseComponentProps {\n __disableActionsWrapping?: boolean;\n __headingTagRef?: MutableRefObject<HTMLHeadingElement | null>;\n __headingTagTabIndex?: number;\n}\n\nexport default function InternalHeader({\n variant,\n headingTagOverride,\n children,\n actions,\n counter,\n description,\n info,\n __internalRootRef,\n __disableActionsWrapping,\n __headingTagRef,\n __headingTagTabIndex,\n ...restProps\n}: InternalHeaderProps) {\n const isMobile = useMobile();\n const HeadingTag = headingTagOverride ?? (variant === 'awsui-h1-sticky' ? 'h1' : variant);\n const { isStuck } = useContext(StickyHeaderContext);\n const baseProps = getBaseProps(restProps);\n const isRefresh = useVisualRefresh();\n const assignHeaderId = useContext(CollectionLabelContext).assignId;\n const isInContainer = useContainerHeader();\n const headingId = useUniqueId('heading');\n\n useTableIntegration(counter);\n\n if (assignHeaderId !== undefined) {\n assignHeaderId(headingId);\n }\n // If is mobile there is no need to have the dynamic variant because it's scrolled out of view\n const dynamicVariant = !isMobile && isStuck ? 'h2' : 'h1';\n const variantOverride = variant === 'awsui-h1-sticky' ? (isRefresh ? dynamicVariant : 'h2') : variant;\n\n return (\n <div\n {...baseProps}\n className={clsx(\n styles.root,\n baseProps.className,\n styles[`root-variant-${variantOverride}`],\n isRefresh && styles.refresh,\n !actions && [styles[`root-no-actions`]],\n description && [styles[`root-has-description`]]\n )}\n ref={__internalRootRef}\n >\n <div\n className={clsx(\n styles.main,\n styles[`main-variant-${variantOverride}`],\n isRefresh && styles.refresh,\n __disableActionsWrapping && [styles['no-wrap']]\n )}\n >\n <div className={clsx(styles.title, styles[`title-variant-${variantOverride}`], isRefresh && styles.refresh)}>\n <HeadingTag\n className={clsx(styles.heading, styles[`heading-variant-${variantOverride}`])}\n ref={__headingTagRef}\n tabIndex={__headingTagTabIndex}\n {...getAnalyticsLabelAttribute(`.${analyticsSelectors['heading-text']}`)}\n >\n <span\n {...(isInContainer ? { [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_SUBSTEP_NAME } : {})}\n className={clsx(\n styles['heading-text'],\n analyticsSelectors['heading-text'],\n styles[`heading-text-variant-${variantOverride}`]\n )}\n id={headingId}\n >\n {children}\n </span>\n {counter !== undefined && <span className={styles.counter}> {counter}</span>}\n </HeadingTag>\n {info && (\n <InfoLinkLabelContext.Provider value={headingId}>\n {/* Exists to create a space between heading text and info so that a double-click selection on the last word of the heading doesn't also include info */}\n <span className={styles['virtual-space']}> </span>\n <span className={styles.info}>{info}</span>\n </InfoLinkLabelContext.Provider>\n )}\n </div>\n {actions && (\n <div\n className={clsx(\n styles.actions,\n styles[`actions-variant-${variantOverride}`],\n isRefresh && styles.refresh,\n !__disableActionsWrapping && [styles['actions-centered']]\n )}\n >\n {actions}\n </div>\n )}\n </div>\n <Description variantOverride={variantOverride}>{description}</Description>\n </div>\n );\n}\n\nexport function Description({ children, variantOverride }: { children: React.ReactNode; variantOverride: string }) {\n const isRefresh = useVisualRefresh();\n return (\n (children && (\n <p\n className={clsx(\n styles.description,\n styles[`description-variant-${variantOverride}`],\n isRefresh && styles.refresh\n )}\n >\n {children}\n </p>\n )) ||\n null\n );\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"help-panel": "awsui_help-
|
|
5
|
-
"loading": "
|
|
6
|
-
"header": "
|
|
7
|
-
"with-toolbar": "awsui_with-
|
|
8
|
-
"content": "
|
|
9
|
-
"footer": "
|
|
4
|
+
"help-panel": "awsui_help-panel_1d237_y6kc4_181",
|
|
5
|
+
"loading": "awsui_loading_1d237_y6kc4_348",
|
|
6
|
+
"header": "awsui_header_1d237_y6kc4_353",
|
|
7
|
+
"with-toolbar": "awsui_with-toolbar_1d237_y6kc4_371",
|
|
8
|
+
"content": "awsui_content_1d237_y6kc4_390",
|
|
9
|
+
"footer": "awsui_footer_1d237_y6kc4_441"
|
|
10
10
|
};
|
|
11
11
|
|