@oceanbase/ui 0.2.27 → 0.2.29

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.
@@ -1,10 +1,10 @@
1
+ import { TooltipProps } from '@oceanbase/design';
1
2
  import React from 'react';
2
- import './index.less';
3
3
  export interface ContentWithQuestionProps {
4
4
  content?: React.ReactNode;
5
- tooltip?: any;
5
+ tooltip?: TooltipProps;
6
6
  prefixIcon?: React.ReactNode | boolean;
7
- suffixIcon?: React.ReactNode;
7
+ suffixIcon?: React.ReactNode | boolean;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
10
  onClick?: (e: React.SyntheticEvent) => void;
@@ -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 = ["content", "tooltip", "prefixIcon", "suffixIcon", "className", "children"];
2
+ var _excluded = ["prefixCls", "content", "tooltip", "prefixIcon", "suffixIcon", "className", "children"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -8,41 +8,44 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
8
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
10
  import { QuestionCircleOutlined } from '@oceanbase/icons';
11
- import { Space, Tooltip } from '@oceanbase/design';
11
+ import { ConfigProvider, Space, Tooltip } from '@oceanbase/design';
12
12
  import classNames from 'classnames';
13
- import React, { isValidElement } from 'react';
14
- import { getPrefix } from "../_util";
15
- import "./index.less";
13
+ import React, { useContext, isValidElement } from 'react';
14
+ import useStyle from "./style";
16
15
  import { jsx as _jsx } from "react/jsx-runtime";
17
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
- var prefix = getPrefix('content-with-question');
19
17
  var ContentWithQuestion = function ContentWithQuestion(_ref) {
20
18
  var _classNames;
21
- var content = _ref.content,
19
+ var customizePrefixCls = _ref.prefixCls,
20
+ content = _ref.content,
22
21
  tooltip = _ref.tooltip,
23
22
  _ref$prefixIcon = _ref.prefixIcon,
24
23
  prefixIcon = _ref$prefixIcon === void 0 ? null : _ref$prefixIcon,
25
24
  _ref$suffixIcon = _ref.suffixIcon,
26
- suffixIcon = _ref$suffixIcon === void 0 ? /*#__PURE__*/_jsx(QuestionCircleOutlined, {
27
- className: "".concat(prefix, "-help")
28
- }) : _ref$suffixIcon,
25
+ suffixIcon = _ref$suffixIcon === void 0 ? true : _ref$suffixIcon,
29
26
  className = _ref.className,
30
27
  children = _ref.children,
31
28
  restProps = _objectWithoutProperties(_ref, _excluded);
32
- // FIXME: antd 已经废弃 icon type 的用法,该组件也需要做相应处理,后面将会是传入 Icon 的形式而非 type
29
+ var _useContext = useContext(ConfigProvider.ConfigContext),
30
+ getPrefixCls = _useContext.getPrefixCls;
31
+ var prefixCls = getPrefixCls('content-with-question', customizePrefixCls);
32
+ var _useStyle = useStyle(prefixCls),
33
+ wrapSSR = _useStyle.wrapSSR;
33
34
  var getIcon = function getIcon(iconConfig) {
34
35
  return iconConfig ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip), {}, {
35
36
  children: /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : /*#__PURE__*/_jsx(QuestionCircleOutlined, {
36
- className: "".concat(prefix, "-help")
37
+ className: "".concat(prefixCls, "-help")
37
38
  })
38
39
  })) : null;
39
40
  };
40
- return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
41
- className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
41
+ return wrapSSR( /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
42
+ // eslint-disable-next-line react/no-unknown-property
43
+ prefixCls: customizePrefixCls,
44
+ className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
42
45
  }, restProps), {}, {
43
46
  children: /*#__PURE__*/_jsxs(Space, {
44
47
  children: [getIcon(prefixIcon === true ? /*#__PURE__*/_jsx(QuestionCircleOutlined, {
45
- className: "".concat(prefix, "-help"),
48
+ className: "".concat(prefixCls, "-help"),
46
49
  style: {
47
50
  marginRight: 4
48
51
  }
@@ -51,6 +54,6 @@ var ContentWithQuestion = function ContentWithQuestion(_ref) {
51
54
  children: content !== null && content !== void 0 ? content : children
52
55
  }), getIcon(suffixIcon)]
53
56
  })
54
- }));
57
+ })));
55
58
  };
