@oceanbase/design 1.0.0-alpha.3 → 1.0.0-alpha.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.
Files changed (74) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/alert/index.d.ts +2 -2
  3. package/es/alert/index.js +16 -4
  4. package/es/alert/style/index.js +155 -60
  5. package/es/badge/index.js +2 -3
  6. package/es/badge/style/index.js +1 -3
  7. package/es/card/index.d.ts +4 -0
  8. package/es/card/index.js +64 -7
  9. package/es/card/style/index.js +36 -10
  10. package/es/checkbox/style/index.js +4 -2
  11. package/es/config-provider/index.d.ts +2 -2
  12. package/es/config-provider/index.js +26 -2
  13. package/es/descriptions/hooks/useItems.d.ts +6 -6
  14. package/es/descriptions/style/index.js +3 -2
  15. package/es/drawer/style/index.js +28 -8
  16. package/es/empty/style/index.js +6 -4
  17. package/es/form/FormItem.d.ts +1 -0
  18. package/es/form/FormItem.js +14 -4
  19. package/es/form/style/index.js +15 -3
  20. package/es/input-number/index.d.ts +2 -1
  21. package/es/locale/ja-JP.d.ts +3 -0
  22. package/es/locale/ja-JP.js +28 -0
  23. package/es/modal/Modal.js +20 -6
  24. package/es/modal/style/index.js +64 -20
  25. package/es/radio/style/index.js +4 -2
  26. package/es/slider/style/index.js +7 -5
  27. package/es/spin/style/index.js +14 -11
  28. package/es/static-function/index.js +13 -4
  29. package/es/table/style/index.js +19 -19
  30. package/es/tabs/style/index.js +4 -2
  31. package/es/tag/index.d.ts +1 -0
  32. package/es/tag/index.js +3 -2
  33. package/es/tag/style/index.js +8 -2
  34. package/es/theme/default.js +9 -3
  35. package/es/theme/style/compact.less +7 -7
  36. package/es/theme/style/default.less +7 -7
  37. package/es/typography/style/index.js +25 -20
  38. package/lib/alert/index.d.ts +2 -2
  39. package/lib/alert/index.js +13 -3
  40. package/lib/alert/style/index.js +171 -72
  41. package/lib/badge/index.js +2 -2
  42. package/lib/badge/style/index.js +1 -3
  43. package/lib/card/index.d.ts +4 -0
  44. package/lib/card/index.js +61 -4
  45. package/lib/card/style/index.js +58 -11
  46. package/lib/checkbox/style/index.js +3 -2
  47. package/lib/config-provider/index.d.ts +2 -2
  48. package/lib/config-provider/index.js +35 -2
  49. package/lib/descriptions/hooks/useItems.d.ts +6 -6
  50. package/lib/descriptions/style/index.js +2 -2
  51. package/lib/drawer/style/index.js +28 -6
  52. package/lib/empty/style/index.js +5 -4
  53. package/lib/form/FormItem.d.ts +1 -0
  54. package/lib/form/FormItem.js +10 -2
  55. package/lib/form/style/index.js +20 -1
  56. package/lib/input-number/index.d.ts +2 -1
  57. package/lib/locale/ja-JP.d.ts +3 -0
  58. package/lib/locale/ja-JP.js +60 -0
  59. package/lib/modal/Modal.js +26 -6
  60. package/lib/modal/style/index.js +78 -18
  61. package/lib/radio/style/index.js +3 -2
  62. package/lib/slider/style/index.js +6 -5
  63. package/lib/spin/style/index.js +12 -11
  64. package/lib/static-function/index.js +7 -1
  65. package/lib/table/style/index.js +19 -19
  66. package/lib/tabs/style/index.js +5 -0
  67. package/lib/tag/index.d.ts +1 -0
  68. package/lib/tag/index.js +3 -1
  69. package/lib/tag/style/index.js +8 -0
  70. package/lib/theme/default.js +9 -3
  71. package/lib/theme/style/compact.less +7 -7
  72. package/lib/theme/style/default.less +7 -7
  73. package/lib/typography/style/index.js +24 -20
  74. package/package.json +5 -6
@@ -5,17 +5,20 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
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; }
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
7
  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); }
8
+ import { useContext } from 'react';
8
9
  import { App, message as antMessage, Modal as AntModal, notification as antNotification } from 'antd';
