material 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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/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/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/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/datepicker.d.ts +6 -0
- package/dist/elements/define.d.ts +48 -0
- 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 +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 +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- 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 +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +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/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/components/_menu.scss +14 -1
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ What a bundler keeps, minified and gzipped (kB is 1,000 bytes), measured from th
|
|
|
94
94
|
| `createButton` from `material`, with code splitting: the initial chunks (the progress indicator loads on demand) | 7.6 kB |
|
|
95
95
|
| `createButton`, without code splitting (the progress indicator included) | 13.9 kB |
|
|
96
96
|
| `createButton`, `createTextField` and `createCheckbox`, without code splitting | 20.4 kB |
|
|
97
|
-
| Everything the root exports (`export * from 'material'`), without code splitting | 127.
|
|
97
|
+
| Everything the root exports (`export * from 'material'`), without code splitting | 127.3 kB |
|
|
98
98
|
| `material/styles/base` | 3.0 kB |
|
|
99
99
|
| `material/styles/base-lite` | 1.6 kB |
|
|
100
100
|
| `material/styles/base` and `material/styles/button` | 5.2 kB |
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/** Badge variants */
|
|
1
2
|
export declare const BADGE_VARIANTS: {
|
|
2
3
|
readonly SMALL: "small";
|
|
3
4
|
readonly LARGE: "large";
|
|
4
5
|
};
|
|
6
|
+
/** Badge colors */
|
|
5
7
|
export declare const BADGE_COLORS: {
|
|
6
8
|
readonly ERROR: "error";
|
|
7
9
|
readonly PRIMARY: "primary";
|
|
@@ -11,10 +13,12 @@ export declare const BADGE_COLORS: {
|
|
|
11
13
|
readonly WARNING: "warning";
|
|
12
14
|
readonly INFO: "info";
|
|
13
15
|
};
|
|
16
|
+
/** Badge positions relative to its container */
|
|
14
17
|
export declare const BADGE_POSITIONS: {
|
|
15
18
|
readonly TOP_RIGHT: "top-right";
|
|
16
19
|
readonly TOP_LEFT: "top-left";
|
|
17
20
|
readonly BOTTOM_RIGHT: "bottom-right";
|
|
18
21
|
readonly BOTTOM_LEFT: "bottom-left";
|
|
19
22
|
};
|
|
23
|
+
/** Maximum character count for badge labels */
|
|
20
24
|
export declare const BADGE_MAX_CHARACTERS = 4;
|
|
@@ -1,50 +1,152 @@
|
|
|
1
1
|
import { ElementComponent } from "../../core/compose/component.js";
|
|
2
|
+
/** Badge variant types - determines the badge size and appearance */
|
|
2
3
|
export type BadgeVariant = 'small' | 'large';
|
|
4
|
+
/** Badge color types - determines the badge's background color */
|
|
3
5
|
export type BadgeColor = 'error' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'info';
|
|
6
|
+
/** Badge position types - determines where the badge appears relative to its target */
|
|
4
7
|
export type BadgePosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
8
|
+
/** Configuration interface for the Badge component */
|
|
5
9
|
export interface BadgeConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Badge variant (small dot or large numbered)
|
|
12
|
+
* @default 'large'
|
|
13
|
+
*/
|
|
6
14
|
variant?: BadgeVariant | string;
|
|
15
|
+
/**
|
|
16
|
+
* Badge color (follows Material Design 3 color system)
|
|
17
|
+
* @default 'error'
|
|
18
|
+
*/
|
|
7
19
|
color?: BadgeColor | string;
|
|
20
|
+
/**
|
|
21
|
+
* Badge position relative to its container element
|
|
22
|
+
* @default 'top-right'
|
|
23
|
+
*/
|
|
8
24
|
position?: BadgePosition | string;
|
|
25
|
+
/** Text label inside the badge (for large badges) Up to 4 characters, numbers exceeding max will show "{max}+" For a small dot, nonnumeric text supplies its accessible announcement; otherwise it announces "New notification" without rendering text. */
|
|
9
26
|
label?: string | number;
|
|
27
|
+
/** Maximum value to display (shows "{max}+" if label exceeds max) */
|
|
10
28
|
max?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the badge should be initially visible
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
11
33
|
visible?: boolean;
|
|
34
|
+
/** Target element to which badge will be attached */
|
|
12
35
|
target?: HTMLElement;
|
|
36
|
+
/** Additional CSS classes to apply to the badge element */
|
|
13
37
|
class?: string;
|
|
38
|
+
/**
|
|
39
|
+
* CSS class prefix for all badge classes
|
|
40
|
+
* @default "mtrl"
|
|
41
|
+
*/
|
|
14
42
|
prefix?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Component name used in CSS class generation
|
|
45
|
+
* @default "badge"
|
|
46
|
+
*/
|
|
15
47
|
componentName?: string;
|
|
16
48
|
}
|
|
49
|
+
/** The visibility control withVisibility installs on a badge. */
|
|
17
50
|
export interface BadgeVisibility {
|
|
51
|
+
/** Shows the badge */
|
|
18
52
|
show: () => void;
|
|
53
|
+
/** Hides the badge */
|
|
19
54
|
hide: () => void;
|
|
55
|
+
/** Toggles badge visibility, or forces it when given a flag */
|
|
20
56
|
toggle: (visible?: boolean) => void;
|
|
57
|
+
/** Whether the badge is currently visible */
|
|
21
58
|
isVisible: () => boolean;
|
|
22
59
|
}
|
|
60
|
+
/** What a badge feature enhancer needs from the component it is handed. */
|
|
23
61
|
export interface BadgeFeatureHost extends ElementComponent {
|
|
24
62
|
config: BadgeConfig & Record<string, unknown>;
|
|
25
63
|
wrapper?: HTMLElement;
|
|
26
64
|
}
|
|
65
|
+
/** Badge component interface */
|
|
27
66
|
export interface BadgeComponent {
|
|
67
|
+
/** The badge's root DOM element */
|
|
28
68
|
element: HTMLElement;
|
|
69
|
+
/** Badge wrapper element (if badge is attached to target) */
|
|
29
70
|
wrapper?: HTMLElement;
|
|
71
|
+
/**
|
|
72
|
+
* Sets the badge's text label
|
|
73
|
+
* @param label
|
|
74
|
+
*/
|
|
30
75
|
setLabel: (label: string | number) => BadgeComponent;
|
|
76
|
+
/** Gets the badge's current text label */
|
|
31
77
|
getLabel: () => string;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the badge's content (alias for setLabel)
|
|
80
|
+
* @param content
|
|
81
|
+
*/
|
|
32
82
|
setContent: (content: string | number) => BadgeComponent;
|
|
83
|
+
/** Gets the badge's current content (alias for getLabel) */
|
|
33
84
|
getContent: () => string;
|
|
85
|
+
/** Shows the badge (makes it visible) */
|
|
34
86
|
show: () => BadgeComponent;
|
|
87
|
+
/** Hides the badge (makes it invisible) */
|
|
35
88
|
hide: () => BadgeComponent;
|
|
89
|
+
/**
|
|
90
|
+
* Toggles badge visibility
|
|
91
|
+
* @param visible
|
|
92
|
+
*/
|
|
36
93
|
toggle: (visible?: boolean) => BadgeComponent;
|
|
94
|
+
/** Checks if the badge is currently visible */
|
|
37
95
|
isVisible: () => boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Sets maximum value (after which badge shows max+)
|
|
98
|
+
* @param max
|
|
99
|
+
*/
|
|
38
100
|
setMax: (max: number) => BadgeComponent;
|
|
101
|
+
/**
|
|
102
|
+
* Sets badge color
|
|
103
|
+
* @param color
|
|
104
|
+
*/
|
|
39
105
|
setColor: (color: BadgeColor | string) => BadgeComponent;
|
|
106
|
+
/**
|
|
107
|
+
* Sets badge variant (size style)
|
|
108
|
+
* @param variant
|
|
109
|
+
*/
|
|
40
110
|
setVariant: (variant: BadgeVariant | string) => BadgeComponent;
|
|
111
|
+
/**
|
|
112
|
+
* Sets badge position relative to target
|
|
113
|
+
* @param position
|
|
114
|
+
*/
|
|
41
115
|
setPosition: (position: BadgePosition | string) => BadgeComponent;
|
|
116
|
+
/**
|
|
117
|
+
* Attaches badge to a target element
|
|
118
|
+
* @param target
|
|
119
|
+
*/
|
|
42
120
|
attachTo: (target: HTMLElement) => BadgeComponent;
|
|
121
|
+
/** Makes badge standalone (removes from wrapper) */
|
|
43
122
|
detach: () => BadgeComponent;
|
|
123
|
+
/** Destroys the badge component and cleans up resources */
|
|
44
124
|
destroy: () => void;
|
|
125
|
+
/**
|
|
126
|
+
* Gets a class name with the component's prefix
|
|
127
|
+
* @param name
|
|
128
|
+
*/
|
|
45
129
|
getClass: (name: string) => string;
|
|
130
|
+
/**
|
|
131
|
+
* Adds CSS classes to the badge element
|
|
132
|
+
* @param classes
|
|
133
|
+
*/
|
|
46
134
|
addClass: (...classes: string[]) => BadgeComponent;
|
|
135
|
+
/**
|
|
136
|
+
* Removes CSS classes from the badge element
|
|
137
|
+
* @param classes
|
|
138
|
+
*/
|
|
47
139
|
removeClass: (...classes: string[]) => BadgeComponent;
|
|
140
|
+
/**
|
|
141
|
+
* Adds an event listener to the badge
|
|
142
|
+
* @param event
|
|
143
|
+
* @param handler
|
|
144
|
+
*/
|
|
48
145
|
on: (event: string, handler: Function) => BadgeComponent;
|
|
146
|
+
/**
|
|
147
|
+
* Removes an event listener from the badge
|
|
148
|
+
* @param event
|
|
149
|
+
* @param handler
|
|
150
|
+
*/
|
|
49
151
|
off: (event: string, handler: Function) => BadgeComponent;
|
|
50
152
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/** FAB position constants for Bottom App Bar */
|
|
1
2
|
export declare const FAB_POSITIONS: {
|
|
2
3
|
readonly CENTER: "center";
|
|
3
4
|
readonly END: "end";
|
|
4
5
|
};
|
|
6
|
+
/** Default transition duration for show/hide animations */
|
|
5
7
|
export declare const DEFAULT_TRANSITION_DURATION = 300;
|
|
8
|
+
/** CSS class names used in the bottom app bar component */
|
|
6
9
|
export declare const BOTTOM_APP_BAR_CLASSES: {
|
|
7
10
|
readonly ROOT: "bottom-app-bar";
|
|
8
11
|
readonly ACTIONS: "bottom-app-bar__actions";
|
|
@@ -1,21 +1,63 @@
|
|
|
1
1
|
import { ElementComponent } from "../../core/compose/index.js";
|
|
2
|
+
/** FAB position type for Bottom App Bar */
|
|
2
3
|
export type FabPosition = 'center' | 'end';
|
|
4
|
+
/** Configuration options for Bottom App Bar component */
|
|
3
5
|
export interface BottomAppBarConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Element to use for the container
|
|
8
|
+
* @default 'div'
|
|
9
|
+
*/
|
|
4
10
|
tag?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether to show FAB in the bottom bar
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
5
15
|
hasFab?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* FAB position in bottom bar
|
|
18
|
+
* @default 'end'
|
|
19
|
+
*/
|
|
6
20
|
fabPosition?: FabPosition;
|
|
21
|
+
/** Additional CSS classes to apply */
|
|
7
22
|
class?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to enable auto-hide on scroll
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
8
27
|
autoHide?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Transition duration for show/hide in ms
|
|
30
|
+
* @default 300
|
|
31
|
+
*/
|
|
9
32
|
transitionDuration?: number;
|
|
33
|
+
/** Called with the new visibility when it changes. */
|
|
10
34
|
onVisibilityChange?: (visible: boolean) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Component prefix for class names
|
|
37
|
+
* @default 'mtrl'
|
|
38
|
+
*/
|
|
11
39
|
prefix?: string;
|
|
40
|
+
/** Component name for class generation */
|
|
12
41
|
componentName?: string;
|
|
13
42
|
}
|
|
43
|
+
/** Bottom App Bar component interface */
|
|
14
44
|
export interface BottomAppBarComponent extends ElementComponent {
|
|
45
|
+
/**
|
|
46
|
+
* Adds an action button to the bottom bar
|
|
47
|
+
* @param button
|
|
48
|
+
*/
|
|
15
49
|
addAction(button: HTMLElement): this;
|
|
50
|
+
/**
|
|
51
|
+
* Adds a floating action button to the bottom bar
|
|
52
|
+
* @param fab
|
|
53
|
+
*/
|
|
16
54
|
addFab(fab: HTMLElement): this;
|
|
55
|
+
/** Shows the bottom bar */
|
|
17
56
|
show(): this;
|
|
57
|
+
/** Hides the bottom bar */
|
|
18
58
|
hide(): this;
|
|
59
|
+
/** Checks if the bottom bar is visible */
|
|
19
60
|
isVisible: () => boolean;
|
|
61
|
+
/** Get the actions container element */
|
|
20
62
|
getActionsContainer: () => HTMLElement;
|
|
21
63
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { BottomSheetConfig, BottomSheetComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a bottom sheet: a surface anchored to the bottom edge holding content secondary to the page.
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
2
6
|
declare const createBottomSheet: (config?: BottomSheetConfig) => BottomSheetComponent;
|
|
3
7
|
export default createBottomSheet;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
+
/** Bottom sheet variants. */
|
|
1
2
|
export declare const BOTTOM_SHEET_VARIANTS: {
|
|
2
3
|
readonly STANDARD: "standard";
|
|
3
4
|
readonly MODAL: "modal";
|
|
4
5
|
};
|
|
6
|
+
/** How far the sheet is open. */
|
|
5
7
|
export declare const BOTTOM_SHEET_STATES: {
|
|
6
8
|
readonly HIDDEN: "hidden";
|
|
7
9
|
readonly PARTIAL: "partial";
|
|
8
10
|
readonly EXPANDED: "expanded";
|
|
9
11
|
};
|
|
12
|
+
/** Defaults, from Compose BottomSheetDefaults and SheetBottomTokens. */
|
|
10
13
|
export declare const BOTTOM_SHEET_DEFAULTS: {
|
|
11
14
|
readonly VARIANT: "modal";
|
|
15
|
+
/** BottomSheetDefaults.SheetMaxWidth; wider viewports centre the sheet */
|
|
12
16
|
readonly MAX_WIDTH: 640;
|
|
17
|
+
/** A drag handle is part of the anatomy, so it is on unless asked otherwise */
|
|
13
18
|
readonly DRAG_HANDLE: true;
|
|
14
19
|
readonly CLOSE_ON_SCRIM_CLICK: true;
|
|
15
20
|
readonly CLOSE_ON_ESCAPE: true;
|
|
21
|
+
/** BottomSheetDefaults.PositionalThreshold: how far the sheet must be dragged before it settles at the next anchor rather than springing back. */
|
|
16
22
|
readonly POSITIONAL_THRESHOLD: 56;
|
|
23
|
+
/** BottomSheetDefaults.VelocityThreshold, in dp per second */
|
|
17
24
|
readonly VELOCITY_THRESHOLD: 125;
|
|
18
25
|
};
|
|
26
|
+
/** Class names, without the prefix. */
|
|
19
27
|
export declare const BOTTOM_SHEET_CLASSES: {
|
|
20
28
|
readonly ROOT: "bottom-sheet";
|
|
21
29
|
readonly SCRIM: "bottom-sheet__scrim";
|
|
@@ -25,6 +33,7 @@ export declare const BOTTOM_SHEET_CLASSES: {
|
|
|
25
33
|
readonly TITLE: "bottom-sheet__title";
|
|
26
34
|
readonly CONTENT: "bottom-sheet__content";
|
|
27
35
|
};
|
|
36
|
+
/** Events the sheet emits. */
|
|
28
37
|
export declare const BOTTOM_SHEET_EVENTS: {
|
|
29
38
|
readonly OPEN: "open";
|
|
30
39
|
readonly CLOSE: "close";
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { BOTTOM_SHEET_VARIANTS, BOTTOM_SHEET_STATES } from "./constants.js";
|
|
2
|
+
/** Standard or modal */
|
|
2
3
|
export type BottomSheetVariant = (typeof BOTTOM_SHEET_VARIANTS)[keyof typeof BOTTOM_SHEET_VARIANTS];
|
|
4
|
+
/** How far the sheet is open */
|
|
3
5
|
export type BottomSheetState = (typeof BOTTOM_SHEET_STATES)[keyof typeof BOTTOM_SHEET_STATES];
|
|
6
|
+
/** What a state change reports */
|
|
4
7
|
export interface BottomSheetStateEvent {
|
|
8
|
+
/** The state the sheet has moved to */
|
|
5
9
|
state: BottomSheetState;
|
|
10
|
+
/** The state it came from */
|
|
6
11
|
previous: BottomSheetState;
|
|
7
12
|
}
|
|
13
|
+
/** Handlers accepted at creation, one per event name */
|
|
8
14
|
export interface BottomSheetEventHandlers {
|
|
9
15
|
open?: () => void;
|
|
10
16
|
close?: () => void;
|
|
@@ -12,35 +18,81 @@ export interface BottomSheetEventHandlers {
|
|
|
12
18
|
dragStart?: () => void;
|
|
13
19
|
dragEnd?: (event: BottomSheetStateEvent) => void;
|
|
14
20
|
}
|
|
21
|
+
/** Configuration for the bottom sheet. */
|
|
15
22
|
export interface BottomSheetConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Standard sheets leave the page usable; modal sheets cover it with a scrim and take focus.
|
|
25
|
+
* @default 'modal'
|
|
26
|
+
*/
|
|
16
27
|
variant?: BottomSheetVariant;
|
|
28
|
+
/** Headline shown above the content. */
|
|
17
29
|
title?: string;
|
|
30
|
+
/** Body of the sheet, as markup or an element */
|
|
18
31
|
content?: string | HTMLElement;
|
|
32
|
+
/**
|
|
33
|
+
* The 32x4dp bar at the top edge, which says the sheet can be dragged.
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
19
36
|
dragHandle?: boolean;
|
|
37
|
+
/** Height of the partially expanded state, in pixels: a sheet with more content shows this much of it until it is expanded. */
|
|
20
38
|
peekHeight?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The sheet stops growing at this width and centres itself, so it does not stretch across a desktop window.
|
|
41
|
+
* @default 640
|
|
42
|
+
*/
|
|
21
43
|
maxWidth?: number;
|
|
44
|
+
/**
|
|
45
|
+
* State to start in.
|
|
46
|
+
* @default 'hidden'
|
|
47
|
+
*/
|
|
22
48
|
initialState?: BottomSheetState;
|
|
49
|
+
/**
|
|
50
|
+
* Whether a click on the scrim closes a modal sheet.
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
23
53
|
closeOnScrimClick?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether Escape closes a modal sheet.
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
24
58
|
closeOnEscape?: boolean;
|
|
59
|
+
/** Where to mount the sheet. */
|
|
25
60
|
container?: HTMLElement;
|
|
61
|
+
/** `"top"` makes a modal sheet's root a `<dialog>` element, rendered in `container` like any sheet, and opens it with `showModal()`: in the browser's top layer, above every z-index and outside any clipping ancestor, with the rest of the page inert. */
|
|
26
62
|
layer?: "top";
|
|
63
|
+
/** Handlers registered at creation, equivalent to calling `on` for each */
|
|
27
64
|
on?: BottomSheetEventHandlers;
|
|
65
|
+
/** Extra classes for the root element */
|
|
28
66
|
class?: string;
|
|
29
67
|
prefix?: string;
|
|
30
68
|
componentName?: string;
|
|
31
69
|
}
|
|
70
|
+
/** A bottom sheet instance. */
|
|
32
71
|
export interface BottomSheetComponent {
|
|
72
|
+
/** The root element, which holds the scrim and the container */
|
|
33
73
|
element: HTMLElement;
|
|
74
|
+
/** Opens the sheet, partially expanded */
|
|
34
75
|
open: () => BottomSheetComponent;
|
|
76
|
+
/** Closes the sheet */
|
|
35
77
|
close: () => BottomSheetComponent;
|
|
78
|
+
/** Opens the sheet to its full height */
|
|
36
79
|
expand: () => BottomSheetComponent;
|
|
80
|
+
/** Returns the sheet to the peek height */
|
|
37
81
|
collapse: () => BottomSheetComponent;
|
|
82
|
+
/** Whether the sheet is showing at all */
|
|
38
83
|
isOpen: () => boolean;
|
|
84
|
+
/** How far the sheet is open */
|
|
39
85
|
getState: () => BottomSheetState;
|
|
86
|
+
/** Replaces the body of the sheet */
|
|
40
87
|
setContent: (content: string | HTMLElement) => BottomSheetComponent;
|
|
88
|
+
/** Replaces the headline */
|
|
41
89
|
setTitle: (title: string) => BottomSheetComponent;
|
|
90
|
+
/** Adds an event listener */
|
|
42
91
|
on: <T extends keyof BottomSheetEventHandlers>(event: T, handler: NonNullable<BottomSheetEventHandlers[T]>) => BottomSheetComponent;
|
|
92
|
+
/** Removes an event listener */
|
|
43
93
|
off: <T extends keyof BottomSheetEventHandlers>(event: T, handler: NonNullable<BottomSheetEventHandlers[T]>) => BottomSheetComponent;
|
|
94
|
+
/** Removes the sheet from the page and releases its listeners */
|
|
44
95
|
destroy: () => void;
|
|
96
|
+
/** Prefixes a class name, for styling hooks */
|
|
45
97
|
getClass: (name: string) => string;
|
|
46
98
|
}
|
|
@@ -1,28 +1,47 @@
|
|
|
1
|
+
/** Button variants */
|
|
1
2
|
export declare const BUTTON_VARIANTS: {
|
|
3
|
+
/** Primary action button with solid background (high emphasis) */
|
|
2
4
|
readonly FILLED: "filled";
|
|
5
|
+
/** Secondary action button with medium emphasis */
|
|
3
6
|
readonly TONAL: "tonal";
|
|
7
|
+
/** Button with outline border and transparent background */
|
|
4
8
|
readonly OUTLINED: "outlined";
|
|
9
|
+
/** Button with slight elevation/shadow */
|
|
5
10
|
readonly ELEVATED: "elevated";
|
|
11
|
+
/** Button that appears as text without background or border (low emphasis) */
|
|
6
12
|
readonly TEXT: "text";
|
|
7
13
|
};
|
|
14
|
+
/** Available button size variants matching MD3 specifications */
|
|
8
15
|
export declare const BUTTON_SIZES: {
|
|
16
|
+
/** Extra small size - 32px height */
|
|
9
17
|
readonly XS: "xs";
|
|
18
|
+
/** Small size - 40px height (default) */
|
|
10
19
|
readonly S: "s";
|
|
20
|
+
/** Medium size - 56px height */
|
|
11
21
|
readonly M: "m";
|
|
22
|
+
/** Large size - 96px height */
|
|
12
23
|
readonly L: "l";
|
|
24
|
+
/** Extra large size - 136px height */
|
|
13
25
|
readonly XL: "xl";
|
|
14
26
|
};
|
|
27
|
+
/** Button size type */
|
|
15
28
|
export type ButtonSize = keyof typeof BUTTON_SIZES;
|
|
29
|
+
/** Available button shape variants */
|
|
16
30
|
export declare const BUTTON_SHAPES: {
|
|
31
|
+
/** Round shape - pill-shaped buttons (default) */
|
|
17
32
|
readonly ROUND: "round";
|
|
33
|
+
/** Square shape - buttons with size-specific corner radius */
|
|
18
34
|
readonly SQUARE: "square";
|
|
19
35
|
};
|
|
36
|
+
/** Button shape type */
|
|
20
37
|
export type ButtonShape = keyof typeof BUTTON_SHAPES;
|
|
38
|
+
/** Default button types */
|
|
21
39
|
export declare const BUTTON_TYPES: {
|
|
22
40
|
readonly BUTTON: "button";
|
|
23
41
|
readonly SUBMIT: "submit";
|
|
24
42
|
readonly RESET: "reset";
|
|
25
43
|
};
|
|
44
|
+
/** CSS classes used by the button component */
|
|
26
45
|
export declare const BUTTON_CLASSES: {
|
|
27
46
|
readonly ROOT: "button";
|
|
28
47
|
readonly ICON: "button__icon";
|
|
@@ -30,6 +49,7 @@ export declare const BUTTON_CLASSES: {
|
|
|
30
49
|
readonly ACTIVE: "button--active";
|
|
31
50
|
readonly DISABLED: "button--disabled";
|
|
32
51
|
};
|
|
52
|
+
/** Default ripple effect configuration */
|
|
33
53
|
export declare const DEFAULT_RIPPLE_CONFIG: {
|
|
34
54
|
readonly DURATION: 450;
|
|
35
55
|
};
|