@true-engineering/true-react-common-ui-kit 3.10.0 → 3.11.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 (27) hide show
  1. package/README.md +6 -0
  2. package/dist/theme/common.d.ts +2 -0
  3. package/dist/true-react-common-ui-kit.js +45 -35
  4. package/dist/true-react-common-ui-kit.js.map +1 -1
  5. package/dist/true-react-common-ui-kit.umd.cjs +45 -35
  6. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/AccountInfo/AccountInfo.styles.ts +3 -2
  9. package/src/components/Button/Button.styles.ts +2 -2
  10. package/src/components/CloseButton/CloseButton.styles.ts +3 -2
  11. package/src/components/FiltersPane/FiltersPane.styles.ts +3 -2
  12. package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +3 -2
  13. package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +2 -2
  14. package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +8 -2
  15. package/src/components/FlexibleTable/FlexibleTable.styles.ts +3 -2
  16. package/src/components/IconButton/IconButton.styles.ts +2 -2
  17. package/src/components/IncrementInput/IncrementInput.styles.ts +3 -2
  18. package/src/components/Input/Input.styles.ts +6 -5
  19. package/src/components/List/List.styles.ts +3 -2
  20. package/src/components/List/components/ListItem/ListItem.styles.ts +3 -2
  21. package/src/components/MoreMenu/MoreMenu.styles.ts +3 -2
  22. package/src/components/NewMoreMenu/NewMoreMenu.styles.ts +3 -2
  23. package/src/components/Selector/Selector.styles.ts +4 -3
  24. package/src/components/Switch/Switch.styles.ts +4 -4
  25. package/src/components/TextArea/TextArea.styles.ts +4 -4
  26. package/src/components/TextButton/TextButton.styles.ts +4 -3
  27. package/src/theme/common.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -16,7 +16,8 @@ export const useStyles = createThemedStyles('AccountInfo', {
16
16
  accountName: {
17
17
  margin: [0, 2, 0, 10],
18
18
  fontSize: 14,
19
- transition: 'color 0.25s ease-in-out',
19
+ transition: animations.defaultTransition,
20
+ transitionProperty: 'color',
20
21
  },
21
22
 
22
23
  accountNameOpened: {},
@@ -24,7 +25,7 @@ export const useStyles = createThemedStyles('AccountInfo', {
24
25
  accountChevron: {
25
26
  width: 16,
26
27
  height: 16,
27
- transition: 'ease-in-out 0.25s',
28
+ transition: animations.defaultTransition,
28
29
  transitionProperty: 'transform, color',
29
30
  },
30
31
 
@@ -1,4 +1,4 @@
1
- import { createThemedStyles, ITweakStyles } from '../../theme';
1
+ import { animations, createThemedStyles, ITweakStyles } from '../../theme';
2
2
  import { IThemedPreloaderStyles } from '../ThemedPreloader';
3
3
  import { IButtonSize } from './types';
4
4
 
@@ -10,7 +10,7 @@ export const useStyles = createThemedStyles('Button', {
10
10
  cursor: 'pointer',
11
11
  outline: 'none',
12
12
  boxSizing: 'border-box',
13
- transition: '0.25s ease-in-out',
13
+ transition: animations.defaultTransition,
14
14
  transitionProperty: 'background-color, color, box-shadow, border-color',
15
15
  maxWidth: '100%',
16
16
  border: [1, 'solid', 'transparent'],
@@ -1,5 +1,5 @@
1
1
  import { rgba } from '../../helpers';
2
- import { colors, createThemedStyles, ITweakStyles } from '../../theme';
2
+ import { animations, colors, createThemedStyles, ITweakStyles } from '../../theme';
3
3
 
4
4
  export const useStyles = createThemedStyles('CloseButton', {
5
5
  root: {
@@ -14,7 +14,8 @@ export const useStyles = createThemedStyles('CloseButton', {
14
14
  appearance: 'none',
15
15
  backgroundColor: 'transparent',
16
16
  cursor: 'pointer',
17
- transition: 'background-color 0.25s ease-in-out',
17
+ transition: animations.defaultTransition,
18
+ transitionProperty: 'background-color',
18
19
 
19
20
  '&:hover': {
20
21
  backgroundColor: rgba(colors.BORDER_MAIN, 0.5),
@@ -1,4 +1,4 @@
1
- import { colors, ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { colors, ITweakStyles, createThemedStyles, animations } from '../../theme';
2
2
  import { IButtonStyles } from '../Button';
3
3
 
4
4
  export const FILTER_HEIGHT = 36;
@@ -20,7 +20,8 @@ export const useStyles = createThemedStyles('FiltersPane', {
20
20
  width: 40,
21
21
  height: FILTER_HEIGHT,
22
22
  cursor: 'pointer',
23
- transition: 'background-color 0.25s ease-in-out',
23
+ transition: animations.defaultTransition,
24
+ transitionProperty: 'background-color',
24
25
  },
25
26
 
26
27
  settingsIcon: {
@@ -1,5 +1,5 @@
1
1
  import cloneDeep from 'lodash-es/cloneDeep';
2
- import { colors, createThemedStyles, helpers, ITweakStyles } from '../../../../theme';
2
+ import { animations, colors, createThemedStyles, helpers, ITweakStyles } from '../../../../theme';
3
3
  import { IButtonStyles } from '../../../Button';
4
4
  import { ISearchInputStyles } from '../../../SearchInput';
5
5
  import { innerTextButtonStyles } from '../../FiltersPane.styles';
@@ -55,7 +55,8 @@ export const useStyles = createThemedStyles('FilterSelect', {
55
55
  cursor: 'pointer',
56
56
  fontSize: 14,
57
57
  minHeight: ITEM_HEIGHT,
58
- transition: 'background-color 0.25s ease-in-out',
58
+ transition: animations.defaultTransition,
59
+ transitionProperty: 'background-color',
59
60
  boxSizing: 'border-box',
60
61
  },
61
62
 
@@ -1,11 +1,11 @@
1
- import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
1
+ import { animations, colors, createThemedStyles, ITweakStyles } from '../../../../theme';
2
2
  import type { IFilterValueViewStyles } from '../FilterValueView';
3
3
  import { FILTER_HEIGHT } from '../../FiltersPane.styles';
4
4
 
5
5
  export const useStyles = createThemedStyles('FilterWrapper', {
6
6
  root: {
7
7
  position: 'relative',
8
- transition: '0.25s ease-in-out',
8
+ transition: animations.defaultTransition,
9
9
  transitionProperty: 'background-color, border-color',
10
10
  border: [1, 'solid', colors.BORDER_MAIN],
11
11
  borderRadius: 18,
@@ -1,5 +1,11 @@
1
1
  import { rgba } from '../../../../helpers';
2
- import { colors, createThemedStyles, dimensions, ITweakStyles } from '../../../../theme';
2
+ import {
3
+ animations,
4
+ colors,
5
+ createThemedStyles,
6
+ dimensions,
7
+ ITweakStyles,
8
+ } from '../../../../theme';
3
9
  import { ISearchInputStyles } from '../../../SearchInput';
4
10
  import { ISelectStyles } from '../../../Select';
5
11
  import { FILTER_HEIGHT } from '../../FiltersPane.styles';
@@ -12,7 +18,7 @@ export const useStyles = createThemedStyles('FiltersPaneSearch', {
12
18
  border: [1, 'transparent', 'solid'],
13
19
  borderRadius: 18,
14
20
  paddingRight: 8,
15
- transition: '0.25s ease-in-out',
21
+ transition: animations.defaultTransition,
16
22
  transitionProperty: 'background-color, border-color',
17
23
  },
18
24
 
@@ -1,5 +1,5 @@
1
1
  import { rgba } from '../../helpers';
2
- import { colors, ITweakStyles, createThemedStyles } from '../../theme';
2
+ import { colors, ITweakStyles, createThemedStyles, animations } from '../../theme';
3
3
  import type { IFlexibleTableRowStyles } from './components';
4
4
 
5
5
  export const STICKY_SHADOW_PADDING = 12;
@@ -72,7 +72,8 @@ export const useStyles = createThemedStyles('FlexibleTable', {
72
72
  background: 'transparent',
73
73
  pointerEvents: 'none',
74
74
  zIndex: 1,
75
- transition: ['box-shadow', '0.25s', 'ease-in-out'],
75
+ transition: animations.defaultTransition,
76
+ transitionProperty: 'box-shadow',
76
77
 
77
78
  '[data-scrolled] &': {
78
79
  boxShadow: '4px 0 4px rgba(0, 0, 0, 0.05)',
@@ -1,4 +1,4 @@
1
- import { ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { ITweakStyles, animations, createThemedStyles } from '../../theme';
2
2
 
3
3
  const BUTTON_SIZE_S = 24;
4
4
  const BUTTON_SIZE_M = 32;
@@ -12,7 +12,7 @@ export const useStyles = createThemedStyles('IconButton', {
12
12
  cursor: 'pointer',
13
13
  outline: 'none',
14
14
  boxSizing: 'border-box',
15
- transition: '0.25s ease-in-out',
15
+ transition: animations.defaultTransition,
16
16
  transitionProperty: 'background-color, color, border-color',
17
17
  border: 'none',
18
18
  position: 'relative',
@@ -1,4 +1,4 @@
1
- import { colors, dimensions, ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { colors, dimensions, ITweakStyles, createThemedStyles, animations } from '../../theme';
2
2
  import { IInputStyles } from '../Input';
3
3
 
4
4
  export const BUTTONS_WIDTH = 36;
@@ -28,7 +28,8 @@ export const useStyles = createThemedStyles('IncrementInput', {
28
28
  border: 'none',
29
29
  outline: 'none',
30
30
  backgroundColor: colors.GREY_BACKGROUND,
31
- transition: 'background-color 0.25s ease-in-out',
31
+ transition: animations.defaultTransition,
32
+ transitionProperty: 'background-color',
32
33
  color: colors.FONT_MEDIUM,
33
34
  cursor: 'pointer',
34
35
  display: 'flex',
@@ -1,4 +1,4 @@
1
- import { dimensions, ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { dimensions, ITweakStyles, createThemedStyles, animations } from '../../theme';
2
2
  import { IThemedPreloaderStyles } from '../ThemedPreloader';
3
3
 
4
4
  const PADDING_X = 12;
@@ -16,7 +16,7 @@ export const useStyles = createThemedStyles('Input', {
16
16
  width: '100%',
17
17
  height: dimensions.CONTROL_HEIGHT,
18
18
  boxSizing: 'border-box',
19
- transition: '0.25s ease-in-out',
19
+ transition: animations.defaultTransition,
20
20
  transitionProperty: 'border-color',
21
21
  backgroundColor: 'white',
22
22
  position: 'relative',
@@ -35,7 +35,7 @@ export const useStyles = createThemedStyles('Input', {
35
35
  outline: 'none',
36
36
  boxSizing: 'border-box',
37
37
  outlineStyle: 'none',
38
- transition: '0.25s ease-in-out',
38
+ transition: animations.defaultTransition,
39
39
  transitionProperty: 'background-color',
40
40
  border: 'none',
41
41
  background: 'none',
@@ -137,7 +137,7 @@ export const useStyles = createThemedStyles('Input', {
137
137
  top: '50%',
138
138
  transformOrigin: 'top left',
139
139
  transform: 'translateY(-50%)',
140
- transition: '0.25s ease-in-out',
140
+ transition: animations.defaultTransition,
141
141
  transitionProperty: 'transform, color',
142
142
  fontSize: 16,
143
143
  },
@@ -241,7 +241,8 @@ export const useStyles = createThemedStyles('Input', {
241
241
  alignItems: 'center',
242
242
  padding: [0, 4],
243
243
  width: 20,
244
- transition: 'color 0.25s ease-in-out',
244
+ transition: animations.defaultTransition,
245
+ transitionProperty: 'color',
245
246
  boxSizing: 'content-box',
246
247
 
247
248
  '&:last-child': {
@@ -1,4 +1,4 @@
1
- import { colors, ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { colors, ITweakStyles, createThemedStyles, animations } from '../../theme';
2
2
 
3
3
  const ITEM_HORIZONTAL_PADDING = 16;
4
4
  const ICON_SIZE = 20;
@@ -21,7 +21,8 @@ export const useStyles = createThemedStyles('List', {
21
21
  whiteSpace: 'nowrap',
22
22
  minHeight: 40,
23
23
  padding: [0, ITEM_HORIZONTAL_PADDING],
24
- transition: 'background-color 0.25s ease-in-out',
24
+ transition: animations.defaultTransition,
25
+ transitionProperty: 'background-color',
25
26
  cursor: 'pointer',
26
27
  },
27
28
 
@@ -1,4 +1,4 @@
1
- import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
1
+ import { animations, colors, createThemedStyles, ITweakStyles } from '../../../../theme';
2
2
 
3
3
  const ITEM_HORIZONTAL_PADDING = 16;
4
4
  const ICON_SIZE = 20;
@@ -13,7 +13,8 @@ export const useStyles = createThemedStyles('ListItem', {
13
13
  whiteSpace: 'nowrap',
14
14
  minHeight: 40,
15
15
  padding: [0, ITEM_HORIZONTAL_PADDING],
16
- transition: 'background-color 0.25s ease-in-out',
16
+ transition: animations.defaultTransition,
17
+ transitionProperty: 'background-color',
17
18
  cursor: 'pointer',
18
19
  },
19
20
 
@@ -1,5 +1,5 @@
1
1
  import { rgba } from '../../helpers';
2
- import { colors, ITweakStyles, createThemedStyles } from '../../theme';
2
+ import { colors, ITweakStyles, createThemedStyles, animations } from '../../theme';
3
3
  import { IListStyles } from '../List';
4
4
 
5
5
  export const useStyles = createThemedStyles('MoreMenu', {
@@ -21,7 +21,8 @@ export const useStyles = createThemedStyles('MoreMenu', {
21
21
  borderRadius: '50%',
22
22
  border: 'none',
23
23
  cursor: 'pointer',
24
- transition: 'background-color 0.25s ease-in-out',
24
+ transition: animations.defaultTransition,
25
+ transitionProperty: 'background-color',
25
26
 
26
27
  '&$hasCircle': {
27
28
  backgroundColor: rgba(colors.GREY_HOVER, 0.5),
@@ -1,4 +1,4 @@
1
- import { colors, ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { colors, ITweakStyles, createThemedStyles, animations } from '../../theme';
2
2
  import { IListStyles } from '../List';
3
3
  import { IWithPopupStyles } from '../WithPopup';
4
4
 
@@ -17,7 +17,8 @@ export const useStyles = createThemedStyles('NewMoreMenu', {
17
17
  borderRadius: '50%',
18
18
  border: 'none',
19
19
  cursor: 'pointer',
20
- transition: 'background-color 0.25s ease-in-out',
20
+ transition: animations.defaultTransition,
21
+ transitionProperty: 'background-color',
21
22
  },
22
23
 
23
24
  icon: {
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { isNotEmpty } from '@true-engineering/true-react-platform-helpers';
3
- import { colors, dimensions, ITweakStyles, createThemedStyles } from '../../theme';
3
+ import { colors, dimensions, ITweakStyles, createThemedStyles, animations } from '../../theme';
4
4
 
5
5
  const SELECTOR_TOTAL_GAP = 4;
6
6
  const SELECTOR_BORDER_WIDTH = 1;
@@ -107,7 +107,7 @@ export const useStyles = createThemedStyles('Selector', {
107
107
  height: `calc(100% - ${SELECTOR_GAP * 2}px)`,
108
108
  backgroundColor: colors.CLASSIC_WHITE,
109
109
  borderRadius: dimensions.BORDER_RADIUS_SMALL,
110
- transition: '0.25s ease-in-out',
110
+ transition: animations.defaultTransition,
111
111
  transitionProperty: 'transform, width',
112
112
  },
113
113
 
@@ -122,7 +122,8 @@ export const useStyles = createThemedStyles('Selector', {
122
122
  height: '100%',
123
123
  color: colors.FONT_MEDIUM,
124
124
  fontSize: 16,
125
- transition: 'color 0.25s ease-in-out',
125
+ transition: animations.defaultTransition,
126
+ transitionProperty: 'color',
126
127
  background: 'none',
127
128
 
128
129
  '&$s': {
@@ -1,4 +1,4 @@
1
- import { ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { ITweakStyles, animations, createThemedStyles } from '../../theme';
2
2
 
3
3
  export const useStyles = createThemedStyles('Switch', {
4
4
  root: {
@@ -33,8 +33,8 @@ export const useStyles = createThemedStyles('Switch', {
33
33
  backgroundColor: '#333',
34
34
  borderRadius: 10,
35
35
  boxSizing: 'border-box',
36
+ transition: animations.defaultTransition,
36
37
  transitionProperty: 'opacity, background-color',
37
- transition: '0.25s ease-in-out',
38
38
 
39
39
  '&::before': {
40
40
  content: '""',
@@ -48,8 +48,8 @@ export const useStyles = createThemedStyles('Switch', {
48
48
  backgroundColor: '#fff',
49
49
  borderRadius: '50%',
50
50
  zIndex: 1,
51
+ transition: animations.defaultTransition,
51
52
  transitionProperty: 'left, background-color',
52
- transition: '0.25s ease-in-out',
53
53
  },
54
54
  },
55
55
 
@@ -58,8 +58,8 @@ export const useStyles = createThemedStyles('Switch', {
58
58
  },
59
59
 
60
60
  label: {
61
+ transition: animations.defaultTransition,
61
62
  transitionProperty: 'opacity, color',
62
- transition: '0.25s ease-in-out',
63
63
  },
64
64
 
65
65
  labelLeft: {
@@ -1,4 +1,4 @@
1
- import { ITweakStyles, createThemedStyles } from '../../theme';
1
+ import { ITweakStyles, animations, createThemedStyles } from '../../theme';
2
2
 
3
3
  const PADDING_X = 12;
4
4
 
@@ -16,7 +16,7 @@ export const useStyles = createThemedStyles('TextArea', {
16
16
  width: '100%',
17
17
  flexGrow: 1,
18
18
  boxSizing: 'border-box',
19
- transition: '0.25s ease-in-out',
19
+ transition: animations.defaultTransition,
20
20
  transitionProperty: 'border-color',
21
21
  backgroundColor: 'white',
22
22
  border: ['solid', 1, 'lightgray'],
@@ -31,7 +31,7 @@ export const useStyles = createThemedStyles('TextArea', {
31
31
  fontFamily: 'inherit',
32
32
  fontSize: 16,
33
33
  padding: [14, PADDING_X, 8],
34
- transition: '0.25s ease-in-out',
34
+ transition: animations.defaultTransition,
35
35
  transitionProperty: 'background-color',
36
36
  border: 'none',
37
37
  resize: 'none',
@@ -95,7 +95,7 @@ export const useStyles = createThemedStyles('TextArea', {
95
95
  top: PADDING_X * 2,
96
96
  transformOrigin: 'top left',
97
97
  transform: 'translateY(-50%)',
98
- transition: '0.25s ease-in-out',
98
+ transition: animations.defaultTransition,
99
99
  transitionProperty: 'transform, color',
100
100
  fontSize: 16,
101
101
  },
@@ -1,4 +1,4 @@
1
- import { createThemedStyles, ITweakStyles } from '../../theme';
1
+ import { animations, createThemedStyles, ITweakStyles } from '../../theme';
2
2
  import { IThemedPreloaderStyles } from '../ThemedPreloader';
3
3
 
4
4
  export const useStyles = createThemedStyles('TextButton', {
@@ -12,7 +12,8 @@ export const useStyles = createThemedStyles('TextButton', {
12
12
  borderRadius: 0,
13
13
  cursor: 'pointer',
14
14
  outline: 'none',
15
- transition: 'color 0.25s ease-in-out',
15
+ transition: animations.defaultTransition,
16
+ transitionProperty: 'color',
16
17
 
17
18
  '&[disabled]': {
18
19
  cursor: 'default',
@@ -65,7 +66,7 @@ export const useStyles = createThemedStyles('TextButton', {
65
66
  width: 24,
66
67
  height: 24,
67
68
  borderRadius: '50%',
68
- transition: '0.25s ease-in-out',
69
+ transition: animations.defaultTransition,
69
70
  transitionProperty: ['background', 'color'],
70
71
  },
71
72
 
@@ -118,6 +118,7 @@ const SLIDE_UP_POSITION_START = 15;
118
118
  const SLIDE_UP_POSITION_END = 0;
119
119
 
120
120
  export const animations = {
121
+ defaultTransition: '0.25s ease-in-out',
121
122
  // Если понадобится, сюда можно пробросить параметры через useTheme props
122
123
  slideUp: {
123
124
  'slide-up-enter': {
@@ -150,6 +151,7 @@ export interface ICommonUiKitTheme extends IUiKitTheme {
150
151
  colors: typeof colors;
151
152
  dimensions: typeof dimensions;
152
153
  helpers: typeof helpers;
154
+ animations: typeof animations;
153
155
  }
154
156
 
155
157
  export const common: ICommonUiKitTheme = {