@true-engineering/true-react-common-ui-kit 3.45.1 → 4.0.0-alpha0

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 (122) hide show
  1. package/README.md +0 -40
  2. package/dist/components/CloseButton/CloseButton.d.ts +1 -1
  3. package/dist/components/ControlGroup/ControlGroup.d.ts +10 -0
  4. package/dist/components/ControlGroup/ControlGroup.stories.d.ts +7 -0
  5. package/dist/components/ControlGroup/ControlGroup.styles.d.ts +3 -0
  6. package/dist/components/ControlGroup/index.d.ts +2 -0
  7. package/dist/components/ControlWrapper/ControlWrapper.d.ts +27 -0
  8. package/dist/components/ControlWrapper/ControlWrapper.stories.d.ts +6 -0
  9. package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +6 -0
  10. package/dist/components/ControlWrapper/index.d.ts +2 -0
  11. package/dist/components/DateInput/DateInput.d.ts +3 -3
  12. package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +1 -1
  13. package/dist/components/DatePicker/types.d.ts +1 -1
  14. package/dist/components/FiltersPane/FiltersPane.stories.d.ts +1 -2
  15. package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.d.ts +1 -1
  16. package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.d.ts +1 -2
  17. package/dist/components/Input/Input.d.ts +5 -52
  18. package/dist/components/Input/Input.stories.d.ts +4 -13
  19. package/dist/components/Input/Input.styles.d.ts +5 -4
  20. package/dist/components/Input/InputBase.d.ts +24 -0
  21. package/dist/components/Input/index.d.ts +1 -0
  22. package/dist/components/Input/types.d.ts +3 -4
  23. package/dist/components/NumberInput/NumberInput.d.ts +3 -3
  24. package/dist/components/PhoneInput/PhoneInput.d.ts +3 -3
  25. package/dist/components/PhoneInput/PhoneInput.stories.d.ts +2 -2
  26. package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.d.ts +3 -2
  27. package/dist/components/PhoneInput/types.d.ts +2 -0
  28. package/dist/components/SearchInput/SearchInput.d.ts +1 -3
  29. package/dist/components/SearchInput/SearchInput.stories.d.ts +11 -1
  30. package/dist/components/SearchInput/SearchInput.styles.d.ts +1 -1
  31. package/dist/components/Select/Select.d.ts +5 -5
  32. package/dist/components/Select/Select.styles.d.ts +17 -16
  33. package/dist/components/Select/types.d.ts +3 -0
  34. package/dist/components/SmartInput/SmartInput.d.ts +3 -3
  35. package/dist/components/TextArea/TextArea.d.ts +5 -14
  36. package/dist/components/TextArea/TextArea.styles.d.ts +8 -2
  37. package/dist/components/WithPopup/WithPopup.d.ts +3 -10
  38. package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
  39. package/dist/components/WithPopup/types.d.ts +0 -3
  40. package/dist/components/WithTooltip/WithTooltip.styles.d.ts +0 -1
  41. package/dist/components/index.d.ts +2 -0
  42. package/dist/theme/common.d.ts +13 -5
  43. package/dist/theme/types.d.ts +4 -2
  44. package/dist/true-react-common-ui-kit.js +1184 -1029
  45. package/dist/true-react-common-ui-kit.js.map +1 -1
  46. package/dist/true-react-common-ui-kit.umd.cjs +1164 -1009
  47. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  48. package/dist/types.d.ts +2 -1
  49. package/package.json +1 -1
  50. package/src/components/Button/Button.stories.tsx +4 -8
  51. package/src/components/CloseButton/CloseButton.tsx +4 -4
  52. package/src/components/ControlGroup/ControlGroup.stories.tsx +40 -0
  53. package/src/components/ControlGroup/ControlGroup.styles.ts +46 -0
  54. package/src/components/ControlGroup/ControlGroup.tsx +55 -0
  55. package/src/components/ControlGroup/index.ts +2 -0
  56. package/src/components/ControlWrapper/ControlWrapper.stories.tsx +45 -0
  57. package/src/components/ControlWrapper/ControlWrapper.styles.ts +185 -0
  58. package/src/components/ControlWrapper/ControlWrapper.tsx +151 -0
  59. package/src/components/ControlWrapper/index.ts +2 -0
  60. package/src/components/DateInput/DateInput.styles.ts +2 -7
  61. package/src/components/DateInput/DateInput.tsx +4 -4
  62. package/src/components/DatePicker/DatePicker.tsx +3 -3
  63. package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.ts +7 -41
  64. package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.tsx +18 -26
  65. package/src/components/DatePicker/types.ts +1 -1
  66. package/src/components/FileItem/FileItem.stories.tsx +4 -8
  67. package/src/components/FiltersPane/FiltersPane.stories.tsx +0 -4
  68. package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +9 -7
  69. package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +1 -8
  70. package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +7 -5
  71. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +7 -9
  72. package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +12 -17
  73. package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +2 -5
  74. package/src/components/IconButton/IconButton.stories.tsx +5 -5
  75. package/src/components/IncrementInput/IncrementInput.stories.tsx +0 -2
  76. package/src/components/IncrementInput/IncrementInput.styles.ts +9 -9
  77. package/src/components/Input/Input.stories.tsx +17 -25
  78. package/src/components/Input/Input.styles.ts +50 -260
  79. package/src/components/Input/Input.tsx +22 -285
  80. package/src/components/Input/InputBase.tsx +250 -0
  81. package/src/components/Input/index.ts +1 -0
  82. package/src/components/Input/types.ts +3 -32
  83. package/src/components/MultiSelectList/MultiSelectList.styles.ts +7 -5
  84. package/src/components/Notification/Notification.stories.tsx +2 -6
  85. package/src/components/NumberInput/NumberInput.stories.tsx +0 -2
  86. package/src/components/NumberInput/NumberInput.tsx +4 -7
  87. package/src/components/PhoneInput/PhoneInput.stories.tsx +6 -10
  88. package/src/components/PhoneInput/PhoneInput.styles.ts +13 -10
  89. package/src/components/PhoneInput/PhoneInput.tsx +9 -12
  90. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.ts +6 -4
  91. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +6 -6
  92. package/src/components/PhoneInput/types.ts +4 -0
  93. package/src/components/SearchInput/SearchInput.stories.tsx +1 -0
  94. package/src/components/SearchInput/SearchInput.styles.ts +17 -27
  95. package/src/components/SearchInput/SearchInput.tsx +13 -34
  96. package/src/components/Select/CustomSelect.stories.tsx +6 -9
  97. package/src/components/Select/MultiSelect.stories.tsx +4 -12
  98. package/src/components/Select/Select.stories.tsx +3 -11
  99. package/src/components/Select/Select.styles.ts +28 -42
  100. package/src/components/Select/Select.tsx +73 -81
  101. package/src/components/Select/types.ts +5 -0
  102. package/src/components/SmartInput/SmartInput.stories.tsx +0 -1
  103. package/src/components/SmartInput/SmartInput.tsx +4 -4
  104. package/src/components/Status/Status.stories.tsx +3 -7
  105. package/src/components/TextArea/TextArea.stories.tsx +1 -3
  106. package/src/components/TextArea/TextArea.styles.ts +27 -126
  107. package/src/components/TextArea/TextArea.tsx +86 -112
  108. package/src/components/TextButton/TextButton.stories.tsx +4 -8
  109. package/src/components/WithPopup/WithPopup.stories.tsx +0 -1
  110. package/src/components/WithPopup/WithPopup.styles.ts +0 -2
  111. package/src/components/WithPopup/WithPopup.tsx +10 -36
  112. package/src/components/WithPopup/types.ts +0 -7
  113. package/src/components/WithTooltip/WithTooltip.styles.ts +0 -6
  114. package/src/components/WithTooltip/WithTooltip.tsx +2 -7
  115. package/src/components/index.ts +2 -0
  116. package/src/theme/common.ts +15 -6
  117. package/src/theme/types.ts +8 -4
  118. package/src/types.ts +3 -0
  119. package/dist/components/Input/constants.d.ts +0 -1
  120. package/dist/components/WithPopup/helpers.d.ts +0 -2
  121. package/src/components/Input/constants.ts +0 -1
  122. package/src/components/WithPopup/helpers.ts +0 -9
