@itcase/ui 1.8.85 → 1.8.87
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/dist/{DatePicker_cjs_BVN24HUp.js → DatePicker_cjs_BFT9fj8A.js} +1 -1
- package/dist/{DatePicker_es_tuBcfK5V.js → DatePicker_es_C1ykgFhq.js} +1 -1
- package/dist/{Input_cjs_DSpBwtPv.js → Input_cjs_CFy0tfAO.js} +8 -2
- package/dist/{Input_es_3C_YhQFo.js → Input_es_l3ry6luZ.js} +8 -2
- package/dist/cjs/components/Checkbox.js +27 -19
- package/dist/cjs/components/Dadata.js +1 -1
- package/dist/cjs/components/DatePeriod.js +2 -2
- package/dist/cjs/components/DatePicker.js +2 -2
- package/dist/cjs/components/Input.js +1 -1
- package/dist/cjs/components/Switch.js +11 -11
- package/dist/components/Checkbox.js +27 -19
- package/dist/components/Dadata.js +1 -1
- package/dist/components/DatePeriod.js +2 -2
- package/dist/components/DatePicker.js +2 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/Switch.js +11 -11
- package/dist/css/components/Code/Code.css +2 -1
- package/dist/css/components/Switch/Switch.css +16 -27
- package/dist/types/components/Checkbox/appearance/checkboxRequire.d.ts +11 -7
- package/dist/types/components/Checkbox/appearance/checkboxSuccess.d.ts +11 -7
- package/dist/types/components/Input/appearance/inputError.d.ts +2 -0
- package/dist/types/components/Input/appearance/inputRequire.d.ts +2 -0
- package/dist/types/components/Input/appearance/inputSuccess.d.ts +2 -0
- package/dist/types/components/Switch/appearance/switchStyle.d.ts +5 -5
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDe
|
|
|
11
11
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
12
12
|
var Button = require('./Button_cjs_BG6t5BXg.js');
|
|
13
13
|
var Icon = require('./Icon_cjs_DP41Z8bS.js');
|
|
14
|
-
var Input = require('./
|
|
14
|
+
var Input = require('./Input_cjs_CFy0tfAO.js');
|
|
15
15
|
var Label = require('./Label_cjs_LEuuFaN-.js');
|
|
16
16
|
var Text = require('./Text_cjs_B8nNXWBA.js');
|
|
17
17
|
var _default = require('@itcase/icons/default');
|
|
@@ -9,7 +9,7 @@ import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevi
|
|
|
9
9
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
10
10
|
import { B as Button } from './Button_es_CAxHI9Qd.js';
|
|
11
11
|
import { I as Icon } from './Icon_es_-iRj1sFG.js';
|
|
12
|
-
import { I as Input } from './
|
|
12
|
+
import { I as Input } from './Input_es_l3ry6luZ.js';
|
|
13
13
|
import { L as Label } from './Label_es_Bfi00e0G.js';
|
|
14
14
|
import { T as Text } from './Text_es_BvmOR4nv.js';
|
|
15
15
|
import { icons14 } from '@itcase/icons/default';
|
|
@@ -14,7 +14,7 @@ var inputAppearanceDefault = {
|
|
|
14
14
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
15
15
|
textColor: 'surfaceTextPrimary',
|
|
16
16
|
textColorDisabled: 'surfaceTextDisabled',
|
|
17
|
-
caret: '
|
|
17
|
+
caret: 'accentItemSecondary',
|
|
18
18
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
19
19
|
iconClearFill: 'surfaceItemPrimary',
|
|
20
20
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -25,7 +25,7 @@ var inputAppearanceDefault = {
|
|
|
25
25
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
26
26
|
textColor: 'surfaceTextPrimary',
|
|
27
27
|
textColorDisabled: 'surfaceTextDisabled',
|
|
28
|
-
caret: '
|
|
28
|
+
caret: 'accentItemSecondary',
|
|
29
29
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
30
30
|
iconClearFill: 'surfaceItemPrimary',
|
|
31
31
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -58,6 +58,7 @@ var inputAppearanceError = {
|
|
|
58
58
|
borderColor: 'errorBorderQuaternary',
|
|
59
59
|
borderColorHover: 'errorBorderQuaternary',
|
|
60
60
|
textColor: 'surfaceTextPrimary',
|
|
61
|
+
caret: 'accentItemSecondary',
|
|
61
62
|
iconBeforeFill: 'errorItemQuaternary',
|
|
62
63
|
iconClearFill: 'errorItemPrimary',
|
|
63
64
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -66,6 +67,7 @@ var inputAppearanceError = {
|
|
|
66
67
|
fill: 'errorSecondary',
|
|
67
68
|
borderColor: 'errorBorderTertiary',
|
|
68
69
|
borderColorHover: 'errorBorderQuaternary',
|
|
70
|
+
caret: 'accentItemSecondary',
|
|
69
71
|
iconBeforeFill: 'errorItemQuaternary',
|
|
70
72
|
iconClearFill: 'errorItemPrimary',
|
|
71
73
|
placeholderTextColor: 'errorTextSecondary',
|
|
@@ -78,6 +80,7 @@ var inputAppearanceRequire = {
|
|
|
78
80
|
borderColor: 'warningBorderQuaternary',
|
|
79
81
|
borderColorHover: 'warningBorderQuaternary',
|
|
80
82
|
textColor: 'surfaceTextPrimary',
|
|
83
|
+
caret: 'accentItemSecondary',
|
|
81
84
|
iconBeforeFill: 'warningItemQuaternary',
|
|
82
85
|
iconClearFill: 'warningItemPrimary',
|
|
83
86
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -86,6 +89,7 @@ var inputAppearanceRequire = {
|
|
|
86
89
|
fill: 'surfaceSecondary',
|
|
87
90
|
borderColor: 'surfaceBorderTertiary',
|
|
88
91
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
92
|
+
caret: 'accentItemSecondary',
|
|
89
93
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
90
94
|
iconClearFill: 'surfaceItemPrimary',
|
|
91
95
|
placeholderTextColor: 'surfaceTextSecondary',
|
|
@@ -169,6 +173,7 @@ var inputAppearanceSuccess = {
|
|
|
169
173
|
borderColor: 'successBorderQuaternary',
|
|
170
174
|
borderColorHover: 'successBorderQuaternary',
|
|
171
175
|
textColor: 'surfaceTextPrimary',
|
|
176
|
+
caret: 'accentItemSecondary',
|
|
172
177
|
iconBeforeFill: 'successItemQuaternary',
|
|
173
178
|
iconClearFill: 'successItemPrimary',
|
|
174
179
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -177,6 +182,7 @@ var inputAppearanceSuccess = {
|
|
|
177
182
|
fill: 'surfaceSecondary',
|
|
178
183
|
borderColor: 'surfaceBorderTertiary',
|
|
179
184
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
185
|
+
caret: 'accentItemSecondary',
|
|
180
186
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
181
187
|
iconClearFill: 'surfaceItemPrimary',
|
|
182
188
|
placeholderTextColor: 'surfaceTextSecondary',
|
|
@@ -12,7 +12,7 @@ var inputAppearanceDefault = {
|
|
|
12
12
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
13
13
|
textColor: 'surfaceTextPrimary',
|
|
14
14
|
textColorDisabled: 'surfaceTextDisabled',
|
|
15
|
-
caret: '
|
|
15
|
+
caret: 'accentItemSecondary',
|
|
16
16
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
17
17
|
iconClearFill: 'surfaceItemPrimary',
|
|
18
18
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -23,7 +23,7 @@ var inputAppearanceDefault = {
|
|
|
23
23
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
24
24
|
textColor: 'surfaceTextPrimary',
|
|
25
25
|
textColorDisabled: 'surfaceTextDisabled',
|
|
26
|
-
caret: '
|
|
26
|
+
caret: 'accentItemSecondary',
|
|
27
27
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
28
28
|
iconClearFill: 'surfaceItemPrimary',
|
|
29
29
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -56,6 +56,7 @@ var inputAppearanceError = {
|
|
|
56
56
|
borderColor: 'errorBorderQuaternary',
|
|
57
57
|
borderColorHover: 'errorBorderQuaternary',
|
|
58
58
|
textColor: 'surfaceTextPrimary',
|
|
59
|
+
caret: 'accentItemSecondary',
|
|
59
60
|
iconBeforeFill: 'errorItemQuaternary',
|
|
60
61
|
iconClearFill: 'errorItemPrimary',
|
|
61
62
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -64,6 +65,7 @@ var inputAppearanceError = {
|
|
|
64
65
|
fill: 'errorSecondary',
|
|
65
66
|
borderColor: 'errorBorderTertiary',
|
|
66
67
|
borderColorHover: 'errorBorderQuaternary',
|
|
68
|
+
caret: 'accentItemSecondary',
|
|
67
69
|
iconBeforeFill: 'errorItemQuaternary',
|
|
68
70
|
iconClearFill: 'errorItemPrimary',
|
|
69
71
|
placeholderTextColor: 'errorTextSecondary',
|
|
@@ -76,6 +78,7 @@ var inputAppearanceRequire = {
|
|
|
76
78
|
borderColor: 'warningBorderQuaternary',
|
|
77
79
|
borderColorHover: 'warningBorderQuaternary',
|
|
78
80
|
textColor: 'surfaceTextPrimary',
|
|
81
|
+
caret: 'accentItemSecondary',
|
|
79
82
|
iconBeforeFill: 'warningItemQuaternary',
|
|
80
83
|
iconClearFill: 'warningItemPrimary',
|
|
81
84
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -84,6 +87,7 @@ var inputAppearanceRequire = {
|
|
|
84
87
|
fill: 'surfaceSecondary',
|
|
85
88
|
borderColor: 'surfaceBorderTertiary',
|
|
86
89
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
90
|
+
caret: 'accentItemSecondary',
|
|
87
91
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
88
92
|
iconClearFill: 'surfaceItemPrimary',
|
|
89
93
|
placeholderTextColor: 'surfaceTextSecondary',
|
|
@@ -167,6 +171,7 @@ var inputAppearanceSuccess = {
|
|
|
167
171
|
borderColor: 'successBorderQuaternary',
|
|
168
172
|
borderColorHover: 'successBorderQuaternary',
|
|
169
173
|
textColor: 'surfaceTextPrimary',
|
|
174
|
+
caret: 'accentItemSecondary',
|
|
170
175
|
iconBeforeFill: 'successItemQuaternary',
|
|
171
176
|
iconClearFill: 'successItemPrimary',
|
|
172
177
|
placeholderTextColor: 'surfaceTextQuaternary',
|
|
@@ -175,6 +180,7 @@ var inputAppearanceSuccess = {
|
|
|
175
180
|
fill: 'surfaceSecondary',
|
|
176
181
|
borderColor: 'surfaceBorderTertiary',
|
|
177
182
|
borderColorHover: 'surfaceBorderQuaternary',
|
|
183
|
+
caret: 'accentItemSecondary',
|
|
178
184
|
iconBeforeFill: 'surfaceItemQuaternary',
|
|
179
185
|
iconClearFill: 'surfaceItemPrimary',
|
|
180
186
|
placeholderTextColor: 'surfaceTextSecondary',
|
|
@@ -84,13 +84,17 @@ var checkboxAppearanceError = {
|
|
|
84
84
|
|
|
85
85
|
var checkboxAppearanceRequire = {
|
|
86
86
|
requirePrimary: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
fillCheckbox: 'warningPrimary',
|
|
88
|
+
fillCheckboxActive: 'warningPrimary',
|
|
89
|
+
fillCheckboxActiveHover: 'warningTertiary',
|
|
90
|
+
fillCheckboxHover: 'warningTertiary',
|
|
91
|
+
fillCheckmark: 'warningBorderPrimary',
|
|
92
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
93
|
+
descTextColor: 'surfaceTextPrimary',
|
|
94
|
+
borderColorCheckbox: 'warningBorderPrimary',
|
|
95
|
+
borderColorCheckboxActive: 'warningBorderPrimary',
|
|
96
|
+
borderColorCheckboxActiveHover: 'warningBorderPrimary',
|
|
97
|
+
borderColorCheckboxHover: 'warningBorderPrimary',
|
|
94
98
|
},
|
|
95
99
|
requireSecondary: {
|
|
96
100
|
fill: 'surfaceSecondary',
|
|
@@ -138,21 +142,25 @@ var checkboxAppearanceStyle = {
|
|
|
138
142
|
|
|
139
143
|
var checkboxAppearanceSuccess = {
|
|
140
144
|
successPrimary: {
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
fillCheckbox: 'successPrimary',
|
|
146
|
+
fillCheckboxActive: 'successPrimary',
|
|
147
|
+
fillCheckboxActiveHover: 'successTertiary',
|
|
148
|
+
fillCheckboxHover: 'successTertiary',
|
|
149
|
+
fillCheckmark: 'successBorderPrimary',
|
|
150
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
151
|
+
descTextColor: 'surfaceTextPrimary',
|
|
152
|
+
borderColorCheckbox: 'successBorderPrimary',
|
|
153
|
+
borderColorCheckboxActive: 'successBorderPrimary',
|
|
154
|
+
borderColorCheckboxActiveHover: 'successBorderPrimary',
|
|
155
|
+
borderColorCheckboxHover: 'successBorderPrimary',
|
|
156
|
+
},
|
|
157
|
+
successSecondary: {
|
|
158
|
+
fill: 'successSecondary',
|
|
159
|
+
borderColor: 'successBorderTertiary',
|
|
143
160
|
borderHover: 'successBorderQuaternary',
|
|
144
|
-
textColor: 'surfaceTextPrimary',
|
|
145
161
|
iconBeforeFill: 'successItemQuaternary',
|
|
146
162
|
iconClearFill: 'successItemPrimary',
|
|
147
|
-
placeholderTextColor: '
|
|
148
|
-
},
|
|
149
|
-
successSecondary: {
|
|
150
|
-
fill: 'surfaceSecondary',
|
|
151
|
-
borderColor: 'surfaceBorderTertiary',
|
|
152
|
-
borderHover: 'surfaceBorderQuaternary',
|
|
153
|
-
iconBeforeFill: 'surfaceItemQuaternary',
|
|
154
|
-
iconClearFill: 'surfaceItemPrimary',
|
|
155
|
-
placeholderTextColor: 'surfaceTextSecondary',
|
|
163
|
+
placeholderTextColor: 'successTextSecondary',
|
|
156
164
|
},
|
|
157
165
|
};
|
|
158
166
|
|
|
@@ -5,7 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var reactDadata = require('react-dadata');
|
|
8
|
-
var Input = require('../../
|
|
8
|
+
var Input = require('../../Input_cjs_CFy0tfAO.js');
|
|
9
9
|
require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
10
10
|
require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
11
11
|
require('lodash/camelCase');
|
|
@@ -4,7 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var common = require('@itcase/common');
|
|
7
|
-
var DatePicker = require('../../
|
|
7
|
+
var DatePicker = require('../../DatePicker_cjs_BFT9fj8A.js');
|
|
8
8
|
var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
9
9
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
10
10
|
var ChipsGroup = require('../../ChipsGroup_cjs_DlU08Wik.js');
|
|
@@ -30,7 +30,7 @@ require('../context/UrlAssetPrefix.js');
|
|
|
30
30
|
require('../../Link_cjs_BqT6eVl6.js');
|
|
31
31
|
require('../../Text_cjs_B8nNXWBA.js');
|
|
32
32
|
require('../../Loader_cjs_DlnM5Vzb.js');
|
|
33
|
-
require('../../
|
|
33
|
+
require('../../Input_cjs_CFy0tfAO.js');
|
|
34
34
|
require('../../Label_cjs_LEuuFaN-.js');
|
|
35
35
|
require('@itcase/icons/default');
|
|
36
36
|
require('lodash/castArray');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var DatePicker = require('../../
|
|
3
|
+
var DatePicker = require('../../DatePicker_cjs_BFT9fj8A.js');
|
|
4
4
|
require('../../tslib.es6_cjs_CCZ3TN_7.js');
|
|
5
5
|
require('react/jsx-runtime');
|
|
6
6
|
require('react');
|
|
@@ -30,7 +30,7 @@ require('../context/UrlAssetPrefix.js');
|
|
|
30
30
|
require('../../Link_cjs_BqT6eVl6.js');
|
|
31
31
|
require('../../Text_cjs_B8nNXWBA.js');
|
|
32
32
|
require('../../Loader_cjs_DlnM5Vzb.js');
|
|
33
|
-
require('../../
|
|
33
|
+
require('../../Input_cjs_CFy0tfAO.js');
|
|
34
34
|
require('../../Label_cjs_LEuuFaN-.js');
|
|
35
35
|
require('@itcase/icons/default');
|
|
36
36
|
|
|
@@ -84,17 +84,17 @@ var switchAppearanceSize = {
|
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
var switchAppearanceStyle = {
|
|
87
|
-
|
|
87
|
+
solid: {
|
|
88
88
|
borderColor: 'none',
|
|
89
89
|
},
|
|
90
|
-
|
|
90
|
+
outlined: {
|
|
91
91
|
fill: 'none',
|
|
92
|
+
},
|
|
93
|
+
full: {
|
|
92
94
|
borderColor: 'none',
|
|
93
95
|
},
|
|
94
|
-
|
|
96
|
+
ghost: {
|
|
95
97
|
fill: 'none',
|
|
96
|
-
},
|
|
97
|
-
solid: {
|
|
98
98
|
borderColor: 'none',
|
|
99
99
|
},
|
|
100
100
|
};
|
|
@@ -119,20 +119,20 @@ var switchConfig = {
|
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
121
|
var Switch = React.forwardRef(function Switch(props, ref) {
|
|
122
|
-
var id = props.id, className = props.className, appearance = props.appearance, _a = props.align, align = _a === void 0 ? 'left' : _a, title = props.title, desc = props.desc, isDisabled = props.isDisabled,
|
|
122
|
+
var id = props.id, className = props.className, appearance = props.appearance, _a = props.align, align = _a === void 0 ? 'left' : _a, title = props.title, desc = props.desc, isDisabled = props.isDisabled, isActive = props.isActive, onChange = props.onChange;
|
|
123
123
|
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, switchConfig);
|
|
124
124
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
125
125
|
var size = propsGenerator.size, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, fillToggleActiveClass = propsGenerator.fillToggleActiveClass, fillToggleActiveHoverClass = propsGenerator.fillToggleActiveHoverClass, fillToggleClass = propsGenerator.fillToggleClass, fillToggleHoverClass = propsGenerator.fillToggleHoverClass, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize;
|
|
126
|
-
return (jsxRuntime.jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [title && (jsxRuntime.jsx(Text.Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsxRuntime.jsx(Text.Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc })), jsxRuntime.jsxs("div", { className: 'switch__item', children: [jsxRuntime.jsx("input", { id: id, className: "switch__checkbox", type: "checkbox",
|
|
126
|
+
return (jsxRuntime.jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [jsxRuntime.jsxs("div", { className: "switch__wrapper", children: [title && (jsxRuntime.jsx(Text.Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsxRuntime.jsx(Text.Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc }))] }), jsxRuntime.jsxs("div", { className: 'switch__item', children: [jsxRuntime.jsx("input", { id: id, className: "switch__checkbox", type: "checkbox",
|
|
127
127
|
// @ts-expect-error
|
|
128
|
-
ref: ref, onChange: onChange }), jsxRuntime.jsx("div", { className: clsx('switch__bg', !isActive
|
|
128
|
+
ref: ref, disabled: isDisabled && 'disabled', checked: isActive && 'checked', onChange: onChange }), jsxRuntime.jsx("div", { className: clsx('switch__bg', !isActive
|
|
129
129
|
? fillClass && "fill_".concat(fillClass)
|
|
130
|
-
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
130
|
+
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
131
131
|
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
132
132
|
: fillActiveHoverClass &&
|
|
133
|
-
"fill_active_hover_".concat(fillActiveHoverClass)), children: "\u00A0" }), jsxRuntime.jsx("div", { className: clsx('switch__toggle', !isActive
|
|
133
|
+
"fill_active_hover_".concat(fillActiveHoverClass)), children: "\u00A0" }), jsxRuntime.jsx("div", { className: clsx('switch__toggle', !isActive
|
|
134
134
|
? fillToggleClass && "fill_".concat(fillToggleClass)
|
|
135
|
-
: fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !isActive
|
|
135
|
+
: fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !isActive
|
|
136
136
|
? fillToggleHoverClass && "fill_hover_".concat(fillToggleHoverClass)
|
|
137
137
|
: fillToggleActiveHoverClass &&
|
|
138
138
|
"fill_active_hover_".concat(fillToggleActiveHoverClass)), children: "\u00A0" })] })] }));
|
|
@@ -82,13 +82,17 @@ var checkboxAppearanceError = {
|
|
|
82
82
|
|
|
83
83
|
var checkboxAppearanceRequire = {
|
|
84
84
|
requirePrimary: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
fillCheckbox: 'warningPrimary',
|
|
86
|
+
fillCheckboxActive: 'warningPrimary',
|
|
87
|
+
fillCheckboxActiveHover: 'warningTertiary',
|
|
88
|
+
fillCheckboxHover: 'warningTertiary',
|
|
89
|
+
fillCheckmark: 'warningBorderPrimary',
|
|
90
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
91
|
+
descTextColor: 'surfaceTextPrimary',
|
|
92
|
+
borderColorCheckbox: 'warningBorderPrimary',
|
|
93
|
+
borderColorCheckboxActive: 'warningBorderPrimary',
|
|
94
|
+
borderColorCheckboxActiveHover: 'warningBorderPrimary',
|
|
95
|
+
borderColorCheckboxHover: 'warningBorderPrimary',
|
|
92
96
|
},
|
|
93
97
|
requireSecondary: {
|
|
94
98
|
fill: 'surfaceSecondary',
|
|
@@ -136,21 +140,25 @@ var checkboxAppearanceStyle = {
|
|
|
136
140
|
|
|
137
141
|
var checkboxAppearanceSuccess = {
|
|
138
142
|
successPrimary: {
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
fillCheckbox: 'successPrimary',
|
|
144
|
+
fillCheckboxActive: 'successPrimary',
|
|
145
|
+
fillCheckboxActiveHover: 'successTertiary',
|
|
146
|
+
fillCheckboxHover: 'successTertiary',
|
|
147
|
+
fillCheckmark: 'successBorderPrimary',
|
|
148
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
149
|
+
descTextColor: 'surfaceTextPrimary',
|
|
150
|
+
borderColorCheckbox: 'successBorderPrimary',
|
|
151
|
+
borderColorCheckboxActive: 'successBorderPrimary',
|
|
152
|
+
borderColorCheckboxActiveHover: 'successBorderPrimary',
|
|
153
|
+
borderColorCheckboxHover: 'successBorderPrimary',
|
|
154
|
+
},
|
|
155
|
+
successSecondary: {
|
|
156
|
+
fill: 'successSecondary',
|
|
157
|
+
borderColor: 'successBorderTertiary',
|
|
141
158
|
borderHover: 'successBorderQuaternary',
|
|
142
|
-
textColor: 'surfaceTextPrimary',
|
|
143
159
|
iconBeforeFill: 'successItemQuaternary',
|
|
144
160
|
iconClearFill: 'successItemPrimary',
|
|
145
|
-
placeholderTextColor: '
|
|
146
|
-
},
|
|
147
|
-
successSecondary: {
|
|
148
|
-
fill: 'surfaceSecondary',
|
|
149
|
-
borderColor: 'surfaceBorderTertiary',
|
|
150
|
-
borderHover: 'surfaceBorderQuaternary',
|
|
151
|
-
iconBeforeFill: 'surfaceItemQuaternary',
|
|
152
|
-
iconClearFill: 'surfaceItemPrimary',
|
|
153
|
-
placeholderTextColor: 'surfaceTextSecondary',
|
|
161
|
+
placeholderTextColor: 'successTextSecondary',
|
|
154
162
|
},
|
|
155
163
|
};
|
|
156
164
|
|
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { PartySuggestions } from 'react-dadata';
|
|
6
|
-
import { I as Input } from '../
|
|
6
|
+
import { I as Input } from '../Input_es_l3ry6luZ.js';
|
|
7
7
|
import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
8
|
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
9
|
import 'lodash/camelCase';
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { DATE_PERIOD_INTERVALS } from '@itcase/common';
|
|
5
|
-
import { D as DatePickerInput } from '../
|
|
5
|
+
import { D as DatePickerInput } from '../DatePicker_es_C1ykgFhq.js';
|
|
6
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { b as ChipsGroup, C as Chips } from '../ChipsGroup_es_BcYHhSiE.js';
|
|
@@ -28,7 +28,7 @@ import '../context/UrlAssetPrefix.js';
|
|
|
28
28
|
import '../Link_es_BnUIX0QT.js';
|
|
29
29
|
import '../Text_es_BvmOR4nv.js';
|
|
30
30
|
import '../Loader_es_DhNCKZ8Y.js';
|
|
31
|
-
import '../
|
|
31
|
+
import '../Input_es_l3ry6luZ.js';
|
|
32
32
|
import '../Label_es_Bfi00e0G.js';
|
|
33
33
|
import '@itcase/icons/default';
|
|
34
34
|
import 'lodash/castArray';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../
|
|
1
|
+
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../DatePicker_es_C1ykgFhq.js';
|
|
2
2
|
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -28,6 +28,6 @@ import '../context/UrlAssetPrefix.js';
|
|
|
28
28
|
import '../Link_es_BnUIX0QT.js';
|
|
29
29
|
import '../Text_es_BvmOR4nv.js';
|
|
30
30
|
import '../Loader_es_DhNCKZ8Y.js';
|
|
31
|
-
import '../
|
|
31
|
+
import '../Input_es_l3ry6luZ.js';
|
|
32
32
|
import '../Label_es_Bfi00e0G.js';
|
|
33
33
|
import '@itcase/icons/default';
|
package/dist/components/Input.js
CHANGED
|
@@ -82,17 +82,17 @@ var switchAppearanceSize = {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
var switchAppearanceStyle = {
|
|
85
|
-
|
|
85
|
+
solid: {
|
|
86
86
|
borderColor: 'none',
|
|
87
87
|
},
|
|
88
|
-
|
|
88
|
+
outlined: {
|
|
89
89
|
fill: 'none',
|
|
90
|
+
},
|
|
91
|
+
full: {
|
|
90
92
|
borderColor: 'none',
|
|
91
93
|
},
|
|
92
|
-
|
|
94
|
+
ghost: {
|
|
93
95
|
fill: 'none',
|
|
94
|
-
},
|
|
95
|
-
solid: {
|
|
96
96
|
borderColor: 'none',
|
|
97
97
|
},
|
|
98
98
|
};
|
|
@@ -117,20 +117,20 @@ var switchConfig = {
|
|
|
117
117
|
},
|
|
118
118
|
};
|
|
119
119
|
var Switch = React.forwardRef(function Switch(props, ref) {
|
|
120
|
-
var id = props.id, className = props.className, appearance = props.appearance, _a = props.align, align = _a === void 0 ? 'left' : _a, title = props.title, desc = props.desc, isDisabled = props.isDisabled,
|
|
120
|
+
var id = props.id, className = props.className, appearance = props.appearance, _a = props.align, align = _a === void 0 ? 'left' : _a, title = props.title, desc = props.desc, isDisabled = props.isDisabled, isActive = props.isActive, onChange = props.onChange;
|
|
121
121
|
var appearanceConfig = useAppearanceConfig(appearance, switchConfig);
|
|
122
122
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
123
123
|
var size = propsGenerator.size, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, fillToggleActiveClass = propsGenerator.fillToggleActiveClass, fillToggleActiveHoverClass = propsGenerator.fillToggleActiveHoverClass, fillToggleClass = propsGenerator.fillToggleClass, fillToggleHoverClass = propsGenerator.fillToggleHoverClass, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize;
|
|
124
|
-
return (jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [title && (jsx(Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsx(Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc })), jsxs("div", { className: 'switch__item', children: [jsx("input", { id: id, className: "switch__checkbox", type: "checkbox",
|
|
124
|
+
return (jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [jsxs("div", { className: "switch__wrapper", children: [title && (jsx(Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsx(Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc }))] }), jsxs("div", { className: 'switch__item', children: [jsx("input", { id: id, className: "switch__checkbox", type: "checkbox",
|
|
125
125
|
// @ts-expect-error
|
|
126
|
-
ref: ref, onChange: onChange }), jsx("div", { className: clsx('switch__bg', !isActive
|
|
126
|
+
ref: ref, disabled: isDisabled && 'disabled', checked: isActive && 'checked', onChange: onChange }), jsx("div", { className: clsx('switch__bg', !isActive
|
|
127
127
|
? fillClass && "fill_".concat(fillClass)
|
|
128
|
-
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
128
|
+
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
129
129
|
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
130
130
|
: fillActiveHoverClass &&
|
|
131
|
-
"fill_active_hover_".concat(fillActiveHoverClass)), children: "\u00A0" }), jsx("div", { className: clsx('switch__toggle', !isActive
|
|
131
|
+
"fill_active_hover_".concat(fillActiveHoverClass)), children: "\u00A0" }), jsx("div", { className: clsx('switch__toggle', !isActive
|
|
132
132
|
? fillToggleClass && "fill_".concat(fillToggleClass)
|
|
133
|
-
: fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !isActive
|
|
133
|
+
: fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !isActive
|
|
134
134
|
? fillToggleHoverClass && "fill_hover_".concat(fillToggleHoverClass)
|
|
135
135
|
: fillToggleActiveHoverClass &&
|
|
136
136
|
"fill_active_hover_".concat(fillToggleActiveHoverClass)), children: "\u00A0" })] })] }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.code {
|
|
2
|
+
width: 100%;
|
|
2
3
|
&__wrapper {
|
|
3
4
|
width: 100%;
|
|
4
5
|
display: flex;
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
}
|
|
15
16
|
.code__input {
|
|
16
17
|
&_size {
|
|
17
|
-
@each $size in l, m {
|
|
18
|
+
@each $size in xl, l, m, s {
|
|
18
19
|
&_$(size) {
|
|
19
20
|
min-width: var(--code-input-size-$(size)-width);
|
|
20
21
|
min-height: var(--code-input-size-$(size)-height);
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
.switch {
|
|
2
|
-
display:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
&__wrapper {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex: 1;
|
|
7
|
+
align-items: center;
|
|
8
|
+
^&__title {
|
|
9
|
+
padding: 0 8px 0 0;
|
|
10
|
+
}
|
|
11
|
+
^&__desc {
|
|
12
|
+
padding: 0 8px 0 0;
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
&__item {
|
|
12
16
|
border-radius: 50px;
|
|
13
17
|
position: relative;
|
|
14
18
|
overflow: hidden;
|
|
15
19
|
display: flex;
|
|
16
|
-
align-self: start;
|
|
17
20
|
transition: 0.4s;
|
|
18
21
|
cursor: pointer;
|
|
19
|
-
grid-row: 1/3;
|
|
20
22
|
}
|
|
21
23
|
&__checkbox {
|
|
22
24
|
width: 100%;
|
|
@@ -30,11 +32,7 @@
|
|
|
30
32
|
cursor: pointer;
|
|
31
33
|
appearance: none;
|
|
32
34
|
&:checked {
|
|
33
|
-
& + .switch__bg {
|
|
34
|
-
/* background: var(--color-accent-fill-primary); */
|
|
35
|
-
}
|
|
36
35
|
& ~ .switch__toggle {
|
|
37
|
-
/* background: var(--color-accent-item-primary); */
|
|
38
36
|
margin: 0 0 0 -3px;
|
|
39
37
|
left: 100%;
|
|
40
38
|
transform: translate(-100%, -50%);
|
|
@@ -47,7 +45,6 @@
|
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
&__bg {
|
|
50
|
-
/* background: var(--color-surface-tertiary); */
|
|
51
48
|
width: 100%;
|
|
52
49
|
flex: 1;
|
|
53
50
|
transition: all 0.25s;
|
|
@@ -55,8 +52,6 @@
|
|
|
55
52
|
&__toggle {
|
|
56
53
|
height: calc(100% - 6px);
|
|
57
54
|
aspect-ratio: 1/1;
|
|
58
|
-
|
|
59
|
-
/* background: #fff; */
|
|
60
55
|
border-radius: 50%;
|
|
61
56
|
position: absolute;
|
|
62
57
|
box-shadow: inset 0 0 5px rgb(0, 0, 0, 0.2);
|
|
@@ -70,26 +65,20 @@
|
|
|
70
65
|
.switch {
|
|
71
66
|
&_align {
|
|
72
67
|
&_left {
|
|
73
|
-
|
|
68
|
+
width: 100%;
|
|
69
|
+
flex-direction: row-reverse;
|
|
74
70
|
^^&__title,
|
|
75
71
|
^^&__desc {
|
|
76
|
-
grid-column-start: 2;
|
|
77
72
|
padding: 0 0 0 8px;
|
|
78
73
|
}
|
|
79
|
-
^^&__item {
|
|
80
|
-
grid-column-start: 1;
|
|
81
|
-
}
|
|
82
74
|
}
|
|
83
75
|
&_right {
|
|
84
|
-
|
|
76
|
+
width: 100%;
|
|
77
|
+
flex-direction: row;
|
|
85
78
|
^^&__title,
|
|
86
79
|
^^&__desc {
|
|
87
|
-
grid-column-start: 1;
|
|
88
80
|
padding: 0 8px 0 0;
|
|
89
81
|
}
|
|
90
|
-
^^&__item {
|
|
91
|
-
grid-column-start: 2;
|
|
92
|
-
}
|
|
93
82
|
}
|
|
94
83
|
}
|
|
95
84
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
declare const checkboxAppearanceRequire: {
|
|
2
2
|
requirePrimary: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
fillCheckbox: string;
|
|
4
|
+
fillCheckboxActive: string;
|
|
5
|
+
fillCheckboxActiveHover: string;
|
|
6
|
+
fillCheckboxHover: string;
|
|
7
|
+
fillCheckmark: string;
|
|
8
|
+
labelTextColor: string;
|
|
9
|
+
descTextColor: string;
|
|
10
|
+
borderColorCheckbox: string;
|
|
11
|
+
borderColorCheckboxActive: string;
|
|
12
|
+
borderColorCheckboxActiveHover: string;
|
|
13
|
+
borderColorCheckboxHover: string;
|
|
10
14
|
};
|
|
11
15
|
requireSecondary: {
|
|
12
16
|
fill: string;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
declare const checkboxAppearanceSuccess: {
|
|
2
2
|
successPrimary: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
fillCheckbox: string;
|
|
4
|
+
fillCheckboxActive: string;
|
|
5
|
+
fillCheckboxActiveHover: string;
|
|
6
|
+
fillCheckboxHover: string;
|
|
7
|
+
fillCheckmark: string;
|
|
8
|
+
labelTextColor: string;
|
|
9
|
+
descTextColor: string;
|
|
10
|
+
borderColorCheckbox: string;
|
|
11
|
+
borderColorCheckboxActive: string;
|
|
12
|
+
borderColorCheckboxActiveHover: string;
|
|
13
|
+
borderColorCheckboxHover: string;
|
|
10
14
|
};
|
|
11
15
|
successSecondary: {
|
|
12
16
|
fill: string;
|
|
@@ -4,6 +4,7 @@ declare const inputAppearanceError: {
|
|
|
4
4
|
borderColor: string;
|
|
5
5
|
borderColorHover: string;
|
|
6
6
|
textColor: string;
|
|
7
|
+
caret: string;
|
|
7
8
|
iconBeforeFill: string;
|
|
8
9
|
iconClearFill: string;
|
|
9
10
|
placeholderTextColor: string;
|
|
@@ -12,6 +13,7 @@ declare const inputAppearanceError: {
|
|
|
12
13
|
fill: string;
|
|
13
14
|
borderColor: string;
|
|
14
15
|
borderColorHover: string;
|
|
16
|
+
caret: string;
|
|
15
17
|
iconBeforeFill: string;
|
|
16
18
|
iconClearFill: string;
|
|
17
19
|
placeholderTextColor: string;
|
|
@@ -4,6 +4,7 @@ declare const inputAppearanceRequire: {
|
|
|
4
4
|
borderColor: string;
|
|
5
5
|
borderColorHover: string;
|
|
6
6
|
textColor: string;
|
|
7
|
+
caret: string;
|
|
7
8
|
iconBeforeFill: string;
|
|
8
9
|
iconClearFill: string;
|
|
9
10
|
placeholderTextColor: string;
|
|
@@ -12,6 +13,7 @@ declare const inputAppearanceRequire: {
|
|
|
12
13
|
fill: string;
|
|
13
14
|
borderColor: string;
|
|
14
15
|
borderColorHover: string;
|
|
16
|
+
caret: string;
|
|
15
17
|
iconBeforeFill: string;
|
|
16
18
|
iconClearFill: string;
|
|
17
19
|
placeholderTextColor: string;
|
|
@@ -4,6 +4,7 @@ declare const inputAppearanceSuccess: {
|
|
|
4
4
|
borderColor: string;
|
|
5
5
|
borderColorHover: string;
|
|
6
6
|
textColor: string;
|
|
7
|
+
caret: string;
|
|
7
8
|
iconBeforeFill: string;
|
|
8
9
|
iconClearFill: string;
|
|
9
10
|
placeholderTextColor: string;
|
|
@@ -12,6 +13,7 @@ declare const inputAppearanceSuccess: {
|
|
|
12
13
|
fill: string;
|
|
13
14
|
borderColor: string;
|
|
14
15
|
borderColorHover: string;
|
|
16
|
+
caret: string;
|
|
15
17
|
iconBeforeFill: string;
|
|
16
18
|
iconClearFill: string;
|
|
17
19
|
placeholderTextColor: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
declare const switchAppearanceStyle: {
|
|
2
|
-
|
|
2
|
+
solid: {
|
|
3
3
|
borderColor: string;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
outlined: {
|
|
6
6
|
fill: string;
|
|
7
|
+
};
|
|
8
|
+
full: {
|
|
7
9
|
borderColor: string;
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
ghost: {
|
|
10
12
|
fill: string;
|
|
11
|
-
};
|
|
12
|
-
solid: {
|
|
13
13
|
borderColor: string;
|
|
14
14
|
};
|
|
15
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.87",
|
|
4
4
|
"description": "UI components (Modal, Loader, Popup, etc)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Modal",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@emotion/is-prop-valid": "^1.3.1",
|
|
104
104
|
"@itcase/common": "^1.2.28",
|
|
105
105
|
"@itcase/icons": "^1.2.16",
|
|
106
|
-
"@itcase/storybook-config": "^1.1.
|
|
106
|
+
"@itcase/storybook-config": "^1.1.77",
|
|
107
107
|
"@itcase/tokens-am": "^1.1.19",
|
|
108
108
|
"@itcase/tokens-baikal": "^1.1.17",
|
|
109
109
|
"@itcase/tokens-palette": "^1.1.11",
|