cynx-ui 1.2.4 → 1.2.5
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/components/Toggle.jsx +4 -4
- package/package.json +1 -1
package/components/Toggle.jsx
CHANGED
|
@@ -5,13 +5,13 @@ const STYLES = `
|
|
|
5
5
|
.tgl-th{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:left .25s cubic-bezier(.34,1.56,.64,1)}
|
|
6
6
|
.tgl-sm .tgl-tr{width:28px;height:16px}
|
|
7
7
|
.tgl-sm .tgl-th{width:12px;height:12px;left:2px}
|
|
8
|
-
.tgl-sm
|
|
8
|
+
.tgl-sm.on .tgl-th{left:14px}
|
|
9
9
|
.tgl-md .tgl-tr{width:34px;height:18px}
|
|
10
10
|
.tgl-md .tgl-th{width:14px;height:14px;left:2px}
|
|
11
|
-
.tgl-md
|
|
11
|
+
.tgl-md.on .tgl-th{left:18px}
|
|
12
12
|
.tgl-lg .tgl-tr{width:44px;height:24px}
|
|
13
13
|
.tgl-lg .tgl-th{width:18px;height:18px;left:3px}
|
|
14
|
-
.tgl-lg
|
|
14
|
+
.tgl-lg.on .tgl-th{left:23px}
|
|
15
15
|
.tgl:disabled{opacity:.4;cursor:not-allowed;pointer-events:none}
|
|
16
16
|
`;
|
|
17
17
|
|
|
@@ -44,7 +44,7 @@ export default function Toggle({
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const sizeClass = ` tgl-${size}`;
|
|
47
|
-
const classes = `tgl${sizeClass}${className ? ' ' + className : ''}`;
|
|
47
|
+
const classes = `tgl${sizeClass}${checked ? ' on' : ''}${className ? ' ' + className : ''}`;
|
|
48
48
|
const trackColor = checked ? (COLORS[color] || COLORS.primary) : 'var(--bd2,#d7d8e0)';
|
|
49
49
|
|
|
50
50
|
return (
|