@true-engineering/true-react-common-ui-kit 3.9.2 → 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 (68) hide show
  1. package/README.md +18 -0
  2. package/dist/components/Button/constants.d.ts +1 -0
  3. package/dist/components/Button/types.d.ts +2 -2
  4. package/dist/components/CloseButton/CloseButton.d.ts +1 -0
  5. package/dist/components/CloseButton/CloseButton.stories.d.ts +5 -0
  6. package/dist/components/IconButton/IconButton.d.ts +19 -0
  7. package/dist/components/IconButton/IconButton.stories.d.ts +6 -0
  8. package/dist/components/IconButton/IconButton.styles.d.ts +3 -0
  9. package/dist/components/IconButton/constants.d.ts +2 -0
  10. package/dist/components/IconButton/index.d.ts +3 -0
  11. package/dist/components/IconButton/types.d.ts +5 -0
  12. package/dist/components/Modal/Modal.styles.d.ts +3 -2
  13. package/dist/components/TextButton/TextButton.d.ts +6 -5
  14. package/dist/components/TextButton/TextButton.stories.d.ts +2 -1
  15. package/dist/components/TextButton/constants.d.ts +2 -0
  16. package/dist/components/TextButton/index.d.ts +1 -1
  17. package/dist/components/TextButton/types.d.ts +5 -0
  18. package/dist/components/Toaster/Toaster.styles.d.ts +2 -2
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/theme/common.d.ts +2 -0
  21. package/dist/theme/types.d.ts +2 -1
  22. package/dist/true-react-common-ui-kit.js +711 -493
  23. package/dist/true-react-common-ui-kit.js.map +1 -1
  24. package/dist/true-react-common-ui-kit.umd.cjs +711 -493
  25. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  26. package/package.json +1 -1
  27. package/src/components/AccountInfo/AccountInfo.styles.ts +3 -2
  28. package/src/components/Button/Button.stories.tsx +3 -5
  29. package/src/components/Button/Button.styles.ts +2 -2
  30. package/src/components/Button/constants.ts +2 -0
  31. package/src/components/Button/types.ts +2 -2
  32. package/src/components/CloseButton/CloseButton.stories.tsx +11 -0
  33. package/src/components/CloseButton/CloseButton.styles.ts +3 -2
  34. package/src/components/CloseButton/CloseButton.tsx +1 -0
  35. package/src/components/FiltersPane/FiltersPane.styles.ts +3 -2
  36. package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +3 -2
  37. package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +2 -2
  38. package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +8 -2
  39. package/src/components/FlexibleTable/FlexibleTable.styles.ts +3 -2
  40. package/src/components/IconButton/IconButton.stories.tsx +32 -0
  41. package/src/components/IconButton/IconButton.styles.ts +88 -0
  42. package/src/components/IconButton/IconButton.tsx +74 -0
  43. package/src/components/IconButton/constants.ts +3 -0
  44. package/src/components/IconButton/index.ts +3 -0
  45. package/src/components/IconButton/types.ts +11 -0
  46. package/src/components/IncrementInput/IncrementInput.styles.ts +3 -2
  47. package/src/components/Input/Input.styles.ts +6 -5
  48. package/src/components/List/List.styles.ts +3 -2
  49. package/src/components/List/components/ListItem/ListItem.styles.ts +3 -2
  50. package/src/components/Modal/Modal.styles.ts +17 -2
  51. package/src/components/Modal/Modal.tsx +7 -4
  52. package/src/components/MoreMenu/MoreMenu.styles.ts +3 -2
  53. package/src/components/NewMoreMenu/NewMoreMenu.styles.ts +3 -2
  54. package/src/components/Select/CustomSelect.stories.tsx +1 -1
  55. package/src/components/Selector/Selector.styles.ts +4 -3
  56. package/src/components/Switch/Switch.styles.ts +4 -4
  57. package/src/components/TextArea/TextArea.styles.ts +4 -4
  58. package/src/components/TextButton/TextButton.stories.tsx +3 -2
  59. package/src/components/TextButton/TextButton.styles.ts +4 -3
  60. package/src/components/TextButton/TextButton.tsx +72 -65
  61. package/src/components/TextButton/constants.ts +3 -0
  62. package/src/components/TextButton/index.ts +1 -2
  63. package/src/components/TextButton/types.ts +11 -0
  64. package/src/components/Toaster/Toaster.styles.ts +2 -2
  65. package/src/components/Toaster/Toaster.tsx +5 -4
  66. package/src/components/index.ts +1 -0
  67. package/src/theme/common.ts +2 -0
  68. package/src/theme/types.ts +8 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "3.9.2",
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
 
@@ -2,9 +2,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
2
  import { IIconType, iconsList } from '../Icon';
