@particle-network/ui-react 0.3.0-beta.10 → 0.3.0-beta.12

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.
@@ -8,7 +8,7 @@ export interface UXSpinnerProps extends SquareProps {
8
8
  color?: UXForegroundColor | 'currentColor';
9
9
  /**
10
10
  * 动画持续时间(毫秒)
11
- * @default 1000
11
+ * @default 500
12
12
  */
13
13
  duration?: number;
14
14
  }
@@ -4,7 +4,7 @@ import { cn } from "@heroui/theme";
4
4
  import { colorToClassName } from "@particle-network/ui-shared";
5
5
  import { Square } from "../layout/index.js";
6
6
  import { SpinnerIcon } from "./SpinnerIcon.js";
7
- const UXSpinner = ({ size = 18, color = 'primary', duration = 1000, className, style, ...restProps })=>{
7
+ const UXSpinner = ({ size = 18, color = 'primary', duration = 500, className, style, ...restProps })=>{
8
8
  const [currentIndex, setCurrentIndex] = useState(0);
9
9
  const animationRef = useRef(null);
10
10
  const iconClassName = 'currentColor' === color ? void 0 : colorToClassName[color];
@@ -4,7 +4,7 @@ export type UXToastProps = Partial<ToastProps> & {
4
4
  type: UXToastType;
5
5
  };
6
6
  export declare const UXToastProvider: () => import("react/jsx-runtime").JSX.Element;
7
- export declare const UXToast: {
7
+ export declare const toast: {
8
8
  success: (message: string, props?: Partial<ToastProps>) => string | null;
9
9
  error: (message: string, props?: Partial<ToastProps>) => string | null;
10
10
  loading: (message: string, props?: Partial<ToastProps>) => string | null;
@@ -12,5 +12,5 @@ export declare const UXToast: {
12
12
  type: UXToastType;
13
13
  }) => string | null;
14
14
  closeAll: () => void;
15
- closeToast: (key: string) => void;
15
+ close: (key: string) => void;
16
16
  };
@@ -5,11 +5,12 @@ import CircleCloseIcon from "@particle-network/icons/web/CircleCloseIcon";
5
5
  import CloseIcon from "@particle-network/icons/web/CloseIcon";
6
6
  import { UXSpinner } from "../UXSpinner/index.js";
7
7
  const UXToastProvider = ()=>/*#__PURE__*/ jsx(ToastProvider, {
8
+ disableAnimation: true,
8
9
  placement: "top-center",
9
- maxVisibleToasts: 5,
10
+ maxVisibleToasts: 4,
10
11
  toastOffset: 40,
11
12
  toastProps: {
12
- timeout: 4000
13
+ timeout: 3000
13
14
  }
14
15
  });
15
16
  const getIcon = (type)=>{
@@ -29,7 +30,7 @@ const show = (props)=>{
29
30
  return addToast({
30
31
  classNames: {
31
32
  base: [
32
- 'bg-tertiary rounded-xl px-3.5 py-3 shadow-none !w-fit max-w-[350px]',
33
+ 'bg-tertiary rounded-xl px-3.5 py-3 shadow-none border-none !w-fit max-w-[350px]',
33
34
  !hideCloseButton && 'pr-12',
34
35
  'flat' === variant && 'success' === type && 'bg-[#0E3728]',
35
36
  'flat' === variant && 'error' === type && 'bg-[#501D1D]'
@@ -63,11 +64,11 @@ const show = (props)=>{
63
64
  loadingComponent: /*#__PURE__*/ jsx(UXSpinner, {
64
65
  size: 18
65
66
  }),
66
- timeout: 'loading' === type ? 1 / 0 : 4000,
67
+ timeout: 'loading' === type ? 1 / 0 : 3000,
67
68
  ...toastProps
68
69
  });
69
70
  };
70
- const UXToast = {
71
+ const toast = {
71
72
  success: (message, props)=>show({
72
73
  type: 'success',
73
74
  description: message,
@@ -86,6 +87,6 @@ const UXToast = {
86
87
  }),
87
88
  show,
88
89
  closeAll: closeAll,
89
- closeToast: closeToast
90
+ close: closeToast
90
91
  };
91
- export { UXToast, UXToastProvider };
92
+ export { UXToastProvider, toast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-react",
3
- "version": "0.3.0-beta.10",
3
+ "version": "0.3.0-beta.12",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -48,8 +48,8 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "ahooks": "^3.9.4",
51
- "@particle-network/icons": "0.3.0-beta.6",
52
- "@particle-network/ui-shared": "0.2.0-beta.3"
51
+ "@particle-network/ui-shared": "0.2.0-beta.3",
52
+ "@particle-network/icons": "0.3.0-beta.6"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "rslib build",