9
10
  import formatToken from 'antd/lib/theme/util/alias';
11
+ import ConfigProvider from "../config-provider";
12
+ import useModalStyle from "../modal/style";
10
13
  import theme from "../theme";
11
14
  import defaultTheme from "../theme/default";
12
15
  var defaultAlgorithm = theme.defaultAlgorithm,
13
16
  defaultSeed = theme.defaultSeed,
14
17
  useToken = theme.useToken;
15
18
 
16
- // 设置默认 token
19
+ // set default token
17
20
  var mapToken = _objectSpread(_objectSpread(_objectSpread({}, defaultAlgorithm(defaultSeed)), defaultTheme.token), {}, {
18
- // 需要覆盖部分 Alias Token 的值
21
+ // need to override some Alias Token values
19
22
  override: {
20
23
  boxShadow: (_defaultTheme$token = defaultTheme.token) === null || _defaultTheme$token === void 0 ? void 0 : _defaultTheme$token.boxShadow,
21
24
  boxShadowSecondary: (_defaultTheme$token2 = defaultTheme.token) === null || _defaultTheme$token2 === void 0 ? void 0 : _defaultTheme$token2.boxShadowSecondary,
@@ -27,10 +30,16 @@ var message = antMessage;
27
30
  var notification = antNotification;
28
31
  var modal = AntModal;
29
32
  export default (function () {
30
- // 自动注入 useToken,避免每次使用都要声明一遍,比较繁琐
33
+ // automatically inject useToken, avoid declaring it every time
31
34
  token = useToken().token;
35
+ var _useContext = useContext(ConfigProvider.ConfigContext),
36
+ getPrefixCls = _useContext.getPrefixCls;
37
+ var prefixCls = getPrefixCls('modal');
38
+
39
+ // register Modal style, ensure static function can also apply style
40
+ useModalStyle(prefixCls);
32
41
  var staticFunction = App.useApp();
33
- // 替换 antd 的静态方法,支持消费 ConfigProvider 配置
42
+ // replace antd's static methods, support consuming ConfigProvider configuration
34
43
  message = _objectSpread(_objectSpread({}, staticFunction.message), {}, {
35
44
  useMessage: antMessage.useMessage
36
45
  });
@@ -2,6 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
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
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
+ import { unit } from '@ant-design/cssinjs';
5
6
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
7
  export var genTableStyle = function genTableStyle(token) {
7
8
  var _ref;
@@ -17,7 +18,8 @@ export var genTableStyle = function genTableStyle(token) {
17
18
  colorBorderSecondary = token.colorBorderSecondary,
18
19
  padding = token.padding,
19
20
  marginLG = token.marginLG,
20
- marginXS = token.marginXS;
21
+ marginXS = token.marginXS,
22
+ calc = token.calc;
21
23
  return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper ").concat(componentCls), _defineProperty(_defineProperty(_defineProperty({
22
24
  color: colorText,
23
25
  backgroundColor: colorBgBase,
@@ -26,9 +28,8 @@ export var genTableStyle = function genTableStyle(token) {
26
28
  borderBottom: "1px solid ".concat(colorBorderSecondary),
27
29
  borderRadius: 0
28
30
  }), "".concat(componentCls, "-thead > tr"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 'th', {
29
- // 弱化列标题
30
31
  color: colorTextSecondary,
31
- fontWeight: 'normal',
32
+ fontWeight: token.fontWeight,
32
33
  backgroundColor: colorBgBase
33
34
  }), "th".concat(componentCls, "-column-has-sorters"), {
34
35
  backgroundColor: colorBgBase
@@ -47,7 +48,7 @@ export var genTableStyle = function genTableStyle(token) {
47
48
  })), "tr > td", {
48
49
  transition: "background ".concat(token.motionDurationMid)
49
50
  }), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
50
- minHeight: 360 - token.paddingSM * 2,
51
+ minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
51
52
  display: 'flex',
52
53
  justifyContent: 'center',
53
54
  alignItems: 'center'
@@ -62,18 +63,17 @@ export var genTableStyle = function genTableStyle(token) {
62
63
  }), "".concat(componentCls, "-empty-wrapper"), {
63
64
  minHeight: 'auto'
64
65
  })))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-middle"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
65
- minHeight: 260 - token.paddingXS * 2
66
+ minHeight: calc(260).sub(calc(token.paddingXS).mul(2).equal()).equal()
66
67
  }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-empty-wrapper"), {
