@cloudscape-design/components-themeable 3.0.1354 → 3.0.1355
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/segmented-control/segment.scss +1 -1
- package/lib/internal/scss/spinner/mixins.scss +6 -0
- package/lib/internal/scss/spinner/styles.scss +13 -0
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/segmented-control/styles.css.js +16 -16
- package/lib/internal/template/segmented-control/styles.scoped.css +36 -36
- package/lib/internal/template/segmented-control/styles.selectors.js +16 -16
- package/lib/internal/template/spinner/internal.d.ts +3 -1
- package/lib/internal/template/spinner/internal.d.ts.map +1 -1
- package/lib/internal/template/spinner/internal.js.map +1 -1
- package/lib/internal/template/spinner/styles.css.js +14 -13
- package/lib/internal/template/spinner/styles.scoped.css +27 -19
- package/lib/internal/template/spinner/styles.selectors.js +14 -13
- package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/internal.js +17 -12
- package/lib/internal/template/status-indicator/internal.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ $selected-background: var(#{custom-props.$styleBackgroundActive}, awsui.$color-b
|
|
|
21
21
|
$selected-color: var(#{custom-props.$styleColorActive}, awsui.$color-text-segment-active);
|
|
22
22
|
$segment-gap: awsui.$space-static-xxs;
|
|
23
23
|
$segment-divider-width: 1px;
|
|
24
|
-
$segment-radius: calc(awsui.$border-radius-button -
|
|
24
|
+
$segment-radius: calc(awsui.$border-radius-button - (#{awsui.$border-width-field} + #{awsui.$border-width-button}));
|
|
25
25
|
|
|
26
26
|
.segment {
|
|
27
27
|
@include styles.font-body-m;
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
@use '../internal/styles/tokens' as awsui;
|
|
9
9
|
|
|
10
10
|
$_spinner-sizes: (
|
|
11
|
+
(
|
|
12
|
+
name: 'x-small',
|
|
13
|
+
size: styles.$base-size,
|
|
14
|
+
iconSizeMap: 12px,
|
|
15
|
+
supportedLineHeight: awsui.$line-height-body-s,
|
|
16
|
+
),
|
|
11
17
|
(
|
|
12
18
|
name: 'normal',
|
|
13
19
|
size: 1.2 * styles.$base-size,
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@use './mixins' as mixins;
|
|
8
8
|
@use '../internal/styles/tokens' as awsui;
|
|
9
9
|
@use '../internal/generated/custom-css-properties/index' as custom-props;
|
|
10
|
+
@use '../internal/styles/utils/theming' as theming;
|
|
10
11
|
|
|
11
12
|
@keyframes spinner-rotator {
|
|
12
13
|
0% {
|
|
@@ -115,3 +116,15 @@
|
|
|
115
116
|
animation-name: spinner-line-right;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
119
|
+
|
|
120
|
+
// One Theme renders x-small/normal status icons with a 1.5px stroke.
|
|
121
|
+
// Match the spinner ring for those sizes only; big/large keep 2px.
|
|
122
|
+
.root.size-x-small,
|
|
123
|
+
.root.size-normal {
|
|
124
|
+
@include theming.one-theme-only {
|
|
125
|
+
& > .circle::after {
|
|
126
|
+
border-block-width: awsui.$border-width-icon-x-small;
|
|
127
|
+
border-inline-width: awsui.$border-width-icon-x-small;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (8ca13603)";
|
|
3
|
+
export var GIT_SHA = "8ca13603";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"segment": "
|
|
5
|
-
"refresh": "
|
|
6
|
-
"disabled": "
|
|
7
|
-
"selected": "
|
|
8
|
-
"icon": "
|
|
9
|
-
"with-text": "awsui_with-
|
|
10
|
-
"with-no-text": "awsui_with-no-
|
|
11
|
-
"root": "
|
|
12
|
-
"segment-part": "awsui_segment-
|
|
13
|
-
"select": "
|
|
14
|
-
"segment-count-2": "awsui_segment-count-
|
|
15
|
-
"segment-count-3": "awsui_segment-count-
|
|
16
|
-
"segment-count-4": "awsui_segment-count-
|
|
17
|
-
"segment-count-5": "awsui_segment-count-
|
|
18
|
-
"segment-count-6": "awsui_segment-count-
|
|
19
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
4
|
+
"segment": "awsui_segment_8cbea_10amm_157",
|
|
5
|
+
"refresh": "awsui_refresh_8cbea_10amm_184",
|
|
6
|
+
"disabled": "awsui_disabled_8cbea_10amm_190",
|
|
7
|
+
"selected": "awsui_selected_8cbea_10amm_247",
|
|
8
|
+
"icon": "awsui_icon_8cbea_10amm_257",
|
|
9
|
+
"with-text": "awsui_with-text_8cbea_10amm_261",
|
|
10
|
+
"with-no-text": "awsui_with-no-text_8cbea_10amm_267",
|
|
11
|
+
"root": "awsui_root_8cbea_10amm_272",
|
|
12
|
+
"segment-part": "awsui_segment-part_8cbea_10amm_304",
|
|
13
|
+
"select": "awsui_select_8cbea_10amm_247",
|
|
14
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_10amm_339",
|
|
15
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_10amm_343",
|
|
16
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_10amm_347",
|
|
17
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_10amm_351",
|
|
18
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_10amm_355",
|
|
19
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_10amm_359"
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -154,7 +154,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
154
154
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
155
155
|
SPDX-License-Identifier: Apache-2.0
|
|
156
156
|
*/
|
|
157
|
-
.
|
|
157
|
+
.awsui_segment_8cbea_10amm_157:not(#\9) {
|
|
158
158
|
font-size: var(--font-size-body-m-tq5a14, 14px);
|
|
159
159
|
line-height: var(--line-height-body-m-5xw6xo, 22px);
|
|
160
160
|
word-wrap: break-word;
|
|
@@ -169,10 +169,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
169
169
|
background: var(--awsui-style-background-default-esndbs, var(--color-background-segment-default-6rgn11, #ffffff));
|
|
170
170
|
color: var(--awsui-style-color-default-esndbs, var(--color-text-segment-default-nk7mbi, #545b64));
|
|
171
171
|
overflow: visible;
|
|
172
|
-
border-start-start-radius: calc(var(--border-radius-button-9k0hrl, 2px) -
|
|
173
|
-
border-start-end-radius: calc(var(--border-radius-button-9k0hrl, 2px) -
|
|
174
|
-
border-end-start-radius: calc(var(--border-radius-button-9k0hrl, 2px) -
|
|
175
|
-
border-end-end-radius: calc(var(--border-radius-button-9k0hrl, 2px) -
|
|
172
|
+
border-start-start-radius: calc(var(--border-radius-button-9k0hrl, 2px) - (var(--border-width-field-2365x3, 1px) + var(--border-width-button-lffd4t, 1px)));
|
|
173
|
+
border-start-end-radius: calc(var(--border-radius-button-9k0hrl, 2px) - (var(--border-width-field-2365x3, 1px) + var(--border-width-button-lffd4t, 1px)));
|
|
174
|
+
border-end-start-radius: calc(var(--border-radius-button-9k0hrl, 2px) - (var(--border-width-field-2365x3, 1px) + var(--border-width-button-lffd4t, 1px)));
|
|
175
|
+
border-end-end-radius: calc(var(--border-radius-button-9k0hrl, 2px) - (var(--border-width-field-2365x3, 1px) + var(--border-width-button-lffd4t, 1px)));
|
|
176
176
|
position: relative;
|
|
177
177
|
block-size: calc(100% - var(--space-static-xxs-vzto3j, 4px));
|
|
178
178
|
display: flex;
|
|
@@ -181,24 +181,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
181
181
|
border-block: none;
|
|
182
182
|
--awsui-style-focus-ring-box-shadow-esndbs: 0 0 0 var(--awsui-style-focus-ring-border-width-esndbs, 2px) var(--awsui-style-focus-ring-border-color-esndbs, var(--color-border-item-focused-sewkzn, #0073bb));
|
|
183
183
|
}
|
|
184
|
-
.
|
|
184
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):not(.awsui_refresh_8cbea_10amm_184) {
|
|
185
185
|
block-size: calc(100% - var(--space-static-xxs-vzto3j, 4px) - 2 * var(--border-width-field-2365x3, 1px));
|
|
186
186
|
}
|
|
187
|
-
.
|
|
187
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):focus {
|
|
188
188
|
outline: none;
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
.awsui_segment_8cbea_10amm_157.awsui_disabled_8cbea_10amm_190:not(#\9) {
|
|
191
191
|
background: var(--awsui-style-background-disabled-esndbs, var(--color-background-segment-disabled-mjubn7, #ffffff));
|
|
192
192
|
color: var(--awsui-style-color-disabled-esndbs, var(--color-text-interactive-disabled-tuxgxq, #aab7b8));
|
|
193
193
|
}
|
|
194
|
-
body[data-awsui-focus-visible=true] .
|
|
194
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_10amm_157:not(#\9):focus {
|
|
195
195
|
position: relative;
|
|
196
196
|
}
|
|
197
|
-
body[data-awsui-focus-visible=true] .
|
|
197
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_10amm_157:not(#\9):focus {
|
|
198
198
|
outline: 2px dotted transparent;
|
|
199
199
|
outline-offset: calc(var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px) - 1px);
|
|
200
200
|
}
|
|
201
|
-
body[data-awsui-focus-visible=true] .
|
|
201
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_10amm_157:not(#\9):focus::before {
|
|
202
202
|
content: " ";
|
|
203
203
|
display: block;
|
|
204
204
|
position: absolute;
|
|
@@ -213,7 +213,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_18mx2_157:not(#\9):focu
|
|
|
213
213
|
box-shadow: var(--awsui-style-focus-ring-box-shadow-esndbs);
|
|
214
214
|
z-index: 1;
|
|
215
215
|
}
|
|
216
|
-
.
|
|
216
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):not(:last-child)::after {
|
|
217
217
|
content: "";
|
|
218
218
|
position: absolute;
|
|
219
219
|
inset-inline-end: calc(-1 * (var(--space-static-xxs-vzto3j, 4px) + 1px));
|
|
@@ -223,53 +223,53 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_18mx2_157:not(#\9):focu
|
|
|
223
223
|
background: var(--color-border-segment-divider-mq01bu, #687078);
|
|
224
224
|
z-index: 1;
|
|
225
225
|
}
|
|
226
|
-
.
|
|
226
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):not(.awsui_refresh_8cbea_10amm_184):not(:last-child)::after {
|
|
227
227
|
inset-inline-end: calc(-1 * var(--space-static-xxs-vzto3j, 4px));
|
|
228
228
|
}
|
|
229
|
-
.
|
|
229
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):nth-child(1) {
|
|
230
230
|
grid-column: 1;
|
|
231
231
|
}
|
|
232
|
-
.
|
|
232
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):nth-child(2) {
|
|
233
233
|
grid-column: 2;
|
|
234
234
|
}
|
|
235
|
-
.
|
|
235
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):nth-child(3) {
|
|
236
236
|
grid-column: 3;
|
|
237
237
|
}
|
|
238
|
-
.
|
|
238
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):nth-child(4) {
|
|
239
239
|
grid-column: 4;
|
|
240
240
|
}
|
|
241
|
-
.
|
|
241
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):nth-child(5) {
|
|
242
242
|
grid-column: 5;
|
|
243
243
|
}
|
|
244
|
-
.
|
|
244
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):nth-child(6) {
|
|
245
245
|
grid-column: 6;
|
|
246
246
|
}
|
|
247
|
-
.
|
|
247
|
+
.awsui_segment_8cbea_10amm_157.awsui_selected_8cbea_10amm_247:not(#\9) {
|
|
248
248
|
background: var(--awsui-style-background-active-esndbs, var(--color-background-segment-active-ns5rt6, #0073bb));
|
|
249
249
|
color: var(--awsui-style-color-active-esndbs, var(--color-text-segment-active-hbbf1h, #ffffff));
|
|
250
250
|
}
|
|
251
|
-
.
|
|
251
|
+
.awsui_segment_8cbea_10amm_157:not(#\9):hover:not(.awsui_selected_8cbea_10amm_247):not(.awsui_disabled_8cbea_10amm_190):not(:focus) {
|
|
252
252
|
background: var(--awsui-style-background-hover-esndbs, var(--color-background-segment-hover-el4hte, #fafafa));
|
|
253
253
|
color: var(--awsui-style-color-hover-esndbs, var(--color-text-segment-hover-qq2b2e, #16191f));
|
|
254
254
|
cursor: pointer;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
.
|
|
257
|
+
.awsui_icon_8cbea_10amm_257:not(#\9) {
|
|
258
258
|
/* used in test-utils */
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
.awsui_with-
|
|
261
|
+
.awsui_with-text_8cbea_10amm_261:not(#\9) {
|
|
262
262
|
position: relative;
|
|
263
263
|
inset-inline-start: calc(-1 * var(--space-xxs-3o1yoq, 4px));
|
|
264
264
|
margin-inline-end: var(--space-xxs-3o1yoq, 4px);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
.awsui_with-no-
|
|
267
|
+
.awsui_with-no-text_8cbea_10amm_267:not(#\9) {
|
|
268
268
|
margin-inline: auto;
|
|
269
269
|
inset-inline: 0;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
.
|
|
272
|
+
.awsui_root_8cbea_10amm_272:not(#\9) {
|
|
273
273
|
border-collapse: separate;
|
|
274
274
|
border-spacing: 0;
|
|
275
275
|
box-sizing: border-box;
|
|
@@ -301,7 +301,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_18mx2_157:not(#\9):focu
|
|
|
301
301
|
-moz-osx-font-smoothing: auto;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
.awsui_segment-
|
|
304
|
+
.awsui_segment-part_8cbea_10amm_304:not(#\9) {
|
|
305
305
|
display: inline-grid;
|
|
306
306
|
border-inline: solid var(--border-width-field-2365x3, 1px) var(--color-border-segment-wrapper-ofstpm, #687078);
|
|
307
307
|
border-block: solid var(--border-width-field-2365x3, 1px) var(--color-border-segment-wrapper-ofstpm, #687078);
|
|
@@ -316,46 +316,46 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_18mx2_157:not(#\9):focu
|
|
|
316
316
|
padding-inline: calc(var(--space-static-xxs-vzto3j, 4px) - var(--border-width-field-2365x3, 1px));
|
|
317
317
|
gap: calc(var(--space-static-xxs-vzto3j, 4px) * 2 + 1px);
|
|
318
318
|
}
|
|
319
|
-
.awsui_segment-
|
|
319
|
+
.awsui_segment-part_8cbea_10amm_304:not(#\9):not(.awsui_refresh_8cbea_10amm_184) {
|
|
320
320
|
padding-inline: calc(var(--space-static-xxxs-opeihl, 2px) + var(--border-width-field-2365x3, 1px));
|
|
321
321
|
padding-block: 0;
|
|
322
322
|
gap: calc(var(--space-static-xxs-vzto3j, 4px) * 2 - 1px);
|
|
323
323
|
}
|
|
324
324
|
@media (max-width: 688px) {
|
|
325
|
-
.awsui_segment-
|
|
325
|
+
.awsui_segment-part_8cbea_10amm_304:not(#\9) {
|
|
326
326
|
display: none;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
.
|
|
330
|
+
.awsui_select_8cbea_10amm_247:not(#\9) {
|
|
331
331
|
display: none;
|
|
332
332
|
}
|
|
333
333
|
@media (max-width: 688px) {
|
|
334
|
-
.
|
|
334
|
+
.awsui_select_8cbea_10amm_247:not(#\9) {
|
|
335
335
|
display: block;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
.awsui_segment-count-
|
|
339
|
+
.awsui_segment-count-2_8cbea_10amm_339:not(#\9) {
|
|
340
340
|
grid-template-columns: repeat(2, auto);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
.awsui_segment-count-
|
|
343
|
+
.awsui_segment-count-3_8cbea_10amm_343:not(#\9) {
|
|
344
344
|
grid-template-columns: repeat(3, auto);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
.awsui_segment-count-
|
|
347
|
+
.awsui_segment-count-4_8cbea_10amm_347:not(#\9) {
|
|
348
348
|
grid-template-columns: repeat(4, auto);
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
.awsui_segment-count-
|
|
351
|
+
.awsui_segment-count-5_8cbea_10amm_351:not(#\9) {
|
|
352
352
|
grid-template-columns: repeat(5, auto);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
.awsui_segment-count-
|
|
355
|
+
.awsui_segment-count-6_8cbea_10amm_355:not(#\9) {
|
|
356
356
|
grid-template-columns: repeat(6, auto);
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
.awsui_disabled-reason-
|
|
359
|
+
.awsui_disabled-reason-tooltip_8cbea_10amm_359:not(#\9) {
|
|
360
360
|
/* used in test-utils or tests */
|
|
361
361
|
}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"segment": "
|
|
6
|
-
"refresh": "
|
|
7
|
-
"disabled": "
|
|
8
|
-
"selected": "
|
|
9
|
-
"icon": "
|
|
10
|
-
"with-text": "awsui_with-
|
|
11
|
-
"with-no-text": "awsui_with-no-
|
|
12
|
-
"root": "
|
|
13
|
-
"segment-part": "awsui_segment-
|
|
14
|
-
"select": "
|
|
15
|
-
"segment-count-2": "awsui_segment-count-
|
|
16
|
-
"segment-count-3": "awsui_segment-count-
|
|
17
|
-
"segment-count-4": "awsui_segment-count-
|
|
18
|
-
"segment-count-5": "awsui_segment-count-
|
|
19
|
-
"segment-count-6": "awsui_segment-count-
|
|
20
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
5
|
+
"segment": "awsui_segment_8cbea_10amm_157",
|
|
6
|
+
"refresh": "awsui_refresh_8cbea_10amm_184",
|
|
7
|
+
"disabled": "awsui_disabled_8cbea_10amm_190",
|
|
8
|
+
"selected": "awsui_selected_8cbea_10amm_247",
|
|
9
|
+
"icon": "awsui_icon_8cbea_10amm_257",
|
|
10
|
+
"with-text": "awsui_with-text_8cbea_10amm_261",
|
|
11
|
+
"with-no-text": "awsui_with-no-text_8cbea_10amm_267",
|
|
12
|
+
"root": "awsui_root_8cbea_10amm_272",
|
|
13
|
+
"segment-part": "awsui_segment-part_8cbea_10amm_304",
|
|
14
|
+
"select": "awsui_select_8cbea_10amm_247",
|
|
15
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_10amm_339",
|
|
16
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_10amm_343",
|
|
17
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_10amm_347",
|
|
18
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_10amm_351",
|
|
19
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_10amm_355",
|
|
20
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_10amm_359"
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
2
2
|
import { SpinnerProps } from './interfaces';
|
|
3
|
-
|
|
3
|
+
type InternalSpinnerSize = SpinnerProps.Size | 'x-small';
|
|
4
|
+
interface InternalSpinnerProps extends Omit<SpinnerProps, 'size'>, InternalBaseComponentProps {
|
|
5
|
+
size?: InternalSpinnerSize;
|
|
4
6
|
}
|
|
5
7
|
export default function InternalSpinner({ size, variant, nativeAttributes, __internalRootRef, ...props }: InternalSpinnerProps): JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/spinner/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/spinner/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAK5C,KAAK,mBAAmB,GAAG,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;AAEzD,UAAU,oBAAqB,SAAQ,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,0BAA0B;IAC3F,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAe,EACf,OAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,oBAAoB,eAgBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/spinner/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/spinner/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AASrC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,QAAQ,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,KAAK,EACa;IACrB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,+BAA+B,EAAE,CAAC;IAClC,OAAO,CACL,oBAAC,oBAAoB,OACf,SAAS,EACb,GAAG,EAAC,MAAM,EACV,aAAa,EAAC,SAAS,EACvB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC,EACvG,GAAG,EAAE,iBAAiB;QAEtB,8BAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,GAAI;QAC/D,8BAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,GAAI,CAC3C,CACxB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useModalContextLoadingComponent } from '../internal/hooks/use-modal-component-analytics';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport { SpinnerProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\n// `x-small` is intentionally internal-only: it matches One Theme's x-small status icons and is not part of the public Spinner API\ntype InternalSpinnerSize = SpinnerProps.Size | 'x-small';\n\ninterface InternalSpinnerProps extends Omit<SpinnerProps, 'size'>, InternalBaseComponentProps {\n size?: InternalSpinnerSize;\n}\n\nexport default function InternalSpinner({\n size = 'normal',\n variant = 'normal',\n nativeAttributes,\n __internalRootRef,\n ...props\n}: InternalSpinnerProps) {\n const baseProps = getBaseProps(props);\n useModalContextLoadingComponent();\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"span\"\n componentName=\"Spinner\"\n nativeAttributes={nativeAttributes}\n className={clsx(baseProps.className, styles.root, styles[`size-${size}`], styles[`variant-${variant}`])}\n ref={__internalRootRef}\n >\n <span className={clsx(styles.circle, styles['circle-left'])} />\n <span className={clsx(styles.circle, styles['circle-right'])} />\n </WithNativeAttributes>\n );\n}\n"]}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"spinner-rotator": "awsui_spinner-
|
|
6
|
-
"size-
|
|
7
|
-
"size-
|
|
8
|
-
"size-
|
|
9
|
-
"
|
|
10
|
-
"variant-
|
|
11
|
-
"variant-
|
|
12
|
-
"
|
|
13
|
-
"circle
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
4
|
+
"root": "awsui_root_1612d_w14dj_179",
|
|
5
|
+
"spinner-rotator": "awsui_spinner-rotator_1612d_w14dj_1",
|
|
6
|
+
"size-x-small": "awsui_size-x-small_1612d_w14dj_194",
|
|
7
|
+
"size-normal": "awsui_size-normal_1612d_w14dj_202",
|
|
8
|
+
"size-big": "awsui_size-big_1612d_w14dj_210",
|
|
9
|
+
"size-large": "awsui_size-large_1612d_w14dj_218",
|
|
10
|
+
"variant-normal": "awsui_variant-normal_1612d_w14dj_226",
|
|
11
|
+
"variant-disabled": "awsui_variant-disabled_1612d_w14dj_229",
|
|
12
|
+
"variant-inverted": "awsui_variant-inverted_1612d_w14dj_232",
|
|
13
|
+
"circle": "awsui_circle_1612d_w14dj_244",
|
|
14
|
+
"circle-left": "awsui_circle-left_1612d_w14dj_272",
|
|
15
|
+
"spinner-line-left": "awsui_spinner-line-left_1612d_w14dj_1",
|
|
16
|
+
"circle-right": "awsui_circle-right_1612d_w14dj_277",
|
|
17
|
+
"spinner-line-right": "awsui_spinner-line-right_1612d_w14dj_1"
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -146,7 +146,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
146
146
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
147
147
|
SPDX-License-Identifier: Apache-2.0
|
|
148
148
|
*/
|
|
149
|
-
@keyframes awsui_spinner-
|
|
149
|
+
@keyframes awsui_spinner-rotator_1612d_w14dj_1 {
|
|
150
150
|
0% {
|
|
151
151
|
transform: rotate(var(--awsui-spinner-rotator-from-esndbs));
|
|
152
152
|
}
|
|
@@ -154,7 +154,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
154
154
|
transform: rotate(var(--awsui-spinner-rotator-to-esndbs));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
@keyframes awsui_spinner-line-
|
|
157
|
+
@keyframes awsui_spinner-line-left_1612d_w14dj_1 {
|
|
158
158
|
0% {
|
|
159
159
|
transform: rotate(var(--awsui-spinner-line-left-from-esndbs));
|
|
160
160
|
}
|
|
@@ -165,7 +165,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
165
165
|
transform: rotate(var(--awsui-spinner-line-left-from-esndbs));
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
@keyframes awsui_spinner-line-
|
|
168
|
+
@keyframes awsui_spinner-line-right_1612d_w14dj_1 {
|
|
169
169
|
0% {
|
|
170
170
|
transform: rotate(var(--awsui-spinner-line-right-from-esndbs));
|
|
171
171
|
}
|
|
@@ -176,7 +176,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
176
176
|
transform: rotate(var(--awsui-spinner-line-right-from-esndbs));
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
.
|
|
179
|
+
.awsui_root_1612d_w14dj_179:not(#\9) {
|
|
180
180
|
--awsui-spinner-rotator-from-esndbs: 0deg;
|
|
181
181
|
--awsui-spinner-rotator-to-esndbs: 360deg;
|
|
182
182
|
--awsui-spinner-line-left-from-esndbs: 0deg;
|
|
@@ -186,12 +186,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
display: inline-block;
|
|
187
187
|
vertical-align: top;
|
|
188
188
|
/*stylelint-disable-next-line @cloudscape-design/no-motion-outside-of-mixin */
|
|
189
|
-
animation: awsui_spinner-
|
|
189
|
+
animation: awsui_spinner-rotator_1612d_w14dj_1 0.7s linear infinite;
|
|
190
190
|
box-sizing: border-box;
|
|
191
191
|
line-height: 0;
|
|
192
192
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
193
193
|
}
|
|
194
|
-
.
|
|
194
|
+
.awsui_root_1612d_w14dj_179.awsui_size-x-small_1612d_w14dj_194:not(#\9) {
|
|
195
|
+
inline-size: 12px;
|
|
196
|
+
block-size: 12px;
|
|
197
|
+
padding-block: calc((12px - 10px) / 2);
|
|
198
|
+
padding-inline: calc((12px - 10px) / 2);
|
|
199
|
+
margin-block: calc((var(--line-height-body-s-gako33, 16px) - 12px) / 2);
|
|
200
|
+
box-sizing: border-box;
|
|
201
|
+
}
|
|
202
|
+
.awsui_root_1612d_w14dj_179.awsui_size-normal_1612d_w14dj_202:not(#\9) {
|
|
195
203
|
inline-size: var(--size-icon-normal-311gry, 16px);
|
|
196
204
|
block-size: var(--size-icon-normal-311gry, 16px);
|
|
197
205
|
padding-block: calc((var(--size-icon-normal-311gry, 16px) - 12px) / 2);
|
|
@@ -199,7 +207,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
199
207
|
margin-block: calc((var(--line-height-body-m-5xw6xo, 22px) - var(--size-icon-normal-311gry, 16px)) / 2);
|
|
200
208
|
box-sizing: border-box;
|
|
201
209
|
}
|
|
202
|
-
.
|
|
210
|
+
.awsui_root_1612d_w14dj_179.awsui_size-big_1612d_w14dj_210:not(#\9) {
|
|
203
211
|
inline-size: var(--size-icon-big-z6z1yl, 32px);
|
|
204
212
|
block-size: var(--size-icon-big-z6z1yl, 32px);
|
|
205
213
|
padding-block: calc((var(--size-icon-big-z6z1yl, 32px) - 24px) / 2);
|
|
@@ -207,7 +215,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
207
215
|
margin-block: calc((var(--line-height-heading-xl-pi61pg, 36px) - var(--size-icon-big-z6z1yl, 32px)) / 2);
|
|
208
216
|
box-sizing: border-box;
|
|
209
217
|
}
|
|
210
|
-
.
|
|
218
|
+
.awsui_root_1612d_w14dj_179.awsui_size-large_1612d_w14dj_218:not(#\9) {
|
|
211
219
|
inline-size: var(--size-icon-large-uba15s, 48px);
|
|
212
220
|
block-size: var(--size-icon-large-uba15s, 48px);
|
|
213
221
|
padding-block: calc((var(--size-icon-large-uba15s, 48px) - 36px) / 2);
|
|
@@ -215,16 +223,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
215
223
|
margin-block: calc((var(--line-height-display-l-tjudur, 56px) - var(--size-icon-large-uba15s, 48px)) / 2);
|
|
216
224
|
box-sizing: border-box;
|
|
217
225
|
}
|
|
218
|
-
.
|
|
226
|
+
.awsui_root_1612d_w14dj_179.awsui_variant-normal_1612d_w14dj_226:not(#\9) {
|
|
219
227
|
color: currentColor;
|
|
220
228
|
}
|
|
221
|
-
.
|
|
229
|
+
.awsui_root_1612d_w14dj_179.awsui_variant-disabled_1612d_w14dj_229:not(#\9) {
|
|
222
230
|
color: var(--color-text-status-inactive-fqjc97, #687078);
|
|
223
231
|
}
|
|
224
|
-
.
|
|
232
|
+
.awsui_root_1612d_w14dj_179.awsui_variant-inverted_1612d_w14dj_232:not(#\9) {
|
|
225
233
|
color: var(--color-text-inverted-fflnsl, #ffffff);
|
|
226
234
|
}
|
|
227
|
-
.
|
|
235
|
+
.awsui_root_1612d_w14dj_179:not(#\9):dir(rtl) {
|
|
228
236
|
--awsui-spinner-rotator-from-esndbs: 360deg;
|
|
229
237
|
--awsui-spinner-rotator-to-esndbs: 0deg;
|
|
230
238
|
--awsui-spinner-line-left-from-esndbs: 0deg;
|
|
@@ -233,14 +241,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
233
241
|
--awsui-spinner-line-right-to-esndbs: 30deg;
|
|
234
242
|
}
|
|
235
243
|
|
|
236
|
-
.
|
|
244
|
+
.awsui_circle_1612d_w14dj_244:not(#\9) {
|
|
237
245
|
display: inline-block;
|
|
238
246
|
inline-size: 50%;
|
|
239
247
|
block-size: 100%;
|
|
240
248
|
overflow: hidden;
|
|
241
249
|
position: relative;
|
|
242
250
|
}
|
|
243
|
-
.
|
|
251
|
+
.awsui_circle_1612d_w14dj_244:not(#\9):after {
|
|
244
252
|
position: absolute;
|
|
245
253
|
box-sizing: border-box;
|
|
246
254
|
content: "";
|
|
@@ -253,7 +261,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
253
261
|
border-inline-end-color: transparent;
|
|
254
262
|
border-block-end-color: transparent;
|
|
255
263
|
}
|
|
256
|
-
.
|
|
264
|
+
.awsui_circle_1612d_w14dj_244:not(#\9):after {
|
|
257
265
|
/*stylelint-disable-next-line @cloudscape-design/no-motion-outside-of-mixin */
|
|
258
266
|
animation: 1.5s ease-in-out infinite;
|
|
259
267
|
inset-block-start: 0;
|
|
@@ -261,13 +269,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
261
269
|
block-size: 100%;
|
|
262
270
|
inline-size: 200%;
|
|
263
271
|
}
|
|
264
|
-
.
|
|
272
|
+
.awsui_circle_1612d_w14dj_244.awsui_circle-left_1612d_w14dj_272:not(#\9):after {
|
|
265
273
|
inset-inline-start: 0;
|
|
266
274
|
/*stylelint-disable-next-line @cloudscape-design/no-motion-outside-of-mixin */
|
|
267
|
-
animation-name: awsui_spinner-line-
|
|
275
|
+
animation-name: awsui_spinner-line-left_1612d_w14dj_1;
|
|
268
276
|
}
|
|
269
|
-
.
|
|
277
|
+
.awsui_circle_1612d_w14dj_244.awsui_circle-right_1612d_w14dj_277:not(#\9):after {
|
|
270
278
|
inset-inline-start: -100%;
|
|
271
279
|
/*stylelint-disable-next-line @cloudscape-design/no-motion-outside-of-mixin */
|
|
272
|
-
animation-name: awsui_spinner-line-
|
|
280
|
+
animation-name: awsui_spinner-line-right_1612d_w14dj_1;
|
|
273
281
|
}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"spinner-rotator": "awsui_spinner-
|
|
7
|
-
"size-
|
|
8
|
-
"size-
|
|
9
|
-
"size-
|
|
10
|
-
"
|
|
11
|
-
"variant-
|
|
12
|
-
"variant-
|
|
13
|
-
"
|
|
14
|
-
"circle
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
5
|
+
"root": "awsui_root_1612d_w14dj_179",
|
|
6
|
+
"spinner-rotator": "awsui_spinner-rotator_1612d_w14dj_1",
|
|
7
|
+
"size-x-small": "awsui_size-x-small_1612d_w14dj_194",
|
|
8
|
+
"size-normal": "awsui_size-normal_1612d_w14dj_202",
|
|
9
|
+
"size-big": "awsui_size-big_1612d_w14dj_210",
|
|
10
|
+
"size-large": "awsui_size-large_1612d_w14dj_218",
|
|
11
|
+
"variant-normal": "awsui_variant-normal_1612d_w14dj_226",
|
|
12
|
+
"variant-disabled": "awsui_variant-disabled_1612d_w14dj_229",
|
|
13
|
+
"variant-inverted": "awsui_variant-inverted_1612d_w14dj_232",
|
|
14
|
+
"circle": "awsui_circle_1612d_w14dj_244",
|
|
15
|
+
"circle-left": "awsui_circle-left_1612d_w14dj_272",
|
|
16
|
+
"spinner-line-left": "awsui_spinner-line-left_1612d_w14dj_1",
|
|
17
|
+
"circle-right": "awsui_circle-right_1612d_w14dj_277",
|
|
18
|
+
"spinner-line-right": "awsui_spinner-line-right_1612d_w14dj_1"
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/status-indicator/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,WAAW,4BACf,SAAQ,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,EAChD,0BAA0B;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC,IAAI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+11,23 @@ import { getBaseProps } from '../internal/base-component';
|
|
|
11
11
|
import WithNativeAttributes from '../internal/utils/with-native-attributes';
|
|
12
12
|
import InternalSpinner from '../spinner/internal';
|
|
13
13
|
import styles from './styles.css.js';
|
|
14
|
-
const typeToIcon = size =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
14
|
+
const typeToIcon = size => {
|
|
15
|
+
// Spinner supports a narrower size set than icons (no 'small'/'medium'/'inherit'); map to a valid
|
|
16
|
+
// spinner size so the loading spinner matches the sibling status icons.
|
|
17
|
+
const spinnerSize = size === 'x-small' ? 'x-small' : 'normal';
|
|
18
|
+
return {
|
|
19
|
+
error: React.createElement(InternalIcon, { name: "status-negative", size: size }),
|
|
20
|
+
warning: React.createElement(InternalIcon, { name: "status-warning", size: size }),
|
|
21
|
+
success: React.createElement(InternalIcon, { name: "status-positive", size: size }),
|
|
22
|
+
info: React.createElement(InternalIcon, { name: "status-info", size: size }),
|
|
23
|
+
stopped: React.createElement(InternalIcon, { name: "status-stopped", size: size }),
|
|
24
|
+
pending: React.createElement(InternalIcon, { name: "status-pending", size: size }),
|
|
25
|
+
'in-progress': React.createElement(InternalIcon, { name: "status-in-progress", size: size }),
|
|
26
|
+
loading: React.createElement(InternalSpinner, { size: spinnerSize }),
|
|
27
|
+
'not-started': React.createElement(InternalIcon, { name: "status-not-started", size: size }),
|
|
28
|
+
log: React.createElement(InternalIcon, { name: "dot", size: size }),
|
|
29
|
+
};
|
|
30
|
+
};
|
|
26
31
|
export function InternalStatusIcon({ type, iconAriaLabel, animate, display, size = 'normal', }) {
|
|
27
32
|
return (React.createElement("span", { className: clsx(styles.icon, animate && styles['icon-shake']), "aria-label": iconAriaLabel, role: iconAriaLabel ? 'img' : undefined },
|
|
28
33
|
typeToIcon(size)[type],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/status-indicator/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AAGrF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D;;GAEG;AACH,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAC5E,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAGlD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,MAAM,UAAU,GAA6E,IAAI,CAAC,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/status-indicator/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AAGrF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D;;GAEG;AACH,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAC5E,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAGlD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,MAAM,UAAU,GAA6E,IAAI,CAAC,EAAE;IAClG,kGAAkG;IAClG,wEAAwE;IACxE,MAAM,WAAW,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9D,OAAO;QACL,KAAK,EAAE,oBAAC,YAAY,IAAC,IAAI,EAAC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2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';\n\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n/**\n * @awsuiSystem core\n */\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport InternalSpinner from '../spinner/internal';\nimport { StatusIndicatorProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalStatusIndicatorProps\n extends SomeRequired<StatusIndicatorProps, 'type'>,\n InternalBaseComponentProps {\n /**\n * Play an animation on the error icon when first rendered\n */\n __animate?: boolean;\n\n /**\n * Size of icon.\n */\n __size?: IconProps.Size;\n\n /**\n * The CSS behavior of the status indicator container element.\n */\n __display?: 'inline' | 'inline-block';\n}\n\nconst typeToIcon: (size: IconProps.Size) => Record<StatusIndicatorProps.Type, JSX.Element> = size => {\n // Spinner supports a narrower size set than icons (no 'small'/'medium'/'inherit'); map to a valid\n // spinner size so the loading spinner matches the sibling status icons.\n const spinnerSize = size === 'x-small' ? 'x-small' : 'normal';\n return {\n error: <InternalIcon name=\"status-negative\" size={size} />,\n warning: <InternalIcon name=\"status-warning\" size={size} />,\n success: <InternalIcon name=\"status-positive\" size={size} />,\n info: <InternalIcon name=\"status-info\" size={size} />,\n stopped: <InternalIcon name=\"status-stopped\" size={size} />,\n pending: <InternalIcon name=\"status-pending\" size={size} />,\n 'in-progress': <InternalIcon name=\"status-in-progress\" size={size} />,\n loading: <InternalSpinner size={spinnerSize} />,\n 'not-started': <InternalIcon name=\"status-not-started\" size={size} />,\n log: <InternalIcon name=\"dot\" size={size} />,\n };\n};\n\ninterface InternalStatusIconProps extends Pick<InternalStatusIndicatorProps, 'type' | 'iconAriaLabel'> {\n animate?: InternalStatusIndicatorProps['__animate'];\n size?: InternalStatusIndicatorProps['__size'];\n display?: InternalStatusIndicatorProps['__display'];\n}\n\nexport function InternalStatusIcon({\n type,\n iconAriaLabel,\n animate,\n display,\n size = 'normal',\n}: InternalStatusIconProps) {\n return (\n <span\n className={clsx(styles.icon, animate && styles['icon-shake'])}\n aria-label={iconAriaLabel}\n role={iconAriaLabel ? 'img' : undefined}\n >\n {typeToIcon(size)[type]}\n {display === 'inline' && <> </>}\n </span>\n );\n}\n\nexport default function StatusIndicator({\n type,\n children,\n iconAriaLabel,\n colorOverride,\n wrapText = true,\n nativeAttributes,\n __animate = false,\n __internalRootRef,\n __size = isThemeActive(Theme.OneTheme) ? 'x-small' : 'normal',\n __display = 'inline-block',\n ...rest\n}: InternalStatusIndicatorProps) {\n const baseProps = getBaseProps(rest);\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"span\"\n componentName=\"StatusIndicator\"\n nativeAttributes={nativeAttributes}\n className={clsx(\n styles.root,\n styles[`status-${type}`],\n {\n [styles[`color-override-${colorOverride}`]]: colorOverride,\n },\n baseProps.className\n )}\n ref={__internalRootRef}\n >\n <span\n className={clsx(\n styles.container,\n styles[`display-${__display}`],\n wrapText === false && styles['overflow-ellipsis'],\n __animate && styles['container-fade-in']\n )}\n >\n <InternalStatusIcon\n type={type}\n iconAriaLabel={iconAriaLabel}\n animate={__animate}\n display={__display}\n size={__size}\n />\n <span>{children}</span>\n </span>\n </WithNativeAttributes>\n );\n}\n"]}
|