@cloudscape-design/components 3.0.310 → 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/button/internal.d.ts +6 -0
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +6 -8
- package/button/internal.js.map +1 -1
- 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/collection-preferences/content-display/index.js +1 -1
- package/collection-preferences/content-display/index.js.map +1 -1
- 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/date-range-picker/calendar/header/index.d.ts.map +1 -1
- package/date-range-picker/calendar/header/index.js +4 -2
- package/date-range-picker/calendar/header/index.js.map +1 -1
- package/date-range-picker/calendar/index.js +1 -1
- package/date-range-picker/calendar/index.js.map +1 -1
- 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/form/index.d.ts.map +1 -1
- package/form/index.js +14 -1
- package/form/index.js.map +1 -1
- package/form/internal.d.ts.map +1 -1
- package/form/internal.js +3 -4
- package/form/internal.js.map +1 -1
- package/form-field/internal.js +2 -3
- package/form-field/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/context.d.ts +14 -7
- package/i18n/context.d.ts.map +1 -1
- package/i18n/context.js.map +1 -1
- package/i18n/messages/all.all.js +3692 -538
- package/i18n/messages/all.all.json +3756 -577
- package/i18n/messages/all.de.js +317 -22
- package/i18n/messages/all.de.json +324 -27
- package/i18n/messages/all.en-GB.js +306 -21
- package/i18n/messages/all.en-GB.json +309 -24
- package/i18n/messages/all.en.js +11 -11
- package/i18n/messages/all.en.json +11 -11
- package/i18n/messages/all.es.js +311 -22
- package/i18n/messages/all.es.json +318 -25
- package/i18n/messages/all.fr.js +335 -27
- package/i18n/messages/all.fr.json +343 -30
- package/i18n/messages/all.id.js +319 -28
- package/i18n/messages/all.id.json +322 -31
- package/i18n/messages/all.it.js +320 -27
- package/i18n/messages/all.it.json +326 -30
- package/i18n/messages/all.ja.js +312 -28
- package/i18n/messages/all.ja.json +315 -30
- package/i18n/messages/all.ko.js +304 -24
- package/i18n/messages/all.ko.json +312 -25
- package/i18n/messages/all.pt-BR.js +313 -28
- package/i18n/messages/all.pt-BR.json +325 -31
- package/i18n/messages/all.zh-CN.js +301 -29
- package/i18n/messages/all.zh-CN.json +300 -31
- package/i18n/messages/all.zh-TW.js +295 -23
- package/i18n/messages/all.zh-TW.json +294 -25
- package/i18n/messages-types.d.ts +435 -0
- package/i18n/messages-types.d.ts.map +1 -0
- package/i18n/messages-types.js +5 -0
- package/i18n/messages-types.js.map +1 -0
- package/i18n/provider.d.ts.map +1 -1
- package/i18n/provider.js +2 -0
- package/i18n/provider.js.map +1 -1
- package/internal/analytics/components/analytics-funnel.d.ts +2 -1
- package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/internal/analytics/components/analytics-funnel.js +6 -4
- package/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/internal/analytics/context/analytics-context.d.ts +2 -0
- package/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/internal/analytics/context/analytics-context.js +2 -0
- package/internal/analytics/context/analytics-context.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +3 -7
- package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
- package/internal/analytics/hooks/use-funnel.js +2 -7
- package/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/internal/base-component/styles.scoped.css +382 -379
- package/internal/components/cartesian-chart/bottom-labels.js +1 -1
- package/internal/components/cartesian-chart/bottom-labels.js.map +1 -1
- package/internal/components/cartesian-chart/left-labels.js +1 -1
- package/internal/components/cartesian-chart/left-labels.js.map +1 -1
- package/internal/components/focus-lock/index.js +20 -19
- package/internal/components/focus-lock/index.js.map +1 -1
- package/internal/context/button-context.d.ts +10 -0
- package/internal/context/button-context.d.ts.map +1 -0
- package/internal/context/button-context.js +10 -0
- package/internal/context/button-context.js.map +1 -0
- 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/i18n/messages/all.all.js +3692 -538
- package/internal/i18n/messages/all.all.json +3756 -577
- package/internal/i18n/messages/all.de.js +317 -22
- package/internal/i18n/messages/all.de.json +324 -27
- package/internal/i18n/messages/all.en-GB.js +306 -21
- package/internal/i18n/messages/all.en-GB.json +309 -24
- package/internal/i18n/messages/all.en.js +11 -11
- package/internal/i18n/messages/all.en.json +11 -11
- package/internal/i18n/messages/all.es.js +311 -22
- package/internal/i18n/messages/all.es.json +318 -25
- package/internal/i18n/messages/all.fr.js +335 -27
- package/internal/i18n/messages/all.fr.json +343 -30
- package/internal/i18n/messages/all.id.js +319 -28
- package/internal/i18n/messages/all.id.json +322 -31
- package/internal/i18n/messages/all.it.js +320 -27
- package/internal/i18n/messages/all.it.json +326 -30
- package/internal/i18n/messages/all.ja.js +312 -28
- package/internal/i18n/messages/all.ja.json +315 -30
- package/internal/i18n/messages/all.ko.js +304 -24
- package/internal/i18n/messages/all.ko.json +312 -25
- package/internal/i18n/messages/all.pt-BR.js +313 -28
- package/internal/i18n/messages/all.pt-BR.json +325 -31
- package/internal/i18n/messages/all.zh-CN.js +301 -29
- package/internal/i18n/messages/all.zh-CN.json +300 -31
- package/internal/i18n/messages/all.zh-TW.js +295 -23
- package/internal/i18n/messages/all.zh-TW.json +294 -25
- package/internal/manifest.json +1 -1
- package/package.json +1 -2
- package/pagination/internal.d.ts.map +1 -1
- package/pagination/internal.js +4 -4
- package/pagination/internal.js.map +1 -1
- package/pie-chart/utils.d.ts +1 -1
- package/pie-chart/utils.d.ts.map +1 -1
- package/pie-chart/utils.js.map +1 -1
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +1 -1
- package/property-filter/index.js.map +1 -1
- package/s3-resource-selector/interfaces.d.ts +3 -0
- package/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/s3-resource-selector/interfaces.js.map +1 -1
- package/s3-resource-selector/s3-in-context/index.js +1 -1
- package/s3-resource-selector/s3-in-context/index.js.map +1 -1
- package/s3-resource-selector/s3-in-context/validation.d.ts +1 -1
- package/s3-resource-selector/s3-in-context/validation.d.ts.map +1 -1
- package/s3-resource-selector/s3-in-context/validation.js.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.d.ts +3 -1
- package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.js +2 -1
- package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/index.js +1 -1
- package/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/s3-resource-selector/s3-modal/table-utils.d.ts +1 -1
- package/s3-resource-selector/s3-modal/table-utils.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/table-utils.js.map +1 -1
- package/select/parts/filter.d.ts +1 -1
- package/space-between/interfaces.d.ts +5 -0
- package/space-between/interfaces.d.ts.map +1 -1
- package/space-between/interfaces.js.map +1 -1
- package/space-between/internal.d.ts +1 -1
- package/space-between/internal.d.ts.map +1 -1
- package/space-between/internal.js +2 -2
- package/space-between/internal.js.map +1 -1
- package/space-between/styles.css.js +21 -20
- package/space-between/styles.scoped.css +25 -21
- package/space-between/styles.selectors.js +21 -20
- package/tag-editor/interfaces.d.ts +1 -0
- package/tag-editor/interfaces.d.ts.map +1 -1
- package/tag-editor/interfaces.js.map +1 -1
- package/tag-editor/validation.d.ts +1 -1
- package/tag-editor/validation.d.ts.map +1 -1
- package/tag-editor/validation.js.map +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
- package/top-navigation/parts/overflow-menu/views/submenu.js +2 -2
- package/top-navigation/parts/overflow-menu/views/submenu.js.map +1 -1
- package/top-navigation/parts/overflow-menu/views/utilities.js +2 -2
- package/top-navigation/parts/overflow-menu/views/utilities.js.map +1 -1
- package/wizard/internal.d.ts.map +1 -1
- package/wizard/internal.js +4 -2
- package/wizard/internal.js.map +1 -1
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +1 -2
- package/wizard/wizard-form.js.map +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/context.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { I18nFormatArgTypes } from './messages-types';
|
|
3
|
+
export type CustomHandler<ReturnValue, FormatFnArgs> = (formatFn: (args: FormatFnArgs) => string) => ReturnValue;
|
|
3
4
|
export interface FormatFunction {
|
|
4
5
|
(namespace: string, component: string, key: string, provided: string): string;
|
|
5
6
|
(namespace: string, component: string, key: string, provided: string | undefined): string | undefined;
|
|
6
|
-
<T>(namespace: string, component: string, key: string, provided: T, handler?: CustomHandler<T>): T;
|
|
7
|
+
<T, A = unknown>(namespace: string, component: string, key: string, provided: T, handler?: CustomHandler<T, A>): T;
|
|
7
8
|
}
|
|
8
9
|
export interface InternalI18nContextProps {
|
|
9
10
|
locale: string | null;
|
|
@@ -11,10 +12,16 @@ export interface InternalI18nContextProps {
|
|
|
11
12
|
}
|
|
12
13
|
export declare const InternalI18nContext: React.Context<InternalI18nContextProps>;
|
|
13
14
|
export declare function useLocale(): string | null;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Utility to get "keyof T" but exclude number or symbol types.
|
|
17
|
+
* TypeScript allows those types because JS implicitly casts them to string.
|
|
18
|
+
*/
|
|
19
|
+
type StringKeyOf<T> = Extract<keyof T, string>;
|
|
20
|
+
export interface ComponentFormatFunction<ComponentName extends StringKeyOf<I18nFormatArgTypes>> {
|
|
21
|
+
<MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>>(key: MessageKey, provided: string, handler?: CustomHandler<string, I18nFormatArgTypes[ComponentName][MessageKey]>): string;
|
|
22
|
+
<MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>>(key: MessageKey, provided: string | undefined, handler?: CustomHandler<string, I18nFormatArgTypes[ComponentName][MessageKey]>): string | undefined;
|
|
23
|
+
<MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>, ReturnValue>(key: MessageKey, provided: ReturnValue, handler: I18nFormatArgTypes[ComponentName][MessageKey] extends never ? never : CustomHandler<ReturnValue, I18nFormatArgTypes[ComponentName][MessageKey]>): ReturnValue;
|
|
18
24
|
}
|
|
19
|
-
export declare function useInternalI18n(componentName:
|
|
25
|
+
export declare function useInternalI18n<ComponentName extends StringKeyOf<I18nFormatArgTypes>>(componentName: ComponentName): ComponentFormatFunction<ComponentName>;
|
|
26
|
+
export {};
|
|
20
27
|
//# sourceMappingURL=context.d.ts.map
|
package/i18n/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"lib/default/","sources":["i18n/context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"lib/default/","sources":["i18n/context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,aAAa,CAAC,WAAW,EAAE,YAAY,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,MAAM,KAAK,WAAW,CAAC;AAEjH,MAAM,WAAW,cAAc;IAC7B,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9E,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACtG,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;CACpH;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,yCAG9B,CAAC;AAEH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAEzC;AAED;;;GAGG;AACH,KAAK,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,WAAW,uBAAuB,CAAC,aAAa,SAAS,WAAW,CAAC,kBAAkB,CAAC;IAC5F,CAAC,UAAU,SAAS,WAAW,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAChE,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC,GAC7E,MAAM,CAAC;IACV,CAAC,UAAU,SAAS,WAAW,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAChE,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC,GAC7E,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,UAAU,SAAS,WAAW,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAAE,WAAW,EAC7E,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,SAAS,KAAK,GAChE,KAAK,GACL,aAAa,CAAC,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC,GAC5E,WAAW,CAAC;CAChB;AAED,wBAAgB,eAAe,CAAC,aAAa,SAAS,WAAW,CAAC,kBAAkB,CAAC,EACnF,aAAa,EAAE,aAAa,GAC3B,uBAAuB,CAAC,aAAa,CAAC,CASxC"}
|
package/i18n/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"lib/default/","sources":["i18n/context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"lib/default/","sources":["i18n/context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAgB1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAA2B;IAC/E,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAI,UAAkB,EAAE,UAAkB,EAAE,IAAY,EAAE,QAAW,EAAE,EAAE,CAAC,QAAQ;CAC3F,CAAC,CAAC;AAEH,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC;AAChD,CAAC;AA4BD,MAAM,UAAU,eAAe,CAC7B,aAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACnD,OAAO,CACL,GAAe,EACf,QAAmB,EACnB,aAAuF,EACvF,EAAE;QACF,OAAO,MAAM,CAAC,+BAA+B,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC9F,CAAC,CAAC;AACJ,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 { I18nFormatArgTypes } from './messages-types';\n\nexport type CustomHandler<ReturnValue, FormatFnArgs> = (formatFn: (args: FormatFnArgs) => string) => ReturnValue;\n\nexport interface FormatFunction {\n (namespace: string, component: string, key: string, provided: string): string;\n (namespace: string, component: string, key: string, provided: string | undefined): string | undefined;\n <T, A = unknown>(namespace: string, component: string, key: string, provided: T, handler?: CustomHandler<T, A>): T;\n}\n\nexport interface InternalI18nContextProps {\n locale: string | null;\n format: FormatFunction;\n}\n\nexport const InternalI18nContext = React.createContext<InternalI18nContextProps>({\n locale: null,\n format: <T>(_namespace: string, _component: string, _key: string, provided: T) => provided,\n});\n\nexport function useLocale(): string | null {\n return useContext(InternalI18nContext).locale;\n}\n\n/**\n * Utility to get \"keyof T\" but exclude number or symbol types.\n * TypeScript allows those types because JS implicitly casts them to string.\n */\ntype StringKeyOf<T> = Extract<keyof T, string>;\n\nexport interface ComponentFormatFunction<ComponentName extends StringKeyOf<I18nFormatArgTypes>> {\n <MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>>(\n key: MessageKey,\n provided: string,\n handler?: CustomHandler<string, I18nFormatArgTypes[ComponentName][MessageKey]>\n ): string;\n <MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>>(\n key: MessageKey,\n provided: string | undefined,\n handler?: CustomHandler<string, I18nFormatArgTypes[ComponentName][MessageKey]>\n ): string | undefined;\n <MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>, ReturnValue>(\n key: MessageKey,\n provided: ReturnValue,\n handler: I18nFormatArgTypes[ComponentName][MessageKey] extends never\n ? never\n : CustomHandler<ReturnValue, I18nFormatArgTypes[ComponentName][MessageKey]>\n ): ReturnValue;\n}\n\nexport function useInternalI18n<ComponentName extends StringKeyOf<I18nFormatArgTypes>>(\n componentName: ComponentName\n): ComponentFormatFunction<ComponentName> {\n const { format } = useContext(InternalI18nContext);\n return <MessageKey extends StringKeyOf<I18nFormatArgTypes[ComponentName]>, ValueType>(\n key: MessageKey,\n provided: ValueType,\n customHandler?: CustomHandler<ValueType, I18nFormatArgTypes[ComponentName][MessageKey]>\n ) => {\n return format('@cloudscape-design/components', componentName, key, provided, customHandler);\n };\n}\n"]}
|