@la-batcave/ui 3.5.0 → 4.0.0
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/Alert.d.ts +17 -7
- package/dist/Alert.js +31 -28
- package/dist/Button.js +27 -24
- package/dist/Card.d.ts +2 -6
- package/dist/Card.js +35 -58
- package/dist/CodeBlock.js +2 -2
- package/dist/Collapse.js +8 -8
- package/dist/Combobox.js +51 -51
- package/dist/DarkMode.js +11 -11
- package/dist/DatePicker.d.ts +5 -17
- package/dist/DatePicker.js +221 -205
- package/dist/Dialog.js +65 -65
- package/dist/Drawer.js +1 -1
- package/dist/Dropdown.js +10 -10
- package/dist/HoverCard.js +13 -13
- package/dist/Input.js +633 -626
- package/dist/LogViewer.js +1 -1
- package/dist/Menubar.js +25 -25
- package/dist/Pagination.js +17 -17
- package/dist/Popover.js +4 -4
- package/dist/Resizable.js +1 -1
- package/dist/Sheet.d.ts +1 -1
- package/dist/Sheet.js +21 -21
- package/dist/Sidebar.d.ts +39 -1
- package/dist/Sidebar.js +101 -63
- package/dist/Skeleton.js +9 -9
- package/dist/Table.js +31 -31
- package/dist/Tabs.d.ts +15 -11
- package/dist/Tabs.js +134 -125
- package/dist/Toast.js +35 -34
- package/dist/Tooltip.js +1 -1
- package/dist/Typography.js +9 -9
- package/dist/Widget.js +77 -81
- package/dist/index.css +1 -1
- package/package.json +3 -2
package/dist/Tabs.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as w, R as V, I as D, c as
|
|
6
|
-
import { P as
|
|
2
|
+
import { jsx as s, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import * as b from "react";
|
|
4
|
+
import { u as S, c as x, a as E, P as F } from "./_shared/index-CXeb1OMI.js";
|
|
5
|
+
import { u as w, R as V, I as D, c as T } from "./_shared/index-C0gNQvxa.js";
|
|
6
|
+
import { P as v } from "./_shared/index-V-Ajw7Ac.js";
|
|
7
7
|
import { u as G } from "./_shared/index-BC7vfx-u.js";
|
|
8
|
-
import { c as
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
]), C =
|
|
12
|
-
(
|
|
8
|
+
import { c as f } from "./_shared/utils-eGXXUFl7.js";
|
|
9
|
+
var m = "Tabs", [$] = E(m, [
|
|
10
|
+
T
|
|
11
|
+
]), C = T(), [L, h] = $(m), I = b.forwardRef(
|
|
12
|
+
(o, n) => {
|
|
13
13
|
const {
|
|
14
|
-
__scopeTabs:
|
|
15
|
-
value:
|
|
16
|
-
onValueChange:
|
|
17
|
-
defaultValue:
|
|
18
|
-
orientation:
|
|
14
|
+
__scopeTabs: i,
|
|
15
|
+
value: e,
|
|
16
|
+
onValueChange: r,
|
|
17
|
+
defaultValue: a,
|
|
18
|
+
orientation: t = "horizontal",
|
|
19
19
|
dir: u,
|
|
20
|
-
activationMode:
|
|
21
|
-
...
|
|
22
|
-
} =
|
|
23
|
-
prop:
|
|
24
|
-
onChange:
|
|
25
|
-
defaultProp:
|
|
26
|
-
caller:
|
|
20
|
+
activationMode: p = "automatic",
|
|
21
|
+
...g
|
|
22
|
+
} = o, l = w(u), [c, d] = S({
|
|
23
|
+
prop: e,
|
|
24
|
+
onChange: r,
|
|
25
|
+
defaultProp: a ?? "",
|
|
26
|
+
caller: m
|
|
27
27
|
});
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ s(
|
|
29
29
|
L,
|
|
30
30
|
{
|
|
31
|
-
scope:
|
|
31
|
+
scope: i,
|
|
32
32
|
baseId: G(),
|
|
33
|
-
value:
|
|
33
|
+
value: c,
|
|
34
34
|
onValueChange: d,
|
|
35
|
-
orientation:
|
|
36
|
-
dir:
|
|
37
|
-
activationMode:
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
|
|
35
|
+
orientation: t,
|
|
36
|
+
dir: l,
|
|
37
|
+
activationMode: p,
|
|
38
|
+
children: /* @__PURE__ */ s(
|
|
39
|
+
v.div,
|
|
40
40
|
{
|
|
41
|
-
dir:
|
|
42
|
-
"data-orientation":
|
|
43
|
-
...
|
|
44
|
-
ref:
|
|
41
|
+
dir: l,
|
|
42
|
+
"data-orientation": t,
|
|
43
|
+
...g,
|
|
44
|
+
ref: n
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
-
I.displayName =
|
|
52
|
-
var N = "TabsList", R =
|
|
53
|
-
(
|
|
54
|
-
const { __scopeTabs:
|
|
55
|
-
return /* @__PURE__ */
|
|
51
|
+
I.displayName = m;
|
|
52
|
+
var N = "TabsList", R = b.forwardRef(
|
|
53
|
+
(o, n) => {
|
|
54
|
+
const { __scopeTabs: i, loop: e = !0, ...r } = o, a = h(N, i), t = C(i);
|
|
55
|
+
return /* @__PURE__ */ s(
|
|
56
56
|
V,
|
|
57
57
|
{
|
|
58
58
|
asChild: !0,
|
|
59
|
-
...
|
|
60
|
-
orientation:
|
|
61
|
-
dir:
|
|
62
|
-
loop:
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
|
|
59
|
+
...t,
|
|
60
|
+
orientation: a.orientation,
|
|
61
|
+
dir: a.dir,
|
|
62
|
+
loop: e,
|
|
63
|
+
children: /* @__PURE__ */ s(
|
|
64
|
+
v.div,
|
|
65
65
|
{
|
|
66
66
|
role: "tablist",
|
|
67
|
-
"aria-orientation":
|
|
68
|
-
...
|
|
69
|
-
ref:
|
|
67
|
+
"aria-orientation": a.orientation,
|
|
68
|
+
...r,
|
|
69
|
+
ref: n
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
}
|
|
@@ -74,38 +74,38 @@ var N = "TabsList", R = f.forwardRef(
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
R.displayName = N;
|
|
77
|
-
var
|
|
78
|
-
(
|
|
79
|
-
const { __scopeTabs:
|
|
80
|
-
return /* @__PURE__ */
|
|
77
|
+
var A = "TabsTrigger", P = b.forwardRef(
|
|
78
|
+
(o, n) => {
|
|
79
|
+
const { __scopeTabs: i, value: e, disabled: r = !1, ...a } = o, t = h(A, i), u = C(i), p = k(t.baseId, e), g = M(t.baseId, e), l = e === t.value;
|
|
80
|
+
return /* @__PURE__ */ s(
|
|
81
81
|
D,
|
|
82
82
|
{
|
|
83
83
|
asChild: !0,
|
|
84
84
|
...u,
|
|
85
|
-
focusable: !
|
|
86
|
-
active:
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
|
|
85
|
+
focusable: !r,
|
|
86
|
+
active: l,
|
|
87
|
+
children: /* @__PURE__ */ s(
|
|
88
|
+
v.button,
|
|
89
89
|
{
|
|
90
90
|
type: "button",
|
|
91
91
|
role: "tab",
|
|
92
|
-
"aria-selected":
|
|
93
|
-
"aria-controls":
|
|
94
|
-
"data-state":
|
|
95
|
-
"data-disabled":
|
|
96
|
-
disabled:
|
|
97
|
-
id:
|
|
98
|
-
...
|
|
99
|
-
ref:
|
|
100
|
-
onMouseDown:
|
|
101
|
-
!
|
|
92
|
+
"aria-selected": l,
|
|
93
|
+
"aria-controls": g,
|
|
94
|
+
"data-state": l ? "active" : "inactive",
|
|
95
|
+
"data-disabled": r ? "" : void 0,
|
|
96
|
+
disabled: r,
|
|
97
|
+
id: p,
|
|
98
|
+
...a,
|
|
99
|
+
ref: n,
|
|
100
|
+
onMouseDown: x(o.onMouseDown, (c) => {
|
|
101
|
+
!r && c.button === 0 && c.ctrlKey === !1 ? t.onValueChange(e) : c.preventDefault();
|
|
102
102
|
}),
|
|
103
|
-
onKeyDown:
|
|
104
|
-
[" ", "Enter"].includes(
|
|
103
|
+
onKeyDown: x(o.onKeyDown, (c) => {
|
|
104
|
+
[" ", "Enter"].includes(c.key) && t.onValueChange(e);
|
|
105
105
|
}),
|
|
106
|
-
onFocus:
|
|
107
|
-
const
|
|
108
|
-
!
|
|
106
|
+
onFocus: x(o.onFocus, () => {
|
|
107
|
+
const c = t.activationMode !== "manual";
|
|
108
|
+
!l && !r && c && t.onValueChange(e);
|
|
109
109
|
})
|
|
110
110
|
}
|
|
111
111
|
)
|
|
@@ -113,87 +113,96 @@ var P = "TabsTrigger", _ = f.forwardRef(
|
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
|
-
|
|
117
|
-
var
|
|
118
|
-
(
|
|
119
|
-
const { __scopeTabs:
|
|
120
|
-
return
|
|
121
|
-
const d = requestAnimationFrame(() =>
|
|
116
|
+
P.displayName = A;
|
|
117
|
+
var _ = "TabsContent", j = b.forwardRef(
|
|
118
|
+
(o, n) => {
|
|
119
|
+
const { __scopeTabs: i, value: e, forceMount: r, children: a, ...t } = o, u = h(_, i), p = k(u.baseId, e), g = M(u.baseId, e), l = e === u.value, c = b.useRef(l);
|
|
120
|
+
return b.useEffect(() => {
|
|
121
|
+
const d = requestAnimationFrame(() => c.current = !1);
|
|
122
122
|
return () => cancelAnimationFrame(d);
|
|
123
|
-
}, []), /* @__PURE__ */
|
|
124
|
-
|
|
123
|
+
}, []), /* @__PURE__ */ s(F, { present: r || l, children: ({ present: d }) => /* @__PURE__ */ s(
|
|
124
|
+
v.div,
|
|
125
125
|
{
|
|
126
|
-
"data-state":
|
|
126
|
+
"data-state": l ? "active" : "inactive",
|
|
127
127
|
"data-orientation": u.orientation,
|
|
128
128
|
role: "tabpanel",
|
|
129
|
-
"aria-labelledby":
|
|
129
|
+
"aria-labelledby": p,
|
|
130
130
|
hidden: !d,
|
|
131
|
-
id:
|
|
131
|
+
id: g,
|
|
132
132
|
tabIndex: 0,
|
|
133
|
-
...
|
|
134
|
-
ref:
|
|
133
|
+
...t,
|
|
134
|
+
ref: n,
|
|
135
135
|
style: {
|
|
136
|
-
...
|
|
137
|
-
animationDuration:
|
|
136
|
+
...o.style,
|
|
137
|
+
animationDuration: c.current ? "0s" : void 0
|
|
138
138
|
},
|
|
139
|
-
children: d &&
|
|
139
|
+
children: d && a
|
|
140
140
|
}
|
|
141
141
|
) });
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
|
-
|
|
145
|
-
function
|
|
146
|
-
return `${
|
|
144
|
+
j.displayName = _;
|
|
145
|
+
function k(o, n) {
|
|
146
|
+
return `${o}-trigger-${n}`;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
return `${
|
|
148
|
+
function M(o, n) {
|
|
149
|
+
return `${o}-content-${n}`;
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
function W({ tabs:
|
|
153
|
-
return /* @__PURE__ */
|
|
154
|
-
|
|
151
|
+
var z = I, K = R, B = P;
|
|
152
|
+
function W({ tabs: o, active: n, onChange: i, variant: e = "line", className: r }) {
|
|
153
|
+
return /* @__PURE__ */ s(z, { value: n, onValueChange: i, children: /* @__PURE__ */ s(
|
|
154
|
+
K,
|
|
155
155
|
{
|
|
156
|
-
className:
|
|
157
|
-
"inline-flex items-center
|
|
156
|
+
className: f(
|
|
157
|
+
"inline-flex items-center",
|
|
158
|
+
e === "line" && "gap-1 border-b border-border",
|
|
159
|
+
e === "pill" && "h-9 gap-0 rounded-full bg-secondary p-1",
|
|
158
160
|
r
|
|
159
161
|
),
|
|
160
|
-
children:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
162
|
+
children: o.map((a) => {
|
|
163
|
+
const t = a.key === n;
|
|
164
|
+
return /* @__PURE__ */ y(
|
|
165
|
+
B,
|
|
166
|
+
{
|
|
167
|
+
value: a.key,
|
|
168
|
+
className: f(
|
|
169
|
+
"inline-flex items-center justify-center gap-2 text-sm font-medium transition-all outline-none cursor-pointer focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30",
|
|
170
|
+
e === "line" && f(
|
|
171
|
+
"px-3 py-2 border-b-2 -mb-px hover:text-foreground focus-visible:rounded-sm",
|
|
172
|
+
t ? "text-primary border-b-primary" : "text-muted-foreground border-transparent"
|
|
173
|
+
),
|
|
174
|
+
e === "pill" && f(
|
|
175
|
+
"h-full flex-1 px-3 py-1 rounded-full border hover:text-foreground",
|
|
176
|
+
t ? "bg-background text-foreground border-transparent dark:bg-foreground/15" : "text-muted-foreground border-transparent"
|
|
177
|
+
)
|
|
178
|
+
),
|
|
179
|
+
children: [
|
|
180
|
+
a.icon && /* @__PURE__ */ s(a.icon, { size: 15 }),
|
|
181
|
+
a.label
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
a.key
|
|
185
|
+
);
|
|
186
|
+
})
|
|
178
187
|
}
|
|
179
188
|
) });
|
|
180
189
|
}
|
|
181
|
-
function X({ items:
|
|
182
|
-
return /* @__PURE__ */
|
|
190
|
+
function X({ items: o, active: n, onChange: i, className: e }) {
|
|
191
|
+
return /* @__PURE__ */ s("nav", { className: f("flex items-center gap-2", e), children: o.map((r) => /* @__PURE__ */ y(
|
|
183
192
|
"button",
|
|
184
193
|
{
|
|
185
|
-
onClick: () =>
|
|
186
|
-
className:
|
|
194
|
+
onClick: () => i(r.key),
|
|
195
|
+
className: f(
|
|
187
196
|
"flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-full border border-transparent transition-all outline-none cursor-pointer",
|
|
188
|
-
|
|
189
|
-
"focus-visible:ring-
|
|
197
|
+
n === r.key ? "bg-accent text-accent-foreground border-primary/40" : "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
198
|
+
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30"
|
|
190
199
|
),
|
|
191
200
|
children: [
|
|
192
|
-
|
|
193
|
-
|
|
201
|
+
r.icon && /* @__PURE__ */ s(r.icon, { size: 15 }),
|
|
202
|
+
r.label
|
|
194
203
|
]
|
|
195
204
|
},
|
|
196
|
-
|
|
205
|
+
r.key
|
|
197
206
|
)) });
|
|
198
207
|
}
|
|
199
208
|
export {
|
package/dist/Toast.js
CHANGED
|
@@ -118,7 +118,7 @@ class me {
|
|
|
118
118
|
];
|
|
119
119
|
}, this.create = (o) => {
|
|
120
120
|
var e;
|
|
121
|
-
const { message: s, ...T } = o, d = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : Tt++, g = this.toasts.find((h) => h.id === d),
|
|
121
|
+
const { message: s, ...T } = o, d = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : Tt++, g = this.toasts.find((h) => h.id === d), k = o.dismissible === void 0 ? !0 : o.dismissible;
|
|
122
122
|
return this.dismissedToasts.has(d) && this.dismissedToasts.delete(d), g ? this.toasts = this.toasts.map((h) => h.id === d ? (this.publish({
|
|
123
123
|
...h,
|
|
124
124
|
...o,
|
|
@@ -128,12 +128,12 @@ class me {
|
|
|
128
128
|
...h,
|
|
129
129
|
...o,
|
|
130
130
|
id: d,
|
|
131
|
-
dismissible:
|
|
131
|
+
dismissible: k,
|
|
132
132
|
title: s
|
|
133
133
|
}) : h) : this.addToast({
|
|
134
134
|
title: s,
|
|
135
135
|
...T,
|
|
136
|
-
dismissible:
|
|
136
|
+
dismissible: k,
|
|
137
137
|
id: d
|
|
138
138
|
}), d;
|
|
139
139
|
}, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
|
|
@@ -180,7 +180,7 @@ class me {
|
|
|
180
180
|
}));
|
|
181
181
|
const T = Promise.resolve(o instanceof Function ? o() : o);
|
|
182
182
|
let d = s !== void 0, g;
|
|
183
|
-
const
|
|
183
|
+
const k = T.then(async (i) => {
|
|
184
184
|
if (g = [
|
|
185
185
|
"resolve",
|
|
186
186
|
i
|
|
@@ -230,8 +230,8 @@ class me {
|
|
|
230
230
|
i
|
|
231
231
|
], e.error !== void 0) {
|
|
232
232
|
d = !1;
|
|
233
|
-
const
|
|
234
|
-
message:
|
|
233
|
+
const N = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, j = typeof N == "object" && !a.isValidElement(N) ? N : {
|
|
234
|
+
message: N
|
|
235
235
|
};
|
|
236
236
|
this.create({
|
|
237
237
|
id: s,
|
|
@@ -242,7 +242,7 @@ class me {
|
|
|
242
242
|
}
|
|
243
243
|
}).finally(() => {
|
|
244
244
|
d && (this.dismiss(s), s = void 0), e.finally == null || e.finally.call(e);
|
|
245
|
-
}), h = () => new Promise((i,
|
|
245
|
+
}), h = () => new Promise((i, N) => k.then(() => g[0] === "reject" ? N(g[1]) : i(g[1])).catch(N));
|
|
246
246
|
return typeof s != "string" && typeof s != "number" ? {
|
|
247
247
|
unwrap: h
|
|
248
248
|
} : Object.assign(s, {
|
|
@@ -283,7 +283,7 @@ oe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;
|
|
|
283
283
|
function pt(n) {
|
|
284
284
|
return n.label !== void 0;
|
|
285
285
|
}
|
|
286
|
-
const ye = 3, xe = "24px", we = "16px", At = 4e3, Ee = 356, Te = 14,
|
|
286
|
+
const ye = 3, xe = "24px", we = "16px", At = 4e3, Ee = 356, Te = 14, ke = 45, Ne = 200;
|
|
287
287
|
function z(...n) {
|
|
288
288
|
return n.filter(Boolean).join(" ");
|
|
289
289
|
}
|
|
@@ -292,8 +292,8 @@ function Se(n) {
|
|
|
292
292
|
return o && s.push(o), e && s.push(e), s;
|
|
293
293
|
}
|
|
294
294
|
const _e = (n) => {
|
|
295
|
-
var o, e, s, T, d, g,
|
|
296
|
-
const { invert:
|
|
295
|
+
var o, e, s, T, d, g, k, h, i;
|
|
296
|
+
const { invert: N, toast: t, unstyled: w, interacting: j, setHeights: E, visibleToasts: ht, heights: U, index: c, toasts: st, expanded: W, removeToast: nt, defaultRichColors: bt, closeButton: P, style: tt, cancelButtonStyle: $, actionButtonStyle: vt, className: rt = "", descriptionClassName: yt = "", duration: et, position: A, gap: it, expandByDefault: at, classNames: u, icons: v, closeButtonAriaLabel: O = "Close toast" } = n, [F, M] = a.useState(null), [V, lt] = a.useState(null), [l, p] = a.useState(!1), [m, R] = a.useState(!1), [K, f] = a.useState(!1), [q, dt] = a.useState(!1), [ct, G] = a.useState(!1), [Pt, xt] = a.useState(0), [Lt, kt] = a.useState(0), ot = a.useRef(t.duration || et || At), Nt = a.useRef(null), L = a.useRef(null), Ot = c === 0, Yt = c + 1 <= ht, _ = t.type, Q = t.dismissible !== !1, $t = t.className || "", Ft = t.descriptionClassName || "", ut = a.useMemo(() => U.findIndex((r) => r.toastId === t.id) || 0, [
|
|
297
297
|
U,
|
|
298
298
|
t.id
|
|
299
299
|
]), Vt = a.useMemo(() => {
|
|
@@ -308,7 +308,7 @@ const _e = (n) => {
|
|
|
308
308
|
]), wt = a.useRef(0), J = a.useRef(0), _t = a.useRef(0), Z = a.useRef(null), [Xt, Ut] = A.split("-"), Dt = a.useMemo(() => U.reduce((r, b, x) => x >= ut ? r : r + b.height, 0), [
|
|
309
309
|
U,
|
|
310
310
|
ut
|
|
311
|
-
]), Rt = fe(), Wt = t.invert ||
|
|
311
|
+
]), Rt = fe(), Wt = t.invert || N, Et = _ === "loading";
|
|
312
312
|
J.current = a.useMemo(() => ut * it + Dt, [
|
|
313
313
|
ut,
|
|
314
314
|
Dt
|
|
@@ -322,7 +322,7 @@ const _e = (n) => {
|
|
|
322
322
|
const r = L.current;
|
|
323
323
|
if (r) {
|
|
324
324
|
const b = r.getBoundingClientRect().height;
|
|
325
|
-
return
|
|
325
|
+
return kt(b), E((x) => [
|
|
326
326
|
{
|
|
327
327
|
toastId: t.id,
|
|
328
328
|
height: b,
|
|
@@ -339,7 +339,7 @@ const _e = (n) => {
|
|
|
339
339
|
const r = L.current, b = r.style.height;
|
|
340
340
|
r.style.height = "auto";
|
|
341
341
|
const x = r.getBoundingClientRect().height;
|
|
342
|
-
r.style.height = b,
|
|
342
|
+
r.style.height = b, kt(x), E((D) => D.find((y) => y.toastId === t.id) ? D.map((y) => y.toastId === t.id ? {
|
|
343
343
|
...y,
|
|
344
344
|
height: x
|
|
345
345
|
} : y) : [
|
|
@@ -363,7 +363,7 @@ const _e = (n) => {
|
|
|
363
363
|
const Y = a.useCallback(() => {
|
|
364
364
|
R(!0), xt(J.current), E((r) => r.filter((b) => b.toastId !== t.id)), setTimeout(() => {
|
|
365
365
|
nt(t);
|
|
366
|
-
},
|
|
366
|
+
}, Ne);
|
|
367
367
|
}, [
|
|
368
368
|
t,
|
|
369
369
|
nt,
|
|
@@ -448,7 +448,7 @@ const _e = (n) => {
|
|
|
448
448
|
f(!1), M(null), Z.current = null;
|
|
449
449
|
},
|
|
450
450
|
onPointerDown: (r) => {
|
|
451
|
-
r.button !== 2 && (Et || !Q || (
|
|
451
|
+
r.button !== 2 && (Et || !Q || (Nt.current = /* @__PURE__ */ new Date(), xt(J.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (f(!0), Z.current = {
|
|
452
452
|
x: r.clientX,
|
|
453
453
|
y: r.clientY
|
|
454
454
|
})));
|
|
@@ -457,8 +457,8 @@ const _e = (n) => {
|
|
|
457
457
|
var r, b, x;
|
|
458
458
|
if (q || !Q) return;
|
|
459
459
|
Z.current = null;
|
|
460
|
-
const D = Number(((r = L.current) == null ? void 0 : r.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ft = Number(((b = L.current) == null ? void 0 : b.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), y = (/* @__PURE__ */ new Date()).getTime() - ((x =
|
|
461
|
-
if (Math.abs(B) >=
|
|
460
|
+
const D = Number(((r = L.current) == null ? void 0 : r.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ft = Number(((b = L.current) == null ? void 0 : b.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), y = (/* @__PURE__ */ new Date()).getTime() - ((x = Nt.current) == null ? void 0 : x.getTime()), B = F === "x" ? D : ft, mt = Math.abs(B) / y;
|
|
461
|
+
if (Math.abs(B) >= ke || mt > 0.11) {
|
|
462
462
|
xt(J.current), t.onDismiss == null || t.onDismiss.call(t, t), lt(F === "x" ? D > 0 ? "right" : "left" : ft > 0 ? "down" : "up"), Y(), dt(!0);
|
|
463
463
|
return;
|
|
464
464
|
} else {
|
|
@@ -516,7 +516,7 @@ const _e = (n) => {
|
|
|
516
516
|
className: z(u?.title, t == null || (g = t.classNames) == null ? void 0 : g.title)
|
|
517
517
|
}, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
|
|
518
518
|
"data-description": "",
|
|
519
|
-
className: z(yt, Ft, u?.description, t == null || (
|
|
519
|
+
className: z(yt, Ft, u?.description, t == null || (k = t.classNames) == null ? void 0 : k.description)
|
|
520
520
|
}, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && pt(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
|
|
521
521
|
"data-button": !0,
|
|
522
522
|
"data-cancel": !0,
|
|
@@ -546,15 +546,15 @@ function De(n, o) {
|
|
|
546
546
|
n,
|
|
547
547
|
o
|
|
548
548
|
].forEach((s, T) => {
|
|
549
|
-
const d = T === 1, g = d ? "--mobile-offset" : "--offset",
|
|
549
|
+
const d = T === 1, g = d ? "--mobile-offset" : "--offset", k = d ? we : xe;
|
|
550
550
|
function h(i) {
|
|
551
551
|
[
|
|
552
552
|
"top",
|
|
553
553
|
"right",
|
|
554
554
|
"bottom",
|
|
555
555
|
"left"
|
|
556
|
-
].forEach((
|
|
557
|
-
e[`${g}-${
|
|
556
|
+
].forEach((N) => {
|
|
557
|
+
e[`${g}-${N}`] = typeof i == "number" ? `${i}px` : i;
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
typeof s == "number" || typeof s == "string" ? h(s) : typeof s == "object" ? [
|
|
@@ -563,15 +563,15 @@ function De(n, o) {
|
|
|
563
563
|
"bottom",
|
|
564
564
|
"left"
|
|
565
565
|
].forEach((i) => {
|
|
566
|
-
s[i] === void 0 ? e[`${g}-${i}`] =
|
|
567
|
-
}) : h(
|
|
566
|
+
s[i] === void 0 ? e[`${g}-${i}`] = k : e[`${g}-${i}`] = typeof s[i] == "number" ? `${s[i]}px` : s[i];
|
|
567
|
+
}) : h(k);
|
|
568
568
|
}), e;
|
|
569
569
|
}
|
|
570
570
|
const Re = /* @__PURE__ */ a.forwardRef(function(o, e) {
|
|
571
571
|
const { id: s, invert: T, position: d = "bottom-right", hotkey: g = [
|
|
572
572
|
"altKey",
|
|
573
573
|
"KeyT"
|
|
574
|
-
], expand:
|
|
574
|
+
], expand: k, closeButton: h, className: i, offset: N, mobileOffset: t, theme: w = "light", richColors: j, duration: E, style: ht, visibleToasts: U = ye, toastOptions: c, dir: st = zt(), gap: W = Te, icons: nt, containerAriaLabel: bt = "Notifications" } = o, [P, tt] = a.useState([]), $ = a.useMemo(() => s ? P.filter((l) => l.toasterId === s) : P.filter((l) => !l.toasterId), [
|
|
575
575
|
P,
|
|
576
576
|
s
|
|
577
577
|
]), vt = a.useMemo(() => Array.from(new Set([
|
|
@@ -689,7 +689,7 @@ const Re = /* @__PURE__ */ a.forwardRef(function(o, e) {
|
|
|
689
689
|
"--width": `${Ee}px`,
|
|
690
690
|
"--gap": `${W}px`,
|
|
691
691
|
...ht,
|
|
692
|
-
...De(
|
|
692
|
+
...De(N, t)
|
|
693
693
|
},
|
|
694
694
|
onBlur: (f) => {
|
|
695
695
|
V.current && !f.currentTarget.contains(f.relatedTarget) && (V.current = !1, M.current && (M.current.focus({
|
|
@@ -735,7 +735,7 @@ const Re = /* @__PURE__ */ a.forwardRef(function(o, e) {
|
|
|
735
735
|
toasts: $.filter((G) => G.position == f.position),
|
|
736
736
|
heights: rt.filter((G) => G.position == f.position),
|
|
737
737
|
setHeights: yt,
|
|
738
|
-
expandByDefault:
|
|
738
|
+
expandByDefault: k,
|
|
739
739
|
gap: W,
|
|
740
740
|
expanded: et,
|
|
741
741
|
swipeDirections: o.swipeDirections
|
|
@@ -749,6 +749,7 @@ function Pe({ position: n = "bottom-right", className: o, ...e }) {
|
|
|
749
749
|
{
|
|
750
750
|
position: n,
|
|
751
751
|
className: Ht("toaster group", o),
|
|
752
|
+
toastOptions: { style: { opacity: 1, background: "transparent", border: "none", padding: 0, boxShadow: "none" } },
|
|
752
753
|
...e
|
|
753
754
|
}
|
|
754
755
|
);
|
|
@@ -756,19 +757,19 @@ function Pe({ position: n = "bottom-right", className: o, ...e }) {
|
|
|
756
757
|
const Be = {
|
|
757
758
|
success: {
|
|
758
759
|
icon: /* @__PURE__ */ H(ae, { size: 18, className: "text-success shrink-0" }),
|
|
759
|
-
|
|
760
|
+
bg: "bg-success/15 border-success/20 dark:bg-success/10 dark:border-success/15"
|
|
760
761
|
},
|
|
761
762
|
error: {
|
|
762
763
|
icon: /* @__PURE__ */ H(ee, { size: 18, className: "text-destructive shrink-0" }),
|
|
763
|
-
|
|
764
|
+
bg: "bg-destructive/15 border-destructive/20 dark:bg-destructive/10 dark:border-destructive/15"
|
|
764
765
|
},
|
|
765
766
|
warning: {
|
|
766
767
|
icon: /* @__PURE__ */ H(te, { size: 18, className: "text-warning shrink-0" }),
|
|
767
|
-
|
|
768
|
+
bg: "bg-warning/15 border-warning/20 dark:bg-warning/10 dark:border-warning/15"
|
|
768
769
|
},
|
|
769
770
|
info: {
|
|
770
771
|
icon: /* @__PURE__ */ H(Zt, { size: 18, className: "text-info shrink-0" }),
|
|
771
|
-
|
|
772
|
+
bg: "bg-info/15 border-info/20 dark:bg-info/10 dark:border-info/15"
|
|
772
773
|
}
|
|
773
774
|
};
|
|
774
775
|
function Me({ id: n, variant: o, title: e, message: s, icon: T }) {
|
|
@@ -777,8 +778,8 @@ function Me({ id: n, variant: o, title: e, message: s, icon: T }) {
|
|
|
777
778
|
"div",
|
|
778
779
|
{
|
|
779
780
|
className: Ht(
|
|
780
|
-
"flex items-center gap-3
|
|
781
|
-
d.
|
|
781
|
+
"flex items-center gap-3 border rounded-3xl shadow-lg text-sm px-4 py-3 w-[356px] bg-card/80 backdrop-blur-md",
|
|
782
|
+
d.bg
|
|
782
783
|
),
|
|
783
784
|
children: [
|
|
784
785
|
T || d.icon,
|
|
@@ -799,7 +800,7 @@ function Me({ id: n, variant: o, title: e, message: s, icon: T }) {
|
|
|
799
800
|
);
|
|
800
801
|
}
|
|
801
802
|
function gt(n, o) {
|
|
802
|
-
const s = typeof o == "object" && o !== null && !Gt.isValidElement(o) ? o : void 0, T = s?.title, d = s ? s.message : o, g = s?.icon,
|
|
803
|
+
const s = typeof o == "object" && o !== null && !Gt.isValidElement(o) ? o : void 0, T = s?.title, d = s ? s.message : o, g = s?.icon, k = s?.duration;
|
|
803
804
|
return jt.custom(
|
|
804
805
|
(h) => /* @__PURE__ */ H(
|
|
805
806
|
Me,
|
|
@@ -811,7 +812,7 @@ function gt(n, o) {
|
|
|
811
812
|
icon: g
|
|
812
813
|
}
|
|
813
814
|
),
|
|
814
|
-
{ duration:
|
|
815
|
+
{ duration: k }
|
|
815
816
|
);
|
|
816
817
|
}
|
|
817
818
|
const Le = {
|
package/dist/Tooltip.js
CHANGED
|
@@ -331,7 +331,7 @@ const je = Ee, $e = Re, Be = _e, Le = s.forwardRef(({ className: t, sideOffset:
|
|
|
331
331
|
ref: r,
|
|
332
332
|
sideOffset: o,
|
|
333
333
|
className: ae(
|
|
334
|
-
"z-50 overflow-hidden rounded-
|
|
334
|
+
"z-50 overflow-hidden rounded-xl border border-border bg-card px-3 py-1.5 text-sm text-foreground shadow-md",
|
|
335
335
|
"animate-in fade-in-0 zoom-in-95",
|
|
336
336
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
337
337
|
"data-[side=bottom]:slide-in-from-top-2",
|
package/dist/Typography.js
CHANGED
|
@@ -11,13 +11,13 @@ function f({ children: t, icon: e, className: r, ...s }) {
|
|
|
11
11
|
),
|
|
12
12
|
...s,
|
|
13
13
|
children: [
|
|
14
|
-
e && /* @__PURE__ */ n("span", { className: "w-9 h-9 rounded-
|
|
14
|
+
e && /* @__PURE__ */ n("span", { className: "w-9 h-9 rounded-xl bg-primary/15 text-primary flex items-center justify-center shrink-0", children: /* @__PURE__ */ n(e, { size: 18 }) }),
|
|
15
15
|
t
|
|
16
16
|
]
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function u({ children: t, className: e, ...r }) {
|
|
21
21
|
return /* @__PURE__ */ n(
|
|
22
22
|
"p",
|
|
23
23
|
{
|
|
@@ -30,7 +30,7 @@ function m({ children: t, className: e, ...r }) {
|
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function m({ children: t, className: e, ...r }) {
|
|
34
34
|
return /* @__PURE__ */ n(
|
|
35
35
|
"h3",
|
|
36
36
|
{
|
|
@@ -43,7 +43,7 @@ function u({ children: t, className: e, ...r }) {
|
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function x({ children: t, className: e, ...r }) {
|
|
47
47
|
return /* @__PURE__ */ n(
|
|
48
48
|
"h1",
|
|
49
49
|
{
|
|
@@ -53,7 +53,7 @@ function d({ children: t, className: e, ...r }) {
|
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function d({ children: t, className: e, ...r }) {
|
|
57
57
|
return /* @__PURE__ */ n(
|
|
58
58
|
"h2",
|
|
59
59
|
{
|
|
@@ -113,11 +113,11 @@ function b({ name: t, suffix: e, className: r, ...s }) {
|
|
|
113
113
|
export {
|
|
114
114
|
b as AppName,
|
|
115
115
|
p as Caption,
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
x as H1,
|
|
117
|
+
d as H2,
|
|
118
118
|
l as H3,
|
|
119
119
|
g as InlineCode,
|
|
120
|
-
|
|
120
|
+
u as PageDescription,
|
|
121
121
|
f as PageTitle,
|
|
122
|
-
|
|
122
|
+
m as SectionTitle
|
|
123
123
|
};
|