56
59
  export default ContentWithQuestion;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { GenerateStyle } from '@oceanbase/design/es/theme';
3
+ export declare const genContentWithQuestionStyle: GenerateStyle<any>;
4
+ declare const _default: (prefixCls: string) => {
5
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
6
+ hashId: string;
7
+ };
8
+ export default _default;
@@ -0,0 +1,28 @@
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
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genContentWithQuestionStyle = function genContentWithQuestionStyle(token) {
7
+ var _$concat;
8
+ var componentCls = token.componentCls,
9
+ paddingSM = token.paddingSM;
10
+ return _defineProperty({}, "".concat(componentCls, "-item"), (_$concat = {
11
+ display: 'inline-flex',
12
+ alignItems: 'center'
13
+ }, _defineProperty(_$concat, "".concat(componentCls, "-prefix"), {
14
+ marginRight: 8
15
+ }), _defineProperty(_$concat, "".concat(componentCls, "-suffix"), {
16
+ marginLeft: 8
17
+ }), _defineProperty(_$concat, "".concat(componentCls, "-help"), {
18
+ cursor: 'help'
19
+ }), _defineProperty(_$concat, "".concat(componentCls, "-color"), {
20
+ color: 'red'
21
+ }), _$concat));
22
+ };
23
+ export default (function (prefixCls) {
24
+ var useStyle = genComponentStyleHook('ContentWithQuestion', function (token) {
25
+ return [genContentWithQuestionStyle(token)];
26
+ });
27
+ return useStyle(prefixCls);
28
+ });
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
29
29
  export declare const THEME_LIGHT = "light";
30
30
  declare const ThemeTypes: ["dark", "light"];
31
31
  export type ThemeType = (typeof ThemeTypes)[number];
