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,3 +1,8 @@
|
|
|
1
|
+
/** Checkbox Component Implementation This module implements a Material Design 3 checkbox component with support for different visual variants, indeterminate state, and configurable label positioning. */
|
|
1
2
|
import { CheckboxConfig, CheckboxComponent } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new Checkbox component with the specified configuration.
|
|
5
|
+
* @param config
|
|
6
|
+
*/
|
|
2
7
|
declare const createCheckbox: (config?: CheckboxConfig) => CheckboxComponent;
|
|
3
8
|
export default createCheckbox;
|
|
@@ -1,16 +1,29 @@
|
|
|
1
|
+
/** Label position options for the checkbox Controls whether the label appears before or after the checkbox. */
|
|
1
2
|
export declare const CHECKBOX_LABEL_POSITION: {
|
|
3
|
+
/** Label appears before (to the left of) the checkbox */
|
|
2
4
|
readonly START: "start";
|
|
5
|
+
/** Label appears after (to the right of) the checkbox (default) */
|
|
3
6
|
readonly END: "end";
|
|
4
7
|
};
|
|
8
|
+
/** Checkbox state classes These classes are applied to the checkbox element to reflect its current state. */
|
|
5
9
|
export declare const CHECKBOX_STATES: {
|
|
10
|
+
/** Applied when the checkbox is checked */
|
|
6
11
|
readonly CHECKED: "checked";
|
|
12
|
+
/** Applied when the checkbox is in indeterminate state */
|
|
7
13
|
readonly INDETERMINATE: "indeterminate";
|
|
14
|
+
/** Applied when the checkbox is disabled */
|
|
8
15
|
readonly DISABLED: "disabled";
|
|
16
|
+
/** Applied when the checkbox has focus */
|
|
9
17
|
readonly FOCUSED: "focused";
|
|
10
18
|
};
|
|
19
|
+
/** Checkbox element classes These classes are applied to different parts of the checkbox component. */
|
|
11
20
|
export declare const CHECKBOX_CLASSES: {
|
|
21
|
+
/** The main checkbox container element */
|
|
12
22
|
readonly ROOT: "checkbox";
|
|
23
|
+
/** The actual input element (usually hidden) */
|
|
13
24
|
readonly INPUT: "checkbox__input";
|
|
25
|
+
/** The visual checkbox icon */
|
|
14
26
|
readonly ICON: "checkbox__icon";
|
|
27
|
+
/** The text label associated with the checkbox */
|
|
15
28
|
readonly LABEL: "checkbox__label";
|
|
16
29
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Checkbox Component Module A Material Design 3 checkbox implementation with support for different variants, indeterminate state, and label positioning. */
|
|
1
2
|
export { default, default as createCheckbox } from "./checkbox.js";
|
|
2
3
|
export type { CheckboxConfig, CheckboxComponent, CheckboxEvents, CheckboxChangePayload, CheckboxLabelPosition } from "./types.js";
|
|
4
|
+
/** Constants for checkbox configuration Use these constants instead of string literals for better code completion, type safety, and to follow best practices. */
|
|
3
5
|
export { CHECKBOX_LABEL_POSITION, CHECKBOX_STATES, CHECKBOX_CLASSES } from "./constants.js";
|
|
@@ -1,53 +1,144 @@
|
|
|
1
1
|
import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
2
2
|
import type { EventCallback } from "../../core/state/emitter.js";
|
|
3
|
+
/** Checkbox label position types - controls where the label appears */
|
|
3
4
|
export type CheckboxLabelPosition = "start" | "end";
|
|
5
|
+
/** Configuration interface for the Checkbox component */
|
|
4
6
|
export interface CheckboxConfig {
|
|
7
|
+
/** Input name attribute, used for form submission */
|
|
5
8
|
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Initial checked state
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
6
13
|
checked?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Initial indeterminate state (partially checked)
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
7
18
|
indeterminate?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether input is required for form validation
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
8
23
|
required?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether checkbox is disabled (non-interactive)
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
9
28
|
disabled?: boolean;
|
|
29
|
+
/** Input value attribute, used for form submission */
|
|
10
30
|
value?: string;
|
|
31
|
+
/** Label text displayed next to the checkbox */
|
|
11
32
|
label?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Label position (start/end)
|
|
35
|
+
* @default "end"
|
|
36
|
+
*/
|
|
12
37
|
labelPosition?: CheckboxLabelPosition | string;
|
|
38
|
+
/**
|
|
39
|
+
* Error state: the outline, the selected container and the state layers take the error role, and the input is marked `aria-invalid`.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
13
42
|
error?: boolean;
|
|
43
|
+
/** Accessible name when there is no visible label */
|
|
14
44
|
ariaLabel?: string;
|
|
45
|
+
/** Whether Enter toggles as Space does. */
|
|
15
46
|
enterToggles?: boolean;
|
|
47
|
+
/** Additional CSS classes to apply to the checkbox */
|
|
16
48
|
class?: string;
|
|
49
|
+
/**
|
|
50
|
+
* CSS class prefix for all checkbox classes
|
|
51
|
+
* @default "mtrl"
|
|
52
|
+
*/
|
|
17
53
|
prefix?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Component name used in CSS class generation
|
|
56
|
+
* @default "checkbox"
|
|
57
|
+
*/
|
|
18
58
|
componentName?: string;
|
|
19
59
|
}
|
|
60
|
+
/** A checked-state change from native input activation. */
|
|
20
61
|
export interface CheckboxChangePayload {
|
|
62
|
+
/** The new checked state. */
|
|
21
63
|
checked: boolean;
|
|
64
|
+
/** The checked model value, matching getValue() at dispatch. */
|
|
22
65
|
value: boolean;
|
|
66
|
+
/** The input's HTML value attribute, used for native form submission. */
|
|
23
67
|
valueAttribute: string;
|
|
68
|
+
/** The original native change event, when supplied by the emitter. */
|
|
24
69
|
nativeEvent?: Event;
|
|
25
70
|
}
|
|
71
|
+
/** Events emitted by the checkbox API. */
|
|
26
72
|
export interface CheckboxEvents extends TouchEvents {
|
|
27
73
|
change: (payload: CheckboxChangePayload) => void;
|
|
28
74
|
}
|
|
75
|
+
/** Checkbox component interface */
|
|
29
76
|
export interface CheckboxComponent {
|
|
77
|
+
/** The checkbox's root DOM element (container) */
|
|
30
78
|
element: HTMLElement;
|
|
79
|
+
/** The actual input element (native checkbox) */
|
|
31
80
|
input: HTMLInputElement;
|
|
81
|
+
/** Gets the checkbox's checked state (boolean) for form compatibility */
|
|
32
82
|
getValue: () => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the checkbox's checked state.
|
|
85
|
+
* @param value
|
|
86
|
+
*/
|
|
33
87
|
setValue: (value: boolean | string) => CheckboxComponent;
|
|
88
|
+
/** Gets the HTML value attribute (rarely needed) */
|
|
34
89
|
getValueAttribute: () => string;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the HTML value attribute (rarely needed)
|
|
92
|
+
* @param value
|
|
93
|
+
*/
|
|
35
94
|
setValueAttribute: (value: string) => CheckboxComponent;
|
|
95
|
+
/** Checks the checkbox (sets checked=true). */
|
|
36
96
|
check: () => CheckboxComponent;
|
|
97
|
+
/** Unchecks the checkbox (sets checked=false). */
|
|
37
98
|
uncheck: () => CheckboxComponent;
|
|
99
|
+
/** Toggles the checkbox's checked state. */
|
|
38
100
|
toggle: () => CheckboxComponent;
|
|
101
|
+
/** Checks if the checkbox is currently checked */
|
|
39
102
|
isChecked: () => boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Sets the checkbox's indeterminate state
|
|
105
|
+
* @param state
|
|
106
|
+
*/
|
|
40
107
|
setIndeterminate: (state: boolean) => CheckboxComponent;
|
|
108
|
+
/**
|
|
109
|
+
* Sets or clears the error state
|
|
110
|
+
* @param error
|
|
111
|
+
*/
|
|
41
112
|
setError: (error: boolean) => CheckboxComponent;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the checkbox's label text
|
|
115
|
+
* @param text
|
|
116
|
+
*/
|
|
42
117
|
setLabel: (text: string) => CheckboxComponent;
|
|
118
|
+
/** Gets the checkbox's current label text */
|
|
43
119
|
getLabel: () => string;
|
|
120
|
+
/**
|
|
121
|
+
* Adds an event listener to the checkbox
|
|
122
|
+
* @param event
|
|
123
|
+
* @param handler
|
|
124
|
+
*/
|
|
44
125
|
on: <K extends keyof CheckboxEvents>(event: K, handler: CheckboxEvents[K]) => CheckboxComponent;
|
|
126
|
+
/**
|
|
127
|
+
* Removes an event listener from the checkbox
|
|
128
|
+
* @param event
|
|
129
|
+
* @param handler
|
|
130
|
+
*/
|
|
45
131
|
off: <K extends keyof CheckboxEvents>(event: K, handler: CheckboxEvents[K]) => CheckboxComponent;
|
|
132
|
+
/** Enables the checkbox, making it interactive */
|
|
46
133
|
enable: () => CheckboxComponent;
|
|
134
|
+
/** Disables the checkbox, making it non-interactive */
|
|
47
135
|
disable: () => CheckboxComponent;
|
|
136
|
+
/** Whether the checkbox is disabled */
|
|
48
137
|
isDisabled: () => boolean;
|
|
138
|
+
/** Destroys the checkbox component and cleans up resources */
|
|
49
139
|
destroy: () => void;
|
|
50
140
|
}
|
|
141
|
+
/** API options interface for internal use */
|
|
51
142
|
export interface ApiOptions {
|
|
52
143
|
disabled: {
|
|
53
144
|
enable: () => void;
|
|
@@ -64,6 +155,7 @@ export interface ApiOptions {
|
|
|
64
155
|
isChecked: () => boolean;
|
|
65
156
|
};
|
|
66
157
|
}
|
|
158
|
+
/** Base component interface for internal composition */
|
|
67
159
|
export interface BaseComponent {
|
|
68
160
|
element: HTMLElement;
|
|
69
161
|
input?: HTMLInputElement;
|
|
@@ -92,7 +184,9 @@ export interface BaseComponent {
|
|
|
92
184
|
isChecked: () => boolean;
|
|
93
185
|
};
|
|
94
186
|
}
|
|
187
|
+
/** Component as it reaches the API step of the pipeline. */
|
|
95
188
|
export type ApiComponent = BaseComponent & Required<Pick<BaseComponent, "checkable" | "disabled" | "lifecycle">>;
|
|
189
|
+
/** Registers CheckboxConfig with the global defaults map, so `setComponentDefaults("checkbox", ...)` is typed without core importing anything from this component. */
|
|
96
190
|
declare module "../../core/config/global" {
|
|
97
191
|
interface ComponentConfigMap {
|
|
98
192
|
checkbox?: Partial<CheckboxConfig>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { ChipsConfig, ChipsComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a chips container for grouping related chips Chips follows a clear architectural pattern: 1.
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
2
6
|
declare const createChips: (config?: ChipsConfig) => ChipsComponent;
|
|
3
7
|
export default createChips;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { AssistChipConfig, FilterChipConfig, InputChipConfig, SuggestionChipConfig, ChipComponent } from "./types.js";
|
|
2
|
+
/** Action chip; flat and outlined by default. */
|
|
2
3
|
export declare const createAssistChip: (config: AssistChipConfig) => ChipComponent;
|
|
4
|
+
/** Toggleable filter; selected chips show a checkmark. */
|
|
3
5
|
export declare const createFilterChip: (config: FilterChipConfig) => ChipComponent;
|
|
6
|
+
/** Selectable input token with an optional independent removal action. */
|
|
4
7
|
export declare const createInputChip: (config: InputChipConfig) => ChipComponent;
|
|
8
|
+
/** Suggested action; flat and outlined by default. */
|
|
5
9
|
export declare const createSuggestionChip: (config: SuggestionChipConfig) => ChipComponent;
|
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
import type { EventCallback } from "../../core/state/emitter.js";
|
|
2
2
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
3
3
|
export type ChipType = "assist" | "filter" | "input" | "suggestion";
|
|
4
|
+
/** Shared chip options. */
|
|
4
5
|
export interface ChipConfig {
|
|
5
6
|
type?: ChipType;
|
|
6
7
|
label?: string;
|
|
8
|
+
/** Accessible name for the primary focus target. */
|
|
7
9
|
ariaLabel?: string;
|
|
8
10
|
value?: string;
|
|
9
11
|
disabled?: boolean;
|
|
12
|
+
/** In a single-select set, selecting this chip replaces the previous selection; the last selected config wins. */
|
|
10
13
|
selected?: boolean;
|
|
14
|
+
/** Elevated styling is supported by assist, filter and suggestion chips. */
|
|
11
15
|
elevated?: boolean;
|
|
16
|
+
/** Markup (HTML). */
|
|
12
17
|
leadingIcon?: string;
|
|
18
|
+
/** Markup (HTML). */
|
|
13
19
|
icon?: string;
|
|
20
|
+
/** Markup (HTML). */
|
|
14
21
|
trailingIcon?: string;
|
|
22
|
+
/** Decorative avatar for an input chip; takes precedence over leadingIcon. */
|
|
15
23
|
avatar?: string;
|
|
24
|
+
/** Called when an input chip is removed, from its remove button or with Backspace or Delete. */
|
|
16
25
|
onRemove?: ChipEvents["remove"];
|
|
17
26
|
removeLabel?: string;
|
|
27
|
+
/** Filter chips: gives the trailing icon its own button, which calls this (the m3.material.io chips' trailing icon that "can be used to open a menu or remove the chip"). */
|
|
18
28
|
onTrailingClick?: ChipEvents["trailing"];
|
|
29
|
+
/** The trailing button's accessible name; "{label} options" for a menu, "Remove {label}" otherwise. */
|
|
19
30
|
trailingLabel?: string;
|
|
31
|
+
/** The trailing button opens a menu: aria-haspopup="menu", and a drop-down arrow unless trailingIcon is set. */
|
|
20
32
|
trailingMenu?: boolean;
|
|
33
|
+
/** Same payload as a `click` listener. */
|
|
21
34
|
onClick?: ChipEvents["click"];
|
|
35
|
+
/** Same payload as a `change` listener: `{ selected, chip, value }`. */
|
|
22
36
|
onChange?: ChipEvents["change"];
|
|
37
|
+
/** Called with the chip when the user toggles a selectable chip, not when a `selectionRequired` set refuses the click. */
|
|
23
38
|
onSelect?: (chip: ChipComponent) => void;
|
|
24
39
|
class?: string;
|
|
25
40
|
prefix?: string;
|
|
@@ -27,9 +42,13 @@ export interface ChipConfig {
|
|
|
27
42
|
ripple?: boolean;
|
|
28
43
|
}
|
|
29
44
|
export interface ChipOptions extends ChipConfig {
|
|
45
|
+
/** Selection belongs to the chips container. */
|
|
30
46
|
managedSelection?: boolean;
|
|
47
|
+
/** Notify the owning set when a chip becomes selected. */
|
|
31
48
|
onSelected?: (chip: ChipComponent) => void;
|
|
49
|
+
/** The owning set removes the chip, once its `remove` listeners have run. */
|
|
32
50
|
onRemoved?: (chip: ChipComponent) => void;
|
|
51
|
+
/** The chip is a cell of a chip set's grid: the root is a `gridcell`, and a one-action chip's cell is its focus target. */
|
|
33
52
|
cell?: boolean;
|
|
34
53
|
}
|
|
35
54
|
type NamedChipConfig = Omit<ChipConfig, "type" | "text" | "selected" | "avatar" | "onRemove" | "removeLabel" | "onChange" | "onSelect" | "onTrailingClick" | "trailingLabel" | "trailingMenu"> & {
|
|
@@ -42,6 +61,7 @@ export type InputChipConfig = Omit<FilterChipConfig, "elevated" | "onTrailingCli
|
|
|
42
61
|
export interface ChipChangePayload {
|
|
43
62
|
selected: boolean;
|
|
44
63
|
chip: ChipComponent;
|
|
64
|
+
/** The chip's value, as `getValue()` returns it; every model event carries it */
|
|
45
65
|
value: string | null;
|
|
46
66
|
}
|
|
47
67
|
export interface ChipEvents {
|
|
@@ -51,11 +71,15 @@ export interface ChipEvents {
|
|
|
51
71
|
blur: (payload: ForwardedEventPayload<FocusEvent, HTMLElement>) => void;
|
|
52
72
|
change: (payload: ChipChangePayload) => void;
|
|
53
73
|
remove: (chip: ChipComponent) => void;
|
|
74
|
+
/** A filter chip's trailing button was activated. */
|
|
54
75
|
trailing: (chip: ChipComponent) => void;
|
|
55
76
|
}
|
|
77
|
+
/** Shared API. */
|
|
56
78
|
export interface ChipComponent {
|
|
57
79
|
element: HTMLElement;
|
|
80
|
+
/** Native primary action. */
|
|
58
81
|
action: HTMLButtonElement;
|
|
82
|
+
/** A filter chip's trailing button, when it has one (`onTrailingClick`): anchor a menu to it and keep its aria-expanded in step. */
|
|
59
83
|
trailingAction?: HTMLButtonElement;
|
|
60
84
|
getType: () => ChipType;
|
|
61
85
|
getValue: () => string | null;
|
|
@@ -65,6 +89,7 @@ export interface ChipComponent {
|
|
|
65
89
|
isDisabled: () => boolean;
|
|
66
90
|
setLabel: (label: string) => ChipComponent;
|
|
67
91
|
getLabel: () => string;
|
|
92
|
+
/** Alias of setLabel for chips-container consumers. */
|
|
68
93
|
setText: (text: string) => ChipComponent;
|
|
69
94
|
getText: () => string;
|
|
70
95
|
setIcon: (icon: string) => ChipComponent;
|
|
@@ -72,6 +97,7 @@ export interface ChipComponent {
|
|
|
72
97
|
setLeadingIcon: (icon: string) => ChipComponent;
|
|
73
98
|
setTrailingIcon: (icon: string) => ChipComponent;
|
|
74
99
|
isSelected: () => boolean;
|
|
100
|
+
/** Selects or deselects this chip silently. */
|
|
75
101
|
setSelected: (selected: boolean) => ChipComponent;
|
|
76
102
|
toggleSelected: () => ChipComponent;
|
|
77
103
|
focus: () => ChipComponent;
|
|
@@ -80,27 +106,67 @@ export interface ChipComponent {
|
|
|
80
106
|
off: <K extends keyof ChipEvents>(event: K, handler: ChipEvents[K]) => ChipComponent;
|
|
81
107
|
addClass: (...classes: string[]) => ChipComponent;
|
|
82
108
|
}
|
|
109
|
+
/** Configuration interface for the Chips component */
|
|
83
110
|
export interface ChipsConfig {
|
|
111
|
+
/**
|
|
112
|
+
* Array of chip configurations to initialize
|
|
113
|
+
* @default []
|
|
114
|
+
*/
|
|
84
115
|
chips?: ChipConfig[];
|
|
116
|
+
/**
|
|
117
|
+
* Whether the chip set is horizontally scrollable
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
85
120
|
scrollable?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the chip set is vertically stacked
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
86
125
|
vertical?: boolean;
|
|
126
|
+
/** Additional CSS classes */
|
|
87
127
|
class?: string;
|
|
128
|
+
/** CSS selector for filtering behavior */
|
|
88
129
|
selector?: string | null;
|
|
130
|
+
/**
|
|
131
|
+
* Whether several chips can be selected at once.
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
89
134
|
multiSelect?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the set keeps at least one chip selected: deselecting the last selected chip is refused, and a refused click emits no `change`, on the chip or on the set.
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
90
139
|
selectionRequired?: boolean;
|
|
140
|
+
/** Same payload as an `on("change")` listener. */
|
|
91
141
|
onChange?: ChipsEvents["change"];
|
|
142
|
+
/**
|
|
143
|
+
* Component prefix for class names
|
|
144
|
+
* @default 'mtrl'
|
|
145
|
+
*/
|
|
92
146
|
prefix?: string;
|
|
147
|
+
/** Label text for the chips container */
|
|
93
148
|
label?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Position of the label (start or end)
|
|
151
|
+
* @default 'start'
|
|
152
|
+
*/
|
|
94
153
|
labelPosition?: "start" | "end";
|
|
154
|
+
/** Schema definition for the component structure */
|
|
95
155
|
schema?: unknown;
|
|
156
|
+
/** Event handlers for component events */
|
|
96
157
|
on?: Partial<ChipsEvents>;
|
|
97
158
|
}
|
|
159
|
+
/** Chips component interface */
|
|
160
|
+
/** What a chips feature needs from the component it is handed. */
|
|
98
161
|
export interface ChipsFeatureComponent {
|
|
99
162
|
element: HTMLElement;
|
|
100
163
|
getClass: (name: string) => string;
|
|
101
164
|
emit?: (event: string, data: unknown) => unknown;
|
|
165
|
+
/** withDom builds this; the controller appends chips to it */
|
|
102
166
|
chipContainer?: HTMLElement;
|
|
167
|
+
/** withChipItems keeps the live chips here. */
|
|
103
168
|
chipInstances: ChipComponent[];
|
|
169
|
+
/** withContainer installs this whole, so the members are not optional in it */
|
|
104
170
|
layout?: {
|
|
105
171
|
isVertical: () => boolean;
|
|
106
172
|
isScrollable: () => boolean;
|
|
@@ -110,52 +176,126 @@ export interface ChipsFeatureComponent {
|
|
|
110
176
|
destroy: () => void;
|
|
111
177
|
};
|
|
112
178
|
}
|
|
179
|
+
/** The handlers the chips controller keeps per event name. */
|
|
113
180
|
export type ChipsEventListeners = Record<string, EventCallback[]>;
|
|
181
|
+
/** The payload of the chips set's `change`. */
|
|
114
182
|
export interface ChipsChangeEvent {
|
|
183
|
+
/** The selection in the `value` property's shape: a string or null for a single-select set, an array for a multi-select one. */
|
|
115
184
|
value: string | string[] | null;
|
|
185
|
+
/** The values of the selected chips, in chip order (a chip without a value gives null) */
|
|
116
186
|
selected: (string | null)[];
|
|
187
|
+
/** The value of the chip the user toggled; null for a change made by a method */
|
|
117
188
|
changed: string | null;
|
|
118
189
|
}
|
|
190
|
+
/** A chip joined the set; `value` is the selection after insertion. */
|
|
119
191
|
export interface ChipsAddEvent {
|
|
120
192
|
value: string | string[] | null;
|
|
121
193
|
chip: ChipComponent;
|
|
122
194
|
}
|
|
195
|
+
/** A chip left the set; `value` is the remaining selection. */
|
|
123
196
|
export interface ChipsRemoveEvent extends ChipsAddEvent {
|
|
197
|
+
/** The selection after removal, in the same shape as the set's `getValue()`. */
|
|
124
198
|
value: string | string[] | null;
|
|
199
|
+
/** The removed chip's value, captured before destruction. */
|
|
125
200
|
chipValue: string | null;
|
|
126
201
|
}
|
|
202
|
+
/** Events emitted by the chips container's controller. */
|
|
127
203
|
export interface ChipsEvents {
|
|
204
|
+
/** The selection after the change. */
|
|
128
205
|
change: (event: ChipsChangeEvent) => void;
|
|
206
|
+
/** The newly created chip and the selection after insertion. */
|
|
129
207
|
add: (event: ChipsAddEvent) => void;
|
|
208
|
+
/** The removed chip and the selection after removal. */
|
|
130
209
|
remove: (event: ChipsRemoveEvent) => void;
|
|
131
210
|
}
|
|
132
211
|
export interface ChipsComponent {
|
|
212
|
+
/** The chips container's DOM element */
|
|
133
213
|
element: HTMLElement;
|
|
214
|
+
/**
|
|
215
|
+
* Adds a new chip to the chips container.
|
|
216
|
+
* @param chipConfig
|
|
217
|
+
*/
|
|
134
218
|
addChip: (chipConfig: ChipConfig) => ChipsComponent;
|
|
219
|
+
/**
|
|
220
|
+
* Removes a chip from the chips container
|
|
221
|
+
* @param chipOrIndex
|
|
222
|
+
*/
|
|
135
223
|
removeChip: (chipOrIndex: ChipComponent | number) => ChipsComponent;
|
|
224
|
+
/** Gets all chip instances in the set */
|
|
136
225
|
getChips: () => ChipComponent[];
|
|
226
|
+
/** Gets currently selected chips */
|
|
137
227
|
getSelectedChips: () => ChipComponent[];
|
|
228
|
+
/** Gets the values of selected chips */
|
|
138
229
|
getSelectedValues: () => (string | null)[];
|
|
230
|
+
/** Gets the current value - form field compatibility */
|
|
139
231
|
getValue: () => string | string[] | null;
|
|
232
|
+
/**
|
|
233
|
+
* Sets the value by selecting chips by value, without a change event - form field compatibility
|
|
234
|
+
* @param values
|
|
235
|
+
*/
|
|
140
236
|
setValue: (values: string | string[] | null | undefined) => ChipsComponent;
|
|
237
|
+
/**
|
|
238
|
+
* Selects chips by their values
|
|
239
|
+
* @param values
|
|
240
|
+
* @param triggerEvent
|
|
241
|
+
*/
|
|
141
242
|
selectByValue: (values: string | string[], triggerEvent?: boolean) => ChipsComponent;
|
|
243
|
+
/** Clears all selections. */
|
|
142
244
|
clearSelection: () => ChipsComponent;
|
|
245
|
+
/**
|
|
246
|
+
* Sets the scrollable state of the chips container
|
|
247
|
+
* @param isScrollable
|
|
248
|
+
*/
|
|
143
249
|
setScrollable: (isScrollable: boolean) => ChipsComponent;
|
|
250
|
+
/**
|
|
251
|
+
* Sets the vertical layout state
|
|
252
|
+
* @param isVertical
|
|
253
|
+
*/
|
|
144
254
|
setVertical: (isVertical: boolean) => ChipsComponent;
|
|
255
|
+
/**
|
|
256
|
+
* Sets the label text
|
|
257
|
+
* @param text
|
|
258
|
+
*/
|
|
145
259
|
setLabel: (text: string) => ChipsComponent;
|
|
260
|
+
/** Gets the label text */
|
|
146
261
|
getLabel: () => string;
|
|
262
|
+
/**
|
|
263
|
+
* Sets the label position
|
|
264
|
+
* @param position
|
|
265
|
+
*/
|
|
147
266
|
setLabelPosition: (position: "start" | "end") => ChipsComponent;
|
|
267
|
+
/** Gets the label position */
|
|
148
268
|
getLabelPosition: () => string;
|
|
269
|
+
/**
|
|
270
|
+
* Scrolls to a specific chip.
|
|
271
|
+
* @param chipOrIndex
|
|
272
|
+
*/
|
|
149
273
|
scrollToChip: (chipOrIndex: ChipComponent | number) => ChipsComponent;
|
|
274
|
+
/** Enables keyboard navigation between chips in the set */
|
|
150
275
|
enableKeyboardNavigation: () => ChipsComponent;
|
|
276
|
+
/** Turns keyboard navigation between the chips on and off: while disabled, */
|
|
151
277
|
keyboard: {
|
|
278
|
+
/** Moves focus with the arrows, Home and End again */
|
|
152
279
|
enable: () => void;
|
|
280
|
+
/** Stops moving focus with the arrows, Home and End */
|
|
153
281
|
disable: () => void;
|
|
154
282
|
};
|
|
283
|
+
/** Destroys the chips container and all contained chips */
|
|
155
284
|
destroy: () => void;
|
|
285
|
+
/**
|
|
286
|
+
* Adds an event listener to the chips container
|
|
287
|
+
* @param event
|
|
288
|
+
* @param handler
|
|
289
|
+
*/
|
|
156
290
|
on: <K extends keyof ChipsEvents>(event: K, handler: ChipsEvents[K]) => ChipsComponent;
|
|
291
|
+
/**
|
|
292
|
+
* Removes an event listener from the chips container
|
|
293
|
+
* @param event
|
|
294
|
+
* @param handler
|
|
295
|
+
*/
|
|
157
296
|
off: <K extends keyof ChipsEvents>(event: K, handler: ChipsEvents[K]) => ChipsComponent;
|
|
158
297
|
}
|
|
298
|
+
/** Registers ChipConfig with the global defaults map, so `setComponentDefaults("chip", ...)` is typed without core importing anything from this component. */
|
|
159
299
|
declare module "../../core/config/global" {
|
|
160
300
|
interface ComponentConfigMap {
|
|
161
301
|
chip?: Partial<ChipConfig>;
|
|
@@ -1,45 +1,83 @@
|
|
|
1
|
+
/** DatePicker variants */
|
|
1
2
|
export declare const DATEPICKER_VARIANTS: {
|
|
3
|
+
/** Docked datepicker appears inline on the page */
|
|
2
4
|
readonly DOCKED: "docked";
|
|
5
|
+
/** Modal datepicker appears in a dialog overlay */
|
|
3
6
|
readonly MODAL: "modal";
|
|
7
|
+
/** Modal with input field for entering dates */
|
|
4
8
|
readonly MODAL_INPUT: "modal-input";
|
|
5
9
|
};
|
|
10
|
+
/** DatePicker views */
|
|
6
11
|
export declare const DATEPICKER_VIEWS: {
|
|
12
|
+
/** Daily calendar grid view */
|
|
7
13
|
readonly DAY: "day";
|
|
14
|
+
/** Month selection view */
|
|
8
15
|
readonly MONTH: "month";
|
|
16
|
+
/** Year selection view */
|
|
9
17
|
readonly YEAR: "year";
|
|
10
18
|
};
|
|
19
|
+
/** DatePicker selection modes */
|
|
11
20
|
export declare const DATEPICKER_SELECTION_MODES: {
|
|
21
|
+
/** Select a single date */
|
|
12
22
|
readonly SINGLE: "single";
|
|
23
|
+
/** Select a date range */
|
|
13
24
|
readonly RANGE: "range";
|
|
14
25
|
};
|
|
26
|
+
/** Day names for the calendar */
|
|
15
27
|
export declare const DAY_NAMES: string[];
|
|
28
|
+
/** Month names for the calendar */
|
|
16
29
|
export declare const MONTH_NAMES: string[];
|
|
30
|
+
/** Month names abbreviated */
|
|
17
31
|
export declare const MONTH_NAMES_SHORT: string[];
|
|
32
|
+
/** Default format for displaying dates */
|
|
18
33
|
export declare const DEFAULT_DATE_FORMAT = "MM/DD/YYYY";
|
|
34
|
+
/** DatePicker CSS class names */
|
|
19
35
|
export declare const DATEPICKER_CLASSES: {
|
|
36
|
+
/** Root container class */
|
|
20
37
|
readonly ROOT: "datepicker";
|
|
38
|
+
/** Class for the input field */
|
|
21
39
|
readonly INPUT: "datepicker__input";
|
|
40
|
+
/** Class for the calendar container */
|
|
22
41
|
readonly CALENDAR: "datepicker__calendar";
|
|
42
|
+
/** Class for the header section */
|
|
23
43
|
readonly HEADER: "datepicker__header";
|
|
44
|
+
/** Class for the month/year navigation */
|
|
24
45
|
readonly NAVIGATION: "datepicker__navigation";
|
|
46
|
+
/** Class for the day names row */
|
|
25
47
|
readonly WEEKDAYS: "datepicker__weekdays";
|
|
48
|
+
/** Class for the days grid */
|
|
26
49
|
readonly DAYS: "datepicker__days";
|
|
50
|
+
/** Class for individual day cells */
|
|
27
51
|
readonly DAY: "datepicker__day";
|
|
52
|
+
/** Class for today's date */
|
|
28
53
|
readonly TODAY: "datepicker__day--today";
|
|
54
|
+
/** Class for selected date */
|
|
29
55
|
readonly SELECTED: "datepicker__day--selected";
|
|
56
|
+
/** Class for disabled dates */
|
|
30
57
|
readonly DISABLED: "datepicker__day--disabled";
|
|
58
|
+
/** Class for dates outside the current month */
|
|
31
59
|
readonly OUTSIDE_MONTH: "datepicker__day--outside";
|
|
60
|
+
/** Class for first date in a range */
|
|
32
61
|
readonly RANGE_START: "datepicker__cell--range-start";
|
|
62
|
+
/** Class for last date in a range */
|
|
33
63
|
readonly RANGE_END: "datepicker__cell--range-end";
|
|
64
|
+
/** Class for dates between start and end in a range */
|
|
34
65
|
readonly RANGE_MIDDLE: "datepicker__cell--range";
|
|
35
66
|
};
|
|
67
|
+
/** DatePicker events */
|
|
36
68
|
export declare const DATEPICKER_EVENTS: {
|
|
69
|
+
/** Fired when the selected date changes */
|
|
37
70
|
readonly CHANGE: "change";
|
|
71
|
+
/** Fired when the datepicker opens */
|
|
38
72
|
readonly OPEN: "open";
|
|
73
|
+
/** Fired when the datepicker closes */
|
|
39
74
|
readonly CLOSE: "close";
|
|
75
|
+
/** Fired when a day is clicked/focused */
|
|
40
76
|
readonly SELECT: "select";
|
|
77
|
+
/** Fired when the view changes (day/month/year) */
|
|
41
78
|
readonly VIEW_CHANGE: "viewChange";
|
|
42
79
|
};
|
|
80
|
+
/** Internal SVG assets; accessible names are on their buttons. */
|
|
43
81
|
export declare const DATEPICKER_ICONS: {
|
|
44
82
|
readonly calendar: "<svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM5 10h14v10H5V10Zm0-4h14v2H5V6Zm2 6h4v4H7v-4Z\"/></svg>";
|
|
45
83
|
readonly edit: "<svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"m3 17.25 11.06-11.06 3.75 3.75L6.75 21H3v-3.75ZM20.71 7.04l-1.83 1.83-3.75-3.75 1.83-1.83a1 1 0 0 1 1.41 0l2.34 2.34a1 1 0 0 1 0 1.41Z\"/></svg>";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { DatePickerComponent, DatePickerConfig, DatePickerValueOf } from "./types.js";
|
|
2
|
+
/** M3 calendar/input modes share a draft; modal acceptance is the commit boundary. */
|
|
3
|
+
/** The value's type follows a literal selectionMode: `'range'` makes it a pair, the default a date. */
|
|
2
4
|
declare const createDatePicker: <M extends string = "single">(config?: DatePickerConfig & {
|
|
3
5
|
selectionMode?: M;
|
|
4
6
|
}) => DatePickerComponent<DatePickerValueOf<M>>;
|