@agentscope-ai/design 1.0.23-beta.1767091755248 → 1.0.24-beta.1767516664353
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.
- package/lib/antd/styles/button.style.js +13 -1
- package/lib/antd/themes/carbonDarkTheme.json +1 -1
- package/lib/antd/themes/generateTheme.js +31 -1
- package/lib/components/commonComponents/Avatar/index.js +7 -1
- package/lib/components/commonComponents/Button/index.js +12 -8
- package/lib/components/commonComponents/Form/index.js +8 -6
- package/lib/components/commonComponents/IconButton/index.js +6 -5
- package/lib/components/commonComponents/Message/index.d.ts +2 -2
- package/lib/components/commonComponents/Tooltip/index.style.js +1 -1
- package/lib/components/commonComponents/Video/index.js +1 -0
- package/lib/components/mobileComponents/MobileModal/index.d.ts +5 -5
- package/lib/i18n/strings/index.js +3 -3
- package/package.json +21 -8
- package/llms/all.llms.txt +0 -4976
- package/llms/components/commonComponents/Alert/index.zh-CN.llms.txt +0 -32
- package/llms/components/commonComponents/AlertDialog/index.zh-CN.llms.txt +0 -171
- package/llms/components/commonComponents/Anchor/index.zh-CN.llms.txt +0 -51
- package/llms/components/commonComponents/Audio/index.zh-CN.llms.txt +0 -7
- package/llms/components/commonComponents/Avatar/index.zh-CN.llms.txt +0 -37
- package/llms/components/commonComponents/Breadcrumb/index.zh-CN.llms.txt +0 -117
- package/llms/components/commonComponents/Button/index.zh-CN.llms.txt +0 -54
- package/llms/components/commonComponents/Card/index.zh-CN.llms.txt +0 -61
- package/llms/components/commonComponents/Checkbox/index.zh-CN.llms.txt +0 -69
- package/llms/components/commonComponents/CodeBlock/index.zh-CN.llms.txt +0 -13
- package/llms/components/commonComponents/Collapse/index.zh-CN.llms.txt +0 -56
- package/llms/components/commonComponents/CollapsePanel/index.zh-CN.llms.txt +0 -69
- package/llms/components/commonComponents/DatePicker/index.zh-CN.llms.txt +0 -221
- package/llms/components/commonComponents/Descriptions/index.zh-CN.llms.txt +0 -37
- package/llms/components/commonComponents/Drawer/index.zh-CN.llms.txt +0 -62
- package/llms/components/commonComponents/Dropdown/index.zh-CN.llms.txt +0 -149
- package/llms/components/commonComponents/Empty/index.zh-CN.llms.txt +0 -41
- package/llms/components/commonComponents/FloatButton/index.zh-CN.llms.txt +0 -51
- package/llms/components/commonComponents/Form/index.zh-CN.llms.txt +0 -558
- package/llms/components/commonComponents/IconButton/index.zh-CN.llms.txt +0 -45
- package/llms/components/commonComponents/Image/index.zh-CN.llms.txt +0 -165
- package/llms/components/commonComponents/Input/index.zh-CN.llms.txt +0 -133
- package/llms/components/commonComponents/InputNumber/index.zh-CN.llms.txt +0 -51
- package/llms/components/commonComponents/Message/index.zh-CN.llms.txt +0 -98
- package/llms/components/commonComponents/Modal/index.zh-CN.llms.txt +0 -168
- package/llms/components/commonComponents/Notification/index.zh-CN.llms.txt +0 -94
- package/llms/components/commonComponents/Pagination/index.zh-CN.llms.txt +0 -45
- package/llms/components/commonComponents/Popconfirm/index.zh-CN.llms.txt +0 -55
- package/llms/components/commonComponents/Popover/index.zh-CN.llms.txt +0 -43
- package/llms/components/commonComponents/Progress/index.zh-CN.llms.txt +0 -50
- package/llms/components/commonComponents/PromptsEditor/index.zh-CN.llms.txt +0 -15
- package/llms/components/commonComponents/Radio/index.zh-CN.llms.txt +0 -66
- package/llms/components/commonComponents/RadioButton/index.zh-CN.llms.txt +0 -73
- package/llms/components/commonComponents/Result/index.zh-CN.llms.txt +0 -10
- package/llms/components/commonComponents/Select/index.zh-CN.llms.txt +0 -96
- package/llms/components/commonComponents/Skeleton/index.zh-CN.llms.txt +0 -59
- package/llms/components/commonComponents/Slider/index.zh-CN.llms.txt +0 -62
- package/llms/components/commonComponents/Spinner/index.zh-CN.llms.txt +0 -15
- package/llms/components/commonComponents/Statistic/index.zh-CN.llms.txt +0 -58
- package/llms/components/commonComponents/Steps/index.zh-CN.llms.txt +0 -57
- package/llms/components/commonComponents/Switch/index.zh-CN.llms.txt +0 -39
- package/llms/components/commonComponents/Table/index.zh-CN.llms.txt +0 -254
- package/llms/components/commonComponents/Tabs/index.zh-CN.llms.txt +0 -68
- package/llms/components/commonComponents/Tag/index.zh-CN.llms.txt +0 -33
- package/llms/components/commonComponents/TimePicker/index.zh-CN.llms.txt +0 -111
- package/llms/components/commonComponents/Tooltip/index.zh-CN.llms.txt +0 -45
- package/llms/components/commonComponents/Upload/index.zh-CN.llms.txt +0 -95
- package/llms/components/commonComponents/Video/index.zh-CN.llms.txt +0 -11
- package/llms/docs/guide/fromAntd.zh-CN.llms.txt +0 -156
- package/llms/docs/guide/fromScratch.zh-CN.llms.txt +0 -83
- package/llms/docs/guide/iconfont.zh-CN.llms.txt +0 -69
- package/llms/docs/guide/overview.zh-CN.llms.txt +0 -51
- package/llms/docs/guide/sparkIcons.zh-CN.llms.txt +0 -25
- package/llms/docs/guide/theme.zh-CN.llms.txt +0 -61
- package/llms/docs/guide/tokens&variables.zh-CN.llms.txt +0 -433
- package/llms/docs/guide/vibe-coding.zh-CN.llms.txt +0 -29
- package/llms/index.llms.txt +0 -58
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import createGlobalStyle from "../../libs/createStyle";
|
|
4
|
-
export var useButtonStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* \u53D6\u6D88\u6240\u6709button\u7684boxShadow */\nbutton[type=\"button\"].", "-btn {\n font-weight: 500;\n padding-inline: 11px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 20px;\n }\n \n &.", "-btn-sm {\n padding-inline: 7px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 16px;\n }\n }\n \n &.", "-btn-lg {\n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 24px;\n }\n }\n}\n\n.", "-btn-default {\n border-color: var(--", "-color-border-secondary);\n}\n\n.", "-btn-textCompact:hover {\n color: var(--", "-color-text-tertiary) !important;\n}\n\n.", "-btn.", "-btn-default.", "-btn-dangerous:not(:disabled):not(.", "-btn-disabled) {\n border-color: transparent;\n background-color: var(--", "-color-error-bg);\n color: var(--", "-color-error);\n \n &:hover {\n background-color: var(--", "-color-error-bg-hover);\n border-color: transparent;\n color: var(--", "-color-error-hover);\n }\n}\n\n.", "-btn-color-dangerous.", "-btn-variant-solid:disabled,\n.", "-btn-color-dangerous.", "-btn-variant-solid.", "-btn-disabled {\n border-color: transparent;\n background-color: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n}\n\n.", "-btn-primary {\n color: var(--", "-color-text-on-primary);\n}\n.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-on-primary);\n}\n\n.", "-btn-primary:disabled {\n background: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n border-color: transparent;\n}\n\n.", "-btn-default:disabled {\n background: var(--", "-color-bg-base);\n color: var(--", "-color-text-tertiary);\n border-color: var(--", "-color-border-secondary);\n}\n"])), function (p) {
|
|
4
|
+
export var useButtonStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* \u53D6\u6D88\u6240\u6709button\u7684boxShadow */\nbutton[type=\"button\"].", "-btn {\n font-weight: 500;\n padding-inline: 11px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 20px;\n }\n \n &.", "-btn-sm {\n padding-inline: 7px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 16px;\n }\n }\n \n &.", "-btn-lg {\n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 24px;\n }\n }\n}\n\n.", "-btn-default {\n border-color: var(--", "-color-border-secondary);\n}\n\n.", "-btn-textCompact:hover {\n color: var(--", "-color-text-tertiary) !important;\n}\n\n.", "-btn.", "-btn-default.", "-btn-dangerous:not(:disabled):not(.", "-btn-disabled) {\n border-color: transparent;\n background-color: var(--", "-color-error-bg);\n color: var(--", "-color-error);\n \n &:hover {\n background-color: var(--", "-color-error-bg-hover);\n border-color: transparent;\n color: var(--", "-color-error-hover);\n }\n}\n\n.", "-btn-color-dangerous.", "-btn-variant-solid:disabled,\n.", "-btn-color-dangerous.", "-btn-variant-solid.", "-btn-disabled {\n border-color: transparent;\n background-color: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n}\n\n.", "-btn-primary {\n color: var(--", "-color-text-on-primary);\n}\n.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-on-primary);\n}\n\n.", "-btn-primary:disabled {\n background: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n border-color: transparent;\n}\n\n.", "-btn-default:disabled {\n background: var(--", "-color-bg-base);\n color: var(--", "-color-text-tertiary);\n border-color: var(--", "-color-border-secondary);\n}\n\n/* Keep white text color for primaryLess buttons */\n.spark-button-primaryLess.", "-btn-primary {\n color: var(--", "-color-text-white);\n}\n.spark-button-primaryLess.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-white);\n}\n"])), function (p) {
|
|
5
|
+
return p.antPrefix;
|
|
6
|
+
}, function (p) {
|
|
7
|
+
return p.antPrefix;
|
|
8
|
+
}, function (p) {
|
|
9
|
+
return p.antPrefix;
|
|
10
|
+
}, function (p) {
|
|
11
|
+
return p.antPrefix;
|
|
12
|
+
}, function (p) {
|
|
13
|
+
return p.antPrefix;
|
|
14
|
+
}, function (p) {
|
|
15
|
+
return p.antPrefix;
|
|
16
|
+
}, function (p) {
|
|
5
17
|
return p.antPrefix;
|
|
6
18
|
}, function (p) {
|
|
7
19
|
return p.antPrefix;
|
|
@@ -35,6 +35,36 @@
|
|
|
35
35
|
import themeDataDark from "./bailianDarkTheme.json";
|
|
36
36
|
import themeData from "./bailianTheme.json";
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Calculate WCAG relative luminance (used for contrast judgment)
|
|
40
|
+
* Return value range: 0 (darkest) to 1 (brightest)
|
|
41
|
+
*/
|
|
42
|
+
var getRelativeLuminance = function getRelativeLuminance(rgb) {
|
|
43
|
+
// Normalize RGB values to 0-1
|
|
44
|
+
var rsRGB = rgb.r / 255;
|
|
45
|
+
var gsRGB = rgb.g / 255;
|
|
46
|
+
var bsRGB = rgb.b / 255;
|
|
47
|
+
|
|
48
|
+
// Apply sRGB gamma correction
|
|
49
|
+
var r = rsRGB <= 0.03928 ? rsRGB / 12.92 : Math.pow((rsRGB + 0.055) / 1.055, 2.4);
|
|
50
|
+
var g = gsRGB <= 0.03928 ? gsRGB / 12.92 : Math.pow((gsRGB + 0.055) / 1.055, 2.4);
|
|
51
|
+
var b = bsRGB <= 0.03928 ? bsRGB / 12.92 : Math.pow((bsRGB + 0.055) / 1.055, 2.4);
|
|
52
|
+
|
|
53
|
+
// Calculate relative luminance using WCAG formula
|
|
54
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Determine whether to use dark or light text on the background color
|
|
59
|
+
* Use WCAG relative luminance algorithm, threshold is 0.5
|
|
60
|
+
* @returns {boolean} true means use dark text, false means use light text
|
|
61
|
+
*/
|
|
62
|
+
var shouldUseDarkText = function shouldUseDarkText(rgb) {
|
|
63
|
+
var luminance = getRelativeLuminance(rgb);
|
|
64
|
+
// Use dark text when luminance is greater than 0.5, otherwise use light text
|
|
65
|
+
return luminance > 0.5;
|
|
66
|
+
};
|
|
67
|
+
|
|
38
68
|
// ==================== Color Conversion Utility Functions ====================
|
|
39
69
|
|
|
40
70
|
/**
|
|
@@ -282,7 +312,7 @@ var generateTheme = function generateTheme(config) {
|
|
|
282
312
|
colorPrimaryTextActive: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 10, 35), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? -10 : -20, 0),
|
|
283
313
|
// Text color displayed on primary color background: automatically selects black or white based on actual primary color lightness
|
|
284
314
|
// Light theme colors (lightness > 50) use black text, dark theme colors (lightness <= 50) use white text
|
|
285
|
-
colorTextOnPrimary:
|
|
315
|
+
colorTextOnPrimary: shouldUseDarkText(actualPrimaryRgb) ? '#000000' : '#ffffff',
|
|
286
316
|
// ========== Text Color System ==========
|
|
287
317
|
// Generated based on textBase hue, uses transparency to achieve different levels
|
|
288
318
|
colorTextBase: textBaseHex,
|
|
@@ -29,7 +29,13 @@ var SparkAvatar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
29
29
|
setModifiedChildren = _useState2[1];
|
|
30
30
|
useEffect(function () {
|
|
31
31
|
if (typeof children === 'string') {
|
|
32
|
-
|
|
32
|
+
// 使用 Array.from 来正确处理 emoji 等多字节字符
|
|
33
|
+
setModifiedChildren(Array.from(children)[0]);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (typeof children === 'number') {
|
|
37
|
+
// 数字类型转换为字符串后截取第一个字符
|
|
38
|
+
setModifiedChildren(Array.from(String(children))[0]);
|
|
33
39
|
return;
|
|
34
40
|
}
|
|
35
41
|
setModifiedChildren(children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["iconSize", "loading"];
|
|
1
|
+
var _excluded = ["iconSize", "loading", "iconType", "tooltipContent"];
|
|
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; }
|
|
@@ -20,6 +20,8 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
20
20
|
var token = theme.useToken();
|
|
21
21
|
var iconSize = props.iconSize,
|
|
22
22
|
loading = props.loading,
|
|
23
|
+
iconType = props.iconType,
|
|
24
|
+
tooltipContent = props.tooltipContent,
|
|
23
25
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
24
26
|
var buttonType = React.useMemo(function () {
|
|
25
27
|
// @ts-ignore
|
|
@@ -52,15 +54,15 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
52
54
|
if (loading && _typeof(loading) === 'object' && loading.icon) {
|
|
53
55
|
return loading === null || loading === void 0 ? void 0 : loading.icon;
|
|
54
56
|
}
|
|
55
|
-
if (
|
|
56
|
-
type:
|
|
57
|
+
if (iconType) return /*#__PURE__*/_jsx(IconFont, {
|
|
58
|
+
type: iconType,
|
|
57
59
|
size: iconSize !== null && iconSize !== void 0 ? iconSize : restProps.size
|
|
58
60
|
}); // 注意 size 也需要传入下去
|
|
59
61
|
if (restProps.icon) return /*#__PURE__*/React.cloneElement(restProps.icon, {
|
|
60
62
|
size: iconSize !== null && iconSize !== void 0 ? iconSize : restProps.size // 注意 size 也需要传入下去
|
|
61
63
|
});
|
|
62
64
|
return null;
|
|
63
|
-
}, [
|
|
65
|
+
}, [iconType, restProps.icon]);
|
|
64
66
|
var button = /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
65
67
|
loading: mergedLoading,
|
|
66
68
|
ref: ref,
|
|
@@ -70,7 +72,9 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
70
72
|
fontWeight: 500,
|
|
71
73
|
lineHeight: 1
|
|
72
74
|
}, restProps.style),
|
|
73
|
-
className: classNames(restProps.className, 'spark-button'
|
|
75
|
+
className: classNames(restProps.className, 'spark-button', {
|
|
76
|
+
'spark-button-primaryLess': restProps.type === 'primaryLess'
|
|
77
|
+
})
|
|
74
78
|
}));
|
|
75
79
|
|
|
76
80
|
// @ts-ignore
|
|
@@ -87,14 +91,14 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
87
91
|
}
|
|
88
92
|
},
|
|
89
93
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
90
|
-
title:
|
|
94
|
+
title: tooltipContent,
|
|
91
95
|
children: button
|
|
92
96
|
})
|
|
93
97
|
});
|
|
94
98
|
// @ts-ignore
|
|
95
99
|
} else if (restProps.type === 'textCompact') {
|
|
96
100
|
return /*#__PURE__*/_jsx(Tooltip, {
|
|
97
|
-
title:
|
|
101
|
+
title: tooltipContent,
|
|
98
102
|
children: /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
99
103
|
ref: ref,
|
|
100
104
|
icon: icon,
|
|
@@ -111,7 +115,7 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
111
115
|
});
|
|
112
116
|
} else {
|
|
113
117
|
return /*#__PURE__*/_jsx(Tooltip, {
|
|
114
|
-
title:
|
|
118
|
+
title: tooltipContent,
|
|
115
119
|
children: button
|
|
116
120
|
});
|
|
117
121
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
var _excluded = ["
|
|
1
|
+
var _excluded = ["labelMarginRight"],
|
|
2
|
+
_excluded2 = ["tooltip"];
|
|
2
3
|
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
4
|
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; }
|
|
6
5
|
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; }
|
|
7
6
|
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
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
8
|
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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
11
|
import { getCommonConfig } from "../../../config";
|
|
11
12
|
import { InfoCircleOutlined } from "@agentscope-ai/icons-override-antd";
|
|
12
13
|
import { Form } from 'antd';
|
|
@@ -19,7 +20,8 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
19
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
21
|
var InternalForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
22
|
var _props$labelMarginRig = props.labelMarginRight,
|
|
22
|
-
labelMarginRight = _props$labelMarginRig === void 0 ? undefined : _props$labelMarginRig
|
|
23
|
+
labelMarginRight = _props$labelMarginRig === void 0 ? undefined : _props$labelMarginRig,
|
|
24
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
23
25
|
var formRef = useRef(null);
|
|
24
26
|
var _getCommonConfig = getCommonConfig(),
|
|
25
27
|
sparkPrefix = _getCommonConfig.sparkPrefix;
|
|
@@ -31,7 +33,7 @@ var InternalForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
31
33
|
children: [/*#__PURE__*/_jsx(Style, {}),
|
|
32
34
|
/*#__PURE__*/
|
|
33
35
|
//@ts-ignore
|
|
34
|
-
_jsx(Form, _objectSpread(_objectSpread({},
|
|
36
|
+
_jsx(Form, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
35
37
|
className: classnames(props.className, "".concat(sparkPrefix, "-form"), labelMarginRight === 'small' && "".concat(sparkPrefix, "-form-label-margin-small")),
|
|
36
38
|
ref: formRef,
|
|
37
39
|
requiredMark: function requiredMark(label, info) {
|
|
@@ -47,7 +49,7 @@ var InternalForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
49
|
});
|
|
48
50
|
var InternalFormItem = function InternalFormItem(props) {
|
|
49
51
|
var tooltip = props.tooltip,
|
|
50
|
-
restProps = _objectWithoutProperties(props,
|
|
52
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
51
53
|
var defaultTooltipIcon = /*#__PURE__*/_jsx(InfoCircleOutlined, {});
|
|
52
54
|
function getTooltip() {
|
|
53
55
|
if (!tooltip) {
|
|
@@ -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 = ["className", "iconType", "bordered"];
|
|
2
|
+
var _excluded = ["className", "iconType", "bordered", "icon"];
|
|
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; }
|
|
@@ -20,6 +20,7 @@ export default (function (props) {
|
|
|
20
20
|
iconType = props.iconType,
|
|
21
21
|
_props$bordered = props.bordered,
|
|
22
22
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
23
|
+
iconProp = props.icon,
|
|
23
24
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
24
25
|
var config = getCommonConfig();
|
|
25
26
|
var iconfont = config.iconfont;
|
|
@@ -30,15 +31,15 @@ export default (function (props) {
|
|
|
30
31
|
type: iconType,
|
|
31
32
|
size: props.size
|
|
32
33
|
});
|
|
33
|
-
} else if (typeof
|
|
34
|
+
} else if (typeof iconProp === 'string') {
|
|
34
35
|
return /*#__PURE__*/_jsx(IconFont, {
|
|
35
|
-
type:
|
|
36
|
+
type: iconProp,
|
|
36
37
|
size: props.size
|
|
37
38
|
});
|
|
38
39
|
} else {
|
|
39
|
-
return
|
|
40
|
+
return iconProp;
|
|
40
41
|
}
|
|
41
|
-
}, [
|
|
42
|
+
}, [iconProp, iconType, iconfont]);
|
|
42
43
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
43
44
|
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
44
45
|
className: classNames(className, "".concat(config.sparkPrefix, "-icon-button")),
|
|
@@ -22,8 +22,8 @@ declare const _default: {
|
|
|
22
22
|
error: (options: JointContent) => void;
|
|
23
23
|
info: (options: JointContent) => void;
|
|
24
24
|
loading: (options: JointContent) => void;
|
|
25
|
-
open(args: MessageArgsProps)
|
|
26
|
-
destroy(key?: import("react").Key)
|
|
25
|
+
open: (args: MessageArgsProps) => import("antd/es/message/interface").MessageType;
|
|
26
|
+
destroy: (key?: import("react").Key) => void;
|
|
27
27
|
}, import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>];
|
|
28
28
|
open: (config: MessageArgsProps) => import("antd/es/message/interface").MessageType;
|
|
29
29
|
destroy: (key?: import("react").Key) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import createGlobalStyle from "../../../libs/createStyle";
|
|
4
|
-
export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/*
|
|
4
|
+
export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* Default dark mode */\n.", "-tooltip-content {\n .", "-tooltip-inner {\n border: 1px solid transparent;\n padding: 6px 12px;\n background: var(--", "-color-slate);\n color: var(--", "-color-text-white);\n }\n}\n\n/* Light mode - keep same style as dark mode */\n.", "-tooltip-light {\n .", "-tooltip-content .", "-tooltip-inner {\n background: var(--", "-color-slate);\n color: var(--", "-color-text-white);\n }\n \n .", "-tooltip-arrow {\n &::after {\n background: var(--", "-color-slate);\n }\n }\n}\n"])), function (p) {
|
|
5
5
|
return p.antPrefix;
|
|
6
6
|
}, function (p) {
|
|
7
7
|
return p.antPrefix;
|
|
@@ -18,23 +18,23 @@ declare const SparkMobileModal: {
|
|
|
18
18
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
19
19
|
success: (config: any) => {
|
|
20
20
|
destroy: () => void;
|
|
21
|
-
update: (configUpdate: import("antd").
|
|
21
|
+
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
22
22
|
};
|
|
23
23
|
error: (config: any) => {
|
|
24
24
|
destroy: () => void;
|
|
25
|
-
update: (configUpdate: import("antd").
|
|
25
|
+
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
26
26
|
};
|
|
27
27
|
warning: (config: any) => {
|
|
28
28
|
destroy: () => void;
|
|
29
|
-
update: (configUpdate: import("antd").
|
|
29
|
+
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
30
30
|
};
|
|
31
31
|
info: (config: any) => {
|
|
32
32
|
destroy: () => void;
|
|
33
|
-
update: (configUpdate: import("antd").
|
|
33
|
+
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
34
34
|
};
|
|
35
35
|
confirm: (config: any) => {
|
|
36
36
|
destroy: () => void;
|
|
37
|
-
update: (configUpdate: import("antd").
|
|
37
|
+
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
38
38
|
};
|
|
39
39
|
SMALL_WIDTH: number;
|
|
40
40
|
MEDIUM_WIDTH: number;
|
|
@@ -4,9 +4,9 @@ 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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var enUS = require("./en-US.json");
|
|
8
|
+
var zhCN = require("./zh-CN.json");
|
|
9
|
+
module.exports = {
|
|
10
10
|
'en-US': _objectSpread({}, enUS),
|
|
11
11
|
'zh-CN': _objectSpread({}, zhCN)
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentscope-ai/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24-beta.1767516664353",
|
|
4
4
|
"description": "AgentScope Spark Design - UI Library for AgentScope AI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,9 +36,13 @@
|
|
|
36
36
|
"dumi:setup": "dumi setup",
|
|
37
37
|
"prepare": "npm run dumi:setup",
|
|
38
38
|
"start": "npm run dev",
|
|
39
|
-
"test": "vitest",
|
|
40
39
|
"release": "node scripts/publish.js",
|
|
41
|
-
"release:beta": "node scripts/publish-beta.js"
|
|
40
|
+
"release:beta": "node scripts/publish-beta.js",
|
|
41
|
+
"test": "jest",
|
|
42
|
+
"test:ci": "jest --ci --coverage --watchAll=false",
|
|
43
|
+
"test:coverage": "jest --coverage",
|
|
44
|
+
"test:watch": "jest --watch",
|
|
45
|
+
"publish:manual": "npm run build && npm publish"
|
|
42
46
|
},
|
|
43
47
|
"dependencies": {
|
|
44
48
|
"@agentscope-ai/icons": "^1.0.35",
|
|
@@ -82,24 +86,29 @@
|
|
|
82
86
|
"@alibot/dumi-plugin-llms": "1.0.4",
|
|
83
87
|
"@alibot/dumi-plugin-api-parser": "1.0.3",
|
|
84
88
|
"@agentscope-ai/dumi-theme-spark": "0.0.99",
|
|
89
|
+
"@babel/core": "^7.28.5",
|
|
90
|
+
"@babel/preset-env": "^7.28.5",
|
|
91
|
+
"@babel/preset-react": "^7.28.5",
|
|
92
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
93
|
+
"@jest/test-sequencer": "^29.7.0",
|
|
85
94
|
"@modelcontextprotocol/sdk": "1.17.3",
|
|
86
95
|
"@rc-component/util": "1.2.1",
|
|
87
96
|
"@react-spring/web": "^9.7.5",
|
|
88
97
|
"@tailwindcss/postcss": "^4.0.6",
|
|
98
|
+
"@testing-library/dom": "^10.4.1",
|
|
89
99
|
"@testing-library/jest-dom": "^6.6.3",
|
|
90
100
|
"@testing-library/react": "^16.0.1",
|
|
101
|
+
"@testing-library/user-event": "^14.6.1",
|
|
102
|
+
"@types/jest": "^29.5.14",
|
|
91
103
|
"@types/less": "^3.0.6",
|
|
92
104
|
"@types/lodash-es": "4.17.12",
|
|
93
105
|
"@types/react": "^18.2.0",
|
|
94
106
|
"@types/react-dom": "^18.2.0",
|
|
95
107
|
"@umijs/lint": "^4.0.0",
|
|
96
108
|
"@umijs/plugins": "^4.4.4",
|
|
97
|
-
"@vitejs/plugin-react": "^4.3.3",
|
|
98
|
-
"@vitejs/plugin-react-swc": "^3.7.1",
|
|
99
|
-
"@vitest/coverage-istanbul": "2.1.4",
|
|
100
|
-
"@vitest/ui": "2.1.9",
|
|
101
109
|
"ahooks": "^3.8.1",
|
|
102
110
|
"antd": "^5.23.0",
|
|
111
|
+
"babel-jest": "^29.7.0",
|
|
103
112
|
"classnames": "^2.5.1",
|
|
104
113
|
"conventional-changelog-cli": "^5.0.0",
|
|
105
114
|
"debug": "^4.3.7",
|
|
@@ -110,6 +119,10 @@
|
|
|
110
119
|
"father": "^4.1.0",
|
|
111
120
|
"framer-motion": "^12.4.2",
|
|
112
121
|
"husky": "^8.0.1",
|
|
122
|
+
"is-hotkey": "^0.2.0",
|
|
123
|
+
"jest": "^29.7.0",
|
|
124
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
125
|
+
"jest-transform-stub": "^2.0.0",
|
|
113
126
|
"jsdom": "^25.0.1",
|
|
114
127
|
"locomotive-scroll": "^4.1.4",
|
|
115
128
|
"motion": "^12.4.1",
|
|
@@ -122,9 +135,9 @@
|
|
|
122
135
|
"replace": "^1.2.2",
|
|
123
136
|
"semver": "^7.6.3",
|
|
124
137
|
"tailwindcss": "^4.0.6",
|
|
138
|
+
"ts-jest": "^29.2.5",
|
|
125
139
|
"ts-node": "^10.9.2",
|
|
126
140
|
"typescript": "^5.6.3",
|
|
127
|
-
"vitest": "^2.1.4",
|
|
128
141
|
"yargs-parser": "^21.1.1",
|
|
129
142
|
"zod": "^3.24.2"
|
|
130
143
|
},
|