@agentscope-ai/design 1.0.4 → 1.0.6

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 (81) hide show
  1. package/README.md +5 -6
  2. package/dist/antd/styles/breadcrumb.style.d.ts +18 -0
  3. package/dist/antd/styles/breadcrumb.style.js +15 -0
  4. package/dist/antd/styles/index.style.js +3 -2
  5. package/dist/antd/styles/select.style.d.ts +15 -0
  6. package/dist/antd/styles/select.style.js +7 -2
  7. package/dist/antd/themes/bailianDarkTheme.json +35 -28
  8. package/dist/antd/themes/bailianTheme.json +35 -28
  9. package/dist/antd/themes/carbonDarkTheme.json +35 -28
  10. package/dist/antd/themes/carbonTheme.json +35 -28
  11. package/dist/components/commonComponents/AlertDialog/index.js +58 -55
  12. package/dist/components/commonComponents/AlertDialog/index.style.d.ts +17 -0
  13. package/dist/components/commonComponents/AlertDialog/index.style.js +30 -0
  14. package/dist/components/commonComponents/Breadcrumb/demo/demo1.d.ts +3 -0
  15. package/dist/components/commonComponents/Breadcrumb/demo/demo1.js +23 -0
  16. package/dist/components/commonComponents/Button/index.d.ts +3 -0
  17. package/dist/components/commonComponents/Button/index.js +36 -23
  18. package/dist/components/commonComponents/ConfigProvider/index.d.ts +2 -4
  19. package/dist/components/commonComponents/ConfigProvider/index.js +17 -34
  20. package/dist/components/commonComponents/Drawer/index.js +8 -2
  21. package/dist/components/commonComponents/Drawer/index.style.d.ts +9 -0
  22. package/dist/components/commonComponents/Drawer/index.style.js +4 -2
  23. package/dist/components/commonComponents/Dropdown/index.js +2 -5
  24. package/dist/components/commonComponents/Empty/index.js +12 -6
  25. package/dist/components/commonComponents/Empty/index.style.d.ts +4 -19
  26. package/dist/components/commonComponents/Empty/index.style.js +3 -4
  27. package/dist/components/commonComponents/FloatButton/demo/demo1.d.ts +3 -0
  28. package/dist/components/commonComponents/FloatButton/demo/demo1.js +11 -0
  29. package/dist/components/commonComponents/FloatButton/demo/demo2.d.ts +3 -0
  30. package/dist/components/commonComponents/FloatButton/demo/demo2.js +11 -0
  31. package/dist/components/commonComponents/Form/index.js +2 -2
  32. package/dist/components/commonComponents/Form/index.style.d.ts +4 -2
  33. package/dist/components/commonComponents/Form/index.style.js +3 -3
  34. package/dist/components/commonComponents/HelpIcon/demo/index.js +1 -0
  35. package/dist/components/commonComponents/HelpIcon/index.js +6 -1
  36. package/dist/components/commonComponents/HelpIcon/index.style.d.ts +4 -0
  37. package/dist/components/commonComponents/HelpIcon/index.style.js +5 -2
  38. package/dist/components/commonComponents/IconButton/demo/demo1.js +5 -14
  39. package/dist/components/commonComponents/IconButton/demo/demo2.js +5 -5
  40. package/dist/components/commonComponents/IconButton/demo/demo3.js +5 -5
  41. package/dist/components/commonComponents/IconButton/demo/demo4.js +5 -5
  42. package/dist/components/commonComponents/IconButton/index.js +4 -0
  43. package/dist/components/commonComponents/IconButton/index.style.d.ts +16 -0
  44. package/dist/components/commonComponents/IconButton/index.style.js +25 -0
  45. package/dist/components/commonComponents/Input/index.js +10 -1
  46. package/dist/components/commonComponents/Input/index.style.d.ts +7 -0
  47. package/dist/components/commonComponents/Input/index.style.js +7 -3
  48. package/dist/components/commonComponents/Message/{demo.js → demo/demo1.js} +1 -1
  49. package/dist/components/commonComponents/Message/demo/demo2.js +66 -0
  50. package/dist/components/commonComponents/Message/index.d.ts +11 -2
  51. package/dist/components/commonComponents/Message/index.js +49 -1
  52. package/dist/components/commonComponents/Modal/index.js +26 -5
  53. package/dist/components/commonComponents/Modal/index.style.d.ts +33 -2
  54. package/dist/components/commonComponents/Modal/index.style.js +24 -10
  55. package/dist/components/commonComponents/Pagination/demo/demo1.js +3 -1
  56. package/dist/components/commonComponents/Pagination/demo/demo2.js +2 -1
  57. package/dist/components/commonComponents/Slider/demo/demo1.js +1 -1
  58. package/dist/components/commonComponents/Slider/demo/demo2.js +1 -1
  59. package/dist/components/commonComponents/Slider/demo/demo3.d.ts +3 -0
  60. package/dist/components/commonComponents/Slider/demo/demo3.js +44 -0
  61. package/dist/components/commonComponents/Slider/index.d.ts +11 -0
  62. package/dist/components/commonComponents/Slider/index.js +27 -0
  63. package/dist/components/commonComponents/Slider/index.style.d.ts +7 -0
  64. package/dist/components/commonComponents/Slider/index.style.js +22 -0
  65. package/dist/components/commonComponents/Slider/slider.input.d.ts +18 -0
  66. package/dist/components/commonComponents/Slider/slider.input.js +73 -0
  67. package/dist/components/commonComponents/Tag/demo1.d.ts +2 -0
  68. package/dist/components/commonComponents/Tag/{demo.js → demo1.js} +3 -0
  69. package/dist/components/commonComponents/Tag/demo2.d.ts +2 -0
  70. package/dist/components/commonComponents/Tag/demo2.js +40 -0
  71. package/dist/components/commonComponents/Tag/index.style.d.ts +11 -0
  72. package/dist/components/commonComponents/Tag/index.style.js +5 -1
  73. package/dist/config.d.ts +0 -3
  74. package/dist/index.d.ts +3 -2
  75. package/dist/index.js +3 -3
  76. package/dist/libs/env/index.d.ts +1 -5
  77. package/dist/libs/env/index.js +11 -2
  78. package/dist/libs/region/index.d.ts +1 -1
  79. package/package.json +13 -7
  80. /package/dist/components/commonComponents/Message/{demo.d.ts → demo/demo1.d.ts} +0 -0
  81. /package/dist/components/commonComponents/{Tag/demo.d.ts → Message/demo/demo2.d.ts} +0 -0
