@oceanbase/design 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (194) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/genComponentStyleHook.d.ts +2 -2
  3. package/es/_util/genComponentStyleHook.js +15 -2
  4. package/es/alert/index.d.ts +2 -2
  5. package/es/alert/index.js +13 -4
  6. package/es/alert/style/index.d.ts +1 -1
  7. package/es/alert/style/index.js +152 -58
  8. package/es/app/index.d.ts +8 -0
  9. package/es/app/index.js +36 -1
  10. package/es/app/style/index.d.ts +9 -0
  11. package/es/{_util/genStyle.js → app/style/index.js} +10 -11
  12. package/es/badge/index.js +2 -3
  13. package/es/badge/style/index.d.ts +1 -1
  14. package/es/badge/style/index.js +1 -3
  15. package/es/button/style/index.d.ts +1 -1
  16. package/es/card/index.d.ts +4 -0
  17. package/es/card/index.js +64 -7
  18. package/es/card/style/index.d.ts +1 -1
  19. package/es/card/style/index.js +32 -8
  20. package/es/checkbox/style/index.d.ts +1 -1
  21. package/es/config-provider/context.d.ts +11 -0
  22. package/es/config-provider/context.js +2 -1
  23. package/es/config-provider/index.d.ts +2 -2
  24. package/es/config-provider/index.js +57 -34
  25. package/es/descriptions/style/index.d.ts +1 -1
  26. package/es/drawer/index.js +7 -5
  27. package/es/drawer/style/index.d.ts +1 -1
  28. package/es/drawer/style/index.js +31 -9
  29. package/es/empty/index.js +1 -1
  30. package/es/empty/style/index.d.ts +1 -1
  31. package/es/form/FormItem.d.ts +2 -1
  32. package/es/form/FormItem.js +14 -4
  33. package/es/form/style/index.d.ts +1 -1
  34. package/es/form/style/index.js +13 -2
  35. package/es/index.d.ts +4 -2
  36. package/es/index.js +1 -0
  37. package/es/input-number/index.d.ts +2 -1
  38. package/es/locale/ja-JP.d.ts +3 -0
  39. package/es/locale/ja-JP.js +28 -0
  40. package/es/modal/Modal.js +20 -6
  41. package/es/modal/style/index.d.ts +1 -1
  42. package/es/modal/style/index.js +62 -19
  43. package/es/radio/style/index.d.ts +1 -1
  44. package/es/result/index.d.ts +2 -2
  45. package/es/result/index.js +5 -4
  46. package/es/result/style/index.d.ts +1 -1
  47. package/es/select/style/index.d.ts +1 -1
  48. package/es/slider/style/index.d.ts +1 -1
  49. package/es/space/style/index.d.ts +1 -1
  50. package/es/spin/style/index.d.ts +1 -1
  51. package/es/static-function/index.js +13 -4
  52. package/es/switch/style/index.d.ts +1 -1
  53. package/es/table/style/index.d.ts +1 -1
  54. package/es/table/style/index.js +3 -4
  55. package/es/tabs/style/index.d.ts +1 -1
  56. package/es/tabs/style/index.js +4 -2
  57. package/es/tag/index.d.ts +1 -0
  58. package/es/tag/index.js +3 -2
  59. package/es/tag/style/index.d.ts +2 -4
  60. package/es/tag/style/index.js +20 -31
  61. package/es/theme/dark.d.ts +1 -48
  62. package/es/theme/default.d.ts +4 -2
  63. package/es/theme/default.js +59 -28
  64. package/es/theme/index.d.ts +20 -57
  65. package/es/theme/interface.d.ts +66 -0
  66. package/es/theme/interface.js +4 -1
  67. package/es/theme/style/aliyun.less +40 -40
  68. package/es/theme/style/compact.less +79 -72
  69. package/es/theme/style/dark.less +53 -53
  70. package/es/theme/style/default.less +79 -72
  71. package/es/tooltip/style/index.d.ts +1 -1
  72. package/es/tree-select/style/index.d.ts +1 -1
  73. package/lib/_util/genComponentStyleHook.d.ts +2 -2
  74. package/lib/_util/genComponentStyleHook.js +20 -4
  75. package/lib/alert/index.d.ts +2 -2
  76. package/lib/alert/index.js +18 -9
  77. package/lib/alert/style/index.d.ts +1 -1
  78. package/lib/alert/style/index.js +170 -71
  79. package/lib/app/index.d.ts +8 -0
  80. package/lib/app/index.js +36 -1
  81. package/lib/app/style/index.d.ts +9 -0
  82. package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +20 -10
  83. package/lib/badge/index.js +23 -20
  84. package/lib/badge/style/index.d.ts +1 -1
  85. package/lib/badge/style/index.js +1 -3
  86. package/lib/button/index.js +2 -1
  87. package/lib/button/style/index.d.ts +1 -1
  88. package/lib/card/index.d.ts +4 -0
  89. package/lib/card/index.js +70 -9
  90. package/lib/card/style/index.d.ts +1 -1
  91. package/lib/card/style/index.js +56 -10
  92. package/lib/checkbox/index.js +2 -1
  93. package/lib/checkbox/style/index.d.ts +1 -1
  94. package/lib/config-provider/DefaultRenderEmpty.js +4 -3
  95. package/lib/config-provider/context.d.ts +11 -0
  96. package/lib/config-provider/index.d.ts +2 -2
  97. package/lib/config-provider/index.js +70 -26
  98. package/lib/descriptions/hooks/useItems.js +5 -4
  99. package/lib/descriptions/index.js +3 -2
  100. package/lib/descriptions/style/index.d.ts +1 -1
  101. package/lib/drawer/index.js +44 -33
  102. package/lib/drawer/style/index.d.ts +1 -1
  103. package/lib/drawer/style/index.js +33 -6
  104. package/lib/dropdown/dropdown-button.js +3 -13
  105. package/lib/dropdown/index.js +2 -2
  106. package/lib/empty/colored.js +413 -327
  107. package/lib/empty/database.js +267 -222
  108. package/lib/empty/default.js +16 -21
  109. package/lib/empty/guide.js +201 -184
  110. package/lib/empty/index.js +23 -18
  111. package/lib/empty/style/index.d.ts +1 -1
  112. package/lib/form/FormItem.d.ts +2 -1
  113. package/lib/form/FormItem.js +18 -6
  114. package/lib/form/index.js +6 -3
  115. package/lib/form/style/index.d.ts +1 -1
  116. package/lib/form/style/index.js +19 -0
  117. package/lib/grid/col.js +2 -1
  118. package/lib/grid/row.js +2 -1
  119. package/lib/index.d.ts +4 -2
  120. package/lib/index.js +3 -0
  121. package/lib/input/Input.js +3 -2
  122. package/lib/input/Password.js +3 -2
  123. package/lib/input/Search.js +3 -2
  124. package/lib/input/TextArea.js +3 -2
  125. package/lib/input-number/index.d.ts +2 -1
  126. package/lib/input-number/index.js +2 -1
  127. package/lib/list/index.js +3 -2
  128. package/lib/locale/ja-JP.d.ts +3 -0
  129. package/lib/locale/ja-JP.js +60 -0
  130. package/lib/lottie/index.js +2 -1
  131. package/lib/modal/Modal.js +33 -9
  132. package/lib/modal/Progress.js +9 -5
  133. package/lib/modal/style/index.d.ts +1 -1
  134. package/lib/modal/style/index.js +76 -17
  135. package/lib/radio/index.js +2 -1
  136. package/lib/radio/style/index.d.ts +1 -1
  137. package/lib/result/403.js +156 -121
  138. package/lib/result/404.js +328 -267
  139. package/lib/result/500.js +295 -257
  140. package/lib/result/Error.js +127 -99
  141. package/lib/result/Processing.js +246 -213
  142. package/lib/result/Success.js +233 -169
  143. package/lib/result/Warning.js +611 -515
  144. package/lib/result/index.d.ts +2 -2
  145. package/lib/result/index.js +12 -11
  146. package/lib/result/style/index.d.ts +1 -1
  147. package/lib/segmented/index.js +8 -4
  148. package/lib/select/index.js +2 -1
  149. package/lib/select/style/index.d.ts +1 -1
  150. package/lib/slider/index.js +2 -1
  151. package/lib/slider/style/index.d.ts +1 -1
  152. package/lib/space/index.js +2 -1
  153. package/lib/space/style/index.d.ts +1 -1
  154. package/lib/spin/index.js +5 -4
  155. package/lib/spin/style/index.d.ts +1 -1
  156. package/lib/static-function/index.js +7 -1
  157. package/lib/switch/index.js +2 -1
  158. package/lib/switch/style/index.d.ts +1 -1
  159. package/lib/table/index.js +44 -31
  160. package/lib/table/style/index.d.ts +1 -1
  161. package/lib/table/style/index.js +3 -4
  162. package/lib/tabs/index.js +10 -5
  163. package/lib/tabs/style/index.d.ts +1 -1
  164. package/lib/tabs/style/index.js +5 -0
  165. package/lib/tag/index.d.ts +1 -0
  166. package/lib/tag/index.js +12 -6
  167. package/lib/tag/style/index.d.ts +2 -4
  168. package/lib/tag/style/index.js +20 -27
  169. package/lib/theme/dark.d.ts +1 -48
  170. package/lib/theme/default.d.ts +4 -2
  171. package/lib/theme/default.js +67 -27
  172. package/lib/theme/index.d.ts +20 -57
  173. package/lib/theme/interface.d.ts +66 -0
  174. package/lib/theme/style/aliyun.less +40 -40
  175. package/lib/theme/style/compact.less +79 -72
  176. package/lib/theme/style/dark.less +53 -53
  177. package/lib/theme/style/default.less +79 -72
  178. package/lib/tooltip/MouseTooltip.js +43 -39
  179. package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
  180. package/lib/tooltip/index.js +14 -10
  181. package/lib/tooltip/style/index.d.ts +1 -1
  182. package/lib/tree-select/index.js +2 -1
  183. package/lib/tree-select/style/index.d.ts +1 -1
  184. package/lib/typography/Link.js +5 -4
  185. package/lib/typography/Paragraph.js +5 -4
  186. package/lib/typography/Text.js +5 -4
  187. package/lib/typography/Title.js +5 -4
  188. package/package.json +7 -6
  189. package/es/_util/genStyle.d.ts +0 -2
  190. package/es/_util/getWeakenBorderColor.d.ts +0 -1
  191. package/es/_util/getWeakenBorderColor.js +0 -4
  192. package/lib/_util/genStyle.d.ts +0 -2
  193. package/lib/_util/genStyle.js +0 -43
  194. package/lib/_util/getWeakenBorderColor.d.ts +0 -1
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { CSSObject } from '@ant-design/cssinjs';
3
3
  import type { ComponentTokenMap } from 'antd/es/theme/interface';
