@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.
Files changed (58) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/dist/reset.css +2 -1
  4. package/es/alert/index.js +3 -0
  5. package/es/alert/style/index.js +21 -22
  6. package/es/button/style/index.js +10 -2
  7. package/es/card/style/index.js +7 -5
  8. package/es/checkbox/style/index.js +4 -2
  9. package/es/config-provider/index.d.ts +2 -1
  10. package/es/config-provider/index.js +41 -16
  11. package/es/descriptions/style/index.js +3 -2
  12. package/es/drawer/style/index.js +7 -5
  13. package/es/empty/style/index.js +6 -4
  14. package/es/form/FormItem.d.ts +1 -1
  15. package/es/form/style/index.js +3 -2
  16. package/es/index.d.ts +0 -1
  17. package/es/index.js +0 -1
  18. package/es/modal/style/index.js +7 -6
  19. package/es/radio/style/index.js +4 -2
  20. package/es/slider/style/index.js +7 -5
  21. package/es/spin/style/index.js +14 -11
  22. package/es/style/global.d.ts +5 -0
  23. package/es/style/global.js +62 -0
  24. package/es/style/reset.css +2 -1
  25. package/es/table/style/index.js +17 -16
  26. package/es/theme/compact.d.ts +1 -1
  27. package/es/theme/compact.js +2 -6
  28. package/es/theme/default.js +28 -9
  29. package/es/typography/style/index.js +25 -20
  30. package/lib/alert/index.js +2 -0
  31. package/lib/alert/style/index.js +18 -19
  32. package/lib/button/style/index.js +8 -2
  33. package/lib/card/style/index.js +6 -5
  34. package/lib/checkbox/style/index.js +3 -2
  35. package/lib/config-provider/index.d.ts +2 -1
  36. package/lib/config-provider/index.js +60 -12
  37. package/lib/descriptions/style/index.js +2 -2
  38. package/lib/drawer/style/index.js +6 -5
  39. package/lib/empty/style/index.js +5 -4
  40. package/lib/form/FormItem.d.ts +1 -1
  41. package/lib/form/style/index.js +2 -2
  42. package/lib/index.d.ts +0 -1
  43. package/lib/index.js +0 -1
  44. package/lib/modal/style/index.js +7 -6
  45. package/lib/radio/style/index.js +3 -2
  46. package/lib/slider/style/index.js +6 -5
  47. package/lib/spin/style/index.js +12 -11
  48. package/lib/style/global.d.ts +5 -0
  49. package/lib/style/global.js +101 -0
  50. package/lib/style/reset.css +2 -1
  51. package/lib/table/style/index.js +17 -16
  52. package/lib/theme/compact.d.ts +1 -1
  53. package/lib/theme/compact.js +1 -5
  54. package/lib/theme/default.js +28 -9
  55. package/lib/typography/style/index.js +24 -20
  56. package/package.json +2 -3
  57. package/es/global.css +0 -48
  58. package/lib/global.css +0 -48
@@ -45,7 +45,9 @@ var import_static_function = __toESM(require("../static-function"));
45
45
  var import_theme = __toESM(require("../theme"));
46
46
  var import_default = __toESM(require("../theme/default"));
47
47
  var import_dark = __toESM(require("../theme/dark"));
48
+ var import_compact = __toESM(require("../theme/compact"));
48
49
  var import_DefaultRenderEmpty = __toESM(require("./DefaultRenderEmpty"));
50
+ var import_global = __toESM(require("../style/global"));
49
51
  __reExport(config_provider_exports, require("./navigate"), module.exports);
50
52
  __reExport(config_provider_exports, require("antd/es/config-provider/context"), module.exports);
51
53
  __reExport(config_provider_exports, require("antd/es/config-provider/SizeContext"), module.exports);
@@ -57,8 +59,8 @@ var ExtendedConfigContext = import_react.default.createContext({
57
59
  hideOnSinglePage: false,
58
60
  injectStaticFunction: true
59
61
  });