@@ -0,0 +1,30 @@
1
+ var _excluded = ["css"];
2
+ 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); }
3
+ 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; }
4
+ 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; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ import createStyle from "../../../libs/createStyle";
9
+ export function getIndexStyleData(params) {
10
+ var sparkPrefix = params.sparkPrefix,
11
+ antPrefix = params.antPrefix;
12
+ return _defineProperty({}, ".".concat(sparkPrefix, "-alert-dialog"), _defineProperty(_defineProperty(_defineProperty({}, ".".concat(antPrefix, "-modal-body"), {
13
+ padding: '0 0 12px 32px',
14
+ fontSize: '14px',
15
+ color: "var(--".concat(antPrefix, "-color-text-secondary)")
16
+ }), ".".concat(antPrefix, "-modal-confirm-content"), {
17
+ padding: '0 0 12px 32px',
18
+ fontSize: '14px',
19
+ color: "var(--".concat(antPrefix, "-color-text-secondary)")
20
+ }), ".".concat(antPrefix, "-modal-confirm-paragraph"), {
21
+ maxWidth: '100%'
22
+ }));
23
+ }
24
+ var useIndexStyle = createStyle(function (_ref2) {
25
+ var css = _ref2.css,
26
+ params = _objectWithoutProperties(_ref2, _excluded);
27
+ var result = css(getIndexStyleData(params));
28
+ return result;
29
+ });
30
+ export default useIndexStyle;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const App: React.FC;
3
+ export default App;
@@ -0,0 +1,23 @@
1
+ import { Breadcrumb } from 'antd';
2
+ import React from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ var App = function App() {
5
+ return /*#__PURE__*/_jsx(Breadcrumb, {
6
+ items: [{
7
+ title: 'Home'
8
+ }, {
9
+ title: /*#__PURE__*/_jsx("a", {
10
+ href: "",
11
+ children: "Application Center"
12
+ })
13
+ }, {
14
+ title: /*#__PURE__*/_jsx("a", {
15
+ href: "",
16
+ children: "Application List"
17
+ })
18
+ }, {
19
+ title: 'An Application'
20
+ }]
21
+ });
22
+ };
23
+ export default App;
@@ -1,5 +1,6 @@
1
1
  import { ButtonProps } from 'antd';
