@true-engineering/true-react-common-ui-kit 2.5.0 → 2.6.0

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 (78) hide show
  1. package/LICENSE +201 -201
  2. package/dist/components/Flag/augment.d.ts +1 -1
  3. package/dist/components/Icon/complexIcons/augment.d.ts +1 -1
  4. package/dist/components/Input/Input.d.ts +2 -2
  5. package/dist/true-react-common-ui-kit.js +58 -58
  6. package/dist/true-react-common-ui-kit.js.map +1 -1
  7. package/dist/true-react-common-ui-kit.umd.cjs +58 -58
  8. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  9. package/dist/vite-env.d.ts +1 -1
  10. package/package.json +1 -1
  11. package/src/components/AccountInfo/AccountInfo.styles.ts +55 -55
  12. package/src/components/AccountInfo/index.ts +2 -2
  13. package/src/components/AddButton/AddButton.stories.tsx +21 -21
  14. package/src/components/AddButton/AddButton.styles.ts +34 -34
  15. package/src/components/AddButton/index.ts +2 -2
  16. package/src/components/Button/Button.styles.ts +196 -196
  17. package/src/components/Checkbox/Checkbox.styles.ts +62 -62
  18. package/src/components/Checkbox/index.ts +2 -2
  19. package/src/components/CloseButton/index.ts +2 -2
  20. package/src/components/Colors/Colors.stories.tsx +7 -7
  21. package/src/components/Colors/Colors.styles.ts +38 -38
  22. package/src/components/Colors/index.ts +2 -2
  23. package/src/components/CssBaseline/CssBaseline.styles.ts +15 -15
  24. package/src/components/CssBaseline/index.ts +2 -2
  25. package/src/components/DateInput/DateInput.styles.ts +14 -14
  26. package/src/components/DateInput/constants.ts +2 -2
  27. package/src/components/DateInput/index.ts +3 -3
  28. package/src/components/Description/Description.styles.ts +31 -31
  29. package/src/components/Description/index.ts +2 -2
  30. package/src/components/FiltersPane/FiltersPane.styles.ts +71 -71
  31. package/src/components/Flag/Flag.styles.ts +18 -18
  32. package/src/components/Flag/augment.d.ts +1 -1
  33. package/src/components/Flag/index.ts +2 -2
  34. package/src/components/FlexibleTable/index.ts +3 -3
  35. package/src/components/Icon/Icon.styles.ts +10 -10
  36. package/src/components/Icon/complexIcons/augment.d.ts +1 -1
  37. package/src/components/Icon/complexIcons/avatarGreen.svg +57 -57
  38. package/src/components/Icon/complexIcons/index.ts +1 -1
  39. package/src/components/IncrementInput/IncrementInput.styles.ts +77 -77
  40. package/src/components/IncrementInput/index.ts +2 -2
  41. package/src/components/Input/Input.styles.ts +307 -307
  42. package/src/components/Input/Input.tsx +3 -2
  43. package/src/components/List/List.styles.ts +52 -52
  44. package/src/components/MoreMenu/MoreMenu.stories.tsx +46 -46
  45. package/src/components/MoreMenu/index.ts +2 -2
  46. package/src/components/MultiSelect/MultiSelect.styles.ts +55 -55
  47. package/src/components/NumberInput/index.ts +1 -1
  48. package/src/components/PhoneInput/PhoneInput.styles.ts +84 -84
  49. package/src/components/PhoneInput/types.ts +16 -16
  50. package/src/components/RadioButton/RadioButton.styles.ts +37 -37
  51. package/src/components/RadioButton/index.ts +2 -2
  52. package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
  53. package/src/components/SearchInput/index.ts +2 -2
  54. package/src/components/Select/Select.styles.ts +96 -96
  55. package/src/components/Select/constants.ts +2 -2
  56. package/src/components/Select/types.ts +1 -1
  57. package/src/components/Switch/Switch.styles.ts +75 -75
  58. package/src/components/TextArea/TextArea.styles.ts +153 -153
  59. package/src/components/TextArea/index.ts +2 -2
  60. package/src/components/TextWithInfo/TextWithInfo.styles.ts +60 -60
  61. package/src/components/TextWithInfo/index.ts +2 -2
  62. package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
  63. package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +19 -19
  64. package/src/components/TextWithTooltip/index.ts +2 -2
  65. package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +21 -21
  66. package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
  67. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +54 -54
  68. package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +2 -2
  69. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +11 -11
  70. package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +2 -2
  71. package/src/components/Toaster/Toaster.styles.ts +59 -59
  72. package/src/components/Tooltip/types.ts +1 -1
  73. package/src/components/index.ts +36 -36
  74. package/src/helpers/popper-helpers.ts +17 -17
  75. package/src/hooks/index.ts +6 -6
  76. package/src/hooks/use-is-mounted.ts +15 -15
  77. package/src/index.ts +6 -6
  78. package/src/vite-env.d.ts +1 -1
