@oceanbase/ui 1.0.0-alpha.4 → 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 (219) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/Item.d.ts +6 -15
  4. package/es/Action/Item.js +85 -128
  5. package/es/Action/index.d.ts +6 -3
  6. package/es/BasicLayout/style/index.js +30 -18
  7. package/es/BatchOperationBar/index.d.ts +0 -1
  8. package/es/BatchOperationBar/index.js +17 -13
  9. package/es/BatchOperationBar/style/index.d.ts +10 -0
  10. package/es/BatchOperationBar/style/index.js +51 -0
  11. package/es/Boundary/Components/Code.js +11 -5
  12. package/es/Boundary/Components/Exception.js +85 -74
  13. package/es/Boundary/Components/Function.js +11 -5
  14. package/es/Boundary/index.d.ts +0 -1
  15. package/es/Boundary/index.js +0 -1
  16. package/es/Boundary/style/index.d.ts +10 -0
  17. package/es/Boundary/style/index.js +46 -0
  18. package/es/ContentWithIcon/index.d.ts +0 -1
  19. package/es/ContentWithIcon/index.js +29 -29
  20. package/es/ContentWithIcon/style/index.d.ts +10 -0
  21. package/es/ContentWithIcon/style/index.js +26 -0
  22. package/es/DateRanger/PickerPanel.js +5 -4
  23. package/es/DateRanger/Ranger.d.ts +0 -1
  24. package/es/DateRanger/Ranger.js +13 -8
  25. package/es/DateRanger/style/index.d.ts +10 -0
  26. package/es/DateRanger/style/index.js +126 -0
  27. package/es/Dialog/Anchor.d.ts +2 -10
  28. package/es/Dialog/Anchor.js +67 -96
  29. package/es/Dialog/index.d.ts +0 -1
  30. package/es/Dialog/index.js +537 -578
  31. package/es/Dialog/style/index.d.ts +10 -0
  32. package/es/Dialog/style/index.js +97 -0
  33. package/es/FullscreenBox/index.d.ts +0 -1
  34. package/es/FullscreenBox/index.js +46 -37
  35. package/es/FullscreenBox/style/index.d.ts +10 -0
  36. package/es/FullscreenBox/style/index.js +53 -0
  37. package/es/GraphToolbar/index.d.ts +0 -1
  38. package/es/GraphToolbar/index.js +19 -16
  39. package/es/GraphToolbar/style/index.d.ts +10 -0
  40. package/es/GraphToolbar/style/index.js +60 -0
  41. package/es/Highlight/DiffView/index.d.ts +0 -1
  42. package/es/Highlight/DiffView/index.js +5 -5
  43. package/es/Highlight/JsonView.d.ts +0 -1
  44. package/es/Highlight/JsonView.js +5 -5
  45. package/es/Highlight/index.d.ts +0 -1
  46. package/es/Highlight/index.js +23 -23
  47. package/es/Highlight/style/index.d.ts +10 -0
  48. package/es/Highlight/style/index.js +213 -0
  49. package/es/Login/ActivateForm.d.ts +0 -1
  50. package/es/Login/ActivateForm.js +12 -9
  51. package/es/Login/LoginForm.d.ts +0 -1
  52. package/es/Login/LoginForm.js +20 -15
  53. package/es/Login/RegisterForm.d.ts +0 -1
  54. package/es/Login/RegisterForm.js +14 -11
  55. package/es/Login/index.d.ts +0 -1
  56. package/es/Login/index.js +24 -22
  57. package/es/Login/style/index.d.ts +10 -0
  58. package/es/Login/style/index.js +182 -0
  59. package/es/NavMenu/index.d.ts +1 -2
  60. package/es/NavMenu/index.js +11 -8
  61. package/es/NavMenu/style/index.d.ts +10 -0
  62. package/es/NavMenu/style/index.js +47 -0
  63. package/es/Ranger/QuickPicker.js +8 -4
  64. package/es/Ranger/Ranger.d.ts +0 -1
  65. package/es/Ranger/Ranger.js +12 -9
  66. package/es/Ranger/style/index.d.ts +10 -0
  67. package/es/Ranger/style/index.js +44 -0
  68. package/es/SideTip/index.d.ts +0 -1
  69. package/es/SideTip/index.js +24 -22
  70. package/es/SideTip/style/index.d.ts +10 -0
  71. package/es/SideTip/style/index.js +162 -0
  72. package/es/TagSelect/Group.d.ts +6 -6
  73. package/es/TagSelect/Group.js +5 -3
  74. package/es/TagSelect/Item.js +5 -3
  75. package/es/TaskGraph/Graph/style/index.d.ts +10 -0
  76. package/es/TaskGraph/Graph/style/index.js +28 -0
  77. package/es/TaskGraph/Graph.d.ts +0 -1
  78. package/es/TaskGraph/Graph.js +26 -10
  79. package/es/TaskGraph/index.d.ts +0 -1
  80. package/es/TaskGraph/index.js +10 -7
  81. package/es/TaskGraph/style/index.d.ts +10 -0
  82. package/es/TaskGraph/style/index.js +102 -0
  83. package/es/Welcome/index.d.ts +0 -1
  84. package/es/Welcome/index.js +30 -26
  85. package/es/Welcome/step/style/index.d.ts +10 -0
  86. package/es/Welcome/step/style/index.js +44 -0
  87. package/es/Welcome/step.d.ts +0 -1
  88. package/es/Welcome/step.js +17 -14
  89. package/es/Welcome/style/index.d.ts +10 -0
  90. package/es/Welcome/style/index.js +141 -0
  91. package/es/index.d.ts +0 -1
  92. package/es/index.js +0 -1
  93. package/lib/Action/Item.d.ts +6 -15
  94. package/lib/Action/Item.js +66 -81
  95. package/lib/Action/index.d.ts +6 -3
  96. package/lib/BasicLayout/style/index.js +27 -18
  97. package/lib/BatchOperationBar/index.d.ts +0 -1
  98. package/lib/BatchOperationBar/index.js +54 -50
  99. package/lib/BatchOperationBar/style/index.d.ts +10 -0
  100. package/lib/BatchOperationBar/style/index.js +82 -0
  101. package/lib/Boundary/Components/Code.js +23 -17
  102. package/lib/Boundary/Components/Exception.js +40 -29
  103. package/lib/Boundary/Components/Function.js +18 -12
  104. package/lib/Boundary/index.d.ts +0 -1
  105. package/lib/Boundary/index.js +0 -1
  106. package/lib/Boundary/style/index.d.ts +10 -0
  107. package/lib/Boundary/style/index.js +74 -0
  108. package/lib/ContentWithIcon/index.d.ts +0 -1
  109. package/lib/ContentWithIcon/index.js +35 -32
  110. package/lib/ContentWithIcon/style/index.d.ts +10 -0
  111. package/lib/ContentWithIcon/style/index.js +57 -0
  112. package/lib/DateRanger/PickerPanel.js +2 -2
  113. package/lib/DateRanger/Ranger.d.ts +0 -1
  114. package/lib/DateRanger/Ranger.js +353 -348
  115. package/lib/DateRanger/style/index.d.ts +10 -0
  116. package/lib/DateRanger/style/index.js +195 -0
  117. package/lib/Dialog/Anchor.d.ts +2 -10
  118. package/lib/Dialog/Anchor.js +58 -60
  119. package/lib/Dialog/index.d.ts +0 -1
  120. package/lib/Dialog/index.js +446 -422
  121. package/lib/Dialog/style/index.d.ts +10 -0
  122. package/lib/Dialog/style/index.js +135 -0
  123. package/lib/FullscreenBox/index.d.ts +0 -1
  124. package/lib/FullscreenBox/index.js +47 -38
  125. package/lib/FullscreenBox/style/index.d.ts +10 -0
  126. package/lib/FullscreenBox/style/index.js +86 -0
  127. package/lib/GraphToolbar/index.d.ts +0 -1
  128. package/lib/GraphToolbar/index.js +69 -66
  129. package/lib/GraphToolbar/style/index.d.ts +10 -0
  130. package/lib/GraphToolbar/style/index.js +91 -0
  131. package/lib/Highlight/DiffView/index.d.ts +0 -1
  132. package/lib/Highlight/DiffView/index.js +3 -3
  133. package/lib/Highlight/JsonView.d.ts +0 -1
  134. package/lib/Highlight/JsonView.js +3 -3
  135. package/lib/Highlight/index.d.ts +0 -1
  136. package/lib/Highlight/index.js +32 -29
  137. package/lib/Highlight/style/index.d.ts +10 -0
  138. package/lib/Highlight/style/index.js +293 -0
  139. package/lib/Login/ActivateForm.d.ts +0 -1
  140. package/lib/Login/ActivateForm.js +17 -9
  141. package/lib/Login/LoginForm.d.ts +0 -1
  142. package/lib/Login/LoginForm.js +25 -13
  143. package/lib/Login/RegisterForm.d.ts +0 -1
  144. package/lib/Login/RegisterForm.js +17 -9
  145. package/lib/Login/index.d.ts +0 -1
  146. package/lib/Login/index.js +96 -94
  147. package/lib/Login/style/index.d.ts +10 -0
  148. package/lib/Login/style/index.js +267 -0
  149. package/lib/NavMenu/index.d.ts +1 -2
  150. package/lib/NavMenu/index.js +20 -17
  151. package/lib/NavMenu/style/index.d.ts +10 -0
  152. package/lib/NavMenu/style/index.js +78 -0
  153. package/lib/Ranger/QuickPicker.js +4 -2
  154. package/lib/Ranger/Ranger.d.ts +0 -1
  155. package/lib/Ranger/Ranger.js +48 -45
  156. package/lib/Ranger/style/index.d.ts +10 -0
  157. package/lib/Ranger/style/index.js +82 -0
  158. package/lib/SideTip/index.d.ts +0 -1
  159. package/lib/SideTip/index.js +46 -38
  160. package/lib/SideTip/style/index.d.ts +10 -0
  161. package/lib/SideTip/style/index.js +211 -0
  162. package/lib/TagSelect/Group.d.ts +6 -6
  163. package/lib/TagSelect/Group.js +3 -2
  164. package/lib/TagSelect/Item.js +3 -2
  165. package/lib/TaskGraph/Graph/style/index.d.ts +10 -0
  166. package/lib/TaskGraph/Graph/style/index.js +56 -0
  167. package/lib/TaskGraph/Graph.d.ts +0 -1
  168. package/lib/TaskGraph/Graph.js +16 -7
  169. package/lib/TaskGraph/index.d.ts +0 -1
  170. package/lib/TaskGraph/index.js +6 -5
  171. package/lib/TaskGraph/style/index.d.ts +10 -0
  172. package/lib/TaskGraph/style/index.js +143 -0
  173. package/lib/Welcome/index.d.ts +0 -1
  174. package/lib/Welcome/index.js +64 -59
  175. package/lib/Welcome/step/style/index.d.ts +10 -0
  176. package/lib/Welcome/step/style/index.js +74 -0
  177. package/lib/Welcome/step.d.ts +0 -1
  178. package/lib/Welcome/step.js +17 -13
  179. package/lib/Welcome/style/index.d.ts +10 -0
  180. package/lib/Welcome/style/index.js +188 -0
  181. package/lib/index.d.ts +0 -1
  182. package/lib/index.js +0 -1
  183. package/package.json +4 -7
  184. package/es/BatchOperationBar/index.less +0 -46
  185. package/es/BatchOperationBar/index.less.d.ts +0 -15
  186. package/es/Boundary/index.less +0 -36
  187. package/es/ContentWithIcon/index.less +0 -21
  188. package/es/DateRanger/index.less +0 -180
  189. package/es/Dialog/index.less +0 -116
  190. package/es/FullscreenBox/index.less +0 -51
  191. package/es/GraphToolbar/index.less +0 -65
  192. package/es/Highlight/index.less +0 -381
  193. package/es/Login/index.less +0 -268
  194. package/es/NavMenu/index.less +0 -50
  195. package/es/Ranger/index.less +0 -57
  196. package/es/SideTip/index.less +0 -180
  197. package/es/TaskGraph/graph.less +0 -23
  198. package/es/TaskGraph/index.less +0 -117
  199. package/es/Welcome/index.less +0 -185
  200. package/es/index.less +0 -1
  201. package/es/variable.less +0 -54
  202. package/lib/BatchOperationBar/index.less +0 -46
  203. package/lib/BatchOperationBar/index.less.d.ts +0 -15
  204. package/lib/Boundary/index.less +0 -36
  205. package/lib/ContentWithIcon/index.less +0 -21
  206. package/lib/DateRanger/index.less +0 -180
  207. package/lib/Dialog/index.less +0 -116
  208. package/lib/FullscreenBox/index.less +0 -51
  209. package/lib/GraphToolbar/index.less +0 -65
  210. package/lib/Highlight/index.less +0 -381
  211. package/lib/Login/index.less +0 -268
  212. package/lib/NavMenu/index.less +0 -50
  213. package/lib/Ranger/index.less +0 -57
  214. package/lib/SideTip/index.less +0 -180
  215. package/lib/TaskGraph/graph.less +0 -23
  216. package/lib/TaskGraph/index.less +0 -117
  217. package/lib/Welcome/index.less +0 -185
  218. package/lib/index.less +0 -1
  219. package/lib/variable.less +0 -54
