@material/web 2.5.1-nightly.12ec888.0 → 2.5.1-nightly.161d032.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 +23 -2
- package/button/internal/button.js.map +1 -1
- package/chips/internal/assist-chip.d.ts +10 -0
- package/chips/internal/assist-chip.js +20 -1
- 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/input-chip.d.ts +10 -0
- package/chips/internal/input-chip.js +20 -1
- package/chips/internal/input-chip.js.map +1 -1
- package/custom-elements.json +13461 -3842
- package/iconbutton/internal/icon-button.d.ts +10 -0
- package/iconbutton/internal/icon-button.js +21 -2
- package/iconbutton/internal/icon-button.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 +23 -21
- package/labs/gb/components/button/button-element.d.ts +20 -14
- package/labs/gb/components/button/button-element.js +48 -73
- 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 +14 -9
- package/labs/gb/components/buttongroup/_button-group-tokens.scss +123 -0
- package/labs/gb/components/buttongroup/button-group-element.d.ts +65 -0
- package/labs/gb/components/buttongroup/button-group-element.js +277 -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 +282 -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 +5 -59
- 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 +1 -0
- 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 +2 -0
- 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-element.d.ts +1 -0
- package/labs/gb/components/fab/fab-element.js +1 -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 +1 -0
- 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 +39 -5
- 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-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 +1 -0
- package/labs/gb/components/list/list-item-element.js +1 -0
- 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 +2 -0
- 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 +1 -0
- package/labs/gb/components/menu/menu-item-element.js +1 -0
- 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 +2 -0
- package/labs/gb/components/navbar/_nav-bar-tokens.scss +53 -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 +58 -0
- package/labs/gb/components/navbar/nav-bar-element.js +116 -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 +146 -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 +296 -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 +978 -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 +173 -0
- package/labs/gb/components/slider/slider.js +502 -0
- package/labs/gb/components/slider/slider.js.map +1 -0
- package/labs/gb/components/slider/slider.scss +689 -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 +1 -0
- 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/list/internal/listitem/list-item.d.ts +10 -0
- package/list/internal/listitem/list-item.js +20 -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 +20 -1
- package/menu/internal/menuitem/menu-item.js.map +1 -1
- package/package.json +2 -1
- package/radio/internal/single-selection-controller.js +4 -1
- package/radio/internal/single-selection-controller.js.map +1 -1
- package/testing/harness.js +3 -0
- package/testing/harness.js.map +1 -1
- package/types/command-event.d.ts +34 -0
- package/types/popover.d.ts +25 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.cssresult.js","sourceRoot":"","sources":["tabs.cssresult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+DAA+D;AAC/D,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/tabs/tabs.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, md.comp.badge;@layer md.comp.tabs{.tabs{--active-indicator-color: var(--md-sys-color-primary);--active-indicator-height: 3px;--active-indicator-shape: 50cqmin 50cqmin 0 0;--active-indicator-min-length: 24px;--active-indicator-inset: 2px;--icon-label-space: 8px;--stacked-icon-label-space: 2px;--badge-space: 4px;--icon-badge-inset: 6px;--container-color: var(--md-sys-color-surface);--container-height: 48px;--container-shape: var(--md-sys-shape-corner-none);--divider-color: var(--md-sys-color-outline-variant, #c4c7c5);--divider-thickness: 1px;--focus-indicator-inset: 3px;--focus-indicator-shape: 12px;--focus-indicator-clearance: 5px;--leading-space: 16px;--tab-scroll-margin: var(--leading-space);--trailing-space: 16px;--icon-color: var(--md-sys-color-on-surface-variant);--icon-size: 24px;--label-text: var(--md-sys-typescale-title-sm);--label-text-axes: var(--md-sys-typescale-title-sm-axes);--label-text-color: var(--md-sys-color-on-surface-variant);--label-text-tracking: var(--md-sys-typescale-title-sm-tracking)}.tabs.tabs-secondary{--active-indicator-color: var(--md-sys-color-primary);--active-indicator-height: 2px;--active-indicator-shape: 0;--container-color: var(--md-sys-color-surface);--container-height: 48px;--container-shape: var(--md-sys-shape-corner-none);--icon-color: var(--md-sys-color-on-surface-variant);--icon-size: 24px;--label-text: var(--md-sys-typescale-title-sm);--label-text-axes: var(--md-sys-typescale-title-sm-axes);--label-text-color: var(--md-sys-color-on-surface-variant);--label-text-tracking: var(--md-sys-typescale-title-sm-tracking);--tabs-secondary: true}.tabs{display:flex;flex-direction:row;position:relative;box-sizing:border-box;background-color:var(--container-color);border-radius:var(--container-shape);min-block-size:var(--container-height);border-block-end:var(--divider-thickness) solid var(--divider-color);overflow-inline:auto;overflow-block:hidden;overscroll-behavior-inline:contain;scrollbar-width:none;anchor-scope:--tab,--tab-content-start,--tab-content-end}.tab{display:flex;position:relative;anchor-scope:--tab-icon;flex:1 1 0;align-items:center;justify-content:center;gap:var(--icon-label-space);box-sizing:border-box;min-block-size:calc(var(--container-height) - var(--divider-thickness));padding-inline:var(--leading-space) var(--trailing-space);padding-block:0;border:none;background-color:rgba(0,0,0,0);cursor:pointer;user-select:none;scroll-margin-inline:var(--tab-scroll-margin, var(--leading-space, 16px));white-space:nowrap;text-align:center;color:var(--label-text-color);font:var(--label-text);letter-spacing:var(--label-text-tracking);font-variation-settings:var(--label-text-axes);outline:none;--md-icon-color: var(--icon-color);--md-icon-size: var(--icon-size)}@container not style(--tabs-secondary: true){.tab:has(>.md-icon):has(>:is(.tab-label,[slot=label])){--container-height: 64px;flex-direction:column;gap:var(--stacked-icon-label-space)}}@container not style(--tabs-secondary: true){.tab:has(>.md-icon)>.md-icon{anchor-name:--tab-icon}.tab:has(>.md-icon)>.tab-badge{position:absolute;position-anchor:--tab-icon;inset-block-start:anchor(start);inset-inline-start:calc(anchor(end) - var(--icon-badge-inset));margin-inline-start:0}}.tab>:is(.tab-label,[slot=label]){min-inline-size:var(--active-indicator-min-length)}.tab-badge{margin-inline-start:calc(var(--badge-space) - var(--icon-label-space))}.tab:is(.selected,[aria-selected=true],:state(selected)){--icon-color: var(--md-sys-color-primary);--label-text-color: var(--md-sys-color-primary);anchor-name:--tab}@container style(--tabs-secondary: true){.tab:is(.selected,[aria-selected=true],:state(selected)){--icon-color: var(--md-sys-color-on-surface);--label-text-color: var(--md-sys-color-on-surface)}}.tab:is(:hover,.hover):not(:is(.selected,[aria-selected=true],:state(selected))){--icon-color: var(--md-sys-color-on-surface);--label-text-color: var(--md-sys-color-on-surface)}.tab:is(:focus-visible,.focus):not(:is(.selected,[aria-selected=true],:state(selected))){--icon-color: var(--md-sys-color-on-surface);--label-text-color: var(--md-sys-color-on-surface)}.tab:is(:active,.active):not(:is(.selected,[aria-selected=true],:state(selected))){--icon-color: var(--md-sys-color-on-surface);--label-text-color: var(--md-sys-color-on-surface)}.tab::before{content:\"\";position:absolute;inset:var(--focus-indicator-inset);border-radius:var(--focus-indicator-shape);outline:var(--focus-ring-outline);outline-offset:var(--focus-ring-offset);animation:var(--focus-ring-animation, none);pointer-events:none}.tab:is(.selected,[aria-selected=true],:state(selected))::before{inset-block-end:calc(var(--active-indicator-height) + var(--focus-indicator-clearance))}.tab:is(.selected,[aria-selected=true],:state(selected)):not(:has(>.md-icon))>:first-child{anchor-name:--tab-content-start}.tab:is(.selected,[aria-selected=true],:state(selected)):not(:has(>.md-icon))>:last-child{anchor-name:--tab-content-end}.tab:is(.selected,[aria-selected=true],:state(selected)):not(:has(>.md-icon))>:only-child{anchor-name:--tab-content-start,--tab-content-end}.tab:is(.selected,[aria-selected=true],:state(selected)):not(:has(>.md-icon):has(>:is(.tab-label,[slot=label])))>.md-icon{anchor-name:--tab-icon,--tab-content-start,--tab-content-end}.tab:is(.selected,[aria-selected=true],:state(selected)):has(>.md-icon):has(>:is(.tab-label,[slot=label]))>:is(.tab-label,[slot=label]){anchor-name:--tab-content-start,--tab-content-end}slot.tab-label{display:contents}.tabs::after{content:\"\";position:absolute;inset-block-end:0;block-size:var(--active-indicator-height);background-color:var(--active-indicator-color);border-radius:var(--active-indicator-shape);inset-inline:calc(anchor(--tab-content-start start) + var(--active-indicator-inset)) calc(anchor(--tab-content-end end) + var(--active-indicator-inset));transition:inset var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-emphasized)}.tabs-secondary::after{inset-inline:anchor(--tab start) anchor(--tab end)}.tabs:not(:has(>.tab:is(.selected,[aria-selected=true],:state(selected))))::after{display:none}@media(prefers-reduced-motion: reduce){.tabs::after{transition:none}}}\n`;\nexport default styles.styleSheet!;\n"]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { type ClassInfo } from 'lit/directives/class-map.js';
|
|
7
|
+
/** The visual variant of a tabs container. */
|
|
8
|
+
export type TabsVariant = 'primary' | 'secondary';
|
|
9
|
+
/** Tabs classes. */
|
|
10
|
+
export declare const TABS_CLASSES: {
|
|
11
|
+
readonly tabs: "tabs";
|
|
12
|
+
readonly tabsSecondary: "tabs-secondary";
|
|
13
|
+
};
|
|
14
|
+
/** The state provided to the `tabsClasses()` function. */
|
|
15
|
+
export interface TabsClassesState {
|
|
16
|
+
/** The visual variant of the tabs. Defaults to `'primary'`. */
|
|
17
|
+
variant?: TabsVariant;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the tabs classes to apply to an element based on the given state.
|
|
21
|
+
*
|
|
22
|
+
* @param state The state of the tabs.
|
|
23
|
+
* @return An object of class names and truthy values if they apply.
|
|
24
|
+
*/
|
|
25
|
+
export declare function tabsClasses({ variant, }?: TabsClassesState): ClassInfo;
|
|
26
|
+
/**
|
|
27
|
+
* Sets up tabs functionality for the given element.
|
|
28
|
+
*
|
|
29
|
+
* @param tabsElement The element on which to set up tabs functionality.
|
|
30
|
+
* @param opts Setup options, supports a cleanup `signal`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function setupTabs(tabsElement: HTMLElement, opts?: {
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
}): void;
|
|
35
|
+
/**
|
|
36
|
+
* A Lit directive that adds tabs styling to its element.
|
|
37
|
+
*
|
|
38
|
+
* The element is responsible for its own ARIA: add `role="tablist"` and
|
|
39
|
+
* `focusgroup="tablist inline"` when not using `<md-gb-tabs>`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* html`
|
|
44
|
+
* <div class="${tabs()}" role="tablist" focusgroup="tablist inline">
|
|
45
|
+
* <button class="${tab({selected: true})}" role="tab" aria-selected="true">
|
|
46
|
+
* <span class="tab-label">Tab 1</span>
|
|
47
|
+
* </button>
|
|
48
|
+
* <button class="${tab()}" role="tab" aria-selected="false">
|
|
49
|
+
* <span class="tab-label">Tab 2</span>
|
|
50
|
+
* </button>
|
|
51
|
+
* </div>
|
|
52
|
+
* `;
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const tabs: (state?: TabsClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
|
|
56
|
+
/** Tab classes. */
|
|
57
|
+
export declare const TAB_CLASSES: {
|
|
58
|
+
readonly tab: "tab";
|
|
59
|
+
readonly tabLabel: "tab-label";
|
|
60
|
+
readonly tabBadge: "tab-badge";
|
|
61
|
+
readonly selected: "selected";
|
|
62
|
+
readonly focusRingInner: string;
|
|
63
|
+
readonly ripple: string;
|
|
64
|
+
};
|
|
65
|
+
/** The state provided to the `tabClasses()` function. */
|
|
66
|
+
export interface TabClassesState {
|
|
67
|
+
/** Whether the tab is selected. */
|
|
68
|
+
selected?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the tab classes to apply to an element based on the given state.
|
|
72
|
+
*
|
|
73
|
+
* `<md-gb-tab>` does not use this function: it emits `:state(selected)`, which
|
|
74
|
+
* the stylesheet matches alongside `.selected` and `[aria-selected="true"]`.
|
|
75
|
+
*
|
|
76
|
+
* @param state The state of the tab.
|
|
77
|
+
* @return An object of class names and truthy values if they apply.
|
|
78
|
+
*/
|
|
79
|
+
export declare function tabClasses({ selected, }?: TabClassesState): ClassInfo;
|
|
80
|
+
/**
|
|
81
|
+
* A Lit directive that adds tab styling to its element.
|
|
82
|
+
*
|
|
83
|
+
* Labels must be marked up with `class="tab-label"` (or `slot="label"` inside
|
|
84
|
+
* `<md-gb-tab>`). Bare text is not a supported authoring form. Icons are
|
|
85
|
+
* unclassed children; the tab sets `--md-icon-*` for them.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* // Applies class="tab focus-ring-inner ripple [selected]"
|
|
90
|
+
* html`
|
|
91
|
+
* <button class="${tab({selected})}" role="tab" aria-selected="${selected}">
|
|
92
|
+
* <md-gb-icon>flight</md-gb-icon>
|
|
93
|
+
* <span class="tab-label">Flights</span>
|
|
94
|
+
* </button>
|
|
95
|
+
* `;
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare const tab: (state?: TabClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FOCUS_RING_CLASSES } from '../focus/focus-ring.js';
|
|
7
|
+
import { RIPPLE_CLASSES } from '../ripple/ripple.js';
|
|
8
|
+
import { createClassMapDirective } from '../shared/directives.js';
|
|
9
|
+
/** Tabs classes. */
|
|
10
|
+
export const TABS_CLASSES = {
|
|
11
|
+
tabs: 'tabs',
|
|
12
|
+
tabsSecondary: 'tabs-secondary',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Returns the tabs classes to apply to an element based on the given state.
|
|
16
|
+
*
|
|
17
|
+
* @param state The state of the tabs.
|
|
18
|
+
* @return An object of class names and truthy values if they apply.
|
|
19
|
+
*/
|
|
20
|
+
export function tabsClasses({ variant = 'primary', } = {}) {
|
|
21
|
+
return {
|
|
22
|
+
[TABS_CLASSES.tabs]: true,
|
|
23
|
+
[TABS_CLASSES.tabsSecondary]: variant === 'secondary',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets up tabs functionality for the given element.
|
|
28
|
+
*
|
|
29
|
+
* @param tabsElement The element on which to set up tabs functionality.
|
|
30
|
+
* @param opts Setup options, supports a cleanup `signal`.
|
|
31
|
+
*/
|
|
32
|
+
export function setupTabs(tabsElement, opts) {
|
|
33
|
+
tabsElement.addEventListener('focusin', (event) => {
|
|
34
|
+
const target = event.target;
|
|
35
|
+
if (!(target instanceof Element) || target === tabsElement) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
target.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
39
|
+
}, opts);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A Lit directive that adds tabs styling to its element.
|
|
43
|
+
*
|
|
44
|
+
* The element is responsible for its own ARIA: add `role="tablist"` and
|
|
45
|
+
* `focusgroup="tablist inline"` when not using `<md-gb-tabs>`.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* html`
|
|
50
|
+
* <div class="${tabs()}" role="tablist" focusgroup="tablist inline">
|
|
51
|
+
* <button class="${tab({selected: true})}" role="tab" aria-selected="true">
|
|
52
|
+
* <span class="tab-label">Tab 1</span>
|
|
53
|
+
* </button>
|
|
54
|
+
* <button class="${tab()}" role="tab" aria-selected="false">
|
|
55
|
+
* <span class="tab-label">Tab 2</span>
|
|
56
|
+
* </button>
|
|
57
|
+
* </div>
|
|
58
|
+
* `;
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export const tabs = createClassMapDirective({
|
|
62
|
+
getClasses: tabsClasses,
|
|
63
|
+
setupElement: setupTabs,
|
|
64
|
+
});
|
|
65
|
+
/** Tab classes. */
|
|
66
|
+
export const TAB_CLASSES = {
|
|
67
|
+
tab: 'tab',
|
|
68
|
+
tabLabel: 'tab-label',
|
|
69
|
+
tabBadge: 'tab-badge',
|
|
70
|
+
selected: 'selected',
|
|
71
|
+
focusRingInner: FOCUS_RING_CLASSES.focusRingInner,
|
|
72
|
+
ripple: RIPPLE_CLASSES.ripple,
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Returns the tab classes to apply to an element based on the given state.
|
|
76
|
+
*
|
|
77
|
+
* `<md-gb-tab>` does not use this function: it emits `:state(selected)`, which
|
|
78
|
+
* the stylesheet matches alongside `.selected` and `[aria-selected="true"]`.
|
|
79
|
+
*
|
|
80
|
+
* @param state The state of the tab.
|
|
81
|
+
* @return An object of class names and truthy values if they apply.
|
|
82
|
+
*/
|
|
83
|
+
export function tabClasses({ selected = false, } = {}) {
|
|
84
|
+
return {
|
|
85
|
+
[TAB_CLASSES.tab]: true,
|
|
86
|
+
[TAB_CLASSES.focusRingInner]: true,
|
|
87
|
+
[TAB_CLASSES.ripple]: true,
|
|
88
|
+
[TAB_CLASSES.selected]: selected,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A Lit directive that adds tab styling to its element.
|
|
93
|
+
*
|
|
94
|
+
* Labels must be marked up with `class="tab-label"` (or `slot="label"` inside
|
|
95
|
+
* `<md-gb-tab>`). Bare text is not a supported authoring form. Icons are
|
|
96
|
+
* unclassed children; the tab sets `--md-icon-*` for them.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* // Applies class="tab focus-ring-inner ripple [selected]"
|
|
101
|
+
* html`
|
|
102
|
+
* <button class="${tab({selected})}" role="tab" aria-selected="${selected}">
|
|
103
|
+
* <md-gb-icon>flight</md-gb-icon>
|
|
104
|
+
* <span class="tab-label">Flights</span>
|
|
105
|
+
* </button>
|
|
106
|
+
* `;
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export const tab = createClassMapDirective({
|
|
110
|
+
getClasses: tabClasses,
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAKhE,oBAAoB;AACpB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,gBAAgB;CACvB,CAAC;AAQX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,OAAO,GAAG,SAAS,MACC,EAAE;IACtB,OAAO;QACL,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI;QACzB,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,OAAO,KAAK,WAAW;KACtD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACvB,WAAwB,EACxB,IAA6B;IAE7B,WAAW,CAAC,gBAAgB,CAC1B,SAAS,EACT,CAAC,KAAY,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3D,OAAO;QACT,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAC,CAAC,CAAC;IAC/D,CAAC,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,uBAAuB,CAAC;IAC1C,UAAU,EAAE,WAAW;IACvB,YAAY,EAAE,SAAS;CACxB,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,kBAAkB,CAAC,cAAc;IACjD,MAAM,EAAE,cAAc,CAAC,MAAM;CACrB,CAAC;AAQX;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,GAAG,KAAK,MACG,EAAE;IACrB,OAAO;QACL,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI;QACvB,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI;QAClC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI;QAC1B,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ;KACjC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,uBAAuB,CAAC;IACzC,UAAU,EAAE,UAAU;CACvB,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 {FOCUS_RING_CLASSES} from '../focus/focus-ring.js';\nimport {RIPPLE_CLASSES} from '../ripple/ripple.js';\nimport {createClassMapDirective} from '../shared/directives.js';\n\n/** The visual variant of a tabs container. */\nexport type TabsVariant = 'primary' | 'secondary';\n\n/** Tabs classes. */\nexport const TABS_CLASSES = {\n tabs: 'tabs',\n tabsSecondary: 'tabs-secondary',\n} as const;\n\n/** The state provided to the `tabsClasses()` function. */\nexport interface TabsClassesState {\n /** The visual variant of the tabs. Defaults to `'primary'`. */\n variant?: TabsVariant;\n}\n\n/**\n * Returns the tabs classes to apply to an element based on the given state.\n *\n * @param state The state of the tabs.\n * @return An object of class names and truthy values if they apply.\n */\nexport function tabsClasses({\n variant = 'primary',\n}: TabsClassesState = {}): ClassInfo {\n return {\n [TABS_CLASSES.tabs]: true,\n [TABS_CLASSES.tabsSecondary]: variant === 'secondary',\n };\n}\n\n/**\n * Sets up tabs functionality for the given element.\n *\n * @param tabsElement The element on which to set up tabs functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupTabs(\n tabsElement: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n tabsElement.addEventListener(\n 'focusin',\n (event: Event) => {\n const target = event.target;\n if (!(target instanceof Element) || target === tabsElement) {\n return;\n }\n\n target.scrollIntoView({block: 'nearest', inline: 'nearest'});\n },\n opts,\n );\n}\n\n/**\n * A Lit directive that adds tabs styling to its element.\n *\n * The element is responsible for its own ARIA: add `role=\"tablist\"` and\n * `focusgroup=\"tablist inline\"` when not using `<md-gb-tabs>`.\n *\n * @example\n * ```ts\n * html`\n * <div class=\"${tabs()}\" role=\"tablist\" focusgroup=\"tablist inline\">\n * <button class=\"${tab({selected: true})}\" role=\"tab\" aria-selected=\"true\">\n * <span class=\"tab-label\">Tab 1</span>\n * </button>\n * <button class=\"${tab()}\" role=\"tab\" aria-selected=\"false\">\n * <span class=\"tab-label\">Tab 2</span>\n * </button>\n * </div>\n * `;\n * ```\n */\nexport const tabs = createClassMapDirective({\n getClasses: tabsClasses,\n setupElement: setupTabs,\n});\n\n/** Tab classes. */\nexport const TAB_CLASSES = {\n tab: 'tab',\n tabLabel: 'tab-label',\n tabBadge: 'tab-badge',\n selected: 'selected',\n focusRingInner: FOCUS_RING_CLASSES.focusRingInner,\n ripple: RIPPLE_CLASSES.ripple,\n} as const;\n\n/** The state provided to the `tabClasses()` function. */\nexport interface TabClassesState {\n /** Whether the tab is selected. */\n selected?: boolean;\n}\n\n/**\n * Returns the tab classes to apply to an element based on the given state.\n *\n * `<md-gb-tab>` does not use this function: it emits `:state(selected)`, which\n * the stylesheet matches alongside `.selected` and `[aria-selected=\"true\"]`.\n *\n * @param state The state of the tab.\n * @return An object of class names and truthy values if they apply.\n */\nexport function tabClasses({\n selected = false,\n}: TabClassesState = {}): ClassInfo {\n return {\n [TAB_CLASSES.tab]: true,\n [TAB_CLASSES.focusRingInner]: true,\n [TAB_CLASSES.ripple]: true,\n [TAB_CLASSES.selected]: selected,\n };\n}\n\n/**\n * A Lit directive that adds tab styling to its element.\n *\n * Labels must be marked up with `class=\"tab-label\"` (or `slot=\"label\"` inside\n * `<md-gb-tab>`). Bare text is not a supported authoring form. Icons are\n * unclassed children; the tab sets `--md-icon-*` for them.\n *\n * @example\n * ```ts\n * // Applies class=\"tab focus-ring-inner ripple [selected]\"\n * html`\n * <button class=\"${tab({selected})}\" role=\"tab\" aria-selected=\"${selected}\">\n * <md-gb-icon>flight</md-gb-icon>\n * <span class=\"tab-label\">Flights</span>\n * </button>\n * `;\n * ```\n */\nexport const tab = createClassMapDirective({\n getClasses: tabClasses,\n});\n"]}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 Google LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// go/keep-sorted start by_regex='(.+) prefix_order=sass:
|
|
7
|
+
@use 'tabs-tokens';
|
|
8
|
+
// go/keep-sorted end
|
|
9
|
+
|
|
10
|
+
// Selection has three authoring forms. `:state(selected)` is the arm that fires
|
|
11
|
+
// in element mode: AriaTabElement's setter writes `internals.ariaSelected`,
|
|
12
|
+
// which is an AOM property and never produces an attribute. The attribute arm
|
|
13
|
+
// serves hand-authored light DOM. `.active` means PRESSED in this component and
|
|
14
|
+
// is never used for selection.
|
|
15
|
+
$selected: ':is(.selected, [aria-selected="true"], :state(selected))';
|
|
16
|
+
|
|
17
|
+
// A tab stacks its icon above its label when it has both. Every gb icon host
|
|
18
|
+
// carries `.md-icon` — IconElement.connectedCallback adds it
|
|
19
|
+
// (styles/icon/icon-element.ts:25) — so the structure can be read directly and
|
|
20
|
+
// no `.tab-icon` class is needed. Primary tabs with icon + label are always
|
|
21
|
+
// stacked and secondary tabs are always inline, so structure is sufficient and
|
|
22
|
+
// no modifier class is required.
|
|
23
|
+
$stacked: ':has(> .md-icon):has(> :is(.tab-label, [slot="label"]))';
|
|
24
|
+
|
|
25
|
+
@layer md.sys, md.comp.ripple, md.comp.focus-ring, md.comp.badge;
|
|
26
|
+
@layer md.comp.tabs {
|
|
27
|
+
.tabs {
|
|
28
|
+
@include tabs-tokens.root;
|
|
29
|
+
|
|
30
|
+
&.tabs-secondary {
|
|
31
|
+
@include tabs-tokens.secondary;
|
|
32
|
+
// Published for `.tab` to read with a style query, so "secondary never
|
|
33
|
+
// stacks" needs no `.tabs-secondary .tab` descendant selector. Same
|
|
34
|
+
// idiom as `--list-segmented` in list.scss:21.
|
|
35
|
+
--tabs-secondary: true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
display: flex;
|
|
39
|
+
// Horizontal only, always. `orientation="vertical"` on md-gb-tabs is an
|
|
40
|
+
// anti-pattern; the API is not blocked, but it must produce no visual
|
|
41
|
+
// difference, so there is deliberately no `[orientation='vertical']`
|
|
42
|
+
// rule anywhere in this file. Stating the direction rather than relying
|
|
43
|
+
// on the initial value makes that intentional.
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
position: relative;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
background-color: var(--container-color);
|
|
48
|
+
border-radius: var(--container-shape);
|
|
49
|
+
|
|
50
|
+
// The divider is INSIDE the declared height: 48dp = 47dp of tab + 1dp of
|
|
51
|
+
// divider (spec image A row 2: indicator y356-358, divider y359; Figma
|
|
52
|
+
// 44:44391 sits at y=47 of 48). `.tab` supplies the 47dp/63dp, so a
|
|
53
|
+
// stacked bar reaches 64dp by growing to fit its tabs. The container
|
|
54
|
+
// cannot detect a stacked tab itself: `:has()` may not be nested inside
|
|
55
|
+
// `:has()`, so `.tabs:has(> .tab:has(…))` is not a valid selector.
|
|
56
|
+
min-block-size: var(--container-height);
|
|
57
|
+
border-block-end: var(--divider-thickness) solid var(--divider-color);
|
|
58
|
+
|
|
59
|
+
// Every bar scrolls once it overflows; there is no `.tabs-scrollable`.
|
|
60
|
+
// The flex items' automatic minimum size floors each tab at min-content,
|
|
61
|
+
// which is what produces the overflow in the first place.
|
|
62
|
+
overflow-inline: auto;
|
|
63
|
+
overflow-block: hidden;
|
|
64
|
+
overscroll-behavior-inline: contain;
|
|
65
|
+
scrollbar-width: none;
|
|
66
|
+
|
|
67
|
+
// Anchor names are tree-scoped, not element-scoped. Without this, every
|
|
68
|
+
// `.tabs` in the tree publishes the same three names and the last one in
|
|
69
|
+
// tree order wins for all of them — measured: with several bars on a
|
|
70
|
+
// page, every indicator resolved against the last bar's selected tab.
|
|
71
|
+
anchor-scope: --tab, --tab-content-start, --tab-content-end;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tab {
|
|
75
|
+
// Deliberately no `@include tabs-tokens.root`: the tab reads the
|
|
76
|
+
// container's custom properties by inheritance, which is what lets
|
|
77
|
+
// `.tabs-secondary` retint every tab without a descendant selector.
|
|
78
|
+
display: flex;
|
|
79
|
+
// Containing block for the `::before` focus ring and out-of-flow `.tab-badge`.
|
|
80
|
+
position: relative;
|
|
81
|
+
anchor-scope: --tab-icon;
|
|
82
|
+
flex: 1 1 0;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
gap: var(--icon-label-space);
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
min-block-size: calc(var(--container-height) - var(--divider-thickness));
|
|
88
|
+
padding-inline: var(--leading-space) var(--trailing-space);
|
|
89
|
+
padding-block: 0;
|
|
90
|
+
border: none;
|
|
91
|
+
background-color: transparent;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
user-select: none;
|
|
94
|
+
scroll-margin-inline: var(--tab-scroll-margin, var(--leading-space, 16px));
|
|
95
|
+
// No two-line labels and no truncation.
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
// The label box is floored at 24dp (see the `min-inline-size` rule below),
|
|
98
|
+
// so a shorter label would otherwise sit against the leading edge of its
|
|
99
|
+
// own box instead of under the centre of the indicator.
|
|
100
|
+
text-align: center;
|
|
101
|
+
color: var(--label-text-color);
|
|
102
|
+
font: var(--label-text);
|
|
103
|
+
letter-spacing: var(--label-text-tracking);
|
|
104
|
+
font-variation-settings: var(--label-text-axes);
|
|
105
|
+
// The focus ring is painted by `::before`, not by this element — see §7.
|
|
106
|
+
// `md.comp.tabs` is declared after `md.comp.focus-ring`, so this beats the
|
|
107
|
+
// primitive's own `outline: var(--focus-ring-outline)` without specificity
|
|
108
|
+
// games.
|
|
109
|
+
outline: none;
|
|
110
|
+
// Icons are unclassed children; the root sets their metrics (chip.scss:67).
|
|
111
|
+
--md-icon-color: var(--icon-color);
|
|
112
|
+
--md-icon-size: var(--icon-size);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.tab#{$stacked} {
|
|
116
|
+
// Secondary never stacks, so the whole block is gated on the variant flag
|
|
117
|
+
// the container publishes rather than on a `.tabs-secondary .tab` selector.
|
|
118
|
+
// Raising `--container-height` here raises this tab's own min-block-size to
|
|
119
|
+
// 63dp; the bar then grows to 64dp to contain it.
|
|
120
|
+
@container not style(--tabs-secondary: true) {
|
|
121
|
+
@include tabs-tokens.with-icon-and-label-text;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
gap: var(--stacked-icon-label-space);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.tab:has(> .md-icon) {
|
|
128
|
+
@container not style(--tabs-secondary: true) {
|
|
129
|
+
> .md-icon {
|
|
130
|
+
anchor-name: --tab-icon;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
> .tab-badge {
|
|
134
|
+
position: absolute;
|
|
135
|
+
position-anchor: --tab-icon;
|
|
136
|
+
inset-block-start: anchor(start);
|
|
137
|
+
inset-inline-start: calc(anchor(end) - var(--icon-badge-inset));
|
|
138
|
+
margin-inline-start: 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// The indicator hugs the tab's content, and design's minimum applies to the
|
|
144
|
+
// CONTENT container, not to the painted bar: a 24dp container with 2dp of
|
|
145
|
+
// indicator padding per side renders a 20dp bar. An icon already has this
|
|
146
|
+
// floor (md-icon.scss:52 sets `min-width: var(--md-icon-size)` = 24dp); a
|
|
147
|
+
// label does not, so it gets one here. Scoped under `.tab` because a bare
|
|
148
|
+
// `[slot="label"]` would match any element on the page.
|
|
149
|
+
.tab > :is(.tab-label, [slot='label']) {
|
|
150
|
+
min-inline-size: var(--active-indicator-min-length);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The inline gap is 8dp icon-to-label but 4dp label-to-badge (spec image A
|
|
154
|
+
// row 4 annotates both). A single `gap` cannot express two values, so the
|
|
155
|
+
// badge pulls back by the difference. Tabs does not style `.badge` itself;
|
|
156
|
+
// this is an opt-in positioning class the author adds alongside it, as
|
|
157
|
+
// `<span class="badge tab-badge">`.
|
|
158
|
+
.tab-badge {
|
|
159
|
+
margin-inline-start: calc(var(--badge-space) - var(--icon-label-space));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.tab#{$selected} {
|
|
163
|
+
@include tabs-tokens.selected;
|
|
164
|
+
anchor-name: --tab;
|
|
165
|
+
|
|
166
|
+
@container style(--tabs-secondary: true) {
|
|
167
|
+
@include tabs-tokens.secondary-selected;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Spec gives inactive tabs on-surface colours on hover/focus/pressed. The
|
|
172
|
+
// secondary-* state mixins resolve to exactly the same two declarations as the
|
|
173
|
+
// primary ones, so one rule each covers both variants.
|
|
174
|
+
.tab:is(:hover, .hover):not(#{$selected}) {
|
|
175
|
+
@include tabs-tokens.hover;
|
|
176
|
+
}
|
|
177
|
+
.tab:is(:focus-visible, .focus):not(#{$selected}) {
|
|
178
|
+
@include tabs-tokens.focus;
|
|
179
|
+
}
|
|
180
|
+
.tab:is(:active, .active):not(#{$selected}) {
|
|
181
|
+
@include tabs-tokens.pressed;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// FOCUS RING. Painted on a pseudo-element rather than on `.tab` itself for
|
|
185
|
+
// two reasons the gb primitive cannot cover (§7): the ring has a 12dp radius
|
|
186
|
+
// while the state layer must stay square and full-bleed, and the selected
|
|
187
|
+
// ring is asymmetric while `outline-offset` is a single scalar. Thickness,
|
|
188
|
+
// colour, visibility and the grow/shrink animation still come from the
|
|
189
|
+
// primitive through its inherited custom properties, so there is one source
|
|
190
|
+
// of truth for all of those.
|
|
191
|
+
.tab::before {
|
|
192
|
+
content: '';
|
|
193
|
+
position: absolute;
|
|
194
|
+
inset: var(--focus-indicator-inset);
|
|
195
|
+
border-radius: var(--focus-indicator-shape);
|
|
196
|
+
outline: var(--focus-ring-outline);
|
|
197
|
+
// md.sys.state.focus-indicator.inner-offset is -3px, i.e. exactly minus the
|
|
198
|
+
// stroke thickness, which is what draws the stroke inside the ring frame
|
|
199
|
+
// the way Figma does (frame 3..44, stroke 41..44) instead of outside it
|
|
200
|
+
// (44..47, overlapping toward the divider).
|
|
201
|
+
outline-offset: var(--focus-ring-offset);
|
|
202
|
+
animation: var(--focus-ring-animation, none);
|
|
203
|
+
pointer-events: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// A selected tab's ring stops short of the indicator. The mechanic is a
|
|
207
|
+
// HEIGHT SHRINK, not a translation: the top inset stays 3dp in every state
|
|
208
|
+
// and only the bottom edge moves. Both Figma values preserve the same 5dp of
|
|
209
|
+
// optical clearance above the indicator (3+5=8 primary, 2+5=7 secondary), so
|
|
210
|
+
// one generative rule covers both variants. Measured: 8px and 7px.
|
|
211
|
+
.tab#{$selected}::before {
|
|
212
|
+
inset-block-end: calc(
|
|
213
|
+
var(--active-indicator-height) + var(--focus-indicator-clearance)
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// The primary indicator hugs the tab's CONTENT, which is narrower than the
|
|
218
|
+
// tab: tabs are equal fractions of the bar (image A annotates 1/4 and 1/2)
|
|
219
|
+
// and their content is centred inside them. `anchor()` resolves against an
|
|
220
|
+
// element's border box, so the content extent has to be published by the
|
|
221
|
+
// content: the first child opens it, the last child closes it.
|
|
222
|
+
//
|
|
223
|
+
// NOTE: This assumes child elements are in visual order (icon, label, badge).
|
|
224
|
+
// In raw HTML, light-DOM child order must match visual order. In `<md-gb-tab>`,
|
|
225
|
+
// named slots pin the flat-tree render order to `<slot>` (icon),
|
|
226
|
+
// `<slot name="label">`, and `<slot name="badge">`.
|
|
227
|
+
.tab#{$selected}:not(:has(> .md-icon)) > :first-child {
|
|
228
|
+
anchor-name: --tab-content-start;
|
|
229
|
+
}
|
|
230
|
+
.tab#{$selected}:not(:has(> .md-icon)) > :last-child {
|
|
231
|
+
anchor-name: --tab-content-end;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// `anchor-name` is one property, so a lone child matched by both rules above
|
|
235
|
+
// would keep only the last declaration and lose the start anchor — measured:
|
|
236
|
+
// the indicator collapsed to 0px wide for every single-child tab.
|
|
237
|
+
.tab#{$selected}:not(:has(> .md-icon)) > :only-child {
|
|
238
|
+
anchor-name: --tab-content-start, --tab-content-end;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.tab#{$selected}:not(#{$stacked}) > .md-icon {
|
|
242
|
+
anchor-name: --tab-icon, --tab-content-start, --tab-content-end;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// A stacked tab puts the icon on its own row, so the label alone defines the
|
|
246
|
+
// inline extent: image A row 1 has label ink 139-180 and indicator 140-179,
|
|
247
|
+
// with the 24dp icon above it uncovered.
|
|
248
|
+
.tab#{$selected}#{$stacked} > :is(.tab-label, [slot='label']) {
|
|
249
|
+
anchor-name: --tab-content-start, --tab-content-end;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// The shadow-side `<slot name="label" class="tab-label">` must not generate a
|
|
253
|
+
// box. In the baseline light DOM the label is a `.tab-label` span assigned to
|
|
254
|
+
// the DEFAULT slot, which would leave the named slot empty and still
|
|
255
|
+
// consuming a flex `gap`. With `display: contents` the label box is the
|
|
256
|
+
// author's own element in both authoring forms — which is also the only tree
|
|
257
|
+
// whose `anchor-name` `.tabs::after` can see.
|
|
258
|
+
slot.tab-label {
|
|
259
|
+
display: contents;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.tabs::after {
|
|
263
|
+
content: '';
|
|
264
|
+
position: absolute;
|
|
265
|
+
inset-block-end: 0;
|
|
266
|
+
block-size: var(--active-indicator-height);
|
|
267
|
+
background-color: var(--active-indicator-color);
|
|
268
|
+
border-radius: var(--active-indicator-shape);
|
|
269
|
+
|
|
270
|
+
// 2dp inset per side. There is no clamp here: the minimum is enforced on
|
|
271
|
+
// the content box (the `min-inline-size` rule above), which keeps the
|
|
272
|
+
// floor, the centring and the 2dp padding in one consistent model.
|
|
273
|
+
inset-inline: calc(
|
|
274
|
+
anchor(--tab-content-start start) + var(--active-indicator-inset)
|
|
275
|
+
)
|
|
276
|
+
calc(anchor(--tab-content-end end) + var(--active-indicator-inset));
|
|
277
|
+
|
|
278
|
+
transition: inset var(--md-sys-motion-duration-medium1)
|
|
279
|
+
var(--md-sys-motion-easing-emphasized);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Secondary spans the whole tab (image A rows 3-4: x=121..300 is the entire
|
|
283
|
+
// first tab of two) and has square corners (Figma 44:44191 carries no radius;
|
|
284
|
+
// `secondary` overrides `--active-indicator-shape` to 0).
|
|
285
|
+
.tabs-secondary::after {
|
|
286
|
+
inset-inline: anchor(--tab start) anchor(--tab end);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// With nothing selected the `anchor()` references are invalid at
|
|
290
|
+
// computed-value time and the bar collapses to zero width. Saying so out loud
|
|
291
|
+
// is cheaper than relying on that.
|
|
292
|
+
.tabs:not(:has(> .tab#{$selected}))::after {
|
|
293
|
+
display: none;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@media (prefers-reduced-motion: reduce) {
|
|
297
|
+
.tabs::after {
|
|
298
|
+
transition: none;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@mixin root {
|
|
7
|
+
// LINT.IfChange
|
|
8
|
+
--button-container-color: var(--md-sys-color-surface-container);
|
|
9
|
+
--container-color: var(--md-sys-color-surface-container);
|
|
10
|
+
--container-elevation: var(--md-sys-elevation-shadow-3);
|
|
11
|
+
--container-leading-space: var(--md-sys-space-100);
|
|
12
|
+
--container-shape: calc(var(--horizontal-container-height) / 2);
|
|
13
|
+
--container-spacing: var(--md-sys-space-50);
|
|
14
|
+
--container-trailing-space: var(--md-sys-space-100);
|
|
15
|
+
--docked-container-elevation: var(--md-sys-elevation-shadow-0);
|
|
16
|
+
--docked-container-height: 64px;
|
|
17
|
+
--docked-container-leading-space: var(--md-sys-space-200);
|
|
18
|
+
--docked-container-max-spacing: 32px;
|
|
19
|
+
--docked-container-min-spacing: 4px;
|
|
20
|
+
--docked-container-shape: var(--md-sys-shape-corner-none);
|
|
21
|
+
--docked-container-trailing-space: var(--md-sys-space-200);
|
|
22
|
+
--horizontal-container-height: 64px;
|
|
23
|
+
--icon-color: var(--md-sys-color-on-surface-variant);
|
|
24
|
+
--label-text-color: var(--md-sys-color-on-surface-variant);
|
|
25
|
+
--min-button-size: 40px;
|
|
26
|
+
--motion-duration: var(--md-sys-motion-duration-short4);
|
|
27
|
+
--motion-easing: var(--md-sys-motion-easing-emphasized);
|
|
28
|
+
--selected-button-container-color: var(--md-sys-color-secondary-container);
|
|
29
|
+
--selected-icon-color: var(--md-sys-color-on-secondary-container);
|
|
30
|
+
--selected-label-text-color: var(--md-sys-color-on-secondary-container);
|
|
31
|
+
--vertical-container-width: 64px;
|
|
32
|
+
// LINT.ThenChange(toolbar-element.ts) keep in sync with `@cssprop` jsdoc tags
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin standard {
|
|
36
|
+
--button-container-color: var(--md-sys-color-surface-container);
|
|
37
|
+
--container-color: var(--md-sys-color-surface-container);
|
|
38
|
+
--icon-color: var(--md-sys-color-on-surface-variant);
|
|
39
|
+
--label-text-color: var(--md-sys-color-on-surface-variant);
|
|
40
|
+
--selected-button-container-color: var(--md-sys-color-secondary-container);
|
|
41
|
+
--selected-icon-color: var(--md-sys-color-on-secondary-container);
|
|
42
|
+
--selected-label-text-color: var(--md-sys-color-on-secondary-container);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@mixin vibrant {
|
|
46
|
+
--button-container-color: var(--md-sys-color-primary-container);
|
|
47
|
+
--container-color: var(--md-sys-color-primary-container);
|
|
48
|
+
--icon-color: var(--md-sys-color-primary);
|
|
49
|
+
--label-text-color: var(--md-sys-color-primary);
|
|
50
|
+
--selected-button-container-color: var(--md-sys-color-surface-container);
|
|
51
|
+
--selected-icon-color: var(--md-sys-color-on-surface);
|
|
52
|
+
--selected-label-text-color: var(--md-sys-color-on-surface);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin vertical {
|
|
56
|
+
--container-shape: calc(var(--vertical-container-width) / 2);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@mixin docked {
|
|
60
|
+
--container-elevation: var(--docked-container-elevation);
|
|
61
|
+
--container-leading-space: var(--docked-container-leading-space);
|
|
62
|
+
--container-shape: var(--docked-container-shape);
|
|
63
|
+
--container-spacing: clamp(
|
|
64
|
+
var(--docked-container-min-spacing),
|
|
65
|
+
4vw,
|
|
66
|
+
var(--docked-container-max-spacing)
|
|
67
|
+
);
|
|
68
|
+
--container-trailing-space: var(--docked-container-trailing-space);
|
|
69
|
+
--horizontal-container-height: var(--docked-container-height);
|
|
70
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ToolbarElement } from './toolbar-element.js';
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
/** A Material Design gBreeze toolbar custom element. */
|
|
10
|
+
'md-gb-toolbar': ToolbarElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"md-gb-toolbar.js","sourceRoot":"","sources":["md-gb-toolbar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AASpD,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ToolbarElement} from './toolbar-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design gBreeze toolbar custom element. */\n 'md-gb-toolbar': ToolbarElement;\n }\n}\n\ncustomElements.define('md-gb-toolbar', ToolbarElement);\n"]}
|