@npm_leadtech/legal-contracts-ui 0.93.6 → 0.93.7

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.
@@ -1,6 +1,6 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
 
3
- export declare const Toast: ({ show, title, message, type, onClose, duration }: ToastProps) => JSX.Element | undefined;
3
+ export declare const Toast: ({ show, title, message, type, onClose, duration }: ToastProps) => JSX.Element | null;
4
4
 
5
5
  export declare interface ToastProps {
6
6
  show: boolean;
@@ -1,11 +1,11 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { useEffect as a } from "react";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { useEffect as h } from "react";
3
3
  import { InfoIcon as c } from "./InfoIcon.js";
4
- import { DoneCircleIcon as f } from "./DoneCircleIcon.js";
4
+ import { DoneCircleIcon as a } from "./DoneCircleIcon.js";
5
5
  import { CloseIcon as d } from "./CloseIcon.js";
6
6
  const g = {
7
7
  success: {
8
- icon: /* @__PURE__ */ e(f, { fill: "white", width: 24, height: 24 }),
8
+ icon: /* @__PURE__ */ e(a, { fill: "white", width: 24, height: 24 }),
9
9
  bg: "bg-primary-500"
10
10
  },
11
11
  error: {
@@ -16,31 +16,31 @@ const g = {
16
16
  icon: /* @__PURE__ */ e(c, { fill: "white", width: 24, height: 24 }),
17
17
  bg: "bg-neutral-500"
18
18
  }
19
- }, N = ({ show: l, title: n, message: s, type: h = "default", onClose: i, duration: t = 3e3 }) => {
20
- a(() => {
21
- const m = setTimeout(() => {
22
- i();
23
- }, t);
19
+ }, N = ({ show: i, title: n, message: s, type: m = "default", onClose: t, duration: r = 3e3 }) => {
20
+ h(() => {
21
+ if (!i) return;
22
+ const f = setTimeout(() => {
23
+ t();
24
+ }, r);
24
25
  return () => {
25
- clearTimeout(m);
26
+ clearTimeout(f);
26
27
  };
27
- }, [i, t]);
28
- const r = g[h];
29
- if (l)
30
- return /* @__PURE__ */ o(
31
- "div",
32
- {
33
- className: `animate-slide-in fixed top-5 right-5 z-9999 flex min-w-75 items-center gap-4 rounded px-4 py-2 shadow-lg ${r.bg}`,
34
- children: [
35
- /* @__PURE__ */ e("div", { className: "shrink-0", children: r.icon }),
36
- /* @__PURE__ */ o("div", { className: "flex grow flex-col text-sm text-white", children: [
37
- /* @__PURE__ */ e("p", { className: "font-bold", children: n }),
38
- /* @__PURE__ */ e("p", { children: s })
39
- ] }),
40
- /* @__PURE__ */ e("button", { onClick: i, className: "cursor-pointer", children: /* @__PURE__ */ e(d, { fill: "white", className: "h-4 w-4" }) })
41
- ]
42
- }
43
- );
28
+ }, [i, t, r]);
29
+ const o = g[m];
30
+ return i ? /* @__PURE__ */ l(
31
+ "div",
32
+ {
33
+ className: `animate-slide-in fixed top-5 right-5 z-9999 flex min-w-75 items-center gap-4 rounded px-4 py-2 shadow-lg ${o.bg}`,
34
+ children: [
35
+ /* @__PURE__ */ e("div", { className: "shrink-0", children: o.icon }),
36
+ /* @__PURE__ */ l("div", { className: "flex grow flex-col text-sm text-white", children: [
37
+ /* @__PURE__ */ e("p", { className: "font-bold", children: n }),
38
+ /* @__PURE__ */ e("p", { children: s })
39
+ ] }),
40
+ /* @__PURE__ */ e("button", { onClick: t, className: "cursor-pointer", children: /* @__PURE__ */ e(d, { fill: "white", className: "h-4 w-4" }) })
41
+ ]
42
+ }
43
+ ) : null;
44
44
  };
45
45
  export {
46
46
  N as Toast
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-contracts-ui",
3
- "version": "0.93.6",
3
+ "version": "0.93.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",