@true-engineering/true-react-common-ui-kit 3.10.0 → 3.12.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.
- package/README.md +16 -0
- package/dist/components/Checkbox/Checkbox.d.ts +8 -7
- package/dist/components/Checkbox/Checkbox.stories.d.ts +8 -5
- package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/theme/common.d.ts +2 -0
- package/dist/true-react-common-ui-kit.js +102 -161
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +102 -161
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/AccountInfo/AccountInfo.styles.ts +3 -2
- package/src/components/Button/Button.styles.ts +2 -2
- package/src/components/Checkbox/Checkbox.stories.tsx +40 -14
- package/src/components/Checkbox/Checkbox.styles.ts +4 -2
- package/src/components/Checkbox/Checkbox.tsx +21 -25
- package/src/components/CloseButton/CloseButton.styles.ts +3 -2
- package/src/components/FiltersPane/FiltersPane.styles.ts +3 -2
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +3 -2
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +2 -2
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +8 -2
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +3 -2
- package/src/components/Icon/icons-list.ts +5 -13
- package/src/components/IconButton/IconButton.styles.ts +2 -2
- package/src/components/IncrementInput/IncrementInput.styles.ts +3 -2
- package/src/components/Input/Input.styles.ts +6 -5
- package/src/components/List/List.styles.ts +3 -2
- package/src/components/List/components/ListItem/ListItem.styles.ts +3 -2
- package/src/components/MoreMenu/MoreMenu.styles.ts +3 -2
- package/src/components/MultiSelectList/MultiSelectList.tsx +9 -6
- package/src/components/NewMoreMenu/NewMoreMenu.styles.ts +3 -2
- package/src/components/Selector/Selector.styles.ts +4 -3
- package/src/components/Switch/Switch.styles.ts +4 -4
- package/src/components/TextArea/TextArea.styles.ts +4 -4
- package/src/components/TextButton/TextButton.styles.ts +4 -3
- package/src/theme/common.ts +2 -0
package/package.json
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
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,28 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useState, FC } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { Checkbox as CheckboxComponent, ICheckboxProps } from './Checkbox';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const CheckboxComponentWithData: FC<ICheckboxProps<string>> = (props) => {
|
|
6
|
+
const [isChecked, setIsChecked] = useState(false);
|
|
7
|
+
const [isSemiChecked, setIsSemiChecked] = useState(false);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div style={{ gap: 10, display: 'grid' }}>
|
|
11
|
+
<CheckboxComponent
|
|
12
|
+
isChecked={isChecked}
|
|
13
|
+
isSemiChecked={isSemiChecked}
|
|
14
|
+
onSelect={({ isSelected }) => {
|
|
15
|
+
setIsChecked(isSelected);
|
|
16
|
+
setIsSemiChecked(false);
|
|
17
|
+
}}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
Use wrapping paper
|
|
21
|
+
</CheckboxComponent>
|
|
22
|
+
<CheckboxComponent
|
|
23
|
+
value={undefined}
|
|
24
|
+
isChecked={isSemiChecked}
|
|
25
|
+
onSelect={({ isSelected }) => setIsSemiChecked(isSelected)}
|
|
26
|
+
>
|
|
27
|
+
Is Semi Checked
|
|
28
|
+
</CheckboxComponent>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const meta: Meta<typeof CheckboxComponentWithData> = {
|
|
5
34
|
title: 'Controls/Checkbox',
|
|
6
|
-
component:
|
|
35
|
+
component: CheckboxComponentWithData,
|
|
7
36
|
args: {
|
|
8
37
|
value: 'value',
|
|
9
38
|
labelPosition: 'right',
|
|
10
|
-
isReadonly: false,
|
|
11
39
|
isInvalid: false,
|
|
12
40
|
isDisabled: false,
|
|
13
|
-
|
|
41
|
+
isReadonly: false,
|
|
14
42
|
},
|
|
15
43
|
parameters: {
|
|
16
44
|
controls: {
|
|
17
45
|
exclude: ['data', 'tweakStyles', 'testId', 'onSelect'],
|
|
18
46
|
},
|
|
19
47
|
},
|
|
20
|
-
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default meta;
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<typeof CheckboxComponent>;
|
|
21
53
|
|
|
22
|
-
export const Default:
|
|
23
|
-
<div style={{ width: 200 }}>
|
|
24
|
-
<Checkbox {...args} onSelect={(value) => console.log('Value was selected', value)}>
|
|
25
|
-
<div>Some text</div>
|
|
26
|
-
</Checkbox>
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
54
|
+
export const Default: Story = {};
|
|
@@ -9,6 +9,10 @@ export const useStyles = createThemedStyles('Checkbox', {
|
|
|
9
9
|
width: 'fit-content',
|
|
10
10
|
},
|
|
11
11
|
|
|
12
|
+
checked: {},
|
|
13
|
+
|
|
14
|
+
invalid: {},
|
|
15
|
+
|
|
12
16
|
disabled: {
|
|
13
17
|
cursor: 'default',
|
|
14
18
|
pointerEvents: 'none',
|
|
@@ -37,8 +41,6 @@ export const useStyles = createThemedStyles('Checkbox', {
|
|
|
37
41
|
boxSizing: 'border-box',
|
|
38
42
|
},
|
|
39
43
|
|
|
40
|
-
checked: {},
|
|
41
|
-
|
|
42
44
|
labelPositionLeft: {
|
|
43
45
|
flexDirection: 'row-reverse',
|
|
44
46
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, ChangeEvent, KeyboardEvent } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import {
|
|
4
4
|
addDataTestId,
|
|
@@ -11,57 +11,53 @@ import { Icon } from '../Icon';
|
|
|
11
11
|
import { useStyles, ICheckboxStyles } from './Checkbox.styles';
|
|
12
12
|
|
|
13
13
|
export interface ICheckboxProps<V> extends ICommonProps<ICheckboxStyles> {
|
|
14
|
+
value?: V;
|
|
14
15
|
children?: ReactNode;
|
|
15
|
-
|
|
16
|
+
/** @default false */
|
|
17
|
+
isChecked?: boolean;
|
|
16
18
|
/** @default false */
|
|
17
19
|
isSemiChecked?: boolean;
|
|
18
20
|
/** @default false */
|
|
21
|
+
isInvalid?: boolean;
|
|
22
|
+
/** @default false */
|
|
19
23
|
isDisabled?: boolean;
|
|
20
24
|
/** @default false */
|
|
21
25
|
isReadonly?: boolean;
|
|
22
|
-
/** @default false */
|
|
23
|
-
isInvalid?: boolean;
|
|
24
|
-
value: V;
|
|
25
26
|
/** @default 'right' */
|
|
26
27
|
labelPosition?: 'right' | 'left';
|
|
27
|
-
onSelect
|
|
28
|
-
value: { value
|
|
28
|
+
onSelect?: (
|
|
29
|
+
value: { value?: V; isSelected: boolean },
|
|
29
30
|
event: ChangeEvent<HTMLInputElement> | KeyboardEvent,
|
|
30
31
|
) => void;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export function Checkbox<V>({
|
|
35
|
+
value,
|
|
34
36
|
children,
|
|
37
|
+
isChecked = false,
|
|
38
|
+
isSemiChecked = false,
|
|
39
|
+
isInvalid = false,
|
|
35
40
|
isDisabled = false,
|
|
36
41
|
isReadonly = false,
|
|
37
|
-
|
|
38
|
-
value,
|
|
42
|
+
labelPosition = 'right',
|
|
39
43
|
data,
|
|
40
44
|
testId,
|
|
41
|
-
isSemiChecked = false,
|
|
42
|
-
labelPosition = 'right',
|
|
43
45
|
tweakStyles,
|
|
44
46
|
onSelect,
|
|
45
47
|
}: ICheckboxProps<V>): JSX.Element {
|
|
46
48
|
const classes = useStyles({ theme: tweakStyles });
|
|
47
49
|
|
|
48
|
-
const [isSelected, setIsSelected] = useState(false);
|
|
49
|
-
|
|
50
50
|
const hasAction = !isDisabled && !isReadonly;
|
|
51
|
+
const isSelected = isChecked || isSemiChecked;
|
|
51
52
|
|
|
52
|
-
const onToggle = (event: ChangeEvent<HTMLInputElement> | KeyboardEvent) =>
|
|
53
|
-
|
|
54
|
-
onSelect({ value, isSelected: isSelectedNext }, event);
|
|
55
|
-
setIsSelected(isSelectedNext);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
setIsSelected(isChecked);
|
|
60
|
-
}, [isChecked]);
|
|
53
|
+
const onToggle = (event: ChangeEvent<HTMLInputElement> | KeyboardEvent) =>
|
|
54
|
+
onSelect?.({ value, isSelected: !isSelected }, event);
|
|
61
55
|
|
|
62
56
|
return (
|
|
63
57
|
<label
|
|
64
58
|
className={clsx(classes.root, {
|
|
59
|
+
[classes.checked]: isSelected,
|
|
60
|
+
[classes.invalid]: isInvalid,
|
|
65
61
|
[classes.disabled]: isDisabled,
|
|
66
62
|
[classes.labelPositionLeft]: labelPosition === 'left',
|
|
67
63
|
})}
|
|
@@ -69,8 +65,8 @@ export function Checkbox<V>({
|
|
|
69
65
|
{...addDataAttributes(data)}
|
|
70
66
|
>
|
|
71
67
|
<input
|
|
72
|
-
type="checkbox"
|
|
73
68
|
className={classes.input}
|
|
69
|
+
type="checkbox"
|
|
74
70
|
checked={isSelected}
|
|
75
71
|
disabled={isDisabled}
|
|
76
72
|
readOnly={isReadonly}
|
|
@@ -79,8 +75,8 @@ export function Checkbox<V>({
|
|
|
79
75
|
onKeyDown: getSelectKeyHandler(onToggle),
|
|
80
76
|
})}
|
|
81
77
|
/>
|
|
82
|
-
<div className={
|
|
83
|
-
<Icon type={isSemiChecked ? 'minus' : 'check'} />
|
|
78
|
+
<div className={classes.check}>
|
|
79
|
+
{isSelected && <Icon type={isSemiChecked ? 'minus' : 'check'} />}
|
|
84
80
|
</div>
|
|
85
81
|
{isReactNodeNotEmpty(children) && <div className={classes.children}>{children}</div>}
|
|
86
82
|
</label>
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 {
|
|
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:
|
|
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:
|
|
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)',
|
|
@@ -123,10 +123,11 @@ export const iconsList = checkIcons({
|
|
|
123
123
|
check: {
|
|
124
124
|
paths: [
|
|
125
125
|
{
|
|
126
|
-
d: '
|
|
126
|
+
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',
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
129
|
},
|
|
130
|
+
/** @deprecated */
|
|
130
131
|
'check-big': {
|
|
131
132
|
paths: [
|
|
132
133
|
{
|
|
@@ -138,17 +139,8 @@ export const iconsList = checkIcons({
|
|
|
138
139
|
viewBox: '0 0 20 20',
|
|
139
140
|
paths: [
|
|
140
141
|
{
|
|
141
|
-
d: '
|
|
142
|
-
|
|
143
|
-
strokeLinecap: 'round' as const,
|
|
144
|
-
stroke: 'currentColor',
|
|
145
|
-
fill: 'none',
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
d: 'M10.2071 13.2929L9.5 12.5858L8.08579 14L8.79289 14.7071L10.2071 13.2929ZM18.2071 7.70711C18.5976 7.31658 18.5976 6.68342 18.2071 6.29289C17.8166 5.90237 17.1834 5.90237 16.7929 6.29289L18.2071 7.70711ZM9.92929 14.4293L10.6364 13.7222L9.92929 14.4293ZM10.0707 14.4293L9.3636 13.7222L10.0707 14.4293ZM8.79289 14.7071L9.22218 15.1364L10.6364 13.7222L10.2071 13.2929L8.79289 14.7071ZM10.7778 15.1364L18.2071 7.70711L16.7929 6.29289L9.3636 13.7222L10.7778 15.1364ZM9.22218 15.1364C9.65176 15.566 10.3482 15.566 10.7778 15.1364L9.3636 13.7222C9.71508 13.3707 10.2849 13.3707 10.6364 13.7222L9.22218 15.1364Z',
|
|
149
|
-
fill: 'currentColor',
|
|
150
|
-
stroke: 'none',
|
|
151
|
-
fillRule: undefined,
|
|
142
|
+
d: 'M14.207 6.707a1 1 0 0 0-1.414-1.414L6 12.086 3.707 9.793a1 1 0 0 0-1.414 1.414l2.93 2.93a1.1 1.1 0 0 0 1.555 0l7.43-7.43Zm4 1a1 1 0 0 0-1.414-1.414L10 13.086l-.5-.5L8.086 14l1.136 1.136a1.1 1.1 0 0 0 1.556 0l7.43-7.429Z',
|
|
143
|
+
fillRule: 'evenodd',
|
|
152
144
|
},
|
|
153
145
|
],
|
|
154
146
|
},
|
|
@@ -466,7 +458,7 @@ export const iconsList = checkIcons({
|
|
|
466
458
|
minus: {
|
|
467
459
|
paths: [
|
|
468
460
|
{
|
|
469
|
-
d: 'M16
|
|
461
|
+
d: 'M16 11H4a1 1 0 1 1 0-2h12a1 1 0 1 1 0 2Z',
|
|
470
462
|
},
|
|
471
463
|
],
|
|
472
464
|
},
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
24
|
+
transition: animations.defaultTransition,
|
|
25
|
+
transitionProperty: 'background-color',
|
|
25
26
|
|
|
26
27
|
'&$hasCircle': {
|
|
27
28
|
backgroundColor: rgba(colors.GREY_HOVER, 0.5),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState, useMemo, useRef, useCallback, ReactNode } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { debounce } from 'ts-debounce';
|
|
4
|
+
import { isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
4
5
|
import { addDataAttributes } from '../../helpers';
|
|
5
6
|
import { useIsMounted, useTweakStyles } from '../../hooks';
|
|
6
7
|
import { ICommonProps } from '../../types';
|
|
@@ -167,12 +168,14 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
167
168
|
onChange(undefined);
|
|
168
169
|
};
|
|
169
170
|
|
|
170
|
-
const onSelect: ICheckboxProps<Option>['onSelect'] = (
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
const onSelect: ICheckboxProps<Option>['onSelect'] = ({ value: checkboxValue, isSelected }) => {
|
|
172
|
+
if (isNotEmpty(checkboxValue)) {
|
|
173
|
+
handleSelectValue(
|
|
174
|
+
isSelected
|
|
175
|
+
? [...(chosenValues ?? []), checkboxValue]
|
|
176
|
+
: chosenValues?.filter((v) => getValueId(v) !== getValueId(checkboxValue)) ?? [],
|
|
177
|
+
);
|
|
178
|
+
}
|
|
176
179
|
};
|
|
177
180
|
|
|
178
181
|
const handleKeyDown = (event: KeyboardEvent) => {
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
98
|
+
transition: animations.defaultTransition,
|
|
99
99
|
transitionProperty: 'transform, color',
|
|
100
100
|
fontSize: 16,
|
|
101
101
|
},
|