@agentscope-ai/design 1.0.30 → 1.0.31-beta.1773057761141

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.
@@ -78,7 +78,6 @@ token, darkMode) {
78
78
  lineHeight: '20px'
79
79
  },
80
80
  Badge: {
81
- colorError: token.colorPrimary,
82
81
  indicatorHeight: 16,
83
82
  textFontSize: 10
84
83
  },
@@ -1,21 +1,29 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
7
  import { Button, notification } from "../../../..";
2
8
  import React from 'react';
3
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
4
12
  var App = function App() {
5
- return /*#__PURE__*/_jsx(Button, {
6
- onClick: function onClick() {
7
- return notification.success({
8
- message: 'title',
9
- description: 'content',
10
- actions: /*#__PURE__*/_jsx(Button, {
11
- onClick: function onClick() {
12
- return alert('click next');
13
- },
14
- children: "Next"
15
- })
16
- });
17
- },
18
- children: "Open"
13
+ var _notification$useNoti = notification.useNotification(),
14
+ _notification$useNoti2 = _slicedToArray(_notification$useNoti, 2),
15
+ api = _notification$useNoti2[0],
16
+ contextHolder = _notification$useNoti2[1];
17
+ return /*#__PURE__*/_jsxs(_Fragment, {
18
+ children: [/*#__PURE__*/_jsx(Button, {
19
+ onClick: function onClick() {
20
+ return api.success({
21
+ message: 'title',
22
+ description: 'using useNotification hooks'
23
+ });
24
+ },
25
+ children: "Open"
26
+ }), contextHolder]
19
27
  });
20
28
  };
21
29
  export default App;
@@ -82,7 +82,7 @@ sparkNotification.useNotification = function (props) {
82
82
  var commonConfig = getCommonConfig();
83
83
  var sparkPrefix = commonConfig.sparkPrefix,
84
84
  antPrefix = commonConfig.antPrefix;
85
- var mergedClassName = "".concat(sparkPrefix, "-notification");
85
+ var baseClassName = "".concat(sparkPrefix, "-notification");
86
86
  var _notification$useNoti = notification.useNotification(props),
87
87
  _notification$useNoti2 = _slicedToArray(_notification$useNoti, 2),
88
88
  api = _notification$useNoti2[0],
@@ -92,14 +92,14 @@ sparkNotification.useNotification = function (props) {
92
92
  types.forEach(function (type) {
93
93
  newAPi[type] = function (props) {
94
94
  return api[type](_objectSpread(_objectSpread({}, props), {}, {
95
- className: mergedClassName,
95
+ className: props.className ? "".concat(baseClassName, " ").concat(props.className) : baseClassName,
96
96
  icon: getIcon(type, antPrefix)
97
97
  }));
98
98
  };
99
99
  });
100
100
  newAPi.open = function (props) {
101
- notification.open(_objectSpread(_objectSpread({}, props), {}, {
102
- className: mergedClassName
101
+ api.open(_objectSpread(_objectSpread({}, props), {}, {
102
+ className: props.className ? "".concat(baseClassName, " ").concat(props.className) : baseClassName
103
103
  }));
104
104
  };
105
105
  newAPi.destroy = api.destroy;