matcha-theme 19.73.0 → 19.75.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.
@@ -0,0 +1,428 @@
1
+ @mixin matcha-slide-toggle-theme($theme) {
2
+ matcha-slide-toggle {
3
+ input[type="checkbox"] {
4
+ &::before {
5
+ background-color: getSurface($theme);
6
+ border-color:getPrimary($theme);
7
+ }
8
+ &::after {
9
+ box-shadow: getDisabled($theme);
10
+ background-color: getPrimary($theme);
11
+ }
12
+ }
13
+ &:not([color]),
14
+ &[color="accent"] {
15
+ input[type="checkbox"] {
16
+ &:checked {
17
+ &::before {
18
+ background-color: getAccent($theme);
19
+ border-color:getAccent($theme);
20
+ }
21
+ &::after {
22
+ background-color: getAccentContrast($theme);
23
+ }
24
+ }
25
+ }
26
+ }
27
+
28
+ //red
29
+ &[color="red"] {
30
+ input[type="checkbox"] {
31
+ &:checked {
32
+ &::before {
33
+ background-color: getRed($theme);
34
+ border-color:getRed($theme);
35
+ }
36
+ &::after {
37
+ background-color: getRedContrast($theme);
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ //pink
44
+ &[color="pink"] {
45
+ input[type="checkbox"] {
46
+ &:checked {
47
+ &::before {
48
+ background-color: getPink($theme);
49
+ border-color:getPink($theme);
50
+ }
51
+ &::after {
52
+ background-color: getPinkContrast($theme);
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ //purple
59
+ &[color="purple"] {
60
+ input[type="checkbox"] {
61
+ &:checked {
62
+ &::before {
63
+ background-color: getPurple($theme);
64
+ border-color:getPurple($theme);
65
+ }
66
+ &::after {
67
+ background-color: getPurpleContrast($theme);
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ //deep-purple
74
+ &[color="deep-purple"] {
75
+ input[type="checkbox"] {
76
+ &:checked {
77
+ &::before {
78
+ background-color: getDeepPurple($theme);
79
+ border-color:getDeepPurple($theme);
80
+ }
81
+ &::after {
82
+ background-color: getDeepPurpleContrast($theme);
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ //indigo
89
+ &[color="indigo"] {
90
+ input[type="checkbox"] {
91
+ &:checked {
92
+ &::before {
93
+ background-color: getIndigo($theme);
94
+ border-color:getIndigo($theme);
95
+ }
96
+ &::after {
97
+ background-color: getIndigoContrast($theme);
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ //blue
104
+ &[color="blue"] {
105
+ input[type="checkbox"] {
106
+ &:checked {
107
+ &::before {
108
+ background-color: getBlue($theme);
109
+ border-color:getBlue($theme);
110
+ }
111
+ &::after {
112
+ background-color: getBlueContrast($theme);
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ //light-blue
119
+ &[color="light-blue"] {
120
+ input[type="checkbox"] {
121
+ &:checked {
122
+ &::before {
123
+ background-color: getLightBlue($theme);
124
+ border-color:getLightBlue($theme);
125
+ }
126
+ &::after {
127
+ background-color: getLightBlueContrast($theme);
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ //cyan
134
+ &[color="cyan"] {
135
+ input[type="checkbox"] {
136
+ &:checked {
137
+ &::before {
138
+ background-color: getCyan($theme);
139
+ border-color:getCyan($theme);
140
+ }
141
+ &::after {
142
+ background-color: getCyanContrast($theme);
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ //teal
149
+ &[color="teal"] {
150
+ input[type="checkbox"] {
151
+ &:checked {
152
+ &::before {
153
+ background-color: getTeal($theme);
154
+ border-color:getTeal($theme);
155
+ }
156
+ &::after {
157
+ background-color: getTealContrast($theme);
158
+ }
159
+ }
160
+ }
161
+ }
162
+
163
+ //green
164
+ &[color="green"] {
165
+ input[type="checkbox"] {
166
+ &:checked {
167
+ &::before {
168
+ background-color: getGreen($theme);
169
+ border-color:getGreen($theme);
170
+ }
171
+ &::after {
172
+ background-color: getGreenContrast($theme);
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ //light-green
179
+ &[color="light-green"] {
180
+ input[type="checkbox"] {
181
+ &:checked {
182
+ &::before {
183
+ background-color: getLightGreen($theme);
184
+ border-color:getLightGreen($theme);
185
+ }
186
+ &::after {
187
+ background-color: getLightGreenContrast($theme);
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ //lime
194
+ &[color="lime"] {
195
+ input[type="checkbox"] {
196
+ &:checked {
197
+ &::before {
198
+ background-color: getLime($theme);
199
+ border-color:getLime($theme);
200
+ }
201
+ &::after {
202
+ background-color: getLimeContrast($theme);
203
+ }
204
+ }
205
+ }
206
+ }
207
+
208
+ //yellow
209
+ &[color="yellow"] {
210
+ input[type="checkbox"] {
211
+ &:checked {
212
+ &::before {
213
+ background-color: getYellow($theme);
214
+ border-color:getYellow($theme);
215
+ }
216
+ &::after {
217
+ background-color: getYellowContrast($theme);
218
+ }
219
+ }
220
+ }
221
+ }
222
+
223
+ //amber
224
+ &[color="amber"] {
225
+ input[type="checkbox"] {
226
+ &:checked {
227
+ &::before {
228
+ background-color: getAmber($theme);
229
+ border-color:getAmber($theme);
230
+ }
231
+ &::after {
232
+ background-color: getAmberContrast($theme);
233
+ }
234
+ }
235
+ }
236
+ }
237
+
238
+ //orange
239
+ &[color="orange"] {
240
+ input[type="checkbox"] {
241
+ &:checked {
242
+ &::before {
243
+ background-color: getOrange($theme);
244
+ border-color:getOrange($theme);
245
+ }
246
+ &::after {
247
+ background-color: getOrangeContrast($theme);
248
+ }
249
+ }
250
+ }
251
+ }
252
+
253
+ //deep-orange
254
+ &[color="deep-orange"] {
255
+ input[type="checkbox"] {
256
+ &:checked {
257
+ &::before {
258
+ background-color: getDeepOrange($theme);
259
+ border-color:getDeepOrange($theme);
260
+ }
261
+ &::after {
262
+ background-color: getDeepOrangeContrast($theme);
263
+ }
264
+ }
265
+ }
266
+ }
267
+
268
+ //brown
269
+ &[color="brown"] {
270
+ input[type="checkbox"] {
271
+ &:checked {
272
+ &::before {
273
+ background-color: getBrown($theme);
274
+ border-color:getBrown($theme);
275
+ }
276
+ &::after {
277
+ background-color: getBrownContrast($theme);
278
+ }
279
+ }
280
+ }
281
+ }
282
+
283
+ //grey
284
+ &[color="grey"] {
285
+ input[type="checkbox"] {
286
+ &:checked {
287
+ &::before {
288
+ background-color: getGrey($theme);
289
+ border-color:getGrey($theme);
290
+ }
291
+ &::after {
292
+ background-color: getGreyContrast($theme);
293
+ }
294
+ }
295
+ }
296
+ }
297
+
298
+ //blue-grey
299
+ &[color="blue-grey"] {
300
+ input[type="checkbox"] {
301
+ &:checked {
302
+ &::before {
303
+ background-color: getBlueGrey($theme);
304
+ border-color:getBlueGrey($theme);
305
+ }
306
+ &::after {
307
+ background-color: getBlueGreyContrast($theme);
308
+ }
309
+ }
310
+ }
311
+ }
312
+
313
+ //primary
314
+ &[color="primary"] {
315
+ input[type="checkbox"] {
316
+ &:checked {
317
+ &::before {
318
+ background-color: getPrimary($theme);
319
+ border-color:getPrimary($theme);
320
+ }
321
+ &::after {
322
+ background-color: getPrimaryContrast($theme);
323
+ }
324
+ }
325
+ }
326
+ }
327
+
328
+ //warn
329
+ &[color="warn"] {
330
+ input[type="checkbox"] {
331
+ &:checked {
332
+ &::before {
333
+ background-color: getWarn($theme);
334
+ border-color:getWarn($theme);
335
+ }
336
+ &::after {
337
+ background-color: getWarnContrast($theme);
338
+ }
339
+ }
340
+ }
341
+ }
342
+
343
+ .matcha-slide-toggle-label {
344
+ color: getGrey($theme);
345
+ }
346
+ }
347
+
348
+ matcha-slide-toggle {
349
+ label {
350
+ display: inline-flex;
351
+ align-items: center;
352
+ cursor: pointer;
353
+ outline: none;
354
+ -webkit-tap-highlight-color: transparent;
355
+ vertical-align: middle;
356
+ position: relative;
357
+
358
+ .matcha-slide-toggle-label {
359
+ font-size: 14px;
360
+ user-select: none;
361
+ }
362
+ &.matcha-slide-toggle-disabled {
363
+ cursor: not-allowed;
364
+ opacity: 0.5;
365
+
366
+ input[type="checkbox"] {
367
+ cursor: not-allowed;
368
+ }
369
+ }
370
+ }
371
+
372
+ input[type="checkbox"] {
373
+ appearance: none;
374
+ -webkit-appearance: none;
375
+ position: relative;
376
+ display: inline-block;
377
+ width: 36px;
378
+ height: 20px;
379
+ margin: 0;
380
+ outline: none;
381
+ cursor: pointer;
382
+ vertical-align: middle;
383
+
384
+ &::before {
385
+ content: "";
386
+ position: absolute;
387
+ top: 50%;
388
+ left: 0;
389
+ transform: translateY(-50%);
390
+ width: 100%;
391
+ height: 20px;
392
+ border-width:2px;
393
+ border-style: solid;
394
+ border-radius: 12px;
395
+ box-sizing: border-box;
396
+ transition: background-color 0.15s linear;
397
+ }
398
+
399
+ &::after {
400
+ content: "";
401
+ position: absolute;
402
+ top: 4px;
403
+ left: 3px;
404
+ width: 12px;
405
+ height: 12px;
406
+ border-radius: 50%;
407
+ transition:
408
+ transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
409
+ background-color 0.15s linear,
410
+ outline 0.1s ease-out;
411
+ }
412
+
413
+ &:checked {
414
+ &::after {
415
+ top: 2px;
416
+ left: 1px;
417
+ width: 16px;
418
+ height: 16px;
419
+ transform: translateX(17px);
420
+ }
421
+ }
422
+
423
+ &:focus-visible::after {
424
+ outline-offset: 2px;
425
+ }
426
+ }
427
+ }
428
+ }
package/main.scss CHANGED
@@ -41,6 +41,8 @@
41
41
  @import "./components/matcha-ripple.scss"; // matcha-ripple-theme($theme)
42
42
  @import "./components/matcha-spin.scss"; // matcha-spin-theme($theme)
43
43
  @import "./components/matcha-hint-text.scss"; // matcha-hint-theme($theme)
44
+ @import "./components/matcha-slide-toggle.scss"; // matcha-slide-toggle($theme)
45
+
44
46
  @import "./components/matcha-tabs.scss"; // matcha-tabs($theme)
45
47
  @import "./components/matcha-modal.scss"; // matcha-modal($theme)
46
48
  // VENDORS
@@ -143,6 +145,7 @@
143
145
  @include matcha-checkbox($theme);
144
146
  @include matcha-spin($theme);
145
147
  @include matcha-hint-text($theme);
148
+ @include matcha-slide-toggle-theme($theme);
146
149
  @include matcha-tabs($theme);
147
150
  @include matcha-modal-theme($theme);
148
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matcha-theme",
3
- "version": "19.73.0",
3
+ "version": "19.75.0",
4
4
  "description": "Themes for matcha-design-system",
5
5
  "main": "main.scss",
6
6
  "scripts": {