@oceanbase/design 0.4.0 → 0.4.2

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 (114) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/dist/reset.css +1 -0
  4. package/es/_util/genComponentStyleHook.d.ts +0 -1
  5. package/es/_util/genComponentStyleHook.js +1 -25
  6. package/es/button/style/index.js +17 -3
  7. package/es/card/index.js +11 -19
  8. package/es/card/style/index.js +5 -3
  9. package/es/checkbox/index.d.ts +2 -0
  10. package/es/checkbox/index.js +40 -1
  11. package/es/checkbox/style/index.d.ts +9 -0
  12. package/es/checkbox/style/index.js +22 -0
  13. package/es/config-provider/index.d.ts +2 -0
  14. package/es/config-provider/index.js +6 -4
  15. package/es/descriptions/hooks/useItems.d.ts +4 -4
  16. package/es/empty/default.js +34 -55
  17. package/es/empty/style/index.js +13 -11
  18. package/es/global.css +48 -0
  19. package/es/index.d.ts +9 -1
  20. package/es/index.js +5 -1
  21. package/es/progress/index.d.ts +1 -0
  22. package/es/progress/index.js +1 -0
  23. package/es/progress/progress.d.ts +1 -0
  24. package/es/progress/progress.js +1 -0
  25. package/es/radio/index.d.ts +7 -0
  26. package/es/radio/index.js +41 -1
  27. package/es/radio/style/index.d.ts +9 -0
  28. package/es/radio/style/index.js +23 -0
  29. package/es/result/style/index.js +10 -2
  30. package/es/slider/index.d.ts +5 -0
  31. package/es/slider/index.js +36 -1
  32. package/es/slider/style/index.d.ts +9 -0
  33. package/es/slider/style/index.js +21 -0
  34. package/es/switch/index.d.ts +4 -0
  35. package/es/switch/index.js +40 -1
  36. package/es/switch/style/index.d.ts +9 -0
  37. package/es/switch/style/index.js +17 -0
  38. package/es/table/index.js +18 -3
  39. package/es/table/style/index.js +55 -40
  40. package/es/theme/default.js +13 -12
  41. package/es/theme/style/aliyun.less +5 -1
  42. package/es/theme/style/compact.less +7 -3
  43. package/es/theme/style/dark.less +5 -1
  44. package/es/theme/style/default.less +15 -11
  45. package/es/tooltip/MouseTooltip.js +3 -2
  46. package/es/tooltip/index.js +3 -2
  47. package/es/tooltip/style/index.js +11 -2
  48. package/es/typography/Link.js +9 -3
  49. package/es/typography/Paragraph.js +9 -3
  50. package/es/typography/Text.js +9 -3
  51. package/es/typography/Title.js +9 -3
  52. package/es/typography/hooks/useClassName.d.ts +3 -0
  53. package/es/typography/hooks/useClassName.js +11 -0
  54. package/es/typography/style/index.js +45 -3
  55. package/lib/_util/genComponentStyleHook.d.ts +0 -1
  56. package/lib/_util/genComponentStyleHook.js +3 -38
  57. package/lib/button/style/index.js +21 -1
  58. package/lib/card/index.js +10 -21
  59. package/lib/card/style/index.js +7 -2
  60. package/lib/checkbox/index.d.ts +2 -0
  61. package/lib/checkbox/index.js +49 -1
  62. package/lib/checkbox/style/index.d.ts +9 -0
  63. package/lib/checkbox/style/index.js +49 -0
  64. package/lib/config-provider/index.d.ts +2 -0
  65. package/lib/config-provider/index.js +2 -1
  66. package/lib/descriptions/hooks/useItems.d.ts +4 -4
  67. package/lib/empty/default.js +8 -39
  68. package/lib/empty/style/index.js +42 -46
  69. package/lib/global.css +48 -0
  70. package/lib/index.d.ts +9 -1
  71. package/lib/index.js +13 -1
  72. package/lib/progress/index.d.ts +1 -0
  73. package/lib/progress/index.js +2 -0
  74. package/lib/progress/progress.d.ts +1 -0
  75. package/lib/progress/progress.js +23 -0
  76. package/lib/radio/index.d.ts +7 -0
  77. package/lib/radio/index.js +42 -1
  78. package/lib/radio/style/index.d.ts +9 -0
  79. package/lib/radio/style/index.js +49 -0
  80. package/lib/result/style/index.js +10 -1
  81. package/lib/slider/index.d.ts +5 -0
  82. package/lib/slider/index.js +38 -1
  83. package/lib/slider/style/index.d.ts +9 -0
  84. package/lib/slider/style/index.js +51 -0
  85. package/lib/switch/index.d.ts +4 -0
  86. package/lib/switch/index.js +40 -1
  87. package/lib/switch/style/index.d.ts +9 -0
  88. package/lib/switch/style/index.js +44 -0
  89. package/lib/table/index.js +19 -3
  90. package/lib/table/style/index.js +94 -55
  91. package/lib/theme/default.js +13 -12
  92. package/lib/theme/style/aliyun.less +5 -1
  93. package/lib/theme/style/compact.less +7 -3
  94. package/lib/theme/style/dark.less +5 -1
  95. package/lib/theme/style/default.less +15 -11
  96. package/lib/tooltip/MouseTooltip.js +3 -2
  97. package/lib/tooltip/index.js +3 -2
  98. package/lib/tooltip/style/index.js +10 -1
  99. package/lib/typography/Link.js +14 -2
  100. package/lib/typography/Paragraph.js +14 -2
  101. package/lib/typography/Text.js +14 -2
  102. package/lib/typography/Title.js +14 -2
  103. package/lib/typography/hooks/useClassName.d.ts +3 -0
  104. package/lib/typography/hooks/useClassName.js +46 -0
  105. package/lib/typography/style/index.js +49 -1
  106. package/package.json +13 -13
  107. package/es/reset.css +0 -10
  108. package/lib/reset.css +0 -10
  109. /package/es/{_util/fonts → fonts}/Consolas.woff2 +0 -0
  110. /package/es/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
  111. /package/es/{_util/fonts → fonts}/Inter.woff2 +0 -0
  112. /package/lib/{_util/fonts → fonts}/Consolas.woff2 +0 -0
  113. /package/lib/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
  114. /package/lib/{_util/fonts → fonts}/Inter.woff2 +0 -0
