@oceanbase/design 0.2.13 → 0.2.15

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 (86) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/genComponentStyleHook.d.ts +3 -1
  3. package/es/_util/genComponentStyleHook.js +2 -2
  4. package/es/alert/index.js +2 -3
  5. package/es/alert/style/index.js +21 -4
  6. package/es/button/index.d.ts +1 -1
  7. package/es/button/index.js +2 -3
  8. package/es/card/index.js +2 -3
  9. package/es/card/style/index.js +2 -2
  10. package/es/config-provider/index.d.ts +12 -3
  11. package/es/config-provider/index.js +3 -1
  12. package/es/descriptions/index.js +5 -7
  13. package/es/form/FormItem.d.ts +1 -1
  14. package/es/index.d.ts +1 -0
  15. package/es/index.js +1 -0
  16. package/es/lottie/index.d.ts +16 -0
  17. package/es/lottie/index.js +65 -0
  18. package/es/modal/Modal.d.ts +30 -0
  19. package/es/modal/Modal.js +50 -0
  20. package/es/modal/Progress.d.ts +10 -0
  21. package/es/modal/Progress.js +46 -0
  22. package/es/modal/index.d.ts +7 -30
  23. package/es/modal/index.js +4 -52
  24. package/es/modal/style/index.js +42 -5
  25. package/es/spin/assets/spin-gray.json +1 -0
  26. package/es/spin/assets/spin.json +1 -0
  27. package/es/spin/index.d.ts +11 -0
  28. package/es/spin/index.js +49 -1
  29. package/es/spin/style/index.d.ts +13 -0
  30. package/es/spin/style/index.js +70 -0
  31. package/es/table/index.d.ts +2 -2
  32. package/es/table/index.js +8 -4
  33. package/es/tabs/index.js +5 -4
  34. package/es/tabs/style/index.d.ts +2 -1
  35. package/es/theme/index.d.ts +0 -48
  36. package/es/theme/index.js +5 -3
  37. package/es/theme/internal.d.ts +1 -0
  38. package/es/theme/internal.js +1 -0
  39. package/es/tooltip/MouseTooltip.js +1 -1
  40. package/es/tooltip/index.d.ts +2 -0
  41. package/es/tooltip/index.js +70 -7
  42. package/es/tooltip/style/index.d.ts +9 -0
  43. package/es/tooltip/style/index.js +29 -0
  44. package/lib/_util/genComponentStyleHook.d.ts +3 -1
  45. package/lib/_util/genComponentStyleHook.js +8 -4
  46. package/lib/alert/index.js +2 -3
  47. package/lib/alert/style/index.js +20 -1
  48. package/lib/button/index.d.ts +1 -1
  49. package/lib/button/index.js +2 -2
  50. package/lib/card/index.js +2 -3
  51. package/lib/card/style/index.js +5 -7
  52. package/lib/config-provider/index.d.ts +12 -3
  53. package/lib/config-provider/index.js +2 -1
  54. package/lib/descriptions/index.js +4 -5
  55. package/lib/form/FormItem.d.ts +1 -1
  56. package/lib/index.d.ts +1 -0
  57. package/lib/index.js +3 -0
  58. package/lib/lottie/index.d.ts +16 -0
  59. package/lib/lottie/index.js +79 -0
  60. package/lib/modal/Modal.d.ts +30 -0
  61. package/lib/modal/Modal.js +59 -0
  62. package/lib/modal/Progress.d.ts +10 -0
  63. package/lib/modal/Progress.js +71 -0
  64. package/lib/modal/index.d.ts +7 -30
  65. package/lib/modal/index.js +5 -40
  66. package/lib/modal/style/index.js +60 -1
  67. package/lib/spin/assets/spin-gray.json +1 -0
  68. package/lib/spin/assets/spin.json +1 -0
  69. package/lib/spin/index.d.ts +11 -0
  70. package/lib/spin/index.js +63 -1
  71. package/lib/spin/style/index.d.ts +13 -0
  72. package/lib/spin/style/index.js +105 -0
  73. package/lib/table/index.d.ts +2 -2
  74. package/lib/table/index.js +7 -4
  75. package/lib/tabs/index.js +2 -2
  76. package/lib/tabs/style/index.d.ts +2 -1
  77. package/lib/theme/index.d.ts +0 -48
  78. package/lib/theme/index.js +3 -4
  79. package/lib/theme/internal.d.ts +1 -0
  80. package/lib/theme/internal.js +23 -0
  81. package/lib/tooltip/MouseTooltip.js +1 -1
  82. package/lib/tooltip/index.d.ts +2 -0
  83. package/lib/tooltip/index.js +44 -2
  84. package/lib/tooltip/style/index.d.ts +9 -0
  85. package/lib/tooltip/style/index.js +55 -0
  86. package/package.json +10 -9
