@cloudscape-design/components 3.0.334 → 3.0.335
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/alert/styles.css.js +19 -19
- package/alert/styles.scoped.css +33 -33
- package/alert/styles.selectors.js +19 -19
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/index.js +3 -3
- package/app-layout/index.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +3 -3
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +69 -69
- package/app-layout/visual-refresh/styles.scoped.css +168 -168
- package/app-layout/visual-refresh/styles.selectors.js +69 -69
- package/attribute-editor/styles.css.js +14 -14
- package/attribute-editor/styles.scoped.css +27 -27
- package/attribute-editor/styles.selectors.js +14 -14
- package/autosuggest/virtual-list.d.ts.map +1 -1
- package/autosuggest/virtual-list.js +2 -2
- package/autosuggest/virtual-list.js.map +1 -1
- package/badge/styles.css.js +5 -5
- package/badge/styles.scoped.css +7 -7
- package/badge/styles.selectors.js +5 -5
- package/box/styles.css.js +189 -189
- package/box/styles.scoped.css +238 -238
- package/box/styles.selectors.js +189 -189
- package/breadcrumb-group/styles.css.js +7 -7
- package/breadcrumb-group/styles.scoped.css +14 -14
- package/breadcrumb-group/styles.selectors.js +7 -7
- package/button/styles.css.js +20 -20
- package/button/styles.scoped.css +154 -154
- package/button/styles.selectors.js +20 -20
- package/button-dropdown/index.d.ts.map +1 -1
- package/button-dropdown/index.js +2 -2
- package/button-dropdown/index.js.map +1 -1
- package/button-dropdown/interfaces.d.ts +31 -0
- package/button-dropdown/interfaces.d.ts.map +1 -1
- package/button-dropdown/interfaces.js.map +1 -1
- package/button-dropdown/internal.d.ts.map +1 -1
- package/button-dropdown/internal.js +52 -7
- package/button-dropdown/internal.js.map +1 -1
- package/button-dropdown/mobile-expandable-group/styles.css.js +5 -5
- package/button-dropdown/mobile-expandable-group/styles.scoped.css +6 -6
- package/button-dropdown/mobile-expandable-group/styles.selectors.js +5 -5
- package/button-dropdown/styles.css.js +14 -8
- package/button-dropdown/styles.scoped.css +44 -14
- package/button-dropdown/styles.selectors.js +14 -8
- package/button-dropdown/utils/use-button-dropdown.d.ts +1 -0
- package/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
- package/button-dropdown/utils/use-button-dropdown.js +1 -0
- package/button-dropdown/utils/use-button-dropdown.js.map +1 -1
- package/calendar/styles.css.js +18 -18
- package/calendar/styles.scoped.css +40 -40
- package/calendar/styles.selectors.js +18 -18
- package/cards/index.js +5 -4
- package/cards/index.js.map +1 -1
- package/cards/styles.css.js +38 -38
- package/cards/styles.scoped.css +55 -55
- package/cards/styles.selectors.js +38 -38
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +7 -7
- package/checkbox/styles.selectors.js +3 -3
- package/code-editor/index.js +2 -2
- package/code-editor/index.js.map +1 -1
- package/code-editor/status-bar.d.ts.map +1 -1
- package/code-editor/status-bar.js +3 -3
- package/code-editor/status-bar.js.map +1 -1
- package/code-editor/styles.css.js +32 -32
- package/code-editor/styles.scoped.css +129 -129
- package/code-editor/styles.selectors.js +32 -32
- package/collection-preferences/content-display/styles.css.js +11 -11
- package/collection-preferences/content-display/styles.scoped.css +19 -19
- package/collection-preferences/content-display/styles.selectors.js +11 -11
- package/collection-preferences/styles.css.js +37 -37
- package/collection-preferences/styles.scoped.css +47 -47
- package/collection-preferences/styles.selectors.js +37 -37
- package/column-layout/flexible-column-layout/index.d.ts.map +1 -1
- package/column-layout/flexible-column-layout/index.js +2 -2
- package/column-layout/flexible-column-layout/index.js.map +1 -1
- package/column-layout/styles.css.js +13 -13
- package/column-layout/styles.scoped.css +44 -44
- package/column-layout/styles.selectors.js +13 -13
- package/container/styles.css.js +28 -28
- package/container/styles.scoped.css +52 -52
- package/container/styles.selectors.js +28 -28
- package/date-picker/styles.css.js +7 -7
- package/date-picker/styles.scoped.css +10 -10
- package/date-picker/styles.selectors.js +7 -7
- package/date-range-picker/styles.css.js +38 -38
- package/date-range-picker/styles.scoped.css +48 -48
- package/date-range-picker/styles.selectors.js +38 -38
- package/expandable-section/styles.css.js +29 -29
- package/expandable-section/styles.scoped.css +65 -65
- package/expandable-section/styles.selectors.js +29 -29
- package/flashbar/styles.css.js +46 -46
- package/flashbar/styles.scoped.css +160 -160
- package/flashbar/styles.selectors.js +46 -46
- package/form/styles.css.js +9 -9
- package/form/styles.scoped.css +9 -9
- package/form/styles.selectors.js +9 -9
- package/form-field/styles.css.js +19 -19
- package/form-field/styles.scoped.css +31 -31
- package/form-field/styles.selectors.js +19 -19
- package/grid/styles.css.js +53 -53
- package/grid/styles.scoped.css +55 -55
- package/grid/styles.selectors.js +53 -53
- package/header/styles.css.js +44 -44
- package/header/styles.scoped.css +50 -50
- package/header/styles.selectors.js +44 -44
- package/help-panel/styles.css.js +4 -4
- package/help-panel/styles.scoped.css +70 -69
- package/help-panel/styles.selectors.js +4 -4
- package/icon/styles.css.js +21 -21
- package/icon/styles.scoped.css +50 -50
- package/icon/styles.selectors.js +21 -21
- package/input/styles.css.js +12 -12
- package/input/styles.scoped.css +35 -35
- package/input/styles.selectors.js +12 -12
- package/internal/base-component/styles.scoped.css +8 -7
- package/internal/components/button-trigger/styles.css.js +9 -9
- package/internal/components/button-trigger/styles.scoped.css +26 -26
- package/internal/components/button-trigger/styles.selectors.js +9 -9
- package/internal/components/cartesian-chart/labels-measure.d.ts.map +1 -1
- package/internal/components/cartesian-chart/labels-measure.js +2 -2
- package/internal/components/cartesian-chart/labels-measure.js.map +1 -1
- package/internal/components/chart-filter/styles.css.js +3 -3
- package/internal/components/chart-filter/styles.scoped.css +4 -4
- package/internal/components/chart-filter/styles.selectors.js +3 -3
- package/internal/components/chart-legend/styles.css.js +6 -6
- package/internal/components/chart-legend/styles.scoped.css +16 -16
- package/internal/components/chart-legend/styles.selectors.js +6 -6
- package/internal/components/chart-popover/styles.css.js +3 -3
- package/internal/components/chart-popover/styles.scoped.css +4 -4
- package/internal/components/chart-popover/styles.selectors.js +3 -3
- package/internal/components/chart-series-details/styles.css.js +5 -5
- package/internal/components/chart-series-details/styles.scoped.css +10 -10
- package/internal/components/chart-series-details/styles.selectors.js +5 -5
- package/internal/components/chart-series-marker/styles.css.js +5 -5
- package/internal/components/chart-series-marker/styles.scoped.css +8 -8
- package/internal/components/chart-series-marker/styles.selectors.js +5 -5
- package/internal/components/chart-wrapper/styles.css.js +6 -6
- package/internal/components/chart-wrapper/styles.scoped.css +9 -9
- package/internal/components/chart-wrapper/styles.selectors.js +6 -6
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +36 -36
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/components/dropdown-footer/styles.css.js +3 -3
- package/internal/components/dropdown-footer/styles.scoped.css +4 -4
- package/internal/components/dropdown-footer/styles.selectors.js +3 -3
- package/internal/components/dropdown-status/index.d.ts.map +1 -1
- package/internal/components/dropdown-status/index.js +1 -1
- package/internal/components/dropdown-status/index.js.map +1 -1
- package/internal/components/dropdown-status/styles.css.js +2 -2
- package/internal/components/dropdown-status/styles.scoped.css +3 -3
- package/internal/components/dropdown-status/styles.selectors.js +2 -2
- package/internal/components/menu-dropdown/styles.css.js +7 -7
- package/internal/components/menu-dropdown/styles.scoped.css +14 -14
- package/internal/components/menu-dropdown/styles.selectors.js +7 -7
- package/internal/components/option/styles.css.js +17 -17
- package/internal/components/option/styles.scoped.css +31 -31
- package/internal/components/option/styles.selectors.js +17 -17
- package/internal/components/options-list/styles.css.js +2 -2
- package/internal/components/options-list/styles.scoped.css +3 -3
- package/internal/components/options-list/styles.selectors.js +2 -2
- package/internal/components/selectable-item/styles.css.js +16 -16
- package/internal/components/selectable-item/styles.scoped.css +29 -29
- package/internal/components/selectable-item/styles.selectors.js +16 -16
- package/internal/components/token-list/styles.css.js +9 -9
- package/internal/components/token-list/styles.scoped.css +21 -21
- package/internal/components/token-list/styles.selectors.js +9 -9
- package/internal/environment.js +1 -1
- package/internal/generated/theming/index.cjs +24 -13
- package/internal/generated/theming/index.js +24 -13
- package/internal/hooks/container-queries/index.d.ts +0 -2
- package/internal/hooks/container-queries/index.d.ts.map +1 -1
- package/internal/hooks/container-queries/index.js +2 -1
- package/internal/hooks/container-queries/index.js.map +1 -1
- package/internal/hooks/container-queries/use-container-breakpoints.d.ts.map +1 -1
- package/internal/hooks/container-queries/use-container-breakpoints.js +2 -2
- package/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
- package/internal/hooks/container-queries/use-resize-observer.d.ts +1 -1
- package/internal/hooks/container-queries/use-resize-observer.d.ts.map +1 -1
- package/internal/hooks/container-queries/use-resize-observer.js +0 -2
- package/internal/hooks/container-queries/use-resize-observer.js.map +1 -1
- package/internal/hooks/use-dynamic-overlap/index.js +2 -2
- package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/use-container-width.d.ts.map +1 -1
- package/internal/utils/use-container-width.js +5 -3
- package/internal/utils/use-container-width.js.map +1 -1
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +73 -73
- package/link/styles.selectors.js +20 -20
- package/modal/internal.d.ts.map +1 -1
- package/modal/internal.js +2 -1
- package/modal/internal.js.map +1 -1
- package/modal/styles.css.js +23 -23
- package/modal/styles.scoped.css +40 -40
- package/modal/styles.selectors.js +23 -23
- package/multiselect/styles.css.js +1 -1
- package/multiselect/styles.scoped.css +2 -2
- package/multiselect/styles.selectors.js +1 -1
- package/package.json +1 -1
- package/pagination/styles.css.js +9 -9
- package/pagination/styles.scoped.css +24 -24
- package/pagination/styles.selectors.js +9 -9
- package/pie-chart/styles.css.js +23 -23
- package/pie-chart/styles.scoped.css +42 -42
- package/pie-chart/styles.selectors.js +23 -23
- package/popover/styles.css.js +50 -50
- package/popover/styles.scoped.css +66 -66
- package/popover/styles.selectors.js +50 -50
- package/progress-bar/styles.css.js +18 -18
- package/progress-bar/styles.scoped.css +35 -35
- package/progress-bar/styles.selectors.js +18 -18
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +2 -3
- package/property-filter/index.js.map +1 -1
- package/property-filter/styles.css.js +29 -29
- package/property-filter/styles.scoped.css +32 -32
- package/property-filter/styles.selectors.js +29 -29
- package/property-filter/token-editor.d.ts.map +1 -1
- package/property-filter/token-editor.js +2 -2
- package/property-filter/token-editor.js.map +1 -1
- package/radio-group/styles.css.js +9 -9
- package/radio-group/styles.scoped.css +17 -17
- package/radio-group/styles.selectors.js +9 -9
- package/s3-resource-selector/s3-in-context/styles.css.js +7 -7
- package/s3-resource-selector/s3-in-context/styles.scoped.css +9 -9
- package/s3-resource-selector/s3-in-context/styles.selectors.js +7 -7
- package/segmented-control/styles.css.js +14 -14
- package/segmented-control/styles.scoped.css +35 -35
- package/segmented-control/styles.selectors.js +14 -14
- package/select/parts/virtual-list.js +2 -2
- package/select/parts/virtual-list.js.map +1 -1
- package/select/styles.css.js +1 -1
- package/select/styles.scoped.css +2 -2
- package/select/styles.selectors.js +1 -1
- package/side-navigation/styles.css.js +27 -27
- package/side-navigation/styles.scoped.css +39 -39
- package/side-navigation/styles.selectors.js +27 -27
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +20 -20
- package/spinner/styles.selectors.js +13 -13
- package/split-panel/styles.css.js +56 -56
- package/split-panel/styles.scoped.css +78 -78
- package/split-panel/styles.selectors.js +56 -56
- package/status-indicator/internal.d.ts +6 -3
- package/status-indicator/internal.d.ts.map +1 -1
- package/status-indicator/internal.js +2 -2
- package/status-indicator/internal.js.map +1 -1
- package/status-indicator/styles.css.js +22 -20
- package/status-indicator/styles.scoped.css +33 -28
- package/status-indicator/styles.selectors.js +22 -20
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +6 -4
- package/table/internal.js.map +1 -1
- package/table/sticky-scrollbar/styles.css.js +4 -4
- package/table/sticky-scrollbar/styles.scoped.css +4 -5
- package/table/sticky-scrollbar/styles.selectors.js +4 -4
- package/table/styles.css.js +34 -34
- package/table/styles.scoped.css +43 -43
- package/table/styles.selectors.js +34 -34
- package/tabs/styles.css.js +21 -21
- package/tabs/styles.scoped.css +39 -39
- package/tabs/styles.selectors.js +21 -21
- package/tabs/tab-header-bar.js +2 -2
- package/tabs/tab-header-bar.js.map +1 -1
- package/test-utils/dom/button-dropdown/index.d.ts +2 -0
- package/test-utils/dom/button-dropdown/index.js +6 -1
- package/test-utils/dom/button-dropdown/index.js.map +1 -1
- package/test-utils/selectors/button-dropdown/index.d.ts +2 -0
- package/test-utils/selectors/button-dropdown/index.js +6 -1
- package/test-utils/selectors/button-dropdown/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +64 -64
- package/text-content/styles.selectors.js +1 -1
- package/text-filter/styles.css.js +3 -3
- package/text-filter/styles.scoped.css +4 -4
- package/text-filter/styles.selectors.js +3 -3
- package/textarea/styles.css.js +4 -4
- package/textarea/styles.scoped.css +14 -14
- package/textarea/styles.selectors.js +4 -4
- package/tiles/styles.css.js +28 -28
- package/tiles/styles.scoped.css +70 -70
- package/tiles/styles.selectors.js +28 -28
- package/toggle/styles.css.js +8 -8
- package/toggle/styles.scoped.css +15 -15
- package/toggle/styles.selectors.js +8 -8
- package/token-group/styles.css.js +7 -7
- package/token-group/styles.scoped.css +17 -17
- package/token-group/styles.selectors.js +7 -7
- package/top-navigation/1.0-beta/styles.css.js +25 -25
- package/top-navigation/1.0-beta/styles.scoped.css +43 -43
- package/top-navigation/1.0-beta/styles.selectors.js +25 -25
- package/top-navigation/1.0-beta/use-top-navigation.d.ts.map +1 -1
- package/top-navigation/1.0-beta/use-top-navigation.js +2 -1
- package/top-navigation/1.0-beta/use-top-navigation.js.map +1 -1
- package/top-navigation/styles.css.js +47 -47
- package/top-navigation/styles.scoped.css +70 -70
- package/top-navigation/styles.selectors.js +47 -47
- package/top-navigation/use-top-navigation.d.ts.map +1 -1
- package/top-navigation/use-top-navigation.js +2 -1
- package/top-navigation/use-top-navigation.js.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
- package/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +23 -23
- package/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
- package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/tutorial-panel/components/tutorial-list/styles.scoped.css +30 -30
- package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/tutorial-panel/styles.css.js +1 -1
- package/tutorial-panel/styles.scoped.css +2 -2
- package/tutorial-panel/styles.selectors.js +1 -1
- package/wizard/styles.css.js +31 -31
- package/wizard/styles.scoped.css +63 -63
- package/wizard/styles.selectors.js +31 -31
- package/internal/hooks/container-queries/interfaces.d.ts +0 -10
- package/internal/hooks/container-queries/interfaces.d.ts.map +0 -1
- package/internal/hooks/container-queries/interfaces.js +0 -4
- package/internal/hooks/container-queries/interfaces.js.map +0 -1
- package/internal/hooks/container-queries/use-container-query.d.ts +0 -22
- package/internal/hooks/container-queries/use-container-query.d.ts.map +0 -1
- package/internal/hooks/container-queries/use-container-query.js +0 -32
- package/internal/hooks/container-queries/use-container-query.js.map +0 -1
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"content": "
|
|
6
|
-
"button": "
|
|
7
|
-
"variant-normal": "awsui_variant-
|
|
8
|
-
"is-activated": "awsui_is-
|
|
9
|
-
"variant-icon": "awsui_variant-
|
|
10
|
-
"variant-modal-dismiss": "awsui_variant-modal-
|
|
11
|
-
"variant-flashbar-icon": "awsui_variant-flashbar-
|
|
12
|
-
"variant-inline-icon": "awsui_variant-inline-
|
|
13
|
-
"disabled": "
|
|
14
|
-
"variant-primary": "awsui_variant-
|
|
15
|
-
"variant-link": "awsui_variant-
|
|
16
|
-
"variant-inline-link": "awsui_variant-inline-
|
|
17
|
-
"variant-breadcrumb-group": "awsui_variant-breadcrumb-
|
|
18
|
-
"variant-menu-trigger": "awsui_variant-menu-
|
|
19
|
-
"button-no-text": "awsui_button-no-
|
|
20
|
-
"button-no-wrap": "awsui_button-no-
|
|
21
|
-
"full-width": "awsui_full-
|
|
22
|
-
"icon-left": "awsui_icon-
|
|
23
|
-
"icon-right": "awsui_icon-
|
|
24
|
-
"icon": "
|
|
5
|
+
"content": "awsui_content_vjswe_uinqw_97",
|
|
6
|
+
"button": "awsui_button_vjswe_uinqw_101",
|
|
7
|
+
"variant-normal": "awsui_variant-normal_vjswe_uinqw_126",
|
|
8
|
+
"is-activated": "awsui_is-activated_vjswe_uinqw_139",
|
|
9
|
+
"variant-icon": "awsui_variant-icon_vjswe_uinqw_166",
|
|
10
|
+
"variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_uinqw_166",
|
|
11
|
+
"variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_uinqw_166",
|
|
12
|
+
"variant-inline-icon": "awsui_variant-inline-icon_vjswe_uinqw_184",
|
|
13
|
+
"disabled": "awsui_disabled_vjswe_uinqw_202",
|
|
14
|
+
"variant-primary": "awsui_variant-primary_vjswe_uinqw_210",
|
|
15
|
+
"variant-link": "awsui_variant-link_vjswe_uinqw_294",
|
|
16
|
+
"variant-inline-link": "awsui_variant-inline-link_vjswe_uinqw_546",
|
|
17
|
+
"variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_uinqw_800",
|
|
18
|
+
"variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_uinqw_887",
|
|
19
|
+
"button-no-text": "awsui_button-no-text_vjswe_uinqw_971",
|
|
20
|
+
"button-no-wrap": "awsui_button-no-wrap_vjswe_uinqw_975",
|
|
21
|
+
"full-width": "awsui_full-width_vjswe_uinqw_978",
|
|
22
|
+
"icon-left": "awsui_icon-left_vjswe_uinqw_995",
|
|
23
|
+
"icon-right": "awsui_icon-right_vjswe_uinqw_1000",
|
|
24
|
+
"icon": "awsui_icon_vjswe_uinqw_995"
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,qGA0CnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
package/button-dropdown/index.js
CHANGED
|
@@ -7,10 +7,10 @@ import { getBaseProps } from '../internal/base-component';
|
|
|
7
7
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
8
8
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
9
9
|
const ButtonDropdown = React.forwardRef((_a, ref) => {
|
|
10
|
-
var { items, variant = 'normal', loading = false, loadingText, disabled = false, expandableGroups = false, expandToViewport = false, ariaLabel, children, onItemClick, onItemFollow } = _a, props = __rest(_a, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "expandToViewport", "ariaLabel", "children", "onItemClick", "onItemFollow"]);
|
|
10
|
+
var { items, variant = 'normal', loading = false, loadingText, disabled = false, expandableGroups = false, expandToViewport = false, ariaLabel, children, onItemClick, onItemFollow, mainAction } = _a, props = __rest(_a, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "expandToViewport", "ariaLabel", "children", "onItemClick", "onItemFollow", "mainAction"]);
|
|
11
11
|
const baseComponentProps = useBaseComponent('ButtonDropdown');
|
|
12
12
|
const baseProps = getBaseProps(props);
|
|
13
|
-
return (React.createElement(InternalButtonDropdown, Object.assign({}, baseProps, baseComponentProps, { ref: ref, items: items, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, expandableGroups: expandableGroups, expandToViewport: expandToViewport, ariaLabel: ariaLabel, onItemClick: onItemClick, onItemFollow: onItemFollow }), children));
|
|
13
|
+
return (React.createElement(InternalButtonDropdown, Object.assign({}, baseProps, baseComponentProps, { ref: ref, items: items, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, expandableGroups: expandableGroups, expandToViewport: expandToViewport, ariaLabel: ariaLabel, onItemClick: onItemClick, onItemFollow: onItemFollow, mainAction: mainAction }), children));
|
|
14
14
|
});
|
|
15
15
|
applyDisplayName(ButtonDropdown, 'ButtonDropdown');
|
|
16
16
|
export default ButtonDropdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["button-dropdown/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,sBAAsB,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,CACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["button-dropdown/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,sBAAsB,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,CACE,EAcsB,EACtB,GAAuC,EACvC,EAAE;QAhBF,EACE,KAAK,EACL,OAAO,GAAG,QAAQ,EAClB,OAAO,GAAG,KAAK,EACf,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,gBAAgB,GAAG,KAAK,EACxB,gBAAgB,GAAG,KAAK,EACxB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,OAEU,EADjB,KAAK,cAbV,wKAcC,CADS;IAIV,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,CACL,oBAAC,sBAAsB,oBACjB,SAAS,EACT,kBAAkB,IACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,KAErB,QAAQ,CACc,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonDropdownProps } from './interfaces';\nimport InternalButtonDropdown from './internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ButtonDropdownProps };\n\nconst ButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n expandToViewport = false,\n ariaLabel,\n children,\n onItemClick,\n onItemFollow,\n mainAction,\n ...props\n }: ButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('ButtonDropdown');\n const baseProps = getBaseProps(props);\n return (\n <InternalButtonDropdown\n {...baseProps}\n {...baseComponentProps}\n ref={ref}\n items={items}\n variant={variant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n expandableGroups={expandableGroups}\n expandToViewport={expandToViewport}\n ariaLabel={ariaLabel}\n onItemClick={onItemClick}\n onItemFollow={onItemFollow}\n mainAction={mainAction}\n >\n {children}\n </InternalButtonDropdown>\n );\n }\n);\n\napplyDisplayName(ButtonDropdown, 'ButtonDropdown');\nexport default ButtonDropdown;\n"]}
|
|
@@ -3,6 +3,7 @@ import { BaseComponentProps } from '../internal/base-component';
|
|
|
3
3
|
import { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';
|
|
4
4
|
import { IconProps } from '../icon/interfaces';
|
|
5
5
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
6
|
+
import { ButtonProps } from '../button/interfaces';
|
|
6
7
|
export interface ButtonDropdownProps extends BaseComponentProps {
|
|
7
8
|
/**
|
|
8
9
|
* Array of objects, each having the following properties:
|
|
@@ -95,9 +96,39 @@ export interface ButtonDropdownProps extends BaseComponentProps {
|
|
|
95
96
|
* modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.
|
|
96
97
|
*/
|
|
97
98
|
onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;
|
|
99
|
+
/**
|
|
100
|
+
* A standalone action that is shown prior to the dropdown trigger. Use it with "primary" variant only.
|
|
101
|
+
* Main action properties:
|
|
102
|
+
* * `text` (string) - Specifies the text shown in the main action.
|
|
103
|
+
* * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.
|
|
104
|
+
* * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.
|
|
105
|
+
*
|
|
106
|
+
* The main action also supports the following properties of the [button](/components/button/?tabId=api) component:
|
|
107
|
+
* `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.
|
|
108
|
+
*/
|
|
109
|
+
mainAction?: ButtonDropdownProps.MainAction;
|
|
98
110
|
}
|
|
99
111
|
export declare namespace ButtonDropdownProps {
|
|
100
112
|
type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';
|
|
113
|
+
interface MainAction {
|
|
114
|
+
text: string;
|
|
115
|
+
ariaLabel?: string;
|
|
116
|
+
onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;
|
|
117
|
+
onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;
|
|
118
|
+
disabled?: boolean;
|
|
119
|
+
loading?: boolean;
|
|
120
|
+
loadingText?: string;
|
|
121
|
+
href?: string;
|
|
122
|
+
target?: string;
|
|
123
|
+
rel?: string;
|
|
124
|
+
download?: boolean | string;
|
|
125
|
+
external?: boolean;
|
|
126
|
+
externalIconAriaLabel?: string;
|
|
127
|
+
iconAlt?: string;
|
|
128
|
+
iconName?: IconProps.Name;
|
|
129
|
+
iconUrl?: string;
|
|
130
|
+
iconSvg?: React.ReactNode;
|
|
131
|
+
}
|
|
101
132
|
interface Item {
|
|
102
133
|
id: string;
|
|
103
134
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,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YAAY,CAAC;IAC7B,aAAa,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,WAAW,KAAK,IAAI,CAAC;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACnH,oBAAoB,CAAC,EAAE,CACrB,YAAY,EAAE,MAAM,IAAI,EACxB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,OAAO,EACnB,SAAS,CAAC,EAAE,MAAM,KACf,KAAK,CAAC,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC;IAExD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["button-dropdown/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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { IconProps } from '../icon/interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface ButtonDropdownProps extends BaseComponentProps {\n /**\n * Array of objects, each having the following properties:\n\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n\n * - `items` (ReadonlyArray<Item>): an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled` and `description`.\n\n * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * By default, the dropdown height is constrained to fit inside the height of its parent element.\n * Enabling this property will allow the dropdown to extend beyond its parent by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n * If you want the dropdown to ignore the `overflow` CSS property of its parents,\n * such as in a split view layout, enable this property.\n * However, use discretion.\n * If you don't need to, we recommend you don't enable this property because there is a known issue with\n * the '[aria-owns](https://a11ysupport.io/tech/aria/aria-owns_attribute)' attribute in Safari with VoiceOver that\n * prevents VO specific controls (CTRL+OPT+Left/Right) from entering a dropdown on Safari due to its position in the DOM.\n * If you don't need to, we also recommend you don't enable this property because fixed positioning results\n * in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * It should be used in buttons that don't have text in order to make them accessible.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n\n export interface Item {\n id: string;\n text: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n description?: string;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text'> {\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (item: ButtonDropdownProps.Item, event: React.MouseEvent | React.KeyboardEvent) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n first?: boolean;\n last: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface InternalButtonDropdownProps extends Omit<ButtonDropdownProps, 'variant'>, InternalBaseComponentProps {\n customTriggerBuilder?: (\n clickHandler: () => void,\n ref: React.Ref<any>,\n isDisabled: boolean,\n isExpanded: boolean,\n ariaLabel?: string\n ) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["button-dropdown/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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { IconProps } from '../icon/interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface ButtonDropdownProps extends BaseComponentProps {\n /**\n * Array of objects, each having the following properties:\n\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n\n * - `items` (ReadonlyArray<Item>): an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled` and `description`.\n\n * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * By default, the dropdown height is constrained to fit inside the height of its parent element.\n * Enabling this property will allow the dropdown to extend beyond its parent by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n * If you want the dropdown to ignore the `overflow` CSS property of its parents,\n * such as in a split view layout, enable this property.\n * However, use discretion.\n * If you don't need to, we recommend you don't enable this property because there is a known issue with\n * the '[aria-owns](https://a11ysupport.io/tech/aria/aria-owns_attribute)' attribute in Safari with VoiceOver that\n * prevents VO specific controls (CTRL+OPT+Left/Right) from entering a dropdown on Safari due to its position in the DOM.\n * If you don't need to, we also recommend you don't enable this property because fixed positioning results\n * in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * It should be used in buttons that don't have text in order to make them accessible.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger. Use it with \"primary\" variant only.\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n\n export interface MainAction {\n text: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n id: string;\n text: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n description?: string;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text'> {\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (item: ButtonDropdownProps.Item, event: React.MouseEvent | React.KeyboardEvent) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n first?: boolean;\n last: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface InternalButtonDropdownProps extends Omit<ButtonDropdownProps, 'variant'>, InternalBaseComponentProps {\n customTriggerBuilder?: (\n clickHandler: () => void,\n ref: React.Ref<any>,\n isDisabled: boolean,\n isExpanded: boolean,\n ariaLabel?: string\n ) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAkBhF,QAAA,MAAM,sBAAsB,6GAmQ3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -15,19 +15,33 @@ import { useMobile } from '../internal/hooks/use-mobile';
|
|
|
15
15
|
import useForwardFocus from '../internal/hooks/forward-focus';
|
|
16
16
|
import InternalBox from '../box/internal';
|
|
17
17
|
import { checkSafeUrl } from '../internal/utils/check-safe-url';
|
|
18
|
+
import { isDevelopment } from '../internal/is-development';
|
|
19
|
+
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
20
|
+
import { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';
|
|
18
21
|
import { useFunnel } from '../internal/analytics/hooks/use-funnel.js';
|
|
19
22
|
const InternalButtonDropdown = React.forwardRef((_a, ref) => {
|
|
20
|
-
var
|
|
23
|
+
var _b;
|
|
24
|
+
var { items, variant = 'normal', loading = false, loadingText, disabled = false, expandableGroups = false, children, onItemClick, onItemFollow, customTriggerBuilder, expandToViewport, ariaLabel, title, description, preferCenter, mainAction, __internalRootRef } = _a, props = __rest(_a, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "children", "onItemClick", "onItemFollow", "customTriggerBuilder", "expandToViewport", "ariaLabel", "title", "description", "preferCenter", "mainAction", "__internalRootRef"]);
|
|
21
25
|
const isInRestrictedView = useMobile();
|
|
22
26
|
const dropdownId = useUniqueId('dropdown');
|
|
23
27
|
for (const item of items) {
|
|
24
28
|
checkSafeUrl('ButtonDropdown', item.href);
|
|
25
29
|
}
|
|
26
|
-
|
|
30
|
+
if (mainAction) {
|
|
31
|
+
checkSafeUrl('ButtonDropdown', mainAction.href);
|
|
32
|
+
}
|
|
33
|
+
if (isDevelopment) {
|
|
34
|
+
if (mainAction && variant !== 'primary') {
|
|
35
|
+
warnOnce('ButtonDropdown', 'Main action is only supported for "primary" component variant.');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const isMainAction = mainAction && variant === 'primary';
|
|
39
|
+
const isVisualRefresh = useVisualRefresh();
|
|
40
|
+
const { isOpen, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, onKeyDown, onKeyUp, onItemActivate, onGroupToggle, toggleDropdown, closeDropdown, setIsUsingMouse, } = useButtonDropdown({
|
|
27
41
|
items,
|
|
28
42
|
onItemClick,
|
|
29
43
|
onItemFollow,
|
|
30
|
-
onReturnFocus: () => { var _a; return (_a =
|
|
44
|
+
onReturnFocus: () => { var _a; return (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); },
|
|
31
45
|
expandToViewport,
|
|
32
46
|
hasExpandableGroups: expandableGroups,
|
|
33
47
|
isInRestrictedView,
|
|
@@ -36,8 +50,9 @@ const InternalButtonDropdown = React.forwardRef((_a, ref) => {
|
|
|
36
50
|
setIsUsingMouse(true);
|
|
37
51
|
};
|
|
38
52
|
const baseProps = getBaseProps(props);
|
|
39
|
-
const
|
|
40
|
-
|
|
53
|
+
const mainActionRef = useRef(null);
|
|
54
|
+
const triggerRef = useRef(null);
|
|
55
|
+
useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);
|
|
41
56
|
const clickHandler = () => {
|
|
42
57
|
if (!loading && !disabled) {
|
|
43
58
|
// Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.
|
|
@@ -55,10 +70,40 @@ const InternalButtonDropdown = React.forwardRef((_a, ref) => {
|
|
|
55
70
|
iconAlign: 'right',
|
|
56
71
|
__iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],
|
|
57
72
|
};
|
|
58
|
-
const
|
|
73
|
+
const baseTriggerProps = Object.assign(Object.assign({ className: styles['trigger-button'] }, iconProps), { variant: triggerVariant, loading,
|
|
74
|
+
loadingText,
|
|
75
|
+
disabled, onClick: (event) => {
|
|
59
76
|
event.preventDefault();
|
|
60
77
|
clickHandler();
|
|
61
|
-
}, ariaLabel
|
|
78
|
+
}, ariaLabel, ariaExpanded: canBeOpened && isOpen, formAction: 'none', __nativeAttributes: {
|
|
79
|
+
'aria-haspopup': true,
|
|
80
|
+
} });
|
|
81
|
+
let trigger = null;
|
|
82
|
+
if (customTriggerBuilder) {
|
|
83
|
+
trigger = (React.createElement("div", { className: styles['dropdown-trigger'] }, customTriggerBuilder(clickHandler, triggerRef, disabled, isOpen, ariaLabel)));
|
|
84
|
+
}
|
|
85
|
+
else if (isMainAction) {
|
|
86
|
+
const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel } = mainAction, mainActionProps = __rest(mainAction, ["text", "iconName", "iconAlt", "iconSvg", "iconUrl", "external", "externalIconAriaLabel"]);
|
|
87
|
+
const mainActionIconProps = external
|
|
88
|
+
? { iconName: 'external', iconAlign: 'right' }
|
|
89
|
+
: { iconName, iconAlt, iconSvg, iconUrl };
|
|
90
|
+
const mainActionAriaLabel = externalIconAriaLabel
|
|
91
|
+
? `${(_b = mainAction.ariaLabel) !== null && _b !== void 0 ? _b : mainAction.text} ${mainAction.externalIconAriaLabel}`
|
|
92
|
+
: undefined;
|
|
93
|
+
trigger = (React.createElement("div", { role: "group", "aria-label": ariaLabel, className: styles['split-trigger-wrapper'] },
|
|
94
|
+
React.createElement("div", { className: clsx(styles['trigger-item'], styles['split-trigger']),
|
|
95
|
+
// Close dropdown upon main action click unless event is cancelled.
|
|
96
|
+
onClick: closeDropdown,
|
|
97
|
+
// Prevent keyboard events from propagation to the button dropdown handler.
|
|
98
|
+
onKeyDown: e => e.stopPropagation(), onKeyUp: e => e.stopPropagation() },
|
|
99
|
+
React.createElement(InternalButton, Object.assign({ ref: mainActionRef }, mainActionProps, mainActionIconProps, { className: styles['trigger-button'], variant: "primary", ariaLabel: mainActionAriaLabel, formAction: "none" }), text)),
|
|
100
|
+
React.createElement("div", { className: clsx(styles['trigger-item'], styles['dropdown-trigger'], isVisualRefresh && styles['visual-refresh']) },
|
|
101
|
+
React.createElement(InternalButton, Object.assign({ ref: triggerRef }, baseTriggerProps)))));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
trigger = (React.createElement("div", { className: styles['dropdown-trigger'] },
|
|
105
|
+
React.createElement(InternalButton, Object.assign({ ref: triggerRef }, baseTriggerProps), children)));
|
|
106
|
+
}
|
|
62
107
|
const hasHeader = title || description;
|
|
63
108
|
const headerId = useUniqueId('awsui-button-dropdown__header');
|
|
64
109
|
const { loadingButtonCount } = useFunnel();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button-dropdown/internal.tsx"],"names":[],"mappings":";AA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EACvB,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAChD,UAAU,EAAC,UAAU;gBAErB,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,gBAAgB,EACrC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,GAChB,CACU,CACL,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport Dropdown from '../internal/components/dropdown';\nimport ItemsList from './items-list';\nimport { useButtonDropdown } from './utils/use-button-dropdown';\nimport OptionsList from '../internal/components/options-list';\nimport { InternalButton } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport InternalBox from '../box/internal';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel.js';\n\nconst InternalButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n children,\n onItemClick,\n onItemFollow,\n customTriggerBuilder,\n expandToViewport,\n ariaLabel,\n title,\n description,\n preferCenter,\n __internalRootRef,\n ...props\n }: InternalButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const isInRestrictedView = useMobile();\n const dropdownId = useUniqueId('dropdown');\n for (const item of items) {\n checkSafeUrl('ButtonDropdown', item.href);\n }\n\n const {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n setIsUsingMouse,\n } = useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n onReturnFocus: () => dropdownRef.current?.focus(),\n expandToViewport,\n hasExpandableGroups: expandableGroups,\n isInRestrictedView,\n });\n\n const handleMouseEvent = () => {\n setIsUsingMouse(true);\n };\n\n const baseProps = getBaseProps(props);\n\n const dropdownRef = useRef<HTMLElement>(null);\n\n useForwardFocus(ref, dropdownRef);\n\n const clickHandler = () => {\n if (!loading && !disabled) {\n // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.\n toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView });\n }\n };\n\n const canBeOpened = !loading && !disabled;\n\n const triggerVariant = variant === 'navigation' ? undefined : variant === 'inline-icon' ? 'inline-icon' : variant;\n const iconProps: Partial<ButtonProps & { __iconClass?: string }> =\n variant === 'icon' || variant === 'inline-icon'\n ? {\n iconName: 'ellipsis',\n }\n : {\n iconName: 'caret-down-filled',\n iconAlign: 'right',\n __iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],\n };\n\n const trigger = customTriggerBuilder ? (\n customTriggerBuilder(clickHandler, dropdownRef, disabled, isOpen, ariaLabel)\n ) : (\n <InternalButton\n ref={dropdownRef}\n {...iconProps}\n variant={triggerVariant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n onClick={(event: Event) => {\n event.preventDefault();\n clickHandler();\n }}\n ariaLabel={ariaLabel}\n aria-haspopup={true}\n ariaExpanded={canBeOpened && isOpen}\n formAction=\"none\"\n >\n {children}\n </InternalButton>\n );\n\n const hasHeader = title || description;\n const headerId = useUniqueId('awsui-button-dropdown__header');\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n return (\n <div\n {...baseProps}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onMouseDown={handleMouseEvent}\n onMouseMove={handleMouseEvent}\n className={clsx(styles['button-dropdown'], styles[`variant-${variant}`], baseProps.className)}\n aria-owns={expandToViewport && isOpen ? dropdownId : undefined}\n ref={__internalRootRef}\n >\n <Dropdown\n open={canBeOpened && isOpen}\n stretchWidth={false}\n stretchTriggerHeight={variant === 'navigation'}\n expandToViewport={expandToViewport}\n preferCenter={preferCenter}\n onDropdownClose={() => toggleDropdown()}\n trigger={trigger}\n dropdownId={dropdownId}\n >\n {hasHeader && (\n <div className={styles.header} id={headerId}>\n {title && (\n <div className={styles.title}>\n <InternalBox\n fontSize=\"heading-s\"\n fontWeight=\"bold\"\n color=\"inherit\"\n tagOverride=\"h2\"\n margin={{ vertical: 'n', horizontal: 'n' }}\n >\n {title}\n </InternalBox>\n </div>\n )}\n {description && (\n <InternalBox fontSize=\"body-s\">\n <span className={styles.description}>{description}</span>\n </InternalBox>\n )}\n </div>\n )}\n <OptionsList\n open={canBeOpened && isOpen}\n position=\"static\"\n role=\"menu\"\n decreaseTopMargin={true}\n ariaLabelledby={hasHeader ? headerId : undefined}\n statusType=\"finished\"\n >\n <ItemsList\n items={items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n hasExpandableGroups={expandableGroups}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n expandToViewport={expandToViewport}\n variant={variant}\n />\n </OptionsList>\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default InternalButtonDropdown;\n"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E,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,gBAAgB,EACrC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,GAChB,CACU,CACL,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport Dropdown from '../internal/components/dropdown';\nimport ItemsList from './items-list';\nimport { useButtonDropdown } from './utils/use-button-dropdown';\nimport OptionsList from '../internal/components/options-list';\nimport { InternalButton, InternalButtonProps } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport InternalBox from '../box/internal';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel.js';\n\nconst InternalButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n children,\n onItemClick,\n onItemFollow,\n customTriggerBuilder,\n expandToViewport,\n ariaLabel,\n title,\n description,\n preferCenter,\n mainAction,\n __internalRootRef,\n ...props\n }: InternalButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const isInRestrictedView = useMobile();\n const dropdownId = useUniqueId('dropdown');\n for (const item of items) {\n checkSafeUrl('ButtonDropdown', item.href);\n }\n if (mainAction) {\n checkSafeUrl('ButtonDropdown', mainAction.href);\n }\n\n if (isDevelopment) {\n if (mainAction && variant !== 'primary') {\n warnOnce('ButtonDropdown', 'Main action is only supported for \"primary\" component variant.');\n }\n }\n const isMainAction = mainAction && variant === 'primary';\n const isVisualRefresh = useVisualRefresh();\n\n const {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n } = useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n onReturnFocus: () => triggerRef.current?.focus(),\n expandToViewport,\n hasExpandableGroups: expandableGroups,\n isInRestrictedView,\n });\n\n const handleMouseEvent = () => {\n setIsUsingMouse(true);\n };\n\n const baseProps = getBaseProps(props);\n\n const mainActionRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n\n useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);\n\n const clickHandler = () => {\n if (!loading && !disabled) {\n // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.\n toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView });\n }\n };\n\n const canBeOpened = !loading && !disabled;\n\n const triggerVariant = variant === 'navigation' ? undefined : variant === 'inline-icon' ? 'inline-icon' : variant;\n const iconProps: Partial<ButtonProps & { __iconClass?: string }> =\n variant === 'icon' || variant === 'inline-icon'\n ? {\n iconName: 'ellipsis',\n }\n : {\n iconName: 'caret-down-filled',\n iconAlign: 'right',\n __iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],\n };\n\n const baseTriggerProps: InternalButtonProps = {\n className: styles['trigger-button'],\n ...iconProps,\n variant: triggerVariant,\n loading,\n loadingText,\n disabled,\n onClick: (event: Event) => {\n event.preventDefault();\n clickHandler();\n },\n ariaLabel,\n ariaExpanded: canBeOpened && isOpen,\n formAction: 'none',\n __nativeAttributes: {\n 'aria-haspopup': true,\n },\n };\n\n let trigger: React.ReactNode = null;\n if (customTriggerBuilder) {\n trigger = (\n <div className={styles['dropdown-trigger']}>\n {customTriggerBuilder(clickHandler, triggerRef, disabled, isOpen, ariaLabel)}\n </div>\n );\n } else if (isMainAction) {\n const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel, ...mainActionProps } =\n mainAction;\n const mainActionIconProps = external\n ? ({ iconName: 'external', iconAlign: 'right' } as const)\n : ({ iconName, iconAlt, iconSvg, iconUrl } as const);\n const mainActionAriaLabel = externalIconAriaLabel\n ? `${mainAction.ariaLabel ?? mainAction.text} ${mainAction.externalIconAriaLabel}`\n : undefined;\n\n trigger = (\n <div role=\"group\" aria-label={ariaLabel} className={styles['split-trigger-wrapper']}>\n <div\n className={clsx(styles['trigger-item'], styles['split-trigger'])}\n // Close dropdown upon main action click unless event is cancelled.\n onClick={closeDropdown}\n // Prevent keyboard events from propagation to the button dropdown handler.\n onKeyDown={e => e.stopPropagation()}\n onKeyUp={e => e.stopPropagation()}\n >\n <InternalButton\n ref={mainActionRef}\n {...mainActionProps}\n {...mainActionIconProps}\n className={styles['trigger-button']}\n variant=\"primary\"\n ariaLabel={mainActionAriaLabel}\n formAction=\"none\"\n >\n {text}\n </InternalButton>\n </div>\n <div\n className={clsx(\n styles['trigger-item'],\n styles['dropdown-trigger'],\n isVisualRefresh && styles['visual-refresh']\n )}\n >\n <InternalButton ref={triggerRef} {...baseTriggerProps} />\n </div>\n </div>\n );\n } else {\n trigger = (\n <div className={styles['dropdown-trigger']}>\n <InternalButton ref={triggerRef} {...baseTriggerProps}>\n {children}\n </InternalButton>\n </div>\n );\n }\n\n const hasHeader = title || description;\n const headerId = useUniqueId('awsui-button-dropdown__header');\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n return (\n <div\n {...baseProps}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onMouseDown={handleMouseEvent}\n onMouseMove={handleMouseEvent}\n className={clsx(styles['button-dropdown'], styles[`variant-${variant}`], baseProps.className)}\n aria-owns={expandToViewport && isOpen ? dropdownId : undefined}\n ref={__internalRootRef}\n >\n <Dropdown\n open={canBeOpened && isOpen}\n stretchWidth={false}\n stretchTriggerHeight={variant === 'navigation'}\n expandToViewport={expandToViewport}\n preferCenter={preferCenter}\n onDropdownClose={() => toggleDropdown()}\n trigger={trigger}\n dropdownId={dropdownId}\n >\n {hasHeader && (\n <div className={styles.header} id={headerId}>\n {title && (\n <div className={styles.title}>\n <InternalBox\n fontSize=\"heading-s\"\n fontWeight=\"bold\"\n color=\"inherit\"\n tagOverride=\"h2\"\n margin={{ vertical: 'n', horizontal: 'n' }}\n >\n {title}\n </InternalBox>\n </div>\n )}\n {description && (\n <InternalBox fontSize=\"body-s\">\n <span className={styles.description}>{description}</span>\n </InternalBox>\n )}\n </div>\n )}\n <OptionsList\n open={canBeOpened && isOpen}\n position=\"static\"\n role=\"menu\"\n decreaseTopMargin={true}\n ariaLabelledby={hasHeader ? headerId : undefined}\n statusType=\"finished\"\n >\n <ItemsList\n items={items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n hasExpandableGroups={expandableGroups}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n expandToViewport={expandToViewport}\n variant={variant}\n />\n </OptionsList>\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default InternalButtonDropdown;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"trigger": "
|
|
6
|
-
"dropdown": "
|
|
7
|
-
"nowrap": "
|
|
8
|
-
"open": "
|
|
4
|
+
"root": "awsui_root_14cnr_16690_93",
|
|
5
|
+
"trigger": "awsui_trigger_14cnr_16690_108",
|
|
6
|
+
"dropdown": "awsui_dropdown_14cnr_16690_111",
|
|
7
|
+
"nowrap": "awsui_nowrap_14cnr_16690_122",
|
|
8
|
+
"open": "awsui_open_14cnr_16690_125"
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
93
|
+
.awsui_root_14cnr_16690_93:not(#\9) {
|
|
94
94
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
95
95
|
border-collapse: separate;
|
|
96
96
|
border-spacing: 0;
|
|
@@ -121,7 +121,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
121
121
|
word-spacing: normal;
|
|
122
122
|
box-sizing: border-box;
|
|
123
123
|
font-size: var(--font-body-m-size-7dign1, 14px);
|
|
124
|
-
line-height: var(--font-body-m-line-height-
|
|
124
|
+
line-height: var(--font-body-m-line-height-ghizru, 20px);
|
|
125
125
|
color: var(--color-text-body-default-su7kuo, #000716);
|
|
126
126
|
font-weight: 400;
|
|
127
127
|
font-family: var(--font-family-base-wn913o, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
@@ -131,10 +131,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
131
131
|
white-space: inherit;
|
|
132
132
|
display: inline;
|
|
133
133
|
}
|
|
134
|
-
.
|
|
134
|
+
.awsui_root_14cnr_16690_93 > .awsui_trigger_14cnr_16690_108:not(#\9) {
|
|
135
135
|
display: inline;
|
|
136
136
|
}
|
|
137
|
-
.
|
|
137
|
+
.awsui_root_14cnr_16690_93 > .awsui_dropdown_14cnr_16690_111:not(#\9) {
|
|
138
138
|
position: static;
|
|
139
139
|
-webkit-user-select: none;
|
|
140
140
|
user-select: none;
|
|
@@ -146,9 +146,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
146
146
|
flex-direction: column;
|
|
147
147
|
width: 100%;
|
|
148
148
|
}
|
|
149
|
-
.
|
|
149
|
+
.awsui_root_14cnr_16690_93 > .awsui_dropdown_14cnr_16690_111.awsui_nowrap_14cnr_16690_122:not(#\9) {
|
|
150
150
|
white-space: nowrap;
|
|
151
151
|
}
|
|
152
|
-
.
|
|
152
|
+
.awsui_root_14cnr_16690_93 > .awsui_dropdown_14cnr_16690_111.awsui_open_14cnr_16690_125:not(#\9) {
|
|
153
153
|
display: flex;
|
|
154
154
|
}
|
|
@@ -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
|
-
"trigger": "
|
|
7
|
-
"dropdown": "
|
|
8
|
-
"nowrap": "
|
|
9
|
-
"open": "
|
|
5
|
+
"root": "awsui_root_14cnr_16690_93",
|
|
6
|
+
"trigger": "awsui_trigger_14cnr_16690_108",
|
|
7
|
+
"dropdown": "awsui_dropdown_14cnr_16690_111",
|
|
8
|
+
"nowrap": "awsui_nowrap_14cnr_16690_122",
|
|
9
|
+
"open": "awsui_open_14cnr_16690_125"
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"button-dropdown": "awsui_button-
|
|
5
|
-
"items-list-container": "awsui_items-list-
|
|
6
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
7
|
-
"rotate-up": "awsui_rotate-
|
|
8
|
-
"rotate-down": "awsui_rotate-
|
|
9
|
-
"header": "
|
|
10
|
-
"title": "
|
|
11
|
-
"description": "
|
|
4
|
+
"button-dropdown": "awsui_button-dropdown_sne0l_2839s_93",
|
|
5
|
+
"items-list-container": "awsui_items-list-container_sne0l_2839s_97",
|
|
6
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_sne0l_2839s_1",
|
|
7
|
+
"rotate-up": "awsui_rotate-up_sne0l_2839s_114",
|
|
8
|
+
"rotate-down": "awsui_rotate-down_sne0l_2839s_129",
|
|
9
|
+
"header": "awsui_header_sne0l_2839s_144",
|
|
10
|
+
"title": "awsui_title_sne0l_2839s_153",
|
|
11
|
+
"description": "awsui_description_sne0l_2839s_154",
|
|
12
|
+
"split-trigger-wrapper": "awsui_split-trigger-wrapper_sne0l_2839s_158",
|
|
13
|
+
"trigger-item": "awsui_trigger-item_sne0l_2839s_161",
|
|
14
|
+
"trigger-button": "awsui_trigger-button_sne0l_2839s_164",
|
|
15
|
+
"visual-refresh": "awsui_visual-refresh_sne0l_2839s_176",
|
|
16
|
+
"split-trigger": "awsui_split-trigger_sne0l_2839s_158",
|
|
17
|
+
"dropdown-trigger": "awsui_dropdown-trigger_sne0l_2839s_184"
|
|
12
18
|
};
|
|
13
19
|
|
|
@@ -90,58 +90,58 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_button-
|
|
93
|
+
.awsui_button-dropdown_sne0l_2839s_93:not(#\9) {
|
|
94
94
|
display: inline-block;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.awsui_items-list-
|
|
97
|
+
.awsui_items-list-container_sne0l_2839s_97:not(#\9) {
|
|
98
98
|
padding: 0;
|
|
99
99
|
margin: 0;
|
|
100
|
-
animation: awsui_awsui-motion-fade-in-
|
|
100
|
+
animation: awsui_awsui-motion-fade-in-0_sne0l_2839s_1 500ms var(--motion-easing-show-quick-17va6f, ease-out);
|
|
101
101
|
animation-fill-mode: none;
|
|
102
102
|
}
|
|
103
103
|
@media (prefers-reduced-motion: reduce) {
|
|
104
|
-
.awsui_items-list-
|
|
104
|
+
.awsui_items-list-container_sne0l_2839s_97:not(#\9) {
|
|
105
105
|
animation: none;
|
|
106
106
|
transition: none;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
.awsui-motion-disabled .awsui_items-list-
|
|
109
|
+
.awsui-motion-disabled .awsui_items-list-container_sne0l_2839s_97:not(#\9), .awsui-mode-entering .awsui_items-list-container_sne0l_2839s_97:not(#\9) {
|
|
110
110
|
animation: none;
|
|
111
111
|
transition: none;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.awsui_rotate-
|
|
114
|
+
.awsui_rotate-up_sne0l_2839s_114:not(#\9) {
|
|
115
115
|
transform: rotate(-180deg);
|
|
116
116
|
transition: transform var(--motion-duration-rotate-180-m9g4a9, 135ms) var(--motion-easing-rotate-180-h4cyjx, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
117
117
|
}
|
|
118
118
|
@media (prefers-reduced-motion: reduce) {
|
|
119
|
-
.awsui_rotate-
|
|
119
|
+
.awsui_rotate-up_sne0l_2839s_114:not(#\9) {
|
|
120
120
|
animation: none;
|
|
121
121
|
transition: none;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
.awsui-motion-disabled .awsui_rotate-
|
|
124
|
+
.awsui-motion-disabled .awsui_rotate-up_sne0l_2839s_114:not(#\9), .awsui-mode-entering .awsui_rotate-up_sne0l_2839s_114:not(#\9) {
|
|
125
125
|
animation: none;
|
|
126
126
|
transition: none;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
.awsui_rotate-
|
|
129
|
+
.awsui_rotate-down_sne0l_2839s_129:not(#\9) {
|
|
130
130
|
transform: rotate(0deg);
|
|
131
131
|
transition: transform var(--motion-duration-rotate-180-m9g4a9, 135ms) var(--motion-easing-rotate-180-h4cyjx, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
132
132
|
}
|
|
133
133
|
@media (prefers-reduced-motion: reduce) {
|
|
134
|
-
.awsui_rotate-
|
|
134
|
+
.awsui_rotate-down_sne0l_2839s_129:not(#\9) {
|
|
135
135
|
animation: none;
|
|
136
136
|
transition: none;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
.awsui-motion-disabled .awsui_rotate-
|
|
139
|
+
.awsui-motion-disabled .awsui_rotate-down_sne0l_2839s_129:not(#\9), .awsui-mode-entering .awsui_rotate-down_sne0l_2839s_129:not(#\9) {
|
|
140
140
|
animation: none;
|
|
141
141
|
transition: none;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
.
|
|
144
|
+
.awsui_header_sne0l_2839s_144:not(#\9) {
|
|
145
145
|
display: flex;
|
|
146
146
|
flex-direction: column;
|
|
147
147
|
list-style: none;
|
|
@@ -150,7 +150,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
border-bottom: var(--border-field-width-riro62, 2px) solid var(--color-border-dropdown-group-qb493x, #e9ebed);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
.
|
|
154
|
-
.
|
|
153
|
+
.awsui_title_sne0l_2839s_153:not(#\9),
|
|
154
|
+
.awsui_description_sne0l_2839s_154:not(#\9) {
|
|
155
155
|
color: var(--color-text-dropdown-header-mdcup0, #000716);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.awsui_split-trigger-wrapper_sne0l_2839s_158:not(#\9) {
|
|
159
|
+
display: flex;
|
|
160
|
+
}
|
|
161
|
+
.awsui_split-trigger-wrapper_sne0l_2839s_158 > .awsui_trigger-item_sne0l_2839s_161 > button:not(#\9):focus {
|
|
162
|
+
z-index: 1;
|
|
163
|
+
}
|
|
164
|
+
.awsui_split-trigger-wrapper_sne0l_2839s_158 > .awsui_trigger-item_sne0l_2839s_161:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_2839s_164 {
|
|
165
|
+
border-top-right-radius: 0;
|
|
166
|
+
border-bottom-right-radius: 0;
|
|
167
|
+
padding-right: var(--space-xs-edba2s, 8px);
|
|
168
|
+
margin-right: var(--space-xxxs-j6dpcy, 2px);
|
|
169
|
+
}
|
|
170
|
+
.awsui_split-trigger-wrapper_sne0l_2839s_158 > .awsui_trigger-item_sne0l_2839s_161:not(#\9):not(:first-child) > .awsui_trigger-button_sne0l_2839s_164 {
|
|
171
|
+
border-top-left-radius: 0;
|
|
172
|
+
border-bottom-left-radius: 0;
|
|
173
|
+
padding-left: calc(var(--space-xs-edba2s, 8px) - 2px);
|
|
174
|
+
padding-right: calc(var(--space-xs-edba2s, 8px) - 2px);
|
|
175
|
+
}
|
|
176
|
+
.awsui_split-trigger-wrapper_sne0l_2839s_158 > .awsui_trigger-item_sne0l_2839s_161:not(#\9):not(:first-child).awsui_visual-refresh_sne0l_2839s_176 > .awsui_trigger-button_sne0l_2839s_164 {
|
|
177
|
+
padding-right: calc(var(--space-s-hdd878, 12px) - 2px);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.awsui_split-trigger_sne0l_2839s_158:not(#\9) {
|
|
181
|
+
display: contents;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.awsui_dropdown-trigger_sne0l_2839s_184:not(#\9) {
|
|
185
|
+
display: contents;
|
|
156
186
|
}
|