@@ -37,10 +37,7 @@ var import_design = require("@oceanbase/design");
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_react = require("react");
39
39
  var import_design2 = require("@oceanbase/design");
40
- var import_util = require("../_util");
41
- var import_index = require("./index.less");
42
40
  var import_jsx_runtime = require("react/jsx-runtime");
43
- var prefix = (0, import_util.getPrefix)("login");
44
41
  var Login = ({
45
42
  loading,
46
43
  locale,
@@ -54,6 +51,8 @@ var Login = ({
54
51
  passwordOptional = false,
55
52
  ...restProps
56
53
  }) => {
54
+ const { getPrefixCls } = (0, import_react.useContext)(import_design2.ConfigProvider.ConfigContext);
55
+ const prefixCls = getPrefixCls("login");
57
56
  const { token } = import_design2.theme.useToken();
58
57
  const [focusInput, setFocusInput] = (0, import_react.useState)("");
59
58
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -61,12 +60,20 @@ var Login = ({
61
60
  {
62
61
  layout: "vertical",
63
62
  hideRequiredMark: true,
64
- className: `${prefix}-form`,
63
+ className: `${prefixCls}-form`,
65
64
  style: { paddingLeft: showAuthCode ? 96 : 0 },
66
65
  ...restProps,
67
66
  "data-testid": "login.form",
68
67
  children: [
69
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Alert, { type: "error", showIcon: true, className: `${prefix}-alert`, message: errorMessage }),
68
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ import_design.Alert,
70
+ {
71
+ type: "error",
72
+ showIcon: true,
73
+ className: `${prefixCls}-alert`,
74
+ message: errorMessage
75
+ }
76
+ ),
70
77
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
78
  import_design.Form.Item,
72
79
  {
@@ -80,6 +87,7 @@ var Login = ({
80
87
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
81
88
  import_design.Input,
82
89
  {
90
+ size: "large",
83
91
  prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserOutlined, { style: { color: token.colorIcon } }),
84
92
  placeholder: locale.usernamePlaceholder,
85
93
  onFocus: () => {
@@ -89,7 +97,7 @@ var Login = ({
89
97
  setFocusInput("");
90
98
  },
91
99
  className: (0, import_classnames.default)({
92
- [`${prefix}-focus-input`]: focusInput === "username"
100
+ [`${prefixCls}-form-focus-input`]: focusInput === "username"
93
101
  }),
94
102
  ...(componentProps == null ? void 0 : componentProps.username) || {}
95
103
  }
@@ -109,6 +117,7 @@ var Login = ({
109
117
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
118
  import_design.Input.Password,
111
119
  {
120
+ size: "large",
112
121
  visibilityToggle: true,
113
122
  autoComplete: "current-password",
114
123
  prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LockOutlined, { style: { color: token.colorIcon } }),
@@ -119,13 +128,13 @@ var Login = ({
119
128
  onBlur: () => {
120
129
  setFocusInput("");
121
130
  },
122
- className: focusInput === "password" ? `${prefix}-focus-input` : "",
131
+ className: focusInput === "password" ? `${prefixCls}-form-focus-input` : "",
123
132
  ...(componentProps == null ? void 0 : componentProps.password) || {}
124
133
  }
125
134
  )
126
135
  }
127
136
  ),
128
- showAuthCode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefix}-auth-code`, children: [
137
+ showAuthCode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefixCls}-auth-code`, children: [
129
138
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
139
  import_design.Form.Item,
131
140
  {
@@ -139,6 +148,7 @@ var Login = ({
139
148
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
140
149
  import_design.Input,
141
150
  {
151
+ size: "large",
142
152
  prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SafetyCertificateOutlined, { style: { color: token.colorIcon } }),
143
153
  placeholder: "请输入验证码",
144
154
  onFocus: () => {
@@ -148,26 +158,27 @@ var Login = ({
148
158
  setFocusInput("");
149
159
  },
150
160
  className: (0, import_classnames.default)({
151
- [`${prefix}-focus-input`]: focusInput === "authCode"
161
+ [`${prefixCls}-form-focus-input`]: focusInput === "authCode"
152
162
  }),
153
163
  ...(componentProps == null ? void 0 : componentProps.authCode) || {}
154
164
  }
155
165
  )
156
166
  }
157
167
  ),
158
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(`${prefix}-code-btn`), children: [
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(`${prefixCls}-code-btn`), children: [
159
169
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: authCodeImg, alt: "", width: "96", height: "38" }),
160
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-code-mask`, onClick: onAuthCodeImgChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, {}) })
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-code-mask`, onClick: onAuthCodeImgChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, {}) })
161
171
  ] })
162
172
  ] }),
163
173
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
174
  import_design.Button,
165
175
  {
166
176
  htmlType: "submit",
177
+ size: "large",
167
178
  loading,
168
179
  type: "primary",
169
180
  block: true,
170
- className: `${prefix}-submit-btn`,
181
+ className: `${prefixCls}-submit-btn`,
171
182
  children: locale.loginText
172
183
  }
173
184
  ) }),
