@hh.ru/magritte-ui-switch 3.1.12 → 3.1.13

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-1-12","slider":"magritte-slider___YN62u_3-1-12","checked":"magritte-checked___QEAn5_3-1-12","switch-skeleton":"magritte-switch-skeleton___g1MEY_3-1-12","switchSkeleton":"magritte-switch-skeleton___g1MEY_3-1-12"};
5
+ var styles = {"switch":"magritte-switch___0AZYC_3-1-13","slider":"magritte-slider___YN62u_3-1-13","checked":"magritte-checked___QEAn5_3-1-13","switch-skeleton":"magritte-switch-skeleton___g1MEY_3-1-13","switchSkeleton":"magritte-switch-skeleton___g1MEY_3-1-13"};
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-CVWbsoG8.js.map
12
+ //# sourceMappingURL=Skeleton-DXeGg5XK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton-CVWbsoG8.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;;;;"}
1
+ {"version":3,"file":"Skeleton-DXeGg5XK.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
@@ -1,5 +1,5 @@
1
1
  import './index.css';
2
2
  import 'react/jsx-runtime';
3
3
  import '@hh.ru/magritte-ui-skeleton';
4
- export { S as SwitchSkeleton } from './Skeleton-CVWbsoG8.js';
4
+ export { S as SwitchSkeleton } from './Skeleton-DXeGg5XK.js';
5
5
  //# sourceMappingURL=Skeleton.js.map
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-CVWbsoG8.js';
7
+ import { S as SwitchSkeleton, s as styles } from './Skeleton-DXeGg5XK.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-6-0:#3030307a;
34
34
  --magritte-shadow-level-1-color-v24-6-0:#00000029;
35
35
  }