package/es/tabs/index.js CHANGED
@@ -42,9 +42,8 @@ var Tabs = function Tabs(_ref) {
42
42
  getPrefixCls = _useContext.getPrefixCls;
43
43
  var prefixCls = getPrefixCls('tabs', customizePrefixCls);
44
44
  var _useStyle = useStyle(prefixCls),
45
- wrapSSR = _useStyle.wrapSSR,
46
- hashId = _useStyle.hashId;
47
- var tabsCls = classNames(className, hashId);
45
+ wrapSSR = _useStyle.wrapSSR;
46
+ var tabsCls = classNames(className);
48
47
  var ref = useRef();
49
48
  var isHorizontal = !tabPosition || tabPosition === 'top' || tabPosition === 'bottom';
50
49
  var newItems = items === null || items === void 0 ? void 0 : items.map(function (item) {
@@ -81,7 +80,9 @@ var Tabs = function Tabs(_ref) {
81
80
  tabPosition: tabPosition,
82
81
  containerRef: ref
83
82
  });
84
- return wrapSSR( /*#__PURE__*/React.createElement(AntTabs, _extends({
83
+ return wrapSSR( /*#__PURE__*/React.createElement(AntTabs
84
+ // @ts-ignore
85
+ , _extends({
85
86
  ref: ref,
86
87
  items: newItems,
87
88
  defaultActiveKey: defaultActiveKey,
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
3
3
  export type TabsToken = FullToken<'Tabs'>;
4
- export declare const genTagStyle: GenerateStyle<TabsToken>;
4
+ export type CardToken = FullToken<'Card'>;
5
+ export declare const genTagStyle: GenerateStyle<TabsToken | CardToken>;
5
6
  declare const _default: (prefixCls: string) => {
6
7
  wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
8
  hashId: string;
@@ -50,54 +50,6 @@ declare const _default: {
50
50
  gold: string;
51
51
  };
52
52
  defaultConfig: {
53
- defaultSeed: {
54
- colorPrimary: string;
55
- colorInfo: string;
56
- colorSuccess: string;
57
- colorWarning: string;
58
- colorError: string;
59
- borderRadius: number;
60
- blue: string;
61
- green: string;
62
- yellow: string;
63
- red: string;
64
- colorTextBase: string;
65
- colorBgBase: string;
66
- colorLink: string;
67
- fontFamily: string;
68
- fontFamilyCode: string;
69
- fontSize: number;
70
- lineWidth: number;
71
- lineType: string;
72
- sizeUnit: number;
73
- sizeStep: number;
74
- sizePopupArrow: number;
75
- controlHeight: number;
76
- zIndexBase: number;
77
- zIndexPopupBase: number;
78
- opacityImage: number;
79
- motionUnit: number;
80
- motionBase: number;
81
- motionEaseOutCirc: string;
82
- motionEaseInOutCirc: string;
83
- motionEaseInOut: string;
84
- motionEaseOutBack: string;
85
- motionEaseInBack: string;
86
- motionEaseInQuint: string;
87
- motionEaseOutQuint: string;
88
- motionEaseOut: string;
89
- wireframe: boolean;
90
- motion: boolean;
91
- purple: string;
92
- cyan: string;
93
- magenta: string;
94
- pink: string;
95
- orange: string;
96
- volcano: string;
97
- geekblue: string;
98
- lime: string;
99
- gold: string;
100
- };
101
53
  token: import("antd/es/theme/internal").SeedToken;
102
54
  hashed: boolean;
103
55
  };
package/es/theme/index.js CHANGED
@@ -20,11 +20,13 @@ var defaultSeed = _objectSpread(_objectSpread({}, theme.defaultSeed), {}, {
20
20
  yellow: '#ffac33',
21
21
  red: '#ff4b4b'
22
22
  });
23
+
24
+ // should use reference assign instead of clone assign
25
+ var defaultConfig = theme.defaultConfig;
26
+ defaultConfig.token = defaultSeed;
23
27
  export default _objectSpread(_objectSpread({}, theme), {}, {
24
28
  defaultSeed: defaultSeed,
25
- defaultConfig: _objectSpread(_objectSpread({}, theme.defaultConfig), {}, {
26
- defaultSeed: defaultSeed
27
- }),
29
+ defaultConfig: defaultConfig,
28
30
  components: {
29
31
  InputNumber: {
30
32
  handleVisible: true
@@ -0,0 +1 @@
1
+ export * from 'antd/es/theme/internal';
@@ -0,0 +1 @@
1
+ export * from 'antd/es/theme/internal';
@@ -94,7 +94,7 @@ var MouseTooltip = function MouseTooltip(_ref) {
94
94
  }, restOverlayInnerStyle)
95
95
  }, restProps), /*#__PURE__*/React.createElement("div", {
96
96
  ref: ref
97
- }, title)));
97
+ }, typeof title === 'function' ? title() : title)));
98
98
  };
99
99
  if (process.env.NODE_ENV !== 'production') {
100
100
  MouseTooltip.displayName = 'MouseTooltip';
@@ -5,6 +5,8 @@ export type TooltipType = 'default' | 'light' | 'success' | 'info' | 'warning' |
5
5
  export interface TooltipProps extends AntTooltipPropsWithTitle {
6
6
  type?: TooltipType;
7
7
  mouseFollow?: boolean;
8
+ closeIcon?: boolean | React.ReactNode;
9
+ onClose?: (e: React.MouseEvent<HTMLElement>) => void;
8
10
  }
9
11
  export declare const getTooltipTypeList: () => {
10
12
  type: string;
@@ -1,17 +1,28 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["children", "type", "color", "overlayInnerStyle", "mouseFollow"];
2
+ var _excluded = ["children", "type", "color", "overlayInnerStyle", "mouseFollow", "closeIcon", "onClose", "title", "className", "open"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
  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; }
7
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
8
  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); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
15
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
16
  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; }
11
- import { Tooltip as AntTooltip } from 'antd';
12
- import React from 'react';
17
+ import { Tooltip as AntTooltip, Space } from 'antd';
18
+ import React, { useContext, useMemo, useState } from 'react';
19
+ import { CloseOutlined } from '@oceanbase/icons';
20
+ import { isNil } from 'lodash';
13
21
  import { token } from "../static-function";
14
22
  import MouseTooltip from "./MouseTooltip";
23
+ import ConfigProvider from "../config-provider";
24
+ import useStyle from "./style";
25
+ import classNames from 'classnames';
15
26
  export * from 'antd/es/tooltip';
16
27
  export var getTooltipTypeList = function getTooltipTypeList() {
17
28
  return [{
@@ -43,22 +54,74 @@ var Tooltip = function Tooltip(_ref) {
43
54
  color = _ref.color,
44
55
  overlayInnerStyle = _ref.overlayInnerStyle,
45
56
  mouseFollow = _ref.mouseFollow,
57
+ _ref$closeIcon = _ref.closeIcon,
58
+ closeIcon = _ref$closeIcon === void 0 ? false : _ref$closeIcon,
59
+ onClose = _ref.onClose,
60
+ title = _ref.title,
61
+ className = _ref.className,
62
+ propOpen = _ref.open,
46
63
  restProps = _objectWithoutProperties(_ref, _excluded);
64
+ var _useContext = useContext(ConfigProvider.ConfigContext),
65
+ getPrefixCls = _useContext.getPrefixCls;
66
+ var customizePrefixCls = restProps.prefixCls;
67
+ var prefixCls = getPrefixCls('tooltip', customizePrefixCls);
68
+ var _useStyle = useStyle(prefixCls),
69
+ wrapSSR = _useStyle.wrapSSR,
70
+ hashId = _useStyle.hashId;
71
+ var tooltipCls = classNames(className, hashId);
72
+ var _useState = useState(undefined),
73
+ _useState2 = _slicedToArray(_useState, 2),
74
+ innerOpen = _useState2[0],
75
+ setInnerOpen = _useState2[1];
76
+ var open = isNil(propOpen) ? innerOpen : propOpen;
77
+ var handleCloseClick = function handleCloseClick(e) {
78
+ e.stopPropagation();
79
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
80
+ if (e.defaultPrevented) {
81
+ return;
82
+ }
83
+ setInnerOpen(false);
84
+ };
85
+ var hasCloseIcon = !!closeIcon;
86
+ var CloseIconNode = useMemo(function () {
87
+ if (!hasCloseIcon) {
88
+ return null;
89
+ }
90
+ return closeIcon === true ? /*#__PURE__*/React.createElement(CloseOutlined, {
91
+ className: "".concat(prefixCls, "-close-icon"),
92
+ onClick: handleCloseClick
93
+ }) : /*#__PURE__*/React.createElement("span", {
94
+ className: "".concat(prefixCls, "-close-icon"),
95
+ onClick: handleCloseClick
96
+ }, closeIcon);
97
+ }, [closeIcon]);
98
+ var titleNode = typeof title === 'function' ? title() : title;
99
+ var titleWithCloseIcon = /*#__PURE__*/React.createElement(Space, {
100
+ className: "".concat(prefixCls, "-close-icon-wrap")
101
+ }, titleNode, CloseIconNode);
47
102
  var typeList = getTooltipTypeList();
48
103
  var typeItem = typeList.find(function (item) {
49
104
  return item.type === type;
50
105
  });
51
- return mouseFollow ? /*#__PURE__*/React.createElement(MouseTooltip, _extends({
106
+ return wrapSSR(mouseFollow ? /*#__PURE__*/React.createElement(MouseTooltip, _extends({
107
+ title: title,
52
108
  color: color || (typeItem === null || typeItem === void 0 ? void 0 : typeItem.backgroundColor),
53
109
  overlayInnerStyle: _objectSpread({
54
110
  color: typeItem === null || typeItem === void 0 ? void 0 : typeItem.color
55
- }, overlayInnerStyle)
111
+ }, overlayInnerStyle),
112
+ className: tooltipCls
56
113
  }, restProps), children) : /*#__PURE__*/React.createElement(AntTooltip, _extends({
114
+ title: hasCloseIcon ? titleWithCloseIcon : title,
57
115
  color: color || (typeItem === null || typeItem === void 0 ? void 0 : typeItem.backgroundColor),
116
+ open: open,
117
+ onOpenChange: function onOpenChange(open) {
118
+ setInnerOpen(open);
119
+ },
58
120
  overlayInnerStyle: _objectSpread({
59
121
  color: typeItem === null || typeItem === void 0 ? void 0 : typeItem.color
60
- }, overlayInnerStyle)
61
- }, restProps), children);
122
+ }, overlayInnerStyle),
123
+ className: tooltipCls
124
+ }, restProps), children));
62
125
  };
63
126
  if (process.env.NODE_ENV !== 'production') {
64
127
  Tooltip.displayName = AntTooltip.displayName;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
3
+ export type TooltipToken = FullToken<'Tooltip'>;
4
+ export declare const genTooltipStyle: GenerateStyle<TooltipToken>;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ hashId: string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,29 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genTooltipStyle = function genTooltipStyle(token) {
7
+ var componentCls = token.componentCls;
8
+ return _defineProperty({}, componentCls, _defineProperty({}, "".concat(componentCls, "-close-icon-wrap"), _defineProperty({
9
+ display: 'flex',
10
+ justifyContent: 'space-between',
11
+ alignItems: 'flex-start',
12
+ wordBreak: 'break-all'
13
+ }, "".concat(componentCls, "-close-icon"), {
14
+ cursor: 'pointer'
15
+ })));
16
+ };
17
+ export default (function (prefixCls) {
18
+ var useStyle = genComponentStyleHook('Tooltip', function (token) {
19
+ return [genTooltipStyle(token)];
20
+ }, function (_ref2) {
21
+ var zIndexPopupBase = _ref2.zIndexPopupBase,
22
+ colorBgSpotlight = _ref2.colorBgSpotlight;
23
+ return {
24
+ zIndexPopup: zIndexPopupBase + 70,
25
+ colorBgDefault: colorBgSpotlight
26
+ };
27
+ });
28
+ return useStyle(prefixCls);
29
+ });
@@ -2,8 +2,10 @@
2
2
  import type { CSSObject } from '@ant-design/cssinjs';
3
3
  import type { ComponentTokenMap } from 'antd/es/theme/interface';
4
4
  import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
5
+ import type { GlobalToken } from 'antd/es/theme/interface';
6
+ import type { OverrideTokenWithoutDerivative } from 'antd/es/theme/util/genComponentStyleHook';
5
7
  export type ComponentName = keyof ComponentTokenMap;
6
- export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>): (prefixCls: string) => {
8
+ export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>, getDefaultToken?: OverrideTokenWithoutDerivative[ComponentName] | ((token: GlobalToken) => OverrideTokenWithoutDerivative[ComponentName])): (prefixCls: string) => {
7
9
  wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
8
10
  hashId: string;
9
11
  };
@@ -23,11 +23,15 @@ __export(genComponentStyleHook_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(genComponentStyleHook_exports);
25
25
  var import_internal = require("antd/es/theme/internal");
26
- function genComponentStyleHook(componentName, styleFn) {
26
+ function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
27
27
  return (prefixCls) => {
28
- const useStyle = (0, import_internal.genComponentStyleHook)(`OB-${componentName}`, (token) => {
29
- return [styleFn(token)];
30
- });
28
+ const useStyle = (0, import_internal.genComponentStyleHook)(
29
+ `OB-${componentName}`,
30
+ (token) => {
31
+ return [styleFn(token)];
32
+ },
33
+ getDefaultToken
34
+ );
31
35
  const [wrapSSR, hashId] = useStyle(prefixCls);
32
36
  return {
33
37
  wrapSSR,
@@ -48,14 +48,13 @@ var Alert = ({
48
48
  }) => {
49
49
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
50
50
  const prefixCls = getPrefixCls("alert", customizePrefixCls);
51
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
51
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
52
52
  const alertCls = (0, import_classnames.default)(
53
53
  {
54
54
  [`${prefixCls}-ghost`]: ghost,
55
55
  [`${prefixCls}-colored`]: colored
56
56
  },
57
- className,
58
- hashId
57
+ className
59
58
  );
60
59
  return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Alert, { prefixCls: customizePrefixCls, className: alertCls, ...restProps }));
61
60
  };
@@ -75,9 +75,28 @@ var genAlertStyle = (token) => {
75
75
  colorWarning,
76
76
  colorWarningHover,
77
77
  colorError,
78
- colorErrorHover
78
+ colorErrorHover,
79
+ colorIcon,
80
+ colorIconHover,
81
+ motionDurationMid
79
82
  } = token;
83
+ const height = token.fontSize * token.lineHeight;
80
84
  return {
85
+ [`${componentCls}`]: {
86
+ // vertical align to flex-start
87
+ alignItems: "flex-start",
88
+ [`${componentCls}-icon`]: {
89
+ height
90
+ },
91
+ [`${componentCls}-close-icon`]: {
92
+ height,
93
+ color: colorIcon,
94
+ transition: `color ${motionDurationMid}`,
95
+ "&:hover": {
96
+ color: colorIconHover
97
+ }
98
+ }
99
+ },
81
100
  [`${componentCls}${componentCls}-with-description`]: {
82
101
  paddingBlock: token.padding,
83
102
  [`${componentCls}-message`]: {
@@ -5,7 +5,7 @@ export type ButtonProps = AntButtonProps;
5
5
  declare const Button: {
6
6
  ({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
7
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
8
- __ANT_BUTTON: any;
8
+ __ANT_BUTTON: boolean;
9
9
  displayName: string;
10
10
  };
11
11
  export default Button;
@@ -42,8 +42,8 @@ __reExport(button_exports, require("antd/es/button"), module.exports);
42
42
  var Button = ({ prefixCls: customizePrefixCls, className, ...restProps }) => {
43
43
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
44
44
  const prefixCls = getPrefixCls("btn", customizePrefixCls);
45
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
46
- const buttonCls = (0, import_classnames.default)(className, hashId);
45
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
46
+ const buttonCls = (0, import_classnames.default)(className);
47
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;
package/lib/card/index.js CHANGED
@@ -57,13 +57,12 @@ var Card = ({
57
57
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
58
58
  const prefixCls = getPrefixCls("card", customizePrefixCls);
59
59
  const tabsPrefixCls = getPrefixCls("tabs", customizePrefixCls);
60
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls, tabsPrefixCls);
60
+ const { wrapSSR } = (0, import_style.default)(prefixCls, tabsPrefixCls);
61
61
  const cardCls = (0, import_classnames.default)(
62
62
  {
63
63
  [`${prefixCls}-no-divider`]: !divided
64
64
  },
65
- className,
66
- hashId
65
+ className
67
66
  );
68
67
  const ref = (0, import_react.useRef)();
69
68
  const newTabList = tabList == null ? void 0 : tabList.map((item) => {
@@ -44,13 +44,11 @@ var genCardStyle = (token) => {
44
44
  }
45
45
  },
46
46
  [`${componentCls}${componentCls}-contain-tabs`]: {
47
- [`${componentCls}-head`]: {
48
- ...(0, import_style.genTagStyle)({
49
- ...token,
50
- componentCls: tabsComponentCls,
51
- prefixCls: tabsPrefixCls
52
- })
53
- }
47
+ [`${componentCls}-head`]: (0, import_style.genTagStyle)({
48
+ ...token,
49
+ componentCls: tabsComponentCls,
50
+ prefixCls: tabsPrefixCls
51
+ })
54
52
  }
55
53
  };
56
54
  };
@@ -1,21 +1,30 @@
1
1
  import React from 'react';
2
- import type { ConfigProviderProps as AntConfigProviderProps, ThemeConfig as AntThemeConfig } from 'antd/es/config-provider';
2
+ import type { ConfigProviderProps as AntConfigProviderProps, ConfigConsumerProps as AntConfigConsumerProps, ThemeConfig as AntThemeConfig } from 'antd/es/config-provider';
3
+ import type { ComponentStyleConfig } from 'antd/es/config-provider/context';
4
+ import type { SpinIndicator } from 'antd/es/spin';
3
5
  import type { NavigateFunction } from './navigate';
4
6
  export * from './navigate';
5
7
  export * from 'antd/es/config-provider';
6
8
  export interface ThemeConfig extends AntThemeConfig {
7
9
  isDark?: boolean;
8
10
  }
11
+ export type SpinConfig = ComponentStyleConfig & {
12
+ indicator?: SpinIndicator;
13
+ };
14
+ export interface ConfigConsumerProps extends AntConfigConsumerProps {
15
+ spin?: SpinConfig;
16
+ }
9
17
  export interface ConfigProviderProps extends AntConfigProviderProps {
10
18
  theme?: ThemeConfig;
11
19
  navigate?: NavigateFunction;
20
+ spin?: SpinConfig;
12
21
  }
13
22
  export interface ExtendedConfigConsumerProps {
14
23
  navigate?: NavigateFunction;
15
24
  }
16
25
  declare const ConfigProvider: {
17
- ({ children, theme, navigate, ...restProps }: ConfigProviderProps): React.JSX.Element;
18
- ConfigContext: React.Context<import("antd/es/config-provider").ConfigConsumerProps>;
26
+ ({ children, theme, navigate, spin, ...restProps }: ConfigProviderProps): React.JSX.Element;
27
+ ConfigContext: React.Context<ConfigConsumerProps>;
19
28
  ExtendedConfigContext: React.Context<ExtendedConfigConsumerProps>;
20
29
  SizeContext: React.Context<import("antd/es/button").ButtonSize>;
21
30
  config: ({ prefixCls, iconPrefixCls, theme, }: Pick<AntConfigProviderProps, "prefixCls" | "iconPrefixCls"> & {
@@ -44,11 +44,12 @@ var ExtendedConfigContext = import_react.default.createContext({
44
44
  navigate: void 0
45
45
  });
46
46
  var { defaultSeed, components } = import_theme.default;
47
- var ConfigProvider = ({ children, theme, navigate, ...restProps }) => {
47
+ var ConfigProvider = ({ children, theme, navigate, spin, ...restProps }) => {
48
48
  var _a;
49
49
  return /* @__PURE__ */ import_react.default.createElement(
50
50
  import_antd.ConfigProvider,
51
51
  {
52
+ spin,
52
53
  theme: {
53
54
  ...theme,
54
55
  // Only set seed token for dark theme
@@ -35,7 +35,6 @@ __export(descriptions_exports, {
35
35
  module.exports = __toCommonJS(descriptions_exports);
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
- var import_lodash = require("lodash");
39
38
  var import_toArray = __toESM(require("rc-util/lib/Children/toArray"));
40
39
  var import_react = __toESM(require("react"));
41
40
  var import_config_provider = __toESM(require("../config-provider"));
@@ -52,8 +51,8 @@ var Descriptions = ({
52
51
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
53
52
  const prefixCls = getPrefixCls("descriptions", customizePrefixCls);
54
53
  const typographyPrefixCls = getPrefixCls("typography", customizePrefixCls);
55
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls, typographyPrefixCls);
56
- const descriptionsCls = (0, import_classnames.default)(className, hashId);
54
+ const { wrapSSR } = (0, import_style.default)(prefixCls, typographyPrefixCls);
55
+ const descriptionsCls = (0, import_classnames.default)(className);
57
56
  const newChildren = bordered ? children : (0, import_toArray.default)(children).map((node) => {
58
57
  if (import_react.default.isValidElement(node)) {
59
58
  const { props } = node;
@@ -74,14 +73,14 @@ var Descriptions = ({
74
73
  import_antd.Typography.Text,
75
74
  {
76
75
  ...restContentProps,
77
- ellipsis: (0, import_lodash.isObject)(ellipsis) ? {
76
+ ellipsis: typeof ellipsis === "object" ? {
78
77
  ...ellipsis,
79
78
  tooltip: (
80
79
  // 如果目标元素已经被 Tooltip 包裹,则去掉默认的 Tooltip,避免有两个 Tooltip
81
80
  (itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TOOLTIP) ? void 0 : {
82
81
  ...defaultEllipsis.tooltip,
83
82
  // TooltipProps
84
- ...(0, import_lodash.isObject)(ellipsis.tooltip) && !(0, import_react.isValidElement)(ellipsis.tooltip) ? ellipsis.tooltip : {
83
+ ...typeof ellipsis.tooltip === "object" && !(0, import_react.isValidElement)(ellipsis.tooltip) ? ellipsis.tooltip : {
85
84
  title: ellipsis.tooltip
86
85
  }
87
86
  }
@@ -8,7 +8,7 @@ export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
8
8
  export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
9
9
  declare const FormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
10
10
  useStatus: () => {
11
- status?: "" | "success" | "error" | "warning" | "validating";
11
+ status?: "" | "success" | "warning" | "error" | "validating";
12
12
  errors: ReactNode[];
13
13
  warnings: ReactNode[];
14
14
  };
package/lib/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export { default as Tabs } from './tabs';
14
14
  export { default as theme } from './theme';
15
15
  export { default as Tooltip } from './tooltip';
16
16
  export { default as Breadcrumb } from './breadcrumb';
17
+ export { default as Spin } from './spin';
17
18
  declare const useToken: () => {
18
19
  theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/interface/seeds").SeedToken, import("antd/es/theme/interface").MapToken>;
19
20
  token: import("antd").GlobalToken;
package/lib/index.js CHANGED
@@ -38,6 +38,7 @@ __export(src_exports, {
38
38
  Descriptions: () => import_descriptions.default,
39
39
  Form: () => import_form.default,
40
40
  Modal: () => import_modal.default,
41
+ Spin: () => import_spin.default,
41
42
  Table: () => import_table.default,
42
43
  Tabs: () => import_tabs.default,
43
44
  Tooltip: () => import_tooltip.default,
@@ -66,6 +67,7 @@ var import_tabs = __toESM(require("./tabs"));
66
67
  var import_theme = __toESM(require("./theme"));
67
68
  var import_tooltip = __toESM(require("./tooltip"));
68
69
  var import_breadcrumb = __toESM(require("./breadcrumb"));
70
+ var import_spin = __toESM(require("./spin"));
69
71
  var { useToken } = import_antd.theme;
70
72
  // Annotate the CommonJS export names for ESM import in node:
71
73
  0 && (module.exports = {
@@ -77,6 +79,7 @@ var { useToken } = import_antd.theme;
77
79
  Descriptions,
78
80
  Form,
79
81
  Modal,
82
+ Spin,
80
83
  Table,
81
84
  Tabs,
82
85
  Tooltip,
@@ -0,0 +1,16 @@
1
+ import type { AnimationConfig, AnimationItem } from 'lottie-web';
2
+ import React from 'react';
3
+ export interface LottieProps extends Omit<AnimationConfig, 'container'> {
4
+ path?: string;
5
+ animationData?: any;
6
+ mode?: 'default' | 'icon';
7
+ loop?: boolean;
8
+ speed?: number;
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ }
12
+ export interface LottieRef {
13
+ animation: AnimationItem;
14
+ }
15
+ declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<LottieRef>>;
16
+ export default Lottie;