2
2
  import React, { ReactNode } from 'react';
3
+ import { SparkIconFontProps } from '../IconFont';
3
4
  export interface SparkButtonProps extends ButtonProps {
4
5
  /** 尺寸
5
6
  * @default
@@ -13,6 +14,8 @@ export interface SparkButtonProps extends ButtonProps {
13
14
  tooltipContent?: string | ReactNode;
14
15
  /** 百炼图标iconfont的key,依赖百炼的iconFont,例如bl-icon-add */
15
16
  iconType?: string;
17
+ /** 图标大小 */
18
+ iconSize?: SparkIconFontProps['size'];
16
19
  }
17
20
  declare const Button: React.ForwardRefExoticComponent<SparkButtonProps & React.RefAttributes<any>>;
18
21
  export default Button;
@@ -1,10 +1,13 @@
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); }
1
+ var _excluded = ["iconSize"];
2
2
  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; }
3
3
  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; }
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { Button as AntdButton, ConfigProvider } from 'antd';
7
+ 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); }
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
+ 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
+ import { Button as AntdButton, ConfigProvider, theme } from 'antd';
8
11
  import React, { forwardRef } from 'react';
9
12
  import IconFont from "../IconFont";
10
13
  import Popover from "../Popover";
@@ -12,65 +15,75 @@ import Popover from "../Popover";
12
15
  // @ts-ignore
13
16
  import { jsx as _jsx } from "react/jsx-runtime";
14
17
  var Button = /*#__PURE__*/forwardRef(function (props, ref) {
18
+ var token = theme.useToken();
19
+ var iconSize = props.iconSize,
20
+ restProps = _objectWithoutProperties(props, _excluded);
15
21
  var buttonType = React.useMemo(function () {
16
22
  // @ts-ignore
17
- if (props.type === 'primaryLess') return 'primary';
23
+ if (restProps.type === 'primaryLess') return 'primary';
18
24
  // @ts-ignore
19
- if (props.type === 'textCompact') return 'link';
20
- return props.type;
21
- }, [props.type]);
25
+ if (restProps.type === 'textCompact') return 'link';
26
+ return restProps.type;
27
+ }, [restProps.type]);
22
28
  var icon = React.useMemo(function () {
23
- if (props.iconType) return /*#__PURE__*/_jsx(IconFont, {
24
- type: props.iconType,
25
- size: props.size
29
+ if (restProps.loading && _typeof(restProps.loading) === 'object' && restProps.loading.icon) {
30
+ var _restProps$loading;
31
+ return (_restProps$loading = restProps.loading) === null || _restProps$loading === void 0 ? void 0 : _restProps$loading.icon;
32
+ }
33
+ if (restProps.iconType) return /*#__PURE__*/_jsx(IconFont, {
34
+ type: restProps.iconType,
35
+ size: iconSize !== null && iconSize !== void 0 ? iconSize : restProps.size
26
36
  }); // 注意 size 也需要传入下去
27
- if (props.icon) return /*#__PURE__*/React.cloneElement(props.icon, {
28
- size: props.size // 注意 size 也需要传入下去
37
+ if (restProps.icon) return /*#__PURE__*/React.cloneElement(restProps.icon, {
38
+ size: iconSize !== null && iconSize !== void 0 ? iconSize : restProps.size // 注意 size 也需要传入下去
29
39
  });
30
40
  return null;
31
- }, [props.iconType, props.icon]);
32
- var button = /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, props), {}, {
41
+ }, [restProps.iconType, restProps.icon]);
42
+ var button = /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, restProps), {}, {
33
43
  ref: ref,
34
44
  type: buttonType,
35
45
  icon: icon,
36
46
  style: _objectSpread({
47
+ fontWeight: 500,
37
48
  lineHeight: 1
38
- }, props.style)
49
+ }, restProps.style)
39
50
  }));
40
51
 
41
52
  // @ts-ignore
