@cloudscape-design/components 3.0.361 → 3.0.363
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/index.d.ts.map +1 -1
- package/alert/index.js +21 -16
- package/alert/index.js.map +1 -1
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/visual-refresh/styles.css.js +69 -69
- package/app-layout/visual-refresh/styles.scoped.css +169 -169
- package/app-layout/visual-refresh/styles.selectors.js +69 -69
- package/area-chart/model/use-chart-model.js +1 -1
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/area-chart/styles.css.js +6 -6
- package/area-chart/styles.scoped.css +10 -10
- package/area-chart/styles.selectors.js +6 -6
- package/attribute-editor/styles.css.js +14 -14
- package/attribute-editor/styles.scoped.css +25 -25
- package/attribute-editor/styles.selectors.js +14 -14
- package/button-dropdown/category-elements/styles.css.js +13 -13
- package/button-dropdown/category-elements/styles.scoped.css +27 -27
- package/button-dropdown/category-elements/styles.selectors.js +13 -13
- package/button-dropdown/item-element/styles.css.js +15 -15
- package/button-dropdown/item-element/styles.scoped.css +19 -19
- package/button-dropdown/item-element/styles.selectors.js +15 -15
- package/button-dropdown/styles.css.js +14 -14
- package/button-dropdown/styles.scoped.css +22 -22
- package/button-dropdown/styles.selectors.js +14 -14
- package/code-editor/index.d.ts.map +1 -1
- package/code-editor/index.js +26 -71
- package/code-editor/index.js.map +1 -1
- package/code-editor/listeners.d.ts +1 -1
- package/code-editor/listeners.d.ts.map +1 -1
- package/code-editor/listeners.js.map +1 -1
- package/code-editor/setup-editor.d.ts.map +1 -1
- package/code-editor/setup-editor.js +39 -36
- package/code-editor/setup-editor.js.map +1 -1
- package/code-editor/styles.css.js +32 -32
- package/code-editor/styles.scoped.css +130 -130
- package/code-editor/styles.selectors.js +32 -32
- package/code-editor/use-editor.d.ts +24 -0
- package/code-editor/use-editor.d.ts.map +1 -0
- package/code-editor/use-editor.js +71 -0
- package/code-editor/use-editor.js.map +1 -0
- package/collection-preferences/content-display/styles.css.js +11 -11
- package/collection-preferences/content-display/styles.scoped.css +18 -18
- package/collection-preferences/content-display/styles.selectors.js +11 -11
- package/collection-preferences/styles.css.js +37 -37
- package/collection-preferences/styles.scoped.css +47 -47
- package/collection-preferences/styles.selectors.js +37 -37
- package/column-layout/flexible-column-layout/styles.css.js +5 -5
- package/column-layout/flexible-column-layout/styles.scoped.css +5 -5
- package/column-layout/flexible-column-layout/styles.selectors.js +5 -5
- package/column-layout/styles.css.js +13 -13
- package/column-layout/styles.scoped.css +46 -46
- package/column-layout/styles.selectors.js +13 -13
- package/container/styles.css.js +28 -28
- package/container/styles.scoped.css +55 -55
- package/container/styles.selectors.js +28 -28
- package/date-range-picker/styles.css.js +38 -38
- package/date-range-picker/styles.scoped.css +47 -47
- package/date-range-picker/styles.selectors.js +38 -38
- package/expandable-section/styles.css.js +29 -29
- package/expandable-section/styles.scoped.css +66 -66
- package/expandable-section/styles.selectors.js +29 -29
- package/form-field/internal.d.ts.map +1 -1
- package/form-field/internal.js +17 -12
- package/form-field/internal.js.map +1 -1
- package/form-field/styles.css.js +19 -19
- package/form-field/styles.scoped.css +30 -30
- package/form-field/styles.selectors.js +19 -19
- package/help-panel/styles.css.js +4 -4
- package/help-panel/styles.scoped.css +66 -66
- package/help-panel/styles.selectors.js +4 -4
- package/internal/base-component/styles.scoped.css +81 -57
- package/internal/components/chart-popover/index.d.ts.map +1 -1
- package/internal/components/chart-popover/index.js +1 -1
- package/internal/components/chart-popover/index.js.map +1 -1
- package/internal/components/dropdown-footer/styles.css.js +3 -3
- package/internal/components/dropdown-footer/styles.scoped.css +4 -4
- package/internal/components/dropdown-footer/styles.selectors.js +3 -3
- package/internal/components/selectable-item/styles.css.js +16 -16
- package/internal/components/selectable-item/styles.scoped.css +31 -31
- package/internal/components/selectable-item/styles.selectors.js +16 -16
- package/internal/components/token-list/styles.css.js +9 -9
- package/internal/components/token-list/styles.scoped.css +22 -22
- package/internal/components/token-list/styles.selectors.js +9 -9
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.js +1 -1
- package/internal/generated/theming/index.cjs +25 -23
- package/internal/generated/theming/index.js +25 -23
- package/internal/manifest.json +1 -1
- package/internal/plugins/api.d.ts +21 -25
- package/internal/plugins/api.d.ts.map +1 -1
- package/internal/plugins/api.js +15 -35
- package/internal/plugins/api.js.map +1 -1
- package/internal/plugins/controllers/action-buttons.d.ts +9 -0
- package/internal/plugins/controllers/action-buttons.d.ts.map +1 -1
- package/internal/plugins/controllers/action-buttons.js +11 -0
- package/internal/plugins/controllers/action-buttons.js.map +1 -1
- package/internal/plugins/controllers/drawers.d.ts +9 -0
- package/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/internal/plugins/controllers/drawers.js +11 -0
- package/internal/plugins/controllers/drawers.js.map +1 -1
- package/internal/utils/dom.d.ts +1 -8
- package/internal/utils/dom.d.ts.map +1 -1
- package/internal/utils/dom.js +1 -22
- package/internal/utils/dom.js.map +1 -1
- package/mixed-line-bar-chart/hooks/use-mouse-hover.js +1 -1
- package/mixed-line-bar-chart/hooks/use-mouse-hover.js.map +1 -1
- package/modal/styles.css.js +23 -23
- package/modal/styles.scoped.css +39 -39
- package/modal/styles.selectors.js +23 -23
- package/package.json +1 -1
- package/pie-chart/pie-chart.d.ts.map +1 -1
- package/pie-chart/pie-chart.js +1 -1
- package/pie-chart/pie-chart.js.map +1 -1
- package/pie-chart/styles.css.js +27 -27
- package/pie-chart/styles.scoped.css +43 -43
- package/pie-chart/styles.selectors.js +27 -27
- package/popover/container.d.ts.map +1 -1
- package/popover/container.js +3 -2
- package/popover/container.js.map +1 -1
- package/property-filter/styles.css.js +29 -29
- package/property-filter/styles.scoped.css +33 -33
- package/property-filter/styles.selectors.js +29 -29
- package/s3-resource-selector/s3-in-context/styles.css.js +7 -7
- package/s3-resource-selector/s3-in-context/styles.scoped.css +10 -10
- package/s3-resource-selector/s3-in-context/styles.selectors.js +7 -7
- package/side-navigation/styles.css.js +28 -28
- package/side-navigation/styles.scoped.css +43 -43
- package/side-navigation/styles.selectors.js +28 -28
- package/split-panel/styles.css.js +56 -56
- package/split-panel/styles.scoped.css +85 -85
- package/split-panel/styles.selectors.js +56 -56
- package/table/body-cell/styles.css.js +28 -28
- package/table/body-cell/styles.scoped.css +76 -76
- package/table/body-cell/styles.selectors.js +28 -28
- package/table/header-cell/styles.css.js +24 -24
- package/table/header-cell/styles.scoped.css +43 -43
- package/table/header-cell/styles.selectors.js +24 -24
- package/table/sticky-scrollbar/styles.css.js +6 -6
- package/table/sticky-scrollbar/styles.scoped.css +9 -9
- package/table/sticky-scrollbar/styles.selectors.js +6 -6
- package/table/styles.css.js +34 -34
- package/table/styles.scoped.css +42 -42
- package/table/styles.selectors.js +34 -34
- package/tabs/styles.css.js +21 -21
- package/tabs/styles.scoped.css +46 -46
- package/tabs/styles.selectors.js +21 -21
- package/tiles/styles.css.js +29 -29
- package/tiles/styles.scoped.css +73 -73
- package/tiles/styles.selectors.js +29 -29
- package/top-navigation/1.0-beta/styles.css.js +25 -25
- package/top-navigation/1.0-beta/styles.scoped.css +43 -43
- package/top-navigation/1.0-beta/styles.selectors.js +25 -25
- package/top-navigation/styles.css.js +47 -47
- package/top-navigation/styles.scoped.css +73 -73
- package/top-navigation/styles.selectors.js +47 -47
- package/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
- package/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +23 -23
- package/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
- package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/tutorial-panel/components/tutorial-list/styles.scoped.css +28 -28
- package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/wizard/styles.css.js +31 -31
- package/wizard/styles.scoped.css +63 -63
- package/wizard/styles.selectors.js +31 -31
|
@@ -94,10 +94,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
94
94
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
95
|
SPDX-License-Identifier: Apache-2.0
|
|
96
96
|
*/
|
|
97
|
-
.awsui_content-
|
|
98
|
-
animation: awsui_awsui-motion-fade-
|
|
97
|
+
.awsui_content-enter_gwq0h_17n0a_97:not(#\9) {
|
|
98
|
+
animation: awsui_awsui-motion-fade-in_gwq0h_17n0a_1 var(--motion-duration-show-paced-q2lo2h, 180ms) var(--motion-easing-show-paced-ne2o0s, ease-out);
|
|
99
99
|
}
|
|
100
|
-
@keyframes awsui_awsui-motion-fade-
|
|
100
|
+
@keyframes awsui_awsui-motion-fade-in_gwq0h_17n0a_1 {
|
|
101
101
|
from {
|
|
102
102
|
opacity: 0.2;
|
|
103
103
|
}
|
|
@@ -106,40 +106,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
@media (prefers-reduced-motion: reduce) {
|
|
109
|
-
.awsui_content-
|
|
109
|
+
.awsui_content-enter_gwq0h_17n0a_97:not(#\9) {
|
|
110
110
|
animation: none;
|
|
111
111
|
transition: none;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
.awsui-motion-disabled .awsui_content-
|
|
114
|
+
.awsui-motion-disabled .awsui_content-enter_gwq0h_17n0a_97:not(#\9), .awsui-mode-entering .awsui_content-enter_gwq0h_17n0a_97:not(#\9) {
|
|
115
115
|
animation: none;
|
|
116
116
|
transition: none;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.awsui_trigger-
|
|
119
|
+
.awsui_trigger-expanded_gwq0h_17n0a_119:not(#\9) {
|
|
120
120
|
transition: border-bottom-color var(--motion-duration-show-paced-q2lo2h, 180ms) var(--motion-easing-show-paced-ne2o0s, ease-out);
|
|
121
121
|
}
|
|
122
122
|
@media (prefers-reduced-motion: reduce) {
|
|
123
|
-
.awsui_trigger-
|
|
123
|
+
.awsui_trigger-expanded_gwq0h_17n0a_119:not(#\9) {
|
|
124
124
|
animation: none;
|
|
125
125
|
transition: none;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
.awsui-motion-disabled .awsui_trigger-
|
|
128
|
+
.awsui-motion-disabled .awsui_trigger-expanded_gwq0h_17n0a_119:not(#\9), .awsui-mode-entering .awsui_trigger-expanded_gwq0h_17n0a_119:not(#\9) {
|
|
129
129
|
animation: none;
|
|
130
130
|
transition: none;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.awsui_icon_gwq0h_17n0a_133:not(#\9) {
|
|
134
134
|
transition: transform var(--motion-duration-rotate-90-4ry26y, 135ms) var(--motion-easing-rotate-90-sb4dk7, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
135
135
|
}
|
|
136
136
|
@media (prefers-reduced-motion: reduce) {
|
|
137
|
-
.
|
|
137
|
+
.awsui_icon_gwq0h_17n0a_133:not(#\9) {
|
|
138
138
|
animation: none;
|
|
139
139
|
transition: none;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
.awsui-motion-disabled .
|
|
142
|
+
.awsui-motion-disabled .awsui_icon_gwq0h_17n0a_133:not(#\9), .awsui-mode-entering .awsui_icon_gwq0h_17n0a_133:not(#\9) {
|
|
143
143
|
animation: none;
|
|
144
144
|
transition: none;
|
|
145
145
|
}
|
|
@@ -148,7 +148,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
148
148
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
149
149
|
SPDX-License-Identifier: Apache-2.0
|
|
150
150
|
*/
|
|
151
|
-
.
|
|
151
|
+
.awsui_root_gwq0h_17n0a_151:not(#\9) {
|
|
152
152
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
153
153
|
border-collapse: separate;
|
|
154
154
|
border-spacing: 0;
|
|
@@ -191,114 +191,114 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
191
191
|
display: block;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
.awsui_expand-
|
|
194
|
+
.awsui_expand-button_gwq0h_17n0a_168:not(#\9) {
|
|
195
195
|
/* used in test-utils */
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.
|
|
198
|
+
.awsui_icon_gwq0h_17n0a_133:not(#\9) {
|
|
199
199
|
transform: rotate(-90deg);
|
|
200
200
|
}
|
|
201
|
-
.
|
|
201
|
+
.awsui_icon_gwq0h_17n0a_133.awsui_expanded_gwq0h_17n0a_175:not(#\9) {
|
|
202
202
|
transform: rotate(0deg);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
.awsui_icon-
|
|
205
|
+
.awsui_icon-container_gwq0h_17n0a_179:not(#\9) {
|
|
206
206
|
position: relative;
|
|
207
207
|
margin-left: calc((var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / -2);
|
|
208
208
|
margin-right: calc(var(--space-xxs-p8yyaw, 4px) + var(--border-divider-list-width-27y3k5, 1px));
|
|
209
209
|
}
|
|
210
|
-
.awsui_icon-container-
|
|
210
|
+
.awsui_icon-container-container_gwq0h_17n0a_184:not(#\9) {
|
|
211
211
|
margin-right: var(--space-xs-zb16t3, 8px);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
.
|
|
214
|
+
.awsui_wrapper_gwq0h_17n0a_188:not(#\9) {
|
|
215
215
|
box-sizing: border-box;
|
|
216
216
|
border: none;
|
|
217
217
|
width: 100%;
|
|
218
218
|
line-height: var(--font-body-m-line-height-5wv9x1, 20px);
|
|
219
219
|
text-align: left;
|
|
220
220
|
}
|
|
221
|
-
.awsui_wrapper-
|
|
222
|
-
border: var(--border-divider-section-width-
|
|
221
|
+
.awsui_wrapper-default_gwq0h_17n0a_195:not(#\9), .awsui_wrapper-footer_gwq0h_17n0a_195:not(#\9) {
|
|
222
|
+
border: var(--border-divider-section-width-8a5uu9, 2px) solid transparent;
|
|
223
223
|
}
|
|
224
|
-
.awsui_wrapper-
|
|
225
|
-
border-left: var(--border-divider-section-width-
|
|
224
|
+
.awsui_wrapper-navigation_gwq0h_17n0a_198:not(#\9) {
|
|
225
|
+
border-left: var(--border-divider-section-width-8a5uu9, 2px) solid transparent;
|
|
226
226
|
}
|
|
227
|
-
.awsui_wrapper-
|
|
227
|
+
.awsui_wrapper-navigation_gwq0h_17n0a_198:not(#\9), .awsui_wrapper-container_gwq0h_17n0a_201:not(#\9) {
|
|
228
228
|
display: flex;
|
|
229
229
|
font-weight: var(--font-heading-s-weight-02hnau, 700);
|
|
230
230
|
}
|
|
231
|
-
.awsui_wrapper-
|
|
232
|
-
color: var(--color-text-expandable-section-default-
|
|
231
|
+
.awsui_wrapper-default_gwq0h_17n0a_195:not(#\9), .awsui_wrapper-navigation_gwq0h_17n0a_198:not(#\9), .awsui_wrapper-footer_gwq0h_17n0a_195:not(#\9) {
|
|
232
|
+
color: var(--color-text-expandable-section-default-lm3qgp, #000716);
|
|
233
233
|
-webkit-font-smoothing: var(--font-smoothing-webkit-m8nc84, antialiased);
|
|
234
234
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-foywby, grayscale);
|
|
235
|
-
font-size: var(--font-expandable-heading-size-
|
|
235
|
+
font-size: var(--font-expandable-heading-size-smdiul, 16px);
|
|
236
236
|
letter-spacing: var(--font-heading-s-letter-spacing-ebpsb6, -0.005em);
|
|
237
237
|
}
|
|
238
|
-
.awsui_wrapper-
|
|
238
|
+
.awsui_wrapper-default_gwq0h_17n0a_195:not(#\9) {
|
|
239
239
|
padding-top: var(--space-scaled-xxs-7597g1, 4px);
|
|
240
240
|
padding-bottom: var(--space-scaled-xxs-7597g1, 4px);
|
|
241
241
|
padding-right: var(--space-xxs-p8yyaw, 4px);
|
|
242
242
|
}
|
|
243
|
-
.awsui_wrapper-
|
|
243
|
+
.awsui_wrapper-default_gwq0h_17n0a_195.awsui_header-deprecated_gwq0h_17n0a_217:not(#\9) {
|
|
244
244
|
padding-left: var(--space-xxs-p8yyaw, 4px);
|
|
245
245
|
}
|
|
246
|
-
.awsui_wrapper-
|
|
246
|
+
.awsui_wrapper-default_gwq0h_17n0a_195:not(#\9):not(.awsui_header-deprecated_gwq0h_17n0a_217) {
|
|
247
247
|
padding-left: calc(var(--space-xxs-p8yyaw, 4px) + calc(var(--size-icon-normal-0m1722, 16px) + (var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / -2 + var(--space-xxs-p8yyaw, 4px) + var(--border-divider-list-width-27y3k5, 1px)));
|
|
248
248
|
}
|
|
249
|
-
.awsui_wrapper-
|
|
249
|
+
.awsui_wrapper-footer_gwq0h_17n0a_195:not(#\9) {
|
|
250
250
|
padding-top: var(--space-scaled-xxs-7597g1, 4px);
|
|
251
251
|
padding-bottom: var(--space-scaled-xxs-7597g1, 4px);
|
|
252
252
|
padding-right: 0;
|
|
253
253
|
}
|
|
254
|
-
.awsui_wrapper-
|
|
254
|
+
.awsui_wrapper-footer_gwq0h_17n0a_195.awsui_header-deprecated_gwq0h_17n0a_217:not(#\9) {
|
|
255
255
|
padding-left: 0;
|
|
256
256
|
}
|
|
257
|
-
.awsui_wrapper-
|
|
257
|
+
.awsui_wrapper-footer_gwq0h_17n0a_195:not(#\9):not(.awsui_header-deprecated_gwq0h_17n0a_217) {
|
|
258
258
|
padding-left: calc(var(--size-icon-normal-0m1722, 16px) + (var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / -2 + var(--space-xxs-p8yyaw, 4px) + var(--border-divider-list-width-27y3k5, 1px));
|
|
259
259
|
}
|
|
260
|
-
.awsui_wrapper-
|
|
260
|
+
.awsui_wrapper-container_gwq0h_17n0a_201:not(#\9) {
|
|
261
261
|
padding-top: var(--space-container-header-top-5qav00, 12px);
|
|
262
262
|
padding-bottom: var(--space-container-header-bottom-vj01hn, 8px);
|
|
263
263
|
padding-right: var(--space-container-horizontal-wfukh3, 20px);
|
|
264
264
|
}
|
|
265
|
-
.awsui_wrapper-
|
|
265
|
+
.awsui_wrapper-container_gwq0h_17n0a_201:not(#\9):not(.awsui_wrapper-expanded_gwq0h_17n0a_239) {
|
|
266
266
|
padding-bottom: var(--space-container-header-top-5qav00, 12px);
|
|
267
267
|
}
|
|
268
|
-
.awsui_wrapper-
|
|
268
|
+
.awsui_wrapper-container_gwq0h_17n0a_201.awsui_header-deprecated_gwq0h_17n0a_217:not(#\9) {
|
|
269
269
|
padding-left: var(--space-container-horizontal-wfukh3, 20px);
|
|
270
270
|
}
|
|
271
|
-
.awsui_wrapper-
|
|
271
|
+
.awsui_wrapper-container_gwq0h_17n0a_201:not(#\9):not(.awsui_header-deprecated_gwq0h_17n0a_217) {
|
|
272
272
|
padding-left: calc(var(--space-container-horizontal-wfukh3, 20px) + calc(var(--size-icon-medium-y9xuoq, 20px) + (var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / -2 + var(--space-xs-zb16t3, 8px)));
|
|
273
273
|
}
|
|
274
|
-
body[data-awsui-focus-visible=true] .awsui_wrapper-
|
|
275
|
-
padding: calc(var(--space-scaled-s-aqzyko, 12px) - var(--border-divider-section-width-
|
|
274
|
+
body[data-awsui-focus-visible=true] .awsui_wrapper-container_gwq0h_17n0a_201:not(#\9):focus {
|
|
275
|
+
padding: calc(var(--space-scaled-s-aqzyko, 12px) - var(--border-divider-section-width-8a5uu9, 2px)) calc(var(--space-l-t419sm, 20px) - var(--border-divider-section-width-8a5uu9, 2px));
|
|
276
276
|
}
|
|
277
|
-
.awsui_wrapper-
|
|
278
|
-
border-bottom-color: var(--color-border-divider-default-
|
|
277
|
+
.awsui_wrapper-default_gwq0h_17n0a_195.awsui_wrapper-expanded_gwq0h_17n0a_239:not(#\9) {
|
|
278
|
+
border-bottom-color: var(--color-border-divider-default-et9j7s, #e9ebed);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
.
|
|
281
|
+
.awsui_header_gwq0h_17n0a_217:not(#\9) {
|
|
282
282
|
/* used in test-utils */
|
|
283
283
|
}
|
|
284
|
-
.awsui_header-
|
|
284
|
+
.awsui_header-wrapper_gwq0h_17n0a_258:not(#\9), .awsui_header-deprecated_gwq0h_17n0a_217:not(#\9) {
|
|
285
285
|
display: flex;
|
|
286
286
|
font-weight: var(--font-heading-s-weight-02hnau, 700);
|
|
287
287
|
}
|
|
288
|
-
.awsui_header-
|
|
288
|
+
.awsui_header-wrapper_gwq0h_17n0a_258:not(#\9) {
|
|
289
289
|
font-size: inherit;
|
|
290
290
|
letter-spacing: inherit;
|
|
291
291
|
margin: 0;
|
|
292
292
|
padding: 0;
|
|
293
293
|
}
|
|
294
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
294
|
+
body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_17n0a_268:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_17n0a_268:not(#\9):focus {
|
|
295
295
|
position: relative;
|
|
296
296
|
}
|
|
297
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
297
|
+
body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_17n0a_268:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_17n0a_268:not(#\9):focus {
|
|
298
298
|
outline: 2px dotted transparent;
|
|
299
299
|
outline-offset: calc(0px - 1px);
|
|
300
300
|
}
|
|
301
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
301
|
+
body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_17n0a_268:not(#\9):focus::before, body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_17n0a_268:not(#\9):focus::before {
|
|
302
302
|
content: " ";
|
|
303
303
|
display: block;
|
|
304
304
|
position: absolute;
|
|
@@ -309,21 +309,21 @@ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_xgtm9_268:not(#\9
|
|
|
309
309
|
border-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
310
310
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
311
311
|
}
|
|
312
|
-
.awsui_header-
|
|
312
|
+
.awsui_header-button_gwq0h_17n0a_268:not(#\9) {
|
|
313
313
|
box-sizing: border-box;
|
|
314
314
|
display: flex;
|
|
315
315
|
margin-left: calc(-1 * calc(var(--size-icon-normal-0m1722, 16px) + (var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / -2 + var(--space-xxs-p8yyaw, 4px) + var(--border-divider-list-width-27y3k5, 1px)));
|
|
316
316
|
}
|
|
317
|
-
.awsui_header-container-
|
|
317
|
+
.awsui_header-container-button_gwq0h_17n0a_268:not(#\9) {
|
|
318
318
|
margin-left: calc(-1 * calc(var(--size-icon-medium-y9xuoq, 20px) + (var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / -2 + var(--space-xs-zb16t3, 8px)));
|
|
319
319
|
}
|
|
320
|
-
.awsui_header-
|
|
320
|
+
.awsui_header-container_gwq0h_17n0a_268:not(#\9) {
|
|
321
321
|
width: 100%;
|
|
322
322
|
}
|
|
323
|
-
.awsui_header-
|
|
323
|
+
.awsui_header-container_gwq0h_17n0a_268 > .awsui_icon-container_gwq0h_17n0a_179:not(#\9) {
|
|
324
324
|
margin-top: var(--space-expandable-section-icon-offset-top-ekk5vc, 4px);
|
|
325
325
|
}
|
|
326
|
-
.awsui_header-
|
|
326
|
+
.awsui_header-navigation_gwq0h_17n0a_300 > .awsui_icon-container_gwq0h_17n0a_179:not(#\9) {
|
|
327
327
|
display: inline-flex;
|
|
328
328
|
cursor: pointer;
|
|
329
329
|
color: var(--color-text-expandable-section-navigation-icon-default-htcovl, #414d5c);
|
|
@@ -334,17 +334,17 @@ body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_xgtm9_268:not(#\9
|
|
|
334
334
|
text-decoration: none;
|
|
335
335
|
flex-direction: column;
|
|
336
336
|
}
|
|
337
|
-
.awsui_header-
|
|
338
|
-
color: var(--color-text-expandable-section-hover-
|
|
337
|
+
.awsui_header-navigation_gwq0h_17n0a_300 > .awsui_icon-container_gwq0h_17n0a_179:not(#\9):hover {
|
|
338
|
+
color: var(--color-text-expandable-section-hover-2d1zpj, #0972d3);
|
|
339
339
|
}
|
|
340
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
340
|
+
body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_17n0a_300 > .awsui_icon-container_gwq0h_17n0a_179:not(#\9):focus {
|
|
341
341
|
position: relative;
|
|
342
342
|
}
|
|
343
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
343
|
+
body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_17n0a_300 > .awsui_icon-container_gwq0h_17n0a_179:not(#\9):focus {
|
|
344
344
|
outline: 2px dotted transparent;
|
|
345
345
|
outline-offset: calc(2px - 1px);
|
|
346
346
|
}
|
|
347
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
347
|
+
body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_17n0a_300 > .awsui_icon-container_gwq0h_17n0a_179:not(#\9):focus::before {
|
|
348
348
|
content: " ";
|
|
349
349
|
display: block;
|
|
350
350
|
position: absolute;
|
|
@@ -355,37 +355,37 @@ body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_xgtm9_300 > .
|
|
|
355
355
|
border-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
356
356
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
357
357
|
}
|
|
358
|
-
.awsui_header-
|
|
358
|
+
.awsui_header-text_gwq0h_17n0a_332:not(#\9) {
|
|
359
359
|
/* used in test-utils */
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
.
|
|
362
|
+
.awsui_content_gwq0h_17n0a_97:not(#\9) {
|
|
363
363
|
display: none;
|
|
364
364
|
}
|
|
365
|
-
.awsui_content-
|
|
365
|
+
.awsui_content-default_gwq0h_17n0a_339:not(#\9) {
|
|
366
366
|
padding: var(--space-scaled-xs-26e2du, 8px) 0;
|
|
367
367
|
}
|
|
368
|
-
.awsui_content-
|
|
368
|
+
.awsui_content-footer_gwq0h_17n0a_342:not(#\9) {
|
|
369
369
|
padding: var(--space-xs-zb16t3, 8px) 0;
|
|
370
370
|
}
|
|
371
|
-
.awsui_content-
|
|
371
|
+
.awsui_content-expanded_gwq0h_17n0a_345:not(#\9) {
|
|
372
372
|
display: block;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
.
|
|
375
|
+
.awsui_focusable_gwq0h_17n0a_349:not(#\9):focus {
|
|
376
376
|
outline: none;
|
|
377
377
|
text-decoration: none;
|
|
378
378
|
}
|
|
379
|
-
body[data-awsui-focus-visible=true] .
|
|
379
|
+
body[data-awsui-focus-visible=true] .awsui_focusable_gwq0h_17n0a_349:not(#\9):focus {
|
|
380
380
|
outline: 2px dotted transparent;
|
|
381
381
|
border: var(--border-field-width-09w7vk, 2px) solid var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
382
382
|
border-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
383
383
|
box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
.awsui_click-
|
|
386
|
+
.awsui_click-target_gwq0h_17n0a_360:not(#\9) {
|
|
387
387
|
cursor: pointer;
|
|
388
388
|
}
|
|
389
|
-
.awsui_click-
|
|
390
|
-
color: var(--color-text-expandable-section-hover-
|
|
389
|
+
.awsui_click-target_gwq0h_17n0a_360:not(#\9):not(.awsui_wrapper-container_gwq0h_17n0a_201):not(.awsui_header-container-button_gwq0h_17n0a_268):hover {
|
|
390
|
+
color: var(--color-text-expandable-section-hover-2d1zpj, #0972d3);
|
|
391
391
|
}
|
|
@@ -2,34 +2,34 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"content-enter": "awsui_content-
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"trigger-expanded": "awsui_trigger-
|
|
8
|
-
"icon": "
|
|
9
|
-
"root": "
|
|
10
|
-
"expand-button": "awsui_expand-
|
|
11
|
-
"expanded": "
|
|
12
|
-
"icon-container": "awsui_icon-
|
|
13
|
-
"icon-container-container": "awsui_icon-container-
|
|
14
|
-
"wrapper": "
|
|
15
|
-
"wrapper-default": "awsui_wrapper-
|
|
16
|
-
"wrapper-footer": "awsui_wrapper-
|
|
17
|
-
"wrapper-navigation": "awsui_wrapper-
|
|
18
|
-
"wrapper-container": "awsui_wrapper-
|
|
19
|
-
"header-deprecated": "awsui_header-
|
|
20
|
-
"wrapper-expanded": "awsui_wrapper-
|
|
21
|
-
"header": "
|
|
22
|
-
"header-wrapper": "awsui_header-
|
|
23
|
-
"header-button": "awsui_header-
|
|
24
|
-
"header-container-button": "awsui_header-container-
|
|
25
|
-
"header-container": "awsui_header-
|
|
26
|
-
"header-navigation": "awsui_header-
|
|
27
|
-
"header-text": "awsui_header-
|
|
28
|
-
"content": "
|
|
29
|
-
"content-default": "awsui_content-
|
|
30
|
-
"content-footer": "awsui_content-
|
|
31
|
-
"content-expanded": "awsui_content-
|
|
32
|
-
"focusable": "
|
|
33
|
-
"click-target": "awsui_click-
|
|
5
|
+
"content-enter": "awsui_content-enter_gwq0h_17n0a_97",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_17n0a_1",
|
|
7
|
+
"trigger-expanded": "awsui_trigger-expanded_gwq0h_17n0a_119",
|
|
8
|
+
"icon": "awsui_icon_gwq0h_17n0a_133",
|
|
9
|
+
"root": "awsui_root_gwq0h_17n0a_151",
|
|
10
|
+
"expand-button": "awsui_expand-button_gwq0h_17n0a_168",
|
|
11
|
+
"expanded": "awsui_expanded_gwq0h_17n0a_175",
|
|
12
|
+
"icon-container": "awsui_icon-container_gwq0h_17n0a_179",
|
|
13
|
+
"icon-container-container": "awsui_icon-container-container_gwq0h_17n0a_184",
|
|
14
|
+
"wrapper": "awsui_wrapper_gwq0h_17n0a_188",
|
|
15
|
+
"wrapper-default": "awsui_wrapper-default_gwq0h_17n0a_195",
|
|
16
|
+
"wrapper-footer": "awsui_wrapper-footer_gwq0h_17n0a_195",
|
|
17
|
+
"wrapper-navigation": "awsui_wrapper-navigation_gwq0h_17n0a_198",
|
|
18
|
+
"wrapper-container": "awsui_wrapper-container_gwq0h_17n0a_201",
|
|
19
|
+
"header-deprecated": "awsui_header-deprecated_gwq0h_17n0a_217",
|
|
20
|
+
"wrapper-expanded": "awsui_wrapper-expanded_gwq0h_17n0a_239",
|
|
21
|
+
"header": "awsui_header_gwq0h_17n0a_217",
|
|
22
|
+
"header-wrapper": "awsui_header-wrapper_gwq0h_17n0a_258",
|
|
23
|
+
"header-button": "awsui_header-button_gwq0h_17n0a_268",
|
|
24
|
+
"header-container-button": "awsui_header-container-button_gwq0h_17n0a_268",
|
|
25
|
+
"header-container": "awsui_header-container_gwq0h_17n0a_268",
|
|
26
|
+
"header-navigation": "awsui_header-navigation_gwq0h_17n0a_300",
|
|
27
|
+
"header-text": "awsui_header-text_gwq0h_17n0a_332",
|
|
28
|
+
"content": "awsui_content_gwq0h_17n0a_97",
|
|
29
|
+
"content-default": "awsui_content-default_gwq0h_17n0a_339",
|
|
30
|
+
"content-footer": "awsui_content-footer_gwq0h_17n0a_342",
|
|
31
|
+
"content-expanded": "awsui_content-expanded_gwq0h_17n0a_345",
|
|
32
|
+
"focusable": "awsui_focusable_gwq0h_17n0a_349",
|
|
33
|
+
"click-target": "awsui_click-target_gwq0h_17n0a_360"
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["form-field/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAazC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAetD,UAAU,mBAAmB;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,eAiBvF;AAED,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,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,iBAAwB,EACxB,gBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["form-field/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAazC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAetD,UAAU,mBAAmB;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,eAiBvF;AAED,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,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,iBAAwB,EACxB,gBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,sBAAsB,eAgIxB"}
|
package/form-field/internal.js
CHANGED
|
@@ -52,22 +52,27 @@ export default function InternalFormField(_a) {
|
|
|
52
52
|
[DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : undefined,
|
|
53
53
|
};
|
|
54
54
|
useEffect(() => {
|
|
55
|
+
var _a, _b, _c;
|
|
55
56
|
if (funnelInteractionId && errorText && funnelState.current !== 'complete') {
|
|
56
57
|
const stepName = getNameFromSelector(stepNameSelector);
|
|
57
58
|
const subStepName = getNameFromSelector(subStepNameSelector);
|
|
58
59
|
errorCount.current++;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
// We don't want to report an error if it is hidden, e.g. inside an Expandable Section.
|
|
61
|
+
const errorIsVisible = ((_c = (_b = (_a = __internalRootRef === null || __internalRootRef === void 0 ? void 0 : __internalRootRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 0) > 0;
|
|
62
|
+
if (errorIsVisible) {
|
|
63
|
+
FunnelMetrics.funnelSubStepError({
|
|
64
|
+
funnelInteractionId,
|
|
65
|
+
subStepSelector,
|
|
66
|
+
subStepName,
|
|
67
|
+
subStepNameSelector,
|
|
68
|
+
stepNumber,
|
|
69
|
+
stepName,
|
|
70
|
+
stepNameSelector,
|
|
71
|
+
fieldErrorSelector: getFieldSlotSeletor(slotIds.error),
|
|
72
|
+
fieldLabelSelector: getFieldSlotSeletor(slotIds.label),
|
|
73
|
+
subStepAllSelector: getSubStepAllSelector(),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
71
76
|
return () => {
|
|
72
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
78
|
errorCount.current--;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["form-field/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE3E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OA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AE,EAAE,OAAO,CAAC,KAAK,EAAE,kBAAkB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,kBAAkB,IACnF,SAAS,CACK,CAClB;YACA,cAAc,IAAI,CACjB,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,IAC1D,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 } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nimport InternalGrid from '../grid/internal';\nimport InternalIcon from '../icon/internal';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport styles from './styles.css.js';\nimport { InternalFormFieldProps } from './interfaces';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\n\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 getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n\n return (\n <div id={id} className={styles.error}>\n <div className={styles['error-icon-shake-wrapper']}>\n <div\n role=\"img\"\n aria-label={i18n('i18nStrings.errorIconAriaLabel', errorIconAriaLabel)}\n className={styles['error-icon-scale-wrapper']}\n >\n <InternalIcon name=\"status-warning\" size=\"small\" />\n </div>\n </div>\n <span className={styles.error__message}>{children}</span>\n </div>\n );\n}\n\nexport function ConstraintText({\n id,\n hasError,\n children,\n}: {\n id?: string;\n hasError: boolean;\n children: React.ReactNode;\n}) {\n return (\n <div id={id} className={clsx(styles.constraint, hasError && styles['constraint-has-error'])}>\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 __hideLabel,\n __internalRootRef = null,\n __disableGutters = false,\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 { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const slotIds = getSlotIds(formFieldId, label, description, constraintText, errorText);\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 } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!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 = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n fieldErrorSelector: getFieldSlotSeletor(slotIds.error),\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\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 ref={__internalRootRef}\n {...analyticsAttributes}\n >\n <div className={clsx(__hideLabel && styles['visually-hidden'])}>\n {label && (\n <label className={styles.label} id={slotIds.label} htmlFor={generatedControlId}>\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) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={slotIds.error} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {constraintText && (\n <ConstraintText id={slotIds.constraint} hasError={!!errorText}>\n {constraintText}\n </ConstraintText>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["form-field/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE3E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,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,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAQzC,MAAM,UAAU,cAAc,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAuB;IACtF,MAAM,IAAI,GAAG,e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EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,IAC1D,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 } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nimport InternalGrid from '../grid/internal';\nimport InternalIcon from '../icon/internal';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport styles from './styles.css.js';\nimport { InternalFormFieldProps } from './interfaces';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\n\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 getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n\n return (\n <div id={id} className={styles.error}>\n <div className={styles['error-icon-shake-wrapper']}>\n <div\n role=\"img\"\n aria-label={i18n('i18nStrings.errorIconAriaLabel', errorIconAriaLabel)}\n className={styles['error-icon-scale-wrapper']}\n >\n <InternalIcon name=\"status-warning\" size=\"small\" />\n </div>\n </div>\n <span className={styles.error__message}>{children}</span>\n </div>\n );\n}\n\nexport function ConstraintText({\n id,\n hasError,\n children,\n}: {\n id?: string;\n hasError: boolean;\n children: React.ReactNode;\n}) {\n return (\n <div id={id} className={clsx(styles.constraint, hasError && styles['constraint-has-error'])}>\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 __hideLabel,\n __internalRootRef = null,\n __disableGutters = false,\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 { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const slotIds = getSlotIds(formFieldId, label, description, constraintText, errorText);\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 } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!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 = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(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 subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n fieldErrorSelector: getFieldSlotSeletor(slotIds.error),\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\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 ref={__internalRootRef}\n {...analyticsAttributes}\n >\n <div className={clsx(__hideLabel && styles['visually-hidden'])}>\n {label && (\n <label className={styles.label} id={slotIds.label} htmlFor={generatedControlId}>\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) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={slotIds.error} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {constraintText && (\n <ConstraintText id={slotIds.constraint} hasError={!!errorText}>\n {constraintText}\n </ConstraintText>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
package/form-field/styles.css.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"error-icon-shake-wrapper": "awsui_error-icon-shake-
|
|
5
|
-
"awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-
|
|
6
|
-
"error-icon-scale-wrapper": "awsui_error-icon-scale-
|
|
7
|
-
"awsui-motion-scale-popup": "awsui_awsui-motion-scale-
|
|
8
|
-
"error": "
|
|
9
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
10
|
-
"root": "
|
|
11
|
-
"label": "
|
|
12
|
-
"info": "
|
|
13
|
-
"description": "
|
|
14
|
-
"constraint": "
|
|
15
|
-
"hints": "
|
|
16
|
-
"constraint-has-error": "awsui_constraint-has-
|
|
17
|
-
"secondary-control": "awsui_secondary-
|
|
18
|
-
"controls": "
|
|
19
|
-
"label-hidden": "awsui_label-
|
|
20
|
-
"control": "
|
|
21
|
-
"error__message": "
|
|
22
|
-
"visually-hidden": "awsui_visually-
|
|
4
|
+
"error-icon-shake-wrapper": "awsui_error-icon-shake-wrapper_14mhv_1i80l_97",
|
|
5
|
+
"awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_14mhv_1i80l_1",
|
|
6
|
+
"error-icon-scale-wrapper": "awsui_error-icon-scale-wrapper_14mhv_1i80l_124",
|
|
7
|
+
"awsui-motion-scale-popup": "awsui_awsui-motion-scale-popup_14mhv_1i80l_1",
|
|
8
|
+
"error": "awsui_error_14mhv_1i80l_97",
|
|
9
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_14mhv_1i80l_1",
|
|
10
|
+
"root": "awsui_root_14mhv_1i80l_168",
|
|
11
|
+
"label": "awsui_label_14mhv_1i80l_182",
|
|
12
|
+
"info": "awsui_info_14mhv_1i80l_195",
|
|
13
|
+
"description": "awsui_description_14mhv_1i80l_200",
|
|
14
|
+
"constraint": "awsui_constraint_14mhv_1i80l_201",
|
|
15
|
+
"hints": "awsui_hints_14mhv_1i80l_208",
|
|
16
|
+
"constraint-has-error": "awsui_constraint-has-error_14mhv_1i80l_209",
|
|
17
|
+
"secondary-control": "awsui_secondary-control_14mhv_1i80l_213",
|
|
18
|
+
"controls": "awsui_controls_14mhv_1i80l_217",
|
|
19
|
+
"label-hidden": "awsui_label-hidden_14mhv_1i80l_217",
|
|
20
|
+
"control": "awsui_control_14mhv_1i80l_217",
|
|
21
|
+
"error__message": "awsui_error__message_14mhv_1i80l_236",
|
|
22
|
+
"visually-hidden": "awsui_visually-hidden_14mhv_1i80l_240"
|
|
23
23
|
};
|
|
24
24
|
|