@rescui/switcher 0.7.0 → 0.8.0
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/lib/index.css +63 -39
- package/lib/index.p.module.css.js +14 -13
- package/lib/public-api.p.css +11 -3
- package/lib/public-api.pcss +11 -3
- package/lib/switcher.d.ts +3 -1
- package/lib/switcher.js +3 -1
- package/package.json +4 -4
package/lib/index.css
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
.
|
|
1
|
+
._themeLight_hikbk6_6{
|
|
2
2
|
--rs-theme-dark:0;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
._themeDark_hikbk6_9{
|
|
5
5
|
--rs-theme-dark:1;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._sizeXS_hikbk6_13{
|
|
8
8
|
--_rs-switcher-border-radius:4px;
|
|
9
|
+
--_rs-switcher-compact-border-radius:var(--_rs-switcher-border-radius);
|
|
9
10
|
--_rs-switcher-option-padding:2px 12px;
|
|
11
|
+
--_rs-switcher-compact-option-padding:2px 8px;
|
|
10
12
|
}
|
|
11
|
-
.
|
|
13
|
+
._sizeXS_hikbk6_13 [data-rs-internal='switcher__option']{
|
|
12
14
|
--_rs-typography-letter-spacing:0.0045em;
|
|
13
15
|
--_rs-typography-text-transform:initial;
|
|
14
16
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -42,11 +44,13 @@
|
|
|
42
44
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
43
45
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
44
46
|
}
|
|
45
|
-
.
|
|
46
|
-
--_rs-switcher-border-radius:
|
|
47
|
+
._sizeS_hikbk6_16{
|
|
48
|
+
--_rs-switcher-border-radius:16px;
|
|
49
|
+
--_rs-switcher-compact-border-radius:4px;
|
|
47
50
|
--_rs-switcher-option-padding:6px 16px;
|
|
51
|
+
--_rs-switcher-compact-option-padding:6px 8px;
|
|
48
52
|
}
|
|
49
|
-
.
|
|
53
|
+
._sizeS_hikbk6_16 [data-rs-internal='switcher__option']{
|
|
50
54
|
--_rs-typography-letter-spacing:0.0045em;
|
|
51
55
|
--_rs-typography-text-transform:initial;
|
|
52
56
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -80,11 +84,13 @@
|
|
|
80
84
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
81
85
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
82
86
|
}
|
|
83
|
-
.
|
|
84
|
-
--_rs-switcher-border-radius:
|
|
87
|
+
._sizeM_hikbk6_19{
|
|
88
|
+
--_rs-switcher-border-radius:20px;
|
|
89
|
+
--_rs-switcher-compact-border-radius:8px;
|
|
85
90
|
--_rs-switcher-option-padding:8px 24px;
|
|
91
|
+
--_rs-switcher-compact-option-padding:8px 12px;
|
|
86
92
|
}
|
|
87
|
-
.
|
|
93
|
+
._sizeM_hikbk6_19 [data-rs-internal='switcher__option']{
|
|
88
94
|
--_rs-typography-letter-spacing:0.0015em;
|
|
89
95
|
--_rs-typography-text-transform:initial;
|
|
90
96
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -119,15 +125,17 @@
|
|
|
119
125
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
120
126
|
}
|
|
121
127
|
@media screen and (max-width: 640px){
|
|
122
|
-
.
|
|
128
|
+
._sizeM_hikbk6_19 [data-rs-internal='switcher__option']{
|
|
123
129
|
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
|
-
.
|
|
127
|
-
--_rs-switcher-border-radius:
|
|
132
|
+
._sizeL_hikbk6_22{
|
|
133
|
+
--_rs-switcher-border-radius:26px;
|
|
134
|
+
--_rs-switcher-compact-border-radius:12px;
|
|
128
135
|
--_rs-switcher-option-padding:12px 32px;
|
|
136
|
+
--_rs-switcher-compact-option-padding:12px 16px;
|
|
129
137
|
}
|
|
130
|
-
.
|
|
138
|
+
._sizeL_hikbk6_22 [data-rs-internal='switcher__option']{
|
|
131
139
|
--_rs-typography-letter-spacing:normal;
|
|
132
140
|
--_rs-typography-text-transform:initial;
|
|
133
141
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -162,22 +170,26 @@
|
|
|
162
170
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
163
171
|
}
|
|
164
172
|
@media screen and (max-width: 640px){
|
|
165
|
-
.
|
|
173
|
+
._sizeL_hikbk6_22 [data-rs-internal='switcher__option']{
|
|
166
174
|
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
|
-
.
|
|
177
|
+
._modeClassic_hikbk6_26{
|
|
170
178
|
--_rs-switcher-option-hover-background:var(--_rs-color-primary-t-fog);
|
|
171
179
|
--_rs-switcher-mark-border-color:var(--_rs-color-primary);
|
|
172
180
|
}
|
|
173
|
-
.
|
|
181
|
+
._modeRock_hikbk6_29{
|
|
174
182
|
--_rs-switcher-option-hover-background:rgba(
|
|
175
183
|
calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227),
|
|
176
184
|
0.1
|
|
177
185
|
);
|
|
178
186
|
--_rs-switcher-mark-border-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
179
187
|
}
|
|
180
|
-
.
|
|
188
|
+
._compact_hikbk6_33{
|
|
189
|
+
--_rs-switcher-border-radius-from-compact:var(--_rs-switcher-compact-border-radius);
|
|
190
|
+
--_rs-switcher-option-padding-from-compact:var(--_rs-switcher-compact-option-padding);
|
|
191
|
+
}
|
|
192
|
+
._switcher_hikbk6_37{
|
|
181
193
|
--_rs-theme-dark:var(
|
|
182
194
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
183
195
|
var(--rs-theme-dark, 0)
|
|
@@ -187,7 +199,7 @@
|
|
|
187
199
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
188
200
|
}
|
|
189
201
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
190
|
-
.
|
|
202
|
+
._switcher_hikbk6_37{
|
|
191
203
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
192
204
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
193
205
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -196,7 +208,7 @@
|
|
|
196
208
|
}
|
|
197
209
|
}
|
|
198
210
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
199
|
-
.
|
|
211
|
+
._switcher_hikbk6_37{
|
|
200
212
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
201
213
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
202
214
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -204,7 +216,7 @@
|
|
|
204
216
|
--_rs-color-primary-t-fog:rgba(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255, calc(var(--_rs-theme-light-coefficient, 1)*0.2 + var(--_rs-theme-dark-coefficient, 0)*0.3));
|
|
205
217
|
}
|
|
206
218
|
}
|
|
207
|
-
.
|
|
219
|
+
._switcher_hikbk6_37 {
|
|
208
220
|
|
|
209
221
|
position:relative;
|
|
210
222
|
|
|
@@ -218,7 +230,10 @@
|
|
|
218
230
|
|
|
219
231
|
box-sizing:border-box;
|
|
220
232
|
|
|
221
|
-
border-radius:var(
|
|
233
|
+
border-radius:var(
|
|
234
|
+
--_rs-switcher-border-radius-from-compact,
|
|
235
|
+
var(--_rs-switcher-border-radius)
|
|
236
|
+
);
|
|
222
237
|
|
|
223
238
|
background:transparent;
|
|
224
239
|
-webkit-box-shadow:inset rgba(
|
|
@@ -230,7 +245,7 @@
|
|
|
230
245
|
calc(0.4 + var(--_rs-theme-dark-coefficient)*0.1)
|
|
231
246
|
) 0 0 0 1px;
|
|
232
247
|
}
|
|
233
|
-
.
|
|
248
|
+
._option_hikbk6_61{
|
|
234
249
|
letter-spacing:var(
|
|
235
250
|
--rs-text-base-letter-spacing,
|
|
236
251
|
var(--_rs-typography-letter-spacing)
|
|
@@ -244,11 +259,11 @@
|
|
|
244
259
|
-webkit-font-feature-settings:'kern', 'liga', 'calt';
|
|
245
260
|
font-feature-settings:'kern', 'liga', 'calt';
|
|
246
261
|
}
|
|
247
|
-
.
|
|
248
|
-
.
|
|
262
|
+
._option_hikbk6_61 > p:not(:nth-child(1)),
|
|
263
|
+
._option_hikbk6_61 > pre:not(:nth-child(1)){
|
|
249
264
|
padding-top:var(--_rs-typography-auto-offset-or-initial);
|
|
250
265
|
}
|
|
251
|
-
.
|
|
266
|
+
._option_hikbk6_61 {
|
|
252
267
|
--_rs-typography-hardness-color:var(
|
|
253
268
|
--rs-color-hard,
|
|
254
269
|
rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227))
|
|
@@ -266,10 +281,16 @@
|
|
|
266
281
|
|
|
267
282
|
box-sizing:border-box;
|
|
268
283
|
margin:0;
|
|
269
|
-
padding:var(
|
|
284
|
+
padding:var(
|
|
285
|
+
--_rs-switcher-option-padding-from-compact,
|
|
286
|
+
var(--_rs-switcher-option-padding)
|
|
287
|
+
);
|
|
270
288
|
|
|
271
289
|
border:none;
|
|
272
|
-
border-radius:var(
|
|
290
|
+
border-radius:var(
|
|
291
|
+
--_rs-switcher-border-radius-from-compact,
|
|
292
|
+
var(--_rs-switcher-border-radius)
|
|
293
|
+
);
|
|
273
294
|
outline:none;
|
|
274
295
|
|
|
275
296
|
cursor:pointer;
|
|
@@ -280,26 +301,26 @@
|
|
|
280
301
|
-moz-appearance:none;
|
|
281
302
|
appearance:none;
|
|
282
303
|
}
|
|
283
|
-
.
|
|
304
|
+
._disabled_hikbk6_91 ._option_hikbk6_61{
|
|
284
305
|
cursor:not-allowed;
|
|
285
306
|
pointer-events:none;
|
|
286
307
|
}
|
|
287
|
-
.
|
|
308
|
+
._option_hikbk6_61:focus[data-focus-method='key']{
|
|
288
309
|
-webkit-box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
289
310
|
box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
290
311
|
}
|
|
291
|
-
.
|
|
312
|
+
._option_hikbk6_61:hover{
|
|
292
313
|
background:var(--_rs-switcher-option-hover-background);
|
|
293
314
|
}
|
|
294
|
-
.
|
|
315
|
+
._option_hikbk6_61._selected_hikbk6_104:active{
|
|
295
316
|
background:transparent;
|
|
296
317
|
}
|
|
297
|
-
.
|
|
298
|
-
.
|
|
318
|
+
._option_hikbk6_61._selected_hikbk6_104:hover,
|
|
319
|
+
._option_hikbk6_61._selected_hikbk6_104:active{
|
|
299
320
|
cursor:default;
|
|
300
321
|
}
|
|
301
|
-
.
|
|
302
|
-
.
|
|
322
|
+
._disabled_hikbk6_91 ._option_hikbk6_61,
|
|
323
|
+
._disabled_hikbk6_91 ._option_hikbk6_61._selected_hikbk6_104{
|
|
303
324
|
cursor:default;
|
|
304
325
|
|
|
305
326
|
color:rgba(
|
|
@@ -308,7 +329,7 @@
|
|
|
308
329
|
);
|
|
309
330
|
background:transparent;
|
|
310
331
|
}
|
|
311
|
-
.
|
|
332
|
+
._mark_hikbk6_126{
|
|
312
333
|
position:absolute;
|
|
313
334
|
top:0;
|
|
314
335
|
bottom:0;
|
|
@@ -321,13 +342,16 @@
|
|
|
321
342
|
|
|
322
343
|
border:solid 2px var(--_rs-switcher-mark-border-color);
|
|
323
344
|
|
|
324
|
-
border-radius:var(
|
|
345
|
+
border-radius:var(
|
|
346
|
+
--_rs-switcher-border-radius-from-compact,
|
|
347
|
+
var(--_rs-switcher-border-radius)
|
|
348
|
+
);
|
|
325
349
|
|
|
326
350
|
-webkit-transition:all 0.2s;
|
|
327
351
|
|
|
328
352
|
transition:all 0.2s;
|
|
329
353
|
}
|
|
330
|
-
.
|
|
354
|
+
._disabled_hikbk6_91 ._mark_hikbk6_126{
|
|
331
355
|
border:solid 2px rgba(
|
|
332
356
|
calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227),
|
|
333
357
|
calc(0.4 - var(--_rs-theme-dark-coefficient)*0.2)
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"sizeXS": "
|
|
5
|
-
"sizeS": "
|
|
6
|
-
"sizeM": "
|
|
7
|
-
"sizeL": "
|
|
8
|
-
"modeClassic": "
|
|
9
|
-
"modeRock": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
2
|
+
"themeLight": "_themeLight_hikbk6_6",
|
|
3
|
+
"themeDark": "_themeDark_hikbk6_9",
|
|
4
|
+
"sizeXS": "_sizeXS_hikbk6_13",
|
|
5
|
+
"sizeS": "_sizeS_hikbk6_16",
|
|
6
|
+
"sizeM": "_sizeM_hikbk6_19",
|
|
7
|
+
"sizeL": "_sizeL_hikbk6_22",
|
|
8
|
+
"modeClassic": "_modeClassic_hikbk6_26",
|
|
9
|
+
"modeRock": "_modeRock_hikbk6_29",
|
|
10
|
+
"compact": "_compact_hikbk6_33",
|
|
11
|
+
"switcher": "_switcher_hikbk6_37",
|
|
12
|
+
"option": "_option_hikbk6_61",
|
|
13
|
+
"disabled": "_disabled_hikbk6_91",
|
|
14
|
+
"selected": "_selected_hikbk6_104",
|
|
15
|
+
"mark": "_mark_hikbk6_126"
|
|
15
16
|
};
|
|
16
17
|
export { styles as default };
|
package/lib/public-api.p.css
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@define-mixin rs-switcher-size-xs{
|
|
2
2
|
&:not(html){
|
|
3
3
|
--_rs-switcher-border-radius:4px;
|
|
4
|
+
--_rs-switcher-compact-border-radius:var(--_rs-switcher-border-radius);
|
|
4
5
|
--_rs-switcher-option-padding:2px 12px;
|
|
6
|
+
--_rs-switcher-compact-option-padding:2px 8px;
|
|
5
7
|
}
|
|
6
8
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
7
9
|
--_rs-typography-letter-spacing:0.0045em;
|
|
@@ -40,8 +42,10 @@
|
|
|
40
42
|
}
|
|
41
43
|
@define-mixin rs-switcher-size-s{
|
|
42
44
|
&:not(html){
|
|
43
|
-
--_rs-switcher-border-radius:
|
|
45
|
+
--_rs-switcher-border-radius:16px;
|
|
46
|
+
--_rs-switcher-compact-border-radius:4px;
|
|
44
47
|
--_rs-switcher-option-padding:6px 16px;
|
|
48
|
+
--_rs-switcher-compact-option-padding:6px 8px;
|
|
45
49
|
}
|
|
46
50
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
47
51
|
--_rs-typography-letter-spacing:0.0045em;
|
|
@@ -80,8 +84,10 @@
|
|
|
80
84
|
}
|
|
81
85
|
@define-mixin rs-switcher-size-m{
|
|
82
86
|
&:not(html){
|
|
83
|
-
--_rs-switcher-border-radius:
|
|
87
|
+
--_rs-switcher-border-radius:20px;
|
|
88
|
+
--_rs-switcher-compact-border-radius:8px;
|
|
84
89
|
--_rs-switcher-option-padding:8px 24px;
|
|
90
|
+
--_rs-switcher-compact-option-padding:8px 12px;
|
|
85
91
|
}
|
|
86
92
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
87
93
|
--_rs-typography-letter-spacing:0.0015em;
|
|
@@ -125,8 +131,10 @@
|
|
|
125
131
|
}
|
|
126
132
|
@define-mixin rs-switcher-size-l{
|
|
127
133
|
&:not(html){
|
|
128
|
-
--_rs-switcher-border-radius:
|
|
134
|
+
--_rs-switcher-border-radius:26px;
|
|
135
|
+
--_rs-switcher-compact-border-radius:12px;
|
|
129
136
|
--_rs-switcher-option-padding:12px 32px;
|
|
137
|
+
--_rs-switcher-compact-option-padding:12px 16px;
|
|
130
138
|
}
|
|
131
139
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
132
140
|
--_rs-typography-letter-spacing:normal;
|
package/lib/public-api.pcss
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@define-mixin rs-switcher-size-xs{
|
|
2
2
|
&:not(html){
|
|
3
3
|
--_rs-switcher-border-radius:4px;
|
|
4
|
+
--_rs-switcher-compact-border-radius:var(--_rs-switcher-border-radius);
|
|
4
5
|
--_rs-switcher-option-padding:2px 12px;
|
|
6
|
+
--_rs-switcher-compact-option-padding:2px 8px;
|
|
5
7
|
}
|
|
6
8
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
7
9
|
--_rs-typography-letter-spacing:0.0045em;
|
|
@@ -40,8 +42,10 @@
|
|
|
40
42
|
}
|
|
41
43
|
@define-mixin rs-switcher-size-s{
|
|
42
44
|
&:not(html){
|
|
43
|
-
--_rs-switcher-border-radius:
|
|
45
|
+
--_rs-switcher-border-radius:16px;
|
|
46
|
+
--_rs-switcher-compact-border-radius:4px;
|
|
44
47
|
--_rs-switcher-option-padding:6px 16px;
|
|
48
|
+
--_rs-switcher-compact-option-padding:6px 8px;
|
|
45
49
|
}
|
|
46
50
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
47
51
|
--_rs-typography-letter-spacing:0.0045em;
|
|
@@ -80,8 +84,10 @@
|
|
|
80
84
|
}
|
|
81
85
|
@define-mixin rs-switcher-size-m{
|
|
82
86
|
&:not(html){
|
|
83
|
-
--_rs-switcher-border-radius:
|
|
87
|
+
--_rs-switcher-border-radius:20px;
|
|
88
|
+
--_rs-switcher-compact-border-radius:8px;
|
|
84
89
|
--_rs-switcher-option-padding:8px 24px;
|
|
90
|
+
--_rs-switcher-compact-option-padding:8px 12px;
|
|
85
91
|
}
|
|
86
92
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
87
93
|
--_rs-typography-letter-spacing:0.0015em;
|
|
@@ -125,8 +131,10 @@
|
|
|
125
131
|
}
|
|
126
132
|
@define-mixin rs-switcher-size-l{
|
|
127
133
|
&:not(html){
|
|
128
|
-
--_rs-switcher-border-radius:
|
|
134
|
+
--_rs-switcher-border-radius:26px;
|
|
135
|
+
--_rs-switcher-compact-border-radius:12px;
|
|
129
136
|
--_rs-switcher-option-padding:12px 32px;
|
|
137
|
+
--_rs-switcher-compact-option-padding:12px 16px;
|
|
130
138
|
}
|
|
131
139
|
&:not(html) [data-rs-internal='switcher__option']{
|
|
132
140
|
--_rs-typography-letter-spacing:normal;
|
package/lib/switcher.d.ts
CHANGED
|
@@ -18,10 +18,12 @@ export interface SwitcherProps<ValueType, OptionsValueType extends ValueType> {
|
|
|
18
18
|
/** Appearance mode */
|
|
19
19
|
mode?: SwitcherMode;
|
|
20
20
|
disabled?: boolean;
|
|
21
|
+
/** Decrease horizontal paddings, gap and border-radius values */
|
|
22
|
+
compact?: boolean;
|
|
21
23
|
/** Identifier for e2e tests */
|
|
22
24
|
'data-e2e'?: string;
|
|
23
25
|
}
|
|
24
|
-
export declare function Switcher<ValueType, OptionsValueType extends ValueType = ValueType>({ className, theme: themeFromProps, size, disabled, ['data-e2e']: e2eId, options, value: switcherValue, mode, onChange }: SwitcherProps<ValueType, OptionsValueType>): JSX.Element;
|
|
26
|
+
export declare function Switcher<ValueType, OptionsValueType extends ValueType = ValueType>({ className, theme: themeFromProps, size, disabled, compact, ['data-e2e']: e2eId, options, value: switcherValue, mode, onChange }: SwitcherProps<ValueType, OptionsValueType>): JSX.Element;
|
|
25
27
|
export declare namespace Switcher {
|
|
26
28
|
var propTypes: {};
|
|
27
29
|
}
|
package/lib/switcher.js
CHANGED
|
@@ -65,6 +65,8 @@ function Switcher(_ref2) {
|
|
|
65
65
|
_ref2$size = _ref2.size,
|
|
66
66
|
size = _ref2$size === void 0 ? 'm' : _ref2$size,
|
|
67
67
|
disabled = _ref2.disabled,
|
|
68
|
+
_ref2$compact = _ref2.compact,
|
|
69
|
+
compact = _ref2$compact === void 0 ? false : _ref2$compact,
|
|
68
70
|
e2eId = _ref2['data-e2e'],
|
|
69
71
|
options = _ref2.options,
|
|
70
72
|
switcherValue = _ref2.value,
|
|
@@ -122,7 +124,7 @@ function Switcher(_ref2) {
|
|
|
122
124
|
}, [activeIndex]);
|
|
123
125
|
useResizeObserver(containerRef, onResize);
|
|
124
126
|
return /*#__PURE__*/React.createElement("span", {
|
|
125
|
-
className: cn(className, styles.switcher, sizeToClass[size], themeToClass[theme], modeToClass[mode], disabled && styles.disabled),
|
|
127
|
+
className: cn(className, styles.switcher, sizeToClass[size], themeToClass[theme], modeToClass[mode], disabled && styles.disabled, compact && styles.compact),
|
|
126
128
|
"data-e2e": e2eId,
|
|
127
129
|
ref: containerRef,
|
|
128
130
|
"data-rs-internal": 'switcher',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/switcher",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"core-js": "^3.9.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@rescui/ui-contexts": "^0.
|
|
24
|
+
"@rescui/ui-contexts": "^0.5.0",
|
|
25
25
|
"prop-types": "^15.7.2",
|
|
26
26
|
"react": ">=16.8.0 <19"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@rescui/colors": "^0.2.0",
|
|
30
30
|
"@rescui/scripts": "^0.3.0",
|
|
31
|
-
"@rescui/typography": "^0.16.
|
|
31
|
+
"@rescui/typography": "^0.16.1"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rescui-scripts build && yarn run build-pcss-api",
|
|
35
35
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "73268bf009792a4c5565b66806ed063c0c503ba2"
|
|
38
38
|
}
|