@@ -1,52 +1,52 @@
1
- import { colors } from '../../theme';
2
- import { ComponentStyles } from '../../types';
3
-
4
- const ITEM_HORIZONTAL_PADDING = 16;
5
- const ICON_SIZE = 20;
6
- const ICON_GAP = 12;
7
-
8
- export const styles = {
9
- root: {
10
- minWidth: 180,
11
- backgroundColor: colors.CLASSIC_WHITE,
12
- padding: [8, 0],
13
- listStyle: 'none',
14
- margin: 0,
15
- },
16
-
17
- item: {
18
- display: 'flex',
19
- alignItems: 'center',
20
- boxSizing: 'border-box',
21
- fontSize: 16,
22
- whiteSpace: 'nowrap',
23
- minHeight: 40,
24
- padding: [0, ITEM_HORIZONTAL_PADDING],
25
- transition: 'background-color 0.25s ease-in-out',
26
- cursor: 'pointer',
27
- },
28
-
29
- disabledItem: {
30
- cursor: 'default',
31
- },
32
-
33
- spacer: {
34
- height: 1,
35
- backgroundColor: colors.BORDER_LIGHT,
36
- },
37
-
38
- withIconGap: {
39
- paddingLeft: ITEM_HORIZONTAL_PADDING + ICON_SIZE + ICON_GAP,
40
- },
41
-
42
- icon: {
43
- width: ICON_SIZE,
44
- height: ICON_SIZE,
45
- marginRight: ICON_GAP,
46
- flexShrink: 0,
47
- },
48
-
49
- content: {},
50
- };
51
-
52
- export type ListStyles = ComponentStyles<typeof styles>;
1
+ import { colors } from '../../theme';
2
+ import { ComponentStyles } from '../../types';
3
+
4
+ const ITEM_HORIZONTAL_PADDING = 16;
5
+ const ICON_SIZE = 20;
6
+ const ICON_GAP = 12;
7
+
8
+ export const styles = {
9
+ root: {
10
+ minWidth: 180,
11
+ backgroundColor: colors.CLASSIC_WHITE,
12
+ padding: [8, 0],
13
+ listStyle: 'none',
14
+ margin: 0,
15
+ },
16
+
17
+ item: {
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ boxSizing: 'border-box',
21
+ fontSize: 16,
22
+ whiteSpace: 'nowrap',
23
+ minHeight: 40,
24
+ padding: [0, ITEM_HORIZONTAL_PADDING],
25
+ transition: 'background-color 0.25s ease-in-out',
26
+ cursor: 'pointer',
27
+ },
28
+
29
+ disabledItem: {
30
+ cursor: 'default',
31
+ },
32
+
33
+ spacer: {
34
+ height: 1,
35
+ backgroundColor: colors.BORDER_LIGHT,
36
+ },
37
+
38
+ withIconGap: {
39
+ paddingLeft: ITEM_HORIZONTAL_PADDING + ICON_SIZE + ICON_GAP,
40
+ },
41
+
42
+ icon: {
43
+ width: ICON_SIZE,
44
+ height: ICON_SIZE,
45
+ marginRight: ICON_GAP,
46
+ flexShrink: 0,
47
+ },
48
+
49
+ content: {},
50
+ };
51
+
52
+ export type ListStyles = ComponentStyles<typeof styles>;
@@ -1,46 +1,46 @@
1
- import { ComponentStory } from '@storybook/react';
2
- import { colors } from '../../theme';
3
- import { MoreMenu } from './MoreMenu';
4
-
5
- const menuItems = [
6
- { item: 'Печатать билет', onClick: console.log },
7
- { item: 'Выписать', onClick: console.log },
8
- { item: 'Аннулировать', onClick: console.log, shouldDrawSpacerBelow: true },
9
- {
10
- item: (() => <div style={{ color: colors.RED_ACTIVE }}>Удалить</div>)(),
11
- onClick: console.log,
12
- },
13
- {
14
- item: (() => <div style={{ color: colors.RED_ACTIVE }}>Удалить</div>)(),
15
- onClick: console.log,
16
- },
17
- ];
18
-
19
- export default {
20
- title: 'MoreMenu',
21
- component: MoreMenu,
22
- };
23
-
24
- const Template: ComponentStory<typeof MoreMenu> = (args) => (
25
- <div
26
- style={{
27
- display: 'flex',
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- width: 600,
31
- height: 400,
32
- }}
33
- >
34
- <div style={{ display: 'flex', gap: 10, alignItems: 'center' }}>
35
- <div style={{ flexShrink: 0 }}>Test subject</div>
36
- <MoreMenu {...args} items={menuItems} />
37
- </div>
38
- </div>
39
- );
40
-
41
- export const Default = Template.bind({});
42
-
43
- Default.args = {
44
- isDisabled: false,
45
- hasDefaultStateBackground: true,
46
- };
1
+ import { ComponentStory } from '@storybook/react';
2
+ import { colors } from '../../theme';
3
+ import { MoreMenu } from './MoreMenu';
4
+
5
+ const menuItems = [
6
+ { item: 'Печатать билет', onClick: console.log },
7
+ { item: 'Выписать', onClick: console.log },
8
+ { item: 'Аннулировать', onClick: console.log, shouldDrawSpacerBelow: true },
9
+ {
10
+ item: (() => <div style={{ color: colors.RED_ACTIVE }}>Удалить</div>)(),
11
+ onClick: console.log,
12
+ },
13
+ {
14
+ item: (() => <div style={{ color: colors.RED_ACTIVE }}>Удалить</div>)(),
15
+ onClick: console.log,
16
+ },
17
+ ];
18
+
19
+ export default {
20
+ title: 'MoreMenu',
21
+ component: MoreMenu,
22
+ };
23
+
24
+ const Template: ComponentStory<typeof MoreMenu> = (args) => (
25
+ <div
26
+ style={{
27
+ display: 'flex',
28
+ alignItems: 'center',
29
+ justifyContent: 'center',
30
+ width: 600,
31
+ height: 400,
32
+ }}
33
+ >
34
+ <div style={{ display: 'flex', gap: 10, alignItems: 'center' }}>
35
+ <div style={{ flexShrink: 0 }}>Test subject</div>
36
+ <MoreMenu {...args} items={menuItems} />
37
+ </div>
38
+ </div>
39
+ );
40
+
41
+ export const Default = Template.bind({});
42
+
43
+ Default.args = {
44
+ isDisabled: false,
45
+ hasDefaultStateBackground: true,
46
+ };
@@ -1,2 +1,2 @@
1
- export * from './MoreMenu';
2
- export type { MoreMenuStyles } from './MoreMenu.styles';
1
+ export * from './MoreMenu';
2
+ export type { MoreMenuStyles } from './MoreMenu.styles';
@@ -1,55 +1,55 @@
1
- import { ComponentStyles } from '../../types';
2
-
3
- export const styles = {
4
- root: {
5
- position: 'relative',
6
- boxSizing: 'border-box',
7
- height: '100%',
8
- width: '100%',
9
- cursor: 'pointer',
10
- fontSize: 16,
11
- },
12
-
13
- required: {
14
- '&:before': {
15
- content: '""',
16
- position: 'absolute',
17
- left: -12,
18
- top: '50%',
19
- transform: 'translate(0, -50%)',
20
- width: 6,
21
- height: 6,
22
- borderRadius: '50%',
23
- },
24
- },
25
-
26
- disabled: {
27
- cursor: 'default',
28
- },
29
-
30
- listContainer: {
31
- position: 'absolute',
32
- top: 'calc(100% + 4px)',
33
- left: -1,
34
- right: -1,
35
- zIndex: 2,
36
- },
37
-
38
- invalid: {},
39
-
40
- open: {},
41
-
42
- full: {},
43
-
44
- left: {},
45
-
46
- right: {},
47
-
48
- tweakMultiSelectList: {
49
- root: {
50
- width: '100%',
51
- },
52
- },
53
- };
54
-
55
- export type MultiSelectStyles = ComponentStyles<typeof styles>;
1
+ import { ComponentStyles } from '../../types';
2
+
3
+ export const styles = {
4
+ root: {
5
+ position: 'relative',
6
+ boxSizing: 'border-box',
7
+ height: '100%',
8
+ width: '100%',
9
+ cursor: 'pointer',
10
+ fontSize: 16,
11
+ },
12
+
13
+ required: {
14
+ '&:before': {
15
+ content: '""',
16
+ position: 'absolute',
17
+ left: -12,
18
+ top: '50%',
19
+ transform: 'translate(0, -50%)',
20
+ width: 6,
21
+ height: 6,
22
+ borderRadius: '50%',
23
+ },
24
+ },
25
+
26
+ disabled: {
27
+ cursor: 'default',
28
+ },
29
+
30
+ listContainer: {
31
+ position: 'absolute',
32
+ top: 'calc(100% + 4px)',
33
+ left: -1,
34
+ right: -1,
35
+ zIndex: 2,
36
+ },
37
+
38
+ invalid: {},
39
+
40
+ open: {},
41
+
42
+ full: {},
43
+
44
+ left: {},
45
+
46
+ right: {},
47
+
48
+ tweakMultiSelectList: {
49
+ root: {
50
+ width: '100%',
51
+ },
52
+ },
53
+ };
54
+
55
+ export type MultiSelectStyles = ComponentStyles<typeof styles>;
@@ -1 +1 @@
1
- export * from './NumberInput';
1
+ export * from './NumberInput';
@@ -1,84 +1,84 @@
1
- import { colors, dimensions } from '../../theme';
2
- import { ComponentStyles } from '../../types';
3
-
4
- const COUNTRY_SELECT_WIDTH = 80;
5
-
6
- export const styles = {
7
- root: {
8
- width: '100%',
9
- position: 'relative',
10
- boxSizing: 'border-box',
11
- },
12
-
13
- countrySelectContainer: {
14
- position: 'absolute',
15
- left: 1,
16
- top: 1,
17
- width: COUNTRY_SELECT_WIDTH,
18
- height: dimensions.CONTROL_HEIGHT - 2,
19
- display: 'flex',
20
- alignItems: 'center',
21
- justifyContent: 'center',
22
- borderRight: ['solid', 1, colors.BORDER_MAIN],
23
- transition: 'border-color 0.2s ease-in',
24
- cursor: 'pointer',
25
- zIndex: 2,
26
- },
27
-
28
- disabledCountrySelect: {
29
- cursor: 'default',
30
- },
31
-
32
- flag: {
33
- width: 22,
34
- height: 16,
35
- },
36
-
37
- arrow: {
38
- width: 20,
39
- color: colors.GREY_ACTIVE,
40
- marginLeft: 8,
41
- transition: 'transform .2s ease',
42
- },
43
-
44
- up: {
45
- transform: 'rotate(180deg)',
46
- },
47
-
48
- invalidArrow: {
49
- color: colors.RED_WARNING,
50
- },
51
-
52
- focusedBorder: {},
53
-
54
- invalidBorder: {
55
- borderColor: colors.RED_WARNING,
56
- },
57
-
58
- inputContainer: {
59
- position: 'relative',
60
- flex: 1,
61
- },
62
-
63
- flagListContainer: {
64
- position: 'absolute',
65
- width: '100%',
66
- top: dimensions.CONTROL_HEIGHT + 6,
67
- left: -1,
68
- zIndex: 3,
69
- },
70
-
71
- tweakInput: {
72
- inputWrapper: {
73
- paddingLeft: COUNTRY_SELECT_WIDTH,
74
- },
75
-
76
- label: {
77
- marginLeft: COUNTRY_SELECT_WIDTH,
78
- },
79
- },
80
-
81
- tweakCountryList: {},
82
- };
83
-
84
- export type PhoneInputStyles = ComponentStyles<typeof styles>;
1
+ import { colors, dimensions } from '../../theme';
2
+ import { ComponentStyles } from '../../types';
3
+
4
+ const COUNTRY_SELECT_WIDTH = 80;
5
+
6
+ export const styles = {
7
+ root: {
8
+ width: '100%',
9
+ position: 'relative',
10
+ boxSizing: 'border-box',
11
+ },
12
+
13
+ countrySelectContainer: {
14
+ position: 'absolute',
15
+ left: 1,
16
+ top: 1,
17
+ width: COUNTRY_SELECT_WIDTH,
18
+ height: dimensions.CONTROL_HEIGHT - 2,
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ borderRight: ['solid', 1, colors.BORDER_MAIN],
23
+ transition: 'border-color 0.2s ease-in',
24
+ cursor: 'pointer',
25
+ zIndex: 2,
26
+ },
27
+
28
+ disabledCountrySelect: {
29
+ cursor: 'default',
30
+ },
31
+
32
+ flag: {
33
+ width: 22,
34
+ height: 16,
35
+ },
36
+
37
+ arrow: {
38
+ width: 20,
39
+ color: colors.GREY_ACTIVE,
40
+ marginLeft: 8,
41
+ transition: 'transform .2s ease',
42
+ },
43
+
44
+ up: {
45
+ transform: 'rotate(180deg)',
46
+ },
47
+
48
+ invalidArrow: {
49
+ color: colors.RED_WARNING,
50
+ },
51
+
52
+ focusedBorder: {},
53
+
54
+ invalidBorder: {
55
+ borderColor: colors.RED_WARNING,
56
+ },
57
+
58
+ inputContainer: {
59
+ position: 'relative',
60
+ flex: 1,
61
+ },
62
+
63
+ flagListContainer: {
64
+ position: 'absolute',
65
+ width: '100%',
66
+ top: dimensions.CONTROL_HEIGHT + 6,
67
+ left: -1,
68
+ zIndex: 3,
69
+ },
70
+
71
+ tweakInput: {
72
+ inputWrapper: {
73
+ paddingLeft: COUNTRY_SELECT_WIDTH,
74
+ },
75
+
76
+ label: {
77
+ marginLeft: COUNTRY_SELECT_WIDTH,
78
+ },
79
+ },
80
+
81
+ tweakCountryList: {},
82
+ };
83
+
84
+ export type PhoneInputStyles = ComponentStyles<typeof styles>;
@@ -1,16 +1,16 @@
1
- export interface IPhoneInfo {
2
- countryEn: string;
3
- countryRu: string;
4
- countryCode: string;
5
- dialCode: string;
6
- phoneMask?: string;
7
- dialCodePriority?: number;
8
- areaCodes?: string[];
9
- fullCodes: string[];
10
- }
11
-
12
- export interface IPhoneValue {
13
- phoneNumber?: string;
14
- dialCode?: string;
15
- countryCode?: string;
16
- }
1
+ export interface IPhoneInfo {
2
+ countryEn: string;
3
+ countryRu: string;
4
+ countryCode: string;
5
+ dialCode: string;
6
+ phoneMask?: string;
7
+ dialCodePriority?: number;
8
+ areaCodes?: string[];
9
+ fullCodes: string[];
10
+ }
11
+
12
+ export interface IPhoneValue {
13
+ phoneNumber?: string;
14
+ dialCode?: string;
15
+ countryCode?: string;
16
+ }
@@ -1,37 +1,37 @@
1
- import { ComponentStyles } from '../../types';
2
-
3
- export const styles = {
4
- input: {
5
- appearance: 'none',
6
- cursor: 'pointer',
7
- borderRadius: '50%',
8
- width: 18,
9
- height: 18,
10
- outline: 'none',
11
- transition: '0.1s all ease-in-out',
12
- margin: 0,
13
- border: [1, 'solid', '#000'],
14
-
15
- '&:checked': {
16
- border: [5, 'solid', '#000'],
17
- },
18
- },
19
-
20
- label: {
21
- display: 'flex',
22
- alignItems: 'center',
23
- cursor: 'pointer',
24
- },
25
-
26
- content: {
27
- marginLeft: 8,
28
- },
29
-
30
- isDisabled: {
31
- cursor: 'default',
32
- },
33
-
34
- isInvalid: {},
35
- };
36
-
37
- export type RadioButtonStyles = ComponentStyles<typeof styles>;
1
+ import { ComponentStyles } from '../../types';
2
+
3
+ export const styles = {
4
+ input: {
5
+ appearance: 'none',
6
+ cursor: 'pointer',
7
+ borderRadius: '50%',
8
+ width: 18,
9
+ height: 18,
10
+ outline: 'none',
11
+ transition: '0.1s all ease-in-out',
12
+ margin: 0,
13
+ border: [1, 'solid', '#000'],
14
+
15
+ '&:checked': {
16
+ border: [5, 'solid', '#000'],
17
+ },
18
+ },
19
+
20
+ label: {
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ cursor: 'pointer',
24
+ },
25
+
26
+ content: {
27
+ marginLeft: 8,
28
+ },
29
+
30
+ isDisabled: {
31
+ cursor: 'default',
32
+ },
33
+
34
+ isInvalid: {},
35
+ };
36
+
37
+ export type RadioButtonStyles = ComponentStyles<typeof styles>;
@@ -1,2 +1,2 @@
1
- export * from './RadioButton';
2
- export type { RadioButtonStyles } from './RadioButton.styles';
1
+ export * from './RadioButton';
2
+ export type { RadioButtonStyles } from './RadioButton.styles';
@@ -1 +1 @@
1
- export * from './ScrollIntoViewIfNeeded';
1
+ export * from './ScrollIntoViewIfNeeded';
@@ -1,2 +1,2 @@
1
- export * from './SearchInput';
2
- export type { SearchInputStyles } from './SearchInput.styles';
1
+ export * from './SearchInput';
2
+ export type { SearchInputStyles } from './SearchInput.styles';