@teamturing/react-kit 2.21.5 → 2.21.7
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/dist/index.js +1305 -1179
- package/esm/core/Button/index.js +63 -63
- package/esm/core/Chip/index.js +53 -51
- package/esm/core/Dialog/index.js +8 -7
- package/esm/core/Grid/index.js +8 -6
- package/esm/core/IconButton/index.js +56 -57
- package/esm/core/IconToggleButton/index.js +17 -18
- package/esm/core/OverlayPopper/index.js +3 -3
- package/esm/core/Spinner/index.js +4 -4
- package/esm/core/Stack/index.js +8 -6
- package/esm/core/Tab/TabItem.js +12 -11
- package/esm/core/Tab/index.js +6 -7
- package/esm/core/Text/index.js +128 -27
- package/esm/core/TextInput/index.js +6 -7
- package/esm/packages/token-studio/esm/token/elevation/index.js +1 -5
- package/esm/packages/token-studio/esm/token/typography/index.js +3 -3
- package/package.json +2 -2
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
-
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
3
|
-
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
4
1
|
import { forwardRef } from 'react';
|
|
5
2
|
import styled from 'styled-components';
|
|
6
3
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
@@ -33,10 +30,11 @@ const IconButton = /*#__PURE__*/forwardRef(({
|
|
|
33
30
|
});
|
|
34
31
|
const BaseIconButton = styled(UnstyledButton)(({
|
|
35
32
|
$loading,
|
|
36
|
-
$disabled
|
|
33
|
+
$disabled,
|
|
34
|
+
theme
|
|
37
35
|
}) => ({
|
|
38
36
|
'position': 'relative',
|
|
39
|
-
'borderRadius': radii.full,
|
|
37
|
+
'borderRadius': theme.radii.full,
|
|
40
38
|
'transition': 'background-color 100ms, color 100ms',
|
|
41
39
|
'& svg': {
|
|
42
40
|
display: 'block',
|
|
@@ -44,7 +42,7 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
44
42
|
},
|
|
45
43
|
'cursor': $loading ? 'progress' : $disabled ? 'not-allowed' : 'pointer',
|
|
46
44
|
'&:focus-visible': {
|
|
47
|
-
outlineColor:
|
|
45
|
+
outlineColor: theme.colors['border/focused'],
|
|
48
46
|
outlineStyle: 'solid',
|
|
49
47
|
outlineWidth: 2,
|
|
50
48
|
outlineOffset: 2
|
|
@@ -75,55 +73,56 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
}), ({
|
|
78
|
-
$disabled
|
|
76
|
+
$disabled,
|
|
77
|
+
theme
|
|
79
78
|
}) => variant({
|
|
80
79
|
prop: 'variant',
|
|
81
80
|
variants: {
|
|
82
81
|
'primary': {
|
|
83
|
-
'backgroundColor':
|
|
84
|
-
'color':
|
|
82
|
+
'backgroundColor': theme.colors['bg/primary'],
|
|
83
|
+
'color': theme.colors['icon/inverse'],
|
|
85
84
|
'&:hover:not(:disabled)': {
|
|
86
|
-
backgroundColor:
|
|
85
|
+
backgroundColor: theme.colors['bg/primary/hovered']
|
|
87
86
|
},
|
|
88
87
|
'&:active:not(:disabled)': {
|
|
89
|
-
backgroundColor:
|
|
88
|
+
backgroundColor: theme.colors['bg/primary/pressed']
|
|
90
89
|
},
|
|
91
90
|
...($disabled ? {
|
|
92
|
-
backgroundColor:
|
|
93
|
-
color:
|
|
91
|
+
backgroundColor: theme.colors['bg/disabled'],
|
|
92
|
+
color: theme.colors['icon/disabled']
|
|
94
93
|
} : {})
|
|
95
94
|
},
|
|
96
95
|
'secondary': {
|
|
97
|
-
'backgroundColor':
|
|
98
|
-
'color':
|
|
96
|
+
'backgroundColor': theme.colors['bg/secondary'],
|
|
97
|
+
'color': theme.colors['icon/primary'],
|
|
99
98
|
'&:hover:not(:disabled)': {
|
|
100
|
-
backgroundColor:
|
|
99
|
+
backgroundColor: theme.colors['bg/secondary/hovered']
|
|
101
100
|
},
|
|
102
101
|
'&:active:not(:disabled)': {
|
|
103
|
-
backgroundColor:
|
|
102
|
+
backgroundColor: theme.colors['bg/secondary/pressed']
|
|
104
103
|
},
|
|
105
104
|
...($disabled ? {
|
|
106
|
-
backgroundColor:
|
|
107
|
-
color:
|
|
105
|
+
backgroundColor: theme.colors['bg/disabled'],
|
|
106
|
+
color: theme.colors['icon/disabled']
|
|
108
107
|
} : {})
|
|
109
108
|
},
|
|
110
109
|
'neutral': {
|
|
111
|
-
'backgroundColor':
|
|
112
|
-
'color':
|
|
110
|
+
'backgroundColor': theme.colors['bg/neutral'],
|
|
111
|
+
'color': theme.colors['icon/accent/gray'],
|
|
113
112
|
'&:hover:not(:disabled)': {
|
|
114
|
-
backgroundColor:
|
|
113
|
+
backgroundColor: theme.colors['bg/neutral/hovered']
|
|
115
114
|
},
|
|
116
115
|
'&:active:not(:disabled)': {
|
|
117
|
-
backgroundColor:
|
|
116
|
+
backgroundColor: theme.colors['bg/neutral/pressed']
|
|
118
117
|
},
|
|
119
118
|
...($disabled ? {
|
|
120
|
-
backgroundColor:
|
|
121
|
-
color:
|
|
119
|
+
backgroundColor: theme.colors['bg/disabled'],
|
|
120
|
+
color: theme.colors['icon/disabled']
|
|
122
121
|
} : {})
|
|
123
122
|
},
|
|
124
123
|
'outlined': {
|
|
125
|
-
'backgroundColor':
|
|
126
|
-
'color':
|
|
124
|
+
'backgroundColor': theme.colors['bg/neutral/subtler'],
|
|
125
|
+
'color': theme.colors['icon/neutral/bolder'],
|
|
127
126
|
'&:after': {
|
|
128
127
|
content: '""',
|
|
129
128
|
position: 'absolute',
|
|
@@ -133,78 +132,78 @@ const BaseIconButton = styled(UnstyledButton)(({
|
|
|
133
132
|
left: 0,
|
|
134
133
|
borderWidth: 1,
|
|
135
134
|
borderStyle: 'solid',
|
|
136
|
-
borderColor:
|
|
137
|
-
borderRadius: radii.full,
|
|
135
|
+
borderColor: theme.colors['border/neutral/bolder'],
|
|
136
|
+
borderRadius: theme.radii.full,
|
|
138
137
|
boxSizing: 'border-box'
|
|
139
138
|
},
|
|
140
139
|
'&:hover:not(:disabled)': {
|
|
141
|
-
backgroundColor:
|
|
140
|
+
backgroundColor: theme.colors['bg/neutral/subtler/hovered']
|
|
142
141
|
},
|
|
143
142
|
'&:active:not(:disabled)': {
|
|
144
|
-
backgroundColor:
|
|
143
|
+
backgroundColor: theme.colors['bg/neutral/subtler/pressed']
|
|
145
144
|
},
|
|
146
145
|
...($disabled ? {
|
|
147
|
-
'backgroundColor':
|
|
148
|
-
'color':
|
|
146
|
+
'backgroundColor': theme.colors['bg/disabled'],
|
|
147
|
+
'color': theme.colors['icon/disabled'],
|
|
149
148
|
'&:after': {
|
|
150
149
|
display: 'none'
|
|
151
150
|
}
|
|
152
151
|
} : {})
|
|
153
152
|
},
|
|
154
153
|
'plain-bold': {
|
|
155
|
-
'backgroundColor':
|
|
156
|
-
'color':
|
|
154
|
+
'backgroundColor': theme.colors['bg/neutral/subtler'],
|
|
155
|
+
'color': theme.colors['icon/neutral/bolder'],
|
|
157
156
|
'&:hover:not(:disabled)': {
|
|
158
|
-
color:
|
|
157
|
+
color: theme.colors['icon/accent/gray']
|
|
159
158
|
},
|
|
160
159
|
'&:active:not(:disabled)': {
|
|
161
|
-
color:
|
|
160
|
+
color: theme.colors['icon/accent/gray']
|
|
162
161
|
},
|
|
163
162
|
...($disabled ? {
|
|
164
|
-
backgroundColor:
|
|
165
|
-
color:
|
|
163
|
+
backgroundColor: theme.colors['bg/disabled/subtlest'],
|
|
164
|
+
color: theme.colors['icon/disabled']
|
|
166
165
|
} : {})
|
|
167
166
|
},
|
|
168
167
|
'plain': {
|
|
169
|
-
'backgroundColor':
|
|
170
|
-
'color':
|
|
168
|
+
'backgroundColor': theme.colors['bg/neutral/subtler'],
|
|
169
|
+
'color': theme.colors['icon/neutral/bold'],
|
|
171
170
|
'&:hover:not(:disabled)': {
|
|
172
|
-
color:
|
|
171
|
+
color: theme.colors['icon/neutral/bolder']
|
|
173
172
|
},
|
|
174
173
|
'&:active:not(:disabled)': {
|
|
175
|
-
color:
|
|
174
|
+
color: theme.colors['icon/neutral/bolder']
|
|
176
175
|
},
|
|
177
176
|
...($disabled ? {
|
|
178
|
-
backgroundColor:
|
|
179
|
-
color:
|
|
177
|
+
backgroundColor: theme.colors['bg/disabled/subtlest'],
|
|
178
|
+
color: theme.colors['icon/disabled/subtler']
|
|
180
179
|
} : {})
|
|
181
180
|
},
|
|
182
181
|
'plain-subtle': {
|
|
183
|
-
'backgroundColor':
|
|
184
|
-
'color':
|
|
182
|
+
'backgroundColor': theme.colors['bg/neutral/subtler'],
|
|
183
|
+
'color': theme.colors['icon/neutral'],
|
|
185
184
|
'&:hover:not(:disabled)': {
|
|
186
|
-
color:
|
|
185
|
+
color: theme.colors['icon/neutral/bold']
|
|
187
186
|
},
|
|
188
187
|
'&:active:not(:disabled)': {
|
|
189
|
-
color:
|
|
188
|
+
color: theme.colors['icon/neutral/bold']
|
|
190
189
|
},
|
|
191
190
|
...($disabled ? {
|
|
192
|
-
backgroundColor:
|
|
193
|
-
color:
|
|
191
|
+
backgroundColor: theme.colors['bg/disabled/subtlest'],
|
|
192
|
+
color: theme.colors['icon/disabled/subtler']
|
|
194
193
|
} : {})
|
|
195
194
|
},
|
|
196
195
|
'danger': {
|
|
197
|
-
'backgroundColor':
|
|
198
|
-
'color':
|
|
196
|
+
'backgroundColor': theme.colors['bg/danger/bold'],
|
|
197
|
+
'color': theme.colors['icon/inverse'],
|
|
199
198
|
'&:hover:not(:disabled)': {
|
|
200
|
-
backgroundColor:
|
|
199
|
+
backgroundColor: theme.colors['bg/danger/bold/hovered']
|
|
201
200
|
},
|
|
202
201
|
'&:active:not(:disabled)': {
|
|
203
|
-
backgroundColor:
|
|
202
|
+
backgroundColor: theme.colors['bg/danger/bold/pressed']
|
|
204
203
|
},
|
|
205
204
|
...($disabled ? {
|
|
206
|
-
backgroundColor:
|
|
207
|
-
color:
|
|
205
|
+
backgroundColor: theme.colors['bg/disabled'],
|
|
206
|
+
color: theme.colors['icon/disabled']
|
|
208
207
|
} : {})
|
|
209
208
|
}
|
|
210
209
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
2
|
-
import radii from '../../packages/token-studio/esm/token/radii/index.js';
|
|
3
|
-
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
4
1
|
import styled from 'styled-components';
|
|
5
2
|
import '../../node_modules/styled-system/dist/index.esm.js';
|
|
6
3
|
import { sx } from '../../utils/styled-system/index.js';
|
|
@@ -31,17 +28,18 @@ const IconToggleButton = ({
|
|
|
31
28
|
});
|
|
32
29
|
};
|
|
33
30
|
const BaseIconToggleButton = styled(UnstyledButton)(({
|
|
34
|
-
$disabled
|
|
31
|
+
$disabled,
|
|
32
|
+
theme
|
|
35
33
|
}) => ({
|
|
36
34
|
'position': 'relative',
|
|
37
|
-
'borderRadius': radii.full,
|
|
35
|
+
'borderRadius': theme.radii.full,
|
|
38
36
|
'transition': 'background-color 100ms, color 100ms',
|
|
39
37
|
'& svg': {
|
|
40
38
|
display: 'block'
|
|
41
39
|
},
|
|
42
40
|
'cursor': $disabled ? 'not-allowed' : 'pointer',
|
|
43
41
|
'&:focus-visible': {
|
|
44
|
-
outlineColor:
|
|
42
|
+
outlineColor: theme.colors['border/focused'],
|
|
45
43
|
outlineStyle: 'solid',
|
|
46
44
|
outlineWidth: 2,
|
|
47
45
|
outlineOffset: 2
|
|
@@ -73,33 +71,34 @@ const BaseIconToggleButton = styled(UnstyledButton)(({
|
|
|
73
71
|
}
|
|
74
72
|
}), ({
|
|
75
73
|
selected,
|
|
76
|
-
$disabled
|
|
74
|
+
$disabled,
|
|
75
|
+
theme
|
|
77
76
|
}) => variant({
|
|
78
77
|
prop: 'variant',
|
|
79
78
|
variants: {
|
|
80
79
|
primary: {
|
|
81
80
|
...(selected ? {
|
|
82
|
-
backgroundColor:
|
|
83
|
-
color:
|
|
81
|
+
backgroundColor: theme.colors['bg/selected/violet'],
|
|
82
|
+
color: theme.colors['icon/inverse']
|
|
84
83
|
} : {
|
|
85
|
-
backgroundColor:
|
|
86
|
-
color:
|
|
84
|
+
backgroundColor: theme.colors['bg/neutral'],
|
|
85
|
+
color: theme.colors['icon/accent/gray']
|
|
87
86
|
}),
|
|
88
87
|
...($disabled ? {
|
|
89
|
-
backgroundColor:
|
|
90
|
-
color:
|
|
88
|
+
backgroundColor: theme.colors['bg/disabled'],
|
|
89
|
+
color: theme.colors['icon/disabled']
|
|
91
90
|
} : {})
|
|
92
91
|
},
|
|
93
92
|
plain: {
|
|
94
|
-
backgroundColor:
|
|
93
|
+
backgroundColor: theme.colors['bg/neutral/subtler'],
|
|
95
94
|
...(selected ? {
|
|
96
|
-
color:
|
|
95
|
+
color: theme.colors['icon/selected/violet']
|
|
97
96
|
} : {
|
|
98
|
-
color:
|
|
97
|
+
color: theme.colors['icon/neutral']
|
|
99
98
|
}),
|
|
100
99
|
...($disabled ? {
|
|
101
|
-
backgroundColor:
|
|
102
|
-
color:
|
|
100
|
+
backgroundColor: theme.colors['bg/disabled/subtlest'],
|
|
101
|
+
color: theme.colors['icon/disabled/subtler']
|
|
103
102
|
} : {})
|
|
104
103
|
}
|
|
105
104
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useFloating } from '../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
2
|
-
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
3
|
-
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
4
2
|
import { isFunction } from '../../packages/utils/esm/isFunction.js';
|
|
5
3
|
import { Children, cloneElement } from 'react';
|
|
4
|
+
import { useTheme } from 'styled-components';
|
|
6
5
|
import useFocusTrap from '../../hook/useFocusTrap.js';
|
|
7
6
|
import useFocusZone from '../../hook/useFocusZone.js';
|
|
8
7
|
import useToggleState from '../../hook/useToggleState.js';
|
|
@@ -19,6 +18,7 @@ const OverlayPopper = ({
|
|
|
19
18
|
onOpen,
|
|
20
19
|
onClose
|
|
21
20
|
}) => {
|
|
21
|
+
const theme = useTheme();
|
|
22
22
|
const {
|
|
23
23
|
refs,
|
|
24
24
|
elements,
|
|
@@ -27,7 +27,7 @@ const OverlayPopper = ({
|
|
|
27
27
|
} = useFloating({
|
|
28
28
|
placement,
|
|
29
29
|
whileElementsMounted: autoUpdate,
|
|
30
|
-
middleware: [offset(space[1]), flip(), shift()],
|
|
30
|
+
middleware: [offset(theme.space[1]), flip(), shift()],
|
|
31
31
|
strategy: 'fixed'
|
|
32
32
|
});
|
|
33
33
|
const [isOpen, toggleOverlay, openOverlay, closeOverlay] = useToggleState({
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import SvgProgressGradient from '../../packages/icons/esm/ProgressGradient.js';
|
|
3
|
-
import color from '../../packages/token-studio/esm/token/color/index.js';
|
|
4
|
-
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
5
3
|
import styled, { keyframes } from 'styled-components';
|
|
6
4
|
|
|
7
5
|
const spin = keyframes`
|
|
@@ -13,12 +11,14 @@ const spin = keyframes`
|
|
|
13
11
|
}
|
|
14
12
|
`;
|
|
15
13
|
const Spinner = styled(SvgProgressGradient)`
|
|
14
|
+
color: ${({
|
|
15
|
+
theme
|
|
16
|
+
}) => theme.colors['icon/neutral']};
|
|
16
17
|
animation: ${spin} 1000ms infinite steps(8, end);
|
|
17
18
|
`;
|
|
18
19
|
Spinner.defaultProps = {
|
|
19
20
|
width: 32,
|
|
20
|
-
height: 32
|
|
21
|
-
color: color['icon/neutral']
|
|
21
|
+
height: 32
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export { Spinner as default };
|
package/esm/core/Stack/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import space from '../../packages/token-studio/esm/token/space/index.js';
|
|
2
|
-
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
3
1
|
import { forcePixelValue } from '../../packages/utils/esm/forcePixelValue.js';
|
|
4
2
|
import { forwardRef } from 'react';
|
|
5
3
|
import styled from 'styled-components';
|
|
@@ -29,9 +27,11 @@ const BaseStack = styled(View)({
|
|
|
29
27
|
display: 'flex',
|
|
30
28
|
flexDirection: 'row',
|
|
31
29
|
flexWrap: 'wrap'
|
|
32
|
-
},
|
|
30
|
+
}, ({
|
|
31
|
+
theme
|
|
32
|
+
}) => variant({
|
|
33
33
|
prop: 'gapX',
|
|
34
|
-
variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
|
|
34
|
+
variants: Object.fromEntries(Object.entries(theme.space).map(([key, value]) => {
|
|
35
35
|
const styleValue = {
|
|
36
36
|
'& > *': {
|
|
37
37
|
px: forcePixelValue(value / 2)
|
|
@@ -40,9 +40,11 @@ const BaseStack = styled(View)({
|
|
|
40
40
|
};
|
|
41
41
|
return [key, styleValue];
|
|
42
42
|
}))
|
|
43
|
-
}),
|
|
43
|
+
}), ({
|
|
44
|
+
theme
|
|
45
|
+
}) => variant({
|
|
44
46
|
prop: 'gapY',
|
|
45
|
-
variants: Object.fromEntries(Object.entries(space).map(([key, value]) => {
|
|
47
|
+
variants: Object.fromEntries(Object.entries(theme.space).map(([key, value]) => {
|
|
46
48
|
const styleValue = {
|
|
47
49
|
'& > *': {
|
|
48
50
|
mt: forcePixelValue(value)
|
package/esm/core/Tab/TabItem.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import typography from '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
1
|
import { scrollIntoView } from '../../packages/utils/esm/scrollIntoView.js';
|
|
3
2
|
import { useRef, useContext } from 'react';
|
|
4
3
|
import styled from 'styled-components';
|
|
@@ -77,15 +76,17 @@ const BaseTabItem = styled(UnstyledButton)(({
|
|
|
77
76
|
outlineWidth: 2,
|
|
78
77
|
outlineOffset: 2
|
|
79
78
|
}
|
|
80
|
-
}), (
|
|
79
|
+
}), ({
|
|
80
|
+
theme
|
|
81
|
+
}) => variant({
|
|
81
82
|
prop: 'size',
|
|
82
83
|
variants: {
|
|
83
84
|
l: {
|
|
84
85
|
'px': 4,
|
|
85
86
|
'py': 2,
|
|
86
|
-
'fontSize':
|
|
87
|
-
'fontWeight':
|
|
88
|
-
'lineHeight':
|
|
87
|
+
'fontSize': theme.fontSizes.s,
|
|
88
|
+
'fontWeight': theme.fontWeights.medium,
|
|
89
|
+
'lineHeight': theme.lineHeights[2],
|
|
89
90
|
'& svg': {
|
|
90
91
|
width: 20,
|
|
91
92
|
height: 20
|
|
@@ -94,9 +95,9 @@ const BaseTabItem = styled(UnstyledButton)(({
|
|
|
94
95
|
m: {
|
|
95
96
|
'px': 4,
|
|
96
97
|
'py': 2,
|
|
97
|
-
'fontSize':
|
|
98
|
-
'fontWeight':
|
|
99
|
-
'lineHeight':
|
|
98
|
+
'fontSize': theme.fontSizes.xs,
|
|
99
|
+
'fontWeight': theme.fontWeights.medium,
|
|
100
|
+
'lineHeight': theme.lineHeights[2],
|
|
100
101
|
'& svg': {
|
|
101
102
|
width: 20,
|
|
102
103
|
height: 20
|
|
@@ -105,9 +106,9 @@ const BaseTabItem = styled(UnstyledButton)(({
|
|
|
105
106
|
s: {
|
|
106
107
|
'px': 3,
|
|
107
108
|
'py': 2,
|
|
108
|
-
'fontSize':
|
|
109
|
-
'fontWeight':
|
|
110
|
-
'lineHeight':
|
|
109
|
+
'fontSize': theme.fontSizes.xxs,
|
|
110
|
+
'fontWeight': theme.fontWeights.medium,
|
|
111
|
+
'lineHeight': theme.lineHeights[2],
|
|
111
112
|
'& svg': {
|
|
112
113
|
width: 16,
|
|
113
114
|
height: 16
|
package/esm/core/Tab/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createContext, useRef, useState, useEffect } from 'react';
|
|
2
2
|
import SvgChevronLeft from '../../packages/icons/esm/ChevronLeft.js';
|
|
3
3
|
import SvgChevronRight from '../../packages/icons/esm/ChevronRight.js';
|
|
4
|
-
import elevation from '../../packages/token-studio/esm/token/elevation/index.js';
|
|
5
|
-
import gradient from '../../packages/token-studio/esm/token/gradient/index.js';
|
|
6
|
-
import '../../packages/token-studio/esm/token/typography/index.js';
|
|
7
4
|
import { forcePixelValue } from '../../packages/utils/esm/forcePixelValue.js';
|
|
8
5
|
import throttle from '../../node_modules/lodash.throttle/index.js';
|
|
6
|
+
import { useTheme } from 'styled-components';
|
|
9
7
|
import useResize from '../../hook/useResize.js';
|
|
10
8
|
import IconButton from '../IconButton/index.js';
|
|
11
9
|
import View from '../View/index.js';
|
|
@@ -19,6 +17,7 @@ const Tab = ({
|
|
|
19
17
|
gap = 2,
|
|
20
18
|
children
|
|
21
19
|
}) => {
|
|
20
|
+
const theme = useTheme();
|
|
22
21
|
const rootRef = useRef(null);
|
|
23
22
|
const [isLeftButtonVisible, setIsLeftButtonVisible] = useState(rootRef.current ? rootRef.current.scrollLeft > 0 : false);
|
|
24
23
|
const [isRightButtonVisible, setIsRightButtonVisible] = useState(rootRef.current ? rootRef.current.clientWidth + rootRef.current.scrollLeft < rootRef.current.scrollWidth : false);
|
|
@@ -86,7 +85,7 @@ const Tab = ({
|
|
|
86
85
|
bottom: 0,
|
|
87
86
|
width: forcePixelValue(gradientWidth),
|
|
88
87
|
height: '100%',
|
|
89
|
-
background: `linear-gradient(${
|
|
88
|
+
background: `linear-gradient(${theme.gradients['overlay/floating/toright']})`,
|
|
90
89
|
pointerEvents: 'none'
|
|
91
90
|
}
|
|
92
91
|
}), /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
@@ -97,7 +96,7 @@ const Tab = ({
|
|
|
97
96
|
top: 0,
|
|
98
97
|
left: 0,
|
|
99
98
|
bottom: 0,
|
|
100
|
-
backgroundColor:
|
|
99
|
+
backgroundColor: theme.colors.surface
|
|
101
100
|
},
|
|
102
101
|
children: /*#__PURE__*/jsxRuntimeExports.jsx(IconButton, {
|
|
103
102
|
size: 's',
|
|
@@ -115,7 +114,7 @@ const Tab = ({
|
|
|
115
114
|
bottom: 0,
|
|
116
115
|
width: forcePixelValue(gradientWidth),
|
|
117
116
|
height: '100%',
|
|
118
|
-
background: `linear-gradient(${
|
|
117
|
+
background: `linear-gradient(${theme.gradients['overlay/floating/toleft']})`,
|
|
119
118
|
pointerEvents: 'none'
|
|
120
119
|
}
|
|
121
120
|
}), /*#__PURE__*/jsxRuntimeExports.jsx(View, {
|
|
@@ -126,7 +125,7 @@ const Tab = ({
|
|
|
126
125
|
top: 0,
|
|
127
126
|
right: 0,
|
|
128
127
|
bottom: 0,
|
|
129
|
-
backgroundColor:
|
|
128
|
+
backgroundColor: theme.colors.surface
|
|
130
129
|
},
|
|
131
130
|
children: /*#__PURE__*/jsxRuntimeExports.jsx(IconButton, {
|
|
132
131
|
size: 's',
|
package/esm/core/Text/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import typography from '../../packages/token-studio/esm/token/typography/index.js';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
2
|
import { fontSize, fontWeight, lineHeight, textAlign } from '../../node_modules/styled-system/dist/index.esm.js';
|
|
4
3
|
import { sx, wordBreak, whiteSpace, textDecoration } from '../../utils/styled-system/index.js';
|
|
@@ -12,34 +11,136 @@ const Text = styled.span({
|
|
|
12
11
|
'& > span': {
|
|
13
12
|
display: 'inline'
|
|
14
13
|
}
|
|
15
|
-
},
|
|
14
|
+
}, ({
|
|
15
|
+
theme
|
|
16
|
+
}) => variant({
|
|
16
17
|
prop: 'typography',
|
|
17
18
|
variants: {
|
|
18
|
-
'display1':
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
'display1': {
|
|
20
|
+
fontSize: theme.fontSizes.display1,
|
|
21
|
+
fontWeight: theme.fontWeights.bold,
|
|
22
|
+
lineHeight: theme.lineHeights[1]
|
|
23
|
+
},
|
|
24
|
+
'display2': {
|
|
25
|
+
fontSize: theme.fontSizes.display2,
|
|
26
|
+
fontWeight: theme.fontWeights.bold,
|
|
27
|
+
lineHeight: theme.lineHeights[1]
|
|
28
|
+
},
|
|
29
|
+
'display3': {
|
|
30
|
+
fontSize: theme.fontSizes.display3,
|
|
31
|
+
fontWeight: theme.fontWeights.bold,
|
|
32
|
+
lineHeight: theme.lineHeights[1]
|
|
33
|
+
},
|
|
34
|
+
'display4': {
|
|
35
|
+
fontSize: theme.fontSizes.display4,
|
|
36
|
+
fontWeight: theme.fontWeights.bold,
|
|
37
|
+
lineHeight: theme.lineHeights[2]
|
|
38
|
+
},
|
|
39
|
+
'xxl/regular': {
|
|
40
|
+
fontSize: theme.fontSizes.xxl,
|
|
41
|
+
fontWeight: theme.fontWeights.regular,
|
|
42
|
+
lineHeight: theme.lineHeights[2]
|
|
43
|
+
},
|
|
44
|
+
'xxl': {
|
|
45
|
+
fontSize: theme.fontSizes.xxl,
|
|
46
|
+
fontWeight: theme.fontWeights.medium,
|
|
47
|
+
lineHeight: theme.lineHeights[2]
|
|
48
|
+
},
|
|
49
|
+
'xxl/bold': {
|
|
50
|
+
fontSize: theme.fontSizes.xxl,
|
|
51
|
+
fontWeight: theme.fontWeights.bold,
|
|
52
|
+
lineHeight: theme.lineHeights[2]
|
|
53
|
+
},
|
|
54
|
+
'xl/regular': {
|
|
55
|
+
fontSize: theme.fontSizes.xl,
|
|
56
|
+
fontWeight: theme.fontWeights.regular,
|
|
57
|
+
lineHeight: theme.lineHeights[2]
|
|
58
|
+
},
|
|
59
|
+
'xl': {
|
|
60
|
+
fontSize: theme.fontSizes.xl,
|
|
61
|
+
fontWeight: theme.fontWeights.medium,
|
|
62
|
+
lineHeight: theme.lineHeights[2]
|
|
63
|
+
},
|
|
64
|
+
'xl/bold': {
|
|
65
|
+
fontSize: theme.fontSizes.xl,
|
|
66
|
+
fontWeight: theme.fontWeights.bold,
|
|
67
|
+
lineHeight: theme.lineHeights[2]
|
|
68
|
+
},
|
|
69
|
+
'l/regular': {
|
|
70
|
+
fontSize: theme.fontSizes.l,
|
|
71
|
+
fontWeight: theme.fontWeights.regular,
|
|
72
|
+
lineHeight: theme.lineHeights[2]
|
|
73
|
+
},
|
|
74
|
+
'l': {
|
|
75
|
+
fontSize: theme.fontSizes.l,
|
|
76
|
+
fontWeight: theme.fontWeights.medium,
|
|
77
|
+
lineHeight: theme.lineHeights[2]
|
|
78
|
+
},
|
|
79
|
+
'l/bold': {
|
|
80
|
+
fontSize: theme.fontSizes.l,
|
|
81
|
+
fontWeight: theme.fontWeights.bold,
|
|
82
|
+
lineHeight: theme.lineHeights[2]
|
|
83
|
+
},
|
|
84
|
+
'm/regular': {
|
|
85
|
+
fontSize: theme.fontSizes.m,
|
|
86
|
+
fontWeight: theme.fontWeights.regular,
|
|
87
|
+
lineHeight: theme.lineHeights[2]
|
|
88
|
+
},
|
|
89
|
+
'm': {
|
|
90
|
+
fontSize: theme.fontSizes.m,
|
|
91
|
+
fontWeight: theme.fontWeights.medium,
|
|
92
|
+
lineHeight: theme.lineHeights[2]
|
|
93
|
+
},
|
|
94
|
+
'm/bold': {
|
|
95
|
+
fontSize: theme.fontSizes.m,
|
|
96
|
+
fontWeight: theme.fontWeights.bold,
|
|
97
|
+
lineHeight: theme.lineHeights[2]
|
|
98
|
+
},
|
|
99
|
+
's/regular': {
|
|
100
|
+
fontSize: theme.fontSizes.s,
|
|
101
|
+
fontWeight: theme.fontWeights.regular,
|
|
102
|
+
lineHeight: theme.lineHeights[2]
|
|
103
|
+
},
|
|
104
|
+
's': {
|
|
105
|
+
fontSize: theme.fontSizes.s,
|
|
106
|
+
fontWeight: theme.fontWeights.medium,
|
|
107
|
+
lineHeight: theme.lineHeights[2]
|
|
108
|
+
},
|
|
109
|
+
's/bold': {
|
|
110
|
+
fontSize: theme.fontSizes.s,
|
|
111
|
+
fontWeight: theme.fontWeights.bold,
|
|
112
|
+
lineHeight: theme.lineHeights[2]
|
|
113
|
+
},
|
|
114
|
+
'xs/regular': {
|
|
115
|
+
fontSize: theme.fontSizes.xs,
|
|
116
|
+
fontWeight: theme.fontWeights.regular,
|
|
117
|
+
lineHeight: theme.lineHeights[2]
|
|
118
|
+
},
|
|
119
|
+
'xs': {
|
|
120
|
+
fontSize: theme.fontSizes.xs,
|
|
121
|
+
fontWeight: theme.fontWeights.medium,
|
|
122
|
+
lineHeight: theme.lineHeights[2]
|
|
123
|
+
},
|
|
124
|
+
'xs/bold': {
|
|
125
|
+
fontSize: theme.fontSizes.xs,
|
|
126
|
+
fontWeight: theme.fontWeights.bold,
|
|
127
|
+
lineHeight: theme.lineHeights[2]
|
|
128
|
+
},
|
|
129
|
+
'xxs/regular': {
|
|
130
|
+
fontSize: theme.fontSizes.xxs,
|
|
131
|
+
fontWeight: theme.fontWeights.regular,
|
|
132
|
+
lineHeight: theme.lineHeights[2]
|
|
133
|
+
},
|
|
134
|
+
'xxs': {
|
|
135
|
+
fontSize: theme.fontSizes.xxs,
|
|
136
|
+
fontWeight: theme.fontWeights.medium,
|
|
137
|
+
lineHeight: theme.lineHeights[2]
|
|
138
|
+
},
|
|
139
|
+
'xxs/bold': {
|
|
140
|
+
fontSize: theme.fontSizes.xxs,
|
|
141
|
+
fontWeight: theme.fontWeights.bold,
|
|
142
|
+
lineHeight: theme.lineHeights[2]
|
|
143
|
+
}
|
|
43
144
|
}
|
|
44
145
|
}), compose(wordBreak, whiteSpace, textDecoration, fontSize, fontWeight, lineHeight, color, textAlign), sx);
|
|
45
146
|
Text.defaultProps = {
|