material 3.7.2 → 3.7.3
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 +2 -2
- package/dist/components/slider/features/controller.js +24 -8
- package/dist/elements/css/card.css +1 -1
- package/dist/elements/css/card.js +1 -1
- package/dist/elements/css/dialog.css +1 -1
- package/dist/elements/css/dialog.js +1 -1
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/css/select.css +1 -1
- package/dist/elements/css/select.js +1 -1
- package/dist/elements/css/slider.css +1 -1
- package/dist/elements/css/slider.js +1 -1
- package/dist/elements/css/tabs.css +1 -1
- package/dist/elements/css/tabs.js +1 -1
- package/dist/elements/css/timepicker.css +1 -1
- package/dist/elements/css/timepicker.js +1 -1
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +1 -1
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/card.css +2 -2
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +2 -2
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +2 -2
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +2 -2
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/timepicker.css +2 -2
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/package.json +2 -1
- package/src/styles/abstract/_base.scss +0 -1
- package/src/styles/abstract/_direction.scss +121 -152
- package/src/styles/abstract/_emit.scss +7 -16
- package/src/styles/abstract/_floating-placement.scss +9 -10
- package/src/styles/abstract/_functions.scss +64 -79
- package/src/styles/abstract/_mixins.scss +355 -459
- package/src/styles/abstract/_theme.scss +122 -136
- package/src/styles/abstract/_variables.scss +320 -390
- package/src/styles/abstract/chips/_assist.scss +2 -3
- package/src/styles/abstract/chips/_filter.scss +2 -3
- package/src/styles/abstract/chips/_input.scss +2 -3
- package/src/styles/abstract/chips/_suggestion.scss +2 -3
- package/src/styles/base/_body-theme.scss +10 -15
- package/src/styles/base/_document.scss +10 -33
- package/src/styles/base/_reset.scss +20 -40
- package/src/styles/base/_tokens.scss +6 -21
- package/src/styles/base/_typescale-tokens.scss +12 -16
- package/src/styles/base/_typography.scss +28 -37
- package/src/styles/components/_badge.scss +171 -193
- package/src/styles/components/_bottom-app-bar.scss +72 -90
- package/src/styles/components/_bottom-sheet.scss +188 -232
- package/src/styles/components/_button-group.scss +140 -189
- package/src/styles/components/_button.scss +382 -478
- package/src/styles/components/_card.scss +349 -473
- package/src/styles/components/_carousel.scss +134 -156
- package/src/styles/components/_checkbox.scss +208 -249
- package/src/styles/components/_chips.scss +239 -304
- package/src/styles/components/_datepicker.scss +172 -222
- package/src/styles/components/_dialog.scss +428 -553
- package/src/styles/components/_divider.scss +37 -46
- package/src/styles/components/_drawer.scss +571 -678
- package/src/styles/components/_extended-fab.scss +263 -294
- package/src/styles/components/_fab-menu.scss +225 -267
- package/src/styles/components/_fab.scss +197 -218
- package/src/styles/components/_icon-button.scss +483 -588
- package/src/styles/components/_list.scss +115 -144
- package/src/styles/components/_loading-indicator.scss +23 -29
- package/src/styles/components/_menu.scss +543 -699
- package/src/styles/components/_navigation-bar.scss +189 -234
- package/src/styles/components/_navigation-rail.scss +256 -312
- package/src/styles/components/_progress.scss +60 -85
- package/src/styles/components/_radios.scss +170 -207
- package/src/styles/components/_search.scss +369 -455
- package/src/styles/components/_select.scss +78 -185
- package/src/styles/components/_side-sheet.scss +234 -292
- package/src/styles/components/_slider.scss +289 -367
- package/src/styles/components/_snackbar.scss +149 -198
- package/src/styles/components/_split-button.scss +139 -228
- package/src/styles/components/_switch.scss +282 -349
- package/src/styles/components/_tabs.scss +350 -547
- package/src/styles/components/_text-field.scss +788 -980
- package/src/styles/components/_timepicker.scss +435 -506
- package/src/styles/components/_toolbar.scss +178 -242
- package/src/styles/components/_tooltip.scss +152 -197
- package/src/styles/components/_top-app-bar.scss +206 -230
- package/src/styles/elements/_badge.scss +42 -61
- package/src/styles/elements/_bottom-app-bar.scss +14 -20
- package/src/styles/elements/_bottom-sheet.scss +0 -3
- package/src/styles/elements/_button-group.scss +80 -80
- package/src/styles/elements/_button.scss +72 -88
- package/src/styles/elements/_card.scss +48 -57
- package/src/styles/elements/_carousel.scss +2 -5
- package/src/styles/elements/_checkbox.scss +32 -43
- package/src/styles/elements/_chips.scss +18 -22
- package/src/styles/elements/_config.scss +11 -26
- package/src/styles/elements/_datepicker.scss +17 -22
- package/src/styles/elements/_dialog.scss +0 -3
- package/src/styles/elements/_divider.scss +11 -13
- package/src/styles/elements/_drawer.scss +9 -14
- package/src/styles/elements/_extended-fab.scss +36 -40
- package/src/styles/elements/_fab-menu.scss +21 -25
- package/src/styles/elements/_fab.scss +17 -20
- package/src/styles/elements/_field.scss +93 -114
- package/src/styles/elements/_icon-button.scss +34 -38
- package/src/styles/elements/_index.scss +0 -4
- package/src/styles/elements/_list.scss +19 -26
- package/src/styles/elements/_loading-indicator.scss +6 -9
- package/src/styles/elements/_menu.scss +0 -3
- package/src/styles/elements/_navigation-bar.scss +5 -9
- package/src/styles/elements/_navigation-rail.scss +10 -15
- package/src/styles/elements/_progress.scss +15 -18
- package/src/styles/elements/_radios.scss +24 -49
- package/src/styles/elements/_search.scss +19 -24
- package/src/styles/elements/_select.scss +4 -9
- package/src/styles/elements/_side-sheet.scss +0 -3
- package/src/styles/elements/_slider.scss +15 -35
- package/src/styles/elements/_snackbar.scss +0 -3
- package/src/styles/elements/_split-button.scss +33 -39
- package/src/styles/elements/_switch.scss +50 -90
- package/src/styles/elements/_tabs.scss +9 -13
- package/src/styles/elements/_text-field.scss +150 -178
- package/src/styles/elements/_timepicker.scss +0 -3
- package/src/styles/elements/_toolbar.scss +30 -35
- package/src/styles/elements/_tooltip.scss +0 -3
- package/src/styles/elements/_top-app-bar.scss +38 -45
- package/src/styles/main.scss +0 -15
- package/src/styles/themes/_autumn.scss +240 -258
- package/src/styles/themes/_base-theme.scss +96 -128
- package/src/styles/themes/_baseline.scss +273 -314
- package/src/styles/themes/_brownbeige.scss +242 -250
- package/src/styles/themes/_content.scss +240 -248
- package/src/styles/themes/_desert.scss +242 -250
- package/src/styles/themes/_expressive.scss +242 -250
- package/src/styles/themes/_fidelity.scss +240 -248
- package/src/styles/themes/_forest.scss +242 -259
- package/src/styles/themes/_fruit-salad.scss +242 -250
- package/src/styles/themes/_highcontrast.scss +164 -172
- package/src/styles/themes/_index.scss +0 -1
- package/src/styles/themes/_monochrome.scss +226 -234
- package/src/styles/themes/_neutral.scss +242 -250
- package/src/styles/themes/_ocean.scss +242 -259
- package/src/styles/themes/_rainbow.scss +242 -250
- package/src/styles/themes/_sageivory.scss +242 -250
- package/src/styles/themes/_spring.scss +238 -255
- package/src/styles/themes/_summer.scss +242 -250
- package/src/styles/themes/_sunset.scss +242 -259
- package/src/styles/themes/_tealcaramel.scss +242 -250
- package/src/styles/themes/_vibrant.scss +242 -250
- package/src/styles/utilities/_colors.scss +44 -50
- package/src/styles/utilities/_flexbox.scss +48 -59
- package/src/styles/utilities/_layout.scss +516 -591
- package/src/styles/utilities/_ripple.scss +61 -70
- package/src/styles/utilities/_spacing.scss +120 -127
- package/src/styles/utilities/_typography.scss +45 -58
- package/src/styles/utilities/_visibility.scss +61 -76
- package/dist/package.json +0 -488
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// src/components/switch/_switch.scss
|
|
2
1
|
@use '../../styles/abstract/base' as base;
|
|
3
2
|
@use '../../styles/abstract/variables' as v;
|
|
4
3
|
@use '../../styles/abstract/functions' as f;
|
|
@@ -9,352 +8,286 @@
|
|
|
9
8
|
$component: '#{base.$prefix}-switch';
|
|
10
9
|
|
|
11
10
|
.#{$component} {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
.#{$component}__input:hover ~ .#{$component}__track::after {
|
|
296
|
-
opacity: v.state('hover-state-layer-opacity');
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.#{$component}__input:focus-visible ~ .#{$component}__track::after {
|
|
300
|
-
opacity: v.state('focus-state-layer-opacity');
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.#{$component}__input:active ~ .#{$component}__track::after {
|
|
304
|
-
opacity: v.state('pressed-state-layer-opacity');
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Pressed handle: 28dp, centred where the handle sits.
|
|
308
|
-
.#{$component}__input:active ~ .#{$component}__track .#{$component}__thumb {
|
|
309
|
-
width: 28px;
|
|
310
|
-
height: 28px;
|
|
311
|
-
top: 0;
|
|
312
|
-
@include d.start-value-set(--#{$component}-thumb-start, 0);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
&.#{$component}--checked .#{$component}__input:active ~ .#{$component}__track .#{$component}__thumb {
|
|
316
|
-
@include d.start-value-set(--#{$component}-thumb-start, 20px);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// The mirrored handle and layer positions, one arm per subject: every
|
|
321
|
-
// state's move rides the custom property the arms form's base names, and a
|
|
322
|
-
// bundler lowers no custom property, so the move animates on whichever side
|
|
323
|
-
// the direction placed it — the transitions above already name both sides
|
|
324
|
-
// in the arms form. The arm resets the base side to auto, exactly as the
|
|
325
|
-
// logical property resolves one side per direction. Nothing of it in the
|
|
326
|
-
// logical form, where the insets mirror natively.
|
|
327
|
-
@include d.arms($self: true) {
|
|
328
|
-
.#{$component}__track::after {
|
|
329
|
-
left: auto;
|
|
330
|
-
right: var(--#{$component}-layer-start, -6px);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.#{$component}__thumb {
|
|
334
|
-
left: auto;
|
|
335
|
-
right: var(--#{$component}-thumb-start, 6px);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Accessibility
|
|
340
|
-
@include m.reduced-motion {
|
|
341
|
-
.#{$component}__track,
|
|
342
|
-
.#{$component}__thumb,
|
|
343
|
-
.#{$component}__thumb-icon {
|
|
344
|
-
transition: none;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
@include m.high-contrast {
|
|
349
|
-
.#{$component}__track {
|
|
350
|
-
border-width: 2px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
&--checked .#{$component}__track {
|
|
354
|
-
border-color: currentColor;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// Touch target for better mobile experience
|
|
359
|
-
// @include m.touch-target;
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
padding: 4px 0;
|
|
16
|
+
user-select: none;
|
|
17
|
+
|
|
18
|
+
&__container {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
min-height: 48px;
|
|
24
|
+
width: 100%;
|
|
25
|
+
column-gap: 12px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:where(:not(:has(.#{$component}__label, .#{$component}__helper))) {
|
|
29
|
+
.#{$component}__container {
|
|
30
|
+
column-gap: 0;
|
|
31
|
+
min-height: 40px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__content {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
flex-grow: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--label-end &__container {
|
|
42
|
+
flex-direction: row-reverse;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&__label {
|
|
46
|
+
@include m.typography('body-large');
|
|
47
|
+
color: t.color('on-surface');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__input {
|
|
51
|
+
font: inherit;
|
|
52
|
+
position: absolute;
|
|
53
|
+
opacity: 0;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
margin: 0;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
z-index: 1;
|
|
59
|
+
|
|
60
|
+
&:disabled {
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus-visible ~ .#{$component}__track {
|
|
65
|
+
outline: 3px solid t.color('secondary');
|
|
66
|
+
outline-offset: 2px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__track {
|
|
71
|
+
position: relative;
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
min-width: 52px;
|
|
74
|
+
height: 32px;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
border-radius: v.shape('full');
|
|
77
|
+
background-color: t.color('surface-container-highest');
|
|
78
|
+
border: 2px solid t.color('outline');
|
|
79
|
+
transition: m.spring(background-color, fast-effects), m.spring(border-color, fast-effects);
|
|
80
|
+
|
|
81
|
+
&::after {
|
|
82
|
+
content: '';
|
|
83
|
+
position: absolute;
|
|
84
|
+
width: 40px;
|
|
85
|
+
height: 40px;
|
|
86
|
+
top: -6px;
|
|
87
|
+
@include d.start-value(--#{$component}-layer-start, -6px);
|
|
88
|
+
background-color: t.color('on-surface');
|
|
89
|
+
opacity: 0;
|
|
90
|
+
border-radius: 50%;
|
|
91
|
+
z-index: 0;
|
|
92
|
+
transition: m.spring(opacity, fast-effects), m.spring(inset-inline-start, fast-spatial),
|
|
93
|
+
m.spring(inset, fast-spatial);
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__thumb {
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 6px;
|
|
101
|
+
@include d.start-value(--#{$component}-thumb-start, 6px);
|
|
102
|
+
width: 16px;
|
|
103
|
+
height: 16px;
|
|
104
|
+
border-radius: 50%;
|
|
105
|
+
background-color: t.color('outline');
|
|
106
|
+
transition: m.spring(inset-inline-start, fast-spatial), m.spring(inset, fast-spatial),
|
|
107
|
+
m.spring(width, fast-spatial), m.spring(height, fast-spatial), m.spring(background-color, fast-effects);
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
z-index: 1; /* Ensure thumb is above ripple */
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
|
|
114
|
+
&-icon {
|
|
115
|
+
position: absolute;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transform: scale(0);
|
|
121
|
+
transition: m.spring(opacity, fast-effects), m.spring(transform, fast-spatial);
|
|
122
|
+
color: t.color('on-primary-container');
|
|
123
|
+
|
|
124
|
+
svg {
|
|
125
|
+
width: 16px;
|
|
126
|
+
height: 16px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&--unselected {
|
|
130
|
+
color: t.color('surface-container-highest');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&__helper {
|
|
136
|
+
@include m.typography('body-medium');
|
|
137
|
+
color: t.color('on-surface-variant');
|
|
138
|
+
|
|
139
|
+
&--error {
|
|
140
|
+
color: t.color('error');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&--icons:not(&--checked) {
|
|
145
|
+
.#{$component}__thumb {
|
|
146
|
+
width: 24px;
|
|
147
|
+
height: 24px;
|
|
148
|
+
top: 2px;
|
|
149
|
+
@include d.start-value-set(--#{$component}-thumb-start, 2px);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.#{$component}__thumb-icon--unselected {
|
|
153
|
+
opacity: 1;
|
|
154
|
+
transform: scale(1);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&--checked {
|
|
159
|
+
.#{$component}__track {
|
|
160
|
+
background-color: t.color('primary');
|
|
161
|
+
border-color: t.color('primary');
|
|
162
|
+
|
|
163
|
+
&::after {
|
|
164
|
+
@include d.start-value-set(--#{$component}-layer-start, 14px);
|
|
165
|
+
background-color: t.color('primary');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.#{$component}__thumb {
|
|
170
|
+
background-color: t.color('on-primary');
|
|
171
|
+
width: 24px;
|
|
172
|
+
height: 24px;
|
|
173
|
+
top: 2px;
|
|
174
|
+
@include d.start-value-set(--#{$component}-thumb-start, 22px);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.#{$component}__thumb-icon:not(.#{$component}__thumb-icon--unselected) {
|
|
178
|
+
opacity: 1;
|
|
179
|
+
transform: scale(1);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&--dense {
|
|
184
|
+
.#{$component}__container {
|
|
185
|
+
min-height: initial;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&--error {
|
|
190
|
+
.#{$component}__track {
|
|
191
|
+
border-color: t.color('error');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&--disabled {
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
|
|
198
|
+
.#{$component}__track {
|
|
199
|
+
background-color: t.alpha('on-surface', 0.12);
|
|
200
|
+
border-color: t.alpha('on-surface', 0.12);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.#{$component}__thumb {
|
|
204
|
+
background-color: t.alpha('on-surface', 0.38);
|
|
205
|
+
|
|
206
|
+
&-icon--unselected {
|
|
207
|
+
color: t.alpha('surface-container-highest', 0.38);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.#{$component}__label, .#{$component}__helper {
|
|
212
|
+
color: t.alpha('on-surface', 0.38);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&.#{$component}--checked {
|
|
216
|
+
.#{$component}__track {
|
|
217
|
+
border-color: transparent;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.#{$component}__thumb {
|
|
221
|
+
background-color: t.color('surface');
|
|
222
|
+
|
|
223
|
+
&-icon {
|
|
224
|
+
color: t.alpha('on-surface', 0.38);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&:not(.#{$component}--disabled) {
|
|
231
|
+
.#{$component}__input:is(:hover, :focus-visible, :active) ~ .#{$component}__track .#{$component}__thumb {
|
|
232
|
+
background-color: t.color('on-surface-variant');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&.#{$component}--checked .#{$component}__input:is(:hover, :focus-visible, :active) ~ .#{$component}__track .#{$component}__thumb {
|
|
236
|
+
background-color: t.color('primary-container');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.#{$component}__input:hover ~ .#{$component}__track::after {
|
|
240
|
+
opacity: v.state('hover-state-layer-opacity');
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.#{$component}__input:focus-visible ~ .#{$component}__track::after {
|
|
244
|
+
opacity: v.state('focus-state-layer-opacity');
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.#{$component}__input:active ~ .#{$component}__track::after {
|
|
248
|
+
opacity: v.state('pressed-state-layer-opacity');
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.#{$component}__input:active ~ .#{$component}__track .#{$component}__thumb {
|
|
252
|
+
width: 28px;
|
|
253
|
+
height: 28px;
|
|
254
|
+
top: 0;
|
|
255
|
+
@include d.start-value-set(--#{$component}-thumb-start, 0);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&.#{$component}--checked .#{$component}__input:active ~ .#{$component}__track .#{$component}__thumb {
|
|
259
|
+
@include d.start-value-set(--#{$component}-thumb-start, 20px);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@include d.arms($self: true) {
|
|
264
|
+
.#{$component}__track::after {
|
|
265
|
+
left: auto;
|
|
266
|
+
right: var(--#{$component}-layer-start, -6px);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.#{$component}__thumb {
|
|
270
|
+
left: auto;
|
|
271
|
+
right: var(--#{$component}-thumb-start, 6px);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@include m.reduced-motion {
|
|
276
|
+
.#{$component}__track,
|
|
277
|
+
.#{$component}__thumb,
|
|
278
|
+
.#{$component}__thumb-icon {
|
|
279
|
+
transition: none;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@include m.high-contrast {
|
|
284
|
+
.#{$component}__track {
|
|
285
|
+
border-width: 2px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&--checked .#{$component}__track {
|
|
289
|
+
border-color: currentColor;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
360
293
|
}
|