@oceanbase/design 0.4.15 → 0.4.17

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 (43) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/es/card/style/index.js +4 -2
  4. package/es/descriptions/hooks/useItems.js +3 -2
  5. package/es/descriptions/style/index.js +1 -3
  6. package/es/form/FormItem.d.ts +1 -0
  7. package/es/form/FormItem.js +1 -0
  8. package/es/global.css +7 -7
  9. package/es/table/index.d.ts +2 -2
  10. package/es/table/style/index.js +1 -3
  11. package/es/tabs/index.d.ts +8 -6
  12. package/es/tabs/index.js +10 -7
  13. package/es/tabs/style/index.js +2 -3
  14. package/es/typography/Link.d.ts +5 -1
  15. package/es/typography/Link.js +1 -0
  16. package/es/typography/Paragraph.d.ts +5 -1
  17. package/es/typography/Paragraph.js +1 -0
  18. package/es/typography/Text.d.ts +5 -1
  19. package/es/typography/Text.js +1 -0
  20. package/es/typography/Title.d.ts +5 -1
  21. package/es/typography/Title.js +1 -0
  22. package/es/typography/style/index.js +2 -6
  23. package/lib/card/style/index.js +9 -1
  24. package/lib/descriptions/hooks/useItems.js +3 -2
  25. package/lib/descriptions/style/index.js +0 -2
  26. package/lib/form/FormItem.d.ts +1 -0
  27. package/lib/form/FormItem.js +6 -0
  28. package/lib/global.css +7 -7
  29. package/lib/table/index.d.ts +2 -2
  30. package/lib/table/style/index.js +2 -4
  31. package/lib/tabs/index.d.ts +8 -6
  32. package/lib/tabs/index.js +68 -62
  33. package/lib/tabs/style/index.js +6 -4
  34. package/lib/typography/Link.d.ts +5 -1
  35. package/lib/typography/Link.js +1 -0
  36. package/lib/typography/Paragraph.d.ts +5 -1
  37. package/lib/typography/Paragraph.js +1 -0
  38. package/lib/typography/Text.d.ts +5 -1
  39. package/lib/typography/Text.js +1 -0
  40. package/lib/typography/Title.d.ts +5 -1
  41. package/lib/typography/Title.js +1 -0
  42. package/lib/typography/style/index.js +2 -9
  43. package/package.json +8 -9
package/lib/tabs/index.js CHANGED
@@ -33,9 +33,9 @@ __export(tabs_exports, {
33
33
  default: () => tabs_default
34
34
  });
35
35
  module.exports = __toCommonJS(tabs_exports);
36
- var import_util = require("@oceanbase/util");
37
- var import_antd = require("antd");
38
36
  var import_react = __toESM(require("react"));
37
+ var import_antd = require("antd");
38
+ var import_util = require("@oceanbase/util");
39
39
  var import_classnames = __toESM(require("classnames"));
40
40
  var import_badge = __toESM(require("../badge"));
41
41
  var import_config_provider = __toESM(require("../config-provider"));
@@ -46,67 +46,73 @@ __reExport(tabs_exports, require("antd/es/tabs"), module.exports);
46
46
  var isReactNode = (item) => {
47
47
  return import_react.default.isValidElement(item);
48
48
  };
