@material/web 2.5.1-nightly.70e259d.0 → 2.5.1-nightly.8f78cc3.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/button/internal/button.d.ts +10 -0
- package/button/internal/button.js +27 -4
- package/button/internal/button.js.map +1 -1
- package/checkbox/internal/checkbox.js +2 -1
- package/checkbox/internal/checkbox.js.map +1 -1
- package/chips/internal/assist-chip.d.ts +10 -0
- package/chips/internal/assist-chip.js +23 -2
- package/chips/internal/assist-chip.js.map +1 -1
- package/chips/internal/chip.js +3 -1
- package/chips/internal/chip.js.map +1 -1
- package/chips/internal/filter-chip.js +2 -1
- package/chips/internal/filter-chip.js.map +1 -1
- package/chips/internal/input-chip.d.ts +10 -0
- package/chips/internal/input-chip.js +27 -3
- package/chips/internal/input-chip.js.map +1 -1
- package/custom-elements.json +16806 -7092
- package/dialog/internal/dialog.js +2 -1
- package/dialog/internal/dialog.js.map +1 -1
- package/fab/internal/shared.js +3 -2
- package/fab/internal/shared.js.map +1 -1
- package/field/internal/_content.scss +4 -0
- package/field/internal/_shared.scss +12 -0
- package/field/internal/shared-styles.css +1 -1
- package/field/internal/shared-styles.css.map +1 -1
- package/field/internal/shared-styles.cssresult.js +1 -1
- package/field/internal/shared-styles.cssresult.js.map +1 -1
- package/iconbutton/internal/icon-button.d.ts +10 -0
- package/iconbutton/internal/icon-button.js +26 -5
- package/iconbutton/internal/icon-button.js.map +1 -1
- package/internal/aria/aria.d.ts +1 -0
- package/internal/aria/aria.js +1 -0
- package/internal/aria/aria.js.map +1 -1
- package/internal/directives/safe-href.d.ts +23 -0
- package/internal/directives/safe-href.js +44 -0
- package/internal/directives/safe-href.js.map +1 -0
- package/labs/aria/buttons/keyboard_click_handler.d.ts +25 -0
- package/labs/aria/buttons/keyboard_click_handler.js +74 -0
- package/labs/aria/buttons/keyboard_click_handler.js.map +1 -0
- package/labs/aria/buttons/md-aria-toggle.d.ts +29 -0
- package/labs/aria/buttons/md-aria-toggle.js +67 -0
- package/labs/aria/buttons/md-aria-toggle.js.map +1 -0
- package/labs/aria/buttons/toggle.d.ts +40 -0
- package/labs/aria/buttons/toggle.js +100 -0
- package/labs/aria/buttons/toggle.js.map +1 -0
- package/labs/aria/command.d.ts +18 -0
- package/labs/aria/command.js +204 -0
- package/labs/aria/command.js.map +1 -0
- package/labs/aria/menu/fieldset.d.ts +36 -0
- package/labs/aria/menu/fieldset.js +103 -0
- package/labs/aria/menu/fieldset.js.map +1 -0
- package/labs/aria/menu/internal.d.ts +15 -0
- package/labs/aria/menu/internal.js +16 -0
- package/labs/aria/menu/internal.js.map +1 -0
- package/labs/aria/menu/md-aria-fieldset.d.ts +11 -0
- package/labs/aria/menu/md-aria-fieldset.js +8 -0
- package/labs/aria/menu/md-aria-fieldset.js.map +1 -0
- package/labs/aria/menu/md-aria-menubar.d.ts +11 -0
- package/labs/aria/menu/md-aria-menubar.js +8 -0
- package/labs/aria/menu/md-aria-menubar.js.map +1 -0
- package/labs/aria/menu/md-aria-menuitem.d.ts +11 -0
- package/labs/aria/menu/md-aria-menuitem.js +8 -0
- package/labs/aria/menu/md-aria-menuitem.js.map +1 -0
- package/labs/aria/menu/md-aria-menulist.d.ts +11 -0
- package/labs/aria/menu/md-aria-menulist.js +8 -0
- package/labs/aria/menu/md-aria-menulist.js.map +1 -0
- package/labs/aria/menu/menubar.d.ts +15 -0
- package/labs/aria/menu/menubar.js +45 -0
- package/labs/aria/menu/menubar.js.map +1 -0
- package/labs/aria/menu/menuitem.d.ts +59 -0
- package/labs/aria/menu/menuitem.js +237 -0
- package/labs/aria/menu/menuitem.js.map +1 -0
- package/labs/aria/menu/menulist.d.ts +21 -0
- package/labs/aria/menu/menulist.js +104 -0
- package/labs/aria/menu/menulist.js.map +1 -0
- package/labs/aria/menu/shared-slotted-content.d.ts +10 -0
- package/labs/aria/menu/shared-slotted-content.js +51 -0
- package/labs/aria/menu/shared-slotted-content.js.map +1 -0
- package/labs/aria/pseudo-classes.d.ts +19 -0
- package/labs/aria/pseudo-classes.js +22 -0
- package/labs/aria/pseudo-classes.js.map +1 -0
- package/labs/aria/tabs/tab.js +5 -0
- package/labs/aria/tabs/tab.js.map +1 -1
- package/labs/aria/tabs/tablist.d.ts +3 -5
- package/labs/aria/tabs/tablist.js +23 -88
- package/labs/aria/tabs/tablist.js.map +1 -1
- package/labs/gb/components/all.d.ts +72 -0
- package/labs/gb/components/all.js +81 -0
- package/labs/gb/components/all.js.map +1 -0
- package/labs/gb/components/appbar/app-bar-element.d.ts +1 -0
- package/labs/gb/components/appbar/app-bar-element.js +1 -0
- package/labs/gb/components/appbar/app-bar-element.js.map +1 -1
- package/labs/gb/components/appbar/app-bar.css +1 -1
- package/labs/gb/components/appbar/app-bar.css.map +1 -1
- package/labs/gb/components/appbar/app-bar.cssresult.js +1 -1
- package/labs/gb/components/appbar/app-bar.cssresult.js.map +1 -1
- package/labs/gb/components/appbar/app-bar.scss +1 -0
- package/labs/gb/components/badge/badge-element.d.ts +1 -0
- package/labs/gb/components/badge/badge-element.js +1 -0
- package/labs/gb/components/badge/badge-element.js.map +1 -1
- package/labs/gb/components/badge/badge.css +1 -1
- package/labs/gb/components/badge/badge.css.map +1 -1
- package/labs/gb/components/badge/badge.cssresult.js +1 -1
- package/labs/gb/components/badge/badge.cssresult.js.map +1 -1
- package/labs/gb/components/badge/badge.scss +1 -0
- package/labs/gb/components/button/_button-tokens.scss +33 -22
- package/labs/gb/components/button/button-element.d.ts +21 -14
- package/labs/gb/components/button/button-element.js +52 -74
- package/labs/gb/components/button/button-element.js.map +1 -1
- package/labs/gb/components/button/button.css +1 -1
- package/labs/gb/components/button/button.css.map +1 -1
- package/labs/gb/components/button/button.cssresult.js +1 -1
- package/labs/gb/components/button/button.cssresult.js.map +1 -1
- package/labs/gb/components/button/button.js +1 -1
- package/labs/gb/components/button/button.js.map +1 -1
- package/labs/gb/components/button/button.scss +19 -9
- package/labs/gb/components/buttongroup/_button-group-tokens.scss +124 -0
- package/labs/gb/components/buttongroup/button-group-element.d.ts +68 -0
- package/labs/gb/components/buttongroup/button-group-element.js +320 -0
- package/labs/gb/components/buttongroup/button-group-element.js.map +1 -0
- package/labs/gb/components/buttongroup/button-group.css +5 -0
- package/labs/gb/components/buttongroup/button-group.css.map +1 -0
- package/labs/gb/components/buttongroup/button-group.cssresult.d.ts +3 -0
- package/labs/gb/components/buttongroup/button-group.cssresult.js +15 -0
- package/labs/gb/components/buttongroup/button-group.cssresult.js.map +1 -0
- package/labs/gb/components/buttongroup/button-group.d.ts +96 -0
- package/labs/gb/components/buttongroup/button-group.js +105 -0
- package/labs/gb/components/buttongroup/button-group.js.map +1 -0
- package/labs/gb/components/buttongroup/button-group.scss +335 -0
- package/labs/gb/components/buttongroup/md-gb-button-group.d.ts +12 -0
- package/labs/gb/components/buttongroup/md-gb-button-group.js +8 -0
- package/labs/gb/components/buttongroup/md-gb-button-group.js.map +1 -0
- package/labs/gb/components/card/card-element.d.ts +2 -9
- package/labs/gb/components/card/card-element.js +8 -61
- package/labs/gb/components/card/card-element.js.map +1 -1
- package/labs/gb/components/card/card.css +1 -1
- package/labs/gb/components/card/card.css.map +1 -1
- package/labs/gb/components/card/card.cssresult.js +1 -1
- package/labs/gb/components/card/card.cssresult.js.map +1 -1
- package/labs/gb/components/card/card.scss +18 -5
- package/labs/gb/components/checkbox/checkbox-element.d.ts +1 -0
- package/labs/gb/components/checkbox/checkbox-element.js +3 -1
- package/labs/gb/components/checkbox/checkbox-element.js.map +1 -1
- package/labs/gb/components/checkbox/checkbox.css +1 -1
- package/labs/gb/components/checkbox/checkbox.css.map +1 -1
- package/labs/gb/components/checkbox/checkbox.cssresult.js +1 -1
- package/labs/gb/components/checkbox/checkbox.cssresult.js.map +1 -1
- package/labs/gb/components/checkbox/checkbox.scss +1 -0
- package/labs/gb/components/chip/chip-element.d.ts +11 -0
- package/labs/gb/components/chip/chip-element.js +28 -6
- package/labs/gb/components/chip/chip-element.js.map +1 -1
- package/labs/gb/components/chip/chip.css +1 -1
- package/labs/gb/components/chip/chip.css.map +1 -1
- package/labs/gb/components/chip/chip.cssresult.js +1 -1
- package/labs/gb/components/chip/chip.cssresult.js.map +1 -1
- package/labs/gb/components/chip/chip.js +1 -1
- package/labs/gb/components/chip/chip.js.map +1 -1
- package/labs/gb/components/chip/chip.scss +5 -1
- package/labs/gb/components/divider/divider-element.d.ts +1 -0
- package/labs/gb/components/divider/divider-element.js +1 -0
- package/labs/gb/components/divider/divider-element.js.map +1 -1
- package/labs/gb/components/fab/_fab-tokens.scss +4 -1
- package/labs/gb/components/fab/fab-element.d.ts +2 -0
- package/labs/gb/components/fab/fab-element.js +2 -0
- package/labs/gb/components/fab/fab-element.js.map +1 -1
- package/labs/gb/components/fab/fab.css +1 -1
- package/labs/gb/components/fab/fab.css.map +1 -1
- package/labs/gb/components/fab/fab.cssresult.js +1 -1
- package/labs/gb/components/fab/fab.cssresult.js.map +1 -1
- package/labs/gb/components/fab/fab.scss +3 -2
- package/labs/gb/components/iconbutton/_icon-button-tokens.scss +13 -4
- package/labs/gb/components/iconbutton/icon-button-element.d.ts +15 -1
- package/labs/gb/components/iconbutton/icon-button-element.js +42 -6
- package/labs/gb/components/iconbutton/icon-button-element.js.map +1 -1
- package/labs/gb/components/iconbutton/icon-button.css +1 -1
- package/labs/gb/components/iconbutton/icon-button.css.map +1 -1
- package/labs/gb/components/iconbutton/icon-button.cssresult.js +1 -1
- package/labs/gb/components/iconbutton/icon-button.cssresult.js.map +1 -1
- package/labs/gb/components/iconbutton/icon-button.js +1 -1
- package/labs/gb/components/iconbutton/icon-button.js.map +1 -1
- package/labs/gb/components/iconbutton/icon-button.scss +13 -2
- package/labs/gb/components/list/_list-tokens.scss +11 -14
- package/labs/gb/components/list/list-element.d.ts +1 -0
- package/labs/gb/components/list/list-element.js +1 -0
- package/labs/gb/components/list/list-element.js.map +1 -1
- package/labs/gb/components/list/list-item-element.d.ts +5 -0
- package/labs/gb/components/list/list-item-element.js +8 -2
- package/labs/gb/components/list/list-item-element.js.map +1 -1
- package/labs/gb/components/list/list.css +1 -1
- package/labs/gb/components/list/list.css.map +1 -1
- package/labs/gb/components/list/list.cssresult.js +1 -1
- package/labs/gb/components/list/list.cssresult.js.map +1 -1
- package/labs/gb/components/list/list.scss +7 -0
- package/labs/gb/components/menu/_menu-tokens.scss +45 -16
- package/labs/gb/components/menu/menu-element.d.ts +1 -0
- package/labs/gb/components/menu/menu-element.js +1 -0
- package/labs/gb/components/menu/menu-element.js.map +1 -1
- package/labs/gb/components/menu/menu-group-element.d.ts +1 -0
- package/labs/gb/components/menu/menu-group-element.js +1 -0
- package/labs/gb/components/menu/menu-group-element.js.map +1 -1
- package/labs/gb/components/menu/menu-item-element.d.ts +5 -1
- package/labs/gb/components/menu/menu-item-element.js +5 -1
- package/labs/gb/components/menu/menu-item-element.js.map +1 -1
- package/labs/gb/components/menu/menu.css +1 -1
- package/labs/gb/components/menu/menu.css.map +1 -1
- package/labs/gb/components/menu/menu.cssresult.js +1 -1
- package/labs/gb/components/menu/menu.cssresult.js.map +1 -1
- package/labs/gb/components/menu/menu.scss +5 -0
- package/labs/gb/components/navbar/_nav-bar-tokens.scss +57 -0
- package/labs/gb/components/navbar/md-gb-nav-bar-item.d.ts +12 -0
- package/labs/gb/components/navbar/md-gb-nav-bar-item.js +10 -0
- package/labs/gb/components/navbar/md-gb-nav-bar-item.js.map +1 -0
- package/labs/gb/components/navbar/md-gb-nav-bar.d.ts +12 -0
- package/labs/gb/components/navbar/md-gb-nav-bar.js +10 -0
- package/labs/gb/components/navbar/md-gb-nav-bar.js.map +1 -0
- package/labs/gb/components/navbar/nav-bar-element.d.ts +60 -0
- package/labs/gb/components/navbar/nav-bar-element.js +118 -0
- package/labs/gb/components/navbar/nav-bar-element.js.map +1 -0
- package/labs/gb/components/navbar/nav-bar-item-element.d.ts +41 -0
- package/labs/gb/components/navbar/nav-bar-item-element.js +150 -0
- package/labs/gb/components/navbar/nav-bar-item-element.js.map +1 -0
- package/labs/gb/components/navbar/nav-bar.css +4 -0
- package/labs/gb/components/navbar/nav-bar.css.map +1 -0
- package/labs/gb/components/navbar/nav-bar.cssresult.d.ts +3 -0
- package/labs/gb/components/navbar/nav-bar.cssresult.js +14 -0
- package/labs/gb/components/navbar/nav-bar.cssresult.js.map +1 -0
- package/labs/gb/components/navbar/nav-bar.d.ts +86 -0
- package/labs/gb/components/navbar/nav-bar.js +92 -0
- package/labs/gb/components/navbar/nav-bar.js.map +1 -0
- package/labs/gb/components/navbar/nav-bar.scss +340 -0
- package/labs/gb/components/navrail/_nav-rail-tokens.scss +123 -0
- package/labs/gb/components/navrail/md-gb-nav-rail-item.d.ts +12 -0
- package/labs/gb/components/navrail/md-gb-nav-rail-item.js +10 -0
- package/labs/gb/components/navrail/md-gb-nav-rail-item.js.map +1 -0
- package/labs/gb/components/navrail/md-gb-nav-rail.d.ts +12 -0
- package/labs/gb/components/navrail/md-gb-nav-rail.js +10 -0
- package/labs/gb/components/navrail/md-gb-nav-rail.js.map +1 -0
- package/labs/gb/components/navrail/nav-rail-element.d.ts +120 -0
- package/labs/gb/components/navrail/nav-rail-element.js +366 -0
- package/labs/gb/components/navrail/nav-rail-element.js.map +1 -0
- package/labs/gb/components/navrail/nav-rail-item-element.d.ts +44 -0
- package/labs/gb/components/navrail/nav-rail-item-element.js +178 -0
- package/labs/gb/components/navrail/nav-rail-item-element.js.map +1 -0
- package/labs/gb/components/navrail/nav-rail.css +4 -0
- package/labs/gb/components/navrail/nav-rail.css.map +1 -0
- package/labs/gb/components/navrail/nav-rail.cssresult.d.ts +3 -0
- package/labs/gb/components/navrail/nav-rail.cssresult.js +14 -0
- package/labs/gb/components/navrail/nav-rail.cssresult.js.map +1 -0
- package/labs/gb/components/navrail/nav-rail.d.ts +108 -0
- package/labs/gb/components/navrail/nav-rail.js +115 -0
- package/labs/gb/components/navrail/nav-rail.js.map +1 -0
- package/labs/gb/components/navrail/nav-rail.scss +419 -0
- package/labs/gb/components/radio/radio-element.d.ts +1 -0
- package/labs/gb/components/radio/radio-element.js +1 -0
- package/labs/gb/components/radio/radio-element.js.map +1 -1
- package/labs/gb/components/radio/radio.css +1 -1
- package/labs/gb/components/radio/radio.css.map +1 -1
- package/labs/gb/components/radio/radio.cssresult.js +1 -1
- package/labs/gb/components/radio/radio.cssresult.js.map +1 -1
- package/labs/gb/components/radio/radio.scss +1 -0
- package/labs/gb/components/shared/fx.d.ts +67 -0
- package/labs/gb/components/shared/fx.js +106 -0
- package/labs/gb/components/shared/fx.js.map +1 -0
- package/labs/gb/components/shared/pseudo-classes.d.ts +1 -7
- package/labs/gb/components/shared/pseudo-classes.js +1 -9
- package/labs/gb/components/shared/pseudo-classes.js.map +1 -1
- package/labs/gb/components/shared/update-class-list.d.ts +22 -0
- package/labs/gb/components/shared/update-class-list.js +26 -0
- package/labs/gb/components/shared/update-class-list.js.map +1 -0
- package/labs/gb/components/slider/_slider-tokens.scss +86 -0
- package/labs/gb/components/slider/md-gb-slider.d.ts +12 -0
- package/labs/gb/components/slider/md-gb-slider.js +8 -0
- package/labs/gb/components/slider/md-gb-slider.js.map +1 -0
- package/labs/gb/components/slider/slider-element.d.ts +147 -0
- package/labs/gb/components/slider/slider-element.js +981 -0
- package/labs/gb/components/slider/slider-element.js.map +1 -0
- package/labs/gb/components/slider/slider.css +1 -0
- package/labs/gb/components/slider/slider.css.map +1 -0
- package/labs/gb/components/slider/slider.cssresult.d.ts +3 -0
- package/labs/gb/components/slider/slider.cssresult.js +11 -0
- package/labs/gb/components/slider/slider.cssresult.js.map +1 -0
- package/labs/gb/components/slider/slider.d.ts +181 -0
- package/labs/gb/components/slider/slider.js +510 -0
- package/labs/gb/components/slider/slider.js.map +1 -0
- package/labs/gb/components/slider/slider.scss +711 -0
- package/labs/gb/components/snackbar/_snackbar-tokens.scss +86 -0
- package/labs/gb/components/snackbar/harness.d.ts +32 -0
- package/labs/gb/components/snackbar/harness.js +64 -0
- package/labs/gb/components/snackbar/harness.js.map +1 -0
- package/labs/gb/components/snackbar/md-gb-snackbar.d.ts +12 -0
- package/labs/gb/components/snackbar/md-gb-snackbar.js +8 -0
- package/labs/gb/components/snackbar/md-gb-snackbar.js.map +1 -0
- package/labs/gb/components/snackbar/snackbar-element.d.ts +123 -0
- package/labs/gb/components/snackbar/snackbar-element.js +448 -0
- package/labs/gb/components/snackbar/snackbar-element.js.map +1 -0
- package/labs/gb/components/snackbar/snackbar.css +5 -0
- package/labs/gb/components/snackbar/snackbar.css.map +1 -0
- package/labs/gb/components/snackbar/snackbar.cssresult.d.ts +3 -0
- package/labs/gb/components/snackbar/snackbar.cssresult.js +15 -0
- package/labs/gb/components/snackbar/snackbar.cssresult.js.map +1 -0
- package/labs/gb/components/snackbar/snackbar.d.ts +54 -0
- package/labs/gb/components/snackbar/snackbar.js +72 -0
- package/labs/gb/components/snackbar/snackbar.js.map +1 -0
- package/labs/gb/components/snackbar/snackbar.scss +384 -0
- package/labs/gb/components/splitbutton/split-button-element.d.ts +1 -0
- package/labs/gb/components/splitbutton/split-button-element.js +1 -0
- package/labs/gb/components/splitbutton/split-button-element.js.map +1 -1
- package/labs/gb/components/switch/switch-element.d.ts +1 -0
- package/labs/gb/components/switch/switch-element.js +3 -1
- package/labs/gb/components/switch/switch-element.js.map +1 -1
- package/labs/gb/components/switch/switch.css +1 -1
- package/labs/gb/components/switch/switch.css.map +1 -1
- package/labs/gb/components/switch/switch.cssresult.js +1 -1
- package/labs/gb/components/switch/switch.cssresult.js.map +1 -1
- package/labs/gb/components/switch/switch.js +5 -2
- package/labs/gb/components/switch/switch.js.map +1 -1
- package/labs/gb/components/switch/switch.scss +4 -2
- package/labs/gb/components/tabs/_tabs-tokens.scss +177 -0
- package/labs/gb/components/tabs/md-gb-tab.d.ts +12 -0
- package/labs/gb/components/tabs/md-gb-tab.js +8 -0
- package/labs/gb/components/tabs/md-gb-tab.js.map +1 -0
- package/labs/gb/components/tabs/md-gb-tabs.d.ts +12 -0
- package/labs/gb/components/tabs/md-gb-tabs.js +8 -0
- package/labs/gb/components/tabs/md-gb-tabs.js.map +1 -0
- package/labs/gb/components/tabs/tab-element.d.ts +42 -0
- package/labs/gb/components/tabs/tab-element.js +75 -0
- package/labs/gb/components/tabs/tab-element.js.map +1 -0
- package/labs/gb/components/tabs/tabs-element.d.ts +37 -0
- package/labs/gb/components/tabs/tabs-element.js +67 -0
- package/labs/gb/components/tabs/tabs-element.js.map +1 -0
- package/labs/gb/components/tabs/tabs.css +4 -0
- package/labs/gb/components/tabs/tabs.css.map +1 -0
- package/labs/gb/components/tabs/tabs.cssresult.d.ts +3 -0
- package/labs/gb/components/tabs/tabs.cssresult.js +14 -0
- package/labs/gb/components/tabs/tabs.cssresult.js.map +1 -0
- package/labs/gb/components/tabs/tabs.d.ts +98 -0
- package/labs/gb/components/tabs/tabs.js +112 -0
- package/labs/gb/components/tabs/tabs.js.map +1 -0
- package/labs/gb/components/tabs/tabs.scss +301 -0
- package/labs/gb/components/toolbar/_toolbar-tokens.scss +70 -0
- package/labs/gb/components/toolbar/md-gb-toolbar.d.ts +12 -0
- package/labs/gb/components/toolbar/md-gb-toolbar.js +8 -0
- package/labs/gb/components/toolbar/md-gb-toolbar.js.map +1 -0
- package/labs/gb/components/toolbar/toolbar-element.d.ts +56 -0
- package/labs/gb/components/toolbar/toolbar-element.js +120 -0
- package/labs/gb/components/toolbar/toolbar-element.js.map +1 -0
- package/labs/gb/components/toolbar/toolbar.css +4 -0
- package/labs/gb/components/toolbar/toolbar.css.map +1 -0
- package/labs/gb/components/toolbar/toolbar.cssresult.d.ts +3 -0
- package/labs/gb/components/toolbar/toolbar.cssresult.js +14 -0
- package/labs/gb/components/toolbar/toolbar.cssresult.js.map +1 -0
- package/labs/gb/components/toolbar/toolbar.d.ts +56 -0
- package/labs/gb/components/toolbar/toolbar.js +60 -0
- package/labs/gb/components/toolbar/toolbar.js.map +1 -0
- package/labs/gb/components/toolbar/toolbar.scss +240 -0
- package/labs/gb/styles/icon/icon-element.d.ts +1 -0
- package/labs/gb/styles/icon/icon-element.js +1 -0
- package/labs/gb/styles/icon/icon-element.js.map +1 -1
- package/labs/gb/styles/tailwind.css +1 -1
- package/labs/gb/styles/tailwind.css.map +1 -1
- package/labs/gb/styles/tailwind.cssresult.js +1 -1
- package/labs/gb/styles/tailwind.cssresult.js.map +1 -1
- package/labs/gb/styles/tailwind.scss +2 -0
- package/labs/navigationbar/internal/navigation-bar.js +2 -1
- package/labs/navigationbar/internal/navigation-bar.js.map +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer-modal.js +2 -1
- package/labs/navigationdrawer/internal/navigation-drawer-modal.js.map +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer.js +2 -1
- package/labs/navigationdrawer/internal/navigation-drawer.js.map +1 -1
- package/labs/navigationtab/internal/navigation-tab.js +2 -1
- package/labs/navigationtab/internal/navigation-tab.js.map +1 -1
- package/labs/segmentedbutton/internal/segmented-button.js +2 -1
- package/labs/segmentedbutton/internal/segmented-button.js.map +1 -1
- package/labs/segmentedbuttonset/internal/segmented-button-set.js +2 -1
- package/labs/segmentedbuttonset/internal/segmented-button-set.js.map +1 -1
- package/list/internal/listitem/list-item.d.ts +10 -0
- package/list/internal/listitem/list-item.js +21 -1
- package/list/internal/listitem/list-item.js.map +1 -1
- package/menu/internal/menuitem/menu-item.d.ts +10 -0
- package/menu/internal/menuitem/menu-item.js +21 -1
- package/menu/internal/menuitem/menu-item.js.map +1 -1
- package/package.json +2 -1
- package/progress/internal/progress.js +2 -1
- package/progress/internal/progress.js.map +1 -1
- package/radio/internal/single-selection-controller.js +4 -1
- package/radio/internal/single-selection-controller.js.map +1 -1
- package/select/internal/selectoption/select-option.js +1 -0
- package/select/internal/selectoption/select-option.js.map +1 -1
- package/slider/internal/slider.js +1 -0
- package/slider/internal/slider.js.map +1 -1
- package/switch/internal/switch.js +1 -0
- package/switch/internal/switch.js.map +1 -1
- package/testing/harness.js +3 -0
- package/testing/harness.js.map +1 -1
- package/textfield/internal/_shared.scss +1 -0
- package/textfield/internal/shared-styles.css +1 -1
- package/textfield/internal/shared-styles.css.map +1 -1
- package/textfield/internal/shared-styles.cssresult.js +1 -1
- package/textfield/internal/shared-styles.cssresult.js.map +1 -1
- package/types/command-event.d.ts +34 -0
- package/types/popover.d.ts +25 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.cssresult.js","sourceRoot":"","sources":["button.cssresult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mEAAmE;AACnE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;CAIxB,CAAC;AACF,eAAe,MAAM,CAAC,UAAW,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./labs/gb/components/button/button.css.\nimport {css} from 'lit';\nexport const styles = css`/*!\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */@layer md.sys, md.comp.ripple, md.comp.focus-ring;@layer md.comp.button{.btn{--container-color: transparent;--container-
|
|
1
|
+
{"version":3,"file":"button.cssresult.js","sourceRoot":"","sources":["button.cssresult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mEAAmE;AACnE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;CAIxB,CAAC;AACF,eAAe,MAAM,CAAC,UAAW,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./labs/gb/components/button/button.css.\nimport {css} from 'lit';\nexport const styles = css`/*!\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */@layer md.sys, md.comp.ripple, md.comp.focus-ring;@layer md.comp.button{.btn{--container-color: transparent;--container-elevation: var(--md-sys-elevation-shadow-0);--container-height: auto;--container-shape: calc(var(--container-height) / 2);--icon-color: currentColor;--icon-label-space: 8px;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-axes: var(--md-sys-typescale-label-lg-axes);--label-text-color: currentColor;--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--leading-space: 0;--md-icon-fill: 1;--outline-color: transparent;--outline-width: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:where(.btn-unselected,[aria-pressed=false]){--md-icon-fill: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md);--md-icon-fill: 1}.btn.btn-filled{--container-color: var(--md-sys-color-primary);--icon-color: var(--md-sys-color-on-primary);--label-text-color: var(--md-sys-color-on-primary)}.btn.btn-filled:where(.btn-unselected,[aria-pressed=false]){--container-color: var(--md-sys-color-surface-container);--icon-color: var(--md-sys-color-on-surface-variant);--label-text-color: var(--md-sys-color-on-surface-variant)}.btn.btn-filled:where(.btn-selected,[aria-pressed=true]){--container-color: var(--md-sys-color-primary);--icon-color: var(--md-sys-color-on-primary);--label-text-color: var(--md-sys-color-on-primary)}.btn.btn-elevated{--container-color: var(--md-sys-color-surface-container-low);--container-elevation: var(--md-sys-elevation-shadow-1);--icon-color: var(--md-sys-color-primary);--label-text-color: var(--md-sys-color-primary)}.btn.btn-elevated:where(.btn-selected,[aria-pressed=true]){--container-color: var(--md-sys-color-primary);--icon-color: var(--md-sys-color-on-primary);--label-text-color: var(--md-sys-color-on-primary)}.btn.btn-tonal{--container-color: var(--md-sys-color-secondary-container);--icon-color: var(--md-sys-color-on-secondary-container);--label-text-color: var(--md-sys-color-on-secondary-container)}.btn.btn-tonal:where(.btn-selected,[aria-pressed=true]){--container-color: var(--md-sys-color-secondary);--icon-color: var(--md-sys-color-on-secondary);--label-text-color: var(--md-sys-color-on-secondary)}.btn.btn-outlined{--icon-color: var(--md-sys-color-on-surface-variant);--label-text-color: var(--md-sys-color-on-surface-variant);--outline-color: var(--md-sys-color-outline-variant)}.btn.btn-outlined:where(.btn-selected,[aria-pressed=true]){--container-color: var(--md-sys-color-inverse-surface);--icon-color: var(--md-sys-color-inverse-on-surface);--label-text-color: var(--md-sys-color-inverse-on-surface);--outline-color: transparent}.btn.btn-text{--icon-color: var(--md-sys-color-primary);--label-text-color: var(--md-sys-color-primary);--state-layer-color: var(--md-sys-color-primary)}.btn.btn-xs{--container-height: 32px;--leading-space: 12px;--outline-width: 1px;--trailing-space: 12px}.btn.btn-sm{--container-height: 40px;--leading-space: 16px;--outline-width: 1px;--trailing-space: 16px}.btn.btn-md{--container-height: 56px;--icon-size: 24px;--label-text: var(--md-sys-typescale-title-md);--label-text-axes: var(--md-sys-typescale-title-md-axes);--label-text-tracking: var(--md-sys-typescale-title-md-tracking);--leading-space: 24px;--outline-width: 1px;--trailing-space: 24px}.btn.btn-md:where(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-lg)}.btn.btn-lg{--container-height: 96px;--icon-label-space: 12px;--icon-size: 32px;--label-text: var(--md-sys-typescale-headline-sm);--label-text-axes: var(--md-sys-typescale-headline-sm-axes);--label-text-tracking: var(--md-sys-typescale-headline-sm-tracking);--leading-space: 48px;--outline-width: 2px;--trailing-space: 48px}.btn.btn-lg:where(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-xl)}.btn.btn-xl{--container-height: 136px;--icon-label-space: 16px;--icon-size: 40px;--label-text: var(--md-sys-typescale-headline-lg);--label-text-axes: var(--md-sys-typescale-headline-lg-axes);--label-text-tracking: var(--md-sys-typescale-headline-lg-tracking);--leading-space: 64px;--outline-width: 3px;--trailing-space: 64px}.btn.btn-xl:where(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-xl)}.btn.btn-square{--container-shape: var(--md-sys-shape-corner-md)}.btn.btn-square:where(.btn-md){--container-shape: var(--md-sys-shape-corner-lg)}.btn.btn-square:where(.btn-lg){--container-shape: var(--md-sys-shape-corner-xl)}.btn.btn-square:where(.btn-xl){--container-shape: var(--md-sys-shape-corner-xl)}.btn.btn-square:where(.btn-selected,[aria-pressed=true]){--container-shape: calc(var(--container-height) / 2)}.btn:is(:active,.active):where(:not(:disabled,.disabled,[aria-disabled=true])){--container-shape: var(--md-sys-shape-corner-sm)}.btn:is(:active,.active):where(:not(:disabled,.disabled,[aria-disabled=true])):where(.btn-md){--container-shape: var(--md-sys-shape-corner-md)}.btn:is(:active,.active):where(:not(:disabled,.disabled,[aria-disabled=true])):where(.btn-lg){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:active,.active):where(:not(:disabled,.disabled,[aria-disabled=true])):where(.btn-xl){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:disabled,.disabled,[aria-disabled=true]){--container-color: hsl(from var(--md-sys-color-on-surface) h s l / 10%);--container-elevation: var(--md-sys-elevation-shadow-0);--icon-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);--label-text-color: hsl(from var(--md-sys-color-on-surface) h s l / 38%);--disabled: true}.btn:is(:disabled,.disabled,[aria-disabled=true]):where(.btn-outlined:not(.btn-selected,[aria-pressed=true])){--container-color: transparent}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:var(--container-height);gap:var(--icon-label-space);padding-inline:var(--leading-space) var(--trailing-space);border:var(--outline-width) solid var(--outline-color);border-radius:var(--container-shape);box-shadow:var(--container-elevation);background-color:var(--container-color);color:var(--label-text-color);font:var(--label-text);letter-spacing:var(--label-text-tracking);font-variation-settings:var(--label-text-axes);-webkit-font-smoothing:antialiased;transition:border-radius 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9),var(--ripple-transition);--md-icon-color: var(--icon-color);--md-icon-size: var(--icon-size)}.btn:not(:disabled,.disabled,[aria-disabled=true]){cursor:pointer}.btn:has(.fx-playing){--outline-color: transparent;--container-elevation: none}}\n`;\nexport default styles.styleSheet!;\n"]}
|
|
@@ -102,7 +102,7 @@ export function setupButton(button, opts) {
|
|
|
102
102
|
button.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
|
|
103
103
|
button.dispatchEvent(new Event('change', { bubbles: true }));
|
|
104
104
|
});
|
|
105
|
-
}, opts);
|
|
105
|
+
}, { ...opts, capture: true });
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* A Lit directive that adds button styling and functionality to its element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAKvE,mCAAmC;AACnC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACJ,CAAC;AAKX,kCAAkC;AAClC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAC;AAEX,sBAAsB;AACtB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,YAAY;IACvB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,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O,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CACzD,CAAC;YACF,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC,EACD,EAAC,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CACzB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,uBAAuB,CAAC;IAC5C,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,WAAW;CAC1B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {type ClassInfo} from 'lit/directives/class-map.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../../../internal/events/dispatch-hooks.js';\nimport {focusRingClasses} from '../focus/focus-ring.js';\nimport {rippleClasses, setupRipple} from '../ripple/ripple.js';\nimport {createClassMapDirective} from '../shared/directives.js';\nimport {isDisabled, PSEUDO_CLASSES} from '../shared/pseudo-classes.js';\n\n/** Button color configuration types. */\nexport type ButtonColor = 'filled' | 'elevated' | 'tonal' | 'outlined' | 'text';\n\n/** Button color configurations. */\nexport const BUTTON_COLORS = {\n filled: 'filled',\n elevated: 'elevated',\n tonal: 'tonal',\n outlined: 'outlined',\n text: 'text',\n} as const;\n\n/** Button size configuration types. */\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Button size configurations. */\nexport const BUTTON_SIZES = {\n xs: 'xs',\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n xl: 'xl',\n} as const;\n\n/** Button classes. */\nexport const BUTTON_CLASSES = {\n btn: 'btn',\n btnFilled: 'btn-filled',\n btnElevated: 'btn-elevated',\n btnTonal: 'btn-tonal',\n btnOutlined: 'btn-outlined',\n btnText: 'btn-text',\n btnXs: 'btn-xs',\n btnSm: 'btn-sm',\n btnMd: 'btn-md',\n btnLg: 'btn-lg',\n btnXl: 'btn-xl',\n btnSquare: 'btn-square',\n btnUnselected: 'btn-unselected',\n btnSelected: 'btn-selected',\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n};\n\n/** The state provided to the `buttonClasses()` function. */\nexport interface ButtonClassesState {\n /** The color of the button. */\n color?: ButtonColor;\n /** The size of the button. */\n size?: ButtonSize;\n /** Whether the button is a square shape. */\n square?: boolean;\n /** Whether the toggle button is selected, if not undefined. */\n selected?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the button classes to apply to an element based on the given state.\n *\n * @param state The state of the button.\n * @return An object of class names and truthy values if they apply.\n */\nexport function buttonClasses({\n color,\n size,\n square = false,\n selected,\n active = false,\n disabled = false,\n}: ButtonClassesState = {}): ClassInfo {\n return {\n ...rippleClasses(),\n ...focusRingClasses(),\n [BUTTON_CLASSES.btn]: true,\n [BUTTON_CLASSES.btnFilled]: color === BUTTON_COLORS.filled,\n [BUTTON_CLASSES.btnElevated]: color === BUTTON_COLORS.elevated,\n [BUTTON_CLASSES.btnTonal]: color === BUTTON_COLORS.tonal,\n [BUTTON_CLASSES.btnOutlined]: color === BUTTON_COLORS.outlined,\n [BUTTON_CLASSES.btnText]: color === BUTTON_COLORS.text || !color,\n [BUTTON_CLASSES.btnXs]: size === BUTTON_SIZES.xs,\n [BUTTON_CLASSES.btnSm]: size === BUTTON_SIZES.sm || !size,\n [BUTTON_CLASSES.btnMd]: size === BUTTON_SIZES.md,\n [BUTTON_CLASSES.btnLg]: size === BUTTON_SIZES.lg,\n [BUTTON_CLASSES.btnXl]: size === BUTTON_SIZES.xl,\n [BUTTON_CLASSES.btnSquare]: square,\n [BUTTON_CLASSES.btnUnselected]: selected === false,\n [BUTTON_CLASSES.btnSelected]: selected === true,\n [BUTTON_CLASSES.active]: active,\n [BUTTON_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up button functionality for the given element.\n *\n * @param button The element on which to set up button functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupButton(\n button: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupDispatchHooks(button, 'click');\n setupRipple(button, opts);\n button.addEventListener(\n 'click',\n (event) => {\n // When disabled, explicitly prevent the click from propagating to other\n // event listeners as well as prevent the default action. This is because\n // the underlying element may not actually be `:disabled`, such as an\n // anchor tag or a soft-disabled button.\n if (isDisabled(button)) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n afterDispatch(event, () => {\n const isToggle =\n button.hasAttribute('aria-pressed') ||\n button.matches(\n `.${BUTTON_CLASSES.btnSelected},.${BUTTON_CLASSES.btnUnselected}`,\n );\n if (event.defaultPrevented || !isToggle) {\n return;\n }\n\n const isPressed = button.ariaPressed === 'true';\n button.ariaPressed = String(!isPressed);\n // Mimic native browser input and change event behavior.\n button.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n button.dispatchEvent(new Event('change', {bubbles: true}));\n });\n },\n {...opts, capture: true},\n );\n}\n\n/**\n * A Lit directive that adds button styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<button class=\"${button({color: 'filled'})}\">Filled</button>`;\n * ```\n */\nexport const button = createClassMapDirective({\n getClasses: buttonClasses,\n setupElement: setupButton,\n});\n"]}
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
@layer md.comp.button {
|
|
12
12
|
.btn {
|
|
13
13
|
@include button-tokens.root;
|
|
14
|
+
&:where(.btn-unselected, [aria-pressed='false']) {
|
|
15
|
+
@include button-tokens.unselected;
|
|
16
|
+
}
|
|
14
17
|
&:is(.btn-selected, [aria-pressed='true']) {
|
|
15
18
|
@include button-tokens.selected;
|
|
16
19
|
}
|
|
@@ -37,12 +40,6 @@
|
|
|
37
40
|
}
|
|
38
41
|
&.btn-outlined {
|
|
39
42
|
@include button-tokens.outlined;
|
|
40
|
-
&:where(.btn-lg) {
|
|
41
|
-
@include button-tokens.outlined-lg;
|
|
42
|
-
}
|
|
43
|
-
&:where(.btn-xl) {
|
|
44
|
-
@include button-tokens.outlined-xl;
|
|
45
|
-
}
|
|
46
43
|
&:where(.btn-selected, [aria-pressed='true']) {
|
|
47
44
|
@include button-tokens.outlined-selected;
|
|
48
45
|
}
|
|
@@ -89,7 +86,9 @@
|
|
|
89
86
|
@include button-tokens.square-selected;
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
|
-
&:is(:active, .active):where(
|
|
89
|
+
&:is(:active, .active):where(
|
|
90
|
+
:not(:disabled, .disabled, [aria-disabled='true'])
|
|
91
|
+
) {
|
|
93
92
|
@include button-tokens.pressed;
|
|
94
93
|
&:where(.btn-md) {
|
|
95
94
|
@include button-tokens.pressed-md;
|
|
@@ -101,8 +100,13 @@
|
|
|
101
100
|
@include button-tokens.pressed-xl;
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
&:is(:disabled, .disabled) {
|
|
103
|
+
&:is(:disabled, .disabled, [aria-disabled='true']) {
|
|
105
104
|
@include button-tokens.disabled;
|
|
105
|
+
--disabled: true;
|
|
106
|
+
|
|
107
|
+
&:where(.btn-outlined:not(.btn-selected, [aria-pressed='true'])) {
|
|
108
|
+
@include button-tokens.outlined-disabled;
|
|
109
|
+
}
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
& {
|
|
@@ -119,14 +123,20 @@
|
|
|
119
123
|
color: var(--label-text-color);
|
|
120
124
|
font: var(--label-text);
|
|
121
125
|
letter-spacing: var(--label-text-tracking);
|
|
126
|
+
font-variation-settings: var(--label-text-axes);
|
|
127
|
+
-webkit-font-smoothing: antialiased;
|
|
122
128
|
transition:
|
|
123
129
|
border-radius 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9),
|
|
124
130
|
var(--ripple-transition);
|
|
125
131
|
--md-icon-color: var(--icon-color);
|
|
126
132
|
--md-icon-size: var(--icon-size);
|
|
127
133
|
}
|
|
128
|
-
&:not(:disabled, .disabled) {
|
|
134
|
+
&:not(:disabled, .disabled, [aria-disabled='true']) {
|
|
129
135
|
cursor: pointer;
|
|
130
136
|
}
|
|
137
|
+
&:has(.fx-playing) {
|
|
138
|
+
--outline-color: transparent;
|
|
139
|
+
--container-elevation: none;
|
|
140
|
+
}
|
|
131
141
|
}
|
|
132
142
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@mixin root {
|
|
7
|
+
// LINT.IfChange
|
|
8
|
+
--between-space: 8px;
|
|
9
|
+
--pressed-item-size: size;
|
|
10
|
+
--pressed-item-width-multiplier: 1.15;
|
|
11
|
+
--motion-spring-fast-spatial: linear(
|
|
12
|
+
0,
|
|
13
|
+
0.099,
|
|
14
|
+
0.317,
|
|
15
|
+
0.561,
|
|
16
|
+
0.775,
|
|
17
|
+
0.934,
|
|
18
|
+
1.034,
|
|
19
|
+
1.083,
|
|
20
|
+
1.095,
|
|
21
|
+
1.084,
|
|
22
|
+
1.063,
|
|
23
|
+
1.04,
|
|
24
|
+
1.02,
|
|
25
|
+
1.005,
|
|
26
|
+
0.996,
|
|
27
|
+
0.992,
|
|
28
|
+
0.991,
|
|
29
|
+
0.992,
|
|
30
|
+
0.994,
|
|
31
|
+
0.996,
|
|
32
|
+
1
|
|
33
|
+
);
|
|
34
|
+
--motion-spring-fast-spatial-duration: 350ms;
|
|
35
|
+
--inner-corner-size: var(--md-sys-shape-corner-sm);
|
|
36
|
+
--pressed-inner-corner-size: var(--md-sys-shape-corner-xs);
|
|
37
|
+
--outer-corner-size: calc(var(--container-height) / 2);
|
|
38
|
+
--outer-corner-square-size: var(--md-sys-shape-corner-sm);
|
|
39
|
+
// LINT.ThenChange(button-group-element.ts) keep in sync with `@cssprop` jsdoc tags
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin standard-xs {
|
|
43
|
+
--between-space: 18px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@mixin standard-sm {
|
|
47
|
+
--between-space: 12px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin standard-md {
|
|
51
|
+
--between-space: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin standard-lg {
|
|
55
|
+
--between-space: 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@mixin standard-xl {
|
|
59
|
+
--between-space: 8px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@mixin connected {
|
|
63
|
+
--between-space: 2px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@mixin inner-corner-xs {
|
|
67
|
+
// Design override of GM3 v35: inner corners for XS are 4px (corner-xs)
|
|
68
|
+
--inner-corner-size: var(--md-sys-shape-corner-xs);
|
|
69
|
+
--pressed-inner-corner-size: var(--md-sys-shape-corner-xs);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@mixin inner-corner-sm {
|
|
73
|
+
--inner-corner-size: var(--md-sys-shape-corner-sm);
|
|
74
|
+
--pressed-inner-corner-size: var(--md-sys-shape-corner-xs);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@mixin inner-corner-md {
|
|
78
|
+
--inner-corner-size: var(--md-sys-shape-corner-sm);
|
|
79
|
+
--pressed-inner-corner-size: var(--md-sys-shape-corner-xs);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@mixin inner-corner-lg {
|
|
83
|
+
--inner-corner-size: var(--md-sys-shape-corner-lg);
|
|
84
|
+
--pressed-inner-corner-size: var(--md-sys-shape-corner-md);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@mixin inner-corner-xl {
|
|
88
|
+
--inner-corner-size: var(--md-sys-shape-corner-lg-increased);
|
|
89
|
+
--pressed-inner-corner-size: var(--md-sys-shape-corner-lg);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@mixin outer-corner-round {
|
|
93
|
+
--outer-corner-size: calc(var(--container-height) / 2);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@mixin outer-corner-square-xs {
|
|
97
|
+
// Design override of GM3 v35: outer corner square XS is 4px (corner-xs)
|
|
98
|
+
--outer-corner-square-size: var(--md-sys-shape-corner-xs);
|
|
99
|
+
--outer-corner-size: var(--md-sys-shape-corner-xs);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@mixin outer-corner-square-sm {
|
|
103
|
+
// Design override of GM3 v35: outer corner square SM is 8px (corner-sm)
|
|
104
|
+
--outer-corner-square-size: var(--md-sys-shape-corner-sm);
|
|
105
|
+
--outer-corner-size: var(--md-sys-shape-corner-sm);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@mixin outer-corner-square-md {
|
|
109
|
+
// Design override of GM3 v35: outer corner square MD is 8px (corner-sm)
|
|
110
|
+
--outer-corner-square-size: var(--md-sys-shape-corner-sm);
|
|
111
|
+
--outer-corner-size: var(--md-sys-shape-corner-sm);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@mixin outer-corner-square-lg {
|
|
115
|
+
// Design override of GM3 v35: outer corner square LG is 16px (corner-lg)
|
|
116
|
+
--outer-corner-square-size: var(--md-sys-shape-corner-lg);
|
|
117
|
+
--outer-corner-size: var(--md-sys-shape-corner-lg);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@mixin outer-corner-square-xl {
|
|
121
|
+
// Design override of GM3 v35: outer corner square XL is 20px (corner-lg-increased)
|
|
122
|
+
--outer-corner-square-size: var(--md-sys-shape-corner-lg-increased);
|
|
123
|
+
--outer-corner-size: var(--md-sys-shape-corner-lg-increased);
|
|
124
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CSSResultOrNative, LitElement, PropertyValues } from 'lit';
|
|
7
|
+
import { type ButtonElement } from '../button/button-element.js';
|
|
8
|
+
import { type ButtonGroupSelection, type ButtonGroupVariant } from './button-group.js';
|
|
9
|
+
declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>;
|
|
10
|
+
/**
|
|
11
|
+
* A Material Design button group component.
|
|
12
|
+
*
|
|
13
|
+
* @slot - Used to display buttons.
|
|
14
|
+
* @fires {InputEvent} input - Fired when selection changes. --bubbles --composed
|
|
15
|
+
* @fires {Event} change - Fired when selection changes. --bubbles
|
|
16
|
+
* @cssprop --between-space
|
|
17
|
+
* @cssprop --pressed-item-size
|
|
18
|
+
* @cssprop --pressed-item-width-multiplier
|
|
19
|
+
* @cssprop --motion-spring-fast-spatial
|
|
20
|
+
* @cssprop --motion-spring-fast-spatial-duration
|
|
21
|
+
* @cssprop --inner-corner-size
|
|
22
|
+
* @cssprop --pressed-inner-corner-size
|
|
23
|
+
* @cssprop --outer-corner-size
|
|
24
|
+
* @cssprop --outer-corner-square-size
|
|
25
|
+
*/
|
|
26
|
+
export declare class ButtonGroupElement extends baseClass {
|
|
27
|
+
/** @nocollapse */
|
|
28
|
+
static styles: CSSResultOrNative[];
|
|
29
|
+
constructor();
|
|
30
|
+
/** The visual variant of the button group. */
|
|
31
|
+
variant: ButtonGroupVariant;
|
|
32
|
+
/** The selection mode. */
|
|
33
|
+
selection: ButtonGroupSelection;
|
|
34
|
+
/** Whether selection is required in single-select mode. */
|
|
35
|
+
required: boolean;
|
|
36
|
+
/** Whether the button group is disabled. */
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
private readonly assignedElementsList;
|
|
39
|
+
private readonly groupDisabledButtons;
|
|
40
|
+
private readonly pressedSizeStyleSheet;
|
|
41
|
+
private readonly childObserver;
|
|
42
|
+
/** Returns all child `md-gb-button` elements. */
|
|
43
|
+
get buttons(): ButtonElement[];
|
|
44
|
+
/** Returns currently selected buttons. */
|
|
45
|
+
get selectedButtons(): ButtonElement[];
|
|
46
|
+
/** Returns index of first selected button or -1. */
|
|
47
|
+
get selectedIndex(): number;
|
|
48
|
+
/** Returns indices of all selected buttons. */
|
|
49
|
+
get selectedIndices(): number[];
|
|
50
|
+
/** Value of the currently selected button (or first selected). */
|
|
51
|
+
get value(): string;
|
|
52
|
+
/** Silent setter for single-select mode. */
|
|
53
|
+
set value(val: string);
|
|
54
|
+
/** Values of all currently selected buttons. */
|
|
55
|
+
get values(): string[];
|
|
56
|
+
connectedCallback(): void;
|
|
57
|
+
disconnectedCallback(): void;
|
|
58
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
59
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
60
|
+
private syncSelectionFromChild;
|
|
61
|
+
private syncButtonsDisabledAndType;
|
|
62
|
+
private normalizeGroupSelection;
|
|
63
|
+
private syncPressedButtonSize;
|
|
64
|
+
private observeChildren;
|
|
65
|
+
protected handleSlotChange(): void;
|
|
66
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
|
|
10
|
+
import { adoptStyles } from '../../styles/adopt-styles.js';
|
|
11
|
+
import { updateClassList } from '../shared/update-class-list.js';
|
|
12
|
+
import { buttonGroupClasses, normalizeSelection, shouldBlockToggle, } from './button-group.js';
|
|
13
|
+
import buttonGroupStyles from './button-group.css' with { type: 'css' }; // github-only
|
|
14
|
+
// import buttonGroupStyles from './button-group.cssresult.js'; // google3-only
|
|
15
|
+
// Separate variable needed for closure.
|
|
16
|
+
const baseClass = mixinElementInternals(LitElement);
|
|
17
|
+
/**
|
|
18
|
+
* A Material Design button group component.
|
|
19
|
+
*
|
|
20
|
+
* @slot - Used to display buttons.
|
|
21
|
+
* @fires {InputEvent} input - Fired when selection changes. --bubbles --composed
|
|
22
|
+
* @fires {Event} change - Fired when selection changes. --bubbles
|
|
23
|
+
* @cssprop --between-space
|
|
24
|
+
* @cssprop --pressed-item-size
|
|
25
|
+
* @cssprop --pressed-item-width-multiplier
|
|
26
|
+
* @cssprop --motion-spring-fast-spatial
|
|
27
|
+
* @cssprop --motion-spring-fast-spatial-duration
|
|
28
|
+
* @cssprop --inner-corner-size
|
|
29
|
+
* @cssprop --pressed-inner-corner-size
|
|
30
|
+
* @cssprop --outer-corner-size
|
|
31
|
+
* @cssprop --outer-corner-square-size
|
|
32
|
+
*/
|
|
33
|
+
export class ButtonGroupElement extends baseClass {
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
/** The visual variant of the button group. */
|
|
37
|
+
this.variant = 'standard';
|
|
38
|
+
/** The selection mode. */
|
|
39
|
+
this.selection = 'none';
|
|
40
|
+
/** Whether selection is required in single-select mode. */
|
|
41
|
+
this.required = false;
|
|
42
|
+
/** Whether the button group is disabled. */
|
|
43
|
+
this.disabled = false;
|
|
44
|
+
this.groupDisabledButtons = new WeakSet();
|
|
45
|
+
this.pressedSizeStyleSheet = new CSSStyleSheet();
|
|
46
|
+
this.childObserver = new MutationObserver((mutations) => {
|
|
47
|
+
for (const mutation of mutations) {
|
|
48
|
+
if (mutation.attributeName === 'class') {
|
|
49
|
+
this.syncPressedButtonSize();
|
|
50
|
+
}
|
|
51
|
+
else if (mutation.attributeName === 'selected') {
|
|
52
|
+
const target = mutation.target;
|
|
53
|
+
if (this.selection === 'single') {
|
|
54
|
+
if (target.selected) {
|
|
55
|
+
this.normalizeGroupSelection({ preferred: target });
|
|
56
|
+
}
|
|
57
|
+
else if (this.required) {
|
|
58
|
+
const anySelected = this.buttons.some((b) => b.selected);
|
|
59
|
+
if (!anySelected) {
|
|
60
|
+
this.normalizeGroupSelection();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
this[internals].role = 'toolbar';
|
|
68
|
+
const handlePointerDown = (event) => {
|
|
69
|
+
const path = event.composedPath();
|
|
70
|
+
const button = this.buttons.find((b) => path.includes(b));
|
|
71
|
+
this.syncPressedButtonSize(button ?? null);
|
|
72
|
+
};
|
|
73
|
+
const handlePointerEnd = () => {
|
|
74
|
+
this.syncPressedButtonSize(null);
|
|
75
|
+
};
|
|
76
|
+
const handleClick = (event) => {
|
|
77
|
+
const path = event.composedPath();
|
|
78
|
+
const button = this.buttons.find((b) => path.includes(b));
|
|
79
|
+
if (!button)
|
|
80
|
+
return;
|
|
81
|
+
if (button.disabled || button.softDisabled) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
event.stopImmediatePropagation();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const index = this.buttons.indexOf(button);
|
|
87
|
+
if (shouldBlockToggle(this.buttons, index, {
|
|
88
|
+
selection: this.selection,
|
|
89
|
+
required: this.required,
|
|
90
|
+
})) {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const handleInput = (event) => {
|
|
95
|
+
if (event.target === this)
|
|
96
|
+
return;
|
|
97
|
+
const path = event.composedPath();
|
|
98
|
+
const child = this.buttons.find((b) => path.includes(b));
|
|
99
|
+
if (!child || child.disabled || child.softDisabled)
|
|
100
|
+
return;
|
|
101
|
+
event.stopImmediatePropagation();
|
|
102
|
+
this.syncSelectionFromChild(child);
|
|
103
|
+
this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
|
|
104
|
+
};
|
|
105
|
+
const handleChange = (event) => {
|
|
106
|
+
if (event.target === this)
|
|
107
|
+
return;
|
|
108
|
+
const path = event.composedPath();
|
|
109
|
+
const child = this.buttons.find((b) => path.includes(b));
|
|
110
|
+
if (!child || child.disabled || child.softDisabled)
|
|
111
|
+
return;
|
|
112
|
+
event.stopImmediatePropagation();
|
|
113
|
+
this.syncSelectionFromChild(child);
|
|
114
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
115
|
+
};
|
|
116
|
+
this.addEventListener('pointerdown', handlePointerDown);
|
|
117
|
+
this.addEventListener('pointerup', handlePointerEnd);
|
|
118
|
+
this.addEventListener('pointercancel', handlePointerEnd);
|
|
119
|
+
this.addEventListener('pointerleave', handlePointerEnd);
|
|
120
|
+
this.addEventListener('click', handleClick);
|
|
121
|
+
this.addEventListener('input', handleInput);
|
|
122
|
+
this.addEventListener('change', handleChange);
|
|
123
|
+
}
|
|
124
|
+
/** Returns all child `md-gb-button` elements. */
|
|
125
|
+
get buttons() {
|
|
126
|
+
return this.assignedElementsList.filter((node) => node.localName === 'md-gb-button');
|
|
127
|
+
}
|
|
128
|
+
/** Returns currently selected buttons. */
|
|
129
|
+
get selectedButtons() {
|
|
130
|
+
return this.buttons.filter((b) => b.selected);
|
|
131
|
+
}
|
|
132
|
+
/** Returns index of first selected button or -1. */
|
|
133
|
+
get selectedIndex() {
|
|
134
|
+
return this.buttons.findIndex((b) => b.selected);
|
|
135
|
+
}
|
|
136
|
+
/** Returns indices of all selected buttons. */
|
|
137
|
+
get selectedIndices() {
|
|
138
|
+
const indices = [];
|
|
139
|
+
const buttons = this.buttons;
|
|
140
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
141
|
+
if (buttons[i].selected) {
|
|
142
|
+
indices.push(i);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return indices;
|
|
146
|
+
}
|
|
147
|
+
/** Value of the currently selected button (or first selected). */
|
|
148
|
+
get value() {
|
|
149
|
+
return this.selectedButtons[0]?.value ?? '';
|
|
150
|
+
}
|
|
151
|
+
/** Silent setter for single-select mode. */
|
|
152
|
+
set value(val) {
|
|
153
|
+
if (this.selection !== 'single')
|
|
154
|
+
return;
|
|
155
|
+
for (const b of this.buttons) {
|
|
156
|
+
b.selected = b.value === val;
|
|
157
|
+
}
|
|
158
|
+
this.normalizeGroupSelection();
|
|
159
|
+
}
|
|
160
|
+
/** Values of all currently selected buttons. */
|
|
161
|
+
get values() {
|
|
162
|
+
return this.selectedButtons.map((b) => b.value);
|
|
163
|
+
}
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
super.connectedCallback();
|
|
166
|
+
adoptStyles(this, buttonGroupStyles);
|
|
167
|
+
adoptStyles(this.shadowRoot, this.pressedSizeStyleSheet);
|
|
168
|
+
updateClassList(this, buttonGroupClasses({
|
|
169
|
+
variant: this.variant,
|
|
170
|
+
disabled: this.disabled,
|
|
171
|
+
}));
|
|
172
|
+
if (this.hasUpdated) {
|
|
173
|
+
this.observeChildren();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
disconnectedCallback() {
|
|
177
|
+
super.disconnectedCallback();
|
|
178
|
+
this.childObserver.disconnect();
|
|
179
|
+
}
|
|
180
|
+
firstUpdated(changedProperties) {
|
|
181
|
+
super.firstUpdated(changedProperties);
|
|
182
|
+
adoptStyles(this.shadowRoot, this.pressedSizeStyleSheet);
|
|
183
|
+
this.syncButtonsDisabledAndType();
|
|
184
|
+
this.normalizeGroupSelection();
|
|
185
|
+
this.observeChildren();
|
|
186
|
+
}
|
|
187
|
+
updated(changedProperties) {
|
|
188
|
+
super.updated(changedProperties);
|
|
189
|
+
if (!this.hasAttribute('focusgroup')) {
|
|
190
|
+
this.setAttribute('focusgroup', 'toolbar wrap inline');
|
|
191
|
+
}
|
|
192
|
+
if (changedProperties.has('variant') || changedProperties.has('disabled')) {
|
|
193
|
+
updateClassList(this, buttonGroupClasses({
|
|
194
|
+
variant: this.variant,
|
|
195
|
+
disabled: this.disabled,
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
if (changedProperties.has('selection') ||
|
|
199
|
+
changedProperties.has('disabled')) {
|
|
200
|
+
this.syncButtonsDisabledAndType();
|
|
201
|
+
}
|
|
202
|
+
if (changedProperties.has('selection') ||
|
|
203
|
+
changedProperties.has('required')) {
|
|
204
|
+
this.normalizeGroupSelection();
|
|
205
|
+
this.observeChildren();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
syncSelectionFromChild(child) {
|
|
209
|
+
// ButtonElement updates its own `selected` property on the `change` event;
|
|
210
|
+
// during an `input` event, the custom element's `selected` property has not
|
|
211
|
+
// yet been updated by its internal listener, so we inspect `aria-pressed` on
|
|
212
|
+
// the inner button element to capture the immediate interactive toggle state.
|
|
213
|
+
const innerBtn = child.shadowRoot?.querySelector('[part="btn"]');
|
|
214
|
+
if (innerBtn) {
|
|
215
|
+
const isPressed = innerBtn.getAttribute('aria-pressed') === 'true' ||
|
|
216
|
+
innerBtn.ariaPressed === 'true';
|
|
217
|
+
child.selected = isPressed;
|
|
218
|
+
}
|
|
219
|
+
if (this.selection === 'single') {
|
|
220
|
+
if (child.selected) {
|
|
221
|
+
for (const button of this.buttons) {
|
|
222
|
+
if (button !== child) {
|
|
223
|
+
button.selected = false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
syncButtonsDisabledAndType() {
|
|
230
|
+
const buttons = this.buttons;
|
|
231
|
+
for (const button of buttons) {
|
|
232
|
+
const hasHref = button.hasAttribute('href') || Boolean(button.href);
|
|
233
|
+
if (!hasHref) {
|
|
234
|
+
const targetType = this.selection === 'none' ? 'button' : 'toggle';
|
|
235
|
+
button.setAttribute('type', targetType);
|
|
236
|
+
}
|
|
237
|
+
if (this.disabled) {
|
|
238
|
+
if (!button.disabled) {
|
|
239
|
+
this.groupDisabledButtons.add(button);
|
|
240
|
+
button.disabled = true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
if (this.groupDisabledButtons.has(button)) {
|
|
245
|
+
this.groupDisabledButtons.delete(button);
|
|
246
|
+
button.disabled = false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
normalizeGroupSelection(options = {}) {
|
|
252
|
+
normalizeSelection(this.buttons, {
|
|
253
|
+
selection: this.selection,
|
|
254
|
+
required: this.required,
|
|
255
|
+
preferred: options.preferred,
|
|
256
|
+
});
|
|
257
|
+
this.childObserver.takeRecords();
|
|
258
|
+
}
|
|
259
|
+
syncPressedButtonSize(pressedButton) {
|
|
260
|
+
if (this.variant === 'connected' || this.disabled) {
|
|
261
|
+
this.pressedSizeStyleSheet.replaceSync('');
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const activeButton = pressedButton !== undefined
|
|
265
|
+
? pressedButton
|
|
266
|
+
: (this.buttons.find((b) => !b.disabled &&
|
|
267
|
+
!b.softDisabled &&
|
|
268
|
+
(b.classList.contains('active') || b.matches(':active'))) ?? null);
|
|
269
|
+
if (!activeButton || activeButton.disabled || activeButton.softDisabled) {
|
|
270
|
+
this.pressedSizeStyleSheet.replaceSync('');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
this.pressedSizeStyleSheet.replaceSync(':host { --pressed-item-width-multiplier: 1 !important; ' +
|
|
274
|
+
'--motion-spring-fast-spatial-duration: 0s !important; }');
|
|
275
|
+
const width = activeButton.getBoundingClientRect().width;
|
|
276
|
+
if (width > 0) {
|
|
277
|
+
this.pressedSizeStyleSheet.replaceSync(`:host { --pressed-item-size: ${width}px !important; }`);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
this.pressedSizeStyleSheet.replaceSync('');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
observeChildren() {
|
|
284
|
+
this.childObserver.disconnect();
|
|
285
|
+
for (const button of this.buttons) {
|
|
286
|
+
this.childObserver.observe(button, {
|
|
287
|
+
attributes: true,
|
|
288
|
+
attributeFilter: ['selected', 'class'],
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
handleSlotChange() {
|
|
293
|
+
this.syncButtonsDisabledAndType();
|
|
294
|
+
const selected = this.buttons.filter((b) => b.selected);
|
|
295
|
+
const preferred = selected[selected.length - 1];
|
|
296
|
+
this.normalizeGroupSelection({ preferred });
|
|
297
|
+
this.observeChildren();
|
|
298
|
+
}
|
|
299
|
+
render() {
|
|
300
|
+
return html `<slot @slotchange=${this.handleSlotChange}></slot>`;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/** @nocollapse */
|
|
304
|
+
ButtonGroupElement.styles = [buttonGroupStyles];
|
|
305
|
+
__decorate([
|
|
306
|
+
property({ reflect: true })
|
|
307
|
+
], ButtonGroupElement.prototype, "variant", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
property({ reflect: true })
|
|
310
|
+
], ButtonGroupElement.prototype, "selection", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ type: Boolean, reflect: true })
|
|
313
|
+
], ButtonGroupElement.prototype, "required", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
property({ type: Boolean, reflect: true })
|
|
316
|
+
], ButtonGroupElement.prototype, "disabled", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
queryAssignedElements({ flatten: true })
|
|
319
|
+
], ButtonGroupElement.prototype, "assignedElementsList", void 0);
|
|
320
|
+
//# sourceMappingURL=button-group-element.js.map
|