material 3.8.2 → 3.10.0
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 +5 -5
- package/dist/components/badge/index.d.ts +167 -3
- package/dist/components/bottom-app-bar/constants.d.ts +16 -3
- package/dist/components/bottom-app-bar/index.d.ts +141 -4
- package/dist/components/bottom-sheet/config.js +1 -1
- package/dist/components/bottom-sheet/features/structure.js +10 -2
- package/dist/components/bottom-sheet/index.d.ts +114 -2
- package/dist/components/button/index.d.ts +10 -5
- package/dist/components/button-group/button-group.js +2 -1
- package/dist/components/button-group/config.js +9 -6
- package/dist/components/button-group/index.d.ts +250 -6
- package/dist/components/card/api.js +19 -0
- package/dist/components/card/index.d.ts +326 -5
- package/dist/components/carousel/features/slides.js +17 -7
- package/dist/components/carousel/index.d.ts +102 -3
- package/dist/components/checkbox/config.js +3 -2
- package/dist/components/checkbox/index.d.ts +217 -5
- package/dist/components/chips/chip/chip.js +4 -3
- package/dist/components/chips/index.d.ts +343 -3
- package/dist/components/datepicker/config.js +1 -1
- package/dist/components/datepicker/datepicker.js +74 -87
- package/dist/components/datepicker/index.d.ts +313 -2
- package/dist/components/datepicker/render.js +24 -20
- package/dist/components/datepicker/utils.js +66 -111
- package/dist/components/dialog/features.js +1 -1
- package/dist/components/dialog/index.d.ts +333 -3
- package/dist/components/divider/index.d.ts +99 -3
- package/dist/components/drawer/features/items.js +10 -2
- package/dist/components/drawer/index.d.ts +196 -3
- package/dist/components/extended-fab/index.d.ts +224 -2
- package/dist/components/fab/index.d.ts +183 -2
- package/dist/components/fab-menu/index.d.ts +106 -6
- package/dist/components/icon-button/index.d.ts +11 -4
- package/dist/components/index.js +1 -1
- package/dist/components/list/features/anatomy.js +25 -6
- package/dist/components/list/features/listbox.js +230 -0
- package/dist/components/list/features/selection.js +30 -2
- package/dist/components/list/index.d.ts +299 -4
- package/dist/components/list/index.js +1 -0
- package/dist/components/loading-indicator/index.d.ts +94 -3
- package/dist/components/menu/config.js +2 -2
- package/dist/components/menu/constants.d.ts +4 -4
- package/dist/components/menu/constants.js +1 -1
- package/dist/components/menu/features/controller.js +14 -1
- package/dist/components/menu/features/position.js +15 -8
- package/dist/components/menu/features/submenu.js +3 -0
- package/dist/components/menu/index.d.ts +10 -6
- package/dist/components/menu/types.d.ts +13 -1
- package/dist/components/navigation-bar/index.d.ts +70 -2
- package/dist/components/navigation-rail/index.d.ts +98 -2
- package/dist/components/progress/index.d.ts +9 -2
- package/dist/components/radios/config.js +1 -0
- package/dist/components/radios/index.d.ts +158 -3
- package/dist/components/radios/radio.js +2 -0
- package/dist/components/search/features/input.js +6 -1
- package/dist/components/search/features/states.js +3 -3
- package/dist/components/search/features/structure.js +27 -5
- package/dist/components/search/features/suggestions.js +4 -0
- package/dist/components/search/index.d.ts +255 -2
- package/dist/components/select/index.d.ts +252 -6
- package/dist/components/side-sheet/config.js +1 -1
- package/dist/components/side-sheet/features/structure.js +10 -2
- package/dist/components/side-sheet/index.d.ts +104 -2
- package/dist/components/slider/config.js +3 -2
- package/dist/components/slider/index.d.ts +236 -2
- package/dist/components/snackbar/api.js +26 -0
- package/dist/components/snackbar/constants.d.ts +4 -0
- package/dist/components/snackbar/constants.js +3 -1
- package/dist/components/snackbar/index.d.ts +215 -4
- package/dist/components/split-button/config.js +1 -1
- package/dist/components/split-button/index.d.ts +10 -3
- package/dist/components/switch/config.js +3 -2
- package/dist/components/switch/index.d.ts +190 -3
- package/dist/components/tabs/config.js +1 -0
- package/dist/components/tabs/index.d.ts +476 -12
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/responsive-legacy.js +65 -0
- package/dist/components/tabs/responsive.d.ts +7 -32
- package/dist/components/tabs/responsive.js +4 -63
- package/dist/components/tabs/tab.js +11 -5
- package/dist/components/tabs/tabs.js +1 -0
- package/dist/components/text-field/config.js +9 -5
- package/dist/components/text-field/features/field.js +61 -0
- package/dist/components/text-field/features/leading-icon.js +12 -45
- package/dist/components/text-field/features/prefix-text.js +6 -40
- package/dist/components/text-field/features/suffix-text.js +6 -40
- package/dist/components/text-field/index.d.ts +345 -3
- package/dist/components/timepicker/api.js +7 -8
- package/dist/components/timepicker/config.js +1 -1
- package/dist/components/timepicker/constants.d.ts +4 -4
- package/dist/components/timepicker/constants.js +2 -2
- package/dist/components/timepicker/index.d.ts +279 -5
- package/dist/components/timepicker/render.js +26 -6
- package/dist/components/timepicker/timepicker.js +0 -1
- package/dist/components/toolbar/config.js +1 -0
- package/dist/components/toolbar/constants.d.ts +4 -1
- package/dist/components/toolbar/constants.js +3 -0
- package/dist/components/toolbar/index.d.ts +145 -6
- package/dist/components/toolbar/toolbar.js +18 -3
- package/dist/components/tooltip/index.d.ts +155 -3
- package/dist/components/top-app-bar/index.d.ts +92 -5
- package/dist/core/canvas/index.d.ts +172 -5
- package/dist/core/compose/features/icon-opt-in.js +5 -0
- package/dist/core/compose/features/icon-slot.js +100 -0
- package/dist/core/compose/features/textinput.js +2 -0
- package/dist/core/compose/features/track.js +4 -0
- package/dist/core/compose/index.d.ts +744 -8
- package/dist/core/config/component.d.ts +5 -515
- package/dist/core/config/control-label.js +5 -0
- package/dist/core/dom/index.d.ts +245 -12
- package/dist/core/index.d.ts +93 -14
- package/dist/core/shapes/index.d.ts +286 -6
- package/dist/core/state/index.d.ts +98 -5
- package/dist/core/theme/index.d.ts +80 -4
- package/dist/core/utils/index.d.ts +98 -9
- package/dist/elements/bottom-sheet.js +3 -2
- package/dist/elements/css/badge.js +2 -2
- package/dist/elements/css/bottom-app-bar.js +2 -2
- package/dist/elements/css/bottom-sheet.css +1 -1
- package/dist/elements/css/bottom-sheet.js +2 -2
- package/dist/elements/css/button-group.css +1 -1
- package/dist/elements/css/button-group.js +2 -2
- package/dist/elements/css/button.css +1 -1
- package/dist/elements/css/button.js +2 -2
- package/dist/elements/css/card.js +2 -2
- package/dist/elements/css/carousel.js +2 -2
- package/dist/elements/css/checkbox.js +2 -2
- package/dist/elements/css/chips.js +2 -2
- package/dist/elements/css/datepicker.css +1 -1
- package/dist/elements/css/datepicker.js +2 -2
- package/dist/elements/css/dialog.css +1 -1
- package/dist/elements/css/dialog.js +2 -2
- package/dist/elements/css/divider.js +2 -2
- package/dist/elements/css/drawer.css +1 -1
- package/dist/elements/css/drawer.js +2 -2
- package/dist/elements/css/extended-fab.js +2 -2
- package/dist/elements/css/fab-menu.js +2 -2
- package/dist/elements/css/fab.js +2 -2
- package/dist/elements/css/icon-button.css +1 -1
- package/dist/elements/css/icon-button.js +2 -2
- package/dist/elements/css/list.css +1 -1
- package/dist/elements/css/list.js +2 -2
- package/dist/elements/css/loading-indicator.js +2 -2
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +2 -2
- package/dist/elements/css/navigation-bar.js +2 -2
- package/dist/elements/css/navigation-rail.js +2 -2
- package/dist/elements/css/progress.js +2 -2
- package/dist/elements/css/radios.js +2 -2
- package/dist/elements/css/ripple.js +2 -2
- package/dist/elements/css/search.js +2 -2
- package/dist/elements/css/select.js +2 -2
- package/dist/elements/css/side-sheet.css +1 -1
- package/dist/elements/css/side-sheet.js +2 -2
- package/dist/elements/css/slider.js +2 -2
- package/dist/elements/css/snackbar.css +1 -1
- package/dist/elements/css/snackbar.js +2 -2
- package/dist/elements/css/split-button.js +2 -2
- package/dist/elements/css/switch.js +2 -2
- package/dist/elements/css/tabs.js +2 -2
- package/dist/elements/css/text-field.css +1 -1
- package/dist/elements/css/text-field.js +2 -2
- package/dist/elements/css/timepicker.css +1 -1
- package/dist/elements/css/timepicker.js +2 -2
- package/dist/elements/css/toolbar.css +1 -1
- package/dist/elements/css/toolbar.js +2 -2
- package/dist/elements/css/tooltip.js +2 -2
- package/dist/elements/css/top-app-bar.js +2 -2
- package/dist/elements/datepicker.js +2 -0
- package/dist/elements/define.js +12 -1
- package/dist/elements/drawer.js +2 -0
- package/dist/elements/index.d.ts +3946 -376
- package/dist/elements/menu.js +17 -3
- 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 +2 -2
- package/dist/elements/preupgrade/button.css +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/elements/preupgrade/list.css +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/elements/preupgrade.js +2 -3
- package/dist/elements/radios.js +5 -1
- package/dist/elements/search.js +19 -3
- package/dist/elements/sheet.js +16 -6
- package/dist/elements/side-sheet.js +5 -3
- package/dist/elements/snackbar.js +2 -0
- package/dist/elements/styles.js +39 -0
- package/dist/elements/switch.js +1 -0
- package/dist/elements/tabs.js +6 -0
- package/dist/elements/text-field.js +2 -0
- package/dist/elements/timepicker.js +1 -0
- package/dist/elements/toolbar.js +13 -1
- package/dist/index.d.ts +78 -4
- package/dist/react/index.d.ts +106 -52
- package/dist/react/jsx.d.ts +50 -49
- package/dist/solid/index.d.ts +106 -52
- package/dist/solid/jsx.d.ts +81 -76
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +2 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +2 -2
- package/dist/styles/button-group.css +2 -2
- package/dist/styles/button.css +2 -2
- 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 +2 -2
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +2 -2
- 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 +2 -2
- package/dist/styles/list.css +2 -2
- 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 +2 -2
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +2 -2
- 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 +2 -2
- package/dist/styles/timepicker.css +2 -2
- package/dist/styles/toolbar.css +2 -2
- 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/BottomAppBar.svelte.d.ts +1 -0
- package/dist/theme/2025.d.ts +3 -0
- package/dist/theme/2025.js +2 -0
- package/dist/theme/index.js +65 -17
- package/dist/theme/spec2025.d.ts +56 -0
- package/dist/theme/spec2025.js +37 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2025.js +846 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +7 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.js +9 -5
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +12 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +13 -9
- package/dist/theme/vendor/dynamiccolor/spec_2025.js +263 -0
- package/dist/theme/vendor/dynamiccolor/spec_extensions.js +70 -0
- package/dist/theme/vendor/palettes/tonal_palette.d.ts +23 -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/index.d.ts +192 -53
- package/package.json +12 -3
- package/src/styles/abstract/_functions.scss +22 -1
- package/src/styles/abstract/_variables.scss +0 -2
- package/src/styles/base/_tokens.scss +12 -0
- package/src/styles/components/_bottom-sheet.scss +1 -0
- package/src/styles/components/_button-group.scss +9 -5
- package/src/styles/components/_button.scss +28 -12
- package/src/styles/components/_datepicker.scss +1 -0
- package/src/styles/components/_dialog.scss +1 -0
- package/src/styles/components/_drawer.scss +33 -65
- package/src/styles/components/_icon-button.scss +32 -33
- package/src/styles/components/_list.scss +54 -6
- package/src/styles/components/_menu.scss +65 -46
- package/src/styles/components/_side-sheet.scss +1 -0
- package/src/styles/components/_snackbar.scss +1 -0
- package/src/styles/components/_text-field.scss +17 -109
- package/src/styles/components/_timepicker.scss +2 -1
- package/src/styles/components/_toolbar.scss +23 -6
- package/src/styles/elements/_button-group.scss +17 -4
- package/src/styles/elements/_button.scss +3 -2
- package/src/styles/elements/_drawer.scss +2 -1
- package/src/styles/elements/_field.scss +25 -14
- package/src/styles/elements/_icon-button.scss +8 -3
- package/src/styles/elements/_list.scss +3 -2
- package/src/styles/elements/_text-field.scss +71 -47
- package/dist/components/badge/badge.d.ts +0 -7
- package/dist/components/badge/types.d.ts +0 -152
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +0 -6
- package/dist/components/bottom-app-bar/types.d.ts +0 -63
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -7
- package/dist/components/bottom-sheet/types.d.ts +0 -98
- package/dist/components/button/button.d.ts +0 -7
- package/dist/components/button-group/button-group.d.ts +0 -7
- package/dist/components/button-group/types.d.ts +0 -227
- package/dist/components/card/card.d.ts +0 -7
- package/dist/components/card/content.d.ts +0 -22
- package/dist/components/card/types.d.ts +0 -272
- package/dist/components/carousel/carousel.d.ts +0 -4
- package/dist/components/carousel/types.d.ts +0 -81
- package/dist/components/checkbox/checkbox.d.ts +0 -8
- package/dist/components/checkbox/types.d.ts +0 -194
- package/dist/components/chips/chips.d.ts +0 -7
- package/dist/components/chips/factories.d.ts +0 -9
- package/dist/components/chips/types.d.ts +0 -304
- package/dist/components/datepicker/datepicker.d.ts +0 -7
- package/dist/components/datepicker/types.d.ts +0 -296
- package/dist/components/datepicker/types.js +0 -17
- package/dist/components/dialog/dialog.d.ts +0 -8
- package/dist/components/dialog/types.d.ts +0 -311
- package/dist/components/divider/config.d.ts +0 -43
- package/dist/components/divider/divider.d.ts +0 -7
- package/dist/components/divider/types.d.ts +0 -43
- package/dist/components/drawer/drawer.d.ts +0 -7
- package/dist/components/drawer/types.d.ts +0 -179
- package/dist/components/extended-fab/extended-fab.d.ts +0 -7
- package/dist/components/extended-fab/types.d.ts +0 -208
- package/dist/components/fab/fab.d.ts +0 -7
- package/dist/components/fab/types.d.ts +0 -168
- package/dist/components/fab-menu/fab-menu.d.ts +0 -8
- package/dist/components/fab-menu/types.d.ts +0 -91
- package/dist/components/icon-button/icon-button.d.ts +0 -7
- package/dist/components/index.d.ts +0 -81
- package/dist/components/list/list.d.ts +0 -7
- package/dist/components/list/types.d.ts +0 -257
- package/dist/components/loading-indicator/features/renderer.d.ts +0 -28
- package/dist/components/loading-indicator/loading-indicator.d.ts +0 -7
- package/dist/components/loading-indicator/types.d.ts +0 -53
- package/dist/components/menu/menu.d.ts +0 -7
- package/dist/components/navigation-bar/navigation-bar.d.ts +0 -3
- package/dist/components/navigation-bar/types.d.ts +0 -59
- package/dist/components/navigation-rail/navigation-rail.d.ts +0 -3
- package/dist/components/navigation-rail/types.d.ts +0 -87
- package/dist/components/progress/progress.d.ts +0 -7
- package/dist/components/radios/radios.d.ts +0 -7
- package/dist/components/radios/types.d.ts +0 -142
- package/dist/components/search/search.d.ts +0 -7
- package/dist/components/search/types.d.ts +0 -235
- package/dist/components/select/select.d.ts +0 -7
- package/dist/components/select/types.d.ts +0 -232
- package/dist/components/side-sheet/side-sheet.d.ts +0 -7
- package/dist/components/side-sheet/types.d.ts +0 -89
- package/dist/components/slider/slider.d.ts +0 -7
- package/dist/components/slider/types.d.ts +0 -213
- package/dist/components/snackbar/snackbar.d.ts +0 -9
- package/dist/components/snackbar/types.d.ts +0 -180
- package/dist/components/split-button/split-button.d.ts +0 -7
- package/dist/components/switch/switch.d.ts +0 -7
- package/dist/components/switch/types.d.ts +0 -166
- package/dist/components/tabs/indicator.d.ts +0 -44
- package/dist/components/tabs/tab.d.ts +0 -7
- package/dist/components/tabs/tabs.d.ts +0 -7
- package/dist/components/tabs/types.d.ts +0 -300
- package/dist/components/tabs/utils.d.ts +0 -46
- package/dist/components/text-field/features/trailing-icon.d.ts +0 -54
- package/dist/components/text-field/text-field.d.ts +0 -7
- package/dist/components/text-field/types.d.ts +0 -256
- package/dist/components/timepicker/timepicker.d.ts +0 -3
- package/dist/components/timepicker/types.d.ts +0 -254
- package/dist/components/toolbar/toolbar.d.ts +0 -8
- package/dist/components/toolbar/types.d.ts +0 -125
- package/dist/components/tooltip/tooltip.d.ts +0 -7
- package/dist/components/tooltip/types.d.ts +0 -137
- package/dist/components/top-app-bar/top-app-bar.d.ts +0 -7
- package/dist/components/top-app-bar/types.d.ts +0 -80
- package/dist/core/canvas/animation.d.ts +0 -20
- package/dist/core/canvas/drawing.d.ts +0 -67
- package/dist/core/canvas/resize.d.ts +0 -8
- package/dist/core/canvas/utils.d.ts +0 -62
- package/dist/core/compose/base.d.ts +0 -18
- package/dist/core/compose/features/badge.d.ts +0 -27
- package/dist/core/compose/features/checkable.d.ts +0 -33
- package/dist/core/compose/features/debounce.d.ts +0 -45
- package/dist/core/compose/features/disabled.d.ts +0 -26
- package/dist/core/compose/features/events.d.ts +0 -31
- package/dist/core/compose/features/index.d.ts +0 -34
- package/dist/core/compose/features/input.d.ts +0 -54
- package/dist/core/compose/features/lifecycle.d.ts +0 -41
- package/dist/core/compose/features/position.d.ts +0 -36
- package/dist/core/compose/features/ripple.d.ts +0 -35
- package/dist/core/compose/features/size.d.ts +0 -12
- package/dist/core/compose/features/style.d.ts +0 -11
- package/dist/core/compose/features/textinput.d.ts +0 -66
- package/dist/core/compose/features/textlabel.d.ts +0 -34
- package/dist/core/compose/features/throttle.d.ts +0 -38
- package/dist/core/compose/features/track.d.ts +0 -24
- package/dist/core/compose/features/variant.d.ts +0 -12
- package/dist/core/compose/features/withEvents.d.ts +0 -27
- package/dist/core/compose/pipe.d.ts +0 -55
- package/dist/core/compose/utils/type-guards.d.ts +0 -17
- package/dist/core/config.d.ts +0 -72
- package/dist/core/dom/attributes.d.ts +0 -34
- package/dist/core/dom/classes.d.ts +0 -29
- package/dist/core/dom/events.d.ts +0 -43
- package/dist/core/dom/focus.d.ts +0 -15
- package/dist/core/dom/html.d.ts +0 -16
- package/dist/core/dom/layer.d.ts +0 -57
- package/dist/core/dom/roving.d.ts +0 -18
- package/dist/core/shapes/cubic.d.ts +0 -45
- package/dist/core/shapes/material.d.ts +0 -131
- package/dist/core/shapes/polygon.d.ts +0 -38
- package/dist/core/state/events.d.ts +0 -25
- package/dist/core/state/store.d.ts +0 -60
- package/dist/core/theme/shape.d.ts +0 -5
- package/dist/core/theme/tokens.d.ts +0 -67
- package/dist/core/utils/background.d.ts +0 -13
- package/dist/core/utils/color.d.ts +0 -6
- package/dist/core/utils/object.d.ts +0 -11
- package/dist/core/utils/performance.d.ts +0 -32
- package/dist/core/utils/theme.d.ts +0 -17
- package/dist/core/utils/url.d.ts +0 -6
- package/dist/elements/badge.d.ts +0 -57
- package/dist/elements/bottom-app-bar.d.ts +0 -49
- package/dist/elements/bottom-sheet.d.ts +0 -107
- package/dist/elements/button-group.d.ts +0 -142
- package/dist/elements/button.d.ts +0 -101
- package/dist/elements/card.d.ts +0 -69
- package/dist/elements/carousel.d.ts +0 -119
- package/dist/elements/checkbox.d.ts +0 -97
- package/dist/elements/chips.d.ts +0 -126
- package/dist/elements/css/badge.d.ts +0 -1
- package/dist/elements/css/bottom-app-bar.d.ts +0 -1
- package/dist/elements/css/bottom-sheet.d.ts +0 -1
- package/dist/elements/css/button-group.d.ts +0 -1
- package/dist/elements/css/button.d.ts +0 -1
- package/dist/elements/css/card.d.ts +0 -1
- package/dist/elements/css/carousel.d.ts +0 -1
- package/dist/elements/css/checkbox.d.ts +0 -1
- package/dist/elements/css/chips.d.ts +0 -1
- package/dist/elements/css/datepicker.d.ts +0 -1
- package/dist/elements/css/dialog.d.ts +0 -1
- package/dist/elements/css/divider.d.ts +0 -1
- package/dist/elements/css/drawer.d.ts +0 -1
- package/dist/elements/css/extended-fab.d.ts +0 -1
- package/dist/elements/css/fab-menu.d.ts +0 -1
- package/dist/elements/css/fab.d.ts +0 -1
- package/dist/elements/css/icon-button.d.ts +0 -1
- package/dist/elements/css/list.d.ts +0 -1
- package/dist/elements/css/loading-indicator.d.ts +0 -1
- package/dist/elements/css/menu.d.ts +0 -1
- package/dist/elements/css/navigation-bar.d.ts +0 -1
- package/dist/elements/css/navigation-rail.d.ts +0 -1
- package/dist/elements/css/progress.d.ts +0 -1
- package/dist/elements/css/radios.d.ts +0 -1
- package/dist/elements/css/ripple.d.ts +0 -1
- package/dist/elements/css/search.d.ts +0 -1
- package/dist/elements/css/select.d.ts +0 -1
- package/dist/elements/css/side-sheet.d.ts +0 -1
- package/dist/elements/css/slider.d.ts +0 -1
- package/dist/elements/css/snackbar.d.ts +0 -1
- package/dist/elements/css/split-button.d.ts +0 -1
- package/dist/elements/css/switch.d.ts +0 -1
- package/dist/elements/css/tabs.d.ts +0 -1
- package/dist/elements/css/text-field.d.ts +0 -1
- package/dist/elements/css/timepicker.d.ts +0 -1
- package/dist/elements/css/toolbar.d.ts +0 -1
- package/dist/elements/css/tooltip.d.ts +0 -1
- package/dist/elements/css/top-app-bar.d.ts +0 -1
- package/dist/elements/datepicker.d.ts +0 -126
- package/dist/elements/dialog.d.ts +0 -101
- package/dist/elements/divider.d.ts +0 -52
- package/dist/elements/drawer.d.ts +0 -119
- package/dist/elements/extended-fab.d.ts +0 -97
- package/dist/elements/fab-menu.d.ts +0 -102
- package/dist/elements/fab.d.ts +0 -71
- package/dist/elements/list.d.ts +0 -127
- package/dist/elements/loading-indicator.d.ts +0 -47
- package/dist/elements/menu.d.ts +0 -144
- package/dist/elements/navigation-bar.d.ts +0 -104
- package/dist/elements/navigation-rail.d.ts +0 -145
- package/dist/elements/progress.d.ts +0 -87
- package/dist/elements/radios.d.ts +0 -91
- package/dist/elements/search.d.ts +0 -202
- package/dist/elements/select.d.ts +0 -119
- package/dist/elements/side-sheet.d.ts +0 -83
- package/dist/elements/slider.d.ts +0 -160
- package/dist/elements/snackbar.d.ts +0 -87
- package/dist/elements/split-button.d.ts +0 -87
- package/dist/elements/switch.d.ts +0 -94
- package/dist/elements/tabs.d.ts +0 -71
- package/dist/elements/text-field.d.ts +0 -170
- package/dist/elements/timepicker.d.ts +0 -143
- package/dist/elements/toolbar.d.ts +0 -90
- package/dist/elements/tooltip.d.ts +0 -75
- package/dist/elements/top-app-bar.d.ts +0 -60
- package/dist/react/badge.d.ts +0 -4
- package/dist/react/bottom-app-bar.d.ts +0 -4
- package/dist/react/bottom-sheet.d.ts +0 -4
- package/dist/react/button-group-item.d.ts +0 -3
- package/dist/react/button-group.d.ts +0 -7
- package/dist/react/button.d.ts +0 -5
- package/dist/react/card.d.ts +0 -4
- package/dist/react/carousel-item.d.ts +0 -3
- package/dist/react/carousel.d.ts +0 -4
- package/dist/react/checkbox.d.ts +0 -4
- package/dist/react/chip.d.ts +0 -3
- package/dist/react/chips.d.ts +0 -4
- package/dist/react/datepicker.d.ts +0 -4
- package/dist/react/dialog.d.ts +0 -7
- package/dist/react/divider.d.ts +0 -4
- package/dist/react/drawer-item.d.ts +0 -3
- package/dist/react/drawer.d.ts +0 -4
- package/dist/react/extended-fab.d.ts +0 -4
- package/dist/react/fab-menu-item.d.ts +0 -3
- package/dist/react/fab-menu.d.ts +0 -6
- package/dist/react/fab.d.ts +0 -4
- package/dist/react/icon-button.d.ts +0 -4
- package/dist/react/list-item.d.ts +0 -3
- package/dist/react/list.d.ts +0 -4
- package/dist/react/loading-indicator.d.ts +0 -4
- package/dist/react/menu-item.d.ts +0 -3
- package/dist/react/menu.d.ts +0 -4
- package/dist/react/navigation-bar-item.d.ts +0 -3
- package/dist/react/navigation-bar.d.ts +0 -4
- package/dist/react/navigation-rail-item.d.ts +0 -3
- package/dist/react/navigation-rail.d.ts +0 -4
- package/dist/react/progress.d.ts +0 -4
- package/dist/react/radio.d.ts +0 -3
- package/dist/react/radios.d.ts +0 -4
- package/dist/react/search-suggestion.d.ts +0 -3
- package/dist/react/search.d.ts +0 -4
- package/dist/react/select-option.d.ts +0 -3
- package/dist/react/select.d.ts +0 -6
- package/dist/react/side-sheet.d.ts +0 -4
- package/dist/react/slider.d.ts +0 -4
- package/dist/react/snackbar.d.ts +0 -7
- package/dist/react/split-button.d.ts +0 -7
- package/dist/react/switch.d.ts +0 -4
- package/dist/react/tab.d.ts +0 -3
- package/dist/react/tabs.d.ts +0 -7
- package/dist/react/text-field.d.ts +0 -4
- package/dist/react/timepicker.d.ts +0 -4
- package/dist/react/toolbar.d.ts +0 -5
- package/dist/react/tooltip.d.ts +0 -4
- package/dist/react/top-app-bar.d.ts +0 -4
- package/dist/solid/badge.d.ts +0 -4
- package/dist/solid/bottom-app-bar.d.ts +0 -4
- package/dist/solid/bottom-sheet.d.ts +0 -4
- package/dist/solid/button-group-item.d.ts +0 -3
- package/dist/solid/button-group.d.ts +0 -7
- package/dist/solid/button.d.ts +0 -5
- package/dist/solid/card.d.ts +0 -4
- package/dist/solid/carousel-item.d.ts +0 -3
- package/dist/solid/carousel.d.ts +0 -4
- package/dist/solid/checkbox.d.ts +0 -4
- package/dist/solid/chip.d.ts +0 -3
- package/dist/solid/chips.d.ts +0 -4
- package/dist/solid/datepicker.d.ts +0 -4
- package/dist/solid/dialog.d.ts +0 -7
- package/dist/solid/divider.d.ts +0 -4
- package/dist/solid/drawer-item.d.ts +0 -3
- package/dist/solid/drawer.d.ts +0 -4
- package/dist/solid/extended-fab.d.ts +0 -4
- package/dist/solid/fab-menu-item.d.ts +0 -3
- package/dist/solid/fab-menu.d.ts +0 -6
- package/dist/solid/fab.d.ts +0 -4
- package/dist/solid/icon-button.d.ts +0 -4
- package/dist/solid/list-item.d.ts +0 -3
- package/dist/solid/list.d.ts +0 -4
- package/dist/solid/loading-indicator.d.ts +0 -4
- package/dist/solid/menu-item.d.ts +0 -3
- package/dist/solid/menu.d.ts +0 -4
- package/dist/solid/navigation-bar-item.d.ts +0 -3
- package/dist/solid/navigation-bar.d.ts +0 -4
- package/dist/solid/navigation-rail-item.d.ts +0 -3
- package/dist/solid/navigation-rail.d.ts +0 -4
- package/dist/solid/progress.d.ts +0 -4
- package/dist/solid/radio.d.ts +0 -3
- package/dist/solid/radios.d.ts +0 -4
- package/dist/solid/search-suggestion.d.ts +0 -3
- package/dist/solid/search.d.ts +0 -4
- package/dist/solid/select-option.d.ts +0 -3
- package/dist/solid/select.d.ts +0 -6
- package/dist/solid/side-sheet.d.ts +0 -4
- package/dist/solid/slider.d.ts +0 -4
- package/dist/solid/snackbar.d.ts +0 -7
- package/dist/solid/split-button.d.ts +0 -7
- package/dist/solid/switch.d.ts +0 -4
- package/dist/solid/tab.d.ts +0 -3
- package/dist/solid/tabs.d.ts +0 -7
- package/dist/solid/text-field.d.ts +0 -4
- package/dist/solid/timepicker.d.ts +0 -4
- package/dist/solid/toolbar.d.ts +0 -5
- package/dist/solid/tooltip.d.ts +0 -4
- package/dist/solid/top-app-bar.d.ts +0 -4
- package/dist/styles/badge.d.ts +0 -1
- package/dist/styles/base-lite.d.ts +0 -1
- package/dist/styles/base.d.ts +0 -1
- package/dist/styles/bottom-app-bar.d.ts +0 -1
- package/dist/styles/bottom-sheet.d.ts +0 -1
- package/dist/styles/button-group.d.ts +0 -1
- package/dist/styles/button.d.ts +0 -1
- package/dist/styles/card.d.ts +0 -1
- package/dist/styles/carousel.d.ts +0 -1
- package/dist/styles/checkbox.d.ts +0 -1
- package/dist/styles/chips.d.ts +0 -1
- package/dist/styles/contrast.d.ts +0 -1
- package/dist/styles/datepicker.d.ts +0 -1
- package/dist/styles/dialog.d.ts +0 -1
- package/dist/styles/divider.d.ts +0 -1
- package/dist/styles/drawer.d.ts +0 -1
- package/dist/styles/extended-fab.d.ts +0 -1
- package/dist/styles/fab-menu.d.ts +0 -1
- package/dist/styles/fab.d.ts +0 -1
- package/dist/styles/icon-button.d.ts +0 -1
- package/dist/styles/list.d.ts +0 -1
- package/dist/styles/loading-indicator.d.ts +0 -1
- package/dist/styles/menu.d.ts +0 -1
- package/dist/styles/navigation-bar.d.ts +0 -1
- package/dist/styles/navigation-rail.d.ts +0 -1
- package/dist/styles/progress.d.ts +0 -1
- package/dist/styles/radios.d.ts +0 -1
- package/dist/styles/search.d.ts +0 -1
- package/dist/styles/select.d.ts +0 -1
- package/dist/styles/side-sheet.d.ts +0 -1
- package/dist/styles/slider.d.ts +0 -1
- package/dist/styles/snackbar.d.ts +0 -1
- package/dist/styles/split-button.d.ts +0 -1
- package/dist/styles/switch.d.ts +0 -1
- package/dist/styles/tabs.d.ts +0 -1
- package/dist/styles/text-field.d.ts +0 -1
- package/dist/styles/timepicker.d.ts +0 -1
- package/dist/styles/toolbar.d.ts +0 -1
- package/dist/styles/tooltip.d.ts +0 -1
- package/dist/styles/top-app-bar.d.ts +0 -1
- package/dist/styles/typography.d.ts +0 -1
- package/dist/styles/utilities.d.ts +0 -1
- package/dist/theme/roles.js +0 -68
- package/dist/theme/vendor/scheme/scheme_content.js +0 -30
- package/dist/theme/vendor/scheme/scheme_expressive.js +0 -30
- package/dist/theme/vendor/scheme/scheme_fidelity.js +0 -30
- package/dist/theme/vendor/scheme/scheme_monochrome.js +0 -30
- package/dist/theme/vendor/scheme/scheme_neutral.js +0 -30
- package/dist/theme/vendor/scheme/scheme_tonal_spot.js +0 -30
- package/dist/theme/vendor/scheme/scheme_vibrant.js +0 -30
- package/dist/vue/badge.d.ts +0 -4
- package/dist/vue/bottom-app-bar.d.ts +0 -4
- package/dist/vue/bottom-sheet.d.ts +0 -4
- package/dist/vue/button-group-item.d.ts +0 -3
- package/dist/vue/button-group.d.ts +0 -7
- package/dist/vue/button.d.ts +0 -5
- package/dist/vue/card.d.ts +0 -4
- package/dist/vue/carousel-item.d.ts +0 -3
- package/dist/vue/carousel.d.ts +0 -4
- package/dist/vue/checkbox.d.ts +0 -4
- package/dist/vue/chip.d.ts +0 -3
- package/dist/vue/chips.d.ts +0 -4
- package/dist/vue/create.d.ts +0 -73
- package/dist/vue/datepicker.d.ts +0 -4
- package/dist/vue/dialog.d.ts +0 -7
- package/dist/vue/divider.d.ts +0 -4
- package/dist/vue/drawer-item.d.ts +0 -3
- package/dist/vue/drawer.d.ts +0 -4
- package/dist/vue/extended-fab.d.ts +0 -4
- package/dist/vue/fab-menu-item.d.ts +0 -3
- package/dist/vue/fab-menu.d.ts +0 -6
- package/dist/vue/fab.d.ts +0 -4
- package/dist/vue/icon-button.d.ts +0 -4
- package/dist/vue/list-item.d.ts +0 -3
- package/dist/vue/list.d.ts +0 -4
- package/dist/vue/loading-indicator.d.ts +0 -4
- package/dist/vue/menu-item.d.ts +0 -3
- package/dist/vue/menu.d.ts +0 -4
- package/dist/vue/navigation-bar-item.d.ts +0 -3
- package/dist/vue/navigation-bar.d.ts +0 -4
- package/dist/vue/navigation-rail-item.d.ts +0 -3
- package/dist/vue/navigation-rail.d.ts +0 -4
- package/dist/vue/progress.d.ts +0 -4
- package/dist/vue/radio.d.ts +0 -3
- package/dist/vue/radios.d.ts +0 -4
- package/dist/vue/search-suggestion.d.ts +0 -3
- package/dist/vue/search.d.ts +0 -4
- package/dist/vue/select-option.d.ts +0 -3
- package/dist/vue/select.d.ts +0 -6
- package/dist/vue/side-sheet.d.ts +0 -4
- package/dist/vue/slider.d.ts +0 -4
- package/dist/vue/snackbar.d.ts +0 -7
- package/dist/vue/split-button.d.ts +0 -7
- package/dist/vue/switch.d.ts +0 -4
- package/dist/vue/tab.d.ts +0 -3
- package/dist/vue/tabs.d.ts +0 -7
- package/dist/vue/text-field.d.ts +0 -4
- package/dist/vue/timepicker.d.ts +0 -4
- package/dist/vue/toolbar.d.ts +0 -5
- package/dist/vue/tooltip.d.ts +0 -4
- package/dist/vue/top-app-bar.d.ts +0 -4
package/dist/core/dom/index.d.ts
CHANGED
|
@@ -1,13 +1,246 @@
|
|
|
1
|
-
|
|
1
|
+
/** How an element is promoted to the browser's top layer: */
|
|
2
|
+
type TopLayerKind = "popover-auto" | "popover-manual" | "modal";
|
|
3
|
+
|
|
4
|
+
interface TopLayerOptions {
|
|
5
|
+
kind: TopLayerKind;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type Layered = Omit<HTMLElement, "showPopover"> & Partial<Pick<HTMLDialogElement & HTMLElement, "showModal" | "close" | "open" | "showPopover">>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Whether the browser can show an element of this kind in the top layer: `showPopover` for the popovers, `HTMLDialogElement.prototype.showModal` for a modal.
|
|
12
|
+
* @param kind
|
|
13
|
+
*/
|
|
14
|
+
declare const supportsTopLayer: (kind: TopLayerKind) => boolean;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Shows an element in the top layer, above everything else on the page whatever its z-index and whatever clips or transforms its ancestors.
|
|
18
|
+
* @param element
|
|
19
|
+
* @param options
|
|
20
|
+
*/
|
|
21
|
+
declare const showInTopLayer: (element: Layered, { kind }: TopLayerOptions) => boolean;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Takes an element out of the top layer.
|
|
25
|
+
* @param element
|
|
26
|
+
*/
|
|
27
|
+
declare const hideFromTopLayer: (element: Layered) => void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Reports the closes the browser makes on its own: a light dismiss or Escape for `popover="auto"` (a `toggle` event to `closed`), Escape or a form for a modal dialog (its `close` event, which follows an uncanceled `cancel`).
|
|
31
|
+
* @param element
|
|
32
|
+
* @param callback
|
|
33
|
+
*/
|
|
34
|
+
declare const onTopLayerClose: (element: HTMLElement, callback: () => void) => (() => void);
|
|
35
|
+
|
|
36
|
+
/** A modal outside the top layer: makes everything but `keep` inert, as showModal() does for a top-layer dialog. */
|
|
37
|
+
declare const inertOutside: (keep: Element) => (() => void);
|
|
38
|
+
|
|
39
|
+
/** What eventsFrom returns: see there. */
|
|
40
|
+
interface EventsFrom {
|
|
41
|
+
/** Whether the event's dispatch began after the call */
|
|
42
|
+
after: (event: Event) => boolean;
|
|
43
|
+
/** Releases the marker. */
|
|
44
|
+
stop: () => void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Tells the events that came after this call from the one that was already on its way: "the event that opened an overlay never dismisses it".
|
|
49
|
+
* @param element
|
|
50
|
+
*/
|
|
51
|
+
declare const eventsFrom: (element: HTMLElement) => EventsFrom;
|
|
52
|
+
|
|
53
|
+
/** A modal's place in the Escape stack: see onModalEscape. */
|
|
54
|
+
interface ModalEscape {
|
|
55
|
+
/** True for the rest of the task the modal opened in, for the one event the marker cannot number: the `cancel` the browser sends the topmost modal `<dialog>` for the key press that opened it, when the page stopped that key press before it reached the window. */
|
|
56
|
+
opening: boolean;
|
|
57
|
+
/** Takes the modal off the stack. */
|
|
58
|
+
stop: () => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Escape for a modal, handled as a key press.
|
|
63
|
+
* @param element
|
|
64
|
+
* @param escape
|
|
65
|
+
* @param d
|
|
66
|
+
*/
|
|
67
|
+
declare const onModalEscape: (element: HTMLElement, escape: () => void, d?: (() => unknown) | false) => ModalEscape;
|
|
68
|
+
/**
|
|
69
|
+
* Normalize classes to array of unique strings with optimization and caching
|
|
70
|
+
* @param classes
|
|
71
|
+
*/
|
|
72
|
+
declare const normalizeClasses: (...classes: (string | string[])[]) => string[];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Add prefixed classes to element with optimizations
|
|
76
|
+
* @param element
|
|
77
|
+
* @param classes
|
|
78
|
+
*/
|
|
79
|
+
declare const addClass: (element: HTMLElement, ...classes: (string | string[])[]) => HTMLElement;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Remove prefixed classes from element with optimizations
|
|
83
|
+
* @param element
|
|
84
|
+
* @param classes
|
|
85
|
+
*/
|
|
86
|
+
declare const removeClass: (element: HTMLElement, ...classes: (string | string[])[]) => HTMLElement;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Toggle prefixed classes on element with optimizations
|
|
90
|
+
* @param element
|
|
91
|
+
* @param classes
|
|
92
|
+
*/
|
|
93
|
+
declare const toggleClass: (element: HTMLElement, ...classes: (string | string[])[]) => HTMLElement;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if element has all specified prefixed classes with optimizations
|
|
97
|
+
* @param element
|
|
98
|
+
* @param classes
|
|
99
|
+
*/
|
|
100
|
+
declare const hasClass: (element: HTMLElement, ...classes: (string | string[])[]) => boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Set attributes on an element with performance optimizations
|
|
103
|
+
* @param element
|
|
104
|
+
* @param attributes
|
|
105
|
+
*/
|
|
106
|
+
declare const setAttributes: <E extends HTMLElement | SVGElement>(element: E, attributes?: object) => E;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Remove attributes from an element
|
|
110
|
+
* @param element
|
|
111
|
+
* @param attributes
|
|
112
|
+
*/
|
|
113
|
+
declare const removeAttributes: (element: HTMLElement, attributes?: string[]) => HTMLElement;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Batch attribute operations for better performance when setting many attributes
|
|
117
|
+
* @param element
|
|
118
|
+
*/
|
|
119
|
+
declare const batchAttributes: (element: HTMLElement, operations: Array<{
|
|
120
|
+
action: "set" | "remove";
|
|
121
|
+
key: string;
|
|
122
|
+
value?: unknown;
|
|
123
|
+
}>) => HTMLElement;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Check if element has attribute
|
|
127
|
+
* @param element
|
|
128
|
+
* @param attribute
|
|
129
|
+
*/
|
|
130
|
+
declare const hasAttribute: (element: HTMLElement, attribute: string) => boolean;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Get attribute value with default
|
|
134
|
+
* @param element
|
|
135
|
+
* @param attribute
|
|
136
|
+
* @param defaultValue
|
|
137
|
+
*/
|
|
138
|
+
declare const getAttribute: (element: HTMLElement, attribute: string, defaultValue?: string) => string;
|
|
139
|
+
/** Whether the arrow keys, Home and End belong to an element: a text input, a textarea or editable content, where they move the caret. */
|
|
140
|
+
declare const isTextEditable: (element: EventTarget | null | undefined) => boolean;
|
|
141
|
+
|
|
142
|
+
interface RovingOptions {
|
|
143
|
+
/** The composite: it receives the key and focus listeners. */
|
|
144
|
+
container: HTMLElement;
|
|
145
|
+
/** The focus targets in order. */
|
|
146
|
+
targets: () => HTMLElement[];
|
|
147
|
+
/** Whether Up and Down move focus instead of Left and Right. */
|
|
148
|
+
vertical?: () => boolean;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface Roving {
|
|
152
|
+
/** Puts the one tab stop back on the current target, or the first enabled one. */
|
|
153
|
+
sync(): void;
|
|
154
|
+
/** Removes the listeners. */
|
|
155
|
+
destroy(): void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** A roving tab index over a composite's focus targets (the WAI-ARIA toolbar pattern): one tab stop, kept on the target focused last; the arrow keys along the layout, Left and Right following the reading direction; Home and End to the ends. */
|
|
159
|
+
declare const createRoving: ({ container, targets, vertical }: RovingOptions) => Roving;
|
|
160
|
+
/** A value the browser's Trusted Types API accepts for innerHTML. */
|
|
161
|
+
interface TrustedHTMLLike {
|
|
162
|
+
toString(): string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Markup a component accepts: a string, or a TrustedHTML from a policy. */
|
|
166
|
+
type HTMLInput = string | TrustedHTMLLike;
|
|
167
|
+
|
|
168
|
+
interface HTMLPolicy {
|
|
169
|
+
/** Called with every markup string before it is written. */
|
|
170
|
+
sanitize: (html: string) => HTMLInput;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Sets the policy every component's markup goes through, or clears it with null. */
|
|
174
|
+
declare const configureHTML: (next: HTMLPolicy | null) => void;
|
|
175
|
+
|
|
176
|
+
/** The policy in force, if any. */
|
|
177
|
+
declare const getHTMLPolicy: () => HTMLPolicy | null;
|
|
178
|
+
|
|
179
|
+
/** Writes markup into an element, through the policy when one is set. */
|
|
180
|
+
declare const setHTML: (element: Element, html: HTMLInput | null | undefined) => void;
|
|
181
|
+
/** Event manager interface for handling DOM events */
|
|
182
|
+
interface EventManager {
|
|
183
|
+
/**
|
|
184
|
+
* Add an event listener with options
|
|
185
|
+
* @param event
|
|
186
|
+
* @param handler
|
|
187
|
+
* @param options
|
|
188
|
+
*/
|
|
189
|
+
on: <T extends Event>(event: string, handler: (e: T) => void, options?: AddEventListenerOptions) => EventManager;
|
|
190
|
+
/**
|
|
191
|
+
* Remove an event listener
|
|
192
|
+
* @param event
|
|
193
|
+
* @param handler
|
|
194
|
+
*/
|
|
195
|
+
off: <T extends Event>(event: string, handler: (e: T) => void) => EventManager;
|
|
196
|
+
/** Temporarily disable all event listeners */
|
|
197
|
+
pause: () => EventManager;
|
|
198
|
+
/** Re-enable all event listeners */
|
|
199
|
+
resume: () => EventManager;
|
|
200
|
+
/** Remove all event listeners and clean up */
|
|
201
|
+
destroy: () => void;
|
|
202
|
+
/** Get all active handlers */
|
|
203
|
+
getHandlers: () => Map<string, HandlerInfo>;
|
|
204
|
+
/**
|
|
205
|
+
* Check if a specific handler exists
|
|
206
|
+
* @param event
|
|
207
|
+
* @param handler
|
|
208
|
+
*/
|
|
209
|
+
hasHandler: <T extends Event>(event: string, handler: (e: T) => void) => boolean;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** Handler information */
|
|
213
|
+
interface HandlerInfo {
|
|
214
|
+
original: EventListener;
|
|
215
|
+
enhanced: EventListener;
|
|
216
|
+
event: string;
|
|
217
|
+
options: AddEventListenerOptions;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Creates an event manager to handle DOM events with enhanced functionality.
|
|
222
|
+
* @param element
|
|
223
|
+
*/
|
|
224
|
+
declare const createEventManager: (element: HTMLElement) => EventManager;
|
|
225
|
+
/**
|
|
226
|
+
* The focused element as seen from a node's own root: the shadow root it lives in, or the document.
|
|
227
|
+
* @param node
|
|
228
|
+
*/
|
|
229
|
+
declare const activeElementOf: (node: Node) => Element | null;
|
|
230
|
+
|
|
231
|
+
/** The element that really has focus, looked for through open shadow roots: where focus goes back to after an overlay closes, when the overlay may sit in another root than whatever opened it. */
|
|
232
|
+
declare const deepActiveElement: () => Element | null;
|
|
233
|
+
|
|
234
|
+
/** The tab stops in a container, in the order Tab reaches them: through slots to what is assigned to them and into shadow roots, which is where the content of a web component sits. */
|
|
235
|
+
declare const tabStops: (container: Element) => HTMLElement[];
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Keeps Tab inside a modal: from its last tab stop to its first, and Shift+Tab from the first (or the modal itself) to the last.
|
|
239
|
+
* @param container
|
|
240
|
+
* @param event
|
|
241
|
+
*/
|
|
242
|
+
declare const wrapTab: (container: HTMLElement, event: KeyboardEvent) => void;
|
|
243
|
+
export type { EventManager, HTMLInput, HTMLPolicy, Roving, RovingOptions, TopLayerKind, TopLayerOptions, TrustedHTMLLike };
|
|
244
|
+
export { activeElementOf, addClass, batchAttributes, configureHTML, createEventManager, createRoving, deepActiveElement, getAttribute, getHTMLPolicy, hasAttribute, hasClass, hideFromTopLayer, inertOutside, isTextEditable, normalizeClasses, onTopLayerClose, removeAttributes, removeClass, setAttributes, setHTML, showInTopLayer, supportsTopLayer, toggleClass };
|
|
2
245
|
export type { CreateElementOptions, ForwardedEventPayload } from "./create.js";
|
|
3
|
-
export {
|
|
4
|
-
export { addClass, removeClass, toggleClass, hasClass, normalizeClasses, } from "./classes.js";
|
|
5
|
-
export { createEventManager } from "./events.js";
|
|
6
|
-
export type { EventManager } from "./events.js";
|
|
7
|
-
export { setHTML, configureHTML, getHTMLPolicy } from "./html.js";
|
|
8
|
-
export type { HTMLPolicy, HTMLInput, TrustedHTMLLike } from "./html.js";
|
|
9
|
-
export { activeElementOf, deepActiveElement } from "./focus.js";
|
|
10
|
-
export { createRoving, isTextEditable } from "./roving.js";
|
|
11
|
-
export type { Roving, RovingOptions } from "./roving.js";
|
|
12
|
-
export { supportsTopLayer, showInTopLayer, hideFromTopLayer, onTopLayerClose, inertOutside, } from "./layer.js";
|
|
13
|
-
export type { TopLayerKind, TopLayerOptions } from "./layer.js";
|
|
246
|
+
export { createElement, createSVGElement } from "./create.js";
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,18 +1,97 @@
|
|
|
1
|
+
/** Library prefix used for all components */
|
|
2
|
+
declare const PREFIX = "mtrl";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Gets a prefixed component class name
|
|
6
|
+
* @param type
|
|
7
|
+
*/
|
|
8
|
+
declare const getComponentClass: (type: string) => string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Gets a BEM modifier class name
|
|
12
|
+
* @param baseClass
|
|
13
|
+
* @param modifier
|
|
14
|
+
*/
|
|
15
|
+
declare const getModifierClass: (baseClass: string, modifier: string) => string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Gets a BEM element class name
|
|
19
|
+
* @param baseClass
|
|
20
|
+
* @param element
|
|
21
|
+
*/
|
|
22
|
+
declare const getElementClass: (baseClass: string, element: string) => string;
|
|
23
|
+
|
|
24
|
+
/** Theme configuration interface */
|
|
25
|
+
interface ThemeConfig {
|
|
26
|
+
/** Theme name */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Theme CSS variables */
|
|
29
|
+
variables: Record<string, string>;
|
|
30
|
+
/** Theme variants */
|
|
31
|
+
variants: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Component configuration interface */
|
|
35
|
+
interface ComponentConfig {
|
|
36
|
+
prefix: string;
|
|
37
|
+
type: string;
|
|
38
|
+
baseClass: string;
|
|
39
|
+
getClass: () => string;
|
|
40
|
+
getModifierClass: (modifier: string) => string;
|
|
41
|
+
getElementClass: (element: string) => string;
|
|
42
|
+
withTheme: (theme: string) => ThemedComponentConfig;
|
|
43
|
+
withVariants: (...variants: string[]) => VariantComponentConfig;
|
|
44
|
+
withStates: (...states: string[]) => StateComponentConfig;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Themed component configuration interface */
|
|
48
|
+
interface ThemedComponentConfig extends ComponentConfig {
|
|
49
|
+
theme: string;
|
|
50
|
+
getThemeClass: (variant: string) => string;
|
|
51
|
+
getCssVariables: () => Record<string, string>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Variant component configuration interface */
|
|
55
|
+
interface VariantComponentConfig extends ComponentConfig {
|
|
56
|
+
variants: string[];
|
|
57
|
+
hasVariant: (variant: string) => boolean;
|
|
58
|
+
getVariantClass: (variant: string) => string | null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** State component configuration interface */
|
|
62
|
+
interface StateComponentConfig extends ComponentConfig {
|
|
63
|
+
states: string[];
|
|
64
|
+
getStateClass: (state: string) => string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** CSS class generation utilities */
|
|
68
|
+
declare const classNames: {
|
|
69
|
+
/**
|
|
70
|
+
* Creates a BEM-style class name
|
|
71
|
+
* @param block
|
|
72
|
+
* @param element
|
|
73
|
+
* @param modifier
|
|
74
|
+
*/
|
|
75
|
+
bem: (block: string, element?: string, modifier?: string) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Joins class names, filtering out falsy values
|
|
78
|
+
* @param classes
|
|
79
|
+
*/
|
|
80
|
+
join: (...classes: (string | undefined | null | false)[]) => string;
|
|
81
|
+
};
|
|
82
|
+
export type { ComponentConfig, StateComponentConfig, ThemeConfig, ThemedComponentConfig, VariantComponentConfig };
|
|
83
|
+
export { PREFIX, classNames, getComponentClass, getElementClass, getModifierClass };
|
|
84
|
+
export * from "./canvas/index.js";
|
|
1
85
|
export * from "./compose/index.js";
|
|
2
86
|
export * from "./dom/index.js";
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export { createEmitter } from "./state/emitter.js";
|
|
87
|
+
export type { ComponentConfigMap } from "./config/global.js";
|
|
88
|
+
export type { Computation, EventManagerState, Selector, Store, StoreOptions, Updater } from "./state/index.js";
|
|
6
89
|
export type { Emitter, EventCallback } from "./state/emitter.js";
|
|
7
|
-
export { createComponentConfig, createElementConfig } from "./config/component.js";
|
|
8
|
-
export { createStore, loggingMiddleware, deriveFiltered } from "./state/store.js";
|
|
9
|
-
export type { Store, StoreOptions, Selector, Computation, Updater, } from "./state/store.js";
|
|
10
|
-
export { createEventManager as createStateEventManager } from "./state/events.js";
|
|
11
|
-
export type { EventManagerState } from "./state/events.js";
|
|
12
|
-
export * from "./canvas/index.js";
|
|
13
|
-
export * from "./canvas/index.js";
|
|
14
|
-
export { PREFIX, classNames, getComponentClass, getModifierClass, getElementClass, } from "./config.js";
|
|
15
|
-
export { setComponentDefaults, getComponentDefaults, setGlobalDefaults, clearGlobalDefaults, type ComponentConfigMap, } from "./config/global.js";
|
|
16
|
-
export { when, classNames as joinClasses, isObject, byString, hasTouchSupport, normalizeEvent, throttle, debounce, once, getInheritedBackground, } from "./utils/index.js";
|
|
17
|
-
export type { ThemeConfig, ComponentConfig, ThemedComponentConfig, VariantComponentConfig, StateComponentConfig, } from "./config.js";
|
|
18
90
|
export type { NormalizedEvent } from "./utils/mobile.js";
|
|
91
|
+
export type { SchemeRoles, SchemeToTokensOptions, ThemeRole, ThemeTokens } from "./theme/index.js";
|
|
92
|
+
export { THEME_ROLES, schemeToTokens } from "./theme/index.js";
|
|
93
|
+
export { byString, classNames as joinClasses, debounce, getInheritedBackground, hasTouchSupport, isObject, normalizeEvent, once, throttle, when } from "./utils/index.js";
|
|
94
|
+
export { clearGlobalDefaults, getComponentDefaults, setComponentDefaults, setGlobalDefaults } from "./config/global.js";
|
|
95
|
+
export { createComponentConfig, createElementConfig } from "./config/component.js";
|
|
96
|
+
export { createEmitter } from "./state/emitter.js";
|
|
97
|
+
export { createEventManager as createStateEventManager, createStore, deriveFiltered, loggingMiddleware } from "./state/index.js";
|
|
@@ -1,6 +1,286 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
|
|
2
|
+
/** How a vertex is rounded: the radius, and how much the curve is smoothed into the sides (0–1) */
|
|
3
|
+
interface CornerRounding {
|
|
4
|
+
radius: number;
|
|
5
|
+
smoothing?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare const UNROUNDED: CornerRounding;
|
|
9
|
+
|
|
10
|
+
/** A closed shape made of contiguous cubics */
|
|
11
|
+
interface RoundedPolygon {
|
|
12
|
+
cubics: Cubic[];
|
|
13
|
+
centerX: number;
|
|
14
|
+
centerY: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Builds a rounded polygon from a flat list of vertex coordinates [x0, y0, x1, y1, ...], a rounding for every vertex or one per vertex, and an optional centre (the vertices' centroid by default). */
|
|
18
|
+
declare const roundedPolygon: (vertices: number[], rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
|
|
19
|
+
|
|
20
|
+
/** A regular polygon, first vertex at angle 0 */
|
|
21
|
+
declare const regularPolygon: (numVertices: number, radius?: number, centerX?: number, centerY?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[]) => RoundedPolygon;
|
|
22
|
+
|
|
23
|
+
/** A circle approximated by a fully rounded polygon */
|
|
24
|
+
declare const circle: (numVertices?: number, radius?: number, centerX?: number, centerY?: number) => RoundedPolygon;
|
|
25
|
+
|
|
26
|
+
/** A star with `numVerticesPerRadius` outer and inner vertices, outer first at angle 0 */
|
|
27
|
+
declare const star: (numVerticesPerRadius: number, radius?: number, innerRadius?: number, rounding?: CornerRounding, innerRounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
|
|
28
|
+
|
|
29
|
+
/** A rectangle centred on (centerX, centerY), its first vertex at the bottom right (graphics-shapes rectangle) */
|
|
30
|
+
declare const rectangle: (width?: number, height?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
|
|
31
|
+
|
|
32
|
+
declare const transformPolygon: (polygon: RoundedPolygon, f: PointTransformer) => RoundedPolygon;
|
|
33
|
+
|
|
34
|
+
/** Rotation about the origin, in degrees, positive clockwise on a y-down canvas */
|
|
35
|
+
declare const rotatePolygon: (polygon: RoundedPolygon, degrees: number) => RoundedPolygon;
|
|
36
|
+
|
|
37
|
+
declare const scalePolygon: (polygon: RoundedPolygon, sx: number, sy?: number) => RoundedPolygon;
|
|
38
|
+
|
|
39
|
+
/** Bounding box [left, top, right, bottom] from the hull of anchors and controls */
|
|
40
|
+
declare const polygonBounds: (polygon: RoundedPolygon) => [
|
|
41
|
+
number,
|
|
42
|
+
number,
|
|
43
|
+
number,
|
|
44
|
+
number
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
/** The farthest any anchor or curve midpoint gets from the centre */
|
|
48
|
+
declare const polygonMaxRadius: (polygon: RoundedPolygon) => number;
|
|
49
|
+
|
|
50
|
+
/** Fits the shape into the unit square, centred, keeping its aspect ratio */
|
|
51
|
+
declare const normalizePolygon: (polygon: RoundedPolygon) => RoundedPolygon;
|
|
52
|
+
|
|
53
|
+
/** Circle */
|
|
54
|
+
declare const shapeCircle: () => RoundedPolygon;
|
|
55
|
+
|
|
56
|
+
/** A rounded square */
|
|
57
|
+
declare const shapeSquare: () => RoundedPolygon;
|
|
58
|
+
|
|
59
|
+
/** A slanted square */
|
|
60
|
+
declare const shapeSlanted: () => RoundedPolygon;
|
|
61
|
+
|
|
62
|
+
/** An arch */
|
|
63
|
+
declare const shapeArch: () => RoundedPolygon;
|
|
64
|
+
|
|
65
|
+
/** A fan */
|
|
66
|
+
declare const shapeFan: () => RoundedPolygon;
|
|
67
|
+
|
|
68
|
+
/** An arrow */
|
|
69
|
+
declare const shapeArrow: () => RoundedPolygon;
|
|
70
|
+
|
|
71
|
+
/** A semicircle */
|
|
72
|
+
declare const shapeSemiCircle: () => RoundedPolygon;
|
|
73
|
+
|
|
74
|
+
/** An oval */
|
|
75
|
+
declare const shapeOval: () => RoundedPolygon;
|
|
76
|
+
|
|
77
|
+
/** A pill */
|
|
78
|
+
declare const shapePill: () => RoundedPolygon;
|
|
79
|
+
|
|
80
|
+
/** A triangle */
|
|
81
|
+
declare const shapeTriangle: () => RoundedPolygon;
|
|
82
|
+
|
|
83
|
+
/** A diamond */
|
|
84
|
+
declare const shapeDiamond: () => RoundedPolygon;
|
|
85
|
+
|
|
86
|
+
/** A clam shell */
|
|
87
|
+
declare const shapeClamShell: () => RoundedPolygon;
|
|
88
|
+
|
|
89
|
+
/** A pentagon */
|
|
90
|
+
declare const shapePentagon: () => RoundedPolygon;
|
|
91
|
+
|
|
92
|
+
/** A gem */
|
|
93
|
+
declare const shapeGem: () => RoundedPolygon;
|
|
94
|
+
|
|
95
|
+
/** A sunny shape: an 8-point star */
|
|
96
|
+
declare const shapeSunny: () => RoundedPolygon;
|
|
97
|
+
|
|
98
|
+
/** A very sunny shape */
|
|
99
|
+
declare const shapeVerySunny: () => RoundedPolygon;
|
|
100
|
+
|
|
101
|
+
/** A 4-sided cookie */
|
|
102
|
+
declare const shapeCookie4Sided: () => RoundedPolygon;
|
|
103
|
+
|
|
104
|
+
/** A 6-sided cookie */
|
|
105
|
+
declare const shapeCookie6Sided: () => RoundedPolygon;
|
|
106
|
+
|
|
107
|
+
/** A 7-sided cookie */
|
|
108
|
+
declare const shapeCookie7Sided: () => RoundedPolygon;
|
|
109
|
+
|
|
110
|
+
/** A 9-sided cookie */
|
|
111
|
+
declare const shapeCookie9Sided: () => RoundedPolygon;
|
|
112
|
+
|
|
113
|
+
/** A 12-sided cookie */
|
|
114
|
+
declare const shapeCookie12Sided: () => RoundedPolygon;
|
|
115
|
+
|
|
116
|
+
/** A ghost-ish shape */
|
|
117
|
+
declare const shapeGhostish: () => RoundedPolygon;
|
|
118
|
+
|
|
119
|
+
/** A 4-leaf clover */
|
|
120
|
+
declare const shapeClover4Leaf: () => RoundedPolygon;
|
|
121
|
+
|
|
122
|
+
/** An 8-leaf clover */
|
|
123
|
+
declare const shapeClover8Leaf: () => RoundedPolygon;
|
|
124
|
+
|
|
125
|
+
/** A burst */
|
|
126
|
+
declare const shapeBurst: () => RoundedPolygon;
|
|
127
|
+
|
|
128
|
+
/** A soft burst */
|
|
129
|
+
declare const shapeSoftBurst: () => RoundedPolygon;
|
|
130
|
+
|
|
131
|
+
/** A boom */
|
|
132
|
+
declare const shapeBoom: () => RoundedPolygon;
|
|
133
|
+
|
|
134
|
+
/** A soft boom */
|
|
135
|
+
declare const shapeSoftBoom: () => RoundedPolygon;
|
|
136
|
+
|
|
137
|
+
/** A flower */
|
|
138
|
+
declare const shapeFlower: () => RoundedPolygon;
|
|
139
|
+
|
|
140
|
+
/** A puffy shape */
|
|
141
|
+
declare const shapePuffy: () => RoundedPolygon;
|
|
142
|
+
|
|
143
|
+
/** A puffy diamond */
|
|
144
|
+
declare const shapePuffyDiamond: () => RoundedPolygon;
|
|
145
|
+
|
|
146
|
+
/** A pixelated circle */
|
|
147
|
+
declare const shapePixelCircle: () => RoundedPolygon;
|
|
148
|
+
|
|
149
|
+
/** A pixelated triangle */
|
|
150
|
+
declare const shapePixelTriangle: () => RoundedPolygon;
|
|
151
|
+
|
|
152
|
+
/** A bun */
|
|
153
|
+
declare const shapeBun: () => RoundedPolygon;
|
|
154
|
+
|
|
155
|
+
/** A heart */
|
|
156
|
+
declare const shapeHeart: () => RoundedPolygon;
|
|
157
|
+
|
|
158
|
+
declare const byName: {
|
|
159
|
+
circle: () => RoundedPolygon;
|
|
160
|
+
square: () => RoundedPolygon;
|
|
161
|
+
slanted: () => RoundedPolygon;
|
|
162
|
+
arch: () => RoundedPolygon;
|
|
163
|
+
fan: () => RoundedPolygon;
|
|
164
|
+
arrow: () => RoundedPolygon;
|
|
165
|
+
semiCircle: () => RoundedPolygon;
|
|
166
|
+
oval: () => RoundedPolygon;
|
|
167
|
+
pill: () => RoundedPolygon;
|
|
168
|
+
triangle: () => RoundedPolygon;
|
|
169
|
+
diamond: () => RoundedPolygon;
|
|
170
|
+
clamShell: () => RoundedPolygon;
|
|
171
|
+
pentagon: () => RoundedPolygon;
|
|
172
|
+
gem: () => RoundedPolygon;
|
|
173
|
+
sunny: () => RoundedPolygon;
|
|
174
|
+
verySunny: () => RoundedPolygon;
|
|
175
|
+
cookie4Sided: () => RoundedPolygon;
|
|
176
|
+
cookie6Sided: () => RoundedPolygon;
|
|
177
|
+
cookie7Sided: () => RoundedPolygon;
|
|
178
|
+
cookie9Sided: () => RoundedPolygon;
|
|
179
|
+
cookie12Sided: () => RoundedPolygon;
|
|
180
|
+
ghostish: () => RoundedPolygon;
|
|
181
|
+
clover4Leaf: () => RoundedPolygon;
|
|
182
|
+
clover8Leaf: () => RoundedPolygon;
|
|
183
|
+
burst: () => RoundedPolygon;
|
|
184
|
+
softBurst: () => RoundedPolygon;
|
|
185
|
+
boom: () => RoundedPolygon;
|
|
186
|
+
softBoom: () => RoundedPolygon;
|
|
187
|
+
flower: () => RoundedPolygon;
|
|
188
|
+
puffy: () => RoundedPolygon;
|
|
189
|
+
puffyDiamond: () => RoundedPolygon;
|
|
190
|
+
pixelCircle: () => RoundedPolygon;
|
|
191
|
+
pixelTriangle: () => RoundedPolygon;
|
|
192
|
+
bun: () => RoundedPolygon;
|
|
193
|
+
heart: () => RoundedPolygon;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/** Names of the Material shapes: Compose's, camelCased. */
|
|
197
|
+
type MaterialShapeName = keyof typeof byName;
|
|
198
|
+
|
|
199
|
+
/** A Material shape by name, normalised into the unit square. */
|
|
200
|
+
declare const materialShape: (name: MaterialShapeName) => RoundedPolygon;
|
|
201
|
+
|
|
202
|
+
/** A polygon's outline as an SVG path ("M … C … Z"), scaled by `size`: a normalised shape fills a `size` × `size` box. */
|
|
203
|
+
declare const polygonPath: (polygon: RoundedPolygon, size?: number) => string;
|
|
204
|
+
|
|
205
|
+
/** A Material shape as an SVG path in a `size` × `size` box. */
|
|
206
|
+
declare const materialShapePath: (name: MaterialShapeName, size?: number) => string;
|
|
207
|
+
|
|
208
|
+
/** A shape's outline as radii at evenly spaced angles around its centre */
|
|
209
|
+
interface RadialProfile {
|
|
210
|
+
/** Radius at angle i * 2π / radii.length, clockwise from the positive x axis on a y-down canvas */
|
|
211
|
+
radii: Float32Array;
|
|
212
|
+
/** The area centroid the radii are measured from */
|
|
213
|
+
centerX: number;
|
|
214
|
+
centerY: number;
|
|
215
|
+
/** The largest radius, for fitting the shape into a circle */
|
|
216
|
+
maxRadius: number;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** radialProfile without its star-shape check, for callers whose shapes are known to be star-shaped: the loading indicator's, which the tests check. */
|
|
220
|
+
declare const sampleProfile: (polygon: RoundedPolygon, samples?: number, stepsPerCubic?: number) => RadialProfile;
|
|
221
|
+
|
|
222
|
+
/** Samples the outline at `samples` angles around the shape's area centroid. */
|
|
223
|
+
declare const radialProfile: (polygon: RoundedPolygon, samples?: number, stepsPerCubic?: number) => RadialProfile;
|
|
224
|
+
/** A cubic Bézier: anchor 0, control 0, control 1, anchor 1 */
|
|
225
|
+
type Cubic = readonly [
|
|
226
|
+
number,
|
|
227
|
+
number,
|
|
228
|
+
number,
|
|
229
|
+
number,
|
|
230
|
+
number,
|
|
231
|
+
number,
|
|
232
|
+
number,
|
|
233
|
+
number
|
|
234
|
+
];
|
|
235
|
+
|
|
236
|
+
/** A 2D point */
|
|
237
|
+
type Point = readonly [
|
|
238
|
+
number,
|
|
239
|
+
number
|
|
240
|
+
];
|
|
241
|
+
|
|
242
|
+
/** Below this distance two points are the same point */
|
|
243
|
+
declare const DISTANCE_EPSILON = 0.0001;
|
|
244
|
+
|
|
245
|
+
declare const lerp: (start: number, stop: number, fraction: number) => number;
|
|
246
|
+
|
|
247
|
+
declare const distance: (x: number, y: number) => number;
|
|
248
|
+
|
|
249
|
+
/** Unit vector in the direction of (x, y) */
|
|
250
|
+
declare const direction: (x: number, y: number) => Point;
|
|
251
|
+
|
|
252
|
+
declare const rotate90: ([x, y]: Point) => Point;
|
|
253
|
+
|
|
254
|
+
declare const dot: (a: Point, b: Point) => number;
|
|
255
|
+
|
|
256
|
+
/** A straight segment expressed as a cubic */
|
|
257
|
+
declare const straightLine: (x0: number, y0: number, x1: number, y1: number) => Cubic;
|
|
258
|
+
|
|
259
|
+
/** A circular arc from (x0, y0) to (x1, y1) around (centerX, centerY), approximated by one cubic; the arc must be under 180 degrees. */
|
|
260
|
+
declare const circularArc: (centerX: number, centerY: number, x0: number, y0: number, x1: number, y1: number) => Cubic;
|
|
261
|
+
|
|
262
|
+
declare const pointOnCurve: (c: Cubic, t: number) => Point;
|
|
263
|
+
|
|
264
|
+
/** Splits a cubic at `t` into two that together trace it (de Casteljau) */
|
|
265
|
+
declare const splitCubic: (c: Cubic, t: number) => [
|
|
266
|
+
Cubic,
|
|
267
|
+
Cubic
|
|
268
|
+
];
|
|
269
|
+
|
|
270
|
+
declare const reverseCubic: (c: Cubic) => Cubic;
|
|
271
|
+
|
|
272
|
+
declare const zeroLength: (c: Cubic) => boolean;
|
|
273
|
+
|
|
274
|
+
type PointTransformer = (x: number, y: number) => Point;
|
|
275
|
+
|
|
276
|
+
declare const transformCubic: (c: Cubic, f: PointTransformer) => Cubic;
|
|
277
|
+
|
|
278
|
+
/** The bounding box of a cubic as [left, top, right, bottom]. */
|
|
279
|
+
declare const cubicBounds: (c: Cubic) => [
|
|
280
|
+
number,
|
|
281
|
+
number,
|
|
282
|
+
number,
|
|
283
|
+
number
|
|
284
|
+
];
|
|
285
|
+
export type { CornerRounding, Cubic, MaterialShapeName, Point, PointTransformer, RadialProfile, RoundedPolygon };
|
|
286
|
+
export { UNROUNDED, circle, circularArc, cubicBounds, materialShape, materialShapePath, normalizePolygon, pointOnCurve, polygonBounds, polygonMaxRadius, polygonPath, radialProfile, rectangle, regularPolygon, rotatePolygon, roundedPolygon, scalePolygon, shapeArch, shapeArrow, shapeBoom, shapeBun, shapeBurst, shapeCircle, shapeClamShell, shapeClover4Leaf, shapeClover8Leaf, shapeCookie12Sided, shapeCookie4Sided, shapeCookie6Sided, shapeCookie7Sided, shapeCookie9Sided, shapeDiamond, shapeFan, shapeFlower, shapeGem, shapeGhostish, shapeHeart, shapeOval, shapePentagon, shapePill, shapePixelCircle, shapePixelTriangle, shapePuffy, shapePuffyDiamond, shapeSemiCircle, shapeSlanted, shapeSoftBoom, shapeSoftBurst, shapeSquare, shapeSunny, shapeTriangle, shapeVerySunny, splitCubic, star, straightLine, transformPolygon };
|