@@ -175,11 +186,12 @@ var Login = ({
175
186
  import_design.Button,
176
187
  {
177
188
  htmlType: "button",
189
+ size: "large",
178
190
  loading: otherLoginProps.loading,
179
191
  type: "primary",
180
192
  block: true,
181
193
  onClick: otherLoginProps.onFinish,
182
- className: `${prefix}-submit-btn`,
194
+ className: `${prefixCls}-submit-btn`,
183
195
  children: locale.otherLoginText
184
196
  }
185
197
  ) })
@@ -1,7 +1,6 @@
1
1
  import type { FormProps } from '@oceanbase/design/es/form';
2
2
  import React from 'react';
3
3
  import type { LoginLocale } from './index';
4
- import './index.less';
5
4
  /**
6
5
  * 冗余的转义符可以增强正则的可读性
7
6
  */
@@ -26,11 +26,8 @@ module.exports = __toCommonJS(RegisterForm_exports);
26
26
  var import_design = require("@oceanbase/design");
27
27
  var import_lodash = require("lodash");
28
28
  var import_react = require("react");
29
- var import_util = require("../_util");
30
- var import_index = require("./index.less");
31
29
  var import_jsx_runtime = require("react/jsx-runtime");
32
30
  var PASSWORD_REGEX = /^(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,})(?=(.*\d){2,})(?=(.*[ !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]){2,})[A-Za-z\d !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]{8,32}$/;