67
- minHeight: 160 - token.paddingXXS * 2
68
+ minHeight: calc(160).sub(calc(token.paddingXXS).mul(2).equal()).equal()
68
69
  }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-footer"), {
69
- borderRadius: "0px 0px ".concat(token.borderRadiusLG, "px ").concat(token.borderRadiusLG, "px")
70
+ borderRadius: "0px 0px ".concat(unit(token.borderRadiusLG), " ").concat(unit(token.borderRadiusLG))
70
71
  })), "".concat(componentCls, "-wrapper").concat(componentCls, "-inner-bordered ").concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-container"), _defineProperty({
71
72
  borderInlineStart: 'none',
72
73
  borderTop: 'none'
73
74
  }, "".concat(componentCls, "-thead > tr > th, ").concat(componentCls, "-tbody > tr > td"), _defineProperty({}, '&:last-child', {
74
75
  borderInlineEnd: 'none'
75
76
  })))), "".concat(componentCls, "-wrapper ").concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-thead, ").concat(componentCls, "-tbody"), _defineProperty({}, 'td, th', _defineProperty(_defineProperty({}, "&".concat(componentCls, "-row-expand-icon-cell"), {
76
- backgroundColor: colorBgBase,
77
77
  // 设置 paddingRight 即可
78
78
  paddingRight: token.paddingXS
79
79
  }), "&".concat(componentCls, "-selection-column, &").concat(componentCls, "-row-expand-icon-cell"), _defineProperty({}, "& + td, & + th", {
@@ -82,26 +82,26 @@ export var genTableStyle = function genTableStyle(token) {
82
82
  borderBottomLeftRadius: 0,
83
83
  borderBottomRightRadius: 0
84
84
  }), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
85
- marginLeft: token.marginXL + token.lineWidth * 2
85
+ marginLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
86
86
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
87
- paddingLeft: token.marginXL + token.lineWidth * 2 + token.padding
87
+ paddingLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
88
88
  })), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
89
- marginLeft: token.margin + token.lineWidth * 2
89
+ marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).equal()
90
90
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
91
- marginLeft: token.margin + token.lineWidth * 2 + token.margin
91
+ marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
92
92
  })))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable").concat(componentCls, "-selectable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
93
- marginLeft: token.marginXL + token.marginXL + token.lineWidth * 2
93
+ marginLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
94
94
  }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
95
- paddingLeft: token.marginXL + token.marginXL + token.lineWidth * 2 + token.padding
95
+ paddingLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
96
96
  })), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
97
- marginLeft: token.margin + token.marginXL + token.lineWidth * 2
97
+ marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
98
98
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
99
- marginLeft: token.margin + token.marginXL + token.lineWidth * 2 + token.margin
99
+ marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
100
100
  })))), "".concat(componentCls, "-wrapper ").concat(antCls, "-spin-blur"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-placeholder"), {
101
101
  // hide empty when Table loading
102
102
  visibility: 'hidden'
103
103
  }))), _defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), {
104
- padding: "".concat(padding, "px 0"),
104
+ padding: "".concat(unit(padding), " 0"),
105
105
  margin: '0 !important'
106
106
  }), "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
107
107
  position: 'absolute',
@@ -110,9 +110,9 @@ export var genTableStyle = function genTableStyle(token) {
110
110
  marginRight: marginLG
111
111
  }, "".concat(componentCls, "-batch-operation-selection"), _defineProperty({
112
112
  color: colorTextSecondary,
113
- fontWeight: 500
113
+ fontWeight: token.fontWeightStrong
114
114
  }, "".concat(componentCls, "-batch-operation-selection-count"), {
115
- margin: "0 ".concat(marginXS, "px"),
115
+ margin: "0 ".concat(unit(marginXS)),
116
116
  color: colorLink
117
117
  }))))), "".concat(antCls, "-popover").concat(componentCls, "-batch-operation-selection-popover"), _defineProperty({}, "".concat(antCls, "-popover-inner"), {
118
118
  padding: 0
@@ -10,9 +10,11 @@ export var genTabsStyle = function genTabsStyle(token) {
10
10
  colorInfoBg = token.colorInfoBg,
11
11
  colorTextSecondary = token.colorTextSecondary,
12
12
  colorFillQuaternary = token.colorFillQuaternary;
13
- return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-no-divider"), _defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
13
+ return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-no-divider"), _defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
14
14
  border: 'none'
15
- }))), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
15
+ }))), "&".concat(componentCls, "-left, &").concat(componentCls, "-right"), _defineProperty({}, "".concat(componentCls, "-tab[data-node-key^=divider-]"), {
16
+ paddingBlock: 0
17
+ })), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
16
18
  color: colorTextSecondary,