42
- if (props.type === 'primaryLess') {
53
+ if (restProps.type === 'primaryLess') {
43
54
  return /*#__PURE__*/_jsx(ConfigProvider, {
44
55
  theme: {
45
56
  token: {
46
- colorPrimary: 'rgba(38, 36, 76, 0.88)',
47
- colorPrimaryHover: 'rgba(38, 36, 76, 0.65)'
57
+ colorPrimary: token.token.colorText,
58
+ colorPrimaryHover: token.token.colorTextSecondary,
59
+ colorPrimaryActive: token.token.colorTextBase
48
60
  }
49
61
  },
50
62
  children: /*#__PURE__*/_jsx(Popover, {
51
- content: props.tooltipContent,
63
+ content: restProps.tooltipContent,
52
64
  children: button
53
65
  })
54
66
  });
55
67
  // @ts-ignore
56
- } else if (props.type === 'textCompact') {
68
+ } else if (restProps.type === 'textCompact') {
57
69
  return /*#__PURE__*/_jsx(Popover, {
58
- content: props.tooltipContent,
59
- children: /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, props), {}, {
70
+ content: restProps.tooltipContent,
71
+ children: /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, restProps), {}, {
60
72
  ref: ref,
61
73
  icon: icon,
62
74
  color: "default",
63
75
  variant: "link",
64
76
  style: _objectSpread({
77
+ fontWeight: 500,
65
78
  paddingLeft: 0,
66
79
  paddingRight: 0,
67
80
  lineHeight: 1
68
- }, props.style)
81
+ }, restProps.style)
69
82
  }))
70
83
  });
71
84
  } else {
72
85
  return /*#__PURE__*/_jsx(Popover, {
73
- content: props.tooltipContent,
86
+ content: restProps.tooltipContent,
74
87
  children: button
75
88
  });
76
89
  }
@@ -11,13 +11,11 @@ export type SparkConfigProviderProps = ConfigProviderProps & {
11
11
  children?: React.ReactNode;
12
12
  className?: string;
13
13
  style?: React.CSSProperties;
14
- theme?: ConfigProviderProps['theme'] & {
15
- extraCssVariables?: Record<string, string | number>;
16
- };
14
+ theme?: ConfigProviderProps['theme'];
17
15
  };
18
16
  declare function SparkConfigProvider(props: SparkConfigProviderProps): import("react/jsx-runtime").JSX.Element;
19
17
  declare namespace SparkConfigProvider {
20
- var ConfigContext: import("react").Context<import("antd/es/config-provider").ConfigConsumerProps>;
18
+ var ConfigContext: import("react").Context<import("antd/es/config-provider/context").ConfigConsumerProps>;
21
19
  var config: (props: any) => void;
22
20
  var useConfig: typeof import("antd/es/config-provider/hooks/useConfig").default;
23
21
  }
@@ -15,8 +15,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
15
15
  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; }
16
16
  import $i18n from "../../../i18n";
17
17
  import { App, ConfigProvider, message, theme } from 'antd';
18
+ import { ConfigContext } from 'antd/es/config-provider/context';
19
+ import useTheme from 'antd/es/config-provider/hooks/useTheme';
18
20
  import classNames from 'classnames';
19
- import { useLayoutEffect, useMemo, useState } from 'react';
21
+ import { useContext, useLayoutEffect, useMemo, useState } from 'react';
20
22
  import { DEFAULT_SPARK_PREFIX, getCommonConfig, setCommonConfig } from "../../../config";
21
23
  import useSparkStyle from "../spark.style";
