@versini/ui-panel 1.0.15 → 1.0.16
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
1
|
+
import { jsx as i, jsxs as T, Fragment as D } from "react/jsx-runtime";
|
|
2
2
|
import y from "clsx";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useFloating as x, useClick as S, useDismiss as $, useRole as
|
|
6
|
-
const
|
|
4
|
+
import { useRef as A, useReducer as M, useEffect as _, useId as R } from "react";
|
|
5
|
+
import { useFloating as x, useClick as S, useDismiss as $, useRole as F, useInteractions as O, useMergeRefs as P, FloatingPortal as k, FloatingOverlay as L, FloatingFocusManager as U } from "@floating-ui/react";
|
|
6
|
+
const w = "SET_ANNOUNCEMENT", I = "CLEAR_ANNOUNCEMENT", V = {
|
|
7
7
|
alert: null,
|
|
8
8
|
alertdialog: null,
|
|
9
9
|
log: "polite",
|
|
@@ -11,14 +11,14 @@ const I = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", V = {
|
|
|
11
11
|
progressbar: null,
|
|
12
12
|
status: "polite",
|
|
13
13
|
timer: "assertive"
|
|
14
|
-
},
|
|
14
|
+
}, B = (e, n) => {
|
|
15
15
|
switch (n == null ? void 0 : n.type) {
|
|
16
|
-
case
|
|
16
|
+
case w:
|
|
17
17
|
return {
|
|
18
18
|
...e,
|
|
19
19
|
announcement: n.payload
|
|
20
20
|
};
|
|
21
|
-
case
|
|
21
|
+
case I:
|
|
22
22
|
return {
|
|
23
23
|
...e,
|
|
24
24
|
announcement: null
|
|
@@ -26,27 +26,27 @@ const I = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", V = {
|
|
|
26
26
|
default:
|
|
27
27
|
return e;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, j = ({
|
|
30
30
|
onAnnouncementClear: e,
|
|
31
31
|
dispatch: n
|
|
32
32
|
}) => {
|
|
33
33
|
n({
|
|
34
|
-
type:
|
|
34
|
+
type: I
|
|
35
35
|
}), typeof e == "function" && e();
|
|
36
36
|
}, C = ({
|
|
37
37
|
children: e,
|
|
38
38
|
clearAnnouncementDelay: n,
|
|
39
39
|
clearAnnouncementTimeoutRef: o,
|
|
40
|
-
onAnnouncementClear:
|
|
41
|
-
dispatch:
|
|
40
|
+
onAnnouncementClear: l,
|
|
41
|
+
dispatch: t
|
|
42
42
|
}) => {
|
|
43
|
-
|
|
44
|
-
type:
|
|
43
|
+
clearTimeout(o.current), e !== null && t({
|
|
44
|
+
type: w,
|
|
45
45
|
payload: e
|
|
46
46
|
}), n && (o.current = setTimeout(
|
|
47
|
-
() =>
|
|
48
|
-
onAnnouncementClear:
|
|
49
|
-
dispatch:
|
|
47
|
+
() => j({
|
|
48
|
+
onAnnouncementClear: l,
|
|
49
|
+
dispatch: t
|
|
50
50
|
}),
|
|
51
51
|
n
|
|
52
52
|
));
|
|
@@ -54,21 +54,21 @@ const I = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", V = {
|
|
|
54
54
|
children: e,
|
|
55
55
|
announcementTimeoutRef: n,
|
|
56
56
|
announcementDelay: o,
|
|
57
|
-
clearAnnouncementDelay:
|
|
58
|
-
clearAnnouncementTimeoutRef:
|
|
57
|
+
clearAnnouncementDelay: l,
|
|
58
|
+
clearAnnouncementTimeoutRef: t,
|
|
59
59
|
onAnnouncementClear: r,
|
|
60
60
|
dispatch: a
|
|
61
61
|
}) => {
|
|
62
62
|
clearTimeout(n.current), o ? n.current = setTimeout(C, o, {
|
|
63
63
|
children: e,
|
|
64
|
-
clearAnnouncementDelay:
|
|
65
|
-
clearAnnouncementTimeoutRef:
|
|
64
|
+
clearAnnouncementDelay: l,
|
|
65
|
+
clearAnnouncementTimeoutRef: t,
|
|
66
66
|
onAnnouncementClear: r,
|
|
67
67
|
dispatch: a
|
|
68
68
|
}) : C({
|
|
69
69
|
children: e,
|
|
70
|
-
clearAnnouncementDelay:
|
|
71
|
-
clearAnnouncementTimeoutRef:
|
|
70
|
+
clearAnnouncementDelay: l,
|
|
71
|
+
clearAnnouncementTimeoutRef: t,
|
|
72
72
|
onAnnouncementClear: r,
|
|
73
73
|
dispatch: a
|
|
74
74
|
});
|
|
@@ -77,21 +77,21 @@ function W({
|
|
|
77
77
|
children: e,
|
|
78
78
|
className: n,
|
|
79
79
|
politeness: o,
|
|
80
|
-
role:
|
|
81
|
-
announcementDelay:
|
|
80
|
+
role: l = null,
|
|
81
|
+
announcementDelay: t,
|
|
82
82
|
clearAnnouncementDelay: r,
|
|
83
83
|
onAnnouncementClear: a,
|
|
84
84
|
visible: s,
|
|
85
85
|
...p
|
|
86
86
|
}) {
|
|
87
|
-
const u =
|
|
87
|
+
const u = A(null), d = A(null), [m, f] = M(B, {
|
|
88
88
|
announcement: null
|
|
89
89
|
});
|
|
90
90
|
let h = o;
|
|
91
|
-
typeof h > "u" && (h =
|
|
91
|
+
typeof h > "u" && (h = l ? V[l] : "assertive"), _(() => {
|
|
92
92
|
q({
|
|
93
93
|
announcementTimeoutRef: u,
|
|
94
|
-
announcementDelay:
|
|
94
|
+
announcementDelay: t,
|
|
95
95
|
children: e,
|
|
96
96
|
clearAnnouncementDelay: r,
|
|
97
97
|
clearAnnouncementTimeoutRef: d,
|
|
@@ -100,7 +100,7 @@ function W({
|
|
|
100
100
|
});
|
|
101
101
|
}, [
|
|
102
102
|
e,
|
|
103
|
-
|
|
103
|
+
t,
|
|
104
104
|
r,
|
|
105
105
|
a
|
|
106
106
|
]);
|
|
@@ -111,7 +111,7 @@ function W({
|
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
113
|
"aria-live": h,
|
|
114
|
-
...
|
|
114
|
+
...l && { role: l },
|
|
115
115
|
className: g,
|
|
116
116
|
...p,
|
|
117
117
|
children: m.announcement
|
|
@@ -124,7 +124,7 @@ function H({
|
|
|
124
124
|
open: n,
|
|
125
125
|
onOpenChange: o
|
|
126
126
|
} = {}) {
|
|
127
|
-
const [
|
|
127
|
+
const [l, t] = c.useState(e), [r, a] = c.useState(), [s, p] = c.useState(), u = n ?? l, d = o ?? t, m = x({
|
|
128
128
|
open: u,
|
|
129
129
|
onOpenChange: d
|
|
130
130
|
}), f = m.context, h = S(f, {
|
|
@@ -132,19 +132,19 @@ function H({
|
|
|
132
132
|
}), g = $(f, {
|
|
133
133
|
outsidePress: !1,
|
|
134
134
|
outsidePressEvent: "mousedown"
|
|
135
|
-
}),
|
|
135
|
+
}), N = F(f), b = O([h, g, N]);
|
|
136
136
|
return c.useMemo(
|
|
137
137
|
() => ({
|
|
138
138
|
open: u,
|
|
139
139
|
setOpen: d,
|
|
140
|
-
...
|
|
140
|
+
...b,
|
|
141
141
|
...m,
|
|
142
142
|
labelId: r,
|
|
143
143
|
descriptionId: s,
|
|
144
144
|
setLabelId: a,
|
|
145
145
|
setDescriptionId: p
|
|
146
146
|
}),
|
|
147
|
-
[u, d,
|
|
147
|
+
[u, d, b, m, r, s]
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
const v = () => {
|
|
@@ -161,32 +161,32 @@ function X({
|
|
|
161
161
|
return /* @__PURE__ */ i(E.Provider, { value: o, children: e });
|
|
162
162
|
}
|
|
163
163
|
const Y = c.forwardRef(function(e, n) {
|
|
164
|
-
const { context: o, ...
|
|
164
|
+
const { context: o, ...l } = v(), t = P([l.refs.setFloating, n]);
|
|
165
165
|
if (!o.open)
|
|
166
166
|
return null;
|
|
167
167
|
const { overlayBackground: r, ...a } = e, s = y("grid place-items-center", {
|
|
168
168
|
[`${r}`]: r,
|
|
169
169
|
"bg-black sm:bg-black/[.8]": !r
|
|
170
170
|
});
|
|
171
|
-
return /* @__PURE__ */ i(
|
|
171
|
+
return /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(L, { className: s, lockScroll: !0, children: /* @__PURE__ */ i(U, { context: o, children: /* @__PURE__ */ i(
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
|
-
ref:
|
|
175
|
-
"aria-labelledby":
|
|
176
|
-
"aria-describedby":
|
|
177
|
-
...
|
|
174
|
+
ref: t,
|
|
175
|
+
"aria-labelledby": l.labelId,
|
|
176
|
+
"aria-describedby": l.descriptionId,
|
|
177
|
+
...l.getFloatingProps(a),
|
|
178
178
|
children: a.children
|
|
179
179
|
}
|
|
180
180
|
) }) }) });
|
|
181
181
|
}), Z = c.forwardRef(function({ children: e, ...n }, o) {
|
|
182
|
-
const { setLabelId:
|
|
183
|
-
return c.useLayoutEffect(() => (t
|
|
182
|
+
const { setLabelId: l } = v(), t = R();
|
|
183
|
+
return c.useLayoutEffect(() => (l(t), () => l(void 0)), [t, l]), /* @__PURE__ */ i("h1", { ...n, ref: o, id: t, children: e });
|
|
184
184
|
}), ee = c.forwardRef(function({ children: e, ...n }, o) {
|
|
185
|
-
const { setDescriptionId:
|
|
186
|
-
return c.useLayoutEffect(() => (t
|
|
185
|
+
const { setDescriptionId: l } = v(), t = R();
|
|
186
|
+
return c.useLayoutEffect(() => (l(t), () => l(void 0)), [t, l]), /* @__PURE__ */ i("div", { ...n, ref: o, id: t, children: e });
|
|
187
187
|
}), ne = c.forwardRef(function(e, n) {
|
|
188
|
-
const { setOpen: o } = v(), { trigger:
|
|
189
|
-
return /* @__PURE__ */ i("div", { className:
|
|
188
|
+
const { setOpen: o } = v(), { trigger: l, className: t, ...r } = e, a = c.useCallback(() => o(!1), [o]);
|
|
189
|
+
return /* @__PURE__ */ i("div", { className: t, children: c.cloneElement(l, {
|
|
190
190
|
ref: n,
|
|
191
191
|
onClick: a,
|
|
192
192
|
...r
|
|
@@ -204,8 +204,8 @@ const Y = c.forwardRef(function(e, n) {
|
|
|
204
204
|
children: e,
|
|
205
205
|
fill: n,
|
|
206
206
|
viewBox: o,
|
|
207
|
-
className:
|
|
208
|
-
defaultViewBox:
|
|
207
|
+
className: l,
|
|
208
|
+
defaultViewBox: t,
|
|
209
209
|
defaultClassName: r,
|
|
210
210
|
spacing: a,
|
|
211
211
|
title: s,
|
|
@@ -214,15 +214,15 @@ const Y = c.forwardRef(function(e, n) {
|
|
|
214
214
|
}) => {
|
|
215
215
|
const d = z(a), m = y(
|
|
216
216
|
d,
|
|
217
|
-
|
|
217
|
+
l || r
|
|
218
218
|
);
|
|
219
|
-
return /* @__PURE__ */
|
|
219
|
+
return /* @__PURE__ */ T(D, { children: [
|
|
220
220
|
/* @__PURE__ */ i(
|
|
221
221
|
"svg",
|
|
222
222
|
{
|
|
223
223
|
xmlns: "http://www.w3.org/2000/svg",
|
|
224
224
|
className: m,
|
|
225
|
-
viewBox: o ||
|
|
225
|
+
viewBox: o || t,
|
|
226
226
|
fill: n || "currentColor",
|
|
227
227
|
role: "img",
|
|
228
228
|
"aria-hidden": !p,
|
|
@@ -235,13 +235,13 @@ const Y = c.forwardRef(function(e, n) {
|
|
|
235
235
|
] });
|
|
236
236
|
};
|
|
237
237
|
/*!
|
|
238
|
-
@versini/ui-private v1.4.
|
|
238
|
+
@versini/ui-private v1.4.19
|
|
239
239
|
© 2024 gizmette.com
|
|
240
240
|
*/
|
|
241
241
|
try {
|
|
242
242
|
window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
|
|
243
|
-
version: "1.4.
|
|
244
|
-
buildTime: "
|
|
243
|
+
version: "1.4.19",
|
|
244
|
+
buildTime: "12/12/2024 05:56 PM EST",
|
|
245
245
|
homepage: "https://github.com/aversini/ui-components",
|
|
246
246
|
license: "MIT"
|
|
247
247
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as l, jsxs as y, Fragment as
|
|
1
|
+
import { jsx as l, jsxs as y, Fragment as V } from "react/jsx-runtime";
|
|
2
2
|
import o from "clsx";
|
|
3
|
-
import E, { lazy as
|
|
3
|
+
import E, { lazy as z, useRef as U, useEffect as j, Suspense as O } from "react";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/ui-panel v1.0.
|
|
5
|
+
@versini/ui-panel v1.0.16
|
|
6
6
|
© 2024 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
|
|
10
|
-
version: "1.0.
|
|
11
|
-
buildTime: "
|
|
10
|
+
version: "1.0.16",
|
|
11
|
+
buildTime: "12/12/2024 05:56 PM EST",
|
|
12
12
|
homepage: "https://github.com/aversini/ui-components",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
|
@@ -288,13 +288,13 @@ const $ = E.forwardRef(
|
|
|
288
288
|
);
|
|
289
289
|
$.displayName = "ButtonIcon";
|
|
290
290
|
/*!
|
|
291
|
-
@versini/ui-button v1.1.
|
|
291
|
+
@versini/ui-button v1.1.12
|
|
292
292
|
© 2024 gizmette.com
|
|
293
293
|
*/
|
|
294
294
|
try {
|
|
295
295
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
296
|
-
version: "1.1.
|
|
297
|
-
buildTime: "
|
|
296
|
+
version: "1.1.12",
|
|
297
|
+
buildTime: "12/12/2024 05:56 PM EST",
|
|
298
298
|
homepage: "https://github.com/aversini/ui-components",
|
|
299
299
|
license: "MIT"
|
|
300
300
|
});
|
|
@@ -337,12 +337,12 @@ const Q = E.forwardRef(
|
|
|
337
337
|
spacing: f,
|
|
338
338
|
noBackground: v,
|
|
339
339
|
align: _
|
|
340
|
-
}),
|
|
340
|
+
}), P = o({
|
|
341
341
|
"text-copy-accent-dark": r === "light" && !i,
|
|
342
342
|
"text-copy-light": r === "dark" && !i,
|
|
343
343
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
344
344
|
"text-copy-light dark:text-copy-accent-dark": r === "system" && !i
|
|
345
|
-
}),
|
|
345
|
+
}), A = w ? o(
|
|
346
346
|
"relative",
|
|
347
347
|
"focus-within:static",
|
|
348
348
|
"focus-within:after:border-transparent",
|
|
@@ -359,7 +359,7 @@ const Q = E.forwardRef(
|
|
|
359
359
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
360
360
|
}
|
|
361
361
|
) : "";
|
|
362
|
-
return /* @__PURE__ */ l("div", { className:
|
|
362
|
+
return /* @__PURE__ */ l("div", { className: A, children: /* @__PURE__ */ y(
|
|
363
363
|
M,
|
|
364
364
|
{
|
|
365
365
|
ref: I,
|
|
@@ -370,7 +370,7 @@ const Q = E.forwardRef(
|
|
|
370
370
|
...N,
|
|
371
371
|
children: [
|
|
372
372
|
c && /* @__PURE__ */ l("span", { className: "pr-2", children: c }),
|
|
373
|
-
/* @__PURE__ */ l("div", { className:
|
|
373
|
+
/* @__PURE__ */ l("div", { className: P, children: e }),
|
|
374
374
|
m && /* @__PURE__ */ l("span", { className: "pl-2", children: m })
|
|
375
375
|
]
|
|
376
376
|
}
|
|
@@ -403,7 +403,7 @@ const Z = (e) => {
|
|
|
403
403
|
u,
|
|
404
404
|
a || d
|
|
405
405
|
);
|
|
406
|
-
return /* @__PURE__ */ y(
|
|
406
|
+
return /* @__PURE__ */ y(V, { children: [
|
|
407
407
|
/* @__PURE__ */ l(
|
|
408
408
|
"svg",
|
|
409
409
|
{
|
|
@@ -422,13 +422,13 @@ const Z = (e) => {
|
|
|
422
422
|
] });
|
|
423
423
|
};
|
|
424
424
|
/*!
|
|
425
|
-
@versini/ui-private v1.4.
|
|
425
|
+
@versini/ui-private v1.4.19
|
|
426
426
|
© 2024 gizmette.com
|
|
427
427
|
*/
|
|
428
428
|
try {
|
|
429
429
|
window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
|
|
430
|
-
version: "1.4.
|
|
431
|
-
buildTime: "
|
|
430
|
+
version: "1.4.19",
|
|
431
|
+
buildTime: "12/12/2024 05:56 PM EST",
|
|
432
432
|
homepage: "https://github.com/aversini/ui-components",
|
|
433
433
|
license: "MIT"
|
|
434
434
|
});
|
|
@@ -455,13 +455,13 @@ const re = ({
|
|
|
455
455
|
}
|
|
456
456
|
);
|
|
457
457
|
/*!
|
|
458
|
-
@versini/ui-icons v1.15.
|
|
458
|
+
@versini/ui-icons v1.15.3
|
|
459
459
|
© 2024 gizmette.com
|
|
460
460
|
*/
|
|
461
461
|
try {
|
|
462
462
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
463
|
-
version: "1.15.
|
|
464
|
-
buildTime: "
|
|
463
|
+
version: "1.15.3",
|
|
464
|
+
buildTime: "12/12/2024 05:56 PM EST",
|
|
465
465
|
homepage: "https://github.com/aversini/ui-components",
|
|
466
466
|
license: "MIT"
|
|
467
467
|
});
|
|
@@ -487,8 +487,8 @@ const p = "panel", x = "messagebox", te = ({
|
|
|
487
487
|
footer: "flex flex-grow flex-col sm:p-4 p-2",
|
|
488
488
|
header: "sm:p-4 mb-0 p-2",
|
|
489
489
|
close: "sm:p-4 p-2"
|
|
490
|
-
}), k = (e) =>
|
|
491
|
-
() => import("./chunks/index.
|
|
490
|
+
}), k = (e) => z(
|
|
491
|
+
() => import("./chunks/index.DfFZfYdy.js").then((t) => ({
|
|
492
492
|
default: t[e]
|
|
493
493
|
}))
|
|
494
494
|
), ae = k("Modal"), oe = k("ModalClose"), ie = k("ModalContent"), le = k("ModalDescription"), de = k("ModalHeading"), ge = ({
|
|
@@ -501,7 +501,7 @@ const p = "panel", x = "messagebox", te = ({
|
|
|
501
501
|
kind: g = p,
|
|
502
502
|
className: i
|
|
503
503
|
}) => {
|
|
504
|
-
const h =
|
|
504
|
+
const h = U(""), s = te({ className: i, kind: g, borderMode: d });
|
|
505
505
|
return j(() => (e && (h.current = document.title, document.title = `${r} | ${h.current}`), () => {
|
|
506
506
|
e && (document.title = h.current);
|
|
507
507
|
}), [r, e]), /* @__PURE__ */ l(O, { fallback: /* @__PURE__ */ l("div", {}), children: e && /* @__PURE__ */ l(ae, { open: e, onOpenChange: t, children: /* @__PURE__ */ y(ie, { className: s.main, children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-panel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@tailwindcss/typography": "0.5.15",
|
|
42
|
-
"@versini/ui-button": "1.1.
|
|
43
|
-
"@versini/ui-icons": "1.15.
|
|
44
|
-
"@versini/ui-private": "1.4.
|
|
42
|
+
"@versini/ui-button": "1.1.12",
|
|
43
|
+
"@versini/ui-icons": "1.15.3",
|
|
44
|
+
"@versini/ui-private": "1.4.19",
|
|
45
45
|
"clsx": "2.1.1",
|
|
46
46
|
"tailwindcss": "3.4.15"
|
|
47
47
|
},
|
|
48
48
|
"sideEffects": [
|
|
49
49
|
"**/*.css"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "678eb92e8c1d2db9cd7d01616750305b5a7588df"
|
|
52
52
|
}
|