33
- var prefix = (0, import_util.getPrefix)("login");
34
31
  var Register = ({
35
32
  isUserExists,
36
33
  locale,
@@ -39,6 +36,8 @@ var Register = ({
39
36
  errorMessage,
40
37
  ...restProps
41
38
  }) => {
39
+ const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
40
+ const prefixCls = getPrefixCls("login");
42
41
  const [form] = import_design.Form.useForm();
43
42
  const handleValidateAccount = (0, import_react.useCallback)(
44
43
  async (rule, value) => {
@@ -76,12 +75,20 @@ var Register = ({
76
75
  {
77
76
  layout: "vertical",
78
77
  requiredMark: false,
79
- className: `${prefix}-form`,
78
+ className: `${prefixCls}-form`,
80
79
  form,
81
80
  ...restProps,
82
81
  "data-testid": "login.register",
83
82
  children: [
84
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Alert, { type: "error", showIcon: true, className: `${prefix}-alert`, message: errorMessage }),
83
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ import_design.Alert,
85
+ {
86
+ type: "error",
87
+ showIcon: true,
88
+ className: `${prefixCls}-alert`,
89
+ message: errorMessage
90
+ }
91
+ ),
85
92
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
93
  import_design.Form.Item,
87
94
  {
@@ -108,7 +115,7 @@ var Register = ({
108
115
  validator: handleValidateAccount
109
116
  }
110
117
  ],
111
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input, { autoComplete: "new-account", autoFocus: true })
118
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input, { size: "large", autoComplete: "new-account", autoFocus: true })
112
119
  }
113
120
  ),
114
121
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -126,7 +133,7 @@ var Register = ({
126
133
  },
127
134
  passwordRegexpRule
128
135
  ],
129
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { visibilityToggle: true, autoComplete: "new-password" })
136
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { size: "large", visibilityToggle: true, autoComplete: "new-password" })
130
137
  }
131
138
  ),
