@workday/canvas-kit-css 11.0.0-alpha.696-next.0 → 11.0.0-alpha.697-next.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/package.json +2 -2
- package/switch.css +86 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-css",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.697-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit CSS components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"components",
|
|
26
26
|
"workday"
|
|
27
27
|
],
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "eb7a03f18423b4ffaef4a4df21d3e5256e728563"
|
|
29
29
|
}
|
package/switch.css
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
.cnvs-switch-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: var(--cnvs-sys-space-x6, calc(0.25rem * 6));
|
|
4
|
+
width: var(--cnvs-sys-space-x8, calc(0.25rem * 8));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
.cnvs-switch-input {
|
|
9
|
+
display: flex;
|
|
10
|
+
position: absolute;
|
|
11
|
+
height: var(--cnvs-sys-space-x6, calc(0.25rem * 6));
|
|
12
|
+
width: var(--cnvs-sys-space-x8, calc(0.25rem * 8));
|
|
13
|
+
margin: var(--cnvs-sys-space-zero, 0);
|
|
14
|
+
margin-left: var(--cnvs-sys-space-x1, 0.25rem);
|
|
15
|
+
border-radius: var(--cnvs-sys-shape-round, calc(0.25rem * 250));
|
|
16
|
+
opacity: 0;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cnvs-switch-input:checked~div:first-of-type, .cnvs-switch-input.checked~div:first-of-type {
|
|
21
|
+
background-color: var(--cnvs-brand-primary-base, rgba(8,117,225,1));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cnvs-switch-input:checked:disabled~div:first-of-type, .cnvs-switch-input.checked:disabled~div:first-of-type, .cnvs-switch-input:checked.disabled~div:first-of-type, .cnvs-switch-input.checked.disabled~div:first-of-type {
|
|
25
|
+
background-color: var(--cnvs-brand-primary-light, rgba(166,210,255,1));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cnvs-switch-input:disabled, .cnvs-switch-input.disabled {
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.cnvs-switch-input:disabled~div:first-of-type, .cnvs-switch-input.disabled~div:first-of-type {
|
|
33
|
+
background-color: var(--cnvs-base-palette-soap-400, rgba(223,226,230,1));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cnvs-switch-input:focus-visible, .cnvs-switch-input:focus, .cnvs-switch-input.focus {
|
|
37
|
+
outline: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.cnvs-switch-input:focus-visible~div:first-of-type, .cnvs-switch-input:focus~div:first-of-type, .cnvs-switch-input.focus~div:first-of-type {
|
|
41
|
+
box-shadow: 0 0 0 2px var(--cnvs-base-palette-french-vanilla-100),0 0 0 4px var(--cnvs-brand-common-focus-outline);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
.cnvs-switch-input--error-error~div:first-of-type {
|
|
46
|
+
box-shadow: 0 0 0 0.125rem var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1)),0 0 0 var(--cnvs-sys-space-x1, 0.25rem) var(--cnvs-brand-error-base, rgba(222,46,33,1)),0 0 0 0.3125rem transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
.cnvs-switch-input--error-alert~div:first-of-type {
|
|
51
|
+
box-shadow: 0 0 0 0.125rem var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1)),0 0 0 var(--cnvs-sys-space-x1, 0.25rem) var(--cnvs-brand-alert-base, rgba(255,161,38,1)),0 0 0 0.3125rem var(--cnvs-brand-alert-darkest, rgba(192,108,0,1));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
.cnvs-switch-background {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
position: absolute;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
margin-top: var(--cnvs-sys-space-x1, 0.25rem);
|
|
62
|
+
width: var(--cnvs-sys-space-x8, calc(0.25rem * 8));
|
|
63
|
+
height: var(--cnvs-sys-space-x4, calc(0.25rem * 4));
|
|
64
|
+
border-radius: var(--cnvs-sys-shape-round, calc(0.25rem * 250));
|
|
65
|
+
padding: var(--cnvs-sys-space-zero, 0) 0.125rem;
|
|
66
|
+
transition: background-color 200ms ease;
|
|
67
|
+
background-color: var(--cnvs-base-palette-licorice-200, rgba(123,133,143,1));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
.cnvs-switch-circle {
|
|
72
|
+
width: var(--cnvs-sys-space-x3, calc(0.25rem * 3));
|
|
73
|
+
height: var(--cnvs-sys-space-x3, calc(0.25rem * 3));
|
|
74
|
+
border-radius: var(--cnvs-sys-shape-round, calc(0.25rem * 250));
|
|
75
|
+
box-shadow: var(--cnvs-sys-depth-1, 0 0.0625rem 0.25rem 0 rgba(31,38,46,0.12),0 0.125rem 0.5rem 0 rgba(31,38,46,0.08));
|
|
76
|
+
transition: transform 150ms ease;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
background-color: var(--cnvs-brand-primary-accent, rgba(255,255,255,1));
|
|
79
|
+
transform: translateX(var(--cnvs-sys-space-zero, 0));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
.cnvs-switch-circle--checked {
|
|
84
|
+
transform: translateX(var(--cnvs-sys-space-x4, calc(0.25rem * 4)));
|
|
85
|
+
}
|
|
86
|
+
|