@definable/ui 0.1.30 → 0.1.32
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/dist/components/alert.js +10 -10
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +11 -10
- package/dist/components/button.js +56 -47
- package/dist/components/card.js +24 -24
- package/dist/components/command-menu.js +14 -14
- package/dist/components/command.d.ts +7 -7
- package/dist/components/command.js +5 -5
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropzone.js +3 -3
- package/dist/components/image-cropper-modal.js +33 -33
- package/dist/components/image-cropper.js +35 -35
- package/dist/components/input.js +1 -1
- package/dist/components/loader.js +1 -1
- package/dist/components/modal.js +28 -28
- package/dist/components/picker.js +2 -2
- package/dist/components/select.js +4 -4
- package/dist/components/selection-bar.js +1 -1
- package/dist/components/sheet.js +28 -28
- package/dist/components/slider.js +5 -5
- package/dist/components/switch.js +1 -1
- package/dist/components/table-mobile.js +37 -37
- package/dist/components/table.js +32 -32
- package/dist/components/tabs.js +1 -1
- package/dist/components/textarea.js +6 -6
- package/dist/components/tooltip.js +5 -5
- package/dist/components/use-toast.js +3 -3
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-slider";
|
|
4
4
|
import { cn as n } from "../lib/utils.js";
|
|
5
|
-
const c = t.forwardRef(({ className: l, ...o },
|
|
5
|
+
const c = t.forwardRef(({ className: l, ...o }, s) => {
|
|
6
6
|
var i;
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
8
8
|
e.Root,
|
|
9
9
|
{
|
|
10
|
-
ref:
|
|
10
|
+
ref: s,
|
|
11
11
|
className: n(
|
|
12
12
|
"relative flex w-full touch-none select-none items-center",
|
|
13
13
|
l
|
|
@@ -21,7 +21,7 @@ const c = t.forwardRef(({ className: l, ...o }, a) => {
|
|
|
21
21
|
style: { width: `${(((i = o.value) == null ? void 0 : i[0]) || 0) * 100}%` }
|
|
22
22
|
}
|
|
23
23
|
) }),
|
|
24
|
-
/* @__PURE__ */ r(e.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-
|
|
24
|
+
/* @__PURE__ */ r(e.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-secondary shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:scale-110 active:scale-90" })
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
);
|
|
@@ -15,7 +15,7 @@ const c = t.forwardRef(({ className: r, ...o }, s) => /* @__PURE__ */ i(
|
|
|
15
15
|
children: /* @__PURE__ */ i(e.Thumb, { asChild: !0, children: /* @__PURE__ */ i(
|
|
16
16
|
n.div,
|
|
17
17
|
{
|
|
18
|
-
className: "block h-4 w-4 rounded-full bg-
|
|
18
|
+
className: "block h-4 w-4 rounded-full bg-secondary shadow-lg ring-0",
|
|
19
19
|
initial: !1,
|
|
20
20
|
animate: {
|
|
21
21
|
x: o.checked ? 16 : 0
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Checkbox as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { useState as
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { cn as p } from "../lib/utils.js";
|
|
3
|
+
import { Checkbox as g } from "./checkbox.js";
|
|
4
|
+
import { Tooltip as v } from "./tooltip.js";
|
|
5
|
+
import { useState as b } from "react";
|
|
6
6
|
import { ChevronRight as x } from "lucide-react";
|
|
7
7
|
function V({
|
|
8
8
|
data: n,
|
|
@@ -11,67 +11,67 @@ function V({
|
|
|
11
11
|
onRowClick: t,
|
|
12
12
|
selectedItems: i,
|
|
13
13
|
onSelect: l,
|
|
14
|
-
isLoading:
|
|
14
|
+
isLoading: c = !1,
|
|
15
15
|
loadingRows: u = 3
|
|
16
16
|
}) {
|
|
17
|
-
const [f,
|
|
18
|
-
return
|
|
17
|
+
const [f, h] = b(null);
|
|
18
|
+
return c ? /* @__PURE__ */ e("div", { className: "space-y-4", children: Array(u).fill(0).map((a, s) => /* @__PURE__ */ d(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
|
-
className: "border border-
|
|
21
|
+
className: "border border-light rounded-xl p-4 space-y-4 shadow-sm bg-card animate-pulse",
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
m && /* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ e("div", { className: "h-5 bg-muted/70 rounded-md w-2/5" }),
|
|
25
|
+
m && /* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-md bg-muted/50" })
|
|
26
26
|
] }),
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
] }, `skeleton-col-${
|
|
27
|
+
/* @__PURE__ */ e("div", { className: "space-y-3 pt-2", children: o.slice(0, 4).map((r, N) => /* @__PURE__ */ d("div", { className: "flex items-start gap-3", children: [
|
|
28
|
+
/* @__PURE__ */ e("div", { className: "h-4 bg-muted/40 rounded-md w-1/4" }),
|
|
29
|
+
/* @__PURE__ */ e("div", { className: "h-4 bg-muted/60 rounded-md", style: { width: Math.random() * 50 + 30 + "%" } })
|
|
30
|
+
] }, `skeleton-col-${r.id}`)) })
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
33
|
`skeleton-${s}`
|
|
34
|
-
)) }) : n.length === 0 ? null : /* @__PURE__ */
|
|
34
|
+
)) }) : n.length === 0 ? null : /* @__PURE__ */ e("div", { className: "space-y-4", children: n.map((a, s) => /* @__PURE__ */ d(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
38
|
-
"border border-
|
|
39
|
-
t && "cursor-pointer hover:border-primary/30 hover:shadow-md hover:bg-card
|
|
37
|
+
className: p(
|
|
38
|
+
"border border-light/40 rounded-xl overflow-hidden bg-card shadow-sm transition-all duration-200",
|
|
39
|
+
t && "cursor-pointer hover:border-primary/30 hover:shadow-md hover:bg-card"
|
|
40
40
|
),
|
|
41
41
|
onClick: () => t == null ? void 0 : t(a),
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */ d("div", { className: "flex items-center justify-between p-4 border-b border-
|
|
44
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between p-4 border-b border-light bg-muted/5", children: [
|
|
44
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: o[0].cell(a) || `Item ${s + 1}` }),
|
|
45
45
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
46
|
-
m && /* @__PURE__ */
|
|
47
|
-
|
|
46
|
+
m && /* @__PURE__ */ e(
|
|
47
|
+
g,
|
|
48
48
|
{
|
|
49
49
|
checked: i == null ? void 0 : i.has(a.id),
|
|
50
|
-
onClick: (
|
|
51
|
-
|
|
50
|
+
onClick: (r) => {
|
|
51
|
+
r.stopPropagation(), l == null || l(a.id, !(i != null && i.has(a.id)));
|
|
52
52
|
},
|
|
53
53
|
className: "data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
t && /* @__PURE__ */
|
|
56
|
+
t && /* @__PURE__ */ e(x, { className: "h-4 w-4 text-muted-foreground/50" })
|
|
57
57
|
] })
|
|
58
58
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-3", children: o.slice(1).map((r) => /* @__PURE__ */ d(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
62
|
className: "flex items-start gap-3 text-sm group",
|
|
63
|
-
onMouseEnter: () =>
|
|
64
|
-
onMouseLeave: () =>
|
|
63
|
+
onMouseEnter: () => r.tooltipValue && h(`${s}-${r.id}`),
|
|
64
|
+
onMouseLeave: () => h(null),
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ e("div", { className: "font-medium text-muted-foreground w-1/3 min-w-[80px] text-xs uppercase tracking-wide pt-0.5", children: r.header }),
|
|
67
|
+
/* @__PURE__ */ e("div", { className: p(
|
|
68
68
|
"flex-1 min-w-0 text-foreground/90 group-hover:text-foreground transition-colors",
|
|
69
|
-
|
|
70
|
-
), children:
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
r.truncate && "truncate"
|
|
70
|
+
), children: r.cell(a) }),
|
|
71
|
+
r.tooltipValue && f === `${s}-${r.id}` && /* @__PURE__ */ e(
|
|
72
|
+
v,
|
|
73
73
|
{
|
|
74
|
-
content:
|
|
74
|
+
content: r.tooltipValue(a),
|
|
75
75
|
side: "bottom",
|
|
76
76
|
align: "start",
|
|
77
77
|
isVisible: !0
|
|
@@ -79,7 +79,7 @@ function V({
|
|
|
79
79
|
)
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
|
|
82
|
+
r.id
|
|
83
83
|
)) })
|
|
84
84
|
]
|
|
85
85
|
},
|
package/dist/components/table.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { cn as d } from "../lib/utils.js";
|
|
3
|
-
import { Checkbox as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { TableEmpty as
|
|
7
|
-
const u = ({ children: t, className:
|
|
3
|
+
import { Checkbox as N } from "./checkbox.js";
|
|
4
|
+
import { Tooltip as w } from "./tooltip.js";
|
|
5
|
+
import { useState as z } from "react";
|
|
6
|
+
import { TableEmpty as V } from "./table-empty.js";
|
|
7
|
+
const u = ({ children: t, className: l }) => /* @__PURE__ */ r("div", { className: d("border border-light rounded-lg overflow-hidden bg-secondary shadow-sm", l), children: t });
|
|
8
8
|
function q({
|
|
9
9
|
data: t,
|
|
10
|
-
columns:
|
|
10
|
+
columns: l,
|
|
11
11
|
showCheckbox: s = !0,
|
|
12
12
|
onRowClick: c,
|
|
13
13
|
className: v,
|
|
14
14
|
selectedItems: a,
|
|
15
15
|
onSelect: o,
|
|
16
|
-
emptyState:
|
|
17
|
-
isLoading:
|
|
16
|
+
emptyState: x,
|
|
17
|
+
isLoading: b = !1,
|
|
18
18
|
loadingRows: T = 5,
|
|
19
19
|
tableHeightOffset: f
|
|
20
20
|
}) {
|
|
21
|
-
const [j,
|
|
21
|
+
const [j, g] = z(null), m = { height: f ? `calc(100vh - ${f})` : "calc(100vh - 8rem)" }, p = [
|
|
22
22
|
s ? "40px" : null,
|
|
23
|
-
...
|
|
23
|
+
...l.map((i) => i.width || "1fr")
|
|
24
24
|
].filter(Boolean).join(" "), $ = () => /* @__PURE__ */ r(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
27
|
className: d("divide-y divide-border/50 overflow-y-auto"),
|
|
28
|
-
style:
|
|
29
|
-
children: Array(T).fill(0).map((i, h) => /* @__PURE__ */
|
|
28
|
+
style: m,
|
|
29
|
+
children: Array(T).fill(0).map((i, h) => /* @__PURE__ */ n(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
className: "grid items-center px-6 py-4 text-sm",
|
|
33
33
|
style: { gridTemplateColumns: p },
|
|
34
34
|
children: [
|
|
35
35
|
s && /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "h-4 w-4 rounded bg-muted animate-pulse" }) }),
|
|
36
|
-
|
|
36
|
+
l.map((e) => /* @__PURE__ */ r(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
39
|
className: d("px-2 relative min-w-0", e.className),
|
|
@@ -53,44 +53,44 @@ function q({
|
|
|
53
53
|
))
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
return
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
return b ? /* @__PURE__ */ r(u, { className: v, children: /* @__PURE__ */ n("div", { className: "relative bg-card", children: [
|
|
57
|
+
/* @__PURE__ */ n(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
className: d(
|
|
61
|
-
"grid items-center px-6 py-3 text-xs font-medium text-muted-foreground/80 bg-muted/30 border-b border-
|
|
61
|
+
"grid items-center px-6 py-3 text-xs font-medium text-muted-foreground/80 bg-muted/30 border-b border-light sticky top-0 z-10"
|
|
62
62
|
),
|
|
63
63
|
style: { gridTemplateColumns: p },
|
|
64
64
|
children: [
|
|
65
65
|
s && /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "h-4 w-4 rounded bg-muted animate-pulse" }) }),
|
|
66
|
-
|
|
66
|
+
l.map((i) => /* @__PURE__ */ r("div", { className: d("px-2 font-medium", i.className), children: i.header }, i.id))
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ r($, {})
|
|
71
|
-
] }) }) : t.length === 0 ? /* @__PURE__ */ r(u, { className: v, children: /* @__PURE__ */ r("div", { className: "relative bg-card", children: /* @__PURE__ */ r(
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
] }) }) : t.length === 0 ? /* @__PURE__ */ r(u, { className: v, children: /* @__PURE__ */ r("div", { className: "relative bg-card", children: /* @__PURE__ */ r(V, { ...x }) }) }) : /* @__PURE__ */ r(u, { className: v, children: /* @__PURE__ */ n("div", { className: "relative bg-card", children: [
|
|
72
|
+
/* @__PURE__ */ n(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
className: d(
|
|
76
|
-
"grid items-center px-6 py-3 text-xs font-medium text-muted-foreground/80 bg-muted/30 border-b border-
|
|
76
|
+
"grid items-center px-6 py-3 text-xs font-medium text-muted-foreground/80 bg-muted/30 border-b border-light sticky top-0 z-10"
|
|
77
77
|
),
|
|
78
78
|
style: { gridTemplateColumns: p },
|
|
79
79
|
children: [
|
|
80
80
|
s && /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
81
|
-
|
|
81
|
+
N,
|
|
82
82
|
{
|
|
83
83
|
checked: t.length > 0 && (a == null ? void 0 : a.size) === t.length,
|
|
84
84
|
onClick: (i) => {
|
|
85
85
|
i.stopPropagation();
|
|
86
86
|
const e = !((a == null ? void 0 : a.size) === t.length);
|
|
87
|
-
t.forEach((
|
|
88
|
-
(a == null ? void 0 : a.has(
|
|
87
|
+
t.forEach((y) => {
|
|
88
|
+
(a == null ? void 0 : a.has(y.id)) !== e && (o == null || o(y.id, e));
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
) }),
|
|
93
|
-
|
|
93
|
+
l.map((i) => /* @__PURE__ */ r("div", { className: d("px-2 font-medium", i.className), children: i.header }, i.id))
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
),
|
|
@@ -98,8 +98,8 @@ function q({
|
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
100
|
className: d("divide-y divide-border/30 overflow-y-auto"),
|
|
101
|
-
style:
|
|
102
|
-
children: t.map((i, h) => /* @__PURE__ */
|
|
101
|
+
style: m,
|
|
102
|
+
children: t.map((i, h) => /* @__PURE__ */ n(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
className: d(
|
|
@@ -109,7 +109,7 @@ function q({
|
|
|
109
109
|
onClick: () => c == null ? void 0 : c(i),
|
|
110
110
|
children: [
|
|
111
111
|
s && /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
112
|
-
|
|
112
|
+
N,
|
|
113
113
|
{
|
|
114
114
|
checked: a == null ? void 0 : a.has(i.id),
|
|
115
115
|
onClick: (e) => {
|
|
@@ -117,15 +117,15 @@ function q({
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
) }),
|
|
120
|
-
|
|
120
|
+
l.map((e) => /* @__PURE__ */ n(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
123
|
className: d(
|
|
124
124
|
"px-2 relative min-w-0",
|
|
125
125
|
e.className
|
|
126
126
|
),
|
|
127
|
-
onMouseEnter: () => e.tooltipValue &&
|
|
128
|
-
onMouseLeave: () =>
|
|
127
|
+
onMouseEnter: () => e.tooltipValue && g(`${h}-${e.id}`),
|
|
128
|
+
onMouseLeave: () => g(null),
|
|
129
129
|
children: [
|
|
130
130
|
/* @__PURE__ */ r("div", { className: d(
|
|
131
131
|
"flex items-center gap-2",
|
|
@@ -135,7 +135,7 @@ function q({
|
|
|
135
135
|
e.truncate && "truncate"
|
|
136
136
|
), children: e.cell(i) }) }),
|
|
137
137
|
e.tooltipValue && j === `${h}-${e.id}` && /* @__PURE__ */ r(
|
|
138
|
-
|
|
138
|
+
w,
|
|
139
139
|
{
|
|
140
140
|
content: e.tooltipValue(i),
|
|
141
141
|
side: "bottom",
|
package/dist/components/tabs.js
CHANGED
|
@@ -19,7 +19,7 @@ const f = a.forwardRef(({ className: i, ...t }, s) => /* @__PURE__ */ o(
|
|
|
19
19
|
{
|
|
20
20
|
ref: s,
|
|
21
21
|
className: n(
|
|
22
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-
|
|
22
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-secondary data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
23
23
|
i
|
|
24
24
|
),
|
|
25
25
|
...t
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
3
|
+
import { cn as s } from "../lib/utils.js";
|
|
4
|
+
const a = t.forwardRef(
|
|
5
5
|
({ className: e, ...r }, o) => /* @__PURE__ */ i(
|
|
6
6
|
"textarea",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
9
|
-
"flex min-h-[80px] w-full rounded-md border border-input bg-
|
|
8
|
+
className: s(
|
|
9
|
+
"flex min-h-[80px] w-full rounded-md border border-input bg-secondary px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
10
10
|
e
|
|
11
11
|
),
|
|
12
12
|
ref: o,
|
|
@@ -14,7 +14,7 @@ const s = t.forwardRef(
|
|
|
14
14
|
}
|
|
15
15
|
)
|
|
16
16
|
);
|
|
17
|
-
|
|
17
|
+
a.displayName = "Textarea";
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
a as Textarea
|
|
20
20
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { AnimatePresence as n, motion as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { AnimatePresence as n, motion as i } from "framer-motion";
|
|
3
|
+
import { cn as c } from "../lib/utils.js";
|
|
4
4
|
function b({ content: t, side: o = "right", align: e = "center", isVisible: s }) {
|
|
5
5
|
return /* @__PURE__ */ r(n, { children: s && /* @__PURE__ */ r(
|
|
6
|
-
|
|
6
|
+
i.div,
|
|
7
7
|
{
|
|
8
8
|
initial: {
|
|
9
9
|
opacity: 0,
|
|
@@ -19,9 +19,9 @@ function b({ content: t, side: o = "right", align: e = "center", isVisible: s })
|
|
|
19
19
|
...a(o)
|
|
20
20
|
},
|
|
21
21
|
transition: { duration: 0.15, ease: "easeOut" },
|
|
22
|
-
className:
|
|
22
|
+
className: c(
|
|
23
23
|
"absolute z-[100] px-2.5 py-1.5 rounded-md text-xs font-medium whitespace-nowrap",
|
|
24
|
-
"bg-
|
|
24
|
+
"bg-secondary border border-light shadow-lg",
|
|
25
25
|
l(o, e)
|
|
26
26
|
),
|
|
27
27
|
children: t
|
|
@@ -33,12 +33,12 @@ const d = () => {
|
|
|
33
33
|
s = s.filter((n) => n.id !== r), d();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
},
|
|
36
|
+
}, b = () => {
|
|
37
37
|
const { toasts: t, dismiss: i } = g();
|
|
38
38
|
return t.length === 0 ? null : /* @__PURE__ */ o("div", { className: "fixed top-4 right-4 z-50 flex flex-col gap-2 w-[350px]", children: t.map((e) => /* @__PURE__ */ c(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
|
-
className: `p-4 rounded-lg shadow-lg border border-
|
|
41
|
+
className: `p-4 rounded-lg shadow-lg border border-light transition-all duration-300 ease-in-out ${e.type === "error" ? "bg-destructive text-destructive-foreground" : e.type === "success" ? "bg-green-50 text-green-800 border-green-200" : e.type === "warning" ? "bg-amber-50 text-amber-800 border-amber-200" : "bg-secondary text-foreground"}`,
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ c("div", { className: "flex justify-between items-start", children: [
|
|
44
44
|
/* @__PURE__ */ o("div", { className: "font-medium", children: e.title }),
|
|
@@ -58,7 +58,7 @@ const d = () => {
|
|
|
58
58
|
)) });
|
|
59
59
|
};
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
b as ToastContainer,
|
|
62
62
|
m as toast,
|
|
63
63
|
g as useToast
|
|
64
64
|
};
|