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,58 +1,107 @@
|
|
|
1
|
+
/** Tab component variants */
|
|
1
2
|
export declare const TAB_VARIANTS: {
|
|
3
|
+
/** Primary tabs */
|
|
2
4
|
readonly PRIMARY: "primary";
|
|
5
|
+
/** Secondary tabs */
|
|
3
6
|
readonly SECONDARY: "secondary";
|
|
4
7
|
};
|
|
8
|
+
/** Tab states */
|
|
5
9
|
export declare const TAB_STATES: {
|
|
10
|
+
/** Tab is currently active */
|
|
6
11
|
readonly ACTIVE: "active";
|
|
12
|
+
/** Tab is not currently active */
|
|
7
13
|
readonly INACTIVE: "inactive";
|
|
14
|
+
/** Tab is disabled */
|
|
8
15
|
readonly DISABLED: "disabled";
|
|
9
16
|
};
|
|
17
|
+
/** Tab indicator width strategies */
|
|
10
18
|
export declare const TAB_INDICATOR_WIDTH_STRATEGIES: {
|
|
19
|
+
/** Fixed width defined by fixedWidth */
|
|
11
20
|
readonly FIXED: "fixed";
|
|
21
|
+
/** Half the tab width */
|
|
12
22
|
readonly DYNAMIC: "dynamic";
|
|
23
|
+
/** Match the text content width */
|
|
13
24
|
readonly CONTENT: "content";
|
|
25
|
+
/** Adapts based on variant (primary: text width, secondary: full tab width) */
|
|
14
26
|
readonly AUTO: "auto";
|
|
15
27
|
};
|
|
28
|
+
/** Tab events */
|
|
16
29
|
export declare const TAB_EVENTS: {
|
|
30
|
+
/** Fired when a tab is clicked */
|
|
17
31
|
readonly CLICK: "click";
|
|
32
|
+
/** Fired when a tab receives focus */
|
|
18
33
|
readonly FOCUS: "focus";
|
|
34
|
+
/** Fired when a tab loses focus */
|
|
19
35
|
readonly BLUR: "blur";
|
|
20
36
|
};
|
|
37
|
+
/** Tabs component events */
|
|
21
38
|
export declare const TABS_EVENTS: {
|
|
39
|
+
/** Fired when the active tab changes */
|
|
22
40
|
readonly CHANGE: "change";
|
|
23
41
|
};
|
|
42
|
+
/** Default values for tabs component */
|
|
24
43
|
export declare const TABS_DEFAULTS: {
|
|
44
|
+
/** Default tab variant */
|
|
25
45
|
readonly VARIANT: "primary";
|
|
46
|
+
/** Whether tabs are horizontally scrollable */
|
|
26
47
|
readonly SCROLLABLE: true;
|
|
48
|
+
/** Whether to show a divider below the tabs */
|
|
27
49
|
readonly SHOW_DIVIDER: true;
|
|
50
|
+
/** Default indicator width strategy */
|
|
28
51
|
readonly INDICATOR_WIDTH_STRATEGY: "auto";
|
|
52
|
+
/** Default fixed width for fixed indicator in pixels */
|
|
29
53
|
readonly INDICATOR_FIXED_WIDTH: 40;
|
|
54
|
+
/** Whether to enable ripple effect on tabs */
|
|
30
55
|
readonly RIPPLE: true;
|
|
31
56
|
};
|
|
57
|
+
/** Tab layout types */
|
|
32
58
|
export declare const TAB_LAYOUT: {
|
|
59
|
+
/** Icon-only tab layout */
|
|
33
60
|
readonly ICON_ONLY: "icon-only";
|
|
61
|
+
/** Text-only tab layout */
|
|
34
62
|
readonly TEXT_ONLY: "text-only";
|
|
63
|
+
/** Icon and text layout */
|
|
35
64
|
readonly ICON_AND_TEXT: "icon-and-text";
|
|
36
65
|
};
|
|
66
|
+
/** CSS class names used by the tabs component */
|
|
37
67
|
export declare const TABS_CLASSES: {
|
|
68
|
+
/** Root element class */
|
|
38
69
|
readonly ROOT: "tabs";
|
|
70
|
+
/** Root element with primary variant */
|
|
39
71
|
readonly PRIMARY: "tabs--primary";
|
|
72
|
+
/** Root element with secondary variant */
|
|
40
73
|
readonly SECONDARY: "tabs--secondary";
|
|
74
|
+
/** Root element with scrollable tabs */
|
|
41
75
|
readonly SCROLLABLE: "tabs--scrollable";
|
|
76
|
+
/** Scroll container element */
|
|
42
77
|
readonly SCROLL: "tabs__scroll";
|
|
78
|
+
/** Divider element */
|
|
43
79
|
readonly DIVIDER: "tabs__divider";
|
|
80
|
+
/** Indicator element */
|
|
44
81
|
readonly INDICATOR: "tabs__indicator";
|
|
45
82
|
};
|
|
83
|
+
/** CSS class names used by the tab component */
|
|
46
84
|
export declare const TAB_CLASSES: {
|
|
85
|
+
/** Root element class */
|
|
47
86
|
readonly ROOT: "tab";
|
|
87
|
+
/** Active state class */
|
|
48
88
|
readonly ACTIVE: "tab--active";
|
|
89
|
+
/** Inactive state class */
|
|
49
90
|
readonly INACTIVE: "tab--inactive";
|
|
91
|
+
/** Disabled state class */
|
|
50
92
|
readonly DISABLED: "tab--disabled";
|
|
93
|
+
/** Text content container */
|
|
51
94
|
readonly TEXT: "button__text";
|
|
95
|
+
/** Icon container */
|
|
52
96
|
readonly ICON: "button__icon";
|
|
97
|
+
/** Ripple effect container */
|
|
53
98
|
readonly RIPPLE: "ripple";
|
|
99
|
+
/** Root element with primary variant */
|
|
54
100
|
readonly PRIMARY: "tab--primary";
|
|
101
|
+
/** Root element with secondary variant */
|
|
55
102
|
readonly SECONDARY: "tab--secondary";
|
|
103
|
+
/** Container for text and icon */
|
|
56
104
|
readonly CONTAINER: "tab__container";
|
|
105
|
+
/** Badge container */
|
|
57
106
|
readonly BADGE: "badge";
|
|
58
107
|
};
|
|
@@ -1,22 +1,44 @@
|
|
|
1
1
|
import { TabComponent } from "./types.js";
|
|
2
|
+
/** Configuration for tab indicator */
|
|
2
3
|
export interface TabIndicatorConfig {
|
|
4
|
+
/** Height of the indicator in pixels */
|
|
3
5
|
height?: number;
|
|
6
|
+
/** Width strategy - fixed size or dynamic based on tab width */
|
|
4
7
|
widthStrategy?: 'fixed' | 'dynamic' | 'content' | 'auto';
|
|
8
|
+
/** Fixed width in pixels when using fixed strategy */
|
|
5
9
|
fixedWidth?: number;
|
|
10
|
+
/** Animation duration in milliseconds */
|
|
6
11
|
animationDuration?: number;
|
|
12
|
+
/** Animation timing function */
|
|
7
13
|
animationTiming?: string;
|
|
14
|
+
/** Whether to show the indicator */
|
|
8
15
|
visible?: boolean;
|
|
16
|
+
/** CSS class prefix */
|
|
9
17
|
prefix?: string;
|
|
18
|
+
/** Custom color for the indicator */
|
|
10
19
|
color?: string;
|
|
20
|
+
/** Tabs variant (primary or secondary) */
|
|
11
21
|
variant?: string;
|
|
12
22
|
}
|
|
23
|
+
/** Tab indicator API */
|
|
13
24
|
export interface TabIndicator {
|
|
25
|
+
/** The indicator DOM element */
|
|
14
26
|
element: HTMLElement;
|
|
27
|
+
/** Move the indicator to a specific tab */
|
|
15
28
|
moveToTab: (tab: TabComponent, immediate?: boolean) => void;
|
|
29
|
+
/** Show the indicator */
|
|
16
30
|
show: () => void;
|
|
31
|
+
/** Hide the indicator */
|
|
17
32
|
hide: () => void;
|
|
33
|
+
/** Set indicator color */
|
|
18
34
|
setColor: (color: string) => void;
|
|
35
|
+
/** Update indicator position (e.g. */
|
|
19
36
|
update: () => void;
|
|
37
|
+
/** Destroy the indicator and clean up */
|
|
20
38
|
destroy: () => void;
|
|
21
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a tab indicator component
|
|
42
|
+
* @param config
|
|
43
|
+
*/
|
|
22
44
|
export declare const createTabIndicator: (config?: TabIndicatorConfig) => TabIndicator;
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
import { TabsComponent } from "./types.js";
|
|
2
|
+
/** Breakpoints for responsive behavior */
|
|
2
3
|
export declare const RESPONSIVE_BREAKPOINTS: {
|
|
4
|
+
/** Small screens (mobile) */
|
|
3
5
|
SMALL: number;
|
|
6
|
+
/** Medium screens (tablet) */
|
|
4
7
|
MEDIUM: number;
|
|
8
|
+
/** Large screens (desktop) */
|
|
5
9
|
LARGE: number;
|
|
6
10
|
};
|
|
11
|
+
/** Configuration for responsive behavior */
|
|
7
12
|
export interface ResponsiveConfig {
|
|
13
|
+
/** Whether to enable responsive behavior */
|
|
8
14
|
responsive?: boolean;
|
|
15
|
+
/** Options for small screens */
|
|
9
16
|
smallScreen?: {
|
|
17
|
+
/**
|
|
18
|
+
* Layout below the small breakpoint: `icon-only` hides the labels of tabs that have an icon (the label still names the tab), `text-only` hides the icons of tabs that have a label, `icon-and-text` keeps every tab as built.
|
|
19
|
+
* @default 'icon-only'
|
|
20
|
+
*/
|
|
10
21
|
layout?: 'icon-only' | 'text-only' | 'icon-and-text';
|
|
11
22
|
};
|
|
23
|
+
/** Breakpoints. */
|
|
12
24
|
breakpoints?: {
|
|
13
25
|
small?: number;
|
|
14
26
|
medium?: number;
|
|
15
27
|
large?: number;
|
|
16
28
|
};
|
|
17
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Enhances tabs with responsive behavior.
|
|
32
|
+
* @param tabs
|
|
33
|
+
* @param config
|
|
34
|
+
*/
|
|
18
35
|
export declare const setupResponsiveBehavior: (tabs: TabsComponent, config?: ResponsiveConfig) => void;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import { TabConfig, TabComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new Tab component following MD3 guidelines
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
6
|
+
/** Point a tab at its panel, but only when that panel exists. */
|
|
2
7
|
export declare const createTab: (config?: TabConfig) => TabComponent;
|
|
@@ -1,40 +1,72 @@
|
|
|
1
1
|
import type { BadgeComponent } from "../badge/index.js";
|
|
2
2
|
import type { ButtonComponent } from "../button/types.js";
|
|
3
3
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
4
|
+
/** Button methods the tab delegates to; each one is checked before use */
|
|
4
5
|
export type TabButton = Partial<Pick<ButtonComponent, 'getValue' | 'setValue' | 'getText' | 'setText' | 'getIcon' | 'setIcon'>>;
|
|
5
6
|
import { TabIndicator } from "./indicator.js";
|
|
7
|
+
/** Available tabs variants */
|
|
6
8
|
export type TabsVariant = 'primary' | 'secondary';
|
|
9
|
+
/** Available tabs states */
|
|
7
10
|
export type TabStates = 'active' | 'inactive' | 'disabled';
|
|
11
|
+
/** Configuration for the tab indicator */
|
|
8
12
|
export interface IndicatorConfig {
|
|
13
|
+
/** Height of the indicator in pixels */
|
|
9
14
|
height?: number;
|
|
15
|
+
/** Width strategy for the indicator */
|
|
10
16
|
widthStrategy?: 'fixed' | 'dynamic' | 'content' | 'auto';
|
|
17
|
+
/** Fixed width in pixels (when using fixed strategy) */
|
|
11
18
|
fixedWidth?: number;
|
|
19
|
+
/** Animation duration in milliseconds */
|
|
12
20
|
animationDuration?: number;
|
|
21
|
+
/** Animation timing function */
|
|
13
22
|
animationTiming?: string;
|
|
23
|
+
/** Custom color for the indicator */
|
|
14
24
|
color?: string;
|
|
25
|
+
/** Whether the indicator shows; hide() and show() change it later */
|
|
15
26
|
visible?: boolean;
|
|
27
|
+
/** Tab variant (primary or secondary) */
|
|
16
28
|
variant?: string;
|
|
17
29
|
}
|
|
30
|
+
/** Tab change event data interface */
|
|
18
31
|
export interface TabChangeEventData {
|
|
32
|
+
/** The tab component that was activated */
|
|
19
33
|
tab: TabComponent;
|
|
34
|
+
/** The value of the activated tab, as `TabComponent.getValue()` returns it. */
|
|
20
35
|
value: string;
|
|
21
36
|
}
|
|
37
|
+
/** Events a single tab emits, and what each hands its handler. */
|
|
22
38
|
export interface TabEvents {
|
|
23
39
|
click: (payload: ForwardedEventPayload<MouseEvent, HTMLElement>) => void;
|
|
24
40
|
focus: (event: FocusEvent) => void;
|
|
25
41
|
blur: (event: FocusEvent) => void;
|
|
26
42
|
}
|
|
43
|
+
/** Events a tabs group emits. */
|
|
27
44
|
export interface TabsEvents {
|
|
28
45
|
change: (event: TabChangeEventData) => void;
|
|
29
46
|
}
|
|
47
|
+
/** Configuration interface for a single Tab */
|
|
30
48
|
export interface TabConfig {
|
|
49
|
+
/** Id of the tab group this tab belongs to. */
|
|
31
50
|
groupId?: string;
|
|
51
|
+
/** Accessible name for a tab with an icon and no text, which otherwise has none. */
|
|
32
52
|
ariaLabel?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Tab state that determines if it's the active destination
|
|
55
|
+
* @default 'inactive'
|
|
56
|
+
*/
|
|
33
57
|
state?: TabStates | string;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the tab is initially disabled
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
34
62
|
disabled?: boolean;
|
|
63
|
+
/** Initial tab text content (label) */
|
|
35
64
|
text?: string;
|
|
65
|
+
/** Initial tab icon HTML content. */
|
|
36
66
|
icon?: string;
|
|
67
|
+
/** Badge text or value to display (if applicable) */
|
|
37
68
|
badge?: string | number;
|
|
69
|
+
/** Badge configuration object */
|
|
38
70
|
badgeConfig?: {
|
|
39
71
|
variant?: string;
|
|
40
72
|
color?: string;
|
|
@@ -42,89 +74,227 @@ export interface TabConfig {
|
|
|
42
74
|
position?: string;
|
|
43
75
|
max?: number;
|
|
44
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Icon size in pixels or other CSS units
|
|
79
|
+
* @default '24px'
|
|
80
|
+
*/
|
|
45
81
|
iconSize?: string;
|
|
82
|
+
/** Additional CSS classes to add to the tab */
|
|
46
83
|
class?: string;
|
|
84
|
+
/** Tab value attribute for identifying the selected tab */
|
|
47
85
|
value?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Whether to enable ripple effect
|
|
88
|
+
* @default true
|
|
89
|
+
*/
|
|
48
90
|
ripple?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Component prefix for class names
|
|
93
|
+
* @default 'mtrl'
|
|
94
|
+
*/
|
|
49
95
|
prefix?: string;
|
|
96
|
+
/** Component name used in class generation */
|
|
50
97
|
componentName?: string;
|
|
98
|
+
/** Ripple effect configuration */
|
|
51
99
|
rippleConfig?: {
|
|
100
|
+
/** How long, in milliseconds, a released wave lingers before it is removed */
|
|
52
101
|
duration?: number;
|
|
53
102
|
};
|
|
103
|
+
/** Variant of the tab */
|
|
54
104
|
variant?: string;
|
|
55
105
|
}
|
|
106
|
+
/** Configuration interface for the Tabs component */
|
|
56
107
|
export interface TabsConfig {
|
|
108
|
+
/** Id for this tab group, used to build each tab's element id as `tab-<groupId>-<value>` and to find panels as `tabpanel-<groupId>-<value>`; a value with characters outside `[A-Za-z0-9_-]` gets a derived id instead (`tabIdFor`, `tabPanelIdFor`, The group id itself is not encoded: keep a pinned one to `[A-Za-z0-9_]` (generated ones are), or `tabIdFor("a-b", "c")` and `tabIdFor("a", "b-c")` coincide and a space makes an unsafe id. */
|
|
57
109
|
groupId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Whether an arrow key also selects the tab it moves to.
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
58
114
|
autoActivate?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Tabs variant (primary or secondary)
|
|
117
|
+
* @default 'primary'
|
|
118
|
+
*/
|
|
59
119
|
variant?: TabsVariant | string;
|
|
120
|
+
/** Initial tabs to create */
|
|
60
121
|
tabs?: TabConfig[];
|
|
122
|
+
/**
|
|
123
|
+
* Whether to show the divider
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
61
126
|
showDivider?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Whether to enable horizontal scrolling
|
|
129
|
+
* @default true
|
|
130
|
+
*/
|
|
62
131
|
scrollable?: boolean;
|
|
132
|
+
/** Additional CSS classes for the container */
|
|
63
133
|
class?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Component prefix for class names
|
|
136
|
+
* @default 'mtrl'
|
|
137
|
+
*/
|
|
64
138
|
prefix?: string;
|
|
139
|
+
/** Event handlers registered when the tabs are created. */
|
|
65
140
|
on?: Partial<TabsEvents>;
|
|
141
|
+
/** Tab indicator configuration */
|
|
66
142
|
indicator?: IndicatorConfig;
|
|
67
143
|
}
|
|
144
|
+
/** Icon API interface for managing tab icons */
|
|
68
145
|
export interface IconAPI {
|
|
146
|
+
/**
|
|
147
|
+
* Sets the icon HTML content
|
|
148
|
+
* @param html
|
|
149
|
+
*/
|
|
69
150
|
setIcon: (html: string) => IconAPI;
|
|
151
|
+
/** Gets the current icon HTML content */
|
|
70
152
|
getIcon: () => string;
|
|
153
|
+
/** Gets the icon DOM element */
|
|
71
154
|
getElement: () => HTMLElement | null;
|
|
72
155
|
}
|
|
156
|
+
/** Text API interface for managing tab text */
|
|
73
157
|
export interface TextAPI {
|
|
158
|
+
/**
|
|
159
|
+
* Sets the text content
|
|
160
|
+
* @param content
|
|
161
|
+
*/
|
|
74
162
|
setText: (content: string) => TextAPI;
|
|
163
|
+
/** Gets the current text content */
|
|
75
164
|
getText: () => string;
|
|
165
|
+
/** Gets the text DOM element */
|
|
76
166
|
getElement: () => HTMLElement | null;
|
|
77
167
|
}
|
|
168
|
+
/** Tab component interface */
|
|
78
169
|
export interface TabComponent {
|
|
170
|
+
/** The tab's DOM element */
|
|
79
171
|
element: HTMLElement;
|
|
172
|
+
/** The button the tab is built on */
|
|
80
173
|
button?: TabButton;
|
|
174
|
+
/** The tab's badge component, or `undefined`. */
|
|
81
175
|
badge?: BadgeComponent | undefined;
|
|
176
|
+
/** Gets a class name with the component's prefix */
|
|
82
177
|
getClass: (name: string) => string;
|
|
178
|
+
/** Gets the tab's value attribute */
|
|
83
179
|
getValue: () => string;
|
|
180
|
+
/** Sets the tab's value attribute */
|
|
84
181
|
setValue: (value: string) => TabComponent;
|
|
182
|
+
/** Activates the tab (sets active state) */
|
|
85
183
|
activate: () => TabComponent;
|
|
184
|
+
/** Deactivates the tab (sets inactive state) */
|
|
86
185
|
deactivate: () => TabComponent;
|
|
186
|
+
/** Checks if the tab is active */
|
|
87
187
|
isActive: () => boolean;
|
|
188
|
+
/** Enables the tab (removes disabled attribute) */
|
|
88
189
|
enable: () => TabComponent;
|
|
190
|
+
/** Disables the tab (adds disabled attribute) */
|
|
89
191
|
disable: () => TabComponent;
|
|
192
|
+
/** Whether the tab is disabled */
|
|
90
193
|
isDisabled: () => boolean;
|
|
194
|
+
/** Sets the tab's text content */
|
|
91
195
|
setText: (content: string) => TabComponent;
|
|
196
|
+
/** Gets the tab's text content */
|
|
92
197
|
getText: () => string;
|
|
198
|
+
/** Sets the tab's icon */
|
|
93
199
|
setIcon: (icon: string) => TabComponent;
|
|
200
|
+
/** Gets the tab's icon HTML content */
|
|
94
201
|
getIcon: () => string;
|
|
202
|
+
/** Sets the tab's badge */
|
|
95
203
|
setBadge: (content: string | number) => TabComponent;
|
|
204
|
+
/** Gets the tab's badge content */
|
|
96
205
|
getBadge: () => string;
|
|
206
|
+
/** Shows the tab's badge */
|
|
97
207
|
showBadge: () => TabComponent;
|
|
208
|
+
/** Hides the tab's badge */
|
|
98
209
|
hideBadge: () => TabComponent;
|
|
210
|
+
/** Gets the badge component instance, or `undefined`: it may not exist */
|
|
99
211
|
getBadgeComponent: () => BadgeComponent | undefined;
|
|
212
|
+
/** Updates the tab's layout style based on content */
|
|
100
213
|
updateLayoutStyle: () => void;
|
|
214
|
+
/**
|
|
215
|
+
* Adds an event listener to the tab.
|
|
216
|
+
* @param event
|
|
217
|
+
* @param handler
|
|
218
|
+
*/
|
|
101
219
|
on: <K extends keyof TabEvents>(event: K, handler: TabEvents[K]) => TabComponent;
|
|
220
|
+
/**
|
|
221
|
+
* Removes an event listener from the tab
|
|
222
|
+
* @param event
|
|
223
|
+
* @param handler
|
|
224
|
+
*/
|
|
102
225
|
off: <K extends keyof TabEvents>(event: K, handler: TabEvents[K]) => TabComponent;
|
|
226
|
+
/** Destroys the tab component and cleans up resources */
|
|
103
227
|
destroy: () => void;
|
|
228
|
+
/** API for managing disabled state */
|
|
104
229
|
disabled?: {
|
|
105
230
|
enable: () => void;
|
|
106
231
|
disable: () => void;
|
|
107
232
|
isDisabled: () => boolean;
|
|
108
233
|
};
|
|
234
|
+
/** API for managing component lifecycle */
|
|
109
235
|
lifecycle?: {
|
|
110
236
|
destroy: () => void;
|
|
111
237
|
};
|
|
112
238
|
}
|
|
239
|
+
/** Tabs component interface */
|
|
113
240
|
export interface TabsComponent {
|
|
241
|
+
/** Container element */
|
|
114
242
|
element: HTMLElement;
|
|
243
|
+
/**
|
|
244
|
+
* Gets a class name with the component's prefix
|
|
245
|
+
* @param name
|
|
246
|
+
*/
|
|
115
247
|
getClass: (name: string) => string;
|
|
248
|
+
/**
|
|
249
|
+
* Creates and adds a new tab to the tabs component
|
|
250
|
+
* @param config
|
|
251
|
+
*/
|
|
116
252
|
addTab: (config: TabConfig) => TabComponent;
|
|
253
|
+
/**
|
|
254
|
+
* Adds a pre-created tab to the tabs component
|
|
255
|
+
* @param tab
|
|
256
|
+
*/
|
|
117
257
|
add: (tab: TabComponent) => TabsComponent;
|
|
258
|
+
/** Gets all tabs in the container */
|
|
118
259
|
getTabs: () => TabComponent[];
|
|
260
|
+
/** Gets the active tab */
|
|
119
261
|
getActiveTab: () => TabComponent | null;
|
|
262
|
+
/** Reads the current model value without changing selection. */
|
|
120
263
|
getValue: () => string | null;
|
|
264
|
+
/** Gets the indicator component */
|
|
121
265
|
getIndicator?: () => TabIndicator;
|
|
266
|
+
/**
|
|
267
|
+
* Sets a tab as active.
|
|
268
|
+
* @param tabOrValue
|
|
269
|
+
*/
|
|
122
270
|
setActiveTab: (tabOrValue: TabComponent | string) => TabsComponent;
|
|
271
|
+
/**
|
|
272
|
+
* Removes a tab from the container
|
|
273
|
+
* @param tabOrValue
|
|
274
|
+
*/
|
|
123
275
|
removeTab: (tabOrValue: TabComponent | string) => TabsComponent;
|
|
276
|
+
/**
|
|
277
|
+
* Adds an event listener.
|
|
278
|
+
* @param event
|
|
279
|
+
* @param handler
|
|
280
|
+
*/
|
|
124
281
|
on: <K extends keyof TabsEvents>(event: K, handler: TabsEvents[K]) => TabsComponent;
|
|
282
|
+
/**
|
|
283
|
+
* Removes an event listener
|
|
284
|
+
* @param event
|
|
285
|
+
* @param handler
|
|
286
|
+
*/
|
|
125
287
|
off: <K extends keyof TabsEvents>(event: K, handler: TabsEvents[K]) => TabsComponent;
|
|
288
|
+
/**
|
|
289
|
+
* Emit one of the group's own events ({@link TabsEvents}), with its payload: the names and payloads `on` and `off` accept.
|
|
290
|
+
* @param event
|
|
291
|
+
* @param data
|
|
292
|
+
*/
|
|
126
293
|
emit?<K extends keyof TabsEvents>(event: K, data: Parameters<TabsEvents[K]>[0]): this;
|
|
294
|
+
/** Destroys the tabs component and all tabs */
|
|
127
295
|
destroy: () => void;
|
|
296
|
+
/** Activation handler shared by the component's click and keyboard paths. */
|
|
128
297
|
handleTabClick: (event: Event | null, tab: TabComponent) => void;
|
|
298
|
+
/** Scroll container owned by the scrollable feature. */
|
|
129
299
|
scrollContainer?: HTMLElement;
|
|
130
300
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TabComponent } from "./types.js";
|
|
2
|
+
/** Tabs members read by these helpers; each one is checked before use */
|
|
2
3
|
interface TabsHost {
|
|
3
4
|
element?: HTMLElement;
|
|
4
5
|
tabs?: TabComponent[];
|
|
@@ -7,15 +8,38 @@ interface TabsHost {
|
|
|
7
8
|
setActiveTab?: (tabOrValue: TabComponent | string) => unknown;
|
|
8
9
|
handleTabClick?: (event: Event | null, tab: TabComponent) => void;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Gets the active tab from a component
|
|
13
|
+
* @param component
|
|
14
|
+
*/
|
|
10
15
|
export declare function getActiveTab(component: TabsHost): TabComponent | null;
|
|
16
|
+
/** A fresh id for a tab group, so two tablists can share tab values. */
|
|
11
17
|
export declare function allocateTabsGroupId(): string;
|
|
18
|
+
/** A tab's element id within its group: `tab-<groupId>-<value>` for a value of `[A-Za-z0-9_-]`, and `tabx-<groupId>-<encoded value>` otherwise. */
|
|
12
19
|
export declare const tabIdFor: (groupId: string, value: string) => string;
|
|
20
|
+
/** The panel id a group looks for when a page does not label its panels: `tabpanel-<groupId>-<value>`, or `tabpanelx-<groupId>-<encoded value>` for a value with other characters, as {@link tabIdFor} derives the tab's. */
|
|
13
21
|
export declare const tabPanelIdFor: (groupId: string, value: string) => string;
|
|
22
|
+
/** Records a tab's value and group on its element: the value as `data-value`, which the panel lookup reads instead of parsing the id. */
|
|
14
23
|
export declare function registerTab(element: HTMLElement, groupId: string, value: string): void;
|
|
24
|
+
/** The panel registered to a tab, or null. */
|
|
15
25
|
export declare function findRegisteredPanel(tab: HTMLElement): HTMLElement | null;
|
|
26
|
+
/** Points a tab's `aria-controls` at its panel, and only at one that exists. */
|
|
16
27
|
export declare function syncTabControls(element: HTMLElement): void;
|
|
28
|
+
/**
|
|
29
|
+
* Updates tab panels based on active tab
|
|
30
|
+
* @param component
|
|
31
|
+
*/
|
|
17
32
|
export declare function updateTabPanels(component: TabsHost): void;
|
|
33
|
+
/**
|
|
34
|
+
* Gives the tablist a single tab stop: the active tab, or the first enabled one when none is active.
|
|
35
|
+
* @param component
|
|
36
|
+
*/
|
|
18
37
|
export declare function syncTabStops(component: TabsHost): void;
|
|
38
|
+
/**
|
|
39
|
+
* Sets up keyboard navigation for tabs.
|
|
40
|
+
* @param component
|
|
41
|
+
* @param options
|
|
42
|
+
*/
|
|
19
43
|
export declare function setupKeyboardNavigation(component: TabsHost, options?: {
|
|
20
44
|
autoActivate?: boolean;
|
|
21
45
|
}): void;
|
|
@@ -1,69 +1,130 @@
|
|
|
1
|
+
/** TextField variant constants */
|
|
1
2
|
declare const TEXT_FIELD_VARIANTS: {
|
|
3
|
+
/** Filled variant with background and animated label */
|
|
2
4
|
readonly FILLED: "filled";
|
|
5
|
+
/** Outlined variant with border and animated label */
|
|
3
6
|
readonly OUTLINED: "outlined";
|
|
4
7
|
};
|
|
8
|
+
/** TextField state constants */
|
|
5
9
|
declare const TEXT_FIELD_STATES: {
|
|
10
|
+
/** TextField is active (focused) */
|
|
6
11
|
readonly ACTIVE: "active";
|
|
12
|
+
/** TextField is inactive (not focused) */
|
|
7
13
|
readonly INACTIVE: "inactive";
|
|
14
|
+
/** TextField is disabled */
|
|
8
15
|
readonly DISABLED: "disabled";
|
|
9
16
|
};
|
|
17
|
+
/** TextField type constants */
|
|
10
18
|
declare const TEXT_FIELD_TYPES: {
|
|
19
|
+
/** Standard text input */
|
|
11
20
|
readonly TEXT: "text";
|
|
21
|
+
/** Password input with obscured characters */
|
|
12
22
|
readonly PASSWORD: "password";
|
|
23
|
+
/** Email input with email validation */
|
|
13
24
|
readonly EMAIL: "email";
|
|
25
|
+
/** Numeric input */
|
|
14
26
|
readonly NUMBER: "number";
|
|
27
|
+
/** Telephone number input */
|
|
15
28
|
readonly TEL: "tel";
|
|
29
|
+
/** URL input with URL validation */
|
|
16
30
|
readonly URL: "url";
|
|
31
|
+
/** Search input */
|
|
17
32
|
readonly SEARCH: "search";
|
|
33
|
+
/** Multiline text input (textarea) */
|
|
18
34
|
readonly MULTILINE: "multiline";
|
|
19
35
|
};
|
|
36
|
+
/** TextField event constants */
|
|
20
37
|
declare const TEXT_FIELD_EVENTS: {
|
|
38
|
+
/** Emitted on native input change; setValue() is silent */
|
|
21
39
|
readonly CHANGE: "change";
|
|
40
|
+
/** Fired during input */
|
|
22
41
|
readonly INPUT: "input";
|
|
42
|
+
/** Fired when text field receives focus */
|
|
23
43
|
readonly FOCUS: "focus";
|
|
44
|
+
/** Fired when text field loses focus */
|
|
24
45
|
readonly BLUR: "blur";
|
|
46
|
+
/** Fired when the trailing icon button is activated (`trailingIconLabel`) */
|
|
25
47
|
readonly TRAILING: "trailing";
|
|
48
|
+
/** Legacy name, not emitted; listen for keydown on the input and check key === "Enter" */
|
|
26
49
|
readonly ENTER: "enter";
|
|
50
|
+
/** Native input event only; not emitted through on() */
|
|
27
51
|
readonly KEYDOWN: "keydown";
|
|
52
|
+
/** Native input event only; not emitted through on() */
|
|
28
53
|
readonly KEYUP: "keyup";
|
|
29
54
|
};
|
|
55
|
+
/** TextField density constants */
|
|
30
56
|
declare const TEXT_FIELD_DENSITY: {
|
|
57
|
+
/** Default density (56px height) */
|
|
31
58
|
readonly DEFAULT: "default";
|
|
59
|
+
/** Compact density (40px height) */
|
|
32
60
|
readonly COMPACT: "compact";
|
|
33
61
|
};
|
|
62
|
+
/** Default text field configuration values */
|
|
34
63
|
declare const TEXT_FIELD_DEFAULTS: {
|
|
64
|
+
/** Default input type */
|
|
35
65
|
readonly TYPE: "text";
|
|
66
|
+
/** Default visual variant */
|
|
36
67
|
readonly VARIANT: "filled";
|
|
68
|
+
/** Default density level */
|
|
37
69
|
readonly DENSITY: "default";
|
|
70
|
+
/** Default disabled state */
|
|
38
71
|
readonly DISABLED: false;
|
|
72
|
+
/** Default required state */
|
|
39
73
|
readonly REQUIRED: false;
|
|
74
|
+
/** Default error state */
|
|
40
75
|
readonly ERROR: false;
|
|
76
|
+
/** Default label floating behavior (always floats on focus) */
|
|
41
77
|
readonly FLOAT_LABEL: true;
|
|
78
|
+
/** Default animation duration in milliseconds */
|
|
42
79
|
readonly ANIMATION_DURATION: 150;
|
|
43
80
|
};
|
|
81
|
+
/** CSS class names used by the text field component */
|
|
44
82
|
declare const TEXT_FIELD_CLASSES: {
|
|
83
|
+
/** Root element class */
|
|
45
84
|
readonly ROOT: "text-field";
|
|
85
|
+
/** Input element class */
|
|
46
86
|
readonly INPUT: "text-field__input";
|
|
87
|
+
/** Label element class */
|
|
47
88
|
readonly LABEL: "text-field__label";
|
|
89
|
+
/** Reserved slot; the current component has no separate container element. */
|
|
48
90
|
readonly CONTAINER: "text-field__container";
|
|
91
|
+
/** Filled variant class */
|
|
49
92
|
readonly FILLED: "text-field--filled";
|
|
93
|
+
/** Outlined variant class */
|
|
50
94
|
readonly OUTLINED: "text-field--outlined";
|
|
95
|
+
/** Focused state class */
|
|
51
96
|
readonly FOCUSED: "text-field--focused";
|
|
97
|
+
/** Disabled state class */
|
|
52
98
|
readonly DISABLED: "text-field--disabled";
|
|
99
|
+
/** Error state class */
|
|
53
100
|
readonly ERROR: "text-field--error";
|
|
101
|
+
/** Required indicator class */
|
|
54
102
|
readonly REQUIRED: "text-field--required";
|
|
103
|
+
/** Supporting text class */
|
|
55
104
|
readonly SUPPORTING_TEXT: "text-field__helper";
|
|
105
|
+
/** Supporting text error class */
|
|
56
106
|
readonly SUPPORTING_TEXT_ERROR: "text-field__helper--error";
|
|
107
|
+
/** Leading icon class */
|
|
57
108
|
readonly LEADING_ICON: "text-field__leading-icon";
|
|
109
|
+
/** Trailing icon class */
|
|
58
110
|
readonly TRAILING_ICON: "text-field__trailing-icon";
|
|
111
|
+
/** Prefix text class */
|
|
59
112
|
readonly PREFIX_TEXT: "text-field__prefix";
|
|
113
|
+
/** Suffix text class */
|
|
60
114
|
readonly SUFFIX_TEXT: "text-field__suffix";
|
|
115
|
+
/** Outline of the outlined variant, drawn in three segments */
|
|
61
116
|
readonly OUTLINE: "text-field__outline";
|
|
117
|
+
/** Outline segment before the label (start corner) */
|
|
62
118
|
readonly OUTLINE_LEADING: "text-field__outline-leading";
|
|
119
|
+
/** Outline segment the floating label sits in */
|
|
63
120
|
readonly OUTLINE_NOTCH: "text-field__outline-notch";
|
|
121
|
+
/** Outline segment after the label */
|
|
64
122
|
readonly OUTLINE_TRAILING: "text-field__outline-trailing";
|
|
123
|
+
/** Outline whose notch is open around the floating label */
|
|
65
124
|
readonly OUTLINE_NOTCHED: "text-field__outline--notched";
|
|
125
|
+
/** Outlined field laid out right to left, from its computed direction */
|
|
66
126
|
readonly RTL: "text-field--rtl";
|
|
127
|
+
/** Multiline class */
|
|
67
128
|
readonly MULTILINE: "text-field--multiline";
|
|
68
129
|
};
|
|
69
130
|
export { TEXT_FIELD_VARIANTS, TEXT_FIELD_STATES, TEXT_FIELD_TYPES, TEXT_FIELD_EVENTS, TEXT_FIELD_DENSITY, TEXT_FIELD_DEFAULTS, TEXT_FIELD_CLASSES, };
|