@true-engineering/true-react-common-ui-kit 4.0.0-alpha34 → 4.0.0-alpha36

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 (89) hide show
  1. package/dist/components/FileItem/constants.d.ts +3 -4
  2. package/dist/components/FileItem/helpers.d.ts +3 -2
  3. package/dist/components/FileItem/types.d.ts +1 -2
  4. package/dist/components/Flag/customFlags/customFlags.d.ts +2 -2
  5. package/dist/components/Icon/icons/index.d.ts +31 -0
  6. package/dist/components/Icon/index.d.ts +1 -1
  7. package/dist/components/Icon/types.d.ts +7 -11
  8. package/dist/components/Modal/Modal.d.ts +1 -1
  9. package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +2 -2
  10. package/dist/helpers/misc.d.ts +1 -2
  11. package/dist/theme/types.d.ts +2 -3
  12. package/dist/true-react-common-ui-kit.js +230 -1175
  13. package/dist/true-react-common-ui-kit.js.map +1 -1
  14. package/dist/true-react-common-ui-kit.umd.cjs +349 -1295
  15. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  16. package/package.json +4 -3
  17. package/src/components/Button/Button.stories.tsx +2 -3
  18. package/src/components/Colors/Colors.tsx +3 -3
  19. package/src/components/ControlWrapper/ControlWrapper.stories.tsx +3 -3
  20. package/src/components/FileItem/FileItem.stories.tsx +2 -3
  21. package/src/components/FileItem/constants.ts +3 -14
  22. package/src/components/FileItem/helpers.ts +3 -2
  23. package/src/components/FileItem/types.ts +1 -3
  24. package/src/components/Icon/Icon.stories.tsx +72 -63
  25. package/src/components/Icon/Icon.styles.ts +1 -1
  26. package/src/components/Icon/Icon.tsx +17 -12
  27. package/src/components/Icon/icons/calendar.svg +1 -0
  28. package/src/components/Icon/icons/check.svg +1 -0
  29. package/src/components/Icon/icons/chevron-down-small.svg +1 -0
  30. package/src/components/Icon/icons/chevron-down.svg +1 -0
  31. package/src/components/Icon/icons/chevron-left.svg +1 -0
  32. package/src/components/Icon/icons/chevron-right.svg +1 -0
  33. package/src/components/Icon/icons/close-large.svg +1 -0
  34. package/src/components/Icon/icons/close-window.svg +1 -0
  35. package/src/components/Icon/icons/close.svg +1 -0
  36. package/src/components/Icon/icons/filter.svg +1 -0
  37. package/src/components/Icon/icons/index.ts +62 -0
  38. package/src/components/Icon/icons/information.svg +1 -0
  39. package/src/components/Icon/icons/menu.svg +1 -0
  40. package/src/components/Icon/icons/minus.svg +1 -0
  41. package/src/components/Icon/icons/plus.svg +1 -0
  42. package/src/components/Icon/icons/search.svg +1 -0
  43. package/src/components/Icon/icons/status-error.svg +1 -0
  44. package/src/components/Icon/icons/status-info.svg +1 -0
  45. package/src/components/Icon/icons/status-not-ok.svg +1 -0
  46. package/src/components/Icon/icons/status-ok.svg +1 -0
  47. package/src/components/Icon/icons/status-warning.svg +1 -0
  48. package/src/components/Icon/icons/trash-can.svg +1 -0
  49. package/src/components/Icon/index.ts +1 -1
  50. package/src/components/Icon/types.ts +7 -13
  51. package/src/components/IconButton/IconButton.stories.tsx +2 -3
  52. package/src/components/Input/Input.stories.tsx +2 -2
  53. package/src/components/Modal/Modal.tsx +1 -1
  54. package/src/components/Notification/Notification.stories.tsx +2 -3
  55. package/src/components/PhoneInput/PhoneInput.stories.tsx +2 -2
  56. package/src/components/Status/Status.stories.tsx +3 -4
  57. package/src/components/TextButton/TextButton.stories.tsx +2 -3
  58. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +4 -4
  59. package/src/helpers/misc.ts +1 -2
  60. package/src/theme/types.ts +2 -4
  61. package/dist/components/Icon/complexIcons/icons.d.ts +0 -10
  62. package/dist/components/Icon/complexIcons/index.d.ts +0 -1
  63. package/dist/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.d.ts +0 -6
  64. package/dist/components/Icon/components/ComplexIconBoilerplate/index.d.ts +0 -1
  65. package/dist/components/Icon/components/IconBolerplate/IconBoilerplate.d.ts +0 -6
  66. package/dist/components/Icon/components/IconBolerplate/index.d.ts +0 -1
  67. package/dist/components/Icon/components/index.d.ts +0 -2
  68. package/dist/components/Icon/helpers.d.ts +0 -6
  69. package/dist/components/Icon/icons-list.d.ts +0 -1
  70. package/src/components/Flag/augment.d.ts +0 -1
  71. package/src/components/Icon/complexIcons/augment.d.ts +0 -1
  72. package/src/components/Icon/complexIcons/icons.ts +0 -19
  73. package/src/components/Icon/complexIcons/index.ts +0 -1
  74. package/src/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.tsx +0 -16
  75. package/src/components/Icon/components/ComplexIconBoilerplate/index.ts +0 -1
  76. package/src/components/Icon/components/IconBolerplate/IconBoilerplate.tsx +0 -43
  77. package/src/components/Icon/components/IconBolerplate/index.ts +0 -1
  78. package/src/components/Icon/components/index.ts +0 -2
  79. package/src/components/Icon/helpers.tsx +0 -9
  80. package/src/components/Icon/icons-list.ts +0 -855
  81. package/src/vite-env.d.ts +0 -1
  82. /package/src/components/Icon/{complexIcons/avatarGreen.svg → icons/avatar.svg} +0 -0
  83. /package/src/components/Icon/{complexIcons/fileExcel.svg → icons/file-excel.svg} +0 -0
  84. /package/src/components/Icon/{complexIcons/fileImage.svg → icons/file-image.svg} +0 -0
  85. /package/src/components/Icon/{complexIcons/fileOther.svg → icons/file-other.svg} +0 -0
  86. /package/src/components/Icon/{complexIcons/filePdf.svg → icons/file-pdf.svg} +0 -0
  87. /package/src/components/Icon/{complexIcons/fileWord.svg → icons/file-word.svg} +0 -0
  88. /package/src/components/Icon/{complexIcons/fileXml.svg → icons/file-xml.svg} +0 -0
  89. /package/src/components/Icon/{complexIcons/fileZip.svg → icons/file-zip.svg} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "4.0.0-alpha34",
