@versini/ui-panel 1.3.0 → 1.3.2
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/index.js +134 -138
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as n, jsxs as x, Fragment as $ } from "react/jsx-runtime";
|
|
2
2
|
import i from "clsx";
|
|
3
|
-
import * as
|
|
4
|
-
import M, { useId as
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import M, { useId as V, useRef as D, useEffect as W } from "react";
|
|
5
5
|
import { useFloating as G, useClick as X, useDismiss as Y, useRole as q, useInteractions as H, useMergeRefs as J, FloatingPortal as K, FloatingOverlay as Q, FloatingFocusManager as Z } from "@floating-ui/react";
|
|
6
6
|
/*!
|
|
7
|
-
@versini/ui-panel v1.3.
|
|
7
|
+
@versini/ui-panel v1.3.2
|
|
8
8
|
© 2025 gizmette.com
|
|
9
9
|
*/
|
|
10
10
|
try {
|
|
11
11
|
window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
|
|
12
|
-
version: "1.3.
|
|
13
|
-
buildTime: "01/
|
|
12
|
+
version: "1.3.2",
|
|
13
|
+
buildTime: "01/04/2025 01:33 PM EST",
|
|
14
14
|
homepage: "https://github.com/aversini/ui-components",
|
|
15
15
|
license: "MIT"
|
|
16
16
|
});
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
|
-
const C = "av-messagebox",
|
|
19
|
+
const C = "av-messagebox", P = "av-panel", O = "av-button", _ = "icon", z = "button", T = "link", ee = ({
|
|
20
20
|
type: e,
|
|
21
21
|
size: t,
|
|
22
22
|
labelRight: r,
|
|
23
23
|
labelLeft: a,
|
|
24
24
|
align: o
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
26
|
+
const d = "max-h-8 py-0 px-2", c = "max-h-9 py-1 px-3", l = "max-h-12 py-2 px-4";
|
|
27
27
|
switch (e) {
|
|
28
|
-
case
|
|
28
|
+
case z:
|
|
29
29
|
case T:
|
|
30
30
|
return i({
|
|
31
|
-
[
|
|
31
|
+
[d]: t === "small",
|
|
32
32
|
[c]: t === "medium",
|
|
33
|
-
[
|
|
33
|
+
[l]: t === "large"
|
|
34
34
|
});
|
|
35
35
|
case _:
|
|
36
36
|
return i("inline-flex items-center", {
|
|
@@ -51,20 +51,20 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
|
|
|
51
51
|
labelRight: r,
|
|
52
52
|
labelLeft: a
|
|
53
53
|
}) => {
|
|
54
|
-
const o = "text-sm font-medium",
|
|
54
|
+
const o = "text-sm font-medium", d = "text-base font-medium", c = "text-lg font-medium";
|
|
55
55
|
switch (e) {
|
|
56
|
-
case
|
|
56
|
+
case z:
|
|
57
57
|
case T:
|
|
58
58
|
return i({
|
|
59
59
|
"text-center": e === T,
|
|
60
60
|
[o]: t === "small",
|
|
61
|
-
[
|
|
61
|
+
[d]: t === "medium",
|
|
62
62
|
[c]: t === "large"
|
|
63
63
|
});
|
|
64
64
|
case _:
|
|
65
65
|
return i({
|
|
66
66
|
[o]: t === "small" && (r || a),
|
|
67
|
-
[
|
|
67
|
+
[d]: t === "medium" && (r || a),
|
|
68
68
|
[c]: t === "large" && (r || a)
|
|
69
69
|
});
|
|
70
70
|
}
|
|
@@ -79,34 +79,30 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
|
|
|
79
79
|
if (a === "primary")
|
|
80
80
|
return i("not-prose", {
|
|
81
81
|
truncate: !r,
|
|
82
|
-
"text-copy-light": e === "dark",
|
|
83
|
-
"text-copy-lighter": e === "light",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
82
|
+
"text-copy-light": e === "dark" || e === "system",
|
|
83
|
+
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
84
|
+
"dark:text-copy-lighter": e === "system",
|
|
85
|
+
"dark:text-copy-light": e === "alt-system"
|
|
86
86
|
});
|
|
87
87
|
if (a === "secondary")
|
|
88
88
|
return i("not-prose", {
|
|
89
89
|
truncate: !r,
|
|
90
|
-
"text-copy-light": e === "light",
|
|
91
|
-
"text-copy-lighter": e === "dark",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
90
|
+
"text-copy-light": e === "light" || e === "system",
|
|
91
|
+
"text-copy-lighter": e === "dark" || e === "alt-system",
|
|
92
|
+
"dark:text-copy-lighter": e === "alt-system",
|
|
93
|
+
"dark:text-copy-light": e === "system"
|
|
94
94
|
});
|
|
95
95
|
if (a === "danger")
|
|
96
96
|
return i("not-prose", {
|
|
97
97
|
truncate: !r,
|
|
98
|
-
"text-copy-light": e === "dark",
|
|
99
|
-
"text-copy-lighter": e === "light",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
98
|
+
"text-copy-light": e === "dark" || e === "system",
|
|
99
|
+
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
100
|
+
"dark:text-copy-lighter": e === "system",
|
|
101
|
+
"dark:text-copy-light": e === "alt-system"
|
|
102
102
|
});
|
|
103
103
|
if (a === "selected")
|
|
104
|
-
return i("not-prose", {
|
|
105
|
-
truncate: !r
|
|
106
|
-
"text-copy-light": e === "dark",
|
|
107
|
-
"text-copy-lighter": e === "light",
|
|
108
|
-
"text-copy-light dark:text-copy-lighter": e === "system",
|
|
109
|
-
"text-copy-lighter dark:text-copy-light": e === "alt-system"
|
|
104
|
+
return i("not-prose text-copy-lighter", {
|
|
105
|
+
truncate: !r
|
|
110
106
|
});
|
|
111
107
|
}, ae = ({
|
|
112
108
|
mode: e,
|
|
@@ -204,7 +200,7 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
|
|
|
204
200
|
});
|
|
205
201
|
if (r === "selected")
|
|
206
202
|
return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
|
|
207
|
-
},
|
|
203
|
+
}, de = ({
|
|
208
204
|
mode: e,
|
|
209
205
|
noBorder: t,
|
|
210
206
|
variant: r
|
|
@@ -234,30 +230,30 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
|
|
|
234
230
|
});
|
|
235
231
|
if (r === "selected")
|
|
236
232
|
return "border border-border-selected-dark";
|
|
237
|
-
},
|
|
233
|
+
}, le = ({
|
|
238
234
|
focusMode: e
|
|
239
235
|
}) => i("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
240
236
|
"focus:outline-focus-dark": e === "dark",
|
|
241
237
|
"focus:outline-focus-light": e === "light",
|
|
242
238
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
243
239
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
244
|
-
}),
|
|
240
|
+
}), U = ({
|
|
245
241
|
type: e,
|
|
246
242
|
className: t,
|
|
247
243
|
raw: r,
|
|
248
244
|
mode: a,
|
|
249
245
|
focusMode: o,
|
|
250
|
-
disabled:
|
|
246
|
+
disabled: d,
|
|
251
247
|
fullWidth: c,
|
|
252
|
-
size:
|
|
253
|
-
noBorder:
|
|
248
|
+
size: l,
|
|
249
|
+
noBorder: h,
|
|
254
250
|
labelRight: g,
|
|
255
251
|
labelLeft: b,
|
|
256
252
|
noBackground: f,
|
|
257
253
|
variant: s,
|
|
258
254
|
noTruncate: u,
|
|
259
|
-
align:
|
|
260
|
-
radius:
|
|
255
|
+
align: v,
|
|
256
|
+
radius: p
|
|
261
257
|
}) => (s || (s = "primary"), r ? i(O, t) : i(
|
|
262
258
|
O,
|
|
263
259
|
te({
|
|
@@ -267,22 +263,22 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
|
|
|
267
263
|
noTruncate: u
|
|
268
264
|
}),
|
|
269
265
|
ae({ mode: a, noBackground: f, variant: s }),
|
|
270
|
-
oe({ radius:
|
|
266
|
+
oe({ radius: p }),
|
|
271
267
|
ee({
|
|
272
268
|
type: e,
|
|
273
|
-
size:
|
|
269
|
+
size: l,
|
|
274
270
|
labelRight: g,
|
|
275
271
|
labelLeft: b,
|
|
276
|
-
align:
|
|
272
|
+
align: v
|
|
277
273
|
}),
|
|
278
|
-
re({ type: e, size:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
ie({ mode: a, variant: s, disabled:
|
|
282
|
-
ne({ mode: a, variant: s, disabled:
|
|
274
|
+
re({ type: e, size: l, labelRight: g, labelLeft: b }),
|
|
275
|
+
de({ mode: a, variant: s, noBorder: h }),
|
|
276
|
+
le({ focusMode: o }),
|
|
277
|
+
ie({ mode: a, variant: s, disabled: d }),
|
|
278
|
+
ne({ mode: a, variant: s, disabled: d }),
|
|
283
279
|
{
|
|
284
280
|
"w-full": c,
|
|
285
|
-
"disabled:cursor-not-allowed disabled:opacity-50":
|
|
281
|
+
"disabled:cursor-not-allowed disabled:opacity-50": d
|
|
286
282
|
},
|
|
287
283
|
t
|
|
288
284
|
)), ce = (e, t, r) => {
|
|
@@ -294,57 +290,57 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
|
|
|
294
290
|
"button",
|
|
295
291
|
{
|
|
296
292
|
ref: t,
|
|
297
|
-
onClick: (
|
|
298
|
-
ce(
|
|
293
|
+
onClick: (d) => {
|
|
294
|
+
ce(d, a, r);
|
|
299
295
|
},
|
|
300
296
|
...o
|
|
301
297
|
}
|
|
302
298
|
);
|
|
303
299
|
});
|
|
304
300
|
L.displayName = "BaseButton";
|
|
305
|
-
const
|
|
301
|
+
const A = M.forwardRef(
|
|
306
302
|
({
|
|
307
303
|
children: e,
|
|
308
304
|
disabled: t = !1,
|
|
309
305
|
mode: r = "system",
|
|
310
306
|
focusMode: a = "system",
|
|
311
307
|
fullWidth: o = !1,
|
|
312
|
-
className:
|
|
308
|
+
className: d,
|
|
313
309
|
type: c = "button",
|
|
314
|
-
raw:
|
|
315
|
-
noBorder:
|
|
310
|
+
raw: l = !1,
|
|
311
|
+
noBorder: h = !1,
|
|
316
312
|
"aria-label": g,
|
|
317
313
|
label: b,
|
|
318
314
|
size: f = "medium",
|
|
319
315
|
labelRight: s,
|
|
320
316
|
labelLeft: u,
|
|
321
|
-
noBackground:
|
|
322
|
-
align:
|
|
317
|
+
noBackground: v = !1,
|
|
318
|
+
align: p = "center",
|
|
323
319
|
radius: y = "large",
|
|
324
320
|
variant: I = "primary",
|
|
325
321
|
...E
|
|
326
322
|
}, B) => {
|
|
327
|
-
const S =
|
|
323
|
+
const S = U({
|
|
328
324
|
type: _,
|
|
329
325
|
mode: r,
|
|
330
326
|
focusMode: a,
|
|
331
327
|
fullWidth: o,
|
|
332
328
|
disabled: t,
|
|
333
|
-
raw:
|
|
334
|
-
className:
|
|
335
|
-
noBorder:
|
|
329
|
+
raw: l,
|
|
330
|
+
className: d,
|
|
331
|
+
noBorder: h,
|
|
336
332
|
size: f,
|
|
337
333
|
labelRight: s,
|
|
338
334
|
labelLeft: u,
|
|
339
|
-
noBackground:
|
|
340
|
-
align:
|
|
335
|
+
noBackground: v,
|
|
336
|
+
align: p,
|
|
341
337
|
radius: y,
|
|
342
338
|
variant: I
|
|
343
339
|
}), R = i({
|
|
344
|
-
"text-copy-accent-dark": r === "light" && !
|
|
345
|
-
"text-copy-light": r === "dark" && !
|
|
346
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
347
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
340
|
+
"text-copy-accent-dark": r === "light" && !l,
|
|
341
|
+
"text-copy-light": r === "dark" && !l,
|
|
342
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !l,
|
|
343
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !l
|
|
348
344
|
});
|
|
349
345
|
return /* @__PURE__ */ x(
|
|
350
346
|
L,
|
|
@@ -364,15 +360,15 @@ const U = M.forwardRef(
|
|
|
364
360
|
);
|
|
365
361
|
}
|
|
366
362
|
);
|
|
367
|
-
|
|
363
|
+
A.displayName = "ButtonIcon";
|
|
368
364
|
/*!
|
|
369
|
-
@versini/ui-button v4.0.
|
|
365
|
+
@versini/ui-button v4.0.2
|
|
370
366
|
© 2025 gizmette.com
|
|
371
367
|
*/
|
|
372
368
|
try {
|
|
373
369
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
374
|
-
version: "4.0.
|
|
375
|
-
buildTime: "01/
|
|
370
|
+
version: "4.0.2",
|
|
371
|
+
buildTime: "01/04/2025 01:33 PM EST",
|
|
376
372
|
homepage: "https://github.com/aversini/ui-components",
|
|
377
373
|
license: "MIT"
|
|
378
374
|
});
|
|
@@ -385,41 +381,41 @@ const se = M.forwardRef(
|
|
|
385
381
|
mode: r = "system",
|
|
386
382
|
focusMode: a = "system",
|
|
387
383
|
fullWidth: o = !1,
|
|
388
|
-
className:
|
|
384
|
+
className: d,
|
|
389
385
|
type: c = "button",
|
|
390
|
-
raw:
|
|
391
|
-
noBorder:
|
|
386
|
+
raw: l = !1,
|
|
387
|
+
noBorder: h = !1,
|
|
392
388
|
"aria-label": g,
|
|
393
389
|
label: b,
|
|
394
390
|
size: f = "medium",
|
|
395
391
|
labelRight: s,
|
|
396
392
|
labelLeft: u,
|
|
397
|
-
noBackground:
|
|
398
|
-
align:
|
|
393
|
+
noBackground: v = !1,
|
|
394
|
+
align: p = "center",
|
|
399
395
|
active: y = !1,
|
|
400
396
|
radius: I = "large",
|
|
401
397
|
...E
|
|
402
398
|
}, B) => {
|
|
403
|
-
const S =
|
|
399
|
+
const S = U({
|
|
404
400
|
type: _,
|
|
405
401
|
mode: r,
|
|
406
402
|
focusMode: a,
|
|
407
403
|
fullWidth: o,
|
|
408
404
|
disabled: t,
|
|
409
|
-
raw:
|
|
410
|
-
className:
|
|
411
|
-
noBorder:
|
|
405
|
+
raw: l,
|
|
406
|
+
className: d,
|
|
407
|
+
noBorder: h,
|
|
412
408
|
size: f,
|
|
413
409
|
labelRight: s,
|
|
414
410
|
labelLeft: u,
|
|
415
|
-
noBackground:
|
|
416
|
-
align:
|
|
411
|
+
noBackground: v,
|
|
412
|
+
align: p,
|
|
417
413
|
radius: I
|
|
418
414
|
}), R = i({
|
|
419
|
-
"text-copy-accent-dark": r === "light" && !
|
|
420
|
-
"text-copy-light": r === "dark" && !
|
|
421
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
422
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
415
|
+
"text-copy-accent-dark": r === "light" && !l,
|
|
416
|
+
"text-copy-light": r === "dark" && !l,
|
|
417
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !l,
|
|
418
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !l
|
|
423
419
|
}), j = y ? i(
|
|
424
420
|
"relative",
|
|
425
421
|
"focus-within:static",
|
|
@@ -462,12 +458,12 @@ const ge = ({
|
|
|
462
458
|
viewBox: r,
|
|
463
459
|
className: a,
|
|
464
460
|
defaultViewBox: o,
|
|
465
|
-
size:
|
|
461
|
+
size: d,
|
|
466
462
|
title: c,
|
|
467
|
-
semantic:
|
|
468
|
-
...
|
|
463
|
+
semantic: l = !1,
|
|
464
|
+
...h
|
|
469
465
|
}) => {
|
|
470
|
-
const g = i(
|
|
466
|
+
const g = i(d, a);
|
|
471
467
|
return /* @__PURE__ */ x($, { children: [
|
|
472
468
|
/* @__PURE__ */ n(
|
|
473
469
|
"svg",
|
|
@@ -477,13 +473,13 @@ const ge = ({
|
|
|
477
473
|
viewBox: r || o,
|
|
478
474
|
fill: t || "currentColor",
|
|
479
475
|
role: "img",
|
|
480
|
-
"aria-hidden": !
|
|
476
|
+
"aria-hidden": !l,
|
|
481
477
|
focusable: !1,
|
|
482
|
-
...
|
|
478
|
+
...h,
|
|
483
479
|
children: e
|
|
484
480
|
}
|
|
485
481
|
),
|
|
486
|
-
c &&
|
|
482
|
+
c && l && /* @__PURE__ */ n("span", { className: "sr-only", children: c })
|
|
487
483
|
] });
|
|
488
484
|
};
|
|
489
485
|
/*!
|
|
@@ -493,13 +489,13 @@ const ge = ({
|
|
|
493
489
|
try {
|
|
494
490
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
495
491
|
version: "4.0.0",
|
|
496
|
-
buildTime: "01/
|
|
492
|
+
buildTime: "01/04/2025 01:33 PM EST",
|
|
497
493
|
homepage: "https://github.com/aversini/ui-components",
|
|
498
494
|
license: "MIT"
|
|
499
495
|
});
|
|
500
496
|
} catch {
|
|
501
497
|
}
|
|
502
|
-
const
|
|
498
|
+
const me = ({
|
|
503
499
|
className: e,
|
|
504
500
|
viewBox: t,
|
|
505
501
|
title: r,
|
|
@@ -518,49 +514,49 @@ const he = ({
|
|
|
518
514
|
}
|
|
519
515
|
);
|
|
520
516
|
/*!
|
|
521
|
-
@versini/ui-icons v4.
|
|
517
|
+
@versini/ui-icons v4.1.0
|
|
522
518
|
© 2025 gizmette.com
|
|
523
519
|
*/
|
|
524
520
|
try {
|
|
525
521
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
526
|
-
version: "4.
|
|
527
|
-
buildTime: "01/
|
|
522
|
+
version: "4.1.0",
|
|
523
|
+
buildTime: "01/04/2025 01:33 PM EST",
|
|
528
524
|
homepage: "https://github.com/aversini/ui-components",
|
|
529
525
|
license: "MIT"
|
|
530
526
|
});
|
|
531
527
|
} catch {
|
|
532
528
|
}
|
|
533
|
-
const F =
|
|
534
|
-
function
|
|
529
|
+
const F = m.createContext(null);
|
|
530
|
+
function he({
|
|
535
531
|
initialOpen: e = !1,
|
|
536
532
|
open: t,
|
|
537
533
|
onOpenChange: r
|
|
538
534
|
} = {}) {
|
|
539
|
-
const [a, o] =
|
|
535
|
+
const [a, o] = m.useState(e), [d, c] = m.useState(), [l, h] = m.useState(), g = t ?? a, b = r ?? o, f = G({
|
|
540
536
|
open: g,
|
|
541
537
|
onOpenChange: b
|
|
542
538
|
}), s = f.context, u = X(s, {
|
|
543
539
|
enabled: t == null
|
|
544
|
-
}),
|
|
540
|
+
}), v = Y(s, {
|
|
545
541
|
outsidePress: !1,
|
|
546
542
|
outsidePressEvent: "mousedown"
|
|
547
|
-
}),
|
|
548
|
-
return
|
|
543
|
+
}), p = q(s), y = H([u, v, p]);
|
|
544
|
+
return m.useMemo(
|
|
549
545
|
() => ({
|
|
550
546
|
open: g,
|
|
551
547
|
setOpen: b,
|
|
552
548
|
...y,
|
|
553
549
|
...f,
|
|
554
|
-
labelId:
|
|
555
|
-
descriptionId:
|
|
550
|
+
labelId: d,
|
|
551
|
+
descriptionId: l,
|
|
556
552
|
setLabelId: c,
|
|
557
|
-
setDescriptionId:
|
|
553
|
+
setDescriptionId: h
|
|
558
554
|
}),
|
|
559
|
-
[g, b, y, f,
|
|
555
|
+
[g, b, y, f, d, l]
|
|
560
556
|
);
|
|
561
557
|
}
|
|
562
558
|
const N = () => {
|
|
563
|
-
const e =
|
|
559
|
+
const e = m.useContext(F);
|
|
564
560
|
if (e == null)
|
|
565
561
|
throw new Error("Modal components must be wrapped in <Modal />");
|
|
566
562
|
return e;
|
|
@@ -569,18 +565,18 @@ function ue({
|
|
|
569
565
|
children: e,
|
|
570
566
|
...t
|
|
571
567
|
}) {
|
|
572
|
-
const r =
|
|
568
|
+
const r = he(t);
|
|
573
569
|
return /* @__PURE__ */ n(F.Provider, { value: r, children: e });
|
|
574
570
|
}
|
|
575
|
-
const be =
|
|
571
|
+
const be = m.forwardRef(function(e, t) {
|
|
576
572
|
const { context: r, ...a } = N(), o = J([a.refs.setFloating, t]);
|
|
577
573
|
if (!r.open)
|
|
578
574
|
return null;
|
|
579
|
-
const { overlayBackground:
|
|
580
|
-
[`${
|
|
581
|
-
"bg-black sm:bg-black/[.8]": !
|
|
575
|
+
const { overlayBackground: d, ...c } = e, l = i("grid place-items-center", {
|
|
576
|
+
[`${d}`]: d,
|
|
577
|
+
"bg-black sm:bg-black/[.8]": !d
|
|
582
578
|
});
|
|
583
|
-
return /* @__PURE__ */ n(K, { children: /* @__PURE__ */ n(Q, { className:
|
|
579
|
+
return /* @__PURE__ */ n(K, { children: /* @__PURE__ */ n(Q, { className: l, lockScroll: !0, children: /* @__PURE__ */ n(Z, { context: r, children: /* @__PURE__ */ n(
|
|
584
580
|
"div",
|
|
585
581
|
{
|
|
586
582
|
ref: o,
|
|
@@ -590,18 +586,18 @@ const be = h.forwardRef(function(e, t) {
|
|
|
590
586
|
children: c.children
|
|
591
587
|
}
|
|
592
588
|
) }) }) });
|
|
593
|
-
}), fe =
|
|
594
|
-
const { setLabelId: a } = N(), o =
|
|
595
|
-
return
|
|
596
|
-
}),
|
|
597
|
-
const { setDescriptionId: a } = N(), o =
|
|
598
|
-
return
|
|
599
|
-
}),
|
|
600
|
-
const { setOpen: r } = N(), { trigger: a, className: o, ...
|
|
601
|
-
return /* @__PURE__ */ n("div", { className: o, children:
|
|
589
|
+
}), fe = m.forwardRef(function({ children: e, ...t }, r) {
|
|
590
|
+
const { setLabelId: a } = N(), o = V();
|
|
591
|
+
return m.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ n("h1", { ...t, ref: r, id: o, children: e });
|
|
592
|
+
}), ve = m.forwardRef(function({ children: e, ...t }, r) {
|
|
593
|
+
const { setDescriptionId: a } = N(), o = V();
|
|
594
|
+
return m.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ n("div", { ...t, ref: r, id: o, children: e });
|
|
595
|
+
}), pe = m.forwardRef(function(e, t) {
|
|
596
|
+
const { setOpen: r } = N(), { trigger: a, className: o, ...d } = e, c = m.useCallback(() => r(!1), [r]);
|
|
597
|
+
return /* @__PURE__ */ n("div", { className: o, children: m.cloneElement(a, {
|
|
602
598
|
ref: t,
|
|
603
599
|
onClick: c,
|
|
604
|
-
...
|
|
600
|
+
...d
|
|
605
601
|
}) });
|
|
606
602
|
});
|
|
607
603
|
/*!
|
|
@@ -611,7 +607,7 @@ const be = h.forwardRef(function(e, t) {
|
|
|
611
607
|
try {
|
|
612
608
|
window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
|
|
613
609
|
version: "1.2.0",
|
|
614
|
-
buildTime: "01/
|
|
610
|
+
buildTime: "01/04/2025 01:33 PM EST",
|
|
615
611
|
homepage: "https://github.com/aversini/ui-components",
|
|
616
612
|
license: "MIT"
|
|
617
613
|
});
|
|
@@ -623,8 +619,8 @@ const k = "panel", w = "messagebox", ye = ({
|
|
|
623
619
|
borderMode: r
|
|
624
620
|
}) => ({
|
|
625
621
|
main: i("prose prose-lighter flex flex-col bg-surface-medium", {
|
|
626
|
-
[`${
|
|
627
|
-
[`${
|
|
622
|
+
[`${P} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === k,
|
|
623
|
+
[`${P} w-full sm:w-[95%] md:max-w-2xl`]: t === k && !e,
|
|
628
624
|
[`${C} rounded-lg border-2`]: t === w,
|
|
629
625
|
[`${C} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === w && !e,
|
|
630
626
|
[`${e}`]: !!e,
|
|
@@ -643,39 +639,39 @@ const k = "panel", w = "messagebox", ye = ({
|
|
|
643
639
|
title: r,
|
|
644
640
|
children: a,
|
|
645
641
|
footer: o,
|
|
646
|
-
borderMode:
|
|
642
|
+
borderMode: d = "light",
|
|
647
643
|
kind: c = k,
|
|
648
|
-
className:
|
|
644
|
+
className: l
|
|
649
645
|
}) => {
|
|
650
|
-
const
|
|
651
|
-
return W(() => (e && (
|
|
652
|
-
e && (document.title =
|
|
646
|
+
const h = D(""), g = ye({ className: l, kind: c, borderMode: d });
|
|
647
|
+
return W(() => (e && (h.current = document.title, document.title = `${r} | ${h.current}`), () => {
|
|
648
|
+
e && (document.title = h.current);
|
|
653
649
|
}), [r, e]), /* @__PURE__ */ n($, { children: e && /* @__PURE__ */ n(ue, { open: e, onOpenChange: t, children: /* @__PURE__ */ x(be, { className: g.main, children: [
|
|
654
650
|
/* @__PURE__ */ x("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
|
655
651
|
/* @__PURE__ */ n(
|
|
656
|
-
|
|
652
|
+
pe,
|
|
657
653
|
{
|
|
658
654
|
className: g.close,
|
|
659
655
|
trigger: /* @__PURE__ */ n(
|
|
660
|
-
|
|
656
|
+
A,
|
|
661
657
|
{
|
|
662
658
|
mode: "dark",
|
|
663
659
|
focusMode: "light",
|
|
664
660
|
noBorder: !0,
|
|
665
661
|
label: "Close",
|
|
666
|
-
children: /* @__PURE__ */ n(
|
|
662
|
+
children: /* @__PURE__ */ n(me, {})
|
|
667
663
|
}
|
|
668
664
|
)
|
|
669
665
|
}
|
|
670
666
|
),
|
|
671
667
|
/* @__PURE__ */ n(fe, { className: g.header, children: r })
|
|
672
668
|
] }),
|
|
673
|
-
/* @__PURE__ */ n(
|
|
669
|
+
/* @__PURE__ */ n(ve, { className: g.content, children: a }),
|
|
674
670
|
o && /* @__PURE__ */ n("div", { className: g.footer, children: o })
|
|
675
671
|
] }) }) });
|
|
676
672
|
};
|
|
677
673
|
export {
|
|
678
674
|
C as MESSAGEBOX_CLASSNAME,
|
|
679
|
-
|
|
675
|
+
P as PANEL_CLASSNAME,
|
|
680
676
|
Ne as Panel
|
|
681
677
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-panel",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@tailwindcss/typography": "0.5.15",
|
|
42
|
-
"@versini/ui-button": "4.0.
|
|
43
|
-
"@versini/ui-icons": "4.
|
|
42
|
+
"@versini/ui-button": "4.0.2",
|
|
43
|
+
"@versini/ui-icons": "4.1.0",
|
|
44
44
|
"@versini/ui-modal": "1.2.0",
|
|
45
45
|
"clsx": "2.1.1",
|
|
46
46
|
"tailwindcss": "3.4.17"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sideEffects": [
|
|
49
49
|
"**/*.css"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "bf6b0d285a70c47a5efc225f32756b95cb963a49"
|
|
52
52
|
}
|