@tidbcloud/uikit 2.0.0-beta.35 → 2.0.0-beta.36
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/CHANGELOG.md +6 -0
- package/dist/primitive/TextInput/TextInput.cjs +11 -1
- package/dist/primitive/TextInput/TextInput.js +11 -1
- package/dist/theme/theme.cjs +86 -56
- package/dist/theme/theme.js +86 -56
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ const index = require("../Typography/index.cjs");
|
|
|
7
7
|
const TextInput$1 = require("../../node_modules/.pnpm/@mantine_core@5.10.4_patch_hash_k3wzpm5n4esvq7igbvcsgyfoja_@emotion_react@11.13.0_@mantine_ho_u2jurujayhgo5kjqawpkatsdsi/node_modules/@mantine/core/esm/TextInput/TextInput.cjs");
|
|
8
8
|
const TextInput = React.forwardRef((props, ref) => {
|
|
9
9
|
const { leftLabel, icon, ...rest } = props;
|
|
10
|
+
const prefixFontSizes = {
|
|
11
|
+
xs: 12,
|
|
12
|
+
sm: 13,
|
|
13
|
+
md: 14,
|
|
14
|
+
lg: 14,
|
|
15
|
+
xl: 16
|
|
16
|
+
};
|
|
10
17
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
11
18
|
TextInput$1.TextInput,
|
|
12
19
|
{
|
|
@@ -29,7 +36,10 @@ const TextInput = React.forwardRef((props, ref) => {
|
|
|
29
36
|
paddingRight: 12,
|
|
30
37
|
borderTopLeftRadius: theme.defaultRadius,
|
|
31
38
|
borderBottomLeftRadius: theme.defaultRadius,
|
|
32
|
-
backgroundColor: theme.colors.carbon[2]
|
|
39
|
+
backgroundColor: theme.colors.carbon[2],
|
|
40
|
+
"& > .mantine-Text-root": {
|
|
41
|
+
fontSize: theme.fn.size({ sizes: prefixFontSizes, size: props.size ?? "md" })
|
|
42
|
+
}
|
|
33
43
|
},
|
|
34
44
|
input: {
|
|
35
45
|
flex: 1,
|
|
@@ -5,6 +5,13 @@ import { Typography } from "../Typography/index.js";
|
|
|
5
5
|
import { TextInput as TextInput$1 } from "../../node_modules/.pnpm/@mantine_core@5.10.4_patch_hash_k3wzpm5n4esvq7igbvcsgyfoja_@emotion_react@11.13.0_@mantine_ho_u2jurujayhgo5kjqawpkatsdsi/node_modules/@mantine/core/esm/TextInput/TextInput.js";
|
|
6
6
|
const TextInput = forwardRef((props, ref) => {
|
|
7
7
|
const { leftLabel, icon, ...rest } = props;
|
|
8
|
+
const prefixFontSizes = {
|
|
9
|
+
xs: 12,
|
|
10
|
+
sm: 13,
|
|
11
|
+
md: 14,
|
|
12
|
+
lg: 14,
|
|
13
|
+
xl: 16
|
|
14
|
+
};
|
|
8
15
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9
16
|
TextInput$1,
|
|
10
17
|
{
|
|
@@ -27,7 +34,10 @@ const TextInput = forwardRef((props, ref) => {
|
|
|
27
34
|
paddingRight: 12,
|
|
28
35
|
borderTopLeftRadius: theme.defaultRadius,
|
|
29
36
|
borderBottomLeftRadius: theme.defaultRadius,
|
|
30
|
-
backgroundColor: theme.colors.carbon[2]
|
|
37
|
+
backgroundColor: theme.colors.carbon[2],
|
|
38
|
+
"& > .mantine-Text-root": {
|
|
39
|
+
fontSize: theme.fn.size({ sizes: prefixFontSizes, size: props.size ?? "md" })
|
|
40
|
+
}
|
|
31
41
|
},
|
|
32
42
|
input: {
|
|
33
43
|
flex: 1,
|
package/dist/theme/theme.cjs
CHANGED
|
@@ -129,51 +129,58 @@ const getButtonStyles = (theme2, params) => {
|
|
|
129
129
|
return finalStyles;
|
|
130
130
|
};
|
|
131
131
|
const getInputStyles = (theme2, params) => {
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
const sizes = {
|
|
133
|
+
xl: 48,
|
|
134
|
+
lg: 44,
|
|
135
|
+
md: 40,
|
|
136
|
+
sm: 32,
|
|
137
|
+
xs: 28
|
|
136
138
|
};
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
...inputStyle,
|
|
144
|
-
// This is for PasswordInput, is has different dom structure with normal input
|
|
145
|
-
// FIXME innerInput is not working in current v5.10.4, use that key after upgrade mantine
|
|
146
|
-
"& .mantine-PasswordInput-innerInput": inputStyle
|
|
147
|
-
}
|
|
148
|
-
}
|
|
139
|
+
const fontSizes = {
|
|
140
|
+
xl: 16,
|
|
141
|
+
lg: 14,
|
|
142
|
+
md: 14,
|
|
143
|
+
sm: 13,
|
|
144
|
+
xs: 12
|
|
149
145
|
};
|
|
150
|
-
const
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
146
|
+
const size = theme2.fn.size({ size: params.size ?? "md", sizes });
|
|
147
|
+
const inputFontSize = theme2.fn.size({ size: params.size ?? "md", sizes: fontSizes });
|
|
148
|
+
const inputSize = {
|
|
149
|
+
height: size,
|
|
150
|
+
minHeight: size,
|
|
151
|
+
lineHeight: `${size - 2}px`,
|
|
152
|
+
fontSize: inputFontSize
|
|
153
|
+
};
|
|
154
|
+
const passwordInnerInputSize = {
|
|
155
|
+
height: size - 2,
|
|
156
|
+
minHeight: size - 2,
|
|
157
|
+
lineHeight: `${size - 2}px`,
|
|
158
|
+
fontSize: inputFontSize
|
|
156
159
|
};
|
|
157
160
|
return {
|
|
158
161
|
label: {
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
color: theme2.colors.carbon[8],
|
|
163
|
+
marginBottom: 6,
|
|
164
|
+
lineHeight: "20px",
|
|
165
|
+
fontSize: 14
|
|
161
166
|
},
|
|
162
167
|
description: {
|
|
163
|
-
color: theme2.colors.carbon[7]
|
|
168
|
+
color: theme2.colors.carbon[7],
|
|
169
|
+
fontSize: 12
|
|
164
170
|
},
|
|
165
171
|
input: {
|
|
166
|
-
...
|
|
172
|
+
...inputSize,
|
|
167
173
|
color: theme2.colors.carbon[8],
|
|
168
174
|
border: `1px solid ${theme2.colors.carbon[4]}`,
|
|
169
175
|
backgroundColor: theme2.colors.carbon[0],
|
|
170
|
-
"&:hover
|
|
176
|
+
"&:hover": {
|
|
171
177
|
borderColor: theme2.colors.carbon[5]
|
|
172
178
|
},
|
|
173
|
-
"&:focus": {
|
|
179
|
+
"&:focus, &:focus-within": {
|
|
174
180
|
borderColor: theme2.colors.carbon[9]
|
|
175
181
|
},
|
|
176
182
|
"&:disabled": {
|
|
183
|
+
borderColor: theme2.colors.carbon[4],
|
|
177
184
|
backgroundColor: theme2.colors.carbon[2],
|
|
178
185
|
color: theme2.colors.carbon[8],
|
|
179
186
|
opacity: 1
|
|
@@ -182,7 +189,7 @@ const getInputStyles = (theme2, params) => {
|
|
|
182
189
|
color: theme2.colors.carbon[6]
|
|
183
190
|
},
|
|
184
191
|
"& .mantine-PasswordInput-innerInput": {
|
|
185
|
-
...
|
|
192
|
+
...passwordInnerInputSize,
|
|
186
193
|
"&::placeholder": {
|
|
187
194
|
color: theme2.colors.carbon[6]
|
|
188
195
|
}
|
|
@@ -477,31 +484,23 @@ const theme = {
|
|
|
477
484
|
defaultProps: {
|
|
478
485
|
transition: "fade",
|
|
479
486
|
transitionDuration: 200,
|
|
480
|
-
transitionTimingFunction: "ease"
|
|
487
|
+
transitionTimingFunction: "ease",
|
|
488
|
+
size: "md"
|
|
481
489
|
},
|
|
482
490
|
styles: (theme2, params) => {
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
label: {
|
|
486
|
-
lineHeight: "20px"
|
|
487
|
-
},
|
|
488
|
-
input: {
|
|
489
|
-
height: 40,
|
|
490
|
-
minHeight: 40,
|
|
491
|
-
lineHeight: "38px"
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
};
|
|
495
|
-
const matches = diffSizeStyles[params.size] || { label: {}, input: {} };
|
|
491
|
+
const styles = getInputStyles(theme2, { size: params.size });
|
|
492
|
+
const height = styles.input.height;
|
|
496
493
|
return {
|
|
497
494
|
label: {
|
|
498
|
-
|
|
495
|
+
lineHeight: "20px",
|
|
496
|
+
marginBottom: 6
|
|
499
497
|
},
|
|
500
498
|
description: {
|
|
501
499
|
color: theme2.colors.carbon[7]
|
|
502
500
|
},
|
|
503
501
|
input: {
|
|
504
|
-
|
|
502
|
+
height,
|
|
503
|
+
minHeight: height,
|
|
505
504
|
color: theme2.colors.carbon[8],
|
|
506
505
|
...params.variant === "unstyled" && {
|
|
507
506
|
border: "none",
|
|
@@ -535,6 +534,9 @@ const theme = {
|
|
|
535
534
|
}
|
|
536
535
|
},
|
|
537
536
|
rightSection: {
|
|
537
|
+
"& .mantine-ActionIcon-root": {
|
|
538
|
+
color: `${theme2.colors.carbon[7]} !important`
|
|
539
|
+
},
|
|
538
540
|
"& [data-chevron]": {
|
|
539
541
|
color: `${theme2.colors.carbon[7]} !important`
|
|
540
542
|
}
|
|
@@ -543,34 +545,62 @@ const theme = {
|
|
|
543
545
|
}
|
|
544
546
|
},
|
|
545
547
|
MultiSelect: {
|
|
548
|
+
defaultProps: {
|
|
549
|
+
size: "md",
|
|
550
|
+
transition: "fade",
|
|
551
|
+
transitionDuration: 200,
|
|
552
|
+
transitionTimingFunction: "ease"
|
|
553
|
+
},
|
|
546
554
|
styles: (theme2, params) => {
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
values: {
|
|
550
|
-
height: 38,
|
|
551
|
-
minHeight: 38,
|
|
552
|
-
lineHeight: "38px"
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
const matches = diffSizeStyles[params.size] || { values: {} };
|
|
555
|
+
const styles = getInputStyles(theme2, { size: params.size });
|
|
556
|
+
const inputHeight = styles.input.height;
|
|
557
557
|
return {
|
|
558
|
+
label: {
|
|
559
|
+
fontSize: 14,
|
|
560
|
+
marginBottom: 6
|
|
561
|
+
},
|
|
562
|
+
wrapper: {
|
|
563
|
+
height: inputHeight + 2
|
|
564
|
+
},
|
|
558
565
|
values: {
|
|
559
|
-
|
|
566
|
+
height: inputHeight - 2,
|
|
567
|
+
minHeight: inputHeight - 2
|
|
568
|
+
},
|
|
569
|
+
value: {
|
|
570
|
+
height: inputHeight - 12,
|
|
571
|
+
backgroundColor: theme2.colors.carbon[3],
|
|
572
|
+
color: theme2.colors.carbon[8]
|
|
573
|
+
},
|
|
574
|
+
rightSection: {
|
|
575
|
+
"& [data-chevron]": {
|
|
576
|
+
color: `${theme2.colors.carbon[7]} !important`
|
|
577
|
+
}
|
|
560
578
|
}
|
|
561
579
|
};
|
|
562
580
|
}
|
|
563
581
|
},
|
|
564
582
|
Input: {
|
|
583
|
+
defaultProps: {
|
|
584
|
+
size: "md"
|
|
585
|
+
},
|
|
565
586
|
styles: getInputStyles
|
|
566
587
|
},
|
|
567
588
|
TextInput: {
|
|
589
|
+
defaultProps: {
|
|
590
|
+
size: "md"
|
|
591
|
+
},
|
|
568
592
|
styles: getInputStyles
|
|
569
593
|
},
|
|
570
594
|
PasswordInput: {
|
|
595
|
+
defaultProps: {
|
|
596
|
+
size: "md"
|
|
597
|
+
},
|
|
571
598
|
styles: getInputStyles
|
|
572
599
|
},
|
|
573
600
|
NumberInput: {
|
|
601
|
+
defaultProps: {
|
|
602
|
+
size: "md"
|
|
603
|
+
},
|
|
574
604
|
styles: getInputStyles
|
|
575
605
|
},
|
|
576
606
|
Textarea: {
|
package/dist/theme/theme.js
CHANGED
|
@@ -127,51 +127,58 @@ const getButtonStyles = (theme2, params) => {
|
|
|
127
127
|
return finalStyles;
|
|
128
128
|
};
|
|
129
129
|
const getInputStyles = (theme2, params) => {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
const sizes = {
|
|
131
|
+
xl: 48,
|
|
132
|
+
lg: 44,
|
|
133
|
+
md: 40,
|
|
134
|
+
sm: 32,
|
|
135
|
+
xs: 28
|
|
134
136
|
};
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
...inputStyle,
|
|
142
|
-
// This is for PasswordInput, is has different dom structure with normal input
|
|
143
|
-
// FIXME innerInput is not working in current v5.10.4, use that key after upgrade mantine
|
|
144
|
-
"& .mantine-PasswordInput-innerInput": inputStyle
|
|
145
|
-
}
|
|
146
|
-
}
|
|
137
|
+
const fontSizes = {
|
|
138
|
+
xl: 16,
|
|
139
|
+
lg: 14,
|
|
140
|
+
md: 14,
|
|
141
|
+
sm: 13,
|
|
142
|
+
xs: 12
|
|
147
143
|
};
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
144
|
+
const size = theme2.fn.size({ size: params.size ?? "md", sizes });
|
|
145
|
+
const inputFontSize = theme2.fn.size({ size: params.size ?? "md", sizes: fontSizes });
|
|
146
|
+
const inputSize = {
|
|
147
|
+
height: size,
|
|
148
|
+
minHeight: size,
|
|
149
|
+
lineHeight: `${size - 2}px`,
|
|
150
|
+
fontSize: inputFontSize
|
|
151
|
+
};
|
|
152
|
+
const passwordInnerInputSize = {
|
|
153
|
+
height: size - 2,
|
|
154
|
+
minHeight: size - 2,
|
|
155
|
+
lineHeight: `${size - 2}px`,
|
|
156
|
+
fontSize: inputFontSize
|
|
154
157
|
};
|
|
155
158
|
return {
|
|
156
159
|
label: {
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
color: theme2.colors.carbon[8],
|
|
161
|
+
marginBottom: 6,
|
|
162
|
+
lineHeight: "20px",
|
|
163
|
+
fontSize: 14
|
|
159
164
|
},
|
|
160
165
|
description: {
|
|
161
|
-
color: theme2.colors.carbon[7]
|
|
166
|
+
color: theme2.colors.carbon[7],
|
|
167
|
+
fontSize: 12
|
|
162
168
|
},
|
|
163
169
|
input: {
|
|
164
|
-
...
|
|
170
|
+
...inputSize,
|
|
165
171
|
color: theme2.colors.carbon[8],
|
|
166
172
|
border: `1px solid ${theme2.colors.carbon[4]}`,
|
|
167
173
|
backgroundColor: theme2.colors.carbon[0],
|
|
168
|
-
"&:hover
|
|
174
|
+
"&:hover": {
|
|
169
175
|
borderColor: theme2.colors.carbon[5]
|
|
170
176
|
},
|
|
171
|
-
"&:focus": {
|
|
177
|
+
"&:focus, &:focus-within": {
|
|
172
178
|
borderColor: theme2.colors.carbon[9]
|
|
173
179
|
},
|
|
174
180
|
"&:disabled": {
|
|
181
|
+
borderColor: theme2.colors.carbon[4],
|
|
175
182
|
backgroundColor: theme2.colors.carbon[2],
|
|
176
183
|
color: theme2.colors.carbon[8],
|
|
177
184
|
opacity: 1
|
|
@@ -180,7 +187,7 @@ const getInputStyles = (theme2, params) => {
|
|
|
180
187
|
color: theme2.colors.carbon[6]
|
|
181
188
|
},
|
|
182
189
|
"& .mantine-PasswordInput-innerInput": {
|
|
183
|
-
...
|
|
190
|
+
...passwordInnerInputSize,
|
|
184
191
|
"&::placeholder": {
|
|
185
192
|
color: theme2.colors.carbon[6]
|
|
186
193
|
}
|
|
@@ -475,31 +482,23 @@ const theme = {
|
|
|
475
482
|
defaultProps: {
|
|
476
483
|
transition: "fade",
|
|
477
484
|
transitionDuration: 200,
|
|
478
|
-
transitionTimingFunction: "ease"
|
|
485
|
+
transitionTimingFunction: "ease",
|
|
486
|
+
size: "md"
|
|
479
487
|
},
|
|
480
488
|
styles: (theme2, params) => {
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
label: {
|
|
484
|
-
lineHeight: "20px"
|
|
485
|
-
},
|
|
486
|
-
input: {
|
|
487
|
-
height: 40,
|
|
488
|
-
minHeight: 40,
|
|
489
|
-
lineHeight: "38px"
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
const matches = diffSizeStyles[params.size] || { label: {}, input: {} };
|
|
489
|
+
const styles = getInputStyles(theme2, { size: params.size });
|
|
490
|
+
const height = styles.input.height;
|
|
494
491
|
return {
|
|
495
492
|
label: {
|
|
496
|
-
|
|
493
|
+
lineHeight: "20px",
|
|
494
|
+
marginBottom: 6
|
|
497
495
|
},
|
|
498
496
|
description: {
|
|
499
497
|
color: theme2.colors.carbon[7]
|
|
500
498
|
},
|
|
501
499
|
input: {
|
|
502
|
-
|
|
500
|
+
height,
|
|
501
|
+
minHeight: height,
|
|
503
502
|
color: theme2.colors.carbon[8],
|
|
504
503
|
...params.variant === "unstyled" && {
|
|
505
504
|
border: "none",
|
|
@@ -533,6 +532,9 @@ const theme = {
|
|
|
533
532
|
}
|
|
534
533
|
},
|
|
535
534
|
rightSection: {
|
|
535
|
+
"& .mantine-ActionIcon-root": {
|
|
536
|
+
color: `${theme2.colors.carbon[7]} !important`
|
|
537
|
+
},
|
|
536
538
|
"& [data-chevron]": {
|
|
537
539
|
color: `${theme2.colors.carbon[7]} !important`
|
|
538
540
|
}
|
|
@@ -541,34 +543,62 @@ const theme = {
|
|
|
541
543
|
}
|
|
542
544
|
},
|
|
543
545
|
MultiSelect: {
|
|
546
|
+
defaultProps: {
|
|
547
|
+
size: "md",
|
|
548
|
+
transition: "fade",
|
|
549
|
+
transitionDuration: 200,
|
|
550
|
+
transitionTimingFunction: "ease"
|
|
551
|
+
},
|
|
544
552
|
styles: (theme2, params) => {
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
values: {
|
|
548
|
-
height: 38,
|
|
549
|
-
minHeight: 38,
|
|
550
|
-
lineHeight: "38px"
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
const matches = diffSizeStyles[params.size] || { values: {} };
|
|
553
|
+
const styles = getInputStyles(theme2, { size: params.size });
|
|
554
|
+
const inputHeight = styles.input.height;
|
|
555
555
|
return {
|
|
556
|
+
label: {
|
|
557
|
+
fontSize: 14,
|
|
558
|
+
marginBottom: 6
|
|
559
|
+
},
|
|
560
|
+
wrapper: {
|
|
561
|
+
height: inputHeight + 2
|
|
562
|
+
},
|
|
556
563
|
values: {
|
|
557
|
-
|
|
564
|
+
height: inputHeight - 2,
|
|
565
|
+
minHeight: inputHeight - 2
|
|
566
|
+
},
|
|
567
|
+
value: {
|
|
568
|
+
height: inputHeight - 12,
|
|
569
|
+
backgroundColor: theme2.colors.carbon[3],
|
|
570
|
+
color: theme2.colors.carbon[8]
|
|
571
|
+
},
|
|
572
|
+
rightSection: {
|
|
573
|
+
"& [data-chevron]": {
|
|
574
|
+
color: `${theme2.colors.carbon[7]} !important`
|
|
575
|
+
}
|
|
558
576
|
}
|
|
559
577
|
};
|
|
560
578
|
}
|
|
561
579
|
},
|
|
562
580
|
Input: {
|
|
581
|
+
defaultProps: {
|
|
582
|
+
size: "md"
|
|
583
|
+
},
|
|
563
584
|
styles: getInputStyles
|
|
564
585
|
},
|
|
565
586
|
TextInput: {
|
|
587
|
+
defaultProps: {
|
|
588
|
+
size: "md"
|
|
589
|
+
},
|
|
566
590
|
styles: getInputStyles
|
|
567
591
|
},
|
|
568
592
|
PasswordInput: {
|
|
593
|
+
defaultProps: {
|
|
594
|
+
size: "md"
|
|
595
|
+
},
|
|
569
596
|
styles: getInputStyles
|
|
570
597
|
},
|
|
571
598
|
NumberInput: {
|
|
599
|
+
defaultProps: {
|
|
600
|
+
size: "md"
|
|
601
|
+
},
|
|
572
602
|
styles: getInputStyles
|
|
573
603
|
},
|
|
574
604
|
Textarea: {
|