3
+ "version": "4.0.0-alpha36",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -12,8 +12,8 @@
12
12
  "homepage": "",
13
13
  "license": "Apache-2.0",
14
14
  "type": "module",
15
- "types": "dist/index.d.ts",
16
- "main": "dist/true-react-common-ui-kit.umd.cjs",
15
+ "types": "./dist/index.d.ts",
16
+ "main": "./dist/true-react-common-ui-kit.umd.cjs",
17
17
  "module": "./dist/true-react-common-ui-kit.js",
18
18
  "directories": {
19
19
  "lib": "src"
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "exports": {
32
32
  ".": {
33
+ "types": "./dist/index.d.ts",
33
34
  "require": "./dist/true-react-common-ui-kit.umd.cjs",
34
35
  "import": "./dist/true-react-common-ui-kit.js"
35
36
  },
@@ -1,10 +1,9 @@
1
1
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
- import { iconsList, IIconType } from '../Icon';
3
- import { complexIcons } from '../Icon/complexIcons';
2
+ import { iconsMap } from '../Icon';
4
3
  import { Button, IButtonProps } from './Button';
5
4
  import { BUTTON_SIZES, BUTTON_VIEWS } from './constants';
6
5
 
7
- const icons = [undefined, ...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
6
+ const icons = [undefined, ...Object.keys(iconsMap)];
8
7
 
9
8
  const preloaderTypes: Array<IButtonProps['preloaderType']> = ['dots', 'default', 'logo'];
10
9
 
@@ -1,12 +1,12 @@
1
- import { FC, useContext } from 'react';
2
- import { ThemeContext } from '../../theme';
1
+ import { FC } from 'react';
2
+ import { useTheme } from '../../theme';
3
3
  import { useStyles } from './Colors.styles';
4
4
 
5
5
  // TODO: А зачем нужен то этот компонент кроме как ради сторис?????? мб его толкьо в сторис оформить?
6
6
 
7
7
  export const Colors: FC = () => {
8
8
  const classes = useStyles();
9
- const { theme } = useContext(ThemeContext);
9
+ const theme = useTheme();
10
10
  const { colors = {} } = theme;
11
11
 
12
12
  return (
@@ -1,6 +1,6 @@
1
1
  import { doNothing } from '@true-engineering/true-react-platform-helpers';
2
2
  import { ComponentStory } from '@storybook/react';
3
- import { Icon, iconsList } from '../Icon';
3
+ import { Icon, iconsMap } from '../Icon';
4
4
  import { ControlWrapper } from './ControlWrapper';
5
5
 
6
6
  export default {
@@ -26,13 +26,13 @@ Default.args = {
26
26
  hasValue: false,
27
27
  icon: [
28
28
  { iconComponent: <div>Бу</div>, onClick: () => console.log('close'), shouldResetSize: true },
29
- { iconComponent: <Icon type="question" /> },
29
+ { iconComponent: <Icon type="plus" /> },
30
30
  { iconComponent: 'search', onClick: () => console.log('search') },
31
31
  ],
32
32
  };
33
33
 
34
34
  Default.argTypes = {
35
- icon: { control: 'select', options: [undefined, ...Object.keys(iconsList)] },
35
+ icon: { control: 'select', options: [undefined, ...Object.keys(iconsMap)] },
36
36
  groupPlacement: {
37
37
  control: 'select',
38
38
  options: [
@@ -2,8 +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 { iconsList, IIconType } from '../Icon';
6
- import { complexIcons } from '../Icon/complexIcons';
5
+ import { iconsMap } from '../Icon';
7
6
  import { FileItem, IFileItemProps } from './FileItem';
8
7
 
9
8
  export default {
@@ -11,7 +10,7 @@ export default {
11
10
  component: FileItem,
12
11
  };
13
12
 
14
- const icons = [undefined, ...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
13
+ const icons = [undefined, ...Object.keys(iconsMap)];
15
14
 
16
15
  const preloaderTypes: Array<IFileItemProps['preloaderType']> = ['dots', 'default', 'logo'];
17
16
 
@@ -1,20 +1,9 @@
1
1
  import { mimeTypes } from '../../constants';
2
- import { IComplexIcon } from '../Icon';
3
- import { type IFileIcon } from './types';
2
+ import { IIconType } from '../Icon';
4
3
 
5
- export const FILE_ICONS = [
6
- 'file-excel',
7
- 'file-image',
8
- 'file-pdf',
9
- 'file-word',
10
- 'file-xml',
11
- 'file-zip',
12
- 'file-other',
13
- ] satisfies IComplexIcon[];
4
+ export const FILE_ICON_DEFAULT: IIconType = 'file-other';
14
5
 
15
- export const FILE_ICON_DEFAULT: IFileIcon = 'file-other';
16
-
17
- export const iconTypeMap: Record<string, IFileIcon> = {
6
+ export const iconTypeMap: Record<string, IIconType> = {
18
7
  [mimeTypes.xls]: 'file-excel',
19
8
  [mimeTypes.xlsx]: 'file-excel',
20
9
  [mimeTypes.jpeg]: 'file-image',
@@ -1,7 +1,8 @@
1
1
  import { isNotEmpty } from '@true-engineering/true-react-platform-helpers';
2
2
  import { IMimeType, mimeTypes } from '../../constants';
3
+ import { IIconType } from '../Icon';
3
4
  import { FILE_ICON_DEFAULT, iconTypeMap } from './constants';
4
- import { IFileIcon, IFileInfo } from './types';
5
+ import { IFileInfo } from './types';
5
6
 
6
7
  export const getFileExtensionByFilename = (fileName: string): string | undefined => {
7
8
  const splitFileName = fileName.split('.');
@@ -13,7 +14,7 @@ export const getMimeTypeByFilename = (fileName: string): string | undefined => {
13
14
  return isNotEmpty(ext) ? mimeTypes[ext as IMimeType] : undefined;
14
15
  };
15
16
 
16
- export const getFileIcon = ({ type, name }: IFileInfo): IFileIcon => {
17
+ export const getFileIcon = ({ type, name }: IFileInfo): IIconType => {
17
18
  if (isNotEmpty(type) && type in iconTypeMap) {
18
19
  return iconTypeMap[type];
19
20
  }
@@ -1,4 +1,4 @@
1
- import { FILE_ICONS, FILE_ITEM_SIZES } from './constants';
1
+ import { FILE_ITEM_SIZES } from './constants';
2
2
 
3
3
  export interface IFileInfo {
4
4
  name: File['name'];
@@ -6,6 +6,4 @@ export interface IFileInfo {
6
6
  size?: File['size'];
7
7
  }
8
8
 
9
- export type IFileIcon = (typeof FILE_ICONS)[number];
10
-
11
9
  export type IFileItemSize = (typeof FILE_ITEM_SIZES)[number];
@@ -1,86 +1,95 @@
1
+ import { FC } from 'react';
2
+ import { isArrayNotEmpty, isEmpty } from '@true-engineering/true-react-platform-helpers';
3
+ import { useTheme } from '../../theme';
1
4
  import { Icon } from './Icon';
2
- import { complexIcons } from './complexIcons';
3
- import { iconsList } from './icons-list';
5
+ import { iconsMap } from './icons';
4
6
  import { IIconType } from './types';
5
7
 
6
- const types: IIconType[] = [...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
7
-
8
8
  export default {
9
9
  title: 'Data Display/Icon',
10
10
  };
11
11
 
12
- export const Default = () => (
12
+ const GalleryIcon: FC<{ type: IIconType }> = ({ type }) => (
13
13
  <div
14
+ key={type}
14
15
  style={{
15
- border: '1px dotted rgba(0,0,0,.2)',
16
- // color: color('Container color', colors.GREEN_FOCUS),
16
+ width: 100,
17
+ height: 100,
18
+ margin: 1,
19
+ background: '#f7f7f7',
17
20
  display: 'flex',
18
- // width: number('Container width', 40, {
19
- // range: true,
20
- // min: 0,
21
- // max: 200,
22
- // step: 10,
23
- // }),
24
- // height: number('Container height', 40, {
25
- // range: true,
26
- // min: 0,
27
- // max: 200,
28
- // step: 10,
29
- // }),
21
+ alignItems: 'center',
22
+ justifyContent: 'center',
23
+ flexDirection: 'column',
30
24
  }}
31
25
  >
32
- {/* <Icon type={select('type', types, types[0])} /> */}
26
+ <div
27
+ style={{
28
+ width: 32,
29
+ height: 32,
30
+ margin: '10px 0',
31
+ display: 'flex',
32
+ alignItems: 'center',
33
+ color: '#888',
34
+ }}
35
+ >
36
+ <Icon type={type} />
37
+ </div>
38
+ <div
39
+ style={{
40
+ fontFamily: 'Arial',
41
+ fontSize: 13,
42
+ color: '#747679',
43
+ overflow: 'hidden',
44
+ padding: '0 5px',
45
+ }}
46
+ >
47
+ {type}
48
+ </div>
33
49
  </div>
34
50
  );
35
51
 
36
- export const Gallery = () => (
37
- <div
38
- style={{
39
- display: 'flex',
40
- alignItems: 'center',
41
- justifyContent: 'center',
42
- flexWrap: 'wrap',
43
- width: '80vw',
44
- }}
45
- >
46
- {types.map((type) => (
47
- <div
48
- key={type}
49
- style={{
50
- width: 100,
51
- height: 100,
52
- margin: 1,
53
- background: '#f7f7f7',
54
- display: 'flex',
55
- alignItems: 'center',
56
- justifyContent: 'center',
57
- flexDirection: 'column',
58
- }}
59
- >
52
+ export const Gallery = () => {
53
+ const theme = useTheme();
54
+ const notCustomizedIcons = Object.keys(iconsMap).filter((icon) =>
55
+ isEmpty(theme.icons?.[icon]),
56
+ ) as IIconType[];
57
+ const customizedIcons = Object.keys(theme.icons ?? {}) as IIconType[];
58
+
59
+ return (
60
+ <div>
61
+ {isArrayNotEmpty(notCustomizedIcons) && (
62
+ <div>
63
+ <h1>Китовые иконки</h1>
64
+ <div
65
+ style={{
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ flexWrap: 'wrap',
69
+ width: '80vw',
70
+ }}
71
+ >
72
+ {notCustomizedIcons.map((type) => (
73
+ <GalleryIcon type={type} key={type} />
74
+ ))}
75
+ </div>
76
+ </div>
77
+ )}
78
+ <div>
79
+ <h1>Кастомизированные иконки</h1>
60
80
  <div
61
81
  style={{
62
- width: 32,
63
- height: 32,
64
- margin: '10px 0',
65
82
  display: 'flex',
66
83
  alignItems: 'center',
67
- color: '#888',
68
- }}
69
- >
70
- <Icon type={type} />
71
- </div>
72
- <div
73
- style={{
74
- fontFamily: 'Arial',
75
- fontSize: 13,
76
- color: '#747679',
77
- overflow: 'hidden',
78
- padding: '0 5px',
84
+ flexWrap: 'wrap',
85
+ width: '80vw',
79
86
  }}
80
87
  >
81
- {type}
88
+ {customizedIcons.map((type) => (
89
+ <GalleryIcon type={type} key={type} />
90
+ ))}
82
91
  </div>
83
92
  </div>
84
- ))}
85
- </div>
86
- );
93
+ </div>
94
+ );
95
+ };
@@ -1,4 +1,4 @@
1
- import { ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { createThemedStyles, ITweakStyles } from '../../theme';
2
2
 
3
3
  export const useStyles = createThemedStyles('Icon', {
4
4
  root: {
@@ -1,11 +1,10 @@
1
1
  import { FC } from 'react';
2
- import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
3
- import { addDataAttributes } from '../../helpers';
2
+ import { addDataAttributes, isEmpty } from '@true-engineering/true-react-platform-helpers';
3
+ import { useTheme } from '../../theme';
4
4
  import { ICommonProps } from '../../types';
5
- import { ComplexIconBoilerplate, IconBoilerplate } from './components';
6
- import { isComplexIcon } from './helpers';
5
+ import { iconsMap } from './icons';
7
6
  import { IIconType } from './types';
8
- import { useStyles, IIconStyles } from './Icon.styles';
7
+ import { IIconStyles, useStyles } from './Icon.styles';
9
8
 
10
9
  export interface IIconProps extends ICommonProps<IIconStyles> {
11
10
  type: IIconType;
@@ -13,14 +12,20 @@ export interface IIconProps extends ICommonProps<IIconStyles> {
13
12
 
14
13
  export const Icon: FC<IIconProps> = ({ type, data, testId, tweakStyles }) => {
15
14
  const classes = useStyles({ theme: tweakStyles });
15
+ const theme = useTheme();
16
+
17
+ const icon = theme.icons?.[type] ?? iconsMap[type];
18
+
19
+ if (isEmpty(icon)) {
20
+ console.error(`Иконки ${type} не существует`);
21
+ return null;
22
+ }
16
23
 
17
24
  return (
18
- <div className={classes.root} {...addDataTestId(testId)} {...addDataAttributes(data)}>
19
- {isComplexIcon(type) ? (
20
- <ComplexIconBoilerplate type={type} />
21
- ) : (
22
- <IconBoilerplate type={type} />
23
- )}
24
- </div>
25
+ <div
26
+ className={classes.root}
27
+ {...addDataAttributes(data, testId)}
28
+ dangerouslySetInnerHTML={{ __html: icon }}
29
+ />
25
30
  );
26
31
  };
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M6 12h3V9H6v3zm-2 4V7h12l.002 9H4zM16 4h-1V3c0-.552-.448-1-1-1s-1 .448-1 1v1H7V3c0-.552-.448-1-1-1s-1 .448-1 1v1H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="m7.5 13.086 7.793-7.793a1 1 0 1 1 1.414 1.414l-8.5 8.5a1 1 0 0 1-1.414 0l-3.5-3.5a1 1 0 1 1 1.414-1.414L7.5 13.086Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M8.24512 8.84751L11.038 6.05461C11.4285 5.66409 12.0617 5.66409 12.4522 6.05461C12.8427 6.44514 12.8427 7.0783 12.4522 7.46883L8.95222 10.9688C8.5617 11.3593 7.92853 11.3593 7.53801 10.9688L4.03801 7.46883C3.64749 7.0783 3.64749 6.44514 4.03801 6.05461C4.42853 5.66409 5.0617 5.66409 5.45222 6.05461L8.24512 8.84751Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10.0029 11.6053L5.71004 7.31242C5.31951 6.9219 4.68635 6.9219 4.29582 7.31242C3.9053 7.70295 3.9053 8.33611 4.29582 8.72664L9.29582 13.7266C9.68635 14.1172 10.3195 14.1172 10.71 13.7266L15.71 8.72664C16.1006 8.33611 16.1006 7.70295 15.71 7.31242C15.3195 6.9219 14.6863 6.9219 14.2958 7.31242L10.0029 11.6053Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M8.41421 10L12.7071 5.70711C13.0976 5.31658 13.0976 4.68342 12.7071 4.29289C12.3166 3.90237 11.6834 3.90237 11.2929 4.29289L6.29289 9.29289C5.90237 9.68342 5.90237 10.3166 6.29289 10.7071L11.2929 15.7071C11.6834 16.0976 12.3166 16.0976 12.7071 15.7071C13.0976 15.3166 13.0976 14.6834 12.7071 14.2929L8.41421 10Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M11.5858 10L7.29289 5.70711C6.90237 5.31658 6.90237 4.68342 7.29289 4.29289C7.68342 3.90237 8.31658 3.90237 8.70711 4.29289L13.7071 9.29289C14.0976 9.68342 14.0976 10.3166 13.7071 10.7071L8.70711 15.7071C8.31658 16.0976 7.68342 16.0976 7.29289 15.7071C6.90237 15.3166 6.90237 14.6834 7.29289 14.2929L11.5858 10Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M6.102 4.709c-.446-.36-1.055-.373-1.415-.012-.39.39-.342 1.072.108 1.523l3.783 3.782-3.783 3.782-.096.108c-.36.446-.373 1.055-.012 1.415.39.391 1.072.342 1.523-.108l3.782-3.783 3.782 3.783.108.097c.446.358 1.055.372 1.415.011.39-.39.342-1.072-.108-1.523l-3.783-3.782L15.19 6.22l.097-.108c.358-.446.372-1.055.011-1.415-.39-.39-1.072-.342-1.523.108L9.992 8.588 6.21 4.805l-.108-.096Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="currentColor" d="M4.5 4.5l11 11m0-11l-11 11" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M11.985 10l2.407-2.293c.41-.39.41-1.023 0-1.414-.41-.39-1.074-.39-1.485 0L10.5 8.586 8.093 6.293c-.411-.39-1.075-.39-1.485 0-.41.391-.41 1.023 0 1.414L9.015 10l-2.407 2.293c-.41.391-.41 1.023 0 1.414.205.195.473.293.742.293s.538-.098.743-.293l2.407-2.293 2.407 2.293c.205.195.474.293.743.293s.537-.098.742-.293c.41-.391.41-1.023 0-1.414L11.985 10z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M12 11c1.306 0 2.417.834 2.829 2H17c.552 0 1 .448 1 1s-.448 1-1 1h-2.17c-.412 1.165-1.524 2-2.83 2s-2.418-.835-2.83-2H3c-.552 0-1-.448-1-1s.448-1 1-1h6.171c.412-1.166 1.523-2 2.829-2zM5 3c1.306 0 2.417.834 2.829 2H17c.552 0 1 .448 1 1s-.448 1-1 1H7.83C7.417 8.165 6.305 9 5 9 3.343 9 2 7.657 2 6s1.343-3 3-3z"></path></svg>
@@ -0,0 +1,62 @@
1
+ import type { ISvgIcon } from '../types';
2
+ import avatar from './avatar.svg?raw';
3
+ import calendar from './calendar.svg?raw';
4
+ import check from './check.svg?raw';
5
+ import chevronDownSmall from './chevron-down-small.svg?raw';
6
+ import chevronDown from './chevron-down.svg?raw';
7
+ import chevronLeft from './chevron-left.svg?raw';
8
+ import chevronRight from './chevron-right.svg?raw';
9
+ import closeLarge from './close-large.svg?raw';
10
+ import closeWindow from './close-window.svg?raw';
11
+ import close from './close.svg?raw';
12
+ import fileExcel from './file-excel.svg?raw';
13
+ import fileImage from './file-image.svg?raw';
14
+ import fileOther from './file-other.svg?raw';
15
+ import filePdf from './file-pdf.svg?raw';
16
+ import fileWord from './file-word.svg?raw';
17
+ import fileXml from './file-xml.svg?raw';
18
+ import fileZip from './file-zip.svg?raw';
19
+ import filter from './filter.svg?raw';
20
+ import information from './information.svg?raw';
21
+ import menu from './menu.svg?raw';
22
+ import minus from './minus.svg?raw';
23
+ import plus from './plus.svg?raw';
24
+ import search from './search.svg?raw';
25
+ import statusError from './status-error.svg?raw';
26
+ import statusInfo from './status-info.svg?raw';
27
+ import statusNotOk from './status-not-ok.svg?raw';
28
+ import statusOk from './status-ok.svg?raw';
29
+ import statusWarning from './status-warning.svg?raw';
30
+ import trashCan from './trash-can.svg?raw';
31
+
32
+ export const iconsMap = {
33
+ avatar,
34
+ calendar,
35
+ check,
36
+ 'chevron-down-small': chevronDownSmall,
37
+ 'chevron-down': chevronDown,
38
+ 'chevron-left': chevronLeft,
39
+ 'chevron-right': chevronRight,
40
+ 'close-large': closeLarge,
41
+ 'close-window': closeWindow,
42
+ close,
43
+ 'file-excel': fileExcel,
44
+ 'file-image': fileImage,
45
+ 'file-other': fileOther,
46
+ 'file-pdf': filePdf,
47
+ 'file-word': fileWord,
48
+ 'file-xml': fileXml,
49
+ 'file-zip': fileZip,
50
+ filter,
51
+ information,
52
+ menu,
53
+ minus,
54
+ plus,
55
+ search,
56
+ 'status-error': statusError,
57
+ 'status-info': statusInfo,
58
+ 'status-not-ok': statusNotOk,
59
+ 'status-ok': statusOk,
60
+ 'status-warning': statusWarning,
61
+ 'trash-can': trashCan,
62
+ } satisfies Record<string, ISvgIcon>;
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 8c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm0 8c3.307 0 6-2.693 6-6 0-3.308-2.693-6-6-6-3.308 0-6 2.692-6 6 0 3.307 2.692 6 6 6zm0-14c2.122 0 4.157.843 5.657 2.343S18 7.878 18 10s-.843 4.157-2.343 5.657S12.122 18 10 18s-4.157-.843-5.657-2.343S2 12.122 2 10c0-4.418 3.582-8 8-8zm0 12c-.552 0-1-.448-1-1v-3c0-.552.448-1 1-1s1 .448 1 1v3c0 .552-.448 1-1 1z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="1 1 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M5.08154 9.02148C5.08154 8.77083 5.16211 8.55778 5.32324 8.38232C5.48438 8.20687 5.70817 8.11914 5.99463 8.11914C6.28109 8.11914 6.50667 8.20687 6.67139 8.38232C6.8361 8.55778 6.91846 8.77083 6.91846 9.02148C6.91846 9.27214 6.8361 9.47803 6.67139 9.63916C6.50667 9.80029 6.28109 9.88086 5.99463 9.88086C5.70817 9.88086 5.48438 9.80029 5.32324 9.63916C5.16211 9.47803 5.08154 9.27214 5.08154 9.02148ZM8.08154 9.02148C8.08154 8.77083 8.16211 8.55778 8.32324 8.38232C8.48438 8.20687 8.70817 8.11914 8.99463 8.11914C9.28109 8.11914 9.50667 8.20687 9.67139 8.38232C9.8361 8.55778 9.91846 8.77083 9.91846 9.02148C9.91846 9.27214 9.8361 9.47803 9.67139 9.63916C9.50667 9.80029 9.28109 9.88086 8.99463 9.88086C8.70817 9.88086 8.48438 9.80029 8.32324 9.63916C8.16211 9.47803 8.08154 9.27214 8.08154 9.02148ZM11.0815 9.02148C11.0815 8.77083 11.1621 8.55778 11.3232 8.38232C11.4844 8.20687 11.7082 8.11914 11.9946 8.11914C12.2811 8.11914 12.5067 8.20687 12.6714 8.38232C12.8361 8.55778 12.9185 8.77083 12.9185 9.02148C12.9185 9.27214 12.8361 9.47803 12.6714 9.63916C12.5067 9.80029 12.2811 9.88086 11.9946 9.88086C11.7082 9.88086 11.4844 9.80029 11.3232 9.63916C11.1621 9.47803 11.0815 9.27214 11.0815 9.02148Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M16 11H4a1 1 0 1 1 0-2h12a1 1 0 1 1 0 2Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M16 11h-5v5a1 1 0 1 1-2 0v-5H4a1 1 0 1 1 0-2h5V4a1 1 0 0 1 2 0v5h5a1 1 0 1 1 0 2Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M9 2c3.866 0 7 3.134 7 7 0 1.7-.606 3.259-1.614 4.472l2.589 2.59c.39.39.39 1.023 0 1.414-.39.39-1.024.39-1.414 0l-2.662-2.661C11.785 15.563 10.443 16 9 16c-3.866 0-7-3.134-7-7s3.134-7 7-7zm0 2C6.239 4 4 6.239 4 9s2.239 5 5 5 5-2.239 5-5-2.239-5-5-5z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M14 11H6c-.552 0-1-.448-1-1s.448-1 1-1h8c.552 0 1 .448 1 1s-.448 1-1 1z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M10 15c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1s1 .448 1 1v4c0 .552-.448 1-1 1zM10 7c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M11.414 10l2.293-2.293c.391-.391.391-1.023 0-1.414-.39-.391-1.023-.391-1.414 0L10 8.586 7.707 6.293c-.39-.391-1.023-.391-1.414 0-.39.391-.39 1.023 0 1.414L8.586 10l-2.293 2.293c-.39.391-.39 1.023 0 1.414.195.195.451.293.707.293.256 0 .512-.098.707-.293L10 11.414l2.293 2.293c.195.195.451.293.707.293.256 0 .512-.098.707-.293.391-.391.391-1.023 0-1.414L11.414 10z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M8.333 11.252l4.96-4.96c.39-.39 1.024-.39 1.414 0 .39.391.39 1.025 0 1.415L9.04 13.374c-.39.39-1.023.39-1.414 0L5.293 11.04c-.39-.39-.39-1.023 0-1.414.39-.39 1.024-.39 1.414 0l1.626 1.626z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0z"></path><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" stroke="none" d="M10 5c-.552 0-1 .448-1 1v4c0 .552.448 1 1 1s1-.448 1-1V6c0-.552-.448-1-1-1zM10 13c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" stroke="none" d="M16 6v10c0 1.105-.895 2-2 2H6c-1.105 0-2-.895-2-2V6h12zM8 8c-.552 0-1 .448-1 1v6c0 .552.448 1 1 1s1-.448 1-1V9c0-.552-.448-1-1-1zm4 0c-.552 0-1 .448-1 1v6c0 .552.448 1 1 1s1-.448 1-1V9c0-.552-.448-1-1-1zm0-6l1 1h3c.552 0 1 .448 1 1s-.448 1-1 1H4c-.552 0-1-.448-1-1s.448-1 1-1h3l1-1h4z"></path></svg>
@@ -1,5 +1,5 @@
1
1
  export * from './Icon';
2
2
  export * from './types';
3
- export { iconsList } from './icons-list';
3
+ export * from './icons';
4
4
  export type { IIconStyles } from './Icon.styles';
5
5
  export * from './snippet';
@@ -1,18 +1,12 @@
1
- import { ReactElement, SVGAttributes } from 'react';
2
- import { complexIcons } from './complexIcons';
3
- import { iconsList } from './icons-list';
1
+ import { ReactElement } from 'react';
2
+ import { iconsMap } from './icons';
4
3
 
5
- export interface ISvgIcon {
6
- viewBox?: string;
7
- paths?: Array<SVGAttributes<never>>;
8
- circles?: Array<SVGAttributes<never>>;
9
- rects?: Array<SVGAttributes<never>>;
10
- }
4
+ export type ISvgIcon = string;
11
5
 
12
- export type ICommonIcon = keyof typeof iconsList;
6
+ type IUiKitIconsMap = typeof iconsMap;
7
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
8
+ export interface IIconsMap extends IUiKitIconsMap {}
13
9
 
14
- export type IComplexIcon = keyof typeof complexIcons;
15
-
16
- export type IIconType = ICommonIcon | IComplexIcon;
10
+ export type IIconType = keyof IIconsMap;
17
11
 
18
12
  export type IIcon = IIconType | ReactElement;
@@ -1,10 +1,9 @@
1
1
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
- import { iconsList, IIconType } from '../Icon';
3
- import { complexIcons } from '../Icon/complexIcons';
2
+ import { iconsMap } from '../Icon';
4
3
  import { IconButton } from './IconButton';
5
4
  import { ICON_BUTTON_SIZES, ICON_BUTTON_VIEWS } from './constants';
6
5
 
7
- const icons = [...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
6
+ const icons = Object.keys(iconsMap);
8
7
 
9
8
  export default {
10
9
  title: 'Buttons/IconButton',
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import { ComponentStory } from '@storybook/react';
3
- import { iconsList } from '../Icon';
3
+ import { iconsMap } from '../Icon';
4
4
  import { IInputProps, Input } from './Input';
5
5
 
6
6
  const types: Array<IInputProps['type']> = ['text', 'password', 'email', 'number'];
@@ -17,7 +17,7 @@ const groupPositions = [
17
17
  'middle',
18
18
  ];
19
19
  const masks = [undefined, '99/99', 'aaa-aaa', '***+***'];
20
- const icons = [undefined, ...Object.keys(iconsList)];
20
+ const icons = [undefined, ...Object.keys(iconsMap)];
21
21
 
22
22
  export default {
23
23
  title: 'Inputs/Input',
@@ -17,7 +17,7 @@ import { useStyles, IModalStyles, closeButtonStyles } from './Modal.styles';
17
17
 
18
18
  export interface IModalProps extends ICommonProps<IModalStyles>, IModalTransitionProps {
19
19
  title?: ReactNode;
20
- /** @default 'l */
20
+ /** @default 'l' */
21
21
  size?: 'l' | 'm' | 's';
22
22
  /** @default false */
23
23
  isFooterSticky?: boolean;
@@ -1,9 +1,8 @@
1
1
  import { Meta, Story } from '@storybook/react';
2
- import { iconsList, IIconType } from '../Icon';
3
- import { complexIcons } from '../Icon/complexIcons';
2
+ import { iconsMap } from '../Icon';
4
3
  import { INotificationProps, Notification } from './Notification';
5
4
 
6
- const icons = [undefined, ...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
5
+ const icons = [undefined, ...Object.keys(iconsMap)];
7
6
 
8
7
  const lorem = 'Lorem ipsum dolor, sit amet consectetur adipisicing';
9
8
 
@@ -1,11 +1,11 @@
1
1
  import { useState } from 'react';
2
2
  import { ComponentStory } from '@storybook/react';
3
3
  import { phoneInfo } from '../../constants';
4
- import { iconsList } from '../Icon';
4
+ import { iconsMap } from '../Icon';
5
5
  import { PhoneInput } from './PhoneInput';
6
6
  import { IPhoneValue } from './types';
7
7
 
8
- const icons = [undefined, ...Object.keys(iconsList)];
8
+ const icons = [undefined, ...Object.keys(iconsMap)];
9
9
  const groupPlacements = [undefined, 'left', 'right', 'middle'];
10
10
  const borders = [undefined, 'left', 'top', 'right', 'bottom'];
11
11
  const errorPositions = ['bottom', 'top'];