3
3
  import { complexIcons } from '../Icon/complexIcons';
4
4
  import { Button, IButtonProps } from './Button';
5
- import { BUTTON_VIEWS } from './constants';
6
-
7
- const sizeTypes: Array<IButtonProps['size']> = ['s', 'm', 'l', 'xl'];
5
+ import { BUTTON_SIZES, BUTTON_VIEWS } from './constants';
8
6
 
9
7
  const iconTypes = [
10
8
  undefined,
@@ -31,9 +29,9 @@ export default {
31
29
  isFullWidth: false,
32
30
  },
33
31
  argTypes: {
34
- view: { options: BUTTON_VIEWS, control: 'inline-radio' },
35
32
  icon: { options: iconTypes, control: 'select' },
36
- size: { options: sizeTypes, control: 'inline-radio' },
33
+ size: { options: BUTTON_SIZES, control: 'inline-radio' },
34
+ view: { options: BUTTON_VIEWS, control: 'inline-radio' },
37
35
  iconPosition: { options: ['left', 'right'], control: 'inline-radio' },
38
36
  preloaderType: { options: preloaderTypes, control: 'inline-radio' },
39
37
  },
@@ -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,3 +1,5 @@
1
+ export const BUTTON_SIZES = ['s', 'm', 'l', 'xl'] as const;
2
+
1
3
  export const BUTTON_VIEWS = [
2
4
  'primary',
3
5
  'secondary',
@@ -1,5 +1,5 @@
1
- import { BUTTON_VIEWS } from './constants';
1
+ import { BUTTON_SIZES, BUTTON_VIEWS } from './constants';
2
2
 
3
- export type IButtonSize = 's' | 'm' | 'l' | 'xl';
3
+ export type IButtonSize = (typeof BUTTON_SIZES)[number];
4
4
 
5
5
  export type IButtonView = (typeof BUTTON_VIEWS)[number];
@@ -0,0 +1,11 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import { CloseButton } from './CloseButton';
3
+
4
+ export default {
5
+ title: 'Buttons/CloseButton',
6
+ component: CloseButton,
7
+ args: {},
8
+ argTypes: {},
9
+ } as ComponentMeta<typeof CloseButton>;
10
+
11
+ export const Default: ComponentStory<typeof CloseButton> = (args) => <CloseButton {...args} />;
@@ -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),
@@ -11,6 +11,7 @@ export interface ICloseButtonProps extends ICommonProps<ICloseButtonStyles> {
11
11
  onClose?: () => void;
12
12
  }
13
13
 
14
+ /** @deprecated */
14
15
  export const CloseButton: FC<ICloseButtonProps> = ({
15
16
  tweakStyles,
16
17
  testId,
@@ -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)',
@@ -0,0 +1,32 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import { IIconType, iconsList } from '../Icon';
3
+ import { complexIcons } from '../Icon/complexIcons';
4
+ import { IconButton } from './IconButton';
5
+ import { ICON_BUTTON_SIZES, ICON_BUTTON_VIEWS } from './constants';
6
+
7
+ const iconTypes = [...Object.keys(iconsList), ...Object.keys(complexIcons)] as IIconType[];
8
+
9
+ export default {
10
+ title: 'Buttons/IconButton',
11
+ component: IconButton,
12
+ args: {
13
+ icon: iconTypes[0],
14
+ view: 'main',
15
+ size: 'm',
16
+ isDisabled: false,
17
+ isLoading: false,
18
+ isActive: false,
19
+ },
20
+ argTypes: {
21
+ icon: { options: iconTypes, control: 'select' },
22
+ size: { options: ICON_BUTTON_SIZES, control: 'inline-radio' },
23
+ view: { options: ICON_BUTTON_VIEWS, control: 'inline-radio' },
24
+ },
25
+ parameters: {
26
+ controls: {
27
+ exclude: ['tweakStyles', 'testId', 'data'],
28
+ },
29
+ },
30
+ } as ComponentMeta<typeof IconButton>;
31
+
32
+ export const Default: ComponentStory<typeof IconButton> = (args) => <IconButton {...args} />;
@@ -0,0 +1,88 @@
1
+ import { ITweakStyles, animations, createThemedStyles } from '../../theme';
2
+
3
+ const BUTTON_SIZE_S = 24;
4
+ const BUTTON_SIZE_M = 32;
5
+ const ICON_SIZE = 20;
6
+
7
+ export const useStyles = createThemedStyles('IconButton', {
8
+ root: {
9
+ display: 'flex',
10
+ justifyContent: 'center',
11
+ alignItems: 'center',
12
+ cursor: 'pointer',
13
+ outline: 'none',
14
+ boxSizing: 'border-box',
15
+ transition: animations.defaultTransition,
16
+ transitionProperty: 'background-color, color, border-color',
17
+ border: 'none',
18
+ position: 'relative',
19
+ boxShadow: 'none',
20
+ borderRadius: '50%',
21
+ background: 'none',
22
+ padding: 0,
23
+ flexShrink: 0,
24
+
25
+ '&:disabled': {
26
+ extend: 'disabled',
27
+ },
28
+
29
+ '&:active': {
30
+ extend: 'active',
31
+ },
32
+ },
33
+
34
+ 'cancel-light': {},
35
+
36
+ cancel: {},
37
+
38
+ main: {},
39
+
40
+ custom: {},
41
+
42
+ active: {},
43
+
44
+ disabled: {
45
+ cursor: 'not-allowed',
46
+ pointerEvents: 'none',
47
+ },
48
+
49
+ loading: {
50
+ '& $content': {
51
+ visibility: 'hidden',
52
+ },
53
+
54
+ '& $loader': {
55
+ display: 'block',
56
+ },
57
+ },
58
+
59
+ icon: {
60
+ display: 'flex',
61
+ alignItems: 'center',
62
+ width: ICON_SIZE,
63
+ height: ICON_SIZE,
64
+ },
65
+
66
+ loader: {
67
+ display: 'none',
68
+ position: 'absolute',
69
+ left: '50%',
70
+ top: '50%',
71
+ transform: 'translate(-50%, -50%)',
72
+
73
+ width: ICON_SIZE,
74
+ height: ICON_SIZE,
75
+ },
76
+
77
+ s: {
78
+ width: BUTTON_SIZE_S,
79
+ height: BUTTON_SIZE_S,
80
+ },
81
+
82
+ m: {
83
+ width: BUTTON_SIZE_M,
84
+ height: BUTTON_SIZE_M,
85
+ },
86
+ });
87
+
88
+ export type IIconButtonStyles = ITweakStyles<typeof useStyles>;
@@ -0,0 +1,74 @@
1
+ import { forwardRef } from 'react';
2
+ import clsx from 'clsx';
3
+ import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
4
+ import { addDataAttributes } from '../../helpers';
5
+ import { ICommonProps } from '../../types';
6
+ import { renderIcon, IIcon } from '../Icon';
7
+ import { ThemedPreloader } from '../ThemedPreloader';
8
+ import { IIconButtonSize, IIconButtonView, IIconButtonHTMLBaseProps } from './types';
9
+ import { useStyles, IIconButtonStyles } from './IconButton.styles';
10
+
11
+ export interface IIconButtonProps
12
+ extends IIconButtonHTMLBaseProps,
13
+ ICommonProps<IIconButtonStyles> {
14
+ icon: IIcon;
15
+ /** @default 'm' */
16
+ size?: IIconButtonSize;
17
+ /** @default 'cancel-light' */
18
+ view?: IIconButtonView;
19
+ /** @default false */
20
+ isDisabled?: boolean;
21
+ /** @default false */
22
+ isActive?: boolean;
23
+ /** @default false */
24
+ isLoading?: boolean;
25
+ }
26
+
27
+ export const IconButton = forwardRef<HTMLButtonElement, IIconButtonProps>(
28
+ (
29
+ {
30
+ icon,
31
+ size = 'm',
32
+ view = 'cancel-light',
33
+ isDisabled = false,
34
+ isActive = false,
35
+ isLoading = false,
36
+ type = 'button',
37
+ testId,
38
+ tweakStyles,
39
+ data,
40
+ onClick,
41
+ ...restProps
42
+ },
43
+ ref,
44
+ ) => {
45
+ const classes = useStyles({ theme: tweakStyles });
46
+
47
+ const hasNoAction = isDisabled || isLoading;
48
+
49
+ return (
50
+ <button
51
+ ref={ref}
52
+ className={clsx(classes.root, classes[view], classes[size], {
53
+ [classes.disabled]: isDisabled,
54
+ [classes.active]: isActive,
55
+ [classes.loading]: isLoading,
56
+ })}
57
+ type={type}
58
+ disabled={isDisabled}
59
+ onClick={hasNoAction ? undefined : onClick}
60
+ {...restProps}
61
+ {...addDataTestId(testId)}
62
+ {...addDataAttributes(data)}
63
+ >
64
+ {isLoading ? (
65
+ <span className={classes.loader}>
66
+ <ThemedPreloader type="default" useCurrentColor />
67
+ </span>
68
+ ) : (
69
+ <span className={classes.icon}>{renderIcon(icon)}</span>
70
+ )}
71
+ </button>
72
+ );
73
+ },
74
+ );
@@ -0,0 +1,3 @@
1
+ export const ICON_BUTTON_SIZES = ['s', 'm'] as const;
2
+
3
+ export const ICON_BUTTON_VIEWS = ['cancel', 'cancel-light', 'main', 'custom'] as const;
@@ -0,0 +1,3 @@
1
+ export * from './IconButton';
2
+ export * from './types';
3
+ export type { IIconButtonStyles } from './IconButton.styles';
@@ -0,0 +1,11 @@
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ import { ICON_BUTTON_SIZES, ICON_BUTTON_VIEWS } from './constants';
3
+
4
+ export type IIconButtonSize = (typeof ICON_BUTTON_SIZES)[number];
5
+
6
+ export type IIconButtonView = (typeof ICON_BUTTON_VIEWS)[number];
7
+
8
+ export type IIconButtonHTMLBaseProps = Omit<
9
+ ButtonHTMLAttributes<HTMLButtonElement>,
10
+ 'disabled' | 'style' | 'className'
11
+ >;
@@ -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,6 +1,6 @@
1
1
  import { rgba } from '../../helpers';
2
2
  import { colors, dimensions, ITweakStyles, createThemedStyles } from '../../theme';
3
- import { ICloseButtonStyles } from '../CloseButton';
3
+ import { IIconButtonStyles } from '../IconButton';
4
4
 
5
5
  const VERTICAL_OVERLAY_PADDING = 50;
6
6
 
@@ -8,6 +8,9 @@ const MODAL_HORIZONTAL_PADDING_L = 40;
8
8
  const MODAL_HORIZONTAL_PADDING_M = 36;
9
9
  const MODAL_HORIZONTAL_PADDING_S = 26;
10
10
 
11
+ const MODAL_CLOSE_BUTTON_SIZE = 40;
12
+ const MODAL_CLOSE_BUTTON_ICON_SIZE = 30;
13
+
11
14
  export const useStyles = createThemedStyles('Modal', {
12
15
  root: {},
13
16
 
@@ -300,4 +303,16 @@ export const useStyles = createThemedStyles('Modal', {
300
303
  'modal-exit-active': { extend: 'animationEnd' },
301
304
  });
302
305
 
303
- export type IModalStyles = ITweakStyles<typeof useStyles, { tweakCloseButton: ICloseButtonStyles }>;
306
+ export const closeButtonStyles: IIconButtonStyles = {
307
+ m: {
308
+ width: MODAL_CLOSE_BUTTON_SIZE,
309
+ height: MODAL_CLOSE_BUTTON_SIZE,
310
+ },
311
+
312
+ icon: {
313
+ width: MODAL_CLOSE_BUTTON_ICON_SIZE,
314
+ height: MODAL_CLOSE_BUTTON_ICON_SIZE,
315
+ },
316
+ };
317
+
318
+ export type IModalStyles = ITweakStyles<typeof useStyles, { tweakCloseButton: IIconButtonStyles }>;
@@ -10,9 +10,9 @@ import {
10
10
  import { addDataAttributes } from '../../helpers';
11
11
  import { useTweakStyles } from '../../hooks';
12
12
  import { ICommonProps } from '../../types';
13
- import { CloseButton } from '../CloseButton';
13
+ import { IconButton } from '../IconButton';
14
14
  import { IModalPosition, IModalTransitionProps } from './types';
15
- import { useStyles, IModalStyles } from './Modal.styles';
15
+ import { useStyles, IModalStyles, closeButtonStyles } from './Modal.styles';
16
16
 
17
17
  export interface IModalProps extends ICommonProps<IModalStyles>, IModalTransitionProps {
18
18
  title?: ReactNode;
@@ -68,6 +68,7 @@ export const Modal: FC<IModalProps> = ({
68
68
  const classes = useStyles({ theme: tweakStyles });
69
69
 
70
70
  const tweakCloseButtonStyles = useTweakStyles({
71
+ innerStyles: closeButtonStyles,
71
72
  tweakStyles,
72
73
  className: 'tweakCloseButton',
73
74
  currentComponentName: 'Modal',
@@ -154,10 +155,12 @@ export const Modal: FC<IModalProps> = ({
154
155
  >
155
156
  {hasCloseButton && (
156
157
  <div className={classes.close}>
157
- <CloseButton
158
+ <IconButton
158
159
  testId={getTestId(testId, 'close-button')}
159
160
  tweakStyles={tweakCloseButtonStyles}
160
- onClose={onClose}
161
+ view="cancel-light"
162
+ icon="close"
163
+ onClick={onClose}
161
164
  />
162
165
  </div>
163
166
  )}
@@ -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: {
@@ -180,7 +180,7 @@ function SelectWithCustomProps({
180
180
  }
181
181
 
182
182
  export default {
183
- title: 'Select',
183
+ title: 'Controls/Select',
184
184
  component: SelectWithCustomProps,
185
185
  argTypes: {
186
186
  scrollParent: {