@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.
@@ -54,10 +54,10 @@ var genAlertTypeStyle = (type, token) => {
54
54
  };
55
55
  };
56
56
  var genAlertStyle = (token) => {
57
- const { componentCls, colorIcon, colorIconHover, motionDurationMid } = token;
58
- const height = token.fontSize * token.lineHeight;
57
+ const { componentCls, colorIcon, colorIconHover, motionDurationMid, calc } = token;
58
+ const height = calc(token.fontSize).mul(token.lineHeight).equal();
59
59
  const iconWidth = token.fontSizeLG;
60
- const contentStartOffset = iconWidth + token.marginXS;
60
+ const contentStartOffset = calc(iconWidth).add(token.marginXS).equal();
61
61
  const closeIconWidth = height;
62
62
  return {
63
63
  [`${componentCls}`]: {
@@ -104,13 +104,13 @@ var genAlertStyle = (token) => {
104
104
  [`${componentCls}:not(${componentCls}-with-description)`]: {
105
105
  flexWrap: "wrap",
106
106
  [`${componentCls}-content`]: {
107
- flex: `1 1 calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
107
+ flex: `1 1 ${calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal()}`,
108
108
  minWidth: 0,
109
- maxWidth: `calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
109
+ maxWidth: calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal(),
110
110
  wordBreak: "break-word"
111
111
  },
112
112
  [`${componentCls}-action`]: {
113
- width: `calc(100% - ${contentStartOffset + token.padding}px)`,
113
+ width: calc("100%").sub(contentStartOffset).sub(token.padding).equal(),
114
114
  marginInlineStart: contentStartOffset,
115
115
  marginTop: token.marginXS
116
116
  }
@@ -128,13 +128,13 @@ var genAlertStyle = (token) => {
128
128
  wordBreak: "break-word"
129
129
  },
130
130
  [`${componentCls}-content`]: {
131
- flex: `1 1 calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
131
+ flex: `1 1 ${calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal()}`,
132
132
  minWidth: 0,
133
- maxWidth: `calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
133
+ maxWidth: calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal(),
134
134
  wordBreak: "break-word"
135
135
  },
136
136
  [`${componentCls}-action`]: {
137
- width: `calc(100% - ${contentStartOffset + token.padding}px)`,
137
+ width: calc("100%").sub(contentStartOffset).sub(token.padding).equal(),
138
138
  marginInlineStart: contentStartOffset,
139
139
  marginTop: token.marginSM
140
140
  },
@@ -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 - 2,
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}px ${paddingLG}px ${paddingLG}px`
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}px ${paddingSM}px ${paddingSM}px`
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: -token.marginSM
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, ${(fontSize * lineHeight - fontSizeLG) / 2}px)`
35
+ transform: `translate(0px, ${translateY})`
35
36
  }
36
37
  }
37
38
  }
@@ -64,7 +64,7 @@ var genVerticalStyle = (size, token) => {
64
64
  };
65
65
  };
66
66
  var genDescriptionsStyle = (token) => {
67
- const { componentCls, typographyComponentCls } = token;
67
+ const { componentCls, typographyComponentCls, calc } = token;
68
68
  return {
69
69
  [`${componentCls}`]: {
70
70
  ...genVerticalStyle("default", token),
@@ -80,7 +80,7 @@ var genDescriptionsStyle = (token) => {
80
80
  },
81
81
  [`${componentCls}-item-container:has(${`${typographyComponentCls}-edit-content`})`]: {
82
82
  alignItems: "center",
83
- height: token.fontSize * token.lineHeight
83
+ height: calc(token.fontSize).mul(token.lineHeight).equal()
84
84
  }
85
85
  },
86
86
  [`${componentCls}${componentCls}-middle`]: genVerticalStyle("middle", token),
@@ -23,9 +23,10 @@ __export(style_exports, {
23
23
  genDrawerStyle: () => genDrawerStyle
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 genDrawerStyle = (token) => {
28
- const { componentCls, antCls, fontSizeHeading3, colorSplit } = token;
29
+ const { componentCls, antCls, fontSizeHeading3, colorSplit, calc } = token;
29
30
  const contentPadding = token.paddingLG;
30
31
  const 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)";
31
32
  const 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)";
@@ -35,7 +36,7 @@ var genDrawerStyle = (token) => {
35
36
  [`${componentCls}-content`]: {
36
37
  [`${componentCls}-header`]: {
37
38
  position: "relative",
38
- padding: `${token.padding}px ${token.paddingLG}px`,
39
+ padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
39
40
  borderBottom: "none",
40
41
  transition: `box-shadow ${token.motionDurationMid}`,
41
42
  // ensure header box-shadow cover body content
@@ -53,8 +54,8 @@ var genDrawerStyle = (token) => {
53
54
  height: "1px",
54
55
  backgroundColor: colorSplit,
55
56
  // 使用负margin让分割线贯通到content边缘
56
- marginLeft: `-${token.paddingLG}px`,
57
- marginRight: `-${token.paddingLG}px`
57
+ marginLeft: calc(token.paddingLG).mul(-1).equal(),
58
+ marginRight: calc(token.paddingLG).mul(-1).equal()
58
59
  }
59
60
  },
60
61
  [`${componentCls}-header-shadow`]: {
@@ -71,7 +72,7 @@ var genDrawerStyle = (token) => {
71
72
  },
72
73
  [`${componentCls}-footer-container`]: {
73
74
  position: "sticky",
74
- padding: `${token.padding}px ${token.paddingLG}px`,
75
+ padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
75
76
  transition: `box-shadow ${token.motionDurationMid}`,
76
77
  // ensure footer box-shadow cover body content
77
78
  zIndex: 10,
@@ -23,9 +23,10 @@ __export(style_exports, {
23
23
  genEmptyStyle: () => genEmptyStyle
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 genEmptyStyle = (token) => {
28
- const { antCls, componentCls, colorTextTertiary, colorText, colorTextSecondary } = token;
29
+ const { antCls, componentCls, colorTextTertiary, colorText, colorTextSecondary, calc } = token;
29
30
  return {
30
31
  [`${componentCls}`]: {
31
32
  [`${componentCls}-image`]: {
@@ -59,7 +60,7 @@ var genEmptyStyle = (token) => {
59
60
  [`${antCls}-steps-item-icon`]: {
60
61
  height: token.controlHeightSM,
61
62
  width: token.controlHeightSM,
62
- lineHeight: `${token.controlHeightSM}px`,
63
+ lineHeight: (0, import_cssinjs.unit)(token.controlHeightSM),
63
64
  backgroundColor: token.colorFillSecondary,
64
65
  // override default border color
65
66
  borderColor: token.colorFillSecondary,
@@ -73,9 +74,9 @@ var genEmptyStyle = (token) => {
73
74
  color: colorText,
74
75
  fontSize: token.fontSize,
75
76
  fontWeight: token.fontWeightStrong,
76
- lineHeight: `${token.controlHeightSM}px`,
77
+ lineHeight: (0, import_cssinjs.unit)(token.controlHeightSM),
77
78
  "&::after": {
78
- top: token.controlHeightSM / 2
79
+ top: calc(token.controlHeightSM).div(2).equal()
79
80
  }
80
81
  },
81
82
  [`${antCls}-steps-item-description`]: {
@@ -25,7 +25,7 @@ __export(style_exports, {
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
27
  var genFormStyle = (token) => {
28
- const { componentCls } = token;
28
+ const { componentCls, calc } = token;
29
29
  return {
30
30
  [componentCls]: {
31
31
  [`${componentCls}-item-extra`]: {
@@ -51,7 +51,7 @@ var genFormStyle = (token) => {
51
51
  paddingBottom: token.paddingXXS
52
52
  },
53
53
  [`${componentCls}-item-description`]: {
54
- paddingBottom: token.paddingXXS + 2,
54
+ paddingBottom: calc(token.paddingXXS).add(2).equal(),
55
55
  fontSize: token.fontSizeSM,
56
56
  color: token.colorTextDescription
57
57
  }
@@ -32,11 +32,12 @@ var genModalStyle = (token) => {
32
32
  fontSizeHeading5,
33
33
  lineHeightHeading5,
34
34
  fontSizeHeading3,
35
- colorSplit
35
+ colorSplit,
36
+ calc
36
37
  } = token;
37
38
  const top = 100;
38
39
  const bottom = 100;
39
- const titleHeight = fontSizeHeading5 * lineHeightHeading5;
40
+ const titleHeight = calc(fontSizeHeading5).mul(lineHeightHeading5).equal();
40
41
  return {
41
42
  /* Modal */
42
43
  [`${componentCls}:not(${componentCls}-confirm):not(${componentCls}-progress)`]: {
@@ -64,13 +65,13 @@ var genModalStyle = (token) => {
64
65
  backgroundColor: colorSplit,
65
66
  // antd Modal content默认padding通常是24px,使用负margin让分割线贯通
66
67
  // 如果antd使用其他padding值,可能需要调整
67
- marginLeft: `-${token.paddingLG}px`,
68
- marginRight: `-${token.paddingLG}px`
68
+ marginLeft: calc(token.paddingLG).mul(-1).equal(),
69
+ marginRight: calc(token.paddingLG).mul(-1).equal()
69
70
  }
70
71
  },
71
72
  [`${componentCls}-body`]: {
72
73
  paddingTop: token.paddingLG,
73
- marginInline: `-${token.marginLG}px`,
74
+ marginInline: calc(token.marginLG).mul(-1).equal(),
74
75
  paddingInline: token.paddingLG
75
76
  }
76
77
  },
@@ -142,7 +143,7 @@ var genModalStyle = (token) => {
142
143
  fontSize: fontSizeHeading3
143
144
  },
144
145
  [`${componentCls}-confirm-body > ${token.iconCls}`]: {
145
- height: token.fontSizeHeading3 * token.lineHeight
146
+ height: calc(token.fontSizeHeading3).mul(token.lineHeight).equal()
146
147
  },
147
148
  [`${componentCls}-confirm-paragraph`]: {
148
149
  rowGap: token.marginSM
@@ -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 genRadioStyle = (token) => {
28
- const { componentCls, radioSize, fontSize, fontSizeLG, lineHeight } = token;
28
+ const { componentCls, radioSize, fontSize, fontSizeLG, lineHeight, calc } = token;
29
+ const marginBottom = calc(calc(fontSize).mul(lineHeight).equal()).sub(radioSize || fontSizeLG).div(-2).equal();
29
30
  return {
30
31
  [`${componentCls}-wrapper`]: {
31
32
  [`${componentCls}`]: {
32
33
  alignSelf: "baseline",
33
34
  [`${componentCls}-inner`]: {
34
- marginBottom: -(fontSize * lineHeight - (radioSize || fontSizeLG)) / 2
35
+ marginBottom
35
36
  }
36
37
  }
37
38
  }
@@ -23,21 +23,22 @@ __export(style_exports, {
23
23
  genSliderStyle: () => genSliderStyle
24
24
  });
25
25
  module.exports = __toCommonJS(style_exports);
26
- var import_lodash = require("lodash");
27
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
28
27
  var genSliderStyle = (token) => {
29
- const { componentCls, dotSize = 8, handleSize = 10, handleLineWidth = 2 } = token;
28
+ const { componentCls, dotSize = 8, handleSize = 10, handleLineWidth = 2, calc } = token;
29
+ const dotSizeHalf = calc(dotSize).div(2).equal();
30
+ const handleOffset = calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal();
30
31
  return {
31
32
  [`${componentCls}${componentCls}-horizontal`]: {
32
33
  [`${componentCls}-mark`]: {
33
34
  [`${componentCls}-mark-text[style*="left: 0%;"]`]: {
34
- transform: `translateX(calc(0% - ${dotSize / 2}px)) !important`
35
+ transform: `translateX(calc(0% - ${dotSizeHalf})) !important`
35
36
  },
36
37
  [`${componentCls}-mark-text[style*="left: 100%;"]`]: {
37
- transform: `translateX(calc(-100% + ${dotSize / 2}px)) !important`
38
+ transform: `translateX(calc(-100% + ${dotSizeHalf})) !important`
38
39
  },
39
40
  [`${componentCls}-mark-text[style="transform: translateX(-50%);"]`]: {
40
- transform: `translateX(calc(0% - ${(handleSize + (0, import_lodash.toNumber)(handleLineWidth) * 2) / 2}px)) !important`
41
+ transform: `translateX(calc(0% - ${handleOffset})) !important`
41
42
  }
42
43
  }
43
44
  }
@@ -25,9 +25,9 @@ __export(style_exports, {
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
27
  var genSizeStyle = (spinDotSize, token) => {
28
- const { componentCls, colorText } = token;
28
+ const { componentCls, colorText, calc } = token;
29
29
  const spinDotWidth = spinDotSize;
30
- const spinDotHight = spinDotWidth * (295 / 397);
30
+ const spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
31
31
  return {
32
32
  // only work for oceanbase indicator
33
33
  [`&${componentCls}-oceanbase`]: {
@@ -43,12 +43,12 @@ var genSizeStyle = (spinDotSize, token) => {
43
43
  };
44
44
  };
45
45
  var genNestedSizeStyle = (spinDotSize, token) => {
46
- const { componentCls, fontSize } = token;
46
+ const { componentCls, fontSize, calc } = token;
47
47
  const spinDotWidth = spinDotSize;
48
- const spinDotHight = spinDotWidth * (295 / 397);
49
- const dotMarginLeft = -spinDotWidth / 2;
50
- const dotMarginTop = -spinDotHight / 2;
51
- const textPaddingTop = (spinDotHight - fontSize) / 2 + 2;
48
+ const spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
49
+ const dotMarginLeft = calc(spinDotWidth).div(-2).equal();
50
+ const dotMarginTop = calc(spinDotHight).div(-2).equal();
51
+ const textPaddingTop = calc(spinDotHight).sub(fontSize).div(2).add(2).equal();
52
52
  return {
53
53
  // only work for oceanbase indicator
54
54
  // `& > ${componentCls}-oceanbase` is compatible with double .ant-spin like Table loading
@@ -61,7 +61,7 @@ var genNestedSizeStyle = (spinDotSize, token) => {
61
61
  paddingTop: textPaddingTop
62
62
  },
63
63
  [`&${componentCls}-show-text ${componentCls}-dot`]: {
64
- marginTop: dotMarginTop - 10
64
+ marginTop: calc(dotMarginTop).sub(10).equal()
65
65
  }
66
66
  }
67
67
  };
@@ -85,6 +85,7 @@ var genSpinStyle = (token) => {
85
85
  };
86
86
  var style_default = (prefixCls) => {
87
87
  const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Spin", (token) => {
88
+ const { calc } = token;
88
89
  return [
89
90
  genSpinStyle({
90
91
  ...token,
@@ -92,11 +93,11 @@ var style_default = (prefixCls) => {
92
93
  // spinDotSize: (token.controlHeightLG / 2) * ratio,
93
94
  // spinDotSizeSM: token.controlHeightLG * 0.35 * ratio,
94
95
  // spinDotSizeLG: token.controlHeight * ratio,
95
- spinDotSize: token.controlHeight * 1.75,
96
+ spinDotSize: calc(token.controlHeight).mul(1.75).equal(),
96
97
  // 56,
97
- spinDotSizeSM: token.controlHeight * 1.125,
98
+ spinDotSizeSM: calc(token.controlHeight).mul(1.125).equal(),
98
99
  // 36
99
- spinDotSizeLG: token.controlHeight * 2.25
100
+ spinDotSizeLG: calc(token.controlHeight).mul(2.25).equal()
100
101
  // 72
101
102
  })
102
103
  ];
@@ -23,6 +23,7 @@ __export(style_exports, {
23
23
  genTableStyle: () => genTableStyle
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 genTableStyle = (token) => {
28
29
  const {
@@ -38,9 +39,9 @@ var genTableStyle = (token) => {
38
39
  colorBorderSecondary,
39
40
  padding,
40
41
  marginLG,
41
- marginXS
42
+ marginXS,
43
+ calc
42
44
  } = token;
43
- console.log(token.fontWeight);
44
45
  return {
45
46
  // 表格通用样式
46
47
  [`${componentCls}-wrapper ${componentCls}`]: {
@@ -93,7 +94,7 @@ var genTableStyle = (token) => {
93
94
  // empty style
94
95
  [`${componentCls}-placeholder td`]: {},
95
96
  [`${componentCls}-empty-wrapper`]: {
96
- minHeight: 360 - token.paddingSM * 2,
97
+ minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
97
98
  display: "flex",
98
99
  justifyContent: "center",
99
100
  alignItems: "center"
@@ -123,7 +124,7 @@ var genTableStyle = (token) => {
123
124
  [`${componentCls}-wrapper ${componentCls}${componentCls}-middle`]: {
124
125
  [`${componentCls}-tbody`]: {
125
126
  [`${componentCls}-empty-wrapper`]: {
126
- minHeight: 260 - token.paddingXS * 2
127
+ minHeight: calc(260).sub(calc(token.paddingXS).mul(2).equal()).equal()
127
128
  }
128
129
  }
129
130
  },
@@ -131,14 +132,14 @@ var genTableStyle = (token) => {
131
132
  [`${componentCls}-wrapper ${componentCls}${componentCls}-small`]: {
132
133
  [`${componentCls}-tbody`]: {
133
134
  [`${componentCls}-empty-wrapper`]: {
134
- minHeight: 160 - token.paddingXXS * 2
135
+ minHeight: calc(160).sub(calc(token.paddingXXS).mul(2).equal()).equal()
135
136
  }
136
137
  }
137
138
  },
138
139
  // 带边框的表格样式
139
140
  [`${componentCls}-wrapper ${componentCls}${componentCls}-bordered`]: {
140
141
  [`${componentCls}-footer`]: {
141
- borderRadius: `0px 0px ${token.borderRadiusLG}px ${token.borderRadiusLG}px`
142
+ borderRadius: `0px 0px ${(0, import_cssinjs.unit)(token.borderRadiusLG)} ${(0, import_cssinjs.unit)(token.borderRadiusLG)}`
142
143
  }
143
144
  },
144
145
  // 带内部边框的表格样式
@@ -201,15 +202,15 @@ var genTableStyle = (token) => {
201
202
  [`${componentCls}-expanded-row > td`]: {
202
203
  // 除内嵌子表格外,设置其他内嵌元素样式
203
204
  [`& > *:not(${componentCls}-wrapper):not(${componentCls}-expanded-row-fixed)`]: {
204
- marginLeft: token.marginXL + token.lineWidth * 2
205
+ marginLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
205
206
  },
206
207
  [`& > *${componentCls}-expanded-row-fixed`]: {
207
- paddingLeft: token.marginXL + token.lineWidth * 2 + token.padding
208
+ paddingLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
208
209
  }
209
210
  },
210
211
  // 嵌套子表格和父表格第一列对齐
211
212
  [`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
212
- marginLeft: token.margin + token.lineWidth * 2
213
+ marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).equal()
213
214
  }
214
215
  }