@@ -312,6 +312,9 @@
312
312
  @colorFillSecondary: rgba(255, 255, 255, 0.12);
313
313
  @colorFillTertiary: rgba(255, 255, 255, 0.08);
314
314
  @colorFillQuaternary: rgba(255, 255, 255, 0.04);
315
+ @colorBgSolid: rgba(255, 255, 255, 0.95);
316
+ @colorBgSolidHover: rgb(255, 255, 255);
317
+ @colorBgSolidActive: rgba(255, 255, 255, 0.9);
315
318
  @colorBgLayout: #000000;
316
319
  @colorBgContainer: #141414;
317
320
  @colorBgElevated: #1f1f1f;
@@ -339,6 +342,7 @@
339
342
  @colorSuccessTextActive: #0e845d;
340
343
  @colorErrorBg: #2b1416;
341
344
  @colorErrorBgHover: #44191a;
345
+ @colorErrorBgFilledHover: #421a1b;
342
346
  @colorErrorBgActive: #591f1f;
343
347
  @colorErrorBorder: #591f1f;
344
348
  @colorErrorBorderHover: #7b2525;
@@ -428,7 +432,7 @@
428
432
  @colorErrorOutline: rgba(250, 20, 40, 0.1);
429
433
  @colorWarningOutline: rgba(180, 93, 0, 0.15);
430
434
  @fontSizeIcon: 12;
431
- @lineWidthFocus: 4;
435
+ @lineWidthFocus: 3;
432
436
  @controlOutlineWidth: 2;
433
437
  @controlInteractiveSize: 16;