22
24
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -40,21 +42,24 @@ function SparkConfigProvider(props) {
40
42
  _useState2 = _slicedToArray(_useState, 2),
41
43
  hasInit = _useState2[0],
42
44
  setHasInit = _useState2[1];
43
- var _useState3 = useState({}),
45
+ var _useState3 = useState(((_props$locale = props.locale) === null || _props$locale === void 0 ? void 0 : _props$locale.locale) || 'defaultKey'),
44
46
  _useState4 = _slicedToArray(_useState3, 2),
45
- variables = _useState4[0],
46
- setVariables = _useState4[1];
47
- var _useState5 = useState(((_props$locale = props.locale) === null || _props$locale === void 0 ? void 0 : _props$locale.locale) || 'defaultKey'),
48
- _useState6 = _slicedToArray(_useState5, 2),
49
- key = _useState6[0],
50
- setKey = _useState6[1];
47
+ key = _useState4[0],
48
+ setKey = _useState4[1];
51
49
  // 更新antd的class prefix
52
50
  var _getCommonConfig = getCommonConfig(),
53
51
  antPrefix = _getCommonConfig.antPrefix,
54
52
  sparkPrefix = _getCommonConfig.sparkPrefix;
53
+ var _useContext = useContext(ConfigContext),
54
+ parentTheme = _useContext.theme; // 父级ConfigProvider的theme(如有)
55
55
  var mergedPrefixCls = useMemo(function () {
56
56
  return prefixCls || (prefix ? "".concat(prefix, "-ant") : antPrefix);
57
57
  }, [prefixCls, prefix]);
58
+
59
+ // 融合父ConfigProvider的theme(如有),供给静态方法使用
60
+ var mergedTheme = useTheme(props.theme, parentTheme, {
61
+ prefixCls: mergedPrefixCls
62
+ });
58
63
  useLayoutEffect(function () {
59
64
  var newCommonConfig = {
60
65
  antPrefix: mergedPrefixCls,
@@ -88,44 +93,22 @@ function SparkConfigProvider(props) {
88
93
  }, []);
89
94
  useLayoutEffect(function () {
90
95
  // 给 message 、modal 、notification 静态方法设置 Provider
96
+ // 注意这里的theme不会集成父ConfigProvider的theme,所以需要手动合并
91
97
  ConfigProvider.config({
92
98
  // 5.13.0+
93
99
  holderRender: function holderRender(children) {
94
100
  return /*#__PURE__*/_jsx(ConfigProvider, _objectSpread(_objectSpread({}, restProps), {}, {
95
101
  prefixCls: mergedPrefixCls,
102
+ theme: mergedTheme,
96
103
  children: /*#__PURE__*/_jsx(App, {
97
104
  className: classNames("spark"),
98
- style: _objectSpread(_objectSpread({}, variables), props.style),
105
+ style: _objectSpread({}, props.style),
99
106
  children: children
100
107
  }, key)
101
108
  }));
102
109
  }
103
110
  });
104
111
  }, [restProps, mergedPrefixCls, hasInit]);
105
- useLayoutEffect(function () {
106
- // 从theme从提取出extraCssVariables,作为额外补充、覆盖的css变量
107
- if (!props.theme) return;
108
- var _getCommonConfig2 = getCommonConfig(),
109
- antPrefix = _getCommonConfig2.antPrefix;
110
- var _variables = {};
111
- var extraCssVariables = props.theme.extraCssVariables;
112
- if (extraCssVariables) {
113
- Object.keys(props.theme.extraCssVariables).forEach(function (key) {
114
- _variables["--".concat(antPrefix, "-").concat(key)] = extraCssVariables[key];
115
- });
116
- setVariables(_variables);
117
- setCommonConfig(_objectSpread(_objectSpread({}, getCommonConfig()), {}, {
118
- variables: _variables,
119
- isDarkMode: function () {
120
- try {
121
- return restProps.theme.algorithm == theme.darkAlgorithm;
122
- } catch (error) {
123
- return false;
124
- }
125
- }()
126
- }));
127
- }
128
- }, [props.theme]);
129
112
  useLayoutEffect(function () {
130
113
  var _props$locale2, _props$locale3;
131
114
  $i18n.updateLocale(((_props$locale2 = props.locale) === null || _props$locale2 === void 0 ? void 0 : _props$locale2.locale) || 'zh-cn'); // 默认为中文
@@ -138,7 +121,7 @@ function SparkConfigProvider(props) {
138
121
  sparkPrefix: sparkPrefix
139
122
  }), /*#__PURE__*/_jsx(App, {
140
123
  className: classNames("spark", props.className),
141
- style: _objectSpread(_objectSpread({}, variables), props.style),
124
+ style: _objectSpread({}, props.style),
142
125
  children: hasInit ? children : null
143
126
  }, key)]
144
127
  }));
@@ -8,6 +8,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
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 { getCommonConfig } from "../../../config";
11
+ import { IconFont } from "../../..";
11
12
  import { Drawer } from 'antd';
12
13
  import classNames from 'classnames';
13
14
  import useIndexStyle from "./index.style";
@@ -20,10 +21,15 @@ export default (function (props) {
20
21
  useIndexStyle();
21
22
  var commonConfig = getCommonConfig();
22
23
  var sparkPrefix = commonConfig.sparkPrefix;
23
- var variables = commonConfig.variables;
24
24
  return /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
25
+ closeIcon: /*#__PURE__*/_jsx(IconFont, {
26
+ type: "spark-false-line",
27
+ style: {
28
+ fontSize: 24
29
+ }
30
+ }),
25
31
  className: classNames("".concat(sparkPrefix, "-drawer"), className),
26
- style: _objectSpread(_objectSpread({}, style), variables)
32
+ style: _objectSpread({}, style)
27
33
  }, restProps), {}, {
28
34
  children: children
29
35
  }));
