@agentscope-ai/design 1.0.13 → 1.0.15
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/README.md +237 -178
- package/README.zh-CN.md +312 -0
- package/lib/antd/styles/alert.style.js +7 -1
- package/lib/antd/styles/dropdown.style.js +5 -1
- package/lib/antd/styles/select.style.js +9 -1
- package/lib/components/commonComponents/Alert/demo/demo2.js +5 -0
- package/lib/components/commonComponents/AlertDialog/index.d.ts +37 -325
- package/lib/components/commonComponents/AlertDialog/index.js +151 -3
- package/lib/components/commonComponents/AlertDialog/index.style.js +2 -14
- package/lib/components/commonComponents/Drawer/index.style.js +2 -42
- package/lib/components/commonComponents/Modal/index.d.ts +16 -2
- package/lib/components/commonComponents/Modal/index.js +71 -3
- package/lib/components/commonComponents/Modal/index.style.js +2 -62
- package/lib/components/commonComponents/PromptsEditor/VarRender.d.ts +1 -1
- package/lib/components/commonComponents/Tabs/index.style.js +7 -1
- package/lib/components/commonComponents/Tag/demo/demo1.js +1 -1
- package/lib/components/commonComponents/Tag/index.d.ts +5 -1
- package/lib/components/commonComponents/Tag/index.js +4 -0
- package/lib/components/commonComponents/Tag/index.style.js +65 -1
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo1.d.ts +3 -0
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo1.js +20 -0
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo2.d.ts +3 -0
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo2.js +50 -0
- package/lib/components/{commonComponents/AlertDialog/mobile.d.ts → mobileComponents/MobileAlertDialog/index.d.ts} +8 -8
- package/lib/components/{commonComponents/AlertDialog/mobile.js → mobileComponents/MobileAlertDialog/index.js} +3 -3
- package/lib/components/mobileComponents/MobileAlertDialog/index.style.d.ts +1 -0
- package/lib/components/mobileComponents/MobileAlertDialog/index.style.js +22 -0
- package/lib/components/mobileComponents/MobileDrawer/Confirm.d.ts +46 -0
- package/lib/components/mobileComponents/MobileDrawer/Confirm.js +63 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo1.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo1.js +49 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo2.d.ts +7 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo2.js +90 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo3.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo3.js +64 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo4.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo4.js +99 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo5.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo5.js +73 -0
- package/lib/components/mobileComponents/MobileDrawer/index.d.ts +16 -0
- package/lib/components/{commonComponents/Modal/pc.js → mobileComponents/MobileDrawer/index.js} +25 -52
- package/lib/components/mobileComponents/MobileDrawer/index.style.d.ts +1 -0
- package/lib/components/mobileComponents/MobileDrawer/index.style.js +44 -0
- package/lib/components/mobileComponents/MobileModal/demo/basic.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/demo/basic.js +49 -0
- package/lib/components/mobileComponents/MobileModal/demo/styles.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/demo/styles.js +158 -0
- package/lib/components/mobileComponents/MobileModal/demo/width.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/demo/width.js +68 -0
- package/lib/components/mobileComponents/MobileModal/index.d.ts +43 -0
- package/lib/components/{commonComponents/Modal/mobile.js → mobileComponents/MobileModal/index.js} +45 -11
- package/lib/components/mobileComponents/MobileModal/index.style.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/index.style.js +70 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +10 -1
- package/lib/libs/env/index.d.ts +1 -1
- package/lib/typings.d.ts +0 -2
- package/package.json +11 -3
- package/lib/components/commonComponents/AlertDialog/pc.d.ts +0 -38
- package/lib/components/commonComponents/AlertDialog/pc.js +0 -152
- package/lib/components/commonComponents/Modal/mobile.d.ts +0 -28
- package/lib/components/commonComponents/Modal/pc.d.ts +0 -28
|
@@ -1,152 +0,0 @@
|
|
|
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 = ["children", "type", "danger", "title", "width", "className"];
|
|
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
|
-
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
|
-
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
|
-
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 $i18n from "../../../i18n";
|
|
11
|
-
import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined } from "@agentscope-ai/icons-override-antd";
|
|
12
|
-
import { Flex, Modal } from 'antd';
|
|
13
|
-
import classNames from 'classnames';
|
|
14
|
-
import { getCommonConfig } from "../../../config";
|
|
15
|
-
import { useStyle } from "./index.style";
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
var getCommonProps = function getCommonProps(props) {
|
|
20
|
-
var renderTitle = function renderTitle(_ref) {
|
|
21
|
-
var type = _ref.type,
|
|
22
|
-
title = _ref.title;
|
|
23
|
-
var _getCommonConfig = getCommonConfig(),
|
|
24
|
-
antPrefix = _getCommonConfig.antPrefix;
|
|
25
|
-
switch (type) {
|
|
26
|
-
case 'success':
|
|
27
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
28
|
-
align: "center",
|
|
29
|
-
gap: 8,
|
|
30
|
-
className: "leading-[28px]",
|
|
31
|
-
children: [/*#__PURE__*/_jsx(CheckCircleOutlined, {
|
|
32
|
-
style: {
|
|
33
|
-
color: "var(--".concat(antPrefix, "-color-success)"),
|
|
34
|
-
fontSize: 18,
|
|
35
|
-
margin: '0 3px'
|
|
36
|
-
}
|
|
37
|
-
}), title]
|
|
38
|
-
});
|
|
39
|
-
case 'warning':
|
|
40
|
-
case 'confirm':
|
|
41
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
42
|
-
align: "center",
|
|
43
|
-
gap: 8,
|
|
44
|
-
className: "leading-[28px]",
|
|
45
|
-
children: [/*#__PURE__*/_jsx(ExclamationCircleOutlined, {
|
|
46
|
-
style: {
|
|
47
|
-
color: "var(--".concat(antPrefix, "-color-warning)"),
|
|
48
|
-
fontSize: 18,
|
|
49
|
-
margin: '0 3px'
|
|
50
|
-
}
|
|
51
|
-
}), title]
|
|
52
|
-
});
|
|
53
|
-
case 'info':
|
|
54
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
55
|
-
align: "center",
|
|
56
|
-
gap: 8,
|
|
57
|
-
className: "leading-[28px]",
|
|
58
|
-
children: [/*#__PURE__*/_jsx(InfoCircleOutlined, {
|
|
59
|
-
style: {
|
|
60
|
-
color: "var(--".concat(antPrefix, "-color-info)"),
|
|
61
|
-
fontSize: 18,
|
|
62
|
-
margin: '0 3px'
|
|
63
|
-
}
|
|
64
|
-
}), title]
|
|
65
|
-
});
|
|
66
|
-
case 'error':
|
|
67
|
-
return /*#__PURE__*/_jsxs(Flex, {
|
|
68
|
-
align: "center",
|
|
69
|
-
gap: 8,
|
|
70
|
-
className: "leading-[28px]",
|
|
71
|
-
children: [/*#__PURE__*/_jsx(CloseCircleOutlined, {
|
|
72
|
-
style: {
|
|
73
|
-
color: "var(--".concat(antPrefix, "-color-error)"),
|
|
74
|
-
fontSize: 18,
|
|
75
|
-
margin: '0 3px'
|
|
76
|
-
}
|
|
77
|
-
}), title]
|
|
78
|
-
});
|
|
79
|
-
default:
|
|
80
|
-
return $i18n.get({
|
|
81
|
-
id: 'components.commonComponents.AlertDialog.Prompt',
|
|
82
|
-
dm: '提示'
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var children = props.children,
|
|
87
|
-
_props$type = props.type,
|
|
88
|
-
type = _props$type === void 0 ? 'info' : _props$type,
|
|
89
|
-
_props$danger = props.danger,
|
|
90
|
-
danger = _props$danger === void 0 ? false : _props$danger,
|
|
91
|
-
title = props.title,
|
|
92
|
-
_props$width = props.width,
|
|
93
|
-
width = _props$width === void 0 ? '400px' : _props$width,
|
|
94
|
-
_props$className = props.className,
|
|
95
|
-
className = _props$className === void 0 ? '' : _props$className,
|
|
96
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
|
97
|
-
return {
|
|
98
|
-
width: width,
|
|
99
|
-
transitionName: '',
|
|
100
|
-
restProps: restProps,
|
|
101
|
-
closeIcon: null,
|
|
102
|
-
title: renderTitle({
|
|
103
|
-
type: type,
|
|
104
|
-
title: title
|
|
105
|
-
}),
|
|
106
|
-
okButtonProps: {
|
|
107
|
-
danger: type === 'error' || type === 'warning' || danger
|
|
108
|
-
},
|
|
109
|
-
destroyOnClose: true,
|
|
110
|
-
className: classNames(className, 'animate-in', "".concat(getCommonConfig().sparkPrefix, "-alert-dialog")),
|
|
111
|
-
content: props.content || children,
|
|
112
|
-
children: children
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
var AlertDialog = function AlertDialog(props) {
|
|
116
|
-
var commonProps = getCommonProps(props);
|
|
117
|
-
var Style = useStyle();
|
|
118
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
119
|
-
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
|
|
120
|
-
width: commonProps.width,
|
|
121
|
-
transitionName: ""
|
|
122
|
-
}, commonProps.restProps), {}, {
|
|
123
|
-
closeIcon: null,
|
|
124
|
-
title: commonProps.title,
|
|
125
|
-
okButtonProps: commonProps.okButtonProps || {},
|
|
126
|
-
destroyOnClose: commonProps.destroyOnClose,
|
|
127
|
-
className: commonProps.className,
|
|
128
|
-
children: commonProps.content || commonProps.children
|
|
129
|
-
}))]
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
var staticFns = ['success', 'info', 'warning', 'error', 'confirm'];
|
|
133
|
-
staticFns.forEach(function (type) {
|
|
134
|
-
AlertDialog[type] = function (props) {
|
|
135
|
-
var commonProps = getCommonProps(_objectSpread(_objectSpread({}, props), {}, {
|
|
136
|
-
type: type
|
|
137
|
-
}));
|
|
138
|
-
function Content() {
|
|
139
|
-
var Style = useStyle();
|
|
140
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
141
|
-
children: [/*#__PURE__*/_jsx(Style, {}), commonProps.content]
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// @ts-ignore
|
|
146
|
-
return Modal.confirm(_objectSpread(_objectSpread(_objectSpread({}, commonProps), commonProps.restProps), {}, {
|
|
147
|
-
content: /*#__PURE__*/_jsx(Content, {}),
|
|
148
|
-
icon: null
|
|
149
|
-
}));
|
|
150
|
-
};
|
|
151
|
-
});
|
|
152
|
-
export default AlertDialog;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ModalProps } from 'antd';
|
|
3
|
-
export interface SparkModalProps extends ModalProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 底部额外内容
|
|
6
|
-
* @descriptionEn footer extra content
|
|
7
|
-
*/
|
|
8
|
-
info?: string | React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* @description 是否显示分割线
|
|
11
|
-
* @descriptionEn whether to show divider
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
showDivider?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const SparkModal: {
|
|
17
|
-
(props: SparkModalProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
useModal: typeof import("antd/es/modal/useModal").default;
|
|
19
|
-
success: import("antd/es/modal/confirm").ModalFunc;
|
|
20
|
-
error: import("antd/es/modal/confirm").ModalFunc;
|
|
21
|
-
warning: import("antd/es/modal/confirm").ModalFunc;
|
|
22
|
-
info: import("antd/es/modal/confirm").ModalFunc;
|
|
23
|
-
confirm: import("antd/es/modal/confirm").ModalFunc;
|
|
24
|
-
SMALL_WIDTH: number;
|
|
25
|
-
MEDIUM_WIDTH: number;
|
|
26
|
-
LARGE_WIDTH: number;
|
|
27
|
-
};
|
|
28
|
-
export default SparkModal;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ModalProps } from 'antd';
|
|
3
|
-
export interface SparkModalProps extends ModalProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 底部额外内容
|
|
6
|
-
* @descriptionEn footer extra content
|
|
7
|
-
*/
|
|
8
|
-
info?: string | React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* @description 是否显示分割线
|
|
11
|
-
* @descriptionEn whether to show divider
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
showDivider?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const SparkModal: {
|
|
17
|
-
(props: SparkModalProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
useModal: typeof import("antd/es/modal/useModal").default;
|
|
19
|
-
success: import("antd/es/modal/confirm").ModalFunc;
|
|
20
|
-
error: import("antd/es/modal/confirm").ModalFunc;
|
|
21
|
-
warning: import("antd/es/modal/confirm").ModalFunc;
|
|
22
|
-
info: import("antd/es/modal/confirm").ModalFunc;
|
|
23
|
-
confirm: import("antd/es/modal/confirm").ModalFunc;
|
|
24
|
-
SMALL_WIDTH: number;
|
|
25
|
-
MEDIUM_WIDTH: number;
|
|
26
|
-
LARGE_WIDTH: number;
|
|
27
|
-
};
|
|
28
|
-
export default SparkModal;
|