@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.
Files changed (82) 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/index.d.ts +1 -1
  7. package/es/card/index.js +11 -19
  8. package/es/descriptions/hooks/useItems.d.ts +1 -1
  9. package/es/empty/style/index.js +13 -11
  10. package/es/global.css +48 -0
  11. package/es/index.d.ts +3 -1
  12. package/es/index.js +2 -1
  13. package/es/progress/index.d.ts +1 -0
  14. package/es/progress/index.js +1 -0
  15. package/es/progress/progress.d.ts +1 -0
  16. package/es/progress/progress.js +1 -0
  17. package/es/radio/index.d.ts +6 -1
  18. package/es/result/style/index.js +10 -2
  19. package/es/slider/style/index.js +2 -2
  20. package/es/switch/index.d.ts +4 -0
  21. package/es/switch/index.js +40 -1
  22. package/es/switch/style/index.d.ts +9 -0
  23. package/es/switch/style/index.js +17 -0
  24. package/es/table/index.js +4 -1
  25. package/es/table/style/index.js +40 -32
  26. package/es/theme/default.js +3 -1
  27. package/es/theme/style/compact.less +1 -1
  28. package/es/theme/style/default.less +1 -1
  29. package/es/tooltip/MouseTooltip.js +3 -2
  30. package/es/tooltip/index.js +3 -2
  31. package/es/tooltip/style/index.js +11 -2
  32. package/es/typography/Link.js +9 -3
  33. package/es/typography/Paragraph.js +9 -3
  34. package/es/typography/Text.js +9 -3
  35. package/es/typography/Title.js +9 -3
  36. package/es/typography/hooks/useClassName.d.ts +3 -0
  37. package/es/typography/hooks/useClassName.js +11 -0
  38. package/es/typography/style/index.js +45 -3
  39. package/lib/_util/genComponentStyleHook.d.ts +0 -1
  40. package/lib/_util/genComponentStyleHook.js +3 -38
  41. package/lib/button/index.d.ts +1 -1
  42. package/lib/card/index.js +10 -21
  43. package/lib/descriptions/hooks/useItems.d.ts +1 -1
  44. package/lib/empty/style/index.js +42 -46
  45. package/lib/global.css +48 -0
  46. package/lib/index.d.ts +3 -1
  47. package/lib/index.js +4 -1
  48. package/lib/progress/index.d.ts +1 -0
  49. package/lib/progress/index.js +2 -0
  50. package/lib/progress/progress.d.ts +1 -0
  51. package/lib/progress/progress.js +23 -0
  52. package/lib/radio/index.d.ts +6 -1
  53. package/lib/result/style/index.js +10 -1
  54. package/lib/slider/style/index.js +2 -2
  55. package/lib/switch/index.d.ts +4 -0
  56. package/lib/switch/index.js +40 -1
  57. package/lib/switch/style/index.d.ts +9 -0
  58. package/lib/switch/style/index.js +44 -0
  59. package/lib/table/index.js +5 -0
  60. package/lib/table/style/index.js +77 -42
  61. package/lib/theme/default.js +3 -1
  62. package/lib/theme/style/compact.less +1 -1
  63. package/lib/theme/style/default.less +1 -1
  64. package/lib/tooltip/MouseTooltip.js +3 -2
  65. package/lib/tooltip/index.js +3 -2
  66. package/lib/tooltip/style/index.js +10 -1
  67. package/lib/typography/Link.js +14 -2
  68. package/lib/typography/Paragraph.js +14 -2
  69. package/lib/typography/Text.js +14 -2
  70. package/lib/typography/Title.js +14 -2
  71. package/lib/typography/hooks/useClassName.d.ts +3 -0
  72. package/lib/typography/hooks/useClassName.js +46 -0
  73. package/lib/typography/style/index.js +49 -1
  74. package/package.json +6 -7
  75. package/es/reset.css +0 -10
  76. package/lib/reset.css +0 -10
  77. /package/es/{_util/fonts → fonts}/Consolas.woff2 +0 -0
  78. /package/es/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
  79. /package/es/{_util/fonts → fonts}/Inter.woff2 +0 -0
  80. /package/lib/{_util/fonts → fonts}/Consolas.woff2 +0 -0
  81. /package/lib/{_util/fonts → fonts}/HelveticaNeue.woff2 +0 -0
  82. /package/lib/{_util/fonts → fonts}/Inter.woff2 +0 -0