434
438
  @controlItemBgHover: rgba(255, 255, 255, 0.08);
@@ -312,6 +312,9 @@
312
312
  @colorFillSecondary: #e2e8f3;
313
313
  @colorFillTertiary: #f3f6fc;
314
314
  @colorFillQuaternary: #f8fafe;
315
+ @colorBgSolid: rgb(0, 0, 0);
316
+ @colorBgSolidHover: rgba(0, 0, 0, 0.75);
317
+ @colorBgSolidActive: rgba(0, 0, 0, 0.95);
315
318
  @colorBgLayout: #f3f6fc;
316
319
  @colorBgContainer: #ffffff;
317
320
  @colorBgElevated: #ffffff;
@@ -339,6 +342,7 @@
339
342
  @colorSuccessTextActive: #00b378;
340
343
  @colorErrorBg: #ffebeb;
341
344
  @colorErrorBgHover: #ffd6d6;
345
+ @colorErrorBgFilledHover: #ffd7d3;
342
346
  @colorErrorBgActive: #ffbcb5;
343
347
  @colorErrorBorder: #ffb3b3;
344
348
  @colorErrorBorderHover: #ff7575;
@@ -372,22 +376,22 @@
372
376
  @fontSizeSM: 12;
373
377
  @fontSizeLG: 16;
374
378
  @fontSizeXL: 20;
375
- @fontSizeHeading1: 32;
376
- @fontSizeHeading2: 24;
377
- @fontSizeHeading3: 20;
378
- @fontSizeHeading4: 16;
379
- @fontSizeHeading5: 14;
379
+ @fontSizeHeading1: 38;
380
+ @fontSizeHeading2: 30;
381
+ @fontSizeHeading3: 24;
382
+ @fontSizeHeading4: 20;
383
+ @fontSizeHeading5: 16;
380
384
  @lineHeight: 1.5714285714285714;
381
385
  @lineHeightLG: 1.5;
382
386
  @lineHeightSM: 1.6666666666666667;
383
387
  @fontHeight: 22;
384
388
  @fontHeightLG: 24;
385
389
  @fontHeightSM: 20;
386
- @lineHeightHeading1: 1.25;
387
- @lineHeightHeading2: 1.3333333333333333;
388
- @lineHeightHeading3: 1.4;
389
- @lineHeightHeading4: 1.5;
390
- @lineHeightHeading5: 1.5714285714285714;
390
+ @lineHeightHeading1: 1.2105263157894737;
391
+ @lineHeightHeading2: 1.2666666666666666;
392
+ @lineHeightHeading3: 1.3333333333333333;
393
+ @lineHeightHeading4: 1.4;
394
+ @lineHeightHeading5: 1.5;
391
395
  @sizeXXL: 48;
392
396
  @sizeXL: 32;
393
397
  @sizeLG: 24;
@@ -410,6 +414,7 @@
410
414
  @borderRadiusOuter: 4;
411
415
  @boxShadowSecondary: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
412
416
  @boxShadow: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
417
+ @lineWidthFocus: 3;
413
418
  @colorFillContent: #e2e8f3;
414
419
  @colorFillContentHover: #cdd5e4;
415
420
  @colorFillAlter: #f8fafe;
@@ -430,7 +435,6 @@
430
435
  @colorErrorOutline: rgba(255, 5, 5, 0.08);
431
436
  @colorWarningOutline: rgba(255, 164, 19, 0.11);
432
437
  @fontSizeIcon: 12;
433
- @lineWidthFocus: 4;
434
438
  @controlOutlineWidth: 2;
435
439
  @controlInteractiveSize: 16;
436
440
  @controlItemBgHover: #f3f6fc;