60
- var getLocaleTokenValue = (locale, tokenKey, tokenValue, tokenValueEn) => {
61
- return tokenValue !== import_default.default.token[tokenKey] ? { [tokenKey]: tokenValue } : ["en", "en-gb"].includes(locale.locale) ? { [tokenKey]: tokenValueEn } : {};
62
+ var getLocaleTokenValue = (mergedThemeToken, locale, tokenKey, tokenValue, tokenValueEn) => {
63
+ return tokenValue !== mergedThemeToken[tokenKey] ? { [tokenKey]: tokenValue } : ["en", "en-gb"].includes(locale.locale) ? { [tokenKey]: tokenValueEn } : {};
62
64
  };
63
65
  var ConfigProvider = ({
64
66
  children,
@@ -79,13 +81,43 @@ var ConfigProvider = ({
79
81
  var _a, _b, _c, _d;
80
82
  const parentContext = import_react.default.useContext(import_antd.ConfigProvider.ConfigContext);
81
83
  const parentExtendedContext = import_react.default.useContext(ExtendedConfigContext);
82
- const { isDark, isAliyun } = (0, import_lodash.merge)({}, parentContext.theme, theme);
83
- const customTheme = isAliyun ? import_aliyun_theme.default : isDark ? import_dark.default : void 0;
84
+ const { isAliyun, isDark, isCompact } = (0, import_lodash.merge)({}, parentContext.theme, theme);
85
+ const aliyunThemeConfig = isAliyun ? import_aliyun_theme.default : void 0;
86
+ const darkThemeConfig = isDark && !isAliyun ? isCompact ? import_dark.default : {
87
+ ...import_dark.default,
88
+ token: {
89
+ ...import_dark.default.token,
90
+ ...Object.fromEntries(
91
+ Object.entries(import_default.default.token).filter(
92
+ ([key]) => {
93
+ var _a2;
94
+ return !((_a2 = key == null ? void 0 : key.toLowerCase()) == null ? void 0 : _a2.startsWith("color"));
95
+ }
96
+ )
97
+ )
98
+ }
99
+ } : void 0;
100
+ const compactThemeConfig = isCompact && !isAliyun ? isDark ? import_compact.default : {
101
+ ...import_compact.default,
102
+ token: {
103
+ ...import_compact.default.token,
104
+ ...Object.fromEntries(
105
+ Object.entries(import_default.default.token).filter(
106
+ ([key]) => {
107
+ var _a2;
108
+ return ((_a2 = key == null ? void 0 : key.toLowerCase()) == null ? void 0 : _a2.startsWith("color")) && !["colorBgBase", "colorTextBase"].includes(key);
109
+ }
110
+ )
111
+ )
112
+ }
113
+ } : void 0;
84
114
  const mergedTheme = (0, import_lodash.merge)(
85
115
  {},
86
- customTheme ? {} : import_default.default,
116
+ isAliyun ? {} : isDark || isCompact ? import_theme.default.defaultSeed : import_default.default,
87
117
  parentContext.theme,
88
- customTheme,
118
+ aliyunThemeConfig,
119
+ darkThemeConfig,
120
+ compactThemeConfig,
89
121
  theme
90
122
  );
91
123
  const { token } = import_theme.default.useToken();
@@ -154,9 +186,22 @@ var ConfigProvider = ({
154
186
  tabs: (0, import_lodash.merge)({}, parentContext.tabs, tabs),
155
187
  theme: (0, import_lodash.merge)({}, mergedTheme, {
156
188
  token: {
157
- ...getLocaleTokenValue(mergedLocale, "fontFamily", fontFamily, import_default.fontFamilyEn),
158
- ...getLocaleTokenValue(mergedLocale, "fontWeight", fontWeight, import_default.fontWeightEn),
159
189
  ...getLocaleTokenValue(
190
+ mergedTheme.token || {},
191
+ mergedLocale,
192
+ "fontFamily",
193
+ fontFamily,
194
+ import_default.fontFamilyEn
195
+ ),
196
+ ...getLocaleTokenValue(
197
+ mergedTheme.token || {},
198
+ mergedLocale,
199
+ "fontWeight",
200
+ fontWeight,
201
+ import_default.fontWeightEn
202
+ ),
203
+ ...getLocaleTokenValue(
204
+ mergedTheme.token || {},
160
205
  mergedLocale,
161
206
  "fontWeightStrong",
162
207
  fontWeightStrong,
@@ -175,10 +220,13 @@ var ConfigProvider = ({
175
220
  // inject static function to outermost ConfigProvider only
176
221
  injectStaticFunction: false
177
222
  },
178
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
179
- children,
180
- parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
181
- ] }) })
223
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: [
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, {}),
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
226
+ children,
227
+ parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
228
+ ] })
229
+ ] })
182
230
  }
183
231
  )
184
232
  }
