@hh.ru/magritte-ui-switch 3.0.31 → 3.0.33
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.
|
@@ -2,11 +2,11 @@ import './index.css';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Skeleton } from '@hh.ru/magritte-ui-skeleton';
|
|
4
4
|
|
|
5
|
-
var styles = {"switch":"magritte-switch___0AZYC_3-0-
|
|
5
|
+
var styles = {"switch":"magritte-switch___0AZYC_3-0-33","slider":"magritte-slider___YN62u_3-0-33","checked":"magritte-checked___QEAn5_3-0-33","switch-skeleton":"magritte-switch-skeleton___g1MEY_3-0-33","switchSkeleton":"magritte-switch-skeleton___g1MEY_3-0-33"};
|
|
6
6
|
|
|
7
7
|
const SwitchSkeleton = ({ Component: Switch,
|
|
8
8
|
// skeleton props
|
|
9
9
|
width, height, borderRadius, inline, additionalClass, loading, ...switchProps }) => (jsx(Skeleton, { loading: loading, additionalClass: styles.switchSkeleton, inline: true, children: jsx(Switch, { ...switchProps }) }));
|
|
10
10
|
|
|
11
11
|
export { SwitchSkeleton as S, styles as s };
|
|
12
|
-
//# sourceMappingURL=Skeleton-
|
|
12
|
+
//# sourceMappingURL=Skeleton-CFUSylpW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton-
|
|
1
|
+
{"version":3,"file":"Skeleton-CFUSylpW.js","sources":["../src/Skeleton.tsx"],"sourcesContent":["import { IncompleteSkeletonComponent, Skeleton } from '@hh.ru/magritte-ui-skeleton';\nimport { SwitchProps } from '@hh.ru/magritte-ui-switch/types';\n\nimport styles from './switch.less';\n\nexport const SwitchSkeleton: IncompleteSkeletonComponent<SwitchProps> = ({\n Component: Switch,\n\n // skeleton props\n width,\n height,\n borderRadius,\n inline,\n additionalClass,\n loading,\n\n ...switchProps\n}) => (\n <Skeleton loading={loading} additionalClass={styles.switchSkeleton} inline>\n <Switch {...switchProps} />\n </Skeleton>\n);\n"],"names":["_jsx"],"mappings":";;;;;MAKa,cAAc,GAA6C,CAAC,EACrE,SAAS,EAAE,MAAM;AAEjB;AACA,KAAK,EACL,MAAM,EACN,YAAY,EACZ,MAAM,EACN,eAAe,EACf,OAAO,EAEP,GAAG,WAAW,EACjB,MACGA,GAAC,CAAA,QAAQ,EAAC,EAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,EAAA,IAAA,EAAA,QAAA,EACtEA,IAAC,MAAM,EAAA,EAAA,GAAK,WAAW,EAAI,CAAA,EAAA,CACpB;;;;"}
|
package/Skeleton.js
CHANGED
package/Switch.js
CHANGED
|
@@ -4,7 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
|
|
5
5
|
import { LockClosedFilledSize16 } from '@hh.ru/magritte-ui-icon/icon';
|
|
6
6
|
import { enrichWithSkeleton } from '@hh.ru/magritte-ui-skeleton';
|
|
7
|
-
import { S as SwitchSkeleton, s as styles } from './Skeleton-
|
|
7
|
+
import { S as SwitchSkeleton, s as styles } from './Skeleton-CFUSylpW.js';
|
|
8
8
|
|
|
9
9
|
const SwitchComponent = ({ onClick, 'aria-label': ariaLabel, disabled = false, checked = false, ...props }) => {
|
|
10
10
|
const forceDisabled = useDisabled();
|
package/index.css
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
--magritte-color-component-switch-background-state-container-unchecked-disabled-v24-3-0:#3030307a;
|
|
34
34
|
--magritte-shadow-level-1-color-v24-3-0:#00000029;
|
|
35
35
|
}
|
|
36
|
-
.magritte-switch___0AZYC_3-0-
|
|
36
|
+
.magritte-switch___0AZYC_3-0-33{
|
|
37
37
|
width:52px;
|
|
38
38
|
height:32px;
|
|
39
39
|
background-color:var(--magritte-color-component-switch-background-container-unchecked-v24-3-0);
|
|
@@ -41,36 +41,36 @@
|
|
|
41
41
|
cursor:pointer;
|
|
42
42
|
position:relative;
|
|
43
43
|
}
|
|
44
|
-
.magritte-switch___0AZYC_3-0-
|
|
44
|
+
.magritte-switch___0AZYC_3-0-33:active:not(:disabled){
|
|
45
45
|
background-color:var(--magritte-color-component-switch-background-state-container-unchecked-pressed-v24-3-0);
|
|
46
46
|
}
|
|
47
|
-
.magritte-switch___0AZYC_3-0-
|
|
47
|
+
.magritte-switch___0AZYC_3-0-33:active:not(:disabled) .magritte-slider___YN62u_3-0-33{
|
|
48
48
|
border-radius:14px;
|
|
49
49
|
background-color:var(--magritte-color-component-switch-background-state-toggle-unchecked-pressed-v24-3-0);
|
|
50
50
|
width:32px;
|
|
51
51
|
}
|
|
52
|
-
.magritte-switch___0AZYC_3-0-
|
|
52
|
+
.magritte-switch___0AZYC_3-0-33:disabled{
|
|
53
53
|
cursor:not-allowed;
|
|
54
54
|
background-color:var(--magritte-color-component-switch-background-state-container-unchecked-disabled-v24-3-0);
|
|
55
55
|
border-radius:20px;
|
|
56
56
|
}
|
|
57
|
-
.magritte-switch___0AZYC_3-0-
|
|
57
|
+
.magritte-switch___0AZYC_3-0-33:disabled.magritte-checked___QEAn5_3-0-33{
|
|
58
58
|
background-color:var(--magritte-color-component-switch-background-state-container-checked-disabled-v24-3-0);
|
|
59
59
|
}
|
|
60
|
-
.magritte-switch___0AZYC_3-0-
|
|
60
|
+
.magritte-switch___0AZYC_3-0-33.focus-visible{
|
|
61
61
|
outline:var(--magritte-color-component-switch-stroke-state-focused-accessible-v24-3-0) solid 4px;
|
|
62
62
|
}
|
|
63
63
|
@media (min-width: 1020px){
|
|
64
|
-
body.magritte-old-layout .magritte-switch___0AZYC_3-0-
|
|
64
|
+
body.magritte-old-layout .magritte-switch___0AZYC_3-0-33:hover:not(:disabled):not(:active){
|
|
65
65
|
background-color:var(--magritte-color-component-switch-background-state-container-unchecked-hovered-v24-3-0);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
@media (min-width: 1024px){
|
|
69
|
-
body:not(.magritte-old-layout) .magritte-switch___0AZYC_3-0-
|
|
69
|
+
body:not(.magritte-old-layout) .magritte-switch___0AZYC_3-0-33:hover:not(:disabled):not(:active){
|
|
70
70
|
background-color:var(--magritte-color-component-switch-background-state-container-unchecked-hovered-v24-3-0);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
.magritte-slider___YN62u_3-0-
|
|
73
|
+
.magritte-slider___YN62u_3-0-33{
|
|
74
74
|
width:24px;
|
|
75
75
|
height:24px;
|
|
76
76
|
background-color:var(--magritte-color-component-switch-background-toggle-unchecked-v24-3-0);
|
|
@@ -88,33 +88,33 @@
|
|
|
88
88
|
--magritte-ui-icon-color-override:var(--magritte-color-component-switch-icon-state-toggle-unchecked-disabled-v24-3-0);
|
|
89
89
|
box-shadow:var(--magritte-shadow-level-1-x-v24-3-0) var(--magritte-shadow-level-1-y-v24-3-0) var(--magritte-shadow-level-1-blur-v24-3-0) var(--magritte-shadow-level-1-spread-v24-3-0) var(--magritte-shadow-level-1-color-v24-3-0);
|
|
90
90
|
}
|
|
91
|
-
.magritte-checked___QEAn5_3-0-
|
|
91
|
+
.magritte-checked___QEAn5_3-0-33{
|
|
92
92
|
background-color:var(--magritte-color-component-switch-background-container-checked-v24-3-0);
|
|
93
93
|
}
|
|
94
|
-
.magritte-checked___QEAn5_3-0-
|
|
94
|
+
.magritte-checked___QEAn5_3-0-33 .magritte-slider___YN62u_3-0-33{
|
|
95
95
|
background-color:var(--magritte-color-component-switch-background-toggle-checked-v24-3-0);
|
|
96
96
|
left:calc(52px - (24px + 4px*2));
|
|
97
97
|
--magritte-ui-icon-color-override:var(--magritte-color-component-switch-icon-state-toggle-checked-disabled-v24-3-0);
|
|
98
98
|
}
|
|
99
|
-
.magritte-checked___QEAn5_3-0-
|
|
99
|
+
.magritte-checked___QEAn5_3-0-33:active:not(:disabled){
|
|
100
100
|
background-color:var(--magritte-color-component-switch-background-state-container-checked-pressed-v24-3-0);
|
|
101
101
|
}
|
|
102
|
-
.magritte-checked___QEAn5_3-0-
|
|
102
|
+
.magritte-checked___QEAn5_3-0-33:active:not(:disabled) .magritte-slider___YN62u_3-0-33{
|
|
103
103
|
background-color:var(--magritte-color-component-switch-background-state-toggle-checked-pressed-v24-3-0);
|
|
104
104
|
width:32px;
|
|
105
105
|
left:calc(52px - (32px + 4px*2));
|
|
106
106
|
}
|
|
107
107
|
@media (min-width: 1020px){
|
|
108
|
-
body.magritte-old-layout .magritte-checked___QEAn5_3-0-
|
|
108
|
+
body.magritte-old-layout .magritte-checked___QEAn5_3-0-33:hover:not(:disabled):not(:active){
|
|
109
109
|
background-color:var(--magritte-color-component-switch-background-state-container-checked-hovered-v24-3-0);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
@media (min-width: 1024px){
|
|
113
|
-
body:not(.magritte-old-layout) .magritte-checked___QEAn5_3-0-
|
|
113
|
+
body:not(.magritte-old-layout) .magritte-checked___QEAn5_3-0-33:hover:not(:disabled):not(:active){
|
|
114
114
|
background-color:var(--magritte-color-component-switch-background-state-container-checked-hovered-v24-3-0);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
.magritte-switch-skeleton___g1MEY_3-0-
|
|
117
|
+
.magritte-switch-skeleton___g1MEY_3-0-33{
|
|
118
118
|
width:52px;
|
|
119
119
|
height:32px;
|
|
120
120
|
border-radius:16px;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-switch",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.33",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@hh.ru/magritte-common-use-disabled": "1.0.14",
|
|
23
23
|
"@hh.ru/magritte-design-tokens": "24.3.0",
|
|
24
|
-
"@hh.ru/magritte-ui-breakpoint": "6.0.
|
|
25
|
-
"@hh.ru/magritte-ui-icon": "13.7.
|
|
24
|
+
"@hh.ru/magritte-ui-breakpoint": "6.0.5",
|
|
25
|
+
"@hh.ru/magritte-ui-icon": "13.7.5",
|
|
26
26
|
"@hh.ru/magritte-ui-skeleton": "3.0.15"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "5b5fe13d8bd8ac942de2e1fa6e1fa9627272cfe4"
|
|
36
36
|
}
|