@cloudscape-design/components-themeable 3.0.853 → 3.0.855
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/breadcrumb-group/styles.scss +47 -0
- package/lib/internal/scss/button/test-classes/styles.scss +4 -0
- package/lib/internal/scss/button-dropdown/item-element/styles.scss +6 -0
- package/lib/internal/scss/button-dropdown/styles.scss +27 -12
- package/lib/internal/scss/file-input/styles.scss +12 -1
- package/lib/internal/scss/internal/styles/motion/animations.scss +11 -0
- package/lib/internal/scss/top-navigation/1.0-beta/styles.scss +0 -14
- package/lib/internal/scss/top-navigation/styles.scss +1 -7
- package/lib/internal/template/alert/styles.css.js +28 -28
- package/lib/internal/template/alert/styles.scoped.css +49 -45
- package/lib/internal/template/alert/styles.selectors.js +28 -28
- package/lib/internal/template/anchor-navigation/styles.css.js +8 -8
- package/lib/internal/template/anchor-navigation/styles.scoped.css +24 -20
- package/lib/internal/template/anchor-navigation/styles.selectors.js +8 -8
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +36 -32
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/content-wrapper/styles.css.js +3 -3
- package/lib/internal/template/app-layout/content-wrapper/styles.scoped.css +10 -6
- package/lib/internal/template/app-layout/content-wrapper/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/drawer/styles.css.js +14 -14
- package/lib/internal/template/app-layout/drawer/styles.scoped.css +28 -24
- package/lib/internal/template/app-layout/drawer/styles.selectors.js +14 -14
- package/lib/internal/template/app-layout/mobile-toolbar/styles.css.js +8 -8
- package/lib/internal/template/app-layout/mobile-toolbar/styles.scoped.css +12 -8
- package/lib/internal/template/app-layout/mobile-toolbar/styles.selectors.js +8 -8
- package/lib/internal/template/app-layout/resize/styles.css.js +5 -5
- package/lib/internal/template/app-layout/resize/styles.scoped.css +16 -12
- package/lib/internal/template/app-layout/resize/styles.selectors.js +5 -5
- package/lib/internal/template/app-layout/split-panel/styles.css.js +2 -2
- package/lib/internal/template/app-layout/split-panel/styles.scoped.css +6 -2
- package/lib/internal/template/app-layout/split-panel/styles.selectors.js +2 -2
- package/lib/internal/template/app-layout/styles.css.js +12 -12
- package/lib/internal/template/app-layout/styles.scoped.css +16 -12
- package/lib/internal/template/app-layout/styles.selectors.js +12 -12
- package/lib/internal/template/app-layout/toggles/styles.css.js +2 -2
- package/lib/internal/template/app-layout/toggles/styles.scoped.css +12 -8
- package/lib/internal/template/app-layout/toggles/styles.selectors.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +167 -163
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +10 -10
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +17 -13
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -10
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +9 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +19 -19
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +39 -35
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +19 -19
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/styles.css.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/styles.scoped.css +5 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/styles.selectors.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +13 -13
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +19 -15
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +13 -13
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.css.js +7 -7
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scoped.css +23 -19
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.selectors.js +7 -7
- package/lib/internal/template/area-chart/styles.css.js +6 -6
- package/lib/internal/template/area-chart/styles.scoped.css +15 -11
- package/lib/internal/template/area-chart/styles.selectors.js +6 -6
- package/lib/internal/template/attribute-editor/styles.css.js +14 -14
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -24
- package/lib/internal/template/attribute-editor/styles.selectors.js +14 -14
- package/lib/internal/template/autosuggest/load-more-controller.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.js +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.js.map +1 -1
- package/lib/internal/template/badge/styles.css.js +10 -10
- package/lib/internal/template/badge/styles.scoped.css +14 -10
- package/lib/internal/template/badge/styles.selectors.js +10 -10
- package/lib/internal/template/box/styles.css.js +191 -191
- package/lib/internal/template/box/styles.scoped.css +240 -236
- package/lib/internal/template/box/styles.selectors.js +191 -191
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts +15 -0
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts.map +1 -0
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.js +47 -0
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.js.map +1 -0
- package/lib/internal/template/breadcrumb-group/implementation.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/implementation.js +9 -6
- package/lib/internal/template/breadcrumb-group/implementation.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +29 -25
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/breadcrumb-group/styles.css.js +14 -10
- package/lib/internal/template/breadcrumb-group/styles.scoped.css +124 -11
- package/lib/internal/template/breadcrumb-group/styles.selectors.js +14 -10
- package/lib/internal/template/breadcrumb-group/utils.d.ts +0 -2
- package/lib/internal/template/breadcrumb-group/utils.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/utils.js +17 -46
- package/lib/internal/template/breadcrumb-group/utils.js.map +1 -1
- package/lib/internal/template/button/index.d.ts.map +1 -1
- package/lib/internal/template/button/index.js +3 -3
- package/lib/internal/template/button/index.js.map +1 -1
- package/lib/internal/template/button/interfaces.d.ts +18 -0
- package/lib/internal/template/button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button/interfaces.js.map +1 -1
- package/lib/internal/template/button/internal.d.ts.map +1 -1
- package/lib/internal/template/button/internal.js +15 -2
- package/lib/internal/template/button/internal.js.map +1 -1
- package/lib/internal/template/button/styles.css.js +21 -21
- package/lib/internal/template/button/styles.scoped.css +158 -154
- package/lib/internal/template/button/styles.selectors.js +21 -21
- package/lib/internal/template/button/test-classes/styles.css.js +2 -1
- package/lib/internal/template/button/test-classes/styles.scoped.css +5 -1
- package/lib/internal/template/button/test-classes/styles.selectors.js +2 -1
- package/lib/internal/template/button-dropdown/category-elements/styles.css.js +14 -14
- package/lib/internal/template/button-dropdown/category-elements/styles.scoped.css +27 -23
- package/lib/internal/template/button-dropdown/category-elements/styles.selectors.js +14 -14
- package/lib/internal/template/button-dropdown/index.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/index.js +2 -2
- package/lib/internal/template/button-dropdown/index.js.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.d.ts +18 -2
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/internal.js +13 -6
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.js +3 -2
- package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +14 -13
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +33 -21
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +14 -13
- package/lib/internal/template/button-dropdown/mobile-expandable-group/styles.css.js +5 -5
- package/lib/internal/template/button-dropdown/mobile-expandable-group/styles.scoped.css +9 -5
- package/lib/internal/template/button-dropdown/mobile-expandable-group/styles.selectors.js +5 -5
- package/lib/internal/template/button-dropdown/styles.css.js +21 -17
- package/lib/internal/template/button-dropdown/styles.scoped.css +51 -38
- package/lib/internal/template/button-dropdown/styles.selectors.js +21 -17
- package/lib/internal/template/button-group/file-input-item.d.ts +11 -0
- package/lib/internal/template/button-group/file-input-item.d.ts.map +1 -0
- package/lib/internal/template/button-group/file-input-item.js +23 -0
- package/lib/internal/template/button-group/file-input-item.js.map +1 -0
- package/lib/internal/template/button-group/interfaces.d.ts +23 -1
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/button-group/internal.d.ts.map +1 -1
- package/lib/internal/template/button-group/internal.js +2 -2
- package/lib/internal/template/button-group/internal.js.map +1 -1
- package/lib/internal/template/button-group/item-element.d.ts +1 -0
- package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
- package/lib/internal/template/button-group/item-element.js +12 -6
- package/lib/internal/template/button-group/item-element.js.map +1 -1
- package/lib/internal/template/button-group/styles.css.js +4 -4
- package/lib/internal/template/button-group/styles.scoped.css +10 -6
- package/lib/internal/template/button-group/styles.selectors.js +4 -4
- package/lib/internal/template/calendar/grid/index.d.ts +1 -2
- package/lib/internal/template/calendar/grid/index.d.ts.map +1 -1
- package/lib/internal/template/calendar/grid/index.js.map +1 -1
- package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.d.ts.map +1 -1
- package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.js +2 -1
- package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.js.map +1 -1
- package/lib/internal/template/calendar/internal.d.ts.map +1 -1
- package/lib/internal/template/calendar/internal.js +2 -1
- package/lib/internal/template/calendar/internal.js.map +1 -1
- package/lib/internal/template/calendar/styles.css.js +21 -21
- package/lib/internal/template/calendar/styles.scoped.css +47 -43
- package/lib/internal/template/calendar/styles.selectors.js +21 -21
- package/lib/internal/template/calendar/utils/navigation-day.d.ts +8 -0
- package/lib/internal/template/calendar/utils/navigation-day.d.ts.map +1 -0
- package/lib/internal/template/calendar/utils/navigation-day.js +39 -0
- package/lib/internal/template/calendar/utils/navigation-day.js.map +1 -0
- package/lib/internal/template/calendar/utils/{navigation.d.ts → navigation-month.d.ts} +2 -6
- package/lib/internal/template/calendar/utils/navigation-month.d.ts.map +1 -0
- package/lib/internal/template/calendar/utils/navigation-month.js +39 -0
- package/lib/internal/template/calendar/utils/navigation-month.js.map +1 -0
- package/lib/internal/template/cards/styles.css.js +39 -39
- package/lib/internal/template/cards/styles.scoped.css +54 -50
- package/lib/internal/template/cards/styles.selectors.js +39 -39
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +9 -5
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/code-editor/resizable-box/styles.css.js +3 -3
- package/lib/internal/template/code-editor/resizable-box/styles.scoped.css +13 -9
- package/lib/internal/template/code-editor/resizable-box/styles.selectors.js +3 -3
- package/lib/internal/template/code-editor/styles.css.js +33 -33
- package/lib/internal/template/code-editor/styles.scoped.css +187 -183
- package/lib/internal/template/code-editor/styles.selectors.js +33 -33
- package/lib/internal/template/collection-preferences/content-display/styles.css.js +12 -12
- package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +23 -15
- package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +12 -12
- package/lib/internal/template/collection-preferences/styles.css.js +38 -38
- package/lib/internal/template/collection-preferences/styles.scoped.css +58 -42
- package/lib/internal/template/collection-preferences/styles.selectors.js +38 -38
- package/lib/internal/template/column-layout/flexible-column-layout/styles.css.js +5 -5
- package/lib/internal/template/column-layout/flexible-column-layout/styles.scoped.css +14 -10
- package/lib/internal/template/column-layout/flexible-column-layout/styles.selectors.js +5 -5
- package/lib/internal/template/column-layout/styles.css.js +13 -13
- package/lib/internal/template/column-layout/styles.scoped.css +49 -45
- package/lib/internal/template/column-layout/styles.selectors.js +13 -13
- package/lib/internal/template/container/styles.css.js +31 -31
- package/lib/internal/template/container/styles.scoped.css +60 -56
- package/lib/internal/template/container/styles.selectors.js +31 -31
- package/lib/internal/template/content-layout/styles.css.js +14 -14
- package/lib/internal/template/content-layout/styles.scoped.css +20 -16
- package/lib/internal/template/content-layout/styles.selectors.js +14 -14
- package/lib/internal/template/date-picker/styles.css.js +7 -7
- package/lib/internal/template/date-picker/styles.scoped.css +13 -9
- package/lib/internal/template/date-picker/styles.selectors.js +7 -7
- package/lib/internal/template/date-range-picker/calendar/grids/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/grids/index.js +1 -1
- package/lib/internal/template/date-range-picker/calendar/grids/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/grids/styles.css.js +28 -28
- package/lib/internal/template/date-range-picker/calendar/grids/styles.scoped.css +47 -43
- package/lib/internal/template/date-range-picker/calendar/grids/styles.selectors.js +28 -28
- package/lib/internal/template/date-range-picker/calendar/index.js +1 -1
- package/lib/internal/template/date-range-picker/calendar/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/index.js +3 -10
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/relative-range/styles.css.js +9 -9
- package/lib/internal/template/date-range-picker/relative-range/styles.scoped.css +17 -13
- package/lib/internal/template/date-range-picker/relative-range/styles.selectors.js +9 -9
- package/lib/internal/template/date-range-picker/styles.css.js +38 -38
- package/lib/internal/template/date-range-picker/styles.scoped.css +51 -47
- package/lib/internal/template/date-range-picker/styles.selectors.js +38 -38
- package/lib/internal/template/date-range-picker/time-offset.d.ts +2 -1
- package/lib/internal/template/date-range-picker/time-offset.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/time-offset.js +1 -1
- package/lib/internal/template/date-range-picker/time-offset.js.map +1 -1
- package/lib/internal/template/date-range-picker/utils.d.ts +9 -0
- package/lib/internal/template/date-range-picker/utils.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/utils.js +19 -2
- package/lib/internal/template/date-range-picker/utils.js.map +1 -1
- package/lib/internal/template/drawer/styles.css.js +5 -5
- package/lib/internal/template/drawer/styles.scoped.css +16 -12
- package/lib/internal/template/drawer/styles.selectors.js +5 -5
- package/lib/internal/template/expandable-section/styles.css.js +34 -34
- package/lib/internal/template/expandable-section/styles.scoped.css +69 -65
- package/lib/internal/template/expandable-section/styles.selectors.js +34 -34
- package/lib/internal/template/file-dropzone/styles.css.js +3 -3
- package/lib/internal/template/file-dropzone/styles.scoped.css +9 -5
- package/lib/internal/template/file-dropzone/styles.selectors.js +3 -3
- package/lib/internal/template/file-input/internal.d.ts +5 -1
- package/lib/internal/template/file-input/internal.d.ts.map +1 -1
- package/lib/internal/template/file-input/internal.js +18 -10
- package/lib/internal/template/file-input/internal.js.map +1 -1
- package/lib/internal/template/file-input/styles.css.js +6 -5
- package/lib/internal/template/file-input/styles.scoped.css +33 -8
- package/lib/internal/template/file-input/styles.selectors.js +6 -5
- package/lib/internal/template/file-token-group/styles.css.js +22 -22
- package/lib/internal/template/file-token-group/styles.scoped.css +35 -31
- package/lib/internal/template/file-token-group/styles.selectors.js +22 -22
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +152 -148
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/form/styles.css.js +8 -8
- package/lib/internal/template/form/styles.scoped.css +12 -8
- package/lib/internal/template/form/styles.selectors.js +8 -8
- package/lib/internal/template/form-field/styles.css.js +24 -24
- package/lib/internal/template/form-field/styles.scoped.css +42 -38
- package/lib/internal/template/form-field/styles.selectors.js +24 -24
- package/lib/internal/template/grid/styles.css.js +53 -53
- package/lib/internal/template/grid/styles.scoped.css +58 -54
- package/lib/internal/template/grid/styles.selectors.js +53 -53
- package/lib/internal/template/header/styles.css.js +34 -34
- package/lib/internal/template/header/styles.scoped.css +56 -52
- package/lib/internal/template/header/styles.selectors.js +34 -34
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +73 -69
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/hotspot/styles.css.js +7 -7
- package/lib/internal/template/hotspot/styles.scoped.css +13 -9
- package/lib/internal/template/hotspot/styles.selectors.js +7 -7
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +3 -0
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/icon/styles.css.js +38 -38
- package/lib/internal/template/icon/styles.scoped.css +89 -85
- package/lib/internal/template/icon/styles.selectors.js +38 -38
- package/lib/internal/template/input/styles.css.js +13 -13
- package/lib/internal/template/input/styles.scoped.css +36 -32
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/components/abstract-switch/styles.css.js +13 -13
- package/lib/internal/template/internal/components/abstract-switch/styles.scoped.css +24 -20
- package/lib/internal/template/internal/components/abstract-switch/styles.selectors.js +13 -13
- package/lib/internal/template/internal/components/button-trigger/styles.css.js +13 -13
- package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +31 -27
- package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +13 -13
- package/lib/internal/template/internal/components/chart-filter/styles.css.js +3 -3
- package/lib/internal/template/internal/components/chart-filter/styles.scoped.css +7 -3
- package/lib/internal/template/internal/components/chart-filter/styles.selectors.js +3 -3
- package/lib/internal/template/internal/components/chart-legend/styles.css.js +6 -6
- package/lib/internal/template/internal/components/chart-legend/styles.scoped.css +19 -15
- package/lib/internal/template/internal/components/chart-legend/styles.selectors.js +6 -6
- package/lib/internal/template/internal/components/chart-plot/styles.css.js +5 -5
- package/lib/internal/template/internal/components/chart-plot/styles.scoped.css +9 -5
- package/lib/internal/template/internal/components/chart-plot/styles.selectors.js +5 -5
- package/lib/internal/template/internal/components/chart-popover/styles.css.js +3 -3
- package/lib/internal/template/internal/components/chart-popover/styles.scoped.css +7 -3
- package/lib/internal/template/internal/components/chart-popover/styles.selectors.js +3 -3
- package/lib/internal/template/internal/components/chart-series-details/styles.css.js +20 -20
- package/lib/internal/template/internal/components/chart-series-details/styles.scoped.css +37 -33
- package/lib/internal/template/internal/components/chart-series-details/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/chart-series-marker/styles.css.js +5 -5
- package/lib/internal/template/internal/components/chart-series-marker/styles.scoped.css +11 -7
- package/lib/internal/template/internal/components/chart-series-marker/styles.selectors.js +5 -5
- package/lib/internal/template/internal/components/chart-wrapper/styles.css.js +9 -9
- package/lib/internal/template/internal/components/chart-wrapper/styles.scoped.css +15 -11
- package/lib/internal/template/internal/components/chart-wrapper/styles.selectors.js +9 -9
- package/lib/internal/template/internal/components/checkbox-icon/styles.css.js +9 -9
- package/lib/internal/template/internal/components/checkbox-icon/styles.scoped.css +13 -9
- package/lib/internal/template/internal/components/checkbox-icon/styles.selectors.js +9 -9
- package/lib/internal/template/internal/components/dnd-container/styles.css.js +1 -1
- package/lib/internal/template/internal/components/dnd-container/styles.scoped.css +8 -4
- package/lib/internal/template/internal/components/dnd-container/styles.selectors.js +1 -1
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +41 -37
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/dropdown-footer/styles.css.js +3 -3
- package/lib/internal/template/internal/components/dropdown-footer/styles.scoped.css +7 -3
- package/lib/internal/template/internal/components/dropdown-footer/styles.selectors.js +3 -3
- package/lib/internal/template/internal/components/dropdown-status/styles.css.js +2 -2
- package/lib/internal/template/internal/components/dropdown-status/styles.scoped.css +6 -2
- package/lib/internal/template/internal/components/dropdown-status/styles.selectors.js +2 -2
- package/lib/internal/template/internal/components/handle/styles.css.js +2 -2
- package/lib/internal/template/internal/components/handle/styles.scoped.css +10 -6
- package/lib/internal/template/internal/components/handle/styles.selectors.js +2 -2
- package/lib/internal/template/internal/components/menu-dropdown/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/menu-dropdown/index.js +2 -1
- package/lib/internal/template/internal/components/menu-dropdown/index.js.map +1 -1
- package/lib/internal/template/internal/components/menu-dropdown/styles.css.js +7 -7
- package/lib/internal/template/internal/components/menu-dropdown/styles.scoped.css +17 -13
- package/lib/internal/template/internal/components/menu-dropdown/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/option/styles.css.js +17 -17
- package/lib/internal/template/internal/components/option/styles.scoped.css +33 -29
- package/lib/internal/template/internal/components/option/styles.selectors.js +17 -17
- package/lib/internal/template/internal/components/options-list/styles.css.js +3 -3
- package/lib/internal/template/internal/components/options-list/styles.scoped.css +7 -3
- package/lib/internal/template/internal/components/options-list/styles.selectors.js +3 -3
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js +13 -16
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/styles.css.js +5 -5
- package/lib/internal/template/internal/components/panel-resize-handle/styles.scoped.css +14 -10
- package/lib/internal/template/internal/components/panel-resize-handle/styles.selectors.js +5 -5
- package/lib/internal/template/internal/components/screenreader-only/styles.css.js +1 -1
- package/lib/internal/template/internal/components/screenreader-only/styles.scoped.css +5 -1
- package/lib/internal/template/internal/components/screenreader-only/styles.selectors.js +1 -1
- package/lib/internal/template/internal/components/selectable-item/styles.css.js +16 -16
- package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +33 -29
- package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +16 -16
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +28 -24
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/internal/hooks/use-performance-marks/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-performance-marks/index.js +23 -2
- package/lib/internal/template/internal/hooks/use-performance-marks/index.js.map +1 -1
- package/lib/internal/template/internal/styles/motion/utils.d.ts +2 -0
- package/lib/internal/template/internal/styles/motion/utils.d.ts.map +1 -0
- package/lib/internal/template/internal/styles/motion/utils.js +5 -0
- package/lib/internal/template/internal/styles/motion/utils.js.map +1 -0
- package/lib/internal/template/internal/utils/date-time/format-date-iso.d.ts +2 -1
- package/lib/internal/template/internal/utils/date-time/format-date-iso.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-iso.js +6 -2
- package/lib/internal/template/internal/utils/date-time/format-date-iso.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-localized.d.ts +2 -1
- package/lib/internal/template/internal/utils/date-time/format-date-localized.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-localized.js +9 -2
- package/lib/internal/template/internal/utils/date-time/format-date-localized.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-time-with-offset.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-time-with-offset.js +4 -3
- package/lib/internal/template/internal/utils/date-time/format-date-time-with-offset.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/index.d.ts +1 -1
- package/lib/internal/template/internal/utils/date-time/index.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/index.js +1 -1
- package/lib/internal/template/internal/utils/date-time/index.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/is-iso-only.d.ts +9 -0
- package/lib/internal/template/internal/utils/date-time/is-iso-only.d.ts.map +1 -0
- package/lib/internal/template/internal/utils/date-time/is-iso-only.js +18 -0
- package/lib/internal/template/internal/utils/date-time/is-iso-only.js.map +1 -0
- package/lib/internal/template/internal/utils/handle-key.d.ts +1 -2
- package/lib/internal/template/internal/utils/handle-key.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/handle-key.js.map +1 -1
- package/lib/internal/template/internal/utils/throttle.d.ts +1 -2
- package/lib/internal/template/internal/utils/throttle.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/throttle.js.map +1 -1
- package/lib/internal/template/key-value-pairs/index.d.ts +1 -1
- package/lib/internal/template/key-value-pairs/index.d.ts.map +1 -1
- package/lib/internal/template/key-value-pairs/index.js +2 -2
- package/lib/internal/template/key-value-pairs/index.js.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.d.ts +8 -0
- package/lib/internal/template/key-value-pairs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.js.map +1 -1
- package/lib/internal/template/key-value-pairs/internal.d.ts.map +1 -1
- package/lib/internal/template/key-value-pairs/internal.js +2 -2
- package/lib/internal/template/key-value-pairs/internal.js.map +1 -1
- package/lib/internal/template/key-value-pairs/styles.css.js +8 -8
- package/lib/internal/template/key-value-pairs/styles.scoped.css +13 -9
- package/lib/internal/template/key-value-pairs/styles.selectors.js +8 -8
- package/lib/internal/template/link/styles.css.js +20 -20
- package/lib/internal/template/link/styles.scoped.css +75 -71
- package/lib/internal/template/link/styles.selectors.js +20 -20
- package/lib/internal/template/live-region/styles.css.js +2 -2
- package/lib/internal/template/live-region/styles.scoped.css +7 -3
- package/lib/internal/template/live-region/styles.selectors.js +2 -2
- package/lib/internal/template/mixed-line-bar-chart/styles.css.js +11 -11
- package/lib/internal/template/mixed-line-bar-chart/styles.scoped.css +23 -19
- package/lib/internal/template/mixed-line-bar-chart/styles.selectors.js +11 -11
- package/lib/internal/template/modal/index.js +1 -1
- package/lib/internal/template/modal/index.js.map +1 -1
- package/lib/internal/template/modal/styles.css.js +23 -23
- package/lib/internal/template/modal/styles.scoped.css +42 -38
- package/lib/internal/template/modal/styles.selectors.js +23 -23
- package/lib/internal/template/multiselect/styles.css.js +3 -3
- package/lib/internal/template/multiselect/styles.scoped.css +7 -3
- package/lib/internal/template/multiselect/styles.selectors.js +3 -3
- package/lib/internal/template/pagination/styles.css.js +9 -9
- package/lib/internal/template/pagination/styles.scoped.css +27 -23
- package/lib/internal/template/pagination/styles.selectors.js +9 -9
- package/lib/internal/template/pie-chart/styles.css.js +27 -27
- package/lib/internal/template/pie-chart/styles.scoped.css +52 -48
- package/lib/internal/template/pie-chart/styles.selectors.js +27 -27
- package/lib/internal/template/popover/styles.css.js +53 -53
- package/lib/internal/template/popover/styles.scoped.css +89 -69
- package/lib/internal/template/popover/styles.selectors.js +53 -53
- package/lib/internal/template/progress-bar/styles.css.js +19 -19
- package/lib/internal/template/progress-bar/styles.scoped.css +42 -34
- package/lib/internal/template/progress-bar/styles.selectors.js +19 -19
- package/lib/internal/template/prompt-input/styles.css.js +14 -14
- package/lib/internal/template/prompt-input/styles.scoped.css +43 -39
- package/lib/internal/template/prompt-input/styles.selectors.js +14 -14
- package/lib/internal/template/property-filter/filtering-token/styles.css.js +18 -18
- package/lib/internal/template/property-filter/filtering-token/styles.scoped.css +45 -41
- package/lib/internal/template/property-filter/filtering-token/styles.selectors.js +18 -18
- package/lib/internal/template/property-filter/styles.css.js +39 -39
- package/lib/internal/template/property-filter/styles.scoped.css +45 -41
- package/lib/internal/template/property-filter/styles.selectors.js +39 -39
- package/lib/internal/template/radio-group/styles.css.js +10 -10
- package/lib/internal/template/radio-group/styles.scoped.css +20 -16
- package/lib/internal/template/radio-group/styles.selectors.js +10 -10
- package/lib/internal/template/s3-resource-selector/s3-modal/basic-table.js +1 -0
- package/lib/internal/template/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-modal/styles.css.js +3 -3
- package/lib/internal/template/s3-resource-selector/s3-modal/styles.scoped.css +9 -5
- package/lib/internal/template/s3-resource-selector/s3-modal/styles.selectors.js +3 -3
- package/lib/internal/template/segmented-control/styles.css.js +15 -15
- package/lib/internal/template/segmented-control/styles.scoped.css +38 -34
- package/lib/internal/template/segmented-control/styles.selectors.js +15 -15
- package/lib/internal/template/select/parts/filter.d.ts +1 -1
- package/lib/internal/template/select/parts/styles.css.js +21 -21
- package/lib/internal/template/select/parts/styles.scoped.css +26 -22
- package/lib/internal/template/select/parts/styles.selectors.js +21 -21
- package/lib/internal/template/select/styles.css.js +1 -1
- package/lib/internal/template/select/styles.scoped.css +5 -1
- package/lib/internal/template/select/styles.selectors.js +1 -1
- package/lib/internal/template/select/utils/use-select.js +1 -1
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/side-navigation/styles.css.js +30 -30
- package/lib/internal/template/side-navigation/styles.scoped.css +50 -46
- package/lib/internal/template/side-navigation/styles.selectors.js +30 -30
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +80 -76
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/space-between/styles.css.js +23 -23
- package/lib/internal/template/space-between/styles.scoped.css +28 -24
- package/lib/internal/template/space-between/styles.selectors.js +23 -23
- package/lib/internal/template/spinner/styles.css.js +13 -13
- package/lib/internal/template/spinner/styles.scoped.css +23 -19
- package/lib/internal/template/spinner/styles.selectors.js +13 -13
- package/lib/internal/template/split-panel/icons/styles.css.js +22 -22
- package/lib/internal/template/split-panel/icons/styles.scoped.css +28 -24
- package/lib/internal/template/split-panel/icons/styles.selectors.js +22 -22
- package/lib/internal/template/split-panel/styles.css.js +26 -26
- package/lib/internal/template/split-panel/styles.scoped.css +47 -43
- package/lib/internal/template/split-panel/styles.selectors.js +26 -26
- package/lib/internal/template/status-indicator/styles.css.js +23 -23
- package/lib/internal/template/status-indicator/styles.scoped.css +33 -29
- package/lib/internal/template/status-indicator/styles.selectors.js +23 -23
- package/lib/internal/template/steps/styles.css.js +6 -6
- package/lib/internal/template/steps/styles.scoped.css +13 -9
- package/lib/internal/template/steps/styles.selectors.js +6 -6
- package/lib/internal/template/table/body-cell/styles.css.js +46 -46
- package/lib/internal/template/table/body-cell/styles.scoped.css +296 -292
- package/lib/internal/template/table/body-cell/styles.selectors.js +46 -46
- package/lib/internal/template/table/expandable-rows/styles.css.js +3 -3
- package/lib/internal/template/table/expandable-rows/styles.scoped.css +17 -13
- package/lib/internal/template/table/expandable-rows/styles.selectors.js +3 -3
- package/lib/internal/template/table/header-cell/styles.css.js +26 -26
- package/lib/internal/template/table/header-cell/styles.scoped.css +69 -65
- package/lib/internal/template/table/header-cell/styles.selectors.js +26 -26
- package/lib/internal/template/table/header-cell/th-element.d.ts +2 -1
- package/lib/internal/template/table/header-cell/th-element.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/th-element.js +2 -2
- package/lib/internal/template/table/header-cell/th-element.js.map +1 -1
- package/lib/internal/template/table/interfaces.d.ts +14 -3
- package/lib/internal/template/table/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/interfaces.js.map +1 -1
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +13 -4
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table/progressive-loading/items-loader.d.ts +8 -2
- package/lib/internal/template/table/progressive-loading/items-loader.d.ts.map +1 -1
- package/lib/internal/template/table/progressive-loading/items-loader.js +11 -5
- package/lib/internal/template/table/progressive-loading/items-loader.js.map +1 -1
- package/lib/internal/template/table/progressive-loading/loader-cell.d.ts +2 -3
- package/lib/internal/template/table/progressive-loading/loader-cell.d.ts.map +1 -1
- package/lib/internal/template/table/progressive-loading/loader-cell.js +2 -2
- package/lib/internal/template/table/progressive-loading/loader-cell.js.map +1 -1
- package/lib/internal/template/table/progressive-loading/progressive-loading-utils.d.ts.map +1 -1
- package/lib/internal/template/table/progressive-loading/progressive-loading-utils.js +2 -2
- package/lib/internal/template/table/progressive-loading/progressive-loading-utils.js.map +1 -1
- package/lib/internal/template/table/resizer/styles.css.js +8 -8
- package/lib/internal/template/table/resizer/styles.scoped.css +19 -15
- package/lib/internal/template/table/resizer/styles.selectors.js +8 -8
- package/lib/internal/template/table/selection/interfaces.d.ts +1 -0
- package/lib/internal/template/table/selection/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/selection/interfaces.js.map +1 -1
- package/lib/internal/template/table/selection/selection-cell.d.ts.map +1 -1
- package/lib/internal/template/table/selection/selection-cell.js +4 -3
- package/lib/internal/template/table/selection/selection-cell.js.map +1 -1
- package/lib/internal/template/table/selection/styles.css.js +3 -3
- package/lib/internal/template/table/selection/styles.scoped.css +7 -3
- package/lib/internal/template/table/selection/styles.selectors.js +3 -3
- package/lib/internal/template/table/selection/use-selection.js +1 -0
- package/lib/internal/template/table/selection/use-selection.js.map +1 -1
- package/lib/internal/template/table/sticky-scrollbar/styles.css.js +6 -6
- package/lib/internal/template/table/sticky-scrollbar/styles.scoped.css +14 -10
- package/lib/internal/template/table/sticky-scrollbar/styles.selectors.js +6 -6
- package/lib/internal/template/table/styles.css.js +34 -34
- package/lib/internal/template/table/styles.scoped.css +45 -41
- package/lib/internal/template/table/styles.selectors.js +34 -34
- package/lib/internal/template/tabs/styles.css.js +28 -28
- package/lib/internal/template/tabs/styles.scoped.css +57 -49
- package/lib/internal/template/tabs/styles.selectors.js +28 -28
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +14 -10
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/test-utils/dom/button-group/index.d.ts +5 -0
- package/lib/internal/template/test-utils/dom/button-group/index.js +16 -7
- package/lib/internal/template/test-utils/dom/button-group/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/button-group/index.d.ts +5 -0
- package/lib/internal/template/test-utils/selectors/button-group/index.js +16 -7
- package/lib/internal/template/test-utils/selectors/button-group/index.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +64 -60
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/text-filter/styles.css.js +3 -3
- package/lib/internal/template/text-filter/styles.scoped.css +7 -3
- package/lib/internal/template/text-filter/styles.selectors.js +3 -3
- package/lib/internal/template/textarea/styles.css.js +5 -5
- package/lib/internal/template/textarea/styles.scoped.css +18 -14
- package/lib/internal/template/textarea/styles.selectors.js +5 -5
- package/lib/internal/template/tiles/styles.css.js +30 -30
- package/lib/internal/template/tiles/styles.scoped.css +77 -73
- package/lib/internal/template/tiles/styles.selectors.js +30 -30
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +21 -17
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/token-group/styles.css.js +8 -8
- package/lib/internal/template/token-group/styles.scoped.css +20 -16
- package/lib/internal/template/token-group/styles.selectors.js +8 -8
- package/lib/internal/template/top-navigation/1.0-beta/styles.css.js +23 -25
- package/lib/internal/template/top-navigation/1.0-beta/styles.scoped.css +40 -66
- package/lib/internal/template/top-navigation/1.0-beta/styles.selectors.js +23 -25
- package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.d.ts.map +1 -1
- package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js +3 -2
- package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
- package/lib/internal/template/top-navigation/styles.css.js +47 -47
- package/lib/internal/template/top-navigation/styles.scoped.css +78 -85
- package/lib/internal/template/top-navigation/styles.selectors.js +47 -47
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +27 -23
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.scoped.css +33 -29
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/lib/internal/template/tutorial-panel/styles.css.js +1 -1
- package/lib/internal/template/tutorial-panel/styles.scoped.css +7 -3
- package/lib/internal/template/tutorial-panel/styles.selectors.js +1 -1
- package/lib/internal/template/wizard/styles.css.js +30 -30
- package/lib/internal/template/wizard/styles.scoped.css +62 -58
- package/lib/internal/template/wizard/styles.selectors.js +30 -30
- package/package.json +1 -1
- package/lib/internal/scss/top-navigation/motion.scss +0 -13
- package/lib/internal/template/calendar/utils/navigation.d.ts.map +0 -1
- package/lib/internal/template/calendar/utils/navigation.js +0 -73
- package/lib/internal/template/calendar/utils/navigation.js.map +0 -1
- package/lib/internal/template/internal/utils/date-time/is-iso-date-only.d.ts +0 -5
- package/lib/internal/template/internal/utils/date-time/is-iso-date-only.d.ts.map +0 -1
- package/lib/internal/template/internal/utils/date-time/is-iso-date-only.js +0 -10
- package/lib/internal/template/internal/utils/date-time/is-iso-date-only.js.map +0 -1
|
@@ -136,62 +136,58 @@
|
|
|
136
136
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
137
137
|
SPDX-License-Identifier: Apache-2.0
|
|
138
138
|
*/
|
|
139
|
+
/*
|
|
140
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
141
|
+
SPDX-License-Identifier: Apache-2.0
|
|
142
|
+
*/
|
|
139
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
140
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
141
|
-
.awsui_button-
|
|
145
|
+
.awsui_button-dropdown_sne0l_3cc6z_145:not(#\9) {
|
|
142
146
|
display: inline-block;
|
|
143
147
|
}
|
|
148
|
+
.awsui_button-dropdown_sne0l_3cc6z_145.awsui_full-width_sne0l_3cc6z_148:not(#\9) {
|
|
149
|
+
inline-size: 100%;
|
|
150
|
+
display: block;
|
|
151
|
+
}
|
|
144
152
|
|
|
145
|
-
.awsui_items-list-
|
|
153
|
+
.awsui_items-list-container_sne0l_3cc6z_153:not(#\9) {
|
|
146
154
|
padding-block: 0;
|
|
147
155
|
padding-inline: 0;
|
|
148
156
|
margin-block: 0;
|
|
149
157
|
margin-inline: 0;
|
|
150
|
-
animation: awsui_awsui-motion-fade-in-
|
|
158
|
+
animation: awsui_awsui-motion-fade-in-0_sne0l_3cc6z_1 500ms var(--motion-easing-show-quick-014od6, ease-out);
|
|
151
159
|
animation-fill-mode: none;
|
|
152
160
|
}
|
|
153
161
|
@media (prefers-reduced-motion: reduce) {
|
|
154
|
-
.awsui_items-list-
|
|
155
|
-
animation: none;
|
|
156
|
-
transition: none;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
.awsui-motion-disabled .awsui_items-list-container_sne0l_gvtil_145:not(#\9), .awsui-mode-entering .awsui_items-list-container_sne0l_gvtil_145:not(#\9) {
|
|
160
|
-
animation: none;
|
|
161
|
-
transition: none;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.awsui_rotate-up_sne0l_gvtil_164:not(#\9) {
|
|
165
|
-
transform: rotate(-180deg);
|
|
166
|
-
transition: transform var(--motion-duration-rotate-180-llqolb, 135ms) var(--motion-easing-rotate-180-wt4cje, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
167
|
-
}
|
|
168
|
-
@media (prefers-reduced-motion: reduce) {
|
|
169
|
-
.awsui_rotate-up_sne0l_gvtil_164:not(#\9) {
|
|
162
|
+
.awsui_items-list-container_sne0l_3cc6z_153:not(#\9) {
|
|
170
163
|
animation: none;
|
|
171
164
|
transition: none;
|
|
172
165
|
}
|
|
173
166
|
}
|
|
174
|
-
.awsui-motion-disabled .
|
|
167
|
+
.awsui-motion-disabled .awsui_items-list-container_sne0l_3cc6z_153:not(#\9), .awsui-mode-entering .awsui_items-list-container_sne0l_3cc6z_153:not(#\9) {
|
|
175
168
|
animation: none;
|
|
176
169
|
transition: none;
|
|
177
170
|
}
|
|
178
171
|
|
|
179
|
-
.
|
|
172
|
+
.awsui_rotate_sne0l_3cc6z_172:not(#\9) {
|
|
180
173
|
transform: rotate(0deg);
|
|
181
174
|
transition: transform var(--motion-duration-rotate-180-llqolb, 135ms) var(--motion-easing-rotate-180-wt4cje, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
182
175
|
}
|
|
183
176
|
@media (prefers-reduced-motion: reduce) {
|
|
184
|
-
.
|
|
177
|
+
.awsui_rotate_sne0l_3cc6z_172:not(#\9) {
|
|
185
178
|
animation: none;
|
|
186
179
|
transition: none;
|
|
187
180
|
}
|
|
188
181
|
}
|
|
189
|
-
.awsui-motion-disabled .
|
|
182
|
+
.awsui-motion-disabled .awsui_rotate_sne0l_3cc6z_172:not(#\9), .awsui-mode-entering .awsui_rotate_sne0l_3cc6z_172:not(#\9) {
|
|
190
183
|
animation: none;
|
|
191
184
|
transition: none;
|
|
192
185
|
}
|
|
186
|
+
.awsui_rotate-open_sne0l_3cc6z_186:not(#\9) {
|
|
187
|
+
transform: rotate(-180deg);
|
|
188
|
+
}
|
|
193
189
|
|
|
194
|
-
.
|
|
190
|
+
.awsui_header_sne0l_3cc6z_190:not(#\9) {
|
|
195
191
|
display: flex;
|
|
196
192
|
flex-direction: column;
|
|
197
193
|
list-style: none;
|
|
@@ -202,52 +198,69 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
202
198
|
border-inline: var(--border-width-field-9kmoac, 1px) solid transparent;
|
|
203
199
|
}
|
|
204
200
|
|
|
205
|
-
.
|
|
206
|
-
.
|
|
201
|
+
.awsui_title_sne0l_3cc6z_201:not(#\9),
|
|
202
|
+
.awsui_description_sne0l_3cc6z_202:not(#\9) {
|
|
207
203
|
color: var(--color-text-top-navigation-title-e4w0av, #16191f);
|
|
208
204
|
}
|
|
209
205
|
|
|
210
|
-
.
|
|
206
|
+
.awsui_trigger-button_sne0l_3cc6z_206.awsui_full-width_sne0l_3cc6z_148:not(#\9) {
|
|
207
|
+
display: grid;
|
|
208
|
+
grid-template-columns: 1fr auto;
|
|
209
|
+
}
|
|
210
|
+
.awsui_trigger-button_sne0l_3cc6z_206.awsui_full-width_sne0l_3cc6z_148.awsui_loading_sne0l_3cc6z_210:not(#\9) {
|
|
211
|
+
grid-template-columns: auto 1fr auto;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214:not(#\9) {
|
|
211
215
|
display: flex;
|
|
212
216
|
}
|
|
213
|
-
.awsui_split-trigger-
|
|
217
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217 > .awsui_trigger-button_sne0l_3cc6z_206:not(#\9):focus, .awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217 > .awsui_trigger-button_sne0l_3cc6z_206:not(#\9):hover {
|
|
214
218
|
z-index: 1;
|
|
215
219
|
}
|
|
216
|
-
.awsui_split-trigger-
|
|
220
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_3cc6z_206 {
|
|
217
221
|
border-start-end-radius: 0;
|
|
218
222
|
border-end-end-radius: 0;
|
|
219
223
|
padding-inline-end: var(--space-m-u91ipm, 16px);
|
|
220
224
|
margin-inline-end: var(--space-xxxs-gn3248, 2px);
|
|
221
225
|
}
|
|
222
|
-
.awsui_split-trigger-
|
|
226
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_3cc6z_206.awsui_has-no-text_sne0l_3cc6z_226 {
|
|
223
227
|
padding-inline: var(--space-button-icon-only-horizontal-gl6z91, 16px);
|
|
224
228
|
}
|
|
225
|
-
.awsui_split-trigger-
|
|
229
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_3cc6z_206.awsui_has-no-text_sne0l_3cc6z_226.awsui_visual-refresh_sne0l_3cc6z_229 {
|
|
226
230
|
padding-inline-start: calc(var(--space-s-vmutj3, 12px) - 2px);
|
|
227
231
|
}
|
|
228
|
-
.awsui_split-trigger-
|
|
232
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217:not(#\9):not(:first-child) > .awsui_trigger-button_sne0l_3cc6z_206 {
|
|
229
233
|
border-start-start-radius: 0;
|
|
230
234
|
border-end-start-radius: 0;
|
|
231
235
|
padding-inline: calc(var(--space-xs-6dgkww, 8px) - 2px);
|
|
232
236
|
}
|
|
233
|
-
.awsui_split-trigger-
|
|
237
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217:not(#\9):not(:first-child).awsui_visual-refresh_sne0l_3cc6z_229 > .awsui_trigger-button_sne0l_3cc6z_206 {
|
|
234
238
|
padding-inline-end: calc(var(--space-s-vmutj3, 12px) - 2px);
|
|
235
239
|
}
|
|
236
|
-
.awsui_split-trigger-
|
|
240
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217.awsui_variant-normal_sne0l_3cc6z_240:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_3cc6z_206 {
|
|
237
241
|
margin-inline-end: 0;
|
|
238
242
|
}
|
|
239
|
-
.awsui_split-trigger-
|
|
243
|
+
.awsui_split-trigger-wrapper_sne0l_3cc6z_214 > .awsui_trigger-item_sne0l_3cc6z_217.awsui_variant-normal_sne0l_3cc6z_240:not(#\9):not(:first-child) > .awsui_trigger-button_sne0l_3cc6z_206 {
|
|
240
244
|
margin-inline-start: calc(var(--border-width-field-9kmoac, 1px) * -1);
|
|
241
245
|
}
|
|
242
246
|
|
|
243
|
-
.awsui_split-
|
|
247
|
+
.awsui_split-trigger_sne0l_3cc6z_214:not(#\9) {
|
|
244
248
|
display: contents;
|
|
245
249
|
}
|
|
246
250
|
|
|
247
|
-
.awsui_dropdown-
|
|
251
|
+
.awsui_dropdown-trigger_sne0l_3cc6z_251:not(#\9) {
|
|
248
252
|
display: contents;
|
|
249
253
|
}
|
|
250
254
|
|
|
251
|
-
.
|
|
255
|
+
.awsui_main-action-full-width_sne0l_3cc6z_255:not(#\9) {
|
|
256
|
+
flex: 1 1 0;
|
|
257
|
+
text-align: center;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.awsui_main-action-trigger-full-width_sne0l_3cc6z_260:not(#\9) {
|
|
261
|
+
flex: 0 0 auto;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.awsui_test-utils-button-trigger_sne0l_3cc6z_264:not(#\9) {
|
|
252
265
|
/* used in test-utils */
|
|
253
266
|
}
|
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"button-dropdown": "awsui_button-
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"rotate
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"trigger-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
5
|
+
"button-dropdown": "awsui_button-dropdown_sne0l_3cc6z_145",
|
|
6
|
+
"full-width": "awsui_full-width_sne0l_3cc6z_148",
|
|
7
|
+
"items-list-container": "awsui_items-list-container_sne0l_3cc6z_153",
|
|
8
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_sne0l_3cc6z_1",
|
|
9
|
+
"rotate": "awsui_rotate_sne0l_3cc6z_172",
|
|
10
|
+
"rotate-open": "awsui_rotate-open_sne0l_3cc6z_186",
|
|
11
|
+
"header": "awsui_header_sne0l_3cc6z_190",
|
|
12
|
+
"title": "awsui_title_sne0l_3cc6z_201",
|
|
13
|
+
"description": "awsui_description_sne0l_3cc6z_202",
|
|
14
|
+
"trigger-button": "awsui_trigger-button_sne0l_3cc6z_206",
|
|
15
|
+
"loading": "awsui_loading_sne0l_3cc6z_210",
|
|
16
|
+
"split-trigger-wrapper": "awsui_split-trigger-wrapper_sne0l_3cc6z_214",
|
|
17
|
+
"trigger-item": "awsui_trigger-item_sne0l_3cc6z_217",
|
|
18
|
+
"has-no-text": "awsui_has-no-text_sne0l_3cc6z_226",
|
|
19
|
+
"visual-refresh": "awsui_visual-refresh_sne0l_3cc6z_229",
|
|
20
|
+
"variant-normal": "awsui_variant-normal_sne0l_3cc6z_240",
|
|
21
|
+
"split-trigger": "awsui_split-trigger_sne0l_3cc6z_214",
|
|
22
|
+
"dropdown-trigger": "awsui_dropdown-trigger_sne0l_3cc6z_251",
|
|
23
|
+
"main-action-full-width": "awsui_main-action-full-width_sne0l_3cc6z_255",
|
|
24
|
+
"main-action-trigger-full-width": "awsui_main-action-trigger-full-width_sne0l_3cc6z_260",
|
|
25
|
+
"test-utils-button-trigger": "awsui_test-utils-button-trigger_sne0l_3cc6z_264"
|
|
22
26
|
};
|
|
23
27
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FileInputProps } from '../file-input/interfaces.js';
|
|
3
|
+
import { CancelableEventHandler } from '../internal/events/index.js';
|
|
4
|
+
import { ButtonGroupProps } from './interfaces.js';
|
|
5
|
+
declare const FileInputItem: React.ForwardRefExoticComponent<{
|
|
6
|
+
item: ButtonGroupProps.IconFileInput;
|
|
7
|
+
showTooltip: boolean;
|
|
8
|
+
onFilesChange?: CancelableEventHandler<ButtonGroupProps.FilesChangeDetails> | undefined;
|
|
9
|
+
} & React.RefAttributes<FileInputProps.Ref>>;
|
|
10
|
+
export default FileInputItem;
|
|
11
|
+
//# sourceMappingURL=file-input-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input-item.d.ts","sourceRoot":"","sources":["../../../src/button-group/file-input-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,sBAAsB,EAAuB,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,QAAA,MAAM,aAAa;UAOP,iBAAiB,aAAa;iBACvB,OAAO;;4CAyCzB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React, { forwardRef, useState } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import InternalFileInput from '../file-input/internal.js';
|
|
6
|
+
import Tooltip from '../internal/components/tooltip/index.js';
|
|
7
|
+
import { fireCancelableEvent } from '../internal/events/index.js';
|
|
8
|
+
import testUtilStyles from './test-classes/styles.css.js';
|
|
9
|
+
const FileInputItem = forwardRef(({ item, showTooltip, onFilesChange, }, ref) => {
|
|
10
|
+
const [files, setFiles] = useState([]);
|
|
11
|
+
const containerRef = React.useRef(null);
|
|
12
|
+
const canShowTooltip = Boolean(showTooltip);
|
|
13
|
+
return (React.createElement("div", { ref: containerRef },
|
|
14
|
+
React.createElement(InternalFileInput, { className: clsx(testUtilStyles['button-group-item']), ref: ref, variant: "icon", ariaLabel: item.text, accept: item.accept, multiple: item.multiple, value: files, onChange: event => {
|
|
15
|
+
fireCancelableEvent(onFilesChange, { id: item.id, files: event.detail.value });
|
|
16
|
+
setFiles(event.detail.value);
|
|
17
|
+
}, "data-testid": item.id, __inputNativeAttributes: {
|
|
18
|
+
'data-itemid': item.id,
|
|
19
|
+
}, __inputClassName: testUtilStyles.item }),
|
|
20
|
+
canShowTooltip && (React.createElement(Tooltip, { trackRef: containerRef, trackKey: item.id, value: item.text, className: clsx(testUtilStyles.tooltip, testUtilStyles['button-group-tooltip']) }))));
|
|
21
|
+
});
|
|
22
|
+
export default FileInputItem;
|
|
23
|
+
//# sourceMappingURL=file-input-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input-item.js","sourceRoot":"","sources":["../../../src/button-group/file-input-item.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,OAAO,MAAM,yCAAyC,CAAC;AAC9D,OAAO,EAA0B,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAG1F,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,MAAM,aAAa,GAAG,UAAU,CAC9B,CACE,EACE,IAAI,EACJ,WAAW,EACX,aAAa,GAKd,EACD,GAAkC,EAClC,EAAE;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAExD,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE5C,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY;QACpB,oBAAC,iBAAiB,IAChB,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,EACpD,GAAG,EAAE,GAAG,EACR,OAAO,EAAC,MAAM,EACd,SAAS,EAAE,IAAI,CAAC,IAAI,EACpB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,KAAK,CAAC,EAAE;gBAChB,mBAAmB,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC/E,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC,iBACY,IAAI,CAAC,EAAE,EACpB,uBAAuB,EAAE;gBACvB,aAAa,EAAE,IAAI,CAAC,EAAE;aACvB,EACD,gBAAgB,EAAE,cAAc,CAAC,IAAI,GACrC;QACD,cAAc,IAAI,CACjB,oBAAC,OAAO,IACN,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,IAAI,CAAC,EAAE,EACjB,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAC,GAC/E,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { FileInputProps } from '../file-input/interfaces.js';\nimport InternalFileInput from '../file-input/internal.js';\nimport Tooltip from '../internal/components/tooltip/index.js';\nimport { CancelableEventHandler, fireCancelableEvent } from '../internal/events/index.js';\nimport { ButtonGroupProps } from './interfaces.js';\n\nimport testUtilStyles from './test-classes/styles.css.js';\n\nconst FileInputItem = forwardRef(\n (\n {\n item,\n showTooltip,\n onFilesChange,\n }: {\n item: ButtonGroupProps.IconFileInput;\n showTooltip: boolean;\n onFilesChange?: CancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n },\n ref: React.Ref<FileInputProps.Ref>\n ) => {\n const [files, setFiles] = useState<File[]>([]);\n const containerRef = React.useRef<HTMLDivElement>(null);\n\n const canShowTooltip = Boolean(showTooltip);\n\n return (\n <div ref={containerRef}>\n <InternalFileInput\n className={clsx(testUtilStyles['button-group-item'])}\n ref={ref}\n variant=\"icon\"\n ariaLabel={item.text}\n accept={item.accept}\n multiple={item.multiple}\n value={files}\n onChange={event => {\n fireCancelableEvent(onFilesChange, { id: item.id, files: event.detail.value });\n setFiles(event.detail.value);\n }}\n data-testid={item.id}\n __inputNativeAttributes={{\n 'data-itemid': item.id,\n }}\n __inputClassName={testUtilStyles.item}\n />\n {canShowTooltip && (\n <Tooltip\n trackRef={containerRef}\n trackKey={item.id}\n value={item.text}\n className={clsx(testUtilStyles.tooltip, testUtilStyles['button-group-tooltip'])}\n />\n )}\n </div>\n );\n }\n);\n\nexport default FileInputItem;\n"]}
|
|
@@ -62,6 +62,13 @@ export interface ButtonGroupProps extends BaseComponentProps {
|
|
|
62
62
|
* * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.
|
|
63
63
|
* * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.
|
|
64
64
|
*
|
|
65
|
+
* * ### file-input
|
|
66
|
+
*
|
|
67
|
+
* * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.
|
|
68
|
+
* * `text` (string) - The name of the menu button shown as a tooltip.
|
|
69
|
+
* * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.
|
|
70
|
+
* * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.
|
|
71
|
+
*
|
|
65
72
|
* ### menu-dropdown
|
|
66
73
|
*
|
|
67
74
|
* * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.
|
|
@@ -81,13 +88,17 @@ export interface ButtonGroupProps extends BaseComponentProps {
|
|
|
81
88
|
* 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.
|
|
82
89
|
*/
|
|
83
90
|
onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;
|
|
91
|
+
/**
|
|
92
|
+
* Called when the user uploads files. The event detail object contains the id and files from the file input item.
|
|
93
|
+
*/
|
|
94
|
+
onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;
|
|
84
95
|
}
|
|
85
96
|
export interface InternalButtonGroupProps extends ButtonGroupProps, InternalBaseComponentProps {
|
|
86
97
|
}
|
|
87
98
|
export declare namespace ButtonGroupProps {
|
|
88
99
|
type Variant = 'icon';
|
|
89
100
|
type ItemOrGroup = Item | Group;
|
|
90
|
-
type Item = IconButton | IconToggleButton | MenuDropdown;
|
|
101
|
+
type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;
|
|
91
102
|
interface IconButton {
|
|
92
103
|
type: 'icon-button';
|
|
93
104
|
id: string;
|
|
@@ -118,6 +129,13 @@ export declare namespace ButtonGroupProps {
|
|
|
118
129
|
popoverFeedback?: React.ReactNode;
|
|
119
130
|
pressedPopoverFeedback?: React.ReactNode;
|
|
120
131
|
}
|
|
132
|
+
interface IconFileInput {
|
|
133
|
+
type: 'icon-file-input';
|
|
134
|
+
id: string;
|
|
135
|
+
text: string;
|
|
136
|
+
accept?: string;
|
|
137
|
+
multiple?: boolean;
|
|
138
|
+
}
|
|
121
139
|
interface MenuDropdown {
|
|
122
140
|
type: 'menu-dropdown';
|
|
123
141
|
id: string;
|
|
@@ -137,6 +155,10 @@ export declare namespace ButtonGroupProps {
|
|
|
137
155
|
pressed?: boolean;
|
|
138
156
|
checked?: boolean;
|
|
139
157
|
}
|
|
158
|
+
interface FilesChangeDetails {
|
|
159
|
+
id: string;
|
|
160
|
+
files: File[];
|
|
161
|
+
}
|
|
140
162
|
interface Ref {
|
|
141
163
|
/**
|
|
142
164
|
* Focuses button group item by id.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,wBAAwB,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,KAAK,EAAE,IAAI,EAAE,CAAC;KACf;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\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?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n}\n\nexport interface InternalButtonGroupProps extends ButtonGroupProps, InternalBaseComponentProps {}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\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?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n}\n\nexport interface InternalButtonGroupProps extends ButtonGroupProps, InternalBaseComponentProps {}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAiB5F,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAM1E,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAiB5F,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAM1E,QAAA,MAAM,mBAAmB,uGAsKxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -16,7 +16,7 @@ import ItemElement from './item-element.js';
|
|
|
16
16
|
import styles from './styles.css.js';
|
|
17
17
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
18
18
|
const InternalButtonGroup = forwardRef((_a, ref) => {
|
|
19
|
-
var { items = [], onItemClick, ariaLabel, dropdownExpandToViewport, __internalRootRef = null } = _a, props = __rest(_a, ["items", "onItemClick", "ariaLabel", "dropdownExpandToViewport", "__internalRootRef"]);
|
|
19
|
+
var { items = [], onItemClick, onFilesChange, ariaLabel, dropdownExpandToViewport, __internalRootRef = null } = _a, props = __rest(_a, ["items", "onItemClick", "onFilesChange", "ariaLabel", "dropdownExpandToViewport", "__internalRootRef"]);
|
|
20
20
|
const baseProps = getBaseProps(props);
|
|
21
21
|
const focusedIdRef = useRef(null);
|
|
22
22
|
const navigationAPI = useRef(null);
|
|
@@ -106,7 +106,7 @@ const InternalButtonGroup = forwardRef((_a, ref) => {
|
|
|
106
106
|
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, testUtilStyles['button-group'], baseProps.className), ref: containerRef, role: "toolbar", "aria-label": ariaLabel, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown }),
|
|
107
107
|
React.createElement(SingleTabStopNavigationProvider, { ref: navigationAPI, navigationActive: true, getNextFocusTarget: getNextFocusTarget, onUnregisterActive: onUnregisterActive }, items.map((itemOrGroup, index) => {
|
|
108
108
|
var _a;
|
|
109
|
-
const itemContent = (item) => (React.createElement(ItemElement, { key: item.id, item: item, dropdownExpandToViewport: dropdownExpandToViewport, tooltip: tooltip, setTooltip: setTooltip, onItemClick: onItemClick, ref: element => (itemsRef.current[item.id] = element) }));
|
|
109
|
+
const itemContent = (item) => (React.createElement(ItemElement, { key: item.id, item: item, dropdownExpandToViewport: dropdownExpandToViewport, tooltip: tooltip, setTooltip: setTooltip, onItemClick: onItemClick, onFilesChange: onFilesChange, ref: element => (itemsRef.current[item.id] = element) }));
|
|
110
110
|
const isGroupBefore = ((_a = items[index - 1]) === null || _a === void 0 ? void 0 : _a.type) === 'group';
|
|
111
111
|
const currentItem = items[index];
|
|
112
112
|
const isGroupNow = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.type) === 'group';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D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CAAC,CAAC,CAC9B,6BAAK,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,OAAO,gBAAa,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,IAChF,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAC7C,CACP,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,WAAW,CAAC,CACzB,CACc,CAClB,CAAC;QACJ,CAAC,CAAC,CAC8B,CAC9B,CACP,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, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { getAllFocusables } from '../internal/components/focus-lock/utils';\nimport {\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n} from '../internal/context/single-tab-stop-navigation-context';\nimport { hasModifierKeys } from '../internal/events';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { KeyCode } from '../internal/keycode';\nimport { circleIndex } from '../internal/utils/circle-index';\nimport handleKey from '../internal/utils/handle-key';\nimport { ButtonGroupProps, InternalButtonGroupProps } from './interfaces';\nimport ItemElement from './item-element.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nconst InternalButtonGroup = forwardRef(\n (\n {\n items = [],\n onItemClick,\n ariaLabel,\n dropdownExpandToViewport,\n __internalRootRef = null,\n ...props\n }: InternalButtonGroupProps,\n ref: React.Ref<ButtonGroupProps.Ref>\n ) => {\n const baseProps = getBaseProps(props);\n const focusedIdRef = useRef<null | string>(null);\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n const containerObjectRef = useRef<HTMLDivElement>(null);\n const containerRef = useMergeRefs(containerObjectRef, __internalRootRef);\n const itemsRef = useRef<Record<string, ButtonProps.Ref | null>>({});\n const [tooltip, setTooltip] = useState<null | { item: string; feedback: boolean }>(null);\n\n useImperativeHandle(ref, () => ({\n focus: id => {\n itemsRef.current[id]?.focus();\n },\n }));\n\n function getNextFocusTarget(): null | HTMLElement {\n if (containerObjectRef.current) {\n const buttons: HTMLButtonElement[] = Array.from(\n containerObjectRef.current.querySelectorAll(`.${testUtilStyles.item}`)\n );\n const activeButtons = buttons.filter(button => !button.disabled);\n return activeButtons.find(button => button.dataset.itemid === focusedIdRef.current) ?? activeButtons[0] ?? null;\n }\n return null;\n }\n\n function onUnregisterActive(focusableElement: HTMLElement) {\n // Only refocus when the node is actually removed (no such ID anymore).\n const target = navigationAPI.current?.getFocusTarget();\n\n if (target && target.dataset.itemid !== focusableElement.dataset.itemid) {\n target.focus();\n }\n }\n\n useEffect(() => {\n navigationAPI.current?.updateFocusTarget();\n });\n\n function onFocus(event: React.FocusEvent) {\n if (event.target instanceof HTMLElement && event.target.dataset.itemid) {\n focusedIdRef.current = event.target.dataset.itemid;\n }\n\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onBlur() {\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onKeyDown(event: React.KeyboardEvent) {\n const focusTarget = navigationAPI.current?.getFocusTarget();\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (hasModifierKeys(event) || specialKeys.indexOf(event.keyCode) === -1) {\n return;\n }\n if (!containerObjectRef.current || !focusTarget) {\n return;\n }\n // Ignore navigation when the focused element is not an item.\n if (document.activeElement && !document.activeElement.matches(`.${testUtilStyles.item}`)) {\n return;\n }\n event.preventDefault();\n\n const focusables = getFocusablesFrom(containerObjectRef.current);\n const activeIndex = focusables.indexOf(focusTarget);\n handleKey(event as any, {\n onHome: () => focusElement(focusables[0]),\n onEnd: () => focusElement(focusables[focusables.length - 1]),\n onInlineStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onInlineEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n });\n }\n\n function focusElement(element: HTMLElement) {\n element.focus();\n }\n\n // List all non-disabled and registered focusables: those are eligible for keyboard navigation.\n function getFocusablesFrom(target: HTMLElement) {\n function isElementRegistered(element: HTMLElement) {\n return navigationAPI.current?.isRegistered(element) ?? false;\n }\n\n function isElementDisabled(element: HTMLElement) {\n if (element instanceof HTMLButtonElement) {\n return element.disabled;\n }\n\n return false;\n }\n\n return getAllFocusables(target).filter(el => isElementRegistered(el) && !isElementDisabled(el));\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, testUtilStyles['button-group'], baseProps.className)}\n ref={containerRef}\n role=\"toolbar\"\n aria-label={ariaLabel}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n >\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={getNextFocusTarget}\n onUnregisterActive={onUnregisterActive}\n >\n {items.map((itemOrGroup, index) => {\n const itemContent = (item: ButtonGroupProps.Item) => (\n <ItemElement\n key={item.id}\n item={item}\n dropdownExpandToViewport={dropdownExpandToViewport}\n tooltip={tooltip}\n setTooltip={setTooltip}\n onItemClick={onItemClick}\n ref={element => (itemsRef.current[item.id] = element)}\n />\n );\n\n const isGroupBefore = items[index - 1]?.type === 'group';\n const currentItem = items[index];\n const isGroupNow = currentItem?.type === 'group';\n const shouldAddDivider = isGroupBefore || (!isGroupBefore && isGroupNow && index !== 0);\n\n if (isGroupNow && currentItem.items.length === 0) {\n warnOnce('ButtonGroup', 'Empty group detected. Empty groups are not allowed.');\n }\n\n return (\n <React.Fragment key={itemOrGroup.type === 'group' ? index : itemOrGroup.id}>\n {shouldAddDivider && <div className={styles.divider} />}\n {itemOrGroup.type === 'group' ? (\n <div key={index} role=\"group\" aria-label={itemOrGroup.text} className={styles.group}>\n {itemOrGroup.items.map(item => itemContent(item))}\n </div>\n ) : (\n itemContent(itemOrGroup)\n )}\n </React.Fragment>\n );\n })}\n </SingleTabStopNavigationProvider>\n </div>\n );\n }\n);\n\nexport default InternalButtonGroup;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAEL,+BAA+B,GAChC,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAErD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAE5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,MAAM,mBAAmB,GAAG,UAAU,CACpC,CACE,EAQ2B,EAC3B,GAAoC,EACpC,EAAE;QAVF,EACE,KAAK,GAAG,EAAE,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,wBAAwB,EACxB,iBAAiB,GAAG,IAAI,OAEC,EADtB,KAA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AK,CAAC,KAAK,CAAC,CAAC;YACjC,MAAM,UAAU,GAAG,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,OAAO,CAAC;YACjD,MAAM,gBAAgB,GAAG,aAAa,IAAI,CAAC,CAAC,aAAa,IAAI,UAAU,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC;YAExF,IAAI,UAAU,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBAChD,QAAQ,CAAC,aAAa,EAAE,qDAAqD,CAAC,CAAC;aAChF;YAED,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE;gBACvE,gBAAgB,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI;gBACtD,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAC9B,6BAAK,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,OAAO,gBAAa,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,IAChF,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAC7C,CACP,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,WAAW,CAAC,CACzB,CACc,CAClB,CAAC;QACJ,CAAC,CAAC,CAC8B,CAC9B,CACP,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, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { getAllFocusables } from '../internal/components/focus-lock/utils';\nimport {\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n} from '../internal/context/single-tab-stop-navigation-context';\nimport { hasModifierKeys } from '../internal/events';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { KeyCode } from '../internal/keycode';\nimport { circleIndex } from '../internal/utils/circle-index';\nimport handleKey from '../internal/utils/handle-key';\nimport { ButtonGroupProps, InternalButtonGroupProps } from './interfaces';\nimport ItemElement from './item-element.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nconst InternalButtonGroup = forwardRef(\n (\n {\n items = [],\n onItemClick,\n onFilesChange,\n ariaLabel,\n dropdownExpandToViewport,\n __internalRootRef = null,\n ...props\n }: InternalButtonGroupProps,\n ref: React.Ref<ButtonGroupProps.Ref>\n ) => {\n const baseProps = getBaseProps(props);\n const focusedIdRef = useRef<null | string>(null);\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n const containerObjectRef = useRef<HTMLDivElement>(null);\n const containerRef = useMergeRefs(containerObjectRef, __internalRootRef);\n const itemsRef = useRef<Record<string, ButtonProps.Ref | null>>({});\n const [tooltip, setTooltip] = useState<null | { item: string; feedback: boolean }>(null);\n\n useImperativeHandle(ref, () => ({\n focus: id => {\n itemsRef.current[id]?.focus();\n },\n }));\n\n function getNextFocusTarget(): null | HTMLElement {\n if (containerObjectRef.current) {\n const buttons: HTMLButtonElement[] = Array.from(\n containerObjectRef.current.querySelectorAll(`.${testUtilStyles.item}`)\n );\n const activeButtons = buttons.filter(button => !button.disabled);\n return activeButtons.find(button => button.dataset.itemid === focusedIdRef.current) ?? activeButtons[0] ?? null;\n }\n return null;\n }\n\n function onUnregisterActive(focusableElement: HTMLElement) {\n // Only refocus when the node is actually removed (no such ID anymore).\n const target = navigationAPI.current?.getFocusTarget();\n\n if (target && target.dataset.itemid !== focusableElement.dataset.itemid) {\n target.focus();\n }\n }\n\n useEffect(() => {\n navigationAPI.current?.updateFocusTarget();\n });\n\n function onFocus(event: React.FocusEvent) {\n if (event.target instanceof HTMLElement && event.target.dataset.itemid) {\n focusedIdRef.current = event.target.dataset.itemid;\n }\n\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onBlur() {\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onKeyDown(event: React.KeyboardEvent) {\n const focusTarget = navigationAPI.current?.getFocusTarget();\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (hasModifierKeys(event) || specialKeys.indexOf(event.keyCode) === -1) {\n return;\n }\n if (!containerObjectRef.current || !focusTarget) {\n return;\n }\n // Ignore navigation when the focused element is not an item.\n if (document.activeElement && !document.activeElement.matches(`.${testUtilStyles.item}`)) {\n return;\n }\n event.preventDefault();\n\n const focusables = getFocusablesFrom(containerObjectRef.current);\n const activeIndex = focusables.indexOf(focusTarget);\n handleKey(event as any, {\n onHome: () => focusElement(focusables[0]),\n onEnd: () => focusElement(focusables[focusables.length - 1]),\n onInlineStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onInlineEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n });\n }\n\n function focusElement(element: HTMLElement) {\n element.focus();\n }\n\n // List all non-disabled and registered focusables: those are eligible for keyboard navigation.\n function getFocusablesFrom(target: HTMLElement) {\n function isElementRegistered(element: HTMLElement) {\n return navigationAPI.current?.isRegistered(element) ?? false;\n }\n\n function isElementDisabled(element: HTMLElement) {\n if (element instanceof HTMLButtonElement) {\n return element.disabled;\n }\n\n return false;\n }\n\n return getAllFocusables(target).filter(el => isElementRegistered(el) && !isElementDisabled(el));\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, testUtilStyles['button-group'], baseProps.className)}\n ref={containerRef}\n role=\"toolbar\"\n aria-label={ariaLabel}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n >\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={getNextFocusTarget}\n onUnregisterActive={onUnregisterActive}\n >\n {items.map((itemOrGroup, index) => {\n const itemContent = (item: ButtonGroupProps.Item) => (\n <ItemElement\n key={item.id}\n item={item}\n dropdownExpandToViewport={dropdownExpandToViewport}\n tooltip={tooltip}\n setTooltip={setTooltip}\n onItemClick={onItemClick}\n onFilesChange={onFilesChange}\n ref={element => (itemsRef.current[item.id] = element)}\n />\n );\n\n const isGroupBefore = items[index - 1]?.type === 'group';\n const currentItem = items[index];\n const isGroupNow = currentItem?.type === 'group';\n const shouldAddDivider = isGroupBefore || (!isGroupBefore && isGroupNow && index !== 0);\n\n if (isGroupNow && currentItem.items.length === 0) {\n warnOnce('ButtonGroup', 'Empty group detected. Empty groups are not allowed.');\n }\n\n return (\n <React.Fragment key={itemOrGroup.type === 'group' ? index : itemOrGroup.id}>\n {shouldAddDivider && <div className={styles.divider} />}\n {itemOrGroup.type === 'group' ? (\n <div key={index} role=\"group\" aria-label={itemOrGroup.text} className={styles.group}>\n {itemOrGroup.items.map(item => itemContent(item))}\n </div>\n ) : (\n itemContent(itemOrGroup)\n )}\n </React.Fragment>\n );\n })}\n </SingleTabStopNavigationProvider>\n </div>\n );\n }\n);\n\nexport default InternalButtonGroup;\n"]}
|
|
@@ -14,6 +14,7 @@ interface ItemElementProps {
|
|
|
14
14
|
feedback: boolean;
|
|
15
15
|
}) => void;
|
|
16
16
|
onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails> | undefined;
|
|
17
|
+
onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails> | undefined;
|
|
17
18
|
}
|
|
18
19
|
declare const ItemElement: React.ForwardRefExoticComponent<ItemElementProps & React.RefAttributes<ButtonProps.Ref>>;
|
|
19
20
|
export default ItemElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-element.d.ts","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAuB,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"item-element.d.ts","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAuB,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAKpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,UAAU,gBAAgB;IACxB,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,OAAO,EAAE,IAAI,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACpD,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,WAAW,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IACvF,aAAa,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;CAC5F;AAED,QAAA,MAAM,WAAW,0FAmIhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
4
|
import { fireCancelableEvent } from '../internal/events';
|
|
5
5
|
import { nodeBelongs } from '../internal/utils/node-belongs';
|
|
6
|
+
import FileInputItem from './file-input-item';
|
|
6
7
|
import IconButtonItem from './icon-button-item';
|
|
7
8
|
import IconToggleButtonItem from './icon-toggle-button-item.js';
|
|
8
9
|
import MenuDropdownItem from './menu-dropdown-item';
|
|
9
10
|
import styles from './styles.css.js';
|
|
10
|
-
const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTooltip, onItemClick }, ref) => {
|
|
11
|
+
const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTooltip, onItemClick, onFilesChange }, ref) => {
|
|
11
12
|
const containerRef = useRef(null);
|
|
12
|
-
const
|
|
13
|
+
const itemRef = useRef(null);
|
|
13
14
|
useImperativeHandle(ref, () => ({
|
|
14
15
|
focus: () => {
|
|
15
16
|
var _a;
|
|
16
|
-
(_a =
|
|
17
|
+
(_a = itemRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
17
18
|
},
|
|
18
19
|
}));
|
|
19
20
|
useEffect(() => {
|
|
@@ -60,6 +61,10 @@ const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTo
|
|
|
60
61
|
}
|
|
61
62
|
fireCancelableEvent(onItemClick, event.detail, event);
|
|
62
63
|
};
|
|
64
|
+
const onFilesChangeHandler = (event) => {
|
|
65
|
+
fireCancelableEvent(onFilesChange, event.detail, event);
|
|
66
|
+
setTooltip(null);
|
|
67
|
+
};
|
|
63
68
|
return (React.createElement("div", { key: item.id, className: styles['item-wrapper'], ref: containerRef, onPointerEnter: () => onShowTooltipSoft(true), onPointerLeave: () => onShowTooltipSoft(false), onFocus: event => {
|
|
64
69
|
// Showing no tooltip when the focus comes from inside the container.
|
|
65
70
|
// This is needed to prevent the tooltip after a menu closes with item selection or Escape.
|
|
@@ -68,9 +73,10 @@ const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTo
|
|
|
68
73
|
}
|
|
69
74
|
onShowTooltipHard(true);
|
|
70
75
|
}, onBlur: () => onShowTooltipHard(false) },
|
|
71
|
-
item.type === 'icon-button' && (React.createElement(IconButtonItem, { ref:
|
|
72
|
-
item.type === 'icon-toggle-button' && (React.createElement(IconToggleButtonItem, { ref:
|
|
73
|
-
item.type === '
|
|
76
|
+
item.type === 'icon-button' && (React.createElement(IconButtonItem, { ref: itemRef, item: item, onItemClick: onClickHandler, showTooltip: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.item) === item.id, showFeedback: !!(tooltip === null || tooltip === void 0 ? void 0 : tooltip.feedback) })),
|
|
77
|
+
item.type === 'icon-toggle-button' && (React.createElement(IconToggleButtonItem, { ref: itemRef, item: item, onItemClick: onClickHandler, showTooltip: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.item) === item.id, showFeedback: !!(tooltip === null || tooltip === void 0 ? void 0 : tooltip.feedback) })),
|
|
78
|
+
item.type === 'icon-file-input' && (React.createElement(FileInputItem, { ref: itemRef, item: item, onFilesChange: onFilesChangeHandler, showTooltip: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.item) === item.id })),
|
|
79
|
+
item.type === 'menu-dropdown' && (React.createElement(MenuDropdownItem, { ref: itemRef, item: item, showTooltip: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.item) === item.id, onItemClick: onClickHandler, expandToViewport: dropdownExpandToViewport }))));
|
|
74
80
|
});
|
|
75
81
|
export default ItemElement;
|
|
76
82
|
//# sourceMappingURL=item-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-element.js","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,EAAE,mBAAmB,EAA6B,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAA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,EAAE,wBAAwB,GAC1C,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { ButtonProps } from '../button/interfaces.js';\nimport { fireCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport FileInputItem from './file-input-item';\nimport IconButtonItem from './icon-button-item';\nimport IconToggleButtonItem from './icon-toggle-button-item.js';\nimport { ButtonGroupProps } from './interfaces';\nimport MenuDropdownItem from './menu-dropdown-item';\n\nimport styles from './styles.css.js';\n\ninterface ItemElementProps {\n item: ButtonGroupProps.Item;\n dropdownExpandToViewport?: boolean;\n tooltip: null | { item: string; feedback: boolean };\n setTooltip: (tooltip: null | { item: string; feedback: boolean }) => void;\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails> | undefined;\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails> | undefined;\n}\n\nconst ItemElement = forwardRef(\n (\n { item, dropdownExpandToViewport, tooltip, setTooltip, onItemClick, onFilesChange }: ItemElementProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const itemRef = useRef<HTMLButtonElement | HTMLInputElement>(null);\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n itemRef.current?.focus();\n },\n }));\n\n useEffect(() => {\n if (tooltip?.item !== item.id) {\n return;\n }\n\n const close = () => {\n setTooltip(null);\n };\n\n const handlePointerDownEvent = (event: PointerEvent) => {\n if (event.target && containerRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n\n close();\n };\n\n const handleKeyDownEvent = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n close();\n }\n };\n\n window.addEventListener('pointerdown', handlePointerDownEvent);\n window.addEventListener('keydown', handleKeyDownEvent);\n\n return () => {\n window.removeEventListener('pointerdown', handlePointerDownEvent);\n window.removeEventListener('keydown', handleKeyDownEvent);\n };\n }, [item.id, tooltip, setTooltip]);\n\n const onShowTooltipSoft = (show: boolean) => {\n if (!tooltip?.feedback) {\n setTooltip(show ? { item: item.id, feedback: false } : null);\n }\n };\n\n const onShowTooltipHard = (show: boolean) => {\n if (!show && item.id !== tooltip?.item) {\n return;\n }\n\n setTooltip(show ? { item: item.id, feedback: false } : null);\n };\n\n const onClickHandler = (event: CustomEvent<ButtonGroupProps.ItemClickDetails>) => {\n const hasPopoverFeedback = 'popoverFeedback' in item && item.popoverFeedback;\n\n if (hasPopoverFeedback) {\n setTooltip({ item: item.id, feedback: true });\n }\n\n fireCancelableEvent(onItemClick, event.detail, event);\n };\n\n const onFilesChangeHandler = (event: CustomEvent<ButtonGroupProps.FilesChangeDetails>) => {\n fireCancelableEvent(onFilesChange, event.detail, event);\n\n setTooltip(null);\n };\n\n return (\n <div\n key={item.id}\n className={styles['item-wrapper']}\n ref={containerRef}\n onPointerEnter={() => onShowTooltipSoft(true)}\n onPointerLeave={() => onShowTooltipSoft(false)}\n onFocus={event => {\n // Showing no tooltip when the focus comes from inside the container.\n // This is needed to prevent the tooltip after a menu closes with item selection or Escape.\n if (event && event.relatedTarget && nodeBelongs(containerRef.current, event.relatedTarget)) {\n return;\n }\n onShowTooltipHard(true);\n }}\n onBlur={() => onShowTooltipHard(false)}\n >\n {item.type === 'icon-button' && (\n <IconButtonItem\n ref={itemRef}\n item={item}\n onItemClick={onClickHandler}\n showTooltip={tooltip?.item === item.id}\n showFeedback={!!tooltip?.feedback}\n />\n )}\n {item.type === 'icon-toggle-button' && (\n <IconToggleButtonItem\n ref={itemRef}\n item={item}\n onItemClick={onClickHandler}\n showTooltip={tooltip?.item === item.id}\n showFeedback={!!tooltip?.feedback}\n />\n )}\n {item.type === 'icon-file-input' && (\n <FileInputItem\n ref={itemRef}\n item={item}\n onFilesChange={onFilesChangeHandler}\n showTooltip={tooltip?.item === item.id}\n />\n )}\n {item.type === 'menu-dropdown' && (\n <MenuDropdownItem\n ref={itemRef}\n item={item}\n showTooltip={tooltip?.item === item.id}\n onItemClick={onClickHandler}\n expandToViewport={dropdownExpandToViewport}\n />\n )}\n </div>\n );\n }\n);\n\nexport default ItemElement;\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"item-wrapper": "awsui_item-
|
|
6
|
-
"group": "
|
|
7
|
-
"divider": "
|
|
4
|
+
"root": "awsui_root_vdkpj_1laq4_181",
|
|
5
|
+
"item-wrapper": "awsui_item-wrapper_vdkpj_1laq4_217",
|
|
6
|
+
"group": "awsui_group_vdkpj_1laq4_221",
|
|
7
|
+
"divider": "awsui_divider_vdkpj_1laq4_225"
|
|
8
8
|
};
|
|
9
9
|
|