@kaizen/components 1.70.16 → 1.70.17
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/dist/cjs/ToggleSwitch/ToggleSwitch/ToggleSwitch.cjs +6 -4
- package/dist/cjs/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.cjs +1 -0
- package/dist/esm/ToggleSwitch/ToggleSwitch/ToggleSwitch.mjs +6 -4
- package/dist/esm/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss.mjs +1 -0
- package/dist/styles.css +8487 -8487
- package/dist/types/ToggleSwitch/ToggleSwitch/ToggleSwitch.d.ts +1 -1
- package/package.json +3 -3
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.module.scss +7 -5
- package/src/ToggleSwitch/ToggleSwitch/ToggleSwitch.tsx +4 -2
|
@@ -10,6 +10,6 @@ export type ToggleSwitchProps = {
|
|
|
10
10
|
reversed?: boolean;
|
|
11
11
|
} & OverrideClassName<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'onToggle'>>;
|
|
12
12
|
export declare const ToggleSwitch: {
|
|
13
|
-
({ toggledStatus, onToggle, reversed, ...restProps }: ToggleSwitchProps): JSX.Element;
|
|
13
|
+
({ toggledStatus, onToggle, reversed, disabled, ...restProps }: ToggleSwitchProps): JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.70.
|
|
3
|
+
"version": "1.70.17",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
"svgo": "^3.3.2",
|
|
175
175
|
"tslib": "^2.8.1",
|
|
176
176
|
"tsx": "^4.19.2",
|
|
177
|
-
"@kaizen/
|
|
178
|
-
"@kaizen/
|
|
177
|
+
"@kaizen/package-bundler": "2.0.4",
|
|
178
|
+
"@kaizen/design-tokens": "10.8.7"
|
|
179
179
|
},
|
|
180
180
|
"devDependenciesComments": {
|
|
181
181
|
"sass": "Prevent deprecation warnings introduced in 1.80 as we plan to move away from sass",
|
|
@@ -27,19 +27,20 @@ $focus-ring-offset: 1px;
|
|
|
27
27
|
|
|
28
28
|
/* TODO: Fix */
|
|
29
29
|
/* stylelint-disable no-descending-specificity */
|
|
30
|
-
.checkbox:focus + &,
|
|
31
|
-
.checkbox:hover:focus + & {
|
|
30
|
+
.checkbox:not(.disabled):focus + &,
|
|
31
|
+
.checkbox:not(.disabled):hover:focus + & {
|
|
32
32
|
border-color: transparent;
|
|
33
33
|
outline: 2px solid $color-blue-500;
|
|
34
34
|
outline-offset: $focus-ring-offset;
|
|
35
35
|
background-color: $color-gray-600;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.checkbox + &:hover,
|
|
38
|
+
.checkbox:not(.disabled) + &:hover,
|
|
39
39
|
label:hover .checkbox + & {
|
|
40
40
|
background-color: $color-purple-500;
|
|
41
41
|
background-color: $color-gray-600;
|
|
42
42
|
}
|
|
43
|
+
|
|
43
44
|
/* stylelint-enable no-descending-specificity */
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -86,7 +87,7 @@ $focus-ring-offset: 1px;
|
|
|
86
87
|
transition-duration: $animation-duration-fast;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
.checkbox + .track:hover,
|
|
90
|
+
.checkbox:not(.disabled) + .track:hover,
|
|
90
91
|
label:hover & .checkbox + .track {
|
|
91
92
|
background-color: $color-green-600;
|
|
92
93
|
}
|
|
@@ -116,10 +117,11 @@ $focus-ring-offset: 1px;
|
|
|
116
117
|
background-color: rgba($color-white-rgb, 0.65);
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
.checkbox + .track:hover,
|
|
120
|
+
.checkbox:not(.disabled) + .track:hover,
|
|
120
121
|
label:hover & .checkbox + .track {
|
|
121
122
|
background-color: rgba($color-white-rgb, 0.65);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
}
|
|
126
|
+
|
|
125
127
|
/* stylelint-enable no-descending-specificity */
|
|
@@ -19,6 +19,7 @@ export const ToggleSwitch = ({
|
|
|
19
19
|
toggledStatus,
|
|
20
20
|
onToggle,
|
|
21
21
|
reversed,
|
|
22
|
+
disabled,
|
|
22
23
|
...restProps
|
|
23
24
|
}: ToggleSwitchProps): JSX.Element => {
|
|
24
25
|
const isOn = toggledStatus === 'on'
|
|
@@ -27,12 +28,13 @@ export const ToggleSwitch = ({
|
|
|
27
28
|
<span className={classnames(isOn ? styles.on : styles.off, reversed && styles.reversed)}>
|
|
28
29
|
<input
|
|
29
30
|
type="checkbox"
|
|
30
|
-
className={styles.checkbox}
|
|
31
|
+
className={classnames(styles.checkbox, disabled && styles.disabled)}
|
|
31
32
|
checked={isOn ? true : false}
|
|
32
33
|
onChange={onToggle}
|
|
34
|
+
disabled={disabled}
|
|
33
35
|
{...restProps}
|
|
34
36
|
/>
|
|
35
|
-
<span className={styles.track}>
|
|
37
|
+
<span className={classnames(styles.track, disabled && styles.disabled)}>
|
|
36
38
|
<span className={styles.thumb}>
|
|
37
39
|
<Icon name="check" isPresentational className={styles.checkIcon} />
|
|
38
40
|
</span>
|