@@ -1,9 +1,6 @@
1
- import { ITweakStyles, createThemedStyles } from '../../../../theme';
1
+ import { createThemedStyles, ITweakStyles } from '../../../../theme';
2
2
  import { ISelectStyles } from '../../../Select';
3
3
 
4
- const SELECT_PADDING_LEFT = 12;
5
- const SELECT_PADDING_RIGHT = 24;
6
-
7
4
  export const useStyles = createThemedStyles('DatePickerHeader', {
8
5
  btn: {
9
6
  width: 36,
@@ -12,34 +9,10 @@ export const useStyles = createThemedStyles('DatePickerHeader', {
12
9
  boxSizing: 'border-box',
13
10
  border: 'none',
14
11
  outline: 'none',
15
-
16
12
  cursor: 'pointer',
17
13
  marginLeft: 8,
18
14
  },
19
15
 
20
- select: {
21
- height: 35,
22
- fontSize: 16,
23
- position: 'relative',
24
- },
25
-
26
- selectValue: {
27
- fontSize: 16,
28
- fontWeight: 'bold',
29
- color: 'transparent',
30
- pointerEvents: 'none',
31
- paddingLeft: SELECT_PADDING_LEFT,
32
- paddingRight: SELECT_PADDING_RIGHT,
33
- },
34
-
35
- selectControl: {
36
- position: 'absolute',
37
- top: 0,
38
- left: 0,
39
- width: '100%',
40
- height: '100%',
41
- },
42
-
43
16
  header: {
44
17
  margin: 6,
45
18
  display: 'flex',
@@ -60,24 +33,17 @@ export const selectStyles: ISelectStyles = {
60
33
  },
61
34
  },
62
35
 
63
- arrow: {
64
- right: 0,
65
- top: 9,
66
- width: 16,
67
- height: 16,
68
- },
69
-
70
36
  tweakInput: {
71
- inputWrapper: {
72
- height: 35,
73
- border: 'none',
37
+ tweakControlWrapper: {
38
+ root: {
39
+ '--control-height': '35px',
40
+ border: 'none',
41
+ },
74
42
  },
75
43
 
76
- input: {
44
+ inputContent: {
77
45
  fontSize: 16,
78
46
  fontWeight: 'bold',
79
- paddingRight: SELECT_PADDING_RIGHT - 8,
80
- paddingLeft: SELECT_PADDING_LEFT,
81
47
  },
82
48
  },
83
49
  };
@@ -1,11 +1,11 @@
1
1
  import { FC, useMemo } from 'react';
2
2
  import { ReactDatePickerCustomHeaderProps as BaseProps } from 'react-datepicker';
3
- import { getYear, getMonth } from 'date-fns';
3
+ import { getMonth, getYear } from 'date-fns';
4
4
  import { useTweakStyles } from '../../../../hooks';
5
5
  import { ICommonProps } from '../../../../types';
6
6
  import { Icon } from '../../../Icon';
7
7
  import { Select } from '../../../Select';
8
- import { useStyles, IDatePickerHeaderStyles, selectStyles } from './DatePickerHeader.styles';
8
+ import { IDatePickerHeaderStyles, selectStyles, useStyles } from './DatePickerHeader.styles';
9
9
 
10
10
  export interface IDatePickerHeaderProps
11
11
  extends BaseProps,
@@ -40,30 +40,22 @@ export const DatePickerHeader: FC<IDatePickerHeaderProps> = ({
40
40
 
41
41
  return (
42
42
  <div className={classes.header}>
43
- <div className={classes.select}>
44
- <div className={classes.selectValue}>{months[getMonth(date)]}</div>
45
- <div className={classes.selectControl}>
46
- <Select
47
- value={months[getMonth(date)]}
48
- options={months}
49
- dropdownIcon="chevron-down-small"
50
- tweakStyles={tweakSelectStyles}
51
- onChange={(value) => changeMonth(months.indexOf(value as string))}
52
- />
53
- </div>
54
- </div>
55
- <div className={classes.select}>
56
- <div className={classes.selectValue}>{getYear(date)}</div>
57
- <div className={classes.selectControl}>
58
- <Select
59
- value={getYear(date)}
60
- options={years}
61
- dropdownIcon="chevron-down-small"
62
- tweakStyles={tweakSelectStyles}
63
- onChange={(value) => changeYear(value as number)}
64
- />
65
- </div>
66
- </div>
43
+ <Select
44
+ value={months[getMonth(date)]}
45
+ options={months}
46
+ dropdownIcon="chevron-down-small"
47
+ isAutoSized
48
+ tweakStyles={tweakSelectStyles}
49
+ onChange={(value) => changeMonth(months.indexOf(value as string))}
50
+ />
51
+ <Select
52
+ value={getYear(date)}
53
+ options={years}
54
+ dropdownIcon="chevron-down-small"
55
+ isAutoSized
56
+ tweakStyles={tweakSelectStyles}
57
+ onChange={(value) => changeYear(value as number)}
58
+ />
67
59
 
68
60
  <div className={classes.buttons}>
69
61
  <button
@@ -40,7 +40,7 @@ export type IDatePickerBaseProps = Pick<
40
40
  | 'endDate'
41
41
  | 'isRange'
42
42
  | 'isActive'
43
- | 'iconType'
43
+ | 'icon'
44
44
  | 'maxLength'
45
45
  | 'onChange'
46
46
  | 'onClick'
@@ -2,7 +2,7 @@ import { format } from 'date-fns';
2
2
  import { ru } from 'date-fns/locale';
3
3
  import { ComponentStory } from '@storybook/react';
4
4
  import { FILE_ITEM_SIZES } from '../FileItem/constants';
5
- import { IIconType, iconsList } from '../Icon';
5
+ import { iconsList, IIconType } from '../Icon';
6
6
  import { complexIcons } from '../Icon/complexIcons';
7
7
  import { FileItem, IFileItemProps } from './FileItem';
8
8
 
@@ -11,11 +11,7 @@ export default {
11
11
  component: FileItem,
12
12
  };
13
13
 
14
- const iconTypes = [
15
- undefined,
16
- ...Object.keys(iconsList),
17
- ...Object.keys(complexIcons),
18
- ] as IIconType[];
14
+ const icons = [undefined, ...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
19
15
 
20
16
  const preloaderTypes: Array<IFileItemProps['preloaderType']> = ['dots', 'default', 'logo'];
21
17
 
@@ -50,8 +46,8 @@ Default.args = {
50
46
  };
51
47
 
52
48
  Default.argTypes = {
53
- icon: { options: iconTypes, control: 'select' },
54
- removeIcon: { options: iconTypes, control: 'select' },
49
+ icon: { options: icons, control: 'select' },
50
+ removeIcon: { options: icons, control: 'select' },
55
51
  itemSize: { options: FILE_ITEM_SIZES, control: 'inline-radio' },
56
52
  preloaderType: { options: preloaderTypes, control: 'inline-radio' },
57
53
  };
@@ -73,7 +73,6 @@ type ConfigValues = {
73
73
  interface IFiltersPaneWithCustomProps<Values, Content> extends IFiltersPaneProps<Values, Content> {
74
74
  containerWidth: number;
75
75
  isSearchDisabled: boolean;
76
- isSearchAutosizeable: boolean;
77
76
  shouldShowSettingsButton: boolean;
78
77
  withFieldNameInLabel: boolean;
79
78
  isGroupingEnabled: boolean;
@@ -84,7 +83,6 @@ interface IFiltersPaneWithCustomProps<Values, Content> extends IFiltersPaneProps
84
83
  function FiltersPaneWithCustomProps<Values, Content>({
85
84
  containerWidth,
86
85
  isSearchDisabled,
87
- isSearchAutosizeable,
88
86
  shouldShowSettingsButton,
89
87
  withFieldNameInLabel,
90
88
  isGroupingEnabled,
@@ -239,7 +237,6 @@ function FiltersPaneWithCustomProps<Values, Content>({
239
237
  fields: ['interval', 'name'] as Array<keyof ConfigValues>,
240
238
  getValueView: convertFieldToString,
241
239
  onChange: setSearchValue,
242
- isAutoSizeable: isSearchAutosizeable,
243
240
  isDisabled: isSearchDisabled,
244
241
  }}
245
242
  enabledFilters={[
@@ -287,7 +284,6 @@ export const Default = Template.bind({});
287
284
 
288
285
  Default.args = {
289
286
  shouldShowSettingsButton: false,
290
- isSearchAutosizeable: true,
291
287
  isSearchDisabled: false,
292
288
  hasClearButton: true,
293
289
  isClearableFields: false,
@@ -40,14 +40,16 @@ export const inputStyles: IInputStyles = {
40
40
  minWidth: 120,
41
41
  },
42
42
 
43
- icon: {
44
- padding: 0,
45
- width: 24,
46
-
47
- '&:last-child': {
48
- paddingRight: 0,
43
+ tweakControlWrapper: {
44
+ icon: {
45
+ padding: 0,
46
+ width: 24,
47
+
48
+ '&:last-child': {
49
+ paddingRight: 0,
50
+ },
49
51
  },
50
- },
52
+ }
51
53
  };
52
54
 
53
55
  export const clearButtonStyles = cloneDeep(innerTextButtonStyles);
@@ -7,12 +7,7 @@ import { Button } from '../../../Button';
7
7
  import { NumberInput } from '../../../NumberInput';
8
8
  import { getLocale, sortValues } from '../../helpers';
9
9
  import { IFilterLocaleKey, IPartialFilterLocale } from '../../types';
10
- import {
11
- useStyles,
12
- IFilterIntervalStyles,
13
- inputStyles,
14
- clearButtonStyles,
15
- } from './FilterInterval.styles';
10
+ import { clearButtonStyles, IFilterIntervalStyles, inputStyles, useStyles } from './FilterInterval.styles';
16
11
 
17
12
  export interface IFilterIntervalProps extends ICommonProps<IFilterIntervalStyles> {
18
13
  value?: Array<number | undefined>;
@@ -98,7 +93,6 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
98
93
  ? `${labelName} ${translates.from.toLocaleLowerCase()}`
99
94
  : translates.from
100
95
  }
101
- border="bottom"
102
96
  canBeFloat={canBeFloat}
103
97
  isClearable
104
98
  min={fromInput?.min}
@@ -122,7 +116,6 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
122
116
  ? `${labelName} ${translates.to.toLocaleLowerCase()}`
123
117
  : translates.to
124
118
  }
125
- border="bottom"
126
119
  canBeFloat={canBeFloat}
127
120
  isClearable
128
121
  min={toInput?.min}
@@ -122,11 +122,13 @@ export const useStyles = createThemedStyles('FilterSelect', {
122
122
 
123
123
  export const searchInputStyles: ISearchInputStyles = {
124
124
  tweakInput: {
125
- inputWrapper: {
126
- backgroundColor: 'transparent',
127
- border: 'none',
128
- height: 40,
129
- },
125
+ tweakControlWrapper: {
126
+ root: {
127
+ '--control-height': '40px',
128
+ backgroundColor: 'transparent',
129
+ border: 'none',
130
+ },
131
+ }
130
132
  },
131
133
  };
132
134
 
@@ -1,4 +1,4 @@
1
- import { useState, useMemo, useRef, FC } from 'react';
1
+ import { FC, useMemo, useRef, useState } from 'react';
2
2
  import { isAfter, isBefore } from 'date-fns';
3
3
  import enUS from 'date-fns/locale/en-US';
4
4
  import ru from 'date-fns/locale/ru';
@@ -11,20 +11,20 @@ import { DatePicker } from '../../../DatePicker';
11
11
  import { DEFAULT_PICKER_PROPS } from '../../constants';
12
12
  import { getLocale } from '../../helpers';
13
13
  import {
14
- IFilterWithDateDatePickerProps,
15
14
  IFilterLocaleKey,
15
+ IFilterWithDateDatePickerProps,
16
16
  IFilterWithDatesValue,
17
17
  IPartialFilterLocale,
18
18
  } from '../../types';
19
19
  import {
20
- useStyles,
21
- IFilterWithDatesStyles,
22
- clearButtonStyles,
23
20
  backButtonStyles,
24
- startDatePickerWithButtonStyles,
25
- startDatePickerStyles,
21
+ clearButtonStyles,
26
22
  endDatePickerStyles,
27
23
  endDatePickerWithButtonStyles,
24
+ IFilterWithDatesStyles,
25
+ startDatePickerStyles,
26
+ startDatePickerWithButtonStyles,
27
+ useStyles,
28
28
  } from './FilterWithDates.styles';
29
29
 
30
30
  export interface IFilterWithDatesProps extends ICommonProps<IFilterWithDatesStyles> {
@@ -139,7 +139,6 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
139
139
  locale={dateLocale}
140
140
  onChangeDate={handleChangeFrom}
141
141
  tweakStyles={tweakStartDatePickerStyles}
142
- border="bottom"
143
142
  testId={getTestId(testId, 'from')}
144
143
  isClearable={isClearable}
145
144
  {...startPickerProps}
@@ -154,7 +153,6 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
154
153
  locale={dateLocale}
155
154
  onChangeDate={handleChangeTo}
156
155
  tweakStyles={tweakEndDatePickerStyles}
157
- border="bottom"
158
156
  testId={getTestId(testId, 'to')}
159
157
  isClearable={isClearable}
160
158
  {...endPickerProps}
@@ -1,11 +1,5 @@
1
1
  import { rgba } from '../../../../helpers';
2
- import {
3
- animations,
4
- colors,
5
- createThemedStyles,
6
- dimensions,
7
- ITweakStyles,
8
- } from '../../../../theme';
2
+ import { animations, colors, createThemedStyles, dimensions, ITweakStyles } from '../../../../theme';
9
3
  import { ISearchInputStyles } from '../../../SearchInput';
10
4
  import { ISelectStyles } from '../../../Select';
11
5
  import { FILTER_HEIGHT } from '../../FiltersPane.styles';
@@ -89,17 +83,18 @@ export const useStyles = createThemedStyles('FiltersPaneSearch', {
89
83
 
90
84
  export const searchInputStyles: ISearchInputStyles = {
91
85
  tweakInput: {
92
- inputWrapper: {
93
- backgroundColor: 'transparent',
94
- border: 'none',
95
- height: FILTER_HEIGHT - 2,
96
- fontSize: 14,
97
- minWidth: 140,
98
- },
86
+ tweakControlWrapper: {
87
+ root: {
88
+ '--control-height': `${FILTER_HEIGHT - 2}px`,
89
+ backgroundColor: 'transparent',
90
+ border: 'none',
91
+ minWidth: 140,
92
+ },
99
93
 
100
- focused: {
101
- backgroundColor: 'transparent',
102
- border: 'none',
94
+ focused: {
95
+ backgroundColor: 'transparent',
96
+ border: 'none',
97
+ },
103
98
  },
104
99
  },
105
100
  };
@@ -1,4 +1,4 @@
1
- import { useRef, useState, useMemo, ReactNode } from 'react';
1
+ import { ReactNode, useMemo, useRef, useState } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { addDataAttributes } from '../../../../helpers';
4
4
  import { useOnClickOutside, useTweakStyles } from '../../../../hooks';
@@ -9,10 +9,10 @@ import { getLocale } from '../../helpers';
9
9
  import { IFilterLocaleKey, IFiltersPaneSearchPayload, IPartialFilterLocale } from '../../types';
10
10
  import { FilterSelect } from '../FilterSelect';
11
11
  import {
12
- useStyles,
13
12
  IFiltersPaneSearchStyles,
14
13
  searchInputStyles,
15
14
  selectStyles,
15
+ useStyles,
16
16
  } from './FiltersPaneSearch.styles';
17
17
 
18
18
  export interface IFiltersPaneSearchProps<Value> extends ICommonProps<IFiltersPaneSearchStyles> {
@@ -29,7 +29,6 @@ export interface IFiltersPaneSearchProps<Value> extends ICommonProps<IFiltersPan
29
29
  hasClearSelectButton?: boolean;
30
30
  isDisabled?: boolean;
31
31
  isSelectSearchEnabled?: boolean;
32
- isAutoSizeable?: boolean;
33
32
  }
34
33
 
35
34
  export function FiltersPaneSearch<Value>({
@@ -45,7 +44,6 @@ export function FiltersPaneSearch<Value>({
45
44
  hasClearSelectButton,
46
45
  isDisabled = false,
47
46
  isSelectSearchEnabled = true,
48
- isAutoSizeable = true,
49
47
  maxLength,
50
48
  data,
51
49
  tweakStyles,
@@ -115,7 +113,6 @@ export function FiltersPaneSearch<Value>({
115
113
  onBlur={() => setIsInputFocused(false)}
116
114
  testId={testId !== undefined ? `${testId}-input` : undefined}
117
115
  maxLength={maxLength}
118
- isAutoSizeable={isAutoSizeable}
119
116
  isDisabled={isDisabled}
120
117
  />
121
118
 
@@ -1,16 +1,16 @@
1
- import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { IIconType, iconsList } from '../Icon';
1
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
2
+ import { iconsList, IIconType } from '../Icon';
3
3
  import { complexIcons } from '../Icon/complexIcons';
4
4
  import { IconButton } from './IconButton';
5
5
  import { ICON_BUTTON_SIZES, ICON_BUTTON_VIEWS } from './constants';
6
6
 
7
- const iconTypes = [...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
7
+ const icons = [...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
8
8
 
9
9
  export default {
10
10
  title: 'Buttons/IconButton',
11
11
  component: IconButton,
12
12
  args: {
13
- icon: iconTypes[0],
13
+ icon: icons[0],
14
14
  view: 'main',
15
15
  size: 'm',
16
16
  isDisabled: false,
@@ -18,7 +18,7 @@ export default {
18
18
  isActive: false,
19
19
  },
20
20
  argTypes: {
21
- icon: { options: iconTypes, control: 'select' },
21
+ icon: { options: icons, control: 'select' },
22
22
  size: { options: ICON_BUTTON_SIZES, control: 'inline-radio' },
23
23
  view: { options: ICON_BUTTON_VIEWS, control: 'inline-radio' },
24
24
  },
@@ -21,8 +21,6 @@ Default.args = {
21
21
  intPartPrecision: 10,
22
22
  label: 'Label',
23
23
  placeholder: 'Placeholder',
24
- hasFloatingLabel: true,
25
- hasRequiredLabel: true,
26
24
  isInvalid: false,
27
25
  errorMessage: 'Error Text',
28
26
  isDisabled: false,
@@ -1,4 +1,4 @@
1
- import { colors, dimensions, ITweakStyles, createThemedStyles, animations } from '../../theme';
1
+ import { animations, colors, createThemedStyles, dimensions, ITweakStyles } from '../../theme';
2
2
  import { IInputStyles } from '../Input';
3
3
 
4
4
  export const BUTTONS_WIDTH = 36;
@@ -19,12 +19,12 @@ export const useStyles = createThemedStyles('IncrementInput', {
19
19
  right: BUTTONS_GAP,
20
20
  top: BUTTONS_GAP,
21
21
  bottom: BUTTONS_GAP,
22
- zIndex: 1,
22
+ zIndex: dimensions.Z_INDEX.CONTROL_FOCUS + 1,
23
23
  },
24
24
 
25
25
  button: {
26
26
  width: '100%',
27
- height: (dimensions.CONTROL_HEIGHT - 5) / 2,
27
+ height: (dimensions.CONTROL.HEIGHT - 5) / 2,
28
28
  border: 'none',
29
29
  outline: 'none',
30
30
  backgroundColor: colors.GREY_BACKGROUND,
@@ -65,14 +65,14 @@ export const useStyles = createThemedStyles('IncrementInput', {
65
65
 
66
66
  export const inputStyles: IInputStyles = {
67
67
  input: {
68
- '&:not($withControls)': {
69
- paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
70
- },
71
- },
72
-
73
- controls: {
74
68
  paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
75
69
  },
70
+
71
+ tweakControlWrapper: {
72
+ controls: {
73
+ paddingRight: BUTTONS_WIDTH + BUTTONS_GAP,
74
+ },
75
+ }
76
76
  };
77
77
 
78
78
  export type IIncrementInputStyles = ITweakStyles<typeof useStyles, { tweakInput: IInputStyles }>;
@@ -1,10 +1,10 @@
1
1
  import { useState } from 'react';
2
2
  import { ComponentStory } from '@storybook/react';
3
3
  import { iconsList } from '../Icon';
4
- import { Input, IInputProps } from './Input';
4
+ import { IInputProps, Input } from './Input';
5
5
 
6
6
  const types: Array<IInputProps['type']> = ['text', 'password', 'email', 'number'];
7
- const inlineStyles = [
7
+ const groupPositions = [
8
8
  undefined,
9
9
  'top',
10
10
  'bottom',
@@ -17,20 +17,16 @@ const inlineStyles = [
17
17
  'middle',
18
18
  ];
19
19
  const masks = [undefined, '99/99', 'aaa-aaa', '***+***'];
20
- const iconTypes = [undefined, ...Object.keys(iconsList)];
21
- const borders = [undefined, 'left', 'top', 'right', 'bottom'];
22
- const errorPositions = ['bottom', 'top'];
20
+ const icons = [undefined, ...Object.keys(iconsList)];
23
21
 
24
22
  export default {
25
23
  title: 'Inputs/Input',
26
24
  component: Input,
27
25
  argTypes: {
28
26
  type: { control: 'radio', options: types },
29
- border: { control: 'radio', options: borders },
30
- iconType: { control: 'select', options: iconTypes },
31
- errorPosition: { control: 'inline-radio', options: errorPositions },
27
+ icon: { control: 'select', options: icons },
32
28
  mask: { control: 'select', options: masks },
33
- inlineStyles: { control: 'select', options: inlineStyles },
29
+ groupPositions: { control: 'select', options: groupPositions },
34
30
  },
35
31
  };
36
32
 
@@ -38,12 +34,14 @@ const Template: ComponentStory<typeof Input> = (args) => {
38
34
  const [value, setValue] = useState('');
39
35
 
40
36
  return (
41
- <Input
42
- {...args}
43
- value={value}
44
- onChange={(v) => setValue(v)}
45
- onIconClick={() => console.log('icon click')}
46
- />
37
+ <div style={{ width: 300 }}>
38
+ <Input
39
+ {...args}
40
+ value={value}
41
+ onChange={setValue}
42
+ onIconClick={() => console.log('icon click')}
43
+ />
44
+ </div>
47
45
  );
48
46
  };
49
47
 
@@ -53,24 +51,19 @@ Default.args = {
53
51
  label: 'Label',
54
52
  placeholder: 'Placeholder',
55
53
  infoMessage: 'Message Info',
56
- units: 'RUB',
57
54
  type: 'text',
58
- border: undefined,
59
- hasFloatingLabel: true,
60
- hasRequiredLabel: true,
61
55
  isInvalid: false,
56
+ units: '',
62
57
  errorMessage: 'Error Text',
63
- errorPosition: 'bottom',
64
- isAutoSizeable: false,
65
- shouldFocusOnMount: false,
66
- shouldAlwaysShowPlaceholder: false,
67
58
  isActive: false,
68
59
  isDisabled: false,
69
60
  isRequired: false,
70
61
  isReadonly: false,
71
62
  isClearable: false,
72
63
  isLoading: false,
73
- inlineStyle: undefined,
64
+ isAutoSized: false,
65
+ shouldAlwaysShowPlaceholder: false,
66
+ groupPlacement: undefined,
74
67
  };
75
68
 
76
69
  Default.parameters = {
@@ -85,7 +78,6 @@ Default.parameters = {
85
78
  'onPaste',
86
79
  'onKeyDown',
87
80
  'onIconClick',
88
- 'tweakStyles',
89
81
  ],
90
82
  },
91
83
  };