material 3.5.3 → 3.6.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 +1 -0
- package/dist/components/badge/api.js +156 -156
- package/dist/components/badge/badge.js +9 -9
- package/dist/components/badge/config.js +43 -43
- package/dist/components/badge/constants.js +13 -13
- package/dist/components/badge/features.js +75 -75
- package/dist/components/bottom-app-bar/bottom-app-bar.js +98 -98
- package/dist/components/bottom-app-bar/config.js +5 -5
- package/dist/components/bottom-app-bar/constants.js +8 -8
- package/dist/components/bottom-sheet/api.js +52 -52
- package/dist/components/bottom-sheet/bottom-sheet.js +9 -9
- package/dist/components/bottom-sheet/config.js +17 -17
- package/dist/components/bottom-sheet/constants.js +24 -24
- package/dist/components/bottom-sheet/features/drag.js +91 -91
- package/dist/components/bottom-sheet/features/state.js +148 -148
- package/dist/components/bottom-sheet/features/structure.js +85 -85
- package/dist/components/button/api.js +265 -265
- package/dist/components/button/button.js +15 -15
- package/dist/components/button/config.js +39 -39
- package/dist/components/button/constants.js +21 -21
- package/dist/components/button/features/progress.js +167 -167
- package/dist/components/button/features/toggle.js +31 -31
- package/dist/components/button-group/button-group.js +389 -389
- package/dist/components/button-group/config.js +106 -106
- package/dist/components/button-group/constants.js +62 -62
- package/dist/components/card/api.js +88 -88
- package/dist/components/card/card.js +11 -11
- package/dist/components/card/config.js +131 -131
- package/dist/components/card/constants.js +39 -39
- package/dist/components/card/content.js +175 -175
- package/dist/components/carousel/api.js +49 -49
- package/dist/components/carousel/arrangement.js +51 -51
- package/dist/components/carousel/carousel.js +2 -2
- package/dist/components/carousel/config.js +31 -31
- package/dist/components/carousel/constants.js +17 -17
- package/dist/components/carousel/features/scroll.js +469 -469
- package/dist/components/carousel/features/slides.js +125 -125
- package/dist/components/carousel/keylines.js +244 -244
- package/dist/components/carousel/strategy.js +185 -185
- package/dist/components/checkbox/api.js +87 -87
- package/dist/components/checkbox/checkbox.js +55 -55
- package/dist/components/checkbox/config.js +44 -44
- package/dist/components/checkbox/constants.js +10 -10
- package/dist/components/chips/api.js +157 -157
- package/dist/components/chips/chip/chip.js +275 -275
- package/dist/components/chips/chips.js +25 -25
- package/dist/components/chips/config.js +73 -73
- package/dist/components/chips/constants.js +2 -2
- package/dist/components/chips/features/chip-items.js +15 -15
- package/dist/components/chips/features/container.js +39 -39
- package/dist/components/chips/features/controller.js +317 -317
- package/dist/components/chips/features/dom.js +52 -52
- package/dist/components/datepicker/api.js +6 -6
- package/dist/components/datepicker/config.js +3 -3
- package/dist/components/datepicker/constants.js +39 -39
- package/dist/components/datepicker/datepicker.js +675 -675
- package/dist/components/datepicker/render.js +153 -153
- package/dist/components/datepicker/types.js +6 -6
- package/dist/components/datepicker/utils.js +157 -157
- package/dist/components/dialog/api.js +109 -109
- package/dist/components/dialog/config.js +29 -29
- package/dist/components/dialog/constants.js +35 -35
- package/dist/components/dialog/dialog.js +16 -16
- package/dist/components/dialog/features.js +739 -739
- package/dist/components/divider/config.js +4 -4
- package/dist/components/divider/constants.js +10 -10
- package/dist/components/divider/divider.js +6 -6
- package/dist/components/divider/features.js +72 -72
- package/dist/components/drawer/api.js +73 -73
- package/dist/components/drawer/config.js +61 -61
- package/dist/components/drawer/constants.js +32 -32
- package/dist/components/drawer/drawer.js +38 -38
- package/dist/components/drawer/features/headline.js +34 -34
- package/dist/components/drawer/features/items.js +203 -203
- package/dist/components/drawer/features/state.js +206 -206
- package/dist/components/extended-fab/api.js +92 -92
- package/dist/components/extended-fab/config.js +65 -65
- package/dist/components/extended-fab/constants.js +30 -30
- package/dist/components/extended-fab/extended-fab.js +51 -51
- package/dist/components/fab/api.js +65 -65
- package/dist/components/fab/config.js +46 -46
- package/dist/components/fab/constants.js +25 -25
- package/dist/components/fab/fab.js +9 -9
- package/dist/components/fab-menu/config.js +9 -9
- package/dist/components/fab-menu/constants.js +15 -15
- package/dist/components/fab-menu/fab-menu.js +310 -310
- package/dist/components/fab-menu/stagger.js +18 -18
- package/dist/components/icon-button/api.js +195 -195
- package/dist/components/icon-button/config.js +79 -79
- package/dist/components/icon-button/constants.js +43 -43
- package/dist/components/icon-button/features/toggle.js +116 -116
- package/dist/components/icon-button/icon-button.js +15 -15
- package/dist/components/list/api.js +55 -55
- package/dist/components/list/config.js +56 -56
- package/dist/components/list/constants.js +25 -25
- package/dist/components/list/features/anatomy.js +41 -41
- package/dist/components/list/features/renderer.js +136 -136
- package/dist/components/list/features/selection.js +118 -118
- package/dist/components/list/list.js +9 -9
- package/dist/components/loading-indicator/api.js +117 -117
- package/dist/components/loading-indicator/config.js +13 -13
- package/dist/components/loading-indicator/constants.js +23 -23
- package/dist/components/loading-indicator/features/motion.js +33 -33
- package/dist/components/loading-indicator/features/renderer.js +121 -121
- package/dist/components/loading-indicator/loading-indicator.js +8 -8
- package/dist/components/menu/api.js +76 -76
- package/dist/components/menu/config.js +73 -73
- package/dist/components/menu/constants.js +45 -45
- package/dist/components/menu/features/controller.js +507 -507
- package/dist/components/menu/features/keyboard.js +292 -292
- package/dist/components/menu/features/layer.js +13 -13
- package/dist/components/menu/features/loader.js +61 -61
- package/dist/components/menu/features/opener.js +288 -288
- package/dist/components/menu/features/position.js +279 -279
- package/dist/components/menu/features/registry.js +7 -7
- package/dist/components/menu/features/submenu.js +386 -386
- package/dist/components/menu/features/tasks.js +45 -45
- package/dist/components/menu/menu.js +16 -16
- package/dist/components/menu/on-demand.js +138 -138
- package/dist/components/navigation-bar/navigation-bar.js +144 -144
- package/dist/components/navigation-rail/config.js +11 -11
- package/dist/components/navigation-rail/constants.js +8 -8
- package/dist/components/navigation-rail/navigation-rail.js +237 -237
- package/dist/components/progress/api.js +207 -207
- package/dist/components/progress/config.js +137 -137
- package/dist/components/progress/constants.js +88 -88
- package/dist/components/progress/features/canvas.js +291 -291
- package/dist/components/progress/features/circular.js +69 -69
- package/dist/components/progress/features/colors.js +41 -41
- package/dist/components/progress/features/linear.js +96 -96
- package/dist/components/progress/features/motion.js +87 -87
- package/dist/components/progress/features/state.js +35 -35
- package/dist/components/progress/progress.js +11 -11
- package/dist/components/radios/api.js +54 -54
- package/dist/components/radios/config.js +19 -19
- package/dist/components/radios/constants.js +10 -10
- package/dist/components/radios/radio.js +161 -161
- package/dist/components/radios/radios.js +12 -12
- package/dist/components/search/api.js +116 -116
- package/dist/components/search/config.js +66 -66
- package/dist/components/search/constants.js +75 -75
- package/dist/components/search/features/input.js +238 -238
- package/dist/components/search/features/states.js +279 -279
- package/dist/components/search/features/structure.js +212 -212
- package/dist/components/search/features/suggestions.js +234 -234
- package/dist/components/search/search.js +30 -30
- package/dist/components/select/api.js +92 -92
- package/dist/components/select/config.js +46 -46
- package/dist/components/select/constants.js +39 -39
- package/dist/components/select/features.js +485 -485
- package/dist/components/select/select.js +17 -17
- package/dist/components/side-sheet/api.js +46 -46
- package/dist/components/side-sheet/config.js +19 -19
- package/dist/components/side-sheet/constants.js +22 -22
- package/dist/components/side-sheet/features/state.js +132 -132
- package/dist/components/side-sheet/features/structure.js +89 -89
- package/dist/components/side-sheet/side-sheet.js +8 -8
- package/dist/components/slider/config.js +54 -54
- package/dist/components/slider/constants.js +54 -54
- package/dist/components/slider/features/axis.js +14 -14
- package/dist/components/slider/features/controller.js +944 -944
- package/dist/components/slider/features/dom.js +104 -104
- package/dist/components/slider/features/states.js +83 -83
- package/dist/components/slider/slider.js +16 -16
- package/dist/components/snackbar/api.js +199 -199
- package/dist/components/snackbar/config.js +24 -24
- package/dist/components/snackbar/constants.js +41 -41
- package/dist/components/snackbar/features.js +115 -115
- package/dist/components/snackbar/layer.js +72 -72
- package/dist/components/snackbar/position.js +20 -20
- package/dist/components/snackbar/queue.js +89 -89
- package/dist/components/snackbar/snackbar.js +12 -12
- package/dist/components/split-button/api.js +137 -137
- package/dist/components/split-button/config.js +11 -11
- package/dist/components/split-button/constants.js +24 -24
- package/dist/components/split-button/features/buttons.js +35 -35
- package/dist/components/split-button/features/menu.js +12 -12
- package/dist/components/split-button/split-button.js +11 -11
- package/dist/components/switch/api.js +101 -101
- package/dist/components/switch/config.js +20 -20
- package/dist/components/switch/constants.js +29 -29
- package/dist/components/switch/features.js +123 -123
- package/dist/components/switch/switch.js +13 -13
- package/dist/components/tabs/api.js +104 -104
- package/dist/components/tabs/config.js +20 -20
- package/dist/components/tabs/constants.js +40 -40
- package/dist/components/tabs/features.js +159 -159
- package/dist/components/tabs/indicator.js +151 -151
- package/dist/components/tabs/responsive.js +59 -59
- package/dist/components/tabs/tab.js +218 -218
- package/dist/components/tabs/tabs.js +27 -27
- package/dist/components/tabs/utils.js +121 -121
- package/dist/components/text-field/api.js +212 -212
- package/dist/components/text-field/config.js +30 -30
- package/dist/components/text-field/constants.js +54 -54
- package/dist/components/text-field/features/counter.js +51 -51
- package/dist/components/text-field/features/density.js +36 -36
- package/dist/components/text-field/features/error.js +55 -55
- package/dist/components/text-field/features/field.js +30 -30
- package/dist/components/text-field/features/leading-icon.js +52 -52
- package/dist/components/text-field/features/placement.js +146 -146
- package/dist/components/text-field/features/prefix-text.js +48 -48
- package/dist/components/text-field/features/required.js +48 -48
- package/dist/components/text-field/features/suffix-text.js +48 -48
- package/dist/components/text-field/features/supporting-text.js +85 -85
- package/dist/components/text-field/features/trailing-icon.js +88 -88
- package/dist/components/text-field/text-field.js +11 -11
- package/dist/components/timepicker/api.js +275 -275
- package/dist/components/timepicker/config.js +31 -31
- package/dist/components/timepicker/constants.js +52 -52
- package/dist/components/timepicker/dial.js +164 -164
- package/dist/components/timepicker/render.js +400 -400
- package/dist/components/timepicker/timepicker.js +40 -40
- package/dist/components/timepicker/types.js +8 -8
- package/dist/components/timepicker/utils.js +67 -67
- package/dist/components/toolbar/config.js +35 -35
- package/dist/components/toolbar/constants.js +17 -17
- package/dist/components/toolbar/toolbar.js +188 -188
- package/dist/components/tooltip/api.js +309 -309
- package/dist/components/tooltip/config.js +32 -32
- package/dist/components/tooltip/constants.js +38 -38
- package/dist/components/tooltip/tooltip.js +20 -20
- package/dist/components/tooltip/types.js +15 -15
- package/dist/components/top-app-bar/config.js +5 -5
- package/dist/components/top-app-bar/constants.js +25 -25
- package/dist/components/top-app-bar/top-app-bar.js +158 -158
- package/dist/core/canvas/animation.js +30 -30
- package/dist/core/canvas/drawing.js +52 -52
- package/dist/core/canvas/resize.js +47 -47
- package/dist/core/canvas/utils.js +101 -101
- package/dist/core/compose/base.js +5 -5
- package/dist/core/compose/cleanup.js +47 -47
- package/dist/core/compose/component.js +132 -132
- package/dist/core/compose/features/badge.js +56 -56
- package/dist/core/compose/features/checkable.js +37 -37
- package/dist/core/compose/features/constants.js +1 -1
- package/dist/core/compose/features/debounce.js +39 -39
- package/dist/core/compose/features/disabled.js +61 -61
- package/dist/core/compose/features/events.js +19 -19
- package/dist/core/compose/features/icon.js +66 -66
- package/dist/core/compose/features/input.js +63 -63
- package/dist/core/compose/features/lifecycle.js +71 -71
- package/dist/core/compose/features/position.js +31 -31
- package/dist/core/compose/features/ripple.js +76 -76
- package/dist/core/compose/features/size.js +5 -5
- package/dist/core/compose/features/style.js +7 -7
- package/dist/core/compose/features/text.js +49 -49
- package/dist/core/compose/features/textinput.js +164 -164
- package/dist/core/compose/features/textlabel.js +47 -47
- package/dist/core/compose/features/throttle.js +39 -39
- package/dist/core/compose/features/track.js +24 -24
- package/dist/core/compose/features/variant.js +5 -5
- package/dist/core/compose/features/withEvents.js +48 -48
- package/dist/core/compose/pipe.js +4 -4
- package/dist/core/compose/utils/type-guards.js +6 -6
- package/dist/core/config/component.js +54 -54
- package/dist/core/config/global.js +6 -6
- package/dist/core/config.js +9 -9
- package/dist/core/dom/attributes.js +38 -38
- package/dist/core/dom/classes.js +74 -74
- package/dist/core/dom/create.js +133 -133
- package/dist/core/dom/direction.js +28 -28
- package/dist/core/dom/events.js +80 -80
- package/dist/core/dom/focus.js +38 -38
- package/dist/core/dom/form-value.js +10 -10
- package/dist/core/dom/html.js +7 -7
- package/dist/core/dom/layer.js +134 -134
- package/dist/core/dom/roving.js +69 -69
- package/dist/core/dom/utils.js +38 -38
- package/dist/core/navigation/destinations.js +103 -103
- package/dist/core/navigation/ripple.js +39 -39
- package/dist/core/shapes/cubic.js +55 -55
- package/dist/core/shapes/material.js +164 -164
- package/dist/core/shapes/polygon.js +198 -198
- package/dist/core/state/emitter.js +29 -29
- package/dist/core/state/events.js +30 -30
- package/dist/core/state/store.js +55 -55
- package/dist/core/theme/tokens.js +28 -28
- package/dist/core/utils/attributes.js +8 -8
- package/dist/core/utils/background.js +29 -29
- package/dist/core/utils/color.js +21 -21
- package/dist/core/utils/mobile.js +28 -28
- package/dist/core/utils/object.js +17 -17
- package/dist/core/utils/performance.js +111 -111
- package/dist/core/utils/theme.js +49 -49
- package/dist/core/utils/url.js +0 -0
- package/dist/core/utils/warn.js +14 -14
- package/dist/elements/adapter.js +51 -51
- package/dist/elements/badge.js +23 -23
- package/dist/elements/bottom-app-bar.js +32 -32
- package/dist/elements/bottom-sheet.js +81 -81
- package/dist/elements/button-group.js +151 -151
- package/dist/elements/button.js +40 -40
- package/dist/elements/card.js +89 -89
- package/dist/elements/carousel.js +101 -101
- package/dist/elements/checkbox.js +44 -44
- package/dist/elements/chips.js +185 -185
- package/dist/elements/datepicker.js +101 -101
- package/dist/elements/define.js +571 -571
- package/dist/elements/dialog.js +134 -134
- package/dist/elements/divider.js +16 -16
- package/dist/elements/drawer.js +118 -118
- package/dist/elements/extended-fab.js +29 -29
- package/dist/elements/fab-menu.js +58 -58
- package/dist/elements/fab.js +18 -18
- package/dist/elements/form-button.js +14 -14
- package/dist/elements/icon-button.js +42 -42
- package/dist/elements/index.js +87 -87
- package/dist/elements/lifecycle.js +8 -8
- package/dist/elements/list.js +162 -162
- package/dist/elements/loading-indicator.js +19 -19
- package/dist/elements/menu.js +169 -169
- package/dist/elements/navigation-bar.js +58 -58
- package/dist/elements/navigation-rail.js +110 -110
- 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/preupgrade.js +0 -1
- package/dist/elements/progress.js +32 -32
- package/dist/elements/radios.js +105 -105
- package/dist/elements/search.js +189 -189
- package/dist/elements/select.js +124 -124
- package/dist/elements/sheet.js +49 -49
- package/dist/elements/side-sheet.js +53 -53
- package/dist/elements/slider.js +117 -117
- package/dist/elements/snackbar.js +45 -45
- package/dist/elements/split-button.js +82 -82
- package/dist/elements/styles.js +27 -27
- package/dist/elements/switch.js +43 -43
- package/dist/elements/tabs.js +96 -96
- package/dist/elements/text-field.js +117 -117
- package/dist/elements/timepicker.js +142 -142
- package/dist/elements/toolbar.js +63 -63
- package/dist/elements/tooltip.js +111 -111
- package/dist/elements/top-app-bar.js +75 -75
- package/dist/package.json +1 -1
- package/dist/react/create.js +113 -113
- package/dist/react/shadow.js +8 -8
- package/dist/solid/create.js +122 -122
- package/dist/solid/shadow.js +6 -6
- package/dist/ssr/react.js +2 -310
- package/dist/ssr/solid.js +1 -16
- package/dist/ssr/svelte.js +1 -73
- package/dist/ssr/vue.js +1 -71
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +2 -0
- package/dist/styles/base-lite.d.ts +1 -0
- package/dist/styles/base-lite.js +2 -0
- 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 +1 -1
- 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 +1 -1
- 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.js +123 -123
- package/dist/vue/shadow.js +6 -6
- package/package.json +2 -1
- package/src/styles/abstract/_mixins.scss +21 -0
- package/src/styles/base/_body-theme.scss +22 -0
- package/src/styles/base/_document.scss +4 -14
- package/src/styles/base/_reset.scss +3 -14
|
@@ -8,45 +8,45 @@ import { parseTime, formatFormValue } from "./utils.js";
|
|
|
8
8
|
import { createFormValue } from "../../core/dom/form-value.js";
|
|
9
9
|
let pickers = 0;
|
|
10
10
|
const createTimePicker = (config = {}) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
11
|
+
const baseConfig = createBaseConfig(config);
|
|
12
|
+
try {
|
|
13
|
+
const baseComponent = pipe(createBase, withEvents(), withElement(getContainerConfig(baseConfig)), withLifecycle())(baseConfig);
|
|
14
|
+
baseConfig.titleId = `${baseConfig.prefix}-time-picker-${++pickers}__title`;
|
|
15
|
+
const dialogElement = document.createElement("dialog");
|
|
16
|
+
dialogElement.setAttribute("aria-labelledby", baseConfig.titleId);
|
|
17
|
+
dialogElement.className = [
|
|
18
|
+
`${baseConfig.prefix}-time-picker__dialog`,
|
|
19
|
+
`${baseConfig.prefix}-time-picker__dialog--${baseConfig.type}`,
|
|
20
|
+
`${baseConfig.prefix}-time-picker__dialog--${baseConfig.orientation}`,
|
|
21
|
+
`${baseConfig.prefix}-time-picker__dialog--${baseConfig.format}`,
|
|
22
|
+
].join(" ");
|
|
23
|
+
const modalElement = dialogElement;
|
|
24
|
+
const container = typeof baseConfig.container === "string"
|
|
25
|
+
? document.querySelector(baseConfig.container) || baseComponent.element
|
|
26
|
+
: baseConfig.container || baseComponent.element;
|
|
27
|
+
container.appendChild(modalElement);
|
|
28
|
+
let timeValue;
|
|
29
|
+
if (baseConfig.value) {
|
|
30
|
+
timeValue = parseTime(baseConfig.value, baseConfig.format);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const now = new Date();
|
|
34
|
+
timeValue = {
|
|
35
|
+
hours: now.getHours(),
|
|
36
|
+
minutes: now.getMinutes(),
|
|
37
|
+
seconds: baseConfig.showSeconds ? now.getSeconds() : 0,
|
|
38
|
+
period: now.getHours() >= 12 ? TIME_PERIOD.PM : TIME_PERIOD.AM,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const formValue = createFormValue(baseComponent.element, baseConfig.name, formatFormValue(timeValue, baseConfig.showSeconds === true));
|
|
42
|
+
const timePicker = createTimePickerAPI(baseComponent, modalElement, dialogElement, timeValue, baseConfig, getApiConfig(baseComponent), formValue);
|
|
43
|
+
if (baseConfig.open)
|
|
44
|
+
timePicker.open(true);
|
|
45
|
+
return timePicker;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error("TimePicker creation error:", error);
|
|
49
|
+
throw new Error(`Failed to create time picker: ${error.message}`);
|
|
50
|
+
}
|
|
51
51
|
};
|
|
52
52
|
export default createTimePicker;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export var TIME_PICKER_TYPE;
|
|
2
2
|
(function (TIME_PICKER_TYPE) {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
TIME_PICKER_TYPE["DIAL"] = "dial";
|
|
4
|
+
TIME_PICKER_TYPE["INPUT"] = "input";
|
|
5
5
|
})(TIME_PICKER_TYPE || (TIME_PICKER_TYPE = {}));
|
|
6
6
|
export var TIME_PICKER_ORIENTATION;
|
|
7
7
|
(function (TIME_PICKER_ORIENTATION) {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
TIME_PICKER_ORIENTATION["VERTICAL"] = "vertical";
|
|
9
|
+
TIME_PICKER_ORIENTATION["HORIZONTAL"] = "horizontal";
|
|
10
10
|
})(TIME_PICKER_ORIENTATION || (TIME_PICKER_ORIENTATION = {}));
|
|
11
11
|
export var TIME_FORMAT;
|
|
12
12
|
(function (TIME_FORMAT) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
TIME_FORMAT["AMPM"] = "12h";
|
|
14
|
+
TIME_FORMAT["MILITARY"] = "24h";
|
|
15
15
|
})(TIME_FORMAT || (TIME_FORMAT = {}));
|
|
16
16
|
export var TIME_PERIOD;
|
|
17
17
|
(function (TIME_PERIOD) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
TIME_PERIOD["AM"] = "AM";
|
|
19
|
+
TIME_PERIOD["PM"] = "PM";
|
|
20
20
|
})(TIME_PERIOD || (TIME_PERIOD = {}));
|
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
import { TIME_PERIOD } from "./types.js";
|
|
2
2
|
export const padZero = (num) => {
|
|
3
|
-
|
|
3
|
+
return num.toString().padStart(2, "0");
|
|
4
4
|
};
|
|
5
5
|
export const parseTime = (timeString, _format) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
6
|
+
try {
|
|
7
|
+
const parts = timeString.split(":");
|
|
8
|
+
const hours = parseInt(parts[0], 10);
|
|
9
|
+
const minutes = parseInt(parts[1], 10);
|
|
10
|
+
const seconds = parts[2] ? parseInt(parts[2], 10) : 0;
|
|
11
|
+
if (isNaN(hours) ||
|
|
12
|
+
hours < 0 ||
|
|
13
|
+
hours > 23 ||
|
|
14
|
+
isNaN(minutes) ||
|
|
15
|
+
minutes < 0 ||
|
|
16
|
+
minutes > 59 ||
|
|
17
|
+
isNaN(seconds) ||
|
|
18
|
+
seconds < 0 ||
|
|
19
|
+
seconds > 59) {
|
|
20
|
+
throw new Error("Invalid time format");
|
|
21
|
+
}
|
|
22
|
+
const period = hours >= 12 ? TIME_PERIOD.PM : TIME_PERIOD.AM;
|
|
23
|
+
return { hours, minutes, seconds, period };
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error("Error parsing time:", error);
|
|
27
|
+
const now = new Date();
|
|
28
|
+
const hours = now.getHours();
|
|
29
|
+
const minutes = now.getMinutes();
|
|
30
|
+
const seconds = now.getSeconds();
|
|
31
|
+
const period = hours >= 12 ? TIME_PERIOD.PM : TIME_PERIOD.AM;
|
|
32
|
+
return { hours, minutes, seconds, period };
|
|
33
|
+
}
|
|
34
34
|
};
|
|
35
35
|
export const convertTo12Hour = (hours24) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const period = hours24 >= 12 ? TIME_PERIOD.PM : TIME_PERIOD.AM;
|
|
37
|
+
let hours12 = hours24 % 12;
|
|
38
|
+
if (hours12 === 0) {
|
|
39
|
+
hours12 = 12;
|
|
40
|
+
}
|
|
41
|
+
return { hours: hours12, period };
|
|
42
42
|
};
|
|
43
43
|
const LAST_SECOND = 24 * 3600 - 1;
|
|
44
44
|
const secondsOf = (time) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
if (!time)
|
|
46
|
+
return undefined;
|
|
47
|
+
const [h, m, sec = 0] = time.split(":").map(part => parseInt(part, 10));
|
|
48
|
+
if ([h, m, sec].some(Number.isNaN) || h < 0 || h > 23 || m < 0 || m > 59 || sec < 0 || sec > 59)
|
|
49
|
+
return undefined;
|
|
50
|
+
return h * 3600 + m * 60 + sec;
|
|
51
51
|
};
|
|
52
52
|
export const limitsOf = (minTime, maxTime) => ({
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
min: secondsOf(minTime) ?? 0,
|
|
54
|
+
max: secondsOf(maxTime) ?? LAST_SECOND,
|
|
55
55
|
});
|
|
56
56
|
export const reachable = (limits, from, to = from) => from <= limits.max && to >= limits.min;
|
|
57
57
|
export const secondsOfTime = (time) => time.hours * 3600 + time.minutes * 60 + (time.seconds ?? 0);
|
|
58
58
|
export const constrainTime = (time, limits, minuteStep = 1, secondStep = 1) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
59
|
+
const lastSecond = 59 - (59 % secondStep);
|
|
60
|
+
const split = (total) => [Math.floor(total / 3600), Math.floor((total % 3600) / 60), total % 60];
|
|
61
|
+
const down = (total) => {
|
|
62
|
+
const [h, m, sec] = split(total);
|
|
63
|
+
return m % minuteStep ? h * 3600 + (m - (m % minuteStep)) * 60 + lastSecond : h * 3600 + m * 60 + sec - (sec % secondStep);
|
|
64
|
+
};
|
|
65
|
+
const up = (total) => {
|
|
66
|
+
const [h, m, sec] = split(total);
|
|
67
|
+
if (m % minuteStep)
|
|
68
|
+
return Math.min(LAST_SECOND, h * 3600 + (m + minuteStep - (m % minuteStep)) * 60);
|
|
69
|
+
const next = sec % secondStep ? sec + secondStep - (sec % secondStep) : sec;
|
|
70
|
+
return next < 60 ? h * 3600 + m * 60 + next : Math.min(LAST_SECOND, h * 3600 + (m + minuteStep) * 60);
|
|
71
|
+
};
|
|
72
|
+
let total = secondsOfTime(time);
|
|
73
|
+
if (total < limits.min)
|
|
74
|
+
total = Math.min(up(limits.min), limits.max);
|
|
75
|
+
else if (total > limits.max)
|
|
76
|
+
total = Math.max(down(limits.max), limits.min);
|
|
77
|
+
else
|
|
78
|
+
return time;
|
|
79
|
+
const [hours, minutes, seconds] = split(total);
|
|
80
|
+
return { hours, minutes, seconds, period: hours >= 12 ? TIME_PERIOD.PM : TIME_PERIOD.AM };
|
|
81
81
|
};
|
|
82
82
|
export const formatFormValue = (timeValue, showSeconds) => {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
const base = `${padZero(timeValue.hours)}:${padZero(timeValue.minutes)}`;
|
|
84
|
+
return showSeconds ? `${base}:${padZero(timeValue.seconds ?? 0)}` : base;
|
|
85
85
|
};
|
|
@@ -2,45 +2,45 @@ import { createComponentConfig } from "../../core/config/component.js";
|
|
|
2
2
|
import { TOOLBAR_VARIANTS, TOOLBAR_COLORS, TOOLBAR_ORIENTATIONS, TOOLBAR_PLACEMENTS, TOOLBAR_ARRANGEMENTS, TOOLBAR_SCROLL_BEHAVIORS, TOOLBAR_SCROLL_THRESHOLD, } from "./constants.js";
|
|
3
3
|
export const OVERFLOW_ICON = '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>';
|
|
4
4
|
export const defaultConfig = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
variant: TOOLBAR_VARIANTS.DOCKED,
|
|
6
|
+
color: TOOLBAR_COLORS.STANDARD,
|
|
7
|
+
orientation: TOOLBAR_ORIENTATIONS.HORIZONTAL,
|
|
8
|
+
placement: TOOLBAR_PLACEMENTS.NONE,
|
|
9
|
+
arrangement: TOOLBAR_ARRANGEMENTS.SPREAD,
|
|
10
|
+
fabPosition: "end",
|
|
11
|
+
scrollBehavior: TOOLBAR_SCROLL_BEHAVIORS.NONE,
|
|
12
|
+
scrollThreshold: TOOLBAR_SCROLL_THRESHOLD,
|
|
13
|
+
overflowLabel: "More options",
|
|
14
|
+
ariaLabel: "Toolbar",
|
|
15
15
|
};
|
|
16
16
|
const oneOf = (values, value, fallback) => Object.values(values).includes(value) ? value : fallback;
|
|
17
17
|
export const resolveColor = (color) => oneOf(TOOLBAR_COLORS, color, TOOLBAR_COLORS.STANDARD);
|
|
18
18
|
const resolvePlacement = (placement, variant, orientation) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
if (placement === TOOLBAR_PLACEMENTS.NONE)
|
|
20
|
+
return placement;
|
|
21
|
+
if (variant === TOOLBAR_VARIANTS.DOCKED)
|
|
22
|
+
return TOOLBAR_PLACEMENTS.BOTTOM;
|
|
23
|
+
if (orientation === TOOLBAR_ORIENTATIONS.VERTICAL)
|
|
24
|
+
return placement === TOOLBAR_PLACEMENTS.START ? placement : TOOLBAR_PLACEMENTS.END;
|
|
25
|
+
return placement === TOOLBAR_PLACEMENTS.TOP ? placement : TOOLBAR_PLACEMENTS.BOTTOM;
|
|
26
26
|
};
|
|
27
27
|
export const createConfig = (config = {}) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
const merged = createComponentConfig(defaultConfig, config, "toolbar");
|
|
29
|
+
const variant = oneOf(TOOLBAR_VARIANTS, merged.variant, TOOLBAR_VARIANTS.DOCKED);
|
|
30
|
+
const floating = variant === TOOLBAR_VARIANTS.FLOATING;
|
|
31
|
+
const orientation = floating
|
|
32
|
+
? oneOf(TOOLBAR_ORIENTATIONS, merged.orientation, TOOLBAR_ORIENTATIONS.HORIZONTAL)
|
|
33
|
+
: TOOLBAR_ORIENTATIONS.HORIZONTAL;
|
|
34
|
+
return {
|
|
35
|
+
...merged,
|
|
36
|
+
variant,
|
|
37
|
+
orientation,
|
|
38
|
+
color: resolveColor(merged.color),
|
|
39
|
+
placement: resolvePlacement(oneOf(TOOLBAR_PLACEMENTS, merged.placement, TOOLBAR_PLACEMENTS.NONE), variant, orientation),
|
|
40
|
+
arrangement: oneOf(TOOLBAR_ARRANGEMENTS, merged.arrangement, TOOLBAR_ARRANGEMENTS.SPREAD),
|
|
41
|
+
fabPosition: merged.fabPosition === "start" ? "start" : "end",
|
|
42
|
+
elevated: floating && merged.elevated !== false,
|
|
43
|
+
exit: merged.scrollBehavior === TOOLBAR_SCROLL_BEHAVIORS.EXIT,
|
|
44
|
+
scrollThreshold: Math.max(0, Number(merged.scrollThreshold) || 0),
|
|
45
|
+
};
|
|
46
46
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
export const TOOLBAR_VARIANTS = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
DOCKED: "docked",
|
|
3
|
+
FLOATING: "floating",
|
|
4
4
|
};
|
|
5
5
|
export const TOOLBAR_COLORS = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
STANDARD: "standard",
|
|
7
|
+
VIBRANT: "vibrant",
|
|
8
8
|
};
|
|
9
9
|
export const TOOLBAR_ORIENTATIONS = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
HORIZONTAL: "horizontal",
|
|
11
|
+
VERTICAL: "vertical",
|
|
12
12
|
};
|
|
13
13
|
export const TOOLBAR_PLACEMENTS = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
NONE: "none",
|
|
15
|
+
BOTTOM: "bottom",
|
|
16
|
+
TOP: "top",
|
|
17
|
+
START: "start",
|
|
18
|
+
END: "end",
|
|
19
19
|
};
|
|
20
20
|
export const TOOLBAR_ARRANGEMENTS = {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
SPREAD: "spread",
|
|
22
|
+
CENTER: "center",
|
|
23
23
|
};
|
|
24
24
|
export const TOOLBAR_SCROLL_BEHAVIORS = {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
NONE: "none",
|
|
26
|
+
EXIT: "exit",
|
|
27
27
|
};
|
|
28
28
|
export const TOOLBAR_SCROLL_THRESHOLD = 40;
|
|
29
29
|
export const TOOLBAR_EVENTS = {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
SHOW: "show",
|
|
31
|
+
HIDE: "hide",
|
|
32
32
|
};
|