4
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
5
- import type { GlobalToken } from 'antd/es/theme/interface';
4
+ import type { GlobalToken, FullToken, GenerateStyle } from '../theme/interface';
5
+ export declare const genSelectCommonStyle: (token: FullToken<'Select' | 'TreeSelect' | 'Cascader'>) => CSSObject;
6
6
  export type ComponentName = keyof ComponentTokenMap;
7
7
  export declare function genComponentStyleHook(componentName: ComponentName, styleFn: GenerateStyle<FullToken<ComponentName>>, getDefaultToken?: Partial<FullToken<ComponentName>> | ((token: GlobalToken) => Partial<FullToken<ComponentName>>)): (prefixCls: string) => {
8
8
  wrapSSR: (node: React.ReactNode) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -29,17 +29,32 @@ 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
32
+ genComponentStyleHook: () => genComponentStyleHook,
33
+ genSelectCommonStyle: () => genSelectCommonStyle
33
34
  });
34
35
  module.exports = __toCommonJS(genComponentStyleHook_exports);
35
- var import_internal = require("antd/es/theme/internal");
36
+ var import_internal = require("../theme/internal");
36
37
  var import_theme = __toESM(require("../theme"));
38
+ var genSelectCommonStyle = (token) => {
39
+ const { antCls } = token;
40
+ const selectComponentCls = `${antCls}-select`;
41
+ return {
42
+ [`${selectComponentCls}${selectComponentCls}-multiple`]: {
43
+ [`${selectComponentCls}-selection-item`]: {
44
+ borderRadius: token.borderRadius
45
+ }
46
+ }
47
+ };
48
+ };
37
49
  function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