@@ -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`]: {
@@ -4,7 +4,7 @@ import type { FormItemProps as AntFormItemProps } from 'antd/es/form';
4
4
  import type { TooltipProps } from '../tooltip';
5
5
  declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
6
6
  useStatus: () => {
7
- status?: "" | "success" | "warning" | "error" | "validating";
7
+ status?: "" | "warning" | "error" | "success" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
@@ -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
  }
package/lib/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './global.css';
2
1
  export * from 'antd';
3
2
  export { version } from '../package.json';
4
3
  export { default as Alert } from './alert';
package/lib/index.js CHANGED
@@ -72,7 +72,6 @@ __export(src_exports, {
72
72
  version: () => import_package.version
73
73
  });
74
74
  module.exports = __toCommonJS(src_exports);
75
- var import_global = require("./global.css");
76
75
  __reExport(src_exports, require("antd"), module.exports);
77
76
  var import_package = require("../package.json");
78
77
  var import_alert = __toESM(require("./alert"));
@@ -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
  ];
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import 'antd/dist/reset.css';
3
+ declare const GlobalStyle: React.FC;
4
+ export { GlobalStyle };
5
+ export default GlobalStyle;
@@ -0,0 +1,101 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/style/global.tsx
30
+ var global_exports = {};
31
+ __export(global_exports, {
32
+ GlobalStyle: () => GlobalStyle,
33
+ default: () => global_default
34
+ });
35
+ module.exports = __toCommonJS(global_exports);
36
+ var import_cssinjs = require("@ant-design/cssinjs");
37
+ var import_theme = __toESM(require("../theme"));
38
+ var import_Inter = __toESM(require("../fonts/Inter.woff2"));
39
+ var import_Consolas = __toESM(require("../fonts/Consolas.woff2"));
40
+ var import_HelveticaNeue = __toESM(require("../fonts/HelveticaNeue.woff2"));
41
+ var import_reset = require("antd/dist/reset.css");
42
+ var import_jsx_runtime = require("react/jsx-runtime");
43
+ var genGlobalStyle = (token) => {
44
+ return [
45
+ // Priority: local font > self-hosting font > remote font
46
+ {
47
+ "@font-face": {
48
+ fontFamily: "'Inter'",
49
+ src: `local('Inter'), url(${import_Inter.default}) format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')`,
50
+ fontDisplay: "swap"
51
+ }
52
+ },
53
+ {
54
+ "@font-face": {
55
+ fontFamily: "'Consolas'",
56
+ src: `local('Consolas'), url(${import_Consolas.default}) format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2')`,
57
+ fontDisplay: "swap"
58
+ }
59
+ },
60
+ {
61
+ "@font-face": {
62
+ fontFamily: "'Helvetica Neue'",
63
+ src: `local('Helvetica Neue'), url(${import_HelveticaNeue.default}) format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2')`,
64
+ fontDisplay: "swap"
65
+ }
66
+ },
67
+ // Global element styles
68
+ {
69
+ "pre, code, kbd, samp": {
70
+ fontFamily: token.fontFamilyCode
71
+ },
72
+ "*": {
73
+ scrollbarColor: `${token.colorFillSecondary} transparent`
74
+ },
75
+ ".rc-virtual-list-scrollbar-thumb": {
76
+ background: `${token.colorFillSecondary} !important`
77
+ }
78
+ }
79
+ ];
80
+ };
81
+ var GlobalStyle = () => {
82
+ const { theme, token } = import_theme.default.useToken();
83
+ const wrapSSR = (0, import_cssinjs.useStyleRegister)(
84
+ {
85
+ theme,
86
+ token,
87
+ path: ["global"],
88
+ hashId: "",
89
+ // Empty hashId for global styles
90
+ order: -1e3
91
+ // Inject before other styles
92
+ },
93
+ () => genGlobalStyle(token)
94
+ );
95
+ return wrapSSR(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {}));
96
+ };
97
+ var global_default = GlobalStyle;
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
100
+ GlobalStyle
101
+ });
@@ -1 +1,2 @@
1
- @import '~antd/dist/reset.css';
1
+ /* antd/dist/reset.css is imported in global.tsx */
2
+ /* reserve this file for compatibility with antd */
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  declare const compactTheme: {
2
- token: import("antd/es/theme/internal").AliasToken;
2
+ token: import("antd/es/theme/internal").SeedToken;
3
3
  components: {
4
4
  InputNumber: {
5
5
  handleVisible: boolean;