@oceanbase/design 1.0.0-alpha.4 → 1.0.0-alpha.5

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/es/alert/index.js CHANGED
@@ -13,6 +13,7 @@ import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, In
13
13
  import classNames from 'classnames';
14
14
  import ConfigProvider from "../config-provider";
15
15
  import useStyle from "./style";
16
+ import theme from "../theme";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  export * from 'antd/es/alert';
18
19
  var iconMapOutlined = {
@@ -32,6 +33,8 @@ var Alert = function Alert(_ref) {
32
33
  customizePrefixCls = _ref.prefixCls,
33
34
  className = _ref.className,
34
35
  restProps = _objectWithoutProperties(_ref, _excluded);
36
+ var _theme$useToken = theme.useToken(),
37
+ token = _theme$useToken.token;
35
38
  // banner exists and type is empty, use warning type by default for correct icon
36
39
  var type = banner && !typeProp ? 'warning' : typeProp;
37
40
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -32,13 +32,14 @@ export var genAlertStyle = function genAlertStyle(token) {
32
32
  var componentCls = token.componentCls,
33
33
  colorIcon = token.colorIcon,
34
34
  colorIconHover = token.colorIconHover,
35
- motionDurationMid = token.motionDurationMid;
35
+ motionDurationMid = token.motionDurationMid,
36
+ calc = token.calc;
36
37
  // height = fontSize * lineHeight
37
- var height = token.fontSize * token.lineHeight;
38
+ var height = calc(token.fontSize).mul(token.lineHeight).equal();
38
39
  // icon width = fontSizeLG (icon size)
39
40
  var iconWidth = token.fontSizeLG;
40
41
  // content and action start position = icon width + icon margin
41
- var contentStartOffset = iconWidth + token.marginXS;
42
+ var contentStartOffset = calc(iconWidth).add(token.marginXS).equal();
42
43
  // close icon width (approximate)
43
44
  var closeIconWidth = height;
44
45
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
@@ -75,12 +76,12 @@ export var genAlertStyle = function genAlertStyle(token) {
75
76
  }), "&".concat(componentCls, "-success"), genAlertTypeStyle('success', token)), "&".concat(componentCls, "-info"), genAlertTypeStyle('info', token)), "&".concat(componentCls, "-warning"), genAlertTypeStyle('warning', token)), "&".concat(componentCls, "-error"), genAlertTypeStyle('error', token))), "".concat(componentCls, ":not(").concat(componentCls, "-with-description)"), _defineProperty(_defineProperty({
76
77
  flexWrap: 'wrap'
77
78
  }, "".concat(componentCls, "-content"), {
78
- flex: "1 1 calc(100% - ".concat(contentStartOffset + closeIconWidth + token.padding, "px)"),
79
+ flex: "1 1 ".concat(calc('100%').sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal()),
79
80
  minWidth: 0,
80
- maxWidth: "calc(100% - ".concat(contentStartOffset + closeIconWidth + token.padding, "px)"),
81
+ maxWidth: calc('100%').sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal(),
81
82
  wordBreak: 'break-word'
82
83
  }), "".concat(componentCls, "-action"), {
83
- width: "calc(100% - ".concat(contentStartOffset + token.padding, "px)"),
84
+ width: calc('100%').sub(contentStartOffset).sub(token.padding).equal(),
84
85
  marginInlineStart: contentStartOffset,
85
86
  marginTop: token.marginXS
86
87
  })), "".concat(componentCls).concat(componentCls, "-with-description"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
@@ -94,12 +95,12 @@ export var genAlertStyle = function genAlertStyle(token) {
94
95
  }), "".concat(componentCls, "-description"), {
95
96
  wordBreak: 'break-word'
96
97
  }), "".concat(componentCls, "-content"), {
97
- flex: "1 1 calc(100% - ".concat(contentStartOffset + closeIconWidth + token.padding, "px)"),
98
+ flex: "1 1 ".concat(calc('100%').sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal()),
98
99
  minWidth: 0,
99
- maxWidth: "calc(100% - ".concat(contentStartOffset + closeIconWidth + token.padding, "px)"),
100
+ maxWidth: calc('100%').sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal(),
100
101
  wordBreak: 'break-word'
101
102
  }), "".concat(componentCls, "-action"), {
102
- width: "calc(100% - ".concat(contentStartOffset + token.padding, "px)"),
103
+ width: calc('100%').sub(contentStartOffset).sub(token.padding).equal(),
103
104
  marginInlineStart: contentStartOffset,
104
105
  marginTop: token.marginSM
105
106
  }), "".concat(componentCls, "-close-icon"), {
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  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); }
7
+ import { unit } from '@ant-design/cssinjs';
7
8
  import { genTabsStyle } from "../../tabs/style";
