@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.
Files changed (141) hide show
  1. package/button/internal/_elevated-button.scss +7 -30
  2. package/button/internal/_filled-button.scss +7 -30
  3. package/button/internal/_filled-tonal-button.scss +7 -30
  4. package/button/internal/_outlined-button.scss +7 -30
  5. package/button/internal/_text-button.scss +7 -30
  6. package/button/internal/elevated-styles.css.js +1 -1
  7. package/button/internal/elevated-styles.css.js.map +1 -1
  8. package/button/internal/filled-styles.css.js +1 -1
  9. package/button/internal/filled-styles.css.js.map +1 -1
  10. package/button/internal/filled-tonal-styles.css.js +1 -1
  11. package/button/internal/filled-tonal-styles.css.js.map +1 -1
  12. package/button/internal/outlined-styles.css.js +1 -1
  13. package/button/internal/outlined-styles.css.js.map +1 -1
  14. package/button/internal/text-styles.css.js +1 -1
  15. package/button/internal/text-styles.css.js.map +1 -1
  16. package/checkbox/internal/_checkbox.scss +3 -37
  17. package/chips/internal/_assist-chip.scss +8 -30
  18. package/chips/internal/_filter-chip.scss +8 -30
  19. package/chips/internal/_input-chip.scss +8 -30
  20. package/chips/internal/_suggestion-chip.scss +8 -30
  21. package/chips/internal/assist-styles.css.js +1 -1
  22. package/chips/internal/assist-styles.css.js.map +1 -1
  23. package/chips/internal/filter-styles.css.js +1 -1
  24. package/chips/internal/filter-styles.css.js.map +1 -1
  25. package/chips/internal/input-styles.css.js +1 -1
  26. package/chips/internal/input-styles.css.js.map +1 -1
  27. package/chips/internal/suggestion-styles.css.js +1 -1
  28. package/chips/internal/suggestion-styles.css.js.map +1 -1
  29. package/dialog/internal/_dialog.scss +3 -40
  30. package/divider/internal/_divider.scss +3 -4
  31. package/elevation/internal/_elevation.scss +3 -4
  32. package/fab/internal/_fab-branded.scss +8 -50
  33. package/fab/internal/_fab.scss +13 -70
  34. package/fab/internal/fab-branded-styles.css.js +1 -1
  35. package/fab/internal/fab-branded-styles.css.js.map +1 -1
  36. package/fab/internal/fab-styles.css.js +1 -1
  37. package/fab/internal/fab-styles.css.js.map +1 -1
  38. package/field/internal/_filled-field.scss +6 -23
  39. package/field/internal/_outlined-field.scss +6 -20
  40. package/field/internal/filled-styles.css.js +1 -1
  41. package/field/internal/filled-styles.css.js.map +1 -1
  42. package/field/internal/outlined-styles.css.js +1 -1
  43. package/field/internal/outlined-styles.css.js.map +1 -1
  44. package/focus/internal/_focus-ring.scss +14 -38
  45. package/icon/internal/_icon.scss +3 -4
  46. package/iconbutton/internal/_filled-icon-button.scss +7 -30
  47. package/iconbutton/internal/_filled-tonal-icon-button.scss +7 -30
  48. package/iconbutton/internal/_icon-button.scss +4 -2
  49. package/iconbutton/internal/_outlined-icon-button.scss +7 -30
  50. package/iconbutton/internal/filled-styles.css.js +1 -1
  51. package/iconbutton/internal/filled-styles.css.js.map +1 -1
  52. package/iconbutton/internal/filled-tonal-styles.css.js +1 -1
  53. package/iconbutton/internal/filled-tonal-styles.css.js.map +1 -1
  54. package/iconbutton/internal/outlined-styles.css.js +1 -1
  55. package/iconbutton/internal/outlined-styles.css.js.map +1 -1
  56. package/labs/card/internal/_elevated-card.scss +4 -2
  57. package/labs/card/internal/_filled-card.scss +4 -2
  58. package/labs/card/internal/_outlined-card.scss +4 -2
  59. package/labs/segmentedbutton/internal/outlined-styles.css.js +1 -1
  60. package/labs/segmentedbutton/internal/outlined-styles.css.js.map +1 -1
  61. package/labs/segmentedbuttonset/internal/_outlined-segmented-button-set.scss +9 -20
  62. package/labs/segmentedbuttonset/internal/outlined-styles.css.js +1 -1
  63. package/labs/segmentedbuttonset/internal/outlined-styles.css.js.map +1 -1
  64. package/list/internal/_list.scss +3 -4
  65. package/list/internal/listitem/_list-item.scss +3 -4
  66. package/menu/internal/_menu.scss +3 -4
  67. package/menu/internal/menuitem/_menu-item.scss +3 -4
  68. package/package.json +1 -1
  69. package/progress/internal/_circular-progress.scss +4 -2
  70. package/progress/internal/_linear-progress.scss +4 -2
  71. package/radio/internal/_radio.scss +3 -4
  72. package/ripple/internal/_ripple.scss +3 -4
  73. package/select/internal/_filled-select.scss +7 -45
  74. package/select/internal/_outlined-select.scss +7 -30
  75. package/select/internal/filled-select-styles.css.js +1 -1
  76. package/select/internal/filled-select-styles.css.js.map +1 -1
  77. package/select/internal/outlined-select-styles.css.js +1 -1
  78. package/select/internal/outlined-select-styles.css.js.map +1 -1
  79. package/slider/internal/_slider.scss +4 -2
  80. package/switch/internal/_switch.scss +3 -52
  81. package/tabs/internal/_primary-tab.scss +8 -30
  82. package/tabs/internal/_secondary-tab.scss +8 -30
  83. package/tabs/internal/primary-tab-styles.css.js +1 -1
  84. package/tabs/internal/primary-tab-styles.css.js.map +1 -1
  85. package/tabs/internal/secondary-tab-styles.css.js +1 -1
  86. package/tabs/internal/secondary-tab-styles.css.js.map +1 -1
  87. package/textfield/internal/_filled-text-field.scss +6 -58
  88. package/textfield/internal/_outlined-text-field.scss +6 -51
  89. package/textfield/internal/filled-styles.css.js +1 -1
  90. package/textfield/internal/filled-styles.css.js.map +1 -1
  91. package/textfield/internal/outlined-styles.css.js +1 -1
  92. package/textfield/internal/outlined-styles.css.js.map +1 -1
  93. package/tokens/_md-comp-assist-chip.scss +40 -7
  94. package/tokens/_md-comp-badge.scss +14 -1
  95. package/tokens/_md-comp-checkbox.scss +36 -2
  96. package/tokens/_md-comp-circular-progress.scss +17 -1
  97. package/tokens/_md-comp-dialog.scss +28 -2
  98. package/tokens/_md-comp-divider.scss +19 -2
  99. package/tokens/_md-comp-elevated-button.scss +40 -7
  100. package/tokens/_md-comp-elevated-card.scss +20 -1
  101. package/tokens/_md-comp-elevation.scss +18 -1
  102. package/tokens/_md-comp-fab-branded.scss +49 -3
  103. package/tokens/_md-comp-fab.scss +55 -2
  104. package/tokens/_md-comp-filled-button.scss +40 -7
  105. package/tokens/_md-comp-filled-card.scss +20 -1
  106. package/tokens/_md-comp-filled-field.scss +36 -2
  107. package/tokens/_md-comp-filled-icon-button.scss +35 -2
  108. package/tokens/_md-comp-filled-select.scss +35 -2
  109. package/tokens/_md-comp-filled-text-field.scss +59 -3
  110. package/tokens/_md-comp-filled-tonal-button.scss +40 -7
  111. package/tokens/_md-comp-filled-tonal-icon-button.scss +39 -2
  112. package/tokens/_md-comp-filter-chip.scss +40 -7
  113. package/tokens/_md-comp-focus-ring.scss +35 -2
  114. package/tokens/_md-comp-icon-button.scss +20 -1
  115. package/tokens/_md-comp-icon.scss +15 -1
  116. package/tokens/_md-comp-input-chip.scss +40 -7
  117. package/tokens/_md-comp-item.scss +1 -0
  118. package/tokens/_md-comp-linear-progress.scss +20 -2
  119. package/tokens/_md-comp-list-item.scss +17 -2
  120. package/tokens/_md-comp-list.scss +16 -2
  121. package/tokens/_md-comp-menu-item.scss +17 -2
  122. package/tokens/_md-comp-menu.scss +13 -3
  123. package/tokens/_md-comp-navigation-bar.scss +23 -2
  124. package/tokens/_md-comp-navigation-drawer.scss +23 -2
  125. package/tokens/_md-comp-outlined-button.scss +40 -7
  126. package/tokens/_md-comp-outlined-card.scss +20 -1
  127. package/tokens/_md-comp-outlined-field.scss +36 -2
  128. package/tokens/_md-comp-outlined-icon-button.scss +39 -2
  129. package/tokens/_md-comp-outlined-segmented-button.scss +36 -2
  130. package/tokens/_md-comp-outlined-select.scss +36 -3
  131. package/tokens/_md-comp-outlined-text-field.scss +55 -3
  132. package/tokens/_md-comp-primary-tab.scss +33 -2
  133. package/tokens/_md-comp-radio.scss +16 -1
  134. package/tokens/_md-comp-ripple.scss +12 -2
  135. package/tokens/_md-comp-secondary-tab.scss +30 -1
  136. package/tokens/_md-comp-slider.scss +13 -1
  137. package/tokens/_md-comp-suggestion-chip.scss +40 -7
  138. package/tokens/_md-comp-switch.scss +43 -2
  139. package/tokens/_md-comp-text-button.scss +40 -7
  140. package/tokens/internal/_shape.scss +93 -0
  141. 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($deps: $_default, $exclude-hardcoded-values: false) {
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
- md-comp-switch.values($deps, $exclude-hardcoded-values),
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($deps: $_default, $exclude-hardcoded-values: false) {
69
- $tokens: validate.values(
70
- md-comp-text-button.values($deps, $exclude-hardcoded-values),
71
- $supported-tokens: $supported-tokens,
72
- $unsupported-tokens: $unsupported-tokens,
73
- $new-tokens: (
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)) is missing the \'#{$token}\' token. Does it need adding to $unsupported-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