@moondreamsdev/dreamer-ui 1.7.6-test.0 → 1.7.7-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/{QuestionMarkCircled-JRFAPLtT.js → X-5_dKmWcQ.js} +5 -5
- package/dist/X-5_dKmWcQ.js.map +1 -0
- package/dist/{QuestionMarkCircled-o1tqa8ZJ.cjs → X-BCa88TDt.cjs} +2 -2
- package/dist/X-BCa88TDt.cjs.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +124 -118
- package/dist/components.esm.js.map +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/toast/Toast.d.ts +24 -0
- package/dist/src/components/toast/ToastProvider.d.ts +14 -0
- package/dist/src/components/toast/index.d.ts +5 -0
- package/dist/src/components/toast/useToast.d.ts +17 -0
- package/dist/src/components/tooltip/Tooltip.d.ts +0 -2
- package/dist/src/components/tooltip/hooks.d.ts +3 -0
- package/dist/src/symbols/CrossCircled.d.ts +4 -0
- package/dist/src/symbols/InfoCircled.d.ts +4 -0
- package/dist/src/symbols/index.d.ts +3 -1
- package/dist/{styles-BqvnMUW1.cjs → styles-B0WE-RIs.cjs} +2 -2
- package/dist/styles-B0WE-RIs.cjs.map +1 -0
- package/dist/{styles-DUXNGn3s.js → styles-Dm_OLOPv.js} +33 -33
- package/dist/styles-Dm_OLOPv.js.map +1 -0
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.cjs.js.map +1 -1
- package/dist/symbols.esm.js +34 -9
- package/dist/symbols.esm.js.map +1 -1
- package/dist/useActionModal-CqT8y2he.cjs +2 -0
- package/dist/{useActionModal-BXwArRwi.cjs.map → useActionModal-CqT8y2he.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/QuestionMarkCircled-JRFAPLtT.js.map +0 -1
- package/dist/QuestionMarkCircled-o1tqa8ZJ.cjs.map +0 -1
- package/dist/styles-BqvnMUW1.cjs.map +0 -1
- package/dist/styles-DUXNGn3s.js.map +0 -1
- package/dist/useActionModal-BXwArRwi.cjs +0 -2
package/dist/components.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as N, jsx as c, Fragment as
|
|
2
|
-
import T, { useId as $, useState as x, createElement as
|
|
1
|
+
import { jsxs as N, jsx as c, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import T, { useId as $, useState as x, createElement as Z, useEffect as E, useCallback as A, useMemo as J, useRef as B, isValidElement as O, cloneElement as P } from "react";
|
|
3
3
|
import { join as w } from "./utils.esm.js";
|
|
4
|
-
import { b as
|
|
5
|
-
import { n as
|
|
6
|
-
import { A as Qe } from "./styles-
|
|
7
|
-
import { createPortal as
|
|
8
|
-
function
|
|
4
|
+
import { b as ee, C as te, E as re, a as oe, d as ne, c as ae, Q as se, X as ie } from "./X-5_dKmWcQ.js";
|
|
5
|
+
import { n as q } from "./styles-Dm_OLOPv.js";
|
|
6
|
+
import { A as Qe } from "./styles-Dm_OLOPv.js";
|
|
7
|
+
import { createPortal as Y } from "react-dom";
|
|
8
|
+
function V({
|
|
9
9
|
id: n,
|
|
10
10
|
title: a,
|
|
11
11
|
content: e,
|
|
@@ -48,7 +48,7 @@ function q({
|
|
|
48
48
|
s ? "rotate-180" : "rotate-0"
|
|
49
49
|
),
|
|
50
50
|
"aria-hidden": "true",
|
|
51
|
-
children: /* @__PURE__ */ c(
|
|
51
|
+
children: /* @__PURE__ */ c(ee, { size: 18 })
|
|
52
52
|
}
|
|
53
53
|
)
|
|
54
54
|
]
|
|
@@ -70,7 +70,7 @@ function q({
|
|
|
70
70
|
)
|
|
71
71
|
] });
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Be({
|
|
74
74
|
id: n,
|
|
75
75
|
items: a = [],
|
|
76
76
|
children: e,
|
|
@@ -91,7 +91,7 @@ function ze({
|
|
|
91
91
|
a.length > 0 && a.map((h, y) => {
|
|
92
92
|
const p = h.id || m(y);
|
|
93
93
|
return /* @__PURE__ */ c(
|
|
94
|
-
|
|
94
|
+
V,
|
|
95
95
|
{
|
|
96
96
|
id: p,
|
|
97
97
|
title: h.title,
|
|
@@ -107,10 +107,10 @@ function ze({
|
|
|
107
107
|
);
|
|
108
108
|
}),
|
|
109
109
|
a.length === 0 && e && T.Children.map(e, (h, y) => {
|
|
110
|
-
if (T.isValidElement(h) && h.type ===
|
|
110
|
+
if (T.isValidElement(h) && h.type === V) {
|
|
111
111
|
const p = h.props.id || m(y);
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
|
|
112
|
+
return /* @__PURE__ */ Z(
|
|
113
|
+
V,
|
|
114
114
|
{
|
|
115
115
|
...h.props,
|
|
116
116
|
key: p,
|
|
@@ -127,7 +127,7 @@ function ze({
|
|
|
127
127
|
})
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function le() {
|
|
131
131
|
const [n, a] = x(0);
|
|
132
132
|
return E(() => {
|
|
133
133
|
const e = setInterval(() => {
|
|
@@ -145,7 +145,7 @@ function ie() {
|
|
|
145
145
|
e
|
|
146
146
|
)) });
|
|
147
147
|
}
|
|
148
|
-
const
|
|
148
|
+
const de = {
|
|
149
149
|
base: "",
|
|
150
150
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
151
151
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -153,7 +153,7 @@ const le = {
|
|
|
153
153
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
154
154
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
155
155
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
156
|
-
},
|
|
156
|
+
}, ue = {
|
|
157
157
|
stripped: "",
|
|
158
158
|
fitted: "size-fit",
|
|
159
159
|
sm: "px-2 py-1 text-sm",
|
|
@@ -161,7 +161,7 @@ const le = {
|
|
|
161
161
|
lg: "px-6 py-3 text-lg",
|
|
162
162
|
icon: "p-1 w-fit aspect-square",
|
|
163
163
|
full: "p-2 w-full"
|
|
164
|
-
},
|
|
164
|
+
}, ce = {
|
|
165
165
|
none: "rounded-none",
|
|
166
166
|
sm: "rounded-sm",
|
|
167
167
|
md: "rounded-md",
|
|
@@ -172,7 +172,7 @@ const le = {
|
|
|
172
172
|
size: "md",
|
|
173
173
|
rounded: "md"
|
|
174
174
|
};
|
|
175
|
-
function
|
|
175
|
+
function fe({
|
|
176
176
|
variant: n = K.variant,
|
|
177
177
|
size: a,
|
|
178
178
|
rounded: e = K.rounded,
|
|
@@ -187,9 +187,9 @@ function ce({
|
|
|
187
187
|
n === "link" && !a ? u = "fitted" : u = a || K.size;
|
|
188
188
|
const i = w(
|
|
189
189
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
de[n],
|
|
191
|
+
ue[u],
|
|
192
|
+
ce[e],
|
|
193
193
|
o && "relative pointer-events-none",
|
|
194
194
|
t && "relative",
|
|
195
195
|
l
|
|
@@ -206,7 +206,7 @@ function ce({
|
|
|
206
206
|
type: s,
|
|
207
207
|
className: i,
|
|
208
208
|
children: [
|
|
209
|
-
o && /* @__PURE__ */ c(
|
|
209
|
+
o && /* @__PURE__ */ c(le, {}),
|
|
210
210
|
/* @__PURE__ */ c("span", { className: w(o && "invisible"), children: d.children }),
|
|
211
211
|
t && !d.disabled && /* @__PURE__ */ c(
|
|
212
212
|
"a",
|
|
@@ -222,7 +222,7 @@ function ce({
|
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function me(n) {
|
|
226
226
|
const [a, e] = x(""), o = A((t) => {
|
|
227
227
|
let r = t, s = "";
|
|
228
228
|
for (; r && !s; ) {
|
|
@@ -239,7 +239,7 @@ function fe(n) {
|
|
|
239
239
|
}
|
|
240
240
|
}, [n, o]), a;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function je({
|
|
243
243
|
ref: n,
|
|
244
244
|
id: a,
|
|
245
245
|
size: e = 20,
|
|
@@ -252,7 +252,7 @@ function Be({
|
|
|
252
252
|
className: u = "",
|
|
253
253
|
...f
|
|
254
254
|
}) {
|
|
255
|
-
const i = $(), g =
|
|
255
|
+
const i = $(), g = J(() => a || `checkbox-${i}`, [a, i]), b = me(g), [m, v] = x(s);
|
|
256
256
|
E(() => {
|
|
257
257
|
v(s);
|
|
258
258
|
}, [s]);
|
|
@@ -287,11 +287,11 @@ function Be({
|
|
|
287
287
|
},
|
|
288
288
|
className: p,
|
|
289
289
|
...f,
|
|
290
|
-
children: m && /* @__PURE__ */ c(
|
|
290
|
+
children: m && /* @__PURE__ */ c(te, { size: e, color: t ? b : void 0 })
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Fe({
|
|
295
295
|
children: n,
|
|
296
296
|
className: a,
|
|
297
297
|
linkTo: e,
|
|
@@ -322,7 +322,7 @@ function je({
|
|
|
322
322
|
)
|
|
323
323
|
] });
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function j({ elementId: n, type: a, message: e }) {
|
|
326
326
|
return E(() => {
|
|
327
327
|
const o = document.getElementById(n);
|
|
328
328
|
if (o) {
|
|
@@ -348,29 +348,29 @@ function B({ elementId: n, type: a, message: e }) {
|
|
|
348
348
|
),
|
|
349
349
|
role: "status",
|
|
350
350
|
children: [
|
|
351
|
-
a === "error" ? /* @__PURE__ */ c(
|
|
351
|
+
a === "error" ? /* @__PURE__ */ c(re, {}) : /* @__PURE__ */ c(oe, {}),
|
|
352
352
|
/* @__PURE__ */ c("span", { id: `${n}-${a}-message`, children: e })
|
|
353
353
|
]
|
|
354
354
|
}
|
|
355
355
|
) : null;
|
|
356
356
|
}
|
|
357
|
-
const
|
|
357
|
+
const be = {
|
|
358
358
|
base: "",
|
|
359
359
|
default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",
|
|
360
360
|
underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
361
361
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
362
|
-
},
|
|
362
|
+
}, he = {
|
|
363
363
|
none: "rounded-none",
|
|
364
364
|
sm: "rounded-sm",
|
|
365
365
|
md: "rounded-md",
|
|
366
366
|
lg: "rounded-lg",
|
|
367
367
|
full: "px-3 rounded-full"
|
|
368
|
-
},
|
|
368
|
+
}, _ = {
|
|
369
369
|
variant: "default",
|
|
370
370
|
rounded: "none"
|
|
371
371
|
};
|
|
372
|
-
function
|
|
373
|
-
variant: n =
|
|
372
|
+
function Se({
|
|
373
|
+
variant: n = _.variant,
|
|
374
374
|
rounded: a,
|
|
375
375
|
displayOnlyMode: e = !1,
|
|
376
376
|
errorMessage: o,
|
|
@@ -381,12 +381,12 @@ function Fe({
|
|
|
381
381
|
}) {
|
|
382
382
|
const d = $(), [u, f] = x(!1);
|
|
383
383
|
let i = a;
|
|
384
|
-
n === "outline" && !a && (i = "md"), i = i ||
|
|
384
|
+
n === "outline" && !a && (i = "md"), i = i || _.rounded;
|
|
385
385
|
const m = w(
|
|
386
386
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
387
387
|
"file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",
|
|
388
|
-
!e &&
|
|
389
|
-
!e &&
|
|
388
|
+
!e && be[n],
|
|
389
|
+
!e && he[i],
|
|
390
390
|
r === "password" && "pr-10",
|
|
391
391
|
!e && "px-2 py-1",
|
|
392
392
|
e && "pointer-events-none",
|
|
@@ -415,15 +415,15 @@ function Fe({
|
|
|
415
415
|
className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
|
|
416
416
|
"aria-label": "Toggle password visibility",
|
|
417
417
|
"data-state": u ? "visible" : "hidden",
|
|
418
|
-
children: u ? /* @__PURE__ */ c(
|
|
418
|
+
children: u ? /* @__PURE__ */ c(ne, { size: 20 }) : /* @__PURE__ */ c(ae, { size: 20 })
|
|
419
419
|
}
|
|
420
420
|
)
|
|
421
421
|
] }),
|
|
422
|
-
!e && /* @__PURE__ */ c(
|
|
423
|
-
!e && /* @__PURE__ */ c(
|
|
422
|
+
!e && /* @__PURE__ */ c(j, { elementId: d, type: "error", message: o }),
|
|
423
|
+
!e && /* @__PURE__ */ c(j, { elementId: d, type: "success", message: t })
|
|
424
424
|
] });
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function He({
|
|
427
427
|
display: n = "inline",
|
|
428
428
|
width: a = "fit-content",
|
|
429
429
|
className: e = "",
|
|
@@ -447,20 +447,20 @@ function Se({
|
|
|
447
447
|
"aria-describedby": i,
|
|
448
448
|
"aria-label": "Help information",
|
|
449
449
|
title: t,
|
|
450
|
-
children: /* @__PURE__ */ c(
|
|
450
|
+
children: /* @__PURE__ */ c(se, {})
|
|
451
451
|
}
|
|
452
452
|
),
|
|
453
453
|
t && /* @__PURE__ */ c("div", { id: i, className: "sr-only", children: t }),
|
|
454
454
|
r && /* @__PURE__ */ c("span", { className: "ml-1", children: r })
|
|
455
455
|
] });
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function pe(n) {
|
|
458
458
|
const [a, e] = x(!1), [o, t] = x(!1);
|
|
459
459
|
return E(() => {
|
|
460
460
|
n ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));
|
|
461
461
|
}, [n]), { show: a, shouldRender: o };
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function ge(n, a) {
|
|
464
464
|
E(() => {
|
|
465
465
|
const e = (o) => {
|
|
466
466
|
o.key === "Escape" && n && a();
|
|
@@ -470,8 +470,8 @@ function pe(n, a) {
|
|
|
470
470
|
};
|
|
471
471
|
}, [n, a]);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
const e =
|
|
473
|
+
function ve(n, a) {
|
|
474
|
+
const e = B(null), o = A(() => {
|
|
475
475
|
const t = document.getElementById(n);
|
|
476
476
|
if (!t) return;
|
|
477
477
|
const r = t.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -497,7 +497,7 @@ function ge(n, a) {
|
|
|
497
497
|
document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
|
|
498
498
|
}), [a, o]);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function qe({
|
|
501
501
|
id: n,
|
|
502
502
|
isOpen: a,
|
|
503
503
|
onClose: e,
|
|
@@ -512,13 +512,13 @@ function He({
|
|
|
512
512
|
ariaLabelledBy: i,
|
|
513
513
|
ariaDescribedBy: g
|
|
514
514
|
}) {
|
|
515
|
-
const b = $(), m = n || `modal-${b}`, v = n ? `${n}-title` : `modal-title-${b}`, { show: h, shouldRender: y } =
|
|
516
|
-
if (
|
|
517
|
-
const p = () => o ? T.isValidElement(o) ? /* @__PURE__ */ c("div", { className: "mb-4", children: o }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: v, children: o }) : null, C = () => u.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: u.map((D,
|
|
518
|
-
const { label:
|
|
519
|
-
return /* @__PURE__ */ c(
|
|
515
|
+
const b = $(), m = n || `modal-${b}`, v = n ? `${n}-title` : `modal-title-${b}`, { show: h, shouldRender: y } = pe(a);
|
|
516
|
+
if (ve(m, y), ge(y, e), !y) return null;
|
|
517
|
+
const p = () => o ? T.isValidElement(o) ? /* @__PURE__ */ c("div", { className: "mb-4", children: o }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: v, children: o }) : null, C = () => u.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: u.map((D, F) => {
|
|
518
|
+
const { label: S, className: L, ...R } = D;
|
|
519
|
+
return /* @__PURE__ */ c(fe, { className: L, type: "button", ...R, "data-modal-action": "true", children: S }, F);
|
|
520
520
|
}) });
|
|
521
|
-
return /* @__PURE__ */ c(
|
|
521
|
+
return /* @__PURE__ */ c(X, { children: Y(
|
|
522
522
|
/* @__PURE__ */ c(
|
|
523
523
|
"div",
|
|
524
524
|
{
|
|
@@ -531,19 +531,19 @@ function He({
|
|
|
531
531
|
/* @__PURE__ */ c(
|
|
532
532
|
"div",
|
|
533
533
|
{
|
|
534
|
-
className:
|
|
534
|
+
className: q("fixed inset-0 bg-black/20 transition-all", l),
|
|
535
535
|
onClick: () => {
|
|
536
536
|
f || e();
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
),
|
|
540
|
-
r && /* @__PURE__ */ c("div", { className:
|
|
540
|
+
r && /* @__PURE__ */ c("div", { className: q("relative w-fit", s), children: t }),
|
|
541
541
|
!r && /* @__PURE__ */ N(
|
|
542
542
|
"div",
|
|
543
543
|
{
|
|
544
544
|
id: m,
|
|
545
545
|
tabIndex: -1,
|
|
546
|
-
className:
|
|
546
|
+
className: q(
|
|
547
547
|
"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",
|
|
548
548
|
h ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
549
549
|
s
|
|
@@ -556,7 +556,7 @@ function He({
|
|
|
556
556
|
onClick: e,
|
|
557
557
|
"data-modal-close-button": "true",
|
|
558
558
|
className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
559
|
-
children: /* @__PURE__ */ c(
|
|
559
|
+
children: /* @__PURE__ */ c(ie, { size: 18 })
|
|
560
560
|
}
|
|
561
561
|
),
|
|
562
562
|
p(),
|
|
@@ -571,7 +571,7 @@ function He({
|
|
|
571
571
|
document.body
|
|
572
572
|
) });
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function we({ itemId: n, checked: a, onChange: e, name: o, disabled: t = !1, className: r = "" }) {
|
|
575
575
|
const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
|
|
576
576
|
t || e();
|
|
577
577
|
}, d = w(
|
|
@@ -608,7 +608,7 @@ function ve({ itemId: n, checked: a, onChange: e, name: o, disabled: t = !1, cla
|
|
|
608
608
|
}
|
|
609
609
|
);
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function G({
|
|
612
612
|
value: n,
|
|
613
613
|
children: a,
|
|
614
614
|
className: e = "",
|
|
@@ -640,7 +640,7 @@ function V({
|
|
|
640
640
|
},
|
|
641
641
|
children: [
|
|
642
642
|
!s && /* @__PURE__ */ c(
|
|
643
|
-
|
|
643
|
+
we,
|
|
644
644
|
{
|
|
645
645
|
itemId: f,
|
|
646
646
|
name: d || "",
|
|
@@ -677,7 +677,7 @@ function V({
|
|
|
677
677
|
}
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function ye(n, a) {
|
|
681
681
|
const [e, o] = x(a), [t, r] = x(-1), [s, l] = x(!1), d = A((b, m) => {
|
|
682
682
|
var y;
|
|
683
683
|
const v = b[m];
|
|
@@ -747,7 +747,7 @@ function we(n, a) {
|
|
|
747
747
|
};
|
|
748
748
|
}, [n, g, u, i]);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Ve({
|
|
751
751
|
options: n = [],
|
|
752
752
|
value: a,
|
|
753
753
|
onChange: e,
|
|
@@ -758,14 +758,14 @@ function qe({
|
|
|
758
758
|
hideInputs: l = !1
|
|
759
759
|
}) {
|
|
760
760
|
const d = $(), u = o || `radio-group-${d}`;
|
|
761
|
-
|
|
761
|
+
ye(
|
|
762
762
|
u,
|
|
763
763
|
n.findIndex((i) => i === a)
|
|
764
764
|
);
|
|
765
|
-
const f =
|
|
765
|
+
const f = J(() => n.reduce((i, g) => (typeof g == "string" ? i.some((b) => b.value === g) || i.push({ label: g, value: g }) : i.push(g), i), []), [n]);
|
|
766
766
|
return /* @__PURE__ */ N("div", { id: u, role: "radiogroup", tabIndex: 0, className: w(r, "focus:outline-none"), children: [
|
|
767
767
|
f.length > 0 && f.map((i, g) => /* @__PURE__ */ c(
|
|
768
|
-
|
|
768
|
+
G,
|
|
769
769
|
{
|
|
770
770
|
value: i.value,
|
|
771
771
|
isSelected: a === i.value,
|
|
@@ -779,8 +779,8 @@ function qe({
|
|
|
779
779
|
},
|
|
780
780
|
`${i.value}-${g}`
|
|
781
781
|
)),
|
|
782
|
-
f.length === 0 && t && T.Children.map(t, (i) => T.isValidElement(i) && i.type ===
|
|
783
|
-
|
|
782
|
+
f.length === 0 && t && T.Children.map(t, (i) => T.isValidElement(i) && i.type === G ? /* @__PURE__ */ c(
|
|
783
|
+
G,
|
|
784
784
|
{
|
|
785
785
|
...i.props,
|
|
786
786
|
className: w(s, i.props.className),
|
|
@@ -794,18 +794,18 @@ function qe({
|
|
|
794
794
|
] });
|
|
795
795
|
}
|
|
796
796
|
function Ke({ children: n, ref: a, ...e }) {
|
|
797
|
-
if (
|
|
797
|
+
if (O(n)) {
|
|
798
798
|
let o = { ...e };
|
|
799
|
-
return n.props && (o = { ...o, ...n.props }),
|
|
799
|
+
return n.props && (o = { ...o, ...n.props }), P(n, {
|
|
800
800
|
...o,
|
|
801
801
|
ref: (t) => {
|
|
802
802
|
typeof a == "function" ? a(t) : a && (a.current = t);
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
return
|
|
806
|
+
return Z("div", { ...e, ref: a }, n);
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function xe({ elementId: n, maxLength: a }) {
|
|
809
809
|
const [e, o] = x(0);
|
|
810
810
|
return E(() => {
|
|
811
811
|
const t = document.getElementById(n);
|
|
@@ -838,7 +838,7 @@ function ye({ elementId: n, maxLength: a }) {
|
|
|
838
838
|
}
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function Ne(n, a) {
|
|
842
842
|
E(() => {
|
|
843
843
|
const e = document.getElementById(n);
|
|
844
844
|
if (!e)
|
|
@@ -855,11 +855,11 @@ function xe(n, a) {
|
|
|
855
855
|
};
|
|
856
856
|
}, [n, a]);
|
|
857
857
|
}
|
|
858
|
-
const
|
|
858
|
+
const Ce = {
|
|
859
859
|
base: "",
|
|
860
860
|
"left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
861
861
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
862
|
-
},
|
|
862
|
+
}, Ee = {
|
|
863
863
|
none: "rounded-none",
|
|
864
864
|
sm: "rounded-sm",
|
|
865
865
|
md: "rounded-md",
|
|
@@ -869,7 +869,7 @@ const Ne = {
|
|
|
869
869
|
variant: "outline",
|
|
870
870
|
rounded: "none"
|
|
871
871
|
};
|
|
872
|
-
function
|
|
872
|
+
function Ge({
|
|
873
873
|
variant: n = Q.variant,
|
|
874
874
|
rounded: a,
|
|
875
875
|
displayOnlyMode: e = !1,
|
|
@@ -882,15 +882,15 @@ function Ve({
|
|
|
882
882
|
...u
|
|
883
883
|
}) {
|
|
884
884
|
const f = $();
|
|
885
|
-
|
|
885
|
+
Ne(f, s || e);
|
|
886
886
|
let i = a;
|
|
887
887
|
n === "outline" && !a && (i = "md"), i = i || Q.rounded;
|
|
888
888
|
let g = r;
|
|
889
889
|
(e || n === "left-line" && !r) && (g = !0);
|
|
890
890
|
const m = w(
|
|
891
891
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
892
|
-
!e &&
|
|
893
|
-
!e &&
|
|
892
|
+
!e && Ce[n],
|
|
893
|
+
!e && Ee[i],
|
|
894
894
|
!e && "px-2 py-1",
|
|
895
895
|
e && "pointer-events-none",
|
|
896
896
|
g && "no-resize-handle",
|
|
@@ -911,12 +911,13 @@ function Ve({
|
|
|
911
911
|
className: m
|
|
912
912
|
}
|
|
913
913
|
),
|
|
914
|
-
l > 0 && /* @__PURE__ */ c(
|
|
915
|
-
!e && /* @__PURE__ */ c(
|
|
916
|
-
!e && /* @__PURE__ */ c(
|
|
914
|
+
l > 0 && /* @__PURE__ */ c(xe, { elementId: f, maxLength: l }),
|
|
915
|
+
!e && /* @__PURE__ */ c(j, { elementId: f, type: "error", message: o }),
|
|
916
|
+
!e && /* @__PURE__ */ c(j, { elementId: f, type: "success", message: t })
|
|
917
917
|
] });
|
|
918
918
|
}
|
|
919
|
-
|
|
919
|
+
const k = 8, z = 4, I = 6;
|
|
920
|
+
function Ae(n) {
|
|
920
921
|
return { calculatePosition: A(
|
|
921
922
|
(e, o) => {
|
|
922
923
|
const t = e.getBoundingClientRect(), r = o.getBoundingClientRect(), s = {
|
|
@@ -925,7 +926,7 @@ function Ee(n) {
|
|
|
925
926
|
}, l = (g, b, m, v) => g < 0 || b < 0 || g + m > s.width || b + v > s.height, d = {
|
|
926
927
|
top: {
|
|
927
928
|
x: t.left + t.width / 2 - r.width / 2,
|
|
928
|
-
y: t.top - r.height -
|
|
929
|
+
y: t.top - r.height - z,
|
|
929
930
|
arrow: {
|
|
930
931
|
x: r.width / 2 - I,
|
|
931
932
|
y: r.height
|
|
@@ -933,14 +934,14 @@ function Ee(n) {
|
|
|
933
934
|
},
|
|
934
935
|
bottom: {
|
|
935
936
|
x: t.left + t.width / 2 - r.width / 2,
|
|
936
|
-
y: t.bottom +
|
|
937
|
+
y: t.bottom + z,
|
|
937
938
|
arrow: {
|
|
938
939
|
x: r.width / 2 - I,
|
|
939
940
|
y: -6
|
|
940
941
|
}
|
|
941
942
|
},
|
|
942
943
|
left: {
|
|
943
|
-
x: t.left - r.width -
|
|
944
|
+
x: t.left - r.width - z,
|
|
944
945
|
y: t.top + t.height / 2 - r.height / 2,
|
|
945
946
|
arrow: {
|
|
946
947
|
x: r.width,
|
|
@@ -948,7 +949,7 @@ function Ee(n) {
|
|
|
948
949
|
}
|
|
949
950
|
},
|
|
950
951
|
right: {
|
|
951
|
-
x: t.right +
|
|
952
|
+
x: t.right + z,
|
|
952
953
|
y: t.top + t.height / 2 - r.height / 2,
|
|
953
954
|
arrow: {
|
|
954
955
|
x: -6,
|
|
@@ -979,7 +980,13 @@ function Ee(n) {
|
|
|
979
980
|
}
|
|
980
981
|
}
|
|
981
982
|
}
|
|
982
|
-
f.x = Math.max(
|
|
983
|
+
f.x = Math.max(
|
|
984
|
+
k,
|
|
985
|
+
Math.min(f.x, s.width - r.width - k)
|
|
986
|
+
), f.y = Math.max(
|
|
987
|
+
k,
|
|
988
|
+
Math.min(f.y, s.height - r.height - k)
|
|
989
|
+
);
|
|
983
990
|
const i = {
|
|
984
991
|
x: t.left + t.width / 2,
|
|
985
992
|
y: t.top + t.height / 2
|
|
@@ -998,8 +1005,8 @@ function Ee(n) {
|
|
|
998
1005
|
[n]
|
|
999
1006
|
) };
|
|
1000
1007
|
}
|
|
1001
|
-
function
|
|
1002
|
-
const o =
|
|
1008
|
+
function Ie(n, a, e) {
|
|
1009
|
+
const o = B(null), t = B(null), r = A(() => {
|
|
1003
1010
|
if (!o.current || !t.current) return;
|
|
1004
1011
|
const s = n(o.current, t.current);
|
|
1005
1012
|
e(s);
|
|
@@ -1016,8 +1023,8 @@ function Ae(n, a, e) {
|
|
|
1016
1023
|
updatePosition: r
|
|
1017
1024
|
};
|
|
1018
1025
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const u =
|
|
1026
|
+
function $e(n, a, e, o, t, r, s, l, d) {
|
|
1027
|
+
const u = B(null), f = A(() => {
|
|
1021
1028
|
n || (u.current && clearTimeout(u.current), u.current = window.setTimeout(() => {
|
|
1022
1029
|
e(!0), requestAnimationFrame(() => {
|
|
1023
1030
|
t(), o(!0);
|
|
@@ -1045,8 +1052,7 @@ function Ie(n, a, e, o, t, r, s, l, d) {
|
|
|
1045
1052
|
timeoutRef: u
|
|
1046
1053
|
};
|
|
1047
1054
|
}
|
|
1048
|
-
|
|
1049
|
-
function Ge({
|
|
1055
|
+
function We({
|
|
1050
1056
|
id: n,
|
|
1051
1057
|
children: a,
|
|
1052
1058
|
message: e,
|
|
@@ -1055,21 +1061,21 @@ function Ge({
|
|
|
1055
1061
|
delay: r = 200,
|
|
1056
1062
|
className: s
|
|
1057
1063
|
}) {
|
|
1058
|
-
const [l, d] = x(!1), [u, f] = x(!1), [i, g] = x(null), [b, m] = x(!1), [v, h] = x(!1), [y, p] = x(!1), { calculatePosition: C } =
|
|
1064
|
+
const [l, d] = x(!1), [u, f] = x(!1), [i, g] = x(null), [b, m] = x(!1), [v, h] = x(!1), [y, p] = x(!1), { calculatePosition: C } = Ae(o), { triggerRef: D, tooltipRef: F, updatePosition: S } = Ie(C, u, g), { showTooltip: L, hideTooltip: R, timeoutRef: W } = $e(
|
|
1059
1065
|
t,
|
|
1060
1066
|
r,
|
|
1061
1067
|
f,
|
|
1062
1068
|
d,
|
|
1063
|
-
|
|
1069
|
+
S,
|
|
1064
1070
|
b,
|
|
1065
1071
|
v,
|
|
1066
1072
|
y,
|
|
1067
1073
|
l
|
|
1068
|
-
),
|
|
1069
|
-
return /* @__PURE__ */ N(
|
|
1074
|
+
), M = $(), U = n ?? M;
|
|
1075
|
+
return /* @__PURE__ */ N(X, { children: [
|
|
1070
1076
|
T.cloneElement(a, {
|
|
1071
|
-
ref: (
|
|
1072
|
-
D.current =
|
|
1077
|
+
ref: (H) => {
|
|
1078
|
+
D.current = H;
|
|
1073
1079
|
},
|
|
1074
1080
|
onMouseEnter: () => {
|
|
1075
1081
|
m(!0), L();
|
|
@@ -1083,16 +1089,16 @@ function Ge({
|
|
|
1083
1089
|
onBlur: () => {
|
|
1084
1090
|
p(!1), R(!0);
|
|
1085
1091
|
},
|
|
1086
|
-
onKeyDown: (
|
|
1087
|
-
|
|
1092
|
+
onKeyDown: (H) => {
|
|
1093
|
+
H.key === "Escape" && R(!0);
|
|
1088
1094
|
},
|
|
1089
1095
|
"aria-describedby": t ? void 0 : U
|
|
1090
1096
|
}),
|
|
1091
|
-
u &&
|
|
1097
|
+
u && Y(
|
|
1092
1098
|
/* @__PURE__ */ c(
|
|
1093
1099
|
"div",
|
|
1094
1100
|
{
|
|
1095
|
-
ref:
|
|
1101
|
+
ref: F,
|
|
1096
1102
|
id: U,
|
|
1097
1103
|
role: "tooltip",
|
|
1098
1104
|
className: w(
|
|
@@ -1102,7 +1108,7 @@ function Ge({
|
|
|
1102
1108
|
),
|
|
1103
1109
|
style: i ? { left: i.x, top: i.y } : { opacity: 0 },
|
|
1104
1110
|
onMouseEnter: () => {
|
|
1105
|
-
h(!0),
|
|
1111
|
+
h(!0), W.current && clearTimeout(W.current);
|
|
1106
1112
|
},
|
|
1107
1113
|
onMouseLeave: () => {
|
|
1108
1114
|
h(!1);
|
|
@@ -1115,21 +1121,21 @@ function Ge({
|
|
|
1115
1121
|
] });
|
|
1116
1122
|
}
|
|
1117
1123
|
export {
|
|
1118
|
-
|
|
1119
|
-
|
|
1124
|
+
Be as Accordion,
|
|
1125
|
+
V as AccordionItem,
|
|
1120
1126
|
Qe as ActionModal,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1127
|
+
fe as Button,
|
|
1128
|
+
le as ButtonLoadingDots,
|
|
1129
|
+
je as Checkbox,
|
|
1130
|
+
Fe as Clickable,
|
|
1131
|
+
Se as Input,
|
|
1132
|
+
He as Label,
|
|
1133
|
+
qe as Modal,
|
|
1134
|
+
Ve as RadioGroup,
|
|
1135
|
+
G as RadioGroupItem,
|
|
1136
|
+
we as RadioInput,
|
|
1131
1137
|
Ke as Slot,
|
|
1132
|
-
|
|
1133
|
-
|
|
1138
|
+
Ge as Textarea,
|
|
1139
|
+
We as Tooltip
|
|
1134
1140
|
};
|
|
1135
1141
|
//# sourceMappingURL=components.esm.js.map
|