@@ -5,13 +5,22 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
5
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genTooltipStyle = function genTooltipStyle(token) {
7
7
  var componentCls = token.componentCls;
8
- return _defineProperty({}, componentCls, _defineProperty({}, "".concat(componentCls, "-close-icon-wrap"), _defineProperty({
8
+ return _defineProperty({}, componentCls, _defineProperty(_defineProperty({
9
+ maxWidth: 300
10
+ }, "".concat(componentCls, "-inner"), {
11
+ maxHeight: 250,
12
+ overflow: 'auto'
13
+ }), "".concat(componentCls, "-close-icon-wrap"), _defineProperty({
9
14
  display: 'flex',
10
15
  justifyContent: 'space-between',
11
16
  alignItems: 'flex-start',
12
17
  wordBreak: 'break-all'
13
18
  }, "".concat(componentCls, "-close-icon"), {
14
- cursor: 'pointer'
19
+ cursor: 'pointer',
20
+ color: token.colorIcon,
21
+ '&:hover': {
22
+ color: token.colorIconHover
23
+ }
15
24
  })));
16
25
  };
17
26
  export default (function (prefixCls) {
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["prefixCls", "children"];
2
+ var _excluded = ["editable", "prefixCls", "className", "children"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -10,12 +10,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
  import React, { useContext } from 'react';
11
11
  import { Typography as AntTypography } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
+ import useClassName from "./hooks/useClassName";
13
14
  import useStyle from "./style";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  var AntLink = AntTypography.Link;
16
17
  export * from 'antd/es/typography/Link';
17
18
  var Link = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
- var customizePrefixCls = _ref.prefixCls,
19
+ var editable = _ref.editable,
20
+ customizePrefixCls = _ref.prefixCls,
21
+ className = _ref.className,
19
22
  children = _ref.children,
20
23
  restProps = _objectWithoutProperties(_ref, _excluded);
21
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -23,9 +26,12 @@ var Link = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
26
  var prefixCls = getPrefixCls('typography', customizePrefixCls);
24
27
  var _useStyle = useStyle(prefixCls),
25
28
  wrapSSR = _useStyle.wrapSSR;
29
+ var typographyCls = useClassName(prefixCls, className, editable);
26
30
  return wrapSSR( /*#__PURE__*/_jsx(AntLink, _objectSpread(_objectSpread({
27
31
  ref: ref,
28
- prefixCls: customizePrefixCls
32
+ editable: editable,
33
+ prefixCls: customizePrefixCls,
34
+ className: typographyCls
29
35
  }, restProps), {}, {
30
36
  children: children
31
37
  })));
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["prefixCls", "children"];
2
+ var _excluded = ["editable", "prefixCls", "className", "children"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -10,12 +10,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
  import React, { useContext } from 'react';
11
11
  import { Typography as AntTypography } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
+ import useClassName from "./hooks/useClassName";
13
14
  import useStyle from "./style";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  var AntParagraph = AntTypography.Paragraph;
16
17
  export * from 'antd/es/typography/Paragraph';
17
18
  var Paragraph = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
- var customizePrefixCls = _ref.prefixCls,
19
+ var editable = _ref.editable,
20
+ customizePrefixCls = _ref.prefixCls,
21
+ className = _ref.className,
19
22
  children = _ref.children,
20
23
  restProps = _objectWithoutProperties(_ref, _excluded);
21
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -23,9 +26,12 @@ var Paragraph = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
26
  var prefixCls = getPrefixCls('typography', customizePrefixCls);
24
27
  var _useStyle = useStyle(prefixCls),
25
28
  wrapSSR = _useStyle.wrapSSR;
29
+ var typographyCls = useClassName(prefixCls, className, editable);
26
30
  return wrapSSR( /*#__PURE__*/_jsx(AntParagraph, _objectSpread(_objectSpread({
27
31
  ref: ref,
28
- prefixCls: customizePrefixCls
32
+ editable: editable,
33
+ prefixCls: customizePrefixCls,
34
+ className: typographyCls
29
35
  }, restProps), {}, {
30
36
  children: children
31
37
  })));
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["prefixCls", "children"];
2
+ var _excluded = ["editable", "prefixCls", "className", "children"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -10,12 +10,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
  import React, { useContext } from 'react';
11
11
  import { Typography as AntTypography } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
+ import useClassName from "./hooks/useClassName";
13
14
  import useStyle from "./style";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  var AntText = AntTypography.Text;
16
17
  export * from 'antd/es/typography/Text';
17
18
  var Text = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
- var customizePrefixCls = _ref.prefixCls,
19
+ var editable = _ref.editable,
20
+ customizePrefixCls = _ref.prefixCls,
21
+ className = _ref.className,
19
22
  children = _ref.children,
20
23
  restProps = _objectWithoutProperties(_ref, _excluded);
21
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -23,9 +26,12 @@ var Text = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
26
  var prefixCls = getPrefixCls('typography', customizePrefixCls);
24
27
  var _useStyle = useStyle(prefixCls),
25
28
  wrapSSR = _useStyle.wrapSSR;
29
+ var typographyCls = useClassName(prefixCls, className, editable);
26
30
  return wrapSSR( /*#__PURE__*/_jsx(AntText, _objectSpread(_objectSpread({
27
31
  ref: ref,
28
- prefixCls: customizePrefixCls
32
+ editable: editable,
33
+ prefixCls: customizePrefixCls,
34
+ className: typographyCls
29
35
  }, restProps), {}, {
30
36
  children: children
31
37
  })));
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["prefixCls", "children"];
2
+ var _excluded = ["editable", "prefixCls", "className", "children"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -10,12 +10,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
  import React, { useContext } from 'react';
11
11
  import { Typography as AntTypography } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
+ import useClassName from "./hooks/useClassName";
13
14
  import useStyle from "./style";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  var AntTitle = AntTypography.Title;
16
17
  export * from 'antd/es/typography/Title';
17
18
  var Title = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
- var customizePrefixCls = _ref.prefixCls,
19
+ var editable = _ref.editable,
20
+ customizePrefixCls = _ref.prefixCls,
21
+ className = _ref.className,
19
22
  children = _ref.children,
20
23
  restProps = _objectWithoutProperties(_ref, _excluded);
21
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -23,9 +26,12 @@ var Title = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
26
  var prefixCls = getPrefixCls('typography', customizePrefixCls);
24
27
  var _useStyle = useStyle(prefixCls),
25
28
  wrapSSR = _useStyle.wrapSSR;
29
+ var typographyCls = useClassName(prefixCls, className, editable);
26
30
  return wrapSSR( /*#__PURE__*/_jsx(AntTitle, _objectSpread(_objectSpread({
27
31
  ref: ref,
28
- prefixCls: customizePrefixCls
32
+ editable: editable,
33
+ prefixCls: customizePrefixCls,
34
+ className: typographyCls
29
35
  }, restProps), {}, {
30
36
  children: children
31
37
  })));
@@ -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,11 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
3
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
+ import classNames from 'classnames';
6
+ var useClassName = function useClassName(prefixCls, className, editable) {
7
+ var _editable$triggerType;
8
+ var typographyCls = classNames(_defineProperty({}, "".concat(prefixCls, "-editable-text"), _typeof(editable) === 'object' && (editable === null || editable === void 0 || (_editable$triggerType = editable.triggerType) === null || _editable$triggerType === void 0 ? void 0 : _editable$triggerType.includes('text'))), className);
9
+ return typographyCls;
10
+ };
11
+ export default useClassName;
@@ -4,8 +4,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genTypographyStyle = function genTypographyStyle(token) {
7
- var componentCls = token.componentCls;
8
- return _defineProperty(_defineProperty({}, "span".concat(componentCls), {
7
+ var componentCls = token.componentCls,
8
+ controlHeight = token.controlHeight,
9
+ fontSize = token.fontSize,
10
+ lineHeight = token.lineHeight;
11
+ var marginOffset = (controlHeight - fontSize * lineHeight) / 2;
12
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "span".concat(componentCls), {
9
13
  lineHeight: 'inherit',
10
14
  color: 'inherit',
11
15
  fontSize: 'inherit'
@@ -13,7 +17,45 @@ export var genTypographyStyle = function genTypographyStyle(token) {
13
17
  lineHeight: 'inherit',
14
18
  color: 'inherit',
15
19
  fontSize: 'inherit'
16
- });
20
+ }), "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-edit"), {
21
+ fontSize: token.fontSize
22
+ })), "".concat(componentCls).concat(componentCls, "-editable-text:not(").concat(componentCls, "-edit-content)"), {
23
+ '&:hover': {
24
+ background: token.colorBgContainer,
25
+ border: "".concat(token.lineWidth, "px ").concat(token.lineType, " ").concat(token.colorBorder),
26
+ borderRadius: token.borderRadius,
27
+ position: 'relative',
28
+ insetInlineStart: -token.paddingSM,
29
+ padding: "".concat(marginOffset - token.lineWidth, "px ").concat(token.paddingSM - token.lineWidth, "px")
30
+ },
31
+ 'div&:hover': {
32
+ height: token.controlHeight,
33
+ marginTop: -marginOffset,
34
+ marginBottom: "calc(1em - ".concat(marginOffset, "px)")
35
+ },
36
+ 'span&:hover': {
37
+ display: 'inline-block',
38
+ height: token.controlHeight,
39
+ marginTop: -marginOffset,
40
+ marginBottom: -marginOffset
41
+ },
42
+ 'h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover': {
43
+ marginTop: "".concat(-marginOffset, "px !important"),
44
+ marginBottom: "".concat(-marginOffset, "px !important")
45
+ }
46
+ }), "".concat(componentCls).concat(componentCls, "-edit-content"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-div&"), {
47
+ insetInlineStart: -token.paddingSM,
48
+ marginTop: -marginOffset,
49
+ marginBottom: "calc(1em - ".concat(marginOffset, "px)")
50
+ }), "".concat(componentCls, "-span&"), {
51
+ insetInlineStart: -token.paddingSM,
52
+ marginTop: -marginOffset,
53
+ marginBottom: -marginOffset
54
+ }), "".concat(componentCls, "-h1&, ").concat(componentCls, "-h2&, ").concat(componentCls, "-h3&, ").concat(componentCls, "-h4&, ").concat(componentCls, "-h5&"), {
55
+ insetInlineStart: -token.paddingSM,
56
+ marginTop: "".concat(-marginOffset, "px !important"),
57
+ marginBottom: "".concat(-marginOffset, "px !important")
58
+ }));
17
59
  };
18
60
  export default (function (prefixCls) {
19
61
  var useStyle = genComponentStyleHook('Typography', function (token) {
@@ -4,7 +4,6 @@ import type { ComponentTokenMap } from 'antd/es/theme/interface';
4
4
  import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
5
5
  import type { GlobalToken } from 'antd/es/theme/interface';
6
6
  export type ComponentName = keyof ComponentTokenMap;
7
- export declare const genCustomFontStyle: (token: GlobalToken) => CSSObject[];
8
7
  export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>, getDefaultToken?: Partial<FullToken<ComponentName>> | ((token: GlobalToken) => Partial<FullToken<ComponentName>>)): (prefixCls: string) => {
9
8
  wrapSSR: (node: React.ReactNode) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
10
9
  hashId: string;
@@ -29,51 +29,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/_util/genComponentStyleHook.ts
30
30
  var genComponentStyleHook_exports = {};
31
31
  __export(genComponentStyleHook_exports, {
32
- genComponentStyleHook: () => genComponentStyleHook,
33
- genCustomFontStyle: () => genCustomFontStyle
32
+ genComponentStyleHook: () => genComponentStyleHook
34
33
  });
35
34
  module.exports = __toCommonJS(genComponentStyleHook_exports);
36
35
  var import_internal = require("antd/es/theme/internal");
37
36
  var import_theme = __toESM(require("../theme"));
38
- var import_Inter = __toESM(require("./fonts/Inter.woff2"));
39
- var import_Consolas = __toESM(require("./fonts/Consolas.woff2"));
40
- var import_HelveticaNeue = __toESM(require("./fonts/HelveticaNeue.woff2"));
41
- var genCustomFontStyle = (token) => {
42
- return [
43
- {
44
- // English font: work by default
45
- ["@font-face"]: {
46
- fontFamily: "Inter",
47
- // load priority: remote font > local font
48
- src: `url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2'), url(${import_Inter.default}) format('woff2')`,
49
- // 定义字体加载策略,外置字体加载前使用默认字体进行兜底
50
- fontDisplay: "swap"
51
- }
52
- },
53
- {
54
- // Code font: work by default
55
- ["@font-face"]: {
56
- fontFamily: "Consolas",
57
- src: `url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2'), url(${import_Consolas.default}) format('woff2')`,
58
- fontDisplay: "swap"
59
- }
60
- },
61
- {
62
- // Number code: work manully by configuring font-family
63
- ["@font-face"]: {
64
- fontFamily: "Helvetica Neue",
65
- src: `url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2'), url(${import_HelveticaNeue.default}) format('woff2')`,
66
- fontDisplay: "swap"
67
- }
68
- }
69
- ];
70
- };
71
37
  function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
72
38
  return (prefixCls) => {
73
39
  const useStyle = (0, import_internal.genComponentStyleHook)(
74
40
  `OB-${componentName}`,
75
41
  (token) => {
76
- return [genCustomFontStyle(token), styleFn(token)];
42
+ return [styleFn(token)];
77
43
  },
78
44
  getDefaultToken,
79
45
  {
@@ -94,6 +60,5 @@ function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
94
60
  }
95
61
  // Annotate the CommonJS export names for ESM import in node:
96
62
  0 && (module.exports = {
97
- genComponentStyleHook,
98
- genCustomFontStyle
63
+ genComponentStyleHook
99
64
  });
@@ -2,7 +2,7 @@ import type { ButtonProps as AntButtonProps } from 'antd/es/button';
2
2
  import React from 'react';
3
3
  export * from 'antd/es/button';
4
4
  export type ButtonProps = AntButtonProps;
5
- declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
5
+ declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
6
6
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
7
  __ANT_BUTTON: boolean;
8
8
  };
package/lib/card/index.js CHANGED
@@ -78,29 +78,18 @@ var Card = import_react.default.forwardRef(
78
78
  });
79
79
  return wrapSSR(
80
80
  /* @__PURE__ */ import_react.default.createElement(
81
- import_config_provider.default,
81
+ import_antd.Card,
82
82
  {
83
- injectStaticFunction: false,
84
- table: noBodyPadding ? {
85
- // expand selection column width for larger padding-left
86
- // related to .ant-card-no-body-padding style
87
- selectionColumnWidth: size === "small" ? 36 : 48
88
- } : {}
83
+ ref,
84
+ size,
85
+ tabList: newTabList,
86
+ prefixCls: customizePrefixCls,
87
+ bodyStyle,
88
+ styles,
89
+ className: cardCls,
90
+ ...restProps
89
91
  },
90
- /* @__PURE__ */ import_react.default.createElement(
91
- import_antd.Card,
92
- {
93
- ref,
94
- size,
95
- tabList: newTabList,
96
- prefixCls: customizePrefixCls,
97
- bodyStyle,
98
- styles,
99
- className: cardCls,
100
- ...restProps
101
- },
102
- children
103
- )
92
+ children
104
93
  )
105
94
  );
106
95
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { DescriptionsItemType } from '..';
3
3
  export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
4
4
  children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
5
- span?: number | {
5
+ span?: number | "filled" | {
6
6
  xxl?: number;
7
7
  xl?: number;
8
8
  lg?: number;
@@ -26,15 +26,7 @@ module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
27
  var import_genStyle = require("../../_util/genStyle");
28
28
  var genEmptyStyle = (token) => {
29
- const {
30
- antCls,
31
- componentCls,
32
- colorTextTertiary,
33
- colorBgLayout,
34
- colorFill,
35
- colorText,
36
- colorTextSecondary
37
- } = token;
29
+ const { antCls, componentCls, colorTextTertiary, colorText, colorTextSecondary } = token;
38
30
  return {
39
31
  [`${componentCls}`]: {
40
32
  [`${componentCls}-image`]: {
@@ -47,54 +39,58 @@ var genEmptyStyle = (token) => {
47
39
  [`${componentCls}-title`]: {
48
40
  color: token.colorText,
49
41
  fontWeight: token.fontWeightStrong,
50
- fontSize: token.fontSizeHeading3,
51
- lineHeight: token.lineHeightHeading3,
42
+ fontSize: token.fontSizeHeading4,
43
+ lineHeight: token.lineHeightHeading4,
52
44
  marginTop: token.marginLG
53
45
  },
54
46
  [`${componentCls}-description-content`]: {
55
47
  color: colorTextTertiary,
48
+ maxWidth: 600,
49
+ margin: "0px auto",
56
50
  marginTop: token.marginXS
57
- }
58
- },
59
- [`${componentCls}-footer`]: {
60
- marginTop: token.marginLG,
61
- ...(0, import_genStyle.genLargeStyle)(token)
62
- },
63
- [`${antCls}-steps`]: {
64
- marginTop: token.margin,
65
- padding: token.paddingLG,
66
- backgroundColor: token.colorFillQuaternary,
67
- borderRadius: token.borderRadiusLG,
68
- [`${antCls}-steps-item-container`]: {
69
- [`${antCls}-steps-item-icon`]: {
70
- height: token.controlHeightSM,
71
- width: token.controlHeightSM,
72
- lineHeight: `${token.controlHeightSM}px`,
73
- backgroundColor: token.colorFillSecondary,
74
- // override default border color
75
- borderColor: token.colorFillSecondary,
76
- [`${antCls}-steps-icon`]: {
77
- color: colorTextSecondary,
78
- fontSize: token.fontSize
79
- }
80
- },
81
- [`${antCls}-steps-item-content`]: {
82
- [`${antCls}-steps-item-title`]: {
83
- color: colorText,
84
- fontSize: token.fontSize,
85
- fontWeight: token.fontWeightStrong,
51
+ },
52
+ [`${antCls}-steps`]: {
53
+ maxWidth: 1e3,
54
+ margin: "0px auto",
55
+ marginTop: token.marginLG,
56
+ padding: token.paddingLG,
57
+ backgroundColor: token.colorFillQuaternary,
58
+ borderRadius: token.borderRadiusLG,
59
+ [`${antCls}-steps-item-container`]: {
60
+ [`${antCls}-steps-item-icon`]: {
61
+ height: token.controlHeightSM,
62
+ width: token.controlHeightSM,
86
63
  lineHeight: `${token.controlHeightSM}px`,
87
- "&::after": {
88
- top: token.controlHeightSM / 2
64
+ backgroundColor: token.colorFillSecondary,
65
+ // override default border color
66
+ borderColor: token.colorFillSecondary,
67
+ [`${antCls}-steps-icon`]: {
68
+ color: colorTextSecondary,
69
+ fontSize: token.fontSize
89
70
  }
90
71
  },
91
- [`${antCls}-steps-item-description`]: {
92
- color: colorTextTertiary,
93
- fontSize: token.fontSizeSM,
94
- marginTop: token.marginXS
72
+ [`${antCls}-steps-item-content`]: {
73
+ [`${antCls}-steps-item-title`]: {
74
+ color: colorText,
75
+ fontSize: token.fontSize,
76
+ fontWeight: token.fontWeightStrong,
77
+ lineHeight: `${token.controlHeightSM}px`,
78
+ "&::after": {
79
+ top: token.controlHeightSM / 2
80
+ }
81
+ },
82
+ [`${antCls}-steps-item-description`]: {
83
+ color: colorTextTertiary,
84
+ fontSize: token.fontSizeSM,
85
+ marginTop: token.marginXS
86
+ }
95
87
  }
96
88
  }
97
89
  }
90
+ },
91
+ [`${componentCls}-footer`]: {
92
+ marginTop: token.marginLG,
93
+ ...(0, import_genStyle.genLargeStyle)(token)
98
94
  }
99
95
  },
100
96
  [`${componentCls}-horizontal`]: {
package/lib/global.css ADDED
@@ -0,0 +1,48 @@
1
+ @import 'antd/dist/reset.css';
2
+
3
+ @font-face {
4
+ font-family: 'Inter';
5
+ /* load priority: local font > remote font > self-hosting font */
6
+ src:
7
+ local('Inter'),
8
+ url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2')
9
+ format('woff2'),
10
+ url('./fonts/Inter.woff2') format('woff2');
11
+ /* load strategy: use default font as fallback */
12
+ font-display: swap;
13
+ }
14
+
15
+ @font-face {
16
+ font-family: 'Consolas';
17
+ src:
18
+ local('Consolas'),
19
+ url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2')
20
+ format('woff2'),
21
+ url('./fonts/Consolas.woff2') format('woff2');
22
+ font-display: swap;
23
+ }
24
+
25
+ @font-face {
26
+ font-family: 'Helvetica Neue';
27
+ src:
28
+ local('Helvetica Neue'),
29
+ url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2')
30
+ format('woff2'),
31
+ url('./fonts/HelveticaNeue.woff2') format('woff2');
32
+ font-display: swap;
33
+ }
34
+
35
+ pre,
36
+ code,
37
+ kbd,
38
+ samp {
39
+ font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
40
+ }
41
+
42
+ * {
43
+ scrollbar-color: #e2e8f3 transparent;
44
+ }
45
+
46
+ .rc-virtual-list-scrollbar-thumb {
47
+ background: #e2e8f3 !important;
48
+ }
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import './reset.css';
1
+ import './global.css';
2
2
  export * from 'antd';
3
3
  export { version } from '../package.json';
4
4
  export { default as Alert } from './alert';
@@ -42,6 +42,8 @@ export { default as Radio } from './radio';
42
42
  export type { RadioProps } from './radio';
43
43
  export { default as Checkbox } from './checkbox';
44
44
  export type { CheckboxProps } from './checkbox';
45
+ export { default as Switch } from './switch';
46
+ export type { SwitchProps } from './switch';
45
47
  export { default as Select } from './select';
46
48
  export type { SelectProps } from './select';
47
49
  export { default as TreeSelect } from './tree-select';
package/lib/index.js CHANGED
@@ -55,6 +55,7 @@ __export(src_exports, {
55
55
  Slider: () => import_slider.default,
56
56
  Space: () => import_space.default,
57
57
  Spin: () => import_spin.default,
58
+ Switch: () => import_switch.default,
58
59
  Table: () => import_table.default,
59
60
  Tabs: () => import_tabs.default,
60
61
  Tag: () => import_tag.default,
@@ -70,7 +71,7 @@ __export(src_exports, {
70
71
  version: () => import_package.version
71
72
  });
72
73
  module.exports = __toCommonJS(src_exports);
73
- var import_reset = require("./reset.css");
74
+ var import_global = require("./global.css");
74
75
  __reExport(src_exports, require("antd"), module.exports);
75
76
  var import_package = require("../package.json");
76
77
  var import_alert = __toESM(require("./alert"));
@@ -94,6 +95,7 @@ var import_input = __toESM(require("./input"));
94
95
  var import_input_number = __toESM(require("./input-number"));
95
96
  var import_radio = __toESM(require("./radio"));
96
97
  var import_checkbox = __toESM(require("./checkbox"));
98
+ var import_switch = __toESM(require("./switch"));
97
99
  var import_select = __toESM(require("./select"));
98
100
  var import_tree_select = __toESM(require("./tree-select"));
99
101
  var import_slider = __toESM(require("./slider"));
@@ -135,6 +137,7 @@ var { useToken } = import_theme2.default;
135
137
  Slider,
136
138
  Space,
137
139
  Spin,
140
+ Switch,
138
141
  Table,
139
142
  Tabs,
140
143
  Tag,
@@ -1 +1,2 @@
1
+ export * from 'antd/es/progress/progress';
1
2
  export * from 'antd/es/progress';
@@ -16,8 +16,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // src/progress/index.ts
17
17
  var progress_exports = {};
18
18
  module.exports = __toCommonJS(progress_exports);
19
+ __reExport(progress_exports, require("antd/es/progress/progress"), module.exports);
19
20
  __reExport(progress_exports, require("antd/es/progress"), module.exports);
20
21
  // Annotate the CommonJS export names for ESM import in node:
21
22
  0 && (module.exports = {
23
+ ...require("antd/es/progress/progress"),
22
24
  ...require("antd/es/progress")
23
25
  });
@@ -0,0 +1 @@
1
+ export * from 'antd/es/progress/progress';