material 3.5.3 → 3.5.4
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/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.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 +1 -1
|
@@ -1,175 +1,175 @@
|
|
|
1
1
|
import createButtonGroup from "../components/button-group/index.js";
|
|
2
2
|
import { createDeclarationClass, defineElement, DEFAULT_PREFIX, } from "./define.js";
|
|
3
3
|
const parse = (value, multi) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
if (value === null || value === undefined || value === "")
|
|
5
|
+
return [];
|
|
6
|
+
const all = Array.isArray(value)
|
|
7
|
+
? value.map(String)
|
|
8
|
+
: multi
|
|
9
|
+
? String(value).split(",").map((part) => part.trim()).filter(Boolean)
|
|
10
|
+
: [String(value)];
|
|
11
|
+
return multi ? all : all.slice(0, 1);
|
|
12
12
|
};
|
|
13
13
|
const declaredItems = (host) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
const itemTag = `${host.localName}-item`;
|
|
15
|
+
const items = [];
|
|
16
|
+
for (const child of Array.from(host.children)) {
|
|
17
|
+
if (child.localName !== itemTag)
|
|
18
|
+
continue;
|
|
19
|
+
const text = child.getAttribute("label") ?? (child.textContent ?? "").trim();
|
|
20
|
+
const icon = child.getAttribute("icon") ?? undefined;
|
|
21
|
+
const ariaLabel = child.getAttribute("aria-label") ?? undefined;
|
|
22
|
+
const value = child.getAttribute("value") ?? (text || ariaLabel || String(items.length));
|
|
23
|
+
const base = {
|
|
24
|
+
value,
|
|
25
|
+
icon,
|
|
26
|
+
selectedIcon: child.getAttribute("selected-icon") ?? undefined,
|
|
27
|
+
disabled: child.hasAttribute("disabled"),
|
|
28
|
+
selected: child.hasAttribute("selected"),
|
|
29
|
+
};
|
|
30
|
+
items.push(text || !icon ? { ...base, text, ariaLabel } : { ...base, ariaLabel: ariaLabel ?? value });
|
|
31
|
+
}
|
|
32
|
+
return items;
|
|
33
33
|
};
|
|
34
34
|
const applied = new WeakMap();
|
|
35
35
|
const readGroup = (host) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const items = declaredItems(host);
|
|
37
|
+
const multi = host.getAttribute("selection") === "multi";
|
|
38
|
+
const chosen = host.hasAttribute("value")
|
|
39
|
+
? parse(host.getAttribute("value"), multi)
|
|
40
|
+
: parse(items.filter((item) => item.selected).map((item) => item.value), multi);
|
|
41
|
+
applied.set(host, items);
|
|
42
|
+
return { buttons: items.map((item) => ({ ...item, selected: chosen.includes(item.value) })) };
|
|
43
43
|
};
|
|
44
44
|
const model = (c) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const selection = c.getSelection();
|
|
46
|
+
if (selection === "none")
|
|
47
|
+
return null;
|
|
48
|
+
const selected = c.getSelected();
|
|
49
|
+
return selection === "multi" ? selected : (selected[0] ?? null);
|
|
50
50
|
};
|
|
51
51
|
const select = (c, value) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
const selection = c.getSelection();
|
|
53
|
+
if (selection === "none")
|
|
54
|
+
return;
|
|
55
|
+
const wanted = parse(value, selection === "multi");
|
|
56
|
+
for (const next of wanted)
|
|
57
|
+
c.select(next);
|
|
58
|
+
for (const current of c.getSelected())
|
|
59
|
+
if (!wanted.includes(current))
|
|
60
|
+
c.deselect(current);
|
|
61
61
|
};
|
|
62
62
|
const applyDisabled = (host, c, items) => {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const group = host.hasAttribute("disabled");
|
|
64
|
+
items.forEach((item, index) => void (group || item.disabled ? c.disableButton(index) : c.enableButton(index)));
|
|
65
65
|
};
|
|
66
66
|
const updateGroup = (host, component) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
67
|
+
const items = declaredItems(host);
|
|
68
|
+
const previous = applied.get(host) ?? [];
|
|
69
|
+
if (items.length !== previous.length || items.length !== component.buttons.length)
|
|
70
|
+
return false;
|
|
71
|
+
for (const [index, item] of items.entries()) {
|
|
72
|
+
const before = previous[index];
|
|
73
|
+
if (item.value !== before.value || !item.text !== !before.text || item.selectedIcon !== before.selectedIcon)
|
|
74
|
+
return false;
|
|
75
|
+
if (item.selected !== before.selected && !host.hasAttribute("value"))
|
|
76
|
+
return false;
|
|
77
|
+
if (item.ariaLabel === undefined && before.ariaLabel !== undefined)
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
for (const [index, item] of items.entries()) {
|
|
81
|
+
const before = previous[index];
|
|
82
|
+
const button = component.buttons[index];
|
|
83
|
+
if (item.text && item.text !== before.text)
|
|
84
|
+
button.setText(item.text);
|
|
85
|
+
if (item.icon !== before.icon)
|
|
86
|
+
button.setIcon(item.icon ?? "");
|
|
87
|
+
if (item.ariaLabel !== undefined && item.ariaLabel !== before.ariaLabel)
|
|
88
|
+
button.setAriaLabel(item.ariaLabel);
|
|
89
|
+
}
|
|
90
|
+
applied.set(host, items);
|
|
91
|
+
applyDisabled(host, component, items);
|
|
92
|
+
return true;
|
|
93
93
|
};
|
|
94
94
|
const buttonGroupSpec = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
95
|
+
name: "button-group",
|
|
96
|
+
create: (config) => createButtonGroup(config),
|
|
97
|
+
styles: ["progress", "button", "icon-button", "button-group"],
|
|
98
|
+
hostStyles: ":host{display:inline-flex}",
|
|
99
|
+
attributes: {
|
|
100
|
+
variant: { type: "string", config: "variant", update: (c, v) => void c.setVariant(String(v ?? "outlined")) },
|
|
101
|
+
kind: { type: "string", config: "kind" },
|
|
102
|
+
selection: { type: "string", config: "selection" },
|
|
103
|
+
required: { type: "boolean", config: "required" },
|
|
104
|
+
size: { type: "string", config: "size" },
|
|
105
|
+
shape: { type: "string", config: "shape" },
|
|
106
|
+
labels: { type: "string", config: "labels" },
|
|
107
|
+
orientation: {
|
|
108
|
+
type: "string",
|
|
109
|
+
config: "orientation",
|
|
110
|
+
update: (c, v) => void c.setOrientation(v === "vertical" ? "vertical" : "horizontal"),
|
|
111
|
+
},
|
|
112
|
+
density: { type: "string", config: "density", update: (c, v) => void c.setDensity(String(v ?? "default")) },
|
|
113
|
+
"equal-width": { type: "boolean", config: "equalWidth" },
|
|
114
|
+
"expanded-ratio": { type: "number", config: "expandedRatio" },
|
|
115
|
+
disabled: {
|
|
116
|
+
type: "boolean",
|
|
117
|
+
config: "disabled",
|
|
118
|
+
update: (c, v, host) => {
|
|
119
|
+
if (v)
|
|
120
|
+
c.disable();
|
|
121
|
+
else
|
|
122
|
+
c.enable();
|
|
123
|
+
applyDisabled(host, c, applied.get(host) ?? []);
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
"aria-label": {
|
|
127
|
+
type: "string",
|
|
128
|
+
config: "ariaLabel",
|
|
129
|
+
update: (c, v) => c.element.setAttribute("aria-label", v === null ? "Button group" : String(v)),
|
|
130
|
+
},
|
|
131
|
+
value: { type: "string", update: (c, v) => select(c, v) },
|
|
132
|
+
},
|
|
133
|
+
properties: {
|
|
134
|
+
value: { get: (c) => model(c), set: (c, v) => select(c, v) },
|
|
135
|
+
},
|
|
136
|
+
model: "value",
|
|
137
|
+
events: {
|
|
138
|
+
change: {
|
|
139
|
+
detail: (payload) => ({ value: model(payload.buttonGroup) }),
|
|
140
|
+
},
|
|
141
|
+
action: {
|
|
142
|
+
detail: (payload) => payload,
|
|
143
|
+
state: true,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
config: readGroup,
|
|
147
|
+
setup: (host, component) => {
|
|
148
|
+
const onClick = (event) => {
|
|
149
|
+
const value = applied.get(host)?.[event.index]?.value ?? String(event.index);
|
|
150
|
+
host.dispatchEvent(new CustomEvent("action", { detail: { value, index: event.index }, bubbles: true, composed: true }));
|
|
151
|
+
};
|
|
152
|
+
component.on("click", onClick);
|
|
153
|
+
return () => void component.off("click", onClick);
|
|
154
|
+
},
|
|
155
|
+
observeChildren: updateGroup,
|
|
156
156
|
};
|
|
157
157
|
export const buttonGroupElement = defineElement(buttonGroupSpec);
|
|
158
158
|
export const buttonGroupItemDeclaration = {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
159
|
+
name: "button-group-item",
|
|
160
|
+
attributes: {
|
|
161
|
+
value: { type: "string" },
|
|
162
|
+
label: { type: "string" },
|
|
163
|
+
icon: { type: "string" },
|
|
164
|
+
"selected-icon": { type: "string" },
|
|
165
|
+
"aria-label": { type: "string" },
|
|
166
|
+
disabled: { type: "boolean" },
|
|
167
|
+
selected: { type: "boolean" },
|
|
168
|
+
},
|
|
169
169
|
};
|
|
170
170
|
export const defineButtonGroup = (options) => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
const itemTag = `${options?.prefix ?? DEFAULT_PREFIX}-${buttonGroupItemDeclaration.name}`;
|
|
172
|
+
if (!customElements.get(itemTag))
|
|
173
|
+
customElements.define(itemTag, createDeclarationClass(buttonGroupItemDeclaration.attributes));
|
|
174
|
+
return buttonGroupElement.define(options);
|
|
175
175
|
};
|
package/dist/elements/button.js
CHANGED
|
@@ -2,46 +2,46 @@ import createButton from "../components/button/index.js";
|
|
|
2
2
|
import { defineElement } from "./define.js";
|
|
3
3
|
import { buttonForm, submitOnClick, typeAttribute } from "./form-button.js";
|
|
4
4
|
const buttonSpec = {
|
|
5
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
5
|
+
name: "button",
|
|
6
|
+
create: (config) => createButton({ ...config, type: "button" }),
|
|
7
|
+
styles: ["progress", "button"],
|
|
8
|
+
hostStyles: ":host{display:inline-flex;vertical-align:middle}",
|
|
9
|
+
attributes: {
|
|
10
|
+
variant: { type: "string", config: "variant", update: (c, v) => void c.setVariant(String(v ?? "filled")) },
|
|
11
|
+
size: { type: "string", config: "size", update: (c, v) => void c.setSize(String(v ?? "s")) },
|
|
12
|
+
shape: { type: "string", config: "shape", update: (c, v) => void c.setShape(String(v ?? "round")) },
|
|
13
|
+
disabled: { type: "boolean", config: "disabled", update: (c, v) => void (v ? c.disable() : c.enable()) },
|
|
14
|
+
icon: { type: "string", config: "icon" },
|
|
15
|
+
"icon-position": { type: "string", config: "iconPosition" },
|
|
16
|
+
toggle: { type: "boolean", config: "toggle" },
|
|
17
|
+
selected: { type: "boolean", config: "selected", update: (c, v) => void c.setSelected(Boolean(v)) },
|
|
18
|
+
value: { type: "string", config: "value", update: (c, v) => void c.setValue(String(v ?? "")) },
|
|
19
|
+
type: typeAttribute,
|
|
20
|
+
"aria-label": { type: "string", config: "ariaLabel", update: (c, v) => void c.setAriaLabel(String(v ?? "")) },
|
|
21
|
+
},
|
|
22
|
+
properties: {
|
|
23
|
+
selected: {
|
|
24
|
+
get: (c) => c.isSelected(),
|
|
25
|
+
set: (c, v) => void c.setSelected(Boolean(v)),
|
|
26
|
+
config: "selected",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
methods: ["setSelected"],
|
|
30
|
+
model: "selected",
|
|
31
|
+
slot: {
|
|
32
|
+
attribute: "label",
|
|
33
|
+
config: "text",
|
|
34
|
+
},
|
|
35
|
+
events: {
|
|
36
|
+
change: {
|
|
37
|
+
detail: (payload) => {
|
|
38
|
+
const { selected, value } = payload;
|
|
39
|
+
return { selected, value };
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
form: buttonForm(),
|
|
44
|
+
setup: submitOnClick,
|
|
45
45
|
};
|
|
46
46
|
export const buttonElement = defineElement(buttonSpec);
|
|
47
47
|
export const defineButton = (options) => buttonElement.define(options);
|
package/dist/elements/card.js
CHANGED
|
@@ -6,109 +6,109 @@ const REGIONS = ["media", "avatar", "headline", "subhead", "header-action", "con
|
|
|
6
6
|
const builtRegions = new WeakMap();
|
|
7
7
|
const hasText = (node) => node.nodeType === 3 && (node.textContent ?? "").trim() !== "";
|
|
8
8
|
const regionsOf = (host) => REGIONS.filter((region) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (region === "content") {
|
|
10
|
+
return Array.from(host.childNodes).some((node) => hasText(node) || (node.nodeType === 1 && !node.hasAttribute("slot")));
|
|
11
|
+
}
|
|
12
|
+
if ((region === "headline" || region === "subhead") && host.getAttribute(region))
|
|
13
|
+
return true;
|
|
14
|
+
return Array.from(host.children).some((child) => child.getAttribute("slot") === region);
|
|
15
15
|
});
|
|
16
16
|
const readCard = (host) => ({ regions: regionsOf(host) });
|
|
17
17
|
const slot = (name, fallback) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const element = document.createElement("slot");
|
|
19
|
+
if (name)
|
|
20
|
+
element.name = name;
|
|
21
|
+
if (fallback)
|
|
22
|
+
element.textContent = fallback;
|
|
23
|
+
return element;
|
|
24
24
|
};
|
|
25
25
|
const header = (config, regions) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
const has = (region) => regions.includes(region);
|
|
27
|
+
const avatar = document.createElement("div");
|
|
28
|
+
avatar.className = `${PREFIX}-card__header-avatar`;
|
|
29
|
+
avatar.append(slot("avatar"));
|
|
30
|
+
const action = document.createElement("div");
|
|
31
|
+
action.className = `${PREFIX}-card__header-action`;
|
|
32
|
+
action.append(slot("header-action"));
|
|
33
|
+
const element = createCardHeader({
|
|
34
|
+
title: has("headline") ? " " : undefined,
|
|
35
|
+
subtitle: has("subhead") ? " " : undefined,
|
|
36
|
+
avatar: has("avatar") ? avatar : undefined,
|
|
37
|
+
action: has("header-action") ? action : undefined,
|
|
38
|
+
});
|
|
39
|
+
element.querySelector(`.${PREFIX}-card__header-title`)?.replaceChildren(slot("headline", config.headline));
|
|
40
|
+
element.querySelector(`.${PREFIX}-card__header-subtitle`)?.replaceChildren(slot("subhead", config.subhead));
|
|
41
|
+
return element;
|
|
42
42
|
};
|
|
43
43
|
const create = (config) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
const { regions = [], headline, subhead, ariaLabel, actionsAlign = "end", ...rest } = config;
|
|
45
|
+
const card = createCard({ ...rest, aria: ariaLabel ? { label: ariaLabel } : undefined });
|
|
46
|
+
const has = (region) => regions.includes(region);
|
|
47
|
+
if (has("media"))
|
|
48
|
+
card.addMedia(createCardMedia({ element: slot("media") }));
|
|
49
|
+
if (has("avatar") || has("headline") || has("subhead") || has("header-action")) {
|
|
50
|
+
card.setHeader(header({ headline, subhead }, regions));
|
|
51
|
+
}
|
|
52
|
+
if (has("content"))
|
|
53
|
+
card.addContent(createCardContent({ children: [slot()] }));
|
|
54
|
+
if (has("actions")) {
|
|
55
|
+
const actions = createCardActions({ align: actionsAlign });
|
|
56
|
+
actions.append(slot("actions"));
|
|
57
|
+
card.setActions(actions);
|
|
58
|
+
}
|
|
59
|
+
builtRegions.set(card, regions.join(" "));
|
|
60
|
+
return card;
|
|
61
61
|
};
|
|
62
62
|
const updateCard = (host, component) => regionsOf(host).join(" ") === builtRegions.get(component);
|
|
63
63
|
const setDisabled = (component, disabled) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
const { element } = component;
|
|
65
|
+
element.classList.toggle(`${component.getClass("card")}--state-disabled`, disabled);
|
|
66
|
+
if (disabled)
|
|
67
|
+
element.setAttribute("aria-disabled", "true");
|
|
68
|
+
else
|
|
69
|
+
element.removeAttribute("aria-disabled");
|
|
70
|
+
if (component.config.clickable || component.config.interactive) {
|
|
71
|
+
if (disabled)
|
|
72
|
+
element.removeAttribute("tabindex");
|
|
73
|
+
else
|
|
74
|
+
element.setAttribute("tabindex", "0");
|
|
75
|
+
}
|
|
76
76
|
};
|
|
77
77
|
const setAriaLabel = (component, label) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
const { element } = component;
|
|
79
|
+
if (label !== null) {
|
|
80
|
+
element.setAttribute("aria-label", label);
|
|
81
|
+
element.removeAttribute("aria-labelledby");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
element.removeAttribute("aria-label");
|
|
85
|
+
const title = element.querySelector(`.${component.getClass("card")}__header-title`);
|
|
86
|
+
if (title?.id)
|
|
87
|
+
element.setAttribute("aria-labelledby", title.id);
|
|
88
88
|
};
|
|
89
89
|
const cardSpec = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
90
|
+
name: "card",
|
|
91
|
+
slots: ["avatar", "header-action", "headline", "subhead", "media", "actions"],
|
|
92
|
+
create: (config) => create(config),
|
|
93
|
+
styles: ["card"],
|
|
94
|
+
hostStyles: ":host{display:block}:host([disabled]){pointer-events:none}",
|
|
95
|
+
attributes: {
|
|
96
|
+
variant: { type: "string", config: "variant" },
|
|
97
|
+
clickable: { type: "boolean", config: "clickable" },
|
|
98
|
+
"full-width": {
|
|
99
|
+
type: "boolean",
|
|
100
|
+
config: "fullWidth",
|
|
101
|
+
update: (c, v) => void c.element.classList.toggle(`${c.getClass("card")}--full-width`, !!v),
|
|
102
|
+
},
|
|
103
|
+
headline: { type: "string", config: "headline" },
|
|
104
|
+
subhead: { type: "string", config: "subhead" },
|
|
105
|
+
"actions-align": { type: "string", config: "actionsAlign" },
|
|
106
|
+
disabled: { type: "boolean", update: (c, v) => setDisabled(c, !!v) },
|
|
107
|
+
"aria-label": { type: "string", config: "ariaLabel", update: (c, v) => setAriaLabel(c, v === null ? null : String(v)) },
|
|
108
|
+
},
|
|
109
|
+
config: readCard,
|
|
110
|
+
setup: (host, c) => setDisabled(c, host.hasAttribute("disabled")),
|
|
111
|
+
observeChildren: updateCard,
|
|
112
112
|
};
|
|
113
113
|
export const cardElement = defineElement(cardSpec);
|
|
114
114
|
export const defineCard = (options) => cardElement.define(options);
|