material 3.9.0 → 3.10.1
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/NOTICE +3 -1
- package/README.md +5 -5
- package/dist/components/badge/index.d.ts +167 -3
- package/dist/components/bottom-app-bar/index.d.ts +141 -4
- package/dist/components/bottom-sheet/index.d.ts +114 -2
- package/dist/components/button/index.d.ts +10 -5
- package/dist/components/button-group/button-group.js +1 -0
- package/dist/components/button-group/config.js +9 -6
- package/dist/components/button-group/index.d.ts +250 -6
- package/dist/components/card/api.js +19 -0
- package/dist/components/card/index.d.ts +326 -5
- package/dist/components/carousel/features/slides.js +17 -7
- package/dist/components/carousel/index.d.ts +102 -3
- package/dist/components/checkbox/index.d.ts +217 -5
- package/dist/components/chips/chip/chip.js +4 -3
- package/dist/components/chips/index.d.ts +343 -3
- package/dist/components/datepicker/datepicker.js +62 -84
- package/dist/components/datepicker/index.d.ts +313 -2
- package/dist/components/datepicker/render.js +25 -21
- package/dist/components/datepicker/utils.js +65 -110
- package/dist/components/dialog/features.js +1 -1
- package/dist/components/dialog/index.d.ts +333 -3
- package/dist/components/divider/index.d.ts +96 -3
- package/dist/components/drawer/features/items.js +10 -2
- package/dist/components/drawer/index.d.ts +196 -3
- package/dist/components/extended-fab/index.d.ts +224 -2
- package/dist/components/fab/index.d.ts +183 -2
- package/dist/components/fab-menu/index.d.ts +106 -6
- package/dist/components/icon-button/index.d.ts +11 -4
- package/dist/components/list/features/anatomy.js +25 -6
- package/dist/components/list/features/selection.js +30 -2
- package/dist/components/list/index.d.ts +299 -6
- package/dist/components/loading-indicator/index.d.ts +91 -3
- package/dist/components/menu/features/controller.js +2 -0
- package/dist/components/menu/index.d.ts +10 -6
- package/dist/components/menu/inner.d.ts +2 -2
- package/dist/components/menu/on-demand.d.ts +5 -9
- package/dist/components/menu/types.d.ts +12 -7
- package/dist/components/navigation-bar/index.d.ts +70 -2
- package/dist/components/navigation-rail/index.d.ts +98 -2
- package/dist/components/progress/index.d.ts +9 -2
- package/dist/components/progress/types.d.ts +5 -5
- package/dist/components/radios/index.d.ts +158 -3
- package/dist/components/search/features/states.js +20 -39
- package/dist/components/search/features/structure.js +24 -4
- package/dist/components/search/features/suggestions.js +4 -0
- package/dist/components/search/index.d.ts +255 -2
- package/dist/components/select/index.d.ts +252 -6
- package/dist/components/side-sheet/index.d.ts +104 -2
- package/dist/components/slider/index.d.ts +236 -2
- package/dist/components/snackbar/api.js +26 -0
- package/dist/components/snackbar/constants.d.ts +4 -0
- package/dist/components/snackbar/constants.js +3 -1
- package/dist/components/snackbar/index.d.ts +215 -4
- package/dist/components/split-button/index.d.ts +10 -3
- package/dist/components/split-button/types.d.ts +3 -3
- package/dist/components/switch/index.d.ts +190 -3
- package/dist/components/tabs/index.d.ts +454 -12
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/responsive-legacy.js +65 -0
- package/dist/components/tabs/responsive.d.ts +7 -32
- package/dist/components/tabs/responsive.js +4 -63
- package/dist/components/tabs/tabs.js +1 -0
- package/dist/components/text-field/config.js +3 -4
- package/dist/components/text-field/features/field.js +61 -0
- package/dist/components/text-field/features/leading-icon.js +12 -45
- package/dist/components/text-field/features/prefix-text.js +6 -40
- package/dist/components/text-field/features/suffix-text.js +6 -40
- package/dist/components/text-field/index.d.ts +338 -3
- package/dist/components/timepicker/constants.d.ts +4 -4
- package/dist/components/timepicker/constants.js +2 -2
- package/dist/components/timepicker/dial.js +30 -3
- package/dist/components/timepicker/index.d.ts +279 -5
- package/dist/components/timepicker/render.js +15 -9
- package/dist/components/toolbar/index.d.ts +145 -6
- package/dist/components/tooltip/index.d.ts +155 -3
- package/dist/components/top-app-bar/index.d.ts +92 -5
- package/dist/core/canvas/index.d.ts +172 -5
- package/dist/core/canvas/utils.js +3 -13
- package/dist/core/compose/cleanup.d.ts +1 -1
- package/dist/core/compose/features/icon-opt-in.js +5 -0
- package/dist/core/compose/features/icon-slot.js +100 -0
- package/dist/core/compose/features/textinput.js +2 -0
- package/dist/core/compose/features/track.js +4 -0
- package/dist/core/compose/index.d.ts +741 -8
- package/dist/core/config/component.d.ts +1 -4
- package/dist/core/dom/create.d.ts +1 -4
- package/dist/core/dom/index.d.ts +233 -12
- package/dist/core/index.d.ts +93 -14
- package/dist/core/navigation/destinations.d.ts +6 -6
- package/dist/core/shapes/index.d.ts +286 -6
- package/dist/core/state/index.d.ts +98 -5
- package/dist/core/theme/index.d.ts +80 -4
- package/dist/core/utils/index.d.ts +95 -9
- package/dist/core/utils/mobile.d.ts +2 -2
- package/dist/elements/adapter.d.ts +3 -3
- package/dist/elements/css/bottom-sheet.css +1 -1
- package/dist/elements/css/button-group.css +1 -1
- package/dist/elements/css/button.css +1 -1
- package/dist/elements/css/datepicker.css +1 -1
- package/dist/elements/css/dialog.css +1 -1
- package/dist/elements/css/drawer.css +1 -1
- package/dist/elements/css/icon-button.css +1 -1
- package/dist/elements/css/list.css +1 -1
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/side-sheet.css +1 -1
- package/dist/elements/css/snackbar.css +1 -1
- package/dist/elements/css/text-field.css +1 -1
- package/dist/elements/css/timepicker.css +1 -1
- package/dist/elements/css/toolbar.css +1 -1
- package/dist/elements/datepicker.js +1 -0
- package/dist/elements/define.d.ts +3 -3
- package/dist/elements/define.js +12 -1
- package/dist/elements/drawer.js +2 -0
- package/dist/elements/index.d.ts +3974 -107
- 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 +2 -2
- package/dist/elements/preupgrade/button.css +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/elements/preupgrade/list.css +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/elements/snackbar.js +2 -0
- package/dist/elements/styles.d.ts +7 -7
- package/dist/elements/styles.js +15 -15
- package/dist/elements/text-field.js +2 -0
- package/dist/index.d.ts +78 -4
- package/dist/react/create.d.ts +2 -6
- package/dist/react/index.d.ts +106 -52
- package/dist/react/jsx.d.ts +49 -49
- package/dist/solid/create.d.ts +2 -7
- package/dist/solid/index.d.ts +106 -52
- package/dist/solid/jsx.d.ts +51 -50
- 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 +2 -2
- package/dist/styles/button-group.css +2 -2
- package/dist/styles/button.css +2 -2
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +2 -2
- 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 +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +2 -2
- package/dist/styles/list.css +2 -2
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +2 -2
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +2 -2
- 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 +2 -2
- 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 +6 -10
- package/dist/theme/vendor/contrast/contrast.js +1 -16
- package/dist/theme/vendor/dislike/dislike_analyzer.js +1 -16
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +1 -16
- package/dist/theme/vendor/dynamiccolor/color_spec_2025.js +1 -16
- package/dist/theme/vendor/dynamiccolor/contrast_curve.js +1 -16
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +2 -2
- package/dist/theme/vendor/dynamiccolor/dynamic_color.js +1 -16
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +2 -2
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +1 -16
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +1 -16
- package/dist/theme/vendor/dynamiccolor/spec_2025.js +1 -16
- package/dist/theme/vendor/dynamiccolor/spec_extensions.js +1 -16
- package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +1 -16
- package/dist/theme/vendor/dynamiccolor/variant.js +1 -16
- package/dist/theme/vendor/hct/cam16.js +1 -16
- package/dist/theme/vendor/hct/hct.js +1 -16
- package/dist/theme/vendor/hct/hct_solver.js +1 -16
- package/dist/theme/vendor/hct/viewing_conditions.js +1 -16
- package/dist/theme/vendor/palettes/tonal_palette.d.ts +6 -9
- package/dist/theme/vendor/palettes/tonal_palette.js +1 -16
- package/dist/theme/vendor/quantize/lab_point_provider.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_celebi.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_map.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_wsmeans.js +1 -16
- package/dist/theme/vendor/quantize/quantizer_wu.js +1 -16
- package/dist/theme/vendor/score/score.js +1 -16
- package/dist/theme/vendor/temperature/temperature_cache.js +1 -16
- package/dist/theme/vendor/utils/color_utils.js +1 -16
- package/dist/theme/vendor/utils/image_utils.js +1 -16
- package/dist/theme/vendor/utils/math_utils.js +1 -16
- package/dist/theme/vendor/utils/string_utils.js +1 -16
- 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/index.d.ts +188 -53
- package/package.json +5 -1
- package/src/styles/abstract/_functions.scss +22 -1
- package/src/styles/abstract/_variables.scss +0 -2
- package/src/styles/base/_tokens.scss +12 -0
- package/src/styles/components/_bottom-sheet.scss +1 -0
- package/src/styles/components/_button-group.scss +9 -5
- package/src/styles/components/_button.scss +9 -12
- package/src/styles/components/_datepicker.scss +2 -1
- package/src/styles/components/_dialog.scss +1 -0
- package/src/styles/components/_drawer.scss +33 -65
- package/src/styles/components/_icon-button.scss +32 -33
- package/src/styles/components/_list.scss +19 -5
- package/src/styles/components/_menu.scss +1 -0
- package/src/styles/components/_side-sheet.scss +1 -0
- package/src/styles/components/_snackbar.scss +1 -0
- package/src/styles/components/_text-field.scss +17 -109
- package/src/styles/components/_timepicker.scss +19 -5
- package/src/styles/components/_toolbar.scss +4 -4
- package/src/styles/elements/_button-group.scss +17 -4
- package/src/styles/elements/_button.scss +3 -2
- package/src/styles/elements/_drawer.scss +2 -1
- package/src/styles/elements/_field.scss +25 -14
- package/src/styles/elements/_icon-button.scss +8 -3
- package/src/styles/elements/_list.scss +3 -2
- package/src/styles/elements/_text-field.scss +71 -47
- package/dist/components/badge/badge.d.ts +0 -7
- package/dist/components/badge/types.d.ts +0 -152
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +0 -12
- package/dist/components/bottom-app-bar/types.d.ts +0 -124
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -7
- package/dist/components/bottom-sheet/types.d.ts +0 -100
- package/dist/components/button/button.d.ts +0 -7
- package/dist/components/button-group/button-group.d.ts +0 -7
- package/dist/components/button-group/types.d.ts +0 -227
- package/dist/components/card/card.d.ts +0 -7
- package/dist/components/card/content.d.ts +0 -22
- package/dist/components/card/types.d.ts +0 -272
- package/dist/components/carousel/carousel.d.ts +0 -4
- package/dist/components/carousel/types.d.ts +0 -81
- package/dist/components/checkbox/checkbox.d.ts +0 -8
- package/dist/components/checkbox/types.d.ts +0 -199
- package/dist/components/chips/chips.d.ts +0 -7
- package/dist/components/chips/factories.d.ts +0 -9
- package/dist/components/chips/types.d.ts +0 -304
- package/dist/components/datepicker/datepicker.d.ts +0 -7
- package/dist/components/datepicker/types.d.ts +0 -300
- package/dist/components/datepicker/types.js +0 -17
- package/dist/components/dialog/dialog.d.ts +0 -8
- package/dist/components/dialog/types.d.ts +0 -311
- package/dist/components/divider/config.d.ts +0 -43
- package/dist/components/divider/divider.d.ts +0 -7
- package/dist/components/divider/types.d.ts +0 -43
- package/dist/components/drawer/drawer.d.ts +0 -7
- package/dist/components/drawer/types.d.ts +0 -179
- package/dist/components/extended-fab/extended-fab.d.ts +0 -7
- package/dist/components/extended-fab/types.d.ts +0 -208
- package/dist/components/fab/fab.d.ts +0 -7
- package/dist/components/fab/types.d.ts +0 -168
- package/dist/components/fab-menu/fab-menu.d.ts +0 -8
- package/dist/components/fab-menu/types.d.ts +0 -91
- package/dist/components/icon-button/icon-button.d.ts +0 -7
- package/dist/components/index.d.ts +0 -82
- package/dist/components/list/features/listbox.d.ts +0 -16
- package/dist/components/list/list.d.ts +0 -7
- package/dist/components/list/types.d.ts +0 -257
- package/dist/components/loading-indicator/features/renderer.d.ts +0 -28
- package/dist/components/loading-indicator/loading-indicator.d.ts +0 -7
- package/dist/components/loading-indicator/types.d.ts +0 -53
- package/dist/components/menu/menu.d.ts +0 -7
- package/dist/components/navigation-bar/navigation-bar.d.ts +0 -3
- package/dist/components/navigation-bar/types.d.ts +0 -59
- package/dist/components/navigation-rail/navigation-rail.d.ts +0 -3
- package/dist/components/navigation-rail/types.d.ts +0 -87
- package/dist/components/progress/progress.d.ts +0 -7
- package/dist/components/radios/radios.d.ts +0 -7
- package/dist/components/radios/types.d.ts +0 -144
- package/dist/components/search/search.d.ts +0 -7
- package/dist/components/search/types.d.ts +0 -235
- package/dist/components/select/select.d.ts +0 -7
- package/dist/components/select/types.d.ts +0 -232
- package/dist/components/side-sheet/side-sheet.d.ts +0 -7
- package/dist/components/side-sheet/types.d.ts +0 -91
- package/dist/components/slider/slider.d.ts +0 -7
- package/dist/components/slider/types.d.ts +0 -218
- package/dist/components/snackbar/snackbar.d.ts +0 -9
- package/dist/components/snackbar/types.d.ts +0 -180
- package/dist/components/split-button/split-button.d.ts +0 -7
- package/dist/components/switch/switch.d.ts +0 -7
- package/dist/components/switch/types.d.ts +0 -171
- package/dist/components/tabs/indicator.d.ts +0 -44
- package/dist/components/tabs/tab.d.ts +0 -7
- package/dist/components/tabs/tabs.d.ts +0 -7
- package/dist/components/tabs/types.d.ts +0 -304
- package/dist/components/tabs/utils.d.ts +0 -46
- package/dist/components/text-field/features/trailing-icon.d.ts +0 -54
- package/dist/components/text-field/text-field.d.ts +0 -7
- package/dist/components/text-field/types.d.ts +0 -261
- package/dist/components/timepicker/timepicker.d.ts +0 -3
- package/dist/components/timepicker/types.d.ts +0 -258
- package/dist/components/toolbar/toolbar.d.ts +0 -8
- package/dist/components/toolbar/types.d.ts +0 -129
- package/dist/components/tooltip/tooltip.d.ts +0 -7
- package/dist/components/tooltip/types.d.ts +0 -137
- package/dist/components/top-app-bar/top-app-bar.d.ts +0 -7
- package/dist/components/top-app-bar/types.d.ts +0 -80
- package/dist/core/canvas/animation.d.ts +0 -20
- package/dist/core/canvas/drawing.d.ts +0 -67
- package/dist/core/canvas/resize.d.ts +0 -8
- package/dist/core/canvas/utils.d.ts +0 -62
- package/dist/core/compose/base.d.ts +0 -18
- package/dist/core/compose/features/badge.d.ts +0 -27
- package/dist/core/compose/features/checkable.d.ts +0 -33
- package/dist/core/compose/features/debounce.d.ts +0 -45
- package/dist/core/compose/features/disabled.d.ts +0 -26
- package/dist/core/compose/features/events.d.ts +0 -31
- package/dist/core/compose/features/index.d.ts +0 -34
- package/dist/core/compose/features/input.d.ts +0 -54
- package/dist/core/compose/features/lifecycle.d.ts +0 -41
- package/dist/core/compose/features/position.d.ts +0 -36
- package/dist/core/compose/features/ripple.d.ts +0 -35
- package/dist/core/compose/features/size.d.ts +0 -12
- package/dist/core/compose/features/style.d.ts +0 -11
- package/dist/core/compose/features/textinput.d.ts +0 -66
- package/dist/core/compose/features/textlabel.d.ts +0 -34
- package/dist/core/compose/features/throttle.d.ts +0 -38
- package/dist/core/compose/features/track.d.ts +0 -24
- package/dist/core/compose/features/variant.d.ts +0 -12
- package/dist/core/compose/features/withEvents.d.ts +0 -27
- package/dist/core/compose/pipe.d.ts +0 -55
- package/dist/core/compose/utils/type-guards.d.ts +0 -17
- package/dist/core/config.d.ts +0 -72
- package/dist/core/dom/attributes.d.ts +0 -34
- package/dist/core/dom/classes.d.ts +0 -29
- package/dist/core/dom/events.d.ts +0 -43
- package/dist/core/dom/focus.d.ts +0 -15
- package/dist/core/dom/html.d.ts +0 -16
- package/dist/core/dom/layer.d.ts +0 -57
- package/dist/core/dom/roving.d.ts +0 -18
- package/dist/core/shapes/cubic.d.ts +0 -45
- package/dist/core/shapes/material.d.ts +0 -131
- package/dist/core/shapes/polygon.d.ts +0 -38
- package/dist/core/state/events.d.ts +0 -25
- package/dist/core/state/store.d.ts +0 -60
- package/dist/core/theme/shape.d.ts +0 -5
- package/dist/core/theme/tokens.d.ts +0 -67
- package/dist/core/utils/background.d.ts +0 -13
- package/dist/core/utils/color.d.ts +0 -6
- package/dist/core/utils/object.d.ts +0 -11
- package/dist/core/utils/performance.d.ts +0 -32
- package/dist/core/utils/theme.d.ts +0 -17
- package/dist/core/utils/url.d.ts +0 -6
- package/dist/elements/badge.d.ts +0 -57
- package/dist/elements/bottom-app-bar.d.ts +0 -66
- package/dist/elements/bottom-sheet.d.ts +0 -107
- package/dist/elements/button-group.d.ts +0 -142
- package/dist/elements/button.d.ts +0 -101
- package/dist/elements/card.d.ts +0 -69
- package/dist/elements/carousel.d.ts +0 -119
- package/dist/elements/checkbox.d.ts +0 -97
- package/dist/elements/chips.d.ts +0 -126
- package/dist/elements/datepicker.d.ts +0 -131
- package/dist/elements/dialog.d.ts +0 -101
- package/dist/elements/divider.d.ts +0 -52
- package/dist/elements/drawer.d.ts +0 -119
- package/dist/elements/extended-fab.d.ts +0 -97
- package/dist/elements/fab-menu.d.ts +0 -102
- package/dist/elements/fab.d.ts +0 -71
- package/dist/elements/list.d.ts +0 -127
- package/dist/elements/loading-indicator.d.ts +0 -47
- package/dist/elements/menu.d.ts +0 -144
- package/dist/elements/navigation-bar.d.ts +0 -104
- package/dist/elements/navigation-rail.d.ts +0 -145
- package/dist/elements/progress.d.ts +0 -87
- package/dist/elements/radios.d.ts +0 -92
- package/dist/elements/search.d.ts +0 -202
- package/dist/elements/select.d.ts +0 -119
- package/dist/elements/side-sheet.d.ts +0 -86
- package/dist/elements/slider.d.ts +0 -160
- package/dist/elements/snackbar.d.ts +0 -87
- package/dist/elements/split-button.d.ts +0 -87
- package/dist/elements/switch.d.ts +0 -98
- package/dist/elements/tabs.d.ts +0 -76
- package/dist/elements/text-field.d.ts +0 -170
- package/dist/elements/timepicker.d.ts +0 -148
- package/dist/elements/toolbar.d.ts +0 -98
- package/dist/elements/tooltip.d.ts +0 -75
- package/dist/elements/top-app-bar.d.ts +0 -60
- package/dist/react/badge.d.ts +0 -4
- package/dist/react/bottom-app-bar.d.ts +0 -5
- package/dist/react/bottom-sheet.d.ts +0 -4
- package/dist/react/button-group-item.d.ts +0 -3
- package/dist/react/button-group.d.ts +0 -7
- package/dist/react/button.d.ts +0 -5
- package/dist/react/card.d.ts +0 -4
- package/dist/react/carousel-item.d.ts +0 -3
- package/dist/react/carousel.d.ts +0 -4
- package/dist/react/checkbox.d.ts +0 -4
- package/dist/react/chip.d.ts +0 -3
- package/dist/react/chips.d.ts +0 -4
- package/dist/react/datepicker.d.ts +0 -4
- package/dist/react/dialog.d.ts +0 -7
- package/dist/react/divider.d.ts +0 -4
- package/dist/react/drawer-item.d.ts +0 -3
- package/dist/react/drawer.d.ts +0 -4
- package/dist/react/extended-fab.d.ts +0 -4
- package/dist/react/fab-menu-item.d.ts +0 -3
- package/dist/react/fab-menu.d.ts +0 -6
- package/dist/react/fab.d.ts +0 -4
- package/dist/react/icon-button.d.ts +0 -4
- package/dist/react/list-item.d.ts +0 -3
- package/dist/react/list.d.ts +0 -4
- package/dist/react/loading-indicator.d.ts +0 -4
- package/dist/react/menu-item.d.ts +0 -3
- package/dist/react/menu.d.ts +0 -4
- package/dist/react/navigation-bar-item.d.ts +0 -3
- package/dist/react/navigation-bar.d.ts +0 -4
- package/dist/react/navigation-rail-item.d.ts +0 -3
- package/dist/react/navigation-rail.d.ts +0 -4
- package/dist/react/progress.d.ts +0 -4
- package/dist/react/radio.d.ts +0 -3
- package/dist/react/radios.d.ts +0 -4
- package/dist/react/search-suggestion.d.ts +0 -3
- package/dist/react/search.d.ts +0 -4
- package/dist/react/select-option.d.ts +0 -3
- package/dist/react/select.d.ts +0 -6
- package/dist/react/side-sheet.d.ts +0 -4
- package/dist/react/slider.d.ts +0 -4
- package/dist/react/snackbar.d.ts +0 -7
- package/dist/react/split-button.d.ts +0 -7
- package/dist/react/switch.d.ts +0 -4
- package/dist/react/tab.d.ts +0 -3
- package/dist/react/tabs.d.ts +0 -7
- package/dist/react/text-field.d.ts +0 -4
- package/dist/react/timepicker.d.ts +0 -4
- package/dist/react/toolbar.d.ts +0 -5
- package/dist/react/tooltip.d.ts +0 -4
- package/dist/react/top-app-bar.d.ts +0 -4
- package/dist/solid/badge.d.ts +0 -4
- package/dist/solid/bottom-app-bar.d.ts +0 -5
- package/dist/solid/bottom-sheet.d.ts +0 -4
- package/dist/solid/button-group-item.d.ts +0 -3
- package/dist/solid/button-group.d.ts +0 -7
- package/dist/solid/button.d.ts +0 -5
- package/dist/solid/card.d.ts +0 -4
- package/dist/solid/carousel-item.d.ts +0 -3
- package/dist/solid/carousel.d.ts +0 -4
- package/dist/solid/checkbox.d.ts +0 -4
- package/dist/solid/chip.d.ts +0 -3
- package/dist/solid/chips.d.ts +0 -4
- package/dist/solid/datepicker.d.ts +0 -4
- package/dist/solid/dialog.d.ts +0 -7
- package/dist/solid/divider.d.ts +0 -4
- package/dist/solid/drawer-item.d.ts +0 -3
- package/dist/solid/drawer.d.ts +0 -4
- package/dist/solid/extended-fab.d.ts +0 -4
- package/dist/solid/fab-menu-item.d.ts +0 -3
- package/dist/solid/fab-menu.d.ts +0 -6
- package/dist/solid/fab.d.ts +0 -4
- package/dist/solid/icon-button.d.ts +0 -4
- package/dist/solid/list-item.d.ts +0 -3
- package/dist/solid/list.d.ts +0 -4
- package/dist/solid/loading-indicator.d.ts +0 -4
- package/dist/solid/menu-item.d.ts +0 -3
- package/dist/solid/menu.d.ts +0 -4
- package/dist/solid/navigation-bar-item.d.ts +0 -3
- package/dist/solid/navigation-bar.d.ts +0 -4
- package/dist/solid/navigation-rail-item.d.ts +0 -3
- package/dist/solid/navigation-rail.d.ts +0 -4
- package/dist/solid/progress.d.ts +0 -4
- package/dist/solid/radio.d.ts +0 -3
- package/dist/solid/radios.d.ts +0 -4
- package/dist/solid/search-suggestion.d.ts +0 -3
- package/dist/solid/search.d.ts +0 -4
- package/dist/solid/select-option.d.ts +0 -3
- package/dist/solid/select.d.ts +0 -6
- package/dist/solid/side-sheet.d.ts +0 -4
- package/dist/solid/slider.d.ts +0 -4
- package/dist/solid/snackbar.d.ts +0 -7
- package/dist/solid/split-button.d.ts +0 -7
- package/dist/solid/switch.d.ts +0 -4
- package/dist/solid/tab.d.ts +0 -3
- package/dist/solid/tabs.d.ts +0 -7
- package/dist/solid/text-field.d.ts +0 -4
- package/dist/solid/timepicker.d.ts +0 -4
- package/dist/solid/toolbar.d.ts +0 -5
- package/dist/solid/tooltip.d.ts +0 -4
- package/dist/solid/top-app-bar.d.ts +0 -4
- package/dist/vue/badge.d.ts +0 -4
- package/dist/vue/bottom-app-bar.d.ts +0 -5
- package/dist/vue/bottom-sheet.d.ts +0 -4
- package/dist/vue/button-group-item.d.ts +0 -3
- package/dist/vue/button-group.d.ts +0 -7
- package/dist/vue/button.d.ts +0 -5
- package/dist/vue/card.d.ts +0 -4
- package/dist/vue/carousel-item.d.ts +0 -3
- package/dist/vue/carousel.d.ts +0 -4
- package/dist/vue/checkbox.d.ts +0 -4
- package/dist/vue/chip.d.ts +0 -3
- package/dist/vue/chips.d.ts +0 -4
- package/dist/vue/create.d.ts +0 -73
- package/dist/vue/datepicker.d.ts +0 -4
- package/dist/vue/dialog.d.ts +0 -7
- package/dist/vue/divider.d.ts +0 -4
- package/dist/vue/drawer-item.d.ts +0 -3
- package/dist/vue/drawer.d.ts +0 -4
- package/dist/vue/extended-fab.d.ts +0 -4
- package/dist/vue/fab-menu-item.d.ts +0 -3
- package/dist/vue/fab-menu.d.ts +0 -6
- package/dist/vue/fab.d.ts +0 -4
- package/dist/vue/icon-button.d.ts +0 -4
- package/dist/vue/list-item.d.ts +0 -3
- package/dist/vue/list.d.ts +0 -4
- package/dist/vue/loading-indicator.d.ts +0 -4
- package/dist/vue/menu-item.d.ts +0 -3
- package/dist/vue/menu.d.ts +0 -4
- package/dist/vue/navigation-bar-item.d.ts +0 -3
- package/dist/vue/navigation-bar.d.ts +0 -4
- package/dist/vue/navigation-rail-item.d.ts +0 -3
- package/dist/vue/navigation-rail.d.ts +0 -4
- package/dist/vue/progress.d.ts +0 -4
- package/dist/vue/radio.d.ts +0 -3
- package/dist/vue/radios.d.ts +0 -4
- package/dist/vue/search-suggestion.d.ts +0 -3
- package/dist/vue/search.d.ts +0 -4
- package/dist/vue/select-option.d.ts +0 -3
- package/dist/vue/select.d.ts +0 -6
- package/dist/vue/side-sheet.d.ts +0 -4
- package/dist/vue/slider.d.ts +0 -4
- package/dist/vue/snackbar.d.ts +0 -7
- package/dist/vue/split-button.d.ts +0 -7
- package/dist/vue/switch.d.ts +0 -4
- package/dist/vue/tab.d.ts +0 -3
- package/dist/vue/tabs.d.ts +0 -7
- package/dist/vue/text-field.d.ts +0 -4
- package/dist/vue/timepicker.d.ts +0 -4
- package/dist/vue/toolbar.d.ts +0 -5
- package/dist/vue/tooltip.d.ts +0 -4
- package/dist/vue/top-app-bar.d.ts +0 -4
|
@@ -1,3 +1,190 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { EventCallback } from "../../core/state/emitter.js";
|
|
2
|
+
import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
3
|
+
|
|
4
|
+
type SwitchPosition = "center" | "start" | "end";
|
|
5
|
+
|
|
6
|
+
/** Switch label position types */
|
|
7
|
+
type SwitchLabelPosition = "start" | "end";
|
|
8
|
+
|
|
9
|
+
/** Configuration interface for the Switch component */
|
|
10
|
+
interface SwitchConfig {
|
|
11
|
+
/** Input name attribute */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** Initial checked state */
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
/** Whether input is required */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** Whether switch is disabled */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Input value attribute */
|
|
20
|
+
value?: string;
|
|
21
|
+
/** Label text, or a node placed inside the label (the web component passes a `<slot>`) */
|
|
22
|
+
label?: string | Node;
|
|
23
|
+
/** Supporting text content */
|
|
24
|
+
supportingText?: string;
|
|
25
|
+
/** Whether supporting text indicates an error */
|
|
26
|
+
error?: boolean;
|
|
27
|
+
/** Additional CSS classes */
|
|
28
|
+
class?: string;
|
|
29
|
+
/** ARIA label for accessibility */
|
|
30
|
+
ariaLabel?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Put ariaLabel only on the input/handle, omitting the generated wrapper label.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
controlLabelOnly?: boolean;
|
|
36
|
+
/** Prefix for class names */
|
|
37
|
+
prefix?: string;
|
|
38
|
+
/** Component name */
|
|
39
|
+
componentName?: string;
|
|
40
|
+
/** Icon HTML in the selected handle; 'none' for no icon. */
|
|
41
|
+
icon?: string;
|
|
42
|
+
/** Icon HTML in the unselected handle, which then grows to 24dp (M3's icons on both states). */
|
|
43
|
+
unselectedIcon?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Which side of the switch the label sits on
|
|
46
|
+
* @default 'start'
|
|
47
|
+
*/
|
|
48
|
+
labelPosition?: SwitchLabelPosition;
|
|
49
|
+
/** Index signature for additional properties */
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A checked-state change from native input activation. */
|
|
54
|
+
interface SwitchChangePayload {
|
|
55
|
+
/** The new checked state. */
|
|
56
|
+
checked: boolean;
|
|
57
|
+
/** The checked model value, matching getValue() at dispatch. */
|
|
58
|
+
value: boolean;
|
|
59
|
+
/** The input's HTML value attribute, used for native form submission. */
|
|
60
|
+
valueAttribute: string;
|
|
61
|
+
/** The original native change event, when supplied by the emitter. */
|
|
62
|
+
nativeEvent?: Event;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Emitter events: change, and the input's focus and blur. */
|
|
66
|
+
interface SwitchEvents extends TouchEvents {
|
|
67
|
+
change: (payload: SwitchChangePayload) => void;
|
|
68
|
+
focus: (event: FocusEvent) => void;
|
|
69
|
+
blur: (event: FocusEvent) => void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Switch component interface */
|
|
73
|
+
interface SwitchComponent {
|
|
74
|
+
/** The root element of the switch */
|
|
75
|
+
element: HTMLElement;
|
|
76
|
+
/** The input element */
|
|
77
|
+
input: HTMLInputElement;
|
|
78
|
+
/** Gets the switch's checked state (boolean) for form compatibility */
|
|
79
|
+
getValue: () => boolean;
|
|
80
|
+
/** Sets the switch's checked state */
|
|
81
|
+
setValue: (value: boolean | string) => SwitchComponent;
|
|
82
|
+
/** Gets the HTML value attribute (rarely needed) */
|
|
83
|
+
getValueAttribute: () => string;
|
|
84
|
+
/** Sets the HTML value attribute (rarely needed) */
|
|
85
|
+
setValueAttribute: (value: string) => SwitchComponent;
|
|
86
|
+
/** Checks/activates the switch */
|
|
87
|
+
check: () => SwitchComponent;
|
|
88
|
+
/** Unchecks/deactivates the switch */
|
|
89
|
+
uncheck: () => SwitchComponent;
|
|
90
|
+
/** Toggles the switch's checked state */
|
|
91
|
+
toggle: () => SwitchComponent;
|
|
92
|
+
/** Returns whether the switch is checked */
|
|
93
|
+
isChecked: () => boolean;
|
|
94
|
+
/** Sets the switch's label text */
|
|
95
|
+
setLabel: (text: string) => SwitchComponent;
|
|
96
|
+
/** Gets the switch's label text */
|
|
97
|
+
getLabel: () => string;
|
|
98
|
+
/** Supporting text element */
|
|
99
|
+
supportingTextElement: HTMLElement | null;
|
|
100
|
+
/** Sets supporting text content */
|
|
101
|
+
setSupportingText: (text: string, isError?: boolean) => SwitchComponent;
|
|
102
|
+
/** Removes supporting text */
|
|
103
|
+
removeSupportingText: () => SwitchComponent;
|
|
104
|
+
/** Puts the switch in or out of the error state: its class and aria-invalid */
|
|
105
|
+
setError: (error: boolean) => SwitchComponent;
|
|
106
|
+
/** Whether the switch is in the error state */
|
|
107
|
+
isError: () => boolean;
|
|
108
|
+
/** Subscribes to checked-state changes; native input events use input.addEventListener. */
|
|
109
|
+
on: <K extends keyof SwitchEvents>(event: K, handler: SwitchEvents[K]) => SwitchComponent;
|
|
110
|
+
/** Removes event listener */
|
|
111
|
+
off: <K extends keyof SwitchEvents>(event: K, handler: SwitchEvents[K]) => SwitchComponent;
|
|
112
|
+
/** Enables the switch */
|
|
113
|
+
enable: () => SwitchComponent;
|
|
114
|
+
/** Disables the switch */
|
|
115
|
+
disable: () => SwitchComponent;
|
|
116
|
+
/** Whether the switch is disabled */
|
|
117
|
+
isDisabled: () => boolean;
|
|
118
|
+
/** Destroys the switch component and cleans up resources */
|
|
119
|
+
destroy: () => void;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
interface ApiOptions {
|
|
124
|
+
disabled: {
|
|
125
|
+
enable: () => void;
|
|
126
|
+
disable: () => void;
|
|
127
|
+
isDisabled: () => boolean;
|
|
128
|
+
};
|
|
129
|
+
lifecycle: {
|
|
130
|
+
destroy: () => void;
|
|
131
|
+
};
|
|
132
|
+
checkable: {
|
|
133
|
+
check: () => void;
|
|
134
|
+
uncheck: () => void;
|
|
135
|
+
toggle: () => void;
|
|
136
|
+
isChecked: () => boolean;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
interface BaseComponent {
|
|
142
|
+
element: HTMLElement;
|
|
143
|
+
input?: HTMLInputElement;
|
|
144
|
+
getValue?: () => boolean;
|
|
145
|
+
setValue?: (value: boolean) => void;
|
|
146
|
+
label?: {
|
|
147
|
+
setText: (content: string) => void;
|
|
148
|
+
getText: () => string;
|
|
149
|
+
};
|
|
150
|
+
on?: (event: string, handler: EventCallback) => void;
|
|
151
|
+
off?: (event: string, handler: EventCallback) => void;
|
|
152
|
+
disabled?: {
|
|
153
|
+
enable: () => void;
|
|
154
|
+
disable: () => void;
|
|
155
|
+
isDisabled: () => boolean;
|
|
156
|
+
};
|
|
157
|
+
lifecycle?: {
|
|
158
|
+
destroy: () => void;
|
|
159
|
+
};
|
|
160
|
+
checkable?: {
|
|
161
|
+
check: () => void;
|
|
162
|
+
uncheck: () => void;
|
|
163
|
+
toggle: () => void;
|
|
164
|
+
isChecked: () => boolean;
|
|
165
|
+
};
|
|
166
|
+
supportingTextElement?: HTMLElement | null;
|
|
167
|
+
setSupportingText?: (text: string, isError?: boolean) => void;
|
|
168
|
+
removeSupportingText?: () => void;
|
|
169
|
+
setError?: (error: boolean) => void;
|
|
170
|
+
isError?: () => boolean;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
type ApiComponent = BaseComponent & Required<Pick<BaseComponent, "checkable" | "disabled" | "lifecycle">>;
|
|
175
|
+
|
|
176
|
+
/** Registers SwitchConfig with the global defaults map, so `setComponentDefaults("switch", ...)` is typed without core importing anything from this component. */
|
|
177
|
+
declare module "../../core/config/global" {
|
|
178
|
+
interface ComponentConfigMap {
|
|
179
|
+
switch?: Partial<SwitchConfig>;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Creates a new Switch component
|
|
185
|
+
* @param config
|
|
186
|
+
*/
|
|
187
|
+
declare const createSwitch: (config?: SwitchConfig) => SwitchComponent;
|
|
188
|
+
export type { SwitchChangePayload, SwitchComponent, SwitchConfig, SwitchEvents };
|
|
189
|
+
export { createSwitch, createSwitch as default };
|
|
190
|
+
export { SWITCH_CLASSES, SWITCH_DEFAULTS, SWITCH_EVENTS, SWITCH_LABEL_POSITIONS, SWITCH_STATES } from "./constants.js";
|
|
@@ -1,12 +1,454 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
2
|
+
import type { BadgeComponent } from "../badge/index.js";
|
|
3
|
+
import type { ButtonComponent } from "../button/types.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface TabsHost {
|
|
7
|
+
element?: HTMLElement;
|
|
8
|
+
tabs?: TabComponent[];
|
|
9
|
+
getTabs?: () => TabComponent[];
|
|
10
|
+
getActiveTab?: () => TabComponent | null;
|
|
11
|
+
setActiveTab?: (tabOrValue: TabComponent | string) => unknown;
|
|
12
|
+
handleTabClick?: (event: Event | null, tab: TabComponent) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
declare function getActiveTab(component: TabsHost): TabComponent | null;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
declare function allocateTabsGroupId(): string;
|
|
20
|
+
|
|
21
|
+
/** A tab's element id within its group: `tab-<groupId>-<value>` for a value of `[A-Za-z0-9_-]`, and `tabx-<groupId>-<encoded value>` otherwise. */
|
|
22
|
+
declare const tabIdFor: (groupId: string, value: string) => string;
|
|
23
|
+
|
|
24
|
+
/** The panel id a group looks for when a page does not label its panels: `tabpanel-<groupId>-<value>`, or `tabpanelx-<groupId>-<encoded value>` for a value with other characters, as {@link tabIdFor} derives the tab's. */
|
|
25
|
+
declare const tabPanelIdFor: (groupId: string, value: string) => string;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
declare function registerTab(element: HTMLElement, groupId: string, value: string): void;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
declare function findRegisteredPanel(tab: HTMLElement): HTMLElement | null;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
declare function syncTabControls(element: HTMLElement): void;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
declare function updateTabPanels(component: TabsHost): void;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
declare function syncTabStops(component: TabsHost): void;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
declare function setupKeyboardNavigation(component: TabsHost, options?: {
|
|
44
|
+
autoActivate?: boolean;
|
|
45
|
+
}): void;
|
|
46
|
+
|
|
47
|
+
/** Button methods the tab delegates to; each one is checked before use */
|
|
48
|
+
type TabButton = Partial<Pick<ButtonComponent, 'getValue' | 'setValue' | 'getText' | 'setText' | 'getIcon' | 'setIcon'>>;
|
|
49
|
+
|
|
50
|
+
/** Available tabs variants */
|
|
51
|
+
type TabsVariant = 'primary' | 'secondary';
|
|
52
|
+
|
|
53
|
+
/** Available tabs states */
|
|
54
|
+
type TabStates = 'active' | 'inactive' | 'disabled';
|
|
55
|
+
|
|
56
|
+
/** Configuration for the tab indicator */
|
|
57
|
+
interface IndicatorConfig {
|
|
58
|
+
/** Height of the indicator in pixels */
|
|
59
|
+
height?: number;
|
|
60
|
+
/** Width strategy for the indicator */
|
|
61
|
+
widthStrategy?: 'fixed' | 'dynamic' | 'content' | 'auto';
|
|
62
|
+
/** Fixed width in pixels (when using fixed strategy) */
|
|
63
|
+
fixedWidth?: number;
|
|
64
|
+
/** Animation duration in milliseconds */
|
|
65
|
+
animationDuration?: number;
|
|
66
|
+
/** Animation timing function */
|
|
67
|
+
animationTiming?: string;
|
|
68
|
+
/** Custom color for the indicator */
|
|
69
|
+
color?: string;
|
|
70
|
+
/** Whether the indicator shows; hide() and show() change it later */
|
|
71
|
+
visible?: boolean;
|
|
72
|
+
/** Tab variant (primary or secondary) */
|
|
73
|
+
variant?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Tab change event data interface */
|
|
77
|
+
interface TabChangeEventData {
|
|
78
|
+
/** The tab component that was activated */
|
|
79
|
+
tab: TabComponent;
|
|
80
|
+
/** The value of the activated tab, as `TabComponent.getValue()` returns it. */
|
|
81
|
+
value: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Events a single tab emits, and what each hands its handler. */
|
|
85
|
+
interface TabEvents {
|
|
86
|
+
click: (payload: ForwardedEventPayload<MouseEvent, HTMLElement>) => void;
|
|
87
|
+
focus: (event: FocusEvent) => void;
|
|
88
|
+
blur: (event: FocusEvent) => void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Events a tabs group emits. */
|
|
92
|
+
interface TabsEvents {
|
|
93
|
+
change: (event: TabChangeEventData) => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Configuration interface for a single Tab */
|
|
97
|
+
interface TabConfig {
|
|
98
|
+
/** Id of the tab group this tab belongs to. */
|
|
99
|
+
groupId?: string;
|
|
100
|
+
/** Accessible name for a tab. */
|
|
101
|
+
ariaLabel?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Tab state that determines if it's the active destination
|
|
104
|
+
* @default 'inactive'
|
|
105
|
+
*/
|
|
106
|
+
state?: TabStates | string;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the tab is initially disabled
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
/** Initial tab text content (label) */
|
|
113
|
+
text?: string;
|
|
114
|
+
/** Initial tab icon HTML content. */
|
|
115
|
+
icon?: string;
|
|
116
|
+
/** Badge text or value to display (if applicable) */
|
|
117
|
+
badge?: string | number;
|
|
118
|
+
/** Badge configuration object */
|
|
119
|
+
badgeConfig?: {
|
|
120
|
+
variant?: string;
|
|
121
|
+
color?: string;
|
|
122
|
+
size?: string;
|
|
123
|
+
position?: string;
|
|
124
|
+
max?: number;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Icon size in pixels or other CSS units
|
|
128
|
+
* @default '24px'
|
|
129
|
+
*/
|
|
130
|
+
iconSize?: string;
|
|
131
|
+
/** Additional CSS classes to add to the tab */
|
|
132
|
+
class?: string;
|
|
133
|
+
/** Tab value attribute for identifying the selected tab */
|
|
134
|
+
value?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether to enable ripple effect
|
|
137
|
+
* @default true
|
|
138
|
+
*/
|
|
139
|
+
ripple?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Component prefix for class names
|
|
142
|
+
* @default 'mtrl'
|
|
143
|
+
*/
|
|
144
|
+
prefix?: string;
|
|
145
|
+
/** Component name used in class generation */
|
|
146
|
+
componentName?: string;
|
|
147
|
+
/** Ripple effect configuration */
|
|
148
|
+
rippleConfig?: {
|
|
149
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
150
|
+
duration?: number;
|
|
151
|
+
};
|
|
152
|
+
/** Variant of the tab */
|
|
153
|
+
variant?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Configuration interface for the Tabs component */
|
|
157
|
+
interface TabsConfig {
|
|
158
|
+
/** Accessible name for the tablist when it has no visible label. */
|
|
159
|
+
ariaLabel?: string;
|
|
160
|
+
/** Id for this tab group, used to build each tab's element id as `tab-<groupId>-<value>` and to find panels as `tabpanel-<groupId>-<value>`; a value with characters outside `[A-Za-z0-9_-]` gets a derived id instead (`tabIdFor`, `tabPanelIdFor`, The group id itself is not encoded: keep a pinned one to `[A-Za-z0-9_]` (generated ones are), or `tabIdFor("a-b", "c")` and `tabIdFor("a", "b-c")` coincide and a space makes an unsafe id. */
|
|
161
|
+
groupId?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Whether an arrow key also selects the tab it moves to.
|
|
164
|
+
* @default false
|
|
165
|
+
*/
|
|
166
|
+
autoActivate?: boolean;
|
|
167
|
+
/** A behaviour to apply to the group while it is created, e.g. */
|
|
168
|
+
responsive?: (tabs: TabsComponent) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Tabs variant (primary or secondary)
|
|
171
|
+
* @default 'primary'
|
|
172
|
+
*/
|
|
173
|
+
variant?: TabsVariant | string;
|
|
174
|
+
/** Initial tabs to create */
|
|
175
|
+
tabs?: TabConfig[];
|
|
176
|
+
/**
|
|
177
|
+
* Whether to show the divider
|
|
178
|
+
* @default true
|
|
179
|
+
*/
|
|
180
|
+
showDivider?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Whether to enable horizontal scrolling
|
|
183
|
+
* @default true
|
|
184
|
+
*/
|
|
185
|
+
scrollable?: boolean;
|
|
186
|
+
/** Additional CSS classes for the container */
|
|
187
|
+
class?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Component prefix for class names
|
|
190
|
+
* @default 'mtrl'
|
|
191
|
+
*/
|
|
192
|
+
prefix?: string;
|
|
193
|
+
/** Event handlers registered when the tabs are created. */
|
|
194
|
+
on?: Partial<TabsEvents>;
|
|
195
|
+
/** Tab indicator configuration */
|
|
196
|
+
indicator?: IndicatorConfig;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
interface IconAPI {
|
|
201
|
+
|
|
202
|
+
setIcon: (html: string) => IconAPI;
|
|
203
|
+
|
|
204
|
+
getIcon: () => string;
|
|
205
|
+
|
|
206
|
+
getElement: () => HTMLElement | null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
interface TextAPI {
|
|
211
|
+
|
|
212
|
+
setText: (content: string) => TextAPI;
|
|
213
|
+
|
|
214
|
+
getText: () => string;
|
|
215
|
+
|
|
216
|
+
getElement: () => HTMLElement | null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Tab component interface */
|
|
220
|
+
interface TabComponent {
|
|
221
|
+
/** The tab's DOM element */
|
|
222
|
+
element: HTMLElement;
|
|
223
|
+
/** The button the tab is built on */
|
|
224
|
+
button?: TabButton;
|
|
225
|
+
/** The tab's badge component, or `undefined`. */
|
|
226
|
+
badge?: BadgeComponent | undefined;
|
|
227
|
+
/** Gets a class name with the component's prefix */
|
|
228
|
+
getClass: (name: string) => string;
|
|
229
|
+
/** Gets the tab's value attribute */
|
|
230
|
+
getValue: () => string;
|
|
231
|
+
/** Sets the tab's value attribute */
|
|
232
|
+
setValue: (value: string) => TabComponent;
|
|
233
|
+
/** Activates the tab (sets active state) */
|
|
234
|
+
activate: () => TabComponent;
|
|
235
|
+
/** Deactivates the tab (sets inactive state) */
|
|
236
|
+
deactivate: () => TabComponent;
|
|
237
|
+
/** Checks if the tab is active */
|
|
238
|
+
isActive: () => boolean;
|
|
239
|
+
/** Enables the tab (removes disabled attribute) */
|
|
240
|
+
enable: () => TabComponent;
|
|
241
|
+
/** Disables the tab (adds disabled attribute) */
|
|
242
|
+
disable: () => TabComponent;
|
|
243
|
+
/** Whether the tab is disabled */
|
|
244
|
+
isDisabled: () => boolean;
|
|
245
|
+
/** Sets the tab's text content */
|
|
246
|
+
setText: (content: string) => TabComponent;
|
|
247
|
+
/** Sets the explicit accessible label; undefined restores text/value naming. */
|
|
248
|
+
setAriaLabel: (label: string | undefined) => TabComponent;
|
|
249
|
+
/** Gets the tab's text content */
|
|
250
|
+
getText: () => string;
|
|
251
|
+
/** Sets the tab's icon */
|
|
252
|
+
setIcon: (icon: string) => TabComponent;
|
|
253
|
+
/** Gets the tab's icon HTML content */
|
|
254
|
+
getIcon: () => string;
|
|
255
|
+
/** Sets the tab's badge */
|
|
256
|
+
setBadge: (content: string | number) => TabComponent;
|
|
257
|
+
/** Gets the tab's badge content */
|
|
258
|
+
getBadge: () => string;
|
|
259
|
+
/** Shows the tab's badge */
|
|
260
|
+
showBadge: () => TabComponent;
|
|
261
|
+
/** Hides the tab's badge */
|
|
262
|
+
hideBadge: () => TabComponent;
|
|
263
|
+
/** Gets the badge component instance, or `undefined`: it may not exist */
|
|
264
|
+
getBadgeComponent: () => BadgeComponent | undefined;
|
|
265
|
+
/** Updates the tab's layout style based on content */
|
|
266
|
+
updateLayoutStyle: () => void;
|
|
267
|
+
/**
|
|
268
|
+
* Adds an event listener to the tab.
|
|
269
|
+
* @param event
|
|
270
|
+
* @param handler
|
|
271
|
+
*/
|
|
272
|
+
on: <K extends keyof TabEvents>(event: K, handler: TabEvents[K]) => TabComponent;
|
|
273
|
+
/**
|
|
274
|
+
* Removes an event listener from the tab
|
|
275
|
+
* @param event
|
|
276
|
+
* @param handler
|
|
277
|
+
*/
|
|
278
|
+
off: <K extends keyof TabEvents>(event: K, handler: TabEvents[K]) => TabComponent;
|
|
279
|
+
/** Destroys the tab component and cleans up resources */
|
|
280
|
+
destroy: () => void;
|
|
281
|
+
/** API for managing disabled state */
|
|
282
|
+
disabled?: {
|
|
283
|
+
enable: () => void;
|
|
284
|
+
disable: () => void;
|
|
285
|
+
isDisabled: () => boolean;
|
|
286
|
+
};
|
|
287
|
+
/** API for managing component lifecycle */
|
|
288
|
+
lifecycle?: {
|
|
289
|
+
destroy: () => void;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Tabs component interface */
|
|
294
|
+
interface TabsComponent {
|
|
295
|
+
/** Container element */
|
|
296
|
+
element: HTMLElement;
|
|
297
|
+
/**
|
|
298
|
+
* Gets a class name with the component's prefix
|
|
299
|
+
* @param name
|
|
300
|
+
*/
|
|
301
|
+
getClass: (name: string) => string;
|
|
302
|
+
/**
|
|
303
|
+
* Creates and adds a new tab to the tabs component
|
|
304
|
+
* @param config
|
|
305
|
+
*/
|
|
306
|
+
addTab: (config: TabConfig) => TabComponent;
|
|
307
|
+
/**
|
|
308
|
+
* Adds a pre-created tab to the tabs component
|
|
309
|
+
* @param tab
|
|
310
|
+
*/
|
|
311
|
+
add: (tab: TabComponent) => TabsComponent;
|
|
312
|
+
/** Gets all tabs in the container */
|
|
313
|
+
getTabs: () => TabComponent[];
|
|
314
|
+
/** Gets the active tab */
|
|
315
|
+
getActiveTab: () => TabComponent | null;
|
|
316
|
+
/** Reads the current model value without changing selection. */
|
|
317
|
+
getValue: () => string | null;
|
|
318
|
+
/** Gets the indicator component */
|
|
319
|
+
getIndicator?: () => TabIndicator;
|
|
320
|
+
/**
|
|
321
|
+
* Sets a tab as active.
|
|
322
|
+
* @param tabOrValue
|
|
323
|
+
*/
|
|
324
|
+
setActiveTab: (tabOrValue: TabComponent | string) => TabsComponent;
|
|
325
|
+
/**
|
|
326
|
+
* Removes a tab from the container
|
|
327
|
+
* @param tabOrValue
|
|
328
|
+
*/
|
|
329
|
+
removeTab: (tabOrValue: TabComponent | string) => TabsComponent;
|
|
330
|
+
/**
|
|
331
|
+
* Adds an event listener.
|
|
332
|
+
* @param event
|
|
333
|
+
* @param handler
|
|
334
|
+
*/
|
|
335
|
+
on: <K extends keyof TabsEvents>(event: K, handler: TabsEvents[K]) => TabsComponent;
|
|
336
|
+
/**
|
|
337
|
+
* Removes an event listener
|
|
338
|
+
* @param event
|
|
339
|
+
* @param handler
|
|
340
|
+
*/
|
|
341
|
+
off: <K extends keyof TabsEvents>(event: K, handler: TabsEvents[K]) => TabsComponent;
|
|
342
|
+
/**
|
|
343
|
+
* Emit one of the group's own events ({@link TabsEvents}), with its payload: the names and payloads `on` and `off` accept.
|
|
344
|
+
* @param event
|
|
345
|
+
* @param data
|
|
346
|
+
*/
|
|
347
|
+
emit?<K extends keyof TabsEvents>(event: K, data: Parameters<TabsEvents[K]>[0]): this;
|
|
348
|
+
/** Destroys the tabs component and all tabs */
|
|
349
|
+
destroy: () => void;
|
|
350
|
+
/** Activation handler shared by the component's click and keyboard paths. */
|
|
351
|
+
handleTabClick: (event: Event | null, tab: TabComponent) => void;
|
|
352
|
+
/** Scroll container owned by the scrollable feature. */
|
|
353
|
+
scrollContainer?: HTMLElement;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Creates a new Tab component following MD3 guidelines
|
|
358
|
+
* @param config
|
|
359
|
+
*/
|
|
360
|
+
/** Point a tab at its panel, but only when that panel exists. */
|
|
361
|
+
declare const createTab: (config?: TabConfig) => TabComponent;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Creates a new Tabs component following MD3 guidelines
|
|
365
|
+
* @param config
|
|
366
|
+
*/
|
|
367
|
+
declare const createTabs: (config?: TabsConfig) => TabsComponent;
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
interface TabIndicatorConfig {
|
|
371
|
+
|
|
372
|
+
height?: number;
|
|
373
|
+
|
|
374
|
+
widthStrategy?: 'fixed' | 'dynamic' | 'content' | 'auto';
|
|
375
|
+
|
|
376
|
+
fixedWidth?: number;
|
|
377
|
+
|
|
378
|
+
animationDuration?: number;
|
|
379
|
+
|
|
380
|
+
animationTiming?: string;
|
|
381
|
+
|
|
382
|
+
visible?: boolean;
|
|
383
|
+
|
|
384
|
+
prefix?: string;
|
|
385
|
+
|
|
386
|
+
color?: string;
|
|
387
|
+
|
|
388
|
+
variant?: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** Tab indicator API */
|
|
392
|
+
interface TabIndicator {
|
|
393
|
+
/** The indicator DOM element */
|
|
394
|
+
element: HTMLElement;
|
|
395
|
+
/** Move the indicator to a specific tab */
|
|
396
|
+
moveToTab: (tab: TabComponent, immediate?: boolean) => void;
|
|
397
|
+
/** Show the indicator */
|
|
398
|
+
show: () => void;
|
|
399
|
+
/** Hide the indicator */
|
|
400
|
+
hide: () => void;
|
|
401
|
+
/** Set indicator color */
|
|
402
|
+
setColor: (color: string) => void;
|
|
403
|
+
/** Update indicator position (e.g. */
|
|
404
|
+
update: () => void;
|
|
405
|
+
/** Destroy the indicator and clean up */
|
|
406
|
+
destroy: () => void;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
declare const createTabIndicator: (config?: TabIndicatorConfig) => TabIndicator;
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
declare const RESPONSIVE_BREAKPOINTS: {
|
|
414
|
+
|
|
415
|
+
SMALL: number;
|
|
416
|
+
|
|
417
|
+
MEDIUM: number;
|
|
418
|
+
|
|
419
|
+
LARGE: number;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
/** Configuration for responsive behavior */
|
|
423
|
+
interface ResponsiveConfig {
|
|
424
|
+
/** Whether to enable responsive behavior */
|
|
425
|
+
responsive?: boolean;
|
|
426
|
+
/** Options for small screens */
|
|
427
|
+
smallScreen?: {
|
|
428
|
+
/**
|
|
429
|
+
* Layout below the small breakpoint: `icon-only` hides the labels of tabs that have an icon (the label still names the tab), `text-only` hides the icons of tabs that have a label, `icon-and-text` keeps every tab as built.
|
|
430
|
+
* @default 'icon-only'
|
|
431
|
+
*/
|
|
432
|
+
layout?: 'icon-only' | 'text-only' | 'icon-and-text';
|
|
433
|
+
};
|
|
434
|
+
/** Breakpoints. */
|
|
435
|
+
breakpoints?: {
|
|
436
|
+
small?: number;
|
|
437
|
+
medium?: number;
|
|
438
|
+
large?: number;
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Enhances tabs with responsive behavior.
|
|
444
|
+
* @deprecated Pass `tabsResponsive(config)` from
|
|
445
|
+
* `material/components/tabs/responsive` as createTabs's `responsive` option
|
|
446
|
+
* instead: it takes this configuration and applies this behaviour. This
|
|
447
|
+
* function keeps working in 3.x and is removed in 4.0.
|
|
448
|
+
* @param tabs
|
|
449
|
+
* @param config
|
|
450
|
+
*/
|
|
451
|
+
declare const setupResponsiveBehavior: (tabs: TabsComponent, config?: ResponsiveConfig) => void;
|
|
452
|
+
export type { IndicatorConfig, ResponsiveConfig, TabChangeEventData, TabComponent, TabConfig, TabEvents, TabIndicator, TabsComponent, TabsConfig, TabsEvents, TabsVariant };
|
|
453
|
+
export { createTab, createTabs, createTabs as default, setupResponsiveBehavior, tabIdFor, tabPanelIdFor };
|
|
454
|
+
export { TABS_CLASSES, TABS_DEFAULTS, TABS_EVENTS, TAB_CLASSES, TAB_EVENTS, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_STATES, TAB_VARIANTS } from "./constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import createTabs from "./tabs.js";
|
|
2
|
-
import { setupResponsiveBehavior } from "./responsive.js";
|
|
2
|
+
import { setupResponsiveBehavior } from "./responsive-legacy.js";
|
|
3
3
|
import { tabIdFor, tabPanelIdFor } from "./utils.js";
|
|
4
4
|
export { TAB_VARIANTS, TAB_STATES, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_EVENTS, TABS_EVENTS, TABS_DEFAULTS, TABS_CLASSES, TAB_CLASSES, } from "./constants.js";
|
|
5
5
|
export { setupResponsiveBehavior };
|