@oceanbase/design 0.2.3 → 0.2.5

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.
@@ -1,11 +1,12 @@
1
1
  import type { AlertProps as AntAlertProps } from 'antd/es/alert';
2
+ import React from 'react';
2
3
  export * from 'antd/es/alert';
3
4
  export interface AlertProps extends AntAlertProps {
4
5
  ghost?: boolean;
5
6
  colored?: boolean;
6
7
  }
7
8
  declare const Alert: {
8
- ({ ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
9
+ ({ ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
9
10
  ErrorBoundary: typeof import("antd/es/alert/ErrorBoundary").default;
10
11
  displayName: string;
11
12
  };
package/es/alert/index.js CHANGED
@@ -8,7 +8,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
8
8
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
9
  import { Alert as AntAlert } from 'antd';
10
10
  import classNames from 'classnames';
11
- import { useContext } from 'react';
11
+ import React, { useContext } from 'react';
12
12
  import ConfigProvider from "../config-provider";
13
13
  import useStyle from "./style";
14
14
  export * from 'antd/es/alert';
@@ -1,9 +1,10 @@
1
1
  import type { ButtonProps as AntButtonProps } from 'antd/es/button';
2
+ import React from 'react';
2
3
  export * from 'antd/es/button';
3
4
  export declare type ButtonProps = AntButtonProps;
4
5
  declare const Button: {
5
- ({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
- Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
6
+ ({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
+ Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
8
  __ANT_BUTTON: any;
8
9
  displayName: string;
9
10
  };
@@ -4,7 +4,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import { Button as AntButton } from 'antd';
6
6
  import classNames from 'classnames';
7
- import { useContext } from 'react';
7
+ import React, { useContext } from 'react';
8
8
  import ConfigProvider from "../config-provider";
9
9
  import useStyle from "./style";
10
10
  export * from 'antd/es/button';
package/es/card/index.js CHANGED
@@ -68,9 +68,8 @@ var Card = function Card(_ref) {
68
68
  tabPosition: tabProps === null || tabProps === void 0 ? void 0 : tabProps.tabPosition,
69
69
  containerRef: ref
70
70
  });
71
- return wrapSSR( /*#__PURE__*/React.createElement("div", {
72
- ref: ref
73
- }, /*#__PURE__*/React.createElement(AntCard, _extends({
71
+ return wrapSSR( /*#__PURE__*/React.createElement(AntCard, _extends({
72
+ ref: ref,
74
73
  tabList: newTabList,
75
74
  defaultActiveTabKey: defaultActiveTabKey,
76
75
  activeTabKey: activeTabKey,
@@ -81,7 +80,7 @@ var Card = function Card(_ref) {
81
80
  tabProps: tabProps,
82
81
  prefixCls: customizePrefixCls,
83
82
  className: cardCls
84
- }, restProps), children)));
83
+ }, restProps), children));
85
84
  };
86
85
  Card.Grid = AntCard.Grid;
87
86
  Card.Meta = AntCard.Meta;
@@ -10,6 +10,7 @@ export var genCardStyle = function genCardStyle(token) {
10
10
  var _$concat$concat, _ref;
11
11
  var componentCls = token.componentCls,
12
12
  tabsComponentCls = token.tabsComponentCls,
13
+ tabsPrefixCls = token.tabsPrefixCls,
13
14
  padding = token.padding,
14
15
  paddingSM = token.paddingSM,
15
16
  paddingLG = token.paddingLG;
@@ -19,12 +20,12 @@ export var genCardStyle = function genCardStyle(token) {
19
20
  padding: "0 ".concat(paddingLG, "px ").concat(padding, "px ").concat(paddingLG, "px")
20
21
  }), _$concat$concat)), _defineProperty(_ref, "".concat(componentCls, "-small").concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-body"), {
21
22
  padding: "0 ".concat(paddingSM, "px 12px ").concat(paddingSM, "px")
22
- })), _defineProperty(_ref, "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _defineProperty({
23
+ })), _defineProperty(_ref, "".concat(componentCls).concat(componentCls, "-contain-tabs"), _defineProperty({}, "".concat(componentCls, "-head"), _objectSpread({
23
24
  // 包含页签时,去掉 head 的底部分割线
24
25
  borderBottom: 'none'
25
- }, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
26
- // 包含位置为 top 和 bottom 的页签时,去掉 Tabs 的分割线
27
- border: 'none'
26
+ }, genTagStyle(_objectSpread(_objectSpread({}, token), {}, {
27
+ componentCls: tabsComponentCls,
28
+ prefixCls: tabsPrefixCls
28
29
  }))))), _ref;