17
19
  fontSize: 12,
18
20
  borderRadius: 12,
package/es/tag/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { Ellipsis } from '../_util/getEllipsisConfig';
4
4
  export * from 'antd/es/tag';
5
5
  export interface TagProps extends AntTagProps {
6
6
  ellipsis?: Ellipsis;
7
+ pill?: boolean;
7
8
  }
8
9
  declare const _default: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>> & {
9
10
  CheckableTag: React.ForwardRefExoticComponent<import("antd/es/tag").CheckableTagProps & React.RefAttributes<HTMLSpanElement>>;
package/es/tag/index.js CHANGED
@@ -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 = ["children", "prefixCls", "icon", "className", "ellipsis"];
2
+ var _excluded = ["children", "prefixCls", "icon", "className", "ellipsis", "pill"];
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; }
@@ -28,6 +28,7 @@ var Tag = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
28
28
  title: children
29
29
  }
30
30
  } : _ref$ellipsis,
31
+ pill = _ref.pill,
31
32
  restProps = _objectWithoutProperties(_ref, _excluded);
32
33
  var _useContext = useContext(ConfigProvider.ConfigContext),
33
34
  getPrefixCls = _useContext.getPrefixCls;
@@ -35,7 +36,7 @@ var Tag = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
35
36
  var _useStyle = useStyle(prefixCls),
36
37
  wrapSSR = _useStyle.wrapSSR;
37
38
  var ellipsisConfig = getEllipsisConfig(ellipsis, children);
38
- var tagCls = classNames(_defineProperty({}, "".concat(prefixCls, "-ellipsis"), !!ellipsisConfig), className);
39
+ var tagCls = classNames(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-ellipsis"), !!ellipsisConfig), "".concat(prefixCls, "-pill"), pill), className);
39
40
  var realIcon = icon ? /*#__PURE__*/_jsx("span", {
40
41
  className: "".concat(prefixCls, "-icon"),
41
42
  children: icon
@@ -19,10 +19,12 @@ export var genTagStyle = function genTagStyle(token) {
19
19
  var antCls = token.antCls,
20
20
  componentCls = token.componentCls,
21
21
  iconCls = token.iconCls;
22
- return _defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
22
+ return _defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
23
23
  paddingInline: token.paddingXS,
24
24
  fontSize: token.fontSizeSM
25
- }, "".concat(componentCls, "-close-icon").concat(iconCls), {
25
+ }, "&:not(".concat(componentCls, "-pill)"), {
26
+ fontWeight: token.fontWeightStrong
27
+ }), "".concat(componentCls, "-close-icon").concat(iconCls), {
26
28
  marginInlineStart: token.marginXXS
27
29
  }), "".concat(antCls, "-typography"), _defineProperty({}, "".concat(componentCls, "-icon"), {
28
30
  marginInlineEnd: token.marginXXS
@@ -37,6 +39,10 @@ export var genTagStyle = function genTagStyle(token) {
37
39
  display: 'none'
38
40
  }), '&-borderless', {
39
41
  borderColor: 'transparent'
42
+ }), '&-pill', {
43
+ borderRadius: 100,
44
+ lineHeight: token.lineHeight,
45
+ marginInlineEnd: token.marginXXS
40
46
  }));
41
47
  };