36
- .magritte-switch___0AZYC_3-1-12{
36
+ .magritte-switch___0AZYC_3-1-13{
37
37
  width:52px;
38
38
  height:32px;
39
39
  background-color:var(--magritte-color-component-switch-background-container-unchecked-v24-6-0);
@@ -41,36 +41,36 @@
41
41
  cursor:pointer;
42
42
  position:relative;
43
43
  }
44
- .magritte-switch___0AZYC_3-1-12:active:not(:disabled){
44
+ .magritte-switch___0AZYC_3-1-13:active:not(:disabled){
45
45
  background-color:var(--magritte-color-component-switch-background-state-container-unchecked-pressed-v24-6-0);
46
46
  }
47
- .magritte-switch___0AZYC_3-1-12:active:not(:disabled) .magritte-slider___YN62u_3-1-12{
47
+ .magritte-switch___0AZYC_3-1-13:active:not(:disabled) .magritte-slider___YN62u_3-1-13{
48
48
  border-radius:14px;
49
49
  background-color:var(--magritte-color-component-switch-background-state-toggle-unchecked-pressed-v24-6-0);
50
50
  width:32px;
51
51
  }
52
- .magritte-switch___0AZYC_3-1-12:disabled{
52
+ .magritte-switch___0AZYC_3-1-13:disabled{
53
53
  cursor:not-allowed;
54
54
  background-color:var(--magritte-color-component-switch-background-state-container-unchecked-disabled-v24-6-0);
55
55
  border-radius:20px;
56
56
  }
57
- .magritte-switch___0AZYC_3-1-12:disabled.magritte-checked___QEAn5_3-1-12{
57
+ .magritte-switch___0AZYC_3-1-13:disabled.magritte-checked___QEAn5_3-1-13{
58
58
  background-color:var(--magritte-color-component-switch-background-state-container-checked-disabled-v24-6-0);
59
59
  }
60
- .magritte-switch___0AZYC_3-1-12.focus-visible{
60
+ .magritte-switch___0AZYC_3-1-13.focus-visible{
61
61
  outline:var(--magritte-color-component-switch-stroke-state-focused-accessible-v24-6-0) solid 4px;
62
62
  }
63
63
  @media (min-width: 1020px){
64
- body.magritte-old-layout .magritte-switch___0AZYC_3-1-12:hover:not(:disabled):not(:active){
64
+ body.magritte-old-layout .magritte-switch___0AZYC_3-1-13:hover:not(:disabled):not(:active){
65
65
  background-color:var(--magritte-color-component-switch-background-state-container-unchecked-hovered-v24-6-0);
66
66
  }
67
67
  }
68
68
  @media (min-width: 1024px){
69
- body:not(.magritte-old-layout) .magritte-switch___0AZYC_3-1-12:hover:not(:disabled):not(:active){
69
+ body:not(.magritte-old-layout) .magritte-switch___0AZYC_3-1-13:hover:not(:disabled):not(:active){
70
70
  background-color:var(--magritte-color-component-switch-background-state-container-unchecked-hovered-v24-6-0);
71
71
  }
72
72
  }
73
- .magritte-slider___YN62u_3-1-12{
73
+ .magritte-slider___YN62u_3-1-13{
74
74
  width:24px;
75
75
  height:24px;
76
76
  background-color:var(--magritte-color-component-switch-background-toggle-unchecked-v24-6-0);
@@ -88,33 +88,33 @@
88
88
  --magritte-ui-icon-color-override:var(--magritte-color-component-switch-icon-state-toggle-unchecked-disabled-v24-6-0);
89
89
  box-shadow:var(--magritte-shadow-level-1-x-v24-6-0) var(--magritte-shadow-level-1-y-v24-6-0) var(--magritte-shadow-level-1-blur-v24-6-0) var(--magritte-shadow-level-1-spread-v24-6-0) var(--magritte-shadow-level-1-color-v24-6-0);
90
90
  }
91
- .magritte-checked___QEAn5_3-1-12{
91
+ .magritte-checked___QEAn5_3-1-13{
92
92
  background-color:var(--magritte-color-component-switch-background-container-checked-v24-6-0);
93
93
  }
94
- .magritte-checked___QEAn5_3-1-12 .magritte-slider___YN62u_3-1-12{
94
+ .magritte-checked___QEAn5_3-1-13 .magritte-slider___YN62u_3-1-13{
95
95
  background-color:var(--magritte-color-component-switch-background-toggle-checked-v24-6-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-6-0);
98
98
  }
99
- .magritte-checked___QEAn5_3-1-12:active:not(:disabled){
99
+ .magritte-checked___QEAn5_3-1-13:active:not(:disabled){
100
100
  background-color:var(--magritte-color-component-switch-background-state-container-checked-pressed-v24-6-0);
101
101
  }
102
- .magritte-checked___QEAn5_3-1-12:active:not(:disabled) .magritte-slider___YN62u_3-1-12{
102
+ .magritte-checked___QEAn5_3-1-13:active:not(:disabled) .magritte-slider___YN62u_3-1-13{
103
103
  background-color:var(--magritte-color-component-switch-background-state-toggle-checked-pressed-v24-6-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-1-12:hover:not(:disabled):not(:active){
108
+ body.magritte-old-layout .magritte-checked___QEAn5_3-1-13:hover:not(:disabled):not(:active){
109
109
  background-color:var(--magritte-color-component-switch-background-state-container-checked-hovered-v24-6-0);
110
110
  }
111
111
  }
112
112
  @media (min-width: 1024px){
113
- body:not(.magritte-old-layout) .magritte-checked___QEAn5_3-1-12:hover:not(:disabled):not(:active){
113
+ body:not(.magritte-old-layout) .magritte-checked___QEAn5_3-1-13:hover:not(:disabled):not(:active){
114
114
  background-color:var(--magritte-color-component-switch-background-state-container-checked-hovered-v24-6-0);
115
115
  }
116
116
  }
117
- .magritte-switch-skeleton___g1MEY_3-1-12{
117
+ .magritte-switch-skeleton___g1MEY_3-1-13{
118
118
  width:52px;
119
119
  height:32px;
120
120
  border-radius:16px;
package/index.js CHANGED
@@ -5,5 +5,5 @@ import 'classnames';
5
5
  import '@hh.ru/magritte-common-use-disabled';
6
6
  import '@hh.ru/magritte-ui-icon/icon';
7
7
  import '@hh.ru/magritte-ui-skeleton';
8
- import './Skeleton-CVWbsoG8.js';
8
+ import './Skeleton-DXeGg5XK.js';
9
9
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ export type * from '@hh.ru/magritte-ui-switch/types';
3
+ export declare const Switch: FC<Record<string, unknown>>;
package/index.mock.js ADDED
@@ -0,0 +1,9 @@
1
+ import './index.css';
2
+ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
+
4
+ const Switch = mockComponent('Switch', undefined, {
5
+ withChildren: false,
6
+ });
7
+
8
+ export { Switch };
9
+ //# sourceMappingURL=index.mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { FC } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport type * from '@hh.ru/magritte-ui-switch/types';\n\nexport const Switch: FC<Record<string, unknown>> = mockComponent('Switch', undefined, {\n withChildren: false,\n});\n"],"names":[],"mappings":";;MAMa,MAAM,GAAgC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE;AAClF,IAAA,YAAY,EAAE,KAAK;AACtB,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-switch",
3
- "version": "3.1.12",
3
+ "version": "3.1.13",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -23,6 +23,7 @@
23
23
  "@hh.ru/magritte-design-tokens": "24.6.0",
24
24
  "@hh.ru/magritte-ui-breakpoint": "6.0.8",
25
25
  "@hh.ru/magritte-ui-icon": "14.2.1",
26
+ "@hh.ru/magritte-ui-mock-component": "1.1.7",
26
27
  "@hh.ru/magritte-ui-skeleton": "3.0.20"
27
28
  },
28
29
  "peerDependencies": {
@@ -32,5 +33,5 @@
32
33
  "publishConfig": {
33
34
  "access": "public"
34
35
  },
35
- "gitHead": "ace8e156de2c5d2d5a3c2a7f1a66a49ca5a04817"
36
+ "gitHead": "cadaa9dd9ed52159fedbaf7e7111b70cdf6bb05c"
36
37
  }