@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.
- package/dist/design.min.css +1 -1
- package/dist/design.min.js +1 -1
- package/dist/reset.css +1 -0
- package/es/_util/genComponentStyleHook.d.ts +0 -1
- package/es/_util/genComponentStyleHook.js +1 -25
- package/es/button/style/index.js +17 -3
- package/es/card/index.js +11 -19
- package/es/card/style/index.js +5 -3
- package/es/checkbox/index.d.ts +2 -0
- package/es/checkbox/index.js +40 -1
- package/es/checkbox/style/index.d.ts +9 -0
- package/es/checkbox/style/index.js +22 -0
- package/es/config-provider/index.d.ts +2 -0
- package/es/config-provider/index.js +6 -4
- package/es/descriptions/hooks/useItems.d.ts +4 -4
- package/es/empty/default.js +34 -55
- package/es/empty/style/index.js +13 -11
- package/es/global.css +48 -0
- package/es/index.d.ts +9 -1
- package/es/index.js +5 -1
- package/es/progress/index.d.ts +1 -0
- package/es/progress/index.js +1 -0
- package/es/progress/progress.d.ts +1 -0
- package/es/progress/progress.js +1 -0
- package/es/radio/index.d.ts +7 -0
- package/es/radio/index.js +41 -1
- package/es/radio/style/index.d.ts +9 -0
- package/es/radio/style/index.js +23 -0
- package/es/result/style/index.js +10 -2
- package/es/slider/index.d.ts +5 -0
- package/es/slider/index.js +36 -1
- package/es/slider/style/index.d.ts +9 -0
- package/es/slider/style/index.js +21 -0
- package/es/switch/index.d.ts +4 -0
- package/es/switch/index.js +40 -1
- package/es/switch/style/index.d.ts +9 -0
- package/es/switch/style/index.js +17 -0
- package/es/table/index.js +18 -3
- package/es/table/style/index.js +55 -40
- package/es/theme/default.js +13 -12
- package/es/theme/style/aliyun.less +5 -1
- package/es/theme/style/compact.less +7 -3
- package/es/theme/style/dark.less +5 -1
- package/es/theme/style/default.less +15 -11
- package/es/tooltip/MouseTooltip.js +3 -2
- package/es/tooltip/index.js +3 -2
- package/es/tooltip/style/index.js +11 -2
- package/es/typography/Link.js +9 -3
- package/es/typography/Paragraph.js +9 -3
- package/es/typography/Text.js +9 -3
- package/es/typography/Title.js +9 -3
- package/es/typography/hooks/useClassName.d.ts +3 -0
- package/es/typography/hooks/useClassName.js +11 -0
- package/es/typography/style/index.js +45 -3
- package/lib/_util/genComponentStyleHook.d.ts +0 -1
- package/lib/_util/genComponentStyleHook.js +3 -38
- package/lib/button/style/index.js +21 -1
- package/lib/card/index.js +10 -21
- package/lib/card/style/index.js +7 -2
- package/lib/checkbox/index.d.ts +2 -0
- package/lib/checkbox/index.js +49 -1
- package/lib/checkbox/style/index.d.ts +9 -0
- package/lib/checkbox/style/index.js +49 -0
- package/lib/config-provider/index.d.ts +2 -0
- package/lib/config-provider/index.js +2 -1
- package/lib/descriptions/hooks/useItems.d.ts +4 -4
- package/lib/empty/default.js +8 -39
- package/lib/empty/style/index.js +42 -46
- package/lib/global.css +48 -0
- package/lib/index.d.ts +9 -1
- package/lib/index.js +13 -1
- package/lib/progress/index.d.ts +1 -0
- package/lib/progress/index.js +2 -0
- package/lib/progress/progress.d.ts +1 -0
- package/lib/progress/progress.js +23 -0
- package/lib/radio/index.d.ts +7 -0
- package/lib/radio/index.js +42 -1
- package/lib/radio/style/index.d.ts +9 -0
- package/lib/radio/style/index.js +49 -0
- package/lib/result/style/index.js +10 -1
- package/lib/slider/index.d.ts +5 -0
- package/lib/slider/index.js +38 -1
- package/lib/slider/style/index.d.ts +9 -0
- package/lib/slider/style/index.js +51 -0
- package/lib/switch/index.d.ts +4 -0
- package/lib/switch/index.js +40 -1
- package/lib/switch/style/index.d.ts +9 -0
- package/lib/switch/style/index.js +44 -0
- package/lib/table/index.js +19 -3
- package/lib/table/style/index.js +94 -55
- package/lib/theme/default.js +13 -12
- package/lib/theme/style/aliyun.less +5 -1
- package/lib/theme/style/compact.less +7 -3
- package/lib/theme/style/dark.less +5 -1
- package/lib/theme/style/default.less +15 -11
- package/lib/tooltip/MouseTooltip.js +3 -2
- package/lib/tooltip/index.js +3 -2
- package/lib/tooltip/style/index.js +10 -1
- package/lib/typography/Link.js +14 -2
- package/lib/typography/Paragraph.js +14 -2
- package/lib/typography/Text.js +14 -2
- package/lib/typography/Title.js +14 -2
- package/lib/typography/hooks/useClassName.d.ts +3 -0
- package/lib/typography/hooks/useClassName.js +46 -0
- package/lib/typography/style/index.js +49 -1
- package/package.json +13 -13
- package/es/reset.css +0 -10
- package/lib/reset.css +0 -10
- /package/es/{_util/fonts → fonts}/Consolas.woff2 +0 -0
- /package/es/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
- /package/es/{_util/fonts → fonts}/Inter.woff2 +0 -0
- /package/lib/{_util/fonts → fonts}/Consolas.woff2 +0 -0
- /package/lib/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
- /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:
|
|
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:
|
|
376
|
-
@fontSizeHeading2:
|
|
377
|
-
@fontSizeHeading3:
|
|
378
|
-
@fontSizeHeading4:
|
|
379
|
-
@fontSizeHeading5:
|
|
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.
|
|
387
|
-
@lineHeightHeading2: 1.
|
|
388
|
-
@lineHeightHeading3: 1.
|
|
389
|
-
@lineHeightHeading4: 1.
|
|
390
|
-
@lineHeightHeading5: 1.
|
|
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,
|
package/lib/tooltip/index.js
CHANGED
|
@@ -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
|
|
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:
|
|
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
|
}
|
package/lib/typography/Link.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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
|
);
|
package/lib/typography/Text.js
CHANGED
|
@@ -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(
|
|
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
|
);
|
package/lib/typography/Title.js
CHANGED
|
@@ -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(
|
|
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,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.
|
|
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.
|
|
37
|
+
"@ant-design/cssinjs": "^1.22.0",
|
|
39
38
|
"@oceanbase/aliyun-theme": "^0.1.6",
|
|
40
|
-
"@oceanbase/icons": "^0.4.
|
|
41
|
-
"@oceanbase/util": "^0.4.
|
|
39
|
+
"@oceanbase/icons": "^0.4.1",
|
|
40
|
+
"@oceanbase/util": "^0.4.1",
|
|
42
41
|
"ahooks": "^2.10.14",
|
|
43
|
-
"antd": "^5.
|
|
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.
|
|
53
|
-
"@babel/preset-env": "^7.
|
|
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.
|
|
56
|
-
"rc-
|
|
57
|
-
"rc-
|
|
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": "
|
|
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
|