8
9
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
9
10
  export var genTableStyle = function genTableStyle(padding, token) {
@@ -26,14 +27,15 @@ export var genCardStyle = function genCardStyle(token) {
26
27
  tabsComponentCls = token.tabsComponentCls,
27
28
  tabsPrefixCls = token.tabsPrefixCls,
28
29
  paddingSM = token.paddingSM,
29
- paddingLG = token.paddingLG;
30
+ paddingLG = token.paddingLG,
31
+ calc = token.calc;
30
32
  var tableComponentCls = "".concat(antCls, "-table");
31
33
  return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-body"), {
32
34
  paddingTop: token.padding
33
35
  }), "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
34
36
  boxShadow: 'none'
35
37
  }), "".concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({
36
- borderRadius: token.borderRadiusLG - 2
38
+ borderRadius: calc(token.borderRadiusLG).sub(2).equal()
37
39
  }, "".concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({
38
40
  borderRadius: token.borderRadius
39
41
  }, "".concat(componentCls).concat(componentCls, "-bordered"), {
@@ -46,11 +48,11 @@ export var genCardStyle = function genCardStyle(token) {
46
48
  }, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
47
49
  border: 'none'
48
50
  }))))), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
49
- padding: "0 ".concat(paddingLG, "px ").concat(paddingLG, "px ").concat(paddingLG, "px")
51
+ padding: "0 ".concat(unit(paddingLG), " ").concat(unit(paddingLG), " ").concat(unit(paddingLG))
50
52
  })), "".concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-body"), {
51
53
  paddingTop: token.paddingXS
52
54
  })), "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
53
- padding: "0 ".concat(paddingSM, "px ").concat(paddingSM, "px ").concat(paddingSM, "px")
55
+ padding: "0 ".concat(unit(paddingSM), " ").concat(unit(paddingSM), " ").concat(unit(paddingSM))
54
56
  })), "".concat(componentCls, "-small").concat(componentCls, "-contain-tabs >").concat(componentCls, "-head"), _defineProperty({}, "".concat(componentCls, "-head-title, ").concat(componentCls, "-head-extra"), {
55
57
  paddingTop: token.paddingXS
56
58
  })), "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _objectSpread(_objectSpread({}, genTabsStyle(_objectSpread(_objectSpread({}, token), {}, {
@@ -65,7 +67,7 @@ export var genCardStyle = function genCardStyle(token) {
65
67
  // work for Card not containing Card.Grid
66
68
  marginBottom: 0
67
69
  })), "&".concat(componentCls, "-has-title").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), _defineProperty({}, "& > ".concat(tableComponentCls, "-wrapper ").concat(tableComponentCls, ":not(").concat(tableComponentCls, "-bordered):first-child"), {
68
- marginTop: -token.marginSM
70
+ marginTop: calc(token.marginSM).mul(-1).equal()
69
71
  }))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding"), genTableStyle(paddingLG, token)), "".concat(componentCls).concat(componentCls, "-no-body-horizontal-padding").concat(componentCls, "-small"), genTableStyle(paddingSM, token)), "".concat(componentCls).concat(componentCls, "-collapsible"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-title-wrapper"), _defineProperty({
70
72
  userSelect: 'none'
71
73
  }, "".concat(componentCls, "-collapsible-icon"), {
@@ -7,11 +7,13 @@ export var genCheckboxStyle = function genCheckboxStyle(token) {
7
7
  var componentCls = token.componentCls,
8
8
  fontSize = token.fontSize,
9
9
  fontSizeLG = token.fontSizeLG,
10
- lineHeight = token.lineHeight;
10
+ lineHeight = token.lineHeight,
11
+ calc = token.calc;
12
+ var translateY = calc(calc(fontSize).mul(lineHeight).equal()).sub(fontSizeLG).div(2).equal();
11
13
  return _defineProperty({}, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls), _defineProperty({
12
14
  alignSelf: 'baseline'
13
15
  }, "".concat(componentCls, "-inner"), {
14
- transform: "translate(0px, ".concat((fontSize * lineHeight - fontSizeLG) / 2, "px)")
16
+ transform: "translate(0px, ".concat(translateY, ")")
15
17
  })));
16
18
  };
17
19
  export default (function (prefixCls) {
@@ -32,7 +32,8 @@ export var genVerticalStyle = function genVerticalStyle(size, token) {
32
32
  };
33
33
  export var genDescriptionsStyle = function genDescriptionsStyle(token) {
34
34
  var componentCls = token.componentCls,
35
- typographyComponentCls = token.typographyComponentCls;
35
+ typographyComponentCls = token.typographyComponentCls,
36
+ calc = token.calc;
36
37
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread({}, genVerticalStyle('default', token)), {}, _defineProperty(_defineProperty({}, "".concat(componentCls, "-item-container"), _defineProperty({}, "".concat(componentCls, "-item-content"), _defineProperty({
37
38
  paddingRight: 12
38
39
  }, "".concat(typographyComponentCls, "-edit-content"), {
@@ -41,7 +42,7 @@ export var genDescriptionsStyle = function genDescriptionsStyle(token) {
41
42
  marginBottom: 0
42
43
  }))), "".concat(componentCls, "-item-container:has(", "".concat(typographyComponentCls, "-edit-content"), ")"), {
43
44
  alignItems: 'center',
44
- height: token.fontSize * token.lineHeight
45
+ height: calc(token.fontSize).mul(token.lineHeight).equal()
45
46
  }))), "".concat(componentCls).concat(componentCls, "-middle"), genVerticalStyle('middle', token)), "".concat(componentCls).concat(componentCls, "-small"), genVerticalStyle('small', token));
46
47
  };
