@xqmsg/ui-core 0.9.3 → 0.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.
- package/dist/components/button/index.d.ts +3 -7
- package/dist/components/input/Input.stories.d.ts +4 -0
- package/dist/components/input/InputTypes.d.ts +5 -3
- package/dist/components/input/StackedInput/StackedInput.d.ts +0 -3
- package/dist/components/input/StackedMultiSelect/index.d.ts +1 -1
- package/dist/components/input/StackedSelect/StackedSelect.d.ts +7 -3
- package/dist/components/input/components/dropdown/index.d.ts +10 -0
- package/dist/components/input/components/label/index.d.ts +9 -0
- package/dist/components/input/components/token/Token.stories.d.ts +5 -0
- package/dist/components/input/components/token/index.d.ts +7 -0
- package/dist/components/input/index.d.ts +1 -3
- package/dist/theme/components/button.d.ts +68 -207
- package/dist/theme/components/form-error.d.ts +3 -3
- package/dist/theme/components/form-label.d.ts +4 -6
- package/dist/theme/components/form.d.ts +3 -3
- package/dist/theme/components/input.d.ts +32 -161
- package/dist/theme/components/select.d.ts +27 -153
- package/dist/theme/components/textarea.d.ts +10 -117
- package/dist/theme/foundations/colors.d.ts +68 -16
- package/dist/ui-core.cjs.development.js +594 -860
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +598 -864
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -2
- package/src/components/banner/index.tsx +7 -1
- package/src/components/button/Button.stories.tsx +19 -7
- package/src/components/button/index.tsx +7 -19
- package/src/components/button/spinner/index.tsx +2 -7
- package/src/components/input/Input.stories.tsx +60 -58
- package/src/components/input/InputTypes.ts +7 -1
- package/src/components/input/StackedInput/StackedInput.tsx +3 -15
- package/src/components/input/StackedMultiSelect/components/MultiValue/index.tsx +2 -2
- package/src/components/input/StackedMultiSelect/index.tsx +88 -92
- package/src/components/input/StackedPilledInput/index.tsx +139 -56
- package/src/components/input/StackedSelect/StackedSelect.tsx +63 -20
- package/src/components/input/StackedSelect/assets/svg/subtract.svg +3 -0
- package/src/components/input/components/dropdown/index.tsx +80 -0
- package/src/components/input/components/label/index.tsx +24 -0
- package/src/components/input/components/token/Token.stories.tsx +22 -0
- package/src/components/input/components/token/assets/svg/close.svg +3 -0
- package/src/components/input/components/token/index.tsx +37 -0
- package/src/components/input/index.tsx +7 -20
- package/src/components/loading/index.tsx +1 -1
- package/src/components/table/Table.stories.tsx +9 -1
- package/src/components/table/index.tsx +1 -1
- package/src/components/table/loading/index.tsx +2 -2
- package/src/components/tabs/index.tsx +1 -1
- package/src/components/text/index.tsx +1 -1
- package/src/theme/components/alert.ts +4 -4
- package/src/theme/components/button.ts +45 -186
- package/src/theme/components/form-error.ts +11 -14
- package/src/theme/components/form-label.ts +8 -8
- package/src/theme/components/form.ts +10 -13
- package/src/theme/components/input.ts +17 -191
- package/src/theme/components/link.ts +2 -1
- package/src/theme/components/select.ts +5 -10
- package/src/theme/components/tabs.ts +3 -3
- package/src/theme/components/textarea.ts +2 -38
- package/src/theme/customXQChakraTheme.ts +0 -2
- package/src/theme/foundations/colors.ts +31 -10
- package/src/theme/foundations/shadows.ts +3 -3
- package/dist/components/input/components/InputTag/index.d.ts +0 -7
- package/dist/theme/components/menu.d.ts +0 -48
- package/src/components/input/components/InputTag/index.tsx +0 -24
- package/src/theme/components/menu.ts +0 -70
|
@@ -23,10 +23,10 @@ export const TableLoadingRows: React.FC<TableLoadingRowsProps> = ({
|
|
|
23
23
|
justifyContent="center"
|
|
24
24
|
alignItems="center"
|
|
25
25
|
height={20}
|
|
26
|
-
borderTopColor={colors.
|
|
26
|
+
borderTopColor={colors.fill.light.quaternary}
|
|
27
27
|
>
|
|
28
28
|
{isLoading ? (
|
|
29
|
-
<Spinner size="lg" color={colors.
|
|
29
|
+
<Spinner size="lg" color={colors.fill.action} />
|
|
30
30
|
) : (
|
|
31
31
|
<IconButton
|
|
32
32
|
aria-label="Fetch more rows"
|
|
@@ -22,7 +22,7 @@ export const TabsWrapper: React.FC<TabsWrapperProps> = ({
|
|
|
22
22
|
<TabList
|
|
23
23
|
flexDirection={{ base: 'column', sm: 'row' }}
|
|
24
24
|
border="1px"
|
|
25
|
-
borderColor={colors.
|
|
25
|
+
borderColor={colors.fill.light.quaternary}
|
|
26
26
|
bg="white"
|
|
27
27
|
borderRadius="md"
|
|
28
28
|
borderBottom={0}
|
|
@@ -19,25 +19,25 @@ const baseStyle = {
|
|
|
19
19
|
|
|
20
20
|
function variantPositive() {
|
|
21
21
|
return {
|
|
22
|
-
container: { bg:
|
|
22
|
+
container: { bg: colors.fill.success },
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function variantWarning() {
|
|
27
27
|
return {
|
|
28
|
-
container: { bg:
|
|
28
|
+
container: { bg: colors.fill.warning },
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function variantError() {
|
|
33
33
|
return {
|
|
34
|
-
container: { bg:
|
|
34
|
+
container: { bg: colors.fill.error },
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function variantNeutral() {
|
|
39
39
|
return {
|
|
40
|
-
container: { bg:
|
|
40
|
+
container: { bg: colors.fill.light.tertiary },
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -1,211 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { defineStyle } from '@chakra-ui/system';
|
|
2
|
+
import colors from '../foundations/colors';
|
|
3
|
+
|
|
4
|
+
const baseStyle = defineStyle({
|
|
5
|
+
borderRadius: '4px',
|
|
6
|
+
fontSize: '18px',
|
|
7
|
+
bg: colors.fill.action,
|
|
8
|
+
color: colors.label.primary.dark,
|
|
9
|
+
px: '8px',
|
|
10
|
+
py: '4px',
|
|
11
|
+
bgGradient: 'linear-gradient(#FFFFFF29, #FFFFFF00)',
|
|
12
|
+
shadow: '1px 0.5px #0000001A',
|
|
13
13
|
_disabled: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
backgroundColor: 'gray.100',
|
|
15
|
+
borderColor: 'gray.100',
|
|
16
|
+
color: 'gray.500',
|
|
17
|
+
pointerEvents: 'none',
|
|
17
18
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_focus: { boxShadow: focusShadow(focusColor) },
|
|
32
|
-
};
|
|
33
|
-
}
|
|
19
|
+
_hover: {
|
|
20
|
+
bg: colors.fill.action,
|
|
21
|
+
},
|
|
22
|
+
_active: {
|
|
23
|
+
color: colors.label.primary.dark,
|
|
24
|
+
bg: colors.fill.action,
|
|
25
|
+
bgGradient: colors.fill.light.quaternary,
|
|
26
|
+
},
|
|
27
|
+
_focus: {
|
|
28
|
+
bg: colors.fill.action,
|
|
29
|
+
border: `2px solid ${colors.border.focus}`,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const variantSolid = () => {
|
|
34
|
+
return { ...baseStyle };
|
|
35
|
+
};
|
|
38
36
|
|
|
37
|
+
const variantOutline = () => {
|
|
39
38
|
return {
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
...baseStyle,
|
|
40
|
+
color: colors.fill.action,
|
|
41
|
+
bg: colors.label.primary.dark,
|
|
42
|
+
border: 'none',
|
|
42
43
|
_hover: {
|
|
43
|
-
bg:
|
|
44
|
+
bg: colors.label.primary.dark,
|
|
44
45
|
},
|
|
45
46
|
_active: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
boxShadow: focusShadow(focusColor),
|
|
47
|
+
color: colors.fill.action,
|
|
48
|
+
bg: colors.label.primary.dark,
|
|
49
|
+
bgGradient: colors.fill.light.quaternary,
|
|
50
50
|
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function variantOutline(props: Dict) {
|
|
55
|
-
const { colorScheme: c } = props;
|
|
56
|
-
const borderColor = mode(`gray.200`, `whiteAlpha.300`)(props);
|
|
57
|
-
return {
|
|
58
|
-
border: '1px solid',
|
|
59
|
-
borderColor: c === 'gray' ? borderColor : 'currentColor',
|
|
60
|
-
...variantGhost(props),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
type AccessibleColor = {
|
|
65
|
-
bg?: string;
|
|
66
|
-
color?: string;
|
|
67
|
-
hoverBg?: string;
|
|
68
|
-
activeBg?: string;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/** Accessible color overrides for less accessible colors. */
|
|
72
|
-
const accessibleColorMap: { [key: string]: AccessibleColor } = {
|
|
73
|
-
yellow: {
|
|
74
|
-
bg: 'yellow.400',
|
|
75
|
-
color: 'black',
|
|
76
|
-
hoverBg: 'yellow.500',
|
|
77
|
-
activeBg: 'yellow.600',
|
|
78
|
-
},
|
|
79
|
-
cyan: {
|
|
80
|
-
bg: 'cyan.400',
|
|
81
|
-
color: 'black',
|
|
82
|
-
hoverBg: 'cyan.500',
|
|
83
|
-
activeBg: 'cyan.600',
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
function variantSolid(props: Dict) {
|
|
88
|
-
const { colorScheme: c, theme } = props;
|
|
89
|
-
|
|
90
|
-
if (c === 'gray')
|
|
91
|
-
return {
|
|
92
|
-
color: 'gray.500',
|
|
93
|
-
bg: mode(`gray.50`, `whiteAlpha.200`)(props),
|
|
94
|
-
_hover: { bg: mode(`gray.100`, `whiteAlpha.300`)(props) },
|
|
95
|
-
_active: { bg: mode(`gray.200`, `whiteAlpha.400`)(props) },
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
if (c === 'darkgray')
|
|
99
|
-
return {
|
|
100
|
-
color: 'white',
|
|
101
|
-
bg: 'gray.400',
|
|
102
|
-
_hover: { bg: 'gray.600' },
|
|
103
|
-
_active: { bg: 'gray.700' },
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const {
|
|
107
|
-
bg = `${c}.500`,
|
|
108
|
-
color = 'white',
|
|
109
|
-
hoverBg = `${c}.600`,
|
|
110
|
-
activeBg = `${c}.700`,
|
|
111
|
-
} = accessibleColorMap[c] || {};
|
|
112
|
-
const focusColor = getColor(theme, `${c}.200`);
|
|
113
|
-
return {
|
|
114
|
-
bg: mode(bg, `${c}.200`)(props),
|
|
115
|
-
color: mode(color, `gray.800`)(props),
|
|
116
|
-
_hover: { bg: mode(hoverBg, `${c}.300`)(props) },
|
|
117
|
-
_active: { bg: mode(activeBg, `${c}.400`)(props) },
|
|
118
51
|
_focus: {
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* A variant that displays a solid variant when an active CSS class is
|
|
126
|
-
* detected, otherwise display a ghost variant. This is useful for pill nav filters.
|
|
127
|
-
*/
|
|
128
|
-
function variantActiveSolid(props: Dict) {
|
|
129
|
-
return {
|
|
130
|
-
...variantGhost({ ...props, colorScheme: 'gray' }),
|
|
131
|
-
'&.active': {
|
|
132
|
-
...variantSolid(props),
|
|
52
|
+
bg: colors.label.primary.dark,
|
|
133
53
|
},
|
|
134
54
|
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function variantLink(props: Dict) {
|
|
138
|
-
const { colorScheme: c } = props;
|
|
139
|
-
return {
|
|
140
|
-
padding: 0,
|
|
141
|
-
height: 'auto',
|
|
142
|
-
lineHeight: 'normal',
|
|
143
|
-
color: mode(`${c}.500`, `${c}.200`)(props),
|
|
144
|
-
_hover: { textDecoration: 'underline' },
|
|
145
|
-
_active: {
|
|
146
|
-
color: mode(`${c}.700`, `${c}.500`)(props),
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const variantUnstyled = {
|
|
152
|
-
bg: 'none',
|
|
153
|
-
color: 'inherit',
|
|
154
|
-
display: 'inline',
|
|
155
|
-
lineHeight: 'inherit',
|
|
156
|
-
m: 0,
|
|
157
|
-
p: 0,
|
|
158
55
|
};
|
|
159
56
|
|
|
160
57
|
const variants = {
|
|
161
|
-
|
|
162
|
-
outline: variantOutline,
|
|
163
|
-
solid: variantSolid,
|
|
164
|
-
activeSolid: variantActiveSolid,
|
|
165
|
-
link: variantLink,
|
|
166
|
-
unstyled: variantUnstyled,
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const sizes = {
|
|
170
|
-
lg: {
|
|
171
|
-
borderRadius: 'full',
|
|
172
|
-
h: 12,
|
|
173
|
-
minW: 20,
|
|
174
|
-
fontSize: 'lg',
|
|
175
|
-
px: 6,
|
|
176
|
-
},
|
|
177
|
-
md: {
|
|
178
|
-
borderRadius: 'full',
|
|
179
|
-
h: 10,
|
|
180
|
-
minW: 20,
|
|
181
|
-
fontSize: 'md',
|
|
182
|
-
px: 4,
|
|
183
|
-
},
|
|
184
|
-
sm: {
|
|
185
|
-
borderRadius: 'full',
|
|
186
|
-
h: 8,
|
|
187
|
-
minW: 8,
|
|
188
|
-
fontSize: 'sm',
|
|
189
|
-
px: 3,
|
|
190
|
-
},
|
|
191
|
-
xs: {
|
|
192
|
-
borderRadius: 'full',
|
|
193
|
-
h: 6,
|
|
194
|
-
minW: 6,
|
|
195
|
-
fontSize: 'xs',
|
|
196
|
-
px: 2,
|
|
197
|
-
},
|
|
58
|
+
solid: variantSolid(),
|
|
59
|
+
outline: variantOutline(),
|
|
198
60
|
};
|
|
199
61
|
|
|
200
62
|
const defaultProps = {
|
|
201
|
-
|
|
202
|
-
size: 'md',
|
|
203
|
-
colorScheme: 'primary',
|
|
63
|
+
solid: 'solid',
|
|
204
64
|
};
|
|
205
65
|
|
|
206
66
|
export default {
|
|
207
67
|
baseStyle,
|
|
208
68
|
variants,
|
|
209
|
-
sizes,
|
|
210
69
|
defaultProps,
|
|
211
70
|
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
-
type Dict = Record<string, any>;
|
|
1
|
+
import colors from '../foundations/colors';
|
|
5
2
|
|
|
6
3
|
const parts = ['text', 'icon'];
|
|
7
4
|
|
|
8
|
-
function baseStyleText(
|
|
5
|
+
function baseStyleText() {
|
|
9
6
|
return {
|
|
10
|
-
color:
|
|
7
|
+
color: colors.label.error,
|
|
11
8
|
mt: 1,
|
|
12
|
-
|
|
13
|
-
fontSize: '
|
|
9
|
+
ml: 1,
|
|
10
|
+
fontSize: '13px',
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
13
|
|
|
17
|
-
function baseStyleIcon(
|
|
14
|
+
function baseStyleIcon() {
|
|
18
15
|
return {
|
|
19
|
-
|
|
20
|
-
color:
|
|
16
|
+
ml: 1,
|
|
17
|
+
color: colors.label.error,
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
const baseStyle = (
|
|
25
|
-
text: baseStyleText(
|
|
26
|
-
icon: baseStyleIcon(
|
|
21
|
+
const baseStyle = () => ({
|
|
22
|
+
text: baseStyleText(),
|
|
23
|
+
icon: baseStyleIcon(),
|
|
27
24
|
});
|
|
28
25
|
|
|
29
26
|
export default {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import colors from '../foundations/colors';
|
|
2
|
+
|
|
1
3
|
const baseStyle = {
|
|
2
|
-
fontSize: '
|
|
3
|
-
|
|
4
|
+
fontSize: '13px',
|
|
5
|
+
position: 'absolute',
|
|
6
|
+
top: 0,
|
|
7
|
+
display: 'flex',
|
|
8
|
+
ml: 1,
|
|
4
9
|
mb: 1,
|
|
5
|
-
|
|
6
|
-
color: 'gray.700',
|
|
7
|
-
transition: 'all 0.2s',
|
|
10
|
+
color: colors.label.primary.light,
|
|
8
11
|
opacity: 1,
|
|
9
|
-
_disabled: {
|
|
10
|
-
opacity: 0.4,
|
|
11
|
-
},
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default {
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
-
type Dict = Record<string, any>;
|
|
1
|
+
import colors from '../foundations/colors';
|
|
5
2
|
|
|
6
3
|
const parts = ['requiredIndicator', 'helperText'];
|
|
7
4
|
|
|
8
|
-
function baseStyleRequiredIndicator(
|
|
5
|
+
function baseStyleRequiredIndicator() {
|
|
9
6
|
return {
|
|
10
7
|
ml: 1,
|
|
11
|
-
color:
|
|
8
|
+
color: colors.label.error,
|
|
12
9
|
};
|
|
13
10
|
}
|
|
14
11
|
|
|
15
|
-
function baseStyleHelperText(
|
|
12
|
+
function baseStyleHelperText() {
|
|
16
13
|
return {
|
|
14
|
+
color: colors.label.secondary.light,
|
|
17
15
|
mt: 1,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
fontSize: 'sm',
|
|
16
|
+
ml: 1,
|
|
17
|
+
fontSize: '13px',
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
const baseStyle = (
|
|
25
|
-
requiredIndicator: baseStyleRequiredIndicator(
|
|
26
|
-
helperText: baseStyleHelperText(
|
|
21
|
+
const baseStyle = () => ({
|
|
22
|
+
requiredIndicator: baseStyleRequiredIndicator(),
|
|
23
|
+
helperText: baseStyleHelperText(),
|
|
27
24
|
});
|
|
28
25
|
|
|
29
26
|
export default {
|
|
@@ -1,213 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import colors from '../foundations/colors';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
type Dict = Record<string, any>;
|
|
5
|
-
|
|
6
|
-
const parts = ['field', 'addon'];
|
|
3
|
+
const parts = ['field'];
|
|
7
4
|
|
|
8
5
|
const baseStyle = {
|
|
9
6
|
field: {
|
|
10
|
-
|
|
11
|
-
outline: 0,
|
|
12
|
-
position: 'relative',
|
|
13
|
-
appearance: 'none',
|
|
14
|
-
transition: 'all 0.2s',
|
|
7
|
+
fontSize: '13px',
|
|
15
8
|
'::placeholder': {
|
|
16
|
-
color:
|
|
9
|
+
color: colors.label.secondary.light,
|
|
17
10
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
h: 12,
|
|
27
|
-
borderRadius: 'md',
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
md: {
|
|
31
|
-
fontSize: 'md',
|
|
32
|
-
pl: 3,
|
|
33
|
-
pr: 3,
|
|
34
|
-
h: 10,
|
|
35
|
-
borderRadius: 'md',
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
sm: {
|
|
39
|
-
fontSize: 'sm',
|
|
40
|
-
pl: 3,
|
|
41
|
-
pr: 3,
|
|
42
|
-
h: 8,
|
|
43
|
-
borderRadius: 'sm',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const sizes = {
|
|
48
|
-
lg: {
|
|
49
|
-
field: size.lg,
|
|
50
|
-
addon: size.lg,
|
|
51
|
-
},
|
|
52
|
-
md: {
|
|
53
|
-
field: size.md,
|
|
54
|
-
addon: size.md,
|
|
55
|
-
},
|
|
56
|
-
sm: {
|
|
57
|
-
field: size.sm,
|
|
58
|
-
addon: size.sm,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
function getDefaults(props: Dict) {
|
|
63
|
-
const { focusBorderColor: fc, errorBorderColor: ec } = props;
|
|
64
|
-
return {
|
|
65
|
-
focusBorderColor: fc || mode('blue.500', 'blue.300')(props),
|
|
66
|
-
errorBorderColor: ec || mode('red.500', 'red.300')(props),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function variantOutline(props: Dict) {
|
|
71
|
-
const { theme } = props;
|
|
72
|
-
const { focusBorderColor: fc, errorBorderColor: ec } = getDefaults(props);
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
field: {
|
|
76
|
-
border: '1px solid',
|
|
77
|
-
borderColor: 'inherit',
|
|
78
|
-
bg: 'white',
|
|
79
|
-
_hover: {
|
|
80
|
-
borderColor: mode('gray.300', 'whiteAlpha.400')(props),
|
|
81
|
-
},
|
|
82
|
-
_readOnly: {
|
|
83
|
-
boxShadow: 'none !important',
|
|
84
|
-
userSelect: 'all',
|
|
85
|
-
},
|
|
86
|
-
_disabled: {
|
|
87
|
-
opacity: 0.4,
|
|
88
|
-
cursor: 'not-allowed',
|
|
89
|
-
},
|
|
90
|
-
_focus: {
|
|
91
|
-
zIndex: 1,
|
|
92
|
-
borderColor: getColor(theme, fc),
|
|
93
|
-
boxShadow: `0 0 0 2px ${transparentize(fc, 0.3)(theme)}`,
|
|
94
|
-
},
|
|
95
|
-
_invalid: {
|
|
96
|
-
borderColor: getColor(theme, ec),
|
|
97
|
-
boxShadow: 'none',
|
|
98
|
-
_focus: {
|
|
99
|
-
boxShadow: `0 0 0 2px ${transparentize(ec, 0.3)(theme)}`,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
addon: {
|
|
104
|
-
border: '1px solid',
|
|
105
|
-
borderColor: mode('inherit', 'whiteAlpha.50')(props),
|
|
106
|
-
bg: mode('gray.100', 'whiteAlpha.300')(props),
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function variantFilled(props: Dict) {
|
|
112
|
-
const { theme } = props;
|
|
113
|
-
const { focusBorderColor: fc, errorBorderColor: ec } = getDefaults(props);
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
field: {
|
|
117
|
-
border: '2px solid',
|
|
118
|
-
borderColor: 'transparent',
|
|
119
|
-
bg: mode('gray.50', 'whiteAlpha.50')(props),
|
|
120
|
-
_hover: {
|
|
121
|
-
bg: mode('gray.100', 'whiteAlpha.100')(props),
|
|
122
|
-
},
|
|
123
|
-
_readOnly: {
|
|
124
|
-
boxShadow: 'none !important',
|
|
125
|
-
userSelect: 'all',
|
|
126
|
-
},
|
|
127
|
-
_disabled: {
|
|
128
|
-
opacity: 0.4,
|
|
129
|
-
cursor: 'not-allowed',
|
|
130
|
-
},
|
|
131
|
-
_focus: {
|
|
132
|
-
bg: 'transparent',
|
|
133
|
-
borderColor: getColor(theme, fc),
|
|
134
|
-
},
|
|
135
|
-
_invalid: {
|
|
136
|
-
borderColor: getColor(theme, ec),
|
|
137
|
-
},
|
|
11
|
+
py: '5px',
|
|
12
|
+
px: '8px',
|
|
13
|
+
border: '1px solid',
|
|
14
|
+
borderColor: colors.border.default,
|
|
15
|
+
_disabled: {
|
|
16
|
+
cursor: 'not-allowed',
|
|
17
|
+
bg: colors.fill.light.quaternary,
|
|
18
|
+
color: colors.label.secondary.light,
|
|
138
19
|
},
|
|
139
|
-
|
|
20
|
+
_focus: {
|
|
21
|
+
bg: '#ffffff',
|
|
140
22
|
border: '2px solid',
|
|
141
|
-
borderColor:
|
|
142
|
-
bg: mode('gray.100', 'whiteAlpha.50')(props),
|
|
23
|
+
borderColor: colors.border.focus,
|
|
143
24
|
},
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function variantFlushed(props: Dict) {
|
|
148
|
-
const { theme } = props;
|
|
149
|
-
const { focusBorderColor: fc, errorBorderColor: ec } = getDefaults(props);
|
|
150
|
-
|
|
151
|
-
return {
|
|
152
|
-
field: {
|
|
153
|
-
borderBottom: '1px solid inherit',
|
|
154
|
-
borderRadius: 0,
|
|
155
|
-
pl: 0,
|
|
156
|
-
pr: 0,
|
|
157
|
-
bg: 'transparent',
|
|
158
|
-
_readOnly: {
|
|
159
|
-
boxShadow: 'none !important',
|
|
160
|
-
userSelect: 'all',
|
|
161
|
-
},
|
|
162
|
-
_focus: {
|
|
163
|
-
borderColor: getColor(theme, fc),
|
|
164
|
-
boxShadow: `0px 1px 0px 0px ${getColor(theme, fc)}`,
|
|
165
|
-
},
|
|
166
|
-
_invalid: {
|
|
167
|
-
borderColor: getColor(theme, ec),
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
addon: {
|
|
171
|
-
borderBottom: '2px solid',
|
|
172
|
-
borderColor: 'inherit',
|
|
173
|
-
borderRadius: 0,
|
|
174
|
-
paddingX: 0,
|
|
175
|
-
bg: 'transparent',
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const variantUnstyled = {
|
|
181
|
-
field: {
|
|
182
|
-
bg: 'transparent',
|
|
183
|
-
pl: 0,
|
|
184
|
-
pr: 0,
|
|
185
|
-
height: 'auto',
|
|
186
|
-
},
|
|
187
|
-
addon: {
|
|
188
|
-
bg: 'transparent',
|
|
189
|
-
pl: 0,
|
|
190
|
-
pr: 0,
|
|
191
|
-
height: 'auto',
|
|
192
25
|
},
|
|
193
26
|
};
|
|
194
27
|
|
|
195
|
-
const variants = {
|
|
196
|
-
outline: variantOutline,
|
|
197
|
-
filled: variantFilled,
|
|
198
|
-
flushed: variantFlushed,
|
|
199
|
-
unstyled: variantUnstyled,
|
|
200
|
-
};
|
|
28
|
+
const variants = { default: baseStyle };
|
|
201
29
|
|
|
202
30
|
const defaultProps = {
|
|
203
|
-
|
|
204
|
-
variant: 'outline',
|
|
31
|
+
variant: 'default',
|
|
205
32
|
};
|
|
206
33
|
|
|
207
34
|
export default {
|
|
208
35
|
parts,
|
|
209
36
|
baseStyle,
|
|
210
|
-
sizes,
|
|
211
37
|
variants,
|
|
212
38
|
defaultProps,
|
|
213
39
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getColor } from '@chakra-ui/theme-tools';
|
|
2
|
+
import colors from '../foundations/colors';
|
|
2
3
|
|
|
3
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
5
|
type Dict = Record<string, any>;
|
|
5
6
|
|
|
6
7
|
const baseStyle = {
|
|
7
|
-
color:
|
|
8
|
+
color: colors.fill.action,
|
|
8
9
|
textDecoration: 'underline',
|
|
9
10
|
transition: 'none',
|
|
10
11
|
_hover: {
|