@cloudscape-design/components-themeable 3.0.1386 → 3.0.1388
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/components/control-group/styles.scss +23 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/forms/mixins.scss +6 -0
- package/lib/internal/scss/segmented-control/segment.scss +15 -0
- package/lib/internal/scss/segmented-control/styles.scss +5 -0
- package/lib/internal/scss/select/parts/styles.scss +1 -2
- package/lib/internal/template/area-chart/model/utils.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/utils.js +4 -0
- package/lib/internal/template/area-chart/model/utils.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +7 -1
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/autosuggest/virtual-list.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/virtual-list.js +16 -5
- package/lib/internal/template/autosuggest/virtual-list.js.map +1 -1
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.th.js +1 -1
- package/lib/internal/template/i18n/messages/all.th.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +679 -678
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js +1 -0
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/control-group/index.d.ts +2 -1
- package/lib/internal/template/internal/components/control-group/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/control-group/index.js +12 -3
- package/lib/internal/template/internal/components/control-group/index.js.map +1 -1
- package/lib/internal/template/internal/components/control-group/styles.css.js +11 -8
- package/lib/internal/template/internal/components/control-group/styles.scoped.css +41 -7
- package/lib/internal/template/internal/components/control-group/styles.selectors.js +11 -8
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +7 -2
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/segmented-control/styles.css.js +26 -26
- package/lib/internal/template/segmented-control/styles.scoped.css +48 -47
- package/lib/internal/template/segmented-control/styles.selectors.js +26 -26
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js +5 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/test-utils/dom/internal/control-group.d.ts +8 -0
- package/lib/internal/template/test-utils/dom/internal/control-group.js +17 -0
- package/lib/internal/template/test-utils/dom/internal/control-group.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/internal/control-group.d.ts +8 -0
- package/lib/internal/template/test-utils/selectors/internal/control-group.js +17 -0
- package/lib/internal/template/test-utils/selectors/internal/control-group.js.map +1 -0
- package/lib/internal/template/token/interfaces.d.ts +1 -1
- package/lib/internal/template/token/interfaces.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"segment": "
|
|
5
|
-
"full-width": "awsui_full-
|
|
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
|
-
"grouped": "
|
|
15
|
-
"grouped-only": "awsui_grouped-
|
|
16
|
-
"grouped-vertical": "awsui_grouped-
|
|
17
|
-
"grouped-horizontal-first": "awsui_grouped-horizontal-
|
|
18
|
-
"grouped-horizontal-middle": "awsui_grouped-horizontal-
|
|
19
|
-
"grouped-horizontal-last": "awsui_grouped-horizontal-
|
|
20
|
-
"grouped-vertical-first": "awsui_grouped-vertical-
|
|
21
|
-
"grouped-vertical-middle": "awsui_grouped-vertical-
|
|
22
|
-
"grouped-vertical-last": "awsui_grouped-vertical-
|
|
23
|
-
"select": "
|
|
24
|
-
"segment-count-2": "awsui_segment-count-
|
|
25
|
-
"segment-count-3": "awsui_segment-count-
|
|
26
|
-
"segment-count-4": "awsui_segment-count-
|
|
27
|
-
"segment-count-5": "awsui_segment-count-
|
|
28
|
-
"segment-count-6": "awsui_segment-count-
|
|
29
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
4
|
+
"segment": "awsui_segment_8cbea_q3zoc_17",
|
|
5
|
+
"full-width": "awsui_full-width_8cbea_q3zoc_44",
|
|
6
|
+
"refresh": "awsui_refresh_8cbea_q3zoc_47",
|
|
7
|
+
"disabled": "awsui_disabled_8cbea_q3zoc_53",
|
|
8
|
+
"selected": "awsui_selected_8cbea_q3zoc_110",
|
|
9
|
+
"icon": "awsui_icon_8cbea_q3zoc_121",
|
|
10
|
+
"with-text": "awsui_with-text_8cbea_q3zoc_125",
|
|
11
|
+
"with-no-text": "awsui_with-no-text_8cbea_q3zoc_131",
|
|
12
|
+
"root": "awsui_root_8cbea_q3zoc_136",
|
|
13
|
+
"segment-part": "awsui_segment-part_8cbea_q3zoc_168",
|
|
14
|
+
"grouped": "awsui_grouped_8cbea_q3zoc_189",
|
|
15
|
+
"grouped-only": "awsui_grouped-only_8cbea_q3zoc_189",
|
|
16
|
+
"grouped-vertical": "awsui_grouped-vertical_8cbea_q3zoc_193",
|
|
17
|
+
"grouped-horizontal-first": "awsui_grouped-horizontal-first_8cbea_q3zoc_204",
|
|
18
|
+
"grouped-horizontal-middle": "awsui_grouped-horizontal-middle_8cbea_q3zoc_208",
|
|
19
|
+
"grouped-horizontal-last": "awsui_grouped-horizontal-last_8cbea_q3zoc_214",
|
|
20
|
+
"grouped-vertical-first": "awsui_grouped-vertical-first_8cbea_q3zoc_218",
|
|
21
|
+
"grouped-vertical-middle": "awsui_grouped-vertical-middle_8cbea_q3zoc_222",
|
|
22
|
+
"grouped-vertical-last": "awsui_grouped-vertical-last_8cbea_q3zoc_228",
|
|
23
|
+
"select": "awsui_select_8cbea_q3zoc_110",
|
|
24
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_q3zoc_245",
|
|
25
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_q3zoc_252",
|
|
26
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_q3zoc_259",
|
|
27
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_q3zoc_266",
|
|
28
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_q3zoc_273",
|
|
29
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_q3zoc_280"
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -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_q3zoc_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;
|
|
@@ -41,27 +41,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
41
41
|
border-block: none;
|
|
42
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_q3zoc_17.awsui_full-width_8cbea_q3zoc_44:not(#\9) {
|
|
45
45
|
justify-content: center;
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):not(.awsui_refresh_8cbea_q3zoc_47) {
|
|
48
48
|
block-size: calc(100% - var(--space-static-xxs-vzto3j, 4px) - 2 * var(--border-width-field-2365x3, 1px));
|
|
49
49
|
}
|
|
50
|
-
.
|
|
50
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):focus {
|
|
51
51
|
outline: none;
|
|
52
52
|
}
|
|
53
|
-
.
|
|
53
|
+
.awsui_segment_8cbea_q3zoc_17.awsui_disabled_8cbea_q3zoc_53:not(#\9) {
|
|
54
54
|
background: var(--awsui-style-background-disabled-ka4djm, var(--color-background-segment-disabled-mjubn7, #ffffff));
|
|
55
55
|
color: var(--awsui-style-color-disabled-ka4djm, var(--color-text-interactive-disabled-tuxgxq, #aab7b8));
|
|
56
56
|
}
|
|
57
|
-
body[data-awsui-focus-visible=true] .
|
|
57
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_q3zoc_17:not(#\9):focus {
|
|
58
58
|
position: relative;
|
|
59
59
|
}
|
|
60
|
-
body[data-awsui-focus-visible=true] .
|
|
60
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_q3zoc_17:not(#\9):focus {
|
|
61
61
|
outline: 2px dotted transparent;
|
|
62
62
|
outline-offset: calc(var(--space-segmented-control-focus-outline-gutter-sz9jgo, 3px) - 1px);
|
|
63
63
|
}
|
|
64
|
-
body[data-awsui-focus-visible=true] .
|
|
64
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_q3zoc_17:not(#\9):focus::before {
|
|
65
65
|
content: " ";
|
|
66
66
|
display: block;
|
|
67
67
|
position: absolute;
|
|
@@ -76,7 +76,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_19w97_17:not(#\9):focus
|
|
|
76
76
|
box-shadow: var(--awsui-style-focus-ring-box-shadow-ka4djm);
|
|
77
77
|
z-index: 1;
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):not(:last-child)::after {
|
|
80
80
|
content: "";
|
|
81
81
|
position: absolute;
|
|
82
82
|
inset-inline-end: calc(-1 * (var(--space-static-xxs-vzto3j, 4px) + 1px));
|
|
@@ -86,53 +86,54 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_19w97_17:not(#\9):focus
|
|
|
86
86
|
background: var(--color-border-segment-divider-mq01bu, #687078);
|
|
87
87
|
z-index: 1;
|
|
88
88
|
}
|
|
89
|
-
.
|
|
89
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):not(.awsui_refresh_8cbea_q3zoc_47):not(:last-child)::after {
|
|
90
90
|
inset-inline-end: calc(-1 * var(--space-static-xxs-vzto3j, 4px));
|
|
91
91
|
}
|
|
92
|
-
.
|
|
92
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):nth-child(1) {
|
|
93
93
|
grid-column: 1;
|
|
94
94
|
}
|
|
95
|
-
.
|
|
95
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):nth-child(2) {
|
|
96
96
|
grid-column: 2;
|
|
97
97
|
}
|
|
98
|
-
.
|
|
98
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):nth-child(3) {
|
|
99
99
|
grid-column: 3;
|
|
100
100
|
}
|
|
101
|
-
.
|
|
101
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):nth-child(4) {
|
|
102
102
|
grid-column: 4;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):nth-child(5) {
|
|
105
105
|
grid-column: 5;
|
|
106
106
|
}
|
|
107
|
-
.
|
|
107
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):nth-child(6) {
|
|
108
108
|
grid-column: 6;
|
|
109
109
|
}
|
|
110
|
-
.
|
|
110
|
+
.awsui_segment_8cbea_q3zoc_17.awsui_selected_8cbea_q3zoc_110:not(#\9) {
|
|
111
111
|
background: var(--awsui-style-background-active-ka4djm, var(--color-background-segment-active-ns5rt6, #0073bb));
|
|
112
112
|
color: var(--awsui-style-color-active-ka4djm, var(--color-text-segment-active-hbbf1h, #ffffff));
|
|
113
|
+
box-shadow: inset 0 0 0 var(--awsui-internal-style-segment-selected-border-width, 0) var(--color-border-segment-active-y8x5lr, #16191f);
|
|
113
114
|
}
|
|
114
|
-
.
|
|
115
|
+
.awsui_segment_8cbea_q3zoc_17:not(#\9):hover:not(.awsui_selected_8cbea_q3zoc_110):not(.awsui_disabled_8cbea_q3zoc_53):not(:focus) {
|
|
115
116
|
background: var(--awsui-style-background-hover-ka4djm, var(--color-background-segment-hover-el4hte, #fafafa));
|
|
116
117
|
color: var(--awsui-style-color-hover-ka4djm, var(--color-text-segment-hover-qq2b2e, #16191f));
|
|
117
118
|
cursor: pointer;
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
.
|
|
121
|
+
.awsui_icon_8cbea_q3zoc_121:not(#\9) {
|
|
121
122
|
/* used in test-utils */
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
.awsui_with-
|
|
125
|
+
.awsui_with-text_8cbea_q3zoc_125:not(#\9) {
|
|
125
126
|
position: relative;
|
|
126
127
|
inset-inline-start: calc(-1 * var(--space-xxs-3o1yoq, 4px));
|
|
127
128
|
margin-inline-end: var(--space-xxs-3o1yoq, 4px);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
.awsui_with-no-
|
|
131
|
+
.awsui_with-no-text_8cbea_q3zoc_131:not(#\9) {
|
|
131
132
|
margin-inline: auto;
|
|
132
133
|
inset-inline: 0;
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
.
|
|
136
|
+
.awsui_root_8cbea_q3zoc_136:not(#\9) {
|
|
136
137
|
border-collapse: separate;
|
|
137
138
|
border-spacing: 0;
|
|
138
139
|
box-sizing: border-box;
|
|
@@ -164,7 +165,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_19w97_17:not(#\9):focus
|
|
|
164
165
|
-moz-osx-font-smoothing: auto;
|
|
165
166
|
}
|
|
166
167
|
|
|
167
|
-
.awsui_segment-
|
|
168
|
+
.awsui_segment-part_8cbea_q3zoc_168:not(#\9) {
|
|
168
169
|
display: inline-grid;
|
|
169
170
|
border-inline: solid var(--border-width-field-2365x3, 1px) var(--color-border-segment-wrapper-ofstpm, #687078);
|
|
170
171
|
border-block: solid var(--border-width-field-2365x3, 1px) var(--color-border-segment-wrapper-ofstpm, #687078);
|
|
@@ -179,103 +180,103 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_19w97_17:not(#\9):focus
|
|
|
179
180
|
padding-inline: calc(var(--space-static-xxs-vzto3j, 4px) - var(--border-width-field-2365x3, 1px));
|
|
180
181
|
gap: calc(var(--space-static-xxs-vzto3j, 4px) * 2 + 1px);
|
|
181
182
|
}
|
|
182
|
-
.awsui_segment-
|
|
183
|
+
.awsui_segment-part_8cbea_q3zoc_168:not(#\9):not(.awsui_refresh_8cbea_q3zoc_47) {
|
|
183
184
|
padding-inline: calc(var(--space-static-xxxs-opeihl, 2px) + var(--border-width-field-2365x3, 1px));
|
|
184
185
|
padding-block: 0;
|
|
185
186
|
gap: calc(var(--space-static-xxs-vzto3j, 4px) * 2 - 1px);
|
|
186
187
|
}
|
|
187
188
|
@media (max-width: 688px) {
|
|
188
|
-
.awsui_segment-
|
|
189
|
+
.awsui_segment-part_8cbea_q3zoc_168:not(#\9):not(.awsui_grouped_8cbea_q3zoc_189), .awsui_segment-part_8cbea_q3zoc_168.awsui_grouped-only_8cbea_q3zoc_189:not(#\9) {
|
|
189
190
|
display: none;
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
|
-
.awsui_segment-
|
|
193
|
+
.awsui_segment-part_8cbea_q3zoc_168.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-vertical_8cbea_q3zoc_193:not(#\9) {
|
|
193
194
|
inline-size: 100%;
|
|
194
195
|
box-sizing: border-box;
|
|
195
196
|
}
|
|
196
197
|
|
|
197
|
-
.
|
|
198
|
+
.awsui_grouped_8cbea_q3zoc_189:not(#\9) {
|
|
198
199
|
border-start-start-radius: var(--border-radius-input-k1q34z, 2px);
|
|
199
200
|
border-start-end-radius: var(--border-radius-input-k1q34z, 2px);
|
|
200
201
|
border-end-start-radius: var(--border-radius-input-k1q34z, 2px);
|
|
201
202
|
border-end-end-radius: var(--border-radius-input-k1q34z, 2px);
|
|
202
203
|
}
|
|
203
|
-
.awsui_grouped-horizontal-
|
|
204
|
+
.awsui_grouped-horizontal-first_8cbea_q3zoc_204:not(#\9) {
|
|
204
205
|
border-start-end-radius: 0;
|
|
205
206
|
border-end-end-radius: 0;
|
|
206
207
|
}
|
|
207
|
-
.awsui_grouped-horizontal-
|
|
208
|
+
.awsui_grouped-horizontal-middle_8cbea_q3zoc_208:not(#\9) {
|
|
208
209
|
border-start-start-radius: 0;
|
|
209
210
|
border-start-end-radius: 0;
|
|
210
211
|
border-end-start-radius: 0;
|
|
211
212
|
border-end-end-radius: 0;
|
|
212
213
|
}
|
|
213
|
-
.awsui_grouped-horizontal-
|
|
214
|
+
.awsui_grouped-horizontal-last_8cbea_q3zoc_214:not(#\9) {
|
|
214
215
|
border-start-start-radius: 0;
|
|
215
216
|
border-end-start-radius: 0;
|
|
216
217
|
}
|
|
217
|
-
.awsui_grouped-vertical-
|
|
218
|
+
.awsui_grouped-vertical-first_8cbea_q3zoc_218:not(#\9) {
|
|
218
219
|
border-end-start-radius: 0;
|
|
219
220
|
border-end-end-radius: 0;
|
|
220
221
|
}
|
|
221
|
-
.awsui_grouped-vertical-
|
|
222
|
+
.awsui_grouped-vertical-middle_8cbea_q3zoc_222:not(#\9) {
|
|
222
223
|
border-start-start-radius: 0;
|
|
223
224
|
border-start-end-radius: 0;
|
|
224
225
|
border-end-start-radius: 0;
|
|
225
226
|
border-end-end-radius: 0;
|
|
226
227
|
}
|
|
227
|
-
.awsui_grouped-vertical-
|
|
228
|
+
.awsui_grouped-vertical-last_8cbea_q3zoc_228:not(#\9) {
|
|
228
229
|
border-start-start-radius: 0;
|
|
229
230
|
border-start-end-radius: 0;
|
|
230
231
|
}
|
|
231
|
-
.
|
|
232
|
+
.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-horizontal-middle_8cbea_q3zoc_208:not(#\9), .awsui_grouped_8cbea_q3zoc_189.awsui_grouped-horizontal-last_8cbea_q3zoc_214:not(#\9) {
|
|
232
233
|
border-inline-start: none;
|
|
233
234
|
}
|
|
234
235
|
|
|
235
|
-
.
|
|
236
|
+
.awsui_select_8cbea_q3zoc_110:not(#\9) {
|
|
236
237
|
display: none;
|
|
237
238
|
}
|
|
238
239
|
@media (max-width: 688px) {
|
|
239
|
-
.
|
|
240
|
+
.awsui_select_8cbea_q3zoc_110:not(#\9):not(.awsui_grouped_8cbea_q3zoc_189), .awsui_select_8cbea_q3zoc_110.awsui_grouped-only_8cbea_q3zoc_189:not(#\9) {
|
|
240
241
|
display: block;
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
|
|
244
|
-
.awsui_segment-count-
|
|
245
|
+
.awsui_segment-count-2_8cbea_q3zoc_245:not(#\9) {
|
|
245
246
|
grid-template-columns: repeat(2, auto);
|
|
246
247
|
}
|
|
247
|
-
.awsui_segment-count-
|
|
248
|
+
.awsui_segment-count-2_8cbea_q3zoc_245.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-vertical_8cbea_q3zoc_193:not(#\9) {
|
|
248
249
|
grid-template-columns: repeat(2, 1fr);
|
|
249
250
|
}
|
|
250
251
|
|
|
251
|
-
.awsui_segment-count-
|
|
252
|
+
.awsui_segment-count-3_8cbea_q3zoc_252:not(#\9) {
|
|
252
253
|
grid-template-columns: repeat(3, auto);
|
|
253
254
|
}
|
|
254
|
-
.awsui_segment-count-
|
|
255
|
+
.awsui_segment-count-3_8cbea_q3zoc_252.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-vertical_8cbea_q3zoc_193:not(#\9) {
|
|
255
256
|
grid-template-columns: repeat(3, 1fr);
|
|
256
257
|
}
|
|
257
258
|
|
|
258
|
-
.awsui_segment-count-
|
|
259
|
+
.awsui_segment-count-4_8cbea_q3zoc_259:not(#\9) {
|
|
259
260
|
grid-template-columns: repeat(4, auto);
|
|
260
261
|
}
|
|
261
|
-
.awsui_segment-count-
|
|
262
|
+
.awsui_segment-count-4_8cbea_q3zoc_259.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-vertical_8cbea_q3zoc_193:not(#\9) {
|
|
262
263
|
grid-template-columns: repeat(4, 1fr);
|
|
263
264
|
}
|
|
264
265
|
|
|
265
|
-
.awsui_segment-count-
|
|
266
|
+
.awsui_segment-count-5_8cbea_q3zoc_266:not(#\9) {
|
|
266
267
|
grid-template-columns: repeat(5, auto);
|
|
267
268
|
}
|
|
268
|
-
.awsui_segment-count-
|
|
269
|
+
.awsui_segment-count-5_8cbea_q3zoc_266.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-vertical_8cbea_q3zoc_193:not(#\9) {
|
|
269
270
|
grid-template-columns: repeat(5, 1fr);
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
.awsui_segment-count-
|
|
273
|
+
.awsui_segment-count-6_8cbea_q3zoc_273:not(#\9) {
|
|
273
274
|
grid-template-columns: repeat(6, auto);
|
|
274
275
|
}
|
|
275
|
-
.awsui_segment-count-
|
|
276
|
+
.awsui_segment-count-6_8cbea_q3zoc_273.awsui_grouped_8cbea_q3zoc_189.awsui_grouped-vertical_8cbea_q3zoc_193:not(#\9) {
|
|
276
277
|
grid-template-columns: repeat(6, 1fr);
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
.awsui_disabled-reason-
|
|
280
|
+
.awsui_disabled-reason-tooltip_8cbea_q3zoc_280:not(#\9) {
|
|
280
281
|
/* used in test-utils or tests */
|
|
281
282
|
}
|
|
@@ -2,31 +2,31 @@
|
|
|
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
|
-
"full-width": "awsui_full-
|
|
7
|
-
"refresh": "
|
|
8
|
-
"disabled": "
|
|
9
|
-
"selected": "
|
|
10
|
-
"icon": "
|
|
11
|
-
"with-text": "awsui_with-
|
|
12
|
-
"with-no-text": "awsui_with-no-
|
|
13
|
-
"root": "
|
|
14
|
-
"segment-part": "awsui_segment-
|
|
15
|
-
"grouped": "
|
|
16
|
-
"grouped-only": "awsui_grouped-
|
|
17
|
-
"grouped-vertical": "awsui_grouped-
|
|
18
|
-
"grouped-horizontal-first": "awsui_grouped-horizontal-
|
|
19
|
-
"grouped-horizontal-middle": "awsui_grouped-horizontal-
|
|
20
|
-
"grouped-horizontal-last": "awsui_grouped-horizontal-
|
|
21
|
-
"grouped-vertical-first": "awsui_grouped-vertical-
|
|
22
|
-
"grouped-vertical-middle": "awsui_grouped-vertical-
|
|
23
|
-
"grouped-vertical-last": "awsui_grouped-vertical-
|
|
24
|
-
"select": "
|
|
25
|
-
"segment-count-2": "awsui_segment-count-
|
|
26
|
-
"segment-count-3": "awsui_segment-count-
|
|
27
|
-
"segment-count-4": "awsui_segment-count-
|
|
28
|
-
"segment-count-5": "awsui_segment-count-
|
|
29
|
-
"segment-count-6": "awsui_segment-count-
|
|
30
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
5
|
+
"segment": "awsui_segment_8cbea_q3zoc_17",
|
|
6
|
+
"full-width": "awsui_full-width_8cbea_q3zoc_44",
|
|
7
|
+
"refresh": "awsui_refresh_8cbea_q3zoc_47",
|
|
8
|
+
"disabled": "awsui_disabled_8cbea_q3zoc_53",
|
|
9
|
+
"selected": "awsui_selected_8cbea_q3zoc_110",
|
|
10
|
+
"icon": "awsui_icon_8cbea_q3zoc_121",
|
|
11
|
+
"with-text": "awsui_with-text_8cbea_q3zoc_125",
|
|
12
|
+
"with-no-text": "awsui_with-no-text_8cbea_q3zoc_131",
|
|
13
|
+
"root": "awsui_root_8cbea_q3zoc_136",
|
|
14
|
+
"segment-part": "awsui_segment-part_8cbea_q3zoc_168",
|
|
15
|
+
"grouped": "awsui_grouped_8cbea_q3zoc_189",
|
|
16
|
+
"grouped-only": "awsui_grouped-only_8cbea_q3zoc_189",
|
|
17
|
+
"grouped-vertical": "awsui_grouped-vertical_8cbea_q3zoc_193",
|
|
18
|
+
"grouped-horizontal-first": "awsui_grouped-horizontal-first_8cbea_q3zoc_204",
|
|
19
|
+
"grouped-horizontal-middle": "awsui_grouped-horizontal-middle_8cbea_q3zoc_208",
|
|
20
|
+
"grouped-horizontal-last": "awsui_grouped-horizontal-last_8cbea_q3zoc_214",
|
|
21
|
+
"grouped-vertical-first": "awsui_grouped-vertical-first_8cbea_q3zoc_218",
|
|
22
|
+
"grouped-vertical-middle": "awsui_grouped-vertical-middle_8cbea_q3zoc_222",
|
|
23
|
+
"grouped-vertical-last": "awsui_grouped-vertical-last_8cbea_q3zoc_228",
|
|
24
|
+
"select": "awsui_select_8cbea_q3zoc_110",
|
|
25
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_q3zoc_245",
|
|
26
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_q3zoc_252",
|
|
27
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_q3zoc_259",
|
|
28
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_q3zoc_266",
|
|
29
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_q3zoc_273",
|
|
30
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_q3zoc_280"
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,6FAqSnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -32,6 +32,10 @@ const InternalSelect = React.forwardRef(({ options, filteringType = 'none', filt
|
|
|
32
32
|
const baseProps = getBaseProps(restProps);
|
|
33
33
|
const formFieldContext = useFormFieldContext(restProps);
|
|
34
34
|
const groupedControlProps = useGroupedControlContext();
|
|
35
|
+
// When grouped, the dropdown is portaled regardless of the public
|
|
36
|
+
// `expandToViewport` prop so it escapes the control slot's stacking context
|
|
37
|
+
// and paints over the group's inline label (which the focus ring stays under).
|
|
38
|
+
const effectiveExpandToViewport = expandToViewport || !!groupedControlProps.position;
|
|
35
39
|
const i18n = useInternalI18n('select');
|
|
36
40
|
const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);
|
|
37
41
|
const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);
|
|
@@ -146,7 +150,7 @@ const InternalSelect = React.forwardRef(({ options, filteringType = 'none', filt
|
|
|
146
150
|
React.createElement("div", { ...baseProps, ref: mergedRef, className: clsx(styles.root, baseProps.className), onKeyDown: handleNativeSearch },
|
|
147
151
|
React.createElement(Dropdown, { ...dropdownProps, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(selectAriaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
|
|
148
152
|
? 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:
|
|
153
|
+
: undefined, open: isOpen, stretchTriggerHeight: !!__inFilteringToken, minWidth: getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth }), maxWidth: getBreakpointValue('xxs'), trigger: trigger, header: dropdownHeader, onMouseDown: handleMouseDown, footer: dropdownFooter, expandToViewport: effectiveExpandToViewport,
|
|
150
154
|
// Forces dropdown position recalculation when new options are loaded
|
|
151
155
|
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
156
|
React.createElement("div", { hidden: true, id: selectAriaLabelId }, ariaLabel || inlineLabelText))));
|
|
@@ -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;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,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AAe,EAC5B,MAAM,EAAE,cAAc,EACtB,gBAAgB,EAAE,gBAAgB;gBAClC,qEAAqE;gBACrE,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;YACF,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,iBAAiB,IACrC,SAAS,IAAI,eAAe,CACzB,CACF,CACqB,CAC9B,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 groupedControlProps = 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 groupedControlProps={groupedControlProps}\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
|
+
{"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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AS,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;YACF,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,iBAAiB,IACrC,SAAS,IAAI,eAAe,CACzB,CACF,CACqB,CAC9B,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 groupedControlProps = useGroupedControlContext();\n\n // When grouped, the dropdown is portaled regardless of the public\n // `expandToViewport` prop so it escapes the control slot's stacking context\n // and paints over the group's inline label (which the focus ring stays under).\n const effectiveExpandToViewport = expandToViewport || !!groupedControlProps.position;\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 groupedControlProps={groupedControlProps}\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: effectiveExpandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\n onMouseDown={handleMouseDown}\n footer={dropdownFooter}\n expandToViewport={effectiveExpandToViewport}\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"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
|
|
2
|
+
export default class ControlGroupWrapper extends ComponentWrapper {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the visible inline label element, or null if no label is set.
|
|
6
|
+
*/
|
|
7
|
+
findInlineLabel(): ElementWrapper | null;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const dom_1 = require("@cloudscape-design/test-utils-core/dom");
|
|
6
|
+
const styles_selectors_js_1 = require("../../../internal/components/control-group/styles.selectors.js");
|
|
7
|
+
class ControlGroupWrapper extends dom_1.ComponentWrapper {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the visible inline label element, or null if no label is set.
|
|
10
|
+
*/
|
|
11
|
+
findInlineLabel() {
|
|
12
|
+
return this.findByClassName(styles_selectors_js_1.default['inline-label']);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
ControlGroupWrapper.rootSelector = styles_selectors_js_1.default['inline-label-wrapper'];
|
|
16
|
+
exports.default = ControlGroupWrapper;
|
|
17
|
+
//# sourceMappingURL=control-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/control-group.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,wGAAoF;AAEpF,MAAqB,mBAAoB,SAAQ,sBAAgB;IAG/D;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,cAAc,CAAC,CAAC,CAAC;IACtD,CAAC;;AAPM,gCAAY,GAAW,6BAAM,CAAC,sBAAsB,CAAC,CAAC;kBAD1C,mBAAmB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
|
|
2
|
+
export default class ControlGroupWrapper extends ComponentWrapper {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the visible inline label element, or null if no label is set.
|
|
6
|
+
*/
|
|
7
|
+
findInlineLabel(): ElementWrapper;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
|
|
6
|
+
const styles_selectors_js_1 = require("../../../internal/components/control-group/styles.selectors.js");
|
|
7
|
+
class ControlGroupWrapper extends selectors_1.ComponentWrapper {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the visible inline label element, or null if no label is set.
|
|
10
|
+
*/
|
|
11
|
+
findInlineLabel() {
|
|
12
|
+
return this.findByClassName(styles_selectors_js_1.default['inline-label']);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
ControlGroupWrapper.rootSelector = styles_selectors_js_1.default['inline-label-wrapper'];
|
|
16
|
+
exports.default = ControlGroupWrapper;
|
|
17
|
+
//# sourceMappingURL=control-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/internal/control-group.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,wGAAoF;AACpF,MAAqB,mBAAoB,SAAQ,4BAAgB;IAG/D;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,cAAc,CAAC,CAAC,CAAC;IACtD,CAAC;;AAPM,gCAAY,GAAW,6BAAM,CAAC,sBAAsB,CAAC,CAAC;kBAD1C,mBAAmB"}
|
|
@@ -23,7 +23,7 @@ export interface TokenProps extends BaseComponentProps {
|
|
|
23
23
|
*
|
|
24
24
|
* When `variant="normal"`, if a description or tags are set, icon size should be `normal`.
|
|
25
25
|
*
|
|
26
|
-
* When `variant="inline"`, icon size should be `small`.
|
|
26
|
+
* When `variant="inline"`, icon size should be `x-small`.
|
|
27
27
|
*/
|
|
28
28
|
icon?: React.ReactNode;
|
|
29
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/token/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface TokenProps extends BaseComponentProps {\n /** Slot for the label of the token as text or an element.\n *\n * For `variant=\"inline\"`, only plain text is supported, for example, strings or numbers.\n */\n label: React.ReactNode;\n\n /**\n * Adds an `aria-label` to the token.\n *\n * Use this if the label is not plain text.\n */\n ariaLabel?: string;\n\n /** A label tag that provides additional guidance, shown next to the label. */\n labelTag?: string;\n\n /** Further information about the token that appears below the label. */\n description?: string;\n\n /** A list of tags giving further guidance about the token. */\n tags?: ReadonlyArray<string>;\n\n /** An icon at the start of the token.\n *\n * When `variant=\"normal\"`, if a description or tags are set, icon size should be `normal`.\n *\n * When `variant=\"inline\"`, icon size should be `small`.\n */\n icon?: React.ReactNode;\n\n /**\n * Specifies the token's visual style and functionality.\n *\n * For `inline` only label, icon and dismiss button are displayed.\n *\n * Defaults to `normal` if not specified.\n */\n variant?: TokenProps.Variant;\n\n /** Determines whether the token is disabled. */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only. A read-only control is still focusable.\n */\n readOnly?: boolean;\n\n /** Adds an `aria-label` to the dismiss button. */\n dismissLabel?: string;\n\n /**\n * Called when the user clicks on the dismiss button.\n *\n * Make sure that you add a listener to this event to update your application state.\n */\n onDismiss?: NonCancelableEventHandler;\n\n /**\n * Content to display in the tooltip when `variant=\"inline\"`. The tooltip appears when the token label is truncated due to insufficient space.\n *\n * Only applies to plain text labels.\n */\n tooltipContent?: string;\n\n /**\n * An object containing CSS properties to customize the token's visual appearance.\n * Refer to the [style](/components/token/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: TokenProps.Style;\n}\n\nexport namespace TokenProps {\n export type Variant = 'normal' | 'inline';\n\n export interface Style {\n root?: {\n background?: {\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n dismissButton?: {\n color?: {\n default?: string;\n disabled?: string;\n hover?: string;\n readOnly?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/token/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface TokenProps extends BaseComponentProps {\n /** Slot for the label of the token as text or an element.\n *\n * For `variant=\"inline\"`, only plain text is supported, for example, strings or numbers.\n */\n label: React.ReactNode;\n\n /**\n * Adds an `aria-label` to the token.\n *\n * Use this if the label is not plain text.\n */\n ariaLabel?: string;\n\n /** A label tag that provides additional guidance, shown next to the label. */\n labelTag?: string;\n\n /** Further information about the token that appears below the label. */\n description?: string;\n\n /** A list of tags giving further guidance about the token. */\n tags?: ReadonlyArray<string>;\n\n /** An icon at the start of the token.\n *\n * When `variant=\"normal\"`, if a description or tags are set, icon size should be `normal`.\n *\n * When `variant=\"inline\"`, icon size should be `x-small`.\n */\n icon?: React.ReactNode;\n\n /**\n * Specifies the token's visual style and functionality.\n *\n * For `inline` only label, icon and dismiss button are displayed.\n *\n * Defaults to `normal` if not specified.\n */\n variant?: TokenProps.Variant;\n\n /** Determines whether the token is disabled. */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only. A read-only control is still focusable.\n */\n readOnly?: boolean;\n\n /** Adds an `aria-label` to the dismiss button. */\n dismissLabel?: string;\n\n /**\n * Called when the user clicks on the dismiss button.\n *\n * Make sure that you add a listener to this event to update your application state.\n */\n onDismiss?: NonCancelableEventHandler;\n\n /**\n * Content to display in the tooltip when `variant=\"inline\"`. The tooltip appears when the token label is truncated due to insufficient space.\n *\n * Only applies to plain text labels.\n */\n tooltipContent?: string;\n\n /**\n * An object containing CSS properties to customize the token's visual appearance.\n * Refer to the [style](/components/token/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: TokenProps.Style;\n}\n\nexport namespace TokenProps {\n export type Variant = 'normal' | 'inline';\n\n export interface Style {\n root?: {\n background?: {\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n dismissButton?: {\n color?: {\n default?: string;\n disabled?: string;\n hover?: string;\n readOnly?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|