132
139
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -145,17 +152,18 @@ var Register = ({
145
152
  validator: handleValidateConfirmPassword
146
153
  }
147
154
  ],
148
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { visibilityToggle: true, autoComplete: "new-password" })
155
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { size: "large", visibilityToggle: true, autoComplete: "new-password" })
149
156
  }
150
157
  ),
151
158
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
152
159
  import_design.Button,
153
160
  {
154
161
  htmlType: "submit",
162
+ size: "large",
155
163
  loading,
156
164
  type: "primary",
157
165
  block: true,
158
- className: `${prefix}-submit-btn`,
166
+ className: `${prefixCls}-submit-btn`,
159
167
  children: locale.registerBtn
160
168
  }
161
169
  )
@@ -5,7 +5,6 @@ import type { IActivateFormProps } from './ActivateForm';
5
5
  import type { ILoginFormProps } from './LoginForm';
6
6
  import type { IRegisterFormProps } from './RegisterForm';
7
7
  import type { Locale } from '../interface';
8
- import './index.less';
9
8
  export interface Values {
10
9
  username: string;
11
10
  password: string;
@@ -38,7 +38,6 @@ var import_design2 = require("@oceanbase/design");
38
38
  var import_classnames = __toESM(require("classnames"));
39
39
  var import_react = require("react");
40
40
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
41
- var import_util = require("../_util");
42
41
  var import_ActivateForm = __toESM(require("./ActivateForm"));
43
42
  var import_zh_CN = __toESM(require("./locale/zh-CN"));
44
43
  var import_LoginForm = __toESM(require("./LoginForm"));
@@ -46,9 +45,8 @@ var import_RegisterForm = __toESM(require("./RegisterForm"));
46
45
  var import_oceanbase_logo = __toESM(require("../assets/logo/oceanbase_logo.svg"));
47
46
  var import_oceanbase_logo_dark = __toESM(require("../assets/logo/oceanbase_logo_dark.svg"));
48
47
  var import_LocaleDropdown = __toESM(require("../LocaleDropdown"));
49
- var import_index = require("./index.less");
48
+ var import_style = __toESM(require("./style"));
50
49
  var import_jsx_runtime = require("react/jsx-runtime");
51
- var prefix = (0, import_util.getPrefix)("login");
52
50
  var Login = (props) => {
53
51
  const {
54
52
  logo,
@@ -72,6 +70,9 @@ var Login = (props) => {
72
70
  isMobile,
73
71
  style = {}
74
72
  } = props;
73
+ const { getPrefixCls, theme } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
74
+ const prefixCls = getPrefixCls("login");
75
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
75
76
  const [showRegister, setShowRegister] = (0, import_ahooks.useControllableValue)(props, {
76
77
  defaultValue: false,
77
78
  valuePropName: "showRegister",
@@ -83,7 +84,6 @@ var Login = (props) => {
83
84
  trigger: "onShowActivateChange"
84
85
  });
85
86
  const isLoading = (loginProps == null ? void 0 : loginProps.loading) || (registerProps == null ? void 0 : registerProps.loading) || (otherLoginProps == null ? void 0 : otherLoginProps.loading);
86
- const { theme } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
87
87
  const switchForm = (0, import_react.useCallback)(() => {
88
88
  if (isLoading) {
89
89
  import_design2.message.warning(locale.isLoadingWarn);
@@ -97,102 +97,104 @@ var Login = (props) => {
97
97
  setShowActivate(!showActivate);
98
98
  }, [showActivate, isLoading]);
99
99
  const showWaterMark = !showRegister;
100
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.App, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
101
- "div",
102
- {
103
- className: (0, import_classnames.default)(`${prefix}-container`, {
104
- [`${prefix}-container-with-board`]: board,
105
- [`${prefix}-container-mobile`]: isMobile
106
- }),
107
- style,
108
- children: [
109
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-bg`, style: { backgroundImage: `url(${bgImage})` }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-info`, children: [
110
- title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-welcome`, children: title }),
111
- description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-start`, children: description })
112
- ] }) }),
113
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-card`, children: [
114
- showLocale && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LocaleDropdown.default, { locales, className: `${prefix}-locale` }),
115
- board && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-board`, children: board }),
116
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-content`, children: [
117
- showActivate ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
118
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefix}-activate-logo` }),
119
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
- import_design.Divider,
121
- {
122
- style: {
123
- marginTop: 14,
124
- marginBottom: 20
100
+ return wrapSSR(
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.App, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
102
+ "div",
103
+ {
104
+ className: (0, import_classnames.default)(`${prefixCls}-container`, {
105
+ [`${prefixCls}-container-with-board`]: board,
106
+ [`${prefixCls}-container-mobile`]: isMobile
107
+ }),
108
+ style,
109
+ children: [
110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-bg`, style: { backgroundImage: `url(${bgImage})` }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-info`, children: [
111
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-welcome`, children: title }),
112
+ description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-start`, children: description })
113
+ ] }) }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-card`, children: [
115
+ showLocale && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LocaleDropdown.default, { locales, className: `${prefixCls}-locale` }),
116
+ board && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-board`, children: board }),
117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-content`, children: [
118
+ showActivate ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefixCls}-activate-logo` }),
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
121
+ import_design.Divider,
122
+ {
123
+ style: {
124
+ marginTop: 14,
125
+ marginBottom: 20
126
+ }
125
127
  }
