@itcase/ui 1.8.3 → 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.
Files changed (43) hide show
  1. package/dist/{Input_cjs_DkQh0Utd.js → Input_cjs_C8RWS1SD.js} +134 -38
  2. package/dist/Input_es_FXxp51gq.js +195 -0
  3. package/dist/cjs/components/Chips.js +3 -3
  4. package/dist/cjs/components/Choice.js +1 -1
  5. package/dist/cjs/components/DadataHintField.js +1 -1
  6. package/dist/cjs/components/DatePicker.js +11 -11
  7. package/dist/cjs/components/Input.js +1 -2
  8. package/dist/components/Chips.js +3 -3
  9. package/dist/components/Choice.js +1 -1
  10. package/dist/components/DadataHintField.js +1 -1
  11. package/dist/components/DatePicker.js +11 -11
  12. package/dist/components/Input.js +1 -1
  13. package/dist/css/components/Avatar/Avatar.css +4 -4
  14. package/dist/css/components/CookiesWarning/CookiesWarning.css +1 -1
  15. package/dist/css/components/DatePicker/DatePicker.css +3 -3
  16. package/dist/css/components/Icon/Icon.css +1 -1
  17. package/dist/css/components/Input/Input.css +7 -1
  18. package/dist/css/components/ModalSheetBottom/ModalSheetBottom.css +2 -5
  19. package/dist/css/components/Notification/Notification.css +1 -1
  20. package/dist/css/components/Notification/css/__item/notification__item_set_toast.css +1 -1
  21. package/dist/css/components/Pagination/Pagination.css +3 -3
  22. package/dist/css/components/RangeSlider/RangeSlider.css +1 -1
  23. package/dist/css/components/Select/Select.css +11 -5
  24. package/dist/css/components/Select/css/__control/select__control_fill.css +1 -1
  25. package/dist/css/components/Select/css/__menu/select__menu.css +1 -1
  26. package/dist/css/components/Tooltip/Tooltip.css +1 -1
  27. package/dist/css/styles/hover/hover-fill-color.css +6 -4
  28. package/dist/css/styles/hover/hover-item-color.css +6 -4
  29. package/dist/css/styles/hover/hover-text-color.css +6 -4
  30. package/dist/types/components/DatePicker/DatePicker.appearance.d.ts +0 -9
  31. package/dist/types/components/DatePicker/appearance/datePickerSize.d.ts +0 -9
  32. package/dist/types/components/Input/Input.appearance.d.ts +1 -2
  33. package/dist/types/components/Input/Input.interface.d.ts +1 -2
  34. package/dist/types/components/Input/appearance/inputDefault.d.ts +24 -0
  35. package/dist/types/components/Input/appearance/inputDisabled.d.ts +20 -0
  36. package/dist/types/components/Input/appearance/inputError.d.ts +20 -0
  37. package/dist/types/components/Input/appearance/inputRequire.d.ts +20 -0
  38. package/dist/types/components/Input/appearance/inputSize.d.ts +31 -0
  39. package/dist/types/components/Input/appearance/inputStyle.d.ts +14 -0
  40. package/dist/types/components/Input/appearance/inputSuccess.d.ts +20 -0
  41. package/dist/types/components/Input/index.d.ts +1 -1
  42. package/package.json +1 -1
  43. package/dist/Input_es_Bs0gEq3L.js +0 -98
@@ -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
  }
@@ -18,7 +18,7 @@
18
18
  animation-name: cookieMessageClose;
19
19
  }