47
48
  export default (function (prefixCls, typographyPrefixCls) {
@@ -2,18 +2,20 @@ 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 genDrawerStyle = function genDrawerStyle(token) {
7
8
  var componentCls = token.componentCls,
8
9
  antCls = token.antCls,
9
10
  fontSizeHeading3 = token.fontSizeHeading3,
10
- colorSplit = token.colorSplit;
11
+ colorSplit = token.colorSplit,
12
+ calc = token.calc;
11
13
  var contentPadding = token.paddingLG;
12
14
  var boxShadowBottom = '0 2px 4px 0 rgba(54,69,99,0.04), 0 1px 6px -1px rgba(54,69,99,0.04), 0 1px 2px 0 rgba(54,69,99,0.06)';
13
15
  var boxShadowTop = '0 -2px 4px 0 rgba(54,69,99,0.04), 0 -1px 6px -1px rgba(54,69,99,0.04), 0 -1px 2px 0 rgba(54,69,99,0.06)';
14
16
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-header"), _defineProperty(_defineProperty({
15
17
  position: 'relative',
16
- padding: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
18
+ padding: "".concat(unit(token.padding), " ").concat(unit(token.paddingLG)),
17
19
  borderBottom: 'none',
18
20
  transition: "box-shadow ".concat(token.motionDurationMid),
19
21
  // ensure header box-shadow cover body content
@@ -29,8 +31,8 @@ export var genDrawerStyle = function genDrawerStyle(token) {
29
31
  height: '1px',
30
32
  backgroundColor: colorSplit,
31
33
  // 使用负margin让分割线贯通到content边缘
32
- marginLeft: "-".concat(token.paddingLG, "px"),
33
- marginRight: "-".concat(token.paddingLG, "px")
34
+ marginLeft: calc(token.paddingLG).mul(-1).equal(),
35
+ marginRight: calc(token.paddingLG).mul(-1).equal()
34
36
  })), "".concat(componentCls, "-header-shadow"), {
35
37
  boxShadow: boxShadowBottom
36
38
  }), "".concat(componentCls, "-body"), {
@@ -42,7 +44,7 @@ export var genDrawerStyle = function genDrawerStyle(token) {
42
44
  overflow: 'auto'
43
45
  }), "".concat(componentCls, "-footer-container"), _defineProperty({
44
46
  position: 'sticky',
45
- padding: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
47
+ padding: "".concat(unit(token.padding), " ").concat(unit(token.paddingLG)),
46
48
  transition: "box-shadow ".concat(token.motionDurationMid),
47
49
  // ensure footer box-shadow cover body content
48
50
  zIndex: 10
@@ -2,13 +2,15 @@ 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 genEmptyStyle = function genEmptyStyle(token) {
7
8
  var antCls = token.antCls,
8
9
  componentCls = token.componentCls,
9
10
  colorTextTertiary = token.colorTextTertiary,
10
11
  colorText = token.colorText,
11
- colorTextSecondary = token.colorTextSecondary;
12
+ colorTextSecondary = token.colorTextSecondary,
13
+ calc = token.calc;
12
14
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty({}, "".concat(componentCls, "-image"), {
13
15
  height: 160,
14
16
  marginBottom: 0
@@ -36,7 +38,7 @@ export var genEmptyStyle = function genEmptyStyle(token) {
36
38
  }, "".concat(antCls, "-steps-item-container"), _defineProperty(_defineProperty({}, "".concat(antCls, "-steps-item-icon"), _defineProperty({
37
39
  height: token.controlHeightSM,
38
40
  width: token.controlHeightSM,
39
- lineHeight: "".concat(token.controlHeightSM, "px"),
41
+ lineHeight: unit(token.controlHeightSM),
40
42
  backgroundColor: token.colorFillSecondary,
41
43
  // override default border color
42
44
  borderColor: token.colorFillSecondary
@@ -47,9 +49,9 @@ export var genEmptyStyle = function genEmptyStyle(token) {
47
49
  color: colorText,
48
50
  fontSize: token.fontSize,
49
51
  fontWeight: token.fontWeightStrong,
50
- lineHeight: "".concat(token.controlHeightSM, "px"),
52
+ lineHeight: unit(token.controlHeightSM),
51
53
  '&::after': {
52
- top: token.controlHeightSM / 2
54
+ top: calc(token.controlHeightSM).div(2).equal()
53
55
  }
54
56
  }), "".concat(antCls, "-steps-item-description"), {
55
57
  color: colorTextTertiary,
@@ -4,7 +4,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
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
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genFormStyle = function genFormStyle(token) {
7
- var componentCls = token.componentCls;
7
+ var componentCls = token.componentCls,
8
+ calc = token.calc;
8
9
  return _defineProperty(_defineProperty({}, componentCls, _defineProperty({}, "".concat(componentCls, "-item-extra"), {
9
10
  paddingTop: token.paddingXXS,
10
11
  fontSize: token.fontSizeSM
@@ -18,7 +19,7 @@ export var genFormStyle = function genFormStyle(token) {
18
19
  }), "".concat(componentCls, "-item-label"), {
19
20
  paddingBottom: token.paddingXXS
20
21
  }), "".concat(componentCls, "-item-description"), {
21
- paddingBottom: token.paddingXXS + 2,
22
+ paddingBottom: calc(token.paddingXXS).add(2).equal(),
22
23
  fontSize: token.fontSizeSM,
23
24
  color: token.colorTextDescription
24
25
  })));
@@ -10,10 +10,11 @@ export var genModalStyle = function genModalStyle(token) {
10
10
  fontSizeHeading5 = token.fontSizeHeading5,
11
11
  lineHeightHeading5 = token.lineHeightHeading5,
12
12
  fontSizeHeading3 = token.fontSizeHeading3,
13
- colorSplit = token.colorSplit;
13
+ colorSplit = token.colorSplit,
14
+ calc = token.calc;
14
15
  var top = 100;
15
16
  var bottom = 100;
16
- var titleHeight = fontSizeHeading5 * lineHeightHeading5;
17
+ var titleHeight = calc(fontSizeHeading5).mul(lineHeightHeading5).equal();
17
18
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-confirm):not(").concat(componentCls, "-progress)"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty({
18
19
  paddingBlock: token.padding
19
20
  }, "".concat(componentCls, "-close"), {
@@ -35,11 +36,11 @@ export var genModalStyle = function genModalStyle(token) {
35
36
  backgroundColor: colorSplit,
36
37
  // antd Modal content默认padding通常是24px,使用负margin让分割线贯通
37
38
  // 如果antd使用其他padding值,可能需要调整
38
- marginLeft: "-".concat(token.paddingLG, "px"),
39
- marginRight: "-".concat(token.paddingLG, "px")
39
+ marginLeft: calc(token.paddingLG).mul(-1).equal(),
40
+ marginRight: calc(token.paddingLG).mul(-1).equal()
40
41
  })), "".concat(componentCls, "-body"), {
41
42
  paddingTop: token.paddingLG,
42
- marginInline: "-".concat(token.marginLG, "px"),
43
+ marginInline: calc(token.marginLG).mul(-1).equal(),
43
44
  paddingInline: token.paddingLG
44
45
  })), "".concat(componentCls, "-footer"), _defineProperty(_defineProperty({
45
46
  paddingTop: token.paddingLG,
@@ -85,7 +86,7 @@ export var genModalStyle = function genModalStyle(token) {
85
86
  }), "".concat(componentCls, "-body"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-confirm-title"), {
86
87
  fontSize: fontSizeHeading3
87
88
  }), "".concat(componentCls, "-confirm-body > ").concat(token.iconCls), {
88
- height: token.fontSizeHeading3 * token.lineHeight
89
+ height: calc(token.fontSizeHeading3).mul(token.lineHeight).equal()
89
90
  }), "".concat(componentCls, "-confirm-paragraph"), {
90
91
  rowGap: token.marginSM
91
92
  }), "".concat(componentCls, "-confirm-content"), {
@@ -8,11 +8,13 @@ export var genRadioStyle = function genRadioStyle(token) {
8
8
  radioSize = token.radioSize,
9
9
  fontSize = token.fontSize,
10
10
  fontSizeLG = token.fontSizeLG,
11
- lineHeight = token.lineHeight;
11
+ lineHeight = token.lineHeight,
12
+ calc = token.calc;
13
+ var marginBottom = calc(calc(fontSize).mul(lineHeight).equal()).sub(radioSize || fontSizeLG).div(-2).equal();
12
14
  return _defineProperty({}, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls), _defineProperty({
13
15
  alignSelf: 'baseline'
14
16
  }, "".concat(componentCls, "-inner"), {
15
- marginBottom: -(fontSize * lineHeight - (radioSize || fontSizeLG)) / 2
17
+ marginBottom: marginBottom
16
18
  })));
17
19
  };
18
20
  export default (function (prefixCls) {
@@ -2,7 +2,6 @@ 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 { toNumber } from 'lodash';
6
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
7
6
  export var genSliderStyle = function genSliderStyle(token) {
8
7
  var componentCls = token.componentCls,
@@ -11,13 +10,16 @@ export var genSliderStyle = function genSliderStyle(token) {
11
10
  _token$handleSize = token.handleSize,
12
11
  handleSize = _token$handleSize === void 0 ? 10 : _token$handleSize,
13
12
  _token$handleLineWidt = token.handleLineWidth,
14
- handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt;
13
+ handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt,
14
+ calc = token.calc;
15
+ var dotSizeHalf = calc(dotSize).div(2).equal();
16
+ var handleOffset = calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal();
15
17
  return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-horizontal"), _defineProperty({}, "".concat(componentCls, "-mark"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-mark-text[style*=\"left: 0%;\"]"), {
16
- transform: "translateX(calc(0% - ".concat(dotSize / 2, "px)) !important")
18
+ transform: "translateX(calc(0% - ".concat(dotSizeHalf, ")) !important")
17
19
  }), "".concat(componentCls, "-mark-text[style*=\"left: 100%;\"]"), {
18
- transform: "translateX(calc(-100% + ".concat(dotSize / 2, "px)) !important")
20
+ transform: "translateX(calc(-100% + ".concat(dotSizeHalf, ")) !important")
19
21
  }), "".concat(componentCls, "-mark-text[style=\"transform: translateX(-50%);\"]"), {
20
- transform: "translateX(calc(0% - ".concat((handleSize + toNumber(handleLineWidth) * 2) / 2, "px)) !important")
22
+ transform: "translateX(calc(0% - ".concat(handleOffset, ")) !important")
21
23
  })));
22
24
  };
