@rescui/toggle 0.3.8 → 0.3.10
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 +28 -51
- package/lib/toggle-control.js +24 -41
- package/lib/toggle.js +21 -38
- package/lib/toggle.p.module.css.js +10 -10
- package/package.json +7 -8
package/lib/index.css
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
.
|
|
1
|
+
._themeLight_1uykhoc_6{
|
|
2
2
|
--rs-theme-dark:0;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
._themeDark_1uykhoc_9{
|
|
5
5
|
--rs-theme-dark:1;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._sizeS_1uykhoc_13{
|
|
8
8
|
--_rs-toggle-width:20px;
|
|
9
9
|
--_rs-toggle-height:12px;
|
|
10
10
|
--_rs-toggle-shadow:3px;
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
._sizeM_1uykhoc_16{
|
|
13
13
|
--_rs-toggle-width:28px;
|
|
14
14
|
--_rs-toggle-height:16px;
|
|
15
15
|
--_rs-toggle-shadow:3px;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
._sizeL_1uykhoc_19{
|
|
18
18
|
--_rs-toggle-width:32px;
|
|
19
19
|
--_rs-toggle-height:18px;
|
|
20
20
|
--_rs-toggle-shadow:4px;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
._classic_1uykhoc_23{
|
|
23
23
|
--_rs-toggle-hover-slider-box-shadow-color:var(--_rs-color-primary-t-fog);
|
|
24
24
|
--_rs-toggle-checked-slider-background-color:var(--_rs-color-primary);
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
._rock_1uykhoc_26{
|
|
27
27
|
--_rs-toggle-hover-slider-box-shadow-color:rgba(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), 0.2);
|
|
28
28
|
--_rs-toggle-checked-slider-background-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));
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
._main_1uykhoc_30{
|
|
31
31
|
--_rs-toggle-circle-border:2px;
|
|
32
32
|
|
|
33
33
|
--_rs-theme-dark:var(
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
43
43
|
}
|
|
44
44
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
45
|
-
.
|
|
45
|
+
._main_1uykhoc_30{
|
|
46
46
|
--_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)));
|
|
47
47
|
--_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)));
|
|
48
48
|
--_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)));
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
54
|
-
.
|
|
54
|
+
._main_1uykhoc_30{
|
|
55
55
|
--_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);
|
|
56
56
|
--_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));
|
|
57
57
|
--_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));
|
|
@@ -59,24 +59,19 @@
|
|
|
59
59
|
--_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));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
.
|
|
62
|
+
._main_1uykhoc_30 {
|
|
63
63
|
|
|
64
64
|
position:relative;
|
|
65
65
|
|
|
66
|
-
display:-webkit-inline-box;
|
|
67
|
-
|
|
68
|
-
display:-ms-inline-flexbox;
|
|
69
|
-
|
|
70
66
|
display:inline-flex;
|
|
71
|
-
-
|
|
72
|
-
align-self:center;
|
|
67
|
+
align-self:center;
|
|
73
68
|
|
|
74
69
|
width:calc(var(--_rs-toggle-width) + var(--_rs-toggle-shadow)*2);
|
|
75
70
|
height:calc(var(--_rs-toggle-height) + var(--_rs-toggle-shadow)*2);
|
|
76
71
|
|
|
77
72
|
cursor:pointer;
|
|
78
73
|
}
|
|
79
|
-
.
|
|
74
|
+
._main_1uykhoc_30 input{
|
|
80
75
|
position:absolute;
|
|
81
76
|
z-index:-1;
|
|
82
77
|
|
|
@@ -86,11 +81,11 @@
|
|
|
86
81
|
|
|
87
82
|
pointer-events:none;
|
|
88
83
|
}
|
|
89
|
-
.
|
|
84
|
+
._main_1uykhoc_30._disabled_1uykhoc_57{
|
|
90
85
|
cursor:default;
|
|
91
86
|
pointer-events:none;
|
|
92
87
|
}
|
|
93
|
-
.
|
|
88
|
+
._slider_1uykhoc_63{
|
|
94
89
|
position:absolute;
|
|
95
90
|
top:var(--_rs-toggle-shadow);
|
|
96
91
|
left:var(--_rs-toggle-shadow);
|
|
@@ -102,18 +97,14 @@
|
|
|
102
97
|
|
|
103
98
|
background-color:#8C8C8E;
|
|
104
99
|
|
|
105
|
-
-webkit-transition:background-color 200ms;
|
|
106
|
-
|
|
107
100
|
transition:background-color 200ms;
|
|
108
101
|
}
|
|
109
|
-
.
|
|
102
|
+
._slider_1uykhoc_63:after{
|
|
110
103
|
position:absolute;
|
|
111
104
|
top:0;
|
|
112
105
|
left:0;
|
|
113
106
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
box-sizing:border-box;
|
|
107
|
+
box-sizing:border-box;
|
|
117
108
|
width:var(--_rs-toggle-height);
|
|
118
109
|
height:var(--_rs-toggle-height);
|
|
119
110
|
|
|
@@ -124,49 +115,35 @@
|
|
|
124
115
|
|
|
125
116
|
background-color:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*227));
|
|
126
117
|
|
|
127
|
-
-webkit-transition:height 200ms, width 200ms, border-color 200ms, -webkit-transform 200ms;
|
|
128
|
-
|
|
129
|
-
transition:height 200ms, width 200ms, border-color 200ms, -webkit-transform 200ms;
|
|
130
|
-
|
|
131
118
|
transition:transform 200ms, height 200ms, width 200ms, border-color 200ms;
|
|
132
|
-
|
|
133
|
-
transition:transform 200ms, height 200ms, width 200ms, border-color 200ms, -webkit-transform 200ms;
|
|
134
|
-
-webkit-transform:translate(0);
|
|
135
|
-
transform:translate(0);
|
|
119
|
+
transform:translate(0);
|
|
136
120
|
}
|
|
137
|
-
.
|
|
121
|
+
._disabled_1uykhoc_57 ._slider_1uykhoc_63{
|
|
138
122
|
background:rgb(calc(209 - var(--_rs-theme-dark-coefficient, 0)*138), calc(209 - var(--_rs-theme-dark-coefficient, 0)*138), calc(210 - var(--_rs-theme-dark-coefficient, 0)*137));
|
|
139
123
|
}
|
|
140
|
-
.
|
|
124
|
+
._disabled_1uykhoc_57 ._slider_1uykhoc_63:after{
|
|
141
125
|
border-color:rgb(calc(209 - var(--_rs-theme-dark-coefficient, 0)*138), calc(209 - var(--_rs-theme-dark-coefficient, 0)*138), calc(210 - var(--_rs-theme-dark-coefficient, 0)*137));
|
|
142
126
|
|
|
143
127
|
background:rgb(calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*181));
|
|
144
128
|
}
|
|
145
|
-
input:checked + .
|
|
129
|
+
input:checked + ._slider_1uykhoc_63:after{
|
|
146
130
|
width:calc(var(--_rs-toggle-height) + var(--_rs-toggle-circle-border));
|
|
147
131
|
height:calc(var(--_rs-toggle-height) + var(--_rs-toggle-circle-border));
|
|
148
132
|
|
|
149
|
-
|
|
150
|
-
calc(var(--_rs-toggle-width) - var(--_rs-toggle-height) - var(--_rs-toggle-circle-border)/2),
|
|
151
|
-
calc(var(--_rs-toggle-circle-border)/-2)
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
transform:translate(
|
|
133
|
+
transform:translate(
|
|
155
134
|
calc(var(--_rs-toggle-width) - var(--_rs-toggle-height) - var(--_rs-toggle-circle-border)/2),
|
|
156
135
|
calc(var(--_rs-toggle-circle-border)/-2)
|
|
157
136
|
);
|
|
158
137
|
}
|
|
159
|
-
.
|
|
160
|
-
|
|
161
|
-
box-shadow:var(--_rs-toggle-hover-slider-box-shadow-color) 0 0 0 var(--_rs-toggle-shadow);
|
|
138
|
+
._main_1uykhoc_30:not(._disabled_1uykhoc_57) input:hover + ._slider_1uykhoc_63{
|
|
139
|
+
box-shadow:var(--_rs-toggle-hover-slider-box-shadow-color) 0 0 0 var(--_rs-toggle-shadow);
|
|
162
140
|
}
|
|
163
|
-
.
|
|
141
|
+
._main_1uykhoc_30:not(._disabled_1uykhoc_57) input:checked + ._slider_1uykhoc_63{
|
|
164
142
|
background-color:var(--_rs-toggle-checked-slider-background-color);
|
|
165
143
|
}
|
|
166
|
-
.
|
|
144
|
+
._main_1uykhoc_30:not(._disabled_1uykhoc_57) input:checked + ._slider_1uykhoc_63:after{
|
|
167
145
|
border-color:var(--_rs-toggle-checked-slider-background-color);
|
|
168
146
|
}
|
|
169
|
-
.
|
|
170
|
-
|
|
171
|
-
box-shadow:0 0 0 var(--_rs-toggle-shadow) var(--_rs-color-primary-t-dim);
|
|
147
|
+
._main_1uykhoc_30:not(._disabled_1uykhoc_57) input:focus[data-focus-method='key'] + ._slider_1uykhoc_63{
|
|
148
|
+
box-shadow:0 0 0 var(--_rs-toggle-shadow) var(--_rs-color-primary-t-dim);
|
|
172
149
|
}
|
package/lib/toggle-control.js
CHANGED
|
@@ -1,60 +1,42 @@
|
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
|
2
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
3
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
5
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
6
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
7
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
8
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
9
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["className", "value", "defaultChecked", "checked", "onChange", "size", "mode", "disabled", "theme", "notUseLabelTag", "tabIndex"];
|
|
11
|
-
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
1
|
import React from 'react';
|
|
17
2
|
import PropTypes from 'prop-types';
|
|
18
3
|
import cn from 'classnames';
|
|
19
4
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
20
5
|
import styles from './toggle.p.module.css.js';
|
|
21
|
-
|
|
6
|
+
const SIZE_STYLES = {
|
|
22
7
|
s: styles.sizeS,
|
|
23
8
|
m: styles.sizeM,
|
|
24
9
|
l: styles.sizeL
|
|
25
10
|
};
|
|
26
|
-
|
|
11
|
+
const MODE_STYLES = {
|
|
27
12
|
classic: styles.classic,
|
|
28
13
|
rock: styles.rock
|
|
29
14
|
};
|
|
30
|
-
|
|
15
|
+
const THEME_STYLES = {
|
|
31
16
|
light: styles.themeLight,
|
|
32
17
|
dark: styles.themeDark
|
|
33
18
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var theme = useThemeWithUndefined(themeFromProps);
|
|
53
|
-
var RootTag = notUseLabelTag ? 'span' : 'label';
|
|
19
|
+
const ToggleControl = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
20
|
+
let {
|
|
21
|
+
className,
|
|
22
|
+
value,
|
|
23
|
+
defaultChecked,
|
|
24
|
+
checked,
|
|
25
|
+
onChange,
|
|
26
|
+
size = 'm',
|
|
27
|
+
mode = 'classic',
|
|
28
|
+
disabled = false,
|
|
29
|
+
theme: themeFromProps,
|
|
30
|
+
notUseLabelTag,
|
|
31
|
+
tabIndex = 0,
|
|
32
|
+
...restProps
|
|
33
|
+
} = _ref;
|
|
34
|
+
const theme = useThemeWithUndefined(themeFromProps);
|
|
35
|
+
const RootTag = notUseLabelTag ? 'span' : 'label';
|
|
54
36
|
return /*#__PURE__*/React.createElement(RootTag, {
|
|
55
37
|
className: cn(className, styles.main, SIZE_STYLES[size], MODE_STYLES[mode], THEME_STYLES[theme], disabled && styles.disabled),
|
|
56
38
|
"data-rs-internal": 'toggle'
|
|
57
|
-
}, /*#__PURE__*/React.createElement("input",
|
|
39
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
58
40
|
type: "checkbox",
|
|
59
41
|
"data-test": "toggle__input",
|
|
60
42
|
ref: ref,
|
|
@@ -63,8 +45,9 @@ var ToggleControl = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
63
45
|
value: value,
|
|
64
46
|
disabled: disabled,
|
|
65
47
|
checked: checked,
|
|
66
|
-
tabIndex: disabled ? -1 : tabIndex
|
|
67
|
-
|
|
48
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
49
|
+
...restProps
|
|
50
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
68
51
|
className: styles.slider
|
|
69
52
|
}));
|
|
70
53
|
});
|
package/lib/toggle.js
CHANGED
|
@@ -1,44 +1,26 @@
|
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
|
2
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
3
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
5
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
6
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
7
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
8
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
9
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["className", "checked", "defaultChecked", "onChange", "size", "mode", "disabled", "theme", "value", "children", "labelPlacement"];
|
|
11
|
-
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
1
|
import React from 'react';
|
|
17
2
|
import PropTypes from 'prop-types';
|
|
18
3
|
import cn from 'classnames';
|
|
19
4
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
20
5
|
import { MenuItem } from '@rescui/menu';
|
|
21
6
|
import { ToggleControl } from './toggle-control.js';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var theme = useThemeWithUndefined(themeFromProps);
|
|
41
|
-
var iconPlacement = labelPlacement === 'right' ? 'left' : 'right';
|
|
7
|
+
const Toggle = /*#__PURE__*/React.forwardRef(function Toggle(_ref, ref) {
|
|
8
|
+
let {
|
|
9
|
+
className,
|
|
10
|
+
checked,
|
|
11
|
+
defaultChecked,
|
|
12
|
+
onChange,
|
|
13
|
+
size = 'm',
|
|
14
|
+
mode = 'classic',
|
|
15
|
+
disabled = false,
|
|
16
|
+
theme: themeFromProps,
|
|
17
|
+
value,
|
|
18
|
+
children,
|
|
19
|
+
labelPlacement = 'right',
|
|
20
|
+
...restProps
|
|
21
|
+
} = _ref;
|
|
22
|
+
const theme = useThemeWithUndefined(themeFromProps);
|
|
23
|
+
const iconPlacement = labelPlacement === 'right' ? 'left' : 'right';
|
|
42
24
|
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
43
25
|
className: cn(className),
|
|
44
26
|
tag: 'label',
|
|
@@ -47,7 +29,7 @@ var Toggle = /*#__PURE__*/React.forwardRef(function Toggle(_ref, ref) {
|
|
|
47
29
|
theme: theme,
|
|
48
30
|
disabled: disabled,
|
|
49
31
|
tabIndex: null,
|
|
50
|
-
icon: /*#__PURE__*/React.createElement(ToggleControl,
|
|
32
|
+
icon: /*#__PURE__*/React.createElement(ToggleControl, {
|
|
51
33
|
value: value,
|
|
52
34
|
checked: checked,
|
|
53
35
|
defaultChecked: defaultChecked,
|
|
@@ -57,8 +39,9 @@ var Toggle = /*#__PURE__*/React.forwardRef(function Toggle(_ref, ref) {
|
|
|
57
39
|
mode: mode,
|
|
58
40
|
disabled: disabled,
|
|
59
41
|
ref: ref,
|
|
60
|
-
notUseLabelTag: true
|
|
61
|
-
|
|
42
|
+
notUseLabelTag: true,
|
|
43
|
+
...restProps
|
|
44
|
+
}),
|
|
62
45
|
iconPlacement: iconPlacement,
|
|
63
46
|
"data-test": 'toggle'
|
|
64
47
|
}, children);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"sizeS": "
|
|
5
|
-
"sizeM": "
|
|
6
|
-
"sizeL": "
|
|
7
|
-
"classic": "
|
|
8
|
-
"rock": "
|
|
9
|
-
"main": "
|
|
10
|
-
"disabled": "
|
|
11
|
-
"slider": "
|
|
2
|
+
"themeLight": "_themeLight_1uykhoc_6",
|
|
3
|
+
"themeDark": "_themeDark_1uykhoc_9",
|
|
4
|
+
"sizeS": "_sizeS_1uykhoc_13",
|
|
5
|
+
"sizeM": "_sizeM_1uykhoc_16",
|
|
6
|
+
"sizeL": "_sizeL_1uykhoc_19",
|
|
7
|
+
"classic": "_classic_1uykhoc_23",
|
|
8
|
+
"rock": "_rock_1uykhoc_26",
|
|
9
|
+
"main": "_main_1uykhoc_30",
|
|
10
|
+
"disabled": "_disabled_1uykhoc_57",
|
|
11
|
+
"slider": "_slider_1uykhoc_63"
|
|
12
12
|
};
|
|
13
13
|
export { styles as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/toggle",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "Toggle is a control that allows you to turn elements on and off instantly",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime-corejs3": "^7.
|
|
18
|
-
"@rescui/menu": "^0.10.
|
|
19
|
-
"classnames": "^2.2.6"
|
|
20
|
-
"core-js": "^3.9.1"
|
|
17
|
+
"@babel/runtime-corejs3": "^7.26.0",
|
|
18
|
+
"@rescui/menu": "^0.10.10",
|
|
19
|
+
"classnames": "^2.2.6"
|
|
21
20
|
},
|
|
22
21
|
"peerDependencies": {
|
|
23
22
|
"@rescui/ui-contexts": "^0.5.0",
|
|
@@ -25,8 +24,8 @@
|
|
|
25
24
|
"react": ">=16.8.0 <19"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@rescui/colors": "^0.2.
|
|
29
|
-
"@rescui/scripts": "^0.3.
|
|
27
|
+
"@rescui/colors": "^0.2.6",
|
|
28
|
+
"@rescui/scripts": "^0.3.5",
|
|
30
29
|
"@rescui/visual-regression": "^0.1.2",
|
|
31
30
|
"@types/classnames": "^2.2.11"
|
|
32
31
|
},
|
|
@@ -35,5 +34,5 @@
|
|
|
35
34
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
36
35
|
},
|
|
37
36
|
"nx": {},
|
|
38
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "67627f69be3de4b4c6a21244fd7de36e841f01f0"
|
|
39
38
|
}
|