@material/web 2.4.2-nightly.81807b2.0 → 2.4.2-nightly.95dd57c.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/checkbox/internal/checkbox.d.ts +2 -0
- package/chips/internal/chip.d.ts +2 -0
- package/internal/aria/aria.d.ts +1 -1
- package/internal/events/dispatch-hooks.js +31 -35
- package/internal/events/dispatch-hooks.js.map +1 -1
- package/labs/gb/components/button/_button-tokens.scss +30 -30
- 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.d.ts +1 -15
- package/labs/gb/components/button/button.js +7 -22
- package/labs/gb/components/button/button.js.map +1 -1
- package/labs/gb/components/button/button.scss +25 -25
- package/labs/gb/components/card/_card-tokens.scss +54 -0
- package/labs/gb/components/card/card.css +4 -0
- package/labs/gb/components/card/card.css.map +1 -0
- package/labs/gb/components/card/card.cssresult.js +14 -0
- package/labs/gb/components/card/card.cssresult.js.map +1 -0
- package/labs/gb/components/card/card.d.ts +57 -0
- package/labs/gb/components/card/card.js +58 -0
- package/labs/gb/components/card/card.js.map +1 -0
- package/labs/gb/components/card/card.scss +74 -0
- package/labs/gb/components/card/md-card.d.ts +30 -0
- package/labs/gb/components/card/md-card.js +85 -0
- package/labs/gb/components/card/md-card.js.map +1 -0
- 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.d.ts +1 -15
- package/labs/gb/components/checkbox/checkbox.js +5 -20
- package/labs/gb/components/checkbox/checkbox.js.map +1 -1
- package/labs/gb/components/checkbox/checkbox.scss +13 -13
- package/labs/gb/components/checkbox/md-checkbox.d.ts +8 -1
- package/labs/gb/components/checkbox/md-checkbox.js +12 -5
- package/labs/gb/components/checkbox/md-checkbox.js.map +1 -1
- package/labs/gb/components/divider/_divider-tokens.scss +9 -0
- package/labs/gb/components/divider/divider.css +4 -0
- package/labs/gb/components/divider/divider.css.map +1 -0
- package/labs/gb/components/divider/divider.cssresult.js +14 -0
- package/labs/gb/components/divider/divider.cssresult.js.map +1 -0
- package/labs/gb/components/divider/divider.d.ts +44 -0
- package/labs/gb/components/divider/divider.js +47 -0
- package/labs/gb/components/divider/divider.js.map +1 -0
- package/labs/gb/components/divider/divider.scss +31 -0
- package/labs/gb/components/divider/md-divider.d.ts +23 -0
- package/labs/gb/components/divider/md-divider.js +51 -0
- package/labs/gb/components/divider/md-divider.js.map +1 -0
- package/labs/gb/components/fab/_fab-tokens.scss +84 -0
- package/labs/gb/components/fab/fab.css +4 -0
- package/labs/gb/components/fab/fab.css.map +1 -0
- package/labs/gb/components/fab/fab.cssresult.js +14 -0
- package/labs/gb/components/fab/fab.cssresult.js.map +1 -0
- package/labs/gb/components/fab/fab.d.ts +84 -0
- package/labs/gb/components/fab/fab.js +92 -0
- package/labs/gb/components/fab/fab.js.map +1 -0
- package/labs/gb/components/fab/fab.scss +77 -0
- package/labs/gb/components/fab/md-fab.d.ts +22 -0
- package/labs/gb/components/fab/md-fab.js +56 -0
- package/labs/gb/components/fab/md-fab.js.map +1 -0
- package/labs/gb/components/iconbutton/_icon-button-tokens.scss +202 -0
- package/labs/gb/components/iconbutton/icon-button.css +4 -0
- package/labs/gb/components/iconbutton/icon-button.css.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.cssresult.js +14 -0
- package/labs/gb/components/iconbutton/icon-button.cssresult.js.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.d.ts +97 -0
- package/labs/gb/components/iconbutton/icon-button.js +122 -0
- package/labs/gb/components/iconbutton/icon-button.js.map +1 -0
- package/labs/gb/components/iconbutton/icon-button.scss +153 -0
- package/labs/gb/components/iconbutton/md-icon-button.d.ts +73 -0
- package/labs/gb/components/iconbutton/md-icon-button.js +176 -0
- package/labs/gb/components/iconbutton/md-icon-button.js.map +1 -0
- package/labs/gb/components/list/_list-tokens.scss +102 -0
- package/labs/gb/components/list/list.css +4 -0
- package/labs/gb/components/list/list.css.map +1 -0
- package/labs/gb/components/list/list.cssresult.js +14 -0
- package/labs/gb/components/list/list.cssresult.js.map +1 -0
- package/labs/gb/components/list/list.d.ts +103 -0
- package/labs/gb/components/list/list.js +109 -0
- package/labs/gb/components/list/list.js.map +1 -0
- package/labs/gb/components/list/list.scss +212 -0
- package/labs/gb/components/list/md-list-item.d.ts +44 -0
- package/labs/gb/components/list/md-list-item.js +122 -0
- package/labs/gb/components/list/md-list-item.js.map +1 -0
- package/labs/gb/components/list/md-list.d.ts +26 -0
- package/labs/gb/components/list/md-list.js +51 -0
- package/labs/gb/components/list/md-list.js.map +1 -0
- package/labs/gb/components/menu/_menu-tokens.scss +128 -0
- package/labs/gb/components/menu/md-menu-group.d.ts +26 -0
- package/labs/gb/components/menu/md-menu-group.js +65 -0
- package/labs/gb/components/menu/md-menu-group.js.map +1 -0
- package/labs/gb/components/menu/md-menu-item.d.ts +30 -0
- package/labs/gb/components/menu/md-menu-item.js +165 -0
- package/labs/gb/components/menu/md-menu-item.js.map +1 -0
- package/labs/gb/components/menu/md-menu.d.ts +28 -0
- package/labs/gb/components/menu/md-menu.js +141 -0
- package/labs/gb/components/menu/md-menu.js.map +1 -0
- package/labs/gb/components/menu/menu.css +4 -0
- package/labs/gb/components/menu/menu.css.map +1 -0
- package/labs/gb/components/menu/menu.cssresult.js +14 -0
- package/labs/gb/components/menu/menu.cssresult.js.map +1 -0
- package/labs/gb/components/menu/menu.d.ts +117 -0
- package/labs/gb/components/menu/menu.js +107 -0
- package/labs/gb/components/menu/menu.js.map +1 -0
- package/labs/gb/components/menu/menu.scss +171 -0
- package/labs/gb/components/radio/_radio-tokens.scss +37 -0
- package/labs/gb/components/radio/md-radio.d.ts +62 -0
- package/labs/gb/components/radio/md-radio.js +186 -0
- package/labs/gb/components/radio/md-radio.js.map +1 -0
- package/labs/gb/components/radio/radio.css +4 -0
- package/labs/gb/components/radio/radio.css.map +1 -0
- package/labs/gb/components/radio/radio.cssresult.js +14 -0
- package/labs/gb/components/radio/radio.cssresult.js.map +1 -0
- package/labs/gb/components/radio/radio.d.ts +57 -0
- package/labs/gb/components/radio/radio.js +62 -0
- package/labs/gb/components/radio/radio.js.map +1 -0
- package/labs/gb/components/radio/radio.scss +74 -0
- package/labs/gb/components/ripple/ripple.d.ts +1 -10
- package/labs/gb/components/ripple/ripple.js +25 -32
- package/labs/gb/components/ripple/ripple.js.map +1 -1
- package/labs/gb/components/shared/directives.d.ts +93 -0
- package/labs/gb/components/shared/directives.js +111 -0
- package/labs/gb/components/shared/directives.js.map +1 -0
- package/labs/gb/components/shared/has-slotted.d.ts +10 -0
- package/labs/gb/components/shared/has-slotted.js +19 -0
- package/labs/gb/components/shared/has-slotted.js.map +1 -0
- package/labs/gb/components/shared/pseudo-classes.d.ts +7 -0
- package/labs/gb/components/shared/pseudo-classes.js +9 -0
- package/labs/gb/components/shared/pseudo-classes.js.map +1 -1
- package/labs/gb/components/switch/_switch-tokens.scss +56 -0
- package/labs/gb/components/switch/md-switch.d.ts +66 -0
- package/labs/gb/components/switch/md-switch.js +162 -0
- package/labs/gb/components/switch/md-switch.js.map +1 -0
- package/labs/gb/components/switch/switch.css +4 -0
- package/labs/gb/components/switch/switch.css.map +1 -0
- package/labs/gb/components/switch/switch.cssresult.js +14 -0
- package/labs/gb/components/switch/switch.cssresult.js.map +1 -0
- package/labs/gb/components/switch/switch.d.ts +54 -0
- package/labs/gb/components/switch/switch.js +85 -0
- package/labs/gb/components/switch/switch.js.map +1 -0
- package/labs/gb/components/switch/switch.scss +109 -0
- package/list/internal/listitem/list-item.d.ts +2 -0
- package/menu/internal/menuitem/menu-item.d.ts +2 -0
- package/package.json +5 -27
- package/select/internal/select.d.ts +2 -0
- package/select/internal/selectoption/select-option.d.ts +2 -0
- package/typography/md-typescale-styles.d.ts +6 -3
- package/typography/md-typescale-styles.js +1 -5
- package/typography/md-typescale-styles.js.map +1 -1
- package/button/internal/elevated-styles.js +0 -11
- package/button/internal/elevated-styles.js.map +0 -1
- package/button/internal/filled-styles.js +0 -11
- package/button/internal/filled-styles.js.map +0 -1
- package/button/internal/filled-tonal-styles.js +0 -11
- package/button/internal/filled-tonal-styles.js.map +0 -1
- package/button/internal/outlined-styles.js +0 -11
- package/button/internal/outlined-styles.js.map +0 -1
- package/button/internal/shared-elevation-styles.js +0 -11
- package/button/internal/shared-elevation-styles.js.map +0 -1
- package/button/internal/shared-styles.js +0 -11
- package/button/internal/shared-styles.js.map +0 -1
- package/button/internal/text-styles.js +0 -11
- package/button/internal/text-styles.js.map +0 -1
- package/checkbox/internal/checkbox-styles.js +0 -11
- package/checkbox/internal/checkbox-styles.js.map +0 -1
- package/chips/internal/assist-styles.d.ts +0 -3
- package/chips/internal/assist-styles.js +0 -11
- package/chips/internal/assist-styles.js.map +0 -1
- package/chips/internal/chip-set-styles.d.ts +0 -3
- package/chips/internal/chip-set-styles.js +0 -11
- package/chips/internal/chip-set-styles.js.map +0 -1
- package/chips/internal/elevated-styles.d.ts +0 -3
- package/chips/internal/elevated-styles.js +0 -11
- package/chips/internal/elevated-styles.js.map +0 -1
- package/chips/internal/filter-styles.d.ts +0 -3
- package/chips/internal/filter-styles.js +0 -11
- package/chips/internal/filter-styles.js.map +0 -1
- package/chips/internal/input-styles.d.ts +0 -3
- package/chips/internal/input-styles.js +0 -11
- package/chips/internal/input-styles.js.map +0 -1
- package/chips/internal/selectable-styles.d.ts +0 -3
- package/chips/internal/selectable-styles.js +0 -11
- package/chips/internal/selectable-styles.js.map +0 -1
- package/chips/internal/shared-styles.d.ts +0 -3
- package/chips/internal/shared-styles.js +0 -11
- package/chips/internal/shared-styles.js.map +0 -1
- package/chips/internal/suggestion-styles.d.ts +0 -3
- package/chips/internal/suggestion-styles.js +0 -11
- package/chips/internal/suggestion-styles.js.map +0 -1
- package/chips/internal/trailing-icon-styles.d.ts +0 -3
- package/chips/internal/trailing-icon-styles.js +0 -11
- package/chips/internal/trailing-icon-styles.js.map +0 -1
- package/dialog/internal/dialog-styles.d.ts +0 -3
- package/dialog/internal/dialog-styles.js +0 -11
- package/dialog/internal/dialog-styles.js.map +0 -1
- package/divider/internal/divider-styles.d.ts +0 -3
- package/divider/internal/divider-styles.js +0 -11
- package/divider/internal/divider-styles.js.map +0 -1
- package/elevation/internal/elevation-styles.d.ts +0 -3
- package/elevation/internal/elevation-styles.js +0 -11
- package/elevation/internal/elevation-styles.js.map +0 -1
- package/fab/internal/fab-branded-styles.d.ts +0 -3
- package/fab/internal/fab-branded-styles.js +0 -11
- package/fab/internal/fab-branded-styles.js.map +0 -1
- package/fab/internal/fab-styles.d.ts +0 -3
- package/fab/internal/fab-styles.js +0 -11
- package/fab/internal/fab-styles.js.map +0 -1
- package/fab/internal/forced-colors-styles.d.ts +0 -3
- package/fab/internal/forced-colors-styles.js +0 -11
- package/fab/internal/forced-colors-styles.js.map +0 -1
- package/fab/internal/shared-styles.d.ts +0 -3
- package/fab/internal/shared-styles.js +0 -11
- package/fab/internal/shared-styles.js.map +0 -1
- package/field/internal/filled-styles.d.ts +0 -3
- package/field/internal/filled-styles.js +0 -11
- package/field/internal/filled-styles.js.map +0 -1
- package/field/internal/outlined-styles.d.ts +0 -3
- package/field/internal/outlined-styles.js +0 -11
- package/field/internal/outlined-styles.js.map +0 -1
- package/field/internal/shared-styles.d.ts +0 -3
- package/field/internal/shared-styles.js +0 -11
- package/field/internal/shared-styles.js.map +0 -1
- package/focus/internal/focus-ring-styles.d.ts +0 -3
- package/focus/internal/focus-ring-styles.js +0 -11
- package/focus/internal/focus-ring-styles.js.map +0 -1
- package/icon/internal/icon-styles.d.ts +0 -3
- package/icon/internal/icon-styles.js +0 -11
- package/icon/internal/icon-styles.js.map +0 -1
- package/iconbutton/internal/filled-styles.d.ts +0 -3
- package/iconbutton/internal/filled-styles.js +0 -11
- package/iconbutton/internal/filled-styles.js.map +0 -1
- package/iconbutton/internal/filled-tonal-styles.d.ts +0 -3
- package/iconbutton/internal/filled-tonal-styles.js +0 -11
- package/iconbutton/internal/filled-tonal-styles.js.map +0 -1
- package/iconbutton/internal/outlined-styles.d.ts +0 -3
- package/iconbutton/internal/outlined-styles.js +0 -11
- package/iconbutton/internal/outlined-styles.js.map +0 -1
- package/iconbutton/internal/shared-styles.d.ts +0 -3
- package/iconbutton/internal/shared-styles.js +0 -11
- package/iconbutton/internal/shared-styles.js.map +0 -1
- package/iconbutton/internal/standard-styles.d.ts +0 -3
- package/iconbutton/internal/standard-styles.js +0 -11
- package/iconbutton/internal/standard-styles.js.map +0 -1
- package/labs/badge/internal/badge-styles.d.ts +0 -3
- package/labs/badge/internal/badge-styles.js +0 -11
- package/labs/badge/internal/badge-styles.js.map +0 -1
- package/labs/card/internal/elevated-styles.d.ts +0 -3
- package/labs/card/internal/elevated-styles.js +0 -11
- package/labs/card/internal/elevated-styles.js.map +0 -1
- package/labs/card/internal/filled-styles.d.ts +0 -3
- package/labs/card/internal/filled-styles.js +0 -11
- package/labs/card/internal/filled-styles.js.map +0 -1
- package/labs/card/internal/outlined-styles.d.ts +0 -3
- package/labs/card/internal/outlined-styles.js +0 -11
- package/labs/card/internal/outlined-styles.js.map +0 -1
- package/labs/card/internal/shared-styles.d.ts +0 -3
- package/labs/card/internal/shared-styles.js +0 -11
- package/labs/card/internal/shared-styles.js.map +0 -1
- package/labs/item/internal/item-styles.d.ts +0 -3
- package/labs/item/internal/item-styles.js +0 -11
- package/labs/item/internal/item-styles.js.map +0 -1
- package/labs/navigationbar/internal/navigation-bar-styles.d.ts +0 -3
- package/labs/navigationbar/internal/navigation-bar-styles.js +0 -11
- package/labs/navigationbar/internal/navigation-bar-styles.js.map +0 -1
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.d.ts +0 -3
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.js +0 -11
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.js.map +0 -1
- package/labs/navigationdrawer/internal/navigation-drawer-styles.d.ts +0 -3
- package/labs/navigationdrawer/internal/navigation-drawer-styles.js +0 -11
- package/labs/navigationdrawer/internal/navigation-drawer-styles.js.map +0 -1
- package/labs/navigationdrawer/internal/shared-styles.d.ts +0 -3
- package/labs/navigationdrawer/internal/shared-styles.js +0 -11
- package/labs/navigationdrawer/internal/shared-styles.js.map +0 -1
- package/labs/navigationtab/internal/navigation-tab-styles.d.ts +0 -3
- package/labs/navigationtab/internal/navigation-tab-styles.js +0 -11
- package/labs/navigationtab/internal/navigation-tab-styles.js.map +0 -1
- package/labs/segmentedbutton/internal/outlined-styles.d.ts +0 -3
- package/labs/segmentedbutton/internal/outlined-styles.js +0 -11
- package/labs/segmentedbutton/internal/outlined-styles.js.map +0 -1
- package/labs/segmentedbutton/internal/shared-styles.d.ts +0 -3
- package/labs/segmentedbutton/internal/shared-styles.js +0 -11
- package/labs/segmentedbutton/internal/shared-styles.js.map +0 -1
- package/labs/segmentedbuttonset/internal/outlined-styles.d.ts +0 -3
- package/labs/segmentedbuttonset/internal/outlined-styles.js +0 -11
- package/labs/segmentedbuttonset/internal/outlined-styles.js.map +0 -1
- package/labs/segmentedbuttonset/internal/shared-styles.d.ts +0 -3
- package/labs/segmentedbuttonset/internal/shared-styles.js +0 -11
- package/labs/segmentedbuttonset/internal/shared-styles.js.map +0 -1
- package/list/internal/list-styles.d.ts +0 -3
- package/list/internal/list-styles.js +0 -11
- package/list/internal/list-styles.js.map +0 -1
- package/list/internal/listitem/list-item-styles.d.ts +0 -3
- package/list/internal/listitem/list-item-styles.js +0 -11
- package/list/internal/listitem/list-item-styles.js.map +0 -1
- package/menu/internal/menu-styles.d.ts +0 -3
- package/menu/internal/menu-styles.js +0 -11
- package/menu/internal/menu-styles.js.map +0 -1
- package/menu/internal/menuitem/menu-item-styles.d.ts +0 -3
- package/menu/internal/menuitem/menu-item-styles.js +0 -11
- package/menu/internal/menuitem/menu-item-styles.js.map +0 -1
- package/menu/internal/submenu/sub-menu-styles.d.ts +0 -3
- package/menu/internal/submenu/sub-menu-styles.js +0 -11
- package/menu/internal/submenu/sub-menu-styles.js.map +0 -1
- package/progress/internal/circular-progress-styles.d.ts +0 -3
- package/progress/internal/circular-progress-styles.js +0 -11
- package/progress/internal/circular-progress-styles.js.map +0 -1
- package/progress/internal/linear-progress-styles.d.ts +0 -3
- package/progress/internal/linear-progress-styles.js +0 -11
- package/progress/internal/linear-progress-styles.js.map +0 -1
- package/radio/internal/radio-styles.d.ts +0 -3
- package/radio/internal/radio-styles.js +0 -11
- package/radio/internal/radio-styles.js.map +0 -1
- package/ripple/internal/ripple-styles.d.ts +0 -3
- package/ripple/internal/ripple-styles.js +0 -11
- package/ripple/internal/ripple-styles.js.map +0 -1
- package/select/internal/filled-select-styles.d.ts +0 -3
- package/select/internal/filled-select-styles.js +0 -11
- package/select/internal/filled-select-styles.js.map +0 -1
- package/select/internal/outlined-select-styles.d.ts +0 -3
- package/select/internal/outlined-select-styles.js +0 -11
- package/select/internal/outlined-select-styles.js.map +0 -1
- package/select/internal/shared-styles.d.ts +0 -3
- package/select/internal/shared-styles.js +0 -11
- package/select/internal/shared-styles.js.map +0 -1
- package/slider/internal/forced-colors-styles.d.ts +0 -3
- package/slider/internal/forced-colors-styles.js +0 -11
- package/slider/internal/forced-colors-styles.js.map +0 -1
- package/slider/internal/slider-styles.d.ts +0 -3
- package/slider/internal/slider-styles.js +0 -11
- package/slider/internal/slider-styles.js.map +0 -1
- package/switch/internal/switch-styles.d.ts +0 -3
- package/switch/internal/switch-styles.js +0 -11
- package/switch/internal/switch-styles.js.map +0 -1
- package/tabs/internal/primary-tab-styles.d.ts +0 -3
- package/tabs/internal/primary-tab-styles.js +0 -11
- package/tabs/internal/primary-tab-styles.js.map +0 -1
- package/tabs/internal/secondary-tab-styles.d.ts +0 -3
- package/tabs/internal/secondary-tab-styles.js +0 -11
- package/tabs/internal/secondary-tab-styles.js.map +0 -1
- package/tabs/internal/tab-styles.d.ts +0 -3
- package/tabs/internal/tab-styles.js +0 -11
- package/tabs/internal/tab-styles.js.map +0 -1
- package/tabs/internal/tabs-styles.d.ts +0 -3
- package/tabs/internal/tabs-styles.js +0 -11
- package/tabs/internal/tabs-styles.js.map +0 -1
- package/textfield/internal/filled-styles.d.ts +0 -3
- package/textfield/internal/filled-styles.js +0 -11
- package/textfield/internal/filled-styles.js.map +0 -1
- package/textfield/internal/outlined-styles.d.ts +0 -3
- package/textfield/internal/outlined-styles.js +0 -11
- package/textfield/internal/outlined-styles.js.map +0 -1
- package/textfield/internal/shared-styles.d.ts +0 -3
- package/textfield/internal/shared-styles.js +0 -11
- package/textfield/internal/shared-styles.js.map +0 -1
- /package/{button/internal/elevated-styles.d.ts → labs/gb/components/card/card.cssresult.d.ts} +0 -0
- /package/{button/internal/filled-styles.d.ts → labs/gb/components/divider/divider.cssresult.d.ts} +0 -0
- /package/{button/internal/filled-tonal-styles.d.ts → labs/gb/components/fab/fab.cssresult.d.ts} +0 -0
- /package/{button/internal/outlined-styles.d.ts → labs/gb/components/iconbutton/icon-button.cssresult.d.ts} +0 -0
- /package/{button/internal/shared-elevation-styles.d.ts → labs/gb/components/list/list.cssresult.d.ts} +0 -0
- /package/{button/internal/shared-styles.d.ts → labs/gb/components/menu/menu.cssresult.d.ts} +0 -0
- /package/{button/internal/text-styles.d.ts → labs/gb/components/radio/radio.cssresult.d.ts} +0 -0
- /package/{checkbox/internal/checkbox-styles.d.ts → labs/gb/components/switch/switch.cssresult.d.ts} +0 -0
|
@@ -25,6 +25,8 @@ export declare class Checkbox extends checkboxBaseClass {
|
|
|
25
25
|
/** @nocollapse */
|
|
26
26
|
static shadowRootOptions: {
|
|
27
27
|
delegatesFocus: boolean;
|
|
28
|
+
clonable?: boolean;
|
|
29
|
+
customElementRegistry?: CustomElementRegistry;
|
|
28
30
|
mode: ShadowRootMode;
|
|
29
31
|
serializable?: boolean;
|
|
30
32
|
slotAssignment?: SlotAssignmentMode;
|
package/chips/internal/chip.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare abstract class Chip extends chipBaseClass {
|
|
|
17
17
|
/** @nocollapse */
|
|
18
18
|
static shadowRootOptions: {
|
|
19
19
|
delegatesFocus: boolean;
|
|
20
|
+
clonable?: boolean;
|
|
21
|
+
customElementRegistry?: CustomElementRegistry;
|
|
20
22
|
mode: ShadowRootMode;
|
|
21
23
|
serializable?: boolean;
|
|
22
24
|
slotAssignment?: SlotAssignmentMode;
|
package/internal/aria/aria.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
|
|
|
18
18
|
/**
|
|
19
19
|
* Accessibility Object Model aria attributes.
|
|
20
20
|
*/
|
|
21
|
-
export declare const ARIA_ATTRIBUTES: ("role" | "aria-hidden" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-current" | "aria-description" | "aria-disabled" | "aria-expanded" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
|
|
21
|
+
export declare const ARIA_ATTRIBUTES: ("role" | "aria-hidden" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
|
|
22
22
|
/**
|
|
23
23
|
* Checks if an attribute is one of the AOM aria attributes.
|
|
24
24
|
*
|
|
@@ -67,7 +67,7 @@ export function afterDispatch(event, callback) {
|
|
|
67
67
|
if (!hooks) {
|
|
68
68
|
throw new Error(`'${event.type}' event needs setupDispatchHooks().`);
|
|
69
69
|
}
|
|
70
|
-
hooks.addEventListener('after', callback);
|
|
70
|
+
hooks.addEventListener('after', callback, { once: true });
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* A lookup map of elements and event types that have a dispatch hook listener
|
|
@@ -106,48 +106,44 @@ export function setupDispatchHooks(element, ...eventTypes) {
|
|
|
106
106
|
}
|
|
107
107
|
for (const eventType of eventTypes) {
|
|
108
108
|
// Don't register multiple dispatch hook listeners. A second registration
|
|
109
|
-
// would lead to the second listener
|
|
110
|
-
// which can cause an infinite loop inside the other one.
|
|
109
|
+
// would lead to the second listener calling `afterDispatch()` hooks twice.
|
|
111
110
|
if (typesAlreadySetUp.has(eventType)) {
|
|
112
111
|
continue;
|
|
113
112
|
}
|
|
114
|
-
// When we re-dispatch the event, it's going to immediately trigger this
|
|
115
|
-
// listener again. Use a flag to ignore it.
|
|
116
|
-
let isRedispatching = false;
|
|
117
113
|
element.addEventListener(eventType, (event) => {
|
|
118
|
-
if (isRedispatching) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
// Do not let the event propagate to any other listener (not just
|
|
122
|
-
// bubbling listeners with `stopPropagation()`).
|
|
123
|
-
event.stopImmediatePropagation();
|
|
124
|
-
// Make a copy.
|
|
125
|
-
const eventCopy = Reflect.construct(event.constructor, [
|
|
126
|
-
event.type,
|
|
127
|
-
event,
|
|
128
|
-
]);
|
|
129
114
|
// Add hooks onto the event.
|
|
130
115
|
const hooks = new EventTarget();
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
116
|
+
event[dispatchHooks] = hooks;
|
|
117
|
+
const cleanupLastNodeListener = new AbortController();
|
|
118
|
+
const callAfterDispatch = () => {
|
|
119
|
+
cleanupLastNodeListener.abort();
|
|
120
|
+
hooks.dispatchEvent(new Event('after'));
|
|
121
|
+
};
|
|
122
|
+
const patchStopPropagation = (superMethod) => {
|
|
123
|
+
return function () {
|
|
124
|
+
superMethod.call(this);
|
|
125
|
+
// Synchronously call afterDispatch() hooks when interrupted.
|
|
126
|
+
callAfterDispatch();
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
event.stopPropagation = patchStopPropagation(event.stopPropagation);
|
|
130
|
+
event.stopImmediatePropagation = patchStopPropagation(event.stopImmediatePropagation);
|
|
131
|
+
// Add an event listener to detect the end of the event's propagation.
|
|
132
|
+
const composedPath = event.composedPath();
|
|
133
|
+
let lastNodeForEvent;
|
|
134
|
+
if (event.composed && event.bubbles) {
|
|
135
|
+
lastNodeForEvent = composedPath[composedPath.length - 1];
|
|
136
|
+
}
|
|
137
|
+
else if (!event.bubbles) {
|
|
138
|
+
lastNodeForEvent = composedPath[0];
|
|
143
139
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (!dispatched) {
|
|
147
|
-
event.preventDefault();
|
|
140
|
+
else {
|
|
141
|
+
lastNodeForEvent = composedPath[0].getRootNode();
|
|
148
142
|
}
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
lastNodeForEvent.addEventListener(eventType, () => {
|
|
144
|
+
// Synchronously call afterDispatch() hooks.
|
|
145
|
+
callAfterDispatch();
|
|
146
|
+
}, { once: true, signal: cleanupLastNodeListener.signal });
|
|
151
147
|
}, {
|
|
152
148
|
// Ensure this listener runs before other listeners.
|
|
153
149
|
// `setupDispatchHooks()` should be called in constructors to also
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-hooks.js","sourceRoot":"","sources":["dispatch-hooks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAS9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,UAAU,aAAa,CAAC,KAAY,EAAE,QAAoB;IAC9D,MAAM,KAAK,GAAI,KAAgC,CAAC,aAAa,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,qCAAqC,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"dispatch-hooks.js","sourceRoot":"","sources":["dispatch-hooks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAS9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,UAAU,aAAa,CAAC,KAAY,EAAE,QAAoB;IAC9D,MAAM,KAAK,GAAI,KAAgC,CAAC,aAAa,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE,CAA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WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACvB,6DAA6D;oBAC7D,iBAAiB,EAAE,CAAC;gBACtB,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,KAAK,CAAC,eAAe,GAAG,oBAAoB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YACpE,KAAK,CAAC,wBAAwB,GAAG,oBAAoB,CACnD,KAAK,CAAC,wBAAwB,CAC/B,CAAC;YAEF,sEAAsE;YACtE,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;YAC1C,IAAI,gBAA6B,CAAC;YAClC,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBACpC,gBAAgB,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAC3D,CAAC;iBAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBAC1B,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,gBAAgB,GAAI,YAAY,CAAC,CAAC,CAAa,CAAC,WAAW,EAAE,CAAC;YAChE,CAAC;YAED,gBAAgB,CAAC,gBAAgB,CAC/B,SAAS,EACT,GAAG,EAAE;gBACH,4CAA4C;gBAC5C,iBAAiB,EAAE,CAAC;YACtB,CAAC,EACD,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,MAAM,EAAC,CACrD,CAAC;QACJ,CAAC,EACD;YACE,oDAAoD;YACpD,kEAAkE;YAClE,uEAAuE;YACvE,OAAO,EAAE,IAAI;SACd,CACF,CAAC;QAEF,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * A symbol used to access dispatch hooks on an event.\n */\nconst dispatchHooks = Symbol('dispatchHooks');\n\n/**\n * An `Event` with additional symbols for dispatch hooks.\n */\ninterface EventWithDispatchHooks extends Event {\n [dispatchHooks]: EventTarget;\n}\n\n/**\n * Add a hook for an event that is called after the event is dispatched and\n * propagates to other event listeners.\n *\n * This is useful for behaviors that need to check if an event is canceled.\n *\n * The callback is invoked synchronously, which allows for better integration\n * with synchronous platform APIs (like `<form>` or `<label>` clicking).\n *\n * Note: `setupDispatchHooks()` must be called on the element before adding any\n * other event listeners. Call it in the constructor of an element or\n * controller.\n *\n * @example\n * ```ts\n * class MyControl extends LitElement {\n * constructor() {\n * super();\n * setupDispatchHooks(this, 'click');\n * this.addEventListener('click', event => {\n * afterDispatch(event, () => {\n * if (event.defaultPrevented) {\n * return\n * }\n *\n * // ... perform logic\n * });\n * });\n * }\n * }\n * ```\n *\n * @example\n * ```ts\n * class MyController implements ReactiveController {\n * constructor(host: ReactiveElement) {\n * // setupDispatchHooks() may be called multiple times for the same\n * // element and events, making it safe for multiple controllers to use it.\n * setupDispatchHooks(host, 'click');\n * host.addEventListener('click', event => {\n * afterDispatch(event, () => {\n * if (event.defaultPrevented) {\n * return;\n * }\n *\n * // ... perform logic\n * });\n * });\n * }\n * }\n * ```\n *\n * @param event The event to add a hook to.\n * @param callback A hook that is called after the event finishes dispatching.\n */\nexport function afterDispatch(event: Event, callback: () => void) {\n const hooks = (event as EventWithDispatchHooks)[dispatchHooks];\n if (!hooks) {\n throw new Error(`'${event.type}' event needs setupDispatchHooks().`);\n }\n\n hooks.addEventListener('after', callback, {once: true});\n}\n\n/**\n * A lookup map of elements and event types that have a dispatch hook listener\n * set up. Used to ensure we don't set up multiple hook listeners on the same\n * element for the same event.\n */\nconst ELEMENT_DISPATCH_HOOK_TYPES = new WeakMap<Element, Set<string>>();\n\n/**\n * Sets up an element to add dispatch hooks to given event types. This must be\n * called before adding any event listeners that need to use dispatch hooks\n * like `afterDispatch()`.\n *\n * This function is safe to call multiple times with the same element or event\n * types. Call it in the constructor of elements, mixins, and controllers to\n * ensure it is set up before external listeners.\n *\n * @example\n * ```ts\n * class MyControl extends LitElement {\n * constructor() {\n * super();\n * setupDispatchHooks(this, 'click');\n * this.addEventListener('click', this.listenerUsingAfterDispatch);\n * }\n * }\n * ```\n *\n * @param element The element to set up event dispatch hooks for.\n * @param eventTypes The event types to add dispatch hooks to.\n */\nexport function setupDispatchHooks(\n element: Element,\n ...eventTypes: [string, ...string[]]\n) {\n let typesAlreadySetUp = ELEMENT_DISPATCH_HOOK_TYPES.get(element);\n if (!typesAlreadySetUp) {\n typesAlreadySetUp = new Set();\n ELEMENT_DISPATCH_HOOK_TYPES.set(element, typesAlreadySetUp);\n }\n\n for (const eventType of eventTypes) {\n // Don't register multiple dispatch hook listeners. A second registration\n // would lead to the second listener calling `afterDispatch()` hooks twice.\n if (typesAlreadySetUp.has(eventType)) {\n continue;\n }\n\n element.addEventListener(\n eventType,\n (event: Event) => {\n // Add hooks onto the event.\n const hooks = new EventTarget();\n (event as EventWithDispatchHooks)[dispatchHooks] = hooks;\n\n const cleanupLastNodeListener = new AbortController();\n const callAfterDispatch = () => {\n cleanupLastNodeListener.abort();\n hooks.dispatchEvent(new Event('after'));\n };\n\n const patchStopPropagation = (\n superMethod: Event['stopPropagation'],\n ) => {\n return function (this: Event) {\n superMethod.call(this);\n // Synchronously call afterDispatch() hooks when interrupted.\n callAfterDispatch();\n };\n };\n\n event.stopPropagation = patchStopPropagation(event.stopPropagation);\n event.stopImmediatePropagation = patchStopPropagation(\n event.stopImmediatePropagation,\n );\n\n // Add an event listener to detect the end of the event's propagation.\n const composedPath = event.composedPath();\n let lastNodeForEvent: EventTarget;\n if (event.composed && event.bubbles) {\n lastNodeForEvent = composedPath[composedPath.length - 1];\n } else if (!event.bubbles) {\n lastNodeForEvent = composedPath[0];\n } else {\n lastNodeForEvent = (composedPath[0] as Element).getRootNode();\n }\n\n lastNodeForEvent.addEventListener(\n eventType,\n () => {\n // Synchronously call afterDispatch() hooks.\n callAfterDispatch();\n },\n {once: true, signal: cleanupLastNodeListener.signal},\n );\n },\n {\n // Ensure this listener runs before other listeners.\n // `setupDispatchHooks()` should be called in constructors to also\n // ensure they run before any other externally-added capture listeners.\n capture: true,\n },\n );\n\n typesAlreadySetUp.add(eventType);\n }\n}\n"]}
|
|
@@ -25,18 +25,6 @@
|
|
|
25
25
|
--container-shape: var(--md-sys-shape-corner-md);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
@mixin square {
|
|
29
|
-
--container-shape: var(--md-sys-shape-corner-md);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@mixin selected-square {
|
|
33
|
-
--container-shape: calc(var(--container-height) / 2);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@mixin pressed {
|
|
37
|
-
--container-shape: var(--md-sys-shape-corner-sm);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
28
|
@mixin filled {
|
|
41
29
|
--container-color: var(--md-sys-color-primary);
|
|
42
30
|
--icon-color: var(--md-sys-color-on-primary);
|
|
@@ -132,14 +120,6 @@
|
|
|
132
120
|
--container-shape: var(--md-sys-shape-corner-lg);
|
|
133
121
|
}
|
|
134
122
|
|
|
135
|
-
@mixin md-square {
|
|
136
|
-
--container-shape: var(--md-sys-shape-corner-lg);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@mixin md-pressed {
|
|
140
|
-
--container-shape: var(--md-sys-shape-corner-md);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
123
|
@mixin lg {
|
|
144
124
|
--container-height: 96px;
|
|
145
125
|
--icon-label-space: 12px;
|
|
@@ -154,14 +134,6 @@
|
|
|
154
134
|
--container-shape: var(--md-sys-shape-corner-xl);
|
|
155
135
|
}
|
|
156
136
|
|
|
157
|
-
@mixin lg-square {
|
|
158
|
-
--container-shape: var(--md-sys-shape-corner-xl);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
@mixin lg-pressed {
|
|
162
|
-
--container-shape: var(--md-sys-shape-corner-lg);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
137
|
@mixin xl {
|
|
166
138
|
--container-height: 136px;
|
|
167
139
|
--icon-label-space: 16px;
|
|
@@ -176,11 +148,39 @@
|
|
|
176
148
|
--container-shape: var(--md-sys-shape-corner-xl);
|
|
177
149
|
}
|
|
178
150
|
|
|
179
|
-
@mixin
|
|
151
|
+
@mixin square {
|
|
152
|
+
--container-shape: var(--md-sys-shape-corner-md);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@mixin square-md {
|
|
156
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@mixin square-lg {
|
|
160
|
+
--container-shape: var(--md-sys-shape-corner-xl);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@mixin square-xl {
|
|
180
164
|
--container-shape: var(--md-sys-shape-corner-xl);
|
|
181
165
|
}
|
|
182
166
|
|
|
183
|
-
@mixin
|
|
167
|
+
@mixin square-selected {
|
|
168
|
+
--container-shape: calc(var(--container-height) / 2);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@mixin pressed {
|
|
172
|
+
--container-shape: var(--md-sys-shape-corner-sm);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@mixin pressed-md {
|
|
176
|
+
--container-shape: var(--md-sys-shape-corner-md);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@mixin pressed-lg {
|
|
180
|
+
--container-shape: var(--md-sys-shape-corner-lg);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@mixin pressed-xl {
|
|
184
184
|
--container-shape: var(--md-sys-shape-corner-lg);
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2026 Google LLC
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/@layer md.sys, md.comp.ripple, md.comp.focus-ring;@layer md.comp.button{.btn{--container-color: transparent;--container-height: auto;--container-elevation: var(--md-sys-elevation-shadow-0);--container-shape: calc(var(--container-height) / 2);--outline-width: 0;--outline-color: transparent;--icon-label-space: 8px;--icon-color: currentColor;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--label-text-color: currentColor;--leading-space: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md)}.btn.btn-
|
|
4
|
+
*/@layer md.sys, md.comp.ripple, md.comp.focus-ring;@layer md.comp.button{.btn{--container-color: transparent;--container-height: auto;--container-elevation: var(--md-sys-elevation-shadow-0);--container-shape: calc(var(--container-height) / 2);--outline-width: 0;--outline-color: transparent;--icon-label-space: 8px;--icon-color: currentColor;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--label-text-color: currentColor;--leading-space: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md)}.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);--outline-width: 1px}.btn.btn-outlined:where(.btn-lg){--outline-width: 2px}.btn.btn-outlined:where(.btn-xl){--outline-width: 3px}.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)}.btn.btn-text{--label-text-color: var(--md-sys-color-primary);--icon-color: var(--md-sys-color-primary);--state-layer-color: var(--md-sys-color-primary)}.btn.btn-xs{--container-height: 32px;--leading-space: 12px;--trailing-space: 12px}.btn.btn-sm{--container-height: 40px;--leading-space: 16px;--trailing-space: 16px}.btn.btn-md{--container-height: 56px;--leading-space: 24px;--trailing-space: 24px;--icon-size: 24px;--label-text: var(--md-sys-typescale-title-md);--label-text-tracking: var(--md-sys-typescale-title-md-tracking)}.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;--leading-space: 48px;--trailing-space: 48px;--label-text: var(--md-sys-typescale-headline-sm);--label-text-tracking: var(--md-sys-typescale-headline-sm-tracking)}.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;--leading-space: 64px;--trailing-space: 64px;--label-text: var(--md-sys-typescale-headline-lg);--label-text-tracking: var(--md-sys-typescale-headline-lg-tracking)}.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)){--container-shape: var(--md-sys-shape-corner-sm)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-md){--container-shape: var(--md-sys-shape-corner-md)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-lg){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-xl){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:disabled,.disabled){--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%)}.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);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){cursor:pointer}}/*# sourceMappingURL=button.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["button.scss","_button-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kDACA,sBACE,KCLA,+BACA,yBACA,wDACA,qDACA,mBACA,6BACA,wBACA,2BACA,kBACA,+CACA,iEACA,iCACA,mBACA,iCACA,oBDPE,2CCWF,iDDRE,gBCYF
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["button.scss","_button-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kDACA,sBACE,KCLA,+BACA,yBACA,wDACA,qDACA,mBACA,6BACA,wBACA,2BACA,kBACA,+CACA,iEACA,iCACA,mBACA,iCACA,oBDPE,2CCWF,iDDRE,gBCYF,+CACA,6CACA,mDDZI,4DCgBJ,yDACA,qDACA,2DDfI,yDCmBJ,+CACA,6CACA,mDDjBE,kBCqBF,6DACA,wDACA,0CACA,gDDtBI,2DC0BJ,+CACA,6CACA,mDDxBE,eC4BF,2DACA,yDACA,+DD5BI,wDCgCJ,iDACA,+CACA,qDD9BE,kBCkCF,qDACA,2DACA,qDACA,qBDnCI,iCCuCJ,qBDpCI,iCCwCJ,qBDrCI,2DCyCJ,uDACA,qDACA,2DDvCE,cC2CF,gDACA,0CACA,iDD1CE,YC8CF,yBACA,sBACA,uBD7CE,YCiDF,yBACA,sBACA,uBDhDE,YCoDF,yBACA,sBACA,uBACA,kBACA,+CACA,iEDvDI,qDC2DJ,iDDvDE,YC2DF,yBACA,yBACA,kBACA,sBACA,uBACA,kDACA,oED/DI,qDCmEJ,iDD/DE,YCmEF,0BACA,yBACA,kBACA,sBACA,uBACA,kDACA,oEDvEI,qDC2EJ,iDDvEE,gBC2EF,iDDzEI,+BC6EJ,iDD1EI,+BC8EJ,iDD3EI,+BC+EJ,iDD5EI,yDCgFJ,qDD5EE,0DCgFF,iDD9EI,yECkFJ,iDD/EI,yECmFJ,iDDhFI,yECoFJ,iDDhFE,6BCoFF,wEACA,wDACA,mEACA,yEDnFE,KACE,oBACA,mBACA,uBACA,mCACA,4BACA,0DACA,uDACA,qCACA,sCACA,wCACA,8BACA,uBACA,0CACA,WACE,iFAEF,mCACA,iCAEF,8BACE","file":"button.css"}
|
|
@@ -8,7 +8,7 @@ import { css } from 'lit';
|
|
|
8
8
|
export const styles = css `/*!
|
|
9
9
|
* Copyright 2026 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
-
*/@layer md.sys, md.comp.ripple, md.comp.focus-ring;@layer md.comp.button{.btn{--container-color: transparent;--container-height: auto;--container-elevation: var(--md-sys-elevation-shadow-0);--container-shape: calc(var(--container-height) / 2);--outline-width: 0;--outline-color: transparent;--icon-label-space: 8px;--icon-color: currentColor;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--label-text-color: currentColor;--leading-space: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md)}.btn.btn-
|
|
11
|
+
*/@layer md.sys, md.comp.ripple, md.comp.focus-ring;@layer md.comp.button{.btn{--container-color: transparent;--container-height: auto;--container-elevation: var(--md-sys-elevation-shadow-0);--container-shape: calc(var(--container-height) / 2);--outline-width: 0;--outline-color: transparent;--icon-label-space: 8px;--icon-color: currentColor;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--label-text-color: currentColor;--leading-space: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md)}.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);--outline-width: 1px}.btn.btn-outlined:where(.btn-lg){--outline-width: 2px}.btn.btn-outlined:where(.btn-xl){--outline-width: 3px}.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)}.btn.btn-text{--label-text-color: var(--md-sys-color-primary);--icon-color: var(--md-sys-color-primary);--state-layer-color: var(--md-sys-color-primary)}.btn.btn-xs{--container-height: 32px;--leading-space: 12px;--trailing-space: 12px}.btn.btn-sm{--container-height: 40px;--leading-space: 16px;--trailing-space: 16px}.btn.btn-md{--container-height: 56px;--leading-space: 24px;--trailing-space: 24px;--icon-size: 24px;--label-text: var(--md-sys-typescale-title-md);--label-text-tracking: var(--md-sys-typescale-title-md-tracking)}.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;--leading-space: 48px;--trailing-space: 48px;--label-text: var(--md-sys-typescale-headline-sm);--label-text-tracking: var(--md-sys-typescale-headline-sm-tracking)}.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;--leading-space: 64px;--trailing-space: 64px;--label-text: var(--md-sys-typescale-headline-lg);--label-text-tracking: var(--md-sys-typescale-headline-lg-tracking)}.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)){--container-shape: var(--md-sys-shape-corner-sm)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-md){--container-shape: var(--md-sys-shape-corner-md)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-lg){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-xl){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:disabled,.disabled){--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%)}.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);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){cursor:pointer}}
|
|
12
12
|
`;
|
|
13
13
|
export default styles.styleSheet;
|
|
14
14
|
//# sourceMappingURL=button.cssresult.js.map
|
|
@@ -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-height: auto;--container-elevation: var(--md-sys-elevation-shadow-0);--container-shape: calc(var(--container-height) / 2);--outline-width: 0;--outline-color: transparent;--icon-label-space: 8px;--icon-color: currentColor;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--label-text-color: currentColor;--leading-space: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md)}.btn.btn-
|
|
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-height: auto;--container-elevation: var(--md-sys-elevation-shadow-0);--container-shape: calc(var(--container-height) / 2);--outline-width: 0;--outline-color: transparent;--icon-label-space: 8px;--icon-color: currentColor;--icon-size: 20px;--label-text: var(--md-sys-typescale-label-lg);--label-text-tracking: var(--md-sys-typescale-label-lg-tracking);--label-text-color: currentColor;--leading-space: 0;--state-layer-color: transparent;--trailing-space: 0}.btn:is(.btn-selected,[aria-pressed=true]){--container-shape: var(--md-sys-shape-corner-md)}.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);--outline-width: 1px}.btn.btn-outlined:where(.btn-lg){--outline-width: 2px}.btn.btn-outlined:where(.btn-xl){--outline-width: 3px}.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)}.btn.btn-text{--label-text-color: var(--md-sys-color-primary);--icon-color: var(--md-sys-color-primary);--state-layer-color: var(--md-sys-color-primary)}.btn.btn-xs{--container-height: 32px;--leading-space: 12px;--trailing-space: 12px}.btn.btn-sm{--container-height: 40px;--leading-space: 16px;--trailing-space: 16px}.btn.btn-md{--container-height: 56px;--leading-space: 24px;--trailing-space: 24px;--icon-size: 24px;--label-text: var(--md-sys-typescale-title-md);--label-text-tracking: var(--md-sys-typescale-title-md-tracking)}.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;--leading-space: 48px;--trailing-space: 48px;--label-text: var(--md-sys-typescale-headline-sm);--label-text-tracking: var(--md-sys-typescale-headline-sm-tracking)}.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;--leading-space: 64px;--trailing-space: 64px;--label-text: var(--md-sys-typescale-headline-lg);--label-text-tracking: var(--md-sys-typescale-headline-lg-tracking)}.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)){--container-shape: var(--md-sys-shape-corner-sm)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-md){--container-shape: var(--md-sys-shape-corner-md)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-lg){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:active,.active):where(:not(:disabled,.disabled)):where(.btn-xl){--container-shape: var(--md-sys-shape-corner-lg)}.btn:is(:disabled,.disabled){--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%)}.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);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){cursor:pointer}}\n`;\nexport default styles.styleSheet!;\n"]}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AttributePart } from 'lit';
|
|
7
|
-
import { Directive, DirectiveParameters } from 'lit/directive.js';
|
|
8
6
|
import { type ClassInfo } from 'lit/directives/class-map.js';
|
|
9
7
|
/** Button color configuration types. */
|
|
10
8
|
export type ButtonColor = 'filled' | 'elevated' | 'tonal' | 'outlined' | 'text';
|
|
@@ -76,17 +74,6 @@ export declare function buttonClasses({ color, size, square, selected, active, d
|
|
|
76
74
|
export declare function setupButton(button: HTMLElement, opts?: {
|
|
77
75
|
signal?: AbortSignal;
|
|
78
76
|
}): void;
|
|
79
|
-
/** The state provided to the `button()` directive. */
|
|
80
|
-
export interface ButtonDirectiveState extends ButtonClassesState {
|
|
81
|
-
/** Additional classes to apply to the element. */
|
|
82
|
-
classes?: ClassInfo;
|
|
83
|
-
}
|
|
84
|
-
declare class ButtonDirective extends Directive {
|
|
85
|
-
private element?;
|
|
86
|
-
private cleanup?;
|
|
87
|
-
render(state: ButtonDirectiveState): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/class-map.js").ClassMapDirective>;
|
|
88
|
-
update({ element }: AttributePart, [state]: DirectiveParameters<this>): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/class-map.js").ClassMapDirective>;
|
|
89
|
-
}
|
|
90
77
|
/**
|
|
91
78
|
* A Lit directive that adds button styling and functionality to its element.
|
|
92
79
|
*
|
|
@@ -95,5 +82,4 @@ declare class ButtonDirective extends Directive {
|
|
|
95
82
|
* html`<button class="${button({color: 'filled'})}">Filled</button>`;
|
|
96
83
|
* ```
|
|
97
84
|
*/
|
|
98
|
-
export declare const button: (state
|
|
99
|
-
export {};
|
|
85
|
+
export declare const button: (state?: ButtonClassesState & import("@material/web/labs/gb/components/shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
import { afterDispatch, setupDispatchHooks, } from '@material/web/internal/events/dispatch-hooks.js';
|
|
7
7
|
import { focusRingClasses } from '@material/web/labs/gb/components/focus/focus-ring.js';
|
|
8
8
|
import { rippleClasses, setupRipple, } from '@material/web/labs/gb/components/ripple/ripple.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
9
|
+
import { createClassMapDirective } from '@material/web/labs/gb/components/shared/directives.js';
|
|
10
|
+
import { isDisabled, PSEUDO_CLASSES, } from '@material/web/labs/gb/components/shared/pseudo-classes.js';
|
|
12
11
|
/** Button color configurations. */
|
|
13
12
|
export const BUTTON_COLORS = {
|
|
14
13
|
filled: 'filled',
|
|
@@ -86,7 +85,7 @@ export function setupButton(button, opts) {
|
|
|
86
85
|
// event listeners as well as prevent the default action. This is because
|
|
87
86
|
// the underlying element may not actually be `:disabled`, such as an
|
|
88
87
|
// anchor tag or a soft-disabled button.
|
|
89
|
-
if (button
|
|
88
|
+
if (isDisabled(button)) {
|
|
90
89
|
event.stopImmediatePropagation();
|
|
91
90
|
event.preventDefault();
|
|
92
91
|
return;
|
|
@@ -105,23 +104,6 @@ export function setupButton(button, opts) {
|
|
|
105
104
|
});
|
|
106
105
|
}, opts);
|
|
107
106
|
}
|
|
108
|
-
class ButtonDirective extends Directive {
|
|
109
|
-
render(state) {
|
|
110
|
-
return classMap({
|
|
111
|
-
...(state.classes || {}),
|
|
112
|
-
...buttonClasses(state),
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
update({ element }, [state]) {
|
|
116
|
-
if (element !== this.element) {
|
|
117
|
-
this.element = element;
|
|
118
|
-
this.cleanup?.abort();
|
|
119
|
-
this.cleanup = new AbortController();
|
|
120
|
-
setupButton(this.element, { signal: this.cleanup.signal });
|
|
121
|
-
}
|
|
122
|
-
return this.render(state);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
107
|
/**
|
|
126
108
|
* A Lit directive that adds button styling and functionality to its element.
|
|
127
109
|
*
|
|
@@ -130,5 +112,8 @@ class ButtonDirective extends Directive {
|
|
|
130
112
|
* html`<button class="${button({color: 'filled'})}">Filled</button>`;
|
|
131
113
|
* ```
|
|
132
114
|
*/
|
|
133
|
-
export const button =
|
|
115
|
+
export const button = createClassMapDirective({
|
|
116
|
+
getClasses: buttonClasses,
|
|
117
|
+
setupElement: setupButton,
|
|
118
|
+
});
|
|
134
119
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sDAAsD,CAAC;AACtF,OAAO,EACL,aAAa,EACb,WAAW,GACZ,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,2DAA2D,CAAC;AAEzF,OAAO,EAAC,SAAS,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAC,QAAQ,EAAiB,MAAM,6BAA6B,CAAC;AAKrE,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,EAAE,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AE,EAAC,OAAO,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,IAAI,CACL,CAAC;AACJ,CAAC;AAQD,MAAM,eAAgB,SAAQ,SAAS;IAIrC,MAAM,CAAC,KAA2B;QAChC,OAAO,QAAQ,CAAC;YACd,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;YACxB,GAAG,aAAa,CAAC,KAAK,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;IAEQ,MAAM,CACb,EAAC,OAAO,EAAgB,EACxB,CAAC,KAAK,CAA4B;QAElC,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,OAAsB,CAAC;YACtC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;YACrC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAC,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '@material/web/internal/events/dispatch-hooks.js';\nimport {focusRingClasses} from '@material/web/labs/gb/components/focus/focus-ring.js';\nimport {\n rippleClasses,\n setupRipple,\n} from '@material/web/labs/gb/components/ripple/ripple.js';\nimport {PSEUDO_CLASSES} from '@material/web/labs/gb/components/shared/pseudo-classes.js';\nimport {AttributePart} from 'lit';\nimport {Directive, directive, DirectiveParameters} from 'lit/directive.js';\nimport {classMap, type ClassInfo} from 'lit/directives/class-map.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 (\n button.matches(`.${BUTTON_CLASSES.disabled},[aria-disabled=\"true\"]`)\n ) {\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,\n );\n}\n\n/** The state provided to the `button()` directive. */\nexport interface ButtonDirectiveState extends ButtonClassesState {\n /** Additional classes to apply to the element. */\n classes?: ClassInfo;\n}\n\nclass ButtonDirective extends Directive {\n private element?: HTMLElement;\n private cleanup?: AbortController;\n\n render(state: ButtonDirectiveState) {\n return classMap({\n ...(state.classes || {}),\n ...buttonClasses(state),\n });\n }\n\n override update(\n {element}: AttributePart,\n [state]: DirectiveParameters<this>,\n ) {\n if (element !== this.element) {\n this.element = element as HTMLElement;\n this.cleanup?.abort();\n this.cleanup = new AbortController();\n setupButton(this.element, {signal: this.cleanup.signal});\n }\n\n return this.render(state);\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 = directive(ButtonDirective);\n"]}
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sDAAsD,CAAC;AACtF,OAAO,EACL,aAAa,EACb,WAAW,GACZ,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EACL,UAAU,EACV,cAAc,GACf,MAAM,2DAA2D,CAAC;AAMnE,mCAAmC;AACnC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UA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ACT,CAAC;QAED,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE;YACxB,MAAM,QAAQ,GACZ,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC;gBACnC,MAAM,CAAC,OAAO,CACZ,IAAI,cAAc,CAAC,WAAW,KAAK,cAAc,CAAC,aAAa,EAAE,CAClE,CAAC;YACJ,IAAI,KAAK,CAAC,gBAAgB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACxC,OAAO;YACT,CAAC;YAED,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC;YAChD,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;YACxC,wDAAwD;YACxD,MAAM,CAAC,aAAa,CAClB,IAAI,UAAU,CAAC,OAAO,EAAE,EAAC,OAAO,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,IAAI,CACL,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 {\n afterDispatch,\n setupDispatchHooks,\n} from '@material/web/internal/events/dispatch-hooks.js';\nimport {focusRingClasses} from '@material/web/labs/gb/components/focus/focus-ring.js';\nimport {\n rippleClasses,\n setupRipple,\n} from '@material/web/labs/gb/components/ripple/ripple.js';\nimport {createClassMapDirective} from '@material/web/labs/gb/components/shared/directives.js';\nimport {\n isDisabled,\n PSEUDO_CLASSES,\n} from '@material/web/labs/gb/components/shared/pseudo-classes.js';\nimport {type ClassInfo} from 'lit/directives/class-map.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,\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"]}
|
|
@@ -14,15 +14,6 @@
|
|
|
14
14
|
&:is(.btn-selected, [aria-pressed='true']) {
|
|
15
15
|
@include button-tokens.selected;
|
|
16
16
|
}
|
|
17
|
-
&.btn-square {
|
|
18
|
-
@include button-tokens.square;
|
|
19
|
-
}
|
|
20
|
-
&:is(.btn-selected, [aria-pressed='true']):where(.btn-square) {
|
|
21
|
-
@include button-tokens.selected-square;
|
|
22
|
-
}
|
|
23
|
-
&:is(:active, .active):where(:not(:disabled, .disabled)) {
|
|
24
|
-
@include button-tokens.pressed;
|
|
25
|
-
}
|
|
26
17
|
&.btn-filled {
|
|
27
18
|
@include button-tokens.filled;
|
|
28
19
|
&:where(.btn-unselected, [aria-pressed='false']) {
|
|
@@ -70,35 +61,44 @@
|
|
|
70
61
|
&:where(.btn-selected, [aria-pressed='true']) {
|
|
71
62
|
@include button-tokens.md-selected;
|
|
72
63
|
}
|
|
73
|
-
&:where(.btn-square) {
|
|
74
|
-
@include button-tokens.md-square;
|
|
75
|
-
}
|
|
76
|
-
&:where(:is(:active, .active):not(:disabled, .disabled)) {
|
|
77
|
-
@include button-tokens.md-pressed;
|
|
78
|
-
}
|
|
79
64
|
}
|
|
80
65
|
&.btn-lg {
|
|
81
66
|
@include button-tokens.lg;
|
|
82
67
|
&:where(.btn-selected, [aria-pressed='true']) {
|
|
83
68
|
@include button-tokens.lg-selected;
|
|
84
69
|
}
|
|
85
|
-
&:where(.btn-square) {
|
|
86
|
-
@include button-tokens.lg-square;
|
|
87
|
-
}
|
|
88
|
-
&:where(:is(:active, .active):not(:disabled, .disabled)) {
|
|
89
|
-
@include button-tokens.lg-pressed;
|
|
90
|
-
}
|
|
91
70
|
}
|
|
92
71
|
&.btn-xl {
|
|
93
72
|
@include button-tokens.xl;
|
|
94
73
|
&:where(.btn-selected, [aria-pressed='true']) {
|
|
95
74
|
@include button-tokens.xl-selected;
|
|
96
75
|
}
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
}
|
|
77
|
+
&.btn-square {
|
|
78
|
+
@include button-tokens.square;
|
|
79
|
+
&:where(.btn-md) {
|
|
80
|
+
@include button-tokens.square-md;
|
|
99
81
|
}
|
|
100
|
-
&:where(
|
|
101
|
-
@include button-tokens.
|
|
82
|
+
&:where(.btn-lg) {
|
|
83
|
+
@include button-tokens.square-lg;
|
|
84
|
+
}
|
|
85
|
+
&:where(.btn-xl) {
|
|
86
|
+
@include button-tokens.square-xl;
|
|
87
|
+
}
|
|
88
|
+
&:where(.btn-selected, [aria-pressed='true']) {
|
|
89
|
+
@include button-tokens.square-selected;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
&:is(:active, .active):where(:not(:disabled, .disabled)) {
|
|
93
|
+
@include button-tokens.pressed;
|
|
94
|
+
&:where(.btn-md) {
|
|
95
|
+
@include button-tokens.pressed-md;
|
|
96
|
+
}
|
|
97
|
+
&:where(.btn-lg) {
|
|
98
|
+
@include button-tokens.pressed-lg;
|
|
99
|
+
}
|
|
100
|
+
&:where(.btn-xl) {
|
|
101
|
+
@include button-tokens.pressed-xl;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
&:is(:disabled, .disabled) {
|