215
216
  },
@@ -217,7 +218,7 @@ var genTableStyle = (token) => {
217
218
  [`${componentCls}-tbody`]: {
218
219
  // 嵌套子表格和父表格第一列对齐
219
220
  [`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
220
- marginLeft: token.margin + token.lineWidth * 2 + token.margin
221
+ marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
221
222
  }
222
223
  }
223
224
  }
@@ -229,15 +230,15 @@ var genTableStyle = (token) => {
229
230
  [`${componentCls}-expanded-row > td`]: {
230
231
  // 除内嵌子表格外,设置其他内嵌元素样式
231
232
  [`& > *:not(${componentCls}-wrapper):not(${componentCls}-expanded-row-fixed)`]: {
232
- marginLeft: token.marginXL + token.marginXL + token.lineWidth * 2
233
+ marginLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
233
234
  },
234
235
  [`& > *${componentCls}-expanded-row-fixed`]: {
235
- paddingLeft: token.marginXL + token.marginXL + token.lineWidth * 2 + token.padding
236
+ paddingLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
236
237
  }
237
238
  },
238
239
  // 嵌套子表格和父表格第一列对齐
239
240
  [`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
240
- marginLeft: token.margin + token.marginXL + token.lineWidth * 2
241
+ marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
241
242
  }
242
243
  }
243
244
  },
