@oceanbase/design 1.0.0-alpha.4 → 1.0.0-alpha.6
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/design.min.css +1 -1
- package/dist/design.min.js +1 -1
- package/dist/reset.css +2 -1
- package/es/alert/index.js +3 -0
- package/es/alert/style/index.js +21 -22
- package/es/button/style/index.js +10 -2
- package/es/card/style/index.js +7 -5
- package/es/checkbox/style/index.js +4 -2
- package/es/config-provider/index.d.ts +2 -1
- package/es/config-provider/index.js +41 -16
- package/es/descriptions/style/index.js +3 -2
- package/es/drawer/style/index.js +7 -5
- package/es/empty/style/index.js +6 -4
- package/es/form/FormItem.d.ts +1 -1
- package/es/form/style/index.js +3 -2
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/modal/style/index.js +7 -6
- package/es/radio/style/index.js +4 -2
- package/es/slider/style/index.js +7 -5
- package/es/spin/style/index.js +14 -11
- package/es/style/global.d.ts +5 -0
- package/es/style/global.js +62 -0
- package/es/style/reset.css +2 -1
- package/es/table/style/index.js +17 -16
- package/es/theme/compact.d.ts +1 -1
- package/es/theme/compact.js +2 -6
- package/es/theme/default.js +28 -9
- package/es/typography/style/index.js +25 -20
- package/lib/alert/index.js +2 -0
- package/lib/alert/style/index.js +18 -19
- package/lib/button/style/index.js +8 -2
- package/lib/card/style/index.js +6 -5
- package/lib/checkbox/style/index.js +3 -2
- package/lib/config-provider/index.d.ts +2 -1
- package/lib/config-provider/index.js +60 -12
- package/lib/descriptions/style/index.js +2 -2
- package/lib/drawer/style/index.js +6 -5
- package/lib/empty/style/index.js +5 -4
- package/lib/form/FormItem.d.ts +1 -1
- package/lib/form/style/index.js +2 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/modal/style/index.js +7 -6
- package/lib/radio/style/index.js +3 -2
- package/lib/slider/style/index.js +6 -5
- package/lib/spin/style/index.js +12 -11
- package/lib/style/global.d.ts +5 -0
- package/lib/style/global.js +101 -0
- package/lib/style/reset.css +2 -1
- package/lib/table/style/index.js +17 -16
- package/lib/theme/compact.d.ts +1 -1
- package/lib/theme/compact.js +1 -5
- package/lib/theme/default.js +28 -9
- package/lib/typography/style/index.js +24 -20
- package/package.json +2 -3
- package/es/global.css +0 -48
- package/lib/global.css +0 -48
package/lib/theme/compact.js
CHANGED
|
@@ -32,13 +32,9 @@ __export(compact_exports, {
|
|
|
32
32
|
default: () => compact_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(compact_exports);
|
|
35
|
-
var import_antd = require("antd");
|
|
36
35
|
var import_index = __toESM(require("./index"));
|
|
37
36
|
var compactTheme = {
|
|
38
|
-
token:
|
|
39
|
-
algorithm: import_antd.theme.compactAlgorithm,
|
|
40
|
-
token: import_index.default.defaultSeed
|
|
41
|
-
}),
|
|
37
|
+
token: import_index.default.defaultSeed,
|
|
42
38
|
components: {
|
|
43
39
|
InputNumber: {
|
|
44
40
|
handleVisible: true
|
package/lib/theme/default.js
CHANGED
|
@@ -40,6 +40,9 @@ var colorFillQuaternary = "#F5F7FC";
|
|
|
40
40
|
var colorBorderSecondary = colorFillSecondary;
|
|
41
41
|
var fontSizeSM = 12;
|
|
42
42
|
var tagColorBorder = colorTextQuaternary;
|
|
43
|
+
var borderRadius = 4;
|
|
44
|
+
var borderRadiusMD = 6;
|
|
45
|
+
var borderRadiusLG = 8;
|
|
43
46
|
var fontFamilyEn = `Inter, 'Noto sans', sans-serif, Roboto, 'Open Sans', 'Segoe UI', 'Helvetica Neue', 'Helvetica, Arial', 'Apple Color Emoji'`;
|
|
44
47
|
var fontWeightWeakEn = 400;
|
|
45
48
|
var fontWeightEn = 500;
|
|
@@ -52,9 +55,9 @@ var defaultTheme = {
|
|
|
52
55
|
fontWeight: 400,
|
|
53
56
|
fontWeightStrong: 500,
|
|
54
57
|
borderRadiusSM: 2,
|
|
55
|
-
borderRadius
|
|
56
|
-
borderRadiusMD
|
|
57
|
-
borderRadiusLG
|
|
58
|
+
borderRadius,
|
|
59
|
+
borderRadiusMD,
|
|
60
|
+
borderRadiusLG,
|
|
58
61
|
fontSizeSM,
|
|
59
62
|
fontSize: 13,
|
|
60
63
|
lineHeight: 20 / 13,
|
|
@@ -118,7 +121,7 @@ var defaultTheme = {
|
|
|
118
121
|
},
|
|
119
122
|
components: {
|
|
120
123
|
Alert: {
|
|
121
|
-
borderRadiusLG:
|
|
124
|
+
borderRadiusLG: borderRadiusMD
|
|
122
125
|
},
|
|
123
126
|
Badge: {
|
|
124
127
|
statusSize: 8
|
|
@@ -139,16 +142,29 @@ var defaultTheme = {
|
|
|
139
142
|
},
|
|
140
143
|
Card: {
|
|
141
144
|
headerFontSize: 16,
|
|
142
|
-
borderRadiusLG
|
|
145
|
+
borderRadiusLG
|
|
143
146
|
},
|
|
144
147
|
Collapse: {
|
|
145
148
|
colorBorder: colorBorderSecondary
|
|
146
149
|
},
|
|
150
|
+
DatePicker: {
|
|
151
|
+
borderRadiusLG: borderRadiusMD
|
|
152
|
+
},
|
|
147
153
|
Descriptions: {
|
|
148
154
|
labelColor: colorTextSecondary
|
|
149
155
|
},
|
|
156
|
+
Dropdown: {
|
|
157
|
+
borderRadiusLG: borderRadiusMD
|
|
158
|
+
},
|
|
159
|
+
Input: {
|
|
160
|
+
borderRadiusLG: borderRadiusMD
|
|
161
|
+
},
|
|
150
162
|
InputNumber: {
|
|
151
|
-
handleVisible: true
|
|
163
|
+
handleVisible: true,
|
|
164
|
+
borderRadiusLG: borderRadiusMD
|
|
165
|
+
},
|
|
166
|
+
Popover: {
|
|
167
|
+
borderRadiusLG: borderRadiusMD
|
|
152
168
|
},
|
|
153
169
|
Progress: {
|
|
154
170
|
defaultColor: colorPrimarySecondary
|
|
@@ -162,6 +178,7 @@ var defaultTheme = {
|
|
|
162
178
|
},
|
|
163
179
|
Select: {
|
|
164
180
|
// work for all multiple select component, including Select, TreeSelect and Cascader and so on
|
|
181
|
+
borderRadiusLG: borderRadiusMD,
|
|
165
182
|
multipleItemBg: colorFillQuaternary,
|
|
166
183
|
multipleItemBorderColor: tagColorBorder,
|
|
167
184
|
multipleItemBorderColorDisabled: tagColorBorder
|
|
@@ -175,7 +192,7 @@ var defaultTheme = {
|
|
|
175
192
|
handleColorDisabled: "#b3ccff"
|
|
176
193
|
},
|
|
177
194
|
Skeleton: {
|
|
178
|
-
blockRadius:
|
|
195
|
+
blockRadius: borderRadius
|
|
179
196
|
},
|
|
180
197
|
Tabs: {
|
|
181
198
|
horizontalItemGutter: 24,
|
|
@@ -185,7 +202,7 @@ var defaultTheme = {
|
|
|
185
202
|
},
|
|
186
203
|
Tag: {
|
|
187
204
|
colorBorder: tagColorBorder,
|
|
188
|
-
borderRadiusSM:
|
|
205
|
+
borderRadiusSM: borderRadius
|
|
189
206
|
},
|
|
190
207
|
Table: {
|
|
191
208
|
cellFontSize: fontSizeSM,
|
|
@@ -199,13 +216,15 @@ var defaultTheme = {
|
|
|
199
216
|
rowSelectedHoverBg: colorFillTertiary
|
|
200
217
|
},
|
|
201
218
|
Tooltip: {
|
|
219
|
+
borderRadius: borderRadiusMD,
|
|
202
220
|
colorBgSpotlight: "#ffffff",
|
|
203
221
|
colorTextLightSolid: colorText
|
|
204
222
|
},
|
|
205
223
|
Menu: {
|
|
224
|
+
borderRadiusLG: borderRadiusMD,
|
|
206
225
|
paddingContentVertical: 0,
|
|
207
226
|
itemHeight: 30,
|
|
208
|
-
itemBorderRadius:
|
|
227
|
+
itemBorderRadius: borderRadius,
|
|
209
228
|
// 80 means 50% opacity
|
|
210
229
|
itemHoverBg: colorFillSecondary + "80",
|
|
211
230
|
itemActiveBg: colorFillSecondary + "80",
|
|
@@ -23,10 +23,14 @@ __export(style_exports, {
|
|
|
23
23
|
genTypographyStyle: () => genTypographyStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
26
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
28
|
var genTypographyStyle = (token) => {
|
|
28
|
-
const { componentCls, controlHeight, fontSize, lineHeight } = token;
|
|
29
|
-
const marginOffset = (controlHeight
|
|
29
|
+
const { componentCls, controlHeight, fontSize, lineHeight, calc } = token;
|
|
30
|
+
const marginOffset = calc(controlHeight).sub(calc(fontSize).mul(lineHeight).equal()).div(2).equal();
|
|
31
|
+
const paddingTop = calc(marginOffset).sub(token.lineWidth).equal();
|
|
32
|
+
const paddingInline = calc(token.paddingSM).sub(token.lineWidth).equal();
|
|
33
|
+
const negativeMarginOffset = calc(marginOffset).mul(-1).equal();
|
|
30
34
|
return {
|
|
31
35
|
// inherit color and lineHeight from parent instead of fixed colorText
|
|
32
36
|
[`${componentCls}`]: {
|
|
@@ -40,43 +44,43 @@ var genTypographyStyle = (token) => {
|
|
|
40
44
|
[`${componentCls}${componentCls}-editable-text:not(${componentCls}-edit-content)`]: {
|
|
41
45
|
"&:hover": {
|
|
42
46
|
background: token.colorBgContainer,
|
|
43
|
-
border: `${token.lineWidth}
|
|
47
|
+
border: `${(0, import_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
|
44
48
|
borderRadius: token.borderRadius,
|
|
45
49
|
position: "relative",
|
|
46
|
-
insetInlineStart:
|
|
47
|
-
padding: `${
|
|
50
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
51
|
+
padding: `${paddingTop} ${paddingInline}`
|
|
48
52
|
},
|
|
49
53
|
"div&:hover": {
|
|
50
54
|
height: token.controlHeight,
|
|
51
|
-
marginTop:
|
|
52
|
-
marginBottom:
|
|
55
|
+
marginTop: negativeMarginOffset,
|
|
56
|
+
marginBottom: calc("1em").sub(marginOffset).equal()
|
|
53
57
|
},
|
|
54
58
|
"span&:hover": {
|
|
55
59
|
display: "inline-block",
|
|
56
60
|
height: token.controlHeight,
|
|
57
|
-
marginTop:
|
|
58
|
-
marginBottom:
|
|
61
|
+
marginTop: negativeMarginOffset,
|
|
62
|
+
marginBottom: negativeMarginOffset
|
|
59
63
|
},
|
|
60
64
|
"h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover": {
|
|
61
|
-
marginTop: `${
|
|
62
|
-
marginBottom: `${
|
|
65
|
+
marginTop: `${negativeMarginOffset} !important`,
|
|
66
|
+
marginBottom: `${negativeMarginOffset} !important`
|
|
63
67
|
}
|
|
64
68
|
},
|
|
65
69
|
[`${componentCls}${componentCls}-edit-content`]: {
|
|
66
70
|
[`${componentCls}-div&`]: {
|
|
67
|
-
insetInlineStart:
|
|
68
|
-
marginTop:
|
|
69
|
-
marginBottom:
|
|
71
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
72
|
+
marginTop: negativeMarginOffset,
|
|
73
|
+
marginBottom: calc("1em").sub(marginOffset).equal()
|
|
70
74
|
},
|
|
71
75
|
[`${componentCls}-span&`]: {
|
|
72
|
-
insetInlineStart:
|
|
73
|
-
marginTop:
|
|
74
|
-
marginBottom:
|
|
76
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
77
|
+
marginTop: negativeMarginOffset,
|
|
78
|
+
marginBottom: negativeMarginOffset
|
|
75
79
|
},
|
|
76
80
|
[`${componentCls}-h1&, ${componentCls}-h2&, ${componentCls}-h3&, ${componentCls}-h4&, ${componentCls}-h5&`]: {
|
|
77
|
-
insetInlineStart:
|
|
78
|
-
marginTop: `${
|
|
79
|
-
marginBottom: `${
|
|
81
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
82
|
+
marginTop: `${negativeMarginOffset} !important`,
|
|
83
|
+
marginBottom: `${negativeMarginOffset} !important`
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/design",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.6",
|
|
4
4
|
"description": "The Design System of OceanBase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"LICENSE"
|
|
32
32
|
],
|
|
33
33
|
"sideEffects": [
|
|
34
|
-
"**/*.less",
|
|
35
34
|
"**/*.css"
|
|
36
35
|
],
|
|
37
36
|
"scripts": {
|
|
@@ -66,5 +65,5 @@
|
|
|
66
65
|
"react": ">=16.9.0",
|
|
67
66
|
"react-dom": ">=16.9.0"
|
|
68
67
|
},
|
|
69
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "7ce9c565c23262a8ffaeab5904095ca65806def9"
|
|
70
69
|
}
|
package/es/global.css
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@import '~antd/dist/reset.css';
|
|
2
|
-
|
|
3
|
-
@font-face {
|
|
4
|
-
font-family: 'Inter';
|
|
5
|
-
/* load priority: local font > self-hosting font > remote font */
|
|
6
|
-
src:
|
|
7
|
-
local('Inter'),
|
|
8
|
-
url('./fonts/Inter.woff2') format('woff2'),
|
|
9
|
-
url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2')
|
|
10
|
-
format('woff2');
|
|
11
|
-
/* load strategy: use default font as fallback */
|
|
12
|
-
font-display: swap;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@font-face {
|
|
16
|
-
font-family: 'Consolas';
|
|
17
|
-
src:
|
|
18
|
-
local('Consolas'),
|
|
19
|
-
url('./fonts/Consolas.woff2') format('woff2'),
|
|
20
|
-
url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2')
|
|
21
|
-
format('woff2');
|
|
22
|
-
font-display: swap;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@font-face {
|
|
26
|
-
font-family: 'Helvetica Neue';
|
|
27
|
-
src:
|
|
28
|
-
local('Helvetica Neue'),
|
|
29
|
-
url('./fonts/HelveticaNeue.woff2') format('woff2'),
|
|
30
|
-
url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2')
|
|
31
|
-
format('woff2');
|
|
32
|
-
font-display: swap;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
pre,
|
|
36
|
-
code,
|
|
37
|
-
kbd,
|
|
38
|
-
samp {
|
|
39
|
-
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
* {
|
|
43
|
-
scrollbar-color: #e2e8f3 transparent;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.rc-virtual-list-scrollbar-thumb {
|
|
47
|
-
background: #e2e8f3 !important;
|
|
48
|
-
}
|
package/lib/global.css
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@import '~antd/dist/reset.css';
|
|
2
|
-
|
|
3
|
-
@font-face {
|
|
4
|
-
font-family: 'Inter';
|
|
5
|
-
/* load priority: local font > self-hosting font > remote font */
|
|
6
|
-
src:
|
|
7
|
-
local('Inter'),
|
|
8
|
-
url('./fonts/Inter.woff2') format('woff2'),
|
|
9
|
-
url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2')
|
|
10
|
-
format('woff2');
|
|
11
|
-
/* load strategy: use default font as fallback */
|
|
12
|
-
font-display: swap;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@font-face {
|
|
16
|
-
font-family: 'Consolas';
|
|
17
|
-
src:
|
|
18
|
-
local('Consolas'),
|
|
19
|
-
url('./fonts/Consolas.woff2') format('woff2'),
|
|
20
|
-
url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2')
|
|
21
|
-
format('woff2');
|
|
22
|
-
font-display: swap;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@font-face {
|
|
26
|
-
font-family: 'Helvetica Neue';
|
|
27
|
-
src:
|
|
28
|
-
local('Helvetica Neue'),
|
|
29
|
-
url('./fonts/HelveticaNeue.woff2') format('woff2'),
|
|
30
|
-
url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2')
|
|
31
|
-
format('woff2');
|
|
32
|
-
font-display: swap;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
pre,
|
|
36
|
-
code,
|
|
37
|
-
kbd,
|
|
38
|
-
samp {
|
|
39
|
-
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
* {
|
|
43
|
-
scrollbar-color: #e2e8f3 transparent;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.rc-virtual-list-scrollbar-thumb {
|
|
47
|
-
background: #e2e8f3 !important;
|
|
48
|
-
}
|