material 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/badge/badge.d.ts +4 -0
- package/dist/components/badge/constants.d.ts +4 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/types.d.ts +102 -0
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +4 -0
- package/dist/components/bottom-app-bar/constants.d.ts +3 -0
- package/dist/components/bottom-app-bar/types.d.ts +42 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
- package/dist/components/bottom-sheet/constants.d.ts +9 -0
- package/dist/components/bottom-sheet/types.d.ts +52 -0
- package/dist/components/button/button.d.ts +4 -0
- package/dist/components/button/constants.d.ts +20 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/types.d.ts +190 -0
- package/dist/components/button-group/button-group.d.ts +4 -0
- package/dist/components/button-group/constants.d.ts +54 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/types.d.ts +125 -0
- package/dist/components/card/card.d.ts +4 -0
- package/dist/components/card/constants.d.ts +11 -0
- package/dist/components/card/content.d.ts +16 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/types.d.ts +123 -0
- package/dist/components/carousel/carousel.d.ts +1 -0
- package/dist/components/carousel/constants.d.ts +10 -0
- package/dist/components/carousel/features/scroll.js +1 -0
- package/dist/components/carousel/types.d.ts +16 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -0
- package/dist/components/checkbox/constants.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/types.d.ts +94 -0
- package/dist/components/chips/chips.d.ts +4 -0
- package/dist/components/chips/constants.d.ts +1 -0
- package/dist/components/chips/factories.d.ts +4 -0
- package/dist/components/chips/features/controller.js +4 -6
- package/dist/components/chips/types.d.ts +140 -0
- package/dist/components/datepicker/constants.d.ts +38 -0
- package/dist/components/datepicker/datepicker.d.ts +2 -0
- package/dist/components/datepicker/types.d.ts +139 -0
- package/dist/components/dialog/constants.d.ts +45 -0
- package/dist/components/dialog/dialog.d.ts +5 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/types.d.ts +196 -0
- package/dist/components/divider/config.d.ts +30 -0
- package/dist/components/divider/constants.d.ts +15 -0
- package/dist/components/divider/divider.d.ts +4 -0
- package/dist/components/divider/types.d.ts +27 -0
- package/dist/components/drawer/constants.d.ts +39 -0
- package/dist/components/drawer/drawer.d.ts +4 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/types.d.ts +109 -0
- package/dist/components/extended-fab/constants.d.ts +32 -0
- package/dist/components/extended-fab/extended-fab.d.ts +4 -0
- package/dist/components/extended-fab/types.d.ts +123 -0
- package/dist/components/fab/constants.d.ts +26 -0
- package/dist/components/fab/fab.d.ts +4 -0
- package/dist/components/fab/types.d.ts +100 -0
- package/dist/components/fab-menu/constants.d.ts +9 -0
- package/dist/components/fab-menu/fab-menu.d.ts +4 -0
- package/dist/components/fab-menu/types.d.ts +41 -0
- package/dist/components/icon-button/constants.d.ts +34 -0
- package/dist/components/icon-button/icon-button.d.ts +4 -0
- package/dist/components/icon-button/types.d.ts +157 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/list/constants.d.ts +30 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/list.d.ts +4 -0
- package/dist/components/list/types.d.ts +110 -0
- package/dist/components/loading-indicator/constants.d.ts +16 -0
- package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
- package/dist/components/loading-indicator/types.d.ts +21 -0
- package/dist/components/menu/constants.d.ts +51 -0
- package/dist/components/menu/features/controller.js +1 -1
- package/dist/components/menu/features/keyboard.js +8 -3
- package/dist/components/menu/features/opener.js +2 -16
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/inner.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +4 -0
- package/dist/components/menu/on-demand.d.ts +9 -0
- package/dist/components/menu/types.d.ts +185 -1
- package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
- package/dist/components/navigation-bar/types.d.ts +12 -0
- package/dist/components/navigation-rail/constants.d.ts +2 -0
- package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
- package/dist/components/navigation-rail/types.d.ts +18 -0
- package/dist/components/progress/constants.d.ts +37 -0
- package/dist/components/progress/progress.d.ts +4 -0
- package/dist/components/progress/types.d.ts +136 -0
- package/dist/components/radios/constants.d.ts +14 -0
- package/dist/components/radios/radios.d.ts +4 -0
- package/dist/components/radios/types.d.ts +89 -0
- package/dist/components/search/constants.d.ts +34 -0
- package/dist/components/search/search.d.ts +4 -0
- package/dist/components/search/types.d.ts +109 -0
- package/dist/components/select/constants.d.ts +46 -0
- package/dist/components/select/features.js +9 -1
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +4 -0
- package/dist/components/select/types.d.ts +95 -0
- package/dist/components/side-sheet/constants.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.d.ts +4 -0
- package/dist/components/side-sheet/types.d.ts +51 -0
- package/dist/components/slider/constants.d.ts +62 -0
- package/dist/components/slider/slider.d.ts +4 -0
- package/dist/components/slider/types.d.ts +78 -0
- package/dist/components/snackbar/constants.d.ts +37 -0
- package/dist/components/snackbar/snackbar.d.ts +5 -0
- package/dist/components/snackbar/types.d.ts +67 -0
- package/dist/components/split-button/api.js +13 -3
- package/dist/components/split-button/constants.d.ts +13 -0
- package/dist/components/split-button/split-button.d.ts +4 -0
- package/dist/components/split-button/types.d.ts +50 -0
- package/dist/components/switch/constants.d.ts +34 -0
- package/dist/components/switch/switch.d.ts +4 -0
- package/dist/components/switch/types.d.ts +55 -0
- package/dist/components/tabs/constants.d.ts +49 -0
- package/dist/components/tabs/indicator.d.ts +22 -0
- package/dist/components/tabs/responsive.d.ts +17 -0
- package/dist/components/tabs/tab.d.ts +5 -0
- package/dist/components/tabs/tabs.d.ts +4 -0
- package/dist/components/tabs/types.d.ts +170 -0
- package/dist/components/tabs/utils.d.ts +24 -0
- package/dist/components/text-field/constants.d.ts +61 -0
- package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
- package/dist/components/text-field/text-field.d.ts +4 -0
- package/dist/components/text-field/types.d.ts +84 -0
- package/dist/components/timepicker/constants.d.ts +61 -0
- package/dist/components/timepicker/types.d.ts +145 -0
- package/dist/components/toolbar/constants.d.ts +8 -0
- package/dist/components/toolbar/toolbar.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +75 -0
- package/dist/components/tooltip/constants.d.ts +43 -0
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +78 -0
- package/dist/components/top-app-bar/constants.d.ts +29 -0
- package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
- package/dist/components/top-app-bar/types.d.ts +55 -0
- package/dist/core/canvas/animation.d.ts +6 -0
- package/dist/core/canvas/drawing.d.ts +47 -0
- package/dist/core/canvas/index.d.ts +1 -0
- package/dist/core/canvas/resize.d.ts +7 -0
- package/dist/core/canvas/utils.d.ts +39 -0
- package/dist/core/compose/base.d.ts +9 -0
- package/dist/core/compose/cleanup.d.ts +2 -0
- package/dist/core/compose/component.d.ts +13 -0
- package/dist/core/compose/features/badge.d.ts +10 -0
- package/dist/core/compose/features/checkable.d.ts +13 -0
- package/dist/core/compose/features/debounce.d.ts +19 -0
- package/dist/core/compose/features/disabled.d.ts +11 -0
- package/dist/core/compose/features/events.d.ts +19 -0
- package/dist/core/compose/features/icon.d.ts +20 -0
- package/dist/core/compose/features/input.d.ts +31 -0
- package/dist/core/compose/features/lifecycle.d.ts +16 -0
- package/dist/core/compose/features/position.d.ts +13 -0
- package/dist/core/compose/features/ripple.d.ts +17 -0
- package/dist/core/compose/features/size.d.ts +5 -0
- package/dist/core/compose/features/style.d.ts +5 -0
- package/dist/core/compose/features/text.d.ts +20 -0
- package/dist/core/compose/features/textinput.d.ts +39 -0
- package/dist/core/compose/features/textlabel.d.ts +18 -0
- package/dist/core/compose/features/throttle.d.ts +18 -0
- package/dist/core/compose/features/track.d.ts +12 -0
- package/dist/core/compose/features/variant.d.ts +5 -0
- package/dist/core/compose/features/withEvents.d.ts +12 -0
- package/dist/core/compose/pipe.d.ts +12 -0
- package/dist/core/compose/utils/type-guards.d.ts +5 -0
- package/dist/core/config/component.d.ts +17 -0
- package/dist/core/config/global.d.ts +15 -0
- package/dist/core/config.d.ts +34 -0
- package/dist/core/dom/attributes.d.ts +25 -0
- package/dist/core/dom/classes.d.ts +24 -0
- package/dist/core/dom/create.d.ts +47 -0
- package/dist/core/dom/events.d.ts +26 -0
- package/dist/core/dom/focus.d.ts +11 -0
- package/dist/core/dom/html.d.ts +6 -0
- package/dist/core/dom/layer.d.ts +36 -0
- package/dist/core/dom/roving.d.ts +7 -0
- package/dist/core/navigation/destinations.d.ts +10 -0
- package/dist/core/shapes/cubic.d.ts +8 -0
- package/dist/core/shapes/material.d.ts +45 -0
- package/dist/core/shapes/polygon.d.ts +11 -0
- package/dist/core/state/emitter.d.ts +19 -0
- package/dist/core/state/events.d.ts +17 -0
- package/dist/core/state/store.d.ts +40 -0
- package/dist/core/theme/shape.d.ts +3 -0
- package/dist/core/theme/tokens.d.ts +6 -0
- package/dist/core/utils/background.d.ts +7 -0
- package/dist/core/utils/color.d.ts +5 -0
- package/dist/core/utils/index.d.ts +9 -0
- package/dist/core/utils/mobile.d.ts +10 -0
- package/dist/core/utils/object.d.ts +9 -0
- package/dist/core/utils/performance.d.ts +20 -0
- package/dist/core/utils/theme.d.ts +8 -0
- package/dist/core/utils/url.d.ts +3 -0
- package/dist/elements/adapter.d.ts +24 -0
- package/dist/elements/badge.d.ts +4 -0
- package/dist/elements/bottom-app-bar.d.ts +4 -0
- package/dist/elements/bottom-sheet.d.ts +6 -0
- package/dist/elements/button-group.d.ts +8 -0
- package/dist/elements/button.d.ts +5 -0
- package/dist/elements/card.d.ts +4 -0
- package/dist/elements/carousel.d.ts +5 -0
- package/dist/elements/checkbox.d.ts +4 -0
- package/dist/elements/chips.d.ts +9 -0
- package/dist/elements/css/button.css +1 -1
- package/dist/elements/css/button.js +1 -1
- package/dist/elements/css/carousel.css +1 -1
- package/dist/elements/css/carousel.js +1 -1
- package/dist/elements/css/chips.css +1 -1
- package/dist/elements/css/chips.js +1 -1
- package/dist/elements/css/dialog.css +1 -1
- package/dist/elements/css/dialog.js +1 -1
- package/dist/elements/css/drawer.css +1 -1
- package/dist/elements/css/drawer.js +1 -1
- package/dist/elements/css/fab-menu.css +1 -1
- package/dist/elements/css/fab-menu.js +1 -1
- package/dist/elements/css/hosts/badge.css +1 -1
- package/dist/elements/css/hosts/bottom-app-bar.css +1 -1
- package/dist/elements/css/hosts/bottom-sheet.css +1 -1
- package/dist/elements/css/hosts/button-group.css +1 -1
- package/dist/elements/css/hosts/button.css +1 -1
- package/dist/elements/css/hosts/card.css +1 -1
- package/dist/elements/css/hosts/carousel.css +1 -1
- package/dist/elements/css/hosts/checkbox.css +1 -1
- package/dist/elements/css/hosts/chips.css +1 -1
- package/dist/elements/css/hosts/datepicker.css +1 -1
- package/dist/elements/css/hosts/dialog.css +1 -1
- package/dist/elements/css/hosts/divider.css +1 -1
- package/dist/elements/css/hosts/drawer.css +1 -1
- package/dist/elements/css/hosts/extended-fab.css +1 -1
- package/dist/elements/css/hosts/fab-menu.css +1 -1
- package/dist/elements/css/hosts/fab.css +1 -1
- package/dist/elements/css/hosts/icon-button.css +1 -1
- package/dist/elements/css/hosts/list.css +1 -1
- package/dist/elements/css/hosts/loading-indicator.css +1 -1
- package/dist/elements/css/hosts/menu.css +1 -1
- package/dist/elements/css/hosts/navigation-bar.css +1 -1
- package/dist/elements/css/hosts/navigation-rail.css +1 -1
- package/dist/elements/css/hosts/progress.css +1 -1
- package/dist/elements/css/hosts/radios.css +1 -1
- package/dist/elements/css/hosts/search.css +1 -1
- package/dist/elements/css/hosts/select.css +1 -1
- package/dist/elements/css/hosts/side-sheet.css +1 -1
- package/dist/elements/css/hosts/slider.css +1 -1
- package/dist/elements/css/hosts/snackbar.css +1 -1
- package/dist/elements/css/hosts/split-button.css +1 -1
- package/dist/elements/css/hosts/switch.css +1 -1
- package/dist/elements/css/hosts/tabs.css +1 -1
- package/dist/elements/css/hosts/text-field.css +1 -1
- package/dist/elements/css/hosts/timepicker.css +1 -1
- package/dist/elements/css/hosts/toolbar.css +1 -1
- package/dist/elements/css/hosts/tooltip.css +1 -1
- package/dist/elements/css/hosts/top-app-bar.css +1 -1
- package/dist/elements/css/icon-button.css +1 -1
- package/dist/elements/css/icon-button.js +1 -1
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/css/navigation-bar.css +1 -1
- package/dist/elements/css/navigation-bar.js +1 -1
- package/dist/elements/css/navigation-rail.css +1 -1
- package/dist/elements/css/navigation-rail.js +1 -1
- package/dist/elements/css/search.css +1 -1
- package/dist/elements/css/search.js +1 -1
- package/dist/elements/css/slider.css +1 -1
- package/dist/elements/css/slider.js +1 -1
- package/dist/elements/css/text-field.css +1 -1
- package/dist/elements/css/text-field.js +1 -1
- package/dist/elements/css/timepicker.css +1 -1
- package/dist/elements/css/timepicker.js +1 -1
- package/dist/elements/datepicker.d.ts +6 -0
- package/dist/elements/define.d.ts +48 -0
- package/dist/elements/define.js +1 -1
- package/dist/elements/dialog.d.ts +5 -0
- package/dist/elements/divider.d.ts +4 -0
- package/dist/elements/drawer.d.ts +6 -0
- package/dist/elements/extended-fab.d.ts +5 -0
- package/dist/elements/fab-menu.d.ts +10 -0
- package/dist/elements/fab.d.ts +5 -0
- package/dist/elements/icon-button.d.ts +6 -0
- package/dist/elements/index.d.ts +4 -0
- package/dist/elements/list.d.ts +8 -0
- package/dist/elements/loading-indicator.d.ts +4 -0
- package/dist/elements/menu.d.ts +12 -0
- package/dist/elements/navigation-bar.d.ts +6 -0
- package/dist/elements/navigation-rail.d.ts +10 -0
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +1 -1
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +1 -1
- package/dist/elements/progress.d.ts +4 -0
- package/dist/elements/radios.d.ts +5 -0
- package/dist/elements/search.d.ts +15 -0
- package/dist/elements/select.d.ts +6 -0
- package/dist/elements/side-sheet.d.ts +5 -0
- package/dist/elements/slider.d.ts +7 -0
- package/dist/elements/snackbar.d.ts +4 -0
- package/dist/elements/split-button.d.ts +8 -0
- package/dist/elements/styles.d.ts +11 -0
- package/dist/elements/switch.d.ts +5 -0
- package/dist/elements/tabs.d.ts +6 -0
- package/dist/elements/text-field.d.ts +9 -0
- package/dist/elements/timepicker.d.ts +9 -0
- package/dist/elements/toolbar.d.ts +4 -0
- package/dist/elements/tooltip.d.ts +4 -0
- package/dist/elements/top-app-bar.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/react/create.d.ts +15 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/jsx.d.ts +3 -0
- package/dist/solid/create.d.ts +16 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/jsx.d.ts +4 -0
- package/dist/ssr/index.d.ts +3 -0
- package/dist/ssr/solid.d.ts +1 -0
- package/dist/ssr/svelte.d.ts +1 -0
- package/dist/ssr/vue.d.ts +1 -0
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +2 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +2 -2
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +2 -2
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +2 -2
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +2 -2
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +2 -2
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +2 -2
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +2 -2
- package/dist/styles/navigation-rail.css +2 -2
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +2 -2
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +2 -2
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +2 -2
- package/dist/styles/timepicker.css +2 -2
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/svelte/runtime.d.ts +21 -0
- package/dist/theme/image.d.ts +2 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/variants.d.ts +6 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +1 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +39 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +13 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +1 -0
- package/dist/theme/vendor/hct/hct.d.ts +9 -0
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/dist/vue/create.d.ts +18 -0
- package/dist/vue/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/abstract/_mixins.scss +1 -1
- package/src/styles/components/_button.scss +1 -0
- package/src/styles/components/_carousel.scss +18 -4
- package/src/styles/components/_chips.scss +3 -2
- package/src/styles/components/_dialog.scss +1 -1
- package/src/styles/components/_drawer.scss +6 -3
- package/src/styles/components/_fab-menu.scss +1 -1
- package/src/styles/components/_icon-button.scss +2 -1
- package/src/styles/components/_menu.scss +14 -1
- package/src/styles/components/_navigation-bar.scss +6 -1
- package/src/styles/components/_navigation-rail.scss +5 -0
- package/src/styles/components/_search.scss +13 -0
- package/src/styles/components/_slider.scss +16 -39
- package/src/styles/components/_text-field.scss +9 -0
- package/src/styles/components/_timepicker.scss +1 -1
|
@@ -1,19 +1,29 @@
|
|
|
1
|
+
/** One destination, as both components take it. */
|
|
1
2
|
export interface DestinationConfig {
|
|
2
3
|
id: string;
|
|
3
4
|
label: string;
|
|
5
|
+
/** Markup (HTML). */
|
|
4
6
|
icon: string;
|
|
7
|
+
/** Markup (HTML). */
|
|
5
8
|
activeIcon?: string;
|
|
6
9
|
href?: string;
|
|
10
|
+
/** A count, a short text, or `true` for the dot */
|
|
7
11
|
badge?: string | number | boolean;
|
|
8
12
|
badgeLabel?: string;
|
|
9
13
|
active?: boolean;
|
|
10
14
|
disabled?: boolean;
|
|
11
15
|
}
|
|
16
|
+
/** The component's class for a part: `__item`, `__badge`, … */
|
|
12
17
|
export type PartClass = (part: string) => string;
|
|
18
|
+
/** A copy of the items with unique ids, labels and icons, and one active at most. */
|
|
13
19
|
export declare const copyDestinations: <T extends DestinationConfig>(items: T[], component: string) => T[];
|
|
20
|
+
/** Shows, updates or removes the item's badge, and names the destination with it. */
|
|
14
21
|
export declare const updateBadge: (item: DestinationConfig, element: HTMLElement, cls: PartClass) => void;
|
|
22
|
+
/** The destination's element: a link or a button, its indicator, icon, label and badge. */
|
|
15
23
|
export declare const createDestination: (item: DestinationConfig, cls: PartClass) => HTMLElement;
|
|
24
|
+
/** Marks the active destination, and shows its active icon. */
|
|
16
25
|
export declare const updateSelection: (items: DestinationConfig[], nodes: Map<string, HTMLElement>, cls: PartClass) => void;
|
|
26
|
+
/** Moves focus between the enabled destinations: `next` and `previous` are the arrow keys of the component's axis, Home and End go to the ends. */
|
|
17
27
|
export declare const moveDestinationFocus: (event: KeyboardEvent, nodes: Map<string, HTMLElement>, container: HTMLElement, keys: {
|
|
18
28
|
next: string;
|
|
19
29
|
previous: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** A cubic Bézier: anchor 0, control 0, control 1, anchor 1 */
|
|
1
2
|
export type Cubic = readonly [
|
|
2
3
|
number,
|
|
3
4
|
number,
|
|
@@ -8,19 +9,25 @@ export type Cubic = readonly [
|
|
|
8
9
|
number,
|
|
9
10
|
number
|
|
10
11
|
];
|
|
12
|
+
/** A 2D point */
|
|
11
13
|
export type Point = readonly [
|
|
12
14
|
number,
|
|
13
15
|
number
|
|
14
16
|
];
|
|
17
|
+
/** Below this distance two points are the same point */
|
|
15
18
|
export declare const DISTANCE_EPSILON = 0.0001;
|
|
16
19
|
export declare const lerp: (start: number, stop: number, fraction: number) => number;
|
|
17
20
|
export declare const distance: (x: number, y: number) => number;
|
|
21
|
+
/** Unit vector in the direction of (x, y) */
|
|
18
22
|
export declare const direction: (x: number, y: number) => Point;
|
|
19
23
|
export declare const rotate90: ([x, y]: Point) => Point;
|
|
20
24
|
export declare const dot: (a: Point, b: Point) => number;
|
|
25
|
+
/** A straight segment expressed as a cubic */
|
|
21
26
|
export declare const straightLine: (x0: number, y0: number, x1: number, y1: number) => Cubic;
|
|
27
|
+
/** A circular arc from (x0, y0) to (x1, y1) around (centerX, centerY), approximated by one cubic; the arc must be under 180 degrees. */
|
|
22
28
|
export declare const circularArc: (centerX: number, centerY: number, x0: number, y0: number, x1: number, y1: number) => Cubic;
|
|
23
29
|
export declare const pointOnCurve: (c: Cubic, t: number) => Point;
|
|
30
|
+
/** Splits a cubic at `t` into two that together trace it (de Casteljau) */
|
|
24
31
|
export declare const splitCubic: (c: Cubic, t: number) => [
|
|
25
32
|
Cubic,
|
|
26
33
|
Cubic
|
|
@@ -29,6 +36,7 @@ export declare const reverseCubic: (c: Cubic) => Cubic;
|
|
|
29
36
|
export declare const zeroLength: (c: Cubic) => boolean;
|
|
30
37
|
export type PointTransformer = (x: number, y: number) => Point;
|
|
31
38
|
export declare const transformCubic: (c: Cubic, f: PointTransformer) => Cubic;
|
|
39
|
+
/** The bounding box of a cubic as [left, top, right, bottom]. */
|
|
32
40
|
export declare const cubicBounds: (c: Cubic) => [
|
|
33
41
|
number,
|
|
34
42
|
number,
|
|
@@ -1,38 +1,73 @@
|
|
|
1
1
|
import { RoundedPolygon, polygonMaxRadius } from "./polygon.js";
|
|
2
|
+
/** Circle */
|
|
2
3
|
export declare const shapeCircle: () => RoundedPolygon;
|
|
4
|
+
/** A rounded square */
|
|
3
5
|
export declare const shapeSquare: () => RoundedPolygon;
|
|
6
|
+
/** A slanted square */
|
|
4
7
|
export declare const shapeSlanted: () => RoundedPolygon;
|
|
8
|
+
/** An arch */
|
|
5
9
|
export declare const shapeArch: () => RoundedPolygon;
|
|
10
|
+
/** A fan */
|
|
6
11
|
export declare const shapeFan: () => RoundedPolygon;
|
|
12
|
+
/** An arrow */
|
|
7
13
|
export declare const shapeArrow: () => RoundedPolygon;
|
|
14
|
+
/** A semicircle */
|
|
8
15
|
export declare const shapeSemiCircle: () => RoundedPolygon;
|
|
16
|
+
/** An oval */
|
|
9
17
|
export declare const shapeOval: () => RoundedPolygon;
|
|
18
|
+
/** A pill */
|
|
10
19
|
export declare const shapePill: () => RoundedPolygon;
|
|
20
|
+
/** A triangle */
|
|
11
21
|
export declare const shapeTriangle: () => RoundedPolygon;
|
|
22
|
+
/** A diamond */
|
|
12
23
|
export declare const shapeDiamond: () => RoundedPolygon;
|
|
24
|
+
/** A clam shell */
|
|
13
25
|
export declare const shapeClamShell: () => RoundedPolygon;
|
|
26
|
+
/** A pentagon */
|
|
14
27
|
export declare const shapePentagon: () => RoundedPolygon;
|
|
28
|
+
/** A gem */
|
|
15
29
|
export declare const shapeGem: () => RoundedPolygon;
|
|
30
|
+
/** A sunny shape: an 8-point star */
|
|
16
31
|
export declare const shapeSunny: () => RoundedPolygon;
|
|
32
|
+
/** A very sunny shape */
|
|
17
33
|
export declare const shapeVerySunny: () => RoundedPolygon;
|
|
34
|
+
/** A 4-sided cookie */
|
|
18
35
|
export declare const shapeCookie4Sided: () => RoundedPolygon;
|
|
36
|
+
/** A 6-sided cookie */
|
|
19
37
|
export declare const shapeCookie6Sided: () => RoundedPolygon;
|
|
38
|
+
/** A 7-sided cookie */
|
|
20
39
|
export declare const shapeCookie7Sided: () => RoundedPolygon;
|
|
40
|
+
/** A 9-sided cookie */
|
|
21
41
|
export declare const shapeCookie9Sided: () => RoundedPolygon;
|
|
42
|
+
/** A 12-sided cookie */
|
|
22
43
|
export declare const shapeCookie12Sided: () => RoundedPolygon;
|
|
44
|
+
/** A ghost-ish shape */
|
|
23
45
|
export declare const shapeGhostish: () => RoundedPolygon;
|
|
46
|
+
/** A 4-leaf clover */
|
|
24
47
|
export declare const shapeClover4Leaf: () => RoundedPolygon;
|
|
48
|
+
/** An 8-leaf clover */
|
|
25
49
|
export declare const shapeClover8Leaf: () => RoundedPolygon;
|
|
50
|
+
/** A burst */
|
|
26
51
|
export declare const shapeBurst: () => RoundedPolygon;
|
|
52
|
+
/** A soft burst */
|
|
27
53
|
export declare const shapeSoftBurst: () => RoundedPolygon;
|
|
54
|
+
/** A boom */
|
|
28
55
|
export declare const shapeBoom: () => RoundedPolygon;
|
|
56
|
+
/** A soft boom */
|
|
29
57
|
export declare const shapeSoftBoom: () => RoundedPolygon;
|
|
58
|
+
/** A flower */
|
|
30
59
|
export declare const shapeFlower: () => RoundedPolygon;
|
|
60
|
+
/** A puffy shape */
|
|
31
61
|
export declare const shapePuffy: () => RoundedPolygon;
|
|
62
|
+
/** A puffy diamond */
|
|
32
63
|
export declare const shapePuffyDiamond: () => RoundedPolygon;
|
|
64
|
+
/** A pixelated circle */
|
|
33
65
|
export declare const shapePixelCircle: () => RoundedPolygon;
|
|
66
|
+
/** A pixelated triangle */
|
|
34
67
|
export declare const shapePixelTriangle: () => RoundedPolygon;
|
|
68
|
+
/** A bun */
|
|
35
69
|
export declare const shapeBun: () => RoundedPolygon;
|
|
70
|
+
/** A heart */
|
|
36
71
|
export declare const shapeHeart: () => RoundedPolygon;
|
|
37
72
|
declare const byName: {
|
|
38
73
|
circle: () => RoundedPolygon;
|
|
@@ -71,16 +106,26 @@ declare const byName: {
|
|
|
71
106
|
bun: () => RoundedPolygon;
|
|
72
107
|
heart: () => RoundedPolygon;
|
|
73
108
|
};
|
|
109
|
+
/** Names of the Material shapes: Compose's, camelCased. */
|
|
74
110
|
export type MaterialShapeName = keyof typeof byName;
|
|
111
|
+
/** A Material shape by name, normalised into the unit square. */
|
|
75
112
|
export declare const materialShape: (name: MaterialShapeName) => RoundedPolygon;
|
|
113
|
+
/** A polygon's outline as an SVG path ("M … C … Z"), scaled by `size`: a normalised shape fills a `size` × `size` box. */
|
|
76
114
|
export declare const polygonPath: (polygon: RoundedPolygon, size?: number) => string;
|
|
115
|
+
/** A Material shape as an SVG path in a `size` × `size` box. */
|
|
77
116
|
export declare const materialShapePath: (name: MaterialShapeName, size?: number) => string;
|
|
117
|
+
/** A shape's outline as radii at evenly spaced angles around its centre */
|
|
78
118
|
export interface RadialProfile {
|
|
119
|
+
/** Radius at angle i * 2π / radii.length, clockwise from the positive x axis on a y-down canvas */
|
|
79
120
|
radii: Float32Array;
|
|
121
|
+
/** The area centroid the radii are measured from */
|
|
80
122
|
centerX: number;
|
|
81
123
|
centerY: number;
|
|
124
|
+
/** The largest radius, for fitting the shape into a circle */
|
|
82
125
|
maxRadius: number;
|
|
83
126
|
}
|
|
127
|
+
/** radialProfile without its star-shape check, for callers whose shapes are known to be star-shaped: the loading indicator's, which the tests check. */
|
|
84
128
|
export declare const sampleProfile: (polygon: RoundedPolygon, samples?: number, stepsPerCubic?: number) => RadialProfile;
|
|
129
|
+
/** Samples the outline at `samples` angles around the shape's area centroid. */
|
|
85
130
|
export declare const radialProfile: (polygon: RoundedPolygon, samples?: number, stepsPerCubic?: number) => RadialProfile;
|
|
86
131
|
export { polygonMaxRadius };
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { Cubic, PointTransformer } from "./cubic.js";
|
|
2
|
+
/** How a vertex is rounded: the radius, and how much the curve is smoothed into the sides (0–1) */
|
|
2
3
|
export interface CornerRounding {
|
|
3
4
|
radius: number;
|
|
4
5
|
smoothing?: number;
|
|
5
6
|
}
|
|
6
7
|
export declare const UNROUNDED: CornerRounding;
|
|
8
|
+
/** A closed shape made of contiguous cubics */
|
|
7
9
|
export interface RoundedPolygon {
|
|
8
10
|
cubics: Cubic[];
|
|
9
11
|
centerX: number;
|
|
10
12
|
centerY: number;
|
|
11
13
|
}
|
|
14
|
+
/** Builds a rounded polygon from a flat list of vertex coordinates [x0, y0, x1, y1, ...], a rounding for every vertex or one per vertex, and an optional centre (the vertices' centroid by default). */
|
|
12
15
|
export declare const roundedPolygon: (vertices: number[], rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
|
|
16
|
+
/** A regular polygon, first vertex at angle 0 */
|
|
13
17
|
export declare const regularPolygon: (numVertices: number, radius?: number, centerX?: number, centerY?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[]) => RoundedPolygon;
|
|
18
|
+
/** A circle approximated by a fully rounded polygon */
|
|
14
19
|
export declare const circle: (numVertices?: number, radius?: number, centerX?: number, centerY?: number) => RoundedPolygon;
|
|
20
|
+
/** A star with `numVerticesPerRadius` outer and inner vertices, outer first at angle 0 */
|
|
15
21
|
export declare const star: (numVerticesPerRadius: number, radius?: number, innerRadius?: number, rounding?: CornerRounding, innerRounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
|
|
22
|
+
/** A rectangle centred on (centerX, centerY), its first vertex at the bottom right (graphics-shapes rectangle) */
|
|
16
23
|
export declare const rectangle: (width?: number, height?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
|
|
17
24
|
export declare const transformPolygon: (polygon: RoundedPolygon, f: PointTransformer) => RoundedPolygon;
|
|
25
|
+
/** Rotation about the origin, in degrees, positive clockwise on a y-down canvas */
|
|
18
26
|
export declare const rotatePolygon: (polygon: RoundedPolygon, degrees: number) => RoundedPolygon;
|
|
19
27
|
export declare const scalePolygon: (polygon: RoundedPolygon, sx: number, sy?: number) => RoundedPolygon;
|
|
28
|
+
/** Bounding box [left, top, right, bottom] from the hull of anchors and controls */
|
|
20
29
|
export declare const polygonBounds: (polygon: RoundedPolygon) => [
|
|
21
30
|
number,
|
|
22
31
|
number,
|
|
23
32
|
number,
|
|
24
33
|
number
|
|
25
34
|
];
|
|
35
|
+
/** The farthest any anchor or curve midpoint gets from the centre */
|
|
26
36
|
export declare const polygonMaxRadius: (polygon: RoundedPolygon) => number;
|
|
37
|
+
/** Fits the shape into the unit square, centred, keeping its aspect ratio */
|
|
27
38
|
export declare const normalizePolygon: (polygon: RoundedPolygon) => RoundedPolygon;
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
+
/** An event handler. */
|
|
1
2
|
export type EventCallback = {
|
|
2
3
|
handler(...args: unknown[]): void;
|
|
3
4
|
}["handler"];
|
|
5
|
+
/** Interface for the event emitter */
|
|
4
6
|
export interface Emitter {
|
|
7
|
+
/**
|
|
8
|
+
* Subscribe to an event
|
|
9
|
+
* @param event
|
|
10
|
+
* @param callback
|
|
11
|
+
*/
|
|
5
12
|
on(event: string, callback: EventCallback): () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Unsubscribe from an event
|
|
15
|
+
* @param event
|
|
16
|
+
* @param callback
|
|
17
|
+
*/
|
|
6
18
|
off(event: string, callback: EventCallback): void;
|
|
19
|
+
/**
|
|
20
|
+
* Emit an event
|
|
21
|
+
* @param event
|
|
22
|
+
* @param args
|
|
23
|
+
*/
|
|
7
24
|
emit(event: string, ...args: unknown[]): void;
|
|
25
|
+
/** Clear all event listeners */
|
|
8
26
|
clear(): void;
|
|
9
27
|
}
|
|
28
|
+
/** Creates an event emitter with subscription management */
|
|
10
29
|
export declare const createEmitter: () => Emitter;
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import type { EventCallback } from "./emitter.js";
|
|
2
|
+
/** Event manager interface for handling component events */
|
|
2
3
|
export interface EventManagerState {
|
|
4
|
+
/**
|
|
5
|
+
* Adds an event listener
|
|
6
|
+
* @param event
|
|
7
|
+
* @param handler
|
|
8
|
+
*/
|
|
3
9
|
on: (event: string, handler: EventCallback) => EventManagerState;
|
|
10
|
+
/**
|
|
11
|
+
* Removes an event listener
|
|
12
|
+
* @param event
|
|
13
|
+
* @param handler
|
|
14
|
+
*/
|
|
4
15
|
off: (event: string, handler: EventCallback) => EventManagerState;
|
|
16
|
+
/** Removes all event listeners and cleans up */
|
|
5
17
|
destroy: () => void;
|
|
18
|
+
/** Gets all active handlers */
|
|
6
19
|
getHandlers: () => Map<EventCallback, string>;
|
|
7
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates an event manager for a component
|
|
23
|
+
* @param element
|
|
24
|
+
*/
|
|
8
25
|
export declare const createEventManager: (element: HTMLElement) => EventManagerState;
|
|
@@ -1,20 +1,60 @@
|
|
|
1
|
+
/** State store options */
|
|
1
2
|
export interface StoreOptions<T> {
|
|
3
|
+
/** Middleware functions that process state changes */
|
|
2
4
|
middleware?: Array<(newState: T, oldState: T) => T>;
|
|
3
5
|
}
|
|
6
|
+
/** State selector function type */
|
|
4
7
|
export type Selector<T, R> = (state: T) => R;
|
|
8
|
+
/** State computation function type for derived state */
|
|
5
9
|
export type Computation<T, R> = (state: T) => R;
|
|
10
|
+
/** State updater function type */
|
|
6
11
|
export type Updater<T> = (state: T) => T;
|
|
12
|
+
/** What derive() returns: call it to remove the derived value, or read the value, typed, through get(). */
|
|
7
13
|
export type DerivedState<R> = (() => void) & {
|
|
8
14
|
get: () => R;
|
|
9
15
|
};
|
|
16
|
+
/** State store interface */
|
|
10
17
|
export interface Store<T> {
|
|
18
|
+
/** Gets current state including derived values */
|
|
11
19
|
getState: <D extends object = Record<never, never>>() => T & D;
|
|
20
|
+
/**
|
|
21
|
+
* Updates state
|
|
22
|
+
* @param update
|
|
23
|
+
*/
|
|
12
24
|
setState: (update: Partial<T> | Updater<T>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Subscribes to state changes
|
|
27
|
+
* @param listener
|
|
28
|
+
*/
|
|
13
29
|
subscribe: (listener: (state: T, oldState: T) => void) => () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a derived state value
|
|
32
|
+
* @param key
|
|
33
|
+
* @param computation
|
|
34
|
+
*/
|
|
14
35
|
derive: <K extends string, R>(key: K, computation: Computation<T, R>) => DerivedState<R>;
|
|
36
|
+
/**
|
|
37
|
+
* Selects a specific slice of state
|
|
38
|
+
* @param selector
|
|
39
|
+
*/
|
|
15
40
|
select: <R>(selector: Selector<T, R>) => R;
|
|
41
|
+
/** Resets state to initial values */
|
|
16
42
|
reset: () => void;
|
|
17
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a state store with support for derived state and middleware
|
|
46
|
+
* @param initialState
|
|
47
|
+
* @param options
|
|
48
|
+
*/
|
|
18
49
|
export declare const createStore: <T extends object>(initialState?: T, options?: StoreOptions<T>) => Store<T>;
|
|
50
|
+
/**
|
|
51
|
+
* Example middleware that logs state changes
|
|
52
|
+
* @param newState
|
|
53
|
+
* @param oldState
|
|
54
|
+
*/
|
|
19
55
|
export declare const loggingMiddleware: <T extends object>(newState: T, oldState: T) => T;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a derived state selector for filtering objects
|
|
58
|
+
* @param predicate
|
|
59
|
+
*/
|
|
20
60
|
export declare const deriveFiltered: <T>(predicate: (value: T, key: string) => boolean) => (state: Record<string, T>) => Record<string, T>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
/** The shape scale's corner tokens, for a radius a component writes from script: as the stylesheets read it, the token with the compiled value as its fallback, so a theme's corners reach inline styles too. */
|
|
2
|
+
/** A step of M3's shape scale, as `$shape` in src/styles/abstract/_variables.scss names it. */
|
|
1
3
|
export type ShapeStep = "none" | "extra-small" | "small" | "medium" | "large" | "large-increased" | "extra-large" | "extra-large-increased" | "extra-extra-large";
|
|
4
|
+
/** `var(--mtrl-sys-shape-corner-small, 8px)`: a step's token, its px the fallback. */
|
|
2
5
|
export declare const cornerToken: (step: ShapeStep, px: number, prefix?: string) => string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** M3 colour roles to mtrl's colour tokens. */
|
|
2
|
+
/** The colour roles a theme sets: the baseline theme's, in its order. */
|
|
1
3
|
export declare const THEME_ROLES: readonly [
|
|
2
4
|
"error",
|
|
3
5
|
"on-error",
|
|
@@ -47,14 +49,18 @@ export declare const THEME_ROLES: readonly [
|
|
|
47
49
|
"inverse-primary"
|
|
48
50
|
];
|
|
49
51
|
export type ThemeRole = (typeof THEME_ROLES)[number];
|
|
52
|
+
/** A scheme's colours by role. */
|
|
50
53
|
export type SchemeRoles = Record<string, string>;
|
|
51
54
|
export interface SchemeToTokensOptions {
|
|
55
|
+
/** The token prefix, as `--{prefix}-sys-color-*`. */
|
|
52
56
|
prefix?: string;
|
|
53
57
|
}
|
|
58
|
+
/** A theme's declarations: custom property to value, light and dark. */
|
|
54
59
|
export interface ThemeTokens {
|
|
55
60
|
light: Record<string, string>;
|
|
56
61
|
dark: Record<string, string>;
|
|
57
62
|
}
|
|
63
|
+
/** Turns a light and a dark scheme's role colours into a theme's colour tokens. */
|
|
58
64
|
export declare const schemeToTokens: (schemes: {
|
|
59
65
|
light: SchemeRoles;
|
|
60
66
|
dark: SchemeRoles;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
/** Result interface for background color lookup */
|
|
1
2
|
export interface BackgroundResult {
|
|
3
|
+
/** The computed background color value */
|
|
2
4
|
color: string;
|
|
5
|
+
/** The element from which the color was obtained */
|
|
3
6
|
element: HTMLElement | null;
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Gets the computed background color of an element or its ancestors.
|
|
10
|
+
* @param element
|
|
11
|
+
*/
|
|
5
12
|
export declare const getInheritedBackground: (element: HTMLElement, maxDepth?: number) => BackgroundResult;
|
|
6
13
|
export default getInheritedBackground;
|
|
@@ -5,5 +5,14 @@ export { throttle, debounce, once } from "./performance.js";
|
|
|
5
5
|
export { getThemeColor } from "./theme.js";
|
|
6
6
|
export { colorToRGBA } from "./color.js";
|
|
7
7
|
export { isSafeUrl, safeUrl, URL_ATTRIBUTES } from "./url.js";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a transformer that only runs if a condition is met
|
|
10
|
+
* @param predicate
|
|
11
|
+
* @param transformer
|
|
12
|
+
*/
|
|
8
13
|
export declare const when: <T, C>(predicate: (obj: T, context: C) => boolean, transformer: (obj: T, context: C) => T) => (obj: T, context: C) => T;
|
|
14
|
+
/**
|
|
15
|
+
* Joins class names, filtering out falsy values
|
|
16
|
+
* @param classes
|
|
17
|
+
*/
|
|
9
18
|
export declare const classNames: (...classes: (string | undefined | null | false)[]) => string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Mobile device detection and capability checks */
|
|
2
|
+
/** Interface for normalized event properties */
|
|
1
3
|
export interface NormalizedEvent {
|
|
2
4
|
clientX: number;
|
|
3
5
|
clientY: number;
|
|
@@ -8,27 +10,35 @@ export interface NormalizedEvent {
|
|
|
8
10
|
stopPropagation: () => void;
|
|
9
11
|
type: string;
|
|
10
12
|
}
|
|
13
|
+
/** Horizontal gesture emitted by an interactive root. */
|
|
11
14
|
export interface SwipePayload {
|
|
12
15
|
direction: "left" | "right";
|
|
13
16
|
deltaX: number;
|
|
14
17
|
deltaY: number;
|
|
15
18
|
}
|
|
19
|
+
/** Touch gestures emitted by touch-enabled interactive roots. */
|
|
16
20
|
export interface TouchEvents {
|
|
17
21
|
tap: (payload: NormalizedEvent) => void;
|
|
18
22
|
swipe: (payload: SwipePayload) => void;
|
|
19
23
|
}
|
|
24
|
+
/** Detects if the current device is likely a mobile device */
|
|
20
25
|
export declare const isMobileDevice: () => boolean;
|
|
26
|
+
/** Options for passive event listeners */
|
|
21
27
|
export declare const PASSIVE_EVENTS: AddEventListenerOptions;
|
|
28
|
+
/** Configuration constants for mobile interactions */
|
|
22
29
|
export declare const TOUCH_CONFIG: {
|
|
23
30
|
TARGET_SIZE: number;
|
|
24
31
|
FEEDBACK_DURATION: number;
|
|
25
32
|
TAP_THRESHOLD: number;
|
|
26
33
|
SWIPE_THRESHOLD: number;
|
|
27
34
|
};
|
|
35
|
+
/** Accessibility-minded touch target sizes */
|
|
28
36
|
export declare const TOUCH_TARGETS: {
|
|
29
37
|
MINIMUM: number;
|
|
30
38
|
COMFORTABLE: number;
|
|
31
39
|
LARGE: number;
|
|
32
40
|
};
|
|
41
|
+
/** Detects if the current device supports touch events */
|
|
33
42
|
export declare const hasTouchSupport: () => boolean;
|
|
43
|
+
/** Normalizes both mouse and touch events into a consistent format */
|
|
34
44
|
export declare const normalizeEvent: (event: Event) => NormalizedEvent;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a value is a plain object
|
|
3
|
+
* @param value
|
|
4
|
+
*/
|
|
1
5
|
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Accesses a nested property of an object using a string path
|
|
8
|
+
* @param obj
|
|
9
|
+
* @param path
|
|
10
|
+
*/
|
|
2
11
|
export declare const byString: <T extends object, R = unknown>(obj: T, path: string) => R | undefined;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
export type Cancellable<F> = F & {
|
|
2
2
|
cancel(): void;
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* Creates a throttled function that only invokes the provided function at most once per every specified wait milliseconds.
|
|
6
|
+
* @param fn
|
|
7
|
+
* @param wait
|
|
8
|
+
* @param options
|
|
9
|
+
* @param options.leading
|
|
10
|
+
* @param options.trailing
|
|
11
|
+
*/
|
|
4
12
|
export declare const throttle: <T extends (...args: never[]) => unknown>(fn: T, wait: number, options?: {
|
|
5
13
|
leading?: boolean;
|
|
6
14
|
trailing?: boolean;
|
|
7
15
|
}) => Cancellable<(...args: Parameters<T>) => void>;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a debounced function that delays invoking the provided function until after the specified wait milliseconds have elapsed since the last time it was invoked.
|
|
18
|
+
* @param fn
|
|
19
|
+
* @param wait
|
|
20
|
+
* @param options
|
|
21
|
+
* @param options.leading
|
|
22
|
+
* @param options.maxWait
|
|
23
|
+
*/
|
|
8
24
|
export declare const debounce: <T extends (...args: never[]) => unknown>(fn: T, wait: number, options?: {
|
|
9
25
|
leading?: boolean;
|
|
10
26
|
maxWait?: number;
|
|
11
27
|
}) => Cancellable<(...args: Parameters<T>) => void>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a function that is restricted to invoking the provided function once.
|
|
30
|
+
* @param fn
|
|
31
|
+
*/
|
|
12
32
|
export declare const once: <T extends (...args: never[]) => unknown>(fn: T) => ((...args: Parameters<T>) => ReturnType<T>);
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
type ThemeChangeCallback = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Register a callback to be notified of theme changes
|
|
4
|
+
* @param callback
|
|
5
|
+
*/
|
|
2
6
|
export declare const onThemeChange: (callback: ThemeChangeCallback) => (() => void);
|
|
7
|
+
/**
|
|
8
|
+
* Gets a theme color from CSS variables, with optional alpha/opacity support.
|
|
9
|
+
* @param varName
|
|
10
|
+
*/
|
|
3
11
|
export declare function getThemeColor(varName: string, options?: {
|
|
4
12
|
alpha?: number;
|
|
5
13
|
fallback?: string;
|
package/dist/core/utils/url.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** Attributes whose value is a URL, and so must be checked before assignment. */
|
|
1
2
|
export declare const URL_ATTRIBUTES: Set<string>;
|
|
3
|
+
/** Whether a URL is safe to assign to a navigable attribute. */
|
|
2
4
|
export declare const isSafeUrl: (url: string) => boolean;
|
|
5
|
+
/** Returns the URL if its scheme is allowed, otherwise an empty string. */
|
|
3
6
|
export declare const safeUrl: (url: string) => string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/** What every framework adapter shares: how a spec's attributes, live properties and events become a framework's props, how values are written as attributes, and the tag prefix. */
|
|
1
2
|
import { type AttributeType, type DefineOptions, type ElementAttributes, type ElementProperties } from "./define.js";
|
|
3
|
+
/** The runtime parts of an element spec an adapter reads. */
|
|
2
4
|
export interface ComponentSpec {
|
|
3
5
|
name: string;
|
|
6
|
+
/** `false`: the server never marks the host. */
|
|
4
7
|
ssr?: boolean | ((host: HTMLElement) => boolean);
|
|
8
|
+
/** The prefix-independent attribute the element's host carries once connected (`data-mtrl-icon-button`). */
|
|
5
9
|
marker?: string;
|
|
6
10
|
attributes?: Record<string, {
|
|
7
11
|
type: AttributeType;
|
|
@@ -15,6 +19,7 @@ export interface ComponentSpec {
|
|
|
15
19
|
form?: unknown;
|
|
16
20
|
model?: string;
|
|
17
21
|
}
|
|
22
|
+
/** A declaration child (`<m-tab>`): attributes and children only, no behaviour. */
|
|
18
23
|
export interface DeclarationSpec {
|
|
19
24
|
name: string;
|
|
20
25
|
attributes: Record<string, {
|
|
@@ -22,9 +27,11 @@ export interface DeclarationSpec {
|
|
|
22
27
|
}>;
|
|
23
28
|
}
|
|
24
29
|
export type Pascal<S extends string> = S extends `${infer H}-${infer T}` ? `${Capitalize<H>}${Pascal<T>}` : Capitalize<S>;
|
|
30
|
+
/** An attribute a live property shadows is set through `default<Name>`. */
|
|
25
31
|
export type DefaultProps<S> = {
|
|
26
32
|
[K in keyof ElementProperties<S> & keyof ElementAttributes<S> & string as `default${Capitalize<K>}`]?: ElementAttributes<S>[K];
|
|
27
33
|
};
|
|
34
|
+
/** Events a component had in 0.10 and material 3.0.0 removed: the icon button's `toggle`. */
|
|
28
35
|
export type RetiredEvents<S> = [
|
|
29
36
|
S
|
|
30
37
|
] extends [
|
|
@@ -34,39 +41,56 @@ export type RetiredEvents<S> = [
|
|
|
34
41
|
] extends [
|
|
35
42
|
S
|
|
36
43
|
] ? "toggle" : never : never;
|
|
44
|
+
/** A form-associated element takes `name`. */
|
|
37
45
|
export type FormProps<S> = S extends {
|
|
38
46
|
form: unknown;
|
|
39
47
|
} ? {
|
|
40
48
|
name?: string;
|
|
41
49
|
} : Record<never, never>;
|
|
50
|
+
/** The live property a framework's two-way binding (`v-model`, `bind:`) drives. */
|
|
42
51
|
export type ModelOf<S> = S extends {
|
|
43
52
|
model: infer M extends keyof ElementProperties<S> & string;
|
|
44
53
|
} ? M : never;
|
|
45
54
|
export declare const camel: (name: string) => string;
|
|
46
55
|
export declare const pascal: (name: string) => string;
|
|
56
|
+
/** An attribute value as a framework should render it. */
|
|
47
57
|
export declare const toAttribute: (type: AttributeType, value: unknown) => string | undefined;
|
|
48
58
|
export interface AttributeProp {
|
|
59
|
+
/** The attribute's name on the element. */
|
|
49
60
|
name: string;
|
|
50
61
|
type: AttributeType;
|
|
62
|
+
/** A live property of the same name exists; this prop is its `default*`. */
|
|
51
63
|
shadowed: boolean;
|
|
52
64
|
}
|
|
65
|
+
/** A spec, read once into the maps an adapter needs. */
|
|
53
66
|
export interface Described {
|
|
67
|
+
/** Prop name (camelCase, or `default<Name>` when shadowed) to attribute. */
|
|
54
68
|
attributes: Map<string, AttributeProp>;
|
|
69
|
+
/** Live-state property names. */
|
|
55
70
|
properties: string[];
|
|
71
|
+
/** Event names, as the element dispatches them. */
|
|
56
72
|
events: string[];
|
|
73
|
+
/** The property two-way binding drives, if any. */
|
|
57
74
|
model: string | undefined;
|
|
58
75
|
form: boolean;
|
|
76
|
+
/** Live property name to the attribute it shadows (`checked` → the `checked` attribute). */
|
|
59
77
|
shadowedBy: Map<string, AttributeProp>;
|
|
78
|
+
/** The named slots, as `slot="…"` names them. */
|
|
60
79
|
slots: readonly string[];
|
|
61
80
|
}
|
|
62
81
|
export declare const describe: (spec: ComponentSpec) => Described;
|
|
82
|
+
/** Writes the attributes live properties shadow (`defaultChecked` → the `checked` attribute) on the element. */
|
|
63
83
|
export declare const writeDefaults: (element: HTMLElement, described: Described, read: (prop: string) => unknown) => void;
|
|
84
|
+
/** Writes live-state props to the element. */
|
|
64
85
|
export declare const writeLive: (element: HTMLElement, described: Described, read: (property: string) => unknown) => void;
|
|
86
|
+
/** On the server a live value is the markup's default, so the page renders in that state before it hydrates: the attribute each given live property shadows, with its value. */
|
|
65
87
|
export declare const serverDefaults: (described: Described, read: (property: string) => unknown) => Array<[
|
|
66
88
|
string,
|
|
67
89
|
string
|
|
68
90
|
]>;
|
|
69
91
|
export declare const describeDeclaration: (spec: DeclarationSpec) => Map<string, AttributeProp>;
|
|
92
|
+
/** The tag prefix adapters render. */
|
|
70
93
|
export declare const getPrefix: () => string;
|
|
94
|
+
/** Sets the tag prefix every adapter renders. */
|
|
71
95
|
export declare const configure: (options: DefineOptions) => void;
|
|
72
96
|
export declare const isBrowser: boolean;
|
package/dist/elements/badge.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** `<m-badge>`: a standalone badge. */
|
|
1
2
|
import type { BadgeComponent } from "../components/badge/types.js";
|
|
2
3
|
import { type DefineOptions, type ElementInstance } from "./define.js";
|
|
3
4
|
declare const badgeSpec: {
|
|
@@ -43,9 +44,12 @@ declare const badgeSpec: {
|
|
|
43
44
|
};
|
|
44
45
|
export declare const badgeElement: import("./define.js").ElementDefinition<BadgeComponent>;
|
|
45
46
|
export type BadgeSpec = typeof badgeSpec;
|
|
47
|
+
/** `<m-badge>` as a ref or a query returns it. */
|
|
46
48
|
export type BadgeElement = ElementInstance<BadgeSpec, BadgeComponent>;
|
|
49
|
+
/** Registers `<m-badge>` (or `<prefix-badge>`). */
|
|
47
50
|
export declare const defineBadge: (options?: DefineOptions) => string;
|
|
48
51
|
declare global {
|
|
52
|
+
/** `document.querySelector("m-…")` and `createElement` return the element's type (the default prefix). */
|
|
49
53
|
interface HTMLElementTagNameMap {
|
|
50
54
|
"m-badge": BadgeElement;
|
|
51
55
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** `<m-bottom-app-bar>`: the bottom app bar as a container with slots. */
|
|
1
2
|
import type { BottomAppBarComponent } from "../components/bottom-app-bar/types.js";
|
|
2
3
|
import { type Config, type DefineOptions, type ElementInstance } from "./define.js";
|
|
3
4
|
declare const bottomAppBarSpec: {
|
|
@@ -35,9 +36,12 @@ declare const bottomAppBarSpec: {
|
|
|
35
36
|
};
|
|
36
37
|
export declare const bottomAppBarElement: import("./define.js").ElementDefinition<BottomAppBarComponent>;
|
|
37
38
|
export type BottomAppBarSpec = typeof bottomAppBarSpec;
|
|
39
|
+
/** `<m-bottom-app-bar>` as a ref or a query returns it. */
|
|
38
40
|
export type BottomAppBarElement = ElementInstance<BottomAppBarSpec, BottomAppBarComponent>;
|
|
41
|
+
/** Registers `<m-bottom-app-bar>` (or `<prefix-bottom-app-bar>`). */
|
|
39
42
|
export declare const defineBottomAppBar: (options?: DefineOptions) => string;
|
|
40
43
|
declare global {
|
|
44
|
+
/** `document.querySelector("m-…")` and `createElement` return the element's type (the default prefix). */
|
|
41
45
|
interface HTMLElementTagNameMap {
|
|
42
46
|
"m-bottom-app-bar": BottomAppBarElement;
|
|
43
47
|
}
|