@material/web 1.2.0 → 1.2.1-nightly.6ecda49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/internal/_elevated-button.scss +7 -30
- package/button/internal/_filled-button.scss +7 -30
- package/button/internal/_filled-tonal-button.scss +7 -30
- package/button/internal/_outlined-button.scss +7 -30
- package/button/internal/_text-button.scss +7 -30
- 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/text-styles.css.js +1 -1
- package/button/internal/text-styles.css.js.map +1 -1
- package/checkbox/internal/_checkbox.scss +3 -37
- package/chips/internal/_assist-chip.scss +8 -30
- package/chips/internal/_filter-chip.scss +8 -30
- package/chips/internal/_input-chip.scss +8 -30
- package/chips/internal/_suggestion-chip.scss +8 -30
- package/chips/internal/assist-styles.css.js +1 -1
- package/chips/internal/assist-styles.css.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-styles.css.js +1 -1
- package/chips/internal/input-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/dialog/internal/_dialog.scss +3 -40
- package/divider/internal/_divider.scss +3 -4
- package/elevation/internal/_elevation.scss +3 -4
- package/fab/internal/_fab-branded.scss +8 -50
- package/fab/internal/_fab.scss +13 -70
- 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/field/internal/_filled-field.scss +6 -23
- package/field/internal/_outlined-field.scss +6 -20
- 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/focus/internal/_focus-ring.scss +14 -38
- package/icon/internal/_icon.scss +3 -4
- package/iconbutton/internal/_filled-icon-button.scss +7 -30
- package/iconbutton/internal/_filled-tonal-icon-button.scss +7 -30
- package/iconbutton/internal/_icon-button.scss +4 -2
- package/iconbutton/internal/_outlined-icon-button.scss +7 -30
- package/iconbutton/internal/filled-styles.css.js +1 -1
- package/iconbutton/internal/filled-styles.css.js.map +1 -1
- package/iconbutton/internal/filled-tonal-styles.css.js +1 -1
- package/iconbutton/internal/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/internal/outlined-styles.css.js +1 -1
- package/iconbutton/internal/outlined-styles.css.js.map +1 -1
- package/labs/card/internal/_elevated-card.scss +4 -2
- package/labs/card/internal/_filled-card.scss +4 -2
- package/labs/card/internal/_outlined-card.scss +4 -2
- package/labs/segmentedbutton/internal/outlined-styles.css.js +1 -1
- package/labs/segmentedbutton/internal/outlined-styles.css.js.map +1 -1
- package/labs/segmentedbuttonset/internal/_outlined-segmented-button-set.scss +9 -20
- package/labs/segmentedbuttonset/internal/outlined-styles.css.js +1 -1
- package/labs/segmentedbuttonset/internal/outlined-styles.css.js.map +1 -1
- package/list/internal/_list.scss +3 -4
- package/list/internal/listitem/_list-item.scss +3 -4
- package/menu/internal/_menu.scss +3 -4
- package/menu/internal/menuitem/_menu-item.scss +3 -4
- package/package.json +1 -1
- package/progress/internal/_circular-progress.scss +4 -2
- package/progress/internal/_linear-progress.scss +4 -2
- package/radio/internal/_radio.scss +3 -4
- package/ripple/internal/_ripple.scss +3 -4
- package/select/internal/_filled-select.scss +7 -45
- package/select/internal/_outlined-select.scss +7 -30
- 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/slider/internal/_slider.scss +4 -2
- package/switch/internal/_switch.scss +3 -52
- package/tabs/internal/_primary-tab.scss +8 -30
- package/tabs/internal/_secondary-tab.scss +8 -30
- package/tabs/internal/primary-tab-styles.css.js +1 -1
- package/tabs/internal/primary-tab-styles.css.js.map +1 -1
- package/tabs/internal/secondary-tab-styles.css.js +1 -1
- package/tabs/internal/secondary-tab-styles.css.js.map +1 -1
- package/textfield/internal/_filled-text-field.scss +6 -58
- package/textfield/internal/_outlined-text-field.scss +6 -51
- 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/tokens/_md-comp-assist-chip.scss +40 -7
- package/tokens/_md-comp-badge.scss +14 -1
- package/tokens/_md-comp-checkbox.scss +36 -2
- package/tokens/_md-comp-circular-progress.scss +17 -1
- package/tokens/_md-comp-dialog.scss +28 -2
- package/tokens/_md-comp-divider.scss +19 -2
- package/tokens/_md-comp-elevated-button.scss +40 -7
- package/tokens/_md-comp-elevated-card.scss +20 -1
- package/tokens/_md-comp-elevation.scss +18 -1
- package/tokens/_md-comp-fab-branded.scss +49 -3
- package/tokens/_md-comp-fab.scss +55 -2
- package/tokens/_md-comp-filled-button.scss +40 -7
- package/tokens/_md-comp-filled-card.scss +20 -1
- package/tokens/_md-comp-filled-field.scss +36 -2
- package/tokens/_md-comp-filled-icon-button.scss +35 -2
- package/tokens/_md-comp-filled-select.scss +35 -2
- package/tokens/_md-comp-filled-text-field.scss +59 -3
- package/tokens/_md-comp-filled-tonal-button.scss +40 -7
- package/tokens/_md-comp-filled-tonal-icon-button.scss +39 -2
- package/tokens/_md-comp-filter-chip.scss +40 -7
- package/tokens/_md-comp-focus-ring.scss +35 -2
- package/tokens/_md-comp-icon-button.scss +20 -1
- package/tokens/_md-comp-icon.scss +15 -1
- package/tokens/_md-comp-input-chip.scss +40 -7
- package/tokens/_md-comp-item.scss +1 -0
- package/tokens/_md-comp-linear-progress.scss +20 -2
- package/tokens/_md-comp-list-item.scss +17 -2
- package/tokens/_md-comp-list.scss +16 -2
- package/tokens/_md-comp-menu-item.scss +17 -2
- package/tokens/_md-comp-menu.scss +13 -3
- package/tokens/_md-comp-navigation-bar.scss +23 -2
- package/tokens/_md-comp-navigation-drawer.scss +23 -2
- package/tokens/_md-comp-outlined-button.scss +40 -7
- package/tokens/_md-comp-outlined-card.scss +20 -1
- package/tokens/_md-comp-outlined-field.scss +36 -2
- package/tokens/_md-comp-outlined-icon-button.scss +39 -2
- package/tokens/_md-comp-outlined-segmented-button.scss +36 -2
- package/tokens/_md-comp-outlined-select.scss +36 -3
- package/tokens/_md-comp-outlined-text-field.scss +55 -3
- package/tokens/_md-comp-primary-tab.scss +33 -2
- package/tokens/_md-comp-radio.scss +16 -1
- package/tokens/_md-comp-ripple.scss +12 -2
- package/tokens/_md-comp-secondary-tab.scss +30 -1
- package/tokens/_md-comp-slider.scss +13 -1
- package/tokens/_md-comp-suggestion-chip.scss +40 -7
- package/tokens/_md-comp-switch.scss +43 -2
- package/tokens/_md-comp-text-button.scss +40 -7
- package/tokens/internal/_shape.scss +93 -0
- package/tokens/internal/_validate.scss +1 -1
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
//
|
|
5
5
|
|
|
6
6
|
// go/keep-sorted start
|
|
7
|
+
@use 'sass:map';
|
|
8
|
+
@use 'sass:string';
|
|
9
|
+
// go/keep-sorted end
|
|
10
|
+
// go/keep-sorted start
|
|
11
|
+
@use './internal/shape';
|
|
7
12
|
@use './internal/validate';
|
|
8
13
|
@use './md-sys-color';
|
|
9
14
|
@use './md-sys-shape';
|
|
@@ -32,6 +37,10 @@ $supported-tokens: (
|
|
|
32
37
|
'handle-color',
|
|
33
38
|
'handle-height',
|
|
34
39
|
'handle-shape',
|
|
40
|
+
'handle-shape-end-end',
|
|
41
|
+
'handle-shape-end-start',
|
|
42
|
+
'handle-shape-start-end',
|
|
43
|
+
'handle-shape-start-start',
|
|
35
44
|
'handle-width',
|
|
36
45
|
'hover-handle-color',
|
|
37
46
|
'hover-icon-color',
|
|
@@ -75,6 +84,10 @@ $supported-tokens: (
|
|
|
75
84
|
'track-outline-color',
|
|
76
85
|
'track-outline-width',
|
|
77
86
|
'track-shape',
|
|
87
|
+
'track-shape-end-end',
|
|
88
|
+
'track-shape-end-start',
|
|
89
|
+
'track-shape-start-end',
|
|
90
|
+
'track-shape-start-start',
|
|
78
91
|
'track-width',
|
|
79
92
|
'with-icon-handle-height',
|
|
80
93
|
'with-icon-handle-width',
|
|
@@ -96,11 +109,23 @@ $_default: (
|
|
|
96
109
|
'md-sys-state': md-sys-state.values(),
|
|
97
110
|
);
|
|
98
111
|
|
|
99
|
-
@function values(
|
|
112
|
+
@function values(
|
|
113
|
+
$deps: $_default,
|
|
114
|
+
$exclude-hardcoded-values: false,
|
|
115
|
+
$exclude-custom-properties: true
|
|
116
|
+
) {
|
|
117
|
+
$tokens: md-comp-switch.values($deps, $exclude-hardcoded-values);
|
|
118
|
+
$new-tokens: shape.get-new-logical-shape-tokens(
|
|
119
|
+
$tokens,
|
|
120
|
+
'handle-shape',
|
|
121
|
+
'track-shape'
|
|
122
|
+
);
|
|
123
|
+
|
|
100
124
|
$tokens: validate.values(
|
|
101
|
-
|
|
125
|
+
$tokens,
|
|
102
126
|
$supported-tokens: $supported-tokens,
|
|
103
127
|
$unsupported-tokens: $unsupported-tokens,
|
|
128
|
+
$new-tokens: $new-tokens,
|
|
104
129
|
$renamed-tokens: (
|
|
105
130
|
// Remove default "unselected" prefix (b/292244480)
|
|
106
131
|
'disabled-unselected-handle-color': 'disabled-handle-color',
|
|
@@ -137,5 +162,21 @@ $_default: (
|
|
|
137
162
|
)
|
|
138
163
|
);
|
|
139
164
|
|
|
165
|
+
// Default to `$exclude-custom-properties: false` in the next breaking change.
|
|
166
|
+
// See b/321816473.
|
|
167
|
+
@if not $exclude-custom-properties {
|
|
168
|
+
@each $token, $value in $tokens {
|
|
169
|
+
$shape-tokens: ('handle-shape', 'track-shape');
|
|
170
|
+
@each $shape-token in $shape-tokens {
|
|
171
|
+
@if string.index($token, '#{$shape-token}-') == 1 {
|
|
172
|
+
// Add fallback to shorthand for logical shape properties.
|
|
173
|
+
$value: var(--md-switch-#{$shape-token}, #{$value});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
$tokens: map.set($tokens, $token, var(--md-switch-#{$token}, #{$value}));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
140
181
|
@return $tokens;
|
|
141
182
|
}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
// go/keep-sorted start
|
|
7
7
|
@use 'sass:map';
|
|
8
|
+
@use 'sass:string';
|
|
8
9
|
// go/keep-sorted end
|
|
9
10
|
// go/keep-sorted start
|
|
11
|
+
@use './internal/shape';
|
|
10
12
|
@use './internal/validate';
|
|
11
13
|
@use './md-sys-color';
|
|
12
14
|
@use './md-sys-shape';
|
|
@@ -19,6 +21,10 @@ $supported-tokens: (
|
|
|
19
21
|
// go/keep-sorted start
|
|
20
22
|
'container-height',
|
|
21
23
|
'container-shape',
|
|
24
|
+
'container-shape-end-end',
|
|
25
|
+
'container-shape-end-start',
|
|
26
|
+
'container-shape-start-end',
|
|
27
|
+
'container-shape-start-start',
|
|
22
28
|
'disabled-icon-color',
|
|
23
29
|
'disabled-icon-opacity',
|
|
24
30
|
'disabled-label-text-color',
|
|
@@ -65,12 +71,15 @@ $_default: (
|
|
|
65
71
|
'md-sys-typescale': md-sys-typescale.values(),
|
|
66
72
|
);
|
|
67
73
|
|
|
68
|
-
@function values(
|
|
69
|
-
$
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
@function values(
|
|
75
|
+
$deps: $_default,
|
|
76
|
+
$exclude-hardcoded-values: false,
|
|
77
|
+
$exclude-custom-properties: true
|
|
78
|
+
) {
|
|
79
|
+
$tokens: md-comp-text-button.values($deps, $exclude-hardcoded-values);
|
|
80
|
+
$new-tokens: map.merge(
|
|
81
|
+
shape.get-new-logical-shape-tokens($tokens, 'container-shape'),
|
|
82
|
+
(
|
|
74
83
|
// b/198759625 - Remove once spacing tokens are formally added
|
|
75
84
|
// go/keep-sorted start
|
|
76
85
|
'leading-space': if($exclude-hardcoded-values, null, 12px),
|
|
@@ -84,7 +93,14 @@ $_default: (
|
|
|
84
93
|
'with-trailing-icon-trailing-space':
|
|
85
94
|
if($exclude-hardcoded-values, null, 12px),
|
|
86
95
|
// go/keep-sorted end
|
|
87
|
-
)
|
|
96
|
+
)
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
$tokens: validate.values(
|
|
100
|
+
$tokens,
|
|
101
|
+
$supported-tokens: $supported-tokens,
|
|
102
|
+
$unsupported-tokens: $unsupported-tokens,
|
|
103
|
+
$new-tokens: $new-tokens,
|
|
88
104
|
$renamed-tokens: (
|
|
89
105
|
// Remove "with-*" prefixes (b/273534858)
|
|
90
106
|
'with-icon-disabled-icon-color': 'disabled-icon-color',
|
|
@@ -97,5 +113,22 @@ $_default: (
|
|
|
97
113
|
)
|
|
98
114
|
);
|
|
99
115
|
|
|
116
|
+
// Default to `$exclude-custom-properties: false` in the next breaking change.
|
|
117
|
+
// See b/321816473.
|
|
118
|
+
@if not $exclude-custom-properties {
|
|
119
|
+
@each $token, $value in $tokens {
|
|
120
|
+
@if string.index($token, 'container-shape-') == 1 {
|
|
121
|
+
// Add fallback to shorthand for logical shape properties.
|
|
122
|
+
$value: var(--md-text-button-container-shape, #{$value});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
$tokens: map.set(
|
|
126
|
+
$tokens,
|
|
127
|
+
$token,
|
|
128
|
+
var(--md-text-button-#{$token}, #{$value})
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
100
133
|
@return $tokens;
|
|
101
134
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
// go/keep-sorted start
|
|
7
|
+
@use 'sass:list';
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
@use 'sass:meta';
|
|
10
|
+
// go/keep-sorted end
|
|
11
|
+
|
|
12
|
+
/// Returns a map of 4 logical tokens (start-start, start-end, end-end,
|
|
13
|
+
/// and end-start) for each of the given shape tokens in the provided token
|
|
14
|
+
/// map.
|
|
15
|
+
///
|
|
16
|
+
/// @example scss
|
|
17
|
+
/// $tokens: ('container-shape': 16px 16px 0px 0px);
|
|
18
|
+
/// $new-tokens: shape.get-new-logical-shape-tokens(
|
|
19
|
+
/// $tokens,
|
|
20
|
+
/// 'container-shape'
|
|
21
|
+
/// );
|
|
22
|
+
/// // (
|
|
23
|
+
/// // 'container-shape-start-start': 16px,
|
|
24
|
+
/// // 'container-shape-start-end': 16px,
|
|
25
|
+
/// // 'container-shape-end-end': 0px,
|
|
26
|
+
/// // 'container-shape-end-start': 0px,
|
|
27
|
+
/// // )
|
|
28
|
+
///
|
|
29
|
+
/// @param $tokens A Map of tokens.
|
|
30
|
+
/// @param $shape-tokens One or more shape tokens in the provided map. Each
|
|
31
|
+
/// shape token will add 4 logical shape tokens to the returned map.
|
|
32
|
+
/// @return A map with 4 logical tokens for each provided shape token.
|
|
33
|
+
@function get-new-logical-shape-tokens($tokens, $shape-tokens...) {
|
|
34
|
+
$new-logical-tokens: ();
|
|
35
|
+
$logical-suffixes: (
|
|
36
|
+
// top-left
|
|
37
|
+
'start-start',
|
|
38
|
+
// top-right
|
|
39
|
+
'start-end',
|
|
40
|
+
// bottom-right
|
|
41
|
+
'end-end',
|
|
42
|
+
// bottom-left
|
|
43
|
+
'end-start'
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
@each $shape-token in $shape-tokens {
|
|
47
|
+
$shorthand-value: _expand-shorthand-to-list(map.get($tokens, $shape-token));
|
|
48
|
+
|
|
49
|
+
@each $logical-suffix in $logical-suffixes {
|
|
50
|
+
$logical-token: '#{$shape-token}-#{$logical-suffix}';
|
|
51
|
+
$logical-index: list.index($logical-suffixes, $logical-suffix);
|
|
52
|
+
|
|
53
|
+
$new-logical-tokens: map.set(
|
|
54
|
+
$new-logical-tokens,
|
|
55
|
+
$logical-token,
|
|
56
|
+
list.nth($shorthand-value, $logical-index)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@return $new-logical-tokens;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@function _expand-shorthand-to-list($shorthand) {
|
|
65
|
+
@if meta.type-of($shorthand) != 'list' or list.length($shorthand) == 1 {
|
|
66
|
+
@return ($shorthand, $shorthand, $shorthand, $shorthand);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@if list.length($shorthand) == 2 {
|
|
70
|
+
$top-left-and-bottom-right: list.nth($shorthand, 1);
|
|
71
|
+
$top-right-and-bottom-left: list.nth($shorthand, 2);
|
|
72
|
+
@return (
|
|
73
|
+
$top-left-and-bottom-right,
|
|
74
|
+
$top-right-and-bottom-left,
|
|
75
|
+
$top-left-and-bottom-right,
|
|
76
|
+
$top-right-and-bottom-left
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@if list.length($shorthand) == 3 {
|
|
81
|
+
$top-left: list.nth($shorthand, 1);
|
|
82
|
+
$top-right-and-bottom-left: list.nth($shorthand, 2);
|
|
83
|
+
$bottom-right: list.nth($shorthand, 3);
|
|
84
|
+
@return (
|
|
85
|
+
$top-left,
|
|
86
|
+
$top-right-and-bottom-left,
|
|
87
|
+
$bottom-right,
|
|
88
|
+
$top-right-and-bottom-left
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@return $shorthand;
|
|
93
|
+
}
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
|
|
96
96
|
@each $token in map.keys($values) {
|
|
97
97
|
@if list.index($supported-tokens, $token) == null {
|
|
98
|
-
@error 'validate.values($supported-tokens)
|
|
98
|
+
@error 'validate.values($supported-tokens) is missing the \'#{$token}\' token. Does it need adding to $unsupported-tokens?';
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|