@material/web 1.0.0-pre.6 → 1.0.0-pre.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/aria/aria.d.ts +43 -0
- package/aria/aria.js +80 -0
- package/aria/aria.js.map +1 -0
- package/aria/delegate.d.ts +37 -0
- package/aria/delegate.js +53 -0
- package/aria/delegate.js.map +1 -0
- package/badge/badge.d.ts +0 -1
- package/badge/badge.js +0 -1
- package/badge/badge.js.map +1 -1
- package/badge/lib/badge.d.ts +5 -7
- package/badge/lib/badge.js +9 -12
- package/badge/lib/badge.js.map +1 -1
- package/button/lib/_elevated-button.scss +35 -6
- package/button/lib/_elevation.scss +13 -3
- package/button/lib/_filled-button.scss +35 -3
- package/button/lib/_outlined-button.scss +35 -6
- package/button/lib/_shared.scss +4 -2
- package/button/lib/_text-button.scss +35 -6
- package/button/lib/_tonal-button.scss +34 -7
- package/button/lib/button.d.ts +24 -38
- package/button/lib/button.js +40 -89
- package/button/lib/button.js.map +1 -1
- package/button/lib/elevated-button.d.ts +6 -4
- package/button/lib/elevated-button.js.map +1 -1
- package/button/lib/elevated-styles.css.js +1 -1
- package/button/lib/elevated-styles.css.js.map +1 -1
- package/button/lib/filled-button.d.ts +6 -4
- package/button/lib/filled-button.js.map +1 -1
- package/button/lib/filled-styles.css.js +1 -1
- package/button/lib/filled-styles.css.js.map +1 -1
- package/button/lib/outlined-button.d.ts +6 -4
- package/button/lib/outlined-button.js.map +1 -1
- package/button/lib/outlined-styles.css.js +1 -1
- package/button/lib/outlined-styles.css.js.map +1 -1
- package/button/lib/shared-elevation-styles.css.js +1 -1
- package/button/lib/shared-elevation-styles.css.js.map +1 -1
- package/button/lib/shared-styles.css.js +1 -1
- package/button/lib/shared-styles.css.js.map +1 -1
- package/button/lib/text-button.d.ts +5 -2
- package/button/lib/text-button.js.map +1 -1
- package/button/lib/text-styles.css.js +1 -1
- package/button/lib/text-styles.css.js.map +1 -1
- package/button/lib/tonal-button.d.ts +6 -4
- package/button/lib/tonal-button.js.map +1 -1
- package/button/lib/tonal-styles.css.js +1 -1
- package/button/lib/tonal-styles.css.js.map +1 -1
- package/checkbox/lib/_checkbox.scss +48 -47
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/checkbox/lib/checkbox.d.ts +2 -7
- package/checkbox/lib/checkbox.js +35 -62
- package/checkbox/lib/checkbox.js.map +1 -1
- package/checkbox/lib/forced-colors-styles.css.js +1 -1
- package/checkbox/lib/forced-colors-styles.css.js.map +1 -1
- package/chips/_filter-chip.scss +6 -0
- package/chips/assist-chip.js +2 -1
- package/chips/assist-chip.js.map +1 -1
- package/chips/filter-chip.d.ts +20 -0
- package/chips/filter-chip.js +25 -0
- package/chips/filter-chip.js.map +1 -0
- package/chips/lib/_assist-chip.scss +37 -3
- package/chips/lib/_elevated.scss +60 -0
- package/chips/lib/_filter-chip.scss +175 -0
- package/chips/lib/_shared.scss +48 -84
- package/chips/lib/_suggestion-chip.scss +36 -5
- package/chips/lib/assist-chip.d.ts +12 -0
- package/chips/lib/assist-chip.js +64 -0
- package/chips/lib/assist-chip.js.map +1 -1
- package/chips/lib/assist-styles.css.js +1 -1
- package/chips/lib/assist-styles.css.js.map +1 -1
- package/chips/lib/chip.d.ts +24 -16
- package/chips/lib/chip.js +53 -74
- package/chips/lib/chip.js.map +1 -1
- package/chips/lib/elevated-styles.css.js +9 -0
- package/chips/lib/elevated-styles.css.js.map +1 -0
- package/{fab/lib/fab-extended-styles.scss → chips/lib/elevated-styles.scss} +3 -3
- package/chips/lib/filter-chip.d.ts +26 -0
- package/chips/lib/filter-chip.js +80 -0
- package/chips/lib/filter-chip.js.map +1 -0
- package/chips/lib/filter-styles.css.js +9 -0
- package/chips/lib/filter-styles.css.js.map +1 -0
- package/chips/lib/filter-styles.scss +10 -0
- package/chips/lib/shared-styles.css.js +1 -1
- package/chips/lib/shared-styles.css.js.map +1 -1
- package/chips/lib/suggestion-chip.d.ts +2 -2
- package/chips/lib/suggestion-chip.js +4 -2
- package/chips/lib/suggestion-chip.js.map +1 -1
- package/chips/lib/suggestion-styles.css.js +1 -1
- package/chips/lib/suggestion-styles.css.js.map +1 -1
- package/chips/suggestion-chip.js +2 -1
- package/chips/suggestion-chip.js.map +1 -1
- package/circularprogress/harness.d.ts +1 -0
- package/circularprogress/harness.js +4 -0
- package/circularprogress/harness.js.map +1 -1
- package/circularprogress/lib/_circular-progress.scss +13 -7
- package/circularprogress/lib/circular-progress-styles.css.js +1 -1
- package/circularprogress/lib/circular-progress-styles.css.js.map +1 -1
- package/circularprogress/lib/circular-progress.d.ts +5 -7
- package/circularprogress/lib/circular-progress.js +17 -21
- package/circularprogress/lib/circular-progress.js.map +1 -1
- package/dialog/lib/_dialog.scss +8 -9
- package/dialog/lib/_tokens.scss +0 -1
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.d.ts +10 -10
- package/dialog/lib/dialog.js +33 -56
- package/dialog/lib/dialog.js.map +1 -1
- package/divider/lib/divider.js +4 -7
- package/divider/lib/divider.js.map +1 -1
- package/elevation/lib/_elevation.scss +5 -7
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/elevation/lib/elevation.d.ts +1 -1
- package/elevation/lib/elevation.js.map +1 -1
- package/fab/_fab.scss +1 -0
- package/fab/branded-fab.d.ts +56 -0
- package/fab/branded-fab.js +56 -0
- package/fab/branded-fab.js.map +1 -0
- package/fab/fab.d.ts +25 -5
- package/fab/fab.js +27 -10
- package/fab/fab.js.map +1 -1
- package/fab/harness.d.ts +1 -2
- package/fab/harness.js +1 -1
- package/fab/harness.js.map +1 -1
- package/fab/lib/_fab-branded.scss +81 -0
- package/fab/lib/_fab.scss +221 -19
- package/fab/lib/_shared.scss +161 -131
- package/fab/lib/fab-branded-styles.css.d.ts +1 -0
- package/fab/lib/fab-branded-styles.css.js +9 -0
- package/fab/lib/fab-branded-styles.css.js.map +1 -0
- package/fab/lib/fab-branded-styles.scss +10 -0
- package/fab/lib/fab-styles.css.js +1 -1
- package/fab/lib/fab-styles.css.js.map +1 -1
- package/fab/lib/fab.d.ts +18 -10
- package/fab/lib/fab.js +19 -12
- package/fab/lib/fab.js.map +1 -1
- package/fab/lib/forced-colors-styles.css.d.ts +1 -0
- package/fab/lib/forced-colors-styles.css.js +9 -0
- package/fab/lib/forced-colors-styles.css.js.map +1 -0
- package/fab/lib/forced-colors-styles.scss +26 -0
- package/fab/lib/shared-styles.css.d.ts +1 -0
- package/fab/lib/shared-styles.css.js +9 -0
- package/fab/lib/shared-styles.css.js.map +1 -0
- package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
- package/fab/lib/shared.d.ts +49 -0
- package/fab/lib/shared.js +113 -0
- package/fab/lib/shared.js.map +1 -0
- package/field/lib/_filled-field.scss +47 -12
- package/field/lib/_outlined-field.scss +39 -12
- package/field/lib/field.js +14 -27
- package/field/lib/field.js.map +1 -1
- package/field/lib/filled-styles.css.js +1 -1
- package/field/lib/filled-styles.css.js.map +1 -1
- package/field/lib/outlined-styles.css.js +1 -1
- package/field/lib/outlined-styles.css.js.map +1 -1
- package/focus/focus-ring.d.ts +2 -1
- package/focus/focus-ring.js +2 -1
- package/focus/focus-ring.js.map +1 -1
- package/focus/lib/_focus-ring.scss +49 -34
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/focus/lib/focus-ring.d.ts +59 -12
- package/focus/lib/focus-ring.js +118 -14
- package/focus/lib/focus-ring.js.map +1 -1
- package/icon/icon.d.ts +0 -1
- package/icon/icon.js +0 -1
- package/icon/icon.js.map +1 -1
- package/icon/lib/_icon.scss +2 -0
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-styles.css.js.map +1 -1
- package/icon/lib/icon.d.ts +5 -4
- package/icon/lib/icon.js +3 -2
- package/icon/lib/icon.js.map +1 -1
- package/iconbutton/filled-icon-button.d.ts +6 -2
- package/iconbutton/filled-icon-button.js.map +1 -1
- package/iconbutton/filled-tonal-icon-button.d.ts +6 -2
- package/iconbutton/filled-tonal-icon-button.js.map +1 -1
- package/iconbutton/harness.d.ts +1 -1
- package/iconbutton/harness.js +4 -1
- package/iconbutton/harness.js.map +1 -1
- package/iconbutton/lib/_filled-icon-button.scss +38 -13
- package/iconbutton/lib/_filled-tonal-icon-button.scss +38 -11
- package/iconbutton/lib/_outlined-icon-button.scss +38 -13
- package/iconbutton/lib/_shared.scss +4 -6
- package/iconbutton/lib/_standard-icon-button.scss +14 -14
- package/iconbutton/lib/filled-styles.css.js +1 -1
- package/iconbutton/lib/filled-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/lib/icon-button.d.ts +17 -25
- package/iconbutton/lib/icon-button.js +37 -73
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/iconbutton/lib/outlined-styles.css.js +1 -1
- package/iconbutton/lib/outlined-styles.css.js.map +1 -1
- package/iconbutton/lib/shared-styles.css.js +1 -1
- package/iconbutton/lib/shared-styles.css.js.map +1 -1
- package/iconbutton/lib/standard-styles.css.js +1 -1
- package/iconbutton/lib/standard-styles.css.js.map +1 -1
- package/iconbutton/outlined-icon-button.d.ts +5 -2
- package/iconbutton/outlined-icon-button.js.map +1 -1
- package/iconbutton/standard-icon-button.d.ts +5 -2
- package/iconbutton/standard-icon-button.js.map +1 -1
- package/linearprogress/_linear-progress.scss +6 -0
- package/linearprogress/harness.d.ts +13 -0
- package/linearprogress/harness.js +18 -0
- package/linearprogress/harness.js.map +1 -0
- package/linearprogress/lib/_linear-progress.scss +386 -0
- package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
- package/linearprogress/lib/linear-progress-styles.css.js +9 -0
- package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
- package/linearprogress/lib/linear-progress-styles.scss +8 -0
- package/linearprogress/lib/linear-progress.d.ts +35 -0
- package/linearprogress/lib/linear-progress.js +127 -0
- package/linearprogress/lib/linear-progress.js.map +1 -0
- package/linearprogress/linear-progress.d.ts +23 -0
- package/linearprogress/linear-progress.js +26 -0
- package/linearprogress/linear-progress.js.map +1 -0
- package/list/lib/_list.scss +9 -50
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/list.d.ts +8 -15
- package/list/lib/list.js +20 -45
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +17 -72
- package/list/lib/listitem/forced-colors-styles.css.js +1 -1
- package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item-styles.css.js +1 -1
- package/list/lib/listitem/list-item-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item.d.ts +29 -31
- package/list/lib/listitem/list-item.js +26 -80
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js +5 -9
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/menu/lib/_menu.scss +9 -29
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu.d.ts +32 -41
- package/menu/lib/menu.js +51 -82
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +16 -33
- package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
- package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
- package/menu/lib/menuitem/menu-item.d.ts +1 -1
- package/menu/lib/menuitem/menu-item.js +4 -6
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
- package/menu/lib/menuitemlink/menu-item-link.js +3 -6
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +20 -2
- package/menu/lib/shared.js +18 -0
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +16 -13
- package/menu/lib/submenuitem/sub-menu-item.js +27 -18
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/typeaheadController.d.ts +9 -9
- package/menu/lib/typeaheadController.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +7 -1
- package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
- package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
- package/navigationbar/lib/navigation-bar.d.ts +6 -6
- package/navigationbar/lib/navigation-bar.js +17 -18
- package/navigationbar/lib/navigation-bar.js.map +1 -1
- package/navigationbar/navigation-bar.d.ts +0 -1
- package/navigationbar/navigation-bar.js +0 -1
- package/navigationbar/navigation-bar.js.map +1 -1
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
- package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
- package/navigationdrawer/lib/_shared.scss +1 -4
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal.d.ts +7 -12
- package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer.d.ts +6 -10
- package/navigationdrawer/lib/navigation-drawer.js +17 -38
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
- package/navigationdrawer/lib/shared-styles.css.js +1 -1
- package/navigationdrawer/lib/shared-styles.css.js.map +1 -1
- package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
- package/navigationdrawer/navigation-drawer-modal.js +0 -1
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/navigation-drawer.d.ts +0 -1
- package/navigationdrawer/navigation-drawer.js +0 -1
- package/navigationdrawer/navigation-drawer.js.map +1 -1
- package/navigationtab/lib/_navigation-tab.scss +2 -2
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/navigationtab/lib/navigation-tab.d.ts +16 -29
- package/navigationtab/lib/navigation-tab.js +49 -88
- package/navigationtab/lib/navigation-tab.js.map +1 -1
- package/navigationtab/lib/state.d.ts +1 -1
- package/navigationtab/lib/state.js.map +1 -1
- package/navigationtab/navigation-tab.d.ts +0 -1
- package/navigationtab/navigation-tab.js +0 -1
- package/navigationtab/navigation-tab.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/_radio.scss +1 -1
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/radio/lib/radio.d.ts +2 -8
- package/radio/lib/radio.js +31 -58
- package/radio/lib/radio.js.map +1 -1
- package/ripple/lib/ripple.js +11 -13
- package/ripple/lib/ripple.js.map +1 -1
- package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
- package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
- package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
- package/segmentedbutton/lib/segmented-button.d.ts +28 -40
- package/segmentedbutton/lib/segmented-button.js +42 -96
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
- package/segmentedbutton/outlined-segmented-button.js +0 -1
- package/segmentedbutton/outlined-segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +32 -13
- package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
- package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
- package/select/_filled-select.scss +6 -0
- package/select/_outlined-select.scss +6 -0
- package/select/filled-select.d.ts +41 -0
- package/select/filled-select.js +46 -0
- package/select/filled-select.js.map +1 -0
- package/select/harness.d.ts +24 -0
- package/select/harness.js +53 -0
- package/select/harness.js.map +1 -0
- package/select/lib/_filled-select.scss +222 -0
- package/select/lib/_outlined-select.scss +180 -0
- package/select/lib/_shared.scss +48 -0
- package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/filled-forced-colors-styles.css.js +9 -0
- package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
- package/select/lib/filled-forced-colors-styles.scss +29 -0
- package/select/lib/filled-select-styles.css.d.ts +1 -0
- package/select/lib/filled-select-styles.css.js +9 -0
- package/select/lib/filled-select-styles.css.js.map +1 -0
- package/select/lib/filled-select-styles.scss +10 -0
- package/select/lib/filled-select.d.ts +10 -0
- package/select/lib/filled-select.js +16 -0
- package/select/lib/filled-select.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/outlined-forced-colors-styles.css.js +9 -0
- package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.scss +29 -0
- package/select/lib/outlined-select-styles.css.d.ts +1 -0
- package/select/lib/outlined-select-styles.css.js +9 -0
- package/select/lib/outlined-select-styles.css.js.map +1 -0
- package/select/lib/outlined-select-styles.scss +10 -0
- package/select/lib/outlined-select.d.ts +10 -0
- package/select/lib/outlined-select.js +16 -0
- package/select/lib/outlined-select.js.map +1 -0
- package/select/lib/select.d.ts +216 -0
- package/select/lib/select.js +589 -0
- package/select/lib/select.js.map +1 -0
- package/select/lib/selectoption/harness.d.ts +11 -0
- package/select/lib/selectoption/harness.js +12 -0
- package/select/lib/selectoption/harness.js.map +1 -0
- package/select/lib/selectoption/select-option.d.ts +30 -0
- package/select/lib/selectoption/select-option.js +71 -0
- package/select/lib/selectoption/select-option.js.map +1 -0
- package/select/lib/shared-styles.css.d.ts +1 -0
- package/select/lib/shared-styles.css.js +9 -0
- package/select/lib/shared-styles.css.js.map +1 -0
- package/select/lib/shared-styles.scss +10 -0
- package/select/lib/shared.d.ts +52 -0
- package/select/lib/shared.js +41 -0
- package/select/lib/shared.js.map +1 -0
- package/select/outlined-select.d.ts +41 -0
- package/select/outlined-select.js +46 -0
- package/select/outlined-select.js.map +1 -0
- package/select/select-option.d.ts +44 -0
- package/select/select-option.js +51 -0
- package/select/select-option.js.map +1 -0
- package/slider/harness.d.ts +2 -1
- package/slider/harness.js +14 -9
- package/slider/harness.js.map +1 -1
- package/slider/lib/_slider.scss +149 -167
- package/slider/lib/forced-colors-styles.css.js +1 -1
- package/slider/lib/forced-colors-styles.css.js.map +1 -1
- package/slider/lib/forced-colors-styles.scss +2 -2
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/slider/lib/slider.d.ts +23 -57
- package/slider/lib/slider.js +77 -167
- package/slider/lib/slider.js.map +1 -1
- package/switch/lib/_switch.scss +63 -18
- package/switch/lib/switch-styles.css.js +1 -1
- package/switch/lib/switch-styles.css.js.map +1 -1
- package/switch/lib/switch.d.ts +0 -7
- package/switch/lib/switch.js +32 -79
- package/switch/lib/switch.js.map +1 -1
- package/textfield/harness.d.ts +1 -1
- package/textfield/harness.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +70 -14
- package/textfield/lib/_outlined-text-field.scss +60 -35
- package/textfield/lib/filled-forced-colors-styles.css.js +1 -1
- package/textfield/lib/filled-forced-colors-styles.css.js.map +1 -1
- package/textfield/lib/filled-styles.css.js +1 -1
- package/textfield/lib/filled-styles.css.js.map +1 -1
- package/textfield/lib/outlined-forced-colors-styles.css.js +1 -1
- package/textfield/lib/outlined-forced-colors-styles.css.js.map +1 -1
- package/textfield/lib/outlined-styles.css.js +1 -1
- package/textfield/lib/outlined-styles.css.js.map +1 -1
- package/textfield/lib/text-field.d.ts +1 -11
- package/textfield/lib/text-field.js +45 -115
- package/textfield/lib/text-field.js.map +1 -1
- package/tokens/_index.scss +5 -18
- package/tokens/_md-comp-assist-chip.scss +25 -29
- package/tokens/_md-comp-checkbox.scss +78 -1
- package/tokens/_md-comp-circular-progress-indicator.scss +39 -13
- package/tokens/_md-comp-elevated-button.scss +0 -10
- package/tokens/_md-comp-elevation.scss +0 -4
- package/tokens/_md-comp-fab-branded.scss +84 -1
- package/tokens/_md-comp-fab.scss +249 -0
- package/tokens/_md-comp-filled-button.scss +0 -10
- package/{field/lib → tokens}/_md-comp-filled-field.scss +91 -9
- package/tokens/_md-comp-filled-icon-button.scss +46 -1
- package/tokens/_md-comp-filled-select.scss +124 -1
- package/tokens/_md-comp-filled-text-field.scss +93 -9
- package/tokens/_md-comp-filled-tonal-button.scss +0 -11
- package/tokens/_md-comp-filled-tonal-icon-button.scss +45 -3
- package/tokens/_md-comp-filter-chip.scss +103 -103
- package/tokens/_md-comp-focus-ring.scss +23 -24
- package/tokens/_md-comp-icon-button.scss +37 -1
- package/tokens/_md-comp-input-chip.scss +77 -95
- package/tokens/_md-comp-linear-progress-indicator.scss +31 -3
- package/tokens/_md-comp-list-item.scss +174 -0
- package/tokens/_md-comp-list.scss +81 -26
- package/tokens/_md-comp-menu-item.scss +50 -0
- package/tokens/_md-comp-menu.scss +29 -2
- package/tokens/_md-comp-outlined-button.scss +0 -10
- package/{field/lib → tokens}/_md-comp-outlined-field.scss +85 -9
- package/tokens/_md-comp-outlined-icon-button.scss +41 -1
- package/tokens/_md-comp-outlined-segmented-button.scss +57 -11
- package/tokens/_md-comp-outlined-select.scss +123 -1
- package/tokens/_md-comp-outlined-text-field.scss +85 -8
- package/tokens/_md-comp-slider.scss +13 -1
- package/tokens/_md-comp-suggestion-chip.scss +29 -30
- package/tokens/_md-comp-switch.scss +81 -1
- package/tokens/_md-comp-text-button.scss +0 -10
- package/tokens/_values.scss +2 -4
- package/types/aria.d.ts +59 -1
- package/actionelement/action-element.d.ts +0 -79
- package/actionelement/action-element.js +0 -97
- package/actionelement/action-element.js.map +0 -1
- package/button/lib/state.d.ts +0 -10
- package/button/lib/state.js +0 -7
- package/button/lib/state.js.map +0 -1
- package/controller/action-controller.d.ts +0 -147
- package/controller/action-controller.js +0 -286
- package/controller/action-controller.js.map +0 -1
- package/decorators/aria-property.d.ts +0 -32
- package/decorators/aria-property.js +0 -99
- package/decorators/aria-property.js.map +0 -1
- package/fab/_fab-extended.scss +0 -6
- package/fab/fab-extended.d.ts +0 -23
- package/fab/fab-extended.js +0 -29
- package/fab/fab-extended.js.map +0 -1
- package/fab/lib/_fab-extended.scss +0 -73
- package/fab/lib/fab-extended-styles.css.js +0 -9
- package/fab/lib/fab-extended-styles.css.js.map +0 -1
- package/fab/lib/fab-extended.d.ts +0 -19
- package/fab/lib/fab-extended.js +0 -28
- package/fab/lib/fab-extended.js.map +0 -1
- package/fab/lib/fab-shared-styles.css.js +0 -9
- package/fab/lib/fab-shared-styles.css.js.map +0 -1
- package/fab/lib/fab-shared.d.ts +0 -44
- package/fab/lib/fab-shared.js +0 -121
- package/fab/lib/fab-shared.js.map +0 -1
- package/focus/strong-focus.d.ts +0 -56
- package/focus/strong-focus.js +0 -96
- package/focus/strong-focus.js.map +0 -1
- package/sass/_shape.scss +0 -154
- package/slider/lib/_tokens.scss +0 -65
- package/tokens/_md-comp-extended-fab-branded.scss +0 -45
- package/tokens/_md-comp-extended-fab-primary.scss +0 -45
- package/tokens/_md-comp-extended-fab-secondary.scss +0 -48
- package/tokens/_md-comp-extended-fab-surface.scss +0 -45
- package/tokens/_md-comp-extended-fab-tertiary.scss +0 -48
- package/tokens/_md-comp-fab-branded-large.scss +0 -23
- package/tokens/_md-comp-fab-primary-large.scss +0 -23
- package/tokens/_md-comp-fab-primary-small.scss +0 -23
- package/tokens/_md-comp-fab-primary.scss +0 -23
- package/tokens/_md-comp-fab-secondary-large.scss +0 -23
- package/tokens/_md-comp-fab-secondary-small.scss +0 -23
- package/tokens/_md-comp-fab-secondary.scss +0 -23
- package/tokens/_md-comp-fab-surface-large.scss +0 -23
- package/tokens/_md-comp-fab-surface-small.scss +0 -23
- package/tokens/_md-comp-fab-surface.scss +0 -23
- package/tokens/_md-comp-fab-tertiary-large.scss +0 -23
- package/tokens/_md-comp-fab-tertiary-small.scss +0 -23
- package/tokens/_md-comp-fab-tertiary.scss +0 -23
- /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/elevated-styles.css.d.ts} +0 -0
- /package/{fab/lib/fab-shared-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
|
@@ -3,23 +3,70 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { LitElement } from 'lit';
|
|
6
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* `:focus-visible`.
|
|
10
|
-
*
|
|
11
|
-
* @description
|
|
12
|
-
* An accessible, themable ring designed to be shown on focus-visible.
|
|
13
|
-
* Focus ring is designed to be controlled by the `strong-focus` module in the
|
|
14
|
-
* same package.
|
|
15
|
-
*
|
|
16
|
-
* In most cases, `visible` should be set to
|
|
17
|
-
* `shouldShowStrongFocus()` on `focus` and `pointerdown` (see `pointerPress()`
|
|
18
|
-
* documentation in the `strong-focus` module), and `false` on `blur`.
|
|
8
|
+
* A focus ring component.
|
|
19
9
|
*/
|
|
20
10
|
export declare class FocusRing extends LitElement {
|
|
21
11
|
/**
|
|
22
12
|
* Makes the focus ring visible.
|
|
23
13
|
*/
|
|
24
14
|
visible: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Reflects the value of the `for` attribute, which is the ID of the focus
|
|
17
|
+
* ring's associated control element.
|
|
18
|
+
*
|
|
19
|
+
* Use this when the focus ring's associated element is not a parent element.
|
|
20
|
+
*
|
|
21
|
+
* To manually control a focus ring, set its `for` attribute to `""`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```html
|
|
25
|
+
* <div class="container">
|
|
26
|
+
* <md-focus-ring for="interactive"></md-focus-ring>
|
|
27
|
+
* <button id="interactive">Action</button>
|
|
28
|
+
* </div>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```html
|
|
33
|
+
* <button class="manually-controlled">
|
|
34
|
+
* <md-focus-ring visible for=""></md-focus-ring>
|
|
35
|
+
* </button>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
htmlFor: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The element that controls the visibility of the focus ring. It is one of:
|
|
41
|
+
*
|
|
42
|
+
* - The element referenced by the `for` attribute.
|
|
43
|
+
* - The element provided to `.attach(element)`
|
|
44
|
+
* - The parent element.
|
|
45
|
+
* - `null` if the focus ring is not controlled.
|
|
46
|
+
*/
|
|
47
|
+
get control(): HTMLElement;
|
|
48
|
+
private currentControl;
|
|
49
|
+
/**
|
|
50
|
+
* Attaches the focus ring to an interactive element.
|
|
51
|
+
*
|
|
52
|
+
* @param control The element that controls the focus ring.
|
|
53
|
+
*/
|
|
54
|
+
attach(control: HTMLElement): void;
|
|
55
|
+
/**
|
|
56
|
+
* Detaches the focus ring from its current interactive element.
|
|
57
|
+
*/
|
|
58
|
+
detach(): void;
|
|
59
|
+
connectedCallback(): void;
|
|
60
|
+
disconnectedCallback(): void;
|
|
61
|
+
protected updated(changedProperties: PropertyValues<FocusRing>): void;
|
|
62
|
+
/**
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
handleEvent(event: FocusRingEvent): void;
|
|
66
|
+
private setCurrentControl;
|
|
67
|
+
}
|
|
68
|
+
declare const HANDLED_BY_FOCUS_RING: unique symbol;
|
|
69
|
+
interface FocusRingEvent extends Event {
|
|
70
|
+
[HANDLED_BY_FOCUS_RING]: true;
|
|
25
71
|
}
|
|
72
|
+
export {};
|
package/focus/lib/focus-ring.js
CHANGED
|
@@ -3,21 +3,11 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { __decorate
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
7
|
import { LitElement } from 'lit';
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* `:focus-visible`.
|
|
12
|
-
*
|
|
13
|
-
* @description
|
|
14
|
-
* An accessible, themable ring designed to be shown on focus-visible.
|
|
15
|
-
* Focus ring is designed to be controlled by the `strong-focus` module in the
|
|
16
|
-
* same package.
|
|
17
|
-
*
|
|
18
|
-
* In most cases, `visible` should be set to
|
|
19
|
-
* `shouldShowStrongFocus()` on `focus` and `pointerdown` (see `pointerPress()`
|
|
20
|
-
* documentation in the `strong-focus` module), and `false` on `blur`.
|
|
10
|
+
* A focus ring component.
|
|
21
11
|
*/
|
|
22
12
|
export class FocusRing extends LitElement {
|
|
23
13
|
constructor() {
|
|
@@ -26,10 +16,124 @@ export class FocusRing extends LitElement {
|
|
|
26
16
|
* Makes the focus ring visible.
|
|
27
17
|
*/
|
|
28
18
|
this.visible = false;
|
|
19
|
+
/**
|
|
20
|
+
* Reflects the value of the `for` attribute, which is the ID of the focus
|
|
21
|
+
* ring's associated control element.
|
|
22
|
+
*
|
|
23
|
+
* Use this when the focus ring's associated element is not a parent element.
|
|
24
|
+
*
|
|
25
|
+
* To manually control a focus ring, set its `for` attribute to `""`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```html
|
|
29
|
+
* <div class="container">
|
|
30
|
+
* <md-focus-ring for="interactive"></md-focus-ring>
|
|
31
|
+
* <button id="interactive">Action</button>
|
|
32
|
+
* </div>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```html
|
|
37
|
+
* <button class="manually-controlled">
|
|
38
|
+
* <md-focus-ring visible for=""></md-focus-ring>
|
|
39
|
+
* </button>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
this.htmlFor = null;
|
|
43
|
+
this.currentControl = null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The element that controls the visibility of the focus ring. It is one of:
|
|
47
|
+
*
|
|
48
|
+
* - The element referenced by the `for` attribute.
|
|
49
|
+
* - The element provided to `.attach(element)`
|
|
50
|
+
* - The parent element.
|
|
51
|
+
* - `null` if the focus ring is not controlled.
|
|
52
|
+
*/
|
|
53
|
+
get control() {
|
|
54
|
+
if (this.hasAttribute('for')) {
|
|
55
|
+
if (!this.htmlFor) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return this.getRootNode()
|
|
59
|
+
.querySelector(`#${this.htmlFor}`);
|
|
60
|
+
}
|
|
61
|
+
return this.currentControl || this.parentElement;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Attaches the focus ring to an interactive element.
|
|
65
|
+
*
|
|
66
|
+
* @param control The element that controls the focus ring.
|
|
67
|
+
*/
|
|
68
|
+
attach(control) {
|
|
69
|
+
if (control === this.currentControl) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.setCurrentControl(control);
|
|
73
|
+
// When imperatively attaching the focus ring, remove the `for` attribute so
|
|
74
|
+
// that the attached control is used instead of a referenced one.
|
|
75
|
+
this.removeAttribute('for');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Detaches the focus ring from its current interactive element.
|
|
79
|
+
*/
|
|
80
|
+
detach() {
|
|
81
|
+
this.setCurrentControl(null);
|
|
82
|
+
// When imperatively detaching, add an empty `for=""` attribute. This will
|
|
83
|
+
// ensure the control is `null` rather than the `parentElement`.
|
|
84
|
+
this.setAttribute('for', '');
|
|
85
|
+
}
|
|
86
|
+
connectedCallback() {
|
|
87
|
+
super.connectedCallback();
|
|
88
|
+
this.setCurrentControl(this.control);
|
|
89
|
+
}
|
|
90
|
+
disconnectedCallback() {
|
|
91
|
+
super.disconnectedCallback();
|
|
92
|
+
this.setCurrentControl(null);
|
|
93
|
+
}
|
|
94
|
+
updated(changedProperties) {
|
|
95
|
+
if (changedProperties.has('htmlFor')) {
|
|
96
|
+
const { control } = this;
|
|
97
|
+
if (control) {
|
|
98
|
+
this.setCurrentControl(control);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
handleEvent(event) {
|
|
106
|
+
if (event[HANDLED_BY_FOCUS_RING]) {
|
|
107
|
+
// This ensures the focus ring does not activate when multiple focus rings
|
|
108
|
+
// are used within a single component.
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
switch (event.type) {
|
|
112
|
+
default:
|
|
113
|
+
return;
|
|
114
|
+
case 'focusin':
|
|
115
|
+
this.visible = this.control?.matches(':focus-visible') ?? false;
|
|
116
|
+
break;
|
|
117
|
+
case 'focusout':
|
|
118
|
+
case 'pointerdown':
|
|
119
|
+
this.visible = false;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
event[HANDLED_BY_FOCUS_RING] = true;
|
|
123
|
+
}
|
|
124
|
+
setCurrentControl(control) {
|
|
125
|
+
for (const event of ['focusin', 'focusout', 'pointerdown']) {
|
|
126
|
+
this.currentControl?.removeEventListener(event, this);
|
|
127
|
+
control?.addEventListener(event, this);
|
|
128
|
+
}
|
|
129
|
+
this.currentControl = control;
|
|
29
130
|
}
|
|
30
131
|
}
|
|
31
132
|
__decorate([
|
|
32
|
-
property({ type: Boolean, reflect: true })
|
|
33
|
-
__metadata("design:type", Object)
|
|
133
|
+
property({ type: Boolean, reflect: true })
|
|
34
134
|
], FocusRing.prototype, "visible", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ attribute: 'for', reflect: true })
|
|
137
|
+
], FocusRing.prototype, "htmlFor", void 0);
|
|
138
|
+
const HANDLED_BY_FOCUS_RING = Symbol('handledByFocusRing');
|
|
35
139
|
//# sourceMappingURL=focus-ring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-ring.js","sourceRoot":"","sources":["focus-ring.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"focus-ring.js","sourceRoot":"","sources":["focus-ring.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,UAAU,EAAiB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IAAzC;;QACE;;WAEG;QACuC,YAAO,GAAG,KAAK,CAAC;QAE1D;;;;;;;;;;;;;;;;;;;;;;WAsBG;QAC0C,YAAO,GAAgB,IAAI,CAAC;QAuBjE,mBAAc,GAAqB,IAAI,CAAC;IAgFlD,CAAC;IArGC;;;;;;;OAOG;IACH,IAAI,OAAO;QACT,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACjB,OAAO,IAAI,CAAC;aACb;YAED,OAAQ,IAAI,CAAC,WAAW,EAA4B;iBAC/C,aAAa,CAAc,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;SACrD;QAED,OAAO,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,aAAa,CAAC;IACnD,CAAC;IAID;;;;OAIG;IACH,MAAM,CAAC,OAAoB;QACzB,IAAI,OAAO,KAAK,IAAI,CAAC,cAAc,EAAE;YACnC,OAAO;SACR;QAED,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChC,4EAA4E;QAC5E,iEAAiE;QACjE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC7B,0EAA0E;QAC1E,gEAAgE;QAChE,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAEQ,oBAAoB;QAC3B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEkB,OAAO,CAAC,iBAA4C;QACrE,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACpC,MAAM,EAAC,OAAO,EAAC,GAAG,IAAI,CAAC;YACvB,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;aACjC;SACF;IACH,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,KAAqB;QAC/B,IAAI,KAAK,CAAC,qBAAqB,CAAC,EAAE;YAChC,0EAA0E;YAC1E,sCAAsC;YACtC,OAAO;SACR;QAED,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB;gBACE,OAAO;YACT,KAAK,SAAS;gBACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC;gBAChE,MAAM;YACR,KAAK,UAAU,CAAC;YAChB,KAAK,aAAa;gBAChB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;gBACrB,MAAM;SACT;QAED,KAAK,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;IACtC,CAAC;IAEO,iBAAiB,CAAC,OAAyB;QACjD,KAAK,MAAM,KAAK,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE;YAC1D,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACtD,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SACxC;QAED,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;CACF;AAhI2C;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAiB;AAyBb;IAA5C,QAAQ,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAA6B;AAyG3E,MAAM,qBAAqB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {LitElement, PropertyValues} from 'lit';\nimport {property} from 'lit/decorators.js';\n\n/**\n * A focus ring component.\n */\nexport class FocusRing extends LitElement {\n /**\n * Makes the focus ring visible.\n */\n @property({type: Boolean, reflect: true}) visible = false;\n\n /**\n * Reflects the value of the `for` attribute, which is the ID of the focus\n * ring's associated control element.\n *\n * Use this when the focus ring's associated element is not a parent element.\n *\n * To manually control a focus ring, set its `for` attribute to `\"\"`.\n *\n * @example\n * ```html\n * <div class=\"container\">\n * <md-focus-ring for=\"interactive\"></md-focus-ring>\n * <button id=\"interactive\">Action</button>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <button class=\"manually-controlled\">\n * <md-focus-ring visible for=\"\"></md-focus-ring>\n * </button>\n * ```\n */\n @property({attribute: 'for', reflect: true}) htmlFor: string|null = null;\n\n /**\n * The element that controls the visibility of the focus ring. It is one of:\n *\n * - The element referenced by the `for` attribute.\n * - The element provided to `.attach(element)`\n * - The parent element.\n * - `null` if the focus ring is not controlled.\n */\n get control() {\n if (this.hasAttribute('for')) {\n if (!this.htmlFor) {\n return null;\n }\n\n return (this.getRootNode() as Document | ShadowRoot)\n .querySelector<HTMLElement>(`#${this.htmlFor}`);\n }\n\n return this.currentControl || this.parentElement;\n }\n\n private currentControl: HTMLElement|null = null;\n\n /**\n * Attaches the focus ring to an interactive element.\n *\n * @param control The element that controls the focus ring.\n */\n attach(control: HTMLElement) {\n if (control === this.currentControl) {\n return;\n }\n\n this.setCurrentControl(control);\n // When imperatively attaching the focus ring, remove the `for` attribute so\n // that the attached control is used instead of a referenced one.\n this.removeAttribute('for');\n }\n\n /**\n * Detaches the focus ring from its current interactive element.\n */\n detach() {\n this.setCurrentControl(null);\n // When imperatively detaching, add an empty `for=\"\"` attribute. This will\n // ensure the control is `null` rather than the `parentElement`.\n this.setAttribute('for', '');\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.setCurrentControl(this.control);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.setCurrentControl(null);\n }\n\n protected override updated(changedProperties: PropertyValues<FocusRing>) {\n if (changedProperties.has('htmlFor')) {\n const {control} = this;\n if (control) {\n this.setCurrentControl(control);\n }\n }\n }\n\n /**\n * @private\n */\n handleEvent(event: FocusRingEvent) {\n if (event[HANDLED_BY_FOCUS_RING]) {\n // This ensures the focus ring does not activate when multiple focus rings\n // are used within a single component.\n return;\n }\n\n switch (event.type) {\n default:\n return;\n case 'focusin':\n this.visible = this.control?.matches(':focus-visible') ?? false;\n break;\n case 'focusout':\n case 'pointerdown':\n this.visible = false;\n break;\n }\n\n event[HANDLED_BY_FOCUS_RING] = true;\n }\n\n private setCurrentControl(control: HTMLElement|null) {\n for (const event of ['focusin', 'focusout', 'pointerdown']) {\n this.currentControl?.removeEventListener(event, this);\n control?.addEventListener(event, this);\n }\n\n this.currentControl = control;\n }\n}\n\nconst HANDLED_BY_FOCUS_RING = Symbol('handledByFocusRing');\n\ninterface FocusRingEvent extends Event {\n [HANDLED_BY_FOCUS_RING]: true;\n}\n"]}
|
package/icon/icon.d.ts
CHANGED
package/icon/icon.js
CHANGED
package/icon/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAQhD
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAQhD;;;GAGG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,IAAI;;AACd,aAAM,GAAG,CAAC,MAAM,CAAC,CAAC;AADvB,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAElB;SAFY,MAAM","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {Icon} from './lib/icon.js';\nimport {styles} from './lib/icon-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-icon': MdIcon;\n }\n}\n\n/**\n * @final\n * @suppress {visibility}\n */\n@customElement('md-icon')\nexport class MdIcon extends Icon {\n static override styles = [styles];\n}\n"]}
|
package/icon/lib/_icon.scss
CHANGED
|
@@ -34,6 +34,8 @@ $_custom-property-prefix: 'icon';
|
|
|
34
34
|
font-size: var(--_size);
|
|
35
35
|
font-variation-settings: var(--_font-variation-settings);
|
|
36
36
|
line-height: 1;
|
|
37
|
+
// Avoid displaying overflowing text if font ligatures have not loaded.
|
|
38
|
+
overflow: hidden;
|
|
37
39
|
letter-spacing: normal;
|
|
38
40
|
text-transform: none;
|
|
39
41
|
white-space: nowrap;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `:host{--_color: var(--md-icon-color, inherit);--_font: var(--md-icon-font, "Material Symbols Outlined");--_font-variation-settings: var(--md-icon-font-variation-settings, inherit);--_size: var(--md-icon-size, 24px);--_weight: var(--md-icon-weight, 400);display:inline-flex;color:var(--_color);font-family:var(--_font);font-weight:var(--_weight);font-style:normal;font-size:var(--_size);font-variation-settings:var(--_font-variation-settings);line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}span ::slotted(svg){fill:currentColor}span ::slotted(*){height:var(--_size);width:var(--_size)}/*# sourceMappingURL=icon-styles.css.map */
|
|
7
|
+
export const styles = css `:host{--_color: var(--md-icon-color, inherit);--_font: var(--md-icon-font, "Material Symbols Outlined");--_font-variation-settings: var(--md-icon-font-variation-settings, inherit);--_size: var(--md-icon-size, 24px);--_weight: var(--md-icon-weight, 400);display:inline-flex;color:var(--_color);font-family:var(--_font);font-weight:var(--_weight);font-style:normal;font-size:var(--_size);font-variation-settings:var(--_font-variation-settings);line-height:1;overflow:hidden;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}span ::slotted(svg){fill:currentColor}span ::slotted(*){height:var(--_size);width:var(--_size)}/*# sourceMappingURL=icon-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=icon-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-styles.css.js","sourceRoot":"","sources":["icon-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_color: var(--md-icon-color, inherit);--_font: var(--md-icon-font, \"Material Symbols Outlined\");--_font-variation-settings: var(--md-icon-font-variation-settings, inherit);--_size: var(--md-icon-size, 24px);--_weight: var(--md-icon-weight, 400);display:inline-flex;color:var(--_color);font-family:var(--_font);font-weight:var(--_weight);font-style:normal;font-size:var(--_size);font-variation-settings:var(--_font-variation-settings);line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}span ::slotted(svg){fill:currentColor}span ::slotted(*){height:var(--_size);width:var(--_size)}/*# sourceMappingURL=icon-styles.css.map */\n`;\n "]}
|
|
1
|
+
{"version":3,"file":"icon-styles.css.js","sourceRoot":"","sources":["icon-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_color: var(--md-icon-color, inherit);--_font: var(--md-icon-font, \"Material Symbols Outlined\");--_font-variation-settings: var(--md-icon-font-variation-settings, inherit);--_size: var(--md-icon-size, 24px);--_weight: var(--md-icon-weight, 400);display:inline-flex;color:var(--_color);font-family:var(--_font);font-weight:var(--_weight);font-style:normal;font-size:var(--_size);font-variation-settings:var(--_font-variation-settings);line-height:1;overflow:hidden;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}span ::slotted(svg){fill:currentColor}span ::slotted(*){height:var(--_size);width:var(--_size)}/*# sourceMappingURL=icon-styles.css.map */\n`;\n "]}
|
package/icon/lib/icon.d.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { LitElement
|
|
7
|
-
/**
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
/**
|
|
8
|
+
* TODO(b/265336902): add docs
|
|
9
|
+
*/
|
|
8
10
|
export declare class Icon extends LitElement {
|
|
9
|
-
|
|
10
|
-
protected render(): TemplateResult;
|
|
11
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
11
12
|
}
|
package/icon/lib/icon.js
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { html, LitElement } from 'lit';
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* TODO(b/265336902): add docs
|
|
9
|
+
*/
|
|
8
10
|
export class Icon extends LitElement {
|
|
9
|
-
/** @soyTemplate */
|
|
10
11
|
render() {
|
|
11
12
|
return html `<span><slot></slot></span>`;
|
|
12
13
|
}
|
package/icon/lib/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,UAAU;IACf,MAAM;QACvB,OAAO,IAAI,CAAA,4BAA4B,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement} from 'lit';\n\n/**\n * TODO(b/265336902): add docs\n */\nexport class Icon extends LitElement {\n protected override render() {\n return html`<span><slot></slot></span>`;\n }\n}\n"]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
7
6
|
import { IconButton } from './lib/icon-button.js';
|
|
8
7
|
declare global {
|
|
9
8
|
interface HTMLElementTagNameMap {
|
|
@@ -27,5 +26,10 @@ declare global {
|
|
|
27
26
|
*/
|
|
28
27
|
export declare class MdFilledIconButton extends IconButton {
|
|
29
28
|
static styles: import("lit").CSSResult[];
|
|
30
|
-
protected getRenderClasses():
|
|
29
|
+
protected getRenderClasses(): {
|
|
30
|
+
'md3-icon-button--filled': boolean;
|
|
31
|
+
'md3-icon-button--toggle-filled': boolean;
|
|
32
|
+
'md3-icon-button--flip-icon': boolean;
|
|
33
|
+
'md3-icon-button--selected': boolean;
|
|
34
|
+
};
|
|
31
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filled-icon-button.js","sourceRoot":"","sources":["filled-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"filled-icon-button.js","sourceRoot":"","sources":["filled-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;;;;;;;;;;GAcG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAG7B,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,yBAAyB,EAAE,IAAI;YAC/B,gCAAgC,EAAE,IAAI,CAAC,MAAM;SAC9C,CAAC;IACJ,CAAC;;AARe,yBAAM,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AADrC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAU9B;SAVY,kBAAkB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles} from './lib/filled-styles.css.js';\nimport {IconButton} from './lib/icon-button.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-filled-icon-button': MdFilledIconButton;\n }\n}\n\n/**\n * @summary Icon buttons help people take supplementary actions with a single\n * tap.\n *\n * @description\n * __Emphasis:__ Low emphasis – For optional or supplementary actions with the\n * least amount of prominence.\n *\n * __Rationale:__ The most compact and unobtrusive type of button, icon buttons\n * are used for optional supplementary actions such as \"Bookmark\" or \"Star.\"\n *\n * __Example usages:__\n * - Add to Favorites\n * - Print\n */\n@customElement('md-filled-icon-button')\nexport class MdFilledIconButton extends IconButton {\n static override styles = [sharedStyles, styles];\n\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-icon-button--filled': true,\n 'md3-icon-button--toggle-filled': this.toggle,\n };\n }\n}\n"]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
7
6
|
import { IconButton } from './lib/icon-button.js';
|
|
8
7
|
declare global {
|
|
9
8
|
interface HTMLElementTagNameMap {
|
|
@@ -27,5 +26,10 @@ declare global {
|
|
|
27
26
|
*/
|
|
28
27
|
export declare class MdFilledTonalIconButton extends IconButton {
|
|
29
28
|
static styles: import("lit").CSSResult[];
|
|
30
|
-
protected getRenderClasses():
|
|
29
|
+
protected getRenderClasses(): {
|
|
30
|
+
'md3-icon-button--filled-tonal': boolean;
|
|
31
|
+
'md3-icon-button--toggle-filled-tonal': boolean;
|
|
32
|
+
'md3-icon-button--flip-icon': boolean;
|
|
33
|
+
'md3-icon-button--selected': boolean;
|
|
34
|
+
};
|
|
31
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filled-tonal-icon-button.js","sourceRoot":"","sources":["filled-tonal-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"filled-tonal-icon-button.js","sourceRoot":"","sources":["filled-tonal-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;;;;;;;;;;GAcG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;IAGlC,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,+BAA+B,EAAE,IAAI;YACrC,sCAAsC,EAAE,IAAI,CAAC,MAAM;SACpD,CAAC;IACJ,CAAC;;AARe,8BAAM,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AADrC,uBAAuB;IADnC,aAAa,CAAC,6BAA6B,CAAC;GAChC,uBAAuB,CAUnC;SAVY,uBAAuB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles} from './lib/filled-tonal-styles.css.js';\nimport {IconButton} from './lib/icon-button.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-filled-tonal-icon-button': MdFilledTonalIconButton;\n }\n}\n\n/**\n * @summary Icon buttons help people take supplementary actions with a single\n * tap.\n *\n * @description\n * __Emphasis:__ Low emphasis – For optional or supplementary actions with the\n * least amount of prominence.\n *\n * __Rationale:__ The most compact and unobtrusive type of button, icon buttons\n * are used for optional supplementary actions such as \"Bookmark\" or \"Star.\"\n *\n * __Example usages:__\n * - Add to Favorites\n * - Print\n */\n@customElement('md-filled-tonal-icon-button')\nexport class MdFilledTonalIconButton extends IconButton {\n static override styles = [sharedStyles, styles];\n\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-icon-button--filled-tonal': true,\n 'md3-icon-button--toggle-filled-tonal': this.toggle,\n };\n }\n}\n"]}
|
package/iconbutton/harness.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ import { IconButton } from './lib/icon-button.js';
|
|
|
9
9
|
* Test harness for icon buttons.
|
|
10
10
|
*/
|
|
11
11
|
export declare class IconButtonHarness extends Harness<IconButton> {
|
|
12
|
-
protected getInteractiveElement(): Promise<
|
|
12
|
+
protected getInteractiveElement(): Promise<HTMLAnchorElement | HTMLButtonElement>;
|
|
13
13
|
}
|
package/iconbutton/harness.js
CHANGED
|
@@ -10,7 +10,10 @@ import { Harness } from '../testing/harness.js';
|
|
|
10
10
|
export class IconButtonHarness extends Harness {
|
|
11
11
|
async getInteractiveElement() {
|
|
12
12
|
await this.element.updateComplete;
|
|
13
|
-
|
|
13
|
+
if (this.element.href) {
|
|
14
|
+
return this.element.renderRoot.querySelector('a');
|
|
15
|
+
}
|
|
16
|
+
return this.element.renderRoot.querySelector('button');
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=harness.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.js","sourceRoot":"","sources":["harness.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAI9C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAmB;IACrC,KAAK,CAAC,qBAAqB;QAC5C,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"harness.js","sourceRoot":"","sources":["harness.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAI9C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAmB;IACrC,KAAK,CAAC,qBAAqB;QAC5C,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAClC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACrB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAE,CAAC;SACpD;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;IAC1D,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {Harness} from '../testing/harness.js';\n\nimport {IconButton} from './lib/icon-button.js';\n\n/**\n * Test harness for icon buttons.\n */\nexport class IconButtonHarness extends Harness<IconButton> {\n protected override async getInteractiveElement() {\n await this.element.updateComplete;\n if (this.element.href) {\n return this.element.renderRoot.querySelector('a')!;\n }\n\n return this.element.renderRoot.querySelector('button')!;\n }\n}\n"]}
|
|
@@ -7,40 +7,65 @@
|
|
|
7
7
|
// Selector '.md3-*' should only be used in this project.
|
|
8
8
|
|
|
9
9
|
// go/keep-sorted start
|
|
10
|
+
@use 'sass:list';
|
|
10
11
|
@use 'sass:map';
|
|
11
12
|
// go/keep-sorted end
|
|
12
13
|
// go/keep-sorted start
|
|
13
14
|
@use '../../ripple/ripple';
|
|
14
|
-
@use '../../sass/shape';
|
|
15
|
-
@use '../../sass/theme';
|
|
16
15
|
@use '../../tokens';
|
|
17
16
|
@use './shared';
|
|
18
17
|
// go/keep-sorted end
|
|
19
18
|
|
|
20
|
-
$_custom-property-prefix: 'filled-icon-button';
|
|
21
|
-
|
|
22
19
|
@mixin theme($tokens) {
|
|
23
|
-
$tokens:
|
|
24
|
-
tokens
|
|
25
|
-
|
|
20
|
+
$supported-tokens: list.join(
|
|
21
|
+
tokens.$md-comp-filled-icon-button-supported-tokens,
|
|
22
|
+
(
|
|
23
|
+
'container-shape-start-start',
|
|
24
|
+
'container-shape-start-end',
|
|
25
|
+
'container-shape-end-end',
|
|
26
|
+
'container-shape-end-start'
|
|
27
|
+
)
|
|
26
28
|
);
|
|
29
|
+
|
|
27
30
|
$tokens: shared.flatten-disabled-colors($tokens, $variant: 'filled');
|
|
28
|
-
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
|
|
29
|
-
$tokens: shared.resolve-shape-tokens($tokens);
|
|
30
31
|
|
|
31
|
-
@
|
|
32
|
+
@each $token, $value in $tokens {
|
|
33
|
+
@if list.index($supported-tokens, $token) == null {
|
|
34
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@if $value {
|
|
38
|
+
--md-filled-icon-button-#{$token}: #{$value};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
@mixin styles() {
|
|
35
44
|
$tokens: tokens.md-comp-filled-icon-button-values();
|
|
36
45
|
$tokens: shared.flatten-disabled-colors($tokens, $variant: 'filled');
|
|
37
|
-
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
|
|
38
|
-
$tokens: shared.resolve-shape-tokens($tokens);
|
|
39
46
|
|
|
40
47
|
:host {
|
|
41
48
|
@each $token, $value in $tokens {
|
|
42
|
-
--_#{$token}: #{$value};
|
|
49
|
+
--_#{$token}: var(--md-filled-icon-button-#{$token}, #{$value});
|
|
43
50
|
}
|
|
51
|
+
|
|
52
|
+
// Support logical shape properties
|
|
53
|
+
--_container-shape-start-start: var(
|
|
54
|
+
--md-filled-icon-button-container-shape-start-start,
|
|
55
|
+
var(--_container-shape)
|
|
56
|
+
);
|
|
57
|
+
--_container-shape-start-end: var(
|
|
58
|
+
--md-filled-icon-button-container-shape-start-end,
|
|
59
|
+
var(--_container-shape)
|
|
60
|
+
);
|
|
61
|
+
--_container-shape-end-end: var(
|
|
62
|
+
--md-filled-icon-button-container-shape-end-end,
|
|
63
|
+
var(--_container-shape)
|
|
64
|
+
);
|
|
65
|
+
--_container-shape-end-start: var(
|
|
66
|
+
--md-filled-icon-button-container-shape-end-start,
|
|
67
|
+
var(--_container-shape)
|
|
68
|
+
);
|
|
44
69
|
}
|
|
45
70
|
|
|
46
71
|
.md3-icon-button {
|
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
// Selector '.md3-*' should only be used in this project.
|
|
8
8
|
|
|
9
9
|
// go/keep-sorted start
|
|
10
|
+
@use 'sass:list';
|
|
10
11
|
@use 'sass:map';
|
|
11
12
|
// go/keep-sorted end
|
|
12
13
|
// go/keep-sorted start
|
|
13
14
|
@use '../../ripple/ripple';
|
|
14
|
-
@use '../../sass/shape';
|
|
15
|
-
@use '../../sass/theme';
|
|
16
15
|
@use '../../tokens';
|
|
17
16
|
@use './shared';
|
|
18
17
|
// go/keep-sorted end
|
|
@@ -20,27 +19,55 @@
|
|
|
20
19
|
$_custom-property-prefix: 'filled-tonal-icon-button';
|
|
21
20
|
|
|
22
21
|
@mixin theme($tokens) {
|
|
23
|
-
$tokens:
|
|
24
|
-
tokens
|
|
25
|
-
|
|
22
|
+
$supported-tokens: list.join(
|
|
23
|
+
tokens.$md-comp-filled-tonal-icon-button-supported-tokens,
|
|
24
|
+
(
|
|
25
|
+
'container-shape-start-start',
|
|
26
|
+
'container-shape-start-end',
|
|
27
|
+
'container-shape-end-end',
|
|
28
|
+
'container-shape-end-start'
|
|
29
|
+
)
|
|
26
30
|
);
|
|
31
|
+
|
|
27
32
|
$tokens: shared.flatten-disabled-colors($tokens, $variant: 'filled-tonal');
|
|
28
|
-
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
|
|
29
|
-
$tokens: shared.resolve-shape-tokens($tokens);
|
|
30
33
|
|
|
31
|
-
@
|
|
34
|
+
@each $token, $value in $tokens {
|
|
35
|
+
@if list.index($supported-tokens, $token) == null {
|
|
36
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@if $value {
|
|
40
|
+
--md-filled-tonal-icon-button-#{$token}: #{$value};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
@mixin styles() {
|
|
35
46
|
$tokens: tokens.md-comp-filled-tonal-icon-button-values();
|
|
36
47
|
$tokens: shared.flatten-disabled-colors($tokens, $variant: 'filled-tonal');
|
|
37
|
-
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
|
|
38
|
-
$tokens: shared.resolve-shape-tokens($tokens);
|
|
39
48
|
|
|
40
49
|
:host {
|
|
41
50
|
@each $token, $value in $tokens {
|
|
42
|
-
--_#{$token}: #{$value};
|
|
51
|
+
--_#{$token}: var(--md-filled-tonal-icon-button-#{$token}, #{$value});
|
|
43
52
|
}
|
|
53
|
+
|
|
54
|
+
// Support logical shape properties
|
|
55
|
+
--_container-shape-start-start: var(
|
|
56
|
+
--md-filled-tonal-icon-button-container-shape-start-start,
|
|
57
|
+
var(--_container-shape)
|
|
58
|
+
);
|
|
59
|
+
--_container-shape-start-end: var(
|
|
60
|
+
--md-filled-tonal-icon-button-container-shape-start-end,
|
|
61
|
+
var(--_container-shape)
|
|
62
|
+
);
|
|
63
|
+
--_container-shape-end-end: var(
|
|
64
|
+
--md-filled-tonal-icon-button-container-shape-end-end,
|
|
65
|
+
var(--_container-shape)
|
|
66
|
+
);
|
|
67
|
+
--_container-shape-end-start: var(
|
|
68
|
+
--md-filled-tonal-icon-button-container-shape-end-start,
|
|
69
|
+
var(--_container-shape)
|
|
70
|
+
);
|
|
44
71
|
}
|
|
45
72
|
|
|
46
73
|
.md3-icon-button {
|