material 3.8.0 → 3.8.2
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/README.md +2 -2
- package/dist/components/badge/badge.d.ts +4 -0
- package/dist/components/badge/constants.d.ts +4 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/types.d.ts +102 -0
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +4 -0
- package/dist/components/bottom-app-bar/constants.d.ts +3 -0
- package/dist/components/bottom-app-bar/types.d.ts +42 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
- package/dist/components/bottom-sheet/constants.d.ts +9 -0
- package/dist/components/bottom-sheet/types.d.ts +52 -0
- package/dist/components/button/button.d.ts +4 -0
- package/dist/components/button/constants.d.ts +20 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/types.d.ts +190 -0
- package/dist/components/button-group/button-group.d.ts +4 -0
- package/dist/components/button-group/constants.d.ts +54 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/types.d.ts +125 -0
- package/dist/components/card/card.d.ts +4 -0
- package/dist/components/card/constants.d.ts +11 -0
- package/dist/components/card/content.d.ts +16 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/types.d.ts +123 -0
- package/dist/components/carousel/carousel.d.ts +1 -0
- package/dist/components/carousel/constants.d.ts +10 -0
- package/dist/components/carousel/features/scroll.js +1 -0
- package/dist/components/carousel/types.d.ts +16 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -0
- package/dist/components/checkbox/constants.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/types.d.ts +94 -0
- package/dist/components/chips/chips.d.ts +4 -0
- package/dist/components/chips/constants.d.ts +1 -0
- package/dist/components/chips/factories.d.ts +4 -0
- package/dist/components/chips/features/controller.js +4 -6
- package/dist/components/chips/types.d.ts +140 -0
- package/dist/components/datepicker/constants.d.ts +38 -0
- package/dist/components/datepicker/datepicker.d.ts +2 -0
- package/dist/components/datepicker/types.d.ts +139 -0
- package/dist/components/dialog/constants.d.ts +45 -0
- package/dist/components/dialog/dialog.d.ts +5 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/types.d.ts +196 -0
- package/dist/components/divider/config.d.ts +30 -0
- package/dist/components/divider/constants.d.ts +15 -0
- package/dist/components/divider/divider.d.ts +4 -0
- package/dist/components/divider/types.d.ts +27 -0
- package/dist/components/drawer/constants.d.ts +39 -0
- package/dist/components/drawer/drawer.d.ts +4 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/types.d.ts +109 -0
- package/dist/components/extended-fab/constants.d.ts +32 -0
- package/dist/components/extended-fab/extended-fab.d.ts +4 -0
- package/dist/components/extended-fab/types.d.ts +123 -0
- package/dist/components/fab/constants.d.ts +26 -0
- package/dist/components/fab/fab.d.ts +4 -0
- package/dist/components/fab/types.d.ts +100 -0
- package/dist/components/fab-menu/constants.d.ts +9 -0
- package/dist/components/fab-menu/fab-menu.d.ts +4 -0
- package/dist/components/fab-menu/types.d.ts +41 -0
- package/dist/components/icon-button/constants.d.ts +34 -0
- package/dist/components/icon-button/icon-button.d.ts +4 -0
- package/dist/components/icon-button/types.d.ts +157 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/list/constants.d.ts +30 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/list.d.ts +4 -0
- package/dist/components/list/types.d.ts +110 -0
- package/dist/components/loading-indicator/constants.d.ts +16 -0
- package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
- package/dist/components/loading-indicator/types.d.ts +21 -0
- package/dist/components/menu/constants.d.ts +51 -0
- package/dist/components/menu/features/controller.js +1 -1
- package/dist/components/menu/features/keyboard.js +8 -3
- package/dist/components/menu/features/opener.js +2 -16
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/inner.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +4 -0
- package/dist/components/menu/on-demand.d.ts +9 -0
- package/dist/components/menu/types.d.ts +185 -1
- package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
- package/dist/components/navigation-bar/types.d.ts +12 -0
- package/dist/components/navigation-rail/constants.d.ts +2 -0
- package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
- package/dist/components/navigation-rail/types.d.ts +18 -0
- package/dist/components/progress/constants.d.ts +37 -0
- package/dist/components/progress/progress.d.ts +4 -0
- package/dist/components/progress/types.d.ts +136 -0
- package/dist/components/radios/constants.d.ts +14 -0
- package/dist/components/radios/radios.d.ts +4 -0
- package/dist/components/radios/types.d.ts +89 -0
- package/dist/components/search/constants.d.ts +34 -0
- package/dist/components/search/search.d.ts +4 -0
- package/dist/components/search/types.d.ts +109 -0
- package/dist/components/select/constants.d.ts +46 -0
- package/dist/components/select/features.js +9 -1
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +4 -0
- package/dist/components/select/types.d.ts +95 -0
- package/dist/components/side-sheet/constants.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.d.ts +4 -0
- package/dist/components/side-sheet/types.d.ts +51 -0
- package/dist/components/slider/constants.d.ts +62 -0
- package/dist/components/slider/slider.d.ts +4 -0
- package/dist/components/slider/types.d.ts +78 -0
- package/dist/components/snackbar/constants.d.ts +37 -0
- package/dist/components/snackbar/snackbar.d.ts +5 -0
- package/dist/components/snackbar/types.d.ts +67 -0
- package/dist/components/split-button/api.js +13 -3
- package/dist/components/split-button/constants.d.ts +13 -0
- package/dist/components/split-button/split-button.d.ts +4 -0
- package/dist/components/split-button/types.d.ts +50 -0
- package/dist/components/switch/constants.d.ts +34 -0
- package/dist/components/switch/switch.d.ts +4 -0
- package/dist/components/switch/types.d.ts +55 -0
- package/dist/components/tabs/constants.d.ts +49 -0
- package/dist/components/tabs/indicator.d.ts +22 -0
- package/dist/components/tabs/responsive.d.ts +17 -0
- package/dist/components/tabs/tab.d.ts +5 -0
- package/dist/components/tabs/tabs.d.ts +4 -0
- package/dist/components/tabs/types.d.ts +170 -0
- package/dist/components/tabs/utils.d.ts +24 -0
- package/dist/components/text-field/constants.d.ts +61 -0
- package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
- package/dist/components/text-field/text-field.d.ts +4 -0
- package/dist/components/text-field/types.d.ts +84 -0
- package/dist/components/timepicker/constants.d.ts +61 -0
- package/dist/components/timepicker/types.d.ts +145 -0
- package/dist/components/toolbar/constants.d.ts +8 -0
- package/dist/components/toolbar/toolbar.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +75 -0
- package/dist/components/tooltip/constants.d.ts +43 -0
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +78 -0
- package/dist/components/top-app-bar/constants.d.ts +29 -0
- package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
- package/dist/components/top-app-bar/types.d.ts +55 -0
- package/dist/core/canvas/animation.d.ts +6 -0
- package/dist/core/canvas/drawing.d.ts +47 -0
- package/dist/core/canvas/index.d.ts +1 -0
- package/dist/core/canvas/resize.d.ts +7 -0
- package/dist/core/canvas/utils.d.ts +39 -0
- package/dist/core/compose/base.d.ts +9 -0
- package/dist/core/compose/cleanup.d.ts +2 -0
- package/dist/core/compose/component.d.ts +13 -0
- package/dist/core/compose/features/badge.d.ts +10 -0
- package/dist/core/compose/features/checkable.d.ts +13 -0
- package/dist/core/compose/features/debounce.d.ts +19 -0
- package/dist/core/compose/features/disabled.d.ts +11 -0
- package/dist/core/compose/features/events.d.ts +19 -0
- package/dist/core/compose/features/icon.d.ts +20 -0
- package/dist/core/compose/features/input.d.ts +31 -0
- package/dist/core/compose/features/lifecycle.d.ts +16 -0
- package/dist/core/compose/features/position.d.ts +13 -0
- package/dist/core/compose/features/ripple.d.ts +17 -0
- package/dist/core/compose/features/size.d.ts +5 -0
- package/dist/core/compose/features/style.d.ts +5 -0
- package/dist/core/compose/features/text.d.ts +20 -0
- package/dist/core/compose/features/textinput.d.ts +39 -0
- package/dist/core/compose/features/textlabel.d.ts +18 -0
- package/dist/core/compose/features/throttle.d.ts +18 -0
- package/dist/core/compose/features/track.d.ts +12 -0
- package/dist/core/compose/features/variant.d.ts +5 -0
- package/dist/core/compose/features/withEvents.d.ts +12 -0
- package/dist/core/compose/pipe.d.ts +12 -0
- package/dist/core/compose/utils/type-guards.d.ts +5 -0
- package/dist/core/config/component.d.ts +17 -0
- package/dist/core/config/global.d.ts +15 -0
- package/dist/core/config.d.ts +34 -0
- package/dist/core/dom/attributes.d.ts +25 -0
- package/dist/core/dom/classes.d.ts +24 -0
- package/dist/core/dom/create.d.ts +47 -0
- package/dist/core/dom/events.d.ts +26 -0
- package/dist/core/dom/focus.d.ts +11 -0
- package/dist/core/dom/html.d.ts +6 -0
- package/dist/core/dom/layer.d.ts +36 -0
- package/dist/core/dom/roving.d.ts +7 -0
- package/dist/core/navigation/destinations.d.ts +10 -0
- package/dist/core/shapes/cubic.d.ts +8 -0
- package/dist/core/shapes/material.d.ts +45 -0
- package/dist/core/shapes/polygon.d.ts +11 -0
- package/dist/core/state/emitter.d.ts +19 -0
- package/dist/core/state/events.d.ts +17 -0
- package/dist/core/state/store.d.ts +40 -0
- package/dist/core/theme/shape.d.ts +3 -0
- package/dist/core/theme/tokens.d.ts +6 -0
- package/dist/core/utils/background.d.ts +7 -0
- package/dist/core/utils/color.d.ts +5 -0
- package/dist/core/utils/index.d.ts +9 -0
- package/dist/core/utils/mobile.d.ts +10 -0
- package/dist/core/utils/object.d.ts +9 -0
- package/dist/core/utils/performance.d.ts +20 -0
- package/dist/core/utils/theme.d.ts +8 -0
- package/dist/core/utils/url.d.ts +3 -0
- package/dist/elements/adapter.d.ts +24 -0
- package/dist/elements/badge.d.ts +4 -0
- package/dist/elements/bottom-app-bar.d.ts +4 -0
- package/dist/elements/bottom-sheet.d.ts +6 -0
- package/dist/elements/button-group.d.ts +8 -0
- package/dist/elements/button.d.ts +5 -0
- package/dist/elements/card.d.ts +4 -0
- package/dist/elements/carousel.d.ts +5 -0
- package/dist/elements/checkbox.d.ts +4 -0
- package/dist/elements/chips.d.ts +9 -0
- package/dist/elements/css/button.css +1 -1
- package/dist/elements/css/button.js +1 -1
- package/dist/elements/css/carousel.css +1 -1
- package/dist/elements/css/carousel.js +1 -1
- package/dist/elements/css/chips.css +1 -1
- package/dist/elements/css/chips.js +1 -1
- package/dist/elements/css/dialog.css +1 -1
- package/dist/elements/css/dialog.js +1 -1
- package/dist/elements/css/drawer.css +1 -1
- package/dist/elements/css/drawer.js +1 -1
- package/dist/elements/css/fab-menu.css +1 -1
- package/dist/elements/css/fab-menu.js +1 -1
- package/dist/elements/css/hosts/badge.css +1 -1
- package/dist/elements/css/hosts/bottom-app-bar.css +1 -1
- package/dist/elements/css/hosts/bottom-sheet.css +1 -1
- package/dist/elements/css/hosts/button-group.css +1 -1
- package/dist/elements/css/hosts/button.css +1 -1
- package/dist/elements/css/hosts/card.css +1 -1
- package/dist/elements/css/hosts/carousel.css +1 -1
- package/dist/elements/css/hosts/checkbox.css +1 -1
- package/dist/elements/css/hosts/chips.css +1 -1
- package/dist/elements/css/hosts/datepicker.css +1 -1
- package/dist/elements/css/hosts/dialog.css +1 -1
- package/dist/elements/css/hosts/divider.css +1 -1
- package/dist/elements/css/hosts/drawer.css +1 -1
- package/dist/elements/css/hosts/extended-fab.css +1 -1
- package/dist/elements/css/hosts/fab-menu.css +1 -1
- package/dist/elements/css/hosts/fab.css +1 -1
- package/dist/elements/css/hosts/icon-button.css +1 -1
- package/dist/elements/css/hosts/list.css +1 -1
- package/dist/elements/css/hosts/loading-indicator.css +1 -1
- package/dist/elements/css/hosts/menu.css +1 -1
- package/dist/elements/css/hosts/navigation-bar.css +1 -1
- package/dist/elements/css/hosts/navigation-rail.css +1 -1
- package/dist/elements/css/hosts/progress.css +1 -1
- package/dist/elements/css/hosts/radios.css +1 -1
- package/dist/elements/css/hosts/search.css +1 -1
- package/dist/elements/css/hosts/select.css +1 -1
- package/dist/elements/css/hosts/side-sheet.css +1 -1
- package/dist/elements/css/hosts/slider.css +1 -1
- package/dist/elements/css/hosts/snackbar.css +1 -1
- package/dist/elements/css/hosts/split-button.css +1 -1
- package/dist/elements/css/hosts/switch.css +1 -1
- package/dist/elements/css/hosts/tabs.css +1 -1
- package/dist/elements/css/hosts/text-field.css +1 -1
- package/dist/elements/css/hosts/timepicker.css +1 -1
- package/dist/elements/css/hosts/toolbar.css +1 -1
- package/dist/elements/css/hosts/tooltip.css +1 -1
- package/dist/elements/css/hosts/top-app-bar.css +1 -1
- package/dist/elements/css/icon-button.css +1 -1
- package/dist/elements/css/icon-button.js +1 -1
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/css/navigation-bar.css +1 -1
- package/dist/elements/css/navigation-bar.js +1 -1
- package/dist/elements/css/navigation-rail.css +1 -1
- package/dist/elements/css/navigation-rail.js +1 -1
- package/dist/elements/css/search.css +1 -1
- package/dist/elements/css/search.js +1 -1
- package/dist/elements/css/slider.css +1 -1
- package/dist/elements/css/slider.js +1 -1
- package/dist/elements/css/text-field.css +1 -1
- package/dist/elements/css/text-field.js +1 -1
- package/dist/elements/css/timepicker.css +1 -1
- package/dist/elements/css/timepicker.js +1 -1
- package/dist/elements/datepicker.d.ts +6 -0
- package/dist/elements/define.d.ts +48 -0
- package/dist/elements/define.js +1 -1
- package/dist/elements/dialog.d.ts +5 -0
- package/dist/elements/divider.d.ts +4 -0
- package/dist/elements/drawer.d.ts +6 -0
- package/dist/elements/extended-fab.d.ts +5 -0
- package/dist/elements/fab-menu.d.ts +10 -0
- package/dist/elements/fab.d.ts +5 -0
- package/dist/elements/icon-button.d.ts +6 -0
- package/dist/elements/index.d.ts +4 -0
- package/dist/elements/list.d.ts +8 -0
- package/dist/elements/loading-indicator.d.ts +4 -0
- package/dist/elements/menu.d.ts +12 -0
- package/dist/elements/navigation-bar.d.ts +6 -0
- package/dist/elements/navigation-rail.d.ts +10 -0
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +1 -1
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +1 -1
- package/dist/elements/progress.d.ts +4 -0
- package/dist/elements/radios.d.ts +5 -0
- package/dist/elements/search.d.ts +15 -0
- package/dist/elements/select.d.ts +6 -0
- package/dist/elements/side-sheet.d.ts +5 -0
- package/dist/elements/slider.d.ts +7 -0
- package/dist/elements/snackbar.d.ts +4 -0
- package/dist/elements/split-button.d.ts +8 -0
- package/dist/elements/styles.d.ts +11 -0
- package/dist/elements/switch.d.ts +5 -0
- package/dist/elements/tabs.d.ts +6 -0
- package/dist/elements/text-field.d.ts +9 -0
- package/dist/elements/timepicker.d.ts +9 -0
- package/dist/elements/toolbar.d.ts +4 -0
- package/dist/elements/tooltip.d.ts +4 -0
- package/dist/elements/top-app-bar.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/react/create.d.ts +15 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/jsx.d.ts +3 -0
- package/dist/solid/create.d.ts +16 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/jsx.d.ts +4 -0
- package/dist/ssr/index.d.ts +3 -0
- package/dist/ssr/solid.d.ts +1 -0
- package/dist/ssr/svelte.d.ts +1 -0
- package/dist/ssr/vue.d.ts +1 -0
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +2 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +2 -2
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +2 -2
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +2 -2
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +2 -2
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +2 -2
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +2 -2
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +2 -2
- package/dist/styles/navigation-rail.css +2 -2
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +2 -2
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +2 -2
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +2 -2
- package/dist/styles/timepicker.css +2 -2
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/svelte/runtime.d.ts +21 -0
- package/dist/theme/image.d.ts +2 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/variants.d.ts +6 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +1 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +39 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +13 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +1 -0
- package/dist/theme/vendor/hct/hct.d.ts +9 -0
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/dist/vue/create.d.ts +18 -0
- package/dist/vue/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/abstract/_mixins.scss +1 -1
- package/src/styles/components/_button.scss +1 -0
- package/src/styles/components/_carousel.scss +18 -4
- package/src/styles/components/_chips.scss +3 -2
- package/src/styles/components/_dialog.scss +1 -1
- package/src/styles/components/_drawer.scss +6 -3
- package/src/styles/components/_fab-menu.scss +1 -1
- package/src/styles/components/_icon-button.scss +2 -1
- package/src/styles/components/_menu.scss +14 -1
- package/src/styles/components/_navigation-bar.scss +6 -1
- package/src/styles/components/_navigation-rail.scss +5 -0
- package/src/styles/components/_search.scss +13 -0
- package/src/styles/components/_slider.scss +16 -39
- package/src/styles/components/_text-field.scss +9 -0
- package/src/styles/components/_timepicker.scss +1 -1
|
@@ -1,105 +1,295 @@
|
|
|
1
1
|
import { BaseComponentConfig } from "../../core/config/component.js";
|
|
2
2
|
import { ProgressConfig, ProgressComponent } from "../progress/types.js";
|
|
3
3
|
import { ButtonSize, ButtonShape } from "./constants.js";
|
|
4
|
+
/** Button variant types - controls the visual style of the button */
|
|
4
5
|
export type ButtonVariant = "filled" | "tonal" | "outlined" | "elevated" | "text";
|
|
6
|
+
/** Configuration interface for the Button component */
|
|
5
7
|
export interface ButtonConfig extends BaseComponentConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Button variant that determines visual styling
|
|
10
|
+
* @default 'filled'
|
|
11
|
+
*/
|
|
6
12
|
variant?: ButtonVariant | string;
|
|
13
|
+
/**
|
|
14
|
+
* Button size variant
|
|
15
|
+
* @default 's'
|
|
16
|
+
*/
|
|
7
17
|
size?: ButtonSize | string;
|
|
18
|
+
/**
|
|
19
|
+
* Button shape variant
|
|
20
|
+
* @default 'round'
|
|
21
|
+
*/
|
|
8
22
|
shape?: ButtonShape | string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the button is initially disabled
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
9
27
|
disabled?: boolean;
|
|
28
|
+
/** Initial button text content, or a node placed where the text goes (the */
|
|
10
29
|
text?: string | Node;
|
|
30
|
+
/** Initial button icon HTML content. */
|
|
11
31
|
icon?: string;
|
|
32
|
+
/** Icon size in pixels or other CSS units */
|
|
12
33
|
iconSize?: string;
|
|
34
|
+
/** Additional CSS classes to add to the button */
|
|
13
35
|
class?: string;
|
|
36
|
+
/** Button value attribute */
|
|
14
37
|
value?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Button type attribute
|
|
40
|
+
* @default 'button'
|
|
41
|
+
*/
|
|
15
42
|
type?: "button" | "submit" | "reset";
|
|
43
|
+
/**
|
|
44
|
+
* Whether to enable ripple effect
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
16
47
|
ripple?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Component prefix for class names
|
|
50
|
+
* @default 'mtrl'
|
|
51
|
+
*/
|
|
17
52
|
prefix?: string;
|
|
53
|
+
/** Component name used in class generation */
|
|
18
54
|
componentName?: string;
|
|
55
|
+
/** Ripple effect configuration */
|
|
19
56
|
rippleConfig?: {
|
|
57
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
20
58
|
duration?: number;
|
|
21
59
|
};
|
|
60
|
+
/** Accessible name for the button (aria-label) */
|
|
22
61
|
ariaLabel?: string;
|
|
62
|
+
/** Progress indicator configuration */
|
|
23
63
|
progress?: ProgressConfig | boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to show progress initially
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
24
68
|
showProgress?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Makes the button a toggle button: a click flips its selected state, the element carries aria-pressed, and the selected state uses the M3 toggle colours and swaps the resting shape (round to square, square to round).
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
25
73
|
toggle?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Initial selected state of a toggle button
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
26
78
|
selected?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Whether a click flips the selected state of a toggle button.
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
27
83
|
toggleOnClick?: boolean;
|
|
28
84
|
}
|
|
85
|
+
/** Icon API interface for managing button icons */
|
|
29
86
|
export interface IconAPI {
|
|
87
|
+
/**
|
|
88
|
+
* Sets the icon HTML content
|
|
89
|
+
* @param html
|
|
90
|
+
*/
|
|
30
91
|
setIcon: (html: string) => IconAPI;
|
|
92
|
+
/** Gets the current icon HTML content */
|
|
31
93
|
getIcon: () => string;
|
|
94
|
+
/** Gets the icon DOM element */
|
|
32
95
|
getElement: () => HTMLElement | null;
|
|
33
96
|
}
|
|
97
|
+
/** Text API interface for managing button text */
|
|
34
98
|
export interface TextAPI {
|
|
99
|
+
/**
|
|
100
|
+
* Sets the text content
|
|
101
|
+
* @param content
|
|
102
|
+
*/
|
|
35
103
|
setText: (content: string) => TextAPI;
|
|
104
|
+
/** Gets the current text content */
|
|
36
105
|
getText: () => string;
|
|
106
|
+
/** Gets the text DOM element */
|
|
37
107
|
getElement: () => HTMLElement | null;
|
|
38
108
|
}
|
|
109
|
+
/** Button component interface */
|
|
110
|
+
/** What a forwarded DOM event hands a button listener. */
|
|
39
111
|
export interface ButtonEventPayload<E extends Event = Event> {
|
|
112
|
+
/** The DOM event that triggered the forward. */
|
|
40
113
|
event: E;
|
|
114
|
+
/** The button's root element, which is the element listened on. */
|
|
41
115
|
element: HTMLElement;
|
|
116
|
+
/** The same DOM event as `event`; both names have always been provided. */
|
|
42
117
|
originalEvent: E;
|
|
43
118
|
}
|
|
119
|
+
/** A toggle button's `change`. */
|
|
44
120
|
export interface ButtonChangePayload {
|
|
121
|
+
/** Whether the button is now selected */
|
|
45
122
|
selected: boolean;
|
|
123
|
+
/** The button's value, as `getValue()` returns it */
|
|
46
124
|
value: string;
|
|
47
125
|
}
|
|
126
|
+
/** The events a button reports, and what each hands its handler. */
|
|
48
127
|
export interface ButtonEvents {
|
|
128
|
+
/** A toggle button's selected state changed on a click. */
|
|
49
129
|
change: (payload: ButtonChangePayload) => void;
|
|
130
|
+
/** The button was clicked. */
|
|
50
131
|
click: (payload: ButtonEventPayload<MouseEvent>) => void;
|
|
132
|
+
/** The button took focus. */
|
|
51
133
|
focus: (payload: ButtonEventPayload<FocusEvent>) => void;
|
|
134
|
+
/** The button lost focus. */
|
|
52
135
|
blur: (payload: ButtonEventPayload<FocusEvent>) => void;
|
|
53
136
|
}
|
|
54
137
|
export interface ButtonComponent {
|
|
138
|
+
/** The button's DOM element */
|
|
55
139
|
element: HTMLButtonElement;
|
|
140
|
+
/** API for managing button text */
|
|
56
141
|
text: TextAPI;
|
|
142
|
+
/** API for managing button icons */
|
|
57
143
|
icon: IconAPI;
|
|
144
|
+
/** API for managing disabled state */
|
|
58
145
|
disabled: {
|
|
146
|
+
/** Enables the button */
|
|
59
147
|
enable: () => void;
|
|
148
|
+
/** Disables the button */
|
|
60
149
|
disable: () => void;
|
|
150
|
+
/** Checks if the button is disabled */
|
|
61
151
|
isDisabled: () => boolean;
|
|
62
152
|
};
|
|
153
|
+
/** API for managing component lifecycle */
|
|
63
154
|
lifecycle: {
|
|
155
|
+
/** Destroys the component and cleans up resources */
|
|
64
156
|
destroy: () => void;
|
|
65
157
|
};
|
|
158
|
+
/**
|
|
159
|
+
* Gets a class name with the component's prefix
|
|
160
|
+
* @param name
|
|
161
|
+
*/
|
|
66
162
|
getClass: (name: string) => string;
|
|
163
|
+
/** Gets the button's value attribute */
|
|
67
164
|
getValue: () => string;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the button's value attribute
|
|
167
|
+
* @param value
|
|
168
|
+
*/
|
|
68
169
|
setValue: (value: string) => ButtonComponent;
|
|
170
|
+
/** Gets the button's current variant */
|
|
69
171
|
getVariant: () => ButtonVariant | string;
|
|
172
|
+
/**
|
|
173
|
+
* Sets the button's variant (visual style)
|
|
174
|
+
* @param variant
|
|
175
|
+
*/
|
|
70
176
|
setVariant: (variant: ButtonVariant | string) => ButtonComponent;
|
|
177
|
+
/** Gets the button's current size */
|
|
71
178
|
getSize: () => ButtonSize | string;
|
|
179
|
+
/**
|
|
180
|
+
* Sets the button's size
|
|
181
|
+
* @param size
|
|
182
|
+
*/
|
|
72
183
|
setSize: (size: ButtonSize | string) => ButtonComponent;
|
|
184
|
+
/** Gets the button's current shape */
|
|
73
185
|
getShape: () => ButtonShape | string;
|
|
186
|
+
/**
|
|
187
|
+
* Sets the button's shape
|
|
188
|
+
* @param shape
|
|
189
|
+
*/
|
|
74
190
|
setShape: (shape: ButtonShape | string) => ButtonComponent;
|
|
191
|
+
/** Enables the button (removes disabled attribute) */
|
|
75
192
|
enable: () => ButtonComponent;
|
|
193
|
+
/** Disables the button (adds disabled attribute) */
|
|
76
194
|
disable: () => ButtonComponent;
|
|
195
|
+
/** Whether the button is disabled */
|
|
77
196
|
isDisabled: () => boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Sets the button's text content
|
|
199
|
+
* @param content
|
|
200
|
+
*/
|
|
78
201
|
setText: (content: string) => ButtonComponent;
|
|
202
|
+
/** Gets the button's text content */
|
|
79
203
|
getText: () => string;
|
|
204
|
+
/** Checks if the button has an icon */
|
|
80
205
|
hasIcon: () => boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Sets the button's icon
|
|
208
|
+
* @param icon
|
|
209
|
+
*/
|
|
81
210
|
setIcon: (icon: string) => ButtonComponent;
|
|
211
|
+
/** Gets the button's icon HTML content */
|
|
82
212
|
getIcon: () => string;
|
|
213
|
+
/** Destroys the button component and cleans up resources */
|
|
83
214
|
destroy: () => void;
|
|
215
|
+
/**
|
|
216
|
+
* Sets the active state of the button
|
|
217
|
+
* @param active
|
|
218
|
+
*/
|
|
84
219
|
setActive: (active: boolean) => ButtonComponent;
|
|
220
|
+
/**
|
|
221
|
+
* Sets the selected state of a toggle button (no-op unless `toggle` is set)
|
|
222
|
+
* @param selected
|
|
223
|
+
*/
|
|
85
224
|
setSelected: (selected: boolean) => ButtonComponent;
|
|
225
|
+
/** Whether a toggle button is selected */
|
|
86
226
|
isSelected: () => boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Adds an event listener to the button
|
|
229
|
+
* @param event
|
|
230
|
+
* @param handler
|
|
231
|
+
*/
|
|
87
232
|
on: <K extends keyof ButtonEvents>(event: K, handler: ButtonEvents[K]) => ButtonComponent;
|
|
233
|
+
/**
|
|
234
|
+
* Removes an event listener from the button
|
|
235
|
+
* @param event
|
|
236
|
+
* @param handler
|
|
237
|
+
*/
|
|
88
238
|
off: <K extends keyof ButtonEvents>(event: K, handler: ButtonEvents[K]) => ButtonComponent;
|
|
239
|
+
/**
|
|
240
|
+
* Adds CSS classes to the button element
|
|
241
|
+
* @param classes
|
|
242
|
+
*/
|
|
89
243
|
addClass: (...classes: string[]) => ButtonComponent;
|
|
244
|
+
/**
|
|
245
|
+
* Sets the aria-label attribute for accessibility
|
|
246
|
+
* @param label
|
|
247
|
+
*/
|
|
90
248
|
setAriaLabel: (label: string) => ButtonComponent;
|
|
249
|
+
/** Progress component instance (if progress is enabled) */
|
|
91
250
|
progress?: ProgressComponent;
|
|
251
|
+
/** Shows the progress indicator (if progress is enabled) */
|
|
92
252
|
showProgress?: () => Promise<ButtonComponent>;
|
|
253
|
+
/** Shows the progress indicator synchronously (if progress is enabled) */
|
|
93
254
|
showProgressSync?: () => ButtonComponent;
|
|
255
|
+
/** Hides the progress indicator (if progress is enabled) */
|
|
94
256
|
hideProgress?: () => Promise<ButtonComponent>;
|
|
257
|
+
/** Hides the progress indicator synchronously (if progress is enabled) */
|
|
95
258
|
hideProgressSync?: () => ButtonComponent;
|
|
259
|
+
/**
|
|
260
|
+
* Sets the progress value (0-100) (if progress is enabled)
|
|
261
|
+
* @param value
|
|
262
|
+
*/
|
|
96
263
|
setProgress?: (value: number) => Promise<ButtonComponent>;
|
|
264
|
+
/**
|
|
265
|
+
* Sets the progress value synchronously (0-100) (if progress is enabled)
|
|
266
|
+
* @param value
|
|
267
|
+
*/
|
|
97
268
|
setProgressSync?: (value: number) => ButtonComponent;
|
|
269
|
+
/**
|
|
270
|
+
* Sets the progress to indeterminate mode (if progress is enabled)
|
|
271
|
+
* @param indeterminate
|
|
272
|
+
*/
|
|
98
273
|
setIndeterminate?: (indeterminate: boolean) => Promise<ButtonComponent>;
|
|
274
|
+
/**
|
|
275
|
+
* Sets the progress to indeterminate mode synchronously (if progress is enabled)
|
|
276
|
+
* @param indeterminate
|
|
277
|
+
*/
|
|
99
278
|
setIndeterminateSync?: (indeterminate: boolean) => ButtonComponent;
|
|
279
|
+
/**
|
|
280
|
+
* Updates both button text and progress for loading states (if progress is enabled)
|
|
281
|
+
* @param loading
|
|
282
|
+
* @param text
|
|
283
|
+
*/
|
|
100
284
|
setLoading?: (loading: boolean, text?: string) => Promise<ButtonComponent>;
|
|
285
|
+
/**
|
|
286
|
+
* Updates both button text and progress for loading states synchronously (if progress is enabled)
|
|
287
|
+
* @param loading
|
|
288
|
+
* @param text
|
|
289
|
+
*/
|
|
101
290
|
setLoadingSync?: (loading: boolean, text?: string) => ButtonComponent;
|
|
102
291
|
}
|
|
292
|
+
/** Registers ButtonConfig with the global defaults map, so `setComponentDefaults("button", ...)` is typed without core importing anything from this component. */
|
|
103
293
|
declare module "../../core/config/global" {
|
|
104
294
|
interface ComponentConfigMap {
|
|
105
295
|
button?: Partial<ButtonConfig>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { ButtonGroupConfig, ButtonGroupComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new Button Group component The Button Group component provides a container for grouping related action buttons.
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
2
6
|
declare const createButtonGroup: (config?: ButtonGroupConfig) => ButtonGroupComponent;
|
|
3
7
|
export default createButtonGroup;
|
|
@@ -1,29 +1,49 @@
|
|
|
1
|
+
/** Button group variants */
|
|
1
2
|
export declare const BUTTON_GROUP_VARIANTS: {
|
|
3
|
+
/** Primary action buttons with solid background */
|
|
2
4
|
readonly FILLED: "filled";
|
|
5
|
+
/** Secondary action buttons with medium emphasis */
|
|
3
6
|
readonly TONAL: "tonal";
|
|
7
|
+
/** Buttons with outline border (default for button groups per MD3) */
|
|
4
8
|
readonly OUTLINED: "outlined";
|
|
9
|
+
/** Buttons with slight elevation/shadow */
|
|
5
10
|
readonly ELEVATED: "elevated";
|
|
11
|
+
/** Text-only buttons without background or border */
|
|
6
12
|
readonly TEXT: "text";
|
|
7
13
|
};
|
|
14
|
+
/** Button group orientations */
|
|
8
15
|
export declare const BUTTON_GROUP_ORIENTATIONS: {
|
|
16
|
+
/** Buttons arranged horizontally (default) */
|
|
9
17
|
readonly HORIZONTAL: "horizontal";
|
|
18
|
+
/** Buttons arranged vertically */
|
|
10
19
|
readonly VERTICAL: "vertical";
|
|
11
20
|
};
|
|
21
|
+
/** Density levels for button groups */
|
|
12
22
|
export declare const BUTTON_GROUP_DENSITY: {
|
|
23
|
+
/** Default size with standard spacing (40px height) */
|
|
13
24
|
readonly DEFAULT: "default";
|
|
25
|
+
/** Reduced size and spacing (36px height) */
|
|
14
26
|
readonly COMFORTABLE: "comfortable";
|
|
27
|
+
/** Minimal size and spacing (32px height) */
|
|
15
28
|
readonly COMPACT: "compact";
|
|
16
29
|
};
|
|
30
|
+
/** Button group events */
|
|
17
31
|
export declare const BUTTON_GROUP_EVENTS: {
|
|
32
|
+
/** Fired when any button in the group is clicked */
|
|
18
33
|
readonly CLICK: "click";
|
|
34
|
+
/** Fired when a button receives focus */
|
|
19
35
|
readonly FOCUS: "focus";
|
|
36
|
+
/** Fired when a button loses focus */
|
|
20
37
|
readonly BLUR: "blur";
|
|
38
|
+
/** Fired when the selection changes (selection groups) */
|
|
21
39
|
readonly CHANGE: "change";
|
|
22
40
|
};
|
|
41
|
+
/** Material 3 button group kinds */
|
|
23
42
|
export declare const BUTTON_GROUP_KINDS: {
|
|
24
43
|
readonly STANDARD: "standard";
|
|
25
44
|
readonly CONNECTED: "connected";
|
|
26
45
|
};
|
|
46
|
+
/** Selection behaviour of the group */
|
|
27
47
|
export declare const BUTTON_GROUP_SELECTION: {
|
|
28
48
|
readonly NONE: "none";
|
|
29
49
|
readonly SINGLE: "single";
|
|
@@ -40,6 +60,7 @@ export declare const BUTTON_GROUP_SIZES: {
|
|
|
40
60
|
readonly L: "l";
|
|
41
61
|
readonly XL: "xl";
|
|
42
62
|
};
|
|
63
|
+
/** Material 3 button group tokens per size (dp): container height, button */
|
|
43
64
|
export declare const BUTTON_GROUP_SIZE_TOKENS: {
|
|
44
65
|
readonly xs: {
|
|
45
66
|
readonly height: 32;
|
|
@@ -77,12 +98,20 @@ export declare const BUTTON_GROUP_SIZE_TOKENS: {
|
|
|
77
98
|
readonly connectedStep: "large-increased";
|
|
78
99
|
};
|
|
79
100
|
};
|
|
101
|
+
/** Connected groups use 2dp between buttons at every size */
|
|
80
102
|
export declare const BUTTON_GROUP_CONNECTED_GAP = 2;
|
|
103
|
+
/** Connected pressed inner corner: extra-small (ConnectedButtonGroupSmallTokens.PressedInnerCornerCornerSize) */
|
|
81
104
|
export declare const BUTTON_GROUP_CONNECTED_PRESSED_CORNER = 4;
|
|
105
|
+
/** Connected xs and s groups keep a 48dp minimum width per button */
|
|
82
106
|
export declare const BUTTON_GROUP_CONNECTED_MIN_WIDTH = 48;
|
|
107
|
+
/** Standard groups: a pressed button widens by this share of its width and */
|
|
83
108
|
export declare const BUTTON_GROUP_EXPANDED_RATIO = 0.15;
|
|
109
|
+
/** The most a neighbour gives up when a button in a standard group is pressed: the trailing content padding of a button (Compose ButtonGroup compression limit, ButtonDefaults.ContentPadding end, BaselineButtonTokens.TrailingSpace). */
|
|
84
110
|
export declare const BUTTON_GROUP_COMPRESSION_LIMIT = 24;
|
|
111
|
+
/** Density reduces the container height by 4dp per step */
|
|
85
112
|
export declare const BUTTON_GROUP_DENSITY_STEP = 4;
|
|
113
|
+
/** Default configuration values */
|
|
114
|
+
/** Label display in selection groups */
|
|
86
115
|
export declare const BUTTON_GROUP_LABELS: {
|
|
87
116
|
readonly ALWAYS: "always";
|
|
88
117
|
readonly SELECTED: "selected";
|
|
@@ -93,30 +122,55 @@ export declare const BUTTON_GROUP_DEFAULTS: {
|
|
|
93
122
|
readonly SHAPE: "round";
|
|
94
123
|
readonly SIZE: "s";
|
|
95
124
|
readonly LABELS: "always";
|
|
125
|
+
/** Default variant (outlined per MD3 button group specs) */
|
|
96
126
|
readonly VARIANT: "outlined";
|
|
127
|
+
/** Default orientation */
|
|
97
128
|
readonly ORIENTATION: "horizontal";
|
|
129
|
+
/** Default density level */
|
|
98
130
|
readonly DENSITY: "default";
|
|
131
|
+
/** Whether ripple effect is enabled by default */
|
|
99
132
|
readonly RIPPLE: true;
|
|
133
|
+
/** Whether buttons have equal width by default */
|
|
100
134
|
readonly EQUAL_WIDTH: false;
|
|
135
|
+
/** Default ripple animation duration in milliseconds */
|
|
101
136
|
readonly RIPPLE_DURATION: 300;
|
|
102
137
|
};
|
|
138
|
+
/** CSS classes for button group elements */
|
|
103
139
|
export declare const BUTTON_GROUP_CLASSES: {
|
|
140
|
+
/** Container element */
|
|
104
141
|
readonly ROOT: "button-group";
|
|
142
|
+
/** Individual button within group */
|
|
105
143
|
readonly BUTTON: "button-group__button";
|
|
144
|
+
/** First button in group */
|
|
106
145
|
readonly FIRST: "button-group__button--first";
|
|
146
|
+
/** Last button in group */
|
|
107
147
|
readonly LAST: "button-group__button--last";
|
|
148
|
+
/** Middle buttons (neither first nor last) */
|
|
108
149
|
readonly MIDDLE: "button-group__button--middle";
|
|
150
|
+
/** Single button (only one in group) */
|
|
109
151
|
readonly SINGLE: "button-group__button--single";
|
|
152
|
+
/** Disabled state */
|
|
110
153
|
readonly DISABLED: "button-group--disabled";
|
|
154
|
+
/** Horizontal orientation */
|
|
111
155
|
readonly HORIZONTAL: "button-group--horizontal";
|
|
156
|
+
/** Vertical orientation */
|
|
112
157
|
readonly VERTICAL: "button-group--vertical";
|
|
158
|
+
/** Equal width buttons */
|
|
113
159
|
readonly EQUAL_WIDTH: "button-group--equal-width";
|
|
160
|
+
/** Filled variant */
|
|
114
161
|
readonly FILLED: "button-group--filled";
|
|
162
|
+
/** Tonal variant */
|
|
115
163
|
readonly TONAL: "button-group--tonal";
|
|
164
|
+
/** Outlined variant */
|
|
116
165
|
readonly OUTLINED: "button-group--outlined";
|
|
166
|
+
/** Elevated variant */
|
|
117
167
|
readonly ELEVATED: "button-group--elevated";
|
|
168
|
+
/** Text variant */
|
|
118
169
|
readonly TEXT: "button-group--text";
|
|
170
|
+
/** Default density */
|
|
119
171
|
readonly DENSITY_DEFAULT: "button-group--density-default";
|
|
172
|
+
/** Comfortable density */
|
|
120
173
|
readonly DENSITY_COMFORTABLE: "button-group--density-comfortable";
|
|
174
|
+
/** Compact density */
|
|
121
175
|
readonly DENSITY_COMPACT: "button-group--density-compact";
|
|
122
176
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Button Group component exports The Button Group component provides a container for grouping related action buttons. */
|
|
1
2
|
export { default as createButtonGroup } from "./button-group.js";
|
|
2
3
|
export { default } from "./button-group.js";
|
|
3
4
|
export type { ButtonGroupConfig, ButtonGroupComponent, ButtonGroupItemConfig, ButtonGroupEvent, ButtonGroupEventType, ButtonGroupVariant, ButtonGroupOrientation, ButtonGroupDensity } from "./types.js";
|
|
@@ -1,38 +1,68 @@
|
|
|
1
1
|
import type { ButtonConfig, ButtonComponent } from "../button/types.js";
|
|
2
|
+
/** Button group orientation */
|
|
2
3
|
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
4
|
+
/** Button group variant - applies to all buttons in the group */
|
|
3
5
|
export type ButtonGroupVariant = "filled" | "tonal" | "outlined" | "elevated" | "text";
|
|
6
|
+
/** Button group density options */
|
|
4
7
|
export type ButtonGroupDensity = "default" | "comfortable" | "compact";
|
|
8
|
+
/** Event types for button group */
|
|
5
9
|
export type ButtonGroupEventType = "click" | "focus" | "blur" | "change";
|
|
10
|
+
/** Material 3 button group kinds. */
|
|
6
11
|
export type ButtonGroupKind = "standard" | "connected";
|
|
7
12
|
export type ButtonGroupSelection = "none" | "single" | "multi";
|
|
8
13
|
export type ButtonGroupShape = "round" | "square";
|
|
9
14
|
export type ButtonGroupSize = "xs" | "s" | "m" | "l" | "xl";
|
|
15
|
+
/** Label display: always, or only on the selected button (icon-only otherwise) */
|
|
10
16
|
export type ButtonGroupLabels = "always" | "selected";
|
|
17
|
+
/** Payload of the "change" event: the selection after the change. */
|
|
11
18
|
export interface ButtonGroupChangeEvent {
|
|
12
19
|
buttonGroup: ButtonGroupComponent;
|
|
20
|
+
/** Values of the selected buttons, in button order */
|
|
13
21
|
values: string[];
|
|
22
|
+
/** The selection in the `value` shape of the `<m-button-group>` element's `change`: an array for a multi-select group, a string or null otherwise. */
|
|
14
23
|
value: string | string[] | null;
|
|
15
24
|
selected: ButtonComponent[];
|
|
25
|
+
/** The button whose click caused the change, if any */
|
|
16
26
|
button?: ButtonComponent;
|
|
17
27
|
originalEvent?: Event;
|
|
18
28
|
}
|
|
29
|
+
/** Event data for button group events */
|
|
19
30
|
export interface ButtonGroupEvent {
|
|
31
|
+
/** The button group component that contains the clicked button */
|
|
20
32
|
buttonGroup: ButtonGroupComponent;
|
|
33
|
+
/** The button component that was clicked */
|
|
21
34
|
button: ButtonComponent;
|
|
35
|
+
/** Index of the button in the group */
|
|
22
36
|
index: number;
|
|
37
|
+
/** Original DOM event */
|
|
23
38
|
originalEvent: Event;
|
|
24
39
|
}
|
|
40
|
+
/** Configuration for a single button within a button group */
|
|
25
41
|
interface ButtonGroupItemBase extends Omit<ButtonConfig, "variant"> {
|
|
42
|
+
/** Unique identifier for the button */
|
|
26
43
|
id?: string;
|
|
44
|
+
/** Button text content */
|
|
27
45
|
text?: string;
|
|
46
|
+
/** Button icon HTML content. */
|
|
28
47
|
icon?: string;
|
|
48
|
+
/** Accessible label. */
|
|
29
49
|
ariaLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this button is disabled
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
30
54
|
disabled?: boolean;
|
|
55
|
+
/** Value associated with this button */
|
|
31
56
|
value?: string;
|
|
57
|
+
/** Icon shown while selected (toggle buttons). */
|
|
32
58
|
selectedIcon?: string;
|
|
59
|
+
/** Initially selected (selection groups only) */
|
|
33
60
|
selected?: boolean;
|
|
61
|
+
/** Additional CSS class for this button */
|
|
34
62
|
class?: string;
|
|
35
63
|
}
|
|
64
|
+
/** Configuration interface for the Button Group component */
|
|
65
|
+
/** A button in a group. */
|
|
36
66
|
export type ButtonGroupItemConfig = (ButtonGroupItemBase & {
|
|
37
67
|
text: string;
|
|
38
68
|
}) | (ButtonGroupItemBase & {
|
|
@@ -40,27 +70,72 @@ export type ButtonGroupItemConfig = (ButtonGroupItemBase & {
|
|
|
40
70
|
ariaLabel: string;
|
|
41
71
|
});
|
|
42
72
|
export interface ButtonGroupConfig {
|
|
73
|
+
/** Array of button configurations */
|
|
43
74
|
buttons?: ButtonGroupItemConfig[];
|
|
75
|
+
/** "standard" (default) or "connected" */
|
|
44
76
|
kind?: ButtonGroupKind;
|
|
77
|
+
/** "none" (default): plain actions. */
|
|
45
78
|
selection?: ButtonGroupSelection;
|
|
79
|
+
/** With single or multi selection: the last selected button cannot be deselected */
|
|
46
80
|
required?: boolean;
|
|
81
|
+
/** Corner style: round (default) or square */
|
|
47
82
|
shape?: ButtonGroupShape;
|
|
83
|
+
/**
|
|
84
|
+
* Standard groups: share of its width a pressed button gains while its neighbours give up the difference (M3: 0.15).
|
|
85
|
+
* @default 0.15
|
|
86
|
+
*/
|
|
48
87
|
expandedRatio?: number;
|
|
88
|
+
/** Material size token: xs, s (default), m, l, xl */
|
|
49
89
|
size?: ButtonGroupSize;
|
|
90
|
+
/** "always" (default): buttons show icon and text. */
|
|
50
91
|
labels?: ButtonGroupLabels;
|
|
92
|
+
/**
|
|
93
|
+
* Visual variant applied to all buttons in the group
|
|
94
|
+
* @default 'outlined'
|
|
95
|
+
*/
|
|
51
96
|
variant?: ButtonGroupVariant;
|
|
97
|
+
/**
|
|
98
|
+
* Orientation of the button group
|
|
99
|
+
* @default 'horizontal'
|
|
100
|
+
*/
|
|
52
101
|
orientation?: ButtonGroupOrientation;
|
|
102
|
+
/**
|
|
103
|
+
* Density setting that controls button sizing
|
|
104
|
+
* @default 'default'
|
|
105
|
+
*/
|
|
53
106
|
density?: ButtonGroupDensity;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the entire button group is disabled
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
54
111
|
disabled?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Whether buttons should have equal width
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
55
116
|
equalWidth?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Component prefix for class names
|
|
119
|
+
* @default 'mtrl'
|
|
120
|
+
*/
|
|
56
121
|
prefix?: string;
|
|
122
|
+
/** Component name used in class generation */
|
|
57
123
|
componentName?: string;
|
|
124
|
+
/** Additional CSS class for the button group container */
|
|
58
125
|
class?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Whether to enable ripple effect on buttons
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
59
130
|
ripple?: boolean;
|
|
131
|
+
/** Ripple effect configuration */
|
|
60
132
|
rippleConfig?: {
|
|
133
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
61
134
|
duration?: number;
|
|
62
135
|
};
|
|
136
|
+
/** Accessible label for the button group */
|
|
63
137
|
ariaLabel?: string;
|
|
138
|
+
/** Listeners registered at creation, ahead of any listener added afterwards. */
|
|
64
139
|
on?: {
|
|
65
140
|
click?: (event: ButtonGroupEvent) => void;
|
|
66
141
|
focus?: (event: ButtonGroupEvent) => void;
|
|
@@ -68,23 +143,62 @@ export interface ButtonGroupConfig {
|
|
|
68
143
|
change?: (event: ButtonGroupChangeEvent) => void;
|
|
69
144
|
};
|
|
70
145
|
}
|
|
146
|
+
/** Button Group component interface */
|
|
71
147
|
export interface ButtonGroupComponent {
|
|
148
|
+
/** The component's container DOM element */
|
|
72
149
|
element: HTMLElement;
|
|
150
|
+
/** Array of button component instances */
|
|
73
151
|
buttons: ButtonComponent[];
|
|
152
|
+
/**
|
|
153
|
+
* Gets a button by its index
|
|
154
|
+
* @param index
|
|
155
|
+
*/
|
|
74
156
|
getButton: (index: number) => ButtonComponent | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Gets a button by its id or value
|
|
159
|
+
* @param id
|
|
160
|
+
*/
|
|
75
161
|
getButtonById: (id: string) => ButtonComponent | undefined;
|
|
162
|
+
/** Gets the current variant */
|
|
76
163
|
getVariant: () => ButtonGroupVariant;
|
|
164
|
+
/**
|
|
165
|
+
* Sets the variant for all buttons in the group
|
|
166
|
+
* @param variant
|
|
167
|
+
*/
|
|
77
168
|
setVariant: (variant: ButtonGroupVariant) => ButtonGroupComponent;
|
|
169
|
+
/** Gets the current orientation */
|
|
78
170
|
getOrientation: () => ButtonGroupOrientation;
|
|
171
|
+
/**
|
|
172
|
+
* Sets the orientation of the button group
|
|
173
|
+
* @param orientation
|
|
174
|
+
*/
|
|
79
175
|
setOrientation: (orientation: ButtonGroupOrientation) => ButtonGroupComponent;
|
|
176
|
+
/** Gets the current density */
|
|
80
177
|
getDensity: () => ButtonGroupDensity;
|
|
178
|
+
/**
|
|
179
|
+
* Sets the density of the button group
|
|
180
|
+
* @param density
|
|
181
|
+
*/
|
|
81
182
|
setDensity: (density: ButtonGroupDensity) => ButtonGroupComponent;
|
|
183
|
+
/** Enables the entire button group */
|
|
82
184
|
enable: () => ButtonGroupComponent;
|
|
185
|
+
/** Disables the entire button group */
|
|
83
186
|
disable: () => ButtonGroupComponent;
|
|
187
|
+
/** Whether the whole group is disabled */
|
|
84
188
|
isDisabled: () => boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Enables a specific button by index
|
|
191
|
+
* @param index
|
|
192
|
+
*/
|
|
85
193
|
enableButton: (index: number) => ButtonGroupComponent;
|
|
194
|
+
/**
|
|
195
|
+
* Disables a specific button by index
|
|
196
|
+
* @param index
|
|
197
|
+
*/
|
|
86
198
|
disableButton: (index: number) => ButtonGroupComponent;
|
|
199
|
+
/** Selection (groups with selection "single" or "multi") */
|
|
87
200
|
getSelected: () => string[];
|
|
201
|
+
/** Reads the current model value without changing selection. */
|
|
88
202
|
getValue: () => string | string[] | null;
|
|
89
203
|
isSelected: (value: string) => boolean;
|
|
90
204
|
select: (value: string) => ButtonGroupComponent;
|
|
@@ -92,11 +206,22 @@ export interface ButtonGroupComponent {
|
|
|
92
206
|
toggle: (value: string) => ButtonGroupComponent;
|
|
93
207
|
getKind: () => ButtonGroupKind;
|
|
94
208
|
getSelection: () => ButtonGroupSelection;
|
|
209
|
+
/**
|
|
210
|
+
* Adds an event listener to the button group
|
|
211
|
+
* @param event
|
|
212
|
+
* @param handler
|
|
213
|
+
*/
|
|
95
214
|
on: {
|
|
96
215
|
(event: "change", handler: (event: ButtonGroupChangeEvent) => void): ButtonGroupComponent;
|
|
97
216
|
(event: "click" | "focus" | "blur", handler: (event: ButtonGroupEvent) => void): ButtonGroupComponent;
|
|
98
217
|
};
|
|
218
|
+
/**
|
|
219
|
+
* Removes an event listener from the button group
|
|
220
|
+
* @param event
|
|
221
|
+
* @param handler
|
|
222
|
+
*/
|
|
99
223
|
off: (event: ButtonGroupEventType, handler: (event: ButtonGroupEvent | ButtonGroupChangeEvent) => void) => ButtonGroupComponent;
|
|
224
|
+
/** Destroys the component and cleans up resources */
|
|
100
225
|
destroy: () => void;
|
|
101
226
|
}
|
|
102
227
|
export {};
|