@re-venue/ui-core-react 0.2.0 → 0.2.1
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/ui-core-react.js +110 -129
- package/dist/ui-core-react.umd.cjs +4 -4
- package/package.json +1 -1
- package/src/components/AppShell.tsx +3 -0
package/dist/ui-core-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as d, jsxs as
|
|
1
|
+
import { jsx as d, jsxs as D, Fragment as Te } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import A, { useState as ce, useRef as qe, useEffect as Et, useMemo as Le, useCallback as he, forwardRef as Po, createElement as vr, useLayoutEffect as Sc, isValidElement as rr, createContext as Ec, useImperativeHandle as Rc, useContext as Nc } from "react";
|
|
4
4
|
import * as kt from "react-dom";
|
|
@@ -29,10 +29,10 @@ function Tc({
|
|
|
29
29
|
onClick: (g) => {
|
|
30
30
|
g.target === g.currentTarget && s();
|
|
31
31
|
},
|
|
32
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ D("div", { className: "rv-modal-dialog", role: "dialog", "aria-modal": "true", "aria-labelledby": m, children: [
|
|
33
33
|
/* @__PURE__ */ d("h2", { id: m, className: "rv-modal-title", children: t }),
|
|
34
34
|
/* @__PURE__ */ d("p", { className: "rv-modal-body", children: o }),
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ D("div", { className: "rv-modal-actions", children: [
|
|
36
36
|
/* @__PURE__ */ d("button", { className: "rv-modal-btn rv-modal-btn-ghost", onClick: s, disabled: n, children: "Cancel" }),
|
|
37
37
|
/* @__PURE__ */ d("button", { className: "rv-modal-btn rv-modal-btn-danger", onClick: a, disabled: n, children: r })
|
|
38
38
|
] })
|
|
@@ -61,9 +61,9 @@ function Ac({ value: e, venues: t, onChange: o }) {
|
|
|
61
61
|
function u(f) {
|
|
62
62
|
o(f), n(!1);
|
|
63
63
|
}
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ D("div", { ref: a, className: "rv-venue-switcher", children: [
|
|
65
|
+
/* @__PURE__ */ D("button", { className: `rv-vs-trigger${r ? " rv-open" : ""}`, onClick: () => n((f) => !f), children: [
|
|
66
|
+
/* @__PURE__ */ D("span", { className: "rv-vs-label", children: [
|
|
67
67
|
/* @__PURE__ */ d("span", { className: "rv-vs-venue", children: s?.name ?? "Select venue" }),
|
|
68
68
|
s?.workspace && c && /* @__PURE__ */ d("span", { className: "rv-vs-workspace", children: s.workspace.name })
|
|
69
69
|
] }),
|
|
@@ -84,7 +84,7 @@ function Ac({ value: e, venues: t, onChange: o }) {
|
|
|
84
84
|
}
|
|
85
85
|
)
|
|
86
86
|
] }),
|
|
87
|
-
r && /* @__PURE__ */ d("div", { className: "rv-vs-dropdown", children: i.map((f) => /* @__PURE__ */
|
|
87
|
+
r && /* @__PURE__ */ d("div", { className: "rv-vs-dropdown", children: i.map((f) => /* @__PURE__ */ D("div", { children: [
|
|
88
88
|
c && /* @__PURE__ */ d("div", { className: "rv-vs-workspace-header", children: f.workspaceName }),
|
|
89
89
|
f.venues.map((m) => /* @__PURE__ */ d(
|
|
90
90
|
"button",
|
|
@@ -181,11 +181,11 @@ function uv({
|
|
|
181
181
|
const E = R?.workspace?.id;
|
|
182
182
|
return n.filter((H) => H.hidden ? !1 : !!(!H.permission || t || e?.globalPermissions.includes(H.permission) || E && e?.workspacePermissions?.[E]?.includes(H.permission) || r && e?.venuePermissions?.[r]?.includes(H.permission)));
|
|
183
183
|
}, [n, t, e, R, r]), I = Le(() => P.filter((E) => !E.pinned), [P]), M = Le(() => P.filter((E) => E.pinned), [P]), T = Le(() => n.filter((H) => H.url && x.startsWith(H.url)).sort((H, B) => B.url.length - H.url.length)[0]?.url ?? null, [n, x]), j = o.length > 0 || u !== void 0;
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
!h && /* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ D("div", { className: "rv-app-shell", children: [
|
|
185
|
+
/* @__PURE__ */ D("aside", { className: `rv-sidebar${h ? " rv-collapsed" : ""}`, children: [
|
|
186
|
+
/* @__PURE__ */ D("div", { className: "rv-sidebar-top", children: [
|
|
187
|
+
!h && /* @__PURE__ */ D("div", { className: "rv-sidebar-brand", children: [
|
|
188
|
+
/* @__PURE__ */ D(
|
|
189
189
|
"svg",
|
|
190
190
|
{
|
|
191
191
|
className: "rv-sidebar-logo",
|
|
@@ -194,7 +194,7 @@ function uv({
|
|
|
194
194
|
xmlns: "http://www.w3.org/2000/svg",
|
|
195
195
|
"aria-label": "Re-venue",
|
|
196
196
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ D("g", { clipPath: "url(#rv-logo-clip)", children: [
|
|
198
198
|
/* @__PURE__ */ d("path", { d: "M24.946 0.60506C24.6367 1.30638 24.2289 3.01155 24.2289 7.32948V8.73212L23.5117 9.22717C22.3867 8.12706 20.2212 7.61826 18.4775 7.61826C11.9105 7.61826 8.0013 13.6414 8.0013 21.3696V35.0247C8.0013 41.0479 8.09974 45.6683 8.4091 48.9824C6.86228 48.6799 5.54045 48.4736 4.303 48.4736C2.96711 48.4736 1.63122 48.6799 -0.0140381 48.9824C0.295326 46.2734 0.39376 42.9593 0.39376 38.2426V15.8691C0.407822 11.5512 0.309388 4.0154 2.39182e-05 1.00385C1.95464 1.40264 3.0796 1.4989 4.31706 1.4989C5.55452 1.4989 6.89041 1.29263 8.42316 1.00385L8.01537 6.0231C7.91693 7.12321 7.91693 8.73212 7.91693 10.7398L8.12786 10.8361C12.1215 3.61661 16.8322 0 21.768 0C23.0055 0 23.7226 0.206271 24.946 0.60506Z", fill: "currentColor" }),
|
|
199
199
|
/* @__PURE__ */ d("path", { d: "M74.7396 20.5858V22.291L74.5287 24.3949C68.3695 24.2987 61.6901 24.0924 54.4059 24.0924C49.4842 24.0924 44.3376 24.2987 39.1065 24.3949C39.0081 24.9037 39.0081 26.3064 39.0081 26.6089C39.0081 39.0539 46.4047 45.7921 56.6699 45.7921C61.901 45.7921 68.1727 42.9868 72.1663 38.6689L72.6866 38.9714L72.0678 43.8944C66.7243 47.9098 60.2557 50.0137 54.8137 50.0137C40.5408 50.0137 29.9662 40.0715 29.9662 26.3201C29.9802 9.84598 38.6003 0 53.4919 0C66.6399 0 74.7396 8.12706 74.7396 20.5858ZM52.6623 20.8883C56.2621 20.8883 62.3088 20.5858 66.3165 20.5858C66.218 9.03465 61.9994 3.21782 53.6888 3.21782C45.3781 3.21782 40.4424 9.74972 39.3174 20.5858C43.3251 20.5858 51.017 20.8883 52.6623 20.8883Z", fill: "currentColor" }),
|
|
200
200
|
/* @__PURE__ */ d("path", { d: "M164.989 22.9923V27.709H82.8533V22.9923H164.989Z", fill: "currentColor" }),
|
|
@@ -216,10 +216,10 @@ function uv({
|
|
|
216
216
|
className: "rv-collapse-toggle",
|
|
217
217
|
title: h ? "Expand sidebar" : "Collapse sidebar",
|
|
218
218
|
onClick: S,
|
|
219
|
-
children: h ? /* @__PURE__ */
|
|
219
|
+
children: h ? /* @__PURE__ */ D("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
220
220
|
/* @__PURE__ */ d("polyline", { points: "13 17 18 12 13 7" }),
|
|
221
221
|
/* @__PURE__ */ d("polyline", { points: "6 17 11 12 6 7" })
|
|
222
|
-
] }) : /* @__PURE__ */
|
|
222
|
+
] }) : /* @__PURE__ */ D("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
223
223
|
/* @__PURE__ */ d("polyline", { points: "11 17 6 12 11 7" }),
|
|
224
224
|
/* @__PURE__ */ d("polyline", { points: "18 17 13 12 18 7" })
|
|
225
225
|
] })
|
|
@@ -227,7 +227,7 @@ function uv({
|
|
|
227
227
|
)
|
|
228
228
|
] }),
|
|
229
229
|
f && /* @__PURE__ */ d("div", { className: "rv-sidebar-panel", children: f }),
|
|
230
|
-
/* @__PURE__ */ d("nav", { className: "rv-sidebar-nav", children: I.map((E) => /* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ d("nav", { className: "rv-sidebar-nav", children: I.map((E) => /* @__PURE__ */ D(
|
|
231
231
|
"a",
|
|
232
232
|
{
|
|
233
233
|
href: E.url,
|
|
@@ -240,7 +240,7 @@ function uv({
|
|
|
240
240
|
},
|
|
241
241
|
E.url
|
|
242
242
|
)) }),
|
|
243
|
-
M.length > 0 && /* @__PURE__ */ d("nav", { className: "rv-sidebar-pinned", children: M.map((E) => /* @__PURE__ */
|
|
243
|
+
M.length > 0 && /* @__PURE__ */ d("nav", { className: "rv-sidebar-pinned", children: M.map((E) => /* @__PURE__ */ D(
|
|
244
244
|
"a",
|
|
245
245
|
{
|
|
246
246
|
href: E.url,
|
|
@@ -253,41 +253,22 @@ function uv({
|
|
|
253
253
|
},
|
|
254
254
|
E.url
|
|
255
255
|
)) }),
|
|
256
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ D("div", { className: "rv-sidebar-user", children: [
|
|
257
257
|
/* @__PURE__ */ d("div", { className: "rv-user-avatar", children: F }),
|
|
258
258
|
!h && /* @__PURE__ */ d("div", { className: "rv-user-info", children: /* @__PURE__ */ d("span", { className: "rv-user-email", title: e?.email ?? "", children: e?.email }) }),
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
{
|
|
262
|
-
className: "rv-theme-toggle-btn",
|
|
263
|
-
title: `Switch to ${p === "light" ? "dark" : "light"} mode`,
|
|
264
|
-
"aria-label": `Switch to ${p === "light" ? "dark" : "light"} mode`,
|
|
265
|
-
onClick: w,
|
|
266
|
-
children: p === "light" ? /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ d("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) : /* @__PURE__ */ _("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
267
|
-
/* @__PURE__ */ d("circle", { cx: "12", cy: "12", r: "5" }),
|
|
268
|
-
/* @__PURE__ */ d("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
269
|
-
/* @__PURE__ */ d("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
270
|
-
/* @__PURE__ */ d("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
271
|
-
/* @__PURE__ */ d("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
272
|
-
/* @__PURE__ */ d("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
273
|
-
/* @__PURE__ */ d("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
274
|
-
/* @__PURE__ */ d("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
275
|
-
/* @__PURE__ */ d("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
276
|
-
] })
|
|
277
|
-
}
|
|
278
|
-
),
|
|
279
|
-
c && /* @__PURE__ */ d("a", { className: "rv-account-settings-btn", href: c, title: "Account settings", children: /* @__PURE__ */ _("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
259
|
+
!1,
|
|
260
|
+
c && /* @__PURE__ */ d("a", { className: "rv-account-settings-btn", href: c, title: "Account settings", children: /* @__PURE__ */ D("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
280
261
|
/* @__PURE__ */ d("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
281
262
|
/* @__PURE__ */ d("circle", { cx: "12", cy: "12", r: "3" })
|
|
282
263
|
] }) }),
|
|
283
|
-
/* @__PURE__ */ d("button", { className: "rv-logout-btn", title: "Sign out", onClick: () => b(!0), children: /* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ d("button", { className: "rv-logout-btn", title: "Sign out", onClick: () => b(!0), children: /* @__PURE__ */ D("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
284
265
|
/* @__PURE__ */ d("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
285
266
|
/* @__PURE__ */ d("polyline", { points: "16 17 21 12 16 7" }),
|
|
286
267
|
/* @__PURE__ */ d("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
287
268
|
] }) })
|
|
288
269
|
] })
|
|
289
270
|
] }),
|
|
290
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ D("div", { className: "rv-shell-body", children: [
|
|
291
272
|
j && /* @__PURE__ */ d("header", { className: "rv-shell-header", children: u !== void 0 ? u : /* @__PURE__ */ d(
|
|
292
273
|
Ac,
|
|
293
274
|
{
|
|
@@ -4123,7 +4104,7 @@ const nf = Su, fv = Eu, af = Ru, ws = l.forwardRef(({ className: e, ...t }, o) =
|
|
|
4123
4104
|
}
|
|
4124
4105
|
));
|
|
4125
4106
|
ws.displayName = ss.displayName;
|
|
4126
|
-
const ys = l.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */
|
|
4107
|
+
const ys = l.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ D(af, { children: [
|
|
4127
4108
|
/* @__PURE__ */ d(ws, {}),
|
|
4128
4109
|
/* @__PURE__ */ d(
|
|
4129
4110
|
is,
|
|
@@ -4453,7 +4434,7 @@ var Xr = l.forwardRef(
|
|
|
4453
4434
|
name: r,
|
|
4454
4435
|
form: f,
|
|
4455
4436
|
value: c,
|
|
4456
|
-
internal_do_not_use_render: ({ isFormControl: g }) => /* @__PURE__ */
|
|
4437
|
+
internal_do_not_use_render: ({ isFormControl: g }) => /* @__PURE__ */ D(Te, { children: [
|
|
4457
4438
|
/* @__PURE__ */ d(
|
|
4458
4439
|
Os,
|
|
4459
4440
|
{
|
|
@@ -4676,9 +4657,9 @@ const Lf = _o, pv = Do, $f = Io, mv = ut, Hs = l.forwardRef(({ className: e, ...
|
|
|
4676
4657
|
}
|
|
4677
4658
|
));
|
|
4678
4659
|
Hs.displayName = _t.displayName;
|
|
4679
|
-
const zs = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */
|
|
4660
|
+
const zs = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */ D($f, { children: [
|
|
4680
4661
|
/* @__PURE__ */ d(Hs, {}),
|
|
4681
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ D(
|
|
4682
4663
|
Dt,
|
|
4683
4664
|
{
|
|
4684
4665
|
ref: r,
|
|
@@ -4689,7 +4670,7 @@ const zs = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__
|
|
|
4689
4670
|
...o,
|
|
4690
4671
|
children: [
|
|
4691
4672
|
t,
|
|
4692
|
-
/* @__PURE__ */
|
|
4673
|
+
/* @__PURE__ */ D(ut, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
4693
4674
|
/* @__PURE__ */ d(Zt, { className: "h-4 w-4" }),
|
|
4694
4675
|
/* @__PURE__ */ d("span", { className: "sr-only", children: "Close" })
|
|
4695
4676
|
] })
|
|
@@ -6209,9 +6190,9 @@ var an = "PopperContent", [Gp, Xp] = ii(an), fi = l.forwardRef(
|
|
|
6209
6190
|
ie(() => {
|
|
6210
6191
|
V && U?.();
|
|
6211
6192
|
}, [V, U]);
|
|
6212
|
-
const K = L.arrow?.x, q = L.arrow?.y, se = L.arrow?.centerOffset !== 0, [de,
|
|
6193
|
+
const K = L.arrow?.x, q = L.arrow?.y, se = L.arrow?.centerOffset !== 0, [de, _] = l.useState();
|
|
6213
6194
|
return ie(() => {
|
|
6214
|
-
y &&
|
|
6195
|
+
y && _(window.getComputedStyle(y).zIndex);
|
|
6215
6196
|
}, [y]), /* @__PURE__ */ d(
|
|
6216
6197
|
"div",
|
|
6217
6198
|
{
|
|
@@ -6570,8 +6551,8 @@ function hv({
|
|
|
6570
6551
|
}, c = (u, f) => {
|
|
6571
6552
|
f.stopPropagation(), o(t.filter((m) => m !== u));
|
|
6572
6553
|
};
|
|
6573
|
-
return /* @__PURE__ */
|
|
6574
|
-
/* @__PURE__ */ d(pm, { asChild: !0, children: /* @__PURE__ */
|
|
6554
|
+
return /* @__PURE__ */ D(fm, { open: n, onOpenChange: a, children: [
|
|
6555
|
+
/* @__PURE__ */ d(pm, { asChild: !0, children: /* @__PURE__ */ D(
|
|
6575
6556
|
"button",
|
|
6576
6557
|
{
|
|
6577
6558
|
type: "button",
|
|
@@ -6580,7 +6561,7 @@ function hv({
|
|
|
6580
6561
|
!s.length && "text-muted-foreground"
|
|
6581
6562
|
),
|
|
6582
6563
|
children: [
|
|
6583
|
-
/* @__PURE__ */ d("div", { className: "flex flex-wrap gap-1 flex-1", children: s.length > 0 ? s.map((u) => /* @__PURE__ */
|
|
6564
|
+
/* @__PURE__ */ d("div", { className: "flex flex-wrap gap-1 flex-1", children: s.length > 0 ? s.map((u) => /* @__PURE__ */ D(
|
|
6584
6565
|
vf,
|
|
6585
6566
|
{
|
|
6586
6567
|
variant: "secondary",
|
|
@@ -6610,7 +6591,7 @@ function hv({
|
|
|
6610
6591
|
) }),
|
|
6611
6592
|
/* @__PURE__ */ d(Ni, { className: "max-h-60 overflow-y-auto p-1", children: e.length === 0 ? /* @__PURE__ */ d("div", { className: "py-4 text-center text-sm text-muted-foreground", children: "No options available" }) : e.map((u) => {
|
|
6612
6593
|
const f = t.includes(u.value);
|
|
6613
|
-
return /* @__PURE__ */
|
|
6594
|
+
return /* @__PURE__ */ D(
|
|
6614
6595
|
"button",
|
|
6615
6596
|
{
|
|
6616
6597
|
type: "button",
|
|
@@ -6781,7 +6762,7 @@ Ii.displayName = mn;
|
|
|
6781
6762
|
var Mi = "ScrollAreaViewport", Li = l.forwardRef(
|
|
6782
6763
|
(e, t) => {
|
|
6783
6764
|
const { __scopeScrollArea: o, children: r, nonce: n, ...a } = e, s = ye(Mi, o), i = l.useRef(null), c = G(t, i, s.onViewportChange);
|
|
6784
|
-
return /* @__PURE__ */
|
|
6765
|
+
return /* @__PURE__ */ D(Te, { children: [
|
|
6785
6766
|
/* @__PURE__ */ d(Rm, { nonce: n }),
|
|
6786
6767
|
/* @__PURE__ */ d(
|
|
6787
6768
|
z.div,
|
|
@@ -7236,7 +7217,7 @@ function Tt(e, t) {
|
|
|
7236
7217
|
}, [e, o]);
|
|
7237
7218
|
}
|
|
7238
7219
|
var ji = Ii, Mm = Li, Lm = zi;
|
|
7239
|
-
const $m = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */
|
|
7220
|
+
const $m = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */ D(ji, { ref: r, className: k("relative overflow-hidden", e), ...o, children: [
|
|
7240
7221
|
/* @__PURE__ */ d(Mm, { className: "h-full w-full rounded-[inherit]", children: t }),
|
|
7241
7222
|
/* @__PURE__ */ d(Yi, {}),
|
|
7242
7223
|
/* @__PURE__ */ d(Lm, {})
|
|
@@ -7403,7 +7384,7 @@ var qi = (e) => {
|
|
|
7403
7384
|
{
|
|
7404
7385
|
__scopeSelect: t,
|
|
7405
7386
|
...r,
|
|
7406
|
-
internal_do_not_use_render: ({ isFormControl: n }) => /* @__PURE__ */
|
|
7387
|
+
internal_do_not_use_render: ({ isFormControl: n }) => /* @__PURE__ */ D(Te, { children: [
|
|
7407
7388
|
o,
|
|
7408
7389
|
n ? /* @__PURE__ */ d(
|
|
7409
7390
|
bl,
|
|
@@ -7532,16 +7513,16 @@ var Re = 10, [nl, rt] = ft(et), qm = "SelectContentImpl", Zm = /* @__PURE__ */ i
|
|
|
7532
7513
|
avoidCollisions: v,
|
|
7533
7514
|
//
|
|
7534
7515
|
...y
|
|
7535
|
-
} = e, b = ot(et, o), [x, C] = l.useState(null), [S, R] = l.useState(null), N = G(t, (
|
|
7516
|
+
} = e, b = ot(et, o), [x, C] = l.useState(null), [S, R] = l.useState(null), N = G(t, (_) => C(_)), [F, P] = l.useState(null), [I, M] = l.useState(
|
|
7536
7517
|
null
|
|
7537
7518
|
), T = Yo(o), [j, E] = l.useState(!1), H = l.useRef(!1);
|
|
7538
7519
|
l.useEffect(() => {
|
|
7539
7520
|
if (x) return $r(x);
|
|
7540
7521
|
}, [x]), Lr();
|
|
7541
7522
|
const B = l.useCallback(
|
|
7542
|
-
(
|
|
7523
|
+
(_) => {
|
|
7543
7524
|
const [ee, ...ae] = T().map((re) => re.ref.current), [Z] = ae.slice(-1), Q = document.activeElement;
|
|
7544
|
-
for (const re of
|
|
7525
|
+
for (const re of _)
|
|
7545
7526
|
if (re === Q || (re?.scrollIntoView({ block: "nearest" }), re === ee && S && (S.scrollTop = 0), re === Z && S && (S.scrollTop = S.scrollHeight), re?.focus(), document.activeElement !== Q)) return;
|
|
7546
7527
|
},
|
|
7547
7528
|
[T, S]
|
|
@@ -7555,38 +7536,38 @@ var Re = 10, [nl, rt] = ft(et), qm = "SelectContentImpl", Zm = /* @__PURE__ */ i
|
|
|
7555
7536
|
const { onOpenChange: L, triggerPointerDownPosRef: O } = b;
|
|
7556
7537
|
l.useEffect(() => {
|
|
7557
7538
|
if (x) {
|
|
7558
|
-
let
|
|
7539
|
+
let _ = { x: 0, y: 0 };
|
|
7559
7540
|
const ee = (Z) => {
|
|
7560
|
-
|
|
7541
|
+
_ = {
|
|
7561
7542
|
x: Math.abs(Math.round(Z.pageX) - (O.current?.x ?? 0)),
|
|
7562
7543
|
y: Math.abs(Math.round(Z.pageY) - (O.current?.y ?? 0))
|
|
7563
7544
|
};
|
|
7564
7545
|
}, ae = (Z) => {
|
|
7565
|
-
|
|
7546
|
+
_.x <= 10 && _.y <= 10 ? Z.preventDefault() : Z.composedPath().includes(x) || L(!1), document.removeEventListener("pointermove", ee), O.current = null;
|
|
7566
7547
|
};
|
|
7567
7548
|
return O.current !== null && (document.addEventListener("pointermove", ee), document.addEventListener("pointerup", ae, { capture: !0, once: !0 })), () => {
|
|
7568
7549
|
document.removeEventListener("pointermove", ee), document.removeEventListener("pointerup", ae, { capture: !0 });
|
|
7569
7550
|
};
|
|
7570
7551
|
}
|
|
7571
7552
|
}, [x, L, O]), l.useEffect(() => {
|
|
7572
|
-
const
|
|
7573
|
-
return window.addEventListener("blur",
|
|
7574
|
-
window.removeEventListener("blur",
|
|
7553
|
+
const _ = () => L(!1);
|
|
7554
|
+
return window.addEventListener("blur", _), window.addEventListener("resize", _), () => {
|
|
7555
|
+
window.removeEventListener("blur", _), window.removeEventListener("resize", _);
|
|
7575
7556
|
};
|
|
7576
7557
|
}, [L]);
|
|
7577
|
-
const [X, J] = wl((
|
|
7578
|
-
const ee = T().filter((Q) => !Q.disabled), ae = ee.find((Q) => Q.ref.current === document.activeElement), Z = yl(ee,
|
|
7558
|
+
const [X, J] = wl((_) => {
|
|
7559
|
+
const ee = T().filter((Q) => !Q.disabled), ae = ee.find((Q) => Q.ref.current === document.activeElement), Z = yl(ee, _, ae);
|
|
7579
7560
|
Z && setTimeout(() => Z.ref.current?.focus());
|
|
7580
7561
|
}), U = l.useCallback(
|
|
7581
|
-
(
|
|
7562
|
+
(_, ee, ae) => {
|
|
7582
7563
|
const Z = !H.current && !ae;
|
|
7583
|
-
(b.value !== void 0 && b.value === ee || Z) && (P(
|
|
7564
|
+
(b.value !== void 0 && b.value === ee || Z) && (P(_), Z && (H.current = !0));
|
|
7584
7565
|
},
|
|
7585
7566
|
[b.value]
|
|
7586
7567
|
), K = l.useCallback(() => x?.focus(), [x]), q = l.useCallback(
|
|
7587
|
-
(
|
|
7568
|
+
(_, ee, ae) => {
|
|
7588
7569
|
const Z = !H.current && !ae;
|
|
7589
|
-
(b.value !== void 0 && b.value === ee || Z) && M(
|
|
7570
|
+
(b.value !== void 0 && b.value === ee || Z) && M(_);
|
|
7590
7571
|
},
|
|
7591
7572
|
[b.value]
|
|
7592
7573
|
), se = r === "popper" ? Rr : sl, de = se === Rr ? {
|
|
@@ -7622,11 +7603,11 @@ var Re = 10, [nl, rt] = ft(et), qm = "SelectContentImpl", Zm = /* @__PURE__ */ i
|
|
|
7622
7603
|
{
|
|
7623
7604
|
asChild: !0,
|
|
7624
7605
|
trapped: b.open,
|
|
7625
|
-
onMountAutoFocus: (
|
|
7626
|
-
|
|
7606
|
+
onMountAutoFocus: (_) => {
|
|
7607
|
+
_.preventDefault();
|
|
7627
7608
|
},
|
|
7628
|
-
onUnmountAutoFocus: $(n, (
|
|
7629
|
-
b.trigger?.focus({ preventScroll: !0 }),
|
|
7609
|
+
onUnmountAutoFocus: $(n, (_) => {
|
|
7610
|
+
b.trigger?.focus({ preventScroll: !0 }), _.preventDefault();
|
|
7630
7611
|
}),
|
|
7631
7612
|
children: /* @__PURE__ */ d(
|
|
7632
7613
|
Ot,
|
|
@@ -7635,7 +7616,7 @@ var Re = 10, [nl, rt] = ft(et), qm = "SelectContentImpl", Zm = /* @__PURE__ */ i
|
|
|
7635
7616
|
disableOutsidePointerEvents: !0,
|
|
7636
7617
|
onEscapeKeyDown: a,
|
|
7637
7618
|
onPointerDownOutside: s,
|
|
7638
|
-
onFocusOutside: (
|
|
7619
|
+
onFocusOutside: (_) => _.preventDefault(),
|
|
7639
7620
|
onDismiss: () => b.onOpenChange(!1),
|
|
7640
7621
|
children: /* @__PURE__ */ d(
|
|
7641
7622
|
se,
|
|
@@ -7644,7 +7625,7 @@ var Re = 10, [nl, rt] = ft(et), qm = "SelectContentImpl", Zm = /* @__PURE__ */ i
|
|
|
7644
7625
|
id: b.contentId,
|
|
7645
7626
|
"data-state": b.open ? "open" : "closed",
|
|
7646
7627
|
dir: b.dir,
|
|
7647
|
-
onContextMenu: (
|
|
7628
|
+
onContextMenu: (_) => _.preventDefault(),
|
|
7648
7629
|
...y,
|
|
7649
7630
|
...de,
|
|
7650
7631
|
onPlaced: () => E(!0),
|
|
@@ -7657,15 +7638,15 @@ var Re = 10, [nl, rt] = ft(et), qm = "SelectContentImpl", Zm = /* @__PURE__ */ i
|
|
|
7657
7638
|
outline: "none",
|
|
7658
7639
|
...y.style
|
|
7659
7640
|
},
|
|
7660
|
-
onKeyDown: $(y.onKeyDown, (
|
|
7661
|
-
const ee =
|
|
7662
|
-
if (
|
|
7641
|
+
onKeyDown: $(y.onKeyDown, (_) => {
|
|
7642
|
+
const ee = _.ctrlKey || _.altKey || _.metaKey;
|
|
7643
|
+
if (_.key === "Tab" && _.preventDefault(), !ee && _.key.length === 1 && J(_.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(_.key)) {
|
|
7663
7644
|
let Z = T().filter((Q) => !Q.disabled).map((Q) => Q.ref.current);
|
|
7664
|
-
if (["ArrowUp", "End"].includes(
|
|
7665
|
-
const Q =
|
|
7645
|
+
if (["ArrowUp", "End"].includes(_.key) && (Z = Z.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(_.key)) {
|
|
7646
|
+
const Q = _.target, re = Z.indexOf(Q);
|
|
7666
7647
|
Z = Z.slice(re + 1);
|
|
7667
7648
|
}
|
|
7668
|
-
setTimeout(() => B(Z)),
|
|
7649
|
+
setTimeout(() => B(Z)), _.preventDefault();
|
|
7669
7650
|
}
|
|
7670
7651
|
})
|
|
7671
7652
|
}
|
|
@@ -7701,7 +7682,7 @@ var Qm = "SelectItemAlignedPosition", sl = l.forwardRef((e, t) => {
|
|
|
7701
7682
|
]);
|
|
7702
7683
|
i.style.minWidth = ue + "px", i.style.right = zt + "px";
|
|
7703
7684
|
}
|
|
7704
|
-
const M = g(), T = window.innerHeight - Re * 2, j = h.scrollHeight, E = window.getComputedStyle(u), H = parseInt(E.borderTopWidth, 10), B = parseInt(E.paddingTop, 10), V = parseInt(E.borderBottomWidth, 10), L = parseInt(E.paddingBottom, 10), O = H + B + j + L + V, X = Math.min(v.offsetHeight * 5, O), J = window.getComputedStyle(h), U = parseInt(J.paddingTop, 10), K = parseInt(J.paddingBottom, 10), q = N.top + N.height / 2 - Re, se = T - q, de = v.offsetHeight / 2,
|
|
7685
|
+
const M = g(), T = window.innerHeight - Re * 2, j = h.scrollHeight, E = window.getComputedStyle(u), H = parseInt(E.borderTopWidth, 10), B = parseInt(E.paddingTop, 10), V = parseInt(E.borderBottomWidth, 10), L = parseInt(E.paddingBottom, 10), O = H + B + j + L + V, X = Math.min(v.offsetHeight * 5, O), J = window.getComputedStyle(h), U = parseInt(J.paddingTop, 10), K = parseInt(J.paddingBottom, 10), q = N.top + N.height / 2 - Re, se = T - q, de = v.offsetHeight / 2, _ = v.offsetTop + de, ee = H + B + _, ae = O - ee;
|
|
7705
7686
|
if (ee <= q) {
|
|
7706
7687
|
const Q = M.length > 0 && v === M[M.length - 1].ref.current;
|
|
7707
7688
|
i.style.bottom = "0px";
|
|
@@ -7816,7 +7797,7 @@ Rr.displayName = Jm;
|
|
|
7816
7797
|
var [eh, yn] = ft(et, {}), Nr = "SelectViewport", il = l.forwardRef(
|
|
7817
7798
|
(e, t) => {
|
|
7818
7799
|
const { __scopeSelect: o, nonce: r, ...n } = e, a = rt(Nr, o), s = yn(Nr, o), i = G(t, a.onViewportChange), c = l.useRef(0);
|
|
7819
|
-
return /* @__PURE__ */
|
|
7800
|
+
return /* @__PURE__ */ D(Te, { children: [
|
|
7820
7801
|
/* @__PURE__ */ d(
|
|
7821
7802
|
"style",
|
|
7822
7803
|
{
|
|
@@ -7965,7 +7946,7 @@ var jt = "SelectItemText", fl = l.forwardRef(
|
|
|
7965
7946
|
() => /* @__PURE__ */ d("option", { value: c.value, disabled: c.disabled, children: p }, c.value),
|
|
7966
7947
|
[c.disabled, c.value, p]
|
|
7967
7948
|
), { onNativeOptionAdd: h, onNativeOptionRemove: v } = u;
|
|
7968
|
-
return ie(() => (h(w), () => v(w)), [h, v, w]), /* @__PURE__ */
|
|
7949
|
+
return ie(() => (h(w), () => v(w)), [h, v, w]), /* @__PURE__ */ D(Te, { children: [
|
|
7969
7950
|
/* @__PURE__ */ d(z.span, { id: c.textId, ...a, ref: g }),
|
|
7970
7951
|
c.isSelected && s.valueNode && !s.valueNodeHasChildren && !Go(s.value) ? kt.createPortal(a.children, s.valueNode) : null
|
|
7971
7952
|
] });
|
|
@@ -8081,7 +8062,7 @@ var vl = "SelectBubbleInput", bl = l.forwardRef(
|
|
|
8081
8062
|
const R = new Event("change", { bubbles: !0 });
|
|
8082
8063
|
S.call(b, h), b.dispatchEvent(R);
|
|
8083
8064
|
}
|
|
8084
|
-
}, [v, h]), /* @__PURE__ */
|
|
8065
|
+
}, [v, h]), /* @__PURE__ */ D(
|
|
8085
8066
|
z.select,
|
|
8086
8067
|
{
|
|
8087
8068
|
"aria-hidden": !0,
|
|
@@ -8138,7 +8119,7 @@ function yl(e, t, o) {
|
|
|
8138
8119
|
function ih(e, t) {
|
|
8139
8120
|
return e.map((o, r) => e[(t + r) % e.length]);
|
|
8140
8121
|
}
|
|
8141
|
-
const gv = qi, vv = cl, bv = Ji, lh = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */
|
|
8122
|
+
const gv = qi, vv = cl, bv = Ji, lh = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */ D(
|
|
8142
8123
|
bn,
|
|
8143
8124
|
{
|
|
8144
8125
|
ref: r,
|
|
@@ -8174,7 +8155,7 @@ const Cl = l.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ d(
|
|
|
8174
8155
|
}
|
|
8175
8156
|
));
|
|
8176
8157
|
Cl.displayName = En.displayName;
|
|
8177
|
-
const ch = l.forwardRef(({ className: e, children: t, position: o = "popper", ...r }, n) => /* @__PURE__ */ d(ol, { children: /* @__PURE__ */
|
|
8158
|
+
const ch = l.forwardRef(({ className: e, children: t, position: o = "popper", ...r }, n) => /* @__PURE__ */ d(ol, { children: /* @__PURE__ */ D(
|
|
8178
8159
|
wn,
|
|
8179
8160
|
{
|
|
8180
8161
|
ref: n,
|
|
@@ -8204,7 +8185,7 @@ const ch = l.forwardRef(({ className: e, children: t, position: o = "popper", ..
|
|
|
8204
8185
|
ch.displayName = wn.displayName;
|
|
8205
8186
|
const dh = l.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ d(xn, { ref: o, className: k("py-1.5 pl-8 pr-2 text-sm font-semibold", e), ...t }));
|
|
8206
8187
|
dh.displayName = xn.displayName;
|
|
8207
|
-
const uh = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */
|
|
8188
|
+
const uh = l.forwardRef(({ className: e, children: t, ...o }, r) => /* @__PURE__ */ D(
|
|
8208
8189
|
Cn,
|
|
8209
8190
|
{
|
|
8210
8191
|
ref: r,
|
|
@@ -8278,11 +8259,11 @@ const wh = qt(
|
|
|
8278
8259
|
}
|
|
8279
8260
|
}
|
|
8280
8261
|
), Nl = l.forwardRef(
|
|
8281
|
-
({ side: e = "right", className: t, children: o, ...r }, n) => /* @__PURE__ */
|
|
8262
|
+
({ side: e = "right", className: t, children: o, ...r }, n) => /* @__PURE__ */ D(bh, { children: [
|
|
8282
8263
|
/* @__PURE__ */ d(Rl, {}),
|
|
8283
|
-
/* @__PURE__ */
|
|
8264
|
+
/* @__PURE__ */ D(Dt, { ref: n, className: k(wh({ side: e }), t), ...r, children: [
|
|
8284
8265
|
o,
|
|
8285
|
-
/* @__PURE__ */
|
|
8266
|
+
/* @__PURE__ */ D(ut, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
8286
8267
|
/* @__PURE__ */ d(Zt, { className: "h-4 w-4" }),
|
|
8287
8268
|
/* @__PURE__ */ d("span", { className: "sr-only", children: "Close" })
|
|
8288
8269
|
] })
|
|
@@ -8392,7 +8373,7 @@ function Kh(e) {
|
|
|
8392
8373
|
}
|
|
8393
8374
|
var Gh = (e) => {
|
|
8394
8375
|
var t, o, r, n, a, s, i, c, u, f, m;
|
|
8395
|
-
let { invert: g, toast: p, unstyled: w, interacting: h, setHeights: v, visibleToasts: y, heights: b, index: x, toasts: C, expanded: S, removeToast: R, defaultRichColors: N, closeButton: F, style: P, cancelButtonStyle: I, actionButtonStyle: M, className: T = "", descriptionClassName: j = "", duration: E, position: H, gap: B, loadingIcon: V, expandByDefault: L, classNames: O, icons: X, closeButtonAriaLabel: J = "Close toast", pauseWhenPageIsHidden: U } = e, [K, q] = A.useState(null), [se, de] = A.useState(null), [
|
|
8376
|
+
let { invert: g, toast: p, unstyled: w, interacting: h, setHeights: v, visibleToasts: y, heights: b, index: x, toasts: C, expanded: S, removeToast: R, defaultRichColors: N, closeButton: F, style: P, cancelButtonStyle: I, actionButtonStyle: M, className: T = "", descriptionClassName: j = "", duration: E, position: H, gap: B, loadingIcon: V, expandByDefault: L, classNames: O, icons: X, closeButtonAriaLabel: J = "Close toast", pauseWhenPageIsHidden: U } = e, [K, q] = A.useState(null), [se, de] = A.useState(null), [_, ee] = A.useState(!1), [ae, Z] = A.useState(!1), [Q, re] = A.useState(!1), [be, ue] = A.useState(!1), [Ht, pt] = A.useState(!1), [zt, er] = A.useState(0), [pc, _n] = A.useState(0), Vt = A.useRef(p.duration || E || wa), Dn = A.useRef(null), nt = A.useRef(null), mc = x === 0, hc = x + 1 <= y, we = p.type, mt = p.dismissible !== !1, gc = p.className || "", vc = p.descriptionClassName || "", to = A.useMemo(() => b.findIndex((W) => W.toastId === p.id) || 0, [b, p.id]), bc = A.useMemo(() => {
|
|
8396
8377
|
var W;
|
|
8397
8378
|
return (W = p.closeButton) != null ? W : F;
|
|
8398
8379
|
}, [p.closeButton, F]), In = A.useMemo(() => p.duration || E || wa, [p.duration, E]), tr = A.useRef(0), ht = A.useRef(0), Mn = A.useRef(0), gt = A.useRef(null), [wc, yc] = H.split("-"), Ln = A.useMemo(() => b.reduce((W, te, ne) => ne >= to ? W : W + te.height, 0), [b, to]), $n = _h(), xc = p.invert || g, or = we === "loading";
|
|
@@ -8407,12 +8388,12 @@ var Gh = (e) => {
|
|
|
8407
8388
|
return _n(te), v((ne) => [{ toastId: p.id, height: te, position: p.position }, ...ne]), () => v((ne) => ne.filter((xe) => xe.toastId !== p.id));
|
|
8408
8389
|
}
|
|
8409
8390
|
}, [v, p.id]), A.useLayoutEffect(() => {
|
|
8410
|
-
if (!
|
|
8391
|
+
if (!_) return;
|
|
8411
8392
|
let W = nt.current, te = W.style.height;
|
|
8412
8393
|
W.style.height = "auto";
|
|
8413
8394
|
let ne = W.getBoundingClientRect().height;
|
|
8414
8395
|
W.style.height = te, _n(ne), v((xe) => xe.find((Ce) => Ce.toastId === p.id) ? xe.map((Ce) => Ce.toastId === p.id ? { ...Ce, height: ne } : Ce) : [{ toastId: p.id, height: ne, position: p.position }, ...xe]);
|
|
8415
|
-
}, [
|
|
8396
|
+
}, [_, p.title, p.description, v, p.id]);
|
|
8416
8397
|
let Ve = A.useCallback(() => {
|
|
8417
8398
|
Z(!0), er(ht.current), v((W) => W.filter((te) => te.toastId !== p.id)), setTimeout(() => {
|
|
8418
8399
|
R(p);
|
|
@@ -8438,7 +8419,7 @@ var Gh = (e) => {
|
|
|
8438
8419
|
var W, te, ne;
|
|
8439
8420
|
return X != null && X.loading ? A.createElement("div", { className: Ee(O?.loader, (W = p?.classNames) == null ? void 0 : W.loader, "sonner-loader"), "data-visible": we === "loading" }, X.loading) : V ? A.createElement("div", { className: Ee(O?.loader, (te = p?.classNames) == null ? void 0 : te.loader, "sonner-loader"), "data-visible": we === "loading" }, V) : A.createElement(Nh, { className: Ee(O?.loader, (ne = p?.classNames) == null ? void 0 : ne.loader), visible: we === "loading" });
|
|
8440
8421
|
}
|
|
8441
|
-
return A.createElement("li", { tabIndex: 0, ref: nt, className: Ee(T, gc, O?.toast, (t = p?.classNames) == null ? void 0 : t.toast, O?.default, O?.[we], (o = p?.classNames) == null ? void 0 : o[we]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : N, "data-styled": !(p.jsx || p.unstyled || w), "data-mounted":
|
|
8422
|
+
return A.createElement("li", { tabIndex: 0, ref: nt, className: Ee(T, gc, O?.toast, (t = p?.classNames) == null ? void 0 : t.toast, O?.default, O?.[we], (o = p?.classNames) == null ? void 0 : o[we]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : N, "data-styled": !(p.jsx || p.unstyled || w), "data-mounted": _, "data-promise": !!p.promise, "data-swiped": Ht, "data-removed": ae, "data-visible": hc, "data-y-position": wc, "data-x-position": yc, "data-index": x, "data-front": mc, "data-swiping": Q, "data-dismissible": mt, "data-type": we, "data-invert": xc, "data-swipe-out": be, "data-swipe-direction": se, "data-expanded": !!(S || L && _), style: { "--index": x, "--toasts-before": x, "--z-index": C.length - x, "--offset": `${ae ? zt : ht.current}px`, "--initial-height": L ? "auto" : `${pc}px`, ...P, ...p.style }, onDragEnd: () => {
|
|
8442
8423
|
re(!1), q(null), gt.current = null;
|
|
8443
8424
|
}, onPointerDown: (W) => {
|
|
8444
8425
|
or || !mt || (Dn.current = /* @__PURE__ */ new Date(), er(ht.current), W.target.setPointerCapture(W.pointerId), W.target.tagName !== "BUTTON" && (re(!0), gt.current = { x: W.clientX, y: W.clientY }));
|
|
@@ -8545,17 +8526,17 @@ var qh = Po(function(e, t) {
|
|
|
8545
8526
|
}, [V.current]), A.createElement("section", { ref: t, "aria-label": `${C} ${L}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, F.map((U, K) => {
|
|
8546
8527
|
var q;
|
|
8547
8528
|
let [se, de] = U.split("-");
|
|
8548
|
-
return R.length ? A.createElement("ol", { key: U, dir: v === "auto" ? ya() : v, tabIndex: -1, ref: V, className: i, "data-sonner-toaster": !0, "data-theme": H, "data-y-position": se, "data-lifted": M && R.length > 1 && !a, "data-x-position": de, style: { "--front-toast-height": `${((q = P[0]) == null ? void 0 : q.height) || 0}px`, "--width": `${Wh}px`, "--gap": `${y}px`, ...p, ...Xh(c, u) }, onBlur: (
|
|
8549
|
-
X.current && !
|
|
8550
|
-
}, onFocus: (
|
|
8551
|
-
|
|
8529
|
+
return R.length ? A.createElement("ol", { key: U, dir: v === "auto" ? ya() : v, tabIndex: -1, ref: V, className: i, "data-sonner-toaster": !0, "data-theme": H, "data-y-position": se, "data-lifted": M && R.length > 1 && !a, "data-x-position": de, style: { "--front-toast-height": `${((q = P[0]) == null ? void 0 : q.height) || 0}px`, "--width": `${Wh}px`, "--gap": `${y}px`, ...p, ...Xh(c, u) }, onBlur: (_) => {
|
|
8530
|
+
X.current && !_.currentTarget.contains(_.relatedTarget) && (X.current = !1, O.current && (O.current.focus({ preventScroll: !0 }), O.current = null));
|
|
8531
|
+
}, onFocus: (_) => {
|
|
8532
|
+
_.target instanceof HTMLElement && _.target.dataset.dismissible === "false" || X.current || (X.current = !0, O.current = _.relatedTarget);
|
|
8552
8533
|
}, onMouseEnter: () => T(!0), onMouseMove: () => T(!0), onMouseLeave: () => {
|
|
8553
8534
|
j || T(!1);
|
|
8554
|
-
}, onDragEnd: () => T(!1), onPointerDown: (
|
|
8555
|
-
|
|
8556
|
-
}, onPointerUp: () => E(!1) }, R.filter((
|
|
8535
|
+
}, onDragEnd: () => T(!1), onPointerDown: (_) => {
|
|
8536
|
+
_.target instanceof HTMLElement && _.target.dataset.dismissible === "false" || E(!0);
|
|
8537
|
+
}, onPointerUp: () => E(!1) }, R.filter((_) => !_.position && K === 0 || _.position === U).map((_, ee) => {
|
|
8557
8538
|
var ae, Z;
|
|
8558
|
-
return A.createElement(Gh, { key:
|
|
8539
|
+
return A.createElement(Gh, { key: _.id, icons: x, index: ee, toast: _, defaultRichColors: m, duration: (ae = h?.duration) != null ? ae : g, className: h?.className, descriptionClassName: h?.descriptionClassName, invert: o, visibleToasts: w, closeButton: (Z = h?.closeButton) != null ? Z : s, interacting: j, position: U, style: h?.style, unstyled: h?.unstyled, classNames: h?.classNames, cancelButtonStyle: h?.cancelButtonStyle, actionButtonStyle: h?.actionButtonStyle, removeToast: J, toasts: R.filter((Q) => Q.position == _.position), heights: P.filter((Q) => Q.position == _.position), setHeights: I, expandByDefault: a, gap: y, loadingIcon: b, expanded: M, pauseWhenPageIsHidden: S, swipeDirections: e.swipeDirections });
|
|
8559
8540
|
})) : null;
|
|
8560
8541
|
}));
|
|
8561
8542
|
});
|
|
@@ -8679,7 +8660,7 @@ var Pn = l.forwardRef(
|
|
|
8679
8660
|
name: r,
|
|
8680
8661
|
form: f,
|
|
8681
8662
|
value: c,
|
|
8682
|
-
internal_do_not_use_render: ({ isFormControl: g }) => /* @__PURE__ */
|
|
8663
|
+
internal_do_not_use_render: ({ isFormControl: g }) => /* @__PURE__ */ D(Te, { children: [
|
|
8683
8664
|
/* @__PURE__ */ d(
|
|
8684
8665
|
Tl,
|
|
8685
8666
|
{
|
|
@@ -8945,7 +8926,7 @@ var Ll = "ToastViewport", pg = ["F8"], kr = "toast.viewportPause", Or = "toast.v
|
|
|
8945
8926
|
};
|
|
8946
8927
|
return v.addEventListener("keydown", y), () => v.removeEventListener("keydown", y);
|
|
8947
8928
|
}
|
|
8948
|
-
}, [i, h]), /* @__PURE__ */
|
|
8929
|
+
}, [i, h]), /* @__PURE__ */ D(
|
|
8949
8930
|
dd,
|
|
8950
8931
|
{
|
|
8951
8932
|
ref: c,
|
|
@@ -9084,7 +9065,7 @@ var [bg, wg] = Il(eo, {
|
|
|
9084
9065
|
a && !h.isClosePausedRef.current && T(S);
|
|
9085
9066
|
}, [a, S, h.isClosePausedRef, T]), l.useEffect(() => (P(), () => I()), [P, I]);
|
|
9086
9067
|
const j = l.useMemo(() => v ? Yl(v) : null, [v]);
|
|
9087
|
-
return h.viewport ? /* @__PURE__ */
|
|
9068
|
+
return h.viewport ? /* @__PURE__ */ D(Te, { children: [
|
|
9088
9069
|
j && /* @__PURE__ */ d(
|
|
9089
9070
|
xg,
|
|
9090
9071
|
{
|
|
@@ -9157,7 +9138,7 @@ var [bg, wg] = Il(eo, {
|
|
|
9157
9138
|
return Eg(() => s(!0)), l.useEffect(() => {
|
|
9158
9139
|
const u = window.setTimeout(() => c(!0), 1e3);
|
|
9159
9140
|
return () => window.clearTimeout(u);
|
|
9160
|
-
}, []), i ? null : /* @__PURE__ */ d(Xt, { asChild: !0, container: n.announcerContainer || void 0, children: /* @__PURE__ */ d(Uo, { ...r, children: a && /* @__PURE__ */
|
|
9141
|
+
}, []), i ? null : /* @__PURE__ */ d(Xt, { asChild: !0, container: n.announcerContainer || void 0, children: /* @__PURE__ */ d(Uo, { ...r, children: a && /* @__PURE__ */ D(Te, { children: [
|
|
9161
9142
|
n.label,
|
|
9162
9143
|
" ",
|
|
9163
9144
|
o
|
|
@@ -9410,10 +9391,10 @@ function Lg() {
|
|
|
9410
9391
|
}
|
|
9411
9392
|
function Ev() {
|
|
9412
9393
|
const { toasts: e } = Lg();
|
|
9413
|
-
return /* @__PURE__ */
|
|
9394
|
+
return /* @__PURE__ */ D(Tg, { children: [
|
|
9414
9395
|
e.map(function({ id: t, title: o, description: r, action: n, ...a }) {
|
|
9415
|
-
return /* @__PURE__ */
|
|
9416
|
-
/* @__PURE__ */
|
|
9396
|
+
return /* @__PURE__ */ D(ec, { ...a, children: [
|
|
9397
|
+
/* @__PURE__ */ D("div", { className: "grid gap-1", children: [
|
|
9417
9398
|
o && /* @__PURE__ */ d(oc, { children: o }),
|
|
9418
9399
|
r && /* @__PURE__ */ d(rc, { children: r })
|
|
9419
9400
|
] }),
|
|
@@ -9600,7 +9581,7 @@ var Hg = "TooltipPortal", [Rv, zg] = Zo(Hg, {
|
|
|
9600
9581
|
onPointerDownOutside: s,
|
|
9601
9582
|
onFocusOutside: (m) => m.preventDefault(),
|
|
9602
9583
|
onDismiss: f,
|
|
9603
|
-
children: /* @__PURE__ */
|
|
9584
|
+
children: /* @__PURE__ */ D(
|
|
9604
9585
|
cn,
|
|
9605
9586
|
{
|
|
9606
9587
|
"data-state": c.stateAttribute,
|
|
@@ -9752,11 +9733,11 @@ function kv({
|
|
|
9752
9733
|
onCTA: r,
|
|
9753
9734
|
ctaLabel: n = "Invite"
|
|
9754
9735
|
}) {
|
|
9755
|
-
return /* @__PURE__ */
|
|
9736
|
+
return /* @__PURE__ */ D("div", { className: "flex flex-col items-center justify-center py-16 px-4", children: [
|
|
9756
9737
|
/* @__PURE__ */ d("div", { className: "w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4", children: /* @__PURE__ */ d(Mf, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
9757
9738
|
/* @__PURE__ */ d("h3", { className: "text-lg font-semibold text-foreground mb-1", children: e }),
|
|
9758
9739
|
/* @__PURE__ */ d("p", { className: "text-sm text-muted-foreground text-center max-w-sm mb-6", children: t }),
|
|
9759
|
-
o && r && /* @__PURE__ */
|
|
9740
|
+
o && r && /* @__PURE__ */ D(lt, { onClick: r, className: "gap-2", children: [
|
|
9760
9741
|
/* @__PURE__ */ d(If, { className: "h-4 w-4" }),
|
|
9761
9742
|
n
|
|
9762
9743
|
] })
|
|
@@ -9772,13 +9753,13 @@ function Ov({
|
|
|
9772
9753
|
onSubmit: s,
|
|
9773
9754
|
children: i
|
|
9774
9755
|
}) {
|
|
9775
|
-
return /* @__PURE__ */ d(Lf, { open: e, onOpenChange: t, children: /* @__PURE__ */
|
|
9776
|
-
/* @__PURE__ */
|
|
9756
|
+
return /* @__PURE__ */ d(Lf, { open: e, onOpenChange: t, children: /* @__PURE__ */ D(zs, { className: "sm:max-w-[425px]", children: [
|
|
9757
|
+
/* @__PURE__ */ D(Vs, { children: [
|
|
9777
9758
|
/* @__PURE__ */ d(Us, { children: o }),
|
|
9778
9759
|
r && /* @__PURE__ */ d(js, { children: r })
|
|
9779
9760
|
] }),
|
|
9780
9761
|
i,
|
|
9781
|
-
/* @__PURE__ */
|
|
9762
|
+
/* @__PURE__ */ D(Ws, { children: [
|
|
9782
9763
|
/* @__PURE__ */ d(
|
|
9783
9764
|
lt,
|
|
9784
9765
|
{
|
|
@@ -9788,7 +9769,7 @@ function Ov({
|
|
|
9788
9769
|
children: "Cancel"
|
|
9789
9770
|
}
|
|
9790
9771
|
),
|
|
9791
|
-
/* @__PURE__ */ d(lt, { onClick: s, disabled: a, children: a ? /* @__PURE__ */
|
|
9772
|
+
/* @__PURE__ */ d(lt, { onClick: s, disabled: a, children: a ? /* @__PURE__ */ D(Te, { children: [
|
|
9792
9773
|
/* @__PURE__ */ d(Fs, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
9793
9774
|
"Submitting..."
|
|
9794
9775
|
] }) : n })
|
|
@@ -9806,12 +9787,12 @@ function rv({
|
|
|
9806
9787
|
isLoading: i = !1,
|
|
9807
9788
|
onConfirm: c
|
|
9808
9789
|
}) {
|
|
9809
|
-
return /* @__PURE__ */ d(nf, { open: e, onOpenChange: t, children: /* @__PURE__ */
|
|
9810
|
-
/* @__PURE__ */
|
|
9790
|
+
return /* @__PURE__ */ d(nf, { open: e, onOpenChange: t, children: /* @__PURE__ */ D(ys, { children: [
|
|
9791
|
+
/* @__PURE__ */ D(xs, { children: [
|
|
9811
9792
|
/* @__PURE__ */ d(Ss, { children: o }),
|
|
9812
9793
|
/* @__PURE__ */ d(Es, { children: r })
|
|
9813
9794
|
] }),
|
|
9814
|
-
/* @__PURE__ */
|
|
9795
|
+
/* @__PURE__ */ D(Cs, { children: [
|
|
9815
9796
|
/* @__PURE__ */ d(Ns, { disabled: i, children: a }),
|
|
9816
9797
|
/* @__PURE__ */ d(
|
|
9817
9798
|
Rs,
|
|
@@ -9849,7 +9830,7 @@ const fc = Ec(null), nv = Po(
|
|
|
9849
9830
|
portalTarget: a,
|
|
9850
9831
|
isDismissingRef: i
|
|
9851
9832
|
}), [f, a]);
|
|
9852
|
-
return /* @__PURE__ */
|
|
9833
|
+
return /* @__PURE__ */ D(fc.Provider, { value: w, children: [
|
|
9853
9834
|
t,
|
|
9854
9835
|
/* @__PURE__ */ d(vh, { open: u, onOpenChange: p, children: /* @__PURE__ */ d(Nl, { className: "w-full sm:max-w-md !p-0", children: /* @__PURE__ */ d("div", { ref: s, className: "relative h-full overflow-hidden isolate" }) }) })
|
|
9855
9836
|
] });
|
|
@@ -9927,7 +9908,7 @@ function Dv({ value: e, onSave: t, className: o, readOnly: r }) {
|
|
|
9927
9908
|
}, [p, w, m]), v = he((y) => {
|
|
9928
9909
|
f.current?.contains(y.relatedTarget) || p();
|
|
9929
9910
|
}, [p]);
|
|
9930
|
-
return r ? /* @__PURE__ */ d("h2", { className: k("text-lg font-semibold truncate", o), children: e }) : n ? /* @__PURE__ */
|
|
9911
|
+
return r ? /* @__PURE__ */ d("h2", { className: k("text-lg font-semibold truncate", o), children: e }) : n ? /* @__PURE__ */ D("div", { className: "flex items-center gap-2", children: [
|
|
9931
9912
|
/* @__PURE__ */ d(
|
|
9932
9913
|
Ys,
|
|
9933
9914
|
{
|
|
@@ -9951,14 +9932,14 @@ function Dv({ value: e, onSave: t, className: o, readOnly: r }) {
|
|
|
9951
9932
|
"h-8 w-8 shrink-0 text-white hover:translate-y-0 hover:shadow-none disabled:opacity-40",
|
|
9952
9933
|
m ? "bg-green-500 hover:bg-green-600 disabled:bg-green-500" : "bg-red-500 hover:bg-red-600"
|
|
9953
9934
|
),
|
|
9954
|
-
children: /* @__PURE__ */
|
|
9935
|
+
children: /* @__PURE__ */ D("div", { className: "relative h-4 w-4", children: [
|
|
9955
9936
|
/* @__PURE__ */ d(Fs, { className: k("h-4 w-4 absolute transition-opacity duration-200 animate-spin", c ? "opacity-100" : "opacity-0") }),
|
|
9956
9937
|
/* @__PURE__ */ d(qr, { className: k("h-4 w-4 absolute transition-opacity duration-200", !c && m ? "opacity-100" : "opacity-0") }),
|
|
9957
9938
|
/* @__PURE__ */ d(Zt, { className: k("h-4 w-4 absolute transition-opacity duration-200", !c && !m ? "opacity-100" : "opacity-0") })
|
|
9958
9939
|
] })
|
|
9959
9940
|
}
|
|
9960
9941
|
)
|
|
9961
|
-
] }) : /* @__PURE__ */
|
|
9942
|
+
] }) : /* @__PURE__ */ D("div", { className: "group flex items-center gap-2", children: [
|
|
9962
9943
|
/* @__PURE__ */ d(
|
|
9963
9944
|
"h2",
|
|
9964
9945
|
{
|
|
@@ -9991,7 +9972,7 @@ function iv({
|
|
|
9991
9972
|
onConfirm: a
|
|
9992
9973
|
}) {
|
|
9993
9974
|
const [s, i] = ce(!1);
|
|
9994
|
-
return /* @__PURE__ */
|
|
9975
|
+
return /* @__PURE__ */ D(Te, { children: [
|
|
9995
9976
|
/* @__PURE__ */ d(
|
|
9996
9977
|
lt,
|
|
9997
9978
|
{
|
|
@@ -10018,13 +9999,13 @@ function iv({
|
|
|
10018
9999
|
] });
|
|
10019
10000
|
}
|
|
10020
10001
|
function Iv({ actions: e }) {
|
|
10021
|
-
return /* @__PURE__ */
|
|
10002
|
+
return /* @__PURE__ */ D("div", { className: "space-y-2", children: [
|
|
10022
10003
|
/* @__PURE__ */ d("h3", { className: "text-sm font-semibold text-foreground", children: "Danger Zone" }),
|
|
10023
10004
|
e.map((t, o) => /* @__PURE__ */ d(iv, { ...t }, o))
|
|
10024
10005
|
] });
|
|
10025
10006
|
}
|
|
10026
10007
|
function Mv({ icon: e, label: t, badge: o, onClick: r }) {
|
|
10027
|
-
return /* @__PURE__ */
|
|
10008
|
+
return /* @__PURE__ */ D(
|
|
10028
10009
|
"button",
|
|
10029
10010
|
{
|
|
10030
10011
|
type: "button",
|
|
@@ -10040,7 +10021,7 @@ function Mv({ icon: e, label: t, badge: o, onClick: r }) {
|
|
|
10040
10021
|
);
|
|
10041
10022
|
}
|
|
10042
10023
|
function Lv({ icon: e, message: t }) {
|
|
10043
|
-
return /* @__PURE__ */
|
|
10024
|
+
return /* @__PURE__ */ D("div", { className: "p-4 bg-muted/30 rounded-lg text-center", children: [
|
|
10044
10025
|
/* @__PURE__ */ d("div", { className: "h-8 w-8 text-muted-foreground mx-auto mb-2 [&>svg]:h-8 [&>svg]:w-8 [&>svg]:mx-auto", children: e }),
|
|
10045
10026
|
/* @__PURE__ */ d("p", { className: "text-sm text-muted-foreground", children: t })
|
|
10046
10027
|
] });
|