23
25
  export default (function (prefixCls) {
@@ -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 * (295 / 397);
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 * (295 / 397);
29
- var dotMarginLeft = -spinDotWidth / 2;
30
- var dotMarginTop = -spinDotHight / 2;
31
- var textPaddingTop = (spinDotHight - fontSize) / 2 + 2;
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 - 10
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 * 1.75,
61
+ spinDotSize: calc(token.controlHeight).mul(1.75).equal(),
59
62
  // 56,
60
- spinDotSizeSM: token.controlHeight * 1.125,
63
+ spinDotSizeSM: calc(token.controlHeight).mul(1.125).equal(),
61
64
  // 36
62
- spinDotSizeLG: token.controlHeight * 2.25 // 72
65
+ spinDotSizeLG: calc(token.controlHeight).mul(2.25).equal() // 72
63
66
  }))];
64
67
  });
65
68
  return useStyle(prefixCls);
@@ -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
- console.log(token.fontWeight);
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 - token.paddingSM * 2,
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 - token.paddingXS * 2
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 - token.paddingXXS * 2
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, "px ").concat(token.borderRadiusLG, "px")
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 + token.lineWidth * 2
85
+ marginLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
85
86
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
86
- paddingLeft: token.marginXL + token.lineWidth * 2 + token.padding
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 + token.lineWidth * 2
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 + token.lineWidth * 2 + 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 + token.marginXL + token.lineWidth * 2
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 + token.marginXL + token.lineWidth * 2 + token.padding
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 + token.marginXL + token.lineWidth * 2
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 + token.marginXL + token.lineWidth * 2 + 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, "px 0"),
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, "px"),
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
@@ -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
- var marginOffset = (controlHeight - fontSize * lineHeight) / 2;
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, "px ").concat(token.lineType, " ").concat(token.colorBorder),
26
+ border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorBorder),
22
27
  borderRadius: token.borderRadius,
23
28
  position: 'relative',
24
- insetInlineStart: -token.paddingSM,
25
- padding: "".concat(marginOffset - token.lineWidth, "px ").concat(token.paddingSM - token.lineWidth, "px")
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: -marginOffset,
30
- marginBottom: "calc(1em - ".concat(marginOffset, "px)")
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: -marginOffset,
36
- marginBottom: -marginOffset
40
+ marginTop: negativeMarginOffset,
41
+ marginBottom: negativeMarginOffset
37
42
  },
38
43
  'h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover': {
39
- marginTop: "".concat(-marginOffset, "px !important"),
40
- marginBottom: "".concat(-marginOffset, "px !important")
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: -token.paddingSM,
44
- marginTop: -marginOffset,
45
- marginBottom: "calc(1em - ".concat(marginOffset, "px)")
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: -token.paddingSM,
48
- marginTop: -marginOffset,
49
- marginBottom: -marginOffset
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: -token.paddingSM,
52
- marginTop: "".concat(-marginOffset, "px !important"),
53
- marginBottom: "".concat(-marginOffset, "px !important")
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) {
@@ -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);