32
- declare const supportedLanguages: ("ruby" | "css" | "bash" | "json" | "go" | "javascript" | "typescript" | "groovy" | "java" | "python" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "css" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
33
33
  export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -61,6 +61,7 @@ export interface LoginProps extends FormProps {
61
61
  onShowRegisterChange?: (isShow: boolean) => void;
62
62
  onShowActivateChange?: (isShow: boolean) => void;
63
63
  onAuthCodeImgChange?: () => void;
64
+ isMobile?: boolean;
64
65
  }
65
66
  declare const _default: any;
66
67
  export default _default;
package/es/Login/index.js CHANGED
@@ -11,13 +11,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { useControllableValue } from 'ahooks';
14
- import { App, ConfigProvider, Button, Divider, Menu, Typography } from '@oceanbase/design';
14
+ import { App, ConfigProvider, Button, Divider, Typography } from '@oceanbase/design';
15
15
  import { message } from '@oceanbase/design';
16
16
  import classNames from 'classnames';
17
17
  import React, { useContext, useCallback } from 'react';
18
- import { LOCALE_LIST } from "../constant";
19
18
  import LocaleWrapper from "../locale/LocaleWrapper";
20
- import { getPrefix, setLocale } from "../_util";
19
+ import { getPrefix } from "../_util";
21
20
  import ActivateForm from "./ActivateForm";
22
21
  import zhCN from "./locale/zh-CN";
23
22
  import LoginForm from "./LoginForm";
@@ -33,6 +32,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
33
32
  import { Fragment as _Fragment } from "react/jsx-runtime";
34
33
  var prefix = getPrefix('login');
35
34
  var Login = function Login(props) {
35
+ var _classNames;
36
36
  var logo = props.logo,
37
37
  bgImage = props.bgImage,
38
38
  title = props.title,
@@ -51,6 +51,7 @@ var Login = function Login(props) {
51
51
  showOtherLoginButton = props.showOtherLoginButton,
52
52
  authCodeImg = props.authCodeImg,
53
53
  onAuthCodeImgChange = props.onAuthCodeImgChange,
54
+ isMobile = props.isMobile,
54
55
  _props$style = props.style,
55
56
  style = _props$style === void 0 ? {} : _props$style;
56
57
  var _useControllableValue = useControllableValue(props, {
@@ -84,23 +85,10 @@ var Login = function Login(props) {
84
85
  }
85
86
  setShowActivate(!showActivate);
86
87
  }, [showActivate, isLoading]);
87
- var localeMenu = /*#__PURE__*/_jsx(Menu, {
88
- onClick: function onClick(_ref) {
89
- var key = _ref.key;
90
- setLocale(key);
91
- },
92
- children: LOCALE_LIST.filter(function (item) {
93
- return !locales || locales.includes(item.value);
94
- }).map(function (item) {
95
- return /*#__PURE__*/_jsx(Menu.Item, {
96
- children: item.label
97
- }, item.value);
98
- })
99
- });
100
88
  var showWaterMark = !showRegister;
101
89
  return /*#__PURE__*/_jsx(App, {
102
90
  children: /*#__PURE__*/_jsxs("div", {
103
- className: classNames("".concat(prefix, "-container"), _defineProperty({}, "".concat(prefix, "-container-with-board"), board)),
91
+ className: classNames("".concat(prefix, "-container"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-container-with-board"), board), _defineProperty(_classNames, "".concat(prefix, "-container-mobile"), isMobile), _classNames)),
104
92
  style: style,
105
93
  children: [/*#__PURE__*/_jsx("div", {
106
94
  className: "".concat(prefix, "-bg"),
@@ -5,20 +5,19 @@
5
5
  .@{prefix}-container {
6
6
  display: flex;
7
7
  justify-content: space-between;
8
- min-width: 768px;
8
+ min-width: 960px;
9
9
  height: 100vh;
10
10
  min-height: 600px;
11
11
  overflow: auto;
12
12
 
13
13
  .@{prefix}-bg {
14
- width: 540px;
15
- min-width: 400px;
14
+ width: 40%;
16
15
  height: 100%;
17
16
  background-repeat: no-repeat;
18
17
  background-size: cover;
19
18
 
20
19
  .@{prefix}-info {
21
- margin: 185px 90px 0 90px;
20
+ margin: 185px 48px 0 48px;
22
21
  color: #fff;
23
22
  font-weight: 600;
24
23
  font-size: 56px;
@@ -43,7 +42,7 @@
43
42
  background-color: #fff;
44
43
 
45
44
  .@{prefix}-locale {
46
- position: fixed;
45
+ position: absolute;
47
46
  top: 24px;
48
47
  right: 24px;
49
48
  color: @colorTextTertiary;
@@ -58,6 +57,7 @@
58
57
 
59
58
  .@{prefix}-content {
60
59
  margin-top: -60px;
60
+ width: 404px;
61
61
  .@{prefix}-logo {
62
62
  display: block;
63
63
  height: 68px;
@@ -87,13 +87,11 @@
87
87
  }
88
88
 
89
89
  .@{prefixCls}-form-item {
90
- width: 404px;
91
90
  margin-bottom: 24px;
92
91
  padding-bottom: 0;
93
92
  }
94
93
 
95
94
  .@{prefixCls}-input-affix-wrapper {
96
- width: 404px;
97
95
  height: 40px;
98
96
  border-radius: 8px;
99
97
 
@@ -178,7 +176,6 @@
178
176
  }
179
177
  }
180
178
  .@{prefix}-submit-btn {
181
- width: 404px;
182
179
  height: 40px;
183
180
  border-radius: 8px;
184
181
  }
@@ -201,7 +198,6 @@
201
198
  }
202
199
 
203
200
  .@{prefix}-alert {
204
- width: 404px;
205
201
  margin-bottom: 24px;
206
202
  border-radius: 8px;
207
203
  }
@@ -209,54 +205,6 @@
209
205
  }
210
206
  }
211
207
 
212
- @media (max-width: 2048px) {
213
- .@{prefix}-container {
214
- .@{prefix}-bg {
215
- width: 800px;
216
-
217
- .@{prefix}-info {
218
- margin: 185px 48px 0 48px;
219
- font-size: 72px;
220
- .@{prefix}-start {
221
- font-size: 48px;
222
- }
223
- }
224
- }
225
- }
226
- }
227
-
228
- @media (max-width: 1800px) {
229
- .@{prefix}-container {
230
- .@{prefix}-bg {
231
- width: 700px;
232
-
233
- .@{prefix}-info {
234
- margin: 185px 48px 0 48px;
235
- font-size: 64px;
236
- .@{prefix}-start {
237
- font-size: 40px;
238
- }
239
- }
240
- }
241
- }
242
- }
243
-
244
- @media (max-width: 1600px) {
245
- .@{prefix}-container {
246
- .@{prefix}-bg {
247
- width: 600px;
248
-
249
- .@{prefix}-info {
250
- margin: 185px 48px 0 48px;
251
- font-size: 56px;
252
- .@{prefix}-start {
253
- font-size: 32px;
254
- }
255
- }
256
- }
257
- }
258
- }
259
-
260
208
  // 设置的登录页最小高度,防止 logo 偏移位置偏移遮住输入框
261
209
  @media (max-height: 650px) {
262
210
  .@{prefix}-container {
@@ -267,59 +215,53 @@
267
215
  }
268
216
  }
269
217
 
270
- @media (max-width: 1200px) {
271
- .@{prefix}-container {
272
- .@{prefix}-bg {
273
- width: 500px;
274
-
275
- .@{prefix}-info {
276
- margin: 185px 48px 0 48px;
277
- font-size: 48px;
278
- .@{prefix}-start {
279
- font-size: 28px;
280
- }
281
- }
218
+ .@{prefix}-container-with-board {
219
+ .@{prefix}-card {
220
+ .@{prefix}-content {
221
+ margin-top: 0;
282
222
  }
283
223
  }
284
224
  }
285
225
 
286
- @media (max-width: 992px) {
287
- .@{prefix}-container {
288
- .@{prefix}-bg {
289
- width: 400px;
290
-
291
- .@{prefix}-info {
292
- margin: 185px 32px 0 32px;
293
- font-size: 40px;
294
- .@{prefix}-start {
295
- font-size: 24px;
296
- }
297
- }
298
- }
226
+ .@{prefix}-container-mobile {
227
+ flex-direction: column;
228
+ min-width: auto;
229
+ .@{prefix}-banner {
230
+ // 移动端设置百分比高度,避免使用 vh,否则安卓端打开软键盘会重新计算高度,导致 banner 图片高度出现跳变
231
+ height: 25%;
299
232
  }
300
- }
301
-
302
- @media (max-width: 768px) {
303
- .@{prefix}-container {
304
- .@{prefix}-bg {
305
- width: 250px;
306
-
307
- .@{prefix}-info {
308
- margin: 185px 24px 0 24px;
309
- font-size: 32px;
310
-
311
- .@{prefix}-start {
312
- font-size: 20px;
313
- }
314
- }
315
- }
233
+ .@{prefix}-bg {
234
+ width: 100%;
316
235
  }
317
- }
318
-
319
- .@{prefix}-container-with-board {
320
236
  .@{prefix}-card {
237
+ align-items: start;
238
+ width: 100%;
239
+ height: 75%;
240
+ margin-top: -48px;
241
+ padding: 0 32px;
242
+ border-radius: 16px 16px 0 0;
243
+ position: relative;
244
+ .@{prefix}-board {
245
+ top: 8px;
246
+ left: 24px;
247
+ }
248
+ .@{prefix}-locale {
249
+ top: 8px;
250
+ }
321
251
  .@{prefix}-content {
322
- margin-top: 0;
252
+ width: 100%;
253
+ margin-top: 40px;
254
+ .@{prefix}-logo {
255
+ height: 48px;
256
+ margin-bottom: 24px;
257
+ }
258
+ .@{prefix}-watermark-wrapper {
259
+ // 移动端改为正常文档流,避免安卓端被软键盘顶起
260
+ width: calc(100% - 64px);
261
+ position: static;
262
+ width: 100%;
263
+ margin-top: 96px;
264
+ }
323
265
  }
324
266
  }
325
267
  }
@@ -4,7 +4,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genPageContainerStyle = function genPageContainerStyle(token) {
7
- var _$concat, _$concat2, _$concat3, _$concat5, _ref;
7
+ var _$concat, _$concat$concat, _$concat2, _$concat4, _ref;
8
8
  var antCls = token.antCls,
9
9
  proComponentsCls = token.proComponentsCls,
10
10
  componentCls = token.componentCls,
@@ -18,25 +18,25 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
18
18
  paddingLG = token.paddingLG;
19
19
  var height = controlHeightLG;
20
20
  var lineHeight = "".concat(controlHeightLG, "px");
21
- return _ref = {}, _defineProperty(_ref, "".concat(componentCls), (_$concat3 = {
21
+ return _ref = {}, _defineProperty(_ref, "".concat(componentCls), (_$concat2 = {
22
22
  minHeight: '100vh',
23
23
  backgroundColor: colorBgLayout
24
- }, _defineProperty(_$concat3, "".concat(proComponentsCls, "-grid-content"), {
24
+ }, _defineProperty(_$concat2, "".concat(proComponentsCls, "-grid-content"), {
25
25
  minHeight: 'auto'
26
- }), _defineProperty(_$concat3, "".concat(antCls, "-page-header"), (_$concat2 = {
26
+ }), _defineProperty(_$concat2, "".concat(componentCls, "-warp-page-header,").concat(componentCls, "-wrap-page-header"), (_$concat$concat = {
27
27
  // 减小内容区左右两侧间距
28
- paddingInlineStart: paddingLG,
29
- paddingInlineEnd: paddingLG,
30
- paddingBlockStart: padding,
31
- paddingBlockEnd: padding
32
- }, _defineProperty(_$concat2, "".concat(antCls, "-page-header-breadcrumb"), {
28
+ paddingInlineStart: "".concat(paddingLG, "px !important"),
29
+ paddingInlineEnd: "".concat(paddingLG, "px !important"),
30
+ paddingBlockStart: "".concat(padding, "px !important"),
31
+ paddingBlockEnd: "".concat(padding, "px !important")
32
+ }, _defineProperty(_$concat$concat, "".concat(antCls, "-page-header-breadcrumb"), {
33
33
  // overwritten pro-components style
34
34
  paddingBlockStart: 0
35
- }), _defineProperty(_$concat2, "".concat(antCls, "-page-header-heading-title"), {
35
+ }), _defineProperty(_$concat$concat, "".concat(antCls, "-page-header-heading-title"), {
36
36
  fontSize: fontSizeHeading3
37
- }), _defineProperty(_$concat2, "".concat(antCls, "-page-header-heading-reload"), {
37
+ }), _defineProperty(_$concat$concat, "".concat(antCls, "-page-header-heading-reload"), {
38
38
  cursor: 'pointer'
39
- }), _defineProperty(_$concat2, "".concat(antCls, "-page-header-heading-extra"), (_$concat = {
39
+ }), _defineProperty(_$concat$concat, "".concat(antCls, "-page-header-heading-extra"), (_$concat = {
40
40
  height: height,
41
41
  lineHeight: lineHeight,
42
42
  marginBlock: 0
@@ -48,31 +48,31 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
48
48
  lineHeight: lineHeight
49
49
  }), _defineProperty(_$concat, "".concat(antCls, "-input-wrapper"), {
50
50
  lineHeight: lineHeight
51
- }), _$concat)), _defineProperty(_$concat2, "".concat(antCls, "-page-header-footer"), {
51
+ }), _$concat)), _defineProperty(_$concat$concat, "".concat(antCls, "-page-header-footer"), {
52
52
  marginBlockStart: 0
53
- }), _$concat2)), _defineProperty(_$concat3, "".concat(componentCls, "-children-container"), {
53
+ }), _$concat$concat)), _defineProperty(_$concat2, "".concat(componentCls, "-children-container"), {
54
54
  paddingInline: paddingLG,
55
55
  paddingBlockStart: 0,
56
56
  paddingBlockEnd: paddingLG
57
- }), _defineProperty(_$concat3, "".concat(antCls, "-page-header:not(").concat(antCls, "-page-header-has-breadcrumb)"), _defineProperty({}, "".concat(antCls, "-page-header-heading"), {
57
+ }), _defineProperty(_$concat2, "".concat(antCls, "-page-header:not(").concat(antCls, "-page-header-has-breadcrumb)"), _defineProperty({}, "".concat(antCls, "-page-header-heading"), {
58
58
  paddingBlockStart: 0
59
- })), _$concat3)), _defineProperty(_ref, "".concat(componentCls, "-no-page-header"), _defineProperty({}, "".concat(componentCls, "-children-container"), {
59
+ })), _$concat2)), _defineProperty(_ref, "".concat(componentCls, "-no-page-header"), _defineProperty({}, "".concat(componentCls, "-children-container"), {
60
60
  paddingBlockStart: paddingLG
61
61
  })), _defineProperty(_ref, "".concat(componentCls, "-with-footer "), {
62
62
  paddingBottom: 64
63
- }), _defineProperty(_ref, "".concat(proComponentsCls, "-footer-bar"), (_$concat5 = {
63
+ }), _defineProperty(_ref, "".concat(proComponentsCls, "-footer-bar"), (_$concat4 = {
64
64
  width: '100%',
65
65
  backgroundColor: colorBgBase,
66
66
  borderRadius: borderRadius,
67
67
  boxShadow: boxShadowSecondary,
68
68
  borderBlockStart: 'none'
69
- }, _defineProperty(_$concat5, "".concat(antCls, "-btn:not(").concat(antCls, "-input-search-button)"), {
69
+ }, _defineProperty(_$concat4, "".concat(antCls, "-btn:not(").concat(antCls, "-input-search-button)"), {
70
70
  minWidth: 68,
71
71
  height: height
72
- }), _defineProperty(_$concat5, "".concat(antCls, "-radio-button-wrapper"), {
72
+ }), _defineProperty(_$concat4, "".concat(antCls, "-radio-button-wrapper"), {
73
73
  height: height,
74
74
  lineHeight: lineHeight
75
- }), _$concat5)), _ref;
75
+ }), _$concat4)), _ref;
76
76
  };
77
77
  export default (function (prefixCls) {
78
78
  var useStyle = genComponentStyleHook('PageContainer', function (token) {
@@ -52,7 +52,8 @@ export var genTagSelectStyle = function genTagSelectStyle(token) {
52
52
  borderRadius: token.borderRadius,
53
53
  marginRight: token.marginXS,
54
54
  padding: "".concat(token.paddingXXS, "px ").concat(token.paddingContentHorizontal, "px"),
55
- cursor: 'pointer'
55
+ cursor: 'pointer',
56
+ transition: "all ".concat(token.motionDurationMid, " ").concat(token.motionEaseInOut)
56
57
  }, _defineProperty(_$concat, "".concat(componentCls, "-input"), {
57
58
  width: 0,
58
59
  height: 0,
@@ -76,9 +77,9 @@ export var genTagSelectStyle = function genTagSelectStyle(token) {
76
77
  }), _defineProperty(_ref, "".concat(componentCls, "-large").concat(componentCls, "-img"), _objectSpread(_objectSpread({}, genImgCoverStyle('228px', '120px')), {}, {
77
78
  marginRight: '16px'
78
79
  })), _defineProperty(_ref, "".concat(componentCls, "-small").concat(componentCls, "-img"), genImgCoverStyle('76px', '32px')), _defineProperty(_ref, "".concat(componentCls, "-large"), genSizeStyle(token.paddingContentVerticalSM, token.fontSize)), _defineProperty(_ref, "".concat(componentCls, "-small"), genSizeStyle(0, token.fontSize)), _defineProperty(_ref, "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-disabled):hover"), {
79
- color: token.colorPrimaryTextHover
80
- }), _defineProperty(_ref, "".concat(componentCls, "-checked"), genColoredStyle(token.blue, token.colorPrimaryBg, token.colorPrimaryText)), _defineProperty(_ref, "".concat(componentCls, "-wrapper").concat(componentCls, "-checked:not(").concat(componentCls, "-disabled):focus-within"), {
81
- boxShadow: "0 1px 3px 0px #000",
80
+ borderColor: token.colorPrimaryText
81
+ }), _defineProperty(_ref, "".concat(componentCls, "-checked"), genColoredStyle(token.blue, token.colorPrimaryBg, token.colorPrimaryText)), _defineProperty(_ref, "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-disabled):active"), {
82
+ boxShadow: "0px 0px 3px ".concat(token.colorPrimary),
82
83
  borderColor: "".concat(token.colorPrimary)
83
84
  }), _defineProperty(_ref, "".concat(componentCls, "-checked:not(").concat(componentCls, "-disabled)"), {
84
85
  '&:hover': _objectSpread(_objectSpread({}, genColoredStyle(token.colorInfoBorder, '#EBF1FF', token.colorInfoTextHover)), {}, _defineProperty({}, "".concat(componentCls, "-inner"), {
@@ -1,10 +1,10 @@
1
+ import { TooltipProps } from '@oceanbase/design';
1
2
  import React from 'react';
2
- import './index.less';
3
3
  export interface ContentWithQuestionProps {
4
4
  content?: React.ReactNode;
5
- tooltip?: any;
5
+ tooltip?: TooltipProps;
6
6
  prefixIcon?: React.ReactNode | boolean;
7
- suffixIcon?: React.ReactNode;
7
+ suffixIcon?: React.ReactNode | boolean;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
10
  onClick?: (e: React.SyntheticEvent) => void;
@@ -36,41 +36,46 @@ var import_icons = require("@oceanbase/icons");
36
36
  var import_design = require("@oceanbase/design");
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_react = __toESM(require("react"));
39
- var import_util = require("../_util");
40
- var import_index = require("./index.less");
41
- var prefix = (0, import_util.getPrefix)("content-with-question");
39
+ var import_style = __toESM(require("./style"));
42
40
  var ContentWithQuestion = ({
41
+ prefixCls: customizePrefixCls,
43
42
  content,
44
43
  tooltip,
45
44
  prefixIcon = null,
46
- suffixIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefix}-help` }),
45
+ suffixIcon = true,
47
46
  className,
48
47
  children,
49
48
  ...restProps
50
49
  }) => {
50
+ const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
51
+ const prefixCls = getPrefixCls("content-with-question", customizePrefixCls);
52
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
51
53
  const getIcon = (iconConfig) => {
52
- return iconConfig ? /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefix}-help` })) : null;
54
+ return iconConfig ? /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefixCls}-help` })) : null;
53
55
  };
54
- return /* @__PURE__ */ import_react.default.createElement(
55
- "span",
56
- {
57
- className: (0, import_classnames.default)({
58
- [`${prefix}-item`]: true,
59
- [className]: !!className
60
- }),
61
- ...restProps
62
- },
63
- /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, getIcon(
64
- prefixIcon === true ? /* @__PURE__ */ import_react.default.createElement(
65
- import_icons.QuestionCircleOutlined,
66
- {
67
- className: `${prefix}-help`,
68
- style: {
69
- marginRight: 4
56
+ return wrapSSR(
57
+ /* @__PURE__ */ import_react.default.createElement(
58
+ "span",
59
+ {
60
+ prefixCls: customizePrefixCls,
61
+ className: (0, import_classnames.default)({
62
+ [`${prefixCls}-item`]: true,
63
+ [className]: !!className
64
+ }),
65
+ ...restProps
66
+ },
67
+ /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, getIcon(
68
+ prefixIcon === true ? /* @__PURE__ */ import_react.default.createElement(
69
+ import_icons.QuestionCircleOutlined,
70
+ {
71
+ className: `${prefixCls}-help`,
72
+ style: {
73
+ marginRight: 4
74
+ }
70
75
  }
71
- }
72
- ) : prefixIcon
73
- ), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "content" }, content ?? children), getIcon(suffixIcon))
76
+ ) : prefixIcon
77
+ ), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "content" }, content ?? children), getIcon(suffixIcon))
78
+ )
74
79
  );
75
80
  };
76
81
  var ContentWithQuestion_default = ContentWithQuestion;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { GenerateStyle } from '@oceanbase/design/es/theme';
3
+ export declare const genContentWithQuestionStyle: GenerateStyle<any>;
4
+ declare const _default: (prefixCls: string) => {
5
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
6
+ hashId: string;
7
+ };
8
+ export default _default;