material 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/badge/badge.d.ts +4 -0
- package/dist/components/badge/constants.d.ts +4 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/types.d.ts +102 -0
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +4 -0
- package/dist/components/bottom-app-bar/constants.d.ts +3 -0
- package/dist/components/bottom-app-bar/types.d.ts +42 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
- package/dist/components/bottom-sheet/constants.d.ts +9 -0
- package/dist/components/bottom-sheet/types.d.ts +52 -0
- package/dist/components/button/button.d.ts +4 -0
- package/dist/components/button/constants.d.ts +20 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/types.d.ts +190 -0
- package/dist/components/button-group/button-group.d.ts +4 -0
- package/dist/components/button-group/constants.d.ts +54 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/types.d.ts +125 -0
- package/dist/components/card/card.d.ts +4 -0
- package/dist/components/card/constants.d.ts +11 -0
- package/dist/components/card/content.d.ts +16 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/types.d.ts +123 -0
- package/dist/components/carousel/carousel.d.ts +1 -0
- package/dist/components/carousel/constants.d.ts +10 -0
- package/dist/components/carousel/types.d.ts +16 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -0
- package/dist/components/checkbox/constants.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/types.d.ts +94 -0
- package/dist/components/chips/chips.d.ts +4 -0
- package/dist/components/chips/constants.d.ts +1 -0
- package/dist/components/chips/factories.d.ts +4 -0
- package/dist/components/chips/types.d.ts +140 -0
- package/dist/components/datepicker/constants.d.ts +38 -0
- package/dist/components/datepicker/datepicker.d.ts +2 -0
- package/dist/components/datepicker/types.d.ts +139 -0
- package/dist/components/dialog/constants.d.ts +45 -0
- package/dist/components/dialog/dialog.d.ts +5 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/types.d.ts +196 -0
- package/dist/components/divider/config.d.ts +30 -0
- package/dist/components/divider/constants.d.ts +15 -0
- package/dist/components/divider/divider.d.ts +4 -0
- package/dist/components/divider/types.d.ts +27 -0
- package/dist/components/drawer/constants.d.ts +39 -0
- package/dist/components/drawer/drawer.d.ts +4 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/types.d.ts +109 -0
- package/dist/components/extended-fab/constants.d.ts +32 -0
- package/dist/components/extended-fab/extended-fab.d.ts +4 -0
- package/dist/components/extended-fab/types.d.ts +123 -0
- package/dist/components/fab/constants.d.ts +26 -0
- package/dist/components/fab/fab.d.ts +4 -0
- package/dist/components/fab/types.d.ts +100 -0
- package/dist/components/fab-menu/constants.d.ts +9 -0
- package/dist/components/fab-menu/fab-menu.d.ts +4 -0
- package/dist/components/fab-menu/types.d.ts +41 -0
- package/dist/components/icon-button/constants.d.ts +34 -0
- package/dist/components/icon-button/icon-button.d.ts +4 -0
- package/dist/components/icon-button/types.d.ts +157 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/list/constants.d.ts +30 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/list.d.ts +4 -0
- package/dist/components/list/types.d.ts +110 -0
- package/dist/components/loading-indicator/constants.d.ts +16 -0
- package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
- package/dist/components/loading-indicator/types.d.ts +21 -0
- package/dist/components/menu/constants.d.ts +51 -0
- package/dist/components/menu/features/controller.js +1 -1
- package/dist/components/menu/features/keyboard.js +8 -3
- package/dist/components/menu/features/opener.js +2 -16
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/inner.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +4 -0
- package/dist/components/menu/on-demand.d.ts +9 -0
- package/dist/components/menu/types.d.ts +185 -1
- package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
- package/dist/components/navigation-bar/types.d.ts +12 -0
- package/dist/components/navigation-rail/constants.d.ts +2 -0
- package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
- package/dist/components/navigation-rail/types.d.ts +18 -0
- package/dist/components/progress/constants.d.ts +37 -0
- package/dist/components/progress/progress.d.ts +4 -0
- package/dist/components/progress/types.d.ts +136 -0
- package/dist/components/radios/constants.d.ts +14 -0
- package/dist/components/radios/radios.d.ts +4 -0
- package/dist/components/radios/types.d.ts +89 -0
- package/dist/components/search/constants.d.ts +34 -0
- package/dist/components/search/search.d.ts +4 -0
- package/dist/components/search/types.d.ts +109 -0
- package/dist/components/select/constants.d.ts +46 -0
- package/dist/components/select/features.js +9 -1
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +4 -0
- package/dist/components/select/types.d.ts +95 -0
- package/dist/components/side-sheet/constants.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.d.ts +4 -0
- package/dist/components/side-sheet/types.d.ts +51 -0
- package/dist/components/slider/constants.d.ts +62 -0
- package/dist/components/slider/slider.d.ts +4 -0
- package/dist/components/slider/types.d.ts +78 -0
- package/dist/components/snackbar/constants.d.ts +37 -0
- package/dist/components/snackbar/snackbar.d.ts +5 -0
- package/dist/components/snackbar/types.d.ts +67 -0
- package/dist/components/split-button/api.js +13 -3
- package/dist/components/split-button/constants.d.ts +13 -0
- package/dist/components/split-button/split-button.d.ts +4 -0
- package/dist/components/split-button/types.d.ts +50 -0
- package/dist/components/switch/constants.d.ts +34 -0
- package/dist/components/switch/switch.d.ts +4 -0
- package/dist/components/switch/types.d.ts +55 -0
- package/dist/components/tabs/constants.d.ts +49 -0
- package/dist/components/tabs/indicator.d.ts +22 -0
- package/dist/components/tabs/responsive.d.ts +17 -0
- package/dist/components/tabs/tab.d.ts +5 -0
- package/dist/components/tabs/tabs.d.ts +4 -0
- package/dist/components/tabs/types.d.ts +170 -0
- package/dist/components/tabs/utils.d.ts +24 -0
- package/dist/components/text-field/constants.d.ts +61 -0
- package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
- package/dist/components/text-field/text-field.d.ts +4 -0
- package/dist/components/text-field/types.d.ts +84 -0
- package/dist/components/timepicker/constants.d.ts +61 -0
- package/dist/components/timepicker/types.d.ts +145 -0
- package/dist/components/toolbar/constants.d.ts +8 -0
- package/dist/components/toolbar/toolbar.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +75 -0
- package/dist/components/tooltip/constants.d.ts +43 -0
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +78 -0
- package/dist/components/top-app-bar/constants.d.ts +29 -0
- package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
- package/dist/components/top-app-bar/types.d.ts +55 -0
- package/dist/core/canvas/animation.d.ts +6 -0
- package/dist/core/canvas/drawing.d.ts +47 -0
- package/dist/core/canvas/index.d.ts +1 -0
- package/dist/core/canvas/resize.d.ts +7 -0
- package/dist/core/canvas/utils.d.ts +39 -0
- package/dist/core/compose/base.d.ts +9 -0
- package/dist/core/compose/cleanup.d.ts +2 -0
- package/dist/core/compose/component.d.ts +13 -0
- package/dist/core/compose/features/badge.d.ts +10 -0
- package/dist/core/compose/features/checkable.d.ts +13 -0
- package/dist/core/compose/features/debounce.d.ts +19 -0
- package/dist/core/compose/features/disabled.d.ts +11 -0
- package/dist/core/compose/features/events.d.ts +19 -0
- package/dist/core/compose/features/icon.d.ts +20 -0
- package/dist/core/compose/features/input.d.ts +31 -0
- package/dist/core/compose/features/lifecycle.d.ts +16 -0
- package/dist/core/compose/features/position.d.ts +13 -0
- package/dist/core/compose/features/ripple.d.ts +17 -0
- package/dist/core/compose/features/size.d.ts +5 -0
- package/dist/core/compose/features/style.d.ts +5 -0
- package/dist/core/compose/features/text.d.ts +20 -0
- package/dist/core/compose/features/textinput.d.ts +39 -0
- package/dist/core/compose/features/textlabel.d.ts +18 -0
- package/dist/core/compose/features/throttle.d.ts +18 -0
- package/dist/core/compose/features/track.d.ts +12 -0
- package/dist/core/compose/features/variant.d.ts +5 -0
- package/dist/core/compose/features/withEvents.d.ts +12 -0
- package/dist/core/compose/pipe.d.ts +12 -0
- package/dist/core/compose/utils/type-guards.d.ts +5 -0
- package/dist/core/config/component.d.ts +17 -0
- package/dist/core/config/global.d.ts +15 -0
- package/dist/core/config.d.ts +34 -0
- package/dist/core/dom/attributes.d.ts +25 -0
- package/dist/core/dom/classes.d.ts +24 -0
- package/dist/core/dom/create.d.ts +47 -0
- package/dist/core/dom/events.d.ts +26 -0
- package/dist/core/dom/focus.d.ts +11 -0
- package/dist/core/dom/html.d.ts +6 -0
- package/dist/core/dom/layer.d.ts +36 -0
- package/dist/core/dom/roving.d.ts +7 -0
- package/dist/core/navigation/destinations.d.ts +10 -0
- package/dist/core/shapes/cubic.d.ts +8 -0
- package/dist/core/shapes/material.d.ts +45 -0
- package/dist/core/shapes/polygon.d.ts +11 -0
- package/dist/core/state/emitter.d.ts +19 -0
- package/dist/core/state/events.d.ts +17 -0
- package/dist/core/state/store.d.ts +40 -0
- package/dist/core/theme/shape.d.ts +3 -0
- package/dist/core/theme/tokens.d.ts +6 -0
- package/dist/core/utils/background.d.ts +7 -0
- package/dist/core/utils/color.d.ts +5 -0
- package/dist/core/utils/index.d.ts +9 -0
- package/dist/core/utils/mobile.d.ts +10 -0
- package/dist/core/utils/object.d.ts +9 -0
- package/dist/core/utils/performance.d.ts +20 -0
- package/dist/core/utils/theme.d.ts +8 -0
- package/dist/core/utils/url.d.ts +3 -0
- package/dist/elements/adapter.d.ts +24 -0
- package/dist/elements/badge.d.ts +4 -0
- package/dist/elements/bottom-app-bar.d.ts +4 -0
- package/dist/elements/bottom-sheet.d.ts +6 -0
- package/dist/elements/button-group.d.ts +8 -0
- package/dist/elements/button.d.ts +5 -0
- package/dist/elements/card.d.ts +4 -0
- package/dist/elements/carousel.d.ts +5 -0
- package/dist/elements/checkbox.d.ts +4 -0
- package/dist/elements/chips.d.ts +9 -0
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/datepicker.d.ts +6 -0
- package/dist/elements/define.d.ts +48 -0
- package/dist/elements/dialog.d.ts +5 -0
- package/dist/elements/divider.d.ts +4 -0
- package/dist/elements/drawer.d.ts +6 -0
- package/dist/elements/extended-fab.d.ts +5 -0
- package/dist/elements/fab-menu.d.ts +10 -0
- package/dist/elements/fab.d.ts +5 -0
- package/dist/elements/icon-button.d.ts +6 -0
- package/dist/elements/index.d.ts +4 -0
- package/dist/elements/list.d.ts +8 -0
- package/dist/elements/loading-indicator.d.ts +4 -0
- package/dist/elements/menu.d.ts +12 -0
- package/dist/elements/navigation-bar.d.ts +6 -0
- package/dist/elements/navigation-rail.d.ts +10 -0
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +1 -1
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +1 -1
- package/dist/elements/progress.d.ts +4 -0
- package/dist/elements/radios.d.ts +5 -0
- package/dist/elements/search.d.ts +15 -0
- package/dist/elements/select.d.ts +6 -0
- package/dist/elements/side-sheet.d.ts +5 -0
- package/dist/elements/slider.d.ts +7 -0
- package/dist/elements/snackbar.d.ts +4 -0
- package/dist/elements/split-button.d.ts +8 -0
- package/dist/elements/styles.d.ts +11 -0
- package/dist/elements/switch.d.ts +5 -0
- package/dist/elements/tabs.d.ts +6 -0
- package/dist/elements/text-field.d.ts +9 -0
- package/dist/elements/timepicker.d.ts +9 -0
- package/dist/elements/toolbar.d.ts +4 -0
- package/dist/elements/tooltip.d.ts +4 -0
- package/dist/elements/top-app-bar.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/react/create.d.ts +15 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/jsx.d.ts +3 -0
- package/dist/solid/create.d.ts +16 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/jsx.d.ts +4 -0
- package/dist/ssr/index.d.ts +3 -0
- package/dist/ssr/solid.d.ts +1 -0
- package/dist/ssr/svelte.d.ts +1 -0
- package/dist/ssr/vue.d.ts +1 -0
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/timepicker.css +1 -1
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/svelte/runtime.d.ts +21 -0
- package/dist/theme/image.d.ts +2 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/variants.d.ts +6 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +1 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +39 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +13 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +1 -0
- package/dist/theme/vendor/hct/hct.d.ts +9 -0
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/dist/vue/create.d.ts +18 -0
- package/dist/vue/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/components/_menu.scss +14 -1
|
@@ -1,70 +1,179 @@
|
|
|
1
1
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
2
2
|
import { BaseComponentConfig } from "../../core/config/component.js";
|
|
3
|
+
/** Drawer variant type — controls layout behavior */
|
|
3
4
|
export type DrawerVariant = "standard" | "modal";
|
|
5
|
+
/** Drawer position — which edge the drawer anchors to */
|
|
4
6
|
export type DrawerPosition = "start" | "end";
|
|
7
|
+
/** Configuration for a navigation destination item */
|
|
5
8
|
export interface DrawerItemConfig {
|
|
9
|
+
/** Item type — defaults to 'item' if omitted */
|
|
6
10
|
type?: "item" | "divider" | "section";
|
|
11
|
+
/** Unique identifier for the item */
|
|
7
12
|
id?: string;
|
|
13
|
+
/** Destination label text */
|
|
8
14
|
label?: string;
|
|
15
|
+
/** Icon HTML content (placed before label). */
|
|
9
16
|
icon?: string;
|
|
17
|
+
/** Badge text (e.g. */
|
|
10
18
|
badge?: string;
|
|
19
|
+
/** Whether this item is initially active/selected */
|
|
11
20
|
active?: boolean;
|
|
21
|
+
/** Section label text (only when type is 'section') */
|
|
12
22
|
sectionLabel?: string;
|
|
23
|
+
/** Whether the item is disabled */
|
|
13
24
|
disabled?: boolean;
|
|
14
25
|
}
|
|
26
|
+
/** Event detail emitted when a drawer item is selected */
|
|
15
27
|
export interface DrawerSelectEvent {
|
|
28
|
+
/** The selected item's id */
|
|
16
29
|
id: string;
|
|
30
|
+
/** The id again, as the `value` of the `<m-drawer>` element's `change` */
|
|
17
31
|
value: string;
|
|
32
|
+
/** The selected item's label */
|
|
18
33
|
label: string;
|
|
34
|
+
/** The selected item's index within navigation items (excludes dividers/sections) */
|
|
19
35
|
index: number;
|
|
36
|
+
/** The underlying DOM event */
|
|
20
37
|
originalEvent: Event;
|
|
21
38
|
}
|
|
39
|
+
/** Events emitted by drawer state, navigation items and root DOM forwarding. */
|
|
22
40
|
export interface DrawerEvents {
|
|
23
41
|
open: () => void;
|
|
24
42
|
close: () => void;
|
|
43
|
+
/** User activation only; setActive() is silent. */
|
|
25
44
|
select: (payload: DrawerSelectEvent) => void;
|
|
26
45
|
click: (payload: ForwardedEventPayload<MouseEvent, HTMLElement>) => void;
|
|
27
46
|
keydown: (payload: ForwardedEventPayload<KeyboardEvent, HTMLElement>) => void;
|
|
28
47
|
}
|
|
48
|
+
/** Configuration interface for the Drawer component */
|
|
29
49
|
export interface DrawerConfig extends BaseComponentConfig {
|
|
50
|
+
/**
|
|
51
|
+
* Drawer variant that determines layout behavior
|
|
52
|
+
* @default 'standard'
|
|
53
|
+
*/
|
|
30
54
|
variant?: DrawerVariant | string;
|
|
55
|
+
/**
|
|
56
|
+
* Drawer anchor position
|
|
57
|
+
* @default 'start'
|
|
58
|
+
*/
|
|
31
59
|
position?: DrawerPosition | string;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the drawer is initially open
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
32
64
|
open?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the modal drawer can be dismissed by clicking the scrim, or with Escape.
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
33
69
|
dismissible?: boolean;
|
|
70
|
+
/** `"top"` makes a modal drawer's root a `<dialog>` element, rendered where the drawer is, and opens it with `showModal()`: in the browser's top layer, above every z-index and outside any clipping ancestor, with the rest of the page inert, a shadow root's page included. */
|
|
34
71
|
layer?: "top";
|
|
72
|
+
/** Optional headline text displayed at the top of the drawer */
|
|
35
73
|
headline?: string;
|
|
74
|
+
/** The drawer's accessible name. */
|
|
36
75
|
ariaLabel?: string;
|
|
76
|
+
/** Navigation items configuration array. */
|
|
37
77
|
items?: DrawerItemConfig[];
|
|
78
|
+
/**
|
|
79
|
+
* Drawer width as a CSS value
|
|
80
|
+
* @default 360
|
|
81
|
+
*/
|
|
38
82
|
width?: string | number;
|
|
83
|
+
/**
|
|
84
|
+
* When true, renders a compact drawer with smaller items and tighter spacing.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
39
87
|
dense?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether items show a ripple on press.
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
40
92
|
ripple?: boolean;
|
|
93
|
+
/** Additional CSS classes to add to the drawer */
|
|
41
94
|
class?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Component prefix for class names
|
|
97
|
+
* @default 'mtrl'
|
|
98
|
+
*/
|
|
42
99
|
prefix?: string;
|
|
100
|
+
/** Component name used in class generation */
|
|
43
101
|
componentName?: string;
|
|
102
|
+
/** `select` listener registered at creation. */
|
|
44
103
|
onSelect?: DrawerEvents["select"];
|
|
104
|
+
/** `open` listener registered at creation. */
|
|
45
105
|
onOpen?: DrawerEvents["open"];
|
|
106
|
+
/** `close` listener registered at creation. */
|
|
46
107
|
onClose?: DrawerEvents["close"];
|
|
47
108
|
}
|
|
109
|
+
/** Drawer component interface — public API */
|
|
48
110
|
export interface DrawerComponent {
|
|
111
|
+
/** The drawer's root DOM element */
|
|
49
112
|
element: HTMLElement;
|
|
113
|
+
/**
|
|
114
|
+
* Gets a class name with the component's prefix
|
|
115
|
+
* @param name
|
|
116
|
+
*/
|
|
50
117
|
getClass: (name: string) => string;
|
|
118
|
+
/** Opens the drawer */
|
|
51
119
|
open: () => DrawerComponent;
|
|
120
|
+
/** Closes the drawer */
|
|
52
121
|
close: () => DrawerComponent;
|
|
122
|
+
/** Toggles the drawer open/closed state */
|
|
53
123
|
toggle: () => DrawerComponent;
|
|
124
|
+
/** Checks if the drawer is currently open */
|
|
54
125
|
isOpen: () => boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Sets the active navigation item by id
|
|
128
|
+
* @param id
|
|
129
|
+
*/
|
|
55
130
|
setActive: (id: string) => DrawerComponent;
|
|
131
|
+
/** Gets the currently active item id */
|
|
56
132
|
getActive: () => string | null;
|
|
133
|
+
/** Reads the current model value without changing selection. */
|
|
57
134
|
getValue: () => string | null;
|
|
135
|
+
/**
|
|
136
|
+
* Sets the headline text
|
|
137
|
+
* @param text
|
|
138
|
+
*/
|
|
58
139
|
setHeadline: (text: string) => DrawerComponent;
|
|
140
|
+
/** Gets the headline text */
|
|
59
141
|
getHeadline: () => string;
|
|
142
|
+
/**
|
|
143
|
+
* Sets the navigation items
|
|
144
|
+
* @param items
|
|
145
|
+
*/
|
|
60
146
|
setItems: (items: DrawerItemConfig[]) => DrawerComponent;
|
|
147
|
+
/** Gets the current items configuration */
|
|
61
148
|
getItems: () => DrawerItemConfig[];
|
|
149
|
+
/**
|
|
150
|
+
* Sets a badge on a specific item
|
|
151
|
+
* @param id
|
|
152
|
+
* @param badge
|
|
153
|
+
*/
|
|
62
154
|
setBadge: (id: string, badge: string) => DrawerComponent;
|
|
155
|
+
/**
|
|
156
|
+
* Adds an event listener
|
|
157
|
+
* @param event
|
|
158
|
+
* @param handler
|
|
159
|
+
*/
|
|
63
160
|
on: <K extends keyof DrawerEvents>(event: K, handler: DrawerEvents[K]) => DrawerComponent;
|
|
161
|
+
/**
|
|
162
|
+
* Removes an event listener
|
|
163
|
+
* @param event
|
|
164
|
+
* @param handler
|
|
165
|
+
*/
|
|
64
166
|
off: <K extends keyof DrawerEvents>(event: K, handler: DrawerEvents[K]) => DrawerComponent;
|
|
167
|
+
/**
|
|
168
|
+
* Adds CSS classes to the drawer element
|
|
169
|
+
* @param classes
|
|
170
|
+
*/
|
|
65
171
|
addClass: (...classes: string[]) => DrawerComponent;
|
|
172
|
+
/** Destroys the drawer component and cleans up resources */
|
|
66
173
|
destroy: () => void;
|
|
174
|
+
/** API for managing component lifecycle */
|
|
67
175
|
lifecycle: {
|
|
176
|
+
/** Destroys the component and cleans up resources */
|
|
68
177
|
destroy: () => void;
|
|
69
178
|
};
|
|
70
179
|
}
|
|
@@ -1,46 +1,78 @@
|
|
|
1
|
+
/** Extended FAB variants following Material Design 3 guidelines */
|
|
1
2
|
export declare const EXTENDED_FAB_VARIANTS: {
|
|
3
|
+
/** Primary container colour (default) */
|
|
2
4
|
readonly PRIMARY_CONTAINER: "primary-container";
|
|
5
|
+
/** Secondary container colour */
|
|
3
6
|
readonly SECONDARY_CONTAINER: "secondary-container";
|
|
7
|
+
/** Tertiary container colour */
|
|
4
8
|
readonly TERTIARY_CONTAINER: "tertiary-container";
|
|
9
|
+
/** Primary tone colour */
|
|
5
10
|
readonly PRIMARY: "primary";
|
|
11
|
+
/** Secondary tone colour */
|
|
6
12
|
readonly SECONDARY: "secondary";
|
|
13
|
+
/** Tertiary tone colour */
|
|
7
14
|
readonly TERTIARY: "tertiary";
|
|
8
15
|
};
|
|
16
|
+
/** Expressive extended FAB sizes. */
|
|
9
17
|
export declare const EXTENDED_FAB_SIZES: {
|
|
10
18
|
readonly SMALL: "small";
|
|
11
19
|
readonly MEDIUM: "medium";
|
|
12
20
|
readonly LARGE: "large";
|
|
13
21
|
};
|
|
22
|
+
/** Extended FAB width behavior */
|
|
14
23
|
export declare const EXTENDED_FAB_WIDTH: {
|
|
24
|
+
/** Maintains a constant width regardless of content (default) */
|
|
15
25
|
readonly FIXED: "fixed";
|
|
26
|
+
/** Adjusts width based on content length */
|
|
16
27
|
readonly FLUID: "fluid";
|
|
17
28
|
};
|
|
29
|
+
/** Extended FAB position on the screen */
|
|
18
30
|
export declare const EXTENDED_FAB_POSITIONS: {
|
|
31
|
+
/** Position in the top-right corner */
|
|
19
32
|
readonly TOP_RIGHT: "top-right";
|
|
33
|
+
/** Position in the top-left corner */
|
|
20
34
|
readonly TOP_LEFT: "top-left";
|
|
35
|
+
/** Position in the bottom-right corner (most common for primary actions) */
|
|
21
36
|
readonly BOTTOM_RIGHT: "bottom-right";
|
|
37
|
+
/** Position in the bottom-left corner */
|
|
22
38
|
readonly BOTTOM_LEFT: "bottom-left";
|
|
23
39
|
};
|
|
40
|
+
/** Icon position options */
|
|
24
41
|
export declare const EXTENDED_FAB_ICON_POSITIONS: {
|
|
42
|
+
/** Icon appears before the text (default) */
|
|
25
43
|
readonly START: "start";
|
|
44
|
+
/** Icon appears after the text */
|
|
26
45
|
readonly END: "end";
|
|
27
46
|
};
|
|
47
|
+
/** Extended FAB CSS classes */
|
|
28
48
|
export declare const EXTENDED_FAB_CLASSES: {
|
|
49
|
+
/** Root element class */
|
|
29
50
|
readonly ROOT: "extended-fab";
|
|
51
|
+
/** Class for the icon container */
|
|
30
52
|
readonly ICON: "extended-fab__icon";
|
|
53
|
+
/** Class for the text container */
|
|
31
54
|
readonly TEXT: "extended-fab__text";
|
|
55
|
+
/** Applied to fixed width FABs */
|
|
32
56
|
readonly FIXED: "extended-fab--fixed";
|
|
57
|
+
/** Applied to fluid width FABs */
|
|
33
58
|
readonly FLUID: "extended-fab--fluid";
|
|
59
|
+
/** Applied when FAB is lowered (pressed state) */
|
|
34
60
|
readonly LOWERED: "extended-fab--lowered";
|
|
61
|
+
/** Applied when FAB is collapsed to a regular FAB */
|
|
35
62
|
readonly COLLAPSED: "extended-fab--collapsed";
|
|
63
|
+
/** Applied when icon is positioned at the end */
|
|
36
64
|
readonly ICON_END: "extended-fab--icon-end";
|
|
37
65
|
};
|
|
66
|
+
/** Button types for Extended FAB */
|
|
38
67
|
export declare const EXTENDED_FAB_TYPES: {
|
|
39
68
|
readonly BUTTON: "button";
|
|
40
69
|
readonly SUBMIT: "submit";
|
|
41
70
|
readonly RESET: "reset";
|
|
42
71
|
};
|
|
72
|
+
/** Default animations for Extended FAB */
|
|
43
73
|
export declare const EXTENDED_FAB_ANIMATIONS: {
|
|
74
|
+
/** Entrance animation duration in milliseconds */
|
|
44
75
|
readonly ENTRANCE_DURATION: 250;
|
|
76
|
+
/** Collapse/expand animation duration in milliseconds */
|
|
45
77
|
readonly COLLAPSE_DURATION: 200;
|
|
46
78
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { ExtendedFabConfig, ExtendedFabComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new Extended Floating Action Button (Extended FAB) component Extended FABs are a variant of the standard Floating Action Button that include both an icon and text label.
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
2
6
|
declare const createExtendedFab: (config?: ExtendedFabConfig) => ExtendedFabComponent;
|
|
3
7
|
export default createExtendedFab;
|
|
@@ -2,84 +2,207 @@ import type { TouchEvents } from "../../core/utils/mobile.js";
|
|
|
2
2
|
import type { IconManager } from "../../core/compose/features/icon.js";
|
|
3
3
|
import type { TextManager } from "../../core/compose/features/text.js";
|
|
4
4
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
5
|
+
/** Extended FAB variants following Material Design 3 guidelines Material Design 3 offers different color variants for the Extended FAB to match visual hierarchy and application color schemes. */
|
|
5
6
|
export type ExtendedFabVariant = "primary-container" | "secondary-container" | "tertiary-container" | "primary" | "secondary" | "tertiary";
|
|
7
|
+
/** Expressive extended FAB size: small 56dp, medium 80dp, large 96dp. */
|
|
6
8
|
export type ExtendedFabSize = "small" | "medium" | "large";
|
|
9
|
+
/** Extended FAB width behavior Controls how the Extended FAB's width is calculated. */
|
|
7
10
|
export type ExtendedFabWidth = "fixed" | "fluid";
|
|
11
|
+
/** Extended FAB position on the screen Predefined positions for the Extended FAB when used as a floating element. */
|
|
8
12
|
export type ExtendedFabPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
13
|
+
/** Logical viewport corners; start/end follow text direction. */
|
|
9
14
|
export type ExtendedFabPlacement = "none" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
15
|
+
/** Configuration interface for the Extended FAB component Comprehensive options for creating and customizing an Extended Floating Action Button according to Material Design 3 guidelines. */
|
|
10
16
|
export interface ExtendedFabConfig {
|
|
17
|
+
/** Expressive container, icon and label size. */
|
|
11
18
|
size?: ExtendedFabSize;
|
|
19
|
+
/**
|
|
20
|
+
* Extended FAB variant that determines visual styling The color variant affects the Extended FAB's background color, text color, and elevation.
|
|
21
|
+
* @default 'primary-container'
|
|
22
|
+
*/
|
|
12
23
|
variant?: ExtendedFabVariant | string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the Extended FAB is initially disabled When disabled, the Extended FAB will have a visually muted appearance and won't respond to user interactions.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
13
28
|
disabled?: boolean;
|
|
29
|
+
/** Extended FAB icon HTML content. */
|
|
14
30
|
icon?: string;
|
|
31
|
+
/** Icon size in pixels or other CSS units Allows customizing the icon size beyond the default 24px size. */
|
|
15
32
|
iconSize?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Position of the icon relative to the text Controls whether the icon appears before or after the text label.
|
|
35
|
+
* @default 'start'
|
|
36
|
+
*/
|
|
16
37
|
iconPosition?: "start" | "end";
|
|
38
|
+
/** Text label for the Extended FAB The text should be short, typically one or two words describing the primary action. */
|
|
17
39
|
text?: string;
|
|
40
|
+
/** Additional CSS classes to add to the Extended FAB Custom classes for styling or identifying the Extended FAB. */
|
|
18
41
|
class?: string;
|
|
42
|
+
/** Button value attribute Sets the HTML value attribute of the button element, useful when using the Extended FAB in a form context. */
|
|
19
43
|
value?: string;
|
|
44
|
+
/** Position of the Extended FAB on the screen Configures the Extended FAB for floating positioning on the screen. */
|
|
20
45
|
/** @deprecated Use placement. Physical left/right do not mirror in RTL; removal in 4.0. */
|
|
21
46
|
position?: ExtendedFabPosition | string;
|
|
47
|
+
/** Logical corner, fixed with 16px margins; none stays in flow. */
|
|
22
48
|
placement?: ExtendedFabPlacement;
|
|
49
|
+
/**
|
|
50
|
+
* Button type attribute Sets the HTML type attribute of the button element.
|
|
51
|
+
* @default 'button'
|
|
52
|
+
*/
|
|
23
53
|
type?: "button" | "submit" | "reset";
|
|
54
|
+
/** Accessible label for screen readers Sets the aria-label attribute. */
|
|
24
55
|
ariaLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to enable ripple effect The ripple effect provides visual feedback when the user interacts with the Extended FAB.
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
25
60
|
ripple?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Component prefix for class names The prefix used for BEM-style class names.
|
|
63
|
+
* @default 'mtrl'
|
|
64
|
+
*/
|
|
26
65
|
prefix?: string;
|
|
66
|
+
/** Component name used in class generation */
|
|
27
67
|
componentName?: string;
|
|
68
|
+
/** Ripple effect configuration Fine-grained control over the ripple effect appearance and behavior. */
|
|
28
69
|
rippleConfig?: {
|
|
70
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
29
71
|
duration?: number;
|
|
30
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Whether to show the Extended FAB with an entrance animation When true, the Extended FAB will animate into view when added to the DOM.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
31
77
|
animate?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Width behavior of the Extended FAB
|
|
80
|
+
* @default 'fixed'
|
|
81
|
+
*/
|
|
32
82
|
width?: ExtendedFabWidth | string;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the Extended FAB should collapse to a standard FAB on scroll When true, the Extended FAB will automatically shrink to a circular FAB (hiding the text) when the user scrolls down, and expand back to the Extended FAB when scrolling up.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
33
87
|
collapseOnScroll?: boolean;
|
|
88
|
+
/** Index signature for additional configuration options */
|
|
34
89
|
[key: string]: unknown;
|
|
35
90
|
}
|
|
91
|
+
/** Native events forwarded through the Extended FAB's emitter. */
|
|
36
92
|
export interface ExtendedFabEvents extends TouchEvents {
|
|
93
|
+
/** Clicks are not forwarded while the button is disabled. */
|
|
37
94
|
click: (payload: ForwardedEventPayload<MouseEvent, HTMLButtonElement>) => void;
|
|
95
|
+
/** The button took focus. */
|
|
38
96
|
focus: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
|
|
97
|
+
/** The button lost focus. */
|
|
39
98
|
blur: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
|
|
99
|
+
/** `collapse()` ran, by call or on scroll */
|
|
40
100
|
collapse: () => void;
|
|
101
|
+
/** `expand()` ran, by call or on scroll */
|
|
41
102
|
expand: () => void;
|
|
42
103
|
}
|
|
104
|
+
/** Extended FAB component interface Provides methods for interacting with and manipulating an Extended Floating Action Button. */
|
|
43
105
|
export interface ExtendedFabComponent {
|
|
106
|
+
/** The Extended FAB's DOM element Direct access to the underlying button element for DOM manipulation. */
|
|
44
107
|
element: HTMLButtonElement;
|
|
108
|
+
/** API for managing Extended FAB icons Access to low-level icon methods and elements. */
|
|
45
109
|
icon: {
|
|
110
|
+
/** Sets the icon HTML content */
|
|
46
111
|
setIcon: (html: string) => IconManager;
|
|
112
|
+
/** Gets the current icon HTML content */
|
|
47
113
|
getIcon: () => string;
|
|
114
|
+
/** Gets the icon DOM element */
|
|
48
115
|
getElement: () => HTMLElement | null;
|
|
49
116
|
};
|
|
117
|
+
/** API for managing text content Access to low-level text methods and elements. */
|
|
50
118
|
text: {
|
|
119
|
+
/** Sets the text content */
|
|
51
120
|
setText: (text: string) => TextManager;
|
|
121
|
+
/** Gets the current text content */
|
|
52
122
|
getText: () => string;
|
|
123
|
+
/** Gets the text DOM element */
|
|
53
124
|
getElement: () => HTMLElement | null;
|
|
54
125
|
};
|
|
126
|
+
/** API for managing disabled state Access to low-level disabled state methods. */
|
|
55
127
|
disabled: {
|
|
128
|
+
/** Enables the Extended FAB */
|
|
56
129
|
enable: () => void;
|
|
130
|
+
/** Disables the Extended FAB */
|
|
57
131
|
disable: () => void;
|
|
132
|
+
/** Checks if the Extended FAB is disabled */
|
|
58
133
|
isDisabled: () => boolean;
|
|
59
134
|
};
|
|
135
|
+
/** API for managing component lifecycle Access to low-level lifecycle methods. */
|
|
60
136
|
lifecycle: {
|
|
137
|
+
/** Destroys the component and cleans up resources */
|
|
61
138
|
destroy: () => void;
|
|
62
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Gets a class name with the component's prefix
|
|
142
|
+
* @param name
|
|
143
|
+
*/
|
|
63
144
|
getClass: (name: string) => string;
|
|
145
|
+
/** Gets the Extended FAB's value attribute */
|
|
64
146
|
getValue: () => string;
|
|
147
|
+
/**
|
|
148
|
+
* Sets the Extended FAB's value attribute
|
|
149
|
+
* @param value
|
|
150
|
+
*/
|
|
65
151
|
setValue: (value: string) => ExtendedFabComponent;
|
|
152
|
+
/** Enables the Extended FAB (removes disabled attribute) Makes the Extended FAB interactive and visually enabled. */
|
|
66
153
|
enable: () => ExtendedFabComponent;
|
|
154
|
+
/** Disables the Extended FAB (adds disabled attribute) Makes the Extended FAB non-interactive and visually disabled. */
|
|
67
155
|
disable: () => ExtendedFabComponent;
|
|
156
|
+
/** Whether the extended FAB is disabled */
|
|
68
157
|
isDisabled: () => boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the Extended FAB's icon
|
|
160
|
+
* @param icon
|
|
161
|
+
*/
|
|
69
162
|
setIcon: (icon: string) => ExtendedFabComponent;
|
|
163
|
+
/** Gets the Extended FAB's icon HTML content */
|
|
70
164
|
getIcon: () => string;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the Extended FAB's text content
|
|
167
|
+
* @param text
|
|
168
|
+
*/
|
|
71
169
|
setText: (text: string) => ExtendedFabComponent;
|
|
170
|
+
/** Gets the Extended FAB's text content */
|
|
72
171
|
getText: () => string;
|
|
172
|
+
/**
|
|
173
|
+
* Sets the Extended FAB's position Positions the Extended FAB in one of the four corners of the viewport.
|
|
174
|
+
* @param position
|
|
175
|
+
*/
|
|
73
176
|
/** @deprecated Physical position alias; use the placement option/attribute. Removal in 4.0. */
|
|
74
177
|
setPosition: (position: string) => ExtendedFabComponent;
|
|
178
|
+
/** Gets the current position of the Extended FAB */
|
|
75
179
|
/** @deprecated Reads only the physical position alias. Removal in 4.0. */
|
|
76
180
|
getPosition: () => string | null;
|
|
181
|
+
/** Lowers the Extended FAB (useful for pressed state) Visually lowers the Extended FAB by reducing its elevation, typically used to indicate a pressed or active state. */
|
|
77
182
|
lower: () => ExtendedFabComponent;
|
|
183
|
+
/** Raises the Extended FAB back to its default elevation Restores the default elevation after it has been lowered. */
|
|
78
184
|
raise: () => ExtendedFabComponent;
|
|
185
|
+
/** Collapses the Extended FAB into a standard FAB Hides the text label, showing only the icon in a circular container. */
|
|
79
186
|
collapse: () => ExtendedFabComponent;
|
|
187
|
+
/** Expands a collapsed Extended FAB back to its full size Shows the text label alongside the icon. */
|
|
80
188
|
expand: () => ExtendedFabComponent;
|
|
189
|
+
/** Destroys the Extended FAB component and cleans up resources Removes event listeners and prepares the component for garbage collection. */
|
|
81
190
|
destroy: () => void;
|
|
191
|
+
/**
|
|
192
|
+
* Adds an event listener to the Extended FAB
|
|
193
|
+
* @param event
|
|
194
|
+
* @param handler
|
|
195
|
+
*/
|
|
82
196
|
on: <K extends keyof ExtendedFabEvents>(event: K, handler: ExtendedFabEvents[K]) => ExtendedFabComponent;
|
|
197
|
+
/**
|
|
198
|
+
* Removes an event listener from the Extended FAB
|
|
199
|
+
* @param event
|
|
200
|
+
* @param handler
|
|
201
|
+
*/
|
|
83
202
|
off: <K extends keyof ExtendedFabEvents>(event: K, handler: ExtendedFabEvents[K]) => ExtendedFabComponent;
|
|
203
|
+
/**
|
|
204
|
+
* Adds CSS classes to the Extended FAB element
|
|
205
|
+
* @param classes
|
|
206
|
+
*/
|
|
84
207
|
addClass: (...classes: string[]) => ExtendedFabComponent;
|
|
85
208
|
}
|
|
@@ -1,39 +1,65 @@
|
|
|
1
|
+
/** FAB variants following Material Design 3 guidelines */
|
|
1
2
|
export declare const FAB_VARIANTS: {
|
|
3
|
+
/** Primary container colour (default) */
|
|
2
4
|
readonly PRIMARY_CONTAINER: "primary-container";
|
|
5
|
+
/** Secondary container colour */
|
|
3
6
|
readonly SECONDARY_CONTAINER: "secondary-container";
|
|
7
|
+
/** Tertiary container colour */
|
|
4
8
|
readonly TERTIARY_CONTAINER: "tertiary-container";
|
|
9
|
+
/** Primary tone colour */
|
|
5
10
|
readonly PRIMARY: "primary";
|
|
11
|
+
/** Secondary tone colour */
|
|
6
12
|
readonly SECONDARY: "secondary";
|
|
13
|
+
/** Tertiary tone colour */
|
|
7
14
|
readonly TERTIARY: "tertiary";
|
|
8
15
|
};
|
|
16
|
+
/** FAB size variants */
|
|
9
17
|
export declare const FAB_SIZES: {
|
|
18
|
+
/** 56px diameter, for standard primary actions (default) */
|
|
10
19
|
readonly DEFAULT: "default";
|
|
20
|
+
/** 80px diameter with a 28px icon */
|
|
11
21
|
readonly MEDIUM: "medium";
|
|
22
|
+
/** 96px diameter, for emphasis or touch-focused interfaces */
|
|
12
23
|
readonly LARGE: "large";
|
|
13
24
|
};
|
|
25
|
+
/** FAB position options */
|
|
14
26
|
export declare const FAB_POSITIONS: {
|
|
27
|
+
/** Position in the top-right corner */
|
|
15
28
|
readonly TOP_RIGHT: "top-right";
|
|
29
|
+
/** Position in the top-left corner */
|
|
16
30
|
readonly TOP_LEFT: "top-left";
|
|
31
|
+
/** Position in the bottom-right corner (most common for primary actions) */
|
|
17
32
|
readonly BOTTOM_RIGHT: "bottom-right";
|
|
33
|
+
/** Position in the bottom-left corner */
|
|
18
34
|
readonly BOTTOM_LEFT: "bottom-left";
|
|
19
35
|
};
|
|
36
|
+
/** FAB CSS classes */
|
|
20
37
|
export declare const FAB_CLASSES: {
|
|
38
|
+
/** Root element class */
|
|
21
39
|
readonly ROOT: "fab";
|
|
40
|
+
/** Class for the icon container */
|
|
22
41
|
readonly ICON: "fab__icon";
|
|
42
|
+
/** Applied when FAB is lowered (pressed state) */
|
|
23
43
|
readonly LOWERED: "fab--lowered";
|
|
44
|
+
/** Applied to medium FABs */
|
|
24
45
|
readonly MEDIUM: "fab--medium";
|
|
46
|
+
/** Applied to large FABs */
|
|
25
47
|
readonly LARGE: "fab--large";
|
|
26
48
|
};
|
|
49
|
+
/** Button types for FAB */
|
|
27
50
|
export declare const FAB_TYPES: {
|
|
28
51
|
readonly BUTTON: "button";
|
|
29
52
|
readonly SUBMIT: "submit";
|
|
30
53
|
readonly RESET: "reset";
|
|
31
54
|
};
|
|
55
|
+
/** Default icon sizes based on FAB size */
|
|
32
56
|
export declare const FAB_ICON_SIZES: {
|
|
33
57
|
readonly DEFAULT: "24px";
|
|
34
58
|
readonly MEDIUM: "28px";
|
|
35
59
|
readonly LARGE: "32px";
|
|
36
60
|
};
|
|
61
|
+
/** Default animations for FAB */
|
|
37
62
|
export declare const FAB_ANIMATIONS: {
|
|
63
|
+
/** Entrance animation duration in milliseconds */
|
|
38
64
|
readonly ENTRANCE_DURATION: 250;
|
|
39
65
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { FabConfig, FabComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new Floating Action Button (FAB) component Floating Action Buttons (FABs) represent the primary action in an application.
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
2
6
|
declare const createFab: (config: FabConfig) => FabComponent;
|
|
3
7
|
export default createFab;
|