29
30
  };
30
31
  export default (function (prefixCls, tabsPrefixCls) {
@@ -32,9 +33,6 @@ export default (function (prefixCls, tabsPrefixCls) {
32
33
  return [genCardStyle(_objectSpread(_objectSpread({}, token), {}, {
33
34
  tabsComponentCls: ".".concat(tabsPrefixCls),
34
35
  tabsPrefixCls: tabsPrefixCls
35
- })), genTagStyle(_objectSpread(_objectSpread({}, token), {}, {
36
- componentCls: ".".concat(tabsPrefixCls),
37
- prefixCls: tabsPrefixCls
38
36
  }))];
39
37
  });
40
38
  return useStyle(prefixCls);
@@ -1,8 +1,9 @@
1
1
  import type { ModalProps as AntModalProps } from 'antd/es/modal';
2
+ import React from 'react';
2
3
  export * from 'antd/es/modal';
3
4
  export declare type ModalProps = AntModalProps;
4
5
  declare const Modal: {
5
- ({ prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
+ ({ prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
6
7
  info(props: any): {
7
8
  destroy: () => void;
8
9
  update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
package/es/modal/index.js CHANGED
@@ -4,7 +4,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import { Modal as AntModal } from 'antd';
6
6
  import classNames from 'classnames';
7
- import { useContext } from 'react';
7
+ import React, { useContext } from 'react';
8
8
  import ConfigProvider from "../config-provider";
9
9
  import { modal } from "../static-function";
10
10
  import useStyle from "./style";
@@ -0,0 +1,12 @@
1
+ import type { SizeType } from 'antd/es/config-provider/SizeContext';
2
+ import type { TabsPosition, TabsType } from 'antd/es/tabs';
3
+ import type { MutableRefObject } from 'react';
4
+ declare const _default: ({ prefixCls, activeKey, size, type, tabPosition, containerRef, }: {
5
+ prefixCls: string;
6
+ activeKey: string;
7
+ size: SizeType;
8
+ type: TabsType;
9
+ tabPosition: TabsPosition;
10
+ containerRef: MutableRefObject<HTMLDivElement>;
11
+ }) => void;
12
+ export default _default;
@@ -23,8 +23,8 @@ export default (function (_ref) {
23
23
  var horizontalOffset = 8;
24
24
  setTimeout(function () {
25
25
  if ((!type || type === 'line') && inkBarNode) {
26
- // 水平布局,如果 inkbar 宽度 > 32,则两侧各减去 8px,并保持水平居中
27
- if (isHorizontal && (activeTabNode === null || activeTabNode === void 0 ? void 0 : activeTabNode.offsetWidth) > 32) {
26
+ // 水平布局,如果 inkbar 宽度 >= 24,则两侧各减去 8px,并保持水平居中
27
+ if (isHorizontal && (activeTabNode === null || activeTabNode === void 0 ? void 0 : activeTabNode.offsetWidth) >= 24) {
28
28
  inkBarNode.style.width = "".concat((activeTabNode === null || activeTabNode === void 0 ? void 0 : activeTabNode.offsetWidth) - horizontalOffset * 2, "px");
29
29
  inkBarNode.style.marginLeft = "".concat(horizontalOffset, "px");
30
30
  inkBarNode.style.marginTop = '0px';
package/es/tabs/index.js CHANGED
@@ -72,9 +72,8 @@ var Tabs = function Tabs(_ref) {
72
72
  tabPosition: tabPosition,
73
73
  containerRef: ref
74
74
  });
75
- return wrapSSR( /*#__PURE__*/React.createElement("div", {
76
- ref: ref
77
- }, /*#__PURE__*/React.createElement(AntTabs, _extends({
75
+ return wrapSSR( /*#__PURE__*/React.createElement(AntTabs, _extends({
76
+ ref: ref,
78
77
  items: newItems,
79
78
  defaultActiveKey: defaultActiveKey,
80
79
  activeKey: activeKey,
@@ -88,7 +87,7 @@ var Tabs = function Tabs(_ref) {
88
87
  tabBarGutter: !type || type === 'line' ? isHorizontal ? 24 : 0 : undefined,
89
88
  prefixCls: customizePrefixCls,
90
89
  className: tabsCls
91
- }, restProps))));
90
+ }, restProps)));
92
91
  };
93
92
  Tabs.TabPane = TabPane;
94
93
  if (process.env.NODE_ENV !== 'production') {
@@ -0,0 +1,8 @@
1
+ import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
+ export declare type TabsToken = FullToken<'Tabs'>;
3
+ export declare const genTagStyle: GenerateStyle<TabsToken>;
4
+ declare const _default: (prefixCls: string) => {
5
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
+ hashId: string;
7
+ };
8
+ export default _default;
@@ -4,12 +4,15 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genTagStyle = function genTagStyle(token) {
7
- var _componentCls, _ref;
7
+ var _componentCls;
8
8
  var componentCls = token.componentCls,
9
9
  colorInfo = token.colorInfo,
10
10
  colorInfoBg = token.colorInfoBg,
11
11
  colorTextSecondary = token.colorTextSecondary;
12
- return _ref = {}, _defineProperty(_ref, componentCls, (_componentCls = {}, _defineProperty(_componentCls, "".concat(componentCls, "-tab"), _defineProperty({}, "".concat(componentCls, "-tab-tag"), {
12
+ return _defineProperty({}, componentCls, (_componentCls = {}, _defineProperty(_componentCls, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
13
+ // 页签位置为 top 和 bottom 时,去掉分割线
14
+ border: 'none'
15
+ })), _defineProperty(_componentCls, "".concat(componentCls, "-tab"), _defineProperty({}, "".concat(componentCls, "-tab-tag"), {
13
16
  color: colorTextSecondary,
14
17
  fontFamily: 'PingFangSC',
15
18
  fontSize: 12,
@@ -22,10 +25,7 @@ export var genTagStyle = function genTagStyle(token) {
22
25
  })), _defineProperty(_componentCls, "".concat(componentCls, "-ink-bar"), {
23
26
  // inkbar 带圆角
24
27
  borderRadius: '1px'
25
- }), _componentCls)), _defineProperty(_ref, componentCls, _defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
26
- // 页签位置为 top 和 bottom 时,去掉分割线
27
- border: 'none'
28
- }))), _ref;
28
+ }), _componentCls));
29
29
  };
30
30
  export default (function (prefixCls) {
31
31
  var useStyle = genComponentStyleHook('Tabs', function (token) {
@@ -1,11 +1,12 @@
1
1
  import type { AlertProps as AntAlertProps } from 'antd/es/alert';
2
+ import React from 'react';
2
3
  export * from 'antd/es/alert';
3
4
  export interface AlertProps extends AntAlertProps {
4
5
  ghost?: boolean;
5
6
  colored?: boolean;
6
7
  }
7
8
  declare const Alert: {
8
- ({ ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
9
+ ({ ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
9
10
  ErrorBoundary: typeof import("antd/es/alert/ErrorBoundary").default;
10
11
  displayName: string;
11
12
  };
@@ -35,7 +35,7 @@ __export(alert_exports, {
35
35
  module.exports = __toCommonJS(alert_exports);
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
- var import_react = require("react");
38
+ var import_react = __toESM(require("react"));
39
39
  var import_config_provider = __toESM(require("../config-provider"));
40
40
  var import_style = __toESM(require("./style"));
41
41
  __reExport(alert_exports, require("antd/es/alert"), module.exports);
@@ -57,7 +57,7 @@ var Alert = ({
57
57
  className,
58
58
  hashId
59
59
  );
60
- return wrapSSR(/* @__PURE__ */ React.createElement(import_antd.Alert, { prefixCls: customizePrefixCls, className: alertCls, ...restProps }));
60
+ return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Alert, { prefixCls: customizePrefixCls, className: alertCls, ...restProps }));
61
61
  };
62
62
  Alert.ErrorBoundary = import_antd.Alert.ErrorBoundary;
63
63
  if (process.env.NODE_ENV !== "production") {
@@ -1,9 +1,10 @@
1
1
  import type { ButtonProps as AntButtonProps } from 'antd/es/button';
2
+ import React from 'react';
2
3
  export * from 'antd/es/button';
3
4
  export declare type ButtonProps = AntButtonProps;
4
5
  declare const Button: {
5
- ({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
- Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
6
+ ({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
+ Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
8
  __ANT_BUTTON: any;
8
9
  displayName: string;
9
10
  };
@@ -35,7 +35,7 @@ __export(button_exports, {
35
35
  module.exports = __toCommonJS(button_exports);
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
- var import_react = require("react");
38
+ var import_react = __toESM(require("react"));
39
39
  var import_config_provider = __toESM(require("../config-provider"));
40
40
  var import_style = __toESM(require("./style"));
41
41
  __reExport(button_exports, require("antd/es/button"), module.exports);
@@ -44,7 +44,7 @@ var Button = ({ prefixCls: customizePrefixCls, className, ...restProps }) => {
44
44
  const prefixCls = getPrefixCls("btn", customizePrefixCls);
45
45
  const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
46
46
  const buttonCls = (0, import_classnames.default)(className, hashId);
47
- return wrapSSR(/* @__PURE__ */ React.createElement(import_antd.Button, { prefixCls: customizePrefixCls, className: buttonCls, ...restProps }));
47
+ return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { prefixCls: customizePrefixCls, className: buttonCls, ...restProps }));
48
48
  };
49
49
  Button.Group = import_antd.Button.Group;
50
50
  Button.__ANT_BUTTON = import_antd.Button.__ANT_BUTTON;
package/lib/card/index.js CHANGED
@@ -86,9 +86,10 @@ var Card = ({
86
86
  containerRef: ref
87
87
  });
88
88
  return wrapSSR(
89
- /* @__PURE__ */ import_react.default.createElement("div", { ref }, /* @__PURE__ */ import_react.default.createElement(
89
+ /* @__PURE__ */ import_react.default.createElement(
90
90
  import_antd.Card,
91
91
  {
92
+ ref,
92
93
  tabList: newTabList,
93
94
  defaultActiveTabKey,
94
95
  activeTabKey,
@@ -102,7 +103,7 @@ var Card = ({
102
103
  ...restProps
103
104
  },
104
105
  children
105
- ))
106
+ )
106
107
  );
107
108
  };
108
109
  Card.Grid = import_antd.Card.Grid;
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(style_exports);
26
26
  var import_style = require("../../tabs/style");
27
27
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
28
28
  var genCardStyle = (token) => {
29
- const { componentCls, tabsComponentCls, padding, paddingSM, paddingLG } = token;
29
+ const { componentCls, tabsComponentCls, tabsPrefixCls, padding, paddingSM, paddingLG } = token;
30
30
  return {
31
31
  [`${componentCls}${componentCls}-no-divider`]: {
32
32
  [`${componentCls}-head`]: {
@@ -45,14 +45,11 @@ var genCardStyle = (token) => {
45
45
  [`${componentCls}-head`]: {
46
46
  // 包含页签时,去掉 head 的底部分割线
47
47
  borderBottom: "none",
48
- [tabsComponentCls]: {
49
- [`&${tabsComponentCls}-top, &${tabsComponentCls}-bottom`]: {
50
- [`${tabsComponentCls}-nav::before`]: {
51
- // 包含位置为 top 和 bottom 的页签时,去掉 Tabs 的分割线
52
- border: "none"
53
- }
54
- }
55
- }
48
+ ...(0, import_style.genTagStyle)({
49
+ ...token,
50
+ componentCls: tabsComponentCls,
51
+ prefixCls: tabsPrefixCls
52
+ })
56
53
  }
57
54
  }
58
55
  };
@@ -64,11 +61,6 @@ var style_default = (prefixCls, tabsPrefixCls) => {
64
61
  ...token,
65
62
  tabsComponentCls: `.${tabsPrefixCls}`,
66
63
  tabsPrefixCls
67
- }),
68
- (0, import_style.genTagStyle)({
69
- ...token,
70
- componentCls: `.${tabsPrefixCls}`,
71
- prefixCls: tabsPrefixCls
72
64
  })
73
65
  ];
74
66
  });
package/lib/form/index.js CHANGED
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
- // src/form/index.tsx
30
+ // src/form/index.ts
31
31
  var form_exports = {};
32
32
  __export(form_exports, {
33
33
  default: () => form_default
@@ -1,8 +1,9 @@
1
1
  import type { ModalProps as AntModalProps } from 'antd/es/modal';
2
+ import React from 'react';
2
3
  export * from 'antd/es/modal';
3
4
  export declare type ModalProps = AntModalProps;
4
5
  declare const Modal: {
5
- ({ prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
+ ({ prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
6
7
  info(props: any): {
7
8
  destroy: () => void;
8
9
  update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
@@ -35,7 +35,7 @@ __export(modal_exports, {
35
35
  module.exports = __toCommonJS(modal_exports);
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
- var import_react = require("react");
38
+ var import_react = __toESM(require("react"));
39
39
  var import_config_provider = __toESM(require("../config-provider"));
40
40
  var import_static_function = require("../static-function");
41
41
  var import_style = __toESM(require("./style"));
@@ -45,7 +45,7 @@ var Modal = ({ prefixCls: customizePrefixCls, className, ...restProps }) => {
45
45
  const prefixCls = getPrefixCls("modal", customizePrefixCls);
46
46
  const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
47
47
  const modalCls = (0, import_classnames.default)(className, hashId);
48
- return wrapSSR(/* @__PURE__ */ React.createElement(import_antd.Modal, { prefixCls: customizePrefixCls, className: modalCls, ...restProps }));
48
+ return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Modal, { prefixCls: customizePrefixCls, className: modalCls, ...restProps }));
49
49
  };
50
50
  Modal.info = (props) => import_static_function.modal.info(props);
51
51
  Modal.success = (props) => import_static_function.modal.success(props);
@@ -0,0 +1,12 @@
1
+ import type { SizeType } from 'antd/es/config-provider/SizeContext';
2
+ import type { TabsPosition, TabsType } from 'antd/es/tabs';
3
+ import type { MutableRefObject } from 'react';
4
+ declare const _default: ({ prefixCls, activeKey, size, type, tabPosition, containerRef, }: {
5
+ prefixCls: string;
6
+ activeKey: string;
7
+ size: SizeType;
8
+ type: TabsType;
9
+ tabPosition: TabsPosition;
10
+ containerRef: MutableRefObject<HTMLDivElement>;
11
+ }) => void;
12
+ export default _default;
@@ -46,7 +46,7 @@ var useInkBar_default = ({
46
46
  const horizontalOffset = 8;
47
47
  setTimeout(() => {
48
48
  if ((!type || type === "line") && inkBarNode) {
49
- if (isHorizontal && (activeTabNode == null ? void 0 : activeTabNode.offsetWidth) > 32) {
49
+ if (isHorizontal && (activeTabNode == null ? void 0 : activeTabNode.offsetWidth) >= 24) {
50
50
  inkBarNode.style.width = `${(activeTabNode == null ? void 0 : activeTabNode.offsetWidth) - horizontalOffset * 2}px`;
51
51
  inkBarNode.style.marginLeft = `${horizontalOffset}px`;
52
52
  inkBarNode.style.marginTop = "0px";
package/lib/tabs/index.js CHANGED
@@ -84,9 +84,10 @@ var Tabs = ({
84
84
  containerRef: ref
85
85
  });
86
86
  return wrapSSR(
87
- /* @__PURE__ */ import_react.default.createElement("div", { ref }, /* @__PURE__ */ import_react.default.createElement(
87
+ /* @__PURE__ */ import_react.default.createElement(
88
88
  import_antd.Tabs,
89
89
  {
90
+ ref,
90
91
  items: newItems,
91
92
  defaultActiveKey,
92
93
  activeKey,
@@ -102,7 +103,7 @@ var Tabs = ({
102
103
  className: tabsCls,
103
104
  ...restProps
104
105
  }
105
- ))
106
+ )
106
107
  );
107
108
  };
108
109
  Tabs.TabPane = import_TabPane.default;
@@ -0,0 +1,8 @@
1
+ import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
+ export declare type TabsToken = FullToken<'Tabs'>;
3
+ export declare const genTagStyle: GenerateStyle<TabsToken>;
4
+ declare const _default: (prefixCls: string) => {
5
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
6
+ hashId: string;
7
+ };
8
+ export default _default;
@@ -28,6 +28,12 @@ var genTagStyle = (token) => {
28
28
  const { componentCls, colorInfo, colorInfoBg, colorTextSecondary } = token;
29
29
  return {
30
30
  [componentCls]: {
31
+ [`&${componentCls}-top, &${componentCls}-bottom`]: {
32
+ [`${componentCls}-nav::before`]: {
33
+ // 页签位置为 top 和 bottom 时,去掉分割线
34
+ border: "none"
35
+ }
36
+ },
31
37
  [`${componentCls}-tab`]: {
32
38
  [`${componentCls}-tab-tag`]: {
33
39
  color: colorTextSecondary,
@@ -48,14 +54,6 @@ var genTagStyle = (token) => {
48
54
  // inkbar 带圆角
49
55
  borderRadius: "1px"
50
56
  }
51
- },
52
- [componentCls]: {
53
- [`&${componentCls}-top, &${componentCls}-bottom`]: {
54
- [`${componentCls}-nav::before`]: {
55
- // 页签位置为 top 和 bottom 时,去掉分割线
56
- border: "none"
57
- }
58
- }
59
57
  }
60
58
  };
61
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "The Design System for OceanBase",
5
5
  "keywords": [
6
6
  "OceanBase",
@@ -55,5 +55,5 @@
55
55
  "react": "^16.9.0",
56
56
  "react-dom": "^16.9.0"
57
57
  },
58
- "gitHead": "5a88960beda0d6a5b64ab4454e79c784b1535adb"
58
+ "gitHead": "fa3eea6c268ba32858604c74c853147006c20e98"
59
59
  }
@@ -1,9 +0,0 @@
1
- import type { CSSObject } from '@ant-design/cssinjs';
2
- import type { ComponentTokenMap } from 'antd/es/theme/interface';
3
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
4
- export declare type ComponentName = keyof ComponentTokenMap;
5
- export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>): (prefixCls: string) => {
6
- wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
- hashId: string;
8
- };
9
- export type { CSSObject, FullToken, GenerateStyle };
package/es/index.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import 'antd/dist/reset.css';
2
- export * from 'antd';
3
- export { version } from '../package.json';
4
- export { default as Alert } from './alert';
5
- export { default as Button } from './button';
6
- export { default as Card } from './card';
7
- export { default as ConfigProvider } from './config-provider';
8
- export { default as Descriptions } from './descriptions';
9
- export { default as Form } from './form';
10
- export { default as Modal } from './modal';
11
- export { message, notification, token } from './static-function';
12
- export { default as Table } from './table';
13
- export { default as Tabs } from './tabs';
14
- export { default as theme } from './theme';
15
- export { default as Tooltip } from './tooltip';
16
- declare const useToken: () => {
17
- theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/internal").SeedToken, import("antd/es/theme/interface").MapToken>;
18
- token: import("antd").GlobalToken;
19
- hashId: string;
20
- };
21
- export { useToken };
@@ -1,9 +0,0 @@
1
- import type { CSSObject } from '@ant-design/cssinjs';
2
- import type { ComponentTokenMap } from 'antd/es/theme/interface';
3
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
4
- export declare type ComponentName = keyof ComponentTokenMap;
5
- export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>): (prefixCls: string) => {
6
- wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
- hashId: string;
8
- };
9
- export type { CSSObject, FullToken, GenerateStyle };
package/lib/index.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import 'antd/dist/reset.css';
2
- export * from 'antd';
3
- export { version } from '../package.json';
4
- export { default as Alert } from './alert';
5
- export { default as Button } from './button';
6
- export { default as Card } from './card';
7
- export { default as ConfigProvider } from './config-provider';
8
- export { default as Descriptions } from './descriptions';
9
- export { default as Form } from './form';
10
- export { default as Modal } from './modal';
11
- export { message, notification, token } from './static-function';
12
- export { default as Table } from './table';
13
- export { default as Tabs } from './tabs';
14
- export { default as theme } from './theme';
15
- export { default as Tooltip } from './tooltip';
16
- declare const useToken: () => {
17
- theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/internal").SeedToken, import("antd/es/theme/interface").MapToken>;
18
- token: import("antd").GlobalToken;
19
- hashId: string;
20
- };
21
- export { useToken };