49
- var Tabs = ({
50
- children,
51
- items,
52
- type,
53
- tabPosition,
54
- prefixCls: customizePrefixCls,
55
- className,
56
- ...restProps
57
- }) => {
58
- const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
59
- const prefixCls = getPrefixCls("tabs", customizePrefixCls);
60
- const { wrapSSR } = (0, import_style.default)(prefixCls);
61
- const tabsCls = (0, import_classnames.default)(className);
62
- const isHorizontal = !tabPosition || tabPosition === "top" || tabPosition === "bottom";
63
- const dividerList = (items == null ? void 0 : items.filter((item) => item.divider)) || [];
64
- const renderBadge = (0, import_react.useCallback)(
65
- (badge) => {
66
- if (typeof badge === "object" && !isReactNode(badge)) {
67
- return /* @__PURE__ */ import_react.default.createElement(import_badge.default, { ...badge, className: (0, import_classnames.default)(`${prefixCls}-tab-badge`, badge.className) });
49
+ var Tabs = import_react.default.forwardRef(
50
+ ({
51
+ children,
52
+ divider = false,
53
+ items,
54
+ type,
55
+ tabPosition,
56
+ prefixCls: customizePrefixCls,
57
+ className,
58
+ ...restProps
59
+ }, ref) => {
60
+ const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
61
+ const prefixCls = getPrefixCls("tabs", customizePrefixCls);
62
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
63
+ const tabsCls = (0, import_classnames.default)(className, {
64
+ [`${prefixCls}-no-divider`]: !divider
65
+ });
66
+ const isHorizontal = !tabPosition || tabPosition === "top" || tabPosition === "bottom";
67
+ const dividerList = (items == null ? void 0 : items.filter((item) => item.divider)) || [];
68
+ const renderBadge = (0, import_react.useCallback)(
69
+ (badge) => {
70
+ if (typeof badge === "object" && !isReactNode(badge)) {
71
+ return /* @__PURE__ */ import_react.default.createElement(import_badge.default, { ...badge, className: (0, import_classnames.default)(`${prefixCls}-tab-badge`, badge.className) });
72
+ }
73
+ return /* @__PURE__ */ import_react.default.createElement(import_badge.default, { className: `${prefixCls}-tab-badge`, count: badge });
74
+ },
75
+ [prefixCls]
76
+ );
77
+ let newItems = (0, import_useLegacyItems.default)(items, children);
78
+ newItems = newItems == null ? void 0 : newItems.map((item) => {
79
+ if (!(0, import_util.isNullValue)(item.divider)) {
80
+ return {
81
+ ...item,
82
+ key: `divider-${dividerList == null ? void 0 : dividerList.indexOf(item)}`,
83
+ label: /* @__PURE__ */ import_react.default.createElement(
84
+ import_antd.Divider,
85
+ {
86
+ type: isHorizontal ? "vertical" : "horizontal",
87
+ className: `${prefixCls}-divider`
88
+ }
89
+ ),
90
+ disabled: true
91
+ };
92
+ } else if (!(0, import_util.isNullValue)(item.tag) || !(0, import_util.isNullValue)(item.badge)) {
93
+ return {
94
+ ...item,
95
+ label: /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, item.label, item.badge && renderBadge(item.badge), !(0, import_util.isNullValue)(item.tag) && /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { bordered: false, className: `${prefixCls}-tab-tag` }, item.tag))
96
+ };
68
97
  }
69
- return /* @__PURE__ */ import_react.default.createElement(import_badge.default, { className: `${prefixCls}-tab-badge`, count: badge });
70
- },
71
- [prefixCls]
72
- );
73
- let newItems = (0, import_useLegacyItems.default)(items, children);
74
- newItems = newItems == null ? void 0 : newItems.map((item) => {
75
- if (!(0, import_util.isNullValue)(item.divider)) {
76
- return {
77
- ...item,
78
- key: `divider-${dividerList == null ? void 0 : dividerList.indexOf(item)}`,
79
- label: /* @__PURE__ */ import_react.default.createElement(
80
- import_antd.Divider,
81
- {
82
- type: isHorizontal ? "vertical" : "horizontal",
83
- className: `${prefixCls}-divider`
84
- }
85
- ),
86
- disabled: true
87
- };
88
- } else if (!(0, import_util.isNullValue)(item.tag) || !(0, import_util.isNullValue)(item.badge)) {
89
- return {
90
- ...item,
91
- label: /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, item.label, item.badge && renderBadge(item.badge), !(0, import_util.isNullValue)(item.tag) && /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { bordered: false, className: `${prefixCls}-tab-tag` }, item.tag))
92
- };
93
- }
94
- return item;
95
- });
96
- return wrapSSR(
97
- /* @__PURE__ */ import_react.default.createElement(
98
- import_antd.Tabs,
99
- {
100
- items: newItems,
101
- type,
102
- tabPosition,
103
- prefixCls: customizePrefixCls,
104
- className: tabsCls,
105
- ...restProps
106
- }
107
- )
108
- );
109
- };
98
+ return item;
99
+ });
100
+ return wrapSSR(
101
+ /* @__PURE__ */ import_react.default.createElement(
102
+ import_antd.Tabs,
103
+ {
104
+ ref,
105
+ items: newItems,
106
+ type,
107
+ tabPosition,
108
+ prefixCls: customizePrefixCls,
109
+ className: tabsCls,
110
+ ...restProps
111
+ }
112
+ )
113
+ );
114
+ }
115
+ );
110
116
  Tabs.TabPane = import_TabPane.default;
111
117
  Tabs.genTabsStyle = import_style.genTabsStyle;
112
118
  if (process.env.NODE_ENV !== "production") {
@@ -28,10 +28,12 @@ var genTabsStyle = (token) => {
28
28
  const { antCls, componentCls, colorInfo, colorInfoBg, colorTextSecondary, colorFillQuaternary } = token;
29
29
  return {
30
30
  [componentCls]: {
31
- [`&${componentCls}-top, &${componentCls}-bottom`]: {
32
- [`${componentCls}-nav::before`]: {
33
- // 页签位置为 top bottom 时,去掉分割线
34
- border: "none"
31
+ [`&${componentCls}-no-divider`]: {
32
+ // divider prop work for top and bottom tabs
33
+ [`&${componentCls}-top, &${componentCls}-bottom`]: {
34
+ [`${componentCls}-nav::before`]: {
35
+ border: "none"
36
+ }
35
37
  }
36
38
  },
37
39
  [`${componentCls}-tab`]: {
@@ -3,5 +3,9 @@ import type { LinkProps as AntLinkProps } from 'antd/es/typography/Link';
3
3
  export * from 'antd/es/typography/Link';
4
4
  export interface LinkProps extends AntLinkProps {
5
5
  }
6
- declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Link: CompoundedComponent;
7
11
  export default Link;
@@ -64,6 +64,7 @@ var Link = import_react.default.forwardRef(
64
64
  if (process.env.NODE_ENV !== "production") {
65
65
  Link.displayName = AntLink.displayName;
66
66
  }
67
+ Link.__ANT_TYPOGRAPHY = true;
67
68
  var Link_default = Link;
68
69
  // Annotate the CommonJS export names for ESM import in node:
69
70
  0 && (module.exports = {
@@ -3,5 +3,9 @@ import type { ParagraphProps as AntParagraphProps } from 'antd/es/typography/Par
3
3
  export * from 'antd/es/typography/Paragraph';
4
4
  export interface ParagraphProps extends AntParagraphProps {
5
5
  }
6
- declare const Paragraph: React.ForwardRefExoticComponent<ParagraphProps & React.RefAttributes<HTMLElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<ParagraphProps & React.RefAttributes<HTMLElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Paragraph: CompoundedComponent;
7
11
  export default Paragraph;
@@ -64,6 +64,7 @@ var Paragraph = import_react.default.forwardRef(
64
64
  if (process.env.NODE_ENV !== "production") {
65
65
  Paragraph.displayName = AntParagraph.displayName;
66
66
  }
67
+ Paragraph.__ANT_TYPOGRAPHY = true;
67
68
  var Paragraph_default = Paragraph;
68
69
  // Annotate the CommonJS export names for ESM import in node:
69
70
  0 && (module.exports = {
@@ -3,5 +3,9 @@ import type { TextProps as AntTextProps } from 'antd/es/typography/Text';
3
3
  export * from 'antd/es/typography/Text';
4
4
  export interface TextProps extends AntTextProps {
5
5
  }
6
- declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Text: CompoundedComponent;
7
11
  export default Text;
@@ -64,6 +64,7 @@ var Text = import_react.default.forwardRef(
64
64
  if (process.env.NODE_ENV !== "production") {
65
65
  Text.displayName = AntText.displayName;
66
66
  }
67
+ Text.__ANT_TYPOGRAPHY = true;
67
68
  var Text_default = Text;
68
69
  // Annotate the CommonJS export names for ESM import in node:
69
70
  0 && (module.exports = {
@@ -3,5 +3,9 @@ import type { TitleProps as AntTitleProps } from 'antd/es/typography/Title';
3
3
  export * from 'antd/es/typography/Title';
4
4
  export interface TitleProps extends AntTitleProps {
5
5
  }
6
- declare const Title: React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Title: CompoundedComponent;
7
11
  export default Title;
@@ -64,6 +64,7 @@ var Title = import_react.default.forwardRef(
64
64
  if (process.env.NODE_ENV !== "production") {
65
65
  Title.displayName = AntTitle.displayName;
66
66
  }
67
+ Title.__ANT_TYPOGRAPHY = true;
67
68
  var Title_default = Title;
68
69
  // Annotate the CommonJS export names for ESM import in node:
69
70
  0 && (module.exports = {
@@ -29,17 +29,10 @@ var genTypographyStyle = (token) => {
29
29
  const marginOffset = (controlHeight - fontSize * lineHeight) / 2;
30
30
  return {
31
31
  // inherit color and lineHeight from parent instead of fixed colorText
32
- [`span${componentCls}`]: {
33
- lineHeight: "inherit",
34
- color: "inherit",
35
- fontSize: "inherit"
36
- },
37
- [`div${componentCls}`]: {
32
+ [`${componentCls}`]: {
38
33
  lineHeight: "inherit",
39
34
  color: "inherit",
40
- fontSize: "inherit"
41
- },
42
- [`${componentCls}`]: {
35
+ fontSize: "inherit",
43
36
  [`${componentCls}-edit`]: {
44
37
  fontSize: token.fontSize
45
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -32,21 +32,20 @@
32
32
  ],
33
33
  "sideEffects": [
34
34
  "**/*.less",
35
- "**/*.css",
36
- "es/index.js"
35
+ "**/*.css"
37
36
  ],
38
37
  "scripts": {
39
38
  "build": "father build && cp src/style/reset.css dist/"
40
39
  },
41
40
  "dependencies": {
42
41
  "@ant-design/cssinjs": "^1.24.0",
43
- "@ctrl/tinycolor": "^4.1.0",
42
+ "@ctrl/tinycolor": "^4.2.0",
44
43
  "@inline-svg-unique-id/react": "^1.2.3",
45
44
  "@oceanbase/aliyun-theme": "^0.1.6",
46
45
  "@oceanbase/icons": "^0.4.7",
47
- "@oceanbase/util": "^0.4.4",
46
+ "@oceanbase/util": "^0.4.5",
48
47
  "ahooks": "^2.10.14",
49
- "antd": "^5.27.0",
48
+ "antd": "^5.27.4",
50
49
  "classnames": "^2.5.1",
51
50
  "lodash": "^4.17.21",
52
51
  "lottie-web": "^5.13.0",
@@ -58,13 +57,13 @@
58
57
  "@babel/preset-env": "^7.28.3",
59
58
  "antd-token-previewer": "^2.0.8",
60
59
  "rc-select": "^14.16.8",
61
- "rc-slider": "^11.1.8",
62
- "rc-table": "^7.51.1",
60
+ "rc-slider": "^11.1.9",
61
+ "rc-table": "^7.54.0",
63
62
  "rc-tree-select": "^5.27.0"
64
63
  },
65
64
  "peerDependencies": {
66
65
  "react": ">=16.9.0",
67
66
  "react-dom": ">=16.9.0"
68
67
  },
69
- "gitHead": "b88518b0f25b30d616d829813ba50eff7830499a"
68
+ "gitHead": "17cf4a2e042c5c3a2b099b8f4d305eb3b543ca66"
70
69
  }