@true-engineering/true-react-common-ui-kit 4.0.0-alpha44 → 4.0.0-alpha46

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 (210) hide show
  1. package/dist/components/AccountInfo/AccountInfo.styles.d.ts +1 -1
  2. package/dist/components/AddButton/AddButton.styles.d.ts +1 -1
  3. package/dist/components/Button/Button.d.ts +1 -1
  4. package/dist/components/Button/Button.styles.d.ts +1 -1
  5. package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -1
  6. package/dist/components/CloseButton/CloseButton.styles.d.ts +1 -1
  7. package/dist/components/ControlWrapper/ControlWrapper.d.ts +2 -2
  8. package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +1 -1
  9. package/dist/components/ControlWrapper/constants.d.ts +1 -0
  10. package/dist/components/ControlWrapper/index.d.ts +1 -0
  11. package/dist/components/ControlWrapper/types.d.ts +3 -1
  12. package/dist/components/CssBaseline/CssBaseline.styles.d.ts +1 -1
  13. package/dist/components/DateInput/DateInput.d.ts +1 -2
  14. package/dist/components/DateInput/DateInput.styles.d.ts +1 -1
  15. package/dist/components/DateInput/constants.d.ts +1 -1
  16. package/dist/components/DatePicker/DatePicker.d.ts +2 -3
  17. package/dist/components/DatePicker/DatePicker.styles.d.ts +1 -1
  18. package/dist/components/DatePicker/components/DatePickerBase/DatePickerBase.d.ts +1 -1
  19. package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +1 -1
  20. package/dist/components/DatePicker/constants.d.ts +1 -1
  21. package/dist/components/DatePicker/types.d.ts +2 -2
  22. package/dist/components/Description/Description.styles.d.ts +1 -1
  23. package/dist/components/FileInput/FileInput.d.ts +1 -1
  24. package/dist/components/FileInput/FileInput.styles.d.ts +1 -1
  25. package/dist/components/FileItem/FileItem.styles.d.ts +1 -1
  26. package/dist/components/FiltersPane/FiltersPane.d.ts +0 -1
  27. package/dist/components/FiltersPane/FiltersPane.styles.d.ts +2 -2
  28. package/dist/components/FiltersPane/components/Filter/Filter.d.ts +1 -2
  29. package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +3 -6
  30. package/dist/components/FiltersPane/components/FilterMultiSelect/FilterMultiSelect.d.ts +0 -1
  31. package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +3 -6
  32. package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +1 -2
  33. package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +1 -1
  34. package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +5 -11
  35. package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +1 -1
  36. package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +0 -1
  37. package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +2 -2
  38. package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +1 -1
  39. package/dist/components/FiltersPane/constants.d.ts +1 -1
  40. package/dist/components/FiltersPane/helpers.d.ts +1 -1
  41. package/dist/components/FiltersPane/types.d.ts +1 -1
  42. package/dist/components/Flag/Flag.styles.d.ts +1 -1
  43. package/dist/components/Flag/customFlags/customFlags.d.ts +2 -2
  44. package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +2 -2
  45. package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
  46. package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +1 -1
  47. package/dist/components/FlexibleTable/helpers.d.ts +2 -2
  48. package/dist/components/FloatDocActions/FloatDocActions.styles.d.ts +1 -1
  49. package/dist/components/FloatDocActions/components/DocActions/DocActions.styles.d.ts +1 -1
  50. package/dist/components/Icon/Icon.styles.d.ts +1 -1
  51. package/dist/components/Icon/icons/index.d.ts +29 -29
  52. package/dist/components/IconButton/IconButton.d.ts +1 -2
  53. package/dist/components/IconButton/IconButton.styles.d.ts +1 -1
  54. package/dist/components/IncrementInput/IncrementInput.styles.d.ts +1 -1
  55. package/dist/components/Input/Input.d.ts +1 -2
  56. package/dist/components/Input/Input.styles.d.ts +1 -1
  57. package/dist/components/Input/InputBase.d.ts +1 -1
  58. package/dist/components/List/List.styles.d.ts +1 -1
  59. package/dist/components/List/components/ListItem/ListItem.styles.d.ts +1 -1
  60. package/dist/components/Modal/Modal.styles.d.ts +1 -1
  61. package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -1
  62. package/dist/components/MultiSelect/MultiSelect.d.ts +0 -1
  63. package/dist/components/MultiSelect/MultiSelect.styles.d.ts +1 -1
  64. package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +1 -1
  65. package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +1 -1
  66. package/dist/components/MultiSelectList/constants.d.ts +1 -1
  67. package/dist/components/MultiSelectList/helpers.d.ts +1 -1
  68. package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +1 -1
  69. package/dist/components/Notification/Notification.styles.d.ts +1 -1
  70. package/dist/components/NumberInput/NumberInput.d.ts +1 -2
  71. package/dist/components/NumberInput/helpers.d.ts +2 -2
  72. package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
  73. package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +1 -1
  74. package/dist/components/RadioButton/RadioButton.styles.d.ts +1 -1
  75. package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +3 -373
  76. package/dist/components/ScrollIntoViewIfNeeded/constants.d.ts +1 -1
  77. package/dist/components/SearchInput/SearchInput.d.ts +1 -2
  78. package/dist/components/Select/Select.d.ts +1 -1
  79. package/dist/components/Select/Select.styles.d.ts +12 -22
  80. package/dist/components/Select/components/SelectList/SelectList.d.ts +5 -5
  81. package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +1 -1
  82. package/dist/components/Select/components/SelectListItem/SelectListItem.d.ts +2 -2
  83. package/dist/components/Select/helpers.d.ts +1 -1
  84. package/dist/components/Selector/Selector.d.ts +0 -1
  85. package/dist/components/Selector/Selector.styles.d.ts +1 -1
  86. package/dist/components/Skeleton/Skeleton.styles.d.ts +1 -1
  87. package/dist/components/SmartInput/SmartInput.d.ts +1 -1
  88. package/dist/components/Status/Status.styles.d.ts +1 -1
  89. package/dist/components/Status/types.d.ts +1 -1
  90. package/dist/components/Switch/Switch.styles.d.ts +1 -1
  91. package/dist/components/TextArea/TextArea.d.ts +1 -1
  92. package/dist/components/TextArea/TextArea.styles.d.ts +1 -1
  93. package/dist/components/TextButton/TextButton.d.ts +1 -1
  94. package/dist/components/TextButton/TextButton.styles.d.ts +1 -1
  95. package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +1 -1
  96. package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +1 -1
  97. package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +1 -1
  98. package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
  99. package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +1 -1
  100. package/dist/components/Toaster/Toaster.styles.d.ts +1 -1
  101. package/dist/components/Tooltip/Tooltip.styles.d.ts +1 -1
  102. package/dist/components/WithMessages/WithMessages.d.ts +1 -1
  103. package/dist/components/WithMessages/WithMessages.styles.d.ts +1 -1
  104. package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
  105. package/dist/components/WithPopup/types.d.ts +4 -4
  106. package/dist/components/index.d.ts +0 -1
  107. package/dist/constants/phone-info.d.ts +1 -1
  108. package/dist/helpers/misc.d.ts +2 -1
  109. package/dist/helpers/phone.d.ts +1 -1
  110. package/dist/hooks/use-dropdown.d.ts +3 -3
  111. package/dist/hooks/use-merge.d.ts +1 -1
  112. package/dist/hooks/use-mixed-styles.d.ts +3 -3
  113. package/dist/hooks/use-tweak-styles.d.ts +5 -5
  114. package/dist/theme/Provider.d.ts +2 -2
  115. package/dist/theme/common.d.ts +1 -1
  116. package/dist/theme/helpers.d.ts +3 -3
  117. package/dist/theme/true-jss/ThemedStylesManager.d.ts +1 -1
  118. package/dist/theme/true-jss/TweakStylesManager.d.ts +1 -1
  119. package/dist/theme/types.d.ts +1 -1
  120. package/dist/true-react-common-ui-kit.js +881 -733
  121. package/dist/true-react-common-ui-kit.js.map +1 -1
  122. package/dist/true-react-common-ui-kit.umd.cjs +881 -733
  123. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  124. package/dist/types.d.ts +4 -4
  125. package/package.json +14 -16
  126. package/src/components/AccountInfo/AccountInfo.stories.tsx +19 -27
  127. package/src/components/AddButton/AddButton.stories.tsx +14 -17
  128. package/src/components/Button/Button.stories.tsx +7 -24
  129. package/src/components/Checkbox/Checkbox.stories.tsx +24 -26
  130. package/src/components/Checkbox/types.ts +1 -1
  131. package/src/components/CloseButton/CloseButton.stories.tsx +5 -6
  132. package/src/components/Colors/Colors.stories.tsx +63 -3
  133. package/src/components/ControlWrapper/ControlWrapper.stories.tsx +43 -38
  134. package/src/components/ControlWrapper/ControlWrapper.tsx +2 -11
  135. package/src/components/ControlWrapper/constants.ts +11 -0
  136. package/src/components/ControlWrapper/index.ts +1 -0
  137. package/src/components/ControlWrapper/types.ts +4 -1
  138. package/src/components/DateInput/DateInput.stories.tsx +13 -30
  139. package/src/components/DatePicker/DatePicker.stories.tsx +15 -52
  140. package/src/components/Description/Description.stories.tsx +11 -16
  141. package/src/components/FileInput/FileInput.stories.tsx +59 -63
  142. package/src/components/FileItem/FileItem.stories.tsx +46 -45
  143. package/src/components/FiltersPane/FiltersPane.stories.tsx +27 -30
  144. package/src/components/FiltersPane/components/Filter/Filter.tsx +1 -1
  145. package/src/components/FiltersPane/components/Filter/helpers.ts +3 -3
  146. package/src/components/FiltersPane/types.ts +0 -2
  147. package/src/components/Flag/Flag.stories.tsx +15 -20
  148. package/src/components/Flag/Flag.tsx +2 -2
  149. package/src/components/FlexibleTable/FlexibleTable.stories.tsx +47 -50
  150. package/src/components/FloatDocActions/FloatDocActions.stories.tsx +18 -24
  151. package/src/components/Icon/Icon.stories.tsx +9 -5
  152. package/src/components/Icon/types.ts +1 -1
  153. package/src/components/IconButton/IconButton.stories.tsx +7 -11
  154. package/src/components/IncrementInput/IncrementInput.stories.tsx +25 -25
  155. package/src/components/Input/Input.stories.tsx +35 -61
  156. package/src/components/List/List.stories.tsx +22 -17
  157. package/src/components/List/List.styles.ts +2 -1
  158. package/src/components/Modal/Modal.stories.tsx +50 -59
  159. package/src/components/MoreMenu/MoreMenu.stories.tsx +24 -15
  160. package/src/components/MultiSelect/MultiSelect.stories.tsx +23 -20
  161. package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +42 -40
  162. package/src/components/Notification/Notification.stories.tsx +34 -32
  163. package/src/components/NumberInput/NumberInput.stories.tsx +27 -27
  164. package/src/components/PhoneInput/PhoneInput.stories.tsx +28 -54
  165. package/src/components/PhoneInput/PhoneInput.tsx +1 -1
  166. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +5 -11
  167. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +1 -4
  168. package/src/components/RadioButton/RadioButton.stories.tsx +28 -31
  169. package/src/components/RadioButton/types.ts +1 -1
  170. package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +15 -9
  171. package/src/components/SearchInput/SearchInput.stories.tsx +14 -14
  172. package/src/components/Select/CustomSelect.stories.tsx +29 -33
  173. package/src/components/Select/MultiSelect.stories.tsx +41 -46
  174. package/src/components/Select/Select.stories.tsx +41 -46
  175. package/src/components/Select/Select.tsx +27 -27
  176. package/src/components/Select/components/SelectList/SelectList.tsx +4 -4
  177. package/src/components/Selector/Selector.stories.tsx +25 -27
  178. package/src/components/Selector/Selector.tsx +1 -2
  179. package/src/components/Skeleton/Skeleton.stories.tsx +13 -12
  180. package/src/components/SmartInput/SmartInput.stories.tsx +23 -23
  181. package/src/components/Status/Status.stories.tsx +29 -30
  182. package/src/components/Status/types.ts +1 -1
  183. package/src/components/Switch/Switch.stories.tsx +19 -26
  184. package/src/components/TextArea/TextArea.stories.tsx +32 -35
  185. package/src/components/TextArea/types.ts +1 -1
  186. package/src/components/TextButton/TextButton.stories.tsx +6 -16
  187. package/src/components/TextWithInfo/TextWithInfo.stories.tsx +13 -21
  188. package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +26 -25
  189. package/src/components/TextWithTooltip/TextWithTooltip.tsx +1 -2
  190. package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +12 -23
  191. package/src/components/Toaster/Toaster.stories.tsx +16 -14
  192. package/src/components/Tooltip/Tooltip.stories.tsx +5 -4
  193. package/src/components/WithMessages/WithMessages.stories.tsx +16 -20
  194. package/src/components/WithPopup/WithPopup.stories.tsx +27 -26
  195. package/src/components/WithTooltip/WithTooltip.stories.tsx +28 -28
  196. package/src/components/index.ts +0 -1
  197. package/src/helpers/misc.ts +8 -5
  198. package/src/helpers/popper-helpers.ts +0 -1
  199. package/src/theme/helpers.ts +3 -1
  200. package/src/theme/true-jss/ThemedStylesManager.ts +2 -1
  201. package/src/theme/true-jss/TweakStylesManager.ts +1 -2
  202. package/src/theme/types.ts +0 -1
  203. package/src/types.ts +0 -2
  204. package/dist/components/Colors/Colors.d.ts +0 -2
  205. package/dist/components/Colors/Colors.styles.d.ts +0 -1
  206. package/dist/components/Colors/index.d.ts +0 -1
  207. package/src/components/Colors/Colors.styles.ts +0 -36
  208. package/src/components/Colors/Colors.tsx +0 -26
  209. package/src/components/Colors/index.ts +0 -1
  210. package/src/components/Flag/customFlags/augment.d.ts +0 -1