@@ -49,6 +49,7 @@ var MouseTooltip = ({
49
49
  mouseLeaveDelay = 0.1,
50
50
  ...restProps
51
51
  }) => {
52
+ var _a, _b;
52
53
  const { token } = import_theme.default.useToken();
53
54
  const [visible, setVisible] = (0, import_react.useState)(false);
54
55
  const { color: textColor, ...restOverlayInnerStyle } = overlayInnerStyle || {};
@@ -95,10 +96,10 @@ var MouseTooltip = ({
95
96
  boxShadow: token.boxShadowSecondary,
96
97
  borderRadius: token.borderRadius,
97
98
  // @ts-ignore
98
- color: textColor || token.Tooltip.colorTextLightSolid || token.colorTextLightSolid,
99
+ color: textColor || ((_a = token.Tooltip) == null ? void 0 : _a.colorTextLightSolid) || token.colorTextLightSolid,
99
100
  backgroundColor: (
100
101
  // @ts-ignore
101
- backgroundColor || token.Tooltip.colorBgSpotlight || token.colorBgSpotlight
102
+ backgroundColor || ((_b = token.Tooltip) == null ? void 0 : _b.colorBgSpotlight) || token.colorBgSpotlight
102
103
  ),
103
104
  left: isOverWidth ? clientX - tooltipWidth - offset : clientX + offset,
104
105
  top: isOverHeight ? clientY - tooltipHeight - offset : clientY + offset,
@@ -66,7 +66,8 @@ var Tooltip = import_react.default.forwardRef(
66
66
  const { prefixCls: customizePrefixCls } = restProps;
67
67
  const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
68
68
  const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
69
- const tooltipCls = (0, import_classnames.default)(className, hashId);
69
+ const tooltipCls = (0, import_classnames.default)(className);
70
+ const mouseTooltipCls = (0, import_classnames.default)(prefixCls, className, hashId);
70
71
  const [innerOpen, setInnerOpen] = (0, import_react.useState)(open ?? visible ?? defaultOpen ?? defaultVisible);
71
72
  const noTitle = !title && !overlay && title !== 0;
72
73
  const newOpen = open ?? visible ?? (noTitle ? false : innerOpen);
@@ -93,7 +94,7 @@ var Tooltip = import_react.default.forwardRef(
93
94
  color: typeItem == null ? void 0 : typeItem.color,
94
95
  ...overlayInnerStyle
95
96
  },
96
- className: tooltipCls,
97
+ className: mouseTooltipCls,
97
98
  overlay,
98
99
  ...restProps
99
100
  },
@@ -28,13 +28,22 @@ var genTooltipStyle = (token) => {
28
28
  const { componentCls } = token;
29
29
  return {
30
30
  [componentCls]: {
31
+ maxWidth: 300,
32
+ [`${componentCls}-inner`]: {
33
+ maxHeight: 250,
34
+ overflow: "auto"
35
+ },
31
36
  [`${componentCls}-close-icon-wrap`]: {
32
37
  display: "flex",
33
38
  justifyContent: "space-between",
34
39
  alignItems: "flex-start",
35
40
  wordBreak: "break-all",
36
41
  [`${componentCls}-close-icon`]: {
37
- cursor: "pointer"
42
+ cursor: "pointer",
43
+ color: token.colorIcon,
44
+ "&:hover": {
45
+ color: token.colorIconHover
46
+ }
38
47
  }
39
48
  }
40
49
  }
@@ -36,16 +36,28 @@ module.exports = __toCommonJS(Link_exports);
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
+ var import_useClassName = __toESM(require("./hooks/useClassName"));
39
40
  var import_style = __toESM(require("./style"));
40
41
  __reExport(Link_exports, require("antd/es/typography/Link"), module.exports);
41
42
  var { Link: AntLink } = import_antd.Typography;
42
43
  var Link = import_react.default.forwardRef(
43
- ({ prefixCls: customizePrefixCls, children, ...restProps }, ref) => {
44
+ ({ editable, prefixCls: customizePrefixCls, className, children, ...restProps }, ref) => {
44
45
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
46
  const prefixCls = getPrefixCls("typography", customizePrefixCls);
46
47
  const { wrapSSR } = (0, import_style.default)(prefixCls);
48
+ const typographyCls = (0, import_useClassName.default)(prefixCls, className, editable);
47
49
  return wrapSSR(
48
- /* @__PURE__ */ import_react.default.createElement(AntLink, { ref, prefixCls: customizePrefixCls, ...restProps }, children)
50
+ /* @__PURE__ */ import_react.default.createElement(
51
+ AntLink,
52
+ {
53
+ ref,
54
+ editable,
55
+ prefixCls: customizePrefixCls,
56
+ className: typographyCls,
57
+ ...restProps
58
+ },
59
+ children
60
+ )
49
61
  );
50
62
  }
51
63
  );
@@ -36,16 +36,28 @@ module.exports = __toCommonJS(Paragraph_exports);
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
+ var import_useClassName = __toESM(require("./hooks/useClassName"));
39
40
  var import_style = __toESM(require("./style"));
40
41
  __reExport(Paragraph_exports, require("antd/es/typography/Paragraph"), module.exports);
41
42
  var { Paragraph: AntParagraph } = import_antd.Typography;
42
43
  var Paragraph = import_react.default.forwardRef(
43
- ({ prefixCls: customizePrefixCls, children, ...restProps }, ref) => {
44
+ ({ editable, prefixCls: customizePrefixCls, className, children, ...restProps }, ref) => {
44
45
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
46
  const prefixCls = getPrefixCls("typography", customizePrefixCls);
46
47
  const { wrapSSR } = (0, import_style.default)(prefixCls);
48
+ const typographyCls = (0, import_useClassName.default)(prefixCls, className, editable);
47
49
  return wrapSSR(
48
- /* @__PURE__ */ import_react.default.createElement(AntParagraph, { ref, prefixCls: customizePrefixCls, ...restProps }, children)
50
+ /* @__PURE__ */ import_react.default.createElement(
51
+ AntParagraph,
52
+ {
53
+ ref,
54
+ editable,
55
+ prefixCls: customizePrefixCls,
56
+ className: typographyCls,
57
+ ...restProps
58
+ },
59
+ children
60
+ )
49
61
  );
50
62
  }
51
63
  );
@@ -36,16 +36,28 @@ module.exports = __toCommonJS(Text_exports);
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
+ var import_useClassName = __toESM(require("./hooks/useClassName"));
39
40
  var import_style = __toESM(require("./style"));
40
41
  __reExport(Text_exports, require("antd/es/typography/Text"), module.exports);
41
42
  var { Text: AntText } = import_antd.Typography;
42
43
  var Text = import_react.default.forwardRef(
43
- ({ prefixCls: customizePrefixCls, children, ...restProps }, ref) => {
44
+ ({ editable, prefixCls: customizePrefixCls, className, children, ...restProps }, ref) => {
44
45
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
46
  const prefixCls = getPrefixCls("typography", customizePrefixCls);
46
47
  const { wrapSSR } = (0, import_style.default)(prefixCls);
48
+ const typographyCls = (0, import_useClassName.default)(prefixCls, className, editable);
47
49
  return wrapSSR(
48
- /* @__PURE__ */ import_react.default.createElement(AntText, { ref, prefixCls: customizePrefixCls, ...restProps }, children)
50
+ /* @__PURE__ */ import_react.default.createElement(
51
+ AntText,
52
+ {
53
+ ref,
54
+ editable,
55
+ prefixCls: customizePrefixCls,
56
+ className: typographyCls,
57
+ ...restProps
58
+ },
59
+ children
60
+ )
49
61
  );
50
62
  }
51
63
  );
@@ -36,16 +36,28 @@ module.exports = __toCommonJS(Title_exports);
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
+ var import_useClassName = __toESM(require("./hooks/useClassName"));
39
40
  var import_style = __toESM(require("./style"));
40
41
  __reExport(Title_exports, require("antd/es/typography/Title"), module.exports);
41
42
  var { Title: AntTitle } = import_antd.Typography;
42
43
  var Title = import_react.default.forwardRef(
43
- ({ prefixCls: customizePrefixCls, children, ...restProps }, ref) => {
44
+ ({ editable, prefixCls: customizePrefixCls, className, children, ...restProps }, ref) => {
44
45
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
46
  const prefixCls = getPrefixCls("typography", customizePrefixCls);
46
47
  const { wrapSSR } = (0, import_style.default)(prefixCls);
48
+ const typographyCls = (0, import_useClassName.default)(prefixCls, className, editable);
47
49
  return wrapSSR(
48
- /* @__PURE__ */ import_react.default.createElement(AntTitle, { ref, prefixCls: customizePrefixCls, ...restProps }, children)
50
+ /* @__PURE__ */ import_react.default.createElement(
51
+ AntTitle,
52
+ {
53
+ ref,
54
+ editable,
55
+ prefixCls: customizePrefixCls,
56
+ className: typographyCls,
57
+ ...restProps
58
+ },
59
+ children
60
+ )
49
61
  );
50
62
  }
51
63
  );
@@ -0,0 +1,3 @@
1
+ import type { BlockProps } from 'antd/es/typography/Base';
2
+ declare const useClassName: (prefixCls: string, className: string, editable?: BlockProps['editable']) => string;
3
+ export default useClassName;
@@ -0,0 +1,46 @@
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/typography/hooks/useClassName.ts
30
+ var useClassName_exports = {};
31
+ __export(useClassName_exports, {
32
+ default: () => useClassName_default
33
+ });
34
+ module.exports = __toCommonJS(useClassName_exports);
35
+ var import_classnames = __toESM(require("classnames"));
36
+ var useClassName = (prefixCls, className, editable) => {
37
+ var _a;
38
+ const typographyCls = (0, import_classnames.default)(
39
+ {
40
+ [`${prefixCls}-editable-text`]: typeof editable === "object" && ((_a = editable == null ? void 0 : editable.triggerType) == null ? void 0 : _a.includes("text"))
41
+ },
42
+ className
43
+ );
44
+ return typographyCls;
45
+ };
46
+ var useClassName_default = useClassName;
@@ -25,7 +25,8 @@ __export(style_exports, {
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
27
  var genTypographyStyle = (token) => {
28
- const { componentCls } = token;
28
+ const { componentCls, controlHeight, fontSize, lineHeight } = token;
29
+ const marginOffset = (controlHeight - fontSize * lineHeight) / 2;
29
30
  return {
30
31
  // inherit color and lineHeight from parent instead of fixed colorText
31
32
  [`span${componentCls}`]: {
@@ -37,6 +38,53 @@ var genTypographyStyle = (token) => {
37
38
  lineHeight: "inherit",
38
39
  color: "inherit",
39
40
  fontSize: "inherit"
41
+ },
42
+ [`${componentCls}`]: {
43
+ [`${componentCls}-edit`]: {
44
+ fontSize: token.fontSize
45
+ }
46
+ },
47
+ [`${componentCls}${componentCls}-editable-text:not(${componentCls}-edit-content)`]: {
48
+ "&:hover": {
49
+ background: token.colorBgContainer,
50
+ border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
51
+ borderRadius: token.borderRadius,
52
+ position: "relative",
53
+ insetInlineStart: -token.paddingSM,
54
+ padding: `${marginOffset - token.lineWidth}px ${token.paddingSM - token.lineWidth}px`
55
+ },
56
+ "div&:hover": {
57
+ height: token.controlHeight,
58
+ marginTop: -marginOffset,
59
+ marginBottom: `calc(1em - ${marginOffset}px)`
60
+ },
61
+ "span&:hover": {
62
+ display: "inline-block",
63
+ height: token.controlHeight,
64
+ marginTop: -marginOffset,
65
+ marginBottom: -marginOffset
66
+ },
67
+ "h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover": {
68
+ marginTop: `${-marginOffset}px !important`,
69
+ marginBottom: `${-marginOffset}px !important`
70
+ }
71
+ },
72
+ [`${componentCls}${componentCls}-edit-content`]: {
73
+ [`${componentCls}-div&`]: {
74
+ insetInlineStart: -token.paddingSM,
75
+ marginTop: -marginOffset,
76
+ marginBottom: `calc(1em - ${marginOffset}px)`
77
+ },
78
+ [`${componentCls}-span&`]: {
79
+ insetInlineStart: -token.paddingSM,
80
+ marginTop: -marginOffset,
81
+ marginBottom: -marginOffset
82
+ },
83
+ [`${componentCls}-h1&, ${componentCls}-h2&, ${componentCls}-h3&, ${componentCls}-h4&, ${componentCls}-h5&`]: {
84
+ insetInlineStart: -token.paddingSM,
85
+ marginTop: `${-marginOffset}px !important`,
86
+ marginBottom: `${-marginOffset}px !important`
87
+ }
40
88
  }
41
89
  };
42
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -31,16 +31,15 @@
31
31
  "LICENSE"
32
32
  ],
33
33
  "scripts": {
34
- "build": "father build",
35
- "postbuild": "cp src/style/reset.css dist/"
34
+ "build": "father build && cp src/style/reset.css dist/"
36
35
  },
37
36
  "dependencies": {
38
- "@ant-design/cssinjs": "^1.21.1",
37
+ "@ant-design/cssinjs": "^1.22.0",
39
38
  "@oceanbase/aliyun-theme": "^0.1.6",
40
- "@oceanbase/icons": "^0.4.0",
41
- "@oceanbase/util": "^0.4.0",
39
+ "@oceanbase/icons": "^0.4.1",
40
+ "@oceanbase/util": "^0.4.1",
42
41
  "ahooks": "^2.10.14",
43
- "antd": "^5.20.6",
42
+ "antd": "^5.22.1",
44
43
  "classnames": "^2.5.1",
45
44
  "lodash": "^4.17.21",
46
45
  "lottie-web": "^5.12.2",
@@ -49,16 +48,17 @@
49
48
  "react-sticky-mouse-tooltip": "^0.0.1"
50
49
  },
51
50
  "devDependencies": {
52
- "@babel/cli": "^7.24.8",
53
- "@babel/preset-env": "^7.25.4",
51
+ "@babel/cli": "^7.25.9",
52
+ "@babel/preset-env": "^7.26.0",
54
53
  "antd-token-previewer": "^2.0.8",
55
- "rc-select": "^14.15.1",
56
- "rc-table": "^7.47.1",
57
- "rc-tree-select": "^5.22.1"
54
+ "rc-select": "^14.16.3",
55
+ "rc-slider": "^11.1.7",
56
+ "rc-table": "^7.48.1",
57
+ "rc-tree-select": "^5.24.4"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": ">=16.9.0",
61
61
  "react-dom": ">=16.9.0"
62
62
  },
63
- "gitHead": "6b8b9e3df994419ff6a6c79cc607c0b4692e4189"
63
+ "gitHead": "67c1567aad182c4b3b7ecb421928fa3c87f321e0"
64
64
  }
package/es/reset.css DELETED
@@ -1,10 +0,0 @@
1
- /* 引入 antd/dist/reset.css,以重置基本样式,保证原生元素遵从 antd 规范样式 */
2
- /* ref: https://ant.design/docs/react/migration-v5-cn#%E6%8A%80%E6%9C%AF%E8%B0%83%E6%95%B4 */
3
- @import '~antd/dist/reset.css';
4
-
5
- pre,
6
- code,
7
- kbd,
8
- samp {
9
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
10
- }
package/lib/reset.css DELETED
@@ -1,10 +0,0 @@
1
- /* 引入 antd/dist/reset.css,以重置基本样式,保证原生元素遵从 antd 规范样式 */
2
- /* ref: https://ant.design/docs/react/migration-v5-cn#%E6%8A%80%E6%9C%AF%E8%B0%83%E6%95%B4 */
3
- @import '~antd/dist/reset.css';
4
-
5
- pre,
6
- code,
7
- kbd,
8
- samp {
9
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
10
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes