material 3.2.6 → 3.3.0
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 +1 -1
- package/dist/components/badge/badge.d.ts +0 -59
- package/dist/components/badge/constants.d.ts +0 -15
- package/dist/components/badge/index.d.ts +0 -6
- package/dist/components/badge/types.d.ts +0 -244
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +0 -10
- package/dist/components/bottom-app-bar/constants.d.ts +0 -9
- package/dist/components/bottom-app-bar/index.d.ts +0 -4
- package/dist/components/bottom-app-bar/types.d.ts +0 -76
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -21
- package/dist/components/bottom-sheet/constants.d.ts +0 -29
- package/dist/components/bottom-sheet/types.d.ts +0 -89
- package/dist/components/button/button.d.ts +0 -62
- package/dist/components/button/constants.d.ts +0 -41
- package/dist/components/button/index.d.ts +0 -4
- package/dist/components/button/types.d.ts +0 -347
- package/dist/components/button-group/button-group.d.ts +0 -51
- package/dist/components/button-group/constants.d.ts +0 -83
- package/dist/components/button-group/index.d.ts +0 -10
- package/dist/components/button-group/types.d.ts +0 -234
- package/dist/components/card/card.d.ts +0 -64
- package/dist/components/card/constants.d.ts +0 -33
- package/dist/components/card/content.d.ts +0 -86
- package/dist/components/card/index.d.ts +0 -66
- package/dist/components/card/types.d.ts +0 -366
- package/dist/components/carousel/carousel.d.ts +0 -22
- package/dist/components/carousel/constants.d.ts +0 -16
- package/dist/components/carousel/types.d.ts +0 -29
- package/dist/components/checkbox/checkbox.d.ts +0 -61
- package/dist/components/checkbox/constants.d.ts +0 -33
- package/dist/components/checkbox/index.d.ts +0 -25
- package/dist/components/checkbox/types.d.ts +0 -206
- package/dist/components/chips/chips.d.ts +0 -14
- package/dist/components/chips/constants.d.ts +0 -1
- package/dist/components/chips/factories.d.ts +0 -4
- package/dist/components/chips/types.d.ts +0 -278
- package/dist/components/datepicker/constants.d.ts +0 -56
- package/dist/components/datepicker/datepicker.d.ts +0 -5
- package/dist/components/datepicker/types.d.ts +12 -257
- package/dist/components/dialog/constants.d.ts +0 -65
- package/dist/components/dialog/dialog.d.ts +0 -86
- package/dist/components/dialog/index.d.ts +0 -12
- package/dist/components/dialog/types.d.ts +0 -511
- package/dist/components/divider/config.d.ts +0 -130
- package/dist/components/divider/constants.d.ts +0 -27
- package/dist/components/divider/divider.d.ts +0 -36
- package/dist/components/divider/index.d.ts +0 -29
- package/dist/components/divider/types.d.ts +0 -126
- package/dist/components/drawer/constants.d.ts +0 -53
- package/dist/components/drawer/drawer.d.ts +0 -56
- package/dist/components/drawer/index.d.ts +0 -4
- package/dist/components/drawer/types.d.ts +0 -200
- package/dist/components/extended-fab/config.js +3 -2
- package/dist/components/extended-fab/constants.d.ts +0 -46
- package/dist/components/extended-fab/extended-fab.d.ts +0 -58
- package/dist/components/extended-fab/index.d.ts +1 -35
- package/dist/components/extended-fab/types.d.ts +2 -654
- package/dist/components/fab/config.js +3 -2
- package/dist/components/fab/constants.d.ts +0 -40
- package/dist/components/fab/fab.d.ts +0 -42
- package/dist/components/fab/index.d.ts +1 -34
- package/dist/components/fab/types.d.ts +2 -543
- package/dist/components/fab-menu/constants.d.ts +0 -22
- package/dist/components/fab-menu/fab-menu.d.ts +0 -36
- package/dist/components/fab-menu/types.d.ts +0 -80
- package/dist/components/icon-button/constants.d.ts +0 -90
- package/dist/components/icon-button/icon-button.d.ts +0 -83
- package/dist/components/icon-button/index.d.ts +0 -44
- package/dist/components/icon-button/types.d.ts +0 -314
- package/dist/components/index.d.ts +0 -9
- package/dist/components/list/constants.d.ts +0 -47
- package/dist/components/list/index.d.ts +0 -1
- package/dist/components/list/list.d.ts +0 -26
- package/dist/components/list/types.d.ts +0 -263
- package/dist/components/loading-indicator/constants.d.ts +0 -35
- package/dist/components/loading-indicator/features/renderer.d.ts +0 -14
- package/dist/components/loading-indicator/loading-indicator.d.ts +0 -6
- package/dist/components/loading-indicator/types.d.ts +0 -35
- package/dist/components/menu/constants.d.ts +0 -79
- package/dist/components/menu/index.d.ts +0 -25
- package/dist/components/menu/inner.d.ts +0 -3
- package/dist/components/menu/menu.d.ts +0 -26
- package/dist/components/menu/types.d.ts +0 -423
- package/dist/components/navigation-bar/navigation-bar.d.ts +0 -7
- package/dist/components/navigation-bar/types.d.ts +0 -25
- package/dist/components/navigation-rail/constants.d.ts +0 -2
- package/dist/components/navigation-rail/navigation-rail.d.ts +0 -5
- package/dist/components/navigation-rail/types.d.ts +0 -22
- package/dist/components/progress/constants.d.ts +24 -56
- package/dist/components/progress/progress.d.ts +0 -21
- package/dist/components/progress/types.d.ts +0 -251
- package/dist/components/radios/constants.d.ts +0 -22
- package/dist/components/radios/radios.d.ts +0 -5
- package/dist/components/radios/types.d.ts +0 -142
- package/dist/components/search/constants.d.ts +0 -59
- package/dist/components/search/search.d.ts +0 -32
- package/dist/components/search/types.d.ts +0 -159
- package/dist/components/select/constants.d.ts +0 -60
- package/dist/components/select/index.d.ts +0 -22
- package/dist/components/select/select.d.ts +0 -33
- package/dist/components/select/types.d.ts +0 -241
- package/dist/components/side-sheet/constants.d.ts +0 -28
- package/dist/components/side-sheet/side-sheet.d.ts +0 -21
- package/dist/components/side-sheet/types.d.ts +0 -82
- package/dist/components/slider/constants.d.ts +0 -86
- package/dist/components/slider/slider.d.ts +0 -16
- package/dist/components/slider/types.d.ts +0 -184
- package/dist/components/snackbar/constants.d.ts +0 -73
- package/dist/components/snackbar/snackbar.d.ts +0 -13
- package/dist/components/snackbar/types.d.ts +0 -147
- package/dist/components/split-button/constants.d.ts +0 -33
- package/dist/components/split-button/split-button.d.ts +0 -21
- package/dist/components/split-button/types.d.ts +0 -81
- package/dist/components/switch/constants.d.ts +0 -49
- package/dist/components/switch/switch.d.ts +0 -5
- package/dist/components/switch/types.d.ts +0 -80
- package/dist/components/tabs/constants.d.ts +0 -76
- package/dist/components/tabs/indicator.d.ts +0 -27
- package/dist/components/tabs/responsive.d.ts +0 -30
- package/dist/components/tabs/tab.d.ts +0 -13
- package/dist/components/tabs/tabs.d.ts +0 -24
- package/dist/components/tabs/types.d.ts +0 -335
- package/dist/components/tabs/utils.d.ts +0 -66
- package/dist/components/text-field/constants.d.ts +0 -82
- package/dist/components/text-field/features/trailing-icon.d.ts +0 -61
- package/dist/components/text-field/text-field.d.ts +0 -33
- package/dist/components/text-field/types.d.ts +0 -123
- package/dist/components/timepicker/constants.d.ts +0 -88
- package/dist/components/timepicker/types.d.ts +0 -268
- package/dist/components/toolbar/constants.d.ts +0 -27
- package/dist/components/toolbar/toolbar.d.ts +0 -25
- package/dist/components/toolbar/types.d.ts +0 -102
- package/dist/components/tooltip/constants.d.ts +0 -58
- package/dist/components/tooltip/tooltip.d.ts +0 -5
- package/dist/components/tooltip/types.d.ts +0 -140
- package/dist/components/top-app-bar/constants.d.ts +0 -41
- package/dist/components/top-app-bar/index.d.ts +0 -4
- package/dist/components/top-app-bar/top-app-bar.d.ts +0 -10
- package/dist/components/top-app-bar/types.d.ts +0 -94
- package/dist/core/canvas/animation.d.ts +0 -13
- package/dist/core/canvas/drawing.d.ts +18 -55
- package/dist/core/canvas/index.d.ts +0 -4
- package/dist/core/canvas/resize.d.ts +0 -13
- package/dist/core/canvas/utils.d.ts +0 -62
- package/dist/core/compose/base.d.ts +0 -22
- package/dist/core/compose/cleanup.d.ts +0 -2
- package/dist/core/compose/component.d.ts +0 -31
- package/dist/core/compose/features/badge.d.ts +0 -25
- package/dist/core/compose/features/checkable.d.ts +0 -36
- package/dist/core/compose/features/debounce.d.ts +0 -57
- package/dist/core/compose/features/disabled.d.ts +0 -31
- package/dist/core/compose/features/events.d.ts +0 -38
- package/dist/core/compose/features/icon.d.ts +0 -49
- package/dist/core/compose/features/input.d.ts +0 -82
- package/dist/core/compose/features/lifecycle.d.ts +0 -36
- package/dist/core/compose/features/position.d.ts +0 -27
- package/dist/core/compose/features/ripple.d.ts +0 -29
- package/dist/core/compose/features/size.d.ts +0 -9
- package/dist/core/compose/features/style.d.ts +0 -9
- package/dist/core/compose/features/text.d.ts +0 -45
- package/dist/core/compose/features/textinput.d.ts +0 -88
- package/dist/core/compose/features/textlabel.d.ts +0 -44
- package/dist/core/compose/features/throttle.d.ts +0 -54
- package/dist/core/compose/features/track.d.ts +0 -34
- package/dist/core/compose/features/variant.d.ts +0 -9
- package/dist/core/compose/features/withEvents.d.ts +0 -30
- package/dist/core/compose/index.d.ts +0 -4
- package/dist/core/compose/pipe.d.ts +0 -55
- package/dist/core/compose/utils/type-guards.d.ts +0 -15
- package/dist/core/config/component.d.ts +0 -45
- package/dist/core/config/global.d.ts +0 -43
- package/dist/core/config.d.ts +0 -59
- package/dist/core/dom/attributes.d.ts +0 -41
- package/dist/core/dom/classes.d.ts +0 -49
- package/dist/core/dom/create.d.ts +0 -98
- package/dist/core/dom/events.d.ts +0 -52
- package/dist/core/dom/focus.d.ts +0 -32
- package/dist/core/dom/html.d.ts +0 -24
- package/dist/core/dom/layer.d.ts +0 -98
- package/dist/core/dom/roving.d.ts +0 -19
- package/dist/core/index.d.ts +0 -9
- package/dist/core/navigation/destinations.d.ts +0 -23
- package/dist/core/shapes/cubic.d.ts +24 -19
- package/dist/core/shapes/material.d.ts +0 -64
- package/dist/core/shapes/polygon.d.ts +6 -16
- package/dist/core/state/emitter.d.ts +0 -36
- package/dist/core/state/events.d.ts +0 -29
- package/dist/core/state/store.d.ts +0 -70
- package/dist/core/theme/index.d.ts +0 -3
- package/dist/core/theme/shape.d.ts +0 -7
- package/dist/core/theme/tokens.d.ts +48 -32
- package/dist/core/utils/background.d.ts +0 -29
- package/dist/core/utils/color.d.ts +0 -13
- package/dist/core/utils/index.d.ts +0 -11
- package/dist/core/utils/mobile.d.ts +0 -31
- package/dist/core/utils/object.d.ts +0 -11
- package/dist/core/utils/performance.d.ts +0 -70
- package/dist/core/utils/theme.d.ts +0 -36
- package/dist/core/utils/url.d.ts +0 -17
- package/dist/elements/adapter.d.ts +13 -62
- package/dist/elements/badge.d.ts +0 -17
- package/dist/elements/bottom-app-bar.d.ts +7 -17
- package/dist/elements/bottom-sheet.d.ts +9 -38
- package/dist/elements/button-group.d.ts +0 -31
- package/dist/elements/button.d.ts +24 -18
- package/dist/elements/button.js +12 -0
- package/dist/elements/card.d.ts +12 -24
- package/dist/elements/card.js +3 -2
- package/dist/elements/carousel.d.ts +5 -29
- package/dist/elements/checkbox.d.ts +5 -15
- package/dist/elements/chips.d.ts +0 -33
- package/dist/elements/css/extended-fab.css +1 -1
- package/dist/elements/css/extended-fab.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/fab.css +1 -1
- package/dist/elements/css/fab.js +1 -1
- package/dist/elements/css/hosts/extended-fab.css +1 -1
- package/dist/elements/css/hosts/fab.css +1 -1
- package/dist/elements/datepicker.d.ts +4 -48
- package/dist/elements/define.d.ts +3 -161
- package/dist/elements/dialog.d.ts +8 -39
- package/dist/elements/divider.d.ts +0 -14
- package/dist/elements/drawer.d.ts +0 -35
- package/dist/elements/extended-fab.d.ts +10 -18
- package/dist/elements/extended-fab.js +3 -1
- package/dist/elements/fab-menu.d.ts +5 -30
- package/dist/elements/fab.d.ts +8 -17
- package/dist/elements/fab.js +3 -1
- package/dist/elements/floating-placement.js +1 -0
- package/dist/elements/icon-button.d.ts +5 -26
- package/dist/elements/index.d.ts +0 -16
- package/dist/elements/list.d.ts +0 -34
- package/dist/elements/loading-indicator.d.ts +4 -13
- package/dist/elements/menu.d.ts +5 -51
- package/dist/elements/navigation-bar.d.ts +4 -29
- package/dist/elements/navigation-rail.d.ts +8 -49
- 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 +2 -2
- package/dist/elements/preupgrade/card.css +2 -2
- 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 +2 -2
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +2 -2
- 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 +2 -2
- package/dist/elements/preupgrade.d.ts +0 -1
- package/dist/elements/preupgrade.js +1 -1
- package/dist/elements/progress.d.ts +0 -15
- package/dist/elements/radios.d.ts +0 -22
- package/dist/elements/search.d.ts +5 -53
- package/dist/elements/select.d.ts +0 -31
- package/dist/elements/side-sheet.d.ts +7 -29
- package/dist/elements/slider.d.ts +3 -22
- package/dist/elements/snackbar.d.ts +4 -28
- package/dist/elements/split-button.d.ts +0 -30
- package/dist/elements/styles.d.ts +0 -63
- package/dist/elements/switch.d.ts +5 -17
- package/dist/elements/tabs.d.ts +0 -22
- package/dist/elements/text-field.d.ts +4 -38
- package/dist/elements/timepicker.d.ts +4 -44
- package/dist/elements/toolbar.d.ts +8 -25
- package/dist/elements/tooltip.d.ts +4 -30
- package/dist/elements/top-app-bar.d.ts +7 -23
- package/dist/index.d.ts +0 -11
- package/dist/package.json +1 -1
- package/dist/react/create.d.ts +0 -42
- package/dist/react/index.d.ts +0 -6
- package/dist/react/jsx.d.ts +0 -13
- package/dist/solid/create.d.ts +0 -48
- package/dist/solid/index.d.ts +0 -6
- package/dist/solid/jsx.d.ts +1 -10
- package/dist/ssr/index.d.ts +0 -49
- package/dist/ssr/solid.d.ts +0 -4
- package/dist/ssr/svelte.d.ts +0 -4
- package/dist/ssr/vue.d.ts +0 -4
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base.css +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/extended-fab.css +2 -2
- package/dist/styles/fab-menu.css +2 -2
- package/dist/styles/fab.css +2 -2
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +1 -1
- 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 +1 -1
- package/dist/styles/slider.css +1 -1
- 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 +1 -1
- package/dist/styles/timepicker.css +1 -1
- 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/Button.svelte +5 -4
- package/dist/svelte/runtime.d.ts +8 -62
- 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 +15 -58
- package/dist/vue/index.d.ts +0 -6
- package/package.json +1 -1
- package/src/styles/abstract/_floating-placement.scss +12 -0
- package/src/styles/components/_extended-fab.scss +34 -8
- package/src/styles/components/_fab-menu.scss +58 -8
- package/src/styles/components/_fab.scss +34 -8
- package/src/styles/elements/_button.scss +27 -5
- package/src/styles/elements/_card.scss +14 -0
- package/src/styles/elements/_extended-fab.scss +2 -0
- package/src/styles/elements/_fab.scss +2 -0
- package/dist/components/badge/api.d.ts +0 -41
- package/dist/components/badge/config.d.ts +0 -631
- package/dist/components/badge/features.d.ts +0 -38
- package/dist/components/bottom-app-bar/config.d.ts +0 -16
- package/dist/components/bottom-sheet/api.d.ts +0 -44
- package/dist/components/bottom-sheet/config.d.ts +0 -547
- package/dist/components/bottom-sheet/features/drag.d.ts +0 -35
- package/dist/components/bottom-sheet/features/index.d.ts +0 -3
- package/dist/components/bottom-sheet/features/state.d.ts +0 -31
- package/dist/components/bottom-sheet/features/structure.d.ts +0 -26
- package/dist/components/button/api.d.ts +0 -68
- package/dist/components/button/config.d.ts +0 -594
- package/dist/components/button/features/progress.d.ts +0 -43
- package/dist/components/button/features/toggle.d.ts +0 -43
- package/dist/components/button-group/config.d.ts +0 -147
- package/dist/components/card/api.d.ts +0 -24
- package/dist/components/card/config.d.ts +0 -635
- package/dist/components/card/features.d.ts +0 -124
- package/dist/components/carousel/api.d.ts +0 -20
- package/dist/components/carousel/arrangement.d.ts +0 -23
- package/dist/components/carousel/config.d.ts +0 -540
- package/dist/components/carousel/features/index.d.ts +0 -2
- package/dist/components/carousel/features/scroll.d.ts +0 -20
- package/dist/components/carousel/features/slides.d.ts +0 -18
- package/dist/components/carousel/keylines.d.ts +0 -68
- package/dist/components/carousel/strategy.d.ts +0 -36
- package/dist/components/checkbox/api.d.ts +0 -7
- package/dist/components/checkbox/config.d.ts +0 -568
- package/dist/components/chips/api.d.ts +0 -62
- package/dist/components/chips/chip/chip.d.ts +0 -4
- package/dist/components/chips/chip/constants.d.ts +0 -38
- package/dist/components/chips/chip/index.d.ts +0 -1
- package/dist/components/chips/config.d.ts +0 -583
- package/dist/components/chips/features/chip-items.d.ts +0 -39
- package/dist/components/chips/features/container.d.ts +0 -75
- package/dist/components/chips/features/controller.d.ts +0 -61
- package/dist/components/chips/features/dom.d.ts +0 -24
- package/dist/components/chips/features/index.d.ts +0 -4
- package/dist/components/chips/schema.d.ts +0 -35
- package/dist/components/datepicker/api.d.ts +0 -7
- package/dist/components/datepicker/config.d.ts +0 -542
- package/dist/components/datepicker/render.d.ts +0 -3
- package/dist/components/datepicker/utils.d.ts +0 -84
- package/dist/components/dialog/api.d.ts +0 -66
- package/dist/components/dialog/config.d.ts +0 -583
- package/dist/components/dialog/features.d.ts +0 -42
- package/dist/components/divider/features.d.ts +0 -6
- package/dist/components/drawer/api.d.ts +0 -55
- package/dist/components/drawer/config.d.ts +0 -620
- package/dist/components/drawer/features/headline.d.ts +0 -27
- package/dist/components/drawer/features/index.d.ts +0 -3
- package/dist/components/drawer/features/items.d.ts +0 -32
- package/dist/components/drawer/features/state.d.ts +0 -22
- package/dist/components/extended-fab/api.d.ts +0 -96
- package/dist/components/extended-fab/config.d.ts +0 -600
- package/dist/components/fab/api.d.ts +0 -74
- package/dist/components/fab/config.d.ts +0 -596
- package/dist/components/fab-menu/config.d.ts +0 -11
- package/dist/components/fab-menu/stagger.d.ts +0 -10
- package/dist/components/icon-button/api.d.ts +0 -84
- package/dist/components/icon-button/config.d.ts +0 -624
- package/dist/components/icon-button/features/toggle.d.ts +0 -133
- package/dist/components/list/api.d.ts +0 -156
- package/dist/components/list/config.d.ts +0 -625
- package/dist/components/list/features/anatomy.d.ts +0 -6
- package/dist/components/list/features/index.d.ts +0 -2
- package/dist/components/list/features/renderer.d.ts +0 -8
- package/dist/components/list/features/selection.d.ts +0 -3
- package/dist/components/loading-indicator/api.d.ts +0 -14
- package/dist/components/loading-indicator/config.d.ts +0 -557
- package/dist/components/loading-indicator/features/motion.d.ts +0 -22
- package/dist/components/menu/api.d.ts +0 -63
- package/dist/components/menu/config.d.ts +0 -576
- package/dist/components/menu/features/controller.d.ts +0 -15
- package/dist/components/menu/features/index.d.ts +0 -5
- package/dist/components/menu/features/keyboard.d.ts +0 -23
- package/dist/components/menu/features/layer.d.ts +0 -15
- package/dist/components/menu/features/loader.d.ts +0 -35
- package/dist/components/menu/features/opener.d.ts +0 -16
- package/dist/components/menu/features/position.d.ts +0 -18
- package/dist/components/menu/features/registry.d.ts +0 -37
- package/dist/components/menu/features/submenu.d.ts +0 -28
- package/dist/components/menu/features/tasks.d.ts +0 -9
- package/dist/components/navigation-bar/config.d.ts +0 -2
- package/dist/components/navigation-rail/config.d.ts +0 -2
- package/dist/components/progress/api.d.ts +0 -81
- package/dist/components/progress/config.d.ts +0 -620
- package/dist/components/progress/features/canvas.d.ts +0 -60
- package/dist/components/progress/features/circular.d.ts +0 -19
- package/dist/components/progress/features/colors.d.ts +0 -17
- package/dist/components/progress/features/index.d.ts +0 -8
- package/dist/components/progress/features/linear.d.ts +0 -25
- package/dist/components/progress/features/motion.d.ts +0 -43
- package/dist/components/progress/features/resize-observer.d.ts +0 -5
- package/dist/components/progress/features/state.d.ts +0 -44
- package/dist/components/radios/api.d.ts +0 -37
- package/dist/components/radios/config.d.ts +0 -568
- package/dist/components/radios/radio.d.ts +0 -26
- package/dist/components/search/api.d.ts +0 -63
- package/dist/components/search/config.d.ts +0 -657
- package/dist/components/search/features/index.d.ts +0 -4
- package/dist/components/search/features/input.d.ts +0 -93
- package/dist/components/search/features/states.d.ts +0 -111
- package/dist/components/search/features/structure.d.ts +0 -16
- package/dist/components/search/features/suggestions.d.ts +0 -60
- package/dist/components/select/api.d.ts +0 -8
- package/dist/components/select/config.d.ts +0 -18
- package/dist/components/select/features.d.ts +0 -14
- package/dist/components/side-sheet/api.d.ts +0 -34
- package/dist/components/side-sheet/config.d.ts +0 -547
- package/dist/components/side-sheet/features/index.d.ts +0 -2
- package/dist/components/side-sheet/features/state.d.ts +0 -28
- package/dist/components/side-sheet/features/structure.d.ts +0 -21
- package/dist/components/slider/api.d.ts +0 -65
- package/dist/components/slider/config.d.ts +0 -605
- package/dist/components/slider/features/axis.d.ts +0 -42
- package/dist/components/slider/features/controller.d.ts +0 -528
- package/dist/components/slider/features/dom.d.ts +0 -22
- package/dist/components/slider/features/handlers.d.ts +0 -16
- package/dist/components/slider/features/index.d.ts +0 -5
- package/dist/components/slider/features/range.d.ts +0 -14
- package/dist/components/slider/features/states.d.ts +0 -76
- package/dist/components/slider/features/tracks.d.ts +0 -50
- package/dist/components/snackbar/api.d.ts +0 -7
- package/dist/components/snackbar/config.d.ts +0 -596
- package/dist/components/snackbar/features.d.ts +0 -26
- package/dist/components/snackbar/layer.d.ts +0 -23
- package/dist/components/snackbar/position.d.ts +0 -16
- package/dist/components/snackbar/queue.d.ts +0 -15
- package/dist/components/split-button/api.d.ts +0 -14
- package/dist/components/split-button/config.d.ts +0 -553
- package/dist/components/split-button/features/buttons.d.ts +0 -8
- package/dist/components/split-button/features/menu.d.ts +0 -10
- package/dist/components/switch/api.d.ts +0 -7
- package/dist/components/switch/config.d.ts +0 -558
- package/dist/components/switch/features.d.ts +0 -63
- package/dist/components/tabs/api.d.ts +0 -54
- package/dist/components/tabs/config.d.ts +0 -31
- package/dist/components/tabs/features.d.ts +0 -131
- package/dist/components/tabs/scroll-indicators.d.ts +0 -18
- package/dist/components/tabs/state.d.ts +0 -48
- package/dist/components/text-field/api.d.ts +0 -29
- package/dist/components/text-field/config.d.ts +0 -560
- package/dist/components/text-field/features/counter.d.ts +0 -29
- package/dist/components/text-field/features/density.d.ts +0 -28
- package/dist/components/text-field/features/error.d.ts +0 -55
- package/dist/components/text-field/features/field.d.ts +0 -37
- package/dist/components/text-field/features/index.d.ts +0 -20
- package/dist/components/text-field/features/leading-icon.d.ts +0 -68
- package/dist/components/text-field/features/placement.d.ts +0 -30
- package/dist/components/text-field/features/prefix-text.d.ts +0 -67
- package/dist/components/text-field/features/required.d.ts +0 -33
- package/dist/components/text-field/features/suffix-text.d.ts +0 -67
- package/dist/components/text-field/features/supporting-text.d.ts +0 -59
- package/dist/components/timepicker/api.d.ts +0 -26
- package/dist/components/timepicker/config.d.ts +0 -570
- package/dist/components/timepicker/dial.d.ts +0 -35
- package/dist/components/timepicker/render.d.ts +0 -9
- package/dist/components/timepicker/utils.d.ts +0 -55
- package/dist/components/toolbar/config.d.ts +0 -19
- package/dist/components/tooltip/api.d.ts +0 -18
- package/dist/components/tooltip/config.d.ts +0 -563
- package/dist/components/top-app-bar/config.d.ts +0 -16
- package/dist/core/compose/features/constants.d.ts +0 -8
- package/dist/core/dom/direction.d.ts +0 -16
- package/dist/core/dom/form-value.d.ts +0 -24
- package/dist/core/dom/utils.d.ts +0 -33
- package/dist/core/navigation/ripple.d.ts +0 -2
- package/dist/core/utils/attributes.d.ts +0 -29
- package/dist/core/utils/validate.d.ts +0 -73
- package/dist/core/utils/warn.d.ts +0 -16
- package/dist/elements/form-button.d.ts +0 -29
- package/dist/elements/lifecycle.d.ts +0 -4
- package/dist/elements/sheet.d.ts +0 -44
- package/dist/react/shadow.d.ts +0 -2
- package/dist/solid/shadow.d.ts +0 -3
- package/dist/vue/shadow.d.ts +0 -7
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Menu component module
|
|
3
|
-
*
|
|
4
|
-
* The Menu component provides a Material Design 3 compliant dropdown menu
|
|
5
|
-
* system with support for nested menus, keyboard navigation, and accessibility.
|
|
6
|
-
*
|
|
7
|
-
* @module components/menu
|
|
8
|
-
* @category Components
|
|
9
|
-
*/
|
|
10
1
|
export { default, default as createMenu } from "./menu.js";
|
|
11
2
|
export type { MenuEvents } from "./types.js";
|
|
12
3
|
export type { MenuConfig, MenuVariant, MenuComponent, MenuItem, MenuDivider, MenuGap, MenuContent, MenuEvent, MenuSelectEvent, MenuPosition } from "./types.js";
|
|
13
|
-
/**
|
|
14
|
-
* Constants for menu position values - use these instead of string literals
|
|
15
|
-
* for better code completion and type safety.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* import { createMenu, MENU_POSITION } from 'material';
|
|
19
|
-
*
|
|
20
|
-
* // Create a menu positioned at the bottom-right of its opener
|
|
21
|
-
* const menu = createMenu({
|
|
22
|
-
* opener: '#dropdown-button',
|
|
23
|
-
* items: [...],
|
|
24
|
-
* position: MENU_POSITION.BOTTOM_END
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* @category Components
|
|
28
|
-
*/
|
|
29
4
|
export { MENU_POSITION, MENU_DEFAULTS, MENU_INTERACTION_TYPES, MENU_ITEM_TYPES, MENU_EVENTS, MENU_CLASSES } from "./constants.js";
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { MenuComponent } from "./types.js";
|
|
2
|
-
/** @internal */
|
|
3
2
|
export declare const MENU: unique symbol;
|
|
4
|
-
/** What an owner of an inner menu carries. @internal */
|
|
5
3
|
export interface MenuOwner {
|
|
6
4
|
[MENU]?: MenuComponent;
|
|
7
5
|
}
|
|
8
|
-
/** The menu inside a select or a split button, if it has one. @internal */
|
|
9
6
|
export declare const innerMenu: (owner: object) => MenuComponent | undefined;
|
|
@@ -1,29 +1,3 @@
|
|
|
1
1
|
import { MenuConfig, MenuComponent } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a new Menu component with the specified configuration.
|
|
4
|
-
*
|
|
5
|
-
* The Menu component implements the Material Design 3 menu specifications,
|
|
6
|
-
* providing a flexible dropdown menu system with support for nested menus,
|
|
7
|
-
* keyboard navigation, and ARIA accessibility.
|
|
8
|
-
*
|
|
9
|
-
* Menus are built using a functional composition pattern, applying various
|
|
10
|
-
* features through the pipe function for a modular architecture.
|
|
11
|
-
*
|
|
12
|
-
* The menu element is not added to the DOM until it's opened, and it's removed
|
|
13
|
-
* from the DOM when closed, following best practices for dropdown menus.
|
|
14
|
-
*
|
|
15
|
-
* @param {MenuConfig} config - Configuration options for the menu
|
|
16
|
-
* This must include an opener element or selector, and an array of menu items.
|
|
17
|
-
* See {@link MenuConfig} for all available options.
|
|
18
|
-
*
|
|
19
|
-
* @returns {MenuComponent} A fully configured menu component instance with
|
|
20
|
-
* all requested features applied. The returned component has methods for
|
|
21
|
-
* menu manipulation, event handling, and lifecycle management.
|
|
22
|
-
*
|
|
23
|
-
* @throws {Error} Throws an error if menu creation fails or if required
|
|
24
|
-
* configuration (like opener) is missing.
|
|
25
|
-
*
|
|
26
|
-
* @category Components
|
|
27
|
-
*/
|
|
28
2
|
declare const createMenu: (config: MenuConfig) => MenuComponent;
|
|
29
3
|
export default createMenu;
|
|
@@ -1,511 +1,114 @@
|
|
|
1
1
|
import type { EventCallback } from "../../core/state/emitter.js";
|
|
2
|
-
/**
|
|
3
|
-
* Menu position options
|
|
4
|
-
* Controls where the menu will appear relative to its opener element
|
|
5
|
-
*
|
|
6
|
-
* @category Components
|
|
7
|
-
*/
|
|
8
2
|
export declare const MENU_POSITION: {
|
|
9
|
-
/** Places menu below the opener, aligned to left edge */
|
|
10
3
|
readonly BOTTOM_START: "bottom-start";
|
|
11
|
-
/** Places menu below the opener, centered */
|
|
12
4
|
readonly BOTTOM: "bottom";
|
|
13
|
-
/** Places menu below the opener, aligned to right edge */
|
|
14
5
|
readonly BOTTOM_END: "bottom-end";
|
|
15
|
-
/** Places menu above the opener, aligned to left edge */
|
|
16
6
|
readonly TOP_START: "top-start";
|
|
17
|
-
/** Places menu above the opener, centered */
|
|
18
7
|
readonly TOP: "top";
|
|
19
|
-
/** Places menu above the opener, aligned to right edge */
|
|
20
8
|
readonly TOP_END: "top-end";
|
|
21
|
-
/** Places menu to the right of the opener, aligned to top edge */
|
|
22
9
|
readonly RIGHT_START: "right-start";
|
|
23
|
-
/** Places menu to the right of the opener, centered */
|
|
24
10
|
readonly RIGHT: "right";
|
|
25
|
-
/** Places menu to the right of the opener, aligned to bottom edge */
|
|
26
11
|
readonly RIGHT_END: "right-end";
|
|
27
|
-
/** Places menu to the left of the opener, aligned to top edge */
|
|
28
12
|
readonly LEFT_START: "left-start";
|
|
29
|
-
/** Places menu to the left of the opener, centered */
|
|
30
13
|
readonly LEFT: "left";
|
|
31
|
-
/** Places menu to the left of the opener, aligned to bottom edge */
|
|
32
14
|
readonly LEFT_END: "left-end";
|
|
33
15
|
};
|
|
34
|
-
/**
|
|
35
|
-
* Position options for the menu
|
|
36
|
-
*
|
|
37
|
-
* @category Components
|
|
38
|
-
*/
|
|
39
16
|
export type MenuPosition = (typeof MENU_POSITION)[keyof typeof MENU_POSITION];
|
|
40
|
-
/**
|
|
41
|
-
* Configuration interface for a menu item
|
|
42
|
-
*
|
|
43
|
-
* @category Components
|
|
44
|
-
*/
|
|
45
17
|
export interface MenuItem<TData = unknown> {
|
|
46
|
-
/**
|
|
47
|
-
* Unique ID for the menu item
|
|
48
|
-
* Required for accessibility and event handling
|
|
49
|
-
*/
|
|
50
18
|
id: string;
|
|
51
|
-
/**
|
|
52
|
-
* Display text for the menu item
|
|
53
|
-
*/
|
|
54
19
|
text: string;
|
|
55
|
-
/**
|
|
56
|
-
* Optional icon to display before the text.
|
|
57
|
-
* Markup (HTML). Not sanitized by default: see Markup and sanitizing.
|
|
58
|
-
* Accepts an HTML string (typically SVG).
|
|
59
|
-
*/
|
|
60
20
|
icon?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Optional keyboard shortcut hint to display
|
|
63
|
-
* Shown at the end of the menu item
|
|
64
|
-
*/
|
|
65
21
|
shortcut?: string;
|
|
66
|
-
/**
|
|
67
|
-
* A second line under the label, for a short explanation of the item
|
|
68
|
-
* (vertical menus only)
|
|
69
|
-
*/
|
|
70
22
|
supportingText?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Whether the menu item is disabled
|
|
73
|
-
* Disabled items cannot be clicked but remain visible
|
|
74
|
-
*/
|
|
75
23
|
disabled?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Whether this item has a submenu
|
|
78
|
-
* If true, the item will show an indicator and can open a nested menu
|
|
79
|
-
*/
|
|
80
24
|
hasSubmenu?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Optional array of submenu items
|
|
83
|
-
* Only used when hasSubmenu is true
|
|
84
|
-
*/
|
|
85
25
|
submenu?: MenuItem<TData>[];
|
|
86
|
-
/**
|
|
87
|
-
* Additional data to associate with the menu item
|
|
88
|
-
* This can be used for custom behavior in click handlers
|
|
89
|
-
*/
|
|
90
26
|
data?: TData;
|
|
91
27
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Menu item type for dividers
|
|
94
|
-
*
|
|
95
|
-
* @category Components
|
|
96
|
-
*/
|
|
97
28
|
export interface MenuDivider {
|
|
98
|
-
/**
|
|
99
|
-
* Type must be 'divider' to differentiate from regular menu items
|
|
100
|
-
*/
|
|
101
29
|
type: "divider";
|
|
102
|
-
/**
|
|
103
|
-
* Optional ID for the divider (for accessibility)
|
|
104
|
-
*/
|
|
105
30
|
id?: string;
|
|
106
31
|
}
|
|
107
|
-
/**
|
|
108
|
-
* Menu item type for a gap between groups.
|
|
109
|
-
*
|
|
110
|
-
* The M3 expressive vertical menu separates groups two ways: a divider line,
|
|
111
|
-
* or a gap. A gap splits the menu into separate surfaces, each with its own
|
|
112
|
-
* rounded container, rather than drawing a line across one surface
|
|
113
|
-
* (m3.material.io/components/menus, vertical menus).
|
|
114
|
-
*
|
|
115
|
-
* A standard menu is a single surface, so a gap there is simply space.
|
|
116
|
-
*
|
|
117
|
-
* @category Components
|
|
118
|
-
*/
|
|
119
32
|
export interface MenuGap {
|
|
120
|
-
/**
|
|
121
|
-
* Type must be 'gap' to differentiate from regular menu items
|
|
122
|
-
*/
|
|
123
33
|
type: "gap";
|
|
124
|
-
/**
|
|
125
|
-
* Optional ID for the gap (for accessibility)
|
|
126
|
-
*/
|
|
127
34
|
id?: string;
|
|
128
35
|
}
|
|
129
|
-
/**
|
|
130
|
-
* Combined type for menu content items (regular items, dividers or gaps)
|
|
131
|
-
*
|
|
132
|
-
* @category Components
|
|
133
|
-
*/
|
|
134
36
|
export type MenuContent<TData = unknown> = MenuItem<TData> | MenuDivider | MenuGap;
|
|
135
|
-
/**
|
|
136
|
-
* Configuration interface for the Menu component
|
|
137
|
-
*
|
|
138
|
-
* @category Components
|
|
139
|
-
*/
|
|
140
|
-
/** Menu variants */
|
|
141
37
|
export type MenuVariant = "baseline" | "vertical";
|
|
142
|
-
/** Colour mappings for the vertical menu */
|
|
143
38
|
export type MenuColor = "standard" | "vibrant";
|
|
144
39
|
export interface MenuConfig {
|
|
145
|
-
/**
|
|
146
|
-
* Element to which the menu will be openered
|
|
147
|
-
* Can be an HTML element, a CSS selector string, or a component with an element property
|
|
148
|
-
*/
|
|
149
40
|
opener: HTMLElement | string | {
|
|
150
41
|
element: HTMLElement;
|
|
151
42
|
};
|
|
152
|
-
/**
|
|
153
|
-
* The element the menu is placed against, when it is not the opener's: a
|
|
154
|
-
* select's field, so its supporting text row never pushes the menu down
|
|
155
|
-
* The opener still opens, closes and gets focus back.
|
|
156
|
-
*/
|
|
157
43
|
positionTarget?: HTMLElement;
|
|
158
|
-
/**
|
|
159
|
-
* Array of menu items and dividers to display
|
|
160
|
-
*/
|
|
161
44
|
items: MenuContent[];
|
|
162
|
-
/**
|
|
163
|
-
* Menu variant. `'vertical'` is the M3 expressive menu: a rounded
|
|
164
|
-
* container holding items that sit apart and change shape as they are
|
|
165
|
-
* hovered, focused, pressed or selected.
|
|
166
|
-
* @default 'baseline'
|
|
167
|
-
*/
|
|
168
45
|
variant?: MenuVariant;
|
|
169
|
-
/**
|
|
170
|
-
* Colour mapping for the vertical variant. `'vibrant'` is tertiary-based
|
|
171
|
-
* and more prominent, so it should be used sparingly.
|
|
172
|
-
*/
|
|
173
46
|
color?: MenuColor;
|
|
174
|
-
/**
|
|
175
|
-
* Position of the menu relative to the opener
|
|
176
|
-
* @default 'bottom-start'
|
|
177
|
-
*/
|
|
178
47
|
position?: MenuPosition;
|
|
179
|
-
/**
|
|
180
|
-
* Whether the menu should close when an item is clicked
|
|
181
|
-
* @default true
|
|
182
|
-
*/
|
|
183
48
|
closeOnSelect?: boolean;
|
|
184
|
-
/**
|
|
185
|
-
* Whether the menu should close when the user clicks outside
|
|
186
|
-
* @default true
|
|
187
|
-
*/
|
|
188
49
|
closeOnClickOutside?: boolean;
|
|
189
|
-
/**
|
|
190
|
-
* Whether the menu should close when the escape key is pressed
|
|
191
|
-
* @default true
|
|
192
|
-
*/
|
|
193
50
|
closeOnEscape?: boolean;
|
|
194
|
-
/**
|
|
195
|
-
* Whether the menu should close when the window is resized
|
|
196
|
-
* @default false
|
|
197
|
-
*/
|
|
198
51
|
closeOnResize?: boolean;
|
|
199
|
-
/**
|
|
200
|
-
* Whether submenus should open on hover
|
|
201
|
-
* @default true
|
|
202
|
-
*/
|
|
203
52
|
openSubmenuOnHover?: boolean;
|
|
204
|
-
/**
|
|
205
|
-
* Optional width for the menu (in CSS units)
|
|
206
|
-
* If not provided, menu will size to its content
|
|
207
|
-
*/
|
|
208
53
|
width?: string;
|
|
209
|
-
/**
|
|
210
|
-
* Optional maximum height for the menu (in CSS units)
|
|
211
|
-
* If content exceeds this height, the menu will scroll
|
|
212
|
-
*/
|
|
213
54
|
maxHeight?: string;
|
|
214
|
-
/**
|
|
215
|
-
* Optional offset from the opener (in pixels)
|
|
216
|
-
* @default 0
|
|
217
|
-
*/
|
|
218
55
|
offset?: number;
|
|
219
|
-
/**
|
|
220
|
-
* Whether the menu should automatically flip position to stay in viewport
|
|
221
|
-
* @default true
|
|
222
|
-
*/
|
|
223
56
|
autoFlip?: boolean;
|
|
224
|
-
/**
|
|
225
|
-
* Whether the menu is initially visible
|
|
226
|
-
* @default false
|
|
227
|
-
*/
|
|
228
57
|
visible?: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Container element to append the menu to
|
|
231
|
-
* If not provided, menu will be appended to document.body
|
|
232
|
-
* Use this when the menu needs to stay within a specific container (e.g., inside a dialog)
|
|
233
|
-
*/
|
|
234
58
|
container?: HTMLElement | null;
|
|
235
|
-
/**
|
|
236
|
-
* `"top"` renders the menu in place, next to its opener, and shows it in the
|
|
237
|
-
* browser's top layer as a `popover="manual"` element: above every z-index,
|
|
238
|
-
* outside any clipping ancestor, and still inside the opener's shadow root,
|
|
239
|
-
* so it keeps that root's styles. `container` is then not used. The menu
|
|
240
|
-
* positions itself in viewport coordinates and keeps its own dismissal.
|
|
241
|
-
* Submenus open in the top layer too.
|
|
242
|
-
*
|
|
243
|
-
* Where the browser has no popover support, the menu behaves as without it.
|
|
244
|
-
* Unset, the menu is appended to `container` or `document.body`.
|
|
245
|
-
*/
|
|
246
59
|
layer?: "top";
|
|
247
|
-
/**
|
|
248
|
-
* When true, the opener is used only for positioning.
|
|
249
|
-
* No click, blur, or keyboard handlers are attached to the opener element.
|
|
250
|
-
* The consumer is responsible for calling open() / close() manually.
|
|
251
|
-
* @default false
|
|
252
|
-
*/
|
|
253
60
|
manualOpen?: boolean;
|
|
254
|
-
/**
|
|
255
|
-
* Renders the menu as the listbox popup of a combobox (WAI-ARIA select-only
|
|
256
|
-
* combobox): the list is `role="listbox"` and each item `role="option"` with
|
|
257
|
-
* its own id, focus stays with the combobox, which owns the keyboard and
|
|
258
|
-
* points at the active option with `aria-activedescendant`, and the opener
|
|
259
|
-
* gets no ARIA from the menu. Pair it with `manualOpen`.
|
|
260
|
-
* @default false
|
|
261
|
-
*/
|
|
262
61
|
listbox?: boolean;
|
|
263
|
-
/**
|
|
264
|
-
* When true, renders a compact menu with smaller items and tighter spacing.
|
|
265
|
-
* Useful in dense UIs like toolbars and action bars where the standard
|
|
266
|
-
* 48px item height is too large.
|
|
267
|
-
* @default false
|
|
268
|
-
*/
|
|
269
62
|
dense?: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* Additional CSS classes to add to the menu
|
|
272
|
-
*/
|
|
273
63
|
class?: string;
|
|
274
|
-
/**
|
|
275
|
-
* Component prefix for CSS class names
|
|
276
|
-
* @default 'mtrl'
|
|
277
|
-
*/
|
|
278
64
|
prefix?: string;
|
|
279
|
-
/**
|
|
280
|
-
* Component name used in CSS class generation
|
|
281
|
-
* @default 'menu'
|
|
282
|
-
*/
|
|
283
65
|
componentName?: string;
|
|
284
|
-
/**
|
|
285
|
-
* Event handlers for the menu
|
|
286
|
-
*/
|
|
287
66
|
on?: {
|
|
288
|
-
/**
|
|
289
|
-
* Called when the menu is opened
|
|
290
|
-
*/
|
|
291
67
|
open?: (event: MenuEvent) => void;
|
|
292
|
-
/**
|
|
293
|
-
* Called when the menu is closed
|
|
294
|
-
*/
|
|
295
68
|
close?: (event: MenuEvent) => void;
|
|
296
|
-
/**
|
|
297
|
-
* Called when a menu item is selected
|
|
298
|
-
*/
|
|
299
69
|
select?: (event: MenuSelectEvent) => void;
|
|
300
70
|
};
|
|
301
71
|
}
|
|
302
|
-
/**
|
|
303
|
-
* What `open` and `close` carry. Neither can be cancelled: the menu is
|
|
304
|
-
* already open, or closed, when its listener runs.
|
|
305
|
-
*
|
|
306
|
-
* @category Components
|
|
307
|
-
*/
|
|
308
72
|
export interface MenuEvent {
|
|
309
|
-
/** The menu component that triggered the event */
|
|
310
73
|
menu: MenuComponent;
|
|
311
|
-
/** Original DOM event if available */
|
|
312
74
|
originalEvent?: Event;
|
|
313
75
|
}
|
|
314
|
-
/**
|
|
315
|
-
* Menu selection event interface
|
|
316
|
-
*
|
|
317
|
-
* @category Components
|
|
318
|
-
*/
|
|
319
76
|
export interface MenuSelectEvent<TData = unknown> extends MenuEvent {
|
|
320
|
-
/** The selected menu item */
|
|
321
77
|
item: MenuItem<TData>;
|
|
322
|
-
/** ID of the selected menu item */
|
|
323
78
|
itemId: string;
|
|
324
|
-
/** The item's id again, as the `value` of the `<m-menu>` element's `select` */
|
|
325
79
|
value: string;
|
|
326
|
-
/** Data associated with the menu item (if any) */
|
|
327
80
|
itemData?: TData;
|
|
328
|
-
/** Keeps the menu open: a `closeOnSelect` menu does not close for this selection */
|
|
329
81
|
preventDefault: () => void;
|
|
330
|
-
/** Whether a listener has called `preventDefault()` */
|
|
331
82
|
defaultPrevented: boolean;
|
|
332
83
|
}
|
|
333
|
-
/**
|
|
334
|
-
* Menu component interface
|
|
335
|
-
*
|
|
336
|
-
* @category Components
|
|
337
|
-
*/
|
|
338
84
|
export interface MenuComponent {
|
|
339
|
-
/** The menu's root DOM element */
|
|
340
85
|
element: HTMLElement;
|
|
341
|
-
/**
|
|
342
|
-
* Opens the menu.
|
|
343
|
-
*
|
|
344
|
-
* When it returns, `isOpen()` is true and `open` has been emitted. The
|
|
345
|
-
* surface is placed and shown, and focus moves in, after that. On an open
|
|
346
|
-
* menu it does nothing and emits nothing.
|
|
347
|
-
*
|
|
348
|
-
* From then on a click outside and Escape close it (`closeOnClickOutside`,
|
|
349
|
-
* `closeOnEscape`). The event that opened it never does: the click or the
|
|
350
|
-
* key press whose dispatch had begun when `open()` ran is ignored, and only
|
|
351
|
-
* that one.
|
|
352
|
-
* @param event - Optional event that triggered the open
|
|
353
|
-
* @param interactionType - The type of interaction that triggered the open ('mouse' or 'keyboard')
|
|
354
|
-
* @returns The menu component for chaining
|
|
355
|
-
*/
|
|
356
86
|
open: (event?: Event, interactionType?: "mouse" | "keyboard") => MenuComponent;
|
|
357
|
-
/**
|
|
358
|
-
* Closes the menu.
|
|
359
|
-
*
|
|
360
|
-
* When it returns, `isOpen()` is false and `close` has been emitted. The
|
|
361
|
-
* surface fades after that and then leaves the document. On a closed menu
|
|
362
|
-
* it does nothing and emits nothing.
|
|
363
|
-
*
|
|
364
|
-
* `close()` then `open()` at once ends open, and `open()` then `close()`
|
|
365
|
-
* ends closed: the later call wins, and what the earlier one still had to
|
|
366
|
-
* do (showing the surface, or removing it) is dropped.
|
|
367
|
-
* @param event - Optional event that triggered the close
|
|
368
|
-
* @param restoreFocus - Whether focus returns to the opener (default true)
|
|
369
|
-
* @param skipAnimation - Whether to close without the exit animation
|
|
370
|
-
* @returns The menu component for chaining
|
|
371
|
-
*/
|
|
372
87
|
close: (event?: Event, restoreFocus?: boolean, skipAnimation?: boolean) => MenuComponent;
|
|
373
|
-
/**
|
|
374
|
-
* Toggles the menu's open state
|
|
375
|
-
* @param event - Optional event that triggered the toggle
|
|
376
|
-
* @returns The menu component for chaining
|
|
377
|
-
*/
|
|
378
88
|
toggle: (event?: Event) => MenuComponent;
|
|
379
|
-
/**
|
|
380
|
-
* Checks if the menu is currently open. It changes inside `open()` and
|
|
381
|
-
* `close()`, before their events, and does not wait for the animation.
|
|
382
|
-
* @returns True if the menu is open
|
|
383
|
-
*/
|
|
384
89
|
isOpen: () => boolean;
|
|
385
|
-
/**
|
|
386
|
-
* Updates the menu items
|
|
387
|
-
* @param items - New array of menu items and dividers
|
|
388
|
-
* @returns The menu component for chaining
|
|
389
|
-
*/
|
|
390
90
|
setItems: (items: MenuContent[]) => MenuComponent;
|
|
391
|
-
/**
|
|
392
|
-
* Gets the current menu items
|
|
393
|
-
* @returns Array of current menu items and dividers
|
|
394
|
-
*/
|
|
395
91
|
getItems: () => MenuContent[];
|
|
396
|
-
/**
|
|
397
|
-
* Updates the menu's opener element
|
|
398
|
-
* @param opener - New opener element or selector
|
|
399
|
-
* @returns The menu component for chaining
|
|
400
|
-
*/
|
|
401
92
|
setOpener: (opener: HTMLElement | string) => MenuComponent;
|
|
402
|
-
/**
|
|
403
|
-
* Gets the current opener element
|
|
404
|
-
* @returns Current opener element
|
|
405
|
-
*/
|
|
406
93
|
getOpener: () => HTMLElement;
|
|
407
|
-
/**
|
|
408
|
-
* Updates the menu's position
|
|
409
|
-
* @param position - New position value
|
|
410
|
-
* @returns The menu component for chaining
|
|
411
|
-
*/
|
|
412
94
|
setPosition: (position: MenuPosition) => MenuComponent;
|
|
413
|
-
/**
|
|
414
|
-
* Gets the current menu position
|
|
415
|
-
* @returns Current position
|
|
416
|
-
*/
|
|
417
95
|
getPosition: () => MenuPosition;
|
|
418
|
-
/**
|
|
419
|
-
* Sets the selected menu item
|
|
420
|
-
* @param itemId - ID of the menu item to mark as selected
|
|
421
|
-
* @returns The menu component for chaining
|
|
422
|
-
*/
|
|
423
96
|
setSelected: (itemId: string | null) => MenuComponent;
|
|
424
|
-
/**
|
|
425
|
-
* Gets the currently selected menu item's ID
|
|
426
|
-
* @returns ID of the selected menu item or null if none is selected
|
|
427
|
-
*/
|
|
428
97
|
getSelected: () => string | null;
|
|
429
|
-
/**
|
|
430
|
-
* Adds an event listener to the menu
|
|
431
|
-
* @param event - Event name ('open', 'close', 'select')
|
|
432
|
-
* @param handler - Event handler function
|
|
433
|
-
* @returns The menu component for chaining
|
|
434
|
-
*/
|
|
435
98
|
on<T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]): MenuComponent;
|
|
436
|
-
/**
|
|
437
|
-
* Adds an event listener for any event the menu emits, such as
|
|
438
|
-
* 'submenu-opened', 'submenu-closed', 'all-submenus-closed' or 'menu-closing'
|
|
439
|
-
* @param event - Event name
|
|
440
|
-
* @param handler - Event handler function
|
|
441
|
-
* @returns The menu component for chaining
|
|
442
|
-
*/
|
|
443
99
|
on(event: string, handler: EventCallback): MenuComponent;
|
|
444
|
-
/**
|
|
445
|
-
* Removes an event listener from the menu
|
|
446
|
-
* @param event - Event name
|
|
447
|
-
* @param handler - Event handler function
|
|
448
|
-
* @returns The menu component for chaining
|
|
449
|
-
*/
|
|
450
100
|
off<T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]): MenuComponent;
|
|
451
|
-
/**
|
|
452
|
-
* Removes an event listener for any event the menu emits
|
|
453
|
-
* @param event - Event name
|
|
454
|
-
* @param handler - Event handler function
|
|
455
|
-
* @returns The menu component for chaining
|
|
456
|
-
*/
|
|
457
101
|
off(event: string, handler: EventCallback): MenuComponent;
|
|
458
|
-
/**
|
|
459
|
-
* Destroys the menu component and cleans up resources
|
|
460
|
-
*/
|
|
461
102
|
destroy: () => void;
|
|
462
103
|
}
|
|
463
|
-
/**
|
|
464
|
-
* Menu events interface for type-checking
|
|
465
|
-
*
|
|
466
|
-
* @category Components
|
|
467
|
-
* @internal
|
|
468
|
-
*/
|
|
469
104
|
export interface MenuEvents {
|
|
470
105
|
open: (event: MenuEvent) => void;
|
|
471
106
|
close: (event: MenuEvent) => void;
|
|
472
107
|
select: (event: MenuSelectEvent) => void;
|
|
473
108
|
}
|
|
474
|
-
/**
|
|
475
|
-
* The menu as its own features see it, part-way through the pipe.
|
|
476
|
-
*
|
|
477
|
-
* One shared shape rather than five near-identical ones, because the features
|
|
478
|
-
* enhance the same object in sequence. `element`, `getClass` and `lifecycle`
|
|
479
|
-
* are required: withElement and withLifecycle run before any of them. The
|
|
480
|
-
* rest are optional because they are installed by siblings, and which have
|
|
481
|
-
* run depends on where in the pipe you are.
|
|
482
|
-
*
|
|
483
|
-
* @category Components
|
|
484
|
-
* @internal
|
|
485
|
-
*/
|
|
486
|
-
/**
|
|
487
|
-
* What withController installs at `component.menu`.
|
|
488
|
-
*
|
|
489
|
-
* The commands return the component they were handed, which is the
|
|
490
|
-
* pre-controller one; nothing reads it and the API layer discards it. Declared
|
|
491
|
-
* void for the same reason as MenuOpenerApi -- so the feature's generic does
|
|
492
|
-
* not appear in its own return type, which is what stopped the pipe binding C
|
|
493
|
-
* at that stage.
|
|
494
|
-
*
|
|
495
|
-
* @category Components
|
|
496
|
-
* @internal
|
|
497
|
-
*/
|
|
498
|
-
/**
|
|
499
|
-
* Menu state the keyboard handlers read.
|
|
500
|
-
*
|
|
501
|
-
* Declared here rather than in features/keyboard.ts so the host below can
|
|
502
|
-
* name it: a host that types its manager methods needs their parameter types
|
|
503
|
-
* in scope.
|
|
504
|
-
*/
|
|
505
109
|
export interface KeyboardMenuState {
|
|
506
110
|
items: MenuContent[];
|
|
507
111
|
}
|
|
508
|
-
/** Menu actions the keyboard handlers call. */
|
|
509
112
|
export interface KeyboardActions {
|
|
510
113
|
closeMenu: (event: Event, restoreFocus?: boolean) => void;
|
|
511
114
|
findItemById: (id: string) => MenuItem | null;
|
|
@@ -525,14 +128,6 @@ export interface MenuControllerApi {
|
|
|
525
128
|
getPosition: () => MenuPosition;
|
|
526
129
|
setPosition: (position: MenuPosition) => void;
|
|
527
130
|
}
|
|
528
|
-
/**
|
|
529
|
-
* A component that can act as a menu's opener: anything that exposes an
|
|
530
|
-
* element through `element`, `getElement()` or `input`, and follows the menu's
|
|
531
|
-
* open state when it can.
|
|
532
|
-
*
|
|
533
|
-
* @category Components
|
|
534
|
-
* @internal
|
|
535
|
-
*/
|
|
536
131
|
export interface OpenerComponent {
|
|
537
132
|
element?: HTMLElement;
|
|
538
133
|
getElement?: () => HTMLElement;
|
|
@@ -542,25 +137,7 @@ export interface OpenerComponent {
|
|
|
542
137
|
focus?: () => void;
|
|
543
138
|
blur?: () => void;
|
|
544
139
|
}
|
|
545
|
-
/**
|
|
546
|
-
* What a menu opener can be given as: a selector, an element or a component
|
|
547
|
-
*
|
|
548
|
-
* @category Components
|
|
549
|
-
* @internal
|
|
550
|
-
*/
|
|
551
140
|
export type OpenerTarget = string | HTMLElement | OpenerComponent;
|
|
552
|
-
/**
|
|
553
|
-
* What withOpener installs at `component.opener`.
|
|
554
|
-
*
|
|
555
|
-
* The three setters return the component they were handed, which is the
|
|
556
|
-
* pre-opener one and so not useful for chaining; nothing reads it, and the API
|
|
557
|
-
* layer discards it. Declared `void` so the value is not promised, and so the
|
|
558
|
-
* feature's generic does not appear in its own return type -- which is what
|
|
559
|
-
* stopped the pipe binding C at that stage.
|
|
560
|
-
*
|
|
561
|
-
* @category Components
|
|
562
|
-
* @internal
|
|
563
|
-
*/
|
|
564
141
|
export interface MenuOpenerApi {
|
|
565
142
|
setOpener: (opener: OpenerTarget) => void;
|
|
566
143
|
getOpener: () => HTMLElement | null;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import type { NavigationBarComponent, NavigationBarConfig } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates an M3 Expressive navigation bar: three to five destinations along
|
|
4
|
-
* the bottom of a compact or medium window (Compose `ShortNavigationBar`).
|
|
5
|
-
* Import its styles separately with `material/styles/navigation-bar`. Links keep
|
|
6
|
-
* native browser navigation; `onSelect` can `preventDefault()` for a router.
|
|
7
|
-
* Don't show it together with a toolbar (m3.material.io).
|
|
8
|
-
*/
|
|
9
2
|
export default function createNavigationBar(config?: NavigationBarConfig): NavigationBarComponent;
|
|
@@ -1,48 +1,26 @@
|
|
|
1
1
|
import type { DestinationConfig } from "../../core/navigation/destinations.js";
|
|
2
|
-
/** One destination of the bar: a link (`href`) or a button. */
|
|
3
2
|
export type NavigationBarItemConfig = DestinationConfig;
|
|
4
|
-
/** What `select` and `onSelect` carry: the destination chosen by click or keyboard. */
|
|
5
3
|
export interface NavigationBarSelectEvent {
|
|
6
4
|
id: string;
|
|
7
|
-
/** The id, as `<m-navigation-bar>`'s `change` carries it */
|
|
8
5
|
value: string;
|
|
9
6
|
index: number;
|
|
10
7
|
originalEvent: MouseEvent;
|
|
11
8
|
}
|
|
12
9
|
export interface NavigationBarEvents {
|
|
13
10
|
select: NavigationBarSelectEvent;
|
|
14
|
-
/** The bar was hidden (`hidden: true`) or shown again, by scroll or by `hide()`/`show()` */
|
|
15
11
|
visibility: {
|
|
16
12
|
hidden: boolean;
|
|
17
13
|
};
|
|
18
14
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Where an item puts its icon. `'vertical'`: above the label, the compact bar.
|
|
21
|
-
* `'horizontal'`: beside it, M3 Expressive's medium-width bar, with the items
|
|
22
|
-
* centred. `'auto'` (the default) is vertical, and horizontal while the bar
|
|
23
|
-
* itself is at least 600px wide: a CSS container query on the bar, so a bar in
|
|
24
|
-
* a narrow pane stays vertical in a wide window. Compose leaves the choice to
|
|
25
|
-
* the caller; MDC-Android puts the threshold at 600dp.
|
|
26
|
-
*/
|
|
27
15
|
export type NavigationBarItemLayout = 'auto' | 'vertical' | 'horizontal';
|
|
28
16
|
export interface NavigationBarConfig {
|
|
29
|
-
/** Three to five destinations (M3) */
|
|
30
17
|
items?: NavigationBarItemConfig[];
|
|
31
18
|
itemLayout?: NavigationBarItemLayout;
|
|
32
|
-
/**
|
|
33
|
-
* Hides the bar while the page scrolls down and shows it when it scrolls
|
|
34
|
-
* up, as the bottom app bar's `autoHide`. `true` follows the window; pass an
|
|
35
|
-
* element to follow its scroll instead. Off by default: M3's guidelines
|
|
36
|
-
* advise against hiding navigation while a screen reader is in use, which a
|
|
37
|
-
* page can't detect. Focus inside the bar always shows it.
|
|
38
|
-
*/
|
|
39
19
|
hideOnScroll?: boolean | {
|
|
40
20
|
target?: HTMLElement | Window;
|
|
41
21
|
};
|
|
42
|
-
/** The landmark's name; default "Primary navigation" */
|
|
43
22
|
ariaLabel?: string;
|
|
44
23
|
ripple?: boolean;
|
|
45
|
-
/** `select` listener registered at creation. */
|
|
46
24
|
onSelect?: (event: NavigationBarEvents["select"]) => void;
|
|
47
25
|
class?: string;
|
|
48
26
|
prefix?: string;
|
|
@@ -55,14 +33,11 @@ export interface NavigationBarComponent {
|
|
|
55
33
|
destroy: () => void;
|
|
56
34
|
};
|
|
57
35
|
getActive: () => string | null;
|
|
58
|
-
/** The active destination's id, as getActive(): the value getter every component has */
|
|
59
36
|
getValue: () => string | null;
|
|
60
|
-
/** Marks a destination active, silently (no `select`); `null` clears it */
|
|
61
37
|
setActive: (id: string | null) => NavigationBarComponent;
|
|
62
38
|
getItems: () => NavigationBarItemConfig[];
|
|
63
39
|
setItems: (items: NavigationBarItemConfig[]) => NavigationBarComponent;
|
|
64
40
|
setBadge: (id: string, badge: NavigationBarItemConfig['badge'], label?: string) => NavigationBarComponent;
|
|
65
|
-
/** Slides the bar out of view (without the slide under reduced motion) */
|
|
66
41
|
hide: () => NavigationBarComponent;
|
|
67
42
|
show: () => NavigationBarComponent;
|
|
68
43
|
isHidden: () => boolean;
|