@itcase/ui 1.8.4 → 1.8.5

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.
@@ -6,64 +6,161 @@ var React = require('react');
6
6
  var clsx = require('clsx');
7
7
  var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
8
8
 
9
- var inputAppearance = {
10
- dev: {
11
- size: 'm',
9
+ var inputAppearanceDefault = {
10
+ defaultPrimary: {
11
+ fill: 'surfaceSecondary',
12
12
  borderColor: 'surfaceBorderTertiary',
13
+ borderHover: 'surfaceBorderQuaternary',
14
+ iconBeforeFill: 'surfaceItemQuaternary',
15
+ iconClearFill: 'surfaceItemPrimary',
13
16
  textColor: 'surfaceTextPrimary',
14
- textSize: 'm',
17
+ textColorDisabled: 'surfaceTextDisabled',
18
+ caret: 'secondaryItemSecondary',
19
+ },
20
+ defaultSecondary: {
21
+ fill: 'surfacePrimary',
22
+ borderColor: 'surfaceBorderTertiary',
23
+ borderHover: 'surfaceBorderQuaternary',
24
+ iconBeforeFill: 'surfaceItemQuaternary',
25
+ iconClearFill: 'surfaceItemPrimary',
15
26
  placeholderTextColor: 'surfaceTextSecondary',
16
- shape: 'rounded',
27
+ textColor: 'surfaceTextPrimary',
28
+ textColorDisabled: 'surfaceTextDisabled',
29
+ caret: 'secondaryItemSecondary',
17
30
  },
18
31
  };
19
- var inputState = {
20
- filled: {
21
- borderColor: 'surfaceBorderQuaternary',
22
- textColor: 'surfaceTextPrimary',
32
+
33
+ var inputAppearanceDisabled = {
34
+ disabledPrimary: {
35
+ fill: 'surfaceFillDisabled',
36
+ borderColor: 'errorBorderQuaternary',
37
+ borderHover: 'errorBorderQuaternary',
38
+ textColor: 'surfaceTextQuaternary',
39
+ iconBeforeFill: 'errorItemQuaternary',
40
+ iconClearFill: 'errorItemPrimary',
41
+ placeholderTextColor: 'surfaceTextQuaternary',
42
+ },
43
+ disabledSecondary: {
44
+ fill: 'surfaceSecondary',
45
+ borderColor: 'surfaceBorderTertiary',
46
+ borderHover: 'surfaceBorderQuaternary',
47
+ iconBeforeFill: 'surfaceItemQuaternary',
48
+ iconClearFill: 'surfaceItemPrimary',
49
+ placeholderTextColor: 'surfaceTextSecondary',
23
50
  },
24
- disabled: {
25
- borderColor: 'surfaceBorderDisabled',
26
- borderColorHover: 'surfaceBorderDisabled',
51
+ };
52
+
53
+ var inputAppearanceError = {
54
+ errorPrimary: {
55
+ fill: 'errorTertiary',
56
+ borderColor: 'errorBorderQuaternary',
57
+ borderHover: 'errorBorderQuaternary',
27
58
  textColor: 'surfaceTextPrimary',
28
- placeholderTextColor: 'surfaceTextDisabled',
59
+ iconBeforeFill: 'errorItemQuaternary',
60
+ iconClearFill: 'errorItemPrimary',
61
+ placeholderTextColor: 'surfaceTextQuaternary',
29
62
  },
30
- error: {
31
- borderColor: 'errorBorderPrimary',
32
- placeholderTextColor: 'secondaryTextSecondary',
63
+ errorSecondary: {
64
+ fill: 'errorSecondary',
65
+ borderColor: 'errorBorderTertiary',
66
+ borderHover: 'errorBorderQuaternary',
67
+ iconBeforeFill: 'errorItemQuaternary',
68
+ iconClearFill: 'errorItemPrimary',
69
+ placeholderTextColor: 'errorTextSecondary',
33
70
  },
34
- errorFilled: {
35
- borderColor: 'errorBorderPrimary',
71
+ };
72
+
73
+ var inputAppearanceRequire = {
74
+ requirePrimary: {
75
+ fill: 'warningTertiary',
76
+ borderColor: 'warningBorderQuaternary',
77
+ borderHover: 'warningBorderQuaternary',
36
78
  textColor: 'surfaceTextPrimary',
79
+ iconBeforeFill: 'warningItemQuaternary',
80
+ iconClearFill: 'warningItemPrimary',
81
+ placeholderTextColor: 'surfaceTextQuaternary',
37
82
  },
38
- success: {
39
- borderColor: 'successBorderPrimary',
40
- textColor: 'surfaceTextPrimary',
83
+ requireSecondary: {
84
+ fill: 'surfaceSecondary',
85
+ borderColor: 'surfaceBorderTertiary',
86
+ borderHover: 'surfaceBorderQuaternary',
87
+ iconBeforeFill: 'surfaceItemQuaternary',
88
+ iconClearFill: 'surfaceItemPrimary',
89
+ placeholderTextColor: 'surfaceTextSecondary',
90
+ },
91
+ };
92
+
93
+ var inputAppearanceSize = {
94
+ sizeXXL: {
95
+ size: 'xxl',
96
+ textSize: 'l',
41
97
  },
42
- active: {
43
- borderColor: 'surfaceBorderActive',
44
- placeholderTextColor: 'secondaryTextSecondary',
98
+ sizeXL: {
99
+ size: 'xl',
100
+ textSize: 's',
45
101
  },
46
- activeFilled: {
47
- borderColor: 'surfaceBorderActive',
48
- textColor: 'surfaceTextPrimary',
102
+ sizeL: {
103
+ size: 'l',
104
+ textSize: 's',
49
105
  },
50
- normal: {
51
- borderColor: 'surfaceBorderQuaternary',
52
- placeholderTextColor: 'secondaryTextSecondary',
106
+ sizeM: {
107
+ size: 'm',
108
+ textSize: 'm',
53
109
  },
54
- readonly: {
55
- borderColor: 'surfaceBorderDisabled',
56
- textColor: 'surfaceTextPrimary',
110
+ sizeS: {
111
+ size: 's',
112
+ textSize: 's',
113
+ },
114
+ sizeXS: {
115
+ size: 'xs',
116
+ textSize: 's',
117
+ },
118
+ sizeXXS: {
119
+ size: 'xxs',
120
+ textSize: 's',
121
+ },
122
+ };
123
+
124
+ var inputAppearanceStyle = {
125
+ full: {
126
+ /* border / fill */
57
127
  },
58
- require: {
59
- borderColor: 'surfaceBorderActive',
128
+ ghost: {
129
+ fill: 'none',
130
+ borderWidth: '0',
131
+ },
132
+ outlined: {
133
+ fill: 'none',
134
+ },
135
+ solid: {
136
+ borderWidth: '0',
137
+ },
138
+ };
139
+
140
+ var inputAppearanceSuccess = {
141
+ successPrimary: {
142
+ fill: 'successTertiary',
143
+ borderColor: 'successBorderQuaternary',
144
+ borderHover: 'successBorderQuaternary',
60
145
  textColor: 'surfaceTextPrimary',
146
+ iconBeforeFill: 'successItemQuaternary',
147
+ iconClearFill: 'successItemPrimary',
148
+ placeholderTextColor: 'surfaceTextQuaternary',
149
+ },
150
+ successSecondary: {
151
+ fill: 'surfaceSecondary',
152
+ borderColor: 'surfaceBorderTertiary',
153
+ borderHover: 'surfaceBorderQuaternary',
154
+ iconBeforeFill: 'surfaceItemQuaternary',
155
+ iconClearFill: 'surfaceItemPrimary',
156
+ placeholderTextColor: 'surfaceTextSecondary',
61
157
  },
62
158
  };
63
159
 
160
+ var inputAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, inputAppearanceDefault), inputAppearanceError), inputAppearanceSuccess), inputAppearanceRequire), inputAppearanceDisabled), inputAppearanceSize), inputAppearanceStyle);
161
+
64
162
  var inputConfig = {
65
163
  appearance: inputAppearance,
66
- state: inputState,
67
164
  setAppearance: function (appearanceConfig) {
68
165
  inputConfig.appearance = appearanceConfig;
69
166
  },
@@ -80,7 +177,7 @@ var Input = React.forwardRef(function Input(props, ref) {
80
177
  // const stateConfig = state && inputConfig.state && inputConfig.state[state]
81
178
  var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
82
179
  var fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorDisabledClass = propsGenerator.borderColorDisabledClass, borderWidthClass = propsGenerator.borderWidthClass, borderWidthDisabledClass = propsGenerator.borderWidthDisabledClass, textColorClass = propsGenerator.textColorClass, textColorDisabledClass = propsGenerator.textColorDisabledClass, textSizeClass = propsGenerator.textSizeClass, textWeightClass = propsGenerator.textWeightClass, placeholderTextColorDisabledClass = propsGenerator.placeholderTextColorDisabledClass, caretClass = propsGenerator.caretClass, placeholderTextColorClass = propsGenerator.placeholderTextColorClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
83
- return (jsxRuntime.jsx("input", { id: String(id), className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || textWeightClass) && 'text', caretClass && "caret-color_".concat(caretClass), shapeClass && "input_shape_".concat(shapeClass), textSizeClass && "text_size_".concat(textSizeClass), textWeightClass && "text-weight_".concat(textWeightClass), widthClass && "width_".concat(widthClass), sizeClass && "input_size_".concat(sizeClass), textColorClass && "text-color_".concat(textColorClass), !isDisabled
180
+ return (jsxRuntime.jsx("input", { id: String(id), className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || textWeightClass) && 'text', caretClass && "caret-color_".concat(caretClass), shapeClass && "input_shape_".concat(shapeClass), textColorClass && "text-color_".concat(textColorClass), textSizeClass && "text_size_".concat(textSizeClass), textWeightClass && "text-weight_".concat(textWeightClass), widthClass && "width_".concat(widthClass), sizeClass && "input_size_".concat(sizeClass), !isDisabled
84
181
  ? fillClass && "fill_".concat(fillClass)
85
182
  : fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isDisabled
86
183
  ? borderWidthClass && "border-width_".concat(borderWidthClass)
@@ -100,4 +197,3 @@ var Input = React.forwardRef(function Input(props, ref) {
100
197
  exports.Input = Input;
101
198
  exports.inputAppearance = inputAppearance;
102
199
  exports.inputConfig = inputConfig;
103
- exports.inputState = inputState;
@@ -0,0 +1,195 @@
1
+ import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import React from 'react';
4
+ import clsx from 'clsx';
5
+ import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
6
+
7
+ var inputAppearanceDefault = {
8
+ defaultPrimary: {
9
+ fill: 'surfaceSecondary',
10
+ borderColor: 'surfaceBorderTertiary',
11
+ borderHover: 'surfaceBorderQuaternary',
12
+ iconBeforeFill: 'surfaceItemQuaternary',
13
+ iconClearFill: 'surfaceItemPrimary',
14
+ textColor: 'surfaceTextPrimary',
15
+ textColorDisabled: 'surfaceTextDisabled',
16
+ caret: 'secondaryItemSecondary',
17
+ },
18
+ defaultSecondary: {
19
+ fill: 'surfacePrimary',
20
+ borderColor: 'surfaceBorderTertiary',
21
+ borderHover: 'surfaceBorderQuaternary',
22
+ iconBeforeFill: 'surfaceItemQuaternary',
23
+ iconClearFill: 'surfaceItemPrimary',
24
+ placeholderTextColor: 'surfaceTextSecondary',
25
+ textColor: 'surfaceTextPrimary',
26
+ textColorDisabled: 'surfaceTextDisabled',
27
+ caret: 'secondaryItemSecondary',
28
+ },
29
+ };
30
+
31
+ var inputAppearanceDisabled = {
32
+ disabledPrimary: {
33
+ fill: 'surfaceFillDisabled',
34
+ borderColor: 'errorBorderQuaternary',
35
+ borderHover: 'errorBorderQuaternary',
36
+ textColor: 'surfaceTextQuaternary',
37
+ iconBeforeFill: 'errorItemQuaternary',
38
+ iconClearFill: 'errorItemPrimary',
39
+ placeholderTextColor: 'surfaceTextQuaternary',
40
+ },
41
+ disabledSecondary: {
42
+ fill: 'surfaceSecondary',
43
+ borderColor: 'surfaceBorderTertiary',
44
+ borderHover: 'surfaceBorderQuaternary',
45
+ iconBeforeFill: 'surfaceItemQuaternary',
46
+ iconClearFill: 'surfaceItemPrimary',
47
+ placeholderTextColor: 'surfaceTextSecondary',
48
+ },
49
+ };
50
+
51
+ var inputAppearanceError = {
52
+ errorPrimary: {
53
+ fill: 'errorTertiary',
54
+ borderColor: 'errorBorderQuaternary',
55
+ borderHover: 'errorBorderQuaternary',
56
+ textColor: 'surfaceTextPrimary',
57
+ iconBeforeFill: 'errorItemQuaternary',
58
+ iconClearFill: 'errorItemPrimary',
59
+ placeholderTextColor: 'surfaceTextQuaternary',
60
+ },
61
+ errorSecondary: {
62
+ fill: 'errorSecondary',
63
+ borderColor: 'errorBorderTertiary',
64
+ borderHover: 'errorBorderQuaternary',
65
+ iconBeforeFill: 'errorItemQuaternary',
66
+ iconClearFill: 'errorItemPrimary',
67
+ placeholderTextColor: 'errorTextSecondary',
68
+ },
69
+ };
70
+
71
+ var inputAppearanceRequire = {
72
+ requirePrimary: {
73
+ fill: 'warningTertiary',
74
+ borderColor: 'warningBorderQuaternary',
75
+ borderHover: 'warningBorderQuaternary',
76
+ textColor: 'surfaceTextPrimary',
77
+ iconBeforeFill: 'warningItemQuaternary',
78
+ iconClearFill: 'warningItemPrimary',
79
+ placeholderTextColor: 'surfaceTextQuaternary',
80
+ },
81
+ requireSecondary: {
82
+ fill: 'surfaceSecondary',
83
+ borderColor: 'surfaceBorderTertiary',
84
+ borderHover: 'surfaceBorderQuaternary',
85
+ iconBeforeFill: 'surfaceItemQuaternary',
86
+ iconClearFill: 'surfaceItemPrimary',
87
+ placeholderTextColor: 'surfaceTextSecondary',
88
+ },
89
+ };
90
+
91
+ var inputAppearanceSize = {
92
+ sizeXXL: {
93
+ size: 'xxl',
94
+ textSize: 'l',
95
+ },
96
+ sizeXL: {
97
+ size: 'xl',
98
+ textSize: 's',
99
+ },
100
+ sizeL: {
101
+ size: 'l',
102
+ textSize: 's',
103
+ },
104
+ sizeM: {
105
+ size: 'm',
106
+ textSize: 'm',
107
+ },
108
+ sizeS: {
109
+ size: 's',
110
+ textSize: 's',
111
+ },
112
+ sizeXS: {
113
+ size: 'xs',
114
+ textSize: 's',
115
+ },
116
+ sizeXXS: {
117
+ size: 'xxs',
118
+ textSize: 's',
119
+ },
120
+ };
121
+
122
+ var inputAppearanceStyle = {
123
+ full: {
124
+ /* border / fill */
125
+ },
126
+ ghost: {
127
+ fill: 'none',
128
+ borderWidth: '0',
129
+ },
130
+ outlined: {
131
+ fill: 'none',
132
+ },
133
+ solid: {
134
+ borderWidth: '0',
135
+ },
136
+ };
137
+
138
+ var inputAppearanceSuccess = {
139
+ successPrimary: {
140
+ fill: 'successTertiary',
141
+ borderColor: 'successBorderQuaternary',
142
+ borderHover: 'successBorderQuaternary',
143
+ textColor: 'surfaceTextPrimary',
144
+ iconBeforeFill: 'successItemQuaternary',
145
+ iconClearFill: 'successItemPrimary',
146
+ placeholderTextColor: 'surfaceTextQuaternary',
147
+ },
148
+ successSecondary: {
149
+ fill: 'surfaceSecondary',
150
+ borderColor: 'surfaceBorderTertiary',
151
+ borderHover: 'surfaceBorderQuaternary',
152
+ iconBeforeFill: 'surfaceItemQuaternary',
153
+ iconClearFill: 'surfaceItemPrimary',
154
+ placeholderTextColor: 'surfaceTextSecondary',
155
+ },
156
+ };
157
+
158
+ var inputAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, inputAppearanceDefault), inputAppearanceError), inputAppearanceSuccess), inputAppearanceRequire), inputAppearanceDisabled), inputAppearanceSize), inputAppearanceStyle);
159
+
160
+ var inputConfig = {
161
+ appearance: inputAppearance,
162
+ setAppearance: function (appearanceConfig) {
163
+ inputConfig.appearance = appearanceConfig;
164
+ },
165
+ setState: function (newComponent) {
166
+ inputConfig.state = newComponent;
167
+ },
168
+ };
169
+ var Input = React.forwardRef(function Input(props, ref) {
170
+ var id = props.id, className = props.className, _a = props.type, type = _a === void 0 ? 'text' : _a, name = props.name, appearance = props.appearance, isDisabled = props.isDisabled, autocomplete = props.autocomplete, dataTestId = props.dataTestId, index = props.index, placeholder = props.placeholder, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
171
+ var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
172
+ var _a;
173
+ return (__assign(__assign({}, resultConfig), (_a = inputConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
174
+ }, {});
175
+ // const stateConfig = state && inputConfig.state && inputConfig.state[state]
176
+ var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
177
+ var fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorDisabledClass = propsGenerator.borderColorDisabledClass, borderWidthClass = propsGenerator.borderWidthClass, borderWidthDisabledClass = propsGenerator.borderWidthDisabledClass, textColorClass = propsGenerator.textColorClass, textColorDisabledClass = propsGenerator.textColorDisabledClass, textSizeClass = propsGenerator.textSizeClass, textWeightClass = propsGenerator.textWeightClass, placeholderTextColorDisabledClass = propsGenerator.placeholderTextColorDisabledClass, caretClass = propsGenerator.caretClass, placeholderTextColorClass = propsGenerator.placeholderTextColorClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
178
+ return (jsx("input", { id: String(id), className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || textWeightClass) && 'text', caretClass && "caret-color_".concat(caretClass), shapeClass && "input_shape_".concat(shapeClass), textColorClass && "text-color_".concat(textColorClass), textSizeClass && "text_size_".concat(textSizeClass), textWeightClass && "text-weight_".concat(textWeightClass), widthClass && "width_".concat(widthClass), sizeClass && "input_size_".concat(sizeClass), !isDisabled
179
+ ? fillClass && "fill_".concat(fillClass)
180
+ : fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isDisabled
181
+ ? borderWidthClass && "border-width_".concat(borderWidthClass)
182
+ : borderWidthDisabledClass &&
183
+ "border-width_disabled_".concat(borderWidthDisabledClass), !isDisabled ? fillHoverClass && "fill_hover_".concat(fillHoverClass) : null, !isDisabled
184
+ ? borderColorClass && "border-color_".concat(borderColorClass)
185
+ : borderColorDisabledClass &&
186
+ "border-color_disabled_".concat(borderColorDisabledClass), !isDisabled
187
+ ? placeholderTextColorClass &&
188
+ "placeholder-text-color_".concat(placeholderTextColorClass)
189
+ : placeholderTextColorDisabledClass &&
190
+ "placeholder-text-color_disabled_".concat(placeholderTextColorDisabledClass), !isDisabled
191
+ ? textColorClass && "text-color_".concat(textColorClass)
192
+ : textColorDisabledClass && "text-color_".concat(textColorDisabledClass)), type: type, disabled: isDisabled, autocomplete: autocomplete, "data-test-id": dataTestId || (name ? "".concat(name, "Input") : 'input'), index: index, placeholder: placeholder, ref: ref, value: value, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown }));
193
+ });
194
+
195
+ export { Input as I, inputAppearance as a, inputConfig as i };
@@ -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('../../Input_cjs_DkQh0Utd.js');
8
+ var Input = require('../../Input_cjs_C8RWS1SD.js');
9
9
  require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
10
10
  require('lodash/camelCase');
11
11
  require('lodash/castArray');
@@ -10,7 +10,7 @@ var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevic
10
10
  var useStyles = require('../hooks/useStyles/useStyles.js');
11
11
  var Button = require('../../Button_cjs_B7OmqizJ.js');
12
12
  var Icon = require('../../Icon_cjs_DSzfNqif.js');
13
- var Input = require('../../Input_cjs_DkQh0Utd.js');
13
+ var Input = require('../../Input_cjs_C8RWS1SD.js');
14
14
  var Label = require('../../Label_cjs_BCjB-mxC.js');
15
15
  var Text = require('../../Text_cjs_D4xG0cKD.js');
16
16
  require('lodash/camelCase');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Input = require('../../Input_cjs_DkQh0Utd.js');
3
+ var Input = require('../../Input_cjs_C8RWS1SD.js');
4
4
  require('../../tslib.es6_cjs_CCZ3TN_7.js');
5
5
  require('react/jsx-runtime');
6
6
  require('react');
@@ -22,4 +22,3 @@ require('../utils/setViewportProperty.js');
22
22
  exports.Input = Input.Input;
23
23
  exports.inputAppearance = Input.inputAppearance;
24
24
  exports.inputConfig = Input.inputConfig;
25
- exports.inputState = Input.inputState;
@@ -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 '../Input_es_Bs0gEq3L.js';
6
+ import { I as Input } from '../Input_es_FXxp51gq.js';
7
7
  import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
8
8
  import 'lodash/camelCase';
9
9
  import 'lodash/castArray';
@@ -8,7 +8,7 @@ import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDev
8
8
  import { useStyles } from '../hooks/useStyles/useStyles.js';
9
9
  import { B as Button } from '../Button_es_CBbHMy1v.js';
10
10
  import { I as Icon } from '../Icon_es_BBmoZ7_3.js';
11
- import { I as Input } from '../Input_es_Bs0gEq3L.js';
11
+ import { I as Input } from '../Input_es_FXxp51gq.js';
12
12
  import { L as Label } from '../Label_es_CZpanSdR.js';
13
13
  import { T as Text } from '../Text_es_FJGduy7Z.js';
14
14
  import 'lodash/camelCase';
@@ -1,4 +1,4 @@
1
- export { I as Input, a as inputAppearance, i as inputConfig, b as inputState } from '../Input_es_Bs0gEq3L.js';
1
+ export { I as Input, a as inputAppearance, i as inputConfig } from '../Input_es_FXxp51gq.js';
2
2
  import '../tslib.es6_es_Bwu1Cn-t.js';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
@@ -82,11 +82,11 @@
82
82
  justify-content: center;
83
83
  align-items: center;
84
84
  ^^^&__image {
85
- width: $(size) px;
86
- height: $(size) px;
85
+ width: $(size)px;
86
+ height: $(size)px;
87
87
  & .image__item {
88
- width: $(size) px;
89
- height: $(size) px;
88
+ width: $(size)px;
89
+ height: $(size)px;
90
90
  }
91
91
  }
92
92
  }
@@ -95,7 +95,13 @@
95
95
  --input-state-hover-border: var(--color-surface-border-quaternary);
96
96
  --input-state-hover-background: none;
97
97
 
98
- /* Dosabled */
98
+ --input-success-border: var(--color-success-border-primary);
99
+ --input-success-border-hover: var(--color-surface-border-quaternary);
100
+ --input-error-border: var(--color-error-border-primary);
101
+ --input-focus-background: var(--color-surface-primary);
102
+ --input-focus-border: var(--color-surface-border-quaternary);
103
+
104
+ /* Disabled */
99
105
  --input-state-disabled-background: none;
100
106
  --input-state-disabled-border: none;
101
107
  }
@@ -1,3 +1,2 @@
1
- import { InputAppearance, InputState } from './Input.interface';
1
+ import { InputAppearance } from './Input.interface';
2
2
  export declare const inputAppearance: InputAppearance;
3
- export declare const inputState: InputState;
@@ -27,7 +27,6 @@ type InputAppearance = {
27
27
  interface InputConfig {
28
28
  [key: number | string | symbol]: any;
29
29
  appearance: InputAppearance | undefined;
30
- state: InputState | undefined;
31
30
  setAppearance: (newComponent: InputAppearance) => void;
32
31
  setState: (newComponent: InputState) => void;
33
32
  }
@@ -50,4 +49,4 @@ interface InputProps extends InputThemeColor, StyleAttributes {
50
49
  onFocus?: (event?: React.FocusEvent<HTMLInputElement>) => void;
51
50
  onKeyDown?: (event?: React.KeyboardEvent<HTMLInputElement>) => void;
52
51
  }
53
- export type { InputThemeColor, InputState, InputAppearance, InputConfig, InputProps, };
52
+ export type { InputThemeColor, InputAppearance, InputConfig, InputProps };
@@ -0,0 +1,24 @@
1
+ declare const inputAppearanceDefault: {
2
+ defaultPrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ iconBeforeFill: string;
7
+ iconClearFill: string;
8
+ textColor: string;
9
+ textColorDisabled: string;
10
+ caret: string;
11
+ };
12
+ defaultSecondary: {
13
+ fill: string;
14
+ borderColor: string;
15
+ borderHover: string;
16
+ iconBeforeFill: string;
17
+ iconClearFill: string;
18
+ placeholderTextColor: string;
19
+ textColor: string;
20
+ textColorDisabled: string;
21
+ caret: string;
22
+ };
23
+ };
24
+ export { inputAppearanceDefault };
@@ -0,0 +1,20 @@
1
+ declare const inputAppearanceDisabled: {
2
+ disabledPrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ textColor: string;
7
+ iconBeforeFill: string;
8
+ iconClearFill: string;
9
+ placeholderTextColor: string;
10
+ };
11
+ disabledSecondary: {
12
+ fill: string;
13
+ borderColor: string;
14
+ borderHover: string;
15
+ iconBeforeFill: string;
16
+ iconClearFill: string;
17
+ placeholderTextColor: string;
18
+ };
19
+ };
20
+ export { inputAppearanceDisabled };
@@ -0,0 +1,20 @@
1
+ declare const inputAppearanceError: {
2
+ errorPrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ textColor: string;
7
+ iconBeforeFill: string;
8
+ iconClearFill: string;
9
+ placeholderTextColor: string;
10
+ };
11
+ errorSecondary: {
12
+ fill: string;
13
+ borderColor: string;
14
+ borderHover: string;
15
+ iconBeforeFill: string;
16
+ iconClearFill: string;
17
+ placeholderTextColor: string;
18
+ };
19
+ };
20
+ export { inputAppearanceError };
@@ -0,0 +1,20 @@
1
+ declare const inputAppearanceRequire: {
2
+ requirePrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ textColor: string;
7
+ iconBeforeFill: string;
8
+ iconClearFill: string;
9
+ placeholderTextColor: string;
10
+ };
11
+ requireSecondary: {
12
+ fill: string;
13
+ borderColor: string;
14
+ borderHover: string;
15
+ iconBeforeFill: string;
16
+ iconClearFill: string;
17
+ placeholderTextColor: string;
18
+ };
19
+ };
20
+ export { inputAppearanceRequire };
@@ -0,0 +1,31 @@
1
+ declare const inputAppearanceSize: {
2
+ sizeXXL: {
3
+ size: string;
4
+ textSize: string;
5
+ };
6
+ sizeXL: {
7
+ size: string;
8
+ textSize: string;
9
+ };
10
+ sizeL: {
11
+ size: string;
12
+ textSize: string;
13
+ };
14
+ sizeM: {
15
+ size: string;
16
+ textSize: string;
17
+ };
18
+ sizeS: {
19
+ size: string;
20
+ textSize: string;
21
+ };
22
+ sizeXS: {
23
+ size: string;
24
+ textSize: string;
25
+ };
26
+ sizeXXS: {
27
+ size: string;
28
+ textSize: string;
29
+ };
30
+ };
31
+ export { inputAppearanceSize };
@@ -0,0 +1,14 @@
1
+ declare const inputAppearanceStyle: {
2
+ full: {};
3
+ ghost: {
4
+ fill: string;
5
+ borderWidth: string;
6
+ };
7
+ outlined: {
8
+ fill: string;
9
+ };
10
+ solid: {
11
+ borderWidth: string;
12
+ };
13
+ };
14
+ export { inputAppearanceStyle };
@@ -0,0 +1,20 @@
1
+ declare const inputAppearanceSuccess: {
2
+ successPrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ textColor: string;
7
+ iconBeforeFill: string;
8
+ iconClearFill: string;
9
+ placeholderTextColor: string;
10
+ };
11
+ successSecondary: {
12
+ fill: string;
13
+ borderColor: string;
14
+ borderHover: string;
15
+ iconBeforeFill: string;
16
+ iconClearFill: string;
17
+ placeholderTextColor: string;
18
+ };
19
+ };
20
+ export { inputAppearanceSuccess };
@@ -1,2 +1,2 @@
1
1
  export { Input, inputConfig } from './Input';
2
- export { inputAppearance, inputState } from './Input.appearance';
2
+ export { inputAppearance } from './Input.appearance';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -1,98 +0,0 @@
1
- import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
2
- import { jsx } from 'react/jsx-runtime';
3
- import React from 'react';
4
- import clsx from 'clsx';
5
- import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
6
-
7
- var inputAppearance = {
8
- dev: {
9
- size: 'm',
10
- borderColor: 'surfaceBorderTertiary',
11
- textColor: 'surfaceTextPrimary',
12
- textSize: 'm',
13
- placeholderTextColor: 'surfaceTextSecondary',
14
- shape: 'rounded',
15
- },
16
- };
17
- var inputState = {
18
- filled: {
19
- borderColor: 'surfaceBorderQuaternary',
20
- textColor: 'surfaceTextPrimary',
21
- },
22
- disabled: {
23
- borderColor: 'surfaceBorderDisabled',
24
- borderColorHover: 'surfaceBorderDisabled',
25
- textColor: 'surfaceTextPrimary',
26
- placeholderTextColor: 'surfaceTextDisabled',
27
- },
28
- error: {
29
- borderColor: 'errorBorderPrimary',
30
- placeholderTextColor: 'secondaryTextSecondary',
31
- },
32
- errorFilled: {
33
- borderColor: 'errorBorderPrimary',
34
- textColor: 'surfaceTextPrimary',
35
- },
36
- success: {
37
- borderColor: 'successBorderPrimary',
38
- textColor: 'surfaceTextPrimary',
39
- },
40
- active: {
41
- borderColor: 'surfaceBorderActive',
42
- placeholderTextColor: 'secondaryTextSecondary',
43
- },
44
- activeFilled: {
45
- borderColor: 'surfaceBorderActive',
46
- textColor: 'surfaceTextPrimary',
47
- },
48
- normal: {
49
- borderColor: 'surfaceBorderQuaternary',
50
- placeholderTextColor: 'secondaryTextSecondary',
51
- },
52
- readonly: {
53
- borderColor: 'surfaceBorderDisabled',
54
- textColor: 'surfaceTextPrimary',
55
- },
56
- require: {
57
- borderColor: 'surfaceBorderActive',
58
- textColor: 'surfaceTextPrimary',
59
- },
60
- };
61
-
62
- var inputConfig = {
63
- appearance: inputAppearance,
64
- state: inputState,
65
- setAppearance: function (appearanceConfig) {
66
- inputConfig.appearance = appearanceConfig;
67
- },
68
- setState: function (newComponent) {
69
- inputConfig.state = newComponent;
70
- },
71
- };
72
- var Input = React.forwardRef(function Input(props, ref) {
73
- var id = props.id, className = props.className, _a = props.type, type = _a === void 0 ? 'text' : _a, name = props.name, appearance = props.appearance, isDisabled = props.isDisabled, autocomplete = props.autocomplete, dataTestId = props.dataTestId, index = props.index, placeholder = props.placeholder, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
74
- var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
75
- var _a;
76
- return (__assign(__assign({}, resultConfig), (_a = inputConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
77
- }, {});
78
- // const stateConfig = state && inputConfig.state && inputConfig.state[state]
79
- var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
80
- var fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorDisabledClass = propsGenerator.borderColorDisabledClass, borderWidthClass = propsGenerator.borderWidthClass, borderWidthDisabledClass = propsGenerator.borderWidthDisabledClass, textColorClass = propsGenerator.textColorClass, textColorDisabledClass = propsGenerator.textColorDisabledClass, textSizeClass = propsGenerator.textSizeClass, textWeightClass = propsGenerator.textWeightClass, placeholderTextColorDisabledClass = propsGenerator.placeholderTextColorDisabledClass, caretClass = propsGenerator.caretClass, placeholderTextColorClass = propsGenerator.placeholderTextColorClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
81
- return (jsx("input", { id: String(id), className: clsx(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || textWeightClass) && 'text', caretClass && "caret-color_".concat(caretClass), shapeClass && "input_shape_".concat(shapeClass), textSizeClass && "text_size_".concat(textSizeClass), textWeightClass && "text-weight_".concat(textWeightClass), widthClass && "width_".concat(widthClass), sizeClass && "input_size_".concat(sizeClass), textColorClass && "text-color_".concat(textColorClass), !isDisabled
82
- ? fillClass && "fill_".concat(fillClass)
83
- : fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isDisabled
84
- ? borderWidthClass && "border-width_".concat(borderWidthClass)
85
- : borderWidthDisabledClass &&
86
- "border-width_disabled_".concat(borderWidthDisabledClass), !isDisabled ? fillHoverClass && "fill_hover_".concat(fillHoverClass) : null, !isDisabled
87
- ? borderColorClass && "border-color_".concat(borderColorClass)
88
- : borderColorDisabledClass &&
89
- "border-color_disabled_".concat(borderColorDisabledClass), !isDisabled
90
- ? placeholderTextColorClass &&
91
- "placeholder-text-color_".concat(placeholderTextColorClass)
92
- : placeholderTextColorDisabledClass &&
93
- "placeholder-text-color_disabled_".concat(placeholderTextColorDisabledClass), !isDisabled
94
- ? textColorClass && "text-color_".concat(textColorClass)
95
- : textColorDisabledClass && "text-color_".concat(textColorDisabledClass)), type: type, disabled: isDisabled, autocomplete: autocomplete, "data-test-id": dataTestId || (name ? "".concat(name, "Input") : 'input'), index: index, placeholder: placeholder, ref: ref, value: value, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown }));
96
- });
97
-
98
- export { Input as I, inputAppearance as a, inputState as b, inputConfig as i };