@alfalab/core-components-switch 2.2.4 → 2.3.3
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/CHANGELOG.md +39 -0
- package/{dist/Component.d.ts → Component.d.ts} +0 -0
- package/{dist/Component.js → Component.js} +1 -1
- package/{dist/cssm → cssm}/Component.d.ts +0 -0
- package/{dist/cssm → cssm}/Component.js +0 -0
- package/{dist/cssm → cssm}/index.d.ts +0 -0
- package/{dist/cssm → cssm}/index.js +0 -0
- package/{dist/cssm → cssm}/index.module.css +0 -0
- package/{dist/esm → esm}/Component.d.ts +0 -0
- package/{dist/esm → esm}/Component.js +1 -1
- package/{dist → esm}/index.css +26 -26
- package/{dist/esm → esm}/index.d.ts +0 -0
- package/{dist/esm → esm}/index.js +0 -0
- package/{dist/esm/index.css → index.css} +26 -26
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/{dist/modern → modern}/Component.d.ts +0 -0
- package/{dist/modern → modern}/Component.js +1 -1
- package/{dist/modern → modern}/index.css +26 -26
- package/{dist/modern → modern}/index.d.ts +0 -0
- package/{dist/modern → modern}/index.js +0 -0
- package/package.json +9 -11
- /package/{dist/send-stats.js → send-stats.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.3.3](https://github.com/core-ds/core-components/compare/@alfalab/core-components-switch@2.3.2...@alfalab/core-components-switch@2.3.3) (2022-07-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @alfalab/core-components-switch
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.3.2](https://github.com/core-ds/core-components/compare/@alfalab/core-components-switch@2.3.1...@alfalab/core-components-switch@2.3.2) (2022-07-15)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* bump packages version ([#153](https://github.com/core-ds/core-components/issues/153)) ([fd3e082](https://github.com/core-ds/core-components/commit/fd3e08205672129cdce04e1000c673f2cd9c10da))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [2.3.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-switch@2.3.0...@alfalab/core-components-switch@2.3.1) (2022-07-14)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @alfalab/core-components-switch
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [2.3.0](https://github.com/core-ds/core-components/compare/@alfalab/core-components-switch@2.2.4...@alfalab/core-components-switch@2.3.0) (2022-06-28)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* circumflexus retrieval ([#57](https://github.com/core-ds/core-components/issues/57)) ([3820da8](https://github.com/core-ds/core-components/commit/3820da818bcdcbee6904c648b3e29c3c828fe202))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## [2.2.1](https://github.com/core-ds/core-components/compare/@alfalab/core-components-switch@2.2.0...@alfalab/core-components-switch@2.2.1) (2021-12-08)
|
|
7
45
|
|
|
8
46
|
|
|
@@ -156,4 +194,5 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
156
194
|
|
|
157
195
|
### Features
|
|
158
196
|
|
|
197
|
+
|
|
159
198
|
* **switch:** improved theming ([b4ecc39](https://github.com/core-ds/core-components/commit/b4ecc399c706e1de7086e255e57219e3907414e0))
|
|
File without changes
|
|
@@ -52,7 +52,7 @@ function __rest(s, e) {
|
|
|
52
52
|
return t;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
var styles = {"component":"
|
|
55
|
+
var styles = {"component":"switch__component_1kbpe","start":"switch__start_1kbpe","center":"switch__center_1kbpe","addons":"switch__addons_1kbpe","block":"switch__block_1kbpe","switch":"switch__switch_1kbpe","content":"switch__content_1kbpe","label":"switch__label_1kbpe","hint":"switch__hint_1kbpe","reversed":"switch__reversed_1kbpe","checked":"switch__checked_1kbpe","disabled":"switch__disabled_1kbpe","inactive":"switch__inactive_1kbpe","focused":"switch__focused_1kbpe"};
|
|
56
56
|
require('./index.css')
|
|
57
57
|
|
|
58
58
|
var Switch = React.forwardRef(function (_a, ref) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -42,7 +42,7 @@ function __rest(s, e) {
|
|
|
42
42
|
return t;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
var styles = {"component":"
|
|
45
|
+
var styles = {"component":"switch__component_1kbpe","start":"switch__start_1kbpe","center":"switch__center_1kbpe","addons":"switch__addons_1kbpe","block":"switch__block_1kbpe","switch":"switch__switch_1kbpe","content":"switch__content_1kbpe","label":"switch__label_1kbpe","hint":"switch__hint_1kbpe","reversed":"switch__reversed_1kbpe","checked":"switch__checked_1kbpe","disabled":"switch__disabled_1kbpe","inactive":"switch__inactive_1kbpe","focused":"switch__focused_1kbpe"};
|
|
46
46
|
require('./index.css')
|
|
47
47
|
|
|
48
48
|
var Switch = forwardRef(function (_a, ref) {
|
package/{dist → esm}/index.css
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: lwtr4 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-link: #007aff;
|
|
4
4
|
--color-light-border-underline: #b6bcc3;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
/* inactive */
|
|
50
50
|
--switch-inactive-color: var(--color-light-border-underline);
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
.switch__component_1kbpe {
|
|
53
53
|
display: inline-flex;
|
|
54
54
|
align-items: flex-start;
|
|
55
55
|
margin: 0;
|
|
@@ -58,25 +58,25 @@
|
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
60
60
|
}
|
|
61
|
-
.
|
|
61
|
+
.switch__component_1kbpe input {
|
|
62
62
|
opacity: 0;
|
|
63
63
|
position: absolute;
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
.switch__start_1kbpe {
|
|
66
66
|
align-items: flex-start;
|
|
67
67
|
}
|
|
68
|
-
.
|
|
68
|
+
.switch__center_1kbpe {
|
|
69
69
|
align-items: center;
|
|
70
70
|
}
|
|
71
|
-
.
|
|
71
|
+
.switch__addons_1kbpe {
|
|
72
72
|
margin-left: auto;
|
|
73
73
|
padding-left: var(--gap-m);
|
|
74
74
|
line-height: 24px;
|
|
75
75
|
}
|
|
76
|
-
.
|
|
76
|
+
.switch__block_1kbpe {
|
|
77
77
|
width: 100%;
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
.switch__switch_1kbpe {
|
|
80
80
|
position: relative;
|
|
81
81
|
border-radius: var(--border-radius-xl);
|
|
82
82
|
width: 36px;
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
89
89
|
box-sizing: border-box;
|
|
90
90
|
}
|
|
91
|
-
.
|
|
91
|
+
.switch__switch_1kbpe:before {
|
|
92
92
|
content: '';
|
|
93
93
|
position: absolute;
|
|
94
94
|
top: 0;
|
|
@@ -101,21 +101,21 @@
|
|
|
101
101
|
box-sizing: border-box;
|
|
102
102
|
transition: transform 0.2s ease;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.switch__content_1kbpe {
|
|
105
105
|
margin-left: var(--gap-s);
|
|
106
106
|
flex-grow: 1;
|
|
107
107
|
}
|
|
108
|
-
.
|
|
108
|
+
.switch__label_1kbpe {
|
|
109
109
|
font-size: 16px;
|
|
110
110
|
line-height: 24px;
|
|
111
111
|
font-weight: 400;
|
|
112
112
|
display: block;
|
|
113
113
|
color: var(--switch-label-color);
|
|
114
114
|
}
|
|
115
|
-
.
|
|
115
|
+
.switch__label_1kbpe:not(:only-child) {
|
|
116
116
|
margin-bottom: var(--gap-2xs);
|
|
117
117
|
}
|
|
118
|
-
.
|
|
118
|
+
.switch__hint_1kbpe {
|
|
119
119
|
font-size: 14px;
|
|
120
120
|
line-height: 18px;
|
|
121
121
|
font-weight: 400;
|
|
@@ -123,55 +123,55 @@
|
|
|
123
123
|
color: var(--switch-hint-color);
|
|
124
124
|
}
|
|
125
125
|
/* Reversed state */
|
|
126
|
-
.
|
|
126
|
+
.switch__component_1kbpe.switch__reversed_1kbpe {
|
|
127
127
|
flex-direction: row-reverse;
|
|
128
128
|
}
|
|
129
|
-
.
|
|
129
|
+
.switch__reversed_1kbpe .switch__content_1kbpe {
|
|
130
130
|
margin-right: var(--gap-m);
|
|
131
131
|
margin-left: 0;
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
.switch__reversed_1kbpe .switch__addons_1kbpe {
|
|
134
134
|
margin-left: 0;
|
|
135
135
|
padding-left: 0;
|
|
136
136
|
margin-right: auto;
|
|
137
137
|
padding-right: var(--gap-m);
|
|
138
138
|
}
|
|
139
139
|
/* Checked state */
|
|
140
|
-
.
|
|
140
|
+
.switch__checked_1kbpe .switch__switch_1kbpe {
|
|
141
141
|
background-color: var(--switch-checked-bg-color);
|
|
142
142
|
border-color: var(--switch-checked-border-color);
|
|
143
143
|
}
|
|
144
|
-
.
|
|
144
|
+
.switch__checked_1kbpe .switch__switch_1kbpe:before {
|
|
145
145
|
/* ширина компонента(36px + 2*2px) - отступы(2 * 2px) - размер кружка(20px) */
|
|
146
146
|
transform: translateX(16px);
|
|
147
147
|
}
|
|
148
148
|
/* Disabled state */
|
|
149
|
-
.
|
|
149
|
+
.switch__disabled_1kbpe {
|
|
150
150
|
cursor: var(--disabled-cursor);
|
|
151
151
|
}
|
|
152
|
-
.
|
|
152
|
+
.switch__disabled_1kbpe .switch__switch_1kbpe {
|
|
153
153
|
background-color: var(--switch-disabled-bg-color);
|
|
154
154
|
border-color: var(--switch-disabled-border-color);
|
|
155
155
|
}
|
|
156
|
-
.
|
|
156
|
+
.switch__disabled_1kbpe .switch__label_1kbpe {
|
|
157
157
|
color: var(--switch-disabled-color);
|
|
158
158
|
}
|
|
159
|
-
.
|
|
159
|
+
.switch__disabled_1kbpe .switch__hint_1kbpe {
|
|
160
160
|
color: var(--switch-disabled-color);
|
|
161
161
|
}
|
|
162
162
|
/* Inactive */
|
|
163
|
-
.
|
|
163
|
+
.switch__inactive_1kbpe {
|
|
164
164
|
cursor: var(--disabled-cursor);
|
|
165
165
|
}
|
|
166
|
-
.
|
|
166
|
+
.switch__inactive_1kbpe .switch__switch_1kbpe {
|
|
167
167
|
background-color: var(--switch-disabled-bg-color);
|
|
168
168
|
border-color: var(--switch-disabled-border-color)
|
|
169
169
|
}
|
|
170
|
-
.
|
|
170
|
+
.switch__inactive_1kbpe .switch__switch_1kbpe:before {
|
|
171
171
|
background-color: var(--switch-inactive-color);
|
|
172
172
|
}
|
|
173
173
|
/* Focused state */
|
|
174
|
-
.
|
|
174
|
+
.switch__focused_1kbpe .switch__switch_1kbpe {
|
|
175
175
|
outline: 2px solid var(--focus-color);
|
|
176
176
|
outline-offset: 2px;
|
|
177
177
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: lwtr4 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-link: #007aff;
|
|
4
4
|
--color-light-border-underline: #b6bcc3;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
/* inactive */
|
|
50
50
|
--switch-inactive-color: var(--color-light-border-underline);
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
.switch__component_1kbpe {
|
|
53
53
|
display: inline-flex;
|
|
54
54
|
align-items: flex-start;
|
|
55
55
|
margin: 0;
|
|
@@ -58,25 +58,25 @@
|
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
60
60
|
}
|
|
61
|
-
.
|
|
61
|
+
.switch__component_1kbpe input {
|
|
62
62
|
opacity: 0;
|
|
63
63
|
position: absolute;
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
.switch__start_1kbpe {
|
|
66
66
|
align-items: flex-start;
|
|
67
67
|
}
|
|
68
|
-
.
|
|
68
|
+
.switch__center_1kbpe {
|
|
69
69
|
align-items: center;
|
|
70
70
|
}
|
|
71
|
-
.
|
|
71
|
+
.switch__addons_1kbpe {
|
|
72
72
|
margin-left: auto;
|
|
73
73
|
padding-left: var(--gap-m);
|
|
74
74
|
line-height: 24px;
|
|
75
75
|
}
|
|
76
|
-
.
|
|
76
|
+
.switch__block_1kbpe {
|
|
77
77
|
width: 100%;
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
.switch__switch_1kbpe {
|
|
80
80
|
position: relative;
|
|
81
81
|
border-radius: var(--border-radius-xl);
|
|
82
82
|
width: 36px;
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
89
89
|
box-sizing: border-box;
|
|
90
90
|
}
|
|
91
|
-
.
|
|
91
|
+
.switch__switch_1kbpe:before {
|
|
92
92
|
content: '';
|
|
93
93
|
position: absolute;
|
|
94
94
|
top: 0;
|
|
@@ -101,21 +101,21 @@
|
|
|
101
101
|
box-sizing: border-box;
|
|
102
102
|
transition: transform 0.2s ease;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.switch__content_1kbpe {
|
|
105
105
|
margin-left: var(--gap-s);
|
|
106
106
|
flex-grow: 1;
|
|
107
107
|
}
|
|
108
|
-
.
|
|
108
|
+
.switch__label_1kbpe {
|
|
109
109
|
font-size: 16px;
|
|
110
110
|
line-height: 24px;
|
|
111
111
|
font-weight: 400;
|
|
112
112
|
display: block;
|
|
113
113
|
color: var(--switch-label-color);
|
|
114
114
|
}
|
|
115
|
-
.
|
|
115
|
+
.switch__label_1kbpe:not(:only-child) {
|
|
116
116
|
margin-bottom: var(--gap-2xs);
|
|
117
117
|
}
|
|
118
|
-
.
|
|
118
|
+
.switch__hint_1kbpe {
|
|
119
119
|
font-size: 14px;
|
|
120
120
|
line-height: 18px;
|
|
121
121
|
font-weight: 400;
|
|
@@ -123,55 +123,55 @@
|
|
|
123
123
|
color: var(--switch-hint-color);
|
|
124
124
|
}
|
|
125
125
|
/* Reversed state */
|
|
126
|
-
.
|
|
126
|
+
.switch__component_1kbpe.switch__reversed_1kbpe {
|
|
127
127
|
flex-direction: row-reverse;
|
|
128
128
|
}
|
|
129
|
-
.
|
|
129
|
+
.switch__reversed_1kbpe .switch__content_1kbpe {
|
|
130
130
|
margin-right: var(--gap-m);
|
|
131
131
|
margin-left: 0;
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
.switch__reversed_1kbpe .switch__addons_1kbpe {
|
|
134
134
|
margin-left: 0;
|
|
135
135
|
padding-left: 0;
|
|
136
136
|
margin-right: auto;
|
|
137
137
|
padding-right: var(--gap-m);
|
|
138
138
|
}
|
|
139
139
|
/* Checked state */
|
|
140
|
-
.
|
|
140
|
+
.switch__checked_1kbpe .switch__switch_1kbpe {
|
|
141
141
|
background-color: var(--switch-checked-bg-color);
|
|
142
142
|
border-color: var(--switch-checked-border-color);
|
|
143
143
|
}
|
|
144
|
-
.
|
|
144
|
+
.switch__checked_1kbpe .switch__switch_1kbpe:before {
|
|
145
145
|
/* ширина компонента(36px + 2*2px) - отступы(2 * 2px) - размер кружка(20px) */
|
|
146
146
|
transform: translateX(16px);
|
|
147
147
|
}
|
|
148
148
|
/* Disabled state */
|
|
149
|
-
.
|
|
149
|
+
.switch__disabled_1kbpe {
|
|
150
150
|
cursor: var(--disabled-cursor);
|
|
151
151
|
}
|
|
152
|
-
.
|
|
152
|
+
.switch__disabled_1kbpe .switch__switch_1kbpe {
|
|
153
153
|
background-color: var(--switch-disabled-bg-color);
|
|
154
154
|
border-color: var(--switch-disabled-border-color);
|
|
155
155
|
}
|
|
156
|
-
.
|
|
156
|
+
.switch__disabled_1kbpe .switch__label_1kbpe {
|
|
157
157
|
color: var(--switch-disabled-color);
|
|
158
158
|
}
|
|
159
|
-
.
|
|
159
|
+
.switch__disabled_1kbpe .switch__hint_1kbpe {
|
|
160
160
|
color: var(--switch-disabled-color);
|
|
161
161
|
}
|
|
162
162
|
/* Inactive */
|
|
163
|
-
.
|
|
163
|
+
.switch__inactive_1kbpe {
|
|
164
164
|
cursor: var(--disabled-cursor);
|
|
165
165
|
}
|
|
166
|
-
.
|
|
166
|
+
.switch__inactive_1kbpe .switch__switch_1kbpe {
|
|
167
167
|
background-color: var(--switch-disabled-bg-color);
|
|
168
168
|
border-color: var(--switch-disabled-border-color)
|
|
169
169
|
}
|
|
170
|
-
.
|
|
170
|
+
.switch__inactive_1kbpe .switch__switch_1kbpe:before {
|
|
171
171
|
background-color: var(--switch-inactive-color);
|
|
172
172
|
}
|
|
173
173
|
/* Focused state */
|
|
174
|
-
.
|
|
174
|
+
.switch__focused_1kbpe .switch__switch_1kbpe {
|
|
175
175
|
outline: 2px solid var(--focus-color);
|
|
176
176
|
outline-offset: 2px;
|
|
177
177
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
4
|
import { useFocus } from '@alfalab/hooks';
|
|
5
5
|
|
|
6
|
-
var styles = {"component":"
|
|
6
|
+
var styles = {"component":"switch__component_1kbpe","start":"switch__start_1kbpe","center":"switch__center_1kbpe","addons":"switch__addons_1kbpe","block":"switch__block_1kbpe","switch":"switch__switch_1kbpe","content":"switch__content_1kbpe","label":"switch__label_1kbpe","hint":"switch__hint_1kbpe","reversed":"switch__reversed_1kbpe","checked":"switch__checked_1kbpe","disabled":"switch__disabled_1kbpe","inactive":"switch__inactive_1kbpe","focused":"switch__focused_1kbpe"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const Switch = forwardRef(({ reversed = false, checked = false, align = 'start', addons, block, disabled, inactive, label, hint, name, value, className, onChange, dataTestId, ...restProps }, ref) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: lwtr4 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-link: #007aff;
|
|
4
4
|
--color-light-border-underline: #b6bcc3;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
/* inactive */
|
|
50
50
|
--switch-inactive-color: var(--color-light-border-underline);
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
.switch__component_1kbpe {
|
|
53
53
|
display: inline-flex;
|
|
54
54
|
align-items: flex-start;
|
|
55
55
|
margin: 0;
|
|
@@ -58,25 +58,25 @@
|
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
60
60
|
}
|
|
61
|
-
.
|
|
61
|
+
.switch__component_1kbpe input {
|
|
62
62
|
opacity: 0;
|
|
63
63
|
position: absolute;
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
.switch__start_1kbpe {
|
|
66
66
|
align-items: flex-start;
|
|
67
67
|
}
|
|
68
|
-
.
|
|
68
|
+
.switch__center_1kbpe {
|
|
69
69
|
align-items: center;
|
|
70
70
|
}
|
|
71
|
-
.
|
|
71
|
+
.switch__addons_1kbpe {
|
|
72
72
|
margin-left: auto;
|
|
73
73
|
padding-left: var(--gap-m);
|
|
74
74
|
line-height: 24px;
|
|
75
75
|
}
|
|
76
|
-
.
|
|
76
|
+
.switch__block_1kbpe {
|
|
77
77
|
width: 100%;
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
.switch__switch_1kbpe {
|
|
80
80
|
position: relative;
|
|
81
81
|
border-radius: var(--border-radius-xl);
|
|
82
82
|
width: 36px;
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
89
89
|
box-sizing: border-box;
|
|
90
90
|
}
|
|
91
|
-
.
|
|
91
|
+
.switch__switch_1kbpe:before {
|
|
92
92
|
content: '';
|
|
93
93
|
position: absolute;
|
|
94
94
|
top: 0;
|
|
@@ -101,21 +101,21 @@
|
|
|
101
101
|
box-sizing: border-box;
|
|
102
102
|
transition: transform 0.2s ease;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.switch__content_1kbpe {
|
|
105
105
|
margin-left: var(--gap-s);
|
|
106
106
|
flex-grow: 1;
|
|
107
107
|
}
|
|
108
|
-
.
|
|
108
|
+
.switch__label_1kbpe {
|
|
109
109
|
font-size: 16px;
|
|
110
110
|
line-height: 24px;
|
|
111
111
|
font-weight: 400;
|
|
112
112
|
display: block;
|
|
113
113
|
color: var(--switch-label-color);
|
|
114
114
|
}
|
|
115
|
-
.
|
|
115
|
+
.switch__label_1kbpe:not(:only-child) {
|
|
116
116
|
margin-bottom: var(--gap-2xs);
|
|
117
117
|
}
|
|
118
|
-
.
|
|
118
|
+
.switch__hint_1kbpe {
|
|
119
119
|
font-size: 14px;
|
|
120
120
|
line-height: 18px;
|
|
121
121
|
font-weight: 400;
|
|
@@ -123,55 +123,55 @@
|
|
|
123
123
|
color: var(--switch-hint-color);
|
|
124
124
|
}
|
|
125
125
|
/* Reversed state */
|
|
126
|
-
.
|
|
126
|
+
.switch__component_1kbpe.switch__reversed_1kbpe {
|
|
127
127
|
flex-direction: row-reverse;
|
|
128
128
|
}
|
|
129
|
-
.
|
|
129
|
+
.switch__reversed_1kbpe .switch__content_1kbpe {
|
|
130
130
|
margin-right: var(--gap-m);
|
|
131
131
|
margin-left: 0;
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
.switch__reversed_1kbpe .switch__addons_1kbpe {
|
|
134
134
|
margin-left: 0;
|
|
135
135
|
padding-left: 0;
|
|
136
136
|
margin-right: auto;
|
|
137
137
|
padding-right: var(--gap-m);
|
|
138
138
|
}
|
|
139
139
|
/* Checked state */
|
|
140
|
-
.
|
|
140
|
+
.switch__checked_1kbpe .switch__switch_1kbpe {
|
|
141
141
|
background-color: var(--switch-checked-bg-color);
|
|
142
142
|
border-color: var(--switch-checked-border-color);
|
|
143
143
|
}
|
|
144
|
-
.
|
|
144
|
+
.switch__checked_1kbpe .switch__switch_1kbpe:before {
|
|
145
145
|
/* ширина компонента(36px + 2*2px) - отступы(2 * 2px) - размер кружка(20px) */
|
|
146
146
|
transform: translateX(16px);
|
|
147
147
|
}
|
|
148
148
|
/* Disabled state */
|
|
149
|
-
.
|
|
149
|
+
.switch__disabled_1kbpe {
|
|
150
150
|
cursor: var(--disabled-cursor);
|
|
151
151
|
}
|
|
152
|
-
.
|
|
152
|
+
.switch__disabled_1kbpe .switch__switch_1kbpe {
|
|
153
153
|
background-color: var(--switch-disabled-bg-color);
|
|
154
154
|
border-color: var(--switch-disabled-border-color);
|
|
155
155
|
}
|
|
156
|
-
.
|
|
156
|
+
.switch__disabled_1kbpe .switch__label_1kbpe {
|
|
157
157
|
color: var(--switch-disabled-color);
|
|
158
158
|
}
|
|
159
|
-
.
|
|
159
|
+
.switch__disabled_1kbpe .switch__hint_1kbpe {
|
|
160
160
|
color: var(--switch-disabled-color);
|
|
161
161
|
}
|
|
162
162
|
/* Inactive */
|
|
163
|
-
.
|
|
163
|
+
.switch__inactive_1kbpe {
|
|
164
164
|
cursor: var(--disabled-cursor);
|
|
165
165
|
}
|
|
166
|
-
.
|
|
166
|
+
.switch__inactive_1kbpe .switch__switch_1kbpe {
|
|
167
167
|
background-color: var(--switch-disabled-bg-color);
|
|
168
168
|
border-color: var(--switch-disabled-border-color)
|
|
169
169
|
}
|
|
170
|
-
.
|
|
170
|
+
.switch__inactive_1kbpe .switch__switch_1kbpe:before {
|
|
171
171
|
background-color: var(--switch-inactive-color);
|
|
172
172
|
}
|
|
173
173
|
/* Focused state */
|
|
174
|
-
.
|
|
174
|
+
.switch__focused_1kbpe .switch__switch_1kbpe {
|
|
175
175
|
outline: 2px solid var(--focus-color);
|
|
176
176
|
outline-offset: 2px;
|
|
177
177
|
}
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-switch",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "f054fef20200664c65e2501ef1f916c555cdf05d",
|
|
6
6
|
"keywords": [],
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"main": "
|
|
9
|
-
"module": "./
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"module": "./esm/index.js",
|
|
13
10
|
"scripts": {
|
|
14
|
-
"postinstall": "node ./
|
|
11
|
+
"postinstall": "node -e \"if (require('fs').existsSync('./send-stats.js')){require('./send-stats.js')} \""
|
|
15
12
|
},
|
|
16
13
|
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
14
|
+
"access": "public",
|
|
15
|
+
"directory": "dist"
|
|
18
16
|
},
|
|
19
17
|
"peerDependencies": {
|
|
20
18
|
"react": "^16.9.0 || ^17.0.1"
|
|
21
19
|
},
|
|
22
20
|
"dependencies": {
|
|
23
21
|
"@alfalab/hooks": "^1.4.1",
|
|
24
|
-
"classnames": "2.2.6",
|
|
25
|
-
"react-merge-refs": "1.1.0"
|
|
22
|
+
"classnames": "^2.2.6",
|
|
23
|
+
"react-merge-refs": "^1.1.0"
|
|
26
24
|
}
|
|
27
25
|
}
|
|
File without changes
|