@moondreamsdev/dreamer-ui 1.7.7-test.21 → 1.7.7-test.22
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-CUHmqnRs.cjs +2 -0
- package/dist/Toast-CUHmqnRs.cjs.map +1 -0
- package/dist/{Toast-BFQrI1bB.js → Toast-PqPYiAd5.js} +29 -28
- package/dist/Toast-PqPYiAd5.js.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +37 -37
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
- package/dist/src/components/accordion/index.d.ts +2 -4
- package/dist/src/components/actionmodal/index.d.ts +1 -2
- package/dist/src/components/button/Button.d.ts +1 -1
- package/dist/src/components/button/LoadingDots.d.ts +1 -1
- package/dist/src/components/button/index.d.ts +2 -4
- package/dist/src/components/carousel/Carousel.d.ts +1 -1
- package/dist/src/components/carousel/hooks.d.ts +1 -0
- package/dist/src/components/carousel/index.d.ts +1 -2
- package/dist/src/components/checkbox/Checkbox.d.ts +1 -1
- package/dist/src/components/checkbox/index.d.ts +1 -1
- package/dist/src/components/clickable/Clickable.d.ts +3 -3
- package/dist/src/components/clickable/index.d.ts +1 -1
- package/dist/src/components/input/Input.d.ts +2 -3
- package/dist/src/components/input/index.d.ts +1 -1
- package/dist/src/components/pagination/Pagination.d.ts +2 -3
- package/dist/src/components/pagination/index.d.ts +1 -1
- package/dist/src/components/panel/Panel.d.ts +1 -1
- package/dist/src/components/panel/index.d.ts +1 -3
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
- package/dist/src/components/scroll-area/ScrollArea.d.ts +1 -1
- package/dist/src/components/scroll-area/hooks.d.ts +1 -0
- package/dist/src/components/scroll-area/index.d.ts +1 -2
- package/dist/src/components/select/Select.d.ts +1 -1
- package/dist/src/components/select/index.d.ts +1 -2
- package/dist/src/components/separator/Separator.d.ts +1 -1
- package/dist/src/components/separator/index.d.ts +1 -2
- package/dist/src/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/src/components/skeleton/index.d.ts +1 -1
- package/dist/src/components/slider/Slider.d.ts +1 -1
- package/dist/src/components/slider/index.d.ts +1 -2
- package/dist/src/components/tabs/TabsContent.d.ts +1 -0
- package/dist/src/components/tabs/TabsContext.d.ts +1 -0
- package/dist/src/components/tabs/TabsList.d.ts +1 -0
- package/dist/src/components/tabs/TabsTrigger.d.ts +1 -0
- package/dist/src/components/textarea/Textarea.d.ts +2 -3
- package/dist/src/components/textarea/index.d.ts +1 -1
- package/dist/src/components/toast/Toast.d.ts +1 -0
- package/dist/src/components/toast/index.d.ts +1 -2
- package/dist/src/components/toggle/Toggle.d.ts +1 -1
- package/dist/src/components/toggle/index.d.ts +1 -2
- package/dist/src/components/tooltip/hooks.d.ts +1 -0
- package/dist/src/components/tooltip/index.d.ts +1 -2
- package/dist/src/hooks/useActionModal.d.ts +1 -0
- package/dist/src/hooks/useToast.d.ts +1 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/Toast-B-Zu6Kp_.cjs +0 -2
- package/dist/Toast-B-Zu6Kp_.cjs.map +0 -1
- package/dist/Toast-BFQrI1bB.js.map +0 -1
package/dist/components.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as k, jsx as c, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import F, { useId as P, useState as A, createElement as Te, useEffect as z, useRef as B, useCallback as C, useMemo as J, isValidElement as De, cloneElement as Re } from "react";
|
|
3
3
|
import { join as w } from "./utils.esm.js";
|
|
4
4
|
import { d as Ae, e as Ie, f as Ce, C as ze, a as Se, g as Le, E as Ve, Q as We, b as Be, c as He } from "./QuestionMarkCircled-CY81euqP.js";
|
|
5
|
-
import { n as V, a as je, u as he } from "./Toast-
|
|
6
|
-
import { A as nr, T as ar } from "./Toast-
|
|
7
|
-
import { E as
|
|
5
|
+
import { n as V, a as je, u as he } from "./Toast-PqPYiAd5.js";
|
|
6
|
+
import { A as nr, T as ar } from "./Toast-PqPYiAd5.js";
|
|
7
|
+
import { E as Ge, X as ve } from "./X-CIoyLewf.js";
|
|
8
8
|
import { createPortal as pe } from "react-dom";
|
|
9
9
|
function fe({
|
|
10
10
|
id: r,
|
|
@@ -107,8 +107,8 @@ function Rt({
|
|
|
107
107
|
g
|
|
108
108
|
);
|
|
109
109
|
}),
|
|
110
|
-
o.length === 0 && t &&
|
|
111
|
-
if (
|
|
110
|
+
o.length === 0 && t && F.Children.map(t, (p, y) => {
|
|
111
|
+
if (F.isValidElement(p) && p.type === fe) {
|
|
112
112
|
const g = p.props.id || h(y);
|
|
113
113
|
return /* @__PURE__ */ Te(
|
|
114
114
|
fe,
|
|
@@ -146,7 +146,7 @@ function Me() {
|
|
|
146
146
|
t
|
|
147
147
|
)) });
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const Fe = {
|
|
150
150
|
base: "",
|
|
151
151
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
152
152
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -188,7 +188,7 @@ function qe({
|
|
|
188
188
|
r === "link" && !o ? f = "fitted" : f = o || me.size;
|
|
189
189
|
const l = w(
|
|
190
190
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
191
|
-
|
|
191
|
+
Fe[r],
|
|
192
192
|
Pe[f],
|
|
193
193
|
Ke[t],
|
|
194
194
|
n && "relative pointer-events-none",
|
|
@@ -358,12 +358,12 @@ function St({
|
|
|
358
358
|
gap: E = 8
|
|
359
359
|
}) {
|
|
360
360
|
var W, te;
|
|
361
|
-
const S = B(null), I =
|
|
361
|
+
const S = B(null), I = F.Children.toArray(r).filter(F.isValidElement), $ = I.length, { screenSize: M } = _e(), L = J(() => {
|
|
362
362
|
if (typeof l == "number")
|
|
363
363
|
return l;
|
|
364
364
|
if (typeof l == "object" && l && M) {
|
|
365
|
-
const Z = ["2xl", "xl", "lg", "md", "sm", "xs"],
|
|
366
|
-
for (let O =
|
|
365
|
+
const Z = ["2xl", "xl", "lg", "md", "sm", "xs"], G = Z.indexOf(M);
|
|
366
|
+
for (let O = G; O < Z.length; O++) {
|
|
367
367
|
const re = Z[O];
|
|
368
368
|
if (l[re] !== void 0)
|
|
369
369
|
return l[re];
|
|
@@ -383,8 +383,8 @@ function St({
|
|
|
383
383
|
(Z) => {
|
|
384
384
|
if (L === 1)
|
|
385
385
|
return { leftWidth: 0, rightWidth: 0, widthReduction: 0 };
|
|
386
|
-
const
|
|
387
|
-
return Z % L === 0 ? { leftWidth: 0, rightWidth: E / 2, widthReduction:
|
|
386
|
+
const G = E * (L - 1) / L;
|
|
387
|
+
return Z % L === 0 ? { leftWidth: 0, rightWidth: E / 2, widthReduction: G } : Z % L === L - 1 ? { leftWidth: E / 2, rightWidth: 0, widthReduction: G } : { leftWidth: E / 2, rightWidth: E / 2, widthReduction: G };
|
|
388
388
|
},
|
|
389
389
|
[L, E]
|
|
390
390
|
), q = () => {
|
|
@@ -400,7 +400,7 @@ function St({
|
|
|
400
400
|
h === "aligned" ? "disabled:opacity-90" : "disabled:opacity-50"
|
|
401
401
|
);
|
|
402
402
|
return /* @__PURE__ */ k("div", { className: w("relative", n), "data-carousel-wrapper": "true", children: [
|
|
403
|
-
!f && /* @__PURE__ */ c(ne, { children: p ?
|
|
403
|
+
!f && /* @__PURE__ */ c(ne, { children: p ? F.cloneElement(
|
|
404
404
|
p,
|
|
405
405
|
{
|
|
406
406
|
onClick: q,
|
|
@@ -455,8 +455,8 @@ function St({
|
|
|
455
455
|
transform: `translateX(${ue}%)`,
|
|
456
456
|
width: `${$ / L * 100}%`
|
|
457
457
|
},
|
|
458
|
-
children: I.map((Z,
|
|
459
|
-
const { leftWidth: O, rightWidth: re, widthReduction: $e } = Q(
|
|
458
|
+
children: I.map((Z, G) => {
|
|
459
|
+
const { leftWidth: O, rightWidth: re, widthReduction: $e } = Q(G);
|
|
460
460
|
return /* @__PURE__ */ c(
|
|
461
461
|
"div",
|
|
462
462
|
{
|
|
@@ -466,33 +466,33 @@ function St({
|
|
|
466
466
|
marginRight: re > 0 ? `${re}px` : void 0,
|
|
467
467
|
marginLeft: O > 0 ? `${O}px` : void 0
|
|
468
468
|
},
|
|
469
|
-
"data-slide-index":
|
|
469
|
+
"data-slide-index": G,
|
|
470
470
|
children: Z
|
|
471
471
|
},
|
|
472
|
-
|
|
472
|
+
G
|
|
473
473
|
);
|
|
474
474
|
})
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
|
-
!m && /* @__PURE__ */ c("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2", children: Array.from({ length: Math.ceil($ / L) }).map((Z,
|
|
477
|
+
!m && /* @__PURE__ */ c("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2", children: Array.from({ length: Math.ceil($ / L) }).map((Z, G) => /* @__PURE__ */ c(
|
|
478
478
|
"button",
|
|
479
479
|
{
|
|
480
480
|
type: "button",
|
|
481
|
-
onClick: () => K(
|
|
481
|
+
onClick: () => K(G),
|
|
482
482
|
className: w(
|
|
483
483
|
"w-2 h-2 rounded-full transition-colors duration-200",
|
|
484
|
-
|
|
484
|
+
G === U ? "bg-accent" : "bg-muted hover:bg-muted-foreground/50",
|
|
485
485
|
N
|
|
486
486
|
),
|
|
487
|
-
"aria-label": `Go to slide ${
|
|
488
|
-
"data-carousel-dot":
|
|
487
|
+
"aria-label": `Go to slide ${G + 1}`,
|
|
488
|
+
"data-carousel-dot": G
|
|
489
489
|
},
|
|
490
|
-
|
|
490
|
+
G
|
|
491
491
|
)) })
|
|
492
492
|
]
|
|
493
493
|
}
|
|
494
494
|
),
|
|
495
|
-
!f && /* @__PURE__ */ c(ne, { children: y ?
|
|
495
|
+
!f && /* @__PURE__ */ c(ne, { children: y ? F.cloneElement(
|
|
496
496
|
y,
|
|
497
497
|
{
|
|
498
498
|
onClick: Y,
|
|
@@ -652,7 +652,7 @@ function le({ elementId: r, type: o, message: t }) {
|
|
|
652
652
|
),
|
|
653
653
|
role: "status",
|
|
654
654
|
children: [
|
|
655
|
-
o === "error" ? /* @__PURE__ */ c(
|
|
655
|
+
o === "error" ? /* @__PURE__ */ c(Ge, {}) : /* @__PURE__ */ c(Se, {}),
|
|
656
656
|
/* @__PURE__ */ c("span", { id: `${r}-${o}-message`, children: t })
|
|
657
657
|
]
|
|
658
658
|
}
|
|
@@ -830,7 +830,7 @@ function Ht({
|
|
|
830
830
|
}) {
|
|
831
831
|
const u = P(), h = r || `modal-${u}`, v = r ? `${r}-title` : `modal-title-${u}`, { show: p, shouldRender: y } = Je(o);
|
|
832
832
|
if (Oe(h, y), Ye(y, t), !y) return null;
|
|
833
|
-
const g = () => n ?
|
|
833
|
+
const g = () => n ? F.isValidElement(n) ? /* @__PURE__ */ c("div", { className: "mb-4", children: n }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: v, children: n }) : null, x = () => f.length === 0 ? null : /* @__PURE__ */ c("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: f.map((N, E) => {
|
|
834
834
|
const { label: S, className: I, ...$ } = N;
|
|
835
835
|
return /* @__PURE__ */ c(qe, { className: I, type: "button", ...$, "data-modal-action": "true", children: S }, E);
|
|
836
836
|
}) });
|
|
@@ -1059,7 +1059,7 @@ const ot = {
|
|
|
1059
1059
|
screen: "w-screen"
|
|
1060
1060
|
}
|
|
1061
1061
|
};
|
|
1062
|
-
function
|
|
1062
|
+
function Gt({
|
|
1063
1063
|
ref: r,
|
|
1064
1064
|
id: o,
|
|
1065
1065
|
isOpen: t,
|
|
@@ -1077,11 +1077,11 @@ function Ft({
|
|
|
1077
1077
|
}) {
|
|
1078
1078
|
const h = P(), v = o || `panel-${h}`, p = o ? `${o}-title` : `panel-title-${h}`, { show: y, shouldRender: g } = rt(t);
|
|
1079
1079
|
if (at(v, g), nt(g, n), !g) return null;
|
|
1080
|
-
const x = () => e ?
|
|
1080
|
+
const x = () => e ? F.isValidElement(e) ? /* @__PURE__ */ c("div", { children: e }) : /* @__PURE__ */ c("h2", { className: "text-2xl font-semibold", id: p, children: e }) : null, N = () => {
|
|
1081
1081
|
if (!s) return null;
|
|
1082
|
-
if (
|
|
1082
|
+
if (F.isValidElement(s)) {
|
|
1083
1083
|
const E = s, S = E.props.className || "";
|
|
1084
|
-
return
|
|
1084
|
+
return F.cloneElement(E, { className: V("px-6 py-4", S) });
|
|
1085
1085
|
}
|
|
1086
1086
|
return /* @__PURE__ */ c("div", { className: "px-6 py-4", children: s });
|
|
1087
1087
|
};
|
|
@@ -1355,7 +1355,7 @@ function Mt({
|
|
|
1355
1355
|
},
|
|
1356
1356
|
`${l.value}-${b}`
|
|
1357
1357
|
)),
|
|
1358
|
-
m.length === 0 && e &&
|
|
1358
|
+
m.length === 0 && e && F.Children.map(e, (l) => F.isValidElement(l) && l.type === be ? /* @__PURE__ */ c(
|
|
1359
1359
|
be,
|
|
1360
1360
|
{
|
|
1361
1361
|
...l.props,
|
|
@@ -1428,7 +1428,7 @@ function lt(r) {
|
|
|
1428
1428
|
handleScroll: h
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function Ft({
|
|
1432
1432
|
className: r,
|
|
1433
1433
|
thumbClassName: o,
|
|
1434
1434
|
viewportClassName: t,
|
|
@@ -2595,7 +2595,7 @@ function er({
|
|
|
2595
2595
|
i
|
|
2596
2596
|
), L = P(), U = r ?? L;
|
|
2597
2597
|
return /* @__PURE__ */ k(ne, { children: [
|
|
2598
|
-
|
|
2598
|
+
F.cloneElement(o, {
|
|
2599
2599
|
ref: (j) => {
|
|
2600
2600
|
N.current = j;
|
|
2601
2601
|
},
|
|
@@ -2647,19 +2647,19 @@ export {
|
|
|
2647
2647
|
fe as AccordionItem,
|
|
2648
2648
|
nr as ActionModal,
|
|
2649
2649
|
qe as Button,
|
|
2650
|
-
Me as ButtonLoadingDots,
|
|
2651
2650
|
St as Carousel,
|
|
2652
2651
|
Lt as Checkbox,
|
|
2653
2652
|
Vt as Clickable,
|
|
2654
2653
|
Wt as Input,
|
|
2655
2654
|
Bt as Label,
|
|
2655
|
+
Me as LoadingDots,
|
|
2656
2656
|
Ht as Modal,
|
|
2657
2657
|
jt as Pagination,
|
|
2658
|
-
|
|
2658
|
+
Gt as Panel,
|
|
2659
2659
|
Mt as RadioGroup,
|
|
2660
2660
|
be as RadioGroupItem,
|
|
2661
2661
|
st as RadioInput,
|
|
2662
|
-
|
|
2662
|
+
Ft as ScrollArea,
|
|
2663
2663
|
Pt as Select,
|
|
2664
2664
|
Kt as Separator,
|
|
2665
2665
|
qt as Skeleton,
|