42
48
  export default (function (prefixCls) {
@@ -14,8 +14,8 @@ var colorTextTertiary = '#8592AD';
14
14
  var colorTextQuaternary = '#B6C0D4';
15
15
  var colorFill = '#CDD5E4';
16
16
  var colorFillSecondary = '#E2E8F3';
17
- var colorFillTertiary = '#EFF3FA';
18
- var colorFillQuaternary = '#F7F9FC';
17
+ var colorFillTertiary = '#EBEFF7';
18
+ var colorFillQuaternary = '#F5F7FC';
19
19
  var colorBorderSecondary = colorFillSecondary;
20
20
  var fontSizeSM = 12;
21
21
  var tagColorBorder = colorTextQuaternary;
@@ -77,7 +77,7 @@ var defaultTheme = {
77
77
  colorIcon: colorTextSecondary,
78
78
  colorBgBase: '#ffffff',
79
79
  colorBgContainer: '#ffffff',
80
- colorBgLayout: colorFillQuaternary,
80
+ colorBgLayout: '#FBFCFE',
81
81
  colorBorder: colorFill,
82
82
  colorBorderSecondary: colorBorderSecondary,
83
83
  colorFill: colorFill,
@@ -96,6 +96,12 @@ var defaultTheme = {
96
96
  lineWidthFocus: 0
97
97
  },
98
98
  components: {
99
+ Alert: {
100
+ borderRadiusLG: 6
101
+ },
102
+ Badge: {
103
+ statusSize: 8
104
+ },
99
105
  Breadcrumb: {
100
106
  fontSize: fontSizeSM,
101
107
  fontHeight: 20,
@@ -310,12 +310,12 @@
310
310
  @colorTextQuaternary: #b6c0d4;
311
311
  @colorFill: #cdd5e4;
312
312
  @colorFillSecondary: #e2e8f3;
313
- @colorFillTertiary: #eff3fa;
314
- @colorFillQuaternary: #f7f9fc;
313
+ @colorFillTertiary: #ebeff7;
314
+ @colorFillQuaternary: #f5f7fc;
315
315
  @colorBgSolid: rgb(0,0,0);
316
316
  @colorBgSolidHover: rgba(0,0,0,0.75);
317
317
  @colorBgSolidActive: rgba(0,0,0,0.95);
318
- @colorBgLayout: #f7f9fc;
318
+ @colorBgLayout: #fbfcfe;
319
319
  @colorBgContainer: #ffffff;
320
320
  @colorBgElevated: #ffffff;
321
321
  @colorBgSpotlight: #ffffff;
@@ -421,14 +421,14 @@
421
421
  @colorFuchsiaBg: #faf0fc;
422
422
  @colorFuchsiaText: #580e67;
423
423
  @colorIcon: #8592ad;
424
- @colorBgContainerDisabled: #eff3fa;
424
+ @colorBgContainerDisabled: #ebeff7;
425
425
  @boxShadow: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
426
426
  @boxShadowSecondary: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
427
427
  @boxShadowTertiary: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
428
428
  @lineWidthFocus: 3px;
429
429
  @colorFillContent: #e2e8f3;
430
430
  @colorFillContentHover: #cdd5e4;
431
- @colorFillAlter: #f7f9fc;
431
+ @colorFillAlter: #f5f7fc;
432
432
  @colorBorderBg: #ffffff;
433
433
  @colorSplit: rgba(13,63,155,0.12);
434
434
  @colorTextPlaceholder: #b6c0d4;
@@ -446,11 +446,11 @@
446
446
  @fontSizeIcon: 12px;
447
447
  @controlOutlineWidth: 2px;
448
448
  @controlInteractiveSize: 14px;
449
- @controlItemBgHover: #eff3fa;
449
+ @controlItemBgHover: #ebeff7;
450
450
  @controlItemBgActive: #e6f4ff;
451
451
  @controlItemBgActiveHover: #b0dbff;
452
452
  @controlItemBgActiveDisabled: #cdd5e4;
453
- @controlTmpOutline: #f7f9fc;
453
+ @controlTmpOutline: #f5f7fc;
454
454
  @controlOutline: rgba(5,145,255,0.1);
455
455
  @opacityLoading: 0.65;
456
456
  @linkDecoration: none;
@@ -310,12 +310,12 @@
310
310
  @colorTextQuaternary: #b6c0d4;
311
311
  @colorFill: #cdd5e4;
312
312
  @colorFillSecondary: #e2e8f3;
313
- @colorFillTertiary: #eff3fa;
314
- @colorFillQuaternary: #f7f9fc;
313
+ @colorFillTertiary: #ebeff7;
314
+ @colorFillQuaternary: #f5f7fc;
315
315
  @colorBgSolid: rgb(0,0,0);
316
316
  @colorBgSolidHover: rgba(0,0,0,0.75);
317
317
  @colorBgSolidActive: rgba(0,0,0,0.95);
318
- @colorBgLayout: #f7f9fc;
318
+ @colorBgLayout: #fbfcfe;
319
319
  @colorBgContainer: #ffffff;
320
320
  @colorBgElevated: #ffffff;
321
321
  @colorBgSpotlight: #ffffff;
@@ -421,14 +421,14 @@
421
421
  @colorFuchsiaBg: #faf0fc;
422
422
  @colorFuchsiaText: #580e67;
423
423
  @colorIcon: #8592ad;
424
- @colorBgContainerDisabled: #eff3fa;
424
+ @colorBgContainerDisabled: #ebeff7;
425
425
  @boxShadow: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
426
426
  @boxShadowSecondary: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
427
427
  @boxShadowTertiary: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
428
428
  @lineWidthFocus: 3px;
429
429
  @colorFillContent: #e2e8f3;
430
430
  @colorFillContentHover: #cdd5e4;
431
- @colorFillAlter: #f7f9fc;
431
+ @colorFillAlter: #f5f7fc;
432
432
  @colorBorderBg: #ffffff;
433
433
  @colorSplit: rgba(13,63,155,0.12);
434
434
  @colorTextPlaceholder: #b6c0d4;
@@ -446,11 +446,11 @@
446
446
  @fontSizeIcon: 12px;
447
447
  @controlOutlineWidth: 2px;
448
448
  @controlInteractiveSize: 14px;
449
- @controlItemBgHover: #eff3fa;
449
+ @controlItemBgHover: #ebeff7;
450
450
  @controlItemBgActive: #e6f4ff;
451
451
  @controlItemBgActiveHover: #b0dbff;
452
452
  @controlItemBgActiveDisabled: #cdd5e4;
453
- @controlTmpOutline: #f7f9fc;
453
+ @controlTmpOutline: #f5f7fc;
454
454
  @controlOutline: rgba(5,145,255,0.1);
455
455
  @opacityLoading: 0.65;
456
456
  @linkDecoration: none;
@@ -2,13 +2,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
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
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
+ import { unit } from '@ant-design/cssinjs';
5
6
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
7
  export var genTypographyStyle = function genTypographyStyle(token) {
7
8
  var componentCls = token.componentCls,
8
9
  controlHeight = token.controlHeight,
9
10
  fontSize = token.fontSize,
10
- lineHeight = token.lineHeight;
11
- var marginOffset = (controlHeight - fontSize * lineHeight) / 2;
11
+ lineHeight = token.lineHeight,
12
+ calc = token.calc;
13
+ var marginOffset = calc(controlHeight).sub(calc(fontSize).mul(lineHeight).equal()).div(2).equal();
14
+ var paddingTop = calc(marginOffset).sub(token.lineWidth).equal();
15
+ var paddingInline = calc(token.paddingSM).sub(token.lineWidth).equal();
16
+ var negativeMarginOffset = calc(marginOffset).mul(-1).equal();
12
17
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({
13
18
  lineHeight: 'inherit',
14
19
  color: 'inherit',
@@ -18,39 +23,39 @@ export var genTypographyStyle = function genTypographyStyle(token) {
18
23
  })), "".concat(componentCls).concat(componentCls, "-editable-text:not(").concat(componentCls, "-edit-content)"), {
19
24
  '&:hover': {
20
25
  background: token.colorBgContainer,
21
- border: "".concat(token.lineWidth, "px ").concat(token.lineType, " ").concat(token.colorBorder),
26
+ border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorBorder),
22
27
  borderRadius: token.borderRadius,
23
28
  position: 'relative',
24
- insetInlineStart: -token.paddingSM,
25
- padding: "".concat(marginOffset - token.lineWidth, "px ").concat(token.paddingSM - token.lineWidth, "px")
29
+ insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
30
+ padding: "".concat(paddingTop, " ").concat(paddingInline)
26
31
  },
27
32
  'div&:hover': {
28
33
  height: token.controlHeight,
29
- marginTop: -marginOffset,
30
- marginBottom: "calc(1em - ".concat(marginOffset, "px)")
34
+ marginTop: negativeMarginOffset,
35
+ marginBottom: calc('1em').sub(marginOffset).equal()
31
36
  },
32
37
  'span&:hover': {
33
38
  display: 'inline-block',
34
39
  height: token.controlHeight,
35
- marginTop: -marginOffset,
36
- marginBottom: -marginOffset
40
+ marginTop: negativeMarginOffset,
41
+ marginBottom: negativeMarginOffset
37
42
  },
38
43
  'h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover': {
39
- marginTop: "".concat(-marginOffset, "px !important"),
40
- marginBottom: "".concat(-marginOffset, "px !important")
44
+ marginTop: "".concat(negativeMarginOffset, " !important"),
45
+ marginBottom: "".concat(negativeMarginOffset, " !important")
41
46
  }
42
47
  }), "".concat(componentCls).concat(componentCls, "-edit-content"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-div&"), {
43
- insetInlineStart: -token.paddingSM,
44
- marginTop: -marginOffset,
45
- marginBottom: "calc(1em - ".concat(marginOffset, "px)")
48
+ insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
49
+ marginTop: negativeMarginOffset,
50
+ marginBottom: calc('1em').sub(marginOffset).equal()
46
51
  }), "".concat(componentCls, "-span&"), {
47
- insetInlineStart: -token.paddingSM,
48
- marginTop: -marginOffset,
49
- marginBottom: -marginOffset
52
+ insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
53
+ marginTop: negativeMarginOffset,
54
+ marginBottom: negativeMarginOffset
50
55
  }), "".concat(componentCls, "-h1&, ").concat(componentCls, "-h2&, ").concat(componentCls, "-h3&, ").concat(componentCls, "-h4&, ").concat(componentCls, "-h5&"), {
51
- insetInlineStart: -token.paddingSM,
52
- marginTop: "".concat(-marginOffset, "px !important"),
53
- marginBottom: "".concat(-marginOffset, "px !important")
56
+ insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
57
+ marginTop: "".concat(negativeMarginOffset, " !important"),
58
+ marginBottom: "".concat(negativeMarginOffset, " !important")
54
59
  }));
