material 3.7.3 → 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/NOTICE +223 -0
- package/README.md +6 -4
- 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 +126 -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 +103 -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 +6 -0
- package/dist/elements/fab-menu.d.ts +10 -0
- package/dist/elements/fab.d.ts +6 -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 +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 +2 -2
- 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 +4 -0
- package/dist/theme/image.js +5 -0
- package/dist/theme/index.d.ts +43 -0
- package/dist/theme/index.js +32 -0
- package/dist/theme/roles.js +68 -0
- package/dist/theme/variants.d.ts +15 -0
- package/dist/theme/variants.js +17 -0
- package/dist/theme/vendor/contrast/contrast.js +72 -0
- package/dist/theme/vendor/dislike/dislike_analyzer.js +31 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +64 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +663 -0
- package/dist/theme/vendor/dynamiccolor/contrast_curve.js +42 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +63 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.js +264 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +100 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +418 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +125 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +311 -0
- package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +27 -0
- package/dist/theme/vendor/dynamiccolor/variant.js +28 -0
- package/dist/theme/vendor/hct/cam16.js +249 -0
- package/dist/theme/vendor/hct/hct.d.ts +32 -0
- package/dist/theme/vendor/hct/hct.js +86 -0
- package/dist/theme/vendor/hct/hct_solver.js +390 -0
- package/dist/theme/vendor/hct/viewing_conditions.js +73 -0
- package/dist/theme/vendor/palettes/tonal_palette.js +114 -0
- package/dist/theme/vendor/quantize/lab_point_provider.js +31 -0
- package/dist/theme/vendor/quantize/quantizer_celebi.js +25 -0
- package/dist/theme/vendor/quantize/quantizer_map.js +31 -0
- package/dist/theme/vendor/quantize/quantizer_wsmeans.js +178 -0
- package/dist/theme/vendor/quantize/quantizer_wu.js +342 -0
- package/dist/theme/vendor/scheme/scheme_content.js +30 -0
- package/dist/theme/vendor/scheme/scheme_expressive.js +30 -0
- package/dist/theme/vendor/scheme/scheme_fidelity.js +30 -0
- package/dist/theme/vendor/scheme/scheme_monochrome.js +30 -0
- package/dist/theme/vendor/scheme/scheme_neutral.js +30 -0
- package/dist/theme/vendor/scheme/scheme_tonal_spot.js +30 -0
- package/dist/theme/vendor/scheme/scheme_vibrant.js +30 -0
- package/dist/theme/vendor/score/score.js +100 -0
- package/dist/theme/vendor/temperature/temperature_cache.js +198 -0
- package/dist/theme/vendor/utils/color_utils.js +173 -0
- package/dist/theme/vendor/utils/image_utils.js +72 -0
- package/dist/theme/vendor/utils/math_utils.js +75 -0
- package/dist/theme/vendor/utils/string_utils.js +61 -0
- package/dist/themes/autumn-contrast.css +2 -2
- package/dist/themes/autumn.css +2 -2
- package/dist/themes/baseline-contrast.css +2 -2
- package/dist/themes/baseline.css +2 -2
- package/dist/themes/brownbeige-contrast.css +2 -2
- package/dist/themes/brownbeige.css +2 -2
- package/dist/themes/content-contrast.css +2 -2
- package/dist/themes/content.css +2 -2
- package/dist/themes/desert-contrast.css +2 -2
- package/dist/themes/desert.css +2 -2
- package/dist/themes/expressive-contrast.css +2 -2
- package/dist/themes/expressive.css +2 -2
- package/dist/themes/fidelity-contrast.css +2 -2
- package/dist/themes/fidelity.css +2 -2
- package/dist/themes/forest-contrast.css +2 -2
- package/dist/themes/forest.css +2 -2
- package/dist/themes/fruit-salad-contrast.css +2 -2
- package/dist/themes/fruit-salad.css +2 -2
- package/dist/themes/highcontrast-contrast.css +2 -2
- package/dist/themes/highcontrast.css +2 -2
- package/dist/themes/monochrome-contrast.css +2 -2
- package/dist/themes/monochrome.css +2 -2
- package/dist/themes/neutral-contrast.css +2 -2
- package/dist/themes/neutral.css +2 -2
- package/dist/themes/ocean-contrast.css +2 -2
- package/dist/themes/ocean.css +2 -2
- package/dist/themes/rainbow-contrast.css +2 -2
- package/dist/themes/rainbow.css +2 -2
- package/dist/themes/sageivory-contrast.css +2 -2
- package/dist/themes/sageivory.css +2 -2
- package/dist/themes/spring-contrast.css +2 -2
- package/dist/themes/spring.css +2 -2
- package/dist/themes/summer-contrast.css +2 -2
- package/dist/themes/summer.css +2 -2
- package/dist/themes/sunset-contrast.css +2 -2
- package/dist/themes/sunset.css +2 -2
- package/dist/themes/tealcaramel-contrast.css +2 -2
- package/dist/themes/tealcaramel.css +2 -2
- package/dist/themes/vibrant-contrast.css +2 -2
- package/dist/themes/vibrant.css +2 -2
- package/dist/vue/create.d.ts +18 -0
- package/dist/vue/index.d.ts +1 -0
- package/package.json +14 -1
- package/src/styles/components/_menu.scss +14 -1
- package/src/styles/themes/_autumn.scss +20 -2
- package/src/styles/themes/_base-theme.scss +34 -24
- package/src/styles/themes/_baseline.scss +18 -0
- package/src/styles/themes/_brownbeige.scss +30 -2
- package/src/styles/themes/_content.scss +30 -2
- package/src/styles/themes/_desert.scss +30 -2
- package/src/styles/themes/_expressive.scss +30 -2
- package/src/styles/themes/_fidelity.scss +30 -2
- package/src/styles/themes/_forest.scss +20 -2
- package/src/styles/themes/_fruit-salad.scss +30 -2
- package/src/styles/themes/_highcontrast.scss +21 -2
- package/src/styles/themes/_monochrome.scss +30 -2
- package/src/styles/themes/_neutral.scss +30 -2
- package/src/styles/themes/_ocean.scss +20 -2
- package/src/styles/themes/_rainbow.scss +30 -2
- package/src/styles/themes/_sageivory.scss +30 -2
- package/src/styles/themes/_spring.scss +20 -2
- package/src/styles/themes/_summer.scss +30 -2
- package/src/styles/themes/_sunset.scss +20 -2
- package/src/styles/themes/_tealcaramel.scss +30 -2
- package/src/styles/themes/_vibrant.scss +30 -2
|
@@ -1,38 +1,68 @@
|
|
|
1
1
|
import type { ButtonConfig, ButtonComponent } from "../button/types.js";
|
|
2
|
+
/** Button group orientation */
|
|
2
3
|
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
4
|
+
/** Button group variant - applies to all buttons in the group */
|
|
3
5
|
export type ButtonGroupVariant = "filled" | "tonal" | "outlined" | "elevated" | "text";
|
|
6
|
+
/** Button group density options */
|
|
4
7
|
export type ButtonGroupDensity = "default" | "comfortable" | "compact";
|
|
8
|
+
/** Event types for button group */
|
|
5
9
|
export type ButtonGroupEventType = "click" | "focus" | "blur" | "change";
|
|
10
|
+
/** Material 3 button group kinds. */
|
|
6
11
|
export type ButtonGroupKind = "standard" | "connected";
|
|
7
12
|
export type ButtonGroupSelection = "none" | "single" | "multi";
|
|
8
13
|
export type ButtonGroupShape = "round" | "square";
|
|
9
14
|
export type ButtonGroupSize = "xs" | "s" | "m" | "l" | "xl";
|
|
15
|
+
/** Label display: always, or only on the selected button (icon-only otherwise) */
|
|
10
16
|
export type ButtonGroupLabels = "always" | "selected";
|
|
17
|
+
/** Payload of the "change" event: the selection after the change. */
|
|
11
18
|
export interface ButtonGroupChangeEvent {
|
|
12
19
|
buttonGroup: ButtonGroupComponent;
|
|
20
|
+
/** Values of the selected buttons, in button order */
|
|
13
21
|
values: string[];
|
|
22
|
+
/** The selection in the `value` shape of the `<m-button-group>` element's `change`: an array for a multi-select group, a string or null otherwise. */
|
|
14
23
|
value: string | string[] | null;
|
|
15
24
|
selected: ButtonComponent[];
|
|
25
|
+
/** The button whose click caused the change, if any */
|
|
16
26
|
button?: ButtonComponent;
|
|
17
27
|
originalEvent?: Event;
|
|
18
28
|
}
|
|
29
|
+
/** Event data for button group events */
|
|
19
30
|
export interface ButtonGroupEvent {
|
|
31
|
+
/** The button group component that contains the clicked button */
|
|
20
32
|
buttonGroup: ButtonGroupComponent;
|
|
33
|
+
/** The button component that was clicked */
|
|
21
34
|
button: ButtonComponent;
|
|
35
|
+
/** Index of the button in the group */
|
|
22
36
|
index: number;
|
|
37
|
+
/** Original DOM event */
|
|
23
38
|
originalEvent: Event;
|
|
24
39
|
}
|
|
40
|
+
/** Configuration for a single button within a button group */
|
|
25
41
|
interface ButtonGroupItemBase extends Omit<ButtonConfig, "variant"> {
|
|
42
|
+
/** Unique identifier for the button */
|
|
26
43
|
id?: string;
|
|
44
|
+
/** Button text content */
|
|
27
45
|
text?: string;
|
|
46
|
+
/** Button icon HTML content. */
|
|
28
47
|
icon?: string;
|
|
48
|
+
/** Accessible label. */
|
|
29
49
|
ariaLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this button is disabled
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
30
54
|
disabled?: boolean;
|
|
55
|
+
/** Value associated with this button */
|
|
31
56
|
value?: string;
|
|
57
|
+
/** Icon shown while selected (toggle buttons). */
|
|
32
58
|
selectedIcon?: string;
|
|
59
|
+
/** Initially selected (selection groups only) */
|
|
33
60
|
selected?: boolean;
|
|
61
|
+
/** Additional CSS class for this button */
|
|
34
62
|
class?: string;
|
|
35
63
|
}
|
|
64
|
+
/** Configuration interface for the Button Group component */
|
|
65
|
+
/** A button in a group. */
|
|
36
66
|
export type ButtonGroupItemConfig = (ButtonGroupItemBase & {
|
|
37
67
|
text: string;
|
|
38
68
|
}) | (ButtonGroupItemBase & {
|
|
@@ -40,27 +70,72 @@ export type ButtonGroupItemConfig = (ButtonGroupItemBase & {
|
|
|
40
70
|
ariaLabel: string;
|
|
41
71
|
});
|
|
42
72
|
export interface ButtonGroupConfig {
|
|
73
|
+
/** Array of button configurations */
|
|
43
74
|
buttons?: ButtonGroupItemConfig[];
|
|
75
|
+
/** "standard" (default) or "connected" */
|
|
44
76
|
kind?: ButtonGroupKind;
|
|
77
|
+
/** "none" (default): plain actions. */
|
|
45
78
|
selection?: ButtonGroupSelection;
|
|
79
|
+
/** With single or multi selection: the last selected button cannot be deselected */
|
|
46
80
|
required?: boolean;
|
|
81
|
+
/** Corner style: round (default) or square */
|
|
47
82
|
shape?: ButtonGroupShape;
|
|
83
|
+
/**
|
|
84
|
+
* Standard groups: share of its width a pressed button gains while its neighbours give up the difference (M3: 0.15).
|
|
85
|
+
* @default 0.15
|
|
86
|
+
*/
|
|
48
87
|
expandedRatio?: number;
|
|
88
|
+
/** Material size token: xs, s (default), m, l, xl */
|
|
49
89
|
size?: ButtonGroupSize;
|
|
90
|
+
/** "always" (default): buttons show icon and text. */
|
|
50
91
|
labels?: ButtonGroupLabels;
|
|
92
|
+
/**
|
|
93
|
+
* Visual variant applied to all buttons in the group
|
|
94
|
+
* @default 'outlined'
|
|
95
|
+
*/
|
|
51
96
|
variant?: ButtonGroupVariant;
|
|
97
|
+
/**
|
|
98
|
+
* Orientation of the button group
|
|
99
|
+
* @default 'horizontal'
|
|
100
|
+
*/
|
|
52
101
|
orientation?: ButtonGroupOrientation;
|
|
102
|
+
/**
|
|
103
|
+
* Density setting that controls button sizing
|
|
104
|
+
* @default 'default'
|
|
105
|
+
*/
|
|
53
106
|
density?: ButtonGroupDensity;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the entire button group is disabled
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
54
111
|
disabled?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Whether buttons should have equal width
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
55
116
|
equalWidth?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Component prefix for class names
|
|
119
|
+
* @default 'mtrl'
|
|
120
|
+
*/
|
|
56
121
|
prefix?: string;
|
|
122
|
+
/** Component name used in class generation */
|
|
57
123
|
componentName?: string;
|
|
124
|
+
/** Additional CSS class for the button group container */
|
|
58
125
|
class?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Whether to enable ripple effect on buttons
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
59
130
|
ripple?: boolean;
|
|
131
|
+
/** Ripple effect configuration */
|
|
60
132
|
rippleConfig?: {
|
|
133
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
61
134
|
duration?: number;
|
|
62
135
|
};
|
|
136
|
+
/** Accessible label for the button group */
|
|
63
137
|
ariaLabel?: string;
|
|
138
|
+
/** Listeners registered at creation, ahead of any listener added afterwards. */
|
|
64
139
|
on?: {
|
|
65
140
|
click?: (event: ButtonGroupEvent) => void;
|
|
66
141
|
focus?: (event: ButtonGroupEvent) => void;
|
|
@@ -68,23 +143,62 @@ export interface ButtonGroupConfig {
|
|
|
68
143
|
change?: (event: ButtonGroupChangeEvent) => void;
|
|
69
144
|
};
|
|
70
145
|
}
|
|
146
|
+
/** Button Group component interface */
|
|
71
147
|
export interface ButtonGroupComponent {
|
|
148
|
+
/** The component's container DOM element */
|
|
72
149
|
element: HTMLElement;
|
|
150
|
+
/** Array of button component instances */
|
|
73
151
|
buttons: ButtonComponent[];
|
|
152
|
+
/**
|
|
153
|
+
* Gets a button by its index
|
|
154
|
+
* @param index
|
|
155
|
+
*/
|
|
74
156
|
getButton: (index: number) => ButtonComponent | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Gets a button by its id or value
|
|
159
|
+
* @param id
|
|
160
|
+
*/
|
|
75
161
|
getButtonById: (id: string) => ButtonComponent | undefined;
|
|
162
|
+
/** Gets the current variant */
|
|
76
163
|
getVariant: () => ButtonGroupVariant;
|
|
164
|
+
/**
|
|
165
|
+
* Sets the variant for all buttons in the group
|
|
166
|
+
* @param variant
|
|
167
|
+
*/
|
|
77
168
|
setVariant: (variant: ButtonGroupVariant) => ButtonGroupComponent;
|
|
169
|
+
/** Gets the current orientation */
|
|
78
170
|
getOrientation: () => ButtonGroupOrientation;
|
|
171
|
+
/**
|
|
172
|
+
* Sets the orientation of the button group
|
|
173
|
+
* @param orientation
|
|
174
|
+
*/
|
|
79
175
|
setOrientation: (orientation: ButtonGroupOrientation) => ButtonGroupComponent;
|
|
176
|
+
/** Gets the current density */
|
|
80
177
|
getDensity: () => ButtonGroupDensity;
|
|
178
|
+
/**
|
|
179
|
+
* Sets the density of the button group
|
|
180
|
+
* @param density
|
|
181
|
+
*/
|
|
81
182
|
setDensity: (density: ButtonGroupDensity) => ButtonGroupComponent;
|
|
183
|
+
/** Enables the entire button group */
|
|
82
184
|
enable: () => ButtonGroupComponent;
|
|
185
|
+
/** Disables the entire button group */
|
|
83
186
|
disable: () => ButtonGroupComponent;
|
|
187
|
+
/** Whether the whole group is disabled */
|
|
84
188
|
isDisabled: () => boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Enables a specific button by index
|
|
191
|
+
* @param index
|
|
192
|
+
*/
|
|
85
193
|
enableButton: (index: number) => ButtonGroupComponent;
|
|
194
|
+
/**
|
|
195
|
+
* Disables a specific button by index
|
|
196
|
+
* @param index
|
|
197
|
+
*/
|
|
86
198
|
disableButton: (index: number) => ButtonGroupComponent;
|
|
199
|
+
/** Selection (groups with selection "single" or "multi") */
|
|
87
200
|
getSelected: () => string[];
|
|
201
|
+
/** Reads the current model value without changing selection. */
|
|
88
202
|
getValue: () => string | string[] | null;
|
|
89
203
|
isSelected: (value: string) => boolean;
|
|
90
204
|
select: (value: string) => ButtonGroupComponent;
|
|
@@ -92,11 +206,22 @@ export interface ButtonGroupComponent {
|
|
|
92
206
|
toggle: (value: string) => ButtonGroupComponent;
|
|
93
207
|
getKind: () => ButtonGroupKind;
|
|
94
208
|
getSelection: () => ButtonGroupSelection;
|
|
209
|
+
/**
|
|
210
|
+
* Adds an event listener to the button group
|
|
211
|
+
* @param event
|
|
212
|
+
* @param handler
|
|
213
|
+
*/
|
|
95
214
|
on: {
|
|
96
215
|
(event: "change", handler: (event: ButtonGroupChangeEvent) => void): ButtonGroupComponent;
|
|
97
216
|
(event: "click" | "focus" | "blur", handler: (event: ButtonGroupEvent) => void): ButtonGroupComponent;
|
|
98
217
|
};
|
|
218
|
+
/**
|
|
219
|
+
* Removes an event listener from the button group
|
|
220
|
+
* @param event
|
|
221
|
+
* @param handler
|
|
222
|
+
*/
|
|
99
223
|
off: (event: ButtonGroupEventType, handler: (event: ButtonGroupEvent | ButtonGroupChangeEvent) => void) => ButtonGroupComponent;
|
|
224
|
+
/** Destroys the component and cleans up resources */
|
|
100
225
|
destroy: () => void;
|
|
101
226
|
}
|
|
102
227
|
export {};
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
+
/** Card variants following Material Design 3 guidelines */
|
|
1
2
|
export declare const CARD_VARIANTS: {
|
|
2
3
|
readonly ELEVATED: "elevated";
|
|
3
4
|
readonly FILLED: "filled";
|
|
4
5
|
readonly OUTLINED: "outlined";
|
|
5
6
|
};
|
|
7
|
+
/** Card elevation levels in Material Design 3 */
|
|
6
8
|
export declare const CARD_ELEVATIONS: {
|
|
7
9
|
readonly LEVEL0: 0;
|
|
8
10
|
readonly LEVEL1: 1;
|
|
9
11
|
readonly LEVEL2: 2;
|
|
10
12
|
readonly LEVEL4: 4;
|
|
11
13
|
};
|
|
14
|
+
/** Card width constants */
|
|
12
15
|
export declare const CARD_WIDTHS: {
|
|
13
16
|
readonly SMALL: "344px";
|
|
14
17
|
readonly MEDIUM: "480px";
|
|
15
18
|
readonly LARGE: "624px";
|
|
16
19
|
readonly FULL: "100%";
|
|
17
20
|
};
|
|
21
|
+
/** Card corner radius options */
|
|
18
22
|
export declare const CARD_CORNER_RADIUS: {
|
|
19
23
|
readonly SMALL: "8px";
|
|
20
24
|
readonly MEDIUM: "12px";
|
|
21
25
|
readonly LARGE: "16px";
|
|
22
26
|
};
|
|
27
|
+
/** Card media aspect ratio options */
|
|
23
28
|
export declare const CARD_ASPECT_RATIOS: {
|
|
24
29
|
readonly SQUARE: "1:1";
|
|
25
30
|
readonly STANDARD: "4:3";
|
|
26
31
|
readonly WIDESCREEN: "16:9";
|
|
27
32
|
};
|
|
33
|
+
/** Card action alignment options */
|
|
28
34
|
export declare const CARD_ACTION_ALIGNMENT: {
|
|
29
35
|
readonly START: "start";
|
|
30
36
|
readonly CENTER: "center";
|
|
31
37
|
readonly END: "end";
|
|
32
38
|
readonly SPACE_BETWEEN: "space-between";
|
|
33
39
|
};
|
|
40
|
+
/** Card media position options */
|
|
34
41
|
export declare const CARD_MEDIA_POSITION: {
|
|
35
42
|
readonly TOP: "top";
|
|
36
43
|
readonly BOTTOM: "bottom";
|
|
37
44
|
};
|
|
45
|
+
/** CSS class names used in the card component */
|
|
38
46
|
export declare const CARD_CLASSES: {
|
|
39
47
|
readonly ROOT: "card";
|
|
40
48
|
readonly HEADER: "card__header";
|
|
@@ -45,11 +53,14 @@ export declare const CARD_CLASSES: {
|
|
|
45
53
|
readonly CONTENT: "card__content";
|
|
46
54
|
readonly MEDIA: "card__media";
|
|
47
55
|
readonly ACTIONS: "card__actions";
|
|
56
|
+
/** Reserved modifier; draggable currently uses the native attribute. */
|
|
48
57
|
readonly DRAGGABLE: "card--draggable";
|
|
49
58
|
readonly INTERACTIVE: "card--interactive";
|
|
50
59
|
readonly FULL_WIDTH: "card--full-width";
|
|
60
|
+
/** Reserved modifier; clickable currently uses INTERACTIVE. */
|
|
51
61
|
readonly CLICKABLE: "card--clickable";
|
|
52
62
|
readonly LOADING: "card--state-loading";
|
|
53
63
|
readonly EXPANDED: "card--expanded";
|
|
64
|
+
/** Reserved modifier prefix; elevation currently uses styles. */
|
|
54
65
|
readonly ELEVATION_PREFIX: "card--elevation-";
|
|
55
66
|
};
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { CardContentConfig, CardHeaderConfig, CardMediaConfig, CardActionsConfig } from "./types.js";
|
|
2
2
|
export declare const CARD_CONTENT_PADDING = true;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a card content component
|
|
5
|
+
* @param config
|
|
6
|
+
*/
|
|
3
7
|
export declare const createCardContent: (config?: CardContentConfig) => HTMLElement;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a card header component
|
|
10
|
+
* @param config
|
|
11
|
+
*/
|
|
4
12
|
export declare const createCardHeader: (config?: CardHeaderConfig) => HTMLElement;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a card actions component
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
5
17
|
export declare const createCardActions: (config?: CardActionsConfig) => HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a card media component
|
|
20
|
+
* @param config
|
|
21
|
+
*/
|
|
6
22
|
export declare const createCardMedia: (config?: CardMediaConfig) => HTMLElement;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Factory function to create a new Card component. */
|
|
1
2
|
export { default, default as createCard } from "./card.js";
|
|
3
|
+
/** Card component types and interfaces These types define the structure and behavior of the Card component. */
|
|
2
4
|
export type { CardVariant, CardElevationLevel, CardConfig, CardHeaderConfig, CardContentConfig, CardActionsConfig, CardMediaConfig, CardAriaAttributes, CardComponent, CardEvents, } from "./types.js";
|
|
3
5
|
export { createCardContent, createCardHeader, createCardActions, createCardMedia, } from "./content.js";
|
|
@@ -1,102 +1,185 @@
|
|
|
1
1
|
import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
2
2
|
import type { ButtonConfig as BaseButtonConfig } from "../button/types.js";
|
|
3
3
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
4
|
+
/** Card variant types following Material Design 3 guidelines. */
|
|
4
5
|
export type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
6
|
+
/** Card elevation levels in Material Design 3. */
|
|
5
7
|
export type CardElevationLevel = 0 | 1 | 2 | 4;
|
|
8
|
+
/** Button configuration interface for buttons shorthand. */
|
|
6
9
|
export interface ButtonConfig extends Omit<BaseButtonConfig, "variant"> {
|
|
10
|
+
/** Button text content */
|
|
7
11
|
text?: string;
|
|
12
|
+
/** Button variant (text, outlined, filled, etc.) */
|
|
8
13
|
variant?: string;
|
|
14
|
+
/** Button icon HTML content */
|
|
9
15
|
icon?: string;
|
|
10
16
|
}
|
|
17
|
+
/** Card configuration interface defining all possible card options. */
|
|
11
18
|
export interface CardConfig {
|
|
19
|
+
/** Card variant type (elevated, filled, outlined) */
|
|
12
20
|
variant?: CardVariant | string;
|
|
21
|
+
/** The hover and press states and their elevation, for a card the app makes interactive itself. */
|
|
13
22
|
interactive?: boolean;
|
|
23
|
+
/** Whether the card should take full width */
|
|
14
24
|
fullWidth?: boolean;
|
|
25
|
+
/** A card that acts on activation: a button (role, tab stop, Enter and */
|
|
15
26
|
clickable?: boolean;
|
|
27
|
+
/** Whether the card is draggable */
|
|
16
28
|
draggable?: boolean;
|
|
29
|
+
/** Additional CSS class(es) */
|
|
17
30
|
class?: string;
|
|
31
|
+
/** Header configuration */
|
|
18
32
|
headerConfig?: CardHeaderConfig;
|
|
33
|
+
/** Content configuration */
|
|
19
34
|
contentConfig?: CardContentConfig;
|
|
35
|
+
/** Actions configuration */
|
|
20
36
|
actionsConfig?: CardActionsConfig;
|
|
37
|
+
/** Media configuration */
|
|
21
38
|
mediaConfig?: CardMediaConfig;
|
|
39
|
+
/** ARIA attributes for accessibility */
|
|
22
40
|
aria?: CardAriaAttributes;
|
|
41
|
+
/** Inline header configuration (alternative to headerConfig) */
|
|
23
42
|
header?: CardHeaderConfig;
|
|
43
|
+
/** Inline content configuration (alternative to contentConfig) */
|
|
24
44
|
content?: CardContentConfig;
|
|
45
|
+
/** Inline media configuration (alternative to mediaConfig) */
|
|
25
46
|
media?: CardMediaConfig;
|
|
47
|
+
/** Inline actions configuration (alternative to actionsConfig) */
|
|
26
48
|
actions?: CardActionsConfig;
|
|
49
|
+
/** Simple buttons array for actions (will be converted to actionsConfig) */
|
|
27
50
|
buttons?: ButtonConfig[];
|
|
51
|
+
/** Internal component name */
|
|
28
52
|
componentName?: string;
|
|
53
|
+
/** CSS class prefix */
|
|
29
54
|
prefix?: string;
|
|
55
|
+
/** Callback executed after component creation */
|
|
30
56
|
afterCreation?: (component: BaseComponent) => void;
|
|
31
57
|
}
|
|
58
|
+
/** ARIA attributes for card accessibility. */
|
|
32
59
|
export interface CardAriaAttributes {
|
|
60
|
+
/** ARIA label */
|
|
33
61
|
label?: string;
|
|
62
|
+
/** ARIA labelledby */
|
|
34
63
|
labelledby?: string;
|
|
64
|
+
/** ARIA describedby */
|
|
35
65
|
describedby?: string;
|
|
66
|
+
/** ARIA role (default: 'button' for a clickable card, 'article' for any other) */
|
|
36
67
|
role?: string;
|
|
68
|
+
/** Additional ARIA attributes as key-value pairs */
|
|
37
69
|
[key: string]: string | undefined;
|
|
38
70
|
}
|
|
71
|
+
/** Card header configuration. */
|
|
39
72
|
export interface CardHeaderConfig {
|
|
73
|
+
/** Header title text */
|
|
40
74
|
title?: string;
|
|
75
|
+
/** Header subtitle text */
|
|
41
76
|
subtitle?: string;
|
|
77
|
+
/** Avatar element or HTML string */
|
|
42
78
|
avatar?: HTMLElement | string;
|
|
79
|
+
/** Action element or HTML string */
|
|
43
80
|
action?: HTMLElement | string;
|
|
81
|
+
/** Additional CSS class(es) */
|
|
44
82
|
class?: string;
|
|
45
83
|
}
|
|
84
|
+
/** Card content configuration. */
|
|
46
85
|
export interface CardContentConfig {
|
|
86
|
+
/** Text content */
|
|
47
87
|
text?: string;
|
|
88
|
+
/** HTML content */
|
|
48
89
|
html?: string;
|
|
90
|
+
/** Child elements */
|
|
49
91
|
children?: HTMLElement[];
|
|
92
|
+
/** Whether to add padding (true by default) */
|
|
50
93
|
padding?: boolean;
|
|
94
|
+
/** Additional CSS class(es) */
|
|
51
95
|
class?: string;
|
|
52
96
|
}
|
|
97
|
+
/** Card actions configuration. */
|
|
53
98
|
export interface CardActionsConfig {
|
|
99
|
+
/** Action elements */
|
|
54
100
|
actions?: HTMLElement[];
|
|
101
|
+
/** Whether actions should be full-bleed */
|
|
55
102
|
fullBleed?: boolean;
|
|
103
|
+
/** Whether actions should be stacked vertically */
|
|
56
104
|
vertical?: boolean;
|
|
105
|
+
/** Horizontal alignment */
|
|
57
106
|
align?: 'start' | 'center' | 'end' | 'space-between';
|
|
107
|
+
/** Additional CSS class(es) */
|
|
58
108
|
class?: string;
|
|
59
109
|
}
|
|
110
|
+
/** Card media configuration. */
|
|
60
111
|
export interface CardMediaConfig {
|
|
112
|
+
/** Image source URL */
|
|
61
113
|
src?: string;
|
|
114
|
+
/** Image alt text (required for accessibility) */
|
|
62
115
|
alt?: string;
|
|
116
|
+
/** Custom element instead of image */
|
|
63
117
|
element?: HTMLElement;
|
|
118
|
+
/** Aspect ratio */
|
|
64
119
|
aspectRatio?: '16:9' | '4:3' | '1:1' | string;
|
|
120
|
+
/** Whether media should use object-fit: contain */
|
|
65
121
|
contain?: boolean;
|
|
122
|
+
/** Additional CSS class(es) */
|
|
66
123
|
class?: string;
|
|
124
|
+
/** Position of the media in the card */
|
|
67
125
|
position?: 'top' | 'bottom';
|
|
68
126
|
}
|
|
127
|
+
/** Base component interface. */
|
|
69
128
|
export interface BaseComponent {
|
|
129
|
+
/** The DOM element */
|
|
70
130
|
element: HTMLElement;
|
|
131
|
+
/** Get class name with prefix */
|
|
71
132
|
getClass: (name: string) => string;
|
|
133
|
+
/** Get modifier class */
|
|
72
134
|
getModifierClass: (base: string, modifier: string) => string;
|
|
135
|
+
/** Get element class */
|
|
73
136
|
getElementClass: (base: string, element: string) => string;
|
|
137
|
+
/** Add CSS class(es) */
|
|
74
138
|
addClass: (...classes: string[]) => BaseComponent;
|
|
139
|
+
/** Emit one of the card's own events ({@link CardEvents}), with its payload: the names and payloads `on` and `off` accept. */
|
|
75
140
|
emit?: <K extends keyof CardEvents>(event: K, payload: Parameters<CardEvents[K]>[0]) => void;
|
|
141
|
+
/** Component configuration */
|
|
76
142
|
config: CardComponentConfig;
|
|
143
|
+
/** Touch state for touch interactions */
|
|
77
144
|
touchState?: TouchState;
|
|
145
|
+
/** Update touch state */
|
|
78
146
|
updateTouchState?: (event: TouchEvent | MouseEvent, status: 'start' | 'end') => void;
|
|
147
|
+
/** Component lifecycle methods */
|
|
79
148
|
lifecycle?: ComponentLifecycle;
|
|
80
149
|
}
|
|
150
|
+
/** Touch state interface for touch interactions. */
|
|
81
151
|
export interface TouchState {
|
|
152
|
+
/** Timestamp when touch started */
|
|
82
153
|
startTime: number;
|
|
154
|
+
/** Starting position */
|
|
83
155
|
startPosition: {
|
|
84
156
|
x: number;
|
|
85
157
|
y: number;
|
|
86
158
|
};
|
|
159
|
+
/** Whether touch is active */
|
|
87
160
|
isTouching: boolean;
|
|
161
|
+
/** Current touch target */
|
|
88
162
|
activeTarget: EventTarget | null;
|
|
89
163
|
}
|
|
164
|
+
/** Component lifecycle interface. */
|
|
90
165
|
export interface ComponentLifecycle {
|
|
166
|
+
/** Called when component is mounted to DOM */
|
|
91
167
|
mount?: () => void;
|
|
168
|
+
/** Called when component is updated */
|
|
92
169
|
update?: () => void;
|
|
170
|
+
/** Called when component is destroyed */
|
|
93
171
|
destroy: () => void;
|
|
94
172
|
}
|
|
173
|
+
/** Card component configuration. */
|
|
95
174
|
export interface CardComponentConfig extends CardConfig {
|
|
175
|
+
/** Component name */
|
|
96
176
|
componentName: string;
|
|
177
|
+
/** CSS class prefix */
|
|
97
178
|
prefix: string;
|
|
98
179
|
}
|
|
180
|
+
/** The card's events. */
|
|
99
181
|
export interface CardEvents extends TouchEvents {
|
|
182
|
+
/** Presentation state after expanding or collapsing. */
|
|
100
183
|
expandedChanged: (payload: {
|
|
101
184
|
expanded: boolean;
|
|
102
185
|
}) => void;
|
|
@@ -113,35 +196,75 @@ export interface CardEvents extends TouchEvents {
|
|
|
113
196
|
event: DragEvent;
|
|
114
197
|
}) => void;
|
|
115
198
|
}
|
|
199
|
+
/** Card component interface with methods. */
|
|
116
200
|
export interface CardComponent extends BaseComponent {
|
|
201
|
+
/** Subscribes to one of the card's events */
|
|
117
202
|
on: <K extends keyof CardEvents>(event: K, handler: CardEvents[K]) => CardComponent;
|
|
203
|
+
/** Removes a handler added with `on` */
|
|
118
204
|
off: <K extends keyof CardEvents>(event: K, handler: CardEvents[K]) => CardComponent;
|
|
205
|
+
/**
|
|
206
|
+
* Adds content to the card.
|
|
207
|
+
* @param contentElement
|
|
208
|
+
*/
|
|
119
209
|
addContent: (contentElement: HTMLElement) => CardComponent;
|
|
210
|
+
/**
|
|
211
|
+
* Sets the card header.
|
|
212
|
+
* @param headerElement
|
|
213
|
+
*/
|
|
120
214
|
setHeader: (headerElement: HTMLElement) => CardComponent;
|
|
215
|
+
/**
|
|
216
|
+
* Adds media to the card.
|
|
217
|
+
* @param mediaElement
|
|
218
|
+
* @param position
|
|
219
|
+
*/
|
|
121
220
|
addMedia: (mediaElement: HTMLElement, position?: 'top' | 'bottom') => CardComponent;
|
|
221
|
+
/**
|
|
222
|
+
* Sets the card actions section.
|
|
223
|
+
* @param actionsElement
|
|
224
|
+
*/
|
|
122
225
|
setActions: (actionsElement: HTMLElement) => CardComponent;
|
|
226
|
+
/**
|
|
227
|
+
* Makes the card draggable.
|
|
228
|
+
* @param dragStartCallback
|
|
229
|
+
*/
|
|
123
230
|
makeDraggable: (dragStartCallback?: (event: DragEvent) => void) => CardComponent;
|
|
231
|
+
/** Sets focus to the card. */
|
|
124
232
|
focus: () => CardComponent;
|
|
233
|
+
/** Destroys the card component and removes event listeners. */
|
|
125
234
|
destroy: () => void;
|
|
126
235
|
}
|
|
236
|
+
/** Loading feature interface. */
|
|
127
237
|
export interface LoadingFeature {
|
|
238
|
+
/** Check if loading state is active */
|
|
128
239
|
isLoading: () => boolean;
|
|
240
|
+
/** Set loading state */
|
|
129
241
|
setLoading: (loading: boolean) => void;
|
|
130
242
|
}
|
|
243
|
+
/** Expandable feature interface. */
|
|
131
244
|
export interface ExpandableFeature {
|
|
245
|
+
/** Check if expanded state is active */
|
|
132
246
|
isExpanded: () => boolean;
|
|
247
|
+
/** Set expanded state */
|
|
133
248
|
setExpanded: (expanded: boolean) => void;
|
|
249
|
+
/** Toggle expanded state */
|
|
134
250
|
toggleExpanded: () => void;
|
|
135
251
|
}
|
|
252
|
+
/** Swipeable feature interface. */
|
|
136
253
|
export interface SwipeableFeature {
|
|
254
|
+
/** Reset swipe position */
|
|
137
255
|
reset: () => void;
|
|
138
256
|
}
|
|
257
|
+
/** API options interface. */
|
|
139
258
|
export interface ApiOptions {
|
|
259
|
+
/** Lifecycle methods */
|
|
140
260
|
lifecycle: {
|
|
261
|
+
/** Destroy callback */
|
|
141
262
|
destroy: () => void;
|
|
142
263
|
};
|
|
264
|
+
/** The resolved configuration the card was created from */
|
|
143
265
|
config: CardComponentConfig;
|
|
144
266
|
}
|
|
267
|
+
/** Registers CardConfig with the global defaults map, so `setComponentDefaults("card", ...)` is typed without core importing anything from this component. */
|
|
145
268
|
declare module "../../core/config/global" {
|
|
146
269
|
interface ComponentConfigMap {
|
|
147
270
|
card?: Partial<CardConfig>;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
+
/** Material 3 carousel layouts (m3.material.io carousel specs) */
|
|
1
2
|
export declare const CAROUSEL_VARIANTS: {
|
|
3
|
+
/** At least one large, one medium and one small item; the default */
|
|
2
4
|
readonly MULTI_BROWSE: "multi-browse";
|
|
5
|
+
/** Items keep one size and run off the trailing edge */
|
|
3
6
|
readonly UNCONTAINED: "uncontained";
|
|
7
|
+
/** One large item and a small preview of the next */
|
|
4
8
|
readonly HERO: "hero";
|
|
9
|
+
/** One large item centred between two small ones */
|
|
5
10
|
readonly HERO_CENTER: "hero-center";
|
|
11
|
+
/** One edge-to-edge item at a time, scrolling vertically */
|
|
6
12
|
readonly FULL_SCREEN: "full-screen";
|
|
7
13
|
};
|
|
8
14
|
export declare const CAROUSEL_EVENTS: {
|
|
15
|
+
/** The snapped item changed; detail carries the index */
|
|
9
16
|
readonly CHANGE: "change";
|
|
10
17
|
};
|
|
18
|
+
/** Defaults from the Compose Material 3 carousel (CarouselDefaults) and the carousel specs: 8dp between items, 16dp container padding, 28dp corners, small items between 40 and 56dp, 10dp anchors just outside the container. */
|
|
11
19
|
export declare const CAROUSEL_DEFAULTS: {
|
|
12
20
|
readonly VARIANT: "multi-browse";
|
|
21
|
+
/** Preferred width of a large item; hero layouts use it as a maximum */
|
|
13
22
|
readonly ITEM_WIDTH: 280;
|
|
14
23
|
readonly GAP: 8;
|
|
24
|
+
/** Full-screen layouts space items 16dp apart */
|
|
15
25
|
readonly GAP_FULL_SCREEN: 16;
|
|
16
26
|
readonly PADDING: 16;
|
|
17
27
|
readonly CORNER_RADIUS: 28;
|
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
2
|
+
/** Current item reported by programmatic navigation or native scrolling. */
|
|
2
3
|
export interface CarouselChangePayload {
|
|
4
|
+
/** The current item's index, as `getValue()` returns it; every model event carries it */
|
|
3
5
|
value: number;
|
|
4
6
|
}
|
|
7
|
+
/** Events emitted by the scroll feature and forwarded from the root. */
|
|
5
8
|
export interface CarouselEvents {
|
|
6
9
|
change: (payload: CarouselChangePayload) => void;
|
|
7
10
|
focus: (payload: ForwardedEventPayload<FocusEvent, HTMLElement>) => void;
|
|
8
11
|
blur: (payload: ForwardedEventPayload<FocusEvent, HTMLElement>) => void;
|
|
9
12
|
}
|
|
10
13
|
export type CarouselVariant = "multi-browse" | "uncontained" | "hero" | "hero-center" | "full-screen";
|
|
14
|
+
/** Content of one carousel item. */
|
|
11
15
|
export interface CarouselSlide {
|
|
12
16
|
image?: string;
|
|
17
|
+
/** Alternative text for the image; empty when the image is decorative */
|
|
13
18
|
alt?: string;
|
|
14
19
|
title?: string;
|
|
15
20
|
description?: string;
|
|
16
21
|
buttonText?: string;
|
|
17
22
|
buttonUrl?: string;
|
|
23
|
+
/** Custom content, replaces the image and text */
|
|
18
24
|
content?: HTMLElement | string;
|
|
19
25
|
}
|
|
20
26
|
export interface CarouselConfig {
|
|
27
|
+
/** Layout, "multi-browse" by default */
|
|
21
28
|
variant?: CarouselVariant;
|
|
22
29
|
slides?: CarouselSlide[];
|
|
30
|
+
/** Width of a large item in px. */
|
|
23
31
|
itemWidth?: number;
|
|
32
|
+
/** Space between items, 8 by default (16 for full-screen) */
|
|
24
33
|
gap?: number;
|
|
34
|
+
/** Space between the container edges and the items, 16 by default (0 for full-screen) */
|
|
25
35
|
padding?: number;
|
|
36
|
+
/** Corner radius of the items, 28 by default */
|
|
26
37
|
cornerRadius?: number;
|
|
38
|
+
/** Snap to items after scrolling; on by default except for uncontained layouts */
|
|
27
39
|
snap?: boolean;
|
|
40
|
+
/** Scroll horizontal carousels with a vertical mouse wheel; false by default. */
|
|
28
41
|
wheel?: boolean;
|
|
29
42
|
initialSlide?: number;
|
|
30
43
|
minSmallItemWidth?: number;
|
|
31
44
|
maxSmallItemWidth?: number;
|
|
45
|
+
/** Accessible name of the carousel */
|
|
32
46
|
ariaLabel?: string;
|
|
33
47
|
prefix?: string;
|
|
34
48
|
componentName?: string;
|
|
@@ -45,8 +59,10 @@ export interface CarouselComponent {
|
|
|
45
59
|
prev: () => CarouselComponent;
|
|
46
60
|
goTo: (index: number) => CarouselComponent;
|
|
47
61
|
getCurrentSlide: () => number;
|
|
62
|
+
/** Reads the current model value without changing selection. */
|
|
48
63
|
getValue: () => number;
|
|
49
64
|
getVariant: () => CarouselVariant;
|
|
65
|
+
/** Enable or disable vertical mouse wheel scrolling in place. */
|
|
50
66
|
setWheel: (on: boolean) => CarouselComponent;
|
|
51
67
|
addSlide: (slide: CarouselSlide, index?: number) => CarouselComponent;
|
|
52
68
|
removeSlide: (index: number) => CarouselComponent;
|