126
- }
127
- ),
128
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.activeTitle }),
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Paragraph, { children: locale.activeTitleDescrition }),
130
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
- import_ActivateForm.default,
132
- {
133
- ...activateFormProps,
134
- locale,
135
- errorMessage: alertProps == null ? void 0 : alertProps.message,
136
- goBack
137
- }
138
- )
139
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: showRegister ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
140
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefix}-reigster-logo` }),
141
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
142
- import_design.Divider,
143
- {
144
- style: {
145
- marginTop: 14,
146
- marginBottom: 20
128
+ ),
129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.activeTitle }),
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Paragraph, { children: locale.activeTitleDescrition }),
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
+ import_ActivateForm.default,
133
+ {
134
+ ...activateFormProps,
135
+ locale,
136
+ errorMessage: alertProps == null ? void 0 : alertProps.message,
137
+ goBack
147
138
  }
148
- }
149
- ),
150
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.registerTitle }),
151
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
152
- import_RegisterForm.default,
153
- {
154
- ...registerProps,
155
- locale,
156
- errorMessage: alertProps == null ? void 0 : alertProps.message
157
- }
158
- )
159
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
160
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefix}-logo` }),
161
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
162
- import_LoginForm.default,
163
- {
164
- ...loginProps,
165
- otherLoginProps,
166
- locale,
167
- errorMessage: alertProps == null ? void 0 : alertProps.message,
168
- showAuthCode,
169
- showOtherLoginButton,
170
- authCodeImg,
171
- onAuthCodeImgChange
172
- }
173
- )
174
- ] }) }),
175
- !!enableRegister && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-switch-btn`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { type: "link", onClick: switchForm, "data-testid": "login.register.btn", children: showRegister ? locale.switchLoginLabel : locale.switchRegisterLabel }) }),
176
- showWaterMark ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
177
- "div",
178
- {
179
- className: `${prefix}-watermark-wrapper`,
180
- style: { paddingLeft: showAuthCode ? 96 : 0 },
181
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
182
- "img",
139
+ )
140
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: showRegister ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefixCls}-reigster-logo` }),
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ import_design.Divider,
144
+ {
145
+ style: {
146
+ marginTop: 14,
147
+ marginBottom: 20
148
+ }
149
+ }
150
+ ),
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.registerTitle }),
152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
153
+ import_RegisterForm.default,
154
+ {
155
+ ...registerProps,
156
+ locale,
157
+ errorMessage: alertProps == null ? void 0 : alertProps.message
158
+ }
159
+ )
160
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
161
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefixCls}-logo` }),
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
163
+ import_LoginForm.default,
183
164
  {
184
- src: (theme == null ? void 0 : theme.isDark) ? import_oceanbase_logo_dark.default : import_oceanbase_logo.default,
185
- alt: "",
186
- className: `${prefix}-watermark`
165
+ ...loginProps,
166
+ otherLoginProps,
167
+ locale,
168
+ errorMessage: alertProps == null ? void 0 : alertProps.message,
169
+ showAuthCode,
170
+ showOtherLoginButton,
171
+ authCodeImg,
172
+ onAuthCodeImgChange
187
173
  }
188
174
  )
189
- }
190
- ) : null
175
+ ] }) }),
176
+ !!enableRegister && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-switch-btn`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { type: "link", onClick: switchForm, "data-testid": "login.register.btn", children: showRegister ? locale.switchLoginLabel : locale.switchRegisterLabel }) }),
177
+ showWaterMark ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
178
+ "div",
179
+ {
180
+ className: `${prefixCls}-watermark-wrapper`,
181
+ style: { paddingLeft: showAuthCode ? 96 : 0 },
182
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
183
+ "img",
184
+ {
185
+ src: (theme == null ? void 0 : theme.isDark) ? import_oceanbase_logo_dark.default : import_oceanbase_logo.default,
186
+ alt: "",
187
+ className: `${prefixCls}-watermark`
188
+ }
189
+ )
190
+ }
191
+ ) : null
192
+ ] })
191
193
  ] })
192
- ] })
193
- ]
194
- }
195
- ) });
194
+ ]
195
+ }
196
+ ) })
197
+ );
196
198
  };
197
199
  var Login_default = (0, import_LocaleWrapper.default)({
198
200
  componentName: "Login",
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { GenerateStyle } from '@oceanbase/design/es/theme';
3
+ import type { OBToken } from '../../_util/genComponentStyleHook';
4
+ export type LoginToken = OBToken;
5
+ export declare const genLoginStyle: GenerateStyle<LoginToken>;
6
+ declare const _default: (prefixCls: string) => {
7
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
8
+ hashId: string;
9
+ };
10
+ export default _default;