@material/web 1.0.0-pre.15 → 1.0.0-pre.17
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 +26 -21
- package/all.d.ts +4 -2
- package/all.js +4 -2
- package/all.js.map +1 -1
- package/button/internal/_elevation.scss +4 -0
- package/button/internal/_filled-button.scss +0 -1
- package/button/internal/_outlined-button.scss +6 -0
- package/button/internal/_shared.scss +12 -2
- package/button/internal/button.d.ts +15 -14
- package/button/internal/button.js +41 -39
- package/button/internal/button.js.map +1 -1
- package/button/internal/elevated-styles.css.js +1 -1
- package/button/internal/elevated-styles.css.js.map +1 -1
- package/button/internal/filled-styles.css.js +1 -1
- package/button/internal/filled-styles.css.js.map +1 -1
- package/button/internal/filled-tonal-styles.css.js +1 -1
- package/button/internal/filled-tonal-styles.css.js.map +1 -1
- package/button/internal/outlined-styles.css.js +1 -1
- package/button/internal/outlined-styles.css.js.map +1 -1
- package/button/internal/shared-elevation-styles.css.js +1 -1
- package/button/internal/shared-elevation-styles.css.js.map +1 -1
- package/button/internal/shared-styles.css.js +1 -1
- package/button/internal/shared-styles.css.js.map +1 -1
- package/button/internal/text-styles.css.js +1 -1
- package/button/internal/text-styles.css.js.map +1 -1
- package/checkbox/internal/_checkbox.scss +2 -1
- package/checkbox/internal/checkbox-styles.css.js +1 -1
- package/checkbox/internal/checkbox-styles.css.js.map +1 -1
- package/checkbox/internal/checkbox.d.ts +2 -2
- package/checkbox/internal/checkbox.js +18 -14
- package/checkbox/internal/checkbox.js.map +1 -1
- package/chips/assist-chip.js +1 -2
- package/chips/assist-chip.js.map +1 -1
- package/chips/filter-chip.js +1 -3
- package/chips/filter-chip.js.map +1 -1
- package/chips/input-chip.js +1 -5
- package/chips/input-chip.js.map +1 -1
- package/chips/internal/_assist-chip.scss +6 -0
- package/chips/internal/_elevated.scss +1 -5
- package/chips/internal/_filter-chip.scss +6 -0
- package/chips/internal/_input-chip.scss +32 -0
- package/chips/internal/_selectable.scss +17 -13
- package/chips/internal/_shared.scss +27 -11
- package/chips/internal/_suggestion-chip.scss +6 -0
- package/chips/internal/_trailing-icon.scss +24 -24
- package/chips/internal/assist-chip.d.ts +3 -1
- package/chips/internal/assist-chip.js +11 -8
- package/chips/internal/assist-chip.js.map +1 -1
- package/chips/internal/assist-styles.css.js +1 -1
- package/chips/internal/assist-styles.css.js.map +1 -1
- package/chips/internal/chip.d.ts +18 -10
- package/chips/internal/chip.js +38 -33
- package/chips/internal/chip.js.map +1 -1
- package/chips/internal/elevated-styles.css.js +1 -1
- package/chips/internal/elevated-styles.css.js.map +1 -1
- package/chips/internal/filter-chip.d.ts +6 -7
- package/chips/internal/filter-chip.js +13 -14
- package/chips/internal/filter-chip.js.map +1 -1
- package/chips/internal/filter-styles.css.js +1 -1
- package/chips/internal/filter-styles.css.js.map +1 -1
- package/chips/internal/input-chip.d.ts +4 -2
- package/chips/internal/input-chip.js +16 -12
- package/chips/internal/input-chip.js.map +1 -1
- package/chips/internal/input-styles.css.js +1 -1
- package/chips/internal/input-styles.css.js.map +1 -1
- package/chips/internal/multi-action-chip.d.ts +2 -3
- package/chips/internal/multi-action-chip.js +3 -3
- package/chips/internal/multi-action-chip.js.map +1 -1
- package/chips/internal/selectable-styles.css.js +1 -1
- package/chips/internal/selectable-styles.css.js.map +1 -1
- package/chips/internal/shared-styles.css.js +1 -1
- package/chips/internal/shared-styles.css.js.map +1 -1
- package/chips/internal/suggestion-styles.css.js +1 -1
- package/chips/internal/suggestion-styles.css.js.map +1 -1
- package/chips/internal/trailing-icon-styles.css.js +1 -1
- package/chips/internal/trailing-icon-styles.css.js.map +1 -1
- package/chips/suggestion-chip.js +1 -2
- package/chips/suggestion-chip.js.map +1 -1
- package/color/_color.scss +193 -0
- package/common.d.ts +2 -2
- package/common.js +2 -2
- package/common.js.map +1 -1
- package/dialog/internal/_dialog.scss +19 -4
- package/dialog/internal/dialog-styles.css.js +1 -1
- package/dialog/internal/dialog-styles.css.js.map +1 -1
- package/dialog/internal/dialog.d.ts +6 -0
- package/dialog/internal/dialog.js +36 -4
- package/dialog/internal/dialog.js.map +1 -1
- package/elevation/internal/_elevation.scss +14 -7
- package/elevation/internal/elevation-styles.css.js +1 -1
- package/elevation/internal/elevation-styles.css.js.map +1 -1
- package/elevation/internal/elevation.d.ts +1 -0
- package/elevation/internal/elevation.js +6 -0
- package/elevation/internal/elevation.js.map +1 -1
- package/fab/branded-fab.d.ts +0 -1
- package/fab/internal/_fab.scss +11 -10
- package/fab/internal/_shared.scss +8 -2
- package/fab/internal/fab-branded-styles.css.js +1 -1
- package/fab/internal/fab-branded-styles.css.js.map +1 -1
- package/fab/internal/fab-styles.css.js +1 -1
- package/fab/internal/fab-styles.css.js.map +1 -1
- package/fab/internal/fab.d.ts +0 -1
- package/fab/internal/shared-styles.css.js +1 -1
- package/fab/internal/shared-styles.css.js.map +1 -1
- package/fab/internal/shared.d.ts +0 -9
- package/fab/internal/shared.js +2 -18
- package/fab/internal/shared.js.map +1 -1
- package/field/internal/_content.scss +9 -1
- package/field/internal/_filled-field.scss +12 -0
- package/field/internal/_label.scss +4 -1
- package/field/internal/_outlined-field.scss +33 -0
- package/field/internal/_shared.scss +14 -6
- package/field/internal/_supporting-text.scss +4 -1
- package/field/internal/field.d.ts +2 -0
- package/field/internal/field.js +19 -0
- package/field/internal/field.js.map +1 -1
- package/field/internal/filled-styles.css.js +1 -1
- package/field/internal/filled-styles.css.js.map +1 -1
- package/field/internal/outlined-styles.css.js +1 -1
- package/field/internal/outlined-styles.css.js.map +1 -1
- package/field/internal/shared-styles.css.js +1 -1
- package/field/internal/shared-styles.css.js.map +1 -1
- package/focus/internal/focus-ring.d.ts +3 -1
- package/focus/internal/focus-ring.js +9 -0
- package/focus/internal/focus-ring.js.map +1 -1
- package/icon/internal/_icon.scss +10 -5
- package/icon/internal/icon-styles.css.js +1 -1
- package/icon/internal/icon-styles.css.js.map +1 -1
- package/icon/internal/icon.js +4 -0
- package/icon/internal/icon.js.map +1 -1
- package/iconbutton/internal/_icon-button.scss +12 -0
- package/iconbutton/internal/_shared.scss +9 -0
- package/iconbutton/internal/icon-button.d.ts +19 -6
- package/iconbutton/internal/icon-button.js +35 -11
- package/iconbutton/internal/icon-button.js.map +1 -1
- package/iconbutton/internal/shared-styles.css.js +1 -1
- package/iconbutton/internal/shared-styles.css.js.map +1 -1
- package/iconbutton/internal/standard-styles.css.js +1 -1
- package/iconbutton/internal/standard-styles.css.js.map +1 -1
- package/internal/aria/aria.d.ts +52 -1
- package/internal/aria/aria.js +146 -0
- package/internal/aria/aria.js.map +1 -1
- package/internal/controller/attachable-controller.d.ts +5 -4
- package/internal/controller/attachable-controller.js +8 -0
- package/internal/controller/attachable-controller.js.map +1 -1
- package/internal/controller/form-submitter.d.ts +12 -0
- package/internal/controller/form-submitter.js +3 -1
- package/internal/controller/form-submitter.js.map +1 -1
- package/labs/badge/internal/_badge.scss +16 -9
- package/labs/badge/internal/badge-styles.css.js +1 -1
- package/labs/badge/internal/badge-styles.css.js.map +1 -1
- package/labs/navigationbar/internal/_navigation-bar.scss +11 -9
- package/labs/navigationbar/internal/navigation-bar-styles.css.js +1 -1
- package/labs/navigationbar/internal/navigation-bar-styles.css.js.map +1 -1
- package/labs/navigationdrawer/internal/_navigation-drawer-modal.scss +11 -8
- package/labs/navigationdrawer/internal/_navigation-drawer.scss +11 -8
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.css.js +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.css.js.map +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer-styles.css.js +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer-styles.css.js.map +1 -1
- package/labs/navigationtab/internal/_navigation-tab.scss +14 -11
- package/labs/navigationtab/internal/navigation-tab-styles.css.js +1 -1
- package/labs/navigationtab/internal/navigation-tab-styles.css.js.map +1 -1
- package/labs/segmentedbutton/internal/_outlined-segmented-button.scss +1 -3
- package/labs/segmentedbutton/internal/_shared.scss +4 -1
- package/labs/segmentedbutton/internal/outlined-styles.css.js +1 -1
- package/labs/segmentedbutton/internal/outlined-styles.css.js.map +1 -1
- package/labs/segmentedbutton/internal/shared-styles.css.js +1 -1
- package/labs/segmentedbutton/internal/shared-styles.css.js.map +1 -1
- package/labs/segmentedbuttonset/internal/outlined-styles.css.js +1 -1
- package/labs/segmentedbuttonset/internal/outlined-styles.css.js.map +1 -1
- package/list/harness.js +1 -1
- package/list/harness.js.map +1 -1
- package/list/internal/_list.scss +7 -6
- package/list/internal/list-styles.css.js +1 -1
- package/list/internal/list-styles.css.js.map +1 -1
- package/list/internal/list.d.ts +1 -2
- package/list/internal/list.js +4 -6
- package/list/internal/list.js.map +1 -1
- package/list/internal/listitem/_list-item.scss +96 -94
- package/list/internal/listitem/forced-colors-styles.css.js +1 -1
- package/list/internal/listitem/forced-colors-styles.css.js.map +1 -1
- package/list/internal/listitem/forced-colors-styles.scss +6 -6
- package/list/internal/listitem/list-item-styles.css.js +1 -1
- package/list/internal/listitem/list-item-styles.css.js.map +1 -1
- package/menu/harness.d.ts +1 -1
- package/menu/harness.js +3 -4
- package/menu/harness.js.map +1 -1
- package/menu/internal/_menu.scss +37 -28
- package/menu/internal/menu-styles.css.js +1 -1
- package/menu/internal/menu-styles.css.js.map +1 -1
- package/menu/internal/menu.d.ts +15 -4
- package/menu/internal/menu.js +33 -10
- package/menu/internal/menu.js.map +1 -1
- package/menu/internal/menuitem/_menu-item.scss +7 -4
- package/menu/internal/menuitem/menu-item-styles.css.js +1 -1
- package/menu/internal/menuitem/menu-item-styles.css.js.map +1 -1
- package/menu/internal/menuitem/menu-item.js +1 -1
- package/menu/internal/menuitem/menu-item.js.map +1 -1
- package/menu/internal/submenuitem/sub-menu-item.d.ts +3 -0
- package/menu/internal/submenuitem/sub-menu-item.js +42 -12
- package/menu/internal/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/internal/typeaheadController.js +2 -1
- package/menu/internal/typeaheadController.js.map +1 -1
- package/menu/menu.d.ts +12 -5
- package/menu/menu.js +12 -5
- package/menu/menu.js.map +1 -1
- package/menu/sub-menu-item.d.ts +3 -4
- package/menu/sub-menu-item.js +3 -4
- package/menu/sub-menu-item.js.map +1 -1
- package/package.json +10 -2
- package/progress/harness.js +2 -4
- package/progress/harness.js.map +1 -1
- package/progress/internal/_circular-progress.scss +8 -6
- package/progress/internal/_linear-progress.scss +95 -134
- package/progress/internal/circular-progress-styles.css.js +1 -1
- package/progress/internal/circular-progress-styles.css.js.map +1 -1
- package/progress/internal/circular-progress.js +1 -1
- package/progress/internal/circular-progress.js.map +1 -1
- package/progress/internal/linear-progress-styles.css.js +1 -1
- package/progress/internal/linear-progress-styles.css.js.map +1 -1
- package/progress/internal/linear-progress.d.ts +0 -11
- package/progress/internal/linear-progress.js +4 -48
- package/progress/internal/linear-progress.js.map +1 -1
- package/radio/harness.d.ts +1 -1
- package/radio/harness.js +1 -1
- package/radio/harness.js.map +1 -1
- package/radio/internal/_radio.scss +4 -4
- package/radio/internal/radio-styles.css.js +1 -1
- package/radio/internal/radio-styles.css.js.map +1 -1
- package/radio/internal/radio.d.ts +4 -6
- package/radio/internal/radio.js +37 -32
- package/radio/internal/radio.js.map +1 -1
- package/radio/internal/single-selection-controller.js +4 -3
- package/radio/internal/single-selection-controller.js.map +1 -1
- package/ripple/internal/_ripple.scss +1 -1
- package/ripple/internal/ripple-styles.css.js +1 -1
- package/ripple/internal/ripple-styles.css.js.map +1 -1
- package/ripple/internal/ripple.d.ts +3 -1
- package/ripple/internal/ripple.js +9 -0
- package/ripple/internal/ripple.js.map +1 -1
- package/select/harness.d.ts +1 -1
- package/select/harness.js +1 -3
- package/select/harness.js.map +1 -1
- package/select/internal/_filled-select.scss +13 -4
- package/select/internal/_outlined-select.scss +13 -4
- package/select/internal/_shared.scss +0 -1
- package/select/internal/filled-select-styles.css.js +1 -1
- package/select/internal/filled-select-styles.css.js.map +1 -1
- package/select/internal/outlined-select-styles.css.js +1 -1
- package/select/internal/outlined-select-styles.css.js.map +1 -1
- package/select/internal/select.d.ts +8 -2
- package/select/internal/select.js +21 -8
- package/select/internal/select.js.map +1 -1
- package/slider/internal/_slider.scss +42 -32
- package/slider/internal/forced-colors-styles.css.js +1 -1
- package/slider/internal/forced-colors-styles.css.js.map +1 -1
- package/slider/internal/forced-colors-styles.scss +31 -4
- package/slider/internal/slider-styles.css.js +1 -1
- package/slider/internal/slider-styles.css.js.map +1 -1
- package/slider/internal/slider.d.ts +22 -8
- package/slider/internal/slider.js +113 -22
- package/slider/internal/slider.js.map +1 -1
- package/switch/harness.d.ts +1 -1
- package/switch/harness.js +1 -1
- package/switch/harness.js.map +1 -1
- package/switch/internal/_handle.scss +22 -21
- package/switch/internal/_icon.scss +12 -12
- package/switch/internal/_switch.scss +17 -17
- package/switch/internal/_track.scss +12 -12
- package/switch/internal/forced-colors-styles.css.js +1 -1
- package/switch/internal/forced-colors-styles.css.js.map +1 -1
- package/switch/internal/forced-colors-styles.scss +1 -0
- package/switch/internal/switch-styles.css.js +1 -1
- package/switch/internal/switch-styles.css.js.map +1 -1
- package/switch/internal/switch.d.ts +73 -3
- package/switch/internal/switch.js +146 -32
- package/switch/internal/switch.js.map +1 -1
- package/tabs/{_tab.scss → _primary-tab.scss} +1 -1
- package/tabs/_secondary-tab.scss +6 -0
- package/tabs/harness.d.ts +2 -2
- package/tabs/harness.js +1 -2
- package/tabs/harness.js.map +1 -1
- package/tabs/internal/_primary-tab.scss +70 -0
- package/tabs/internal/_secondary-tab.scss +61 -0
- package/tabs/internal/_tab.scss +21 -114
- package/tabs/internal/_tabs.scss +9 -10
- package/tabs/internal/primary-tab-styles.css.js +9 -0
- package/tabs/internal/primary-tab-styles.css.js.map +1 -0
- package/tabs/internal/primary-tab-styles.scss +10 -0
- package/tabs/internal/primary-tab.d.ts +20 -0
- package/tabs/internal/primary-tab.js +30 -0
- package/tabs/internal/primary-tab.js.map +1 -0
- package/tabs/internal/secondary-tab-styles.css.js +9 -0
- package/tabs/internal/secondary-tab-styles.css.js.map +1 -0
- package/tabs/internal/secondary-tab-styles.scss +10 -0
- package/tabs/internal/secondary-tab.d.ts +12 -0
- package/tabs/internal/secondary-tab.js +16 -0
- package/tabs/internal/secondary-tab.js.map +1 -0
- package/tabs/internal/tab-styles.css.js +1 -1
- package/tabs/internal/tab-styles.css.js.map +1 -1
- package/tabs/internal/tab.d.ts +16 -34
- package/tabs/internal/tab.js +81 -81
- package/tabs/internal/tab.js.map +1 -1
- package/tabs/internal/tabs-styles.css.js +1 -1
- package/tabs/internal/tabs-styles.css.js.map +1 -1
- package/tabs/internal/tabs.d.ts +6 -20
- package/tabs/internal/tabs.js +33 -66
- package/tabs/internal/tabs.js.map +1 -1
- package/tabs/{tab.d.ts → primary-tab.d.ts} +3 -4
- package/tabs/primary-tab.js +23 -0
- package/tabs/primary-tab.js.map +1 -0
- package/tabs/secondary-tab.d.ts +18 -0
- package/tabs/secondary-tab.js +23 -0
- package/tabs/secondary-tab.js.map +1 -0
- package/tabs/tabs.d.ts +0 -2
- package/tabs/tabs.js +0 -2
- package/tabs/tabs.js.map +1 -1
- package/textfield/internal/_filled-text-field.scss +12 -3
- package/textfield/internal/_outlined-text-field.scss +12 -3
- package/textfield/internal/filled-styles.css.js +1 -1
- package/textfield/internal/filled-styles.css.js.map +1 -1
- package/textfield/internal/outlined-styles.css.js +1 -1
- package/textfield/internal/outlined-styles.css.js.map +1 -1
- package/textfield/internal/text-field.d.ts +30 -10
- package/textfield/internal/text-field.js +80 -32
- package/textfield/internal/text-field.js.map +1 -1
- package/tokens/_index.scss +5 -6
- package/tokens/_md-comp-assist-chip.scss +6 -14
- package/tokens/_md-comp-badge.scss +1 -14
- package/tokens/{_md-comp-circular-progress-indicator.scss → _md-comp-circular-progress.scss} +3 -1
- package/tokens/_md-comp-dialog.scss +10 -17
- package/tokens/_md-comp-elevated-button.scss +5 -13
- package/tokens/_md-comp-fab-branded.scss +9 -10
- package/tokens/_md-comp-fab.scss +9 -10
- package/tokens/_md-comp-filled-button.scss +5 -13
- package/tokens/_md-comp-filled-field.scss +27 -8
- package/tokens/_md-comp-filled-select.scss +18 -15
- package/tokens/_md-comp-filled-text-field.scss +17 -19
- package/tokens/_md-comp-filled-tonal-button.scss +5 -13
- package/tokens/_md-comp-filter-chip.scss +5 -13
- package/tokens/_md-comp-input-chip.scss +5 -13
- package/tokens/_md-comp-list-item.scss +117 -122
- package/tokens/_md-comp-menu-item.scss +3 -3
- package/tokens/_md-comp-outlined-button.scss +5 -13
- package/tokens/_md-comp-outlined-field.scss +27 -7
- package/tokens/_md-comp-outlined-segmented-button.scss +5 -13
- package/tokens/_md-comp-outlined-select.scss +23 -15
- package/tokens/_md-comp-outlined-text-field.scss +17 -19
- package/tokens/_md-comp-primary-tab.scss +132 -0
- package/tokens/_md-comp-secondary-tab.scss +139 -0
- package/tokens/_md-comp-slider.scss +16 -16
- package/tokens/_md-comp-suggestion-chip.scss +5 -13
- package/tokens/_md-comp-test-table.scss +13 -2
- package/tokens/_md-comp-text-button.scss +5 -13
- package/tokens/_md-ref-palette.scss +101 -1
- package/tokens/_md-ref-typeface.scss +3 -0
- package/tokens/_md-sys-color.scss +57 -2
- package/tokens/_md-sys-typescale.scss +66 -5
- package/chips/internal/assist-forced-colors-styles.css.js +0 -9
- package/chips/internal/assist-forced-colors-styles.css.js.map +0 -1
- package/chips/internal/assist-forced-colors-styles.scss +0 -27
- package/chips/internal/filter-forced-colors-styles.css.js +0 -9
- package/chips/internal/filter-forced-colors-styles.css.js.map +0 -1
- package/chips/internal/filter-forced-colors-styles.scss +0 -34
- package/chips/internal/input-forced-colors-styles.css.d.ts +0 -1
- package/chips/internal/input-forced-colors-styles.css.js +0 -9
- package/chips/internal/input-forced-colors-styles.css.js.map +0 -1
- package/chips/internal/input-forced-colors-styles.scss +0 -39
- package/chips/internal/suggestion-forced-colors-styles.css.d.ts +0 -1
- package/chips/internal/suggestion-forced-colors-styles.css.js +0 -9
- package/chips/internal/suggestion-forced-colors-styles.css.js.map +0 -1
- package/chips/internal/suggestion-forced-colors-styles.scss +0 -27
- package/internal/sass/_theme.scss +0 -249
- package/tabs/tab.js +0 -22
- package/tabs/tab.js.map +0 -1
- package/tokens/_md-comp-tab.scss +0 -285
- /package/{chips/internal/assist-forced-colors-styles.css.d.ts → tabs/internal/primary-tab-styles.css.d.ts} +0 -0
- /package/{chips/internal/filter-forced-colors-styles.css.d.ts → tabs/internal/secondary-tab-styles.css.d.ts} +0 -0
- /package/tokens/{_md-comp-linear-progress-indicator.scss → _md-comp-linear-progress.scss} +0 -0
- /package/tokens/{_md-comp-radio-button.scss → _md-comp-radio.scss} +0 -0
|
@@ -59,6 +59,28 @@
|
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
:host([avatar]) {
|
|
63
|
+
// Use a rounded border by default for avatar chips. Recreating the
|
|
64
|
+
// fallbacks allows `--md-input-chip-container-shape` to cascade and
|
|
65
|
+
// override this without needing to add more specificity for avatar chips.
|
|
66
|
+
--_container-shape-start-start: var(
|
|
67
|
+
--md-input-chip-container-shape-start-start,
|
|
68
|
+
var(--md-input-chip-container-shape, calc(var(--_container-height) / 2))
|
|
69
|
+
);
|
|
70
|
+
--_container-shape-start-end: var(
|
|
71
|
+
--md-input-chip-container-shape-start-end,
|
|
72
|
+
var(--md-input-chip-container-shape, calc(var(--_container-height) / 2))
|
|
73
|
+
);
|
|
74
|
+
--_container-shape-end-end: var(
|
|
75
|
+
--md-input-chip-container-shape-end-end,
|
|
76
|
+
var(--md-input-chip-container-shape, calc(var(--_container-height) / 2))
|
|
77
|
+
);
|
|
78
|
+
--_container-shape-end-start: var(
|
|
79
|
+
--md-input-chip-container-shape-end-start,
|
|
80
|
+
var(--md-input-chip-container-shape, calc(var(--_container-height) / 2))
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
62
84
|
.avatar .primary.action {
|
|
63
85
|
padding-inline-start: 4px;
|
|
64
86
|
}
|
|
@@ -72,4 +94,14 @@
|
|
|
72
94
|
.disabled.avatar .leading.icon {
|
|
73
95
|
opacity: var(--_disabled-avatar-opacity);
|
|
74
96
|
}
|
|
97
|
+
|
|
98
|
+
@media (forced-colors: active) {
|
|
99
|
+
.link .outline {
|
|
100
|
+
border-color: ActiveText;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.disabled.avatar .leading.icon {
|
|
104
|
+
opacity: 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
75
107
|
}
|
|
@@ -19,56 +19,60 @@
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.selected::before {
|
|
22
|
+
:where(.selected)::before {
|
|
23
23
|
background: var(--_selected-container-color);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.selected .outline {
|
|
26
|
+
:where(.selected) .outline {
|
|
27
27
|
border-width: var(--_selected-outline-width);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.selected.disabled::before {
|
|
30
|
+
:where(.selected.disabled)::before {
|
|
31
31
|
background: var(--_disabled-selected-container-color);
|
|
32
32
|
opacity: var(--_disabled-selected-container-opacity);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.selected .label {
|
|
35
|
+
:where(.selected) .label {
|
|
36
36
|
color: var(--_selected-label-text-color);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.selected:hover .label {
|
|
39
|
+
:where(.selected:hover) .label {
|
|
40
40
|
color: var(--_selected-hover-label-text-color);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.selected:focus .label {
|
|
43
|
+
:where(.selected:focus) .label {
|
|
44
44
|
color: var(--_selected-focus-label-text-color);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.selected:active .label {
|
|
47
|
+
:where(.selected:active) .label {
|
|
48
48
|
color: var(--_selected-pressed-label-text-color);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.selected .leading.icon {
|
|
51
|
+
:where(.selected) .leading.icon {
|
|
52
52
|
color: var(--_selected-leading-icon-color);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.selected:hover .leading.icon {
|
|
55
|
+
:where(.selected:hover) .leading.icon {
|
|
56
56
|
color: var(--_selected-hover-leading-icon-color);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.selected:focus .leading.icon {
|
|
59
|
+
:where(.selected:focus) .leading.icon {
|
|
60
60
|
color: var(--_selected-focus-leading-icon-color);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.selected:active .leading.icon {
|
|
63
|
+
:where(.selected:active) .leading.icon {
|
|
64
64
|
color: var(--_selected-pressed-leading-icon-color);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
@media (forced-colors: active) {
|
|
68
|
-
.selected:not(.elevated)::before {
|
|
68
|
+
:where(.selected:not(.elevated))::before {
|
|
69
69
|
// for forced-colors. Don't add it to elevated containers since elevation
|
|
70
70
|
// already have a border added.
|
|
71
|
-
border: 1px solid
|
|
71
|
+
border: 1px solid CanvasText;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:where(.selected) .outline {
|
|
75
|
+
border-width: 1px;
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
border-end-end-radius: var(--_container-shape-end-end);
|
|
21
21
|
display: inline-flex;
|
|
22
22
|
height: var(--_container-height);
|
|
23
|
+
cursor: pointer;
|
|
23
24
|
|
|
24
25
|
@include ripple.theme(
|
|
25
26
|
(
|
|
@@ -116,11 +117,11 @@
|
|
|
116
117
|
position: absolute;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
:focus .outline {
|
|
120
|
+
:where(:focus) .outline {
|
|
120
121
|
border-color: var(--_focus-outline-color);
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
.disabled .outline {
|
|
124
|
+
:where(.disabled) .outline {
|
|
124
125
|
border-color: var(--_disabled-outline-color);
|
|
125
126
|
opacity: var(--_disabled-outline-opacity);
|
|
126
127
|
}
|
|
@@ -140,26 +141,29 @@
|
|
|
140
141
|
align-items: center;
|
|
141
142
|
color: var(--_label-text-color);
|
|
142
143
|
display: flex;
|
|
143
|
-
font: var(--_label-text-
|
|
144
|
+
font-family: var(--_label-text-font);
|
|
145
|
+
font-size: var(--_label-text-size);
|
|
146
|
+
line-height: var(--_label-text-line-height);
|
|
147
|
+
font-weight: var(--_label-text-weight);
|
|
144
148
|
height: 100%;
|
|
145
149
|
text-overflow: ellipsis;
|
|
146
150
|
user-select: none;
|
|
147
151
|
white-space: nowrap;
|
|
148
152
|
}
|
|
149
153
|
|
|
150
|
-
:hover .label {
|
|
154
|
+
:where(:hover) .label {
|
|
151
155
|
color: var(--_hover-label-text-color);
|
|
152
156
|
}
|
|
153
157
|
|
|
154
|
-
:focus .label {
|
|
158
|
+
:where(:focus) .label {
|
|
155
159
|
color: var(--_focus-label-text-color);
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
:active .label {
|
|
162
|
+
:where(:active) .label {
|
|
159
163
|
color: var(--_pressed-label-text-color);
|
|
160
164
|
}
|
|
161
165
|
|
|
162
|
-
.disabled .label {
|
|
166
|
+
:where(.disabled) .label {
|
|
163
167
|
color: var(--_disabled-label-text-color);
|
|
164
168
|
opacity: var(--_disabled-label-text-opacity);
|
|
165
169
|
}
|
|
@@ -181,20 +185,32 @@
|
|
|
181
185
|
color: var(--_leading-icon-color);
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
:hover .leading.icon {
|
|
188
|
+
:where(:hover) .leading.icon {
|
|
185
189
|
color: var(--_hover-leading-icon-color);
|
|
186
190
|
}
|
|
187
191
|
|
|
188
|
-
:focus .leading.icon {
|
|
192
|
+
:where(:focus) .leading.icon {
|
|
189
193
|
color: var(--_focus-leading-icon-color);
|
|
190
194
|
}
|
|
191
195
|
|
|
192
|
-
:active .leading.icon {
|
|
196
|
+
:where(:active) .leading.icon {
|
|
193
197
|
color: var(--_pressed-leading-icon-color);
|
|
194
198
|
}
|
|
195
199
|
|
|
196
|
-
.disabled .leading.icon {
|
|
200
|
+
:where(.disabled) .leading.icon {
|
|
197
201
|
color: var(--_disabled-leading-icon-color);
|
|
198
202
|
opacity: var(--_disabled-leading-icon-opacity);
|
|
199
203
|
}
|
|
204
|
+
|
|
205
|
+
@media (forced-colors: active) {
|
|
206
|
+
:where(.disabled) :is(.label, .outline, .leading.icon) {
|
|
207
|
+
color: GrayText;
|
|
208
|
+
opacity: 1;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
a,
|
|
213
|
+
button:not(:disabled) {
|
|
214
|
+
cursor: inherit;
|
|
215
|
+
}
|
|
200
216
|
}
|
|
@@ -14,27 +14,16 @@
|
|
|
14
14
|
padding: 0 8px;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.trailing.action md-focus-ring {
|
|
18
|
-
// Note: the trailing action's shape only follows the trailing end of the
|
|
19
|
-
// chip. For example, if the leading end is rounded, but the trailing is end
|
|
20
|
-
// squared, then the focus ring will be squared (not rounded+squared).
|
|
21
|
-
@include focus-ring.theme(
|
|
22
|
-
(
|
|
23
|
-
'shape-start-start': var(--_container-shape-start-end),
|
|
24
|
-
'shape-end-start': var(--_container-shape-end-end),
|
|
25
|
-
'shape-end-end': var(--_container-shape-end-end),
|
|
26
|
-
'shape-start-end': var(--_container-shape-start-end),
|
|
27
|
-
'outward-offset': -2px,
|
|
28
|
-
)
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.trailing.action md-ripple {
|
|
17
|
+
.trailing.action :is(md-ripple, md-focus-ring) {
|
|
33
18
|
border-radius: 50%;
|
|
34
19
|
height: calc(4 / 3 * var(--_icon-size)); // 24px default
|
|
35
20
|
width: calc(4 / 3 * var(--_icon-size)); // 24px default
|
|
36
21
|
}
|
|
37
22
|
|
|
23
|
+
.trailing.action md-focus-ring {
|
|
24
|
+
inset: unset;
|
|
25
|
+
}
|
|
26
|
+
|
|
38
27
|
.has-trailing .primary.action {
|
|
39
28
|
padding-inline-end: 0;
|
|
40
29
|
}
|
|
@@ -45,36 +34,47 @@
|
|
|
45
34
|
width: var(--_icon-size);
|
|
46
35
|
}
|
|
47
36
|
|
|
48
|
-
:hover .trailing.icon {
|
|
37
|
+
:where(:hover) .trailing.icon {
|
|
49
38
|
color: var(--_hover-trailing-icon-color);
|
|
50
39
|
}
|
|
51
40
|
|
|
52
|
-
:focus .trailing.icon {
|
|
41
|
+
:where(:focus) .trailing.icon {
|
|
53
42
|
color: var(--_focus-trailing-icon-color);
|
|
54
43
|
}
|
|
55
44
|
|
|
56
|
-
:active .trailing.icon {
|
|
45
|
+
:where(:active) .trailing.icon {
|
|
57
46
|
color: var(--_pressed-trailing-icon-color);
|
|
58
47
|
}
|
|
59
48
|
|
|
60
|
-
.disabled .trailing.icon {
|
|
49
|
+
:where(.disabled) .trailing.icon {
|
|
61
50
|
color: var(--_disabled-trailing-icon-color);
|
|
62
51
|
opacity: var(--_disabled-trailing-icon-opacity);
|
|
63
52
|
}
|
|
64
53
|
|
|
65
|
-
.selected .trailing.icon {
|
|
54
|
+
:where(.selected) .trailing.icon {
|
|
66
55
|
color: var(--_selected-trailing-icon-color);
|
|
67
56
|
}
|
|
68
57
|
|
|
69
|
-
.selected:hover .trailing.icon {
|
|
58
|
+
:where(.selected:hover) .trailing.icon {
|
|
70
59
|
color: var(--_selected-hover-trailing-icon-color);
|
|
71
60
|
}
|
|
72
61
|
|
|
73
|
-
.selected:focus .trailing.icon {
|
|
62
|
+
:where(.selected:focus) .trailing.icon {
|
|
74
63
|
color: var(--_selected-focus-trailing-icon-color);
|
|
75
64
|
}
|
|
76
65
|
|
|
77
|
-
.selected:active .trailing.icon {
|
|
66
|
+
:where(.selected:active) .trailing.icon {
|
|
78
67
|
color: var(--_selected-pressed-trailing-icon-color);
|
|
79
68
|
}
|
|
69
|
+
|
|
70
|
+
@media (forced-colors: active) {
|
|
71
|
+
.trailing.icon {
|
|
72
|
+
color: ButtonText;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:where(.disabled) .trailing.icon {
|
|
76
|
+
color: GrayText;
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
80
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import '../../elevation/elevation.js';
|
|
7
|
+
import { nothing } from 'lit';
|
|
7
8
|
import { Chip } from './chip.js';
|
|
8
9
|
/**
|
|
9
10
|
* An assist chip component.
|
|
@@ -14,11 +15,12 @@ export declare class AssistChip extends Chip {
|
|
|
14
15
|
target: '_blank' | '_parent' | '_self' | '_top' | '';
|
|
15
16
|
protected get primaryId(): "link" | "button";
|
|
16
17
|
protected get rippleDisabled(): boolean;
|
|
18
|
+
protected renderContainer(content: unknown): import("lit-html").TemplateResult<1>;
|
|
17
19
|
protected getContainerClasses(): {
|
|
18
20
|
disabled: boolean;
|
|
19
21
|
elevated: boolean;
|
|
20
22
|
link: boolean;
|
|
21
23
|
};
|
|
22
|
-
protected
|
|
24
|
+
protected renderPrimaryAction(content: unknown): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
23
25
|
protected renderOutline(): import("lit-html").TemplateResult<1>;
|
|
24
26
|
}
|
|
@@ -7,7 +7,7 @@ import { __decorate } from "tslib";
|
|
|
7
7
|
import '../../elevation/elevation.js';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
|
-
import { Chip } from './chip.js';
|
|
10
|
+
import { Chip, renderGridAction, renderGridContainer } from './chip.js';
|
|
11
11
|
/**
|
|
12
12
|
* An assist chip component.
|
|
13
13
|
*/
|
|
@@ -25,6 +25,9 @@ export class AssistChip extends Chip {
|
|
|
25
25
|
// Link chips cannot be disabled
|
|
26
26
|
return !this.href && this.disabled;
|
|
27
27
|
}
|
|
28
|
+
renderContainer(content) {
|
|
29
|
+
return renderGridContainer(content, this.getContainerClasses());
|
|
30
|
+
}
|
|
28
31
|
getContainerClasses() {
|
|
29
32
|
return {
|
|
30
33
|
...super.getContainerClasses(),
|
|
@@ -34,26 +37,26 @@ export class AssistChip extends Chip {
|
|
|
34
37
|
link: !!this.href,
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
|
-
|
|
40
|
+
renderPrimaryAction(content) {
|
|
38
41
|
const { ariaLabel } = this;
|
|
39
42
|
if (this.href) {
|
|
40
|
-
return html `
|
|
43
|
+
return renderGridAction(html `
|
|
41
44
|
<a class="primary action"
|
|
42
45
|
id="link"
|
|
43
46
|
aria-label=${ariaLabel || nothing}
|
|
44
47
|
href=${this.href}
|
|
45
48
|
target=${this.target || nothing}
|
|
46
|
-
>${
|
|
47
|
-
|
|
49
|
+
>${content}</a>
|
|
50
|
+
`);
|
|
48
51
|
}
|
|
49
|
-
return html `
|
|
52
|
+
return renderGridAction(html `
|
|
50
53
|
<button class="primary action"
|
|
51
54
|
id="button"
|
|
52
55
|
aria-label=${ariaLabel || nothing}
|
|
53
56
|
?disabled=${this.disabled}
|
|
54
57
|
type="button"
|
|
55
|
-
>${
|
|
56
|
-
|
|
58
|
+
>${content}</button>
|
|
59
|
+
`);
|
|
57
60
|
}
|
|
58
61
|
renderOutline() {
|
|
59
62
|
if (this.elevated) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assist-chip.js","sourceRoot":"","sources":["assist-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"assist-chip.js","sourceRoot":"","sources":["assist-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,EAAC,IAAI,EAAE,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,IAAI;IAApC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QAChC,SAAI,GAAG,EAAE,CAAC;QACV,WAAM,GAAyC,EAAE,CAAC;IAuDhE,CAAC;IArDC,IAAc,SAAS;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvC,CAAC;IAED,IAAuB,cAAc;QACnC,gCAAgC;QAChC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC;IACrC,CAAC;IAEkB,eAAe,CAAC,OAAgB;QACjD,OAAO,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAClE,CAAC;IAEkB,mBAAmB;QACpC,OAAO;YACL,GAAG,KAAK,CAAC,mBAAmB,EAAE;YAC9B,gCAAgC;YAChC,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ;YACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI;SAClB,CAAC;IACJ,CAAC;IAEkB,mBAAmB,CAAC,OAAgB;QACrD,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAC5C,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO,gBAAgB,CAAC,IAAI,CAAA;;;uBAGX,SAAS,IAAI,OAAO;iBAC1B,IAAI,CAAC,IAAI;mBACP,IAAI,CAAC,MAAM,IAAI,OAAO;WAC9B,OAAO;OACX,CAAC,CAAC;SACJ;QAED,OAAO,gBAAgB,CAAC,IAAI,CAAA;;;qBAGX,SAAS,IAAI,OAAO;oBACrB,IAAI,CAAC,QAAQ;;SAExB,OAAO;KACX,CAAC,CAAC;IACL,CAAC;IAEkB,aAAa;QAC9B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO,IAAI,CAAA,+BAA+B,CAAC;SAC5C;QAED,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;CACF;AAzD4B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAChC;IAAX,QAAQ,EAAE;wCAAW;AACV;IAAX,QAAQ,EAAE;0CAAmD","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\n\nimport {html, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {Chip, renderGridAction, renderGridContainer} from './chip.js';\n\n/**\n * An assist chip component.\n */\nexport class AssistChip extends Chip {\n @property({type: Boolean}) elevated = false;\n @property() href = '';\n @property() target: '_blank'|'_parent'|'_self'|'_top'|'' = '';\n\n protected get primaryId() {\n return this.href ? 'link' : 'button';\n }\n\n protected override get rippleDisabled() {\n // Link chips cannot be disabled\n return !this.href && this.disabled;\n }\n\n protected override renderContainer(content: unknown) {\n return renderGridContainer(content, this.getContainerClasses());\n }\n\n protected override getContainerClasses() {\n return {\n ...super.getContainerClasses(),\n // Link chips cannot be disabled\n disabled: !this.href && this.disabled,\n elevated: this.elevated,\n link: !!this.href,\n };\n }\n\n protected override renderPrimaryAction(content: unknown) {\n const {ariaLabel} = this as ARIAMixinStrict;\n if (this.href) {\n return renderGridAction(html`\n <a class=\"primary action\"\n id=\"link\"\n aria-label=${ariaLabel || nothing}\n href=${this.href}\n target=${this.target || nothing}\n >${content}</a>\n `);\n }\n\n return renderGridAction(html`\n <button class=\"primary action\"\n id=\"button\"\n aria-label=${ariaLabel || nothing}\n ?disabled=${this.disabled}\n type=\"button\"\n >${content}</button>\n `);\n }\n\n protected override renderOutline() {\n if (this.elevated) {\n return html`<md-elevation></md-elevation>`;\n }\n\n return super.renderOutline();\n }\n}\n"]}
|
|
@@ -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{--_container-height: var(--md-assist-chip-container-height, 32px);--_container-shape: var(--md-assist-chip-container-shape, 8px);--_disabled-label-text-color: var(--md-assist-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-assist-chip-disabled-label-text-opacity, 0.38);--_elevated-container-color: var(--md-assist-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_elevated-container-elevation: var(--md-assist-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color: var(--md-assist-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color: var(--md-assist-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation: var(--md-assist-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity: var(--md-assist-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation: var(--md-assist-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation: var(--md-assist-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation: var(--md-assist-chip-elevated-pressed-container-elevation, 1);--_focus-label-text-color: var(--md-assist-chip-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-assist-chip-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color: var(--md-assist-chip-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-assist-chip-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-assist-chip-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-
|
|
7
|
+
export const styles = css `:host{--_container-height: var(--md-assist-chip-container-height, 32px);--_container-shape: var(--md-assist-chip-container-shape, 8px);--_disabled-label-text-color: var(--md-assist-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-assist-chip-disabled-label-text-opacity, 0.38);--_elevated-container-color: var(--md-assist-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_elevated-container-elevation: var(--md-assist-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color: var(--md-assist-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color: var(--md-assist-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation: var(--md-assist-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity: var(--md-assist-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation: var(--md-assist-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation: var(--md-assist-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation: var(--md-assist-chip-elevated-pressed-container-elevation, 1);--_focus-label-text-color: var(--md-assist-chip-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-assist-chip-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color: var(--md-assist-chip-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-assist-chip-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-assist-chip-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-assist-chip-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-assist-chip-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-assist-chip-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-assist-chip-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-assist-chip-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-color: var(--md-assist-chip-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-assist-chip-pressed-state-layer-opacity, 0.12);--_disabled-outline-color: var(--md-assist-chip-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-assist-chip-disabled-outline-opacity, 0.12);--_focus-outline-color: var(--md-assist-chip-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_outline-color: var(--md-assist-chip-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-assist-chip-outline-width, 1px);--_disabled-leading-icon-color: var(--md-assist-chip-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-assist-chip-disabled-leading-icon-opacity, 0.38);--_focus-leading-icon-color: var(--md-assist-chip-focus-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-leading-icon-color: var(--md-assist-chip-hover-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-icon-color: var(--md-assist-chip-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-assist-chip-icon-size, 18px);--_pressed-leading-icon-color: var(--md-assist-chip-pressed-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var( --md-assist-chip-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-assist-chip-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-assist-chip-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-assist-chip-container-shape-end-start, var(--_container-shape) )}@media(forced-colors: active){.link .outline{border-color:ActiveText}}/*# sourceMappingURL=assist-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=assist-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assist-styles.css.js","sourceRoot":"","sources":["assist-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{--_container-height: var(--md-assist-chip-container-height, 32px);--_container-shape: var(--md-assist-chip-container-shape, 8px);--_disabled-label-text-color: var(--md-assist-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-assist-chip-disabled-label-text-opacity, 0.38);--_elevated-container-color: var(--md-assist-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_elevated-container-elevation: var(--md-assist-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color: var(--md-assist-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color: var(--md-assist-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation: var(--md-assist-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity: var(--md-assist-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation: var(--md-assist-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation: var(--md-assist-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation: var(--md-assist-chip-elevated-pressed-container-elevation, 1);--_focus-label-text-color: var(--md-assist-chip-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-assist-chip-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color: var(--md-assist-chip-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-assist-chip-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-assist-chip-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-
|
|
1
|
+
{"version":3,"file":"assist-styles.css.js","sourceRoot":"","sources":["assist-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{--_container-height: var(--md-assist-chip-container-height, 32px);--_container-shape: var(--md-assist-chip-container-shape, 8px);--_disabled-label-text-color: var(--md-assist-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-assist-chip-disabled-label-text-opacity, 0.38);--_elevated-container-color: var(--md-assist-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_elevated-container-elevation: var(--md-assist-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color: var(--md-assist-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color: var(--md-assist-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation: var(--md-assist-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity: var(--md-assist-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation: var(--md-assist-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation: var(--md-assist-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation: var(--md-assist-chip-elevated-pressed-container-elevation, 1);--_focus-label-text-color: var(--md-assist-chip-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-assist-chip-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color: var(--md-assist-chip-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-assist-chip-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-assist-chip-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-assist-chip-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-assist-chip-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-assist-chip-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-assist-chip-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-assist-chip-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-color: var(--md-assist-chip-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-assist-chip-pressed-state-layer-opacity, 0.12);--_disabled-outline-color: var(--md-assist-chip-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-assist-chip-disabled-outline-opacity, 0.12);--_focus-outline-color: var(--md-assist-chip-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_outline-color: var(--md-assist-chip-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-assist-chip-outline-width, 1px);--_disabled-leading-icon-color: var(--md-assist-chip-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-assist-chip-disabled-leading-icon-opacity, 0.38);--_focus-leading-icon-color: var(--md-assist-chip-focus-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-leading-icon-color: var(--md-assist-chip-hover-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-icon-color: var(--md-assist-chip-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-assist-chip-icon-size, 18px);--_pressed-leading-icon-color: var(--md-assist-chip-pressed-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var( --md-assist-chip-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-assist-chip-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-assist-chip-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-assist-chip-container-shape-end-start, var(--_container-shape) )}@media(forced-colors: active){.link .outline{border-color:ActiveText}}/*# sourceMappingURL=assist-styles.css.map */\n`;\n "]}
|
package/chips/internal/chip.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import '../../focus/md-focus-ring.js';
|
|
7
7
|
import '../../ripple/ripple.js';
|
|
8
8
|
import { LitElement, nothing, TemplateResult } from 'lit';
|
|
9
|
+
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
9
10
|
/**
|
|
10
11
|
* A chip component.
|
|
11
12
|
*/
|
|
@@ -27,19 +28,26 @@ export declare abstract class Chip extends LitElement {
|
|
|
27
28
|
* Some chip actions such as links cannot be disabled.
|
|
28
29
|
*/
|
|
29
30
|
protected get rippleDisabled(): boolean;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* Listbox chip sets should remove this since they do not contain cells.
|
|
33
|
-
*/
|
|
34
|
-
protected containerRole?: 'row';
|
|
35
|
-
protected render(): TemplateResult<1>;
|
|
31
|
+
protected render(): unknown;
|
|
32
|
+
protected abstract renderContainer(content: unknown): unknown;
|
|
36
33
|
protected getContainerClasses(): {
|
|
37
34
|
disabled: boolean;
|
|
38
35
|
};
|
|
39
|
-
protected
|
|
40
|
-
protected renderActionCell(content: TemplateResult | typeof nothing): TemplateResult | typeof nothing;
|
|
41
|
-
protected abstract renderAction(): TemplateResult;
|
|
42
|
-
protected renderContent(): TemplateResult<1>;
|
|
36
|
+
protected renderContainerContent(): TemplateResult<1>;
|
|
43
37
|
protected renderOutline(): TemplateResult<1>;
|
|
44
38
|
protected renderLeadingIcon(): TemplateResult;
|
|
39
|
+
protected abstract renderPrimaryAction(content: unknown): unknown;
|
|
40
|
+
private renderPrimaryContent;
|
|
45
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Renders a chip container that follows the grid/row/cell a11y pattern.
|
|
44
|
+
*
|
|
45
|
+
* This renders the container with `role="row"`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function renderGridContainer(content: unknown, classes: ClassInfo): TemplateResult<1>;
|
|
48
|
+
/**
|
|
49
|
+
* Renders a chip action that follows the grid/row/cell a11y pattern.
|
|
50
|
+
*
|
|
51
|
+
* This wraps actions in a `role="cell"` div.
|
|
52
|
+
*/
|
|
53
|
+
export declare function renderGridAction(content: unknown): TemplateResult<1> | typeof nothing;
|
package/chips/internal/chip.js
CHANGED
|
@@ -7,7 +7,7 @@ import { __decorate } from "tslib";
|
|
|
7
7
|
import '../../focus/md-focus-ring.js';
|
|
8
8
|
import '../../ripple/ripple.js';
|
|
9
9
|
import { html, LitElement, nothing } from 'lit';
|
|
10
|
-
import { property
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
11
|
import { classMap } from 'lit/directives/class-map.js';
|
|
12
12
|
import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
|
|
13
13
|
/**
|
|
@@ -18,11 +18,6 @@ export class Chip extends LitElement {
|
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.disabled = false;
|
|
20
20
|
this.label = '';
|
|
21
|
-
/**
|
|
22
|
-
* The aria role of the container. Defaults to `row` for grid chip sets.
|
|
23
|
-
* Listbox chip sets should remove this since they do not contain cells.
|
|
24
|
-
*/
|
|
25
|
-
this.containerRole = 'row';
|
|
26
21
|
}
|
|
27
22
|
/**
|
|
28
23
|
* Whether or not the primary ripple is disabled (defaults to `disabled`).
|
|
@@ -32,32 +27,30 @@ export class Chip extends LitElement {
|
|
|
32
27
|
return this.disabled;
|
|
33
28
|
}
|
|
34
29
|
render() {
|
|
35
|
-
return
|
|
36
|
-
<div class="container ${classMap(this.getContainerClasses())}"
|
|
37
|
-
role=${this.containerRole || nothing}>
|
|
38
|
-
${this.renderOutline()}
|
|
39
|
-
<md-focus-ring part="focus-ring" for=${this.primaryId}></md-focus-ring>
|
|
40
|
-
<md-ripple for=${this.primaryId}
|
|
41
|
-
?disabled=${this.rippleDisabled}></md-ripple>
|
|
42
|
-
${this.renderActions()}
|
|
43
|
-
</div>
|
|
44
|
-
`;
|
|
30
|
+
return this.renderContainer(this.renderContainerContent());
|
|
45
31
|
}
|
|
46
32
|
getContainerClasses() {
|
|
47
33
|
return {
|
|
48
34
|
disabled: this.disabled,
|
|
49
35
|
};
|
|
50
36
|
}
|
|
51
|
-
|
|
52
|
-
return
|
|
37
|
+
renderContainerContent() {
|
|
38
|
+
return html `
|
|
39
|
+
${this.renderOutline()}
|
|
40
|
+
<md-focus-ring part="focus-ring"
|
|
41
|
+
for=${this.primaryId}></md-focus-ring>
|
|
42
|
+
<md-ripple for=${this.primaryId}
|
|
43
|
+
?disabled=${this.rippleDisabled}></md-ripple>
|
|
44
|
+
${this.renderPrimaryAction(this.renderPrimaryContent())}
|
|
45
|
+
`;
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return html `<
|
|
47
|
+
renderOutline() {
|
|
48
|
+
return html `<span class="outline"></span>`;
|
|
49
|
+
}
|
|
50
|
+
renderLeadingIcon() {
|
|
51
|
+
return html `<slot name="icon"></slot>`;
|
|
59
52
|
}
|
|
60
|
-
|
|
53
|
+
renderPrimaryContent() {
|
|
61
54
|
return html `
|
|
62
55
|
<span class="leading icon" aria-hidden="true">
|
|
63
56
|
${this.renderLeadingIcon()}
|
|
@@ -66,12 +59,6 @@ export class Chip extends LitElement {
|
|
|
66
59
|
<span class="touch"></span>
|
|
67
60
|
`;
|
|
68
61
|
}
|
|
69
|
-
renderOutline() {
|
|
70
|
-
return html `<span class="outline"></span>`;
|
|
71
|
-
}
|
|
72
|
-
renderLeadingIcon() {
|
|
73
|
-
return html `<slot name="icon"></slot>`;
|
|
74
|
-
}
|
|
75
62
|
}
|
|
76
63
|
(() => {
|
|
77
64
|
requestUpdateOnAriaChange(Chip);
|
|
@@ -87,7 +74,25 @@ __decorate([
|
|
|
87
74
|
__decorate([
|
|
88
75
|
property()
|
|
89
76
|
], Chip.prototype, "label", void 0);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Renders a chip container that follows the grid/row/cell a11y pattern.
|
|
79
|
+
*
|
|
80
|
+
* This renders the container with `role="row"`.
|
|
81
|
+
*/
|
|
82
|
+
export function renderGridContainer(content, classes) {
|
|
83
|
+
return html `
|
|
84
|
+
<div class="container ${classMap(classes)}" role="row">${content}</div>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Renders a chip action that follows the grid/row/cell a11y pattern.
|
|
89
|
+
*
|
|
90
|
+
* This wraps actions in a `role="cell"` div.
|
|
91
|
+
*/
|
|
92
|
+
export function renderGridAction(content) {
|
|
93
|
+
if (content === nothing) {
|
|
94
|
+
return content;
|
|
95
|
+
}
|
|
96
|
+
return html `<div class="cell" role="cell">${content}</div>`;
|
|
97
|
+
}
|
|
93
98
|
//# sourceMappingURL=chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","sourceRoot":"","sources":["chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"chip.js","sourceRoot":"","sources":["chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAE1E;;GAEG;AACH,MAAM,OAAgB,IAAK,SAAQ,UAAU;IAA7C;;QAW6B,aAAQ,GAAG,KAAK,CAAC;QAChC,UAAK,GAAG,EAAE,CAAC;IAyDzB,CAAC;IAlDC;;;OAGG;IACH,IAAc,cAAc;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAIS,mBAAmB;QAC3B,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;IACJ,CAAC;IAES,sBAAsB;QAC9B,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,aAAa,EAAE;;gBAEZ,IAAI,CAAC,SAAS;uBACP,IAAI,CAAC,SAAS;sBACf,IAAI,CAAC,cAAc;QACjC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;KACxD,CAAC;IACJ,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAA,+BAA+B,CAAC;IAC7C,CAAC;IAES,iBAAiB;QACzB,OAAO,IAAI,CAAA,2BAA2B,CAAC;IACzC,CAAC;IAIO,oBAAoB;QAC1B,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,iBAAiB,EAAE;;4BAEN,IAAI,CAAC,KAAK;;KAEjC,CAAC;IACJ,CAAC;;AAnED;IACE,yBAAyB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAED,kBAAkB;AACF,sBAAiB,GAAG;IAClC,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,CAAC;AAEyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;sCAAkB;AAChC;IAAX,QAAQ,EAAE;mCAAY;AA2DzB;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,OAAkB;IACtE,OAAO,IAAI,CAAA;4BACe,QAAQ,CAAC,OAAO,CAAC,gBAAgB,OAAO;GACjE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,IAAI,OAAO,KAAK,OAAO,EAAE;QACvB,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,IAAI,CAAA,iCAAiC,OAAO,QAAQ,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, LitElement, nothing, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\n\n/**\n * A chip component.\n */\nexport abstract class Chip extends LitElement {\n static {\n requestUpdateOnAriaChange(Chip);\n }\n\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true\n };\n\n @property({type: Boolean}) disabled = false;\n @property() label = '';\n\n /**\n * The `id` of the action the primary focus ring and ripple are for.\n */\n protected abstract readonly primaryId: string;\n\n /**\n * Whether or not the primary ripple is disabled (defaults to `disabled`).\n * Some chip actions such as links cannot be disabled.\n */\n protected get rippleDisabled() {\n return this.disabled;\n }\n\n protected override render() {\n return this.renderContainer(this.renderContainerContent());\n }\n\n protected abstract renderContainer(content: unknown): unknown;\n\n protected getContainerClasses() {\n return {\n disabled: this.disabled,\n };\n }\n\n protected renderContainerContent() {\n return html`\n ${this.renderOutline()}\n <md-focus-ring part=\"focus-ring\"\n for=${this.primaryId}></md-focus-ring>\n <md-ripple for=${this.primaryId}\n ?disabled=${this.rippleDisabled}></md-ripple>\n ${this.renderPrimaryAction(this.renderPrimaryContent())}\n `;\n }\n\n protected renderOutline() {\n return html`<span class=\"outline\"></span>`;\n }\n\n protected renderLeadingIcon(): TemplateResult {\n return html`<slot name=\"icon\"></slot>`;\n }\n\n protected abstract renderPrimaryAction(content: unknown): unknown;\n\n private renderPrimaryContent() {\n return html`\n <span class=\"leading icon\" aria-hidden=\"true\">\n ${this.renderLeadingIcon()}\n </span>\n <span class=\"label\">${this.label}</span>\n <span class=\"touch\"></span>\n `;\n }\n}\n\n/**\n * Renders a chip container that follows the grid/row/cell a11y pattern.\n *\n * This renders the container with `role=\"row\"`.\n */\nexport function renderGridContainer(content: unknown, classes: ClassInfo) {\n return html`\n <div class=\"container ${classMap(classes)}\" role=\"row\">${content}</div>\n `;\n}\n\n/**\n * Renders a chip action that follows the grid/row/cell a11y pattern.\n *\n * This wraps actions in a `role=\"cell\"` div.\n */\nexport function renderGridAction(content: unknown) {\n if (content === nothing) {\n return content;\n }\n\n return html`<div class=\"cell\" role=\"cell\">${content}</div>`;\n}\n"]}
|