@cloudscape-design/components 3.0.1409 → 3.0.1411
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/autosuggest/index.d.ts.map +1 -1
- package/autosuggest/index.js +1 -1
- package/autosuggest/index.js.map +1 -1
- package/autosuggest/internal.d.ts +8 -1
- package/autosuggest/internal.d.ts.map +1 -1
- package/autosuggest/internal.js +2 -2
- package/autosuggest/internal.js.map +1 -1
- package/autosuggest/styles.css.js +3 -3
- package/autosuggest/styles.scoped.css +5 -3
- package/autosuggest/styles.selectors.js +3 -3
- package/button/styles.css.js +24 -24
- package/button/styles.scoped.css +83 -79
- package/button/styles.selectors.js +24 -24
- package/cards/index.js +1 -1
- package/cards/index.js.map +1 -1
- package/container/internal.d.ts +3 -2
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +2 -2
- package/container/internal.js.map +1 -1
- package/container/use-sticky-header.d.ts +0 -14
- package/container/use-sticky-header.d.ts.map +1 -1
- package/container/use-sticky-header.js +9 -92
- package/container/use-sticky-header.js.map +1 -1
- package/copy-to-clipboard/internal.d.ts.map +1 -1
- package/copy-to-clipboard/internal.js +16 -50
- package/copy-to-clipboard/internal.js.map +1 -1
- package/copy-to-clipboard/styles.css.js +5 -10
- package/copy-to-clipboard/styles.scoped.css +6 -38
- package/copy-to-clipboard/styles.selectors.js +5 -10
- package/flashbar/collapsible-flashbar.d.ts +1 -0
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +10 -4
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/flash.d.ts +6 -0
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +6 -6
- package/flashbar/flash.js.map +1 -1
- package/flashbar/internal-interfaces.d.ts +11 -1
- package/flashbar/internal-interfaces.d.ts.map +1 -1
- package/flashbar/internal-interfaces.js.map +1 -1
- package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/non-collapsible-flashbar.js +8 -1
- package/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +184 -161
- package/flashbar/styles.selectors.js +50 -50
- package/icon/generated/icons.d.ts +4 -0
- package/icon/generated/icons.d.ts.map +1 -1
- package/icon/generated/icons.js +14 -0
- package/icon/generated/icons.js.map +1 -1
- package/icon/styles.css.js +44 -43
- package/icon/styles.scoped.css +109 -107
- package/icon/styles.selectors.js +44 -43
- package/icon-provider/interfaces.d.ts +1 -1
- package/icon-provider/interfaces.d.ts.map +1 -1
- package/icon-provider/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/base-theme/styles.scoped.css +1 -0
- package/internal/components/autosuggest-input/index.d.ts +5 -0
- package/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/internal/components/autosuggest-input/index.js +2 -2
- package/internal/components/autosuggest-input/index.js.map +1 -1
- package/internal/components/option/index.d.ts.map +1 -1
- package/internal/components/option/index.js +2 -2
- package/internal/components/option/index.js.map +1 -1
- package/internal/components/option/styles.css.js +19 -18
- package/internal/components/option/styles.scoped.css +39 -33
- package/internal/components/option/styles.selectors.js +19 -18
- package/internal/components/radio-button/index.d.ts +1 -1
- package/internal/components/radio-button/index.d.ts.map +1 -1
- package/internal/components/radio-button/index.js.map +1 -1
- package/internal/components/radio-button/styles.css.js +7 -7
- package/internal/components/radio-button/styles.scoped.css +36 -12
- package/internal/components/radio-button/styles.selectors.js +7 -7
- package/internal/components/sortable-area/index.d.ts.map +1 -1
- package/internal/components/sortable-area/index.js +34 -4
- package/internal/components/sortable-area/index.js.map +1 -1
- package/internal/components/sortable-area/keyboard-sensor/index.js +1 -1
- package/internal/components/sortable-area/keyboard-sensor/index.js.map +1 -1
- package/{table → internal/components/sticky-header}/sticky-scrolling.d.ts +1 -6
- package/internal/components/sticky-header/sticky-scrolling.d.ts.map +1 -0
- package/{table → internal/components/sticky-header}/sticky-scrolling.js +2 -7
- package/internal/components/sticky-header/sticky-scrolling.js.map +1 -0
- package/internal/components/sticky-header/use-cells-resize-observer.d.ts +1 -0
- package/internal/components/sticky-header/use-cells-resize-observer.d.ts.map +1 -0
- package/internal/components/sticky-header/use-cells-resize-observer.js +39 -0
- package/internal/components/sticky-header/use-cells-resize-observer.js.map +1 -0
- package/internal/components/sticky-header/use-header-stuck.d.ts +7 -0
- package/internal/components/sticky-header/use-header-stuck.d.ts.map +1 -0
- package/internal/components/sticky-header/use-header-stuck.js +35 -0
- package/internal/components/sticky-header/use-header-stuck.js.map +1 -0
- package/internal/components/sticky-header/use-sticky-header-copy.d.ts +19 -0
- package/internal/components/sticky-header/use-sticky-header-copy.d.ts.map +1 -0
- package/{table/use-sticky-header.js → internal/components/sticky-header/use-sticky-header-copy.js} +7 -8
- package/internal/components/sticky-header/use-sticky-header-copy.js.map +1 -0
- package/internal/components/sticky-header/use-sticky-position.d.ts +27 -0
- package/internal/components/sticky-header/use-sticky-position.d.ts.map +1 -0
- package/internal/components/sticky-header/use-sticky-position.js +57 -0
- package/internal/components/sticky-header/use-sticky-position.js.map +1 -0
- package/internal/components/sticky-scrollbar/index.d.ts.map +1 -0
- package/internal/components/sticky-scrollbar/index.js.map +1 -0
- package/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.d.ts +2 -1
- package/internal/components/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -0
- package/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.js +8 -5
- package/internal/components/sticky-scrollbar/sticky-scrollbar.js.map +1 -0
- package/internal/components/sticky-scrollbar/styles.css.js +11 -0
- package/{table → internal/components}/sticky-scrollbar/styles.scoped.css +8 -8
- package/internal/components/sticky-scrollbar/styles.selectors.js +12 -0
- package/{table → internal/components}/sticky-scrollbar/use-sticky-scrollbar.d.ts +11 -2
- package/internal/components/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -0
- package/{table → internal/components}/sticky-scrollbar/use-sticky-scrollbar.js +17 -16
- package/internal/components/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -0
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +4 -0
- package/internal/generated/theming/index.d.cts +9 -0
- package/internal/generated/theming/index.d.ts +9 -0
- package/internal/generated/theming/index.js +4 -0
- package/internal/manifest.json +1 -1
- package/manifest.json +2 -2
- package/multiselect/index.d.ts.map +1 -1
- package/multiselect/index.js +1 -1
- package/multiselect/index.js.map +1 -1
- package/multiselect/internal.d.ts +12 -1
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +9 -5
- package/multiselect/internal.js.map +1 -1
- package/multiselect/styles.css.js +5 -5
- package/multiselect/styles.scoped.css +17 -5
- package/multiselect/styles.selectors.js +5 -5
- package/package.json +1 -1
- package/radio-button/styles.css.js +1 -1
- package/radio-button/styles.scoped.css +1 -25
- package/radio-button/styles.selectors.js +1 -1
- package/radio-group/internal.d.ts +7 -1
- package/radio-group/internal.d.ts.map +1 -1
- package/radio-group/internal.js +2 -2
- package/radio-group/internal.js.map +1 -1
- package/radio-group/styles.css.js +5 -5
- package/radio-group/styles.scoped.css +7 -6
- package/radio-group/styles.selectors.js +5 -5
- package/segmented-control/internal-segmented-control.d.ts +4 -1
- package/segmented-control/internal-segmented-control.d.ts.map +1 -1
- package/segmented-control/internal-segmented-control.js +3 -3
- package/segmented-control/internal-segmented-control.js.map +1 -1
- package/segmented-control/internal.d.ts +11 -1
- package/segmented-control/internal.d.ts.map +1 -1
- package/segmented-control/internal.js +3 -2
- package/segmented-control/internal.js.map +1 -1
- package/segmented-control/segment.d.ts +2 -0
- package/segmented-control/segment.d.ts.map +1 -1
- package/segmented-control/segment.js +4 -2
- package/segmented-control/segment.js.map +1 -1
- package/segmented-control/styles.css.js +31 -31
- package/segmented-control/styles.scoped.css +119 -82
- package/segmented-control/styles.selectors.js +31 -31
- package/select/index.d.ts.map +1 -1
- package/select/index.js +1 -1
- package/select/index.js.map +1 -1
- package/select/internal.d.ts +8 -0
- package/select/internal.d.ts.map +1 -1
- package/select/internal.js +4 -4
- package/select/internal.js.map +1 -1
- package/select/parts/styles.css.js +22 -21
- package/select/parts/styles.scoped.css +28 -24
- package/select/parts/styles.selectors.js +22 -21
- package/select/parts/trigger.d.ts +6 -0
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +4 -4
- package/select/parts/trigger.js.map +1 -1
- package/select/styles.css.js +3 -3
- package/select/styles.scoped.css +14 -3
- package/select/styles.selectors.js +3 -3
- package/styling/autosuggest.scss +1 -0
- package/styling/flashbar.scss +127 -0
- package/styling/multiselect.scss +80 -0
- package/styling/radio-group.scss +1 -0
- package/styling/segmented-control.scss +111 -0
- package/styling/select.scss +80 -0
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +1 -1
- package/table/internal.js.map +1 -1
- package/table/resizer/styles.css.js +17 -17
- package/table/resizer/styles.scoped.css +30 -29
- package/table/resizer/styles.selectors.js +17 -17
- package/table/sticky-header.d.ts.map +1 -1
- package/table/sticky-header.js +8 -2
- package/table/sticky-header.js.map +1 -1
- package/table/styles.css.js +37 -37
- package/table/styles.scoped.css +47 -47
- package/table/styles.selectors.js +37 -37
- package/table/use-column-widths.d.ts.map +1 -1
- package/table/use-column-widths.js +4 -16
- package/table/use-column-widths.js.map +1 -1
- package/table-root/internal.d.ts.map +1 -1
- package/table-root/internal.js +17 -3
- package/table-root/internal.js.map +1 -1
- package/table-root/styles.css.js +5 -5
- package/table-root/styles.scoped.css +10 -6
- package/table-root/styles.selectors.js +5 -5
- package/tabs/styles.css.js +30 -31
- package/tabs/styles.scoped.css +51 -67
- package/tabs/styles.selectors.js +30 -31
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +5 -54
- package/tabs/tab-header-bar.js.map +1 -1
- package/token/styles.css.js +14 -14
- package/token/styles.scoped.css +25 -24
- package/token/styles.selectors.js +14 -14
- package/token-group/internal.d.ts +5 -0
- package/token-group/internal.d.ts.map +1 -1
- package/token-group/internal.js +2 -2
- package/token-group/internal.js.map +1 -1
- package/table/sticky-scrollbar/index.d.ts.map +0 -1
- package/table/sticky-scrollbar/index.js.map +0 -1
- package/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +0 -1
- package/table/sticky-scrollbar/sticky-scrollbar.js.map +0 -1
- package/table/sticky-scrollbar/styles.css.js +0 -11
- package/table/sticky-scrollbar/styles.selectors.js +0 -12
- package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +0 -1
- package/table/sticky-scrollbar/use-sticky-scrollbar.js.map +0 -1
- package/table/sticky-scrolling.d.ts.map +0 -1
- package/table/sticky-scrolling.js.map +0 -1
- package/table/use-sticky-header.d.ts +0 -5
- package/table/use-sticky-header.d.ts.map +0 -1
- package/table/use-sticky-header.js.map +0 -1
- /package/{table → internal/components}/sticky-scrollbar/index.d.ts +0 -0
- /package/{table → internal/components}/sticky-scrollbar/index.js +0 -0
|
@@ -334,6 +334,7 @@ export declare interface TypedOverride {
|
|
|
334
334
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
335
335
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
336
336
|
fontDecorationStyleLink?: GlobalValue;
|
|
337
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
337
338
|
fontDecorationThicknessLink?: GlobalValue;
|
|
338
339
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
339
340
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -814,6 +815,7 @@ export declare interface TypedOverride {
|
|
|
814
815
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
815
816
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
816
817
|
fontDecorationStyleLink?: GlobalValue;
|
|
818
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
817
819
|
fontDecorationThicknessLink?: GlobalValue;
|
|
818
820
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
819
821
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -1294,6 +1296,7 @@ export declare interface TypedOverride {
|
|
|
1294
1296
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1295
1297
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1296
1298
|
fontDecorationStyleLink?: GlobalValue;
|
|
1299
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
1297
1300
|
fontDecorationThicknessLink?: GlobalValue;
|
|
1298
1301
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
1299
1302
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -1774,6 +1777,7 @@ export declare interface TypedOverride {
|
|
|
1774
1777
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1775
1778
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1776
1779
|
fontDecorationStyleLink?: GlobalValue;
|
|
1780
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
1777
1781
|
fontDecorationThicknessLink?: GlobalValue;
|
|
1778
1782
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
1779
1783
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -2254,6 +2258,7 @@ export declare interface TypedOverride {
|
|
|
2254
2258
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2255
2259
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2256
2260
|
fontDecorationStyleLink?: GlobalValue;
|
|
2261
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
2257
2262
|
fontDecorationThicknessLink?: GlobalValue;
|
|
2258
2263
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
2259
2264
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -2734,6 +2739,7 @@ export declare interface TypedOverride {
|
|
|
2734
2739
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2735
2740
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2736
2741
|
fontDecorationStyleLink?: GlobalValue;
|
|
2742
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
2737
2743
|
fontDecorationThicknessLink?: GlobalValue;
|
|
2738
2744
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
2739
2745
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3214,6 +3220,7 @@ export declare interface TypedOverride {
|
|
|
3214
3220
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3215
3221
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3216
3222
|
fontDecorationStyleLink?: GlobalValue;
|
|
3223
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
3217
3224
|
fontDecorationThicknessLink?: GlobalValue;
|
|
3218
3225
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
3219
3226
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3694,6 +3701,7 @@ export declare interface TypedOverride {
|
|
|
3694
3701
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3695
3702
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3696
3703
|
fontDecorationStyleLink?: GlobalValue;
|
|
3704
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
3697
3705
|
fontDecorationThicknessLink?: GlobalValue;
|
|
3698
3706
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
3699
3707
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -4174,6 +4182,7 @@ export declare interface TypedOverride {
|
|
|
4174
4182
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
4175
4183
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
4176
4184
|
fontDecorationStyleLink?: GlobalValue;
|
|
4185
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
4177
4186
|
fontDecorationThicknessLink?: GlobalValue;
|
|
4178
4187
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
4179
4188
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3259,6 +3259,7 @@ export var preset = {
|
|
|
3259
3259
|
"fontButtonLetterSpacing": "0.005em",
|
|
3260
3260
|
"fontChartDetailSize": "{fontSizeBodyS}",
|
|
3261
3261
|
"fontDecorationStyleLink": "solid",
|
|
3262
|
+
"fontDecorationLineButtonInlineLink": "none",
|
|
3262
3263
|
"fontDecorationLineLinkSecondary": "none",
|
|
3263
3264
|
"fontDecorationThicknessLink": "1px",
|
|
3264
3265
|
"fontDecorationThicknessLinkDisplayL": "2px",
|
|
@@ -17045,6 +17046,7 @@ export var preset = {
|
|
|
17045
17046
|
"colorTextBadgeRed",
|
|
17046
17047
|
"colorBackgroundCodeView",
|
|
17047
17048
|
"fontDecorationStyleLink",
|
|
17049
|
+
"fontDecorationLineButtonInlineLink",
|
|
17048
17050
|
"fontDecorationThicknessLink",
|
|
17049
17051
|
"fontDecorationThicknessLinkDisplayL",
|
|
17050
17052
|
"fontSizeExpandableHeading",
|
|
@@ -18572,6 +18574,7 @@ export var preset = {
|
|
|
18572
18574
|
"fontButtonLetterSpacing": "font-button-letter-spacing",
|
|
18573
18575
|
"fontChartDetailSize": "font-chart-detail-size",
|
|
18574
18576
|
"fontDecorationStyleLink": "font-decoration-style-link",
|
|
18577
|
+
"fontDecorationLineButtonInlineLink": "font-decoration-line-button-inline-link",
|
|
18575
18578
|
"fontDecorationLineLinkSecondary": "font-decoration-line-link-secondary",
|
|
18576
18579
|
"fontDecorationThicknessLink": "font-decoration-thickness-link",
|
|
18577
18580
|
"fontDecorationThicknessLinkDisplayL": "font-decoration-thickness-link-display-l",
|
|
@@ -19746,6 +19749,7 @@ export var preset = {
|
|
|
19746
19749
|
"fontButtonLetterSpacing": "--font-button-letter-spacing-ki7gj3",
|
|
19747
19750
|
"fontChartDetailSize": "--font-chart-detail-size-5il5az",
|
|
19748
19751
|
"fontDecorationStyleLink": "--font-decoration-style-link-azri03",
|
|
19752
|
+
"fontDecorationLineButtonInlineLink": "--font-decoration-line-button-inline-link-14tvpm",
|
|
19749
19753
|
"fontDecorationLineLinkSecondary": "--font-decoration-line-link-secondary-henot1",
|
|
19750
19754
|
"fontDecorationThicknessLink": "--font-decoration-thickness-link-ue2y2g",
|
|
19751
19755
|
"fontDecorationThicknessLinkDisplayL": "--font-decoration-thickness-link-display-l-9280qx",
|
package/internal/manifest.json
CHANGED
package/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAuEhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
|
package/multiselect/index.js
CHANGED
|
@@ -46,7 +46,7 @@ const Multiselect = React.forwardRef(({ options = [], filteringType = 'none', st
|
|
|
46
46
|
.map(option => { var _a; return `${(_a = option.label) !== null && _a !== void 0 ? _a : option.value}`; }),
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
|
-
return (React.createElement(InternalMultiselect, { renderOption: renderOption, options: options, filteringType: filteringType, statusType: statusType, selectedOptions: selectedOptions, keepOpen: keepOpen, hideTokens: hideTokens, ...restProps, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }) }));
|
|
49
|
+
return (React.createElement(InternalMultiselect, { renderOption: renderOption, options: options, filteringType: filteringType, statusType: statusType, selectedOptions: selectedOptions, keepOpen: keepOpen, hideTokens: hideTokens, ...restProps, ...baseComponentProps, styleClassNames: restProps.styleClassNames, ref: ref, ...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }) }));
|
|
50
50
|
});
|
|
51
51
|
applyDisplayName(Multiselect, 'Multiselect');
|
|
52
52
|
export default Multiselect;
|
package/multiselect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,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;QACzB,KAAK,EAAE,IAAI,+BAA+B,CAAC,gBAAgB,CAAC,EAAE;QAC9D,UAAU,EAAE;YACV,QAAQ,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE;YACnC,oBAAoB,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE;YACjD,qBAAqB,EAAE,eAAe;iBACnC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;iBAC5C,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;YACnC,eAAe,EAAE,eAAe;iBAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;gBAC7C,uFAAuF;gBACvF,2BAA2B;iBAC1B,GAAG,CAAC,MAAM,CAAC,EAAE,WAAC,OAAA,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,MAAM,CAAC,KAAK,EAAE,CAAA,EAAA,CAAC;SACpD;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,KAClB,SAAS,KACT,kBAAkB,EACtB,eAAe,EAAG,SAAmD,CAAC,eAAe,EACrF,GAAG,EAAE,GAAG,KACJ,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,GAC5E,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataMultiselectComponent } from './analytics-metadata/interfaces';\nimport { MultiselectProps } from './interfaces';\nimport InternalMultiselect, { StyleClassNames } from './internal';\n\nimport buttonTriggerAnalyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';\n\nexport { MultiselectProps };\n\nconst Multiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n selectedOptions = [],\n keepOpen = true,\n hideTokens = false,\n renderOption,\n ...restProps\n }: MultiselectProps,\n ref: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Multiselect', {\n props: {\n inlineTokens: restProps.inlineTokens,\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n hideTokens,\n keepOpen,\n tokenLimit: restProps.tokenLimit,\n virtualScroll: restProps.virtualScroll,\n readOnly: restProps.readOnly,\n enableSelectAll: restProps.enableSelectAll,\n dropdownRole: restProps.dropdownRole,\n },\n metadata: {\n hasInlineLabel: Boolean(restProps.inlineLabelText),\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\n hasDropdownHeader: Boolean(restProps.renderDropdownHeader),\n hasDropdownFooter: Boolean(restProps.renderDropdownFooter),\n hasDropdownAriaDescribedby: Boolean(restProps.dropdownAriaDescribedby),\n },\n });\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataMultiselectComponent = {\n name: 'awsui.Multiselect',\n label: `.${buttonTriggerAnalyticsSelectors['button-trigger']}`,\n properties: {\n disabled: `${!!restProps.disabled}`,\n selectedOptionsCount: `${selectedOptions.length}`,\n selectedOptionsValues: selectedOptions\n .filter(option => option.value !== undefined)\n .map(option => `${option.value}`),\n selectedOptions: selectedOptions\n .filter(option => option.value !== undefined)\n // fallback on value when label's undefined because in the dropdown if there's no label\n // the value will be shown.\n .map(option => `${option.label ?? option.value}`),\n },\n };\n\n return (\n <InternalMultiselect\n renderOption={renderOption}\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n selectedOptions={selectedOptions}\n keepOpen={keepOpen}\n hideTokens={hideTokens}\n {...restProps}\n {...baseComponentProps}\n styleClassNames={(restProps as { styleClassNames?: StyleClassNames }).styleClassNames}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n"]}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleClassNames as InputStyleClassNames } from '../input/internal';
|
|
2
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';
|
|
4
|
+
import { StyleClassNames as TokenStyleClassNames } from '../token/internal';
|
|
3
5
|
import { MultiselectProps } from './interfaces';
|
|
6
|
+
export interface StyleClassNames {
|
|
7
|
+
trigger?: string;
|
|
8
|
+
inlineLabel?: string;
|
|
9
|
+
filter?: InputStyleClassNames;
|
|
10
|
+
dropdown?: string;
|
|
11
|
+
token?: TokenStyleClassNames;
|
|
12
|
+
}
|
|
4
13
|
declare const InternalMultiselect: React.ForwardRefExoticComponent<MultiselectProps & {
|
|
5
14
|
filteringType: import("../dropdown/interfaces").OptionsFilteringType;
|
|
6
15
|
statusType: import("../types/dropdown-status").DropdownStatusProps.StatusType;
|
|
@@ -8,5 +17,7 @@ declare const InternalMultiselect: React.ForwardRefExoticComponent<MultiselectPr
|
|
|
8
17
|
selectedOptions: ReadonlyArray<MultiselectProps.Option>;
|
|
9
18
|
keepOpen: boolean;
|
|
10
19
|
hideTokens: boolean;
|
|
11
|
-
} & InternalBaseComponentProps &
|
|
20
|
+
} & InternalBaseComponentProps & {
|
|
21
|
+
styleClassNames?: StyleClassNames;
|
|
22
|
+
} & React.RefAttributes<MultiselectProps.Ref>>;
|
|
12
23
|
export default InternalMultiselect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAOhD,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAQ5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAS3F,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAchD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAID,QAAA,MAAM,mBAAmB;;;;;;;;sBAdH,eAAe;8CA8QpC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/multiselect/internal.js
CHANGED
|
@@ -22,7 +22,7 @@ import { composeDropdownContent } from '../select/utils/dropdown-customization';
|
|
|
22
22
|
import InternalTokenGroup from '../token-group/internal';
|
|
23
23
|
import { useMultiselect } from './use-multiselect';
|
|
24
24
|
import styles from './styles.css.js';
|
|
25
|
-
const InternalMultiselect = React.forwardRef(({ options, filteringType, filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, ariaRequired, placeholder, disabled, readOnly, ariaLabel, inlineLabelText, selectedOptions, deselectAriaLabel, tokenLimit, i18nStrings, virtualScroll, inlineTokens, hideTokens, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef, autoFocus, enableSelectAll, renderOption, renderDropdownHeader, renderDropdownFooter, dropdownRole, dropdownAriaDescribedby, ...restProps }, externalRef) => {
|
|
25
|
+
const InternalMultiselect = React.forwardRef(({ options, filteringType, filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, ariaRequired, placeholder, disabled, readOnly, ariaLabel, inlineLabelText, selectedOptions, deselectAriaLabel, tokenLimit, i18nStrings, virtualScroll, inlineTokens, hideTokens, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef, autoFocus, enableSelectAll, renderOption, renderDropdownHeader, renderDropdownFooter, dropdownRole, dropdownAriaDescribedby, styleClassNames, ...restProps }, externalRef) => {
|
|
26
26
|
var _a;
|
|
27
27
|
const baseProps = getBaseProps(restProps);
|
|
28
28
|
const formFieldContext = useFormFieldContext(restProps);
|
|
@@ -75,11 +75,15 @@ const InternalMultiselect = React.forwardRef(({ options, filteringType, filterin
|
|
|
75
75
|
};
|
|
76
76
|
const customDropdownHeader = renderDropdownHeader === null || renderDropdownHeader === void 0 ? void 0 : renderDropdownHeader(dropdownContentProps);
|
|
77
77
|
const customDropdownFooter = renderDropdownFooter === null || renderDropdownFooter === void 0 ? void 0 : renderDropdownFooter(dropdownContentProps);
|
|
78
|
-
const filter = (React.createElement(Filter, { clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue, ...multiselectProps.getFilterProps() }));
|
|
78
|
+
const filter = (React.createElement(Filter, { clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue, styleClassNames: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.filter, ...multiselectProps.getFilterProps() }));
|
|
79
79
|
const triggerRef = useRef(null);
|
|
80
80
|
const [triggerWidth, setTriggerWidth] = useState(null);
|
|
81
81
|
useResizeObserver(() => triggerRef.current, entry => setTriggerWidth(entry.borderBoxWidth));
|
|
82
|
-
const trigger = (React.createElement(Trigger, { ref: triggerRef, placeholder: placeholder, disabled: disabled, readOnly: readOnly, triggerProps: multiselectProps.getTriggerProps(disabled, autoFocus), selectedOption: null, selectedOptions: selectedOptions, triggerVariant: showTokensInline ? 'tokens' : 'placeholder', isOpen: multiselectProps.isOpen, groupedControlProps: groupedControlProps, inlineLabelText: inlineLabelText,
|
|
82
|
+
const trigger = (React.createElement(Trigger, { ref: triggerRef, placeholder: placeholder, disabled: disabled, readOnly: readOnly, triggerProps: multiselectProps.getTriggerProps(disabled, autoFocus), selectedOption: null, selectedOptions: selectedOptions, triggerVariant: showTokensInline ? 'tokens' : 'placeholder', isOpen: multiselectProps.isOpen, groupedControlProps: groupedControlProps, inlineLabelText: inlineLabelText, styleClassNames: {
|
|
83
|
+
trigger: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.trigger,
|
|
84
|
+
inlineLabel: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.inlineLabel,
|
|
85
|
+
token: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.token,
|
|
86
|
+
}, ...formFieldContext, controlId: controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, ariaLabelId) }));
|
|
83
87
|
const tokens = selectedOptions.map(option => ({
|
|
84
88
|
label: option.label,
|
|
85
89
|
disabled,
|
|
@@ -115,12 +119,12 @@ const InternalMultiselect = React.forwardRef(({ options, filteringType, filterin
|
|
|
115
119
|
hasOptions.current = hasOptions.current || options.length > 0;
|
|
116
120
|
return (React.createElement(ResetGroupedControlContext, null,
|
|
117
121
|
React.createElement("div", { ...baseProps, ref: __internalRootRef, className: clsx(styles.root, baseProps.className), ...multiselectProps.getWrapperProps() },
|
|
118
|
-
React.createElement(Dropdown, { ...dropdownProps, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
|
|
122
|
+
React.createElement(Dropdown, { ...dropdownProps, styleClassNames: { container: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.dropdown }, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
|
|
119
123
|
? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)
|
|
120
124
|
: undefined, open: multiselectProps.isOpen, minWidth: getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth }), maxWidth: getBreakpointValue('xxs'), trigger: trigger, header: dropdownHeader, footer: dropdownFooter, expandToViewport: effectiveExpandToViewport,
|
|
121
125
|
// Forces dropdown position recalculation when new options are loaded
|
|
122
126
|
contentKey: hasOptions.current.toString(), content: React.createElement(ListComponent, { renderOption: renderOption, listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, menuProps: { ...multiselectProps.getMenuProps(), ariaRequired }, getOptionProps: multiselectProps.getOptionProps, filteredOptions: multiselectProps.filteredOptions, filteringValue: filteringValue, ref: multiselectProps.scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups: true, screenReaderContent: multiselectProps.announcement, highlightType: multiselectProps.highlightType, firstOptionSticky: hasFilteredOptions && enableSelectAll, isMultiSelect: true }) }),
|
|
123
|
-
showTokens && (React.createElement(InternalTokenGroup, { ...multiselectProps.getTokenProps(), className: styles.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true, readOnly: readOnly, isItemReadOnly: item => item._readOnly })),
|
|
127
|
+
showTokens && (React.createElement(InternalTokenGroup, { ...multiselectProps.getTokenProps(), className: styles.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true, readOnly: readOnly, isItemReadOnly: item => item._readOnly, styleClassNames: { token: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.token } })),
|
|
124
128
|
React.createElement(ScreenreaderOnly, { id: ariaLabelId }, ariaLabel || inlineLabelText))));
|
|
125
129
|
});
|
|
126
130
|
export default InternalMultiselect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAGhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAA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SAAS,IAAI,eAAe,CAAoB,CAChF,CACqB,CAC9B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../internal/context/control-group-context';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { warnOnUnsupportedGroupedControlProps } from '../internal/grouped-control/dev-warnings';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings';\nimport Filter from '../select/parts/filter';\nimport PlainList from '../select/parts/plain-list';\nimport Trigger from '../select/parts/trigger';\nimport VirtualList from '../select/parts/virtual-list';\nimport { composeDropdownContent } from '../select/utils/dropdown-customization';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport InternalTokenGroup from '../token-group/internal';\nimport { MultiselectProps } from './interfaces';\nimport { useMultiselect } from './use-multiselect';\n\nimport styles from './styles.css.js';\n\ntype InternalMultiselectProps = SomeRequired<\n MultiselectProps,\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen' | 'hideTokens'\n> &\n InternalBaseComponentProps;\n\ntype ExtendedToken = TokenGroupProps.Item & { _readOnly: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options,\n filteringType,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n inlineLabelText,\n selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef,\n autoFocus,\n enableSelectAll,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const groupedControlProps = useGroupedControlContext();\n const i18n = useInternalI18n('multiselect');\n\n const isGrouped = !!groupedControlProps.position;\n\n warnOnUnsupportedGroupedControlProps({\n isGrouped,\n componentName: 'Multiselect',\n invalid: formFieldContext.invalid,\n warning: formFieldContext.warning,\n readOnly,\n inlineTokens,\n expandToViewport,\n });\n\n // When rendered inside a control group, tokens are always shown inline in the\n // trigger regardless of the `inlineTokens` prop, since there is no room to\n // display tokens below the control within a group.\n const showTokensInline = inlineTokens || isGrouped;\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 || isGrouped;\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const ariaLabelId = useUniqueId('multiselect-ariaLabel-');\n const footerId = useUniqueId('multiselect-footer-');\n\n const [filteringValue, setFilteringValue] = useState('');\n const multiselectProps = useMultiselect({\n options,\n selectedOptions,\n filteringType,\n disabled,\n deselectAriaLabel,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n enableSelectAll,\n i18nStrings,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps,\n });\n\n const dropdownContentProps: MultiselectProps.DropdownContentProps = {\n filterText: filteringValue,\n closeDropdown: multiselectProps.closeDropdown,\n };\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 {...multiselectProps.getFilterProps()}\n />\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => setTriggerWidth(entry.borderBoxWidth)\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={showTokensInline ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n groupedControlProps={groupedControlProps}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: Array<ExtendedToken> = selectedOptions.map(option => ({\n label: option.label,\n disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n _readOnly: !!option.disabled,\n }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !showTokensInline && tokens.length > 0;\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const dropdownStatus = multiselectProps.dropdownStatus;\n const dropdownProps = multiselectProps.getDropdownProps();\n const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.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 hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <ResetGroupedControlContext>\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...multiselectProps.getWrapperProps()}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={multiselectProps.isOpen}\n minWidth={getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\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 renderOption={renderOption}\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={{ ...multiselectProps.getMenuProps(), ariaRequired }}\n getOptionProps={multiselectProps.getOptionProps}\n filteredOptions={multiselectProps.filteredOptions}\n filteringValue={filteringValue}\n ref={multiselectProps.scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={true}\n screenReaderContent={multiselectProps.announcement}\n highlightType={multiselectProps.highlightType}\n firstOptionSticky={hasFilteredOptions && enableSelectAll}\n isMultiSelect={true}\n />\n }\n />\n\n {showTokens && (\n <InternalTokenGroup\n {...multiselectProps.getTokenProps()}\n className={styles.tokens}\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n i18nStrings={tokenGroupI18nStrings}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n disableOuterPadding={true}\n readOnly={readOnly}\n isItemReadOnly={item => (item as ExtendedToken)._readOnly}\n />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel || inlineLabelText}</ScreenreaderOnly>\n </div>\n </ResetGroupedControlContext>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,oCAAoC,EAAE,MAAM,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E,kBAAkB,IAAI,eAAe,EACxD,aAAa,EAAE,IAAI,GACnB,GAEJ;YAED,UAAU,IAAI,CACb,oBAAC,kBAAkB,OACb,gBAAgB,CAAC,aAAa,EAAE,EACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,qBAAqB,EAClC,sBAAsB,EAAE,2BAA2B,EACnD,uBAAuB,EAAE,4BAA4B,EACrD,mBAAmB,EAAE,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,IAAI,CAAC,EAAE,CAAE,IAAsB,CAAC,SAAS,EACzD,eAAe,EAAE,EAAE,KAAK,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE,GAClD,CACH;YAED,oBAAC,gBAAgB,IAAC,EAAE,EAAE,WAAW,IAAG,SAAS,IAAI,eAAe,CAAoB,CAChF,CACqB,CAC9B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { StyleClassNames as InputStyleClassNames } from '../input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../internal/context/control-group-context';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { warnOnUnsupportedGroupedControlProps } from '../internal/grouped-control/dev-warnings';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings';\nimport Filter from '../select/parts/filter';\nimport PlainList from '../select/parts/plain-list';\nimport Trigger from '../select/parts/trigger';\nimport VirtualList from '../select/parts/virtual-list';\nimport { composeDropdownContent } from '../select/utils/dropdown-customization';\nimport { StyleClassNames as TokenStyleClassNames } from '../token/internal';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport InternalTokenGroup from '../token-group/internal';\nimport { MultiselectProps } from './interfaces';\nimport { useMultiselect } from './use-multiselect';\n\nimport styles from './styles.css.js';\n\ntype InternalMultiselectProps = SomeRequired<\n MultiselectProps,\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen' | 'hideTokens'\n> &\n InternalBaseComponentProps & {\n styleClassNames?: StyleClassNames;\n };\n\n// Style API v2\nexport interface StyleClassNames {\n trigger?: string;\n inlineLabel?: string;\n filter?: InputStyleClassNames;\n dropdown?: string;\n token?: TokenStyleClassNames;\n}\n\ntype ExtendedToken = TokenGroupProps.Item & { _readOnly: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options,\n filteringType,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n inlineLabelText,\n selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef,\n autoFocus,\n enableSelectAll,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n styleClassNames,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const groupedControlProps = useGroupedControlContext();\n const i18n = useInternalI18n('multiselect');\n\n const isGrouped = !!groupedControlProps.position;\n\n warnOnUnsupportedGroupedControlProps({\n isGrouped,\n componentName: 'Multiselect',\n invalid: formFieldContext.invalid,\n warning: formFieldContext.warning,\n readOnly,\n inlineTokens,\n expandToViewport,\n });\n\n // When rendered inside a control group, tokens are always shown inline in the\n // trigger regardless of the `inlineTokens` prop, since there is no room to\n // display tokens below the control within a group.\n const showTokensInline = inlineTokens || isGrouped;\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 || isGrouped;\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const ariaLabelId = useUniqueId('multiselect-ariaLabel-');\n const footerId = useUniqueId('multiselect-footer-');\n\n const [filteringValue, setFilteringValue] = useState('');\n const multiselectProps = useMultiselect({\n options,\n selectedOptions,\n filteringType,\n disabled,\n deselectAriaLabel,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n enableSelectAll,\n i18nStrings,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps,\n });\n\n const dropdownContentProps: MultiselectProps.DropdownContentProps = {\n filterText: filteringValue,\n closeDropdown: multiselectProps.closeDropdown,\n };\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 styleClassNames={styleClassNames?.filter}\n {...multiselectProps.getFilterProps()}\n />\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => setTriggerWidth(entry.borderBoxWidth)\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={showTokensInline ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n groupedControlProps={groupedControlProps}\n inlineLabelText={inlineLabelText}\n styleClassNames={{\n trigger: styleClassNames?.trigger,\n inlineLabel: styleClassNames?.inlineLabel,\n token: styleClassNames?.token,\n }}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: Array<ExtendedToken> = selectedOptions.map(option => ({\n label: option.label,\n disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n _readOnly: !!option.disabled,\n }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !showTokensInline && tokens.length > 0;\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const dropdownStatus = multiselectProps.dropdownStatus;\n const dropdownProps = multiselectProps.getDropdownProps();\n const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.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 hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <ResetGroupedControlContext>\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...multiselectProps.getWrapperProps()}\n >\n <Dropdown\n {...dropdownProps}\n styleClassNames={{ container: styleClassNames?.dropdown }}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={multiselectProps.isOpen}\n minWidth={getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\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 renderOption={renderOption}\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={{ ...multiselectProps.getMenuProps(), ariaRequired }}\n getOptionProps={multiselectProps.getOptionProps}\n filteredOptions={multiselectProps.filteredOptions}\n filteringValue={filteringValue}\n ref={multiselectProps.scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={true}\n screenReaderContent={multiselectProps.announcement}\n highlightType={multiselectProps.highlightType}\n firstOptionSticky={hasFilteredOptions && enableSelectAll}\n isMultiSelect={true}\n />\n }\n />\n\n {showTokens && (\n <InternalTokenGroup\n {...multiselectProps.getTokenProps()}\n className={styles.tokens}\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n i18nStrings={tokenGroupI18nStrings}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n disableOuterPadding={true}\n readOnly={readOnly}\n isItemReadOnly={item => (item as ExtendedToken)._readOnly}\n styleClassNames={{ token: styleClassNames?.token }}\n />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel || inlineLabelText}</ScreenreaderOnly>\n </div>\n </ResetGroupedControlContext>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"embedded": "
|
|
6
|
-
"tokens": "
|
|
7
|
-
"dropdown-header": "awsui_dropdown-
|
|
8
|
-
"dropdown-footer": "awsui_dropdown-
|
|
4
|
+
"root": "awsui_root_f8g6q_avh76_21",
|
|
5
|
+
"embedded": "awsui_embedded_f8g6q_avh76_53",
|
|
6
|
+
"tokens": "awsui_tokens_f8g6q_avh76_86",
|
|
7
|
+
"dropdown-header": "awsui_dropdown-header_f8g6q_avh76_90",
|
|
8
|
+
"dropdown-footer": "awsui_dropdown-footer_f8g6q_avh76_96"
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -6,7 +6,19 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
|
|
9
|
+
@property --awsui-style-placeholder-color {
|
|
10
|
+
syntax: "*";
|
|
11
|
+
inherits: false;
|
|
12
|
+
}
|
|
13
|
+
/* awsui:style-api-slot name=trigger tokens=placeholder-color properties=color, background, border, border-radius, box-shadow, padding, font-family, font-size, font-weight */
|
|
14
|
+
/* awsui:style-api-description slot=trigger kind=slot name=trigger text=The trigger button, which is also the field box. Pass a different class for the states you control (`invalid`, `warning`, `disabled`, `readOnly`); use `:hover` and `:focus` for interaction states. */
|
|
15
|
+
/* awsui:style-api-description slot=trigger kind=property name=color text=The placeholder is styled with `--awsui-style-placeholder-color`. */
|
|
16
|
+
/* awsui:style-api-description slot=trigger kind=property name=box-shadow text=Also draws the focus ring under `:focus`. */
|
|
17
|
+
/* awsui:style-api-slot name=inlineLabel tokens= properties=color, background, font-family, font-size, font-weight */
|
|
18
|
+
/* awsui:style-api-slot name=filter component=input */
|
|
19
|
+
/* awsui:style-api-slot name=dropdown component=dropdown slot=container */
|
|
20
|
+
/* awsui:style-api-slot name=token component=token */
|
|
21
|
+
.awsui_root_f8g6q_avh76_21:not(#\9) {
|
|
10
22
|
border-collapse: separate;
|
|
11
23
|
border-spacing: 0;
|
|
12
24
|
box-sizing: border-box;
|
|
@@ -38,7 +50,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
38
50
|
-moz-osx-font-smoothing: auto;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
|
-
.
|
|
53
|
+
.awsui_embedded_f8g6q_avh76_53:not(#\9) {
|
|
42
54
|
border-collapse: separate;
|
|
43
55
|
border-spacing: 0;
|
|
44
56
|
box-sizing: border-box;
|
|
@@ -71,16 +83,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
71
83
|
display: contents;
|
|
72
84
|
}
|
|
73
85
|
|
|
74
|
-
.
|
|
86
|
+
.awsui_tokens_f8g6q_avh76_86:not(#\9) {
|
|
75
87
|
margin-block-start: var(--space-scaled-xs-65ylh6, 8px);
|
|
76
88
|
}
|
|
77
89
|
|
|
78
|
-
.awsui_dropdown-
|
|
90
|
+
.awsui_dropdown-header_f8g6q_avh76_90:not(#\9) {
|
|
79
91
|
inline-size: 100%;
|
|
80
92
|
position: relative;
|
|
81
93
|
z-index: 4;
|
|
82
94
|
}
|
|
83
95
|
|
|
84
|
-
.awsui_dropdown-
|
|
96
|
+
.awsui_dropdown-footer_f8g6q_avh76_96:not(#\9) {
|
|
85
97
|
inline-size: 100%;
|
|
86
98
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"embedded": "
|
|
7
|
-
"tokens": "
|
|
8
|
-
"dropdown-header": "awsui_dropdown-
|
|
9
|
-
"dropdown-footer": "awsui_dropdown-
|
|
5
|
+
"root": "awsui_root_f8g6q_avh76_21",
|
|
6
|
+
"embedded": "awsui_embedded_f8g6q_avh76_53",
|
|
7
|
+
"tokens": "awsui_tokens_f8g6q_avh76_86",
|
|
8
|
+
"dropdown-header": "awsui_dropdown-header_f8g6q_avh76_90",
|
|
9
|
+
"dropdown-footer": "awsui_dropdown-footer_f8g6q_avh76_96"
|
|
10
10
|
};
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
"./internal/base-theme/styles.css.js",
|
|
381
381
|
"./internal/base-component/styles.css.js"
|
|
382
382
|
],
|
|
383
|
-
"version": "3.0.
|
|
383
|
+
"version": "3.0.1411",
|
|
384
384
|
"repository": {
|
|
385
385
|
"type": "git",
|
|
386
386
|
"url": "https://github.com/cloudscape-design/components.git"
|
|
@@ -6,32 +6,8 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
@property --awsui-style-fill-color {
|
|
10
|
-
syntax: "*";
|
|
11
|
-
inherits: false;
|
|
12
|
-
}
|
|
13
|
-
@property --awsui-style-border-color {
|
|
14
|
-
syntax: "*";
|
|
15
|
-
inherits: false;
|
|
16
|
-
}
|
|
17
|
-
@property --awsui-style-indicator-color {
|
|
18
|
-
syntax: "*";
|
|
19
|
-
inherits: false;
|
|
20
|
-
}
|
|
21
|
-
@property --awsui-style-focus-ring-color {
|
|
22
|
-
syntax: "*";
|
|
23
|
-
inherits: false;
|
|
24
|
-
}
|
|
25
|
-
@property --awsui-style-focus-ring-width {
|
|
26
|
-
syntax: "*";
|
|
27
|
-
inherits: false;
|
|
28
|
-
}
|
|
29
|
-
@property --awsui-style-focus-ring-radius {
|
|
30
|
-
syntax: "*";
|
|
31
|
-
inherits: false;
|
|
32
|
-
}
|
|
33
9
|
/* awsui:style-api-slot name=control tokens=fill-color, border-color, indicator-color, focus-ring-color, focus-ring-width, focus-ring-radius properties= */
|
|
34
|
-
.awsui_radio-
|
|
10
|
+
.awsui_radio-button_zdbjz_p13zo_10:not(#\9) {
|
|
35
11
|
border-collapse: separate;
|
|
36
12
|
border-spacing: 0;
|
|
37
13
|
box-sizing: border-box;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleClassNames as RadioButtonStyleClassNames } from '../internal/components/radio-button';
|
|
2
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
4
|
import { RadioGroupProps } from './interfaces';
|
|
4
|
-
|
|
5
|
+
export interface StyleClassNames {
|
|
6
|
+
radioButton?: RadioButtonStyleClassNames;
|
|
7
|
+
}
|
|
8
|
+
declare const InternalRadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & InternalBaseComponentProps & {
|
|
9
|
+
styleClassNames?: StyleClassNames;
|
|
10
|
+
} & React.RefAttributes<RadioGroupProps.Ref>>;
|
|
5
11
|
export default InternalRadioGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAoB,EAAE,eAAe,IAAI,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAIjH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAY/C,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,0BAA0B,CAAC;CAC1C;AAED,QAAA,MAAM,kBAAkB;sBARF,eAAe;6CAyFpC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/radio-group/internal.js
CHANGED
|
@@ -12,13 +12,13 @@ import useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-gro
|
|
|
12
12
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
13
13
|
import styles from './styles.css.js';
|
|
14
14
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
15
|
-
const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef, style, direction, ...props }, ref) => {
|
|
15
|
+
const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef, style, direction, styleClassNames, ...props }, ref) => {
|
|
16
16
|
const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);
|
|
17
17
|
const baseProps = getBaseProps(props);
|
|
18
18
|
const generatedName = useUniqueId('awsui-radio-');
|
|
19
19
|
const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
|
|
20
20
|
return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles['radio-group'], direction === 'horizontal' && styles['horizontal-group']), ref: __internalRootRef }, items &&
|
|
21
|
-
items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(styles.radio, item.description && styles['radio--has-description'], direction === 'horizontal' && styles.horizontal, item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, description: item.description, disabled: item.disabled, onSelect: () => fireNonCancelableEvent(onChange, { value: item.value }), controlId: item.controlId, readOnly: readOnly, style: style, ...getAnalyticsMetadataAttribute(!item.disabled && !readOnly
|
|
21
|
+
items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(styles.radio, item.description && styles['radio--has-description'], direction === 'horizontal' && styles.horizontal, item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, description: item.description, disabled: item.disabled, onSelect: () => fireNonCancelableEvent(onChange, { value: item.value }), controlId: item.controlId, readOnly: readOnly, style: style, styleClassNames: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.radioButton, ...getAnalyticsMetadataAttribute(!item.disabled && !readOnly
|
|
22
22
|
? {
|
|
23
23
|
detail: {
|
|
24
24
|
position: `${index + 1}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.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Q;gBACzB,CAAC,CAAC;oBACE,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAC+C;iBACnE;gBACH,CAAC,CAAC,EAAE,CACP,IAEA,IAAI,CAAC,KAAK,CACC,CACf,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton, { StyleClassNames as RadioButtonStyleClassNames } from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps &\n InternalBaseComponentProps & {\n styleClassNames?: StyleClassNames;\n };\n\n// Style API v2\nexport interface StyleClassNames {\n radioButton?: RadioButtonStyleClassNames;\n}\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n direction,\n styleClassNames,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(\n baseProps.className,\n testUtilStyles.root,\n styles['radio-group'],\n direction === 'horizontal' && styles['horizontal-group']\n )}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n direction === 'horizontal' && styles.horizontal,\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onSelect={() => fireNonCancelableEvent(onChange, { value: item.value })}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n styleClassNames={styleClassNames?.radioButton}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"radio-group": "awsui_radio-
|
|
5
|
-
"horizontal-group": "awsui_horizontal-
|
|
6
|
-
"radio": "
|
|
7
|
-
"horizontal": "
|
|
8
|
-
"radio--has-description": "awsui_radio--has-
|
|
4
|
+
"radio-group": "awsui_radio-group_1mabk_1sbpk_10",
|
|
5
|
+
"horizontal-group": "awsui_horizontal-group_1mabk_1sbpk_41",
|
|
6
|
+
"radio": "awsui_radio_1mabk_1sbpk_10",
|
|
7
|
+
"horizontal": "awsui_horizontal_1mabk_1sbpk_41",
|
|
8
|
+
"radio--has-description": "awsui_radio--has-description_1mabk_1sbpk_55"
|
|
9
9
|
};
|
|
10
10
|
|