@@ -7,6 +7,15 @@ export declare function getIndexStyleData(params: any): {
7
7
  fontWeight: string;
8
8
  lineHeight: string;
9
9
  color: string;
10
+ width?: undefined;
11
+ height?: undefined;
12
+ } | {
13
+ width: number;
14
+ height: number;
15
+ fontSize?: undefined;
16
+ fontWeight?: undefined;
17
+ lineHeight?: undefined;
18
+ color?: undefined;
10
19
  };
11
20
  display: string;
12
21
  flexDirection: string;
@@ -12,7 +12,7 @@ export function getIndexStyleData(params) {
12
12
  return _defineProperty({}, ".".concat(sparkPrefix, "-drawer"), _defineProperty(_defineProperty(_defineProperty({}, ".".concat(antPrefix, "-drawer-header"), _defineProperty({
13
13
  padding: '18px 20px',
14
14
  borderColor: "var(--".concat(antPrefix, "-color-border-secondary)")
15
- }, ".".concat(antPrefix, "-drawer-header-title"), _defineProperty({
15
+ }, ".".concat(antPrefix, "-drawer-header-title"), _defineProperty(_defineProperty({
16
16
  display: 'flex',
17
17
  flexDirection: 'row-reverse'
18
18
  }, ".".concat(antPrefix, "-drawer-title"), {
@@ -20,10 +20,12 @@ export function getIndexStyleData(params) {
20
20
  fontWeight: '500',
21
21
  lineHeight: '28px',
22
22
  color: "var(--".concat(antPrefix, "-color-text)")
23
+ }), ".".concat(antPrefix, "-drawer-close"), {
24
+ width: 32,
25
+ height: 32
23
26
  }))), ".".concat(antPrefix, "-drawer-footer"), {
24
27
  padding: '16px 20px',
25
28
  borderColor: "var(--".concat(antPrefix, "-color-border-secondary)"),
26
- // height: '72px',
27
29
  display: 'flex',
28
30
  alignItems: 'center'
29
31
  }), ".".concat(antPrefix, "-drawer-close"), {
@@ -4,17 +4,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { getCommonConfig } from "../../../config";
8
7
  import { Dropdown } from 'antd';
9
8
  import { forwardRef } from 'react';
10
9
  import useIndexStyle from "./index.style";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
- var SparkDropdown = /*#__PURE__*/forwardRef(function (props, ref) {
11
+ var SparkDropdown = /*#__PURE__*/forwardRef(function (props) {
13
12
  useIndexStyle();
14
- var _getCommonConfig = getCommonConfig(),
15
- variables = _getCommonConfig.variables;
16
13
  return /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({}, props), {}, {
17
- overlayStyle: _objectSpread(_objectSpread({}, variables), props.overlayStyle)
14
+ overlayStyle: _objectSpread({}, props.overlayStyle)
18
15
  }));
19
16
  });
20
17
  export default SparkDropdown;
@@ -5,9 +5,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { getCommonConfig } from "../../../config";
8
- import { Space } from 'antd';
9
- import useIndexStyle from "./index.style";
8
+ import { Flex } from 'antd';
10
9
  import Button from "../Button";
10
+ import useIndexStyle from "./index.style";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
13
  var EMPTY_TYPE_IMAGE_MAP = {
@@ -64,6 +64,7 @@ var Empty = function Empty(props) {
64
64
  isDarkMode = commonConfig.isDarkMode;
65
65
  var image = props.image || (isDarkMode ? EMPTY_TYPE_IMAGE_MAP_DARK : EMPTY_TYPE_IMAGE_MAP)[type];
66
66
  useIndexStyle();
67
+ var parsedSize = typeof size === 'string' ? parseFloat(size.replace(/px/i, '')) : size !== null && size !== void 0 ? size : 0;
67
68
  return /*#__PURE__*/_jsxs("div", {
68
69
  className: "".concat(sparkPrefix, "-empty ").concat(props.className || ''),
69
70
  style: _objectSpread(_objectSpread({}, imageStyle), {}, {
@@ -85,20 +86,25 @@ var Empty = function Empty(props) {
85
86
  width: size,
86
87
  height: size
87
88
  }
88
- }), /*#__PURE__*/_jsxs(Space, {
89
- direction: "vertical",
89
+ }), /*#__PURE__*/_jsxs(Flex, {
90
+ vertical: true,
90
91
  align: "center",
91
92
  style: {
92
- marginTop: '56.25%'
93
+ marginTop: '52.5%'
93
94
  },
94
95
  children: [title && /*#__PURE__*/_jsx("div", {
95
96
  className: "".concat(sparkPrefix, "-empty-title"),
97
+ style: {
98
+ marginBottom: description ? 0.025 * parsedSize : 0
99
+ },
96
100
  children: title
97
101
  }), description && /*#__PURE__*/_jsx("div", {
98
102
  className: "".concat(sparkPrefix, "-empty-description"),
99
103
  children: description
100
104
  }), !!okText && /*#__PURE__*/_jsx("div", {
101
- className: "".concat(sparkPrefix, "-empty-buttons"),
105
+ style: {
106
+ marginTop: 0.05 * parsedSize
107
+ },
102
108
  children: /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
103
109
  type: okType || 'primary',
104
110
  onClick: onOk
@@ -7,17 +7,18 @@ export declare function getIndexStyleData(params: any): {
7
7
  position: string;
8
8
  top?: undefined;
9
9
  left?: undefined;
10
+ pointerEvents?: undefined;
10
11
  fontSize?: undefined;
11
12
  fontWeight?: undefined;
12
13
  lineHeight?: undefined;
13
14
  color?: undefined;
14
15
  textAlign?: undefined;
15
16
  width?: undefined;
16
- marginTop?: undefined;
17
17
  } | {
18
18
  position: string;
19
19
  top: number;
20
20
  left: number;
21
+ pointerEvents: string;
21
22
  display?: undefined;
22
23
  flexDirection?: undefined;
23
24
  alignItems?: undefined;
@@ -28,7 +29,6 @@ export declare function getIndexStyleData(params: any): {
28
29
  color?: undefined;
29
30
  textAlign?: undefined;
30
31
  width?: undefined;
31
- marginTop?: undefined;
32
32
  } | {
33
33
  fontSize: string;
34
34
  fontWeight: number;
@@ -41,9 +41,9 @@ export declare function getIndexStyleData(params: any): {
41
41
  position?: undefined;
42
42
  top?: undefined;
43
43
  left?: undefined;
44
+ pointerEvents?: undefined;
44
45
  textAlign?: undefined;
45
46
  width?: undefined;
46
- marginTop?: undefined;
47
47
  } | {
48
48
  fontSize: string;
49
49
  lineHeight: string;
@@ -57,23 +57,8 @@ export declare function getIndexStyleData(params: any): {
57
57
  position?: undefined;
58
58
  top?: undefined;
59
59
  left?: undefined;
60
+ pointerEvents?: undefined;
60
61
  fontWeight?: undefined;
61
- marginTop?: undefined;
62
- } | {
63
- marginTop: string;
64
- display?: undefined;
65
- flexDirection?: undefined;
66
- alignItems?: undefined;
67
- overflow?: undefined;
68
- position?: undefined;
69
- top?: undefined;
70
- left?: undefined;
71
- fontSize?: undefined;
72
- fontWeight?: undefined;
73
- lineHeight?: undefined;
74
- color?: undefined;
75
- textAlign?: undefined;
76
- width?: undefined;
77
62
  };
78
63
  };
79
64
  declare const useIndexStyle: (props?: {}) => import("../../../config").CommonConfig;
@@ -9,7 +9,7 @@ import createStyle from "../../../libs/createStyle";
9
9
  export function getIndexStyleData(params) {
10
10
  var sparkPrefix = params.sparkPrefix,
11
11
  antPrefix = params.antPrefix;
12
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-empty"), {
12
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-empty"), {
13
13
  display: 'flex',
14
14
  flexDirection: 'column',
15
15
  alignItems: 'center',
@@ -18,7 +18,8 @@ export function getIndexStyleData(params) {
18
18
  }), ".".concat(sparkPrefix, "-empty-image"), {
19
19
  position: 'absolute',
20
20
  top: 0,
21
- left: 0
21
+ left: 0,
22
+ pointerEvents: 'none'
22
23
  }), ".".concat(sparkPrefix, "-empty-title"), {
23
24
  fontSize: '16px',
24
25
  fontWeight: 500,
@@ -30,8 +31,6 @@ export function getIndexStyleData(params) {
30
31
  color: "var(--".concat(antPrefix, "-color-text-secondary)"),
31
32
  textAlign: 'center',
32
33
  width: '100%'
33
- }), ".".concat(sparkPrefix, "-empty-buttons"), {
34
- marginTop: '16px'
35
34
  });
36
35
  }
37
36
  var useIndexStyle = createStyle(function (_ref2) {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const App: React.FC;
3
+ export default App;
@@ -0,0 +1,11 @@
1
+ import { FloatButton } from 'antd';
2
+ import React from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ var App = function App() {
5
+ return /*#__PURE__*/_jsx(FloatButton, {
6
+ onClick: function onClick() {
7
+ return console.log('onClick');
8
+ }
9
+ });
10
+ };
11
+ export default App;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const App: React.FC;
3
+ export default App;
@@ -0,0 +1,11 @@
1
+ import { FloatButton } from 'antd';
2
+ import React from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ var App = function App() {
5
+ return /*#__PURE__*/_jsx(FloatButton, {
6
+ onClick: function onClick() {
7
+ return console.log('onClick');
8
+ }
9
+ });
10
+ };
11
+ export default App;
@@ -8,7 +8,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
9
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  import { getCommonConfig } from "../../../config";
11
- import { QuestionCircleOutlined } from "@agentscope-ai/icons-override-antd";
11
+ import { InfoCircleOutlined } from "@agentscope-ai/icons-override-antd";
12
12
  import { Form } from 'antd';
13
13
  import FormItem from 'antd/es/form/FormItem';
14
14
  import classnames from 'classnames';
@@ -47,7 +47,7 @@ var InternalForm = /*#__PURE__*/forwardRef(function (props, ref) {
47
47
  var InternalFormItem = function InternalFormItem(props) {
48
48
  var tooltip = props.tooltip,
49
49
  restProps = _objectWithoutProperties(props, _excluded);
50
- var defaultTooltipIcon = /*#__PURE__*/_jsx(QuestionCircleOutlined, {});
50
+ var defaultTooltipIcon = /*#__PURE__*/_jsx(InfoCircleOutlined, {});
51
51
  function getTooltip() {
52
52
  if (!tooltip) {
53
53
  return undefined;
@@ -2,14 +2,12 @@ export declare function getIndexStyleData(params: any): {
2
2
  [x: string]: {
3
3
  [x: string]: {
4
4
  color: string;
5
- marginLeft: string;
6
5
  lineHeight: number;
7
6
  marginTop: string;
8
7
  textAlign?: undefined;
9
8
  } | {
10
9
  textAlign: string;
11
10
  color?: undefined;
12
- marginLeft?: undefined;
13
11
  lineHeight?: undefined;
14
12
  marginTop?: undefined;
15
13
  };
@@ -18,6 +16,7 @@ export declare function getIndexStyleData(params: any): {
18
16
  fontSize?: undefined;
19
17
  lineHeight?: undefined;
20
18
  color?: undefined;
19
+ gap?: undefined;
21
20
  minHeight?: undefined;
22
21
  } | {
23
22
  fontWeight: number;
@@ -25,6 +24,7 @@ export declare function getIndexStyleData(params: any): {
25
24
  fontSize: string;
26
25
  lineHeight: string;
27
26
  color: string;
27
+ gap: string;
28
28
  minHeight?: undefined;
29
29
  } | {
30
30
  [x: string]: {
@@ -35,6 +35,7 @@ export declare function getIndexStyleData(params: any): {
35
35
  fontSize?: undefined;
36
36
  lineHeight?: undefined;
37
37
  color?: undefined;
38
+ gap?: undefined;
38
39
  minHeight?: undefined;
39
40
  } | {
40
41
  minHeight: string;
@@ -43,6 +44,7 @@ export declare function getIndexStyleData(params: any): {
43
44
  fontSize?: undefined;
44
45
  lineHeight?: undefined;
45
46
  color?: undefined;
47
+ gap?: undefined;
46
48
  };
47
49
  };
48
50
  declare const useIndexStyle: (props?: {}) => import("../../../config").CommonConfig;