@oceanbase/design 0.4.1 → 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/index.d.ts +1 -1
- package/es/card/index.js +11 -19
- package/es/descriptions/hooks/useItems.d.ts +1 -1
- package/es/empty/style/index.js +13 -11
- package/es/global.css +48 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +2 -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 +6 -1
- package/es/result/style/index.js +10 -2
- package/es/slider/style/index.js +2 -2
- 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 +4 -1
- package/es/table/style/index.js +40 -32
- package/es/theme/default.js +3 -1
- package/es/theme/style/compact.less +1 -1
- package/es/theme/style/default.less +1 -1
- 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/index.d.ts +1 -1
- package/lib/card/index.js +10 -21
- package/lib/descriptions/hooks/useItems.d.ts +1 -1
- package/lib/empty/style/index.js +42 -46
- package/lib/global.css +48 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +4 -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 +6 -1
- package/lib/result/style/index.js +10 -1
- package/lib/slider/style/index.js +2 -2
- 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 +5 -0
- package/lib/table/style/index.js +77 -42
- package/lib/theme/default.js +3 -1
- package/lib/theme/style/compact.less +1 -1
- package/lib/theme/style/default.less +1 -1
- 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 +6 -7
- 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
|
@@ -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
39
|
"@oceanbase/icons": "^0.4.1",
|
|
41
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",
|
|
@@ -55,11 +54,11 @@
|
|
|
55
54
|
"rc-select": "^14.16.3",
|
|
56
55
|
"rc-slider": "^11.1.7",
|
|
57
56
|
"rc-table": "^7.48.1",
|
|
58
|
-
"rc-tree-select": "^5.24.
|
|
57
|
+
"rc-tree-select": "^5.24.4"
|
|
59
58
|
},
|
|
60
59
|
"peerDependencies": {
|
|
61
60
|
"react": ">=16.9.0",
|
|
62
61
|
"react-dom": ">=16.9.0"
|
|
63
62
|
},
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "67c1567aad182c4b3b7ecb421928fa3c87f321e0"
|
|
65
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
|