20
20
  &__inner {
21
- background: var(--color-surface-primary);
21
+ background: var(--color-surface-fill-primary);
22
22
  padding: 32px;
23
23
  position: relative;
24
24
  @media (--mobile) {
@@ -1287,7 +1287,7 @@ h2.react-datepicker__current-month {
1287
1287
  }
1288
1288
  :root {
1289
1289
  --date-picker-padding: 24px 12px;
1290
- --date-picker-fill: var(--color-surface-primary);
1290
+ --date-picker-fill: var(--color-surface-fill-primary);
1291
1291
  --date-picker-box-shadow: 0px 4px 24px 0px rgb(0, 0, 0, 0.2);
1292
1292
  --date-picker-border-radius: 12px;
1293
1293
  --date-picker-border: solid 1px var(--color-surface-tertiary);
@@ -1336,7 +1336,7 @@ h2.react-datepicker__current-month {
1336
1336
  --date-picker-day-range-start-border-radius: 12px 0 0 12px;
1337
1337
  --date-picker-day-range-end-border-radius: 0 12px 12px 0;
1338
1338
 
1339
- --date-picker-day-weekend-background: var(--color-surface-primary);
1339
+ --date-picker-day-weekend-background: var(--color-surface-fill-primary);
1340
1340
  --date-picker-day-weekend-text-color: var(--color-secondary-text-secondary);
1341
1341
  --date-picker-day-weekend-outside-text-color: var(
1342
1342
  --color-secondary-text-disabled
@@ -1349,6 +1349,6 @@ h2.react-datepicker__current-month {
1349
1349
  --date-picker-day-selected-text-color: var(--color-accent-text-primary);
1350
1350
  --date-picker-day-selected-text-hover-color: var(--color-accent-text-primary);
1351
1351
 
1352
- --date-picker-day-outside-background: var(--color-surface-primary);
1352
+ --date-picker-day-outside-background: var(--color-surface-fill-primary);
1353
1353
  --date-picker-day-outside-text-color: var(--color-surface-text-tertiary);
1354
1354
  }
@@ -50,7 +50,7 @@
50
50
  &-$(color) {
51
51
  & svg {
52
52
  stroke: none;
53
- fill: var(--color-$(type)-$(color));
53
+ fill: var(--color-$(type)-fill-$(color));
54
54
  }
55
55
  }
56
56
  }
@@ -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,10 +1,7 @@
1
1
  .modal-sheet-bottom {
2
2
  position: relative;
3
3
  &__container {
4
- background-color: var(
5
- --modal-sheet-bottom-container-background,
6
- var(--color-surface-primary)
7
- ) !important;
4
+ background-color: var(--modal-sheet-bottom-container-background) !important;
8
5
  border-radius: var(--modal-sheet-bottom-container-border-radius) !important;
9
6
  }
10
7
  &__header {
@@ -35,8 +32,8 @@
35
32
  }
36
33
  }
37
34
  :root {
38
- --modal-sheet-bottom-container-background: none;
39
35
  --modal-sheet-bottom-container-border-radius: 0;
40
36
  --modal-sheet-bottom-header-grabber: none;
41
37
  --modal-sheet-bottom-backdrop: 0;
38
+ --modal-sheet-bottom-container-background: var(--color-surface-fill-primary);
42
39
  }
@@ -76,7 +76,7 @@
76
76
  &_set {
77
77
  &_toast {
78
78
  width: 100%;
79
- background: var(--color-surface-primary);
79
+ background: var(--color-surface-fill-primary);
80
80
  border-radius: var(--notification-item-set-toast-border-radius);
81
81
  display: flex;
82
82
  flex-direction: column;
@@ -2,7 +2,7 @@
2
2
  &_set {
3
3
  &_toast {
4
4
  width: 100%;
5
- background: var(--color-surface-primary);
5
+ background: var(--color-surface-fill-primary);
6
6
  border-radius: var(--notification-item-set-toast-border-radius);
7
7
  display: flex;
8
8
  flex-direction: column;
@@ -19,7 +19,7 @@
19
19
  }
20
20
  }
21
21
  &__input {
22
- background: var(--color-surface-primary);
22
+ background: var(--color-surface-fill-primary);
23
23
  border: solid 1px
24
24
  var(--pagination-input-color, --color-surface-border-tertiary);
25
25
  border-radius: 8px;
@@ -130,8 +130,8 @@
130
130
 
131
131
  --paginator-item-transition: all 0.2s ease 0s;
132
132
 
133
- --paginator-item-default-fill: var(--color-surface-primary);
134
- --paginator-item-default-fill-hover: var(--color-surface-primary-hover);
133
+ --paginator-item-default-fill: var(--color-surface-fill-primary);
134
+ --paginator-item-default-fill-hover: var(--color-surface-hover);
135
135
  --paginator-item-default-text: var(--color-surface-text-primary);
136
136
 
137
137
  --paginator-item-active-fill: var(--color-accent-primary);
@@ -317,7 +317,7 @@
317
317
  accent, disabled, hover {
318
318
  &-$(color) {
319
319
  & .rc-slider-rail {
320
- background: var(--color-$(type)-$(color));
320
+ background: var(--color-$(type)-fill-$(color));
321
321
  }
322
322
  }
323
323
  }
@@ -117,7 +117,7 @@
117
117
  @each $color in primary, secondary, tertiary, quaternary, quinary,
118
118
  senary, accent, disabled, hover {
119
119
  &-$(color) {
120
- background: var(--color-$(type)-$(color));
120
+ background: var(--color-$(type)-fill-$(color));
121
121
  }
122
122
  }
123
123
  }
@@ -220,7 +220,7 @@
220
220
  .select {
221
221
  &__menu {
222
222
  width: 100%;
223
- background: var(--color-surface-primary);
223
+ background: var(--color-surface-fill-primary);
224
224
  padding: 12px 0;
225
225
  margin: var(--select-menu-margin);
226
226
  border-radius: var(--select-menu-border-radius);
@@ -385,11 +385,16 @@
385
385
  --select-menu-border-radius: 12px;
386
386
  --select-menu-margin: 0;
387
387
 
388
- --select-multi-value-padding: 2px 6px;
389
-
390
388
  --select-control-shape-rounded: 8px;
391
389
 
392
- --select-success-border: var(--color-surface-border-tertiary);
390
+ --select-background: var(--color-surface-fill-primary);
391
+ --select-background-hover: var(--color-surface-fill-hover);
392
+ --select-focus-background: var(--color-surface-fill-primary);
393
+ --select-focus-border: var(--color-surface-border-quaternary);
394
+ --select-success-border: var(--color-success-border-secondary);
395
+ --select-success-border-hover: var(--color-surface-border-quaternary);
396
+ --select-error-border: var(--color-error-border-secondary);
397
+ --select-error-hover: var(--color-error-border-secondary);
393
398
 
394
399
  --select-menu-list-item-xxl-padding: 18px 25px;
395
400
  --select-menu-list-item-xl-padding: 14px 20px;
@@ -398,5 +403,6 @@
398
403
  --select-menu-list-item-s-padding: 6px 10px;
399
404
  --select-menu-list-item-xs-padding: 2px 8px;
400
405
 
406
+ --select-multi-value-padding: 2px 6px;
401
407
  --select-multi-value-border-radius: 0;
402
408
  }
@@ -7,7 +7,7 @@
7
7
  @each $color in primary, secondary, tertiary, quaternary, quinary,
8
8
  senary, accent, disabled, hover {
9
9
  &-$(color) {
10
- background: var(--color-$(type)-$(color));
10
+ background: var(--color-$(type)-fill-$(color));
11
11
  }
12
12
  }
13
13
  }
@@ -1,7 +1,7 @@
1
1
  .select {
2
2
  &__menu {
3
3
  width: 100%;
4
- background: var(--color-surface-primary);
4
+ background: var(--color-surface-fill-primary);
5
5
  padding: 12px 0;
6
6
  margin: var(--select-menu-margin);
7
7
  border-radius: var(--select-menu-border-radius);
@@ -163,7 +163,7 @@
163
163
  --tooltip-arrow-height: 14px;
164
164
  --tooltip-arrow-radius: 2px;
165
165
 
166
- --tooltip-arrow-color: var(--color-surface-primary);
166
+ --tooltip-arrow-color: var(--color-surface-fill-primary);
167
167
  --tooltip-shape-rounded-default: 0;
168
168
 
169
169
  /* Size */
@@ -1,10 +1,12 @@
1
1
  .hover-fill-color {
2
- @each $type in accent, primary, secondary, tertiary, quaternary, quinary, senary, surface, success, error, info, warning {
3
- &_$(type) {
4
- @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
2
+ @each $type in accent, primary, secondary, tertiary, quaternary, surface,
3
+ error, success, warning, info, danger, gradient, disabled, hover, inverse {
4
+ @each $color in primary, secondary, tertiary, quaternary, accent, disabled,
5
+ hover, inverse {
6
+ &_$(type) {
5
7
  &-$(color) {
6
8
  &:hover {
7
- background: var(--color-$(type)-$(color));
9
+ background: var(--color-$(type)-fill-$(color));
8
10
  }
9
11
  }
10
12
  }
@@ -1,8 +1,10 @@
1
1
  .hover-item-color {
2
- @each $type in accent, primary, secondary, tertiary, quaternary, quinary, senary, surface, success, error, info, warning {
3
- &_$(type) {
4
- &-item {
5
- @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
2
+ @each $type in accent, primary, secondary, tertiary, quaternary, surface,
3
+ error, success, warning, info, danger, gradient, disabled, hover, inverse {
4
+ @each $color in primary, secondary, tertiary, quaternary, accent, disabled,
5
+ hover, inverse {
6
+ &_$(type) {
7
+ &-item {
6
8
  &-$(color) {
7
9
  &:hover {
8
10
  color: var(--color-$(type)-item-$(color));
@@ -1,8 +1,10 @@
1
1
  .hover-text-color {
2
- @each $type in accent, primary, secondary, tertiary, quaternary, quinary, senary, surface, success, error, info, warning {
3
- &_$(type) {
4
- &-text {
5
- @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
2
+ @each $type in accent, primary, secondary, tertiary, quaternary, surface,
3
+ error, success, warning, info, danger, gradient, disabled, hover, inverse {
4
+ @each $color in primary, secondary, tertiary, quaternary, accent, disabled,
5
+ hover, inverse {
6
+ &_$(type) {
7
+ &-text {
6
8
  &-$(color) {
7
9
  &:hover {
8
10
  color: var(--color-$(type)-text-$(color));
@@ -27,13 +27,10 @@ export declare const datePickerAppearance: {
27
27
  daySize: string;
28
28
  dayTextSize: string;
29
29
  iconFillSize: number;
30
- iconLeft: any;
31
- iconRight: any;
32
30
  };
33
31
  inputProps: {
34
32
  size: string;
35
33
  textSize: string;
36
- clearIcon: any;
37
34
  clearIconSize: number;
38
35
  clearLabelTextSize: string;
39
36
  };
@@ -43,13 +40,10 @@ export declare const datePickerAppearance: {
43
40
  daySize: string;
44
41
  dayTextSize: string;
45
42
  iconFillSize: number;
46
- iconLeft: any;
47
- iconRight: any;
48
43
  };
49
44
  inputProps: {
50
45
  size: string;
51
46
  textSize: string;
52
- clearIcon: any;
53
47
  clearIconSize: number;
54
48
  clearLabelTextSize: string;
55
49
  };
@@ -59,13 +53,10 @@ export declare const datePickerAppearance: {
59
53
  daySize: string;
60
54
  dayTextSize: string;
61
55
  iconFillSize: number;
62
- iconLeft: any;
63
- iconRight: any;
64
56
  };
65
57
  inputProps: {
66
58
  size: string;
67
59
  textSize: string;
68
- clearIcon: any;
69
60
  clearIconSize: number;
70
61
  clearLabelTextSize: string;
71
62
  };
@@ -4,13 +4,10 @@ declare const datePickerSize: {
4
4
  daySize: string;
5
5
  dayTextSize: string;
6
6
  iconFillSize: number;
7
- iconLeft: any;
8
- iconRight: any;
9
7
  };
10
8
  inputProps: {
11
9
  size: string;
12
10
  textSize: string;
13
- clearIcon: any;
14
11
  clearIconSize: number;
15
12
  clearLabelTextSize: string;
16
13
  };
@@ -20,13 +17,10 @@ declare const datePickerSize: {
20
17
  daySize: string;
21
18
  dayTextSize: string;
22
19
  iconFillSize: number;
23
- iconLeft: any;
24
- iconRight: any;
25
20
  };
26
21
  inputProps: {
27
22
  size: string;
28
23
  textSize: string;
29
- clearIcon: any;
30
24
  clearIconSize: number;
31
25
  clearLabelTextSize: string;
32
26
  };
@@ -36,13 +30,10 @@ declare const datePickerSize: {
36
30
  daySize: string;
37
31
  dayTextSize: string;
38
32
  iconFillSize: number;
39
- iconLeft: any;
40
- iconRight: any;
41
33
  };
42
34
  inputProps: {
43
35
  size: string;
44
36
  textSize: string;
45
- clearIcon: any;
46
37
  clearIconSize: number;
47
38
  clearLabelTextSize: string;
48
39
  };
@@ -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.3",
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 };