@cloudscape-design/components 3.0.311 → 3.0.312
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/code-editor/resizable-box/styles.css.js +3 -3
- package/code-editor/resizable-box/styles.scoped.css +10 -8
- package/code-editor/resizable-box/styles.selectors.js +3 -3
- package/code-editor/styles.css.js +32 -32
- package/code-editor/styles.scoped.css +189 -157
- package/code-editor/styles.selectors.js +32 -32
- package/container/interfaces.d.ts +50 -0
- package/container/interfaces.d.ts.map +1 -1
- package/container/interfaces.js.map +1 -1
- package/container/internal.d.ts +1 -1
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +24 -18
- package/container/internal.js.map +1 -1
- package/container/styles.css.js +28 -18
- package/container/styles.scoped.css +93 -36
- package/container/styles.selectors.js +28 -18
- package/expandable-section/expandable-section-header.d.ts +2 -1
- package/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/expandable-section/expandable-section-header.js +6 -16
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/expandable-section/internal.d.ts.map +1 -1
- package/expandable-section/internal.js +3 -2
- package/expandable-section/internal.js.map +1 -1
- package/help-panel/styles.css.js +4 -4
- package/help-panel/styles.scoped.css +135 -95
- package/help-panel/styles.selectors.js +4 -4
- package/i18n/provider.d.ts.map +1 -1
- package/i18n/provider.js +2 -0
- package/i18n/provider.js.map +1 -1
- package/internal/base-component/styles.scoped.css +382 -379
- package/internal/environment.js +1 -1
- package/internal/generated/theming/index.cjs +2 -1
- package/internal/generated/theming/index.js +2 -1
- package/internal/hooks/use-visual-mode/index.d.ts.map +1 -1
- package/internal/hooks/use-visual-mode/index.js +3 -0
- package/internal/hooks/use-visual-mode/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/test-utils/dom/container/index.d.ts +1 -0
- package/test-utils/dom/container/index.js +3 -0
- package/test-utils/dom/container/index.js.map +1 -1
- package/test-utils/dom/expandable-section/index.js +1 -1
- package/test-utils/dom/expandable-section/index.js.map +1 -1
- package/test-utils/selectors/container/index.d.ts +1 -0
- package/test-utils/selectors/container/index.js +3 -0
- package/test-utils/selectors/container/index.js.map +1 -1
- package/test-utils/selectors/expandable-section/index.js +1 -1
- package/test-utils/selectors/expandable-section/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +65 -64
- package/text-content/styles.selectors.js +1 -1
|
@@ -91,7 +91,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
93
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
94
|
-
.awsui_help-
|
|
94
|
+
.awsui_help-panel_1d237_1wbpo_94:not(#\9) {
|
|
95
95
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
96
96
|
border-collapse: separate;
|
|
97
97
|
border-spacing: 0;
|
|
@@ -131,32 +131,32 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
131
131
|
word-wrap: break-word;
|
|
132
132
|
padding: var(--space-scaled-l-2rs0gk, 20px) var(--space-panel-side-right-zzgkuy, 24px) 0 var(--space-panel-side-left-ob0rxs, 28px);
|
|
133
133
|
}
|
|
134
|
-
.awsui_help-
|
|
134
|
+
.awsui_help-panel_1d237_1wbpo_94 hr:not(#\9) {
|
|
135
135
|
border: none;
|
|
136
136
|
border-top: var(--border-divider-section-width-orq175, 2px) solid var(--color-border-divider-default-9o8zql, #e9ebed);
|
|
137
137
|
margin: var(--space-scaled-xl-jawob6, 24px) calc(-1 * var(--space-xs-edba2s, 8px));
|
|
138
138
|
}
|
|
139
|
-
.awsui_help-
|
|
140
|
-
.awsui_help-
|
|
139
|
+
.awsui_help-panel_1d237_1wbpo_94 ol:not(#\9),
|
|
140
|
+
.awsui_help-panel_1d237_1wbpo_94 ul:not(#\9) {
|
|
141
141
|
padding-left: var(--space-l-f4l5gr, 20px);
|
|
142
142
|
list-style-position: outside;
|
|
143
143
|
}
|
|
144
|
-
.awsui_help-
|
|
145
|
-
.awsui_help-
|
|
146
|
-
.awsui_help-
|
|
147
|
-
.awsui_help-
|
|
148
|
-
.awsui_help-
|
|
149
|
-
.awsui_help-
|
|
150
|
-
.awsui_help-
|
|
151
|
-
.awsui_help-
|
|
152
|
-
.awsui_help-
|
|
153
|
-
.awsui_help-
|
|
154
|
-
.awsui_help-
|
|
144
|
+
.awsui_help-panel_1d237_1wbpo_94 a:not(#\9),
|
|
145
|
+
.awsui_help-panel_1d237_1wbpo_94 p:not(#\9),
|
|
146
|
+
.awsui_help-panel_1d237_1wbpo_94 ul:not(#\9),
|
|
147
|
+
.awsui_help-panel_1d237_1wbpo_94 ol:not(#\9),
|
|
148
|
+
.awsui_help-panel_1d237_1wbpo_94 li:not(#\9),
|
|
149
|
+
.awsui_help-panel_1d237_1wbpo_94 h2:not(#\9),
|
|
150
|
+
.awsui_help-panel_1d237_1wbpo_94 h3:not(#\9),
|
|
151
|
+
.awsui_help-panel_1d237_1wbpo_94 h4:not(#\9),
|
|
152
|
+
.awsui_help-panel_1d237_1wbpo_94 h5:not(#\9),
|
|
153
|
+
.awsui_help-panel_1d237_1wbpo_94 pre:not(#\9),
|
|
154
|
+
.awsui_help-panel_1d237_1wbpo_94 code:not(#\9) {
|
|
155
155
|
margin: var(--space-xs-edba2s, 8px) 0;
|
|
156
156
|
padding-top: 0;
|
|
157
157
|
padding-bottom: 0;
|
|
158
158
|
}
|
|
159
|
-
.awsui_help-
|
|
159
|
+
.awsui_help-panel_1d237_1wbpo_94 code:not(#\9) {
|
|
160
160
|
font-size: var(--font-body-s-size-6jmxer, 12px);
|
|
161
161
|
line-height: var(--font-body-s-line-height-ga8tt7, 16px);
|
|
162
162
|
letter-spacing: var(--font-body-s-letter-spacing-v8bwhi, 0.005em);
|
|
@@ -166,7 +166,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
166
166
|
word-wrap: break-word;
|
|
167
167
|
white-space: pre-wrap;
|
|
168
168
|
}
|
|
169
|
-
.awsui_help-
|
|
169
|
+
.awsui_help-panel_1d237_1wbpo_94 pre:not(#\9) {
|
|
170
170
|
font-size: var(--font-body-s-size-6jmxer, 12px);
|
|
171
171
|
line-height: var(--font-body-s-line-height-ga8tt7, 16px);
|
|
172
172
|
letter-spacing: var(--font-body-s-letter-spacing-v8bwhi, 0.005em);
|
|
@@ -177,37 +177,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
177
177
|
white-space: pre-wrap;
|
|
178
178
|
padding: var(--space-xxs-ja5cp8, 4px);
|
|
179
179
|
}
|
|
180
|
-
.awsui_help-
|
|
180
|
+
.awsui_help-panel_1d237_1wbpo_94 dl:not(#\9) {
|
|
181
181
|
margin: var(--space-xs-edba2s, 8px) 0;
|
|
182
182
|
/* stylelint-disable-next-line selector-max-universal */
|
|
183
183
|
}
|
|
184
|
-
.awsui_help-
|
|
184
|
+
.awsui_help-panel_1d237_1wbpo_94 dl *:not(#\9) {
|
|
185
185
|
margin-top: 0;
|
|
186
186
|
margin-bottom: 0;
|
|
187
187
|
}
|
|
188
|
-
.awsui_help-
|
|
188
|
+
.awsui_help-panel_1d237_1wbpo_94 dt:not(#\9) {
|
|
189
189
|
margin-top: var(--space-xs-edba2s, 8px);
|
|
190
190
|
font-weight: 700;
|
|
191
191
|
}
|
|
192
|
-
.awsui_help-
|
|
192
|
+
.awsui_help-panel_1d237_1wbpo_94 dd:not(#\9) {
|
|
193
193
|
margin: 0 0 var(--space-xs-edba2s, 8px);
|
|
194
194
|
}
|
|
195
|
-
.awsui_help-
|
|
196
|
-
.awsui_help-
|
|
197
|
-
.awsui_help-
|
|
198
|
-
.awsui_help-
|
|
199
|
-
.awsui_help-
|
|
195
|
+
.awsui_help-panel_1d237_1wbpo_94 h2:not(#\9),
|
|
196
|
+
.awsui_help-panel_1d237_1wbpo_94 h3:not(#\9),
|
|
197
|
+
.awsui_help-panel_1d237_1wbpo_94 h4:not(#\9),
|
|
198
|
+
.awsui_help-panel_1d237_1wbpo_94 h5:not(#\9),
|
|
199
|
+
.awsui_help-panel_1d237_1wbpo_94 h6:not(#\9) {
|
|
200
200
|
margin-top: var(--space-xl-gsucfg, 24px);
|
|
201
201
|
color: var(--color-text-heading-default-18iw0k, #000716);
|
|
202
202
|
}
|
|
203
|
-
.awsui_help-
|
|
203
|
+
.awsui_help-panel_1d237_1wbpo_94 > :not(#\9):last-child {
|
|
204
204
|
margin-bottom: var(--space-scaled-xxxl-crpygs, 40px);
|
|
205
205
|
}
|
|
206
|
-
.awsui_help-
|
|
206
|
+
.awsui_help-panel_1d237_1wbpo_94 p:not(#\9) {
|
|
207
207
|
color: inherit;
|
|
208
208
|
text-decoration: none;
|
|
209
209
|
}
|
|
210
|
-
.awsui_help-
|
|
210
|
+
.awsui_help-panel_1d237_1wbpo_94 h1:not(#\9) {
|
|
211
211
|
font-size: var(--font-heading-xl-size-qxqrag, 32px);
|
|
212
212
|
line-height: var(--font-heading-xl-line-height-4s70cu, 40px);
|
|
213
213
|
letter-spacing: var(--font-heading-xl-letter-spacing-zxoemo, -0.02em);
|
|
@@ -215,7 +215,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
215
215
|
-webkit-font-smoothing: var(--font-smoothing-webkit-fyh4as, antialiased);
|
|
216
216
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-pa2uqe, grayscale);
|
|
217
217
|
}
|
|
218
|
-
.awsui_help-
|
|
218
|
+
.awsui_help-panel_1d237_1wbpo_94 h2:not(#\9) {
|
|
219
219
|
font-size: var(--font-heading-l-size-hcsmf8, 24px);
|
|
220
220
|
line-height: var(--font-heading-l-line-height-l1pmir, 30px);
|
|
221
221
|
letter-spacing: var(--font-heading-l-letter-spacing-usq225, -0.015em);
|
|
@@ -223,7 +223,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
223
223
|
-webkit-font-smoothing: var(--font-smoothing-webkit-fyh4as, antialiased);
|
|
224
224
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-pa2uqe, grayscale);
|
|
225
225
|
}
|
|
226
|
-
.awsui_help-
|
|
226
|
+
.awsui_help-panel_1d237_1wbpo_94 h3:not(#\9) {
|
|
227
227
|
font-size: var(--font-heading-m-size-hbn9yp, 20px);
|
|
228
228
|
line-height: var(--font-heading-m-line-height-ozfvgp, 24px);
|
|
229
229
|
letter-spacing: var(--font-heading-m-letter-spacing-rsatez, -0.01em);
|
|
@@ -231,7 +231,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
231
231
|
-webkit-font-smoothing: var(--font-smoothing-webkit-fyh4as, antialiased);
|
|
232
232
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-pa2uqe, grayscale);
|
|
233
233
|
}
|
|
234
|
-
.awsui_help-
|
|
234
|
+
.awsui_help-panel_1d237_1wbpo_94 h4:not(#\9) {
|
|
235
235
|
font-size: var(--font-heading-s-size-ep2ts9, 16px);
|
|
236
236
|
line-height: var(--font-heading-s-line-height-uruujc, 20px);
|
|
237
237
|
letter-spacing: var(--font-heading-s-letter-spacing-j4vcrt, -0.005em);
|
|
@@ -239,63 +239,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
239
239
|
-webkit-font-smoothing: var(--font-smoothing-webkit-fyh4as, antialiased);
|
|
240
240
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-pa2uqe, grayscale);
|
|
241
241
|
}
|
|
242
|
-
.awsui_help-
|
|
242
|
+
.awsui_help-panel_1d237_1wbpo_94 h5:not(#\9) {
|
|
243
243
|
font-size: var(--font-heading-xs-size-2ai9la, 14px);
|
|
244
244
|
line-height: var(--font-heading-xs-line-height-yt5y4b, 18px);
|
|
245
245
|
font-weight: var(--font-heading-xs-weight-dxq16u, 800);
|
|
246
246
|
-webkit-font-smoothing: var(--font-smoothing-webkit-fyh4as, antialiased);
|
|
247
247
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-pa2uqe, grayscale);
|
|
248
248
|
}
|
|
249
|
-
.awsui_help-
|
|
250
|
-
.awsui_help-
|
|
249
|
+
.awsui_help-panel_1d237_1wbpo_94 b:not(#\9),
|
|
250
|
+
.awsui_help-panel_1d237_1wbpo_94 strong:not(#\9) {
|
|
251
251
|
font-weight: 700;
|
|
252
252
|
}
|
|
253
|
-
.awsui_help-
|
|
254
|
-
color: var(--color-text-link-default-gthbx2, #0972d3);
|
|
255
|
-
font-weight: inherit;
|
|
256
|
-
letter-spacing: normal;
|
|
257
|
-
text-decoration: none;
|
|
258
|
-
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
259
|
-
text-decoration-color: transparent;
|
|
260
|
-
transition-property: color, -webkit-text-decoration;
|
|
261
|
-
transition-property: color, text-decoration;
|
|
262
|
-
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
263
|
-
transition-duration: var(--motion-duration-refresh-only-medium-wkp575, 165ms);
|
|
264
|
-
}
|
|
265
|
-
@media (prefers-reduced-motion: reduce) {
|
|
266
|
-
.awsui_help-panel_1d237_c6kvy_94 a:not(#\9) {
|
|
267
|
-
animation: none;
|
|
268
|
-
transition: none;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
.awsui-motion-disabled .awsui_help-panel_1d237_c6kvy_94 a:not(#\9), .awsui-mode-entering .awsui_help-panel_1d237_c6kvy_94 a:not(#\9) {
|
|
272
|
-
animation: none;
|
|
273
|
-
transition: none;
|
|
274
|
-
}
|
|
275
|
-
.awsui_help-panel_1d237_c6kvy_94 a:not(#\9):hover {
|
|
276
|
-
cursor: pointer;
|
|
277
|
-
color: var(--color-text-link-hover-h1b9eu, #033160);
|
|
278
|
-
}
|
|
279
|
-
.awsui_help-panel_1d237_c6kvy_94 a:not(#\9):focus {
|
|
280
|
-
outline: none;
|
|
281
|
-
}
|
|
282
|
-
.awsui_help-panel_1d237_c6kvy_94 a:not(#\9):active {
|
|
283
|
-
color: var(--color-text-link-hover-h1b9eu, #033160);
|
|
284
|
-
}
|
|
285
|
-
.awsui_help-panel_1d237_c6kvy_94 a:not(#\9):active, .awsui_help-panel_1d237_c6kvy_94 a:not(#\9):focus, .awsui_help-panel_1d237_c6kvy_94 a:not(#\9):hover {
|
|
286
|
-
text-decoration: underline;
|
|
287
|
-
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
288
|
-
text-decoration-color: currentColor;
|
|
289
|
-
}
|
|
290
|
-
.awsui_help-panel_1d237_c6kvy_94 a:not(#\9):focus {
|
|
291
|
-
outline: thin dotted;
|
|
292
|
-
outline: var(--border-link-focus-ring-outline-pwlekd, 0);
|
|
293
|
-
outline-offset: 2px;
|
|
294
|
-
outline-color: var(--color-border-item-focused-4t19h5, #0972d3);
|
|
295
|
-
border-radius: var(--border-radius-control-default-focus-ring-muizvi, 4px);
|
|
296
|
-
box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-z7lixz, 2px) var(--color-border-item-focused-4t19h5, #0972d3);
|
|
297
|
-
}
|
|
298
|
-
.awsui_help-panel_1d237_c6kvy_94 .awsui_header_1d237_c6kvy_270:not(#\9) {
|
|
253
|
+
.awsui_help-panel_1d237_1wbpo_94 .awsui_header_1d237_1wbpo_227:not(#\9) {
|
|
299
254
|
font-size: var(--font-panel-header-size-x8jazn, 20px);
|
|
300
255
|
line-height: var(--font-panel-header-line-height-mz6j6r, 24px);
|
|
301
256
|
font-weight: var(--font-heading-l-weight-cxmpnm, 800);
|
|
@@ -309,11 +264,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
309
264
|
border-bottom: var(--border-divider-section-width-orq175, 2px) solid var(--color-border-divider-default-9o8zql, #e9ebed);
|
|
310
265
|
margin: 0 calc(-1 * var(--space-panel-side-right-zzgkuy, 24px)) var(--space-scaled-l-2rs0gk, 20px) calc(-1 * var(--space-panel-side-left-ob0rxs, 28px));
|
|
311
266
|
}
|
|
312
|
-
.awsui_help-
|
|
313
|
-
.awsui_help-
|
|
314
|
-
.awsui_help-
|
|
315
|
-
.awsui_help-
|
|
316
|
-
.awsui_help-
|
|
267
|
+
.awsui_help-panel_1d237_1wbpo_94 .awsui_header_1d237_1wbpo_227 h2:not(#\9),
|
|
268
|
+
.awsui_help-panel_1d237_1wbpo_94 .awsui_header_1d237_1wbpo_227 h3:not(#\9),
|
|
269
|
+
.awsui_help-panel_1d237_1wbpo_94 .awsui_header_1d237_1wbpo_227 h4:not(#\9),
|
|
270
|
+
.awsui_help-panel_1d237_1wbpo_94 .awsui_header_1d237_1wbpo_227 h5:not(#\9),
|
|
271
|
+
.awsui_help-panel_1d237_1wbpo_94 .awsui_header_1d237_1wbpo_227 h6:not(#\9) {
|
|
317
272
|
font-size: var(--font-panel-header-size-x8jazn, 20px);
|
|
318
273
|
line-height: var(--font-panel-header-line-height-mz6j6r, 24px);
|
|
319
274
|
font-weight: var(--font-heading-l-weight-cxmpnm, 800);
|
|
@@ -325,27 +280,112 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
325
280
|
margin-bottom: 0;
|
|
326
281
|
}
|
|
327
282
|
|
|
328
|
-
.
|
|
283
|
+
.awsui_content_1d237_1wbpo_257:not(#\9) {
|
|
329
284
|
color: var(--color-text-body-secondary-he5d85, #414d5c);
|
|
330
285
|
}
|
|
331
|
-
.
|
|
332
|
-
.
|
|
333
|
-
.
|
|
334
|
-
.
|
|
335
|
-
.
|
|
286
|
+
.awsui_content_1d237_1wbpo_257 h2:not(#\9):first-child,
|
|
287
|
+
.awsui_content_1d237_1wbpo_257 h3:not(#\9):first-child,
|
|
288
|
+
.awsui_content_1d237_1wbpo_257 h4:not(#\9):first-child,
|
|
289
|
+
.awsui_content_1d237_1wbpo_257 h5:not(#\9):first-child,
|
|
290
|
+
.awsui_content_1d237_1wbpo_257 h6:not(#\9):first-child {
|
|
336
291
|
margin-top: 0;
|
|
337
292
|
}
|
|
293
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9) {
|
|
294
|
+
color: var(--color-text-link-default-gthbx2, #0972d3);
|
|
295
|
+
font-weight: var(--font-link-primary-weight-tj5hoh, "inherit");
|
|
296
|
+
letter-spacing: var(--font-link-primary-letter-spacing-zpfgrc, "inherit");
|
|
297
|
+
-webkit-text-decoration: var(--font-link-primary-decoration-gru46w, underline);
|
|
298
|
+
text-decoration: var(--font-link-primary-decoration-gru46w, underline);
|
|
299
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
300
|
+
text-decoration-color: var(--color-text-link-primary-underline-tnqzzx, #0972d3);
|
|
301
|
+
transition-property: color, -webkit-text-decoration;
|
|
302
|
+
transition-property: color, text-decoration;
|
|
303
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
304
|
+
transition-duration: var(--motion-duration-refresh-only-medium-wkp575, 165ms);
|
|
305
|
+
}
|
|
306
|
+
@media (prefers-reduced-motion: reduce) {
|
|
307
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9) {
|
|
308
|
+
animation: none;
|
|
309
|
+
transition: none;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
.awsui-motion-disabled .awsui_content_1d237_1wbpo_257 a:not(#\9), .awsui-mode-entering .awsui_content_1d237_1wbpo_257 a:not(#\9) {
|
|
313
|
+
animation: none;
|
|
314
|
+
transition: none;
|
|
315
|
+
}
|
|
316
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9):hover {
|
|
317
|
+
cursor: pointer;
|
|
318
|
+
color: var(--color-text-link-hover-h1b9eu, #033160);
|
|
319
|
+
}
|
|
320
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9):focus {
|
|
321
|
+
outline: none;
|
|
322
|
+
}
|
|
323
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9):active {
|
|
324
|
+
color: var(--color-text-link-hover-h1b9eu, #033160);
|
|
325
|
+
}
|
|
326
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9):active, .awsui_content_1d237_1wbpo_257 a:not(#\9):focus, .awsui_content_1d237_1wbpo_257 a:not(#\9):hover {
|
|
327
|
+
text-decoration: underline;
|
|
328
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
329
|
+
text-decoration-color: currentColor;
|
|
330
|
+
}
|
|
338
331
|
|
|
339
|
-
.
|
|
332
|
+
.awsui_footer_1d237_1wbpo_303:not(#\9) {
|
|
340
333
|
color: var(--color-text-body-secondary-he5d85, #414d5c);
|
|
341
334
|
border-top: var(--border-divider-section-width-orq175, 2px) solid var(--color-border-divider-default-9o8zql, #e9ebed);
|
|
342
335
|
margin: var(--space-scaled-xl-jawob6, 24px) calc(-1 * var(--space-xs-edba2s, 8px));
|
|
343
336
|
padding: 0 var(--space-s-hdd878, 12px);
|
|
344
337
|
}
|
|
345
|
-
.
|
|
338
|
+
.awsui_footer_1d237_1wbpo_303 > :not(#\9):first-child {
|
|
346
339
|
margin-top: var(--space-scaled-xl-jawob6, 24px);
|
|
347
340
|
}
|
|
348
|
-
.
|
|
341
|
+
.awsui_footer_1d237_1wbpo_303 ul:not(#\9) {
|
|
349
342
|
list-style: none;
|
|
350
343
|
padding-left: 0;
|
|
344
|
+
}
|
|
345
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9) {
|
|
346
|
+
color: var(--color-text-link-default-gthbx2, #0972d3);
|
|
347
|
+
font-weight: inherit;
|
|
348
|
+
letter-spacing: normal;
|
|
349
|
+
text-decoration: none;
|
|
350
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
351
|
+
text-decoration-color: transparent;
|
|
352
|
+
transition-property: color, -webkit-text-decoration;
|
|
353
|
+
transition-property: color, text-decoration;
|
|
354
|
+
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
355
|
+
transition-duration: var(--motion-duration-refresh-only-medium-wkp575, 165ms);
|
|
356
|
+
}
|
|
357
|
+
@media (prefers-reduced-motion: reduce) {
|
|
358
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9) {
|
|
359
|
+
animation: none;
|
|
360
|
+
transition: none;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
.awsui-motion-disabled .awsui_footer_1d237_1wbpo_303 a:not(#\9), .awsui-mode-entering .awsui_footer_1d237_1wbpo_303 a:not(#\9) {
|
|
364
|
+
animation: none;
|
|
365
|
+
transition: none;
|
|
366
|
+
}
|
|
367
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9):hover {
|
|
368
|
+
cursor: pointer;
|
|
369
|
+
color: var(--color-text-link-hover-h1b9eu, #033160);
|
|
370
|
+
}
|
|
371
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9):focus {
|
|
372
|
+
outline: none;
|
|
373
|
+
}
|
|
374
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9):active {
|
|
375
|
+
color: var(--color-text-link-hover-h1b9eu, #033160);
|
|
376
|
+
}
|
|
377
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9):active, .awsui_footer_1d237_1wbpo_303 a:not(#\9):focus, .awsui_footer_1d237_1wbpo_303 a:not(#\9):hover {
|
|
378
|
+
text-decoration: underline;
|
|
379
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
380
|
+
text-decoration-color: currentColor;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.awsui_content_1d237_1wbpo_257 a:not(#\9):focus,
|
|
384
|
+
.awsui_footer_1d237_1wbpo_303 a:not(#\9):focus {
|
|
385
|
+
outline: thin dotted;
|
|
386
|
+
outline: var(--border-link-focus-ring-outline-pwlekd, 0);
|
|
387
|
+
outline-offset: 2px;
|
|
388
|
+
outline-color: var(--color-border-item-focused-4t19h5, #0972d3);
|
|
389
|
+
border-radius: var(--border-radius-control-default-focus-ring-muizvi, 4px);
|
|
390
|
+
box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-z7lixz, 2px) var(--color-border-item-focused-4t19h5, #0972d3);
|
|
351
391
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"help-panel": "awsui_help-
|
|
6
|
-
"header": "
|
|
7
|
-
"content": "
|
|
8
|
-
"footer": "
|
|
5
|
+
"help-panel": "awsui_help-panel_1d237_1wbpo_94",
|
|
6
|
+
"header": "awsui_header_1d237_1wbpo_227",
|
|
7
|
+
"content": "awsui_content_1d237_1wbpo_257",
|
|
8
|
+
"footer": "awsui_footer_1d237_1wbpo_303"
|
|
9
9
|
};
|
|
10
10
|
|
package/i18n/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"lib/default/","sources":["i18n/provider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"lib/default/","sources":["i18n/provider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAM1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,QAAQ;QACvB,CAAC,SAAS,EAAE,MAAM,GAAG;YACnB,CAAC,MAAM,EAAE,MAAM,GAAG;gBAChB,CAAC,SAAS,EAAE,MAAM,GAAG;oBACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;iBAChD,CAAC;aACH,CAAC;SACH,CAAC;KACH;CACF;AASD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eAyE5G"}
|
package/i18n/provider.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
4
|
import IntlMessageFormat from 'intl-messageformat';
|
|
5
5
|
import { InternalI18nContext } from './context';
|
|
6
|
+
import { useTelemetry } from '../internal/hooks/use-telemetry';
|
|
6
7
|
import { warnOnce } from '../internal/logging';
|
|
7
8
|
/**
|
|
8
9
|
* Context to send parent messages down to child I18nProviders. This isn't
|
|
@@ -11,6 +12,7 @@ import { warnOnce } from '../internal/logging';
|
|
|
11
12
|
*/
|
|
12
13
|
const I18nMessagesContext = React.createContext({});
|
|
13
14
|
export function I18nProvider({ messages: messagesArray, locale: providedLocale, children }) {
|
|
15
|
+
useTelemetry('I18nProvider');
|
|
14
16
|
if (typeof document === 'undefined' && !providedLocale) {
|
|
15
17
|
warnOnce('I18nProvider', 'An explicit locale was not provided during server rendering. This can lead to a hydration mismatch on the client.');
|
|
16
18
|
}
|
package/i18n/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"lib/default/","sources":["i18n/provider.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAiC,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM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Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useContext } from 'react';\nimport IntlMessageFormat from 'intl-messageformat';\nimport { MessageFormatElement } from '@formatjs/icu-messageformat-parser';\n\nimport { InternalI18nContext, FormatFunction, CustomHandler } from './context';\nimport { warnOnce } from '../internal/logging';\n\nexport interface I18nProviderProps {\n messages: ReadonlyArray<I18nProviderProps.Messages>;\n locale?: string;\n children: React.ReactNode;\n}\n\nexport namespace I18nProviderProps {\n export interface Messages {\n [namespace: string]: {\n [locale: string]: {\n [component: string]: {\n [key: string]: string | MessageFormatElement[];\n };\n };\n };\n }\n}\n\n/**\n * Context to send parent messages down to child I18nProviders. This isn't\n * included in the InternalI18nContext to avoid components from depending on\n * MessageFormatElement types.\n */\nconst I18nMessagesContext = React.createContext<I18nProviderProps.Messages>({});\n\nexport function I18nProvider({ messages: messagesArray, locale: providedLocale, children }: I18nProviderProps) {\n if (typeof document === 'undefined' && !providedLocale) {\n warnOnce(\n 'I18nProvider',\n 'An explicit locale was not provided during server rendering. This can lead to a hydration mismatch on the client.'\n );\n }\n\n // The provider accepts an array of configs. We merge parent messages and\n // flatten the tree early on so that accesses by key are simpler and faster.\n const parentMessages = useContext(I18nMessagesContext);\n const messages = mergeMessages([parentMessages, ...messagesArray]);\n\n let locale: string;\n if (providedLocale) {\n // If a locale is explicitly provided, use the string directly.\n // Locales have a recommended case, but are matched case-insensitively,\n // so we lowercase it internally.\n locale = providedLocale.toLowerCase();\n } else if (typeof document !== 'undefined' && document.documentElement.lang) {\n // Otherwise, use the value provided in the HTML tag.\n locale = document.documentElement.lang.toLowerCase();\n } else {\n // Lastly, fall back to English.\n locale = 'en';\n }\n\n const format: FormatFunction = <ReturnValue, FormatFnArgs extends Record<string, string | number>>(\n namespace: string,\n component: string,\n key: string,\n provided: ReturnValue,\n customHandler?: CustomHandler<ReturnValue, FormatFnArgs>\n ): ReturnValue => {\n // A general rule in the library is that undefined is basically\n // treated as \"not provided\". So even if a user explicitly provides an\n // undefined value, it will default to i18n values.\n if (provided !== undefined) {\n return provided;\n }\n\n // Widen the locale string (e.g. en-GB -> en) until we find a locale\n // that contains the message we need.\n let message: string | MessageFormatElement[] | undefined;\n const matchableLocales = getMatchableLocales(locale);\n for (const matchableLocale of matchableLocales) {\n const localeMessage = messages?.[namespace]?.[matchableLocale]?.[component]?.[key];\n if (localeMessage !== undefined) {\n message = localeMessage;\n break;\n }\n }\n\n // If a message wasn't found, exit early.\n if (message === undefined) {\n return provided;\n }\n\n const intlMessageFormat = new IntlMessageFormat(message, locale);\n if (customHandler) {\n return customHandler(args => intlMessageFormat.format(args) as string);\n }\n // Assuming `T extends string` since a customHandler wasn't provided.\n return intlMessageFormat.format() as ReturnValue;\n };\n\n return (\n <InternalI18nContext.Provider value={{ locale, format }}>\n <I18nMessagesContext.Provider value={messages}>{children}</I18nMessagesContext.Provider>\n </InternalI18nContext.Provider>\n );\n}\n\nfunction mergeMessages(sources: ReadonlyArray<I18nProviderProps.Messages>): I18nProviderProps.Messages {\n const result: I18nProviderProps.Messages = {};\n for (const messages of sources) {\n for (const namespace in messages) {\n if (!(namespace in result)) {\n result[namespace] = {};\n }\n for (const casedLocale in messages[namespace]) {\n const locale = casedLocale.toLowerCase();\n if (!(locale in result[namespace])) {\n result[namespace][locale] = {};\n }\n for (const component in messages[namespace][casedLocale]) {\n if (!(component in result[namespace][locale])) {\n result[namespace][locale][component] = {};\n }\n for (const key in messages[namespace][casedLocale][component]) {\n result[namespace][locale][component][key] = messages[namespace][casedLocale][component][key];\n }\n }\n }\n }\n }\n return result;\n}\n\nfunction getMatchableLocales(ietfLanguageTag: string): string[] {\n const parts = ietfLanguageTag.split('-');\n if (parts.length === 1) {\n return [ietfLanguageTag];\n }\n\n const localeStrings: string[] = [];\n for (let i = parts.length; i > 0; i--) {\n localeStrings.push(parts.slice(0, i).join('-'));\n }\n return localeStrings;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot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E;QACtB,OAAO,CAAC,eAAe,CAAC,CAAC;KAC1B;IAED,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACrC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;KACjD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useContext } from 'react';\nimport IntlMessageFormat from 'intl-messageformat';\nimport { MessageFormatElement } from '@formatjs/icu-messageformat-parser';\n\nimport { InternalI18nContext, FormatFunction, CustomHandler } from './context';\nimport { useTelemetry } from '../internal/hooks/use-telemetry';\nimport { warnOnce } from '../internal/logging';\n\nexport interface I18nProviderProps {\n messages: ReadonlyArray<I18nProviderProps.Messages>;\n locale?: string;\n children: React.ReactNode;\n}\n\nexport namespace I18nProviderProps {\n export interface Messages {\n [namespace: string]: {\n [locale: string]: {\n [component: string]: {\n [key: string]: string | MessageFormatElement[];\n };\n };\n };\n }\n}\n\n/**\n * Context to send parent messages down to child I18nProviders. This isn't\n * included in the InternalI18nContext to avoid components from depending on\n * MessageFormatElement types.\n */\nconst I18nMessagesContext = React.createContext<I18nProviderProps.Messages>({});\n\nexport function I18nProvider({ messages: messagesArray, locale: providedLocale, children }: I18nProviderProps) {\n useTelemetry('I18nProvider');\n\n if (typeof document === 'undefined' && !providedLocale) {\n warnOnce(\n 'I18nProvider',\n 'An explicit locale was not provided during server rendering. This can lead to a hydration mismatch on the client.'\n );\n }\n\n // The provider accepts an array of configs. We merge parent messages and\n // flatten the tree early on so that accesses by key are simpler and faster.\n const parentMessages = useContext(I18nMessagesContext);\n const messages = mergeMessages([parentMessages, ...messagesArray]);\n\n let locale: string;\n if (providedLocale) {\n // If a locale is explicitly provided, use the string directly.\n // Locales have a recommended case, but are matched case-insensitively,\n // so we lowercase it internally.\n locale = providedLocale.toLowerCase();\n } else if (typeof document !== 'undefined' && document.documentElement.lang) {\n // Otherwise, use the value provided in the HTML tag.\n locale = document.documentElement.lang.toLowerCase();\n } else {\n // Lastly, fall back to English.\n locale = 'en';\n }\n\n const format: FormatFunction = <ReturnValue, FormatFnArgs extends Record<string, string | number>>(\n namespace: string,\n component: string,\n key: string,\n provided: ReturnValue,\n customHandler?: CustomHandler<ReturnValue, FormatFnArgs>\n ): ReturnValue => {\n // A general rule in the library is that undefined is basically\n // treated as \"not provided\". So even if a user explicitly provides an\n // undefined value, it will default to i18n values.\n if (provided !== undefined) {\n return provided;\n }\n\n // Widen the locale string (e.g. en-GB -> en) until we find a locale\n // that contains the message we need.\n let message: string | MessageFormatElement[] | undefined;\n const matchableLocales = getMatchableLocales(locale);\n for (const matchableLocale of matchableLocales) {\n const localeMessage = messages?.[namespace]?.[matchableLocale]?.[component]?.[key];\n if (localeMessage !== undefined) {\n message = localeMessage;\n break;\n }\n }\n\n // If a message wasn't found, exit early.\n if (message === undefined) {\n return provided;\n }\n\n const intlMessageFormat = new IntlMessageFormat(message, locale);\n if (customHandler) {\n return customHandler(args => intlMessageFormat.format(args) as string);\n }\n // Assuming `T extends string` since a customHandler wasn't provided.\n return intlMessageFormat.format() as ReturnValue;\n };\n\n return (\n <InternalI18nContext.Provider value={{ locale, format }}>\n <I18nMessagesContext.Provider value={messages}>{children}</I18nMessagesContext.Provider>\n </InternalI18nContext.Provider>\n );\n}\n\nfunction mergeMessages(sources: ReadonlyArray<I18nProviderProps.Messages>): I18nProviderProps.Messages {\n const result: I18nProviderProps.Messages = {};\n for (const messages of sources) {\n for (const namespace in messages) {\n if (!(namespace in result)) {\n result[namespace] = {};\n }\n for (const casedLocale in messages[namespace]) {\n const locale = casedLocale.toLowerCase();\n if (!(locale in result[namespace])) {\n result[namespace][locale] = {};\n }\n for (const component in messages[namespace][casedLocale]) {\n if (!(component in result[namespace][locale])) {\n result[namespace][locale][component] = {};\n }\n for (const key in messages[namespace][casedLocale][component]) {\n result[namespace][locale][component][key] = messages[namespace][casedLocale][component][key];\n }\n }\n }\n }\n }\n return result;\n}\n\nfunction getMatchableLocales(ietfLanguageTag: string): string[] {\n const parts = ietfLanguageTag.split('-');\n if (parts.length === 1) {\n return [ietfLanguageTag];\n }\n\n const localeStrings: string[] = [];\n for (let i = parts.length; i > 0; i--) {\n localeStrings.push(parts.slice(0, i).join('-'));\n }\n return localeStrings;\n}\n"]}
|