55
60
  };
56
61
  export default (function (prefixCls) {
@@ -3,10 +3,10 @@ import type { AlertProps as AntAlertProps } from 'antd/es/alert';
3
3
  export * from 'antd/es/alert';
4
4
  export interface AlertProps extends AntAlertProps {
5
5
  ghost?: boolean;
6
- colored?: boolean;
6
+ mini?: boolean;
7
7
  }
8
8
  declare const Alert: {
9
- ({ type, ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
9
+ ({ type: typeProp, showIcon, closable, ghost, mini, banner, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
10
10
  ErrorBoundary: typeof import("antd/es/alert/ErrorBoundary").default;
11
11
  displayName: string;
12
12
  };
@@ -39,6 +39,7 @@ var import_icons = require("@oceanbase/icons");
39
39
  var import_classnames = __toESM(require("classnames"));
40
40
  var import_config_provider = __toESM(require("../config-provider"));
41
41
  var import_style = __toESM(require("./style"));
42
+ var import_theme = __toESM(require("../theme"));
42
43
  __reExport(alert_exports, require("antd/es/alert"), module.exports);
43
44
  var import_jsx_runtime = require("react/jsx-runtime");
44
45
  var iconMapOutlined = {
@@ -48,20 +49,26 @@ var iconMapOutlined = {
48
49
  warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {})
49
50
  };
50
51
  var Alert = ({
51
- type,
52
+ type: typeProp,
53
+ showIcon = true,
54
+ closable,
52
55
  ghost,
53
- colored,
56
+ mini,
57
+ banner,
54
58
  prefixCls: customizePrefixCls,
55
59
  className,
56
60
  ...restProps
57
61
  }) => {
62
+ const { token } = import_theme.default.useToken();
63
+ const type = banner && !typeProp ? "warning" : typeProp;
58
64
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
59
65
  const prefixCls = getPrefixCls("alert", customizePrefixCls);
60
66
  const { wrapSSR } = (0, import_style.default)(prefixCls);
61
67
  const alertCls = (0, import_classnames.default)(
62
68
  {
69
+ [`${prefixCls}-closable`]: closable,
63
70
  [`${prefixCls}-ghost`]: ghost,
64
- [`${prefixCls}-colored`]: colored
71
+ [`${prefixCls}-mini`]: mini
65
72
  },
66
73
  className
67
74
  );
@@ -70,6 +77,9 @@ var Alert = ({
70
77
  import_antd.Alert,
71
78
  {
72
79
  type,
80
+ showIcon,
81
+ closable,
82
+ banner,
73
83
  icon: iconMapOutlined[type],
74
84
  prefixCls: customizePrefixCls,
75
85
  className: alertCls,