@material/web 1.0.0-pre.7 → 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 +3 -3
- package/aria/aria.js +37 -13
- package/aria/aria.js.map +1 -1
- package/aria/delegate.d.ts +1 -1
- package/aria/delegate.js +1 -1
- package/aria/delegate.js.map +1 -1
- package/badge/lib/badge.d.ts +0 -3
- package/badge/lib/badge.js +4 -6
- package/badge/lib/badge.js.map +1 -1
- package/button/lib/_elevated-button.scss +35 -6
- 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 +23 -26
- package/button/lib/button.js +12 -30
- 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-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 -6
- package/checkbox/lib/checkbox.js +3 -20
- 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/assist-chip.js +2 -1
- package/chips/assist-chip.js.map +1 -1
- package/chips/filter-chip.js +2 -1
- package/chips/filter-chip.js.map +1 -1
- package/chips/lib/_assist-chip.scss +37 -3
- package/chips/lib/_elevated.scss +60 -0
- package/chips/lib/_filter-chip.scss +43 -9
- package/chips/lib/_shared.scss +36 -76
- 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 +19 -16
- package/chips/lib/chip.js +43 -63
- package/chips/lib/chip.js.map +1 -1
- package/chips/lib/elevated-styles.css.d.ts +1 -0
- package/chips/lib/elevated-styles.css.js +9 -0
- package/chips/lib/elevated-styles.css.js.map +1 -0
- package/chips/lib/elevated-styles.scss +10 -0
- package/chips/lib/filter-chip.d.ts +6 -1
- package/chips/lib/filter-chip.js +38 -5
- package/chips/lib/filter-chip.js.map +1 -1
- package/chips/lib/filter-styles.css.js +1 -1
- package/chips/lib/filter-styles.css.js.map +1 -1
- 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/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 -6
- package/circularprogress/lib/circular-progress.js +1 -2
- package/circularprogress/lib/circular-progress.js.map +1 -1
- package/dialog/lib/_dialog.scss +0 -1
- package/dialog/lib/_tokens.scss +0 -1
- package/dialog/lib/dialog.d.ts +10 -10
- package/dialog/lib/dialog.js +8 -7
- package/dialog/lib/dialog.js.map +1 -1
- package/elevation/lib/elevation.d.ts +1 -1
- package/elevation/lib/elevation.js.map +1 -1
- package/fab/branded-fab.d.ts +3 -0
- package/fab/lib/_fab-branded.scss +58 -4
- package/fab/lib/_fab.scss +80 -6
- package/fab/lib/_shared.scss +8 -3
- package/fab/lib/fab-branded-styles.css.js +1 -1
- package/fab/lib/fab-branded-styles.css.js.map +1 -1
- 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 +4 -0
- package/fab/lib/forced-colors-styles.css.js +1 -1
- package/fab/lib/forced-colors-styles.css.js.map +1 -1
- package/fab/lib/shared-styles.css.js +1 -1
- package/fab/lib/shared-styles.css.js.map +1 -1
- package/fab/lib/shared.d.ts +12 -15
- package/fab/lib/shared.js +2 -26
- package/fab/lib/shared.js.map +1 -1
- package/field/lib/_filled-field.scss +47 -12
- package/field/lib/_outlined-field.scss +39 -12
- 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 -0
- package/focus/focus-ring.js +2 -0
- 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 +116 -11
- package/focus/lib/focus-ring.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 -21
- package/iconbutton/lib/icon-button.js +12 -28
- 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/lib/_linear-progress.scss +78 -72
- package/linearprogress/lib/linear-progress.d.ts +5 -5
- package/linearprogress/lib/linear-progress.js +1 -1
- package/linearprogress/lib/linear-progress.js.map +1 -1
- package/list/lib/_list.scss +4 -2
- package/list/lib/list.d.ts +7 -12
- package/list/lib/list.js +2 -11
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +8 -4
- 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 +27 -27
- package/list/lib/listitem/list-item.js +4 -29
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js +1 -3
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/menu/lib/_menu.scss +4 -2
- 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 +31 -39
- package/menu/lib/menu.js +14 -20
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +4 -2
- package/menu/lib/shared.d.ts +14 -0
- 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 -11
- package/menu/lib/submenuitem/sub-menu-item.js +20 -3
- 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.d.ts +2 -2
- package/navigationbar/lib/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 +3 -3
- 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 +2 -2
- 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/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 +9 -17
- package/navigationtab/lib/navigation-tab.js +3 -22
- 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/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 -7
- package/radio/lib/radio.js +2 -22
- package/radio/lib/radio.js.map +1 -1
- package/ripple/lib/ripple.js +4 -0
- package/ripple/lib/ripple.js.map +1 -1
- package/segmentedbutton/lib/segmented-button.d.ts +15 -21
- package/segmentedbutton/lib/segmented-button.js +3 -24
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +32 -13
- 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 +1 -1
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/select/lib/_filled-select.scss +66 -7
- package/select/lib/_outlined-select.scss +41 -7
- package/select/lib/filled-select-styles.css.js +1 -1
- package/select/lib/filled-select-styles.css.js.map +1 -1
- package/select/lib/outlined-select-styles.css.js +1 -1
- package/select/lib/outlined-select-styles.css.js.map +1 -1
- package/select/lib/select.d.ts +46 -48
- package/select/lib/select.js +21 -19
- package/select/lib/select.js.map +1 -1
- package/slider/harness.d.ts +1 -1
- package/slider/harness.js +9 -9
- package/slider/harness.js.map +1 -1
- package/slider/lib/_slider.scss +6 -6
- 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 +22 -51
- package/slider/lib/slider.js +18 -54
- 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 -5
- package/switch/lib/switch.js +2 -27
- 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 -1
- package/textfield/lib/text-field.js.map +1 -1
- package/tokens/_index.scss +2 -18
- package/tokens/_md-comp-assist-chip.scss +0 -9
- 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-fab-branded.scss +6 -31
- package/tokens/_md-comp-fab.scss +9 -50
- 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 +4 -30
- 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 +0 -10
- 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 +0 -10
- package/tokens/_md-comp-linear-progress-indicator.scss +23 -8
- package/tokens/_md-comp-list-item.scss +0 -27
- package/tokens/_md-comp-list.scss +3 -29
- package/tokens/_md-comp-menu-item.scss +3 -29
- package/tokens/_md-comp-menu.scss +0 -23
- 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 +1 -28
- package/tokens/_md-comp-outlined-text-field.scss +85 -8
- package/tokens/_md-comp-suggestion-chip.scss +0 -9
- package/tokens/_md-comp-switch.scss +81 -1
- package/tokens/_md-comp-text-button.scss +0 -10
- package/tokens/_values.scss +2 -7
- package/types/aria.d.ts +0 -2
- package/focus/strong-focus.d.ts +0 -56
- package/focus/strong-focus.js +0 -101
- package/focus/strong-focus.js.map +0 -1
- package/sass/_shape.scss +0 -154
- 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/README.md
CHANGED
|
@@ -41,13 +41,13 @@ Chips | 🟡 | ❌ | ❌
|
|
|
41
41
|
Dialog | ✅ | ✅ | ❌
|
|
42
42
|
Divider | ✅ | ✅ | 🟡
|
|
43
43
|
Elevation | ✅ | ✅ | 🟡
|
|
44
|
-
Focus ring | ✅ |
|
|
44
|
+
Focus ring | ✅ | ✅ | 🟡
|
|
45
45
|
Field | ✅ | ✅ | 🟡
|
|
46
46
|
Icon | ✅ | ✅ | ❌
|
|
47
47
|
List | ✅ | ✅ | ❌
|
|
48
48
|
Menu | ✅ | ✅ | ❌
|
|
49
|
-
Progress indicator (circular) | ✅ | ✅ |
|
|
50
|
-
Progress indicator (linear) | ✅ | ✅ |
|
|
49
|
+
Progress indicator (circular) | ✅ | ✅ | 🟡
|
|
50
|
+
Progress indicator (linear) | ✅ | ✅ | 🟡
|
|
51
51
|
Radio button | ✅ | ✅ | ❌
|
|
52
52
|
Ripple | ✅ | ✅ | 🟡
|
|
53
53
|
Select | ✅ | ✅ | ❌
|
package/aria/aria.js
CHANGED
|
@@ -7,19 +7,43 @@
|
|
|
7
7
|
* Accessibility Object Model reflective aria properties.
|
|
8
8
|
*/
|
|
9
9
|
export const ARIA_PROPERTIES = [
|
|
10
|
-
'ariaAtomic',
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
10
|
+
'ariaAtomic',
|
|
11
|
+
'ariaAutoComplete',
|
|
12
|
+
'ariaBusy',
|
|
13
|
+
'ariaChecked',
|
|
14
|
+
'ariaColCount',
|
|
15
|
+
'ariaColIndex',
|
|
16
|
+
'ariaColSpan',
|
|
17
|
+
'ariaCurrent',
|
|
18
|
+
'ariaDisabled',
|
|
19
|
+
'ariaExpanded',
|
|
20
|
+
'ariaHasPopup',
|
|
21
|
+
'ariaHidden',
|
|
22
|
+
'ariaInvalid',
|
|
23
|
+
'ariaKeyShortcuts',
|
|
24
|
+
'ariaLabel',
|
|
25
|
+
'ariaLevel',
|
|
26
|
+
'ariaLive',
|
|
27
|
+
'ariaModal',
|
|
28
|
+
'ariaMultiLine',
|
|
29
|
+
'ariaMultiSelectable',
|
|
30
|
+
'ariaOrientation',
|
|
31
|
+
'ariaPlaceholder',
|
|
32
|
+
'ariaPosInSet',
|
|
33
|
+
'ariaPressed',
|
|
34
|
+
'ariaReadOnly',
|
|
35
|
+
'ariaRequired',
|
|
36
|
+
'ariaRoleDescription',
|
|
37
|
+
'ariaRowCount',
|
|
38
|
+
'ariaRowIndex',
|
|
39
|
+
'ariaRowSpan',
|
|
40
|
+
'ariaSelected',
|
|
41
|
+
'ariaSetSize',
|
|
42
|
+
'ariaSort',
|
|
43
|
+
'ariaValueMax',
|
|
44
|
+
'ariaValueMin',
|
|
45
|
+
'ariaValueNow',
|
|
46
|
+
'ariaValueText',
|
|
23
47
|
];
|
|
24
48
|
/**
|
|
25
49
|
* Accessibility Object Model aria attributes.
|
package/aria/aria.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aria.js","sourceRoot":"","sources":["aria.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,YAAY,
|
|
1
|
+
{"version":3,"file":"aria.js","sourceRoot":"","sources":["aria.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,YAAY;IACZ,kBAAkB;IAClB,UAAU;IACV,aAAa;IACb,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,WAAW;IACX,WAAW;IACX,UAAU;IACV,WAAW;IACX,eAAe;IACf,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,aAAa;IACb,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,eAAe;CAChB,CAAC;AAOF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACnC,QAAW;IACb,OAAO,QAAQ;SACH,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,kEAAkE;SACjE,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,WAAW,EAAgC,CAAC;AAC1D,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Accessibility Object Model reflective aria property name types.\n */\nexport type ARIAProperty = Exclude<keyof ARIAMixin, 'role'>;\n\n/**\n * Accessibility Object Model reflective aria properties.\n */\nexport const ARIA_PROPERTIES: ARIAProperty[] = [\n 'ariaAtomic',\n 'ariaAutoComplete',\n 'ariaBusy',\n 'ariaChecked',\n 'ariaColCount',\n 'ariaColIndex',\n 'ariaColSpan',\n 'ariaCurrent',\n 'ariaDisabled',\n 'ariaExpanded',\n 'ariaHasPopup',\n 'ariaHidden',\n 'ariaInvalid',\n 'ariaKeyShortcuts',\n 'ariaLabel',\n 'ariaLevel',\n 'ariaLive',\n 'ariaModal',\n 'ariaMultiLine',\n 'ariaMultiSelectable',\n 'ariaOrientation',\n 'ariaPlaceholder',\n 'ariaPosInSet',\n 'ariaPressed',\n 'ariaReadOnly',\n 'ariaRequired',\n 'ariaRoleDescription',\n 'ariaRowCount',\n 'ariaRowIndex',\n 'ariaRowSpan',\n 'ariaSelected',\n 'ariaSetSize',\n 'ariaSort',\n 'ariaValueMax',\n 'ariaValueMin',\n 'ariaValueNow',\n 'ariaValueText',\n];\n\n/**\n * Accessibility Object Model aria attribute name types.\n */\nexport type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;\n\n/**\n * Accessibility Object Model aria attributes.\n */\nexport const ARIA_ATTRIBUTES = ARIA_PROPERTIES.map(ariaPropertyToAttribute);\n\n/**\n * Checks if an attribute is one of the AOM aria attributes.\n *\n * @example\n * isAriaAttribute('aria-label'); // true\n *\n * @param attribute The attribute to check.\n * @return True if the attribute is an aria attribute, or false if not.\n */\nexport function isAriaAttribute(attribute: string): attribute is ARIAAttribute {\n return attribute.startsWith('aria-');\n}\n\n/**\n * Converts an AOM aria property into its corresponding attribute.\n *\n * @example\n * ariaPropertyToAttribute('ariaLabel'); // 'aria-label'\n *\n * @param property The aria property.\n * @return The aria attribute.\n */\nexport function ariaPropertyToAttribute<K extends ARIAProperty|'role'>(\n property: K) {\n return property\n .replace('aria', 'aria-')\n // IDREF attributes also include an \"Element\" or \"Elements\" suffix\n .replace(/Elements?/g, '')\n .toLowerCase() as ARIAPropertyToAttribute<K>;\n}\n\n// Converts an `ariaFoo` string type to an `aria-foo` string type.\ntype ARIAPropertyToAttribute<K extends string> =\n K extends `aria${infer Suffix}Element${infer OptS}` ?\n `aria-${Lowercase < Suffix >}` :\n K extends `aria${infer Suffix}` ? `aria-${Lowercase < Suffix >}` : K;\n"]}
|
package/aria/delegate.d.ts
CHANGED
package/aria/delegate.js
CHANGED
|
@@ -23,7 +23,7 @@ import { ARIA_PROPERTIES, ariaPropertyToAttribute } from './aria.js';
|
|
|
23
23
|
* requestUpdateOnAriaChange(this);
|
|
24
24
|
* }
|
|
25
25
|
*
|
|
26
|
-
* override render() {
|
|
26
|
+
* protected override render() {
|
|
27
27
|
* return html`
|
|
28
28
|
* <button aria-label=${this.ariaLabel || nothing}>
|
|
29
29
|
* <slot></slot>
|
package/aria/delegate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["delegate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,eAAe,EAAE,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAA4B;IACpE,KAAK,MAAM,YAAY,IAAI,eAAe,EAAE;QAC1C,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE;YAChC,SAAS,EAAE,uBAAuB,CAAC,YAAY,CAAC;YAChD,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;KACJ;IAED,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;QAC5B,MAAM,UAAU,GAAG;YACjB,aAAa;gBACX,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;YAC/C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ReactiveElement} from 'lit';\n\nimport {ARIA_PROPERTIES, ariaPropertyToAttribute} from './aria.js';\n\n/**\n * Sets up a `ReactiveElement` constructor to enable updates when delegating\n * aria attributes. Elements may bind `this.aria*` properties to `aria-*`\n * attributes in their render functions.\n *\n * This function will:\n * - Call `requestUpdate()` when an aria attribute changes.\n * - Add `role=\"presentation\"` to the host.\n *\n * NOTE: The following features are not currently supported:\n * - Delegating IDREF attributes (ex: `aria-labelledby`, `aria-controls`)\n * - Delegating the `role` attribute\n *\n * @example\n * class XButton extends LitElement {\n * static {\n * requestUpdateOnAriaChange(this);\n * }\n *\n * override render() {\n * return html`\n * <button aria-label=${this.ariaLabel || nothing}>\n * <slot></slot>\n * </button>\n * `;\n * }\n * }\n *\n * @param ctor The `ReactiveElement` constructor to patch.\n */\nexport function requestUpdateOnAriaChange(ctor: typeof ReactiveElement) {\n for (const ariaProperty of ARIA_PROPERTIES) {\n ctor.createProperty(ariaProperty, {\n attribute: ariaPropertyToAttribute(ariaProperty),\n reflect: true,\n });\n }\n\n ctor.addInitializer(element => {\n const controller = {\n hostConnected() {\n element.setAttribute('role', 'presentation');\n }\n };\n\n element.addController(controller);\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["delegate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,eAAe,EAAE,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAA4B;IACpE,KAAK,MAAM,YAAY,IAAI,eAAe,EAAE;QAC1C,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE;YAChC,SAAS,EAAE,uBAAuB,CAAC,YAAY,CAAC;YAChD,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;KACJ;IAED,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;QAC5B,MAAM,UAAU,GAAG;YACjB,aAAa;gBACX,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;YAC/C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ReactiveElement} from 'lit';\n\nimport {ARIA_PROPERTIES, ariaPropertyToAttribute} from './aria.js';\n\n/**\n * Sets up a `ReactiveElement` constructor to enable updates when delegating\n * aria attributes. Elements may bind `this.aria*` properties to `aria-*`\n * attributes in their render functions.\n *\n * This function will:\n * - Call `requestUpdate()` when an aria attribute changes.\n * - Add `role=\"presentation\"` to the host.\n *\n * NOTE: The following features are not currently supported:\n * - Delegating IDREF attributes (ex: `aria-labelledby`, `aria-controls`)\n * - Delegating the `role` attribute\n *\n * @example\n * class XButton extends LitElement {\n * static {\n * requestUpdateOnAriaChange(this);\n * }\n *\n * protected override render() {\n * return html`\n * <button aria-label=${this.ariaLabel || nothing}>\n * <slot></slot>\n * </button>\n * `;\n * }\n * }\n *\n * @param ctor The `ReactiveElement` constructor to patch.\n */\nexport function requestUpdateOnAriaChange(ctor: typeof ReactiveElement) {\n for (const ariaProperty of ARIA_PROPERTIES) {\n ctor.createProperty(ariaProperty, {\n attribute: ariaPropertyToAttribute(ariaProperty),\n reflect: true,\n });\n }\n\n ctor.addInitializer(element => {\n const controller = {\n hostConnected() {\n element.setAttribute('role', 'presentation');\n }\n };\n\n element.addController(controller);\n });\n}\n"]}
|
package/badge/lib/badge.d.ts
CHANGED
package/badge/lib/badge.js
CHANGED
|
@@ -16,12 +16,10 @@ export class Badge extends LitElement {
|
|
|
16
16
|
this.value = '';
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'md3-badge--large': this.value,
|
|
24
|
-
};
|
|
19
|
+
const classes = { 'md3-badge--large': this.value };
|
|
20
|
+
return html `<div class="md3-badge ${classMap(classes)}">
|
|
21
|
+
<p class="md3-badge__value">${this.value}</p>
|
|
22
|
+
</div>`;
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
__decorate([
|
package/badge/lib/badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["badge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QACc,UAAK,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["badge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QACc,UAAK,GAAG,EAAE,CAAC;IASzB,CAAC;IAPoB,MAAM;QACvB,MAAM,OAAO,GAAG,EAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC;QAEjD,OAAO,IAAI,CAAA,yBAAyB,QAAQ,CAAC,OAAO,CAAC;oCACrB,IAAI,CAAC,KAAK;WACnC,CAAC;IACV,CAAC;CACF;AATa;IAAX,QAAQ,EAAE;oCAAY","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\n/**\n * TODO(b/265340196): add docs\n */\nexport class Badge extends LitElement {\n @property() value = '';\n\n protected override render() {\n const classes = {'md3-badge--large': this.value};\n\n return html`<div class=\"md3-badge ${classMap(classes)}\">\n <p class=\"md3-badge__value\">${this.value}</p>\n </div>`;\n }\n}\n"]}
|
|
@@ -4,21 +4,32 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
// go/keep-sorted start
|
|
7
|
+
@use 'sass:list';
|
|
7
8
|
@use 'sass:map';
|
|
8
9
|
// go/keep-sorted end
|
|
9
10
|
// go/keep-sorted start
|
|
10
|
-
@use '../../sass/theme';
|
|
11
11
|
@use '../../tokens';
|
|
12
12
|
// go/keep-sorted end
|
|
13
13
|
|
|
14
14
|
@mixin theme($tokens) {
|
|
15
|
-
$tokens:
|
|
16
|
-
tokens
|
|
17
|
-
|
|
15
|
+
$supported-tokens: list.join(
|
|
16
|
+
tokens.$md-comp-elevated-button-supported-tokens,
|
|
17
|
+
(
|
|
18
|
+
'container-shape-start-start',
|
|
19
|
+
'container-shape-start-end',
|
|
20
|
+
'container-shape-end-end',
|
|
21
|
+
'container-shape-end-start'
|
|
22
|
+
)
|
|
18
23
|
);
|
|
19
24
|
|
|
20
25
|
@each $token, $value in $tokens {
|
|
21
|
-
|
|
26
|
+
@if list.index($supported-tokens, $token) {
|
|
27
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@if $value {
|
|
31
|
+
--md-elevated-button-#{$token}: #{$value};
|
|
32
|
+
}
|
|
22
33
|
}
|
|
23
34
|
}
|
|
24
35
|
|
|
@@ -27,7 +38,25 @@
|
|
|
27
38
|
|
|
28
39
|
:host {
|
|
29
40
|
@each $token, $value in $tokens {
|
|
30
|
-
--_#{$token}: #{$value};
|
|
41
|
+
--_#{$token}: var(--md-elevated-button-#{$token}, #{$value});
|
|
31
42
|
}
|
|
43
|
+
|
|
44
|
+
// Support logical shape properties
|
|
45
|
+
--_container-shape-start-start: var(
|
|
46
|
+
--md-elevated-button-container-shape-start-start,
|
|
47
|
+
var(--_container-shape)
|
|
48
|
+
);
|
|
49
|
+
--_container-shape-start-end: var(
|
|
50
|
+
--md-elevated-button-container-shape-start-end,
|
|
51
|
+
var(--_container-shape)
|
|
52
|
+
);
|
|
53
|
+
--_container-shape-end-end: var(
|
|
54
|
+
--md-elevated-button-container-shape-end-end,
|
|
55
|
+
var(--_container-shape)
|
|
56
|
+
);
|
|
57
|
+
--_container-shape-end-start: var(
|
|
58
|
+
--md-elevated-button-container-shape-end-start,
|
|
59
|
+
var(--_container-shape)
|
|
60
|
+
);
|
|
32
61
|
}
|
|
33
62
|
}
|
|
@@ -12,10 +12,24 @@
|
|
|
12
12
|
// go/keep-sorted end
|
|
13
13
|
|
|
14
14
|
@mixin theme($tokens) {
|
|
15
|
-
$tokens:
|
|
15
|
+
$supported-tokens: list.join(
|
|
16
|
+
tokens.$md-comp-filled-button-supported-tokens,
|
|
17
|
+
(
|
|
18
|
+
'container-shape-start-start',
|
|
19
|
+
'container-shape-start-end',
|
|
20
|
+
'container-shape-end-end',
|
|
21
|
+
'container-shape-end-start'
|
|
22
|
+
)
|
|
23
|
+
);
|
|
16
24
|
|
|
17
25
|
@each $token, $value in $tokens {
|
|
18
|
-
|
|
26
|
+
@if list.index($supported-tokens, $token) {
|
|
27
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@if $value {
|
|
31
|
+
--md-filled-button-#{$token}: #{$value};
|
|
32
|
+
}
|
|
19
33
|
}
|
|
20
34
|
}
|
|
21
35
|
|
|
@@ -24,7 +38,25 @@
|
|
|
24
38
|
|
|
25
39
|
:host {
|
|
26
40
|
@each $token, $value in $tokens {
|
|
27
|
-
--_#{$token}: #{$value};
|
|
41
|
+
--_#{$token}: var(--md-filled-button-#{$token}, #{$value});
|
|
28
42
|
}
|
|
43
|
+
|
|
44
|
+
// Support logical shape properties
|
|
45
|
+
--_container-shape-start-start: var(
|
|
46
|
+
--md-filled-button-container-shape-start-start,
|
|
47
|
+
var(--_container-shape)
|
|
48
|
+
);
|
|
49
|
+
--_container-shape-start-end: var(
|
|
50
|
+
--md-filled-button-container-shape-start-end,
|
|
51
|
+
var(--_container-shape)
|
|
52
|
+
);
|
|
53
|
+
--_container-shape-end-end: var(
|
|
54
|
+
--md-filled-button-container-shape-end-end,
|
|
55
|
+
var(--_container-shape)
|
|
56
|
+
);
|
|
57
|
+
--_container-shape-end-start: var(
|
|
58
|
+
--md-filled-button-container-shape-end-start,
|
|
59
|
+
var(--_container-shape)
|
|
60
|
+
);
|
|
29
61
|
}
|
|
30
62
|
}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
// go/keep-sorted start
|
|
7
|
+
@use 'sass:list';
|
|
7
8
|
@use 'sass:map';
|
|
8
9
|
// go/keep-sorted end
|
|
9
10
|
// go/keep-sorted start
|
|
10
|
-
@use '../../sass/theme';
|
|
11
11
|
@use '../../tokens';
|
|
12
12
|
// go/keep-sorted end
|
|
13
13
|
|
|
@@ -15,13 +15,24 @@
|
|
|
15
15
|
// Selector '.md3-*' should only be used in this project.
|
|
16
16
|
|
|
17
17
|
@mixin theme($tokens) {
|
|
18
|
-
$tokens:
|
|
19
|
-
tokens
|
|
20
|
-
|
|
18
|
+
$supported-tokens: list.join(
|
|
19
|
+
tokens.$md-comp-outlined-button-supported-tokens,
|
|
20
|
+
(
|
|
21
|
+
'container-shape-start-start',
|
|
22
|
+
'container-shape-start-end',
|
|
23
|
+
'container-shape-end-end',
|
|
24
|
+
'container-shape-end-start'
|
|
25
|
+
)
|
|
21
26
|
);
|
|
22
27
|
|
|
23
28
|
@each $token, $value in $tokens {
|
|
24
|
-
|
|
29
|
+
@if list.index($supported-tokens, $token) {
|
|
30
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@if $value {
|
|
34
|
+
--md-outlined-button-#{$token}: #{$value};
|
|
35
|
+
}
|
|
25
36
|
}
|
|
26
37
|
}
|
|
27
38
|
|
|
@@ -30,8 +41,26 @@
|
|
|
30
41
|
|
|
31
42
|
:host {
|
|
32
43
|
@each $token, $value in $tokens {
|
|
33
|
-
--_#{$token}: #{$value};
|
|
44
|
+
--_#{$token}: var(--md-outlined-button-#{$token}, #{$value});
|
|
34
45
|
}
|
|
46
|
+
|
|
47
|
+
// Support logical shape properties
|
|
48
|
+
--_container-shape-start-start: var(
|
|
49
|
+
--md-outlined-button-container-shape-start-start,
|
|
50
|
+
var(--_container-shape)
|
|
51
|
+
);
|
|
52
|
+
--_container-shape-start-end: var(
|
|
53
|
+
--md-outlined-button-container-shape-start-end,
|
|
54
|
+
var(--_container-shape)
|
|
55
|
+
);
|
|
56
|
+
--_container-shape-end-end: var(
|
|
57
|
+
--md-outlined-button-container-shape-end-end,
|
|
58
|
+
var(--_container-shape)
|
|
59
|
+
);
|
|
60
|
+
--_container-shape-end-start: var(
|
|
61
|
+
--md-outlined-button-container-shape-end-start,
|
|
62
|
+
var(--_container-shape)
|
|
63
|
+
);
|
|
35
64
|
}
|
|
36
65
|
|
|
37
66
|
.md3-button__outline {
|
package/button/lib/_shared.scss
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
@use '../../focus/focus-ring';
|
|
14
14
|
@use '../../ripple/ripple';
|
|
15
15
|
@use '../../sass/dom';
|
|
16
|
-
@use '../../sass/shape';
|
|
17
16
|
// go/keep-sorted end
|
|
18
17
|
|
|
19
18
|
@mixin styles() {
|
|
@@ -41,7 +40,10 @@
|
|
|
41
40
|
|
|
42
41
|
@include focus-ring.theme(
|
|
43
42
|
(
|
|
44
|
-
shape:
|
|
43
|
+
'shape-start-start': var(--_container-shape-start-start),
|
|
44
|
+
'shape-start-end': var(--_container-shape-start-end),
|
|
45
|
+
'shape-end-end': var(--_container-shape-end-end),
|
|
46
|
+
'shape-end-start': var(--_container-shape-end-start),
|
|
45
47
|
)
|
|
46
48
|
);
|
|
47
49
|
}
|
|
@@ -7,17 +7,28 @@
|
|
|
7
7
|
@use 'sass:map';
|
|
8
8
|
// go/keep-sorted end
|
|
9
9
|
// go/keep-sorted start
|
|
10
|
-
@use '../../sass/theme';
|
|
11
10
|
@use '../../tokens';
|
|
12
11
|
// go/keep-sorted end
|
|
13
12
|
|
|
14
|
-
$_custom-property-prefix: 'text-button';
|
|
15
|
-
|
|
16
13
|
@mixin theme($tokens) {
|
|
17
|
-
$tokens:
|
|
14
|
+
$supported-tokens: list.join(
|
|
15
|
+
tokens.$md-comp-text-button-supported-tokens,
|
|
16
|
+
(
|
|
17
|
+
'container-shape-start-start',
|
|
18
|
+
'container-shape-start-end',
|
|
19
|
+
'container-shape-end-end',
|
|
20
|
+
'container-shape-end-start'
|
|
21
|
+
)
|
|
22
|
+
);
|
|
18
23
|
|
|
19
24
|
@each $token, $value in $tokens {
|
|
20
|
-
|
|
25
|
+
@if list.index($supported-tokens, $token) {
|
|
26
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $value {
|
|
30
|
+
--md-text-button-#{$token}: #{$value};
|
|
31
|
+
}
|
|
21
32
|
}
|
|
22
33
|
}
|
|
23
34
|
|
|
@@ -26,11 +37,29 @@ $_custom-property-prefix: 'text-button';
|
|
|
26
37
|
|
|
27
38
|
:host {
|
|
28
39
|
@each $token, $value in $tokens {
|
|
29
|
-
--_#{$token}: #{$value};
|
|
40
|
+
--_#{$token}: var(--md-text-button-#{$token}, #{$value});
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
--_container-color: none;
|
|
33
44
|
--_disabled-container-color: none;
|
|
34
45
|
--_disabled-container-opacity: 0;
|
|
46
|
+
|
|
47
|
+
// Support logical shape properties
|
|
48
|
+
--_container-shape-start-start: var(
|
|
49
|
+
--md-text-button-container-shape-start-start,
|
|
50
|
+
var(--_container-shape)
|
|
51
|
+
);
|
|
52
|
+
--_container-shape-start-end: var(
|
|
53
|
+
--md-text-button-container-shape-start-end,
|
|
54
|
+
var(--_container-shape)
|
|
55
|
+
);
|
|
56
|
+
--_container-shape-end-end: var(
|
|
57
|
+
--md-text-button-container-shape-end-end,
|
|
58
|
+
var(--_container-shape)
|
|
59
|
+
);
|
|
60
|
+
--_container-shape-end-start: var(
|
|
61
|
+
--md-text-button-container-shape-end-start,
|
|
62
|
+
var(--_container-shape)
|
|
63
|
+
);
|
|
35
64
|
}
|
|
36
65
|
}
|
|
@@ -7,19 +7,28 @@
|
|
|
7
7
|
@use 'sass:map';
|
|
8
8
|
// go/keep-sorted end
|
|
9
9
|
// go/keep-sorted start
|
|
10
|
-
@use '../../sass/shape';
|
|
11
|
-
@use '../../sass/theme';
|
|
12
10
|
@use '../../tokens';
|
|
13
11
|
// go/keep-sorted end
|
|
14
12
|
|
|
15
13
|
@mixin theme($tokens) {
|
|
16
|
-
$tokens:
|
|
17
|
-
tokens
|
|
18
|
-
|
|
14
|
+
$supported-tokens: list.join(
|
|
15
|
+
tokens.$md-comp-filled-button-supported-tokens,
|
|
16
|
+
(
|
|
17
|
+
'container-shape-start-start',
|
|
18
|
+
'container-shape-start-end',
|
|
19
|
+
'container-shape-end-end',
|
|
20
|
+
'container-shape-end-start'
|
|
21
|
+
)
|
|
19
22
|
);
|
|
20
23
|
|
|
21
24
|
@each $token, $value in $tokens {
|
|
22
|
-
|
|
25
|
+
@if list.index($supported-tokens, $token) {
|
|
26
|
+
@error 'Token `#{$token}` is not a supported token.';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $value {
|
|
30
|
+
--md-tonal-button-#{$token}: #{$value};
|
|
31
|
+
}
|
|
23
32
|
}
|
|
24
33
|
}
|
|
25
34
|
|
|
@@ -28,7 +37,25 @@
|
|
|
28
37
|
|
|
29
38
|
:host {
|
|
30
39
|
@each $token, $value in $tokens {
|
|
31
|
-
--_#{$token}: #{$value};
|
|
40
|
+
--_#{$token}: var(--md-tonal-button-#{$token}, #{$value});
|
|
32
41
|
}
|
|
42
|
+
|
|
43
|
+
// Support logical shape properties
|
|
44
|
+
--_container-shape-start-start: var(
|
|
45
|
+
--md-tonal-button-container-shape-start-start,
|
|
46
|
+
var(--_container-shape)
|
|
47
|
+
);
|
|
48
|
+
--_container-shape-start-end: var(
|
|
49
|
+
--md-tonal-button-container-shape-start-end,
|
|
50
|
+
var(--_container-shape)
|
|
51
|
+
);
|
|
52
|
+
--_container-shape-end-end: var(
|
|
53
|
+
--md-tonal-button-container-shape-end-end,
|
|
54
|
+
var(--_container-shape)
|
|
55
|
+
);
|
|
56
|
+
--_container-shape-end-start: var(
|
|
57
|
+
--md-tonal-button-container-shape-end-start,
|
|
58
|
+
var(--_container-shape)
|
|
59
|
+
);
|
|
33
60
|
}
|
|
34
61
|
}
|
package/button/lib/button.d.ts
CHANGED
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import '../../focus/focus-ring.js';
|
|
7
7
|
import '../../ripple/ripple.js';
|
|
8
|
-
import { LitElement, TemplateResult } from 'lit';
|
|
9
|
-
import { ClassInfo } from 'lit/directives/class-map.js';
|
|
10
|
-
import { MdRipple } from '../../ripple/ripple.js';
|
|
8
|
+
import { LitElement, nothing, TemplateResult } from 'lit';
|
|
11
9
|
/**
|
|
12
10
|
* A button component.
|
|
13
11
|
*/
|
|
@@ -43,30 +41,29 @@ export declare abstract class Button extends LitElement {
|
|
|
43
41
|
* submissions.
|
|
44
42
|
*/
|
|
45
43
|
preventClickDefault: boolean;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
protected assignedIcons: HTMLElement[];
|
|
44
|
+
private readonly buttonElement;
|
|
45
|
+
private readonly ripple;
|
|
46
|
+
private showRipple;
|
|
47
|
+
private readonly assignedIcons;
|
|
51
48
|
constructor();
|
|
52
|
-
private readonly handleActivationClick;
|
|
53
49
|
focus(): void;
|
|
54
50
|
blur(): void;
|
|
55
|
-
protected
|
|
56
|
-
protected
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
protected
|
|
61
|
-
protected renderOutline(): TemplateResult;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
protected render(): TemplateResult<2 | 1>;
|
|
52
|
+
protected getRenderClasses(): {
|
|
53
|
+
'md3-button--icon-leading': boolean;
|
|
54
|
+
'md3-button--icon-trailing': boolean;
|
|
55
|
+
};
|
|
56
|
+
protected renderElevation(): TemplateResult | typeof nothing;
|
|
57
|
+
protected renderOutline(): TemplateResult | typeof nothing;
|
|
58
|
+
private renderTouchTarget;
|
|
59
|
+
private readonly handleActivationClick;
|
|
60
|
+
private readonly getRipple;
|
|
61
|
+
private readonly renderRipple;
|
|
62
|
+
private renderFocusRing;
|
|
63
|
+
private renderLabel;
|
|
64
|
+
private renderLeadingIcon;
|
|
65
|
+
private renderTrailingIcon;
|
|
66
|
+
private renderIcon;
|
|
67
|
+
private handleClick;
|
|
68
|
+
private handleSlotChange;
|
|
72
69
|
}
|