@@ -1,14 +1,15 @@
1
- import { useState } from 'react';
2
- import { ComponentStory } from '@storybook/react';
1
+ import { FC, useState } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
+ import { excludeStorybookParams } from '../../helpers';
3
4
  import { Status } from '../Status';
4
- import { Selector } from './Selector';
5
+ import { ISelectorProps, Selector } from './Selector';
5
6
  import { ISelectorOption } from './types';
6
7
 
7
8
  const options: Array<ISelectorOption<string>> = [
8
9
  {
9
10
  label: 'Label 1',
10
11
  value: '1',
11
- icon: 'eye',
12
+ icon: 'filter',
12
13
  },
13
14
  {
14
15
  label: 'My label 2',
@@ -32,31 +33,28 @@ const options: Array<ISelectorOption<string>> = [
32
33
  },
33
34
  ];
34
35
 
35
- export default {
36
- title: 'Controls/Selector',
37
- component: Selector,
38
- };
39
-
40
- const Template: ComponentStory<typeof Selector> = (args) => {
36
+ const Story: FC<ISelectorProps<string>> = (args) => {
41
37
  const [value, setValue] = useState(options[0].value);
42
- return <Selector {...args} value={value} options={options} onChange={setValue} />;
43
- };
44
-
45
- export const Default = Template.bind({});
46
-
47
- Default.args = {
48
- size: 'l',
49
- iconPosition: 'left',
50
- hasSameOptionsWidth: true,
51
- isDisabled: false,
52
- isInvalid: false,
53
- isRequired: false,
38
+ return <Selector<string> {...args} value={value} options={options} onChange={setValue} />;
54
39
  };
55
40
 
56
- Default.argTypes = {};
57
-
58
- Default.parameters = {
59
- controls: {
60
- exclude: ['options', 'value', 'testId', 'onChange'],
41
+ const meta: Meta<typeof Story> = {
42
+ title: 'Controls/Selector',
43
+ component: Story,
44
+ args: {
45
+ size: 'l',
46
+ iconPosition: 'left',
47
+ hasSameOptionsWidth: true,
48
+ isDisabled: false,
49
+ isInvalid: false,
50
+ isRequired: false,
51
+ },
52
+ parameters: {
53
+ controls: {
54
+ exclude: excludeStorybookParams(['options', 'value']),
55
+ },
61
56
  },
62
57
  };
58
+
59
+ export default meta;
60
+ export const Default = {};
@@ -11,7 +11,7 @@ import { addDataAttributes } from '../../helpers';
11
11
  import { ICommonProps } from '../../types';
12
12
  import { renderIcon } from '../Icon';
13
13
  import { ISelectorOption, ISelectorValue } from './types';
14
- import { getSelectorLineStyle, useStyles, ISelectorStyles } from './Selector.styles';
14
+ import { getSelectorLineStyle, ISelectorStyles, useStyles } from './Selector.styles';
15
15
 
16
16
  export interface ISelectorProps<V extends ISelectorValue> extends ICommonProps<ISelectorStyles> {
17
17
  options: Array<ISelectorOption<V>>;
@@ -52,7 +52,6 @@ export function Selector<V extends ISelectorValue>({
52
52
  const listRef = useRef<HTMLDivElement>(null);
53
53
 
54
54
  if (hasDuplicates(optionsValues)) {
55
- // eslint-disable-next-line no-console
56
55
  console.error('Selector: Значения options.value должны быть уникальными');
57
56
  }
58
57
 
@@ -1,19 +1,20 @@
1
- import { ComponentStory } from '@storybook/react';
2
- import { Skeleton } from './Skeleton';
1
+ import { FC } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
+ import { ISkeletonProps, Skeleton } from './Skeleton';
3
4
 
4
- export default {
5
- title: 'Feedback/Skeleton',
6
- component: Skeleton,
7
- };
8
-
9
- const Template: ComponentStory<typeof Skeleton> = (args) => (
5
+ const Story: FC<ISkeletonProps> = (args) => (
10
6
  <div style={{ padding: 32, backgroundColor: '#fff', width: 200 }}>
11
7
  <Skeleton {...args} />
12
8
  </div>
13
9
  );
14
10
 
15
- export const Default = Template.bind({});
16
-
17
- Default.args = {
18
- height: '20px',
11
+ const meta: Meta<typeof Story> = {
12
+ title: 'Feedback/Skeleton',
13
+ component: Story,
14
+ args: {
15
+ height: '20px',
16
+ },
19
17
  };
18
+
19
+ export default meta;
20
+ export const Default = {};
@@ -1,22 +1,13 @@
1
- import { useState } from 'react';
2
- import { ComponentStory } from '@storybook/react';
1
+ import { FC, useState } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
3
  import { IInputProps } from '../Input';
4
- import { SmartInput } from './SmartInput';
4
+ import { ISmartInputProps, SmartInput } from './SmartInput';
5
5
  import { ISmartType } from './types';
6
6
 
7
7
  const types: Array<IInputProps['type']> = ['text', 'password', 'email', 'number'];
8
8
  const smartTypes: ISmartType[] = ['default', 'agencyName', 'surname', 'name', 'email'];
9
9
 
10
- export default {
11
- title: 'Inputs/SmartInput',
12
- component: SmartInput,
13
- argTypes: {
14
- type: { control: 'inline-radio', options: types },
15
- smartType: { control: 'inline-radio', options: smartTypes },
16
- },
17
- };
18
-
19
- const Template: ComponentStory<typeof SmartInput> = (args) => {
10
+ const Story: FC<ISmartInputProps> = (args) => {
20
11
  const [value, setValue] = useState('');
21
12
 
22
13
  return (
@@ -38,14 +29,23 @@ const Template: ComponentStory<typeof SmartInput> = (args) => {
38
29
  );
39
30
  };
40
31
 
41
- export const Default = Template.bind({});
42
-
43
- Default.args = {
44
- label: 'Label',
45
- placeholder: 'Placeholder',
46
- type: 'text',
47
- smartType: 'default',
48
- isUpperCase: false,
49
- isDisabled: false,
50
- isTransliterationEnabled: true,
32
+ const meta: Meta<typeof Story> = {
33
+ title: 'Inputs/SmartInput',
34
+ component: Story,
35
+ args: {
36
+ label: 'Label',
37
+ placeholder: 'Placeholder',
38
+ type: 'text',
39
+ smartType: 'default',
40
+ isUpperCase: false,
41
+ isDisabled: false,
42
+ isTransliterationEnabled: true,
43
+ },
44
+ argTypes: {
45
+ type: { control: 'inline-radio', options: types },
46
+ smartType: { control: 'inline-radio', options: smartTypes },
47
+ },
51
48
  };
49
+
50
+ export default meta;
51
+ export const Default = {};
@@ -1,12 +1,13 @@
1
- import { ComponentStory } from '@storybook/react';
2
- import { rgba } from '../../helpers';
1
+ import { FC } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
+ import { excludeStorybookParams, rgba } from '../../helpers';
3
4
  import { IExtendableProps } from '../../types';
4
5
  import { iconsMap } from '../Icon';
5
- import { Status } from './Status';
6
+ import { IStatusProps, Status } from './Status';
6
7
  import { STATUS_SIZES } from './constants';
7
8
  import { IStatusStyles } from './Status.styles';
8
9
 
9
- export const STATUS_COLORS = [
10
+ const STATUS_COLORS = [
10
11
  'green',
11
12
  'teal',
12
13
  'blue',
@@ -17,18 +18,11 @@ export const STATUS_COLORS = [
17
18
  'custom',
18
19
  ] as const;
19
20
 
20
- export default {
21
- title: 'Data Display/Status',
22
- component: Status,
23
- };
24
-
25
21
  declare module './types' {
26
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
22
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
27
23
  export interface IStatusColors extends IExtendableProps<typeof STATUS_COLORS> {}
28
24
  }
29
25
 
30
- const icons = [undefined, ...Object.keys(iconsMap)];
31
-
32
26
  const customTweakStyles: IStatusStyles = {
33
27
  green: {
34
28
  '--status-background': rgba('#D4E3AC', 0.5),
@@ -71,7 +65,7 @@ const customTweakStyles: IStatusStyles = {
71
65
  },
72
66
  };
73
67
 
74
- const Template: ComponentStory<typeof Status> = (args) => (
68
+ const Story: FC<IStatusProps> = (args) => (
75
69
  <div
76
70
  style={{
77
71
  display: 'grid',
@@ -100,22 +94,27 @@ const Template: ComponentStory<typeof Status> = (args) => (
100
94
  </div>
101
95
  );
102
96
 
103
- export const Default = Template.bind({});
104
-
105
- Default.args = {
106
- children: 'Status',
107
- badge: '+ Badge',
108
- icon: 'balloon',
109
- iconPosition: 'left',
110
- };
111
-
112
- Default.argTypes = {
113
- icon: { options: icons, control: 'select' },
114
- iconPosition: { options: ['left', 'right'], control: 'inline-radio' },
115
- };
116
-
117
- Default.parameters = {
118
- controls: {
119
- exclude: ['size', 'color', 'tweakStyles', 'testId', 'data'],
97
+ const meta: Meta<typeof Story> = {
98
+ title: 'Data Display/Status',
99
+ component: Story,
100
+ args: {
101
+ children: 'Status',
102
+ badge: '+ Badge',
103
+ icon: 'information',
104
+ iconPosition: 'left',
105
+ color: 'blue',
106
+ size: 's',
107
+ },
108
+ argTypes: {
109
+ icon: { options: [undefined, ...Object.keys(iconsMap)], control: 'select' },
110
+ iconPosition: { options: ['left', 'right'], control: 'inline-radio' },
111
+ },
112
+ parameters: {
113
+ controls: {
114
+ exclude: excludeStorybookParams(['color', 'size']),
115
+ },
120
116
  },
121
117
  };
118
+
119
+ export default meta;
120
+ export const Default = {};
@@ -3,7 +3,7 @@ import type { STATUS_SIZES } from './constants';
3
3
 
4
4
  export type IStatusSize = (typeof STATUS_SIZES)[number];
5
5
 
6
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
7
7
  export interface IStatusColors extends IDefaultExtendableProps {}
8
8
 
9
9
  export type IStatusColor = keyof IStatusColors;
@@ -1,19 +1,9 @@
1
- import { useState } from 'react';
2
- import { ComponentStory } from '@storybook/react';
3
- import { Switch } from './Switch';
1
+ import { FC, useState } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
+ import { ISwitchProps, Switch } from './Switch';
4
4
 
5
- export default {
6
- title: 'Controls/Switch',
7
- component: Switch,
8
- argTypes: {
9
- labelPosition: { control: 'inline-radio', options: ['left', 'right'] },
10
- color: { control: 'inline-radio', options: ['primary', 'secondary'] },
11
- },
12
- };
13
-
14
- const Template: ComponentStory<typeof Switch> = (args) => {
5
+ const Story: FC<ISwitchProps<string>> = (args) => {
15
6
  const [isChecked, setIsChecked] = useState(true);
16
-
17
7
  return (
18
8
  <Switch
19
9
  {...args}
@@ -24,17 +14,20 @@ const Template: ComponentStory<typeof Switch> = (args) => {
24
14
  );
25
15
  };
26
16
 
27
- export const Default = Template.bind({});
28
-
29
- Default.args = {
30
- children: 'Label',
31
- labelPosition: 'right',
32
- isDisabled: false,
33
- color: 'primary',
34
- };
35
-
36
- Default.parameters = {
37
- controls: {
38
- exclude: ['data', 'testId', 'onChange'],
17
+ const meta: Meta<typeof Story> = {
18
+ title: 'Controls/Switch',
19
+ component: Story,
20
+ args: {
21
+ children: 'Label',
22
+ labelPosition: 'right',
23
+ isDisabled: false,
24
+ color: 'primary',
25
+ },
26
+ argTypes: {
27
+ labelPosition: { control: 'inline-radio', options: ['left', 'right'] },
28
+ color: { control: 'inline-radio', options: ['primary', 'secondary'] },
39
29
  },
40
30
  };
31
+
32
+ export default meta;
33
+ export const Default = {};
@@ -1,49 +1,46 @@
1
- import { useState } from 'react';
2
- import { ComponentStory } from '@storybook/react';
1
+ import { FC, useState } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
3
  import { IExtendableProps } from '../../types';
4
- import { TextArea } from './TextArea';
4
+ import { ITextAreaProps, TextArea } from './TextArea';
5
5
 
6
6
  const COUNTER_POSITIONS = ['default', 'top'] as const;
7
7
 
8
- export default {
9
- title: 'Inputs/TextArea',
10
- component: TextArea,
11
- argTypes: {
12
- maxLength: {
13
- control: { type: 'range', min: 10, max: 500, step: 10 },
14
- },
15
- },
16
- };
17
-
18
8
  declare module './types' {
19
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
9
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
20
10
  export interface ITextAreaCounterPositions extends IExtendableProps<typeof COUNTER_POSITIONS> {}
21
11
  }
22
12
 
23
- const Template: ComponentStory<typeof TextArea> = (args) => {
13
+ const Story: FC<ITextAreaProps> = (args) => {
24
14
  const [value, setValue] = useState('');
25
15
  return <TextArea {...args} value={value} onChange={setValue} />;
26
16
  };
27
17
 
28
- export const Default = Template.bind({});
29
-
30
- Default.args = {
31
- label: 'Label',
32
- placeholder: 'Placeholder',
33
- infoMessage: 'Message Info',
34
- rows: 5,
35
- maxLength: 500,
36
- isInvalid: false,
37
- counterPosition: 'default',
38
- errorMessage: 'Error Text',
39
- isActive: false,
40
- isDisabled: false,
41
- isRequired: false,
42
- isAutoSized: true,
43
- shouldAlwaysShowPlaceholder: false,
44
- size: undefined,
18
+ const meta: Meta<typeof Story> = {
19
+ title: 'Inputs/TextArea',
20
+ component: Story,
21
+ args: {
22
+ label: 'Label',
23
+ placeholder: 'Placeholder',
24
+ infoMessage: 'Message Info',
25
+ rows: 5,
26
+ maxLength: 500,
27
+ isInvalid: false,
28
+ counterPosition: 'default',
29
+ errorMessage: 'Error Text',
30
+ isActive: false,
31
+ isDisabled: false,
32
+ isRequired: false,
33
+ isAutoSized: true,
34
+ shouldAlwaysShowPlaceholder: false,
35
+ size: undefined,
36
+ },
37
+ argTypes: {
38
+ counterPosition: { options: [undefined, ...COUNTER_POSITIONS], control: 'select' },
39
+ maxLength: {
40
+ control: { type: 'range', min: 10, max: 500, step: 10 },
41
+ },
42
+ },
45
43
  };
46
44
 
47
- Default.argTypes = {
48
- counterPosition: { options: [undefined, ...COUNTER_POSITIONS], control: 'select' },
49
- };
45
+ export default meta;
46
+ export const Default = {};
@@ -1,6 +1,6 @@
1
1
  import { IExtendableProps } from '../../types';
2
2
 
3
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
3
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
4
4
  export interface ITextAreaCounterPositions extends IExtendableProps<'default'> {}
5
5
 
6
6
  export type ITextAreaCounterPosition = keyof ITextAreaCounterPositions;
@@ -1,11 +1,9 @@
1
- import { ComponentMeta, ComponentStory } from '@storybook/react';
1
+ import { type Meta } from '@storybook/react';
2
2
  import { iconsMap } from '../Icon';
3
3
  import { TextButton } from './TextButton';
4
4
  import { TEXT_BUTTON_SIZES, TEXT_BUTTON_VIEWS } from './constants';
5
5
 
6
- const icons = [undefined, ...Object.keys(iconsMap)];
7
-
8
- export default {
6
+ const meta: Meta<typeof TextButton> = {
9
7
  title: 'Buttons/TextButton',
10
8
  component: TextButton,
11
9
  args: {
@@ -21,22 +19,14 @@ export default {
21
19
  iconPosition: 'left',
22
20
  preloaderType: 'dots',
23
21
  },
24
-
25
22
  argTypes: {
26
- icon: { control: 'select', options: icons },
23
+ icon: { control: 'select', options: [undefined, Object.keys(iconsMap)] },
27
24
  size: { options: TEXT_BUTTON_SIZES, control: 'inline-radio' },
28
25
  view: { options: TEXT_BUTTON_VIEWS, control: 'inline-radio' },
29
26
  iconPosition: { control: 'inline-radio' },
30
27
  preloaderType: { control: 'inline-radio' },
31
28
  },
29
+ };
32
30
 
33
- parameters: {
34
- controls: {
35
- exclude: ['testId', 'tweakStyles', 'data', 'onClick'],
36
- },
37
- },
38
- } as ComponentMeta<typeof TextButton>;
39
-
40
- export const Default: ComponentStory<typeof TextButton> = (args) => (
41
- <TextButton {...args} key={args.size} />
42
- );
31
+ export default meta;
32
+ export const Default = {};
@@ -1,17 +1,13 @@
1
1
  import { FC, useState } from 'react';
2
- import { ComponentStory } from '@storybook/react';
2
+ import { type Meta } from '@storybook/react';
3
3
  import { ITextWithInfoProps, TextWithInfo } from './TextWithInfo';
4
4
 
5
- interface ITextWithInfoWithCustomProps extends ITextWithInfoProps {
5
+ interface ITextWithInfoCustomProps extends ITextWithInfoProps {
6
6
  infoTooltip: string;
7
7
  link: string;
8
8
  }
9
9
 
10
- const TextWithInfoWithCustomProps: FC<ITextWithInfoWithCustomProps> = ({
11
- infoTooltip,
12
- link,
13
- ...args
14
- }) => {
10
+ const Story: FC<ITextWithInfoCustomProps> = ({ infoTooltip, link, ...args }) => {
15
11
  const [isSelected, setIsSelected] = useState(false);
16
12
 
17
13
  return (
@@ -34,20 +30,16 @@ const TextWithInfoWithCustomProps: FC<ITextWithInfoWithCustomProps> = ({
34
30
  );
35
31
  };
36
32
 
37
- export default {
33
+ const meta: Meta<typeof Story> = {
38
34
  title: 'Data Display/TextWithInfo',
39
- component: TextWithInfoWithCustomProps,
35
+ component: Story,
36
+ args: {
37
+ text: 'Обычная перевозка',
38
+ textTooltip: 'Tултип для самой обычной перевозки',
39
+ infoTooltip: 'Читать подробную информацию',
40
+ link: 'https://ya.ru/',
41
+ },
40
42
  };
41
43
 
42
- const Template: ComponentStory<typeof TextWithInfoWithCustomProps> = (args) => (
43
- <TextWithInfoWithCustomProps {...args} />
44
- );
45
-
46
- export const Default = Template.bind({});
47
-
48
- Default.args = {
49
- text: 'Обычная перевозка',
50
- textTooltip: 'Tултип для самой обычной перевозки',
51
- infoTooltip: 'Читать подробную информацию',
52
- link: 'https://ya.ru/',
53
- };
44
+ export default meta;
45
+ export const Default = {};
@@ -1,5 +1,6 @@
1
- import { ComponentStory } from '@storybook/react';
2
- import { TextWithTooltip } from './TextWithTooltip';
1
+ import { FC } from 'react';
2
+ import { type Meta } from '@storybook/react';
3
+ import { ITextWithTooltipProps, TextWithTooltip } from './TextWithTooltip';
3
4
 
4
5
  const positions = [
5
6
  'top',
@@ -19,18 +20,7 @@ const positions = [
19
20
  'auto-end',
20
21
  ];
21
22
 
22
- export default {
23
- title: 'Data Display/TextWithTooltip',
24
- component: TextWithTooltip,
25
- argTypes: {
26
- tooltipPosition: { control: 'select', options: positions },
27
- tooltipView: { control: 'inline-radio', options: ['tooltip', 'hint'] },
28
- tooltipType: { control: 'inline-radio', options: ['info', 'error'] },
29
- mouseEventType: { control: 'inline-radio', options: ['hover', 'click'] },
30
- },
31
- };
32
-
33
- const Template: ComponentStory<typeof TextWithTooltip> = (args) => (
23
+ const Story: FC<ITextWithTooltipProps> = (args) => (
34
24
  <div
35
25
  style={{
36
26
  display: 'flex',
@@ -44,15 +34,26 @@ const Template: ComponentStory<typeof TextWithTooltip> = (args) => (
44
34
  </div>
45
35
  );
46
36
 
47
- export const Default = Template.bind({});
48
-
49
- Default.args = {
50
- children: 'Наведи на меня - появится тултип',
51
- tooltipText: 'Текст тултипа',
52
- tooltipPosition: 'top',
53
- tooltipView: 'tooltip',
54
- tooltipType: 'info',
55
- isDisabled: false,
56
- mouseEventType: 'hover',
57
- shouldRenderInBody: true,
37
+ const meta: Meta<typeof Story> = {
38
+ title: 'Data Display/TextWithTooltip',
39
+ component: Story,
40
+ args: {
41
+ children: 'Наведи на меня - появится тултип',
42
+ tooltipText: 'Текст тултипа',
43
+ tooltipPosition: 'top',
44
+ tooltipView: 'tooltip',
45
+ tooltipType: 'info',
46
+ isDisabled: false,
47
+ mouseEventType: 'hover',
48
+ shouldRenderInBody: true,
49
+ },
50
+ argTypes: {
51
+ tooltipPosition: { control: 'select', options: positions },
52
+ tooltipView: { control: 'inline-radio', options: ['tooltip', 'hint'] },
53
+ tooltipType: { control: 'inline-radio', options: ['info', 'error'] },
54
+ mouseEventType: { control: 'inline-radio', options: ['hover', 'click'] },
55
+ },
58
56
  };
57
+
58
+ export default meta;
59
+ export const Default = {};
@@ -7,7 +7,7 @@ import { addDataAttributes } from '../../helpers';
7
7
  import { useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
8
8
  import { ICommonProps } from '../../types';
9
9
  import { ITooltipProps, Tooltip } from '../Tooltip';
10
- import { useStyles, ITextWithTooltipStyles } from './TextWithTooltip.styles';
10
+ import { ITextWithTooltipStyles, useStyles } from './TextWithTooltip.styles';
11
11
 
12
12
  export interface ITextWithTooltipProps extends ICommonProps<ITextWithTooltipStyles> {
13
13
  children: ReactNode;
@@ -18,7 +18,6 @@ export interface ITextWithTooltipProps extends ICommonProps<ITextWithTooltipStyl
18
18
  tooltipType?: ITooltipProps['type'];
19
19
  /** @default 'top' */
20
20
  tooltipPosition?: Placement;
21
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
21
  /** @default [] */
23
22
  tooltipModifiers?: Array<Partial<Modifier<any, any>>>;
24
23
  tooltipOffsetOptions?: Record<string, unknown>;
@@ -1,41 +1,30 @@
1
1
  import { FC } from 'react';
2
- import { ComponentStory } from '@storybook/react';
2
+ import { type Meta } from '@storybook/react';
3
3
  import { colors } from '../../theme';
4
4
  import { IThemedPreloaderProps, ThemedPreloader } from './ThemedPreloader';
5
5
 
6
- interface IThemedPreloaderWithCustomProps extends IThemedPreloaderProps {
6
+ interface IThemedPreloaderCustomProps extends IThemedPreloaderProps {
7
7
  currentColor: string;
8
8
  }
9
9
 
10
- const ThemedPreloaderWithCustomProps: FC<IThemedPreloaderWithCustomProps> = ({
11
- currentColor,
12
- ...args
13
- }) => (
10
+ const Story: FC<IThemedPreloaderCustomProps> = ({ currentColor, ...args }) => (
14
11
  <div style={{ color: currentColor }}>
15
12
  <ThemedPreloader {...args} />
16
13
  </div>
17
14
  );
18
15
 
19
- export default {
16
+ const meta: Meta<typeof Story> = {
20
17
  title: 'Feedback/ThemedPreloader',
21
- component: ThemedPreloaderWithCustomProps,
18
+ component: Story,
19
+ args: {
20
+ type: 'dots',
21
+ useCurrentColor: false,
22
+ currentColor: colors.GREEN_FOCUS,
23
+ },
22
24
  argTypes: {
23
25
  type: { options: ['default', 'logo', 'dots'], control: 'inline-radio' },
24
26
  },
25
27
  };
26
28
 
27
- const Template: ComponentStory<typeof ThemedPreloaderWithCustomProps> = (args) => (
28
- <ThemedPreloaderWithCustomProps {...args} />
29
- );
30
-
31
- export const Default = Template.bind({});
32
- Default.args = {
33
- type: 'dots',
34
- useCurrentColor: false,
35
- currentColor: colors.GREEN_FOCUS,
36
- };
37
- Default.parameters = {
38
- controls: {
39
- exclude: ['data'],
40
- },
41
- };
29
+ export default meta;
30
+ export const Default = {};