38
50
  return (prefixCls) => {
39
51
  const useStyle = (0, import_internal.genComponentStyleHook)(
40
52
  `OB-${componentName}`,
41
53
  (token) => {
42
- return [styleFn(token)];
54
+ return [
55
+ genSelectCommonStyle(token),
56
+ styleFn(token)
57
+ ];
43
58
  },
44
59
  getDefaultToken,
45
60
  {
@@ -60,5 +75,6 @@ function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
60
75
  }
61
76
  // Annotate the CommonJS export names for ESM import in node:
62
77
  0 && (module.exports = {
63
- genComponentStyleHook
78
+ genComponentStyleHook,
79
+ genSelectCommonStyle
64
80
  });
@@ -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
  };
@@ -33,42 +33,51 @@ __export(alert_exports, {
33
33
  default: () => alert_default
34
34
  });
35
35
  module.exports = __toCommonJS(alert_exports);
36
- var import_react = __toESM(require("react"));
36
+ var import_react = require("react");
37
37
  var import_antd = require("antd");
38
38
  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
42
  __reExport(alert_exports, require("antd/es/alert"), module.exports);
43
+ var import_jsx_runtime = require("react/jsx-runtime");
43
44
  var iconMapOutlined = {
44
- success: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckCircleOutlined, null),
45
- info: /* @__PURE__ */ import_react.default.createElement(import_icons.InfoCircleOutlined, null),
46
- error: /* @__PURE__ */ import_react.default.createElement(import_icons.CloseCircleOutlined, null),
47
- warning: /* @__PURE__ */ import_react.default.createElement(import_icons.ExclamationCircleOutlined, null)
45
+ success: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleOutlined, {}),
46
+ info: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.InfoCircleOutlined, {}),
47
+ error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleOutlined, {}),
48
+ warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {})
48
49
  };