@@ -245,7 +246,7 @@ var genTableStyle = (token) => {
245
246
  [`${componentCls}-tbody`]: {
246
247
  // 嵌套子表格和父表格第一列对齐
247
248
  [`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
248
- marginLeft: token.margin + token.marginXL + token.lineWidth * 2 + token.margin
249
+ marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
249
250
  }
250
251
  }
251
252
  }
@@ -263,7 +264,7 @@ var genTableStyle = (token) => {
263
264
  [`${componentCls}-wrapper`]: {
264
265
  [`${componentCls}-pagination`]: {
265
266
  [`&${antCls}-pagination`]: {
266
- padding: `${padding}px 0`,
267
+ padding: `${(0, import_cssinjs.unit)(padding)} 0`,
267
268
  margin: "0 !important"
268
269
  },
269
270
  // 批量操作栏样式
@@ -276,7 +277,7 @@ var genTableStyle = (token) => {
276
277
  color: colorTextSecondary,
277
278
  fontWeight: token.fontWeightStrong,
278
279
  [`${componentCls}-batch-operation-selection-count`]: {
279
- margin: `0 ${marginXS}px`,
280
+ margin: `0 ${(0, import_cssinjs.unit)(marginXS)}`,
280
281
  color: colorLink
281
282
  }
282
283
  }
@@ -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 - fontSize * lineHeight) / 2;
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}px ${token.lineType} ${token.colorBorder}`,
47
+ border: `${(0, import_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
44
48
  borderRadius: token.borderRadius,
45
49
  position: "relative",
46
- insetInlineStart: -token.paddingSM,
47
- padding: `${marginOffset - token.lineWidth}px ${token.paddingSM - token.lineWidth}px`
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: -marginOffset,
52
- marginBottom: `calc(1em - ${marginOffset}px)`
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: -marginOffset,
58
- marginBottom: -marginOffset
61
+ marginTop: negativeMarginOffset,
62
+ marginBottom: negativeMarginOffset
59
63
  },
60
64
  "h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover": {
61
- marginTop: `${-marginOffset}px !important`,
62
- marginBottom: `${-marginOffset}px !important`
65
+ marginTop: `${negativeMarginOffset} !important`,
66
+ marginBottom: `${negativeMarginOffset} !important`
63
67
  }
64
68
  },
65
69
  [`${componentCls}${componentCls}-edit-content`]: {
66
70
  [`${componentCls}-div&`]: {
67
- insetInlineStart: -token.paddingSM,
68
- marginTop: -marginOffset,
69
- marginBottom: `calc(1em - ${marginOffset}px)`
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: -token.paddingSM,
73
- marginTop: -marginOffset,
74
- marginBottom: -marginOffset
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: -token.paddingSM,
78
- marginTop: `${-marginOffset}px !important`,
79
- marginBottom: `${-marginOffset}px !important`
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.4",
3
+ "version": "1.0.0-alpha.5",
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": "7619cf0d3f5d29dd4c7b67be8265ace300d7e731"
68
+ "gitHead": "c716061dd0da7a44ab09515d43972d2212e59d0f"
70
69
  }