@moondreamsdev/dreamer-ui 1.7.16 → 1.7.17-test.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/{Toast-hraOWsUl.cjs → Toast-Ck5u3kQt.cjs} +2 -2
- package/dist/Toast-Ck5u3kQt.cjs.map +1 -0
- package/dist/{Toast-aRIuMq3v.js → Toast-GnTYRmnY.js} +17 -12
- package/dist/Toast-GnTYRmnY.js.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.esm.js +62 -62
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.cjs.js.map +1 -1
- package/dist/providers.esm.js +5 -5
- package/dist/providers.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/Toast-aRIuMq3v.js.map +0 -1
- package/dist/Toast-hraOWsUl.cjs.map +0 -1
package/dist/components.esm.js
CHANGED
|
@@ -2,11 +2,11 @@ var et = Object.defineProperty;
|
|
|
2
2
|
var tt = (r, o, t) => o in r ? et(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
|
|
3
3
|
var Re = (r, o, t) => tt(r, typeof o != "symbol" ? o + "" : o, t);
|
|
4
4
|
import { jsxs as w, jsx as e, Fragment as te } from "react/jsx-runtime";
|
|
5
|
-
import
|
|
5
|
+
import Z, { useId as J, useState as R, createElement as rt, useEffect as V, useCallback as $, useMemo as ne, useRef as q, Component as nt, isValidElement as at, cloneElement as ot } from "react";
|
|
6
6
|
import { j as k } from "./join-BmgR_f4v.js";
|
|
7
|
-
import { f as Ne, g as ye, h as he, k as st, c as
|
|
8
|
-
import { u as Me, D as wt, n as
|
|
9
|
-
import { A as Ma, T as Ta } from "./Toast-
|
|
7
|
+
import { f as Ne, g as ye, h as he, k as st, c as Ze, D as Qe, b as ze, W as lt, l as it, j as ct, C as dt, a as ut, G as ft, i as Ue, T as mt, P as pt, Q as ht, m as bt, E as gt, I as xt, d as yt, e as vt } from "./Window-bavT8vOT.js";
|
|
8
|
+
import { u as Me, D as wt, n as Y, a as kt, b as Te } from "./Toast-GnTYRmnY.js";
|
|
9
|
+
import { A as Ma, T as Ta } from "./Toast-GnTYRmnY.js";
|
|
10
10
|
import { X as be, E as ve, C as Nt, I as Be } from "./X-CIoyLewf.js";
|
|
11
11
|
import "./useTheme-CYIEopvl.js";
|
|
12
12
|
import { u as Dt } from "./useScreenSize-DiuQZBHb.js";
|
|
@@ -113,8 +113,8 @@ function ea({
|
|
|
113
113
|
h
|
|
114
114
|
);
|
|
115
115
|
}),
|
|
116
|
-
o.length === 0 && t &&
|
|
117
|
-
if (
|
|
116
|
+
o.length === 0 && t && Z.Children.map(t, (b, D) => {
|
|
117
|
+
if (Z.isValidElement(b) && b.type === Ce) {
|
|
118
118
|
const h = b.props.id || x(D);
|
|
119
119
|
return /* @__PURE__ */ rt(
|
|
120
120
|
Ce,
|
|
@@ -541,7 +541,7 @@ const Ht = {
|
|
|
541
541
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
542
542
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
543
543
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
544
|
-
},
|
|
544
|
+
}, Yt = {
|
|
545
545
|
stripped: "",
|
|
546
546
|
fitted: "size-fit leading-0",
|
|
547
547
|
sm: "px-2 py-1 text-sm",
|
|
@@ -549,7 +549,7 @@ const Ht = {
|
|
|
549
549
|
lg: "px-6 py-3 text-lg",
|
|
550
550
|
icon: "p-1 w-fit aspect-square",
|
|
551
551
|
full: "p-2 w-full"
|
|
552
|
-
},
|
|
552
|
+
}, Zt = {
|
|
553
553
|
none: "rounded-none",
|
|
554
554
|
sm: "rounded-sm",
|
|
555
555
|
md: "rounded-md",
|
|
@@ -573,8 +573,8 @@ function Qt({
|
|
|
573
573
|
const i = k(
|
|
574
574
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
575
575
|
Ht[r],
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
Yt[l],
|
|
577
|
+
Zt[t],
|
|
578
578
|
s && "relative pointer-events-none",
|
|
579
579
|
n
|
|
580
580
|
);
|
|
@@ -591,10 +591,10 @@ function Qt({
|
|
|
591
591
|
children: a.children
|
|
592
592
|
}
|
|
593
593
|
);
|
|
594
|
-
const f = a, u = () => f.children ? typeof f.children == "string" || typeof f.children == "number" || typeof f.children == "boolean" ? /* @__PURE__ */ e("span", { className: k(s && "invisible"), children: f.children }) :
|
|
595
|
-
if (
|
|
594
|
+
const f = a, u = () => f.children ? typeof f.children == "string" || typeof f.children == "number" || typeof f.children == "boolean" ? /* @__PURE__ */ e("span", { className: k(s && "invisible"), children: f.children }) : Z.Children.map(f.children, (m, p) => {
|
|
595
|
+
if (Z.isValidElement(m)) {
|
|
596
596
|
const x = m.props;
|
|
597
|
-
return
|
|
597
|
+
return Z.cloneElement(m, {
|
|
598
598
|
key: p,
|
|
599
599
|
className: k(s && "invisible", x.className)
|
|
600
600
|
});
|
|
@@ -1068,7 +1068,7 @@ const er = {
|
|
|
1068
1068
|
}, tr = {
|
|
1069
1069
|
info: /* @__PURE__ */ e(Be, { size: 22 }),
|
|
1070
1070
|
destructive: /* @__PURE__ */ e(Nt, { size: 22 }),
|
|
1071
|
-
success: /* @__PURE__ */ e(
|
|
1071
|
+
success: /* @__PURE__ */ e(Ze, { size: 22 }),
|
|
1072
1072
|
warning: /* @__PURE__ */ e(ve, { size: 20 }),
|
|
1073
1073
|
base: /* @__PURE__ */ e(st, { size: 22 })
|
|
1074
1074
|
};
|
|
@@ -1305,7 +1305,7 @@ function sa({
|
|
|
1305
1305
|
gap: F = 8
|
|
1306
1306
|
}) {
|
|
1307
1307
|
var j, X;
|
|
1308
|
-
const B = q(null), N =
|
|
1308
|
+
const B = q(null), N = Z.Children.toArray(r).filter(Z.isValidElement), A = N.length, { screenSize: E } = Dt(), C = ne(() => {
|
|
1309
1309
|
if (typeof c == "number")
|
|
1310
1310
|
return c;
|
|
1311
1311
|
if (typeof c == "object" && c && E) {
|
|
@@ -1347,7 +1347,7 @@ function sa({
|
|
|
1347
1347
|
x === "aligned" ? "disabled:opacity-90" : "disabled:opacity-50"
|
|
1348
1348
|
);
|
|
1349
1349
|
return /* @__PURE__ */ w("div", { className: k("relative", s), "data-carousel-wrapper": "true", children: [
|
|
1350
|
-
!f && /* @__PURE__ */ e(te, { children: b ?
|
|
1350
|
+
!f && /* @__PURE__ */ e(te, { children: b ? Z.cloneElement(
|
|
1351
1351
|
b,
|
|
1352
1352
|
{
|
|
1353
1353
|
onClick: L,
|
|
@@ -1439,7 +1439,7 @@ function sa({
|
|
|
1439
1439
|
]
|
|
1440
1440
|
}
|
|
1441
1441
|
),
|
|
1442
|
-
!f && /* @__PURE__ */ e(te, { children: D ?
|
|
1442
|
+
!f && /* @__PURE__ */ e(te, { children: D ? Z.cloneElement(
|
|
1443
1443
|
D,
|
|
1444
1444
|
{
|
|
1445
1445
|
onClick: K,
|
|
@@ -2458,11 +2458,11 @@ function ua({
|
|
|
2458
2458
|
enabled: c
|
|
2459
2459
|
});
|
|
2460
2460
|
if (Ir(v, h), $r(h, s), !h) return null;
|
|
2461
|
-
const B = () => n ?
|
|
2461
|
+
const B = () => n ? Z.isValidElement(n) ? /* @__PURE__ */ e("div", { children: n }) : /* @__PURE__ */ e("h2", { className: "text-2xl font-semibold", id: b, children: n }) : null, N = () => {
|
|
2462
2462
|
if (!l) return null;
|
|
2463
|
-
if (
|
|
2463
|
+
if (Z.isValidElement(l)) {
|
|
2464
2464
|
const A = l, E = A.props.className || "";
|
|
2465
|
-
return
|
|
2465
|
+
return Z.cloneElement(A, { className: k("px-6 py-4", E) });
|
|
2466
2466
|
}
|
|
2467
2467
|
return /* @__PURE__ */ e("div", { className: "px-6 py-4", children: l });
|
|
2468
2468
|
};
|
|
@@ -2692,7 +2692,7 @@ function Rr({
|
|
|
2692
2692
|
var T, M;
|
|
2693
2693
|
x ? (h.current = document.activeElement, (T = b.current) == null || T.focus()) : ((M = h.current) == null || M.focus(), h.current = null);
|
|
2694
2694
|
}, [x]);
|
|
2695
|
-
const C = d.props, z =
|
|
2695
|
+
const C = d.props, z = Z.cloneElement(d, {
|
|
2696
2696
|
"aria-expanded": x,
|
|
2697
2697
|
"aria-haspopup": "dialog",
|
|
2698
2698
|
"aria-controls": g,
|
|
@@ -3004,7 +3004,7 @@ function fa({
|
|
|
3004
3004
|
isOpen: D,
|
|
3005
3005
|
onClose: h
|
|
3006
3006
|
});
|
|
3007
|
-
const B = ne(() =>
|
|
3007
|
+
const B = ne(() => Z.cloneElement(s, {
|
|
3008
3008
|
onClick: (N) => {
|
|
3009
3009
|
b && v((E) => !E);
|
|
3010
3010
|
const A = s.props;
|
|
@@ -3049,7 +3049,7 @@ const Kr = (r) => ({
|
|
|
3049
3049
|
separator: qr,
|
|
3050
3050
|
custom: Hr
|
|
3051
3051
|
};
|
|
3052
|
-
function
|
|
3052
|
+
function Yr(r = []) {
|
|
3053
3053
|
const [o, t] = R(r), [s, n] = R(null), [a, l] = R(null), d = q(null), i = $((h, g) => {
|
|
3054
3054
|
const y = {
|
|
3055
3055
|
...g,
|
|
@@ -3105,7 +3105,7 @@ function Zr(r = []) {
|
|
|
3105
3105
|
handleDrop: b
|
|
3106
3106
|
};
|
|
3107
3107
|
}
|
|
3108
|
-
const
|
|
3108
|
+
const Zr = {
|
|
3109
3109
|
sm: "text-sm",
|
|
3110
3110
|
md: "text-base",
|
|
3111
3111
|
lg: "text-lg"
|
|
@@ -3174,7 +3174,7 @@ function pa({
|
|
|
3174
3174
|
handleDragOver: K,
|
|
3175
3175
|
handleDragEnd: ae,
|
|
3176
3176
|
handleDrop: le
|
|
3177
|
-
} =
|
|
3177
|
+
} = Yr(r), ie = m || u;
|
|
3178
3178
|
V(() => {
|
|
3179
3179
|
if (!N.current) {
|
|
3180
3180
|
N.current = !0;
|
|
@@ -3217,14 +3217,14 @@ function pa({
|
|
|
3217
3217
|
}
|
|
3218
3218
|
}, O = () => {
|
|
3219
3219
|
if (!v) return null;
|
|
3220
|
-
const _ = k("font-medium opacity-60",
|
|
3220
|
+
const _ = k("font-medium opacity-60", Zr[o]);
|
|
3221
3221
|
if (typeof v == "string")
|
|
3222
3222
|
return /* @__PURE__ */ e("h4", { id: C, className: _, children: v });
|
|
3223
3223
|
const ee = v.props;
|
|
3224
|
-
return
|
|
3224
|
+
return Z.cloneElement(v, { id: C, className: k(_, ee.className) });
|
|
3225
3225
|
}, H = (_) => {
|
|
3226
3226
|
if (!c) return null;
|
|
3227
|
-
if (
|
|
3227
|
+
if (Z.isValidElement(c))
|
|
3228
3228
|
return c;
|
|
3229
3229
|
switch (c) {
|
|
3230
3230
|
case "disc":
|
|
@@ -3682,7 +3682,7 @@ function ke({ elementId: r, type: o, message: t }) {
|
|
|
3682
3682
|
),
|
|
3683
3683
|
role: "status",
|
|
3684
3684
|
children: [
|
|
3685
|
-
o === "error" ? /* @__PURE__ */ e(ve, {}) : /* @__PURE__ */ e(
|
|
3685
|
+
o === "error" ? /* @__PURE__ */ e(ve, {}) : /* @__PURE__ */ e(Ze, {}),
|
|
3686
3686
|
/* @__PURE__ */ e("span", { id: `${r}-${o}-message`, children: t })
|
|
3687
3687
|
]
|
|
3688
3688
|
}
|
|
@@ -4049,16 +4049,16 @@ function vn({
|
|
|
4049
4049
|
ref: d,
|
|
4050
4050
|
...i
|
|
4051
4051
|
}) {
|
|
4052
|
-
const { viewportRef: f, verticalThumbRef: u, horizontalThumbRef: c, isScrolling: m, isFadingOut: p, scrollbarVisible: x, handleScroll: v } = yn(n), b =
|
|
4052
|
+
const { viewportRef: f, verticalThumbRef: u, horizontalThumbRef: c, isScrolling: m, isFadingOut: p, scrollbarVisible: x, handleScroll: v } = yn(n), b = Y(
|
|
4053
4053
|
"relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",
|
|
4054
4054
|
o
|
|
4055
4055
|
);
|
|
4056
|
-
return /* @__PURE__ */ w("div", { ref: d, id: l, className:
|
|
4056
|
+
return /* @__PURE__ */ w("div", { ref: d, id: l, className: Y("relative overflow-hidden", r), "data-scroll-area-root": "", ...i, children: [
|
|
4057
4057
|
/* @__PURE__ */ e(
|
|
4058
4058
|
"div",
|
|
4059
4059
|
{
|
|
4060
4060
|
ref: f,
|
|
4061
|
-
className:
|
|
4061
|
+
className: Y(
|
|
4062
4062
|
"h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
4063
4063
|
t
|
|
4064
4064
|
),
|
|
@@ -4070,7 +4070,7 @@ function vn({
|
|
|
4070
4070
|
x.vertical && (m || p) && /* @__PURE__ */ e(
|
|
4071
4071
|
"div",
|
|
4072
4072
|
{
|
|
4073
|
-
className:
|
|
4073
|
+
className: Y(
|
|
4074
4074
|
"touch-none select-none transition-all duration-300",
|
|
4075
4075
|
"p-[1px]",
|
|
4076
4076
|
"absolute right-0 top-0",
|
|
@@ -4087,7 +4087,7 @@ function vn({
|
|
|
4087
4087
|
"div",
|
|
4088
4088
|
{
|
|
4089
4089
|
ref: u,
|
|
4090
|
-
className:
|
|
4090
|
+
className: Y("absolute rounded-full", b),
|
|
4091
4091
|
"data-scroll-area-thumb": "",
|
|
4092
4092
|
style: { height: "20%", top: "0%", width: "100%" }
|
|
4093
4093
|
}
|
|
@@ -4097,7 +4097,7 @@ function vn({
|
|
|
4097
4097
|
x.horizontal && (m || p) && /* @__PURE__ */ e(
|
|
4098
4098
|
"div",
|
|
4099
4099
|
{
|
|
4100
|
-
className:
|
|
4100
|
+
className: Y(
|
|
4101
4101
|
"touch-none select-none transition-all duration-300",
|
|
4102
4102
|
"p-[1px]",
|
|
4103
4103
|
"absolute bottom-0 left-0",
|
|
@@ -4114,7 +4114,7 @@ function vn({
|
|
|
4114
4114
|
"div",
|
|
4115
4115
|
{
|
|
4116
4116
|
ref: c,
|
|
4117
|
-
className:
|
|
4117
|
+
className: Y("absolute rounded-full", b),
|
|
4118
4118
|
"data-scroll-area-thumb": "",
|
|
4119
4119
|
style: { width: "20%", left: "0%", height: "100%" }
|
|
4120
4120
|
}
|
|
@@ -4124,7 +4124,7 @@ function vn({
|
|
|
4124
4124
|
x.vertical && x.horizontal && /* @__PURE__ */ e(
|
|
4125
4125
|
"div",
|
|
4126
4126
|
{
|
|
4127
|
-
className:
|
|
4127
|
+
className: Y("bg-transparent", "absolute bottom-0 right-0"),
|
|
4128
4128
|
"data-scroll-area-corner": "",
|
|
4129
4129
|
style: {
|
|
4130
4130
|
height: `${n}px`,
|
|
@@ -4528,7 +4528,7 @@ function Dn({
|
|
|
4528
4528
|
},
|
|
4529
4529
|
`${c.value}-${m}`
|
|
4530
4530
|
)),
|
|
4531
|
-
u.length === 0 && n &&
|
|
4531
|
+
u.length === 0 && n && Z.Children.map(n, (c) => Z.isValidElement(c) && c.type === Ie ? /* @__PURE__ */ e(
|
|
4532
4532
|
Ie,
|
|
4533
4533
|
{
|
|
4534
4534
|
...c.props,
|
|
@@ -4782,7 +4782,7 @@ function Cn({
|
|
|
4782
4782
|
left: "left-full top-1/2 -translate-y-1/2 border-t-[6px] border-b-[6px] border-l-[6px] border-t-transparent border-b-transparent border-l-tooltip",
|
|
4783
4783
|
right: "right-full top-1/2 -translate-y-1/2 border-t-[6px] border-b-[6px] border-r-[6px] border-t-transparent border-b-transparent border-r-tooltip"
|
|
4784
4784
|
}[s]) : "", N = o.props;
|
|
4785
|
-
return /* @__PURE__ */ e(te, { children:
|
|
4785
|
+
return /* @__PURE__ */ e(te, { children: Z.cloneElement(o, {
|
|
4786
4786
|
style: {
|
|
4787
4787
|
...N.style,
|
|
4788
4788
|
position: "relative"
|
|
@@ -4907,7 +4907,7 @@ function ya({
|
|
|
4907
4907
|
}) {
|
|
4908
4908
|
const x = J(), v = r || `modal-${x}`, b = r ? `${r}-title` : `modal-title-${x}`, { show: D, shouldRender: h } = En(o);
|
|
4909
4909
|
if (Sn(v, h), Fn(h, t), !h) return null;
|
|
4910
|
-
const g = () => s ?
|
|
4910
|
+
const g = () => s ? Z.isValidElement(s) ? /* @__PURE__ */ e("div", { className: "mb-4", children: s }) : /* @__PURE__ */ e("h2", { className: "mb-4 text-xl font-semibold", id: b, children: s }) : null, y = () => u.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: u.map((F, B) => {
|
|
4911
4911
|
const { label: N, ...A } = F;
|
|
4912
4912
|
return /* @__PURE__ */ e(Qt, { ...A, "data-modal-action": "true", children: N }, B);
|
|
4913
4913
|
}) });
|
|
@@ -4920,23 +4920,23 @@ function ya({
|
|
|
4920
4920
|
role: "dialog",
|
|
4921
4921
|
"aria-modal": "true",
|
|
4922
4922
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
4923
|
-
children: /* @__PURE__ */ w("div", { className:
|
|
4923
|
+
children: /* @__PURE__ */ w("div", { className: Y("flex min-h-screen items-center justify-center p-4", i), children: [
|
|
4924
4924
|
/* @__PURE__ */ e(
|
|
4925
4925
|
"div",
|
|
4926
4926
|
{
|
|
4927
|
-
className:
|
|
4927
|
+
className: Y("fixed inset-0 bg-black/20 transition-all", d),
|
|
4928
4928
|
onClick: () => {
|
|
4929
4929
|
c || t();
|
|
4930
4930
|
}
|
|
4931
4931
|
}
|
|
4932
4932
|
),
|
|
4933
|
-
a && /* @__PURE__ */ e("div", { className:
|
|
4933
|
+
a && /* @__PURE__ */ e("div", { className: Y("relative w-fit", l), children: n }),
|
|
4934
4934
|
!a && /* @__PURE__ */ w(
|
|
4935
4935
|
"div",
|
|
4936
4936
|
{
|
|
4937
4937
|
id: v,
|
|
4938
4938
|
tabIndex: -1,
|
|
4939
|
-
className:
|
|
4939
|
+
className: Y(
|
|
4940
4940
|
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in duration-75",
|
|
4941
4941
|
D ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
4942
4942
|
l
|
|
@@ -4996,19 +4996,19 @@ function va({
|
|
|
4996
4996
|
}, [c, t, r, o])(), x = r > 1, v = c || r < o, b = s && !c, D = s && !c, h = (y) => {
|
|
4997
4997
|
y >= 1 && (c || y <= o) && n(y);
|
|
4998
4998
|
}, g = $(() => {
|
|
4999
|
-
const y =
|
|
4999
|
+
const y = Y(
|
|
5000
5000
|
"flex items-center justify-center min-w-fit",
|
|
5001
5001
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
5002
5002
|
In[a],
|
|
5003
5003
|
"rounded-md"
|
|
5004
5004
|
);
|
|
5005
|
-
return
|
|
5005
|
+
return Y(y, An[l], f);
|
|
5006
5006
|
}, [l, a, f]);
|
|
5007
5007
|
return /* @__PURE__ */ w(
|
|
5008
5008
|
"nav",
|
|
5009
5009
|
{
|
|
5010
5010
|
ref: i,
|
|
5011
|
-
className:
|
|
5011
|
+
className: Y("flex items-center justify-center gap-1", d),
|
|
5012
5012
|
role: "navigation",
|
|
5013
5013
|
"aria-label": "Pagination",
|
|
5014
5014
|
"data-page": r,
|
|
@@ -5045,7 +5045,7 @@ function va({
|
|
|
5045
5045
|
"button",
|
|
5046
5046
|
{
|
|
5047
5047
|
onClick: () => h(y),
|
|
5048
|
-
className:
|
|
5048
|
+
className: Y(g(), "aspect-square"),
|
|
5049
5049
|
"aria-label": `Go to page ${y}`,
|
|
5050
5050
|
"aria-current": y === r ? !0 : void 0,
|
|
5051
5051
|
children: y
|
|
@@ -5142,11 +5142,11 @@ function wa({
|
|
|
5142
5142
|
}) {
|
|
5143
5143
|
const p = J(), x = o || `panel-${p}`, v = o ? `${o}-title` : `panel-title-${p}`, { show: b, shouldRender: D } = $n(t);
|
|
5144
5144
|
if (Mn(x, D), zn(D, s), !D) return null;
|
|
5145
|
-
const h = () => n ?
|
|
5145
|
+
const h = () => n ? Z.isValidElement(n) ? /* @__PURE__ */ e("div", { children: n }) : /* @__PURE__ */ e("h2", { className: "text-2xl font-semibold", id: v, children: n }) : null, g = () => {
|
|
5146
5146
|
if (!l) return null;
|
|
5147
|
-
if (
|
|
5147
|
+
if (Z.isValidElement(l)) {
|
|
5148
5148
|
const y = l, F = y.props.className || "";
|
|
5149
|
-
return
|
|
5149
|
+
return Z.cloneElement(y, { className: Y("px-6 py-4", F) });
|
|
5150
5150
|
}
|
|
5151
5151
|
return /* @__PURE__ */ e("div", { className: "px-6 py-4", children: l });
|
|
5152
5152
|
};
|
|
@@ -5164,7 +5164,7 @@ function wa({
|
|
|
5164
5164
|
/* @__PURE__ */ e(
|
|
5165
5165
|
"div",
|
|
5166
5166
|
{
|
|
5167
|
-
className:
|
|
5167
|
+
className: Y(
|
|
5168
5168
|
"fixed inset-0 bg-black/40 transition-opacity duration-300",
|
|
5169
5169
|
b ? "opacity-100" : "opacity-0",
|
|
5170
5170
|
i
|
|
@@ -5180,7 +5180,7 @@ function wa({
|
|
|
5180
5180
|
id: x,
|
|
5181
5181
|
ref: r,
|
|
5182
5182
|
tabIndex: -1,
|
|
5183
|
-
className:
|
|
5183
|
+
className: Y(
|
|
5184
5184
|
"relative h-full max-w-md transform shadow-xl bg-popover text-popover-foreground transition-transform duration-300 ease-in-out border-l border-border",
|
|
5185
5185
|
b ? "translate-x-0" : "translate-x-full",
|
|
5186
5186
|
d
|
|
@@ -5198,7 +5198,7 @@ function wa({
|
|
|
5198
5198
|
children: /* @__PURE__ */ e(be, { size: 18 })
|
|
5199
5199
|
}
|
|
5200
5200
|
),
|
|
5201
|
-
/* @__PURE__ */ e("div", { className:
|
|
5201
|
+
/* @__PURE__ */ e("div", { className: Y("flex-1 overflow-y-auto px-6 pb-6", n ? "pt-6" : "pt-10"), children: a }),
|
|
5202
5202
|
g()
|
|
5203
5203
|
] })
|
|
5204
5204
|
}
|
|
@@ -5429,7 +5429,7 @@ function Da({
|
|
|
5429
5429
|
{
|
|
5430
5430
|
id: r,
|
|
5431
5431
|
ref: m,
|
|
5432
|
-
className:
|
|
5432
|
+
className: Y(
|
|
5433
5433
|
"relative flex items-center w-full touch-none select-none",
|
|
5434
5434
|
d && "opacity-50 cursor-not-allowed",
|
|
5435
5435
|
c
|
|
@@ -5444,7 +5444,7 @@ function Da({
|
|
|
5444
5444
|
"div",
|
|
5445
5445
|
{
|
|
5446
5446
|
ref: y,
|
|
5447
|
-
className:
|
|
5447
|
+
className: Y(
|
|
5448
5448
|
"relative h-1.5 w-full rounded-full bg-muted cursor-pointer",
|
|
5449
5449
|
d && "cursor-not-allowed",
|
|
5450
5450
|
i
|
|
@@ -5454,7 +5454,7 @@ function Da({
|
|
|
5454
5454
|
/* @__PURE__ */ e(
|
|
5455
5455
|
"div",
|
|
5456
5456
|
{
|
|
5457
|
-
className:
|
|
5457
|
+
className: Y(
|
|
5458
5458
|
"absolute h-full rounded-full pointer-events-none",
|
|
5459
5459
|
// pointer-events are disabled so that user interactions are handled by the track element, enabling correct slider behavior
|
|
5460
5460
|
!F.current && "transition-all",
|
|
@@ -5466,7 +5466,7 @@ function Da({
|
|
|
5466
5466
|
/* @__PURE__ */ e(
|
|
5467
5467
|
"div",
|
|
5468
5468
|
{
|
|
5469
|
-
className:
|
|
5469
|
+
className: Y(
|
|
5470
5470
|
"absolute size-5 -top-2 rounded-full shadow-md cursor-grab",
|
|
5471
5471
|
d && "cursor-not-allowed",
|
|
5472
5472
|
!d && "cursor-grab focus:outline-none focus:ring-2",
|
|
@@ -5611,7 +5611,7 @@ function Ca({
|
|
|
5611
5611
|
isAllSelected: T,
|
|
5612
5612
|
isPartiallySelected: M
|
|
5613
5613
|
} = Ln({ initialSelected: i }), I = n.map((L, K) => d(L, K));
|
|
5614
|
-
|
|
5614
|
+
Z.useEffect(() => {
|
|
5615
5615
|
f && f(Array.from(B));
|
|
5616
5616
|
}, [B, f]);
|
|
5617
5617
|
const G = () => {
|
|
@@ -5902,15 +5902,15 @@ const Wn = {
|
|
|
5902
5902
|
unchecked: "bg-muted",
|
|
5903
5903
|
checked: "bg-destructive"
|
|
5904
5904
|
}
|
|
5905
|
-
},
|
|
5905
|
+
}, Ye = {
|
|
5906
5906
|
variant: "default",
|
|
5907
5907
|
size: "md"
|
|
5908
5908
|
};
|
|
5909
5909
|
function Ia({
|
|
5910
5910
|
ref: r,
|
|
5911
5911
|
id: o,
|
|
5912
|
-
size: t =
|
|
5913
|
-
variant: s =
|
|
5912
|
+
size: t = Ye.size,
|
|
5913
|
+
variant: s = Ye.variant,
|
|
5914
5914
|
checked: n,
|
|
5915
5915
|
onCheckedChange: a,
|
|
5916
5916
|
disabled: l = !1,
|
package/dist/providers.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),g=require("./Toast-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),g=require("./Toast-Ck5u3kQt.cjs"),T=require("./useTheme-Bdg1t0Zr.cjs");require("react-dom");const y=require("./join-BVMUUvyP.cjs");function x({children:u}){const[e,i]=s.useState(null),f=s.useCallback(r=>new Promise(d=>{i({isOpen:!0,type:"confirm",title:r.title,message:r.message,confirmText:r.confirmText,cancelText:r.cancelText,destructive:r.destructive,resolve:d})}),[]),l=s.useCallback(r=>new Promise(d=>{i({isOpen:!0,type:"alert",title:r.title,message:r.message,confirmText:r.confirmText,destructive:r.destructive,resolve:d})}),[]),o=s.useCallback(()=>{e!=null&&e.resolve&&(e.type==="confirm"?e.resolve(!1):e.resolve()),i(null)},[e]),m=s.useCallback(()=>{e!=null&&e.resolve&&(e.type==="confirm"?e.resolve(!0):e.resolve()),i(null)},[e]),c={confirm:f,alert:l};return a.jsxs(T.ActionModalContext.Provider,{value:c,children:[u,e&&e.type==="alert"&&a.jsx(g.ActionModal,{type:"alert",isOpen:e.isOpen,onClose:o,title:e.title,message:e.message,confirmText:e.confirmText,destructive:e.destructive,onConfirm:m,className:"bg-white dark:bg-gray-800 rounded-lg"}),e&&e.type==="confirm"&&a.jsx(g.ActionModal,{type:"confirm",isOpen:e.isOpen,onClose:o,title:e.title,message:e.message,confirmText:e.confirmText,cancelText:e.cancelText,destructive:e.destructive,onConfirm:m,className:"bg-white dark:bg-gray-800 rounded-lg"})]})}const b={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","bottom-center":"bottom-4 left-1/2 -translate-x-1/2"};function p({children:u,customTypes:e,customComponent:i,position:f="top-right",maxToasts:l=5}){const[o,m]=s.useState([]),c=s.useCallback(n=>{const v=`toast-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,t=n.id||v,h={id:t,title:n.title,description:n.description,type:n.type||"info",action:n.action,duration:n.duration??5e3};return m(k=>[h,...k].slice(0,l)),t},[l]),r=s.useCallback(n=>{m(v=>v.filter(t=>t.id!==n))},[]),d={addToast:c,removeToast:r,toasts:o};return a.jsxs(T.ToastContext.Provider,{value:d,children:[u,a.jsx("div",{className:y.join("fixed z-50 pointer-events-none max-w-sm w-full space-y-2",b[f]),role:"region","aria-label":"Notifications",children:o.map(n=>a.jsx("div",{className:"pointer-events-auto",children:a.jsx(g.Toast,{...n,onRemove:r,customTypes:e,customComponent:i})},n.id))})]})}function w({children:u,defaultTheme:e="system",storageKey:i="dreamer-ui-theme",attribute:f="data-theme",respectSystem:l=!0}){const[o,m]=s.useState(()=>{if(typeof window>"u")return e;const t=localStorage.getItem(i);return t&&["light","dark","system"].includes(t)?t:e}),[c,r]=s.useState(()=>typeof window>"u"?"light":o==="system"&&l?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o==="dark"?"dark":"light"),d=s.useCallback(t=>{m(t),typeof window<"u"&&localStorage.setItem(i,t)},[i]),n=s.useCallback(()=>{d(c==="light"?"dark":"light")},[c,d]);s.useLayoutEffect(()=>{if(typeof window>"u")return;const t=()=>{if(o==="system"&&l){const h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";r(h)}else r(o==="dark"?"dark":"light")};if(t(),o==="system"&&l){const h=window.matchMedia("(prefers-color-scheme: dark)");return h.addEventListener("change",t),()=>h.removeEventListener("change",t)}},[o,l]),s.useLayoutEffect(()=>{if(typeof window>"u")return;const t=document.documentElement;t.setAttribute(f,c),c==="dark"?t.classList.add("dark"):t.classList.remove("dark")},[c,f]);const v={theme:o,setTheme:d,resolvedTheme:c,toggleTheme:n};return a.jsx(T.ThemeContext.Provider,{value:v,children:u})}function C({children:u,theme:e={},toast:i={}}){return a.jsx(w,{...e,children:a.jsx(p,{...i,children:a.jsx(x,{children:u})})})}exports.ActionModalProvider=x;exports.DreamerUIProvider=C;exports.ThemeProvider=w;exports.ToastProvider=p;
|
|
2
2
|
//# sourceMappingURL=providers.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.cjs.js","sources":["../src/providers/ActionModalProvider.tsx","../src/providers/ToastProvider.tsx","../src/providers/ThemeProvider.tsx","../src/providers/DreamerUIProvider.tsx"],"sourcesContent":["import { ReactNode, useCallback, useState } from 'react';\nimport { ActionModal } from '../components';\nimport { ActionModalContext } from '../hooks';\n\nexport interface ConfirmOptions {\n /** The title displayed in the confirmation modal header */\n title?: string;\n /** The main message content displayed in the modal body */\n message: ReactNode;\n /** Text for the confirm/accept button. Defaults to \"Confirm\" */\n confirmText?: string;\n /** Text for the cancel/dismiss button. Defaults to \"Cancel\" */\n cancelText?: string;\n /** Whether the action is destructive, affects button styling */\n destructive?: boolean;\n}\n\nexport interface AlertOptions {\n /** The title displayed in the alert modal header */\n title?: string;\n /** The main message content displayed in the modal body */\n message: ReactNode;\n /** Text for the confirm/dismiss button. Defaults to \"OK\" */\n confirmText?: string;\n /** Whether the alert represents a destructive action, affects button styling */\n destructive?: boolean;\n}\n\nexport interface ActionModalContextValue {\n /** Shows a confirmation modal and returns a promise that resolves to true if confirmed, false if cancelled */\n confirm: (options: ConfirmOptions) => Promise<boolean>;\n /** Shows an alert modal and returns a promise that resolves when dismissed */\n alert: (options: AlertOptions) => Promise<void>;\n}\n\ninterface ActionModalState {\n isOpen: boolean;\n type: 'alert' | 'confirm';\n title?: string;\n message: ReactNode;\n confirmText?: string;\n cancelText?: string;\n destructive?: boolean;\n resolve?: ((value: boolean) => void) | (() => void);\n}\n\nexport function ActionModalProvider({ children }: { children: ReactNode }) {\n const [modalState, setModalState] = useState<ActionModalState | null>(null);\n\n const confirm = useCallback((options: ConfirmOptions): Promise<boolean> => {\n return new Promise((resolve) => {\n setModalState({\n isOpen: true,\n type: 'confirm',\n title: options.title,\n message: options.message,\n confirmText: options.confirmText,\n cancelText: options.cancelText,\n destructive: options.destructive,\n resolve,\n });\n });\n }, []);\n\n const alert = useCallback((options: AlertOptions): Promise<void> => {\n return new Promise((resolve) => {\n setModalState({\n isOpen: true,\n type: 'alert',\n title: options.title,\n message: options.message,\n confirmText: options.confirmText,\n destructive: options.destructive,\n resolve,\n });\n });\n }, []);\n\n const handleClose = useCallback(() => {\n if (modalState?.resolve) {\n if (modalState.type === 'confirm') {\n (modalState.resolve as (value: boolean) => void)(false);\n } else {\n (modalState.resolve as () => void)();\n }\n }\n setModalState(null);\n }, [modalState]);\n\n const handleConfirm = useCallback(() => {\n if (modalState?.resolve) {\n if (modalState.type === 'confirm') {\n (modalState.resolve as (value: boolean) => void)(true);\n } else {\n (modalState.resolve as () => void)();\n }\n }\n setModalState(null);\n }, [modalState]);\n\n const contextValue: ActionModalContextValue = {\n confirm,\n alert,\n };\n\n return (\n <ActionModalContext.Provider value={contextValue}>\n {children}\n {modalState && modalState.type === 'alert' && (\n <ActionModal\n type='alert'\n isOpen={modalState.isOpen}\n onClose={handleClose}\n title={modalState.title}\n message={modalState.message}\n confirmText={modalState.confirmText}\n destructive={modalState.destructive}\n onConfirm={handleConfirm}\n className='bg-white dark:bg-gray-800 rounded-lg'\n />\n )}\n {modalState && modalState.type === 'confirm' && (\n <ActionModal\n type='confirm'\n isOpen={modalState.isOpen}\n onClose={handleClose}\n title={modalState.title}\n message={modalState.message}\n confirmText={modalState.confirmText}\n cancelText={modalState.cancelText}\n destructive={modalState.destructive}\n onConfirm={handleConfirm}\n className='bg-white dark:bg-gray-800 rounded-lg'\n />\n )}\n </ActionModalContext.Provider>\n );\n}\n","import { ReactNode, useCallback, useState } from 'react';\nimport { Toast, ToastData, ToastType } from '../components/toast';\nimport { AddToastOptions, ToastContextValue } from '../hooks/useToast';\nimport { ToastContext } from '../hooks/useToast';\nimport { join } from '../utils';\n\nexport interface ToastProviderProps {\n /** React children to be wrapped by the toast provider */\n children: ReactNode;\n /** Custom toast types with their own styling and icons */\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n /** Custom toast component to replace the default Toast component */\n customComponent?: React.ComponentType<ToastData>;\n /** Position where toasts should appear on screen */\n position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';\n /** Maximum number of toasts to display at once */\n maxToasts?: number;\n}\n\nconst positionClasses = {\n 'top-right': 'top-4 right-4',\n 'top-left': 'top-4 left-4',\n 'bottom-right': 'bottom-4 right-4',\n 'bottom-left': 'bottom-4 left-4',\n 'top-center': 'top-4 left-1/2 -translate-x-1/2',\n 'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2',\n};\n\nexport function ToastProvider({\n children,\n customTypes,\n customComponent,\n position = 'top-right',\n maxToasts = 5,\n}: ToastProviderProps) {\n const [toasts, setToasts] = useState<ToastData[]>([]);\n\n const addToast = useCallback(\n (options: AddToastOptions) => {\n const generatedId = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;\n const id = options.id || generatedId;\n\n const newToast: ToastData = {\n id,\n title: options.title,\n description: options.description,\n type: (options.type as ToastType) || 'info',\n action: options.action,\n duration: options.duration ?? 5000,\n };\n\n setToasts((prevToasts) => {\n const updatedToasts = [newToast, ...prevToasts];\n // Keep only the most recent toasts if we exceed maxToasts\n return updatedToasts.slice(0, maxToasts);\n });\n\n return id;\n },\n [maxToasts]\n );\n\n const removeToast = useCallback((id: string) => {\n setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));\n }, []);\n\n const contextValue: ToastContextValue = {\n addToast,\n removeToast,\n toasts,\n };\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n\n <div\n className={join('fixed z-50 pointer-events-none max-w-sm w-full space-y-2', positionClasses[position])}\n role='region'\n aria-label='Notifications'\n >\n {toasts.map((toast) => (\n <div key={toast.id} className='pointer-events-auto'>\n <Toast {...toast} onRemove={removeToast} customTypes={customTypes} customComponent={customComponent} />\n </div>\n ))}\n </div>\n </ToastContext.Provider>\n );\n}\n","import { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { Theme, ThemeContext, ThemeContextValue } from '../hooks/useTheme';\n\nexport interface ThemeProviderProps {\n /** React children to be wrapped by the theme provider */\n children: ReactNode;\n /** The default theme to use on first load. Defaults to 'system' */\n defaultTheme?: Theme;\n /** Local storage key used to persist the theme selection. Defaults to 'dreamer-ui-theme' */\n storageKey?: string;\n /** HTML attribute name to set on document root. Defaults to 'data-theme' */\n attribute?: string;\n /** Whether to respect system theme when theme is set to 'system'. Defaults to true */\n respectSystem?: boolean;\n}\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'dreamer-ui-theme',\n attribute = 'data-theme',\n respectSystem = true,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<Theme>(() => {\n if (typeof window === 'undefined') {\n return defaultTheme;\n }\n\n const stored = localStorage.getItem(storageKey);\n if (stored && ['light', 'dark', 'system'].includes(stored)) {\n return stored as Theme;\n }\n\n return defaultTheme;\n });\n\n const [resolvedTheme, setResolvedTheme] = useState<'light' | 'dark'>(() => {\n if (typeof window === 'undefined') {\n return 'light';\n }\n\n if (theme === 'system' && respectSystem) {\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n\n return theme === 'dark' ? 'dark' : 'light';\n });\n\n const setTheme = useCallback(\n (newTheme: Theme) => {\n setThemeState(newTheme);\n if (typeof window !== 'undefined') {\n localStorage.setItem(storageKey, newTheme);\n }\n },\n [storageKey]\n );\n\n const toggleTheme = useCallback(() => {\n const newTheme = resolvedTheme === 'light' ? 'dark' : 'light';\n setTheme(newTheme);\n }, [resolvedTheme, setTheme]);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n const updateResolvedTheme = () => {\n if (theme === 'system' && respectSystem) {\n const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n setResolvedTheme(systemTheme);\n } else {\n setResolvedTheme(theme === 'dark' ? 'dark' : 'light');\n }\n };\n\n updateResolvedTheme();\n\n if (theme === 'system' && respectSystem) {\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n mediaQuery.addEventListener('change', updateResolvedTheme);\n return () => mediaQuery.removeEventListener('change', updateResolvedTheme);\n }\n }, [theme, respectSystem]);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n const root = document.documentElement;\n root.setAttribute(attribute, resolvedTheme);\n \n // Also set class for Tailwind dark mode\n if (resolvedTheme === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n }, [resolvedTheme, attribute]);\n\n const contextValue: ThemeContextValue = {\n theme,\n setTheme,\n resolvedTheme,\n toggleTheme,\n };\n\n return <ThemeContext.Provider value={contextValue}>{children}</ThemeContext.Provider>;\n}","import { ReactNode } from 'react';\nimport { ActionModalProvider } from './ActionModalProvider';\nimport { ThemeProvider, ThemeProviderProps } from './ThemeProvider';\nimport { ToastProvider, ToastProviderProps } from './ToastProvider';\n\nexport interface DreamerUIProviderProps {\n\t/** React children to be wrapped by all DreamerUI providers */\n\tchildren: ReactNode;\n\t/** Configuration options for the ThemeProvider */\n\ttheme?: Omit<ThemeProviderProps, 'children'>;\n\t/** Configuration options for the ToastProvider */\n\ttoast?: Omit<ToastProviderProps, 'children'>;\n}\n\nexport function DreamerUIProvider({ children, theme = {}, toast = {} }: DreamerUIProviderProps) {\n\treturn (\n\t\t<ThemeProvider {...theme}>\n\t\t\t<ToastProvider {...toast}>\n\t\t\t\t<ActionModalProvider>{children}</ActionModalProvider>\n\t\t\t</ToastProvider>\n\t\t</ThemeProvider>\n\t);\n}\n"],"names":["ActionModalProvider","children","modalState","setModalState","useState","confirm","useCallback","options","resolve","alert","handleClose","handleConfirm","contextValue","jsxs","ActionModalContext","jsx","ActionModal","positionClasses","ToastProvider","customTypes","customComponent","position","maxToasts","toasts","setToasts","addToast","generatedId","id","newToast","prevToasts","removeToast","toast","ToastContext","join","Toast","ThemeProvider","defaultTheme","storageKey","attribute","respectSystem","theme","setThemeState","stored","resolvedTheme","setResolvedTheme","setTheme","newTheme","toggleTheme","useEffect","updateResolvedTheme","systemTheme","mediaQuery","root","ThemeContext","DreamerUIProvider"],"mappings":"2QA8CgB,SAAAA,EAAoB,CAAE,SAAAC,GAAqC,CACzE,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAkC,IAAI,EAEpEC,EAAUC,cAAaC,GACpB,IAAI,QAASC,GAAY,CAChBL,EAAA,CACZ,OAAQ,GACR,KAAM,UACN,MAAOI,EAAQ,MACf,QAASA,EAAQ,QACjB,YAAaA,EAAQ,YACrB,WAAYA,EAAQ,WACpB,YAAaA,EAAQ,YACrB,QAAAC,CAAA,CACD,CAAA,CACF,EACA,EAAE,EAECC,EAAQH,cAAaC,GAClB,IAAI,QAASC,GAAY,CAChBL,EAAA,CACZ,OAAQ,GACR,KAAM,QACN,MAAOI,EAAQ,MACf,QAASA,EAAQ,QACjB,YAAaA,EAAQ,YACrB,YAAaA,EAAQ,YACrB,QAAAC,CAAA,CACD,CAAA,CACF,EACA,EAAE,EAECE,EAAcJ,EAAAA,YAAY,IAAM,CAChCJ,GAAA,MAAAA,EAAY,UACVA,EAAW,OAAS,UACrBA,EAAW,QA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,aAAQM,EAAAA,aAAa,SAAb,CAAsB,MAAOzC,EAAe,SAAAX,EAAS,CAC/D,CC5FgB,SAAAqD,EAAkB,CAAE,SAAArD,EAAU,MAAAuC,EAAQ,CAAA,EAAI,MAAAT,EAAQ,CAAA,GAA8B,CAC/F,OACEhB,EAAAA,IAAAoB,EAAA,CAAe,GAAGK,EAClB,SAACzB,EAAA,IAAAG,EAAA,CAAe,GAAGa,EAClB,SAAChB,EAAAA,IAAAf,EAAA,CAAqB,SAAAC,CAAS,CAAA,CAChC,CAAA,EACD,CAEF"}
|
|
1
|
+
{"version":3,"file":"providers.cjs.js","sources":["../src/providers/ActionModalProvider.tsx","../src/providers/ToastProvider.tsx","../src/providers/ThemeProvider.tsx","../src/providers/DreamerUIProvider.tsx"],"sourcesContent":["import { ReactNode, useCallback, useState } from 'react';\nimport { ActionModal } from '../components';\nimport { ActionModalContext } from '../hooks';\n\nexport interface ConfirmOptions {\n /** The title displayed in the confirmation modal header */\n title?: string;\n /** The main message content displayed in the modal body */\n message: ReactNode;\n /** Text for the confirm/accept button. Defaults to \"Confirm\" */\n confirmText?: string;\n /** Text for the cancel/dismiss button. Defaults to \"Cancel\" */\n cancelText?: string;\n /** Whether the action is destructive, affects button styling */\n destructive?: boolean;\n}\n\nexport interface AlertOptions {\n /** The title displayed in the alert modal header */\n title?: string;\n /** The main message content displayed in the modal body */\n message: ReactNode;\n /** Text for the confirm/dismiss button. Defaults to \"OK\" */\n confirmText?: string;\n /** Whether the alert represents a destructive action, affects button styling */\n destructive?: boolean;\n}\n\nexport interface ActionModalContextValue {\n /** Shows a confirmation modal and returns a promise that resolves to true if confirmed, false if cancelled */\n confirm: (options: ConfirmOptions) => Promise<boolean>;\n /** Shows an alert modal and returns a promise that resolves when dismissed */\n alert: (options: AlertOptions) => Promise<void>;\n}\n\ninterface ActionModalState {\n isOpen: boolean;\n type: 'alert' | 'confirm';\n title?: string;\n message: ReactNode;\n confirmText?: string;\n cancelText?: string;\n destructive?: boolean;\n resolve?: ((value: boolean) => void) | (() => void);\n}\n\nexport function ActionModalProvider({ children }: { children: ReactNode }) {\n const [modalState, setModalState] = useState<ActionModalState | null>(null);\n\n const confirm = useCallback((options: ConfirmOptions): Promise<boolean> => {\n return new Promise((resolve) => {\n setModalState({\n isOpen: true,\n type: 'confirm',\n title: options.title,\n message: options.message,\n confirmText: options.confirmText,\n cancelText: options.cancelText,\n destructive: options.destructive,\n resolve,\n });\n });\n }, []);\n\n const alert = useCallback((options: AlertOptions): Promise<void> => {\n return new Promise((resolve) => {\n setModalState({\n isOpen: true,\n type: 'alert',\n title: options.title,\n message: options.message,\n confirmText: options.confirmText,\n destructive: options.destructive,\n resolve,\n });\n });\n }, []);\n\n const handleClose = useCallback(() => {\n if (modalState?.resolve) {\n if (modalState.type === 'confirm') {\n (modalState.resolve as (value: boolean) => void)(false);\n } else {\n (modalState.resolve as () => void)();\n }\n }\n setModalState(null);\n }, [modalState]);\n\n const handleConfirm = useCallback(() => {\n if (modalState?.resolve) {\n if (modalState.type === 'confirm') {\n (modalState.resolve as (value: boolean) => void)(true);\n } else {\n (modalState.resolve as () => void)();\n }\n }\n setModalState(null);\n }, [modalState]);\n\n const contextValue: ActionModalContextValue = {\n confirm,\n alert,\n };\n\n return (\n <ActionModalContext.Provider value={contextValue}>\n {children}\n {modalState && modalState.type === 'alert' && (\n <ActionModal\n type='alert'\n isOpen={modalState.isOpen}\n onClose={handleClose}\n title={modalState.title}\n message={modalState.message}\n confirmText={modalState.confirmText}\n destructive={modalState.destructive}\n onConfirm={handleConfirm}\n className='bg-white dark:bg-gray-800 rounded-lg'\n />\n )}\n {modalState && modalState.type === 'confirm' && (\n <ActionModal\n type='confirm'\n isOpen={modalState.isOpen}\n onClose={handleClose}\n title={modalState.title}\n message={modalState.message}\n confirmText={modalState.confirmText}\n cancelText={modalState.cancelText}\n destructive={modalState.destructive}\n onConfirm={handleConfirm}\n className='bg-white dark:bg-gray-800 rounded-lg'\n />\n )}\n </ActionModalContext.Provider>\n );\n}\n","import { ReactNode, useCallback, useState } from 'react';\nimport { Toast, ToastData, ToastType } from '../components/toast';\nimport { AddToastOptions, ToastContextValue } from '../hooks/useToast';\nimport { ToastContext } from '../hooks/useToast';\nimport { join } from '../utils';\n\nexport interface ToastProviderProps {\n /** React children to be wrapped by the toast provider */\n children: ReactNode;\n /** Custom toast types with their own styling and icons */\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n /** Custom toast component to replace the default Toast component */\n customComponent?: React.ComponentType<ToastData>;\n /** Position where toasts should appear on screen */\n position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';\n /** Maximum number of toasts to display at once */\n maxToasts?: number;\n}\n\nconst positionClasses = {\n 'top-right': 'top-4 right-4',\n 'top-left': 'top-4 left-4',\n 'bottom-right': 'bottom-4 right-4',\n 'bottom-left': 'bottom-4 left-4',\n 'top-center': 'top-4 left-1/2 -translate-x-1/2',\n 'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2',\n};\n\nexport function ToastProvider({\n children,\n customTypes,\n customComponent,\n position = 'top-right',\n maxToasts = 5,\n}: ToastProviderProps) {\n const [toasts, setToasts] = useState<ToastData[]>([]);\n\n const addToast = useCallback(\n (options: AddToastOptions) => {\n const generatedId = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;\n const id = options.id || generatedId;\n\n const newToast: ToastData = {\n id,\n title: options.title,\n description: options.description,\n type: (options.type as ToastType) || 'info',\n action: options.action,\n duration: options.duration ?? 5000,\n };\n\n setToasts((prevToasts) => {\n const updatedToasts = [newToast, ...prevToasts];\n // Keep only the most recent toasts if we exceed maxToasts\n return updatedToasts.slice(0, maxToasts);\n });\n\n return id;\n },\n [maxToasts]\n );\n\n const removeToast = useCallback((id: string) => {\n setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));\n }, []);\n\n const contextValue: ToastContextValue = {\n addToast,\n removeToast,\n toasts,\n };\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n\n <div\n className={join('fixed z-50 pointer-events-none max-w-sm w-full space-y-2', positionClasses[position])}\n role='region'\n aria-label='Notifications'\n >\n {toasts.map((toast) => (\n <div key={toast.id} className='pointer-events-auto'>\n <Toast {...toast} onRemove={removeToast} customTypes={customTypes} customComponent={customComponent} />\n </div>\n ))}\n </div>\n </ToastContext.Provider>\n );\n}\n","import { ReactNode, useCallback, useLayoutEffect, useState } from 'react';\nimport { Theme, ThemeContext, ThemeContextValue } from '../hooks/useTheme';\n\nexport interface ThemeProviderProps {\n /** React children to be wrapped by the theme provider */\n children: ReactNode;\n /** The default theme to use on first load. Defaults to 'system' */\n defaultTheme?: Theme;\n /** Local storage key used to persist the theme selection. Defaults to 'dreamer-ui-theme' */\n storageKey?: string;\n /** HTML attribute name to set on document root. Defaults to 'data-theme' */\n attribute?: string;\n /** Whether to respect system theme when theme is set to 'system'. Defaults to true */\n respectSystem?: boolean;\n}\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'dreamer-ui-theme',\n attribute = 'data-theme',\n respectSystem = true,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<Theme>(() => {\n if (typeof window === 'undefined') {\n return defaultTheme;\n }\n\n const stored = localStorage.getItem(storageKey);\n if (stored && ['light', 'dark', 'system'].includes(stored)) {\n return stored as Theme;\n }\n\n return defaultTheme;\n });\n\n const [resolvedTheme, setResolvedTheme] = useState<'light' | 'dark'>(() => {\n if (typeof window === 'undefined') {\n return 'light';\n }\n\n if (theme === 'system' && respectSystem) {\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n\n return theme === 'dark' ? 'dark' : 'light';\n });\n\n const setTheme = useCallback(\n (newTheme: Theme) => {\n setThemeState(newTheme);\n if (typeof window !== 'undefined') {\n localStorage.setItem(storageKey, newTheme);\n }\n },\n [storageKey]\n );\n\n const toggleTheme = useCallback(() => {\n const newTheme = resolvedTheme === 'light' ? 'dark' : 'light';\n setTheme(newTheme);\n }, [resolvedTheme, setTheme]);\n\n useLayoutEffect(() => {\n if (typeof window === 'undefined') return;\n\n const updateResolvedTheme = () => {\n if (theme === 'system' && respectSystem) {\n const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n setResolvedTheme(systemTheme);\n } else {\n setResolvedTheme(theme === 'dark' ? 'dark' : 'light');\n }\n };\n\n updateResolvedTheme();\n\n if (theme === 'system' && respectSystem) {\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n mediaQuery.addEventListener('change', updateResolvedTheme);\n return () => mediaQuery.removeEventListener('change', updateResolvedTheme);\n }\n }, [theme, respectSystem]);\n\n useLayoutEffect(() => {\n if (typeof window === 'undefined') return;\n\n const root = document.documentElement;\n root.setAttribute(attribute, resolvedTheme);\n \n // Also set class for Tailwind dark mode\n if (resolvedTheme === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n }, [resolvedTheme, attribute]);\n\n const contextValue: ThemeContextValue = {\n theme,\n setTheme,\n resolvedTheme,\n toggleTheme,\n };\n\n return <ThemeContext.Provider value={contextValue}>{children}</ThemeContext.Provider>;\n}","import { ReactNode } from 'react';\nimport { ActionModalProvider } from './ActionModalProvider';\nimport { ThemeProvider, ThemeProviderProps } from './ThemeProvider';\nimport { ToastProvider, ToastProviderProps } from './ToastProvider';\n\nexport interface DreamerUIProviderProps {\n\t/** React children to be wrapped by all DreamerUI providers */\n\tchildren: ReactNode;\n\t/** Configuration options for the ThemeProvider */\n\ttheme?: Omit<ThemeProviderProps, 'children'>;\n\t/** Configuration options for the ToastProvider */\n\ttoast?: Omit<ToastProviderProps, 'children'>;\n}\n\nexport function DreamerUIProvider({ children, theme = {}, toast = {} }: DreamerUIProviderProps) {\n\treturn (\n\t\t<ThemeProvider {...theme}>\n\t\t\t<ToastProvider {...toast}>\n\t\t\t\t<ActionModalProvider>{children}</ActionModalProvider>\n\t\t\t</ToastProvider>\n\t\t</ThemeProvider>\n\t);\n}\n"],"names":["ActionModalProvider","children","modalState","setModalState","useState","confirm","useCallback","options","resolve","alert","handleClose","handleConfirm","contextValue","jsxs","ActionModalContext","jsx","ActionModal","positionClasses","ToastProvider","customTypes","customComponent","position","maxToasts","toasts","setToasts","addToast","generatedId","id","newToast","prevToasts","removeToast","toast","ToastContext","join","Toast","ThemeProvider","defaultTheme","storageKey","attribute","respectSystem","theme","setThemeState","stored","resolvedTheme","setResolvedTheme","setTheme","newTheme","toggleTheme","useLayoutEffect","updateResolvedTheme","systemTheme","mediaQuery","root","ThemeContext","DreamerUIProvider"],"mappings":"2QA8CgB,SAAAA,EAAoB,CAAE,SAAAC,GAAqC,CACzE,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAkC,IAAI,EAEpEC,EAAUC,cAAaC,GACpB,IAAI,QAASC,GAAY,CAChBL,EAAA,CACZ,OAAQ,GACR,KAAM,UACN,MAAOI,EAAQ,MACf,QAASA,EAAQ,QACjB,YAAaA,EAAQ,YACrB,WAAYA,EAAQ,WACpB,YAAaA,EAAQ,YACrB,QAAAC,CAAA,CACD,CAAA,CACF,EACA,EAAE,EAECC,EAAQH,cAAaC,GAClB,IAAI,QAASC,GAAY,CAChBL,EAAA,CACZ,OAAQ,GACR,KAAM,QACN,MAAOI,EAAQ,MACf,QAASA,EAAQ,QACjB,YAAaA,EAAQ,YACrB,YAAaA,EAAQ,YACrB,QAAAC,CAAA,CACD,CAAA,CACF,EACA,EAAE,EAECE,EAAcJ,EAAAA,YAAY,IAAM,CAChCJ,GAAA,MAAAA,EAAY,UACVA,EAAW,OAAS,UACrBA,EAAW,QAAqC,EAAK,EAErDA,EAAW,QAAuB,GAGvCC,EAAc,IAAI,CAAA,EACjB,CAACD,CAAU,CAAC,EAETS,EAAgBL,EAAAA,YAAY,IAAM,CAClCJ,GAAA,MAAAA,EAAY,UACVA,EAAW,OAAS,UACrBA,EAAW,QAAqC,EAAI,EAEpDA,EAAW,QAAuB,GAGvCC,EAAc,IAAI,CAAA,EACjB,CAAC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AAAG,EAAA,CAAe,GAAGa,EAClB,SAAChB,EAAAA,IAAAf,EAAA,CAAqB,SAAAC,CAAS,CAAA,CAChC,CAAA,EACD,CAEF"}
|
package/dist/providers.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as w, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { useState as v, useCallback as d,
|
|
3
|
-
import { A as T, T as y } from "./Toast-
|
|
2
|
+
import { useState as v, useCallback as d, useLayoutEffect as p } from "react";
|
|
3
|
+
import { A as T, T as y } from "./Toast-GnTYRmnY.js";
|
|
4
4
|
import { A as k, c as b, T as C } from "./useTheme-CYIEopvl.js";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
import { j as P } from "./join-BmgR_f4v.js";
|
|
@@ -115,7 +115,7 @@ function O({
|
|
|
115
115
|
)
|
|
116
116
|
] });
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function L({
|
|
119
119
|
children: m,
|
|
120
120
|
defaultTheme: e = "system",
|
|
121
121
|
storageKey: i = "dreamer-ui-theme",
|
|
@@ -162,12 +162,12 @@ function N({
|
|
|
162
162
|
return /* @__PURE__ */ l(C.Provider, { value: g, children: m });
|
|
163
163
|
}
|
|
164
164
|
function $({ children: m, theme: e = {}, toast: i = {} }) {
|
|
165
|
-
return /* @__PURE__ */ l(
|
|
165
|
+
return /* @__PURE__ */ l(L, { ...e, children: /* @__PURE__ */ l(O, { ...i, children: /* @__PURE__ */ l(M, { children: m }) }) });
|
|
166
166
|
}
|
|
167
167
|
export {
|
|
168
168
|
M as ActionModalProvider,
|
|
169
169
|
$ as DreamerUIProvider,
|
|
170
|
-
|
|
170
|
+
L as ThemeProvider,
|
|
171
171
|
O as ToastProvider
|
|
172
172
|
};
|
|
173
173
|
//# sourceMappingURL=providers.esm.js.map
|