@cloudscape-design/components-themeable 3.0.1382 → 3.0.1383
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/container/styles.scss +5 -4
- package/lib/internal/scss/input/styles.scss +4 -0
- package/lib/internal/scss/internal/components/button-trigger/styles.scss +4 -0
- package/lib/internal/scss/internal/components/control-group/styles.scss +36 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +176 -175
- package/lib/internal/scss/internal/styles/forms/mixins.scss +43 -17
- package/lib/internal/scss/segmented-control/styles.scss +19 -4
- package/lib/internal/scss/side-navigation/styles.scss +13 -6
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +50 -50
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/annotation-context/annotation/styles.css.js +13 -13
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +21 -21
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +13 -13
- package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
- package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +32 -32
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +89 -89
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +32 -32
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +6 -6
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +13 -13
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +6 -6
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +30 -30
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +68 -68
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +30 -30
- package/lib/internal/template/attribute-editor/styles.css.js +15 -15
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -28
- package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +28 -28
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/button/styles.css.js +23 -23
- package/lib/internal/template/button/styles.scoped.css +261 -261
- package/lib/internal/template/button/styles.selectors.js +23 -23
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +21 -21
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +37 -37
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +21 -21
- package/lib/internal/template/cards/styles.css.js +39 -39
- package/lib/internal/template/cards/styles.scoped.css +41 -41
- package/lib/internal/template/cards/styles.selectors.js +39 -39
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +10 -10
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/container/style.d.ts +1 -15
- package/lib/internal/template/container/style.d.ts.map +1 -1
- package/lib/internal/template/container/style.js +6 -2
- package/lib/internal/template/container/style.js.map +1 -1
- package/lib/internal/template/container/styles.css.js +34 -34
- package/lib/internal/template/container/styles.scoped.css +87 -87
- package/lib/internal/template/container/styles.selectors.js +34 -34
- package/lib/internal/template/content-layout/styles.css.js +14 -14
- package/lib/internal/template/content-layout/styles.scoped.css +27 -27
- package/lib/internal/template/content-layout/styles.selectors.js +14 -14
- package/lib/internal/template/dropdown/styles.css.js +20 -20
- package/lib/internal/template/dropdown/styles.scoped.css +49 -49
- package/lib/internal/template/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.js +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts +4 -4
- package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
- package/lib/internal/template/file-token-group/styles.css.js +23 -23
- package/lib/internal/template/file-token-group/styles.scoped.css +36 -36
- package/lib/internal/template/file-token-group/styles.selectors.js +23 -23
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +184 -184
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +72 -72
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/input/internal.d.ts.map +1 -1
- package/lib/internal/template/input/internal.js +11 -4
- package/lib/internal/template/input/internal.js.map +1 -1
- package/lib/internal/template/input/styles.css.js +34 -29
- package/lib/internal/template/input/styles.scoped.css +158 -137
- package/lib/internal/template/input/styles.selectors.js +34 -29
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js +4 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.d.ts +2 -0
- package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.js +2 -2
- package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/styles.css.js +19 -14
- package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +53 -33
- package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +19 -14
- package/lib/internal/template/internal/components/control-group/index.d.ts +7 -0
- package/lib/internal/template/internal/components/control-group/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/control-group/index.js +20 -0
- package/lib/internal/template/internal/components/control-group/index.js.map +1 -0
- package/lib/internal/template/internal/components/control-group/styles.css.js +9 -0
- package/lib/internal/template/internal/components/control-group/styles.scoped.css +54 -0
- package/lib/internal/template/internal/components/control-group/styles.selectors.js +10 -0
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.css.js +30 -30
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
- package/lib/internal/template/internal/components/option/styles.css.js +17 -17
- package/lib/internal/template/internal/components/option/styles.scoped.css +31 -31
- package/lib/internal/template/internal/components/option/styles.selectors.js +17 -17
- package/lib/internal/template/internal/components/radio-button/styles.css.js +7 -7
- package/lib/internal/template/internal/components/radio-button/styles.scoped.css +17 -17
- package/lib/internal/template/internal/components/radio-button/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/selectable-item/styles.css.js +22 -22
- package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +57 -57
- package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +22 -22
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +25 -25
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
- package/lib/internal/template/internal/context/control-group-context.d.ts +24 -0
- package/lib/internal/template/internal/context/control-group-context.d.ts.map +1 -0
- package/lib/internal/template/internal/context/control-group-context.js +22 -0
- package/lib/internal/template/internal/context/control-group-context.js.map +1 -0
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts +1 -0
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/lib/internal/template/internal/generated/custom-css-properties/index.js +175 -174
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/item-card/styles.css.js +14 -14
- package/lib/internal/template/item-card/styles.scoped.css +63 -63
- package/lib/internal/template/item-card/styles.selectors.js +14 -14
- package/lib/internal/template/link/styles.css.js +21 -21
- package/lib/internal/template/link/styles.scoped.css +104 -104
- package/lib/internal/template/link/styles.selectors.js +21 -21
- package/lib/internal/template/modal/styles.css.js +31 -31
- package/lib/internal/template/modal/styles.scoped.css +48 -48
- package/lib/internal/template/modal/styles.selectors.js +31 -31
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +12 -9
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/progress-bar/styles.css.js +19 -19
- package/lib/internal/template/progress-bar/styles.scoped.css +58 -58
- package/lib/internal/template/progress-bar/styles.selectors.js +19 -19
- package/lib/internal/template/prompt-input/styles.css.js +26 -26
- package/lib/internal/template/prompt-input/styles.scoped.css +105 -109
- package/lib/internal/template/prompt-input/styles.selectors.js +26 -26
- package/lib/internal/template/segmented-control/internal-segmented-control.d.ts +6 -1
- package/lib/internal/template/segmented-control/internal-segmented-control.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/internal-segmented-control.js +3 -1
- package/lib/internal/template/segmented-control/internal-segmented-control.js.map +1 -1
- package/lib/internal/template/segmented-control/internal.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/internal.js +7 -2
- package/lib/internal/template/segmented-control/internal.js.map +1 -1
- package/lib/internal/template/segmented-control/styles.css.js +21 -16
- package/lib/internal/template/segmented-control/styles.scoped.css +74 -46
- package/lib/internal/template/segmented-control/styles.selectors.js +21 -16
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js +11 -8
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/parts/styles.css.js +21 -21
- package/lib/internal/template/select/parts/styles.scoped.css +24 -24
- package/lib/internal/template/select/parts/styles.selectors.js +21 -21
- package/lib/internal/template/select/parts/trigger.d.ts +2 -0
- package/lib/internal/template/select/parts/trigger.d.ts.map +1 -1
- package/lib/internal/template/select/parts/trigger.js +2 -2
- package/lib/internal/template/select/parts/trigger.js.map +1 -1
- package/lib/internal/template/side-navigation/styles.css.js +64 -64
- package/lib/internal/template/side-navigation/styles.scoped.css +119 -114
- package/lib/internal/template/side-navigation/styles.selectors.js +64 -64
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +165 -165
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/spinner/styles.css.js +14 -14
- package/lib/internal/template/spinner/styles.scoped.css +40 -40
- package/lib/internal/template/spinner/styles.selectors.js +14 -14
- package/lib/internal/template/table/styles.css.js +37 -37
- package/lib/internal/template/table/styles.scoped.css +46 -46
- package/lib/internal/template/table/styles.selectors.js +37 -37
- package/lib/internal/template/tabs/styles.css.js +30 -30
- package/lib/internal/template/tabs/styles.scoped.css +76 -76
- package/lib/internal/template/tabs/styles.selectors.js +30 -30
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +13 -13
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +66 -66
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/textarea/styles.css.js +9 -9
- package/lib/internal/template/textarea/styles.scoped.css +51 -55
- package/lib/internal/template/textarea/styles.selectors.js +9 -9
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +22 -22
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/token/styles.css.js +14 -14
- package/lib/internal/template/token/styles.scoped.css +46 -46
- package/lib/internal/template/token/styles.selectors.js +14 -14
- package/package.json +1 -1
|
@@ -1,21 +1,26 @@
|
|
|
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
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
4
|
+
"segment": "awsui_segment_8cbea_xy00c_17",
|
|
5
|
+
"refresh": "awsui_refresh_8cbea_xy00c_44",
|
|
6
|
+
"disabled": "awsui_disabled_8cbea_xy00c_50",
|
|
7
|
+
"selected": "awsui_selected_8cbea_xy00c_107",
|
|
8
|
+
"icon": "awsui_icon_8cbea_xy00c_117",
|
|
9
|
+
"with-text": "awsui_with-text_8cbea_xy00c_121",
|
|
10
|
+
"with-no-text": "awsui_with-no-text_8cbea_xy00c_127",
|
|
11
|
+
"root": "awsui_root_8cbea_xy00c_132",
|
|
12
|
+
"segment-part": "awsui_segment-part_8cbea_xy00c_164",
|
|
13
|
+
"grouped": "awsui_grouped_8cbea_xy00c_185",
|
|
14
|
+
"grouped-only": "awsui_grouped-only_8cbea_xy00c_185",
|
|
15
|
+
"grouped-first": "awsui_grouped-first_8cbea_xy00c_190",
|
|
16
|
+
"grouped-middle": "awsui_grouped-middle_8cbea_xy00c_196",
|
|
17
|
+
"grouped-last": "awsui_grouped-last_8cbea_xy00c_202",
|
|
18
|
+
"select": "awsui_select_8cbea_xy00c_107",
|
|
19
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_xy00c_227",
|
|
20
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_xy00c_231",
|
|
21
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_xy00c_235",
|
|
22
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_xy00c_239",
|
|
23
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_xy00c_243",
|
|
24
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_xy00c_247"
|
|
20
25
|
};
|
|
21
26
|
|
|
@@ -14,7 +14,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
14
14
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
15
15
|
SPDX-License-Identifier: Apache-2.0
|
|
16
16
|
*/
|
|
17
|
-
.
|
|
17
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9) {
|
|
18
18
|
font-size: var(--font-size-body-m-tq5a14, 14px);
|
|
19
19
|
line-height: var(--line-height-body-m-5xw6xo, 22px);
|
|
20
20
|
word-wrap: break-word;
|
|
@@ -26,8 +26,8 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
26
26
|
letter-spacing: 0.25px;
|
|
27
27
|
padding-block: calc(var(--space-field-vertical-77df8s, 4px) - var(--border-width-field-2365x3, 1px));
|
|
28
28
|
padding-inline: calc(var(--space-button-horizontal-ojp1rq, 20px) - var(--space-static-xxs-vzto3j, 4px));
|
|
29
|
-
background: var(--awsui-style-background-default-
|
|
30
|
-
color: var(--awsui-style-color-default-
|
|
29
|
+
background: var(--awsui-style-background-default-ka4djm, var(--color-background-segment-default-6rgn11, #ffffff));
|
|
30
|
+
color: var(--awsui-style-color-default-ka4djm, var(--color-text-segment-default-nk7mbi, #545b64));
|
|
31
31
|
overflow: visible;
|
|
32
32
|
border-start-start-radius: calc(var(--border-radius-button-9k0hrl, 2px) - (var(--border-width-field-2365x3, 1px) + var(--border-width-button-lffd4t, 1px)));
|
|
33
33
|
border-start-end-radius: calc(var(--border-radius-button-9k0hrl, 2px) - (var(--border-width-field-2365x3, 1px) + var(--border-width-button-lffd4t, 1px)));
|
|
@@ -39,26 +39,26 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
39
39
|
align-items: center;
|
|
40
40
|
border-inline: none;
|
|
41
41
|
border-block: none;
|
|
42
|
-
--awsui-style-focus-ring-box-shadow-
|
|
42
|
+
--awsui-style-focus-ring-box-shadow-ka4djm: 0 0 0 var(--awsui-style-focus-ring-border-width-ka4djm, 2px) var(--awsui-style-focus-ring-border-color-ka4djm, var(--color-border-item-focused-sewkzn, #0073bb));
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):not(.awsui_refresh_8cbea_xy00c_44) {
|
|
45
45
|
block-size: calc(100% - var(--space-static-xxs-vzto3j, 4px) - 2 * var(--border-width-field-2365x3, 1px));
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):focus {
|
|
48
48
|
outline: none;
|
|
49
49
|
}
|
|
50
|
-
.
|
|
51
|
-
background: var(--awsui-style-background-disabled-
|
|
52
|
-
color: var(--awsui-style-color-disabled-
|
|
50
|
+
.awsui_segment_8cbea_xy00c_17.awsui_disabled_8cbea_xy00c_50:not(#\9) {
|
|
51
|
+
background: var(--awsui-style-background-disabled-ka4djm, var(--color-background-segment-disabled-mjubn7, #ffffff));
|
|
52
|
+
color: var(--awsui-style-color-disabled-ka4djm, var(--color-text-interactive-disabled-tuxgxq, #aab7b8));
|
|
53
53
|
}
|
|
54
|
-
body[data-awsui-focus-visible=true] .
|
|
54
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_xy00c_17:not(#\9):focus {
|
|
55
55
|
position: relative;
|
|
56
56
|
}
|
|
57
|
-
body[data-awsui-focus-visible=true] .
|
|
57
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_xy00c_17:not(#\9):focus {
|
|
58
58
|
outline: 2px dotted transparent;
|
|
59
59
|
outline-offset: calc(var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px) - 1px);
|
|
60
60
|
}
|
|
61
|
-
body[data-awsui-focus-visible=true] .
|
|
61
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_xy00c_17:not(#\9):focus::before {
|
|
62
62
|
content: " ";
|
|
63
63
|
display: block;
|
|
64
64
|
position: absolute;
|
|
@@ -66,14 +66,14 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_17mt7_17:not(#\9):focus
|
|
|
66
66
|
inset-block-start: calc(-1 * var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px));
|
|
67
67
|
inline-size: calc(100% + var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px) + var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px));
|
|
68
68
|
block-size: calc(100% + var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px) + var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px));
|
|
69
|
-
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-
|
|
70
|
-
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-
|
|
71
|
-
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-
|
|
72
|
-
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-
|
|
73
|
-
box-shadow: var(--awsui-style-focus-ring-box-shadow-
|
|
69
|
+
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-ka4djm, var(--border-radius-control-default-focus-ring-akwhsf, 2px));
|
|
70
|
+
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-ka4djm, var(--border-radius-control-default-focus-ring-akwhsf, 2px));
|
|
71
|
+
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-ka4djm, var(--border-radius-control-default-focus-ring-akwhsf, 2px));
|
|
72
|
+
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-ka4djm, var(--border-radius-control-default-focus-ring-akwhsf, 2px));
|
|
73
|
+
box-shadow: var(--awsui-style-focus-ring-box-shadow-ka4djm);
|
|
74
74
|
z-index: 1;
|
|
75
75
|
}
|
|
76
|
-
.
|
|
76
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):not(:last-child)::after {
|
|
77
77
|
content: "";
|
|
78
78
|
position: absolute;
|
|
79
79
|
inset-inline-end: calc(-1 * (var(--space-static-xxs-vzto3j, 4px) + 1px));
|
|
@@ -83,53 +83,53 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_17mt7_17:not(#\9):focus
|
|
|
83
83
|
background: var(--color-border-segment-divider-mq01bu, #687078);
|
|
84
84
|
z-index: 1;
|
|
85
85
|
}
|
|
86
|
-
.
|
|
86
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):not(.awsui_refresh_8cbea_xy00c_44):not(:last-child)::after {
|
|
87
87
|
inset-inline-end: calc(-1 * var(--space-static-xxs-vzto3j, 4px));
|
|
88
88
|
}
|
|
89
|
-
.
|
|
89
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):nth-child(1) {
|
|
90
90
|
grid-column: 1;
|
|
91
91
|
}
|
|
92
|
-
.
|
|
92
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):nth-child(2) {
|
|
93
93
|
grid-column: 2;
|
|
94
94
|
}
|
|
95
|
-
.
|
|
95
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):nth-child(3) {
|
|
96
96
|
grid-column: 3;
|
|
97
97
|
}
|
|
98
|
-
.
|
|
98
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):nth-child(4) {
|
|
99
99
|
grid-column: 4;
|
|
100
100
|
}
|
|
101
|
-
.
|
|
101
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):nth-child(5) {
|
|
102
102
|
grid-column: 5;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):nth-child(6) {
|
|
105
105
|
grid-column: 6;
|
|
106
106
|
}
|
|
107
|
-
.
|
|
108
|
-
background: var(--awsui-style-background-active-
|
|
109
|
-
color: var(--awsui-style-color-active-
|
|
107
|
+
.awsui_segment_8cbea_xy00c_17.awsui_selected_8cbea_xy00c_107:not(#\9) {
|
|
108
|
+
background: var(--awsui-style-background-active-ka4djm, var(--color-background-segment-active-ns5rt6, #0073bb));
|
|
109
|
+
color: var(--awsui-style-color-active-ka4djm, var(--color-text-segment-active-hbbf1h, #ffffff));
|
|
110
110
|
}
|
|
111
|
-
.
|
|
112
|
-
background: var(--awsui-style-background-hover-
|
|
113
|
-
color: var(--awsui-style-color-hover-
|
|
111
|
+
.awsui_segment_8cbea_xy00c_17:not(#\9):hover:not(.awsui_selected_8cbea_xy00c_107):not(.awsui_disabled_8cbea_xy00c_50):not(:focus) {
|
|
112
|
+
background: var(--awsui-style-background-hover-ka4djm, var(--color-background-segment-hover-el4hte, #fafafa));
|
|
113
|
+
color: var(--awsui-style-color-hover-ka4djm, var(--color-text-segment-hover-qq2b2e, #16191f));
|
|
114
114
|
cursor: pointer;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.
|
|
117
|
+
.awsui_icon_8cbea_xy00c_117:not(#\9) {
|
|
118
118
|
/* used in test-utils */
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
.awsui_with-
|
|
121
|
+
.awsui_with-text_8cbea_xy00c_121:not(#\9) {
|
|
122
122
|
position: relative;
|
|
123
123
|
inset-inline-start: calc(-1 * var(--space-xxs-3o1yoq, 4px));
|
|
124
124
|
margin-inline-end: var(--space-xxs-3o1yoq, 4px);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.awsui_with-no-
|
|
127
|
+
.awsui_with-no-text_8cbea_xy00c_127:not(#\9) {
|
|
128
128
|
margin-inline: auto;
|
|
129
129
|
inset-inline: 0;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
.
|
|
132
|
+
.awsui_root_8cbea_xy00c_132:not(#\9) {
|
|
133
133
|
border-collapse: separate;
|
|
134
134
|
border-spacing: 0;
|
|
135
135
|
box-sizing: border-box;
|
|
@@ -161,7 +161,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_17mt7_17:not(#\9):focus
|
|
|
161
161
|
-moz-osx-font-smoothing: auto;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
.awsui_segment-
|
|
164
|
+
.awsui_segment-part_8cbea_xy00c_164:not(#\9) {
|
|
165
165
|
display: inline-grid;
|
|
166
166
|
border-inline: solid var(--border-width-field-2365x3, 1px) var(--color-border-segment-wrapper-ofstpm, #687078);
|
|
167
167
|
border-block: solid var(--border-width-field-2365x3, 1px) var(--color-border-segment-wrapper-ofstpm, #687078);
|
|
@@ -176,46 +176,74 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_17mt7_17:not(#\9):focus
|
|
|
176
176
|
padding-inline: calc(var(--space-static-xxs-vzto3j, 4px) - var(--border-width-field-2365x3, 1px));
|
|
177
177
|
gap: calc(var(--space-static-xxs-vzto3j, 4px) * 2 + 1px);
|
|
178
178
|
}
|
|
179
|
-
.awsui_segment-
|
|
179
|
+
.awsui_segment-part_8cbea_xy00c_164:not(#\9):not(.awsui_refresh_8cbea_xy00c_44) {
|
|
180
180
|
padding-inline: calc(var(--space-static-xxxs-opeihl, 2px) + var(--border-width-field-2365x3, 1px));
|
|
181
181
|
padding-block: 0;
|
|
182
182
|
gap: calc(var(--space-static-xxs-vzto3j, 4px) * 2 - 1px);
|
|
183
183
|
}
|
|
184
184
|
@media (max-width: 688px) {
|
|
185
|
-
.awsui_segment-
|
|
185
|
+
.awsui_segment-part_8cbea_xy00c_164:not(#\9):not(.awsui_grouped_8cbea_xy00c_185), .awsui_segment-part_8cbea_xy00c_164.awsui_grouped-only_8cbea_xy00c_185:not(#\9) {
|
|
186
186
|
display: none;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
.
|
|
190
|
+
.awsui_grouped_8cbea_xy00c_185.awsui_grouped-first_8cbea_xy00c_190:not(#\9) {
|
|
191
|
+
border-start-start-radius: var(--border-radius-input-k1q34z, 2px);
|
|
192
|
+
border-end-start-radius: var(--border-radius-input-k1q34z, 2px);
|
|
193
|
+
border-start-end-radius: 0;
|
|
194
|
+
border-end-end-radius: 0;
|
|
195
|
+
}
|
|
196
|
+
.awsui_grouped_8cbea_xy00c_185.awsui_grouped-middle_8cbea_xy00c_196:not(#\9) {
|
|
197
|
+
border-start-start-radius: 0;
|
|
198
|
+
border-start-end-radius: 0;
|
|
199
|
+
border-end-start-radius: 0;
|
|
200
|
+
border-end-end-radius: 0;
|
|
201
|
+
}
|
|
202
|
+
.awsui_grouped_8cbea_xy00c_185.awsui_grouped-last_8cbea_xy00c_202:not(#\9) {
|
|
203
|
+
border-start-end-radius: var(--border-radius-input-k1q34z, 2px);
|
|
204
|
+
border-end-end-radius: var(--border-radius-input-k1q34z, 2px);
|
|
205
|
+
border-start-start-radius: 0;
|
|
206
|
+
border-end-start-radius: 0;
|
|
207
|
+
}
|
|
208
|
+
.awsui_grouped_8cbea_xy00c_185.awsui_grouped-only_8cbea_xy00c_185:not(#\9) {
|
|
209
|
+
border-start-start-radius: var(--border-radius-input-k1q34z, 2px);
|
|
210
|
+
border-start-end-radius: var(--border-radius-input-k1q34z, 2px);
|
|
211
|
+
border-end-start-radius: var(--border-radius-input-k1q34z, 2px);
|
|
212
|
+
border-end-end-radius: var(--border-radius-input-k1q34z, 2px);
|
|
213
|
+
}
|
|
214
|
+
.awsui_grouped_8cbea_xy00c_185.awsui_grouped-middle_8cbea_xy00c_196:not(#\9), .awsui_grouped_8cbea_xy00c_185.awsui_grouped-last_8cbea_xy00c_202:not(#\9) {
|
|
215
|
+
border-inline-start: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.awsui_select_8cbea_xy00c_107:not(#\9) {
|
|
191
219
|
display: none;
|
|
192
220
|
}
|
|
193
221
|
@media (max-width: 688px) {
|
|
194
|
-
.
|
|
222
|
+
.awsui_select_8cbea_xy00c_107:not(#\9):not(.awsui_grouped_8cbea_xy00c_185), .awsui_select_8cbea_xy00c_107.awsui_grouped-only_8cbea_xy00c_185:not(#\9) {
|
|
195
223
|
display: block;
|
|
196
224
|
}
|
|
197
225
|
}
|
|
198
226
|
|
|
199
|
-
.awsui_segment-count-
|
|
227
|
+
.awsui_segment-count-2_8cbea_xy00c_227:not(#\9) {
|
|
200
228
|
grid-template-columns: repeat(2, auto);
|
|
201
229
|
}
|
|
202
230
|
|
|
203
|
-
.awsui_segment-count-
|
|
231
|
+
.awsui_segment-count-3_8cbea_xy00c_231:not(#\9) {
|
|
204
232
|
grid-template-columns: repeat(3, auto);
|
|
205
233
|
}
|
|
206
234
|
|
|
207
|
-
.awsui_segment-count-
|
|
235
|
+
.awsui_segment-count-4_8cbea_xy00c_235:not(#\9) {
|
|
208
236
|
grid-template-columns: repeat(4, auto);
|
|
209
237
|
}
|
|
210
238
|
|
|
211
|
-
.awsui_segment-count-
|
|
239
|
+
.awsui_segment-count-5_8cbea_xy00c_239:not(#\9) {
|
|
212
240
|
grid-template-columns: repeat(5, auto);
|
|
213
241
|
}
|
|
214
242
|
|
|
215
|
-
.awsui_segment-count-
|
|
243
|
+
.awsui_segment-count-6_8cbea_xy00c_243:not(#\9) {
|
|
216
244
|
grid-template-columns: repeat(6, auto);
|
|
217
245
|
}
|
|
218
246
|
|
|
219
|
-
.awsui_disabled-reason-
|
|
247
|
+
.awsui_disabled-reason-tooltip_8cbea_xy00c_247:not(#\9) {
|
|
220
248
|
/* used in test-utils or tests */
|
|
221
249
|
}
|
|
@@ -2,21 +2,26 @@
|
|
|
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
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
5
|
+
"segment": "awsui_segment_8cbea_xy00c_17",
|
|
6
|
+
"refresh": "awsui_refresh_8cbea_xy00c_44",
|
|
7
|
+
"disabled": "awsui_disabled_8cbea_xy00c_50",
|
|
8
|
+
"selected": "awsui_selected_8cbea_xy00c_107",
|
|
9
|
+
"icon": "awsui_icon_8cbea_xy00c_117",
|
|
10
|
+
"with-text": "awsui_with-text_8cbea_xy00c_121",
|
|
11
|
+
"with-no-text": "awsui_with-no-text_8cbea_xy00c_127",
|
|
12
|
+
"root": "awsui_root_8cbea_xy00c_132",
|
|
13
|
+
"segment-part": "awsui_segment-part_8cbea_xy00c_164",
|
|
14
|
+
"grouped": "awsui_grouped_8cbea_xy00c_185",
|
|
15
|
+
"grouped-only": "awsui_grouped-only_8cbea_xy00c_185",
|
|
16
|
+
"grouped-first": "awsui_grouped-first_8cbea_xy00c_190",
|
|
17
|
+
"grouped-middle": "awsui_grouped-middle_8cbea_xy00c_196",
|
|
18
|
+
"grouped-last": "awsui_grouped-last_8cbea_xy00c_202",
|
|
19
|
+
"select": "awsui_select_8cbea_xy00c_107",
|
|
20
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_xy00c_227",
|
|
21
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_xy00c_231",
|
|
22
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_xy00c_235",
|
|
23
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_xy00c_239",
|
|
24
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_xy00c_243",
|
|
25
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_xy00c_247"
|
|
21
26
|
};
|
|
22
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgB3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAc3C,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IAC3G,kBAAkB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACxC;AAED,QAAA,MAAM,cAAc,6FAgSnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { getBreakpointValue } from '../internal/breakpoints';
|
|
|
10
10
|
import DropdownFooter from '../internal/components/dropdown-footer';
|
|
11
11
|
import { useDropdownStatus } from '../internal/components/dropdown-status';
|
|
12
12
|
import { prepareOptions } from '../internal/components/option/utils/prepare-options.js';
|
|
13
|
+
import { ResetGroupedControlContext, useGroupedControlContext } from '../internal/context/control-group-context';
|
|
13
14
|
import { useFormFieldContext } from '../internal/context/form-field-context';
|
|
14
15
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
15
16
|
import checkControlled from '../internal/hooks/check-controlled';
|
|
@@ -30,6 +31,7 @@ const InternalSelect = React.forwardRef(({ options, filteringType = 'none', filt
|
|
|
30
31
|
var _a;
|
|
31
32
|
const baseProps = getBaseProps(restProps);
|
|
32
33
|
const formFieldContext = useFormFieldContext(restProps);
|
|
34
|
+
const { position: groupedControlPosition } = useGroupedControlContext();
|
|
33
35
|
const i18n = useInternalI18n('select');
|
|
34
36
|
const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);
|
|
35
37
|
const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);
|
|
@@ -82,7 +84,7 @@ const InternalSelect = React.forwardRef(({ options, filteringType = 'none', filt
|
|
|
82
84
|
const customDropdownHeader = renderDropdownHeader === null || renderDropdownHeader === void 0 ? void 0 : renderDropdownHeader(dropdownContentProps);
|
|
83
85
|
const customDropdownFooter = renderDropdownFooter === null || renderDropdownFooter === void 0 ? void 0 : renderDropdownFooter(dropdownContentProps);
|
|
84
86
|
const filter = (React.createElement(Filter, { clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue, ...getFilterProps() }));
|
|
85
|
-
const trigger = (React.createElement(Trigger, { renderOption: renderOption, ref: triggerRef, placeholder: placeholder, disabled: disabled, readOnly: readOnly, triggerVariant: triggerVariant, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption: selectedOption, isOpen: isOpen, inFilteringToken: __inFilteringToken, inlineLabelText: inlineLabelText, ...formFieldContext, controlId: controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId) }));
|
|
87
|
+
const trigger = (React.createElement(Trigger, { renderOption: renderOption, ref: triggerRef, placeholder: placeholder, disabled: disabled, readOnly: readOnly, triggerVariant: triggerVariant, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption: selectedOption, isOpen: isOpen, inFilteringToken: __inFilteringToken, groupedControlPosition: groupedControlPosition, inlineLabelText: inlineLabelText, ...formFieldContext, controlId: controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId) }));
|
|
86
88
|
const isEmpty = !options || options.length === 0;
|
|
87
89
|
const isNoMatch = filteredOptions && filteredOptions.length === 0;
|
|
88
90
|
const isFiltered = filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;
|
|
@@ -140,13 +142,14 @@ const InternalSelect = React.forwardRef(({ options, filteringType = 'none', filt
|
|
|
140
142
|
const dropdownProps = getDropdownProps();
|
|
141
143
|
const hasOptions = useRef(options.length > 0);
|
|
142
144
|
hasOptions.current = hasOptions.current || options.length > 0;
|
|
143
|
-
return (React.createElement(
|
|
144
|
-
React.createElement(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
return (React.createElement(ResetGroupedControlContext, null,
|
|
146
|
+
React.createElement("div", { ...baseProps, ref: mergedRef, className: clsx(styles.root, baseProps.className), onKeyDown: handleNativeSearch },
|
|
147
|
+
React.createElement(Dropdown, { ...dropdownProps, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(selectAriaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
|
|
148
|
+
? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)
|
|
149
|
+
: undefined, open: isOpen, stretchTriggerHeight: !!__inFilteringToken, minWidth: getDropdownMinWidth({ expandToViewport, triggerWidth }), maxWidth: getBreakpointValue('xxs'), trigger: trigger, header: dropdownHeader, onMouseDown: handleMouseDown, footer: dropdownFooter, expandToViewport: expandToViewport,
|
|
150
|
+
// Forces dropdown position recalculation when new options are loaded
|
|
151
|
+
contentKey: hasOptions.current.toString(), content: React.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, renderOption: renderOption, menuProps: menuProps, getOptionProps: getOptionProps, filteredOptions: filteredOptions, filteringValue: filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, screenReaderContent: announcement, highlightType: highlightType }) }),
|
|
152
|
+
React.createElement("div", { hidden: true, id: selectAriaLabelId }, ariaLabel || inlineLabelText))));
|
|
150
153
|
});
|
|
151
154
|
export default InternalSelect;
|
|
152
155
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;A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AClC,qEAAqE;YACrE,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,EACzC,OAAO,EACL,oBAAC,aAAa,IACZ,UAAU,EACR,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CACzB,oBAAC,cAAc,IAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,GAAI,CAClF,CAAC,CAAC,CAAC,IAAI,EAEV,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,aAAa,EAClB,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,mBAAmB,EAAE,YAAY,EACjC,aAAa,EAAE,aAAa,GAC5B,GAEJ;QACF,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,iBAAiB,IACrC,SAAS,IAAI,eAAe,CACzB,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { OptionGroup } from '../types/option';\nimport { SelectProps } from './interfaces';\nimport Filter from './parts/filter';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport Trigger from './parts/trigger';\nimport VirtualList from './parts/virtual-list';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { composeDropdownContent } from './utils/dropdown-customization';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { useSelect } from './utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: 'root' | 'nested';\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n inlineLabelText,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref<SelectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => entry.borderBoxWidth > 0 && setTriggerWidth(entry.borderBoxWidth)\n );\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n focusActiveRef,\n closeDropdown,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n dropdownRole,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && !readOnly,\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const dropdownContentProps: SelectProps.DropdownContentProps = { filterText: filteringValue, closeDropdown };\n const customDropdownHeader = renderDropdownHeader?.(dropdownContentProps);\n const customDropdownFooter = renderDropdownFooter?.(dropdownContentProps);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n renderOption={renderOption}\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId)}\n />\n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: () => {\n handleRecoveryClick();\n focusActiveRef();\n },\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null;\n const { header: dropdownHeader, footer: dropdownFooter } = composeDropdownContent({\n filter,\n customDropdownHeader,\n customDropdownFooter,\n statusFooter,\n dropdownHeaderClass: styles['dropdown-header'],\n dropdownFooterClass: styles['dropdown-footer'],\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby),\n ariaRequired,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyDown={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={isOpen}\n stretchTriggerHeight={!!__inFilteringToken}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\n onMouseDown={handleMouseDown}\n footer={dropdownFooter}\n expandToViewport={expandToViewport}\n // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n renderOption={renderOption}\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n }\n />\n <div hidden={true} id={selectAriaLabelId}>\n {ariaLabel || inlineLabelText}\n </div>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvH,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAGxE,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,SAA8B,MAAM,oBAAoB,CAAC;AAChE,OAAO,OAAO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,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options.js';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../internal/context/control-group-context';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { OptionGroup } from '../types/option';\nimport { SelectProps } from './interfaces';\nimport Filter from './parts/filter';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport Trigger from './parts/trigger';\nimport VirtualList from './parts/virtual-list';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { composeDropdownContent } from './utils/dropdown-customization';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { useSelect } from './utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: 'root' | 'nested';\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n inlineLabelText,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref<SelectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const { position: groupedControlPosition } = useGroupedControlContext();\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => entry.borderBoxWidth > 0 && setTriggerWidth(entry.borderBoxWidth)\n );\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n focusActiveRef,\n closeDropdown,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n dropdownRole,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && !readOnly,\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const dropdownContentProps: SelectProps.DropdownContentProps = { filterText: filteringValue, closeDropdown };\n const customDropdownHeader = renderDropdownHeader?.(dropdownContentProps);\n const customDropdownFooter = renderDropdownFooter?.(dropdownContentProps);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n renderOption={renderOption}\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n groupedControlPosition={groupedControlPosition}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId)}\n />\n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: () => {\n handleRecoveryClick();\n focusActiveRef();\n },\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null;\n const { header: dropdownHeader, footer: dropdownFooter } = composeDropdownContent({\n filter,\n customDropdownHeader,\n customDropdownFooter,\n statusFooter,\n dropdownHeaderClass: styles['dropdown-header'],\n dropdownFooterClass: styles['dropdown-footer'],\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby),\n ariaRequired,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <ResetGroupedControlContext>\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyDown={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={isOpen}\n stretchTriggerHeight={!!__inFilteringToken}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\n onMouseDown={handleMouseDown}\n footer={dropdownFooter}\n expandToViewport={expandToViewport}\n // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n renderOption={renderOption}\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n }\n />\n <div hidden={true} id={selectAriaLabelId}>\n {ariaLabel || inlineLabelText}\n </div>\n </div>\n </ResetGroupedControlContext>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"placeholder": "
|
|
5
|
-
"disabled": "
|
|
6
|
-
"item": "
|
|
7
|
-
"checkbox": "
|
|
8
|
-
"option-group": "awsui_option-
|
|
9
|
-
"filter": "
|
|
10
|
-
"trigger": "
|
|
11
|
-
"layout-strut": "awsui_layout-
|
|
12
|
-
"list-bottom": "awsui_list-
|
|
13
|
-
"selected-icon": "awsui_selected-
|
|
14
|
-
"show-label-tag": "awsui_show-label-
|
|
15
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
16
|
-
"inline-token-list": "awsui_inline-token-
|
|
17
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
18
|
-
"inline-token-counter": "awsui_inline-token-
|
|
19
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
20
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
21
|
-
"inline-label": "awsui_inline-
|
|
22
|
-
"inline-label-disabled": "awsui_inline-label-
|
|
23
|
-
"inline-label-inline-tokens": "awsui_inline-label-inline-
|
|
24
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
4
|
+
"placeholder": "awsui_placeholder_dwuol_wsgh3_9",
|
|
5
|
+
"disabled": "awsui_disabled_dwuol_wsgh3_14",
|
|
6
|
+
"item": "awsui_item_dwuol_wsgh3_18",
|
|
7
|
+
"checkbox": "awsui_checkbox_dwuol_wsgh3_22",
|
|
8
|
+
"option-group": "awsui_option-group_dwuol_wsgh3_31",
|
|
9
|
+
"filter": "awsui_filter_dwuol_wsgh3_35",
|
|
10
|
+
"trigger": "awsui_trigger_dwuol_wsgh3_40",
|
|
11
|
+
"layout-strut": "awsui_layout-strut_dwuol_wsgh3_46",
|
|
12
|
+
"list-bottom": "awsui_list-bottom_dwuol_wsgh3_52",
|
|
13
|
+
"selected-icon": "awsui_selected-icon_dwuol_wsgh3_56",
|
|
14
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_wsgh3_61",
|
|
15
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_wsgh3_65",
|
|
16
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_wsgh3_72",
|
|
17
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_wsgh3_86",
|
|
18
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_wsgh3_92",
|
|
19
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_wsgh3_96",
|
|
20
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_wsgh3_100",
|
|
21
|
+
"inline-label": "awsui_inline-label_dwuol_wsgh3_96",
|
|
22
|
+
"inline-label-disabled": "awsui_inline-label-disabled_dwuol_wsgh3_125",
|
|
23
|
+
"inline-label-inline-tokens": "awsui_inline-label-inline-tokens_dwuol_wsgh3_129",
|
|
24
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_wsgh3_134"
|
|
25
25
|
};
|
|
26
26
|
|