@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.
- package/LICENSE +201 -201
- package/dist/components/Flag/augment.d.ts +1 -1
- package/dist/components/Icon/complexIcons/augment.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/true-react-common-ui-kit.js +58 -58
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +58 -58
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/vite-env.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AccountInfo/AccountInfo.styles.ts +55 -55
- package/src/components/AccountInfo/index.ts +2 -2
- package/src/components/AddButton/AddButton.stories.tsx +21 -21
- package/src/components/AddButton/AddButton.styles.ts +34 -34
- package/src/components/AddButton/index.ts +2 -2
- package/src/components/Button/Button.styles.ts +196 -196
- package/src/components/Checkbox/Checkbox.styles.ts +62 -62
- package/src/components/Checkbox/index.ts +2 -2
- package/src/components/CloseButton/index.ts +2 -2
- package/src/components/Colors/Colors.stories.tsx +7 -7
- package/src/components/Colors/Colors.styles.ts +38 -38
- package/src/components/Colors/index.ts +2 -2
- package/src/components/CssBaseline/CssBaseline.styles.ts +15 -15
- package/src/components/CssBaseline/index.ts +2 -2
- package/src/components/DateInput/DateInput.styles.ts +14 -14
- package/src/components/DateInput/constants.ts +2 -2
- package/src/components/DateInput/index.ts +3 -3
- package/src/components/Description/Description.styles.ts +31 -31
- package/src/components/Description/index.ts +2 -2
- package/src/components/FiltersPane/FiltersPane.styles.ts +71 -71
- package/src/components/Flag/Flag.styles.ts +18 -18
- package/src/components/Flag/augment.d.ts +1 -1
- package/src/components/Flag/index.ts +2 -2
- package/src/components/FlexibleTable/index.ts +3 -3
- package/src/components/Icon/Icon.styles.ts +10 -10
- package/src/components/Icon/complexIcons/augment.d.ts +1 -1
- package/src/components/Icon/complexIcons/avatarGreen.svg +57 -57
- package/src/components/Icon/complexIcons/index.ts +1 -1
- package/src/components/IncrementInput/IncrementInput.styles.ts +77 -77
- package/src/components/IncrementInput/index.ts +2 -2
- package/src/components/Input/Input.styles.ts +307 -307
- package/src/components/Input/Input.tsx +3 -2
- package/src/components/List/List.styles.ts +52 -52
- package/src/components/MoreMenu/MoreMenu.stories.tsx +46 -46
- package/src/components/MoreMenu/index.ts +2 -2
- package/src/components/MultiSelect/MultiSelect.styles.ts +55 -55
- package/src/components/NumberInput/index.ts +1 -1
- package/src/components/PhoneInput/PhoneInput.styles.ts +84 -84
- package/src/components/PhoneInput/types.ts +16 -16
- package/src/components/RadioButton/RadioButton.styles.ts +37 -37
- package/src/components/RadioButton/index.ts +2 -2
- package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
- package/src/components/SearchInput/index.ts +2 -2
- package/src/components/Select/Select.styles.ts +96 -96
- package/src/components/Select/constants.ts +2 -2
- package/src/components/Select/types.ts +1 -1
- package/src/components/Switch/Switch.styles.ts +75 -75
- package/src/components/TextArea/TextArea.styles.ts +153 -153
- package/src/components/TextArea/index.ts +2 -2
- package/src/components/TextWithInfo/TextWithInfo.styles.ts +60 -60
- package/src/components/TextWithInfo/index.ts +2 -2
- package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
- package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +19 -19
- package/src/components/TextWithTooltip/index.ts +2 -2
- package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +21 -21
- package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +54 -54
- package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +2 -2
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +11 -11
- package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +2 -2
- package/src/components/Toaster/Toaster.styles.ts +59 -59
- package/src/components/Tooltip/types.ts +1 -1
- package/src/components/index.ts +36 -36
- package/src/helpers/popper-helpers.ts +17 -17
- package/src/hooks/index.ts +6 -6
- package/src/hooks/use-is-mounted.ts +15 -15
- package/src/index.ts +6 -6
- package/src/vite-env.d.ts +1 -1
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { ComponentStyles } from '../../types';
|
|
2
|
-
|
|
3
|
-
export const styles = {
|
|
4
|
-
root: {
|
|
5
|
-
width: '100%',
|
|
6
|
-
position: 'relative',
|
|
7
|
-
boxSizing: 'border-box',
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
inputWrapper: {
|
|
11
|
-
width: '100%',
|
|
12
|
-
cursor: 'text',
|
|
13
|
-
position: 'relative',
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
listWrapper: {
|
|
17
|
-
left: -1,
|
|
18
|
-
zIndex: 3,
|
|
19
|
-
width: 'fit-content',
|
|
20
|
-
minWidth: 'calc(100% + 1px)',
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
withoutPopper: {
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
top: 'calc(100% + 6px)',
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
listWrapperInBody: {
|
|
29
|
-
minWidth: 'auto',
|
|
30
|
-
width: 'auto',
|
|
31
|
-
maxWidth: 'min-content',
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
arrow: {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
right: 12,
|
|
37
|
-
top: 14,
|
|
38
|
-
width: 20,
|
|
39
|
-
height: 20,
|
|
40
|
-
cursor: 'pointer',
|
|
41
|
-
zIndex: 1,
|
|
42
|
-
transition: 'transform 0.1s ease',
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
activeArrow: {
|
|
46
|
-
transform: 'rotate(180deg)',
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
disabled: {
|
|
50
|
-
'& $arrow': {
|
|
51
|
-
cursor: 'default',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
counter: {
|
|
56
|
-
'&:not(:last-child)': {
|
|
57
|
-
paddingRight: 8,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
icon: {
|
|
62
|
-
width: 16,
|
|
63
|
-
height: 16,
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
tweakInput: {
|
|
67
|
-
input: {
|
|
68
|
-
paddingRight: 32,
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
disabled: {
|
|
72
|
-
'& $input': {
|
|
73
|
-
cursor: 'default',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
controls: {
|
|
78
|
-
paddingRight: 32,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
tweakSelectList: {},
|
|
83
|
-
|
|
84
|
-
tweakSearchInput: {
|
|
85
|
-
tweakInput: {
|
|
86
|
-
inputWrapper: {
|
|
87
|
-
height: 48,
|
|
88
|
-
borderRadius: 0,
|
|
89
|
-
border: 'none',
|
|
90
|
-
backgroundColor: 'transparent',
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export type SelectStyles = ComponentStyles<typeof styles>;
|
|
1
|
+
import { ComponentStyles } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const styles = {
|
|
4
|
+
root: {
|
|
5
|
+
width: '100%',
|
|
6
|
+
position: 'relative',
|
|
7
|
+
boxSizing: 'border-box',
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
inputWrapper: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
cursor: 'text',
|
|
13
|
+
position: 'relative',
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
listWrapper: {
|
|
17
|
+
left: -1,
|
|
18
|
+
zIndex: 3,
|
|
19
|
+
width: 'fit-content',
|
|
20
|
+
minWidth: 'calc(100% + 1px)',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
withoutPopper: {
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
top: 'calc(100% + 6px)',
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
listWrapperInBody: {
|
|
29
|
+
minWidth: 'auto',
|
|
30
|
+
width: 'auto',
|
|
31
|
+
maxWidth: 'min-content',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
arrow: {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
right: 12,
|
|
37
|
+
top: 14,
|
|
38
|
+
width: 20,
|
|
39
|
+
height: 20,
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
zIndex: 1,
|
|
42
|
+
transition: 'transform 0.1s ease',
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
activeArrow: {
|
|
46
|
+
transform: 'rotate(180deg)',
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
disabled: {
|
|
50
|
+
'& $arrow': {
|
|
51
|
+
cursor: 'default',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
counter: {
|
|
56
|
+
'&:not(:last-child)': {
|
|
57
|
+
paddingRight: 8,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
icon: {
|
|
62
|
+
width: 16,
|
|
63
|
+
height: 16,
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
tweakInput: {
|
|
67
|
+
input: {
|
|
68
|
+
paddingRight: 32,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
disabled: {
|
|
72
|
+
'& $input': {
|
|
73
|
+
cursor: 'default',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
controls: {
|
|
78
|
+
paddingRight: 32,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
tweakSelectList: {},
|
|
83
|
+
|
|
84
|
+
tweakSearchInput: {
|
|
85
|
+
tweakInput: {
|
|
86
|
+
inputWrapper: {
|
|
87
|
+
height: 48,
|
|
88
|
+
borderRadius: 0,
|
|
89
|
+
border: 'none',
|
|
90
|
+
backgroundColor: 'transparent',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type SelectStyles = ComponentStyles<typeof styles>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const DEFAULT_OPTION_INDEX = -2;
|
|
2
|
-
export const ALL_OPTION_INDEX = -1;
|
|
1
|
+
export const DEFAULT_OPTION_INDEX = -2;
|
|
2
|
+
export const ALL_OPTION_INDEX = -1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type IMultipleSelectValue<Value> = Array<NonNullable<Value>>;
|
|
1
|
+
export type IMultipleSelectValue<Value> = Array<NonNullable<Value>>;
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { ComponentStyles } from '../../types';
|
|
2
|
-
|
|
3
|
-
export const styles = {
|
|
4
|
-
root: {
|
|
5
|
-
display: 'flex',
|
|
6
|
-
alignItems: 'center',
|
|
7
|
-
cursor: 'pointer',
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
primary: {},
|
|
11
|
-
|
|
12
|
-
secondary: {},
|
|
13
|
-
|
|
14
|
-
invalid: {},
|
|
15
|
-
|
|
16
|
-
disabled: {
|
|
17
|
-
pointerEvents: 'none',
|
|
18
|
-
cursor: 'default',
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
checked: {
|
|
22
|
-
'& $switch::before': {
|
|
23
|
-
left: 18,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
switch: {
|
|
28
|
-
position: 'relative',
|
|
29
|
-
flexShrink: 0,
|
|
30
|
-
display: 'block',
|
|
31
|
-
width: 36,
|
|
32
|
-
height: 20,
|
|
33
|
-
backgroundColor: '#333',
|
|
34
|
-
borderRadius: 10,
|
|
35
|
-
boxSizing: 'border-box',
|
|
36
|
-
transitionProperty: 'opacity, background-color',
|
|
37
|
-
transition: '0.25s ease-in-out',
|
|
38
|
-
|
|
39
|
-
'&::before': {
|
|
40
|
-
content: '""',
|
|
41
|
-
position: 'absolute',
|
|
42
|
-
top: 2,
|
|
43
|
-
left: 2,
|
|
44
|
-
right: 'auto',
|
|
45
|
-
display: 'block',
|
|
46
|
-
width: 16,
|
|
47
|
-
height: 16,
|
|
48
|
-
backgroundColor: '#fff',
|
|
49
|
-
borderRadius: '50%',
|
|
50
|
-
zIndex: 1,
|
|
51
|
-
transitionProperty: 'left, background-color',
|
|
52
|
-
transition: '0.25s ease-in-out',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
input: {
|
|
57
|
-
display: 'none',
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
label: {
|
|
61
|
-
transitionProperty: 'opacity, color',
|
|
62
|
-
transition: '0.25s ease-in-out',
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
labelLeft: {
|
|
66
|
-
order: -1,
|
|
67
|
-
marginRight: 12,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
labelRight: {
|
|
71
|
-
marginLeft: 12,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export type SwitchStyles = ComponentStyles<typeof styles>;
|
|
1
|
+
import { ComponentStyles } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const styles = {
|
|
4
|
+
root: {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
cursor: 'pointer',
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
primary: {},
|
|
11
|
+
|
|
12
|
+
secondary: {},
|
|
13
|
+
|
|
14
|
+
invalid: {},
|
|
15
|
+
|
|
16
|
+
disabled: {
|
|
17
|
+
pointerEvents: 'none',
|
|
18
|
+
cursor: 'default',
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
checked: {
|
|
22
|
+
'& $switch::before': {
|
|
23
|
+
left: 18,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
switch: {
|
|
28
|
+
position: 'relative',
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
display: 'block',
|
|
31
|
+
width: 36,
|
|
32
|
+
height: 20,
|
|
33
|
+
backgroundColor: '#333',
|
|
34
|
+
borderRadius: 10,
|
|
35
|
+
boxSizing: 'border-box',
|
|
36
|
+
transitionProperty: 'opacity, background-color',
|
|
37
|
+
transition: '0.25s ease-in-out',
|
|
38
|
+
|
|
39
|
+
'&::before': {
|
|
40
|
+
content: '""',
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
top: 2,
|
|
43
|
+
left: 2,
|
|
44
|
+
right: 'auto',
|
|
45
|
+
display: 'block',
|
|
46
|
+
width: 16,
|
|
47
|
+
height: 16,
|
|
48
|
+
backgroundColor: '#fff',
|
|
49
|
+
borderRadius: '50%',
|
|
50
|
+
zIndex: 1,
|
|
51
|
+
transitionProperty: 'left, background-color',
|
|
52
|
+
transition: '0.25s ease-in-out',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
input: {
|
|
57
|
+
display: 'none',
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
label: {
|
|
61
|
+
transitionProperty: 'opacity, color',
|
|
62
|
+
transition: '0.25s ease-in-out',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
labelLeft: {
|
|
66
|
+
order: -1,
|
|
67
|
+
marginRight: 12,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
labelRight: {
|
|
71
|
+
marginLeft: 12,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type SwitchStyles = ComponentStyles<typeof styles>;
|
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
import { ComponentStyles } from '../../types';
|
|
2
|
-
|
|
3
|
-
const PADDING_X = 12;
|
|
4
|
-
|
|
5
|
-
export const styles = {
|
|
6
|
-
root: {
|
|
7
|
-
width: '100%',
|
|
8
|
-
height: '100%',
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
wrapper: {
|
|
14
|
-
display: 'flex',
|
|
15
|
-
position: 'relative',
|
|
16
|
-
width: '100%',
|
|
17
|
-
flexGrow: 1,
|
|
18
|
-
boxSizing: 'border-box',
|
|
19
|
-
transition: '0.25s ease-in-out',
|
|
20
|
-
transitionProperty: 'border-color',
|
|
21
|
-
backgroundColor: 'white',
|
|
22
|
-
border: ['solid', 1, 'lightgray'],
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
textarea: {
|
|
26
|
-
width: '100%',
|
|
27
|
-
height: '100%',
|
|
28
|
-
outline: 'none',
|
|
29
|
-
boxSizing: 'border-box',
|
|
30
|
-
outlineStyle: 'none',
|
|
31
|
-
fontFamily: 'inherit',
|
|
32
|
-
fontSize: 16,
|
|
33
|
-
padding: [14, PADDING_X, 8],
|
|
34
|
-
transition: '0.25s ease-in-out',
|
|
35
|
-
transitionProperty: 'background-color',
|
|
36
|
-
border: 'none',
|
|
37
|
-
resize: 'none',
|
|
38
|
-
overflow: 'auto',
|
|
39
|
-
|
|
40
|
-
'&::placeholder': {
|
|
41
|
-
opacity: 1,
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
MozAppearance: 'textfield',
|
|
45
|
-
'&::-webkit-inner-spin-button,&::-webkit-outer-spin-button': {
|
|
46
|
-
WebkitAppearance: 'none',
|
|
47
|
-
margin: 0,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
focused: {
|
|
52
|
-
position: 'relative',
|
|
53
|
-
zIndex: 1,
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
withFloatingLabel: {
|
|
57
|
-
paddingTop: 24,
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
floating: {},
|
|
61
|
-
|
|
62
|
-
activeLabel: {
|
|
63
|
-
display: 'none',
|
|
64
|
-
|
|
65
|
-
'&$floating': {
|
|
66
|
-
display: 'block',
|
|
67
|
-
transform: 'scale(0.75) translateY(-120%)',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
required: {
|
|
72
|
-
'&:before': {
|
|
73
|
-
content: '""',
|
|
74
|
-
position: 'absolute',
|
|
75
|
-
left: -12,
|
|
76
|
-
top: 20,
|
|
77
|
-
width: 6,
|
|
78
|
-
height: 6,
|
|
79
|
-
borderRadius: '50%',
|
|
80
|
-
|
|
81
|
-
backgroundColor: 'red',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
disabled: {},
|
|
86
|
-
|
|
87
|
-
label: {
|
|
88
|
-
position: 'absolute',
|
|
89
|
-
pointerEvents: 'none',
|
|
90
|
-
left: PADDING_X,
|
|
91
|
-
top: PADDING_X * 2,
|
|
92
|
-
transformOrigin: 'top left',
|
|
93
|
-
transform: 'translateY(-50%)',
|
|
94
|
-
transition: '0.25s ease-in-out',
|
|
95
|
-
transitionProperty: 'transform, color',
|
|
96
|
-
fontSize: 16,
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
invalid: {
|
|
100
|
-
borderColor: 'red',
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
invalidLabel: {
|
|
104
|
-
color: 'red',
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
error: {
|
|
108
|
-
fontSize: 12,
|
|
109
|
-
paddingTop: 4,
|
|
110
|
-
paddingLeft: 13,
|
|
111
|
-
color: 'red',
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
requiredLabel: {
|
|
115
|
-
'&:after': {
|
|
116
|
-
content: '""',
|
|
117
|
-
position: 'absolute',
|
|
118
|
-
right: -8,
|
|
119
|
-
top: 4,
|
|
120
|
-
transform: 'translate(0, -50%)',
|
|
121
|
-
width: 6,
|
|
122
|
-
height: 6,
|
|
123
|
-
borderRadius: '50%',
|
|
124
|
-
backgroundColor: 'red',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
symbolsCount: {
|
|
129
|
-
display: 'block',
|
|
130
|
-
textAlign: 'right',
|
|
131
|
-
marginTop: 4,
|
|
132
|
-
fontSize: 12,
|
|
133
|
-
marginLeft: 'auto',
|
|
134
|
-
paddingLeft: 32,
|
|
135
|
-
whiteSpace: 'nowrap',
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
symbolsCountError: {
|
|
139
|
-
color: 'red',
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
footer: {
|
|
143
|
-
display: 'flex',
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
info: {
|
|
147
|
-
fontSize: 12,
|
|
148
|
-
paddingTop: 4,
|
|
149
|
-
paddingLeft: 13,
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export type TextAreaStyles = ComponentStyles<typeof styles>;
|
|
1
|
+
import { ComponentStyles } from '../../types';
|
|
2
|
+
|
|
3
|
+
const PADDING_X = 12;
|
|
4
|
+
|
|
5
|
+
export const styles = {
|
|
6
|
+
root: {
|
|
7
|
+
width: '100%',
|
|
8
|
+
height: '100%',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
wrapper: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
position: 'relative',
|
|
16
|
+
width: '100%',
|
|
17
|
+
flexGrow: 1,
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
transition: '0.25s ease-in-out',
|
|
20
|
+
transitionProperty: 'border-color',
|
|
21
|
+
backgroundColor: 'white',
|
|
22
|
+
border: ['solid', 1, 'lightgray'],
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
textarea: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
outline: 'none',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
outlineStyle: 'none',
|
|
31
|
+
fontFamily: 'inherit',
|
|
32
|
+
fontSize: 16,
|
|
33
|
+
padding: [14, PADDING_X, 8],
|
|
34
|
+
transition: '0.25s ease-in-out',
|
|
35
|
+
transitionProperty: 'background-color',
|
|
36
|
+
border: 'none',
|
|
37
|
+
resize: 'none',
|
|
38
|
+
overflow: 'auto',
|
|
39
|
+
|
|
40
|
+
'&::placeholder': {
|
|
41
|
+
opacity: 1,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
MozAppearance: 'textfield',
|
|
45
|
+
'&::-webkit-inner-spin-button,&::-webkit-outer-spin-button': {
|
|
46
|
+
WebkitAppearance: 'none',
|
|
47
|
+
margin: 0,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
focused: {
|
|
52
|
+
position: 'relative',
|
|
53
|
+
zIndex: 1,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
withFloatingLabel: {
|
|
57
|
+
paddingTop: 24,
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
floating: {},
|
|
61
|
+
|
|
62
|
+
activeLabel: {
|
|
63
|
+
display: 'none',
|
|
64
|
+
|
|
65
|
+
'&$floating': {
|
|
66
|
+
display: 'block',
|
|
67
|
+
transform: 'scale(0.75) translateY(-120%)',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
required: {
|
|
72
|
+
'&:before': {
|
|
73
|
+
content: '""',
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
left: -12,
|
|
76
|
+
top: 20,
|
|
77
|
+
width: 6,
|
|
78
|
+
height: 6,
|
|
79
|
+
borderRadius: '50%',
|
|
80
|
+
|
|
81
|
+
backgroundColor: 'red',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
disabled: {},
|
|
86
|
+
|
|
87
|
+
label: {
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
pointerEvents: 'none',
|
|
90
|
+
left: PADDING_X,
|
|
91
|
+
top: PADDING_X * 2,
|
|
92
|
+
transformOrigin: 'top left',
|
|
93
|
+
transform: 'translateY(-50%)',
|
|
94
|
+
transition: '0.25s ease-in-out',
|
|
95
|
+
transitionProperty: 'transform, color',
|
|
96
|
+
fontSize: 16,
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
invalid: {
|
|
100
|
+
borderColor: 'red',
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
invalidLabel: {
|
|
104
|
+
color: 'red',
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
error: {
|
|
108
|
+
fontSize: 12,
|
|
109
|
+
paddingTop: 4,
|
|
110
|
+
paddingLeft: 13,
|
|
111
|
+
color: 'red',
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
requiredLabel: {
|
|
115
|
+
'&:after': {
|
|
116
|
+
content: '""',
|
|
117
|
+
position: 'absolute',
|
|
118
|
+
right: -8,
|
|
119
|
+
top: 4,
|
|
120
|
+
transform: 'translate(0, -50%)',
|
|
121
|
+
width: 6,
|
|
122
|
+
height: 6,
|
|
123
|
+
borderRadius: '50%',
|
|
124
|
+
backgroundColor: 'red',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
symbolsCount: {
|
|
129
|
+
display: 'block',
|
|
130
|
+
textAlign: 'right',
|
|
131
|
+
marginTop: 4,
|
|
132
|
+
fontSize: 12,
|
|
133
|
+
marginLeft: 'auto',
|
|
134
|
+
paddingLeft: 32,
|
|
135
|
+
whiteSpace: 'nowrap',
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
symbolsCountError: {
|
|
139
|
+
color: 'red',
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
footer: {
|
|
143
|
+
display: 'flex',
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
info: {
|
|
147
|
+
fontSize: 12,
|
|
148
|
+
paddingTop: 4,
|
|
149
|
+
paddingLeft: 13,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type TextAreaStyles = ComponentStyles<typeof styles>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './TextArea';
|
|
2
|
-
export type { TextAreaStyles } from './TextArea.styles';
|
|
1
|
+
export * from './TextArea';
|
|
2
|
+
export type { TextAreaStyles } from './TextArea.styles';
|