@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/es/spin/style/index.js
CHANGED
|
@@ -7,9 +7,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
8
8
|
var genSizeStyle = function genSizeStyle(spinDotSize, token) {
|
|
9
9
|
var componentCls = token.componentCls,
|
|
10
|
-
colorText = token.colorText
|
|
10
|
+
colorText = token.colorText,
|
|
11
|
+
calc = token.calc;
|
|
11
12
|
var spinDotWidth = spinDotSize;
|
|
12
|
-
var spinDotHight = spinDotWidth
|
|
13
|
+
var spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
|
|
13
14
|
return _defineProperty({}, "&".concat(componentCls, "-oceanbase"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-dot"), {
|
|
14
15
|
width: spinDotWidth,
|
|
15
16
|
height: spinDotHight
|
|
@@ -20,22 +21,23 @@ var genSizeStyle = function genSizeStyle(spinDotSize, token) {
|
|
|
20
21
|
};
|
|
21
22
|
var genNestedSizeStyle = function genNestedSizeStyle(spinDotSize, token) {
|
|
22
23
|
var componentCls = token.componentCls,
|
|
23
|
-
fontSize = token.fontSize
|
|
24
|
+
fontSize = token.fontSize,
|
|
25
|
+
calc = token.calc;
|
|
24
26
|
var spinDotWidth = spinDotSize;
|
|
25
27
|
// oceanbase indicator is rectangle instead of square, should calculate actual height by ratio
|
|
26
28
|
// width: 295px
|
|
27
29
|
// height: 397px
|
|
28
|
-
var spinDotHight = spinDotWidth
|
|
29
|
-
var dotMarginLeft = -
|
|
30
|
-
var dotMarginTop = -
|
|
31
|
-
var textPaddingTop = (spinDotHight
|
|
30
|
+
var spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
|
|
31
|
+
var dotMarginLeft = calc(spinDotWidth).div(-2).equal();
|
|
32
|
+
var dotMarginTop = calc(spinDotHight).div(-2).equal();
|
|
33
|
+
var textPaddingTop = calc(spinDotHight).sub(fontSize).div(2).add(2).equal();
|
|
32
34
|
return _defineProperty({}, "&".concat(componentCls, "-oceanbase, & > ").concat(componentCls, "-oceanbase"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-dot"), {
|
|
33
35
|
marginLeft: dotMarginLeft,
|
|
34
36
|
marginTop: dotMarginTop
|
|
35
37
|
}), "".concat(componentCls, "-text"), {
|
|
36
38
|
paddingTop: textPaddingTop
|
|
37
39
|
}), "&".concat(componentCls, "-show-text ").concat(componentCls, "-dot"), {
|
|
38
|
-
marginTop: dotMarginTop
|
|
40
|
+
marginTop: calc(dotMarginTop).sub(10).equal()
|
|
39
41
|
}));
|
|
40
42
|
};
|
|
41
43
|
export var genSpinStyle = function genSpinStyle(token) {
|
|
@@ -50,16 +52,17 @@ export default (function (prefixCls) {
|
|
|
50
52
|
// should expand by 2x for oceanbase indicator
|
|
51
53
|
// because it's inner padding is smaller than antd default indicator
|
|
52
54
|
// const ratio = 3;
|
|
55
|
+
var calc = token.calc;
|
|
53
56
|
return [genSpinStyle(_objectSpread(_objectSpread({}, token), {}, {
|
|
54
57
|
// https://github.com/ant-design/ant-design/blob/master/components/spin/style/index.tsx#L238
|
|
55
58
|
// spinDotSize: (token.controlHeightLG / 2) * ratio,
|
|
56
59
|
// spinDotSizeSM: token.controlHeightLG * 0.35 * ratio,
|
|
57
60
|
// spinDotSizeLG: token.controlHeight * ratio,
|
|
58
|
-
spinDotSize: token.controlHeight
|
|
61
|
+
spinDotSize: calc(token.controlHeight).mul(1.75).equal(),
|
|
59
62
|
// 56,
|
|
60
|
-
spinDotSizeSM: token.controlHeight
|
|
63
|
+
spinDotSizeSM: calc(token.controlHeight).mul(1.125).equal(),
|
|
61
64
|
// 36
|
|
62
|
-
spinDotSizeLG: token.controlHeight
|
|
65
|
+
spinDotSizeLG: calc(token.controlHeight).mul(2.25).equal() // 72
|
|
63
66
|
}))];
|
|
64
67
|
});
|
|
65
68
|
return useStyle(prefixCls);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
3
|
+
import themeConfig from "../theme";
|
|
4
|
+
import interFont from "../fonts/Inter.woff2";
|
|
5
|
+
import consolasFont from "../fonts/Consolas.woff2";
|
|
6
|
+
import helveticaNeueFont from "../fonts/HelveticaNeue.woff2";
|
|
7
|
+
import 'antd/dist/reset.css';
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
var genGlobalStyle = function genGlobalStyle(token) {
|
|
11
|
+
return [
|
|
12
|
+
// Priority: local font > self-hosting font > remote font
|
|
13
|
+
{
|
|
14
|
+
'@font-face': {
|
|
15
|
+
fontFamily: "'Inter'",
|
|
16
|
+
src: "local('Inter'), url(".concat(interFont, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')"),
|
|
17
|
+
fontDisplay: 'swap'
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
'@font-face': {
|
|
21
|
+
fontFamily: "'Consolas'",
|
|
22
|
+
src: "local('Consolas'), url(".concat(consolasFont, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2')"),
|
|
23
|
+
fontDisplay: 'swap'
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
'@font-face': {
|
|
27
|
+
fontFamily: "'Helvetica Neue'",
|
|
28
|
+
src: "local('Helvetica Neue'), url(".concat(helveticaNeueFont, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2')"),
|
|
29
|
+
fontDisplay: 'swap'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
// Global element styles
|
|
33
|
+
{
|
|
34
|
+
'pre, code, kbd, samp': {
|
|
35
|
+
fontFamily: token.fontFamilyCode
|
|
36
|
+
},
|
|
37
|
+
'*': {
|
|
38
|
+
scrollbarColor: "".concat(token.colorFillSecondary, " transparent")
|
|
39
|
+
},
|
|
40
|
+
'.rc-virtual-list-scrollbar-thumb': {
|
|
41
|
+
background: "".concat(token.colorFillSecondary, " !important")
|
|
42
|
+
}
|
|
43
|
+
}];
|
|
44
|
+
};
|
|
45
|
+
var GlobalStyle = function GlobalStyle() {
|
|
46
|
+
var _themeConfig$useToken = themeConfig.useToken(),
|
|
47
|
+
theme = _themeConfig$useToken.theme,
|
|
48
|
+
token = _themeConfig$useToken.token;
|
|
49
|
+
var wrapSSR = useStyleRegister({
|
|
50
|
+
theme: theme,
|
|
51
|
+
token: token,
|
|
52
|
+
path: ['global'],
|
|
53
|
+
hashId: '',
|
|
54
|
+
// Empty hashId for global styles
|
|
55
|
+
order: -1000 // Inject before other styles
|
|
56
|
+
}, function () {
|
|
57
|
+
return genGlobalStyle(token);
|
|
58
|
+
});
|
|
59
|
+
return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {}));
|
|
60
|
+
};
|
|
61
|
+
export { GlobalStyle };
|
|
62
|
+
export default GlobalStyle;
|
package/es/style/reset.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/* antd/dist/reset.css is imported in global.tsx */
|
|
2
|
+
/* reserve this file for compatibility with antd */
|
package/es/table/style/index.js
CHANGED
|
@@ -2,6 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
import { unit } from '@ant-design/cssinjs';
|
|
5
6
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
7
|
export var genTableStyle = function genTableStyle(token) {
|
|
7
8
|
var _ref;
|
|
@@ -17,8 +18,8 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
17
18
|
colorBorderSecondary = token.colorBorderSecondary,
|
|
18
19
|
padding = token.padding,
|
|
19
20
|
marginLG = token.marginLG,
|
|
20
|
-
marginXS = token.marginXS
|
|
21
|
-
|
|
21
|
+
marginXS = token.marginXS,
|
|
22
|
+
calc = token.calc;
|
|
22
23
|
return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper ").concat(componentCls), _defineProperty(_defineProperty(_defineProperty({
|
|
23
24
|
color: colorText,
|
|
24
25
|
backgroundColor: colorBgBase,
|
|
@@ -47,7 +48,7 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
47
48
|
})), "tr > td", {
|
|
48
49
|
transition: "background ".concat(token.motionDurationMid)
|
|
49
50
|
}), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
|
|
50
|
-
minHeight: 360
|
|
51
|
+
minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
|
|
51
52
|
display: 'flex',
|
|
52
53
|
justifyContent: 'center',
|
|
53
54
|
alignItems: 'center'
|
|
@@ -62,11 +63,11 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
62
63
|
}), "".concat(componentCls, "-empty-wrapper"), {
|
|
63
64
|
minHeight: 'auto'
|
|
64
65
|
})))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-middle"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
|
|
65
|
-
minHeight: 260
|
|
66
|
+
minHeight: calc(260).sub(calc(token.paddingXS).mul(2).equal()).equal()
|
|
66
67
|
}))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
|
|
67
|
-
minHeight: 160
|
|
68
|
+
minHeight: calc(160).sub(calc(token.paddingXXS).mul(2).equal()).equal()
|
|
68
69
|
}))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-footer"), {
|
|
69
|
-
borderRadius: "0px 0px ".concat(token.borderRadiusLG, "
|
|
70
|
+
borderRadius: "0px 0px ".concat(unit(token.borderRadiusLG), " ").concat(unit(token.borderRadiusLG))
|
|
70
71
|
})), "".concat(componentCls, "-wrapper").concat(componentCls, "-inner-bordered ").concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-container"), _defineProperty({
|
|
71
72
|
borderInlineStart: 'none',
|
|
72
73
|
borderTop: 'none'
|
|
@@ -81,26 +82,26 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
81
82
|
borderBottomLeftRadius: 0,
|
|
82
83
|
borderBottomRightRadius: 0
|
|
83
84
|
}), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
|
|
84
|
-
marginLeft: token.marginXL
|
|
85
|
+
marginLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
85
86
|
}), "& > *".concat(componentCls, "-expanded-row-fixed"), {
|
|
86
|
-
paddingLeft: token.marginXL
|
|
87
|
+
paddingLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
|
|
87
88
|
})), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
|
|
88
|
-
marginLeft: token.margin
|
|
89
|
+
marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
89
90
|
}))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
|
|
90
|
-
marginLeft: token.margin
|
|
91
|
+
marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
|
|
91
92
|
})))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable").concat(componentCls, "-selectable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
|
|
92
|
-
marginLeft: token.marginXL
|
|
93
|
+
marginLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
93
94
|
}), "& > *".concat(componentCls, "-expanded-row-fixed"), {
|
|
94
|
-
paddingLeft: token.marginXL
|
|
95
|
+
paddingLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
|
|
95
96
|
})), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
|
|
96
|
-
marginLeft: token.margin
|
|
97
|
+
marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
97
98
|
}))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
|
|
98
|
-
marginLeft: token.margin
|
|
99
|
+
marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
|
|
99
100
|
})))), "".concat(componentCls, "-wrapper ").concat(antCls, "-spin-blur"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-placeholder"), {
|
|
100
101
|
// hide empty when Table loading
|
|
101
102
|
visibility: 'hidden'
|
|
102
103
|
}))), _defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), {
|
|
103
|
-
padding: "".concat(padding, "
|
|
104
|
+
padding: "".concat(unit(padding), " 0"),
|
|
104
105
|
margin: '0 !important'
|
|
105
106
|
}), "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
|
|
106
107
|
position: 'absolute',
|
|
@@ -111,7 +112,7 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
111
112
|
color: colorTextSecondary,
|
|
112
113
|
fontWeight: token.fontWeightStrong
|
|
113
114
|
}, "".concat(componentCls, "-batch-operation-selection-count"), {
|
|
114
|
-
margin: "0 ".concat(marginXS
|
|
115
|
+
margin: "0 ".concat(unit(marginXS)),
|
|
115
116
|
color: colorLink
|
|
116
117
|
}))))), "".concat(antCls, "-popover").concat(componentCls, "-batch-operation-selection-popover"), _defineProperty({}, "".concat(antCls, "-popover-inner"), {
|
|
117
118
|
padding: 0
|
package/es/theme/compact.d.ts
CHANGED
package/es/theme/compact.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import themeConfig from "./index";
|
|
1
|
+
import theme from "./index";
|
|
3
2
|
var compactTheme = {
|
|
4
|
-
token: theme.
|
|
5
|
-
algorithm: theme.compactAlgorithm,
|
|
6
|
-
token: themeConfig.defaultSeed
|
|
7
|
-
}),
|
|
3
|
+
token: theme.defaultSeed,
|
|
8
4
|
components: {
|
|
9
5
|
InputNumber: {
|
|
10
6
|
handleVisible: true
|
package/es/theme/default.js
CHANGED
|
@@ -19,6 +19,9 @@ var colorFillQuaternary = '#F5F7FC';
|
|
|
19
19
|
var colorBorderSecondary = colorFillSecondary;
|
|
20
20
|
var fontSizeSM = 12;
|
|
21
21
|
var tagColorBorder = colorTextQuaternary;
|
|
22
|
+
var borderRadius = 4;
|
|
23
|
+
var borderRadiusMD = 6;
|
|
24
|
+
var borderRadiusLG = 8;
|
|
22
25
|
export var fontFamilyEn = "Inter, 'Noto sans', sans-serif, Roboto, 'Open Sans', 'Segoe UI', 'Helvetica Neue', 'Helvetica, Arial', 'Apple Color Emoji'";
|
|
23
26
|
export var fontWeightWeakEn = 400;
|
|
24
27
|
export var fontWeightEn = 500;
|
|
@@ -31,9 +34,9 @@ var defaultTheme = {
|
|
|
31
34
|
fontWeight: 400,
|
|
32
35
|
fontWeightStrong: 500,
|
|
33
36
|
borderRadiusSM: 2,
|
|
34
|
-
borderRadius:
|
|
35
|
-
borderRadiusMD:
|
|
36
|
-
borderRadiusLG:
|
|
37
|
+
borderRadius: borderRadius,
|
|
38
|
+
borderRadiusMD: borderRadiusMD,
|
|
39
|
+
borderRadiusLG: borderRadiusLG,
|
|
37
40
|
fontSizeSM: fontSizeSM,
|
|
38
41
|
fontSize: 13,
|
|
39
42
|
lineHeight: 20 / 13,
|
|
@@ -97,7 +100,7 @@ var defaultTheme = {
|
|
|
97
100
|
},
|
|
98
101
|
components: {
|
|
99
102
|
Alert: {
|
|
100
|
-
borderRadiusLG:
|
|
103
|
+
borderRadiusLG: borderRadiusMD
|
|
101
104
|
},
|
|
102
105
|
Badge: {
|
|
103
106
|
statusSize: 8
|
|
@@ -118,16 +121,29 @@ var defaultTheme = {
|
|
|
118
121
|
},
|
|
119
122
|
Card: {
|
|
120
123
|
headerFontSize: 16,
|
|
121
|
-
borderRadiusLG:
|
|
124
|
+
borderRadiusLG: borderRadiusLG
|
|
122
125
|
},
|
|
123
126
|
Collapse: {
|
|
124
127
|
colorBorder: colorBorderSecondary
|
|
125
128
|
},
|
|
129
|
+
DatePicker: {
|
|
130
|
+
borderRadiusLG: borderRadiusMD
|
|
131
|
+
},
|
|
126
132
|
Descriptions: {
|
|
127
133
|
labelColor: colorTextSecondary
|
|
128
134
|
},
|
|
135
|
+
Dropdown: {
|
|
136
|
+
borderRadiusLG: borderRadiusMD
|
|
137
|
+
},
|
|
138
|
+
Input: {
|
|
139
|
+
borderRadiusLG: borderRadiusMD
|
|
140
|
+
},
|
|
129
141
|
InputNumber: {
|
|
130
|
-
handleVisible: true
|
|
142
|
+
handleVisible: true,
|
|
143
|
+
borderRadiusLG: borderRadiusMD
|
|
144
|
+
},
|
|
145
|
+
Popover: {
|
|
146
|
+
borderRadiusLG: borderRadiusMD
|
|
131
147
|
},
|
|
132
148
|
Progress: {
|
|
133
149
|
defaultColor: colorPrimarySecondary
|
|
@@ -141,6 +157,7 @@ var defaultTheme = {
|
|
|
141
157
|
},
|
|
142
158
|
Select: {
|
|
143
159
|
// work for all multiple select component, including Select, TreeSelect and Cascader and so on
|
|
160
|
+
borderRadiusLG: borderRadiusMD,
|
|
144
161
|
multipleItemBg: colorFillQuaternary,
|
|
145
162
|
multipleItemBorderColor: tagColorBorder,
|
|
146
163
|
multipleItemBorderColorDisabled: tagColorBorder
|
|
@@ -154,7 +171,7 @@ var defaultTheme = {
|
|
|
154
171
|
handleColorDisabled: '#b3ccff'
|
|
155
172
|
},
|
|
156
173
|
Skeleton: {
|
|
157
|
-
blockRadius:
|
|
174
|
+
blockRadius: borderRadius
|
|
158
175
|
},
|
|
159
176
|
Tabs: {
|
|
160
177
|
horizontalItemGutter: 24,
|
|
@@ -164,7 +181,7 @@ var defaultTheme = {
|
|
|
164
181
|
},
|
|
165
182
|
Tag: {
|
|
166
183
|
colorBorder: tagColorBorder,
|
|
167
|
-
borderRadiusSM:
|
|
184
|
+
borderRadiusSM: borderRadius
|
|
168
185
|
},
|
|
169
186
|
Table: {
|
|
170
187
|
cellFontSize: fontSizeSM,
|
|
@@ -178,13 +195,15 @@ var defaultTheme = {
|
|
|
178
195
|
rowSelectedHoverBg: colorFillTertiary
|
|
179
196
|
},
|
|
180
197
|
Tooltip: {
|
|
198
|
+
borderRadius: borderRadiusMD,
|
|
181
199
|
colorBgSpotlight: '#ffffff',
|
|
182
200
|
colorTextLightSolid: colorText
|
|
183
201
|
},
|
|
184
202
|
Menu: {
|
|
203
|
+
borderRadiusLG: borderRadiusMD,
|
|
185
204
|
paddingContentVertical: 0,
|
|
186
205
|
itemHeight: 30,
|
|
187
|
-
itemBorderRadius:
|
|
206
|
+
itemBorderRadius: borderRadius,
|
|
188
207
|
// 80 means 50% opacity
|
|
189
208
|
itemHoverBg: colorFillSecondary + '80',
|
|
190
209
|
itemActiveBg: colorFillSecondary + '80',
|
|
@@ -2,13 +2,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
import { unit } from '@ant-design/cssinjs';
|
|
5
6
|
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
7
|
export var genTypographyStyle = function genTypographyStyle(token) {
|
|
7
8
|
var componentCls = token.componentCls,
|
|
8
9
|
controlHeight = token.controlHeight,
|
|
9
10
|
fontSize = token.fontSize,
|
|
10
|
-
lineHeight = token.lineHeight
|
|
11
|
-
|
|
11
|
+
lineHeight = token.lineHeight,
|
|
12
|
+
calc = token.calc;
|
|
13
|
+
var marginOffset = calc(controlHeight).sub(calc(fontSize).mul(lineHeight).equal()).div(2).equal();
|
|
14
|
+
var paddingTop = calc(marginOffset).sub(token.lineWidth).equal();
|
|
15
|
+
var paddingInline = calc(token.paddingSM).sub(token.lineWidth).equal();
|
|
16
|
+
var negativeMarginOffset = calc(marginOffset).mul(-1).equal();
|
|
12
17
|
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({
|
|
13
18
|
lineHeight: 'inherit',
|
|
14
19
|
color: 'inherit',
|
|
@@ -18,39 +23,39 @@ export var genTypographyStyle = function genTypographyStyle(token) {
|
|
|
18
23
|
})), "".concat(componentCls).concat(componentCls, "-editable-text:not(").concat(componentCls, "-edit-content)"), {
|
|
19
24
|
'&:hover': {
|
|
20
25
|
background: token.colorBgContainer,
|
|
21
|
-
border: "".concat(token.lineWidth, "
|
|
26
|
+
border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorBorder),
|
|
22
27
|
borderRadius: token.borderRadius,
|
|
23
28
|
position: 'relative',
|
|
24
|
-
insetInlineStart:
|
|
25
|
-
padding: "".concat(
|
|
29
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
30
|
+
padding: "".concat(paddingTop, " ").concat(paddingInline)
|
|
26
31
|
},
|
|
27
32
|
'div&:hover': {
|
|
28
33
|
height: token.controlHeight,
|
|
29
|
-
marginTop:
|
|
30
|
-
marginBottom:
|
|
34
|
+
marginTop: negativeMarginOffset,
|
|
35
|
+
marginBottom: calc('1em').sub(marginOffset).equal()
|
|
31
36
|
},
|
|
32
37
|
'span&:hover': {
|
|
33
38
|
display: 'inline-block',
|
|
34
39
|
height: token.controlHeight,
|
|
35
|
-
marginTop:
|
|
36
|
-
marginBottom:
|
|
40
|
+
marginTop: negativeMarginOffset,
|
|
41
|
+
marginBottom: negativeMarginOffset
|
|
37
42
|
},
|
|
38
43
|
'h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover': {
|
|
39
|
-
marginTop: "".concat(
|
|
40
|
-
marginBottom: "".concat(
|
|
44
|
+
marginTop: "".concat(negativeMarginOffset, " !important"),
|
|
45
|
+
marginBottom: "".concat(negativeMarginOffset, " !important")
|
|
41
46
|
}
|
|
42
47
|
}), "".concat(componentCls).concat(componentCls, "-edit-content"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-div&"), {
|
|
43
|
-
insetInlineStart:
|
|
44
|
-
marginTop:
|
|
45
|
-
marginBottom:
|
|
48
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
49
|
+
marginTop: negativeMarginOffset,
|
|
50
|
+
marginBottom: calc('1em').sub(marginOffset).equal()
|
|
46
51
|
}), "".concat(componentCls, "-span&"), {
|
|
47
|
-
insetInlineStart:
|
|
48
|
-
marginTop:
|
|
49
|
-
marginBottom:
|
|
52
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
53
|
+
marginTop: negativeMarginOffset,
|
|
54
|
+
marginBottom: negativeMarginOffset
|
|
50
55
|
}), "".concat(componentCls, "-h1&, ").concat(componentCls, "-h2&, ").concat(componentCls, "-h3&, ").concat(componentCls, "-h4&, ").concat(componentCls, "-h5&"), {
|
|
51
|
-
insetInlineStart:
|
|
52
|
-
marginTop: "".concat(
|
|
53
|
-
marginBottom: "".concat(
|
|
56
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
57
|
+
marginTop: "".concat(negativeMarginOffset, " !important"),
|
|
58
|
+
marginBottom: "".concat(negativeMarginOffset, " !important")
|
|
54
59
|
}));
|
|
55
60
|
};
|
|
56
61
|
export default (function (prefixCls) {
|
package/lib/alert/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_icons = require("@oceanbase/icons");
|
|
|
39
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
40
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
41
|
var import_style = __toESM(require("./style"));
|
|
42
|
+
var import_theme = __toESM(require("../theme"));
|
|
42
43
|
__reExport(alert_exports, require("antd/es/alert"), module.exports);
|
|
43
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
45
|
var iconMapOutlined = {
|
|
@@ -58,6 +59,7 @@ var Alert = ({
|
|
|
58
59
|
className,
|
|
59
60
|
...restProps
|
|
60
61
|
}) => {
|
|
62
|
+
const { token } = import_theme.default.useToken();
|
|
61
63
|
const type = banner && !typeProp ? "warning" : typeProp;
|
|
62
64
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
63
65
|
const prefixCls = getPrefixCls("alert", customizePrefixCls);
|
package/lib/alert/style/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(style_exports, {
|
|
|
23
23
|
genAlertStyle: () => genAlertStyle
|
|
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 import_lodash = require("lodash");
|
|
28
29
|
var genAlertTypeStyle = (type, token) => {
|
|
@@ -54,17 +55,31 @@ var genAlertTypeStyle = (type, token) => {
|
|
|
54
55
|
};
|
|
55
56
|
};
|
|
56
57
|
var genAlertStyle = (token) => {
|
|
57
|
-
const { componentCls, colorIcon, colorIconHover, motionDurationMid } = token;
|
|
58
|
-
const height = token.fontSize
|
|
58
|
+
const { componentCls, colorIcon, colorIconHover, motionDurationMid, calc } = token;
|
|
59
|
+
const height = calc(token.fontSize).mul(token.lineHeight).equal();
|
|
59
60
|
const iconWidth = token.fontSizeLG;
|
|
60
|
-
const contentStartOffset = iconWidth
|
|
61
|
+
const contentStartOffset = calc(iconWidth).add(token.marginXS).equal();
|
|
61
62
|
const closeIconWidth = height;
|
|
63
|
+
const contentWidth = (0, import_cssinjs.unit)(
|
|
64
|
+
calc(contentStartOffset).add(closeIconWidth).add(token.padding).equal()
|
|
65
|
+
);
|
|
66
|
+
const actionWidth = (0, import_cssinjs.unit)(calc(contentStartOffset).add(token.padding).equal());
|
|
62
67
|
return {
|
|
63
68
|
[`${componentCls}`]: {
|
|
64
69
|
// vertical align to flex-start
|
|
65
70
|
alignItems: "flex-start !important",
|
|
66
71
|
paddingInline: token.padding,
|
|
67
72
|
position: "relative",
|
|
73
|
+
[`${componentCls}-content`]: {
|
|
74
|
+
flex: `1 1 calc(100% - ${contentWidth})`,
|
|
75
|
+
minWidth: 0,
|
|
76
|
+
maxWidth: `calc(100% - ${contentWidth})`,
|
|
77
|
+
wordBreak: "break-word"
|
|
78
|
+
},
|
|
79
|
+
[`${componentCls}-action`]: {
|
|
80
|
+
width: `calc(100% - ${actionWidth})`,
|
|
81
|
+
marginInlineStart: contentStartOffset
|
|
82
|
+
},
|
|
68
83
|
[`${componentCls}-icon`]: {
|
|
69
84
|
height,
|
|
70
85
|
fontSize: token.fontSizeLG,
|
|
@@ -103,15 +118,7 @@ var genAlertStyle = (token) => {
|
|
|
103
118
|
},
|
|
104
119
|
[`${componentCls}:not(${componentCls}-with-description)`]: {
|
|
105
120
|
flexWrap: "wrap",
|
|
106
|
-
[`${componentCls}-content`]: {
|
|
107
|
-
flex: `1 1 calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
|
|
108
|
-
minWidth: 0,
|
|
109
|
-
maxWidth: `calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
|
|
110
|
-
wordBreak: "break-word"
|
|
111
|
-
},
|
|
112
121
|
[`${componentCls}-action`]: {
|
|
113
|
-
width: `calc(100% - ${contentStartOffset + token.padding}px)`,
|
|
114
|
-
marginInlineStart: contentStartOffset,
|
|
115
122
|
marginTop: token.marginXS
|
|
116
123
|
}
|
|
117
124
|
},
|
|
@@ -127,15 +134,7 @@ var genAlertStyle = (token) => {
|
|
|
127
134
|
[`${componentCls}-description`]: {
|
|
128
135
|
wordBreak: "break-word"
|
|
129
136
|
},
|
|
130
|
-
[`${componentCls}-content`]: {
|
|
131
|
-
flex: `1 1 calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
|
|
132
|
-
minWidth: 0,
|
|
133
|
-
maxWidth: `calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
|
|
134
|
-
wordBreak: "break-word"
|
|
135
|
-
},
|
|
136
137
|
[`${componentCls}-action`]: {
|
|
137
|
-
width: `calc(100% - ${contentStartOffset + token.padding}px)`,
|
|
138
|
-
marginInlineStart: contentStartOffset,
|
|
139
138
|
marginTop: token.marginSM
|
|
140
139
|
},
|
|
141
140
|
[`${componentCls}-close-icon`]: {
|
|
@@ -25,11 +25,17 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genButtonStyle = (token) => {
|
|
28
|
-
|
|
28
|
+
const { componentCls } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}`]: {
|
|
31
|
+
// remove box-shadow for button
|
|
32
|
+
boxShadow: "none !important"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
29
35
|
};
|
|
30
36
|
var style_default = (prefixCls, isAliyun) => {
|
|
31
37
|
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Button", (token) => {
|
|
32
|
-
return
|
|
38
|
+
return [genButtonStyle(token)];
|
|
33
39
|
});
|
|
34
40
|
return useStyle(prefixCls);
|
|
35
41
|
};
|
package/lib/card/style/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(style_exports, {
|
|
|
24
24
|
genTableStyle: () => genTableStyle
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(style_exports);
|
|
27
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
27
28
|
var import_style = require("../../tabs/style");
|
|
28
29
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
29
30
|
var genTableStyle = (padding, token) => {
|
|
@@ -55,7 +56,7 @@ var genTableStyle = (padding, token) => {
|
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
58
|
var genCardStyle = (token) => {
|
|
58
|
-
const { componentCls, antCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG } = token;
|
|
59
|
+
const { componentCls, antCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG, calc } = token;
|
|
59
60
|
const tableComponentCls = `${antCls}-table`;
|
|
60
61
|
return {
|
|
61
62
|
[`${componentCls}`]: {
|
|
@@ -68,7 +69,7 @@ var genCardStyle = (token) => {
|
|
|
68
69
|
},
|
|
69
70
|
// nested and bordered Card radius
|
|
70
71
|
[`${componentCls}${componentCls}-bordered`]: {
|
|
71
|
-
borderRadius: token.borderRadiusLG
|
|
72
|
+
borderRadius: calc(token.borderRadiusLG).sub(2).equal(),
|
|
72
73
|
[`${componentCls}${componentCls}-bordered`]: {
|
|
73
74
|
borderRadius: token.borderRadius,
|
|
74
75
|
[`${componentCls}${componentCls}-bordered`]: {
|
|
@@ -95,7 +96,7 @@ var genCardStyle = (token) => {
|
|
|
95
96
|
},
|
|
96
97
|
[`${componentCls}${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
97
98
|
[`${componentCls}-body`]: {
|
|
98
|
-
padding: `0 ${paddingLG}
|
|
99
|
+
padding: `0 ${(0, import_cssinjs.unit)(paddingLG)} ${(0, import_cssinjs.unit)(paddingLG)} ${(0, import_cssinjs.unit)(paddingLG)}`
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
[`${componentCls}-small`]: {
|
|
@@ -105,7 +106,7 @@ var genCardStyle = (token) => {
|
|
|
105
106
|
},
|
|
106
107
|
[`${componentCls}-small${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
107
108
|
[`${componentCls}-body`]: {
|
|
108
|
-
padding: `0 ${paddingSM}
|
|
109
|
+
padding: `0 ${(0, import_cssinjs.unit)(paddingSM)} ${(0, import_cssinjs.unit)(paddingSM)} ${(0, import_cssinjs.unit)(paddingSM)}`
|
|
109
110
|
}
|
|
110
111
|
},
|
|
111
112
|
[`${componentCls}-small${componentCls}-contain-tabs >${componentCls}-head`]: {
|
|
@@ -145,7 +146,7 @@ var genCardStyle = (token) => {
|
|
|
145
146
|
[`&${componentCls}-has-title${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
146
147
|
[`${componentCls}-body`]: {
|
|
147
148
|
[`& > ${tableComponentCls}-wrapper ${tableComponentCls}:not(${tableComponentCls}-bordered):first-child`]: {
|
|
148
|
-
marginTop:
|
|
149
|
+
marginTop: calc(token.marginSM).mul(-1).equal()
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
},
|
|
@@ -25,13 +25,14 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genCheckboxStyle = (token) => {
|
|
28
|
-
const { componentCls, fontSize, fontSizeLG, lineHeight } = token;
|
|
28
|
+
const { componentCls, fontSize, fontSizeLG, lineHeight, calc } = token;
|
|
29
|
+
const translateY = calc(calc(fontSize).mul(lineHeight).equal()).sub(fontSizeLG).div(2).equal();
|
|
29
30
|
return {
|
|
30
31
|
[`${componentCls}-wrapper`]: {
|
|
31
32
|
[`${componentCls}`]: {
|
|
32
33
|
alignSelf: "baseline",
|
|
33
34
|
[`${componentCls}-inner`]: {
|
|
34
|
-
transform: `translate(0px, ${
|
|
35
|
+
transform: `translate(0px, ${translateY})`
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -14,8 +14,9 @@ export * from 'antd/es/config-provider/SizeContext';
|
|
|
14
14
|
export * from 'antd/es/config-provider/DisabledContext';
|
|
15
15
|
export * from 'antd/es/config-provider';
|
|
16
16
|
export interface ThemeConfig extends AntThemeConfig {
|
|
17
|
-
isDark?: boolean;
|
|
18
17
|
isAliyun?: boolean;
|
|
18
|
+
isDark?: boolean;
|
|
19
|
+
isCompact?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export type CardConfig = AntCardConfig & {
|
|
21
22
|
divided?: boolean;
|