49
50
  var Alert = ({
50
- type,
51
+ type: typeProp,
52
+ showIcon = true,
53
+ closable,
51
54
  ghost,
52
- colored,
55
+ mini,
56
+ banner,
53
57
  prefixCls: customizePrefixCls,
54
58
  className,
55
59
  ...restProps
56
60
  }) => {
61
+ const type = banner && !typeProp ? "warning" : typeProp;
57
62
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
58
63
  const prefixCls = getPrefixCls("alert", customizePrefixCls);
59
64
  const { wrapSSR } = (0, import_style.default)(prefixCls);
60
65
  const alertCls = (0, import_classnames.default)(
61
66
  {
67
+ [`${prefixCls}-closable`]: closable,
62
68
  [`${prefixCls}-ghost`]: ghost,
63
- [`${prefixCls}-colored`]: colored
69
+ [`${prefixCls}-mini`]: mini
64
70
  },
65
71
  className
66
72
  );
67
73
  return wrapSSR(
68
- /* @__PURE__ */ import_react.default.createElement(
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
75
  import_antd.Alert,
70
76
  {
71
77
  type,
78
+ showIcon,
79
+ closable,
80
+ banner,
72
81
  icon: iconMapOutlined[type],
73
82
  prefixCls: customizePrefixCls,
74
83
  className: alertCls,
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
3
  export type AlertToken = FullToken<'Alert'>;
4
4
  export declare const genAlertStyle: GenerateStyle<AlertToken>;
5
5
  declare const _default: (prefixCls: string) => {
@@ -24,118 +24,217 @@ __export(style_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
- var genTypeStyle = (color, token) => {
28
- const borderWidth = 8;
29
- return {
30
- content: '""',
31
- width: borderWidth,
32
- // Y 轴旋转 60deg 是为了让圆角有一定的视觉拉伸,以与原先的边框贴合更加紧密
33
- transform: "rotateY(60deg)",
34
- backgroundColor: color,
35
- position: "absolute",
36
- height: `calc(100% - ${token.lineWidth}px)`,
37
- left: -token.lineWidth - borderWidth / 2 / 2,
38
- top: token.lineWidth / 2,
39
- borderTopLeftRadius: token.borderRadiusLG,
40
- borderBottomLeftRadius: token.borderRadiusLG
27
+ var import_lodash = require("lodash");
28
+ var genAlertTypeStyle = (type, token) => {
29
+ const { componentCls } = token;
30
+ const textColor = token[`color${(0, import_lodash.upperFirst)(type)}Text`];
31
+ const hoverColor = token[`color${(0, import_lodash.upperFirst)(type)}TextHover`];
32
+ const activeColor = token[`color${(0, import_lodash.upperFirst)(type)}TextActive`];
33
+ const linkStyle = {
34
+ color: textColor,
35
+ textDecoration: "underline",
36
+ "&:hover": {
37
+ color: hoverColor
38
+ },
39
+ "&:active": {
40
+ color: activeColor
41
+ }
41
42
  };
42
- };
43
- var genColoredStyle = (color, colorHover, token) => {
44
- const { componentCls, iconCls } = token;
45
43
  return {
46
44
  [`${componentCls}-message`]: {
47
- color
45
+ color: textColor,
46
+ a: linkStyle
48
47
  },
49
48
  [`${componentCls}-description`]: {
50
- color
49
+ a: linkStyle
51
50
  },
52
- [`${componentCls}-close-icon`]: {
53
- [`${iconCls}`]: {
54
- color,
55
- "&:hover": {
56
- color: colorHover
57
- }
58
- },
59
- [`${componentCls}-close-text`]: {
60
- color,
61
- "&:hover": {
62
- color: colorHover
63
- }
64
- }
51
+ [`${componentCls}-icon`]: {
52
+ color: textColor
65
53
  }
66
54
  };
67
55
  };
68
56
  var genAlertStyle = (token) => {
69
- const {
70
- componentCls,
71
- colorSuccess,
72
- colorSuccessHover,
73
- colorInfo,
74
- colorInfoHover,
75
- colorWarning,
76
- colorWarningHover,
77
- colorError,
78
- colorErrorHover,
79
- colorIcon,
80
- colorIconHover,
81
- motionDurationMid
82
- } = token;
57
+ const { componentCls, colorIcon, colorIconHover, motionDurationMid } = token;
83
58
  const height = token.fontSize * token.lineHeight;
59
+ const iconWidth = token.fontSizeLG;
60
+ const contentStartOffset = iconWidth + token.marginXS;
61
+ const closeIconWidth = height;
84
62
  return {
85
63
  [`${componentCls}`]: {
86
64
  // vertical align to flex-start
87
65
  alignItems: "flex-start !important",
88
- paddingRight: token.padding,
66
+ paddingInline: token.padding,
67
+ position: "relative",
89
68
  [`${componentCls}-icon`]: {
90
- height
69
+ height,
70
+ fontSize: token.fontSizeLG,
71
+ marginInlineEnd: token.marginXS,
72
+ flexShrink: 0
91
73
  },
92
74
  [`${componentCls}-close-icon`]: {
75
+ position: "absolute",
76
+ top: token.paddingXS,
77
+ insetInlineEnd: token.padding,
93
78
  height,
94
79
  color: colorIcon,
95
80
  transition: `color ${motionDurationMid}`,
81
+ flexShrink: 0,
82
+ display: "flex",
83
+ alignItems: "center",
96
84
  "&:hover": {
97
85
  color: colorIconHover
98
86
  }
99
- }
87
+ },
88
+ // Default link styles (will be overridden by type-specific styles)
89
+ [`${componentCls}-message`]: {
90
+ a: {
91
+ textDecoration: "underline"
92
+ }
93
+ },
94
+ [`${componentCls}-description`]: {
95
+ a: {
96
+ textDecoration: "underline"
97
+ }
98
+ },
99
+ [`&${componentCls}-success`]: genAlertTypeStyle("success", token),
100
+ [`&${componentCls}-info`]: genAlertTypeStyle("info", token),
101
+ [`&${componentCls}-warning`]: genAlertTypeStyle("warning", token),
102
+ [`&${componentCls}-error`]: genAlertTypeStyle("error", token)
100
103
  },
101
104
  [`${componentCls}:not(${componentCls}-with-description)`]: {
102
- paddingLeft: token.padding
105
+ flexWrap: "wrap",
106
+ [`${componentCls}-content`]: {
107
+ flex: `1 1 calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
108
+ minWidth: 0,
109
+ maxWidth: `calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
110
+ wordBreak: "break-word"
111
+ },
112
+ [`${componentCls}-action`]: {
113
+ width: `calc(100% - ${contentStartOffset + token.padding}px)`,
114
+ marginInlineStart: contentStartOffset,
115
+ marginTop: token.marginXS
116
+ }
103
117
  },
104
118
  [`${componentCls}${componentCls}-with-description`]: {
105
- paddingBlock: token.padding,
119
+ paddingBlock: token.paddingSM,
120
+ flexWrap: "wrap",
106
121
  [`${componentCls}-message`]: {
107
- fontWeight: 500,
108
- marginBottom: token.marginXXS
122
+ fontSize: token.fontSize,
123
+ fontWeight: token.fontWeightStrong,
124
+ marginBottom: token.marginXXS,
125
+ wordBreak: "break-word"
109
126
  },
110
127
  [`${componentCls}-description`]: {
111
- color: token.colorTextSecondary
128
+ wordBreak: "break-word"
112
129
  },
113
- [`${componentCls}-icon`]: {
114
- fontSize: token.fontSizeHeading4,
115
- height: token.fontSizeHeading3,
116
- marginInlineEnd: token.margin
130
+ [`${componentCls}-content`]: {
131
+ flex: `1 1 calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
132
+ minWidth: 0,
133
+ maxWidth: `calc(100% - ${contentStartOffset + closeIconWidth + token.padding}px)`,
134
+ wordBreak: "break-word"
117
135
  },
118
136
  [`${componentCls}-action`]: {
119
- marginInlineStart: token.marginXS
137
+ width: `calc(100% - ${contentStartOffset + token.padding}px)`,
138
+ marginInlineStart: contentStartOffset,
139
+ marginTop: token.marginSM
140
+ },
141
+ [`${componentCls}-close-icon`]: {
142
+ top: token.paddingSM
120
143
  }
121
144
  },
122
- [`${componentCls}:not(${componentCls}-banner):not(${componentCls}-ghost)`]: {
123
- [`&${componentCls}-success::before`]: genTypeStyle(colorSuccess, token),
124
- [`&${componentCls}-info::before`]: genTypeStyle(colorInfo, token),
125
- [`&${componentCls}-warning::before`]: genTypeStyle(colorWarning, token),
126
- [`&${componentCls}-error::before`]: genTypeStyle(colorError, token)
127
- },
128
145
  [`${componentCls}${componentCls}-ghost`]: {
129
146
  backgroundColor: "transparent",
130
147
  border: "none",
131
- padding: 0,
148
+ padding: "0px !important",
132
149
  borderRadius: 0
133
150
  },
134
- [`${componentCls}-colored`]: {
135
- [`&${componentCls}-success`]: genColoredStyle(colorSuccess, colorSuccessHover, token),
136
- [`&${componentCls}-info`]: genColoredStyle(colorInfo, colorInfoHover, token),
137
- [`&${componentCls}-warning`]: genColoredStyle(colorWarning, colorWarningHover, token),
138
- [`&${componentCls}-error`]: genColoredStyle(colorError, colorErrorHover, token)
151
+ [`${componentCls}${componentCls}-mini`]: {
152
+ paddingBlock: token.paddingXXS,
153
+ paddingInline: token.paddingXS,
154
+ border: "none",
155
+ width: "fit-content",
156
+ display: "inline-flex",
157
+ alignItems: "center",
158
+ flexWrap: "nowrap",
159
+ [`${componentCls}-icon`]: {
160
+ marginInlineEnd: token.paddingXS,
161
+ flexShrink: 0,
162
+ display: "flex",
163
+ alignItems: "center",
164
+ justifyContent: "center",
165
+ lineHeight: 1
166
+ },
167
+ [`${componentCls}-message`]: {
168
+ whiteSpace: "nowrap",
169
+ wordBreak: "normal",
170
+ overflow: "visible",
171
+ lineHeight: token.lineHeight,
172
+ display: "flex",
173
+ alignItems: "center"
174
+ },
175
+ [`${componentCls}-content`]: {
176
+ display: "flex",
177
+ alignItems: "center",
178
+ flex: "0 1 auto",
179
+ whiteSpace: "nowrap",
180
+ minWidth: 0,
181
+ lineHeight: token.lineHeight
182
+ },
183
+ [`${componentCls}-close-icon`]: {
184
+ position: "relative",
185
+ top: token.paddingXXS,
186
+ insetInlineEnd: "auto",
187
+ height: "auto",
188
+ flexShrink: 0,
189
+ marginInlineStart: 0
190
+ },
191
+ [`&${componentCls}-closable`]: {
192
+ [`${componentCls}-content`]: {
193
+ paddingInlineEnd: token.paddingXS
194
+ }
195
+ },
196
+ [`&:not(${componentCls}-with-description)`]: {
197
+ flexWrap: "nowrap",
198
+ [`${componentCls}-content`]: {
199
+ flex: "0 1 auto",
200
+ minWidth: 0,
201
+ maxWidth: "none",
202
+ wordBreak: "normal"
203
+ }
204
+ },
205
+ [`&${componentCls}-with-description`]: {
206
+ paddingBlock: token.paddingXXS,
207
+ flexDirection: "row",
208
+ alignItems: "flex-start",
209
+ position: "relative",
210
+ flexWrap: "nowrap",
211
+ [`${componentCls}-icon`]: {
212
+ alignSelf: "flex-start",
213
+ marginTop: 0
214
+ },
215
+ [`${componentCls}-content`]: {
216
+ flexDirection: "column",
217
+ alignItems: "flex-start",
218
+ flex: "0 1 auto",
219
+ minWidth: 0,
220
+ maxWidth: "none",
221
+ wordBreak: "normal"
222
+ },
223
+ [`${componentCls}-message`]: {
224
+ marginBottom: token.marginXXS,
225
+ whiteSpace: "nowrap",
226
+ wordBreak: "normal"
227
+ },
228
+ [`${componentCls}-description`]: {
229
+ whiteSpace: "nowrap",
230
+ wordBreak: "normal"
231
+ },
232
+ [`${componentCls}-close-icon`]: {
233
+ position: "absolute",
234
+ top: token.paddingXXS,
235
+ insetInlineEnd: token.paddingXS
236
+ }
237
+ }
139
238
  }
140
239
  };
141
240
  };
@@ -1 +1,9 @@
1
+ import React from 'react';
2
+ import { App as AntApp } from 'antd';
3
+ import type { AppProps } from 'antd/es/app';
1
4
  export * from 'antd/es/app';
5
+ export type AppType = React.FC<AppProps> & {
6
+ useApp: typeof AntApp.useApp;
7
+ };
8
+ declare const App: AppType;
9
+ export default App;
package/lib/app/index.js CHANGED
@@ -1,7 +1,13 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
5
11
  var __copyProps = (to, from, except, desc) => {
6
12
  if (from && typeof from === "object" || typeof from === "function") {
7
13
  for (let key of __getOwnPropNames(from))
@@ -11,12 +17,41 @@ var __copyProps = (to, from, except, desc) => {
11
17
  return to;
12
18
  };
13
19
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
14
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
29
 
16
- // src/app/index.ts
30
+ // src/app/index.tsx
17
31
  var app_exports = {};
32
+ __export(app_exports, {
33
+ default: () => app_default
34
+ });
18
35
  module.exports = __toCommonJS(app_exports);
36
+ var import_react = require("react");
37
+ var import_antd = require("antd");
38
+ var import_classnames = __toESM(require("classnames"));
39
+ var import_config_provider = __toESM(require("../config-provider"));
40
+ var import_style = __toESM(require("./style"));
19
41
  __reExport(app_exports, require("antd/es/app"), module.exports);
42
+ var import_jsx_runtime = require("react/jsx-runtime");
43
+ var App = ({ prefixCls: customizePrefixCls, className, ...restProps }) => {
44
+ const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
+ const prefixCls = getPrefixCls("app", customizePrefixCls);
46
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
47
+ const appCls = (0, import_classnames.default)(className);
48
+ return wrapSSR(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.App, { prefixCls: customizePrefixCls, className: appCls, ...restProps }));
49
+ };
50
+ App.useApp = import_antd.App.useApp;
51
+ if (process.env.NODE_ENV !== "production") {
52
+ App.displayName = import_antd.App.displayName;
53
+ }
54
+ var app_default = App;
20
55
  // Annotate the CommonJS export names for ESM import in node:
21
56
  0 && (module.exports = {
22
57
  ...require("antd/es/app")
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
+ export type AppToken = FullToken<'App'>;
4
+ export declare const genAppStyle: GenerateStyle<AppToken>;
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;
@@ -16,17 +16,27 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // src/_util/getWeakenBorderColor.ts
20
- var getWeakenBorderColor_exports = {};
21
- __export(getWeakenBorderColor_exports, {
22
- getWeakenBorderColor: () => getWeakenBorderColor
19
+ // src/app/style/index.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ default: () => style_default,
23
+ genAppStyle: () => genAppStyle
23
24
  });
24
- module.exports = __toCommonJS(getWeakenBorderColor_exports);
25
- var import_tinycolor = require("@ctrl/tinycolor");
26
- function getWeakenBorderColor(color) {
27
- return new import_tinycolor.TinyColor(color).setAlpha(0.4).toHex8String();
28
- }
25
+ module.exports = __toCommonJS(style_exports);
26
+ var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
+ var genAppStyle = (token) => {
28
+ const { componentCls } = token;
29
+ return {
30
+ [`${componentCls}`]: {}
31
+ };
32
+ };
33
+ var style_default = (prefixCls) => {
34
+ const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("App", (token) => {
35
+ return [genAppStyle(token)];
36
+ });
37
+ return useStyle(prefixCls);
38
+ };
29
39
  // Annotate the CommonJS export names for ESM import in node:
30
40
  0 && (module.exports = {
31
- getWeakenBorderColor
41
+ genAppStyle
32
42
  });
@@ -40,28 +40,29 @@ 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
42
  __reExport(badge_exports, require("antd/es/badge"), module.exports);
43
+ var import_jsx_runtime = require("react/jsx-runtime");
43
44
  var Badge = import_react.default.forwardRef(
44
45
  ({ prefixCls: customizePrefixCls, className, status, text, icon, ...restProps }, ref) => {
45
- const { getPrefixCls, iconPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
46
+ const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
46
47
  const prefixCls = getPrefixCls("badge", customizePrefixCls);
47
48
  const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
48
49
  const iconMap = {
49
- default: /* @__PURE__ */ import_react.default.createElement(import_icons.MinusCircleFilled, { rotate: 45 }),
50
- processing: /* @__PURE__ */ import_react.default.createElement(
50
+ default: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MinusCircleFilled, { rotate: 45 }),
51
+ processing: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
52
  import_icons.Loading3QuartersOutlined,
52
53
  {
53
54
  style: {
54
55
  display: "inline-block"
55
56
  },
56
- className: `${iconPrefixCls}-spin`
57
+ spin: true
57
58
  }
58
59
  ),
59
- success: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckCircleFilled, null),
60
- error: /* @__PURE__ */ import_react.default.createElement(import_icons.CloseCircleFilled, null),
61
- warning: /* @__PURE__ */ import_react.default.createElement(import_icons.EllipsisCircleFilled, null)
60
+ success: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleFilled, {}),
61
+ error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleFilled, {}),
62
+ warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EllipsisCircleFilled, {})
62
63
  };
63
64
  return wrapSSR(
64
- /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, status && icon ? /* @__PURE__ */ import_react.default.createElement(
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: status && icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
65
66
  "span",
66
67
  {
67
68
  ref,
@@ -69,17 +70,19 @@ var Badge = import_react.default.forwardRef(
69
70
  style: {
70
71
  display: "inline-block"
71
72
  },
72
- ...restProps
73
- },
74
- /* @__PURE__ */ import_react.default.createElement(
75
- "span",
76
- {
77
- className: (0, import_classnames.default)(`${prefixCls}-status-icon`, `${prefixCls}-status-${status}`)
78
- },
79
- import_react.default.isValidElement(icon) ? icon : iconMap[status]
80
- ),
81
- text && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-status-text` }, text)
82
- ) : /* @__PURE__ */ import_react.default.createElement(
73
+ ...restProps,
74
+ children: [
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ "span",
77
+ {
78
+ className: (0, import_classnames.default)(`${prefixCls}-status-icon`, `${prefixCls}-status-${status}`),
79
+ children: import_react.default.isValidElement(icon) ? icon : iconMap[status]
80
+ }
81
+ ),
82
+ text && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-status-text`, children: text })
83
+ ]
84
+ }
85
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
86
  import_antd.Badge,
84
87
  {
85
88
  ref,
@@ -89,7 +92,7 @@ var Badge = import_react.default.forwardRef(
89
92
  text,
90
93
  ...restProps
91
94
  }
92
- ))
95
+ ) })
93
96
  );
94
97
  }
95
98
  );
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
3
  export type BadgeToken = FullToken<'Badge'>;
4
4
  export declare const genBadgeStyle: GenerateStyle<BadgeToken>;
5
5
  declare const _default: (prefixCls: string) => {
@@ -35,9 +35,7 @@ var genBadgeStyle = (token) => {
35
35
  [`${componentCls}${componentCls}-status`]: {
36
36
  // dot style
37
37
  [`${componentCls}-status-dot`]: {
38
- [`&${componentCls}-status-default`]: {
39
- backgroundColor: token.colorFill
40
- }
38
+ [`&${componentCls}-status-default`]: {}
41
39
  },
42
40
  // icon style
43
41
  [`${componentCls}-status-icon`]: {
@@ -39,6 +39,7 @@ var import_react = __toESM(require("react"));
39
39
  var import_config_provider = __toESM(require("../config-provider"));
40
40
  var import_style = __toESM(require("./style"));
41
41
  __reExport(button_exports, require("antd/es/button"), module.exports);
42
+ var import_jsx_runtime = require("react/jsx-runtime");
42
43
  var Button = import_react.default.forwardRef(
43
44
  ({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
44
45
  const { theme, getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
@@ -46,7 +47,7 @@ var Button = import_react.default.forwardRef(
46
47
  const { wrapSSR } = (0, import_style.default)(prefixCls, theme == null ? void 0 : theme.isAliyun);
47
48
  const buttonCls = (0, import_classnames.default)(className);
48
49
  return wrapSSR(
49
- /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ref, prefixCls: customizePrefixCls, className: buttonCls, ...restProps })
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Button, { ref, prefixCls: customizePrefixCls, className: buttonCls, ...restProps })
50
51
  );
51
52
  }
52
53
  );