@versini/ui-panel 1.0.8 → 1.0.10
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
1
|
import { jsx as i, jsxs as D, Fragment as M } 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
|
|
6
|
-
const
|
|
4
|
+
import { useRef as A, useReducer as N, useEffect as _, useId as w } from "react";
|
|
5
|
+
import { useFloating as x, useClick as $, useDismiss as S, useRole as O, useInteractions as F, useMergeRefs as P, FloatingPortal as k, FloatingOverlay as L, FloatingFocusManager as U } from "@floating-ui/react";
|
|
6
|
+
const I = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", V = {
|
|
7
7
|
alert: null,
|
|
8
8
|
alertdialog: null,
|
|
9
9
|
log: "polite",
|
|
@@ -11,9 +11,9 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
|
|
|
11
11
|
progressbar: null,
|
|
12
12
|
status: "polite",
|
|
13
13
|
timer: "assertive"
|
|
14
|
-
},
|
|
14
|
+
}, j = (e, n) => {
|
|
15
15
|
switch (n == null ? void 0 : n.type) {
|
|
16
|
-
case
|
|
16
|
+
case I:
|
|
17
17
|
return {
|
|
18
18
|
...e,
|
|
19
19
|
announcement: n.payload
|
|
@@ -26,7 +26,7 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
|
|
|
26
26
|
default:
|
|
27
27
|
return e;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, B = ({
|
|
30
30
|
onAnnouncementClear: e,
|
|
31
31
|
dispatch: n
|
|
32
32
|
}) => {
|
|
@@ -41,16 +41,16 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
|
|
|
41
41
|
dispatch: l
|
|
42
42
|
}) => {
|
|
43
43
|
(o == null ? void 0 : o.current) !== null && clearTimeout(o.current), e !== null && l({
|
|
44
|
-
type:
|
|
44
|
+
type: I,
|
|
45
45
|
payload: e
|
|
46
46
|
}), n && (o.current = setTimeout(
|
|
47
|
-
() =>
|
|
47
|
+
() => B({
|
|
48
48
|
onAnnouncementClear: t,
|
|
49
49
|
dispatch: l
|
|
50
50
|
}),
|
|
51
51
|
n
|
|
52
52
|
));
|
|
53
|
-
},
|
|
53
|
+
}, q = ({
|
|
54
54
|
children: e,
|
|
55
55
|
announcementTimeoutRef: n,
|
|
56
56
|
announcementDelay: o,
|
|
@@ -73,7 +73,7 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
|
|
|
73
73
|
dispatch: a
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
function
|
|
76
|
+
function W({
|
|
77
77
|
children: e,
|
|
78
78
|
className: n,
|
|
79
79
|
politeness: o,
|
|
@@ -82,21 +82,21 @@ function X({
|
|
|
82
82
|
clearAnnouncementDelay: r,
|
|
83
83
|
onAnnouncementClear: a,
|
|
84
84
|
visible: s,
|
|
85
|
-
...
|
|
85
|
+
...p
|
|
86
86
|
}) {
|
|
87
|
-
const u =
|
|
87
|
+
const u = A(), d = A(), [m, f] = N(j, {
|
|
88
88
|
announcement: null
|
|
89
89
|
});
|
|
90
90
|
let h = o;
|
|
91
|
-
typeof h > "u" && (h = t ?
|
|
92
|
-
|
|
91
|
+
typeof h > "u" && (h = t ? V[t] : "assertive"), _(() => {
|
|
92
|
+
q({
|
|
93
93
|
announcementTimeoutRef: u,
|
|
94
94
|
announcementDelay: l,
|
|
95
95
|
children: e,
|
|
96
96
|
clearAnnouncementDelay: r,
|
|
97
97
|
clearAnnouncementTimeoutRef: d,
|
|
98
98
|
onAnnouncementClear: a,
|
|
99
|
-
dispatch:
|
|
99
|
+
dispatch: f
|
|
100
100
|
});
|
|
101
101
|
}, [
|
|
102
102
|
e,
|
|
@@ -113,38 +113,38 @@ function X({
|
|
|
113
113
|
"aria-live": h,
|
|
114
114
|
...t && { role: t },
|
|
115
115
|
className: g,
|
|
116
|
-
...
|
|
116
|
+
...p,
|
|
117
117
|
children: m.announcement
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
const E = c.createContext(null);
|
|
122
|
-
function
|
|
122
|
+
function H({
|
|
123
123
|
initialOpen: e = !1,
|
|
124
124
|
open: n,
|
|
125
125
|
onOpenChange: o
|
|
126
126
|
} = {}) {
|
|
127
|
-
const [t, l] = c.useState(e), [r, a] = c.useState(), [s,
|
|
127
|
+
const [t, l] = c.useState(e), [r, a] = c.useState(), [s, p] = c.useState(), u = n ?? t, d = o ?? l, m = x({
|
|
128
128
|
open: u,
|
|
129
129
|
onOpenChange: d
|
|
130
|
-
}),
|
|
130
|
+
}), f = m.context, h = $(f, {
|
|
131
131
|
enabled: n == null
|
|
132
|
-
}), g =
|
|
132
|
+
}), g = S(f, {
|
|
133
133
|
outsidePress: !1,
|
|
134
134
|
outsidePressEvent: "mousedown"
|
|
135
|
-
}), T =
|
|
135
|
+
}), T = O(f), b = F([h, g, T]);
|
|
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
|
-
setDescriptionId:
|
|
145
|
+
setDescriptionId: p
|
|
146
146
|
}),
|
|
147
|
-
[u, d,
|
|
147
|
+
[u, d, b, m, r, s]
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
const v = () => {
|
|
@@ -153,25 +153,22 @@ const v = () => {
|
|
|
153
153
|
throw new Error("Modal components must be wrapped in <Modal />");
|
|
154
154
|
return e;
|
|
155
155
|
};
|
|
156
|
-
function
|
|
157
|
-
return x();
|
|
158
|
-
}
|
|
159
|
-
function Y({
|
|
156
|
+
function X({
|
|
160
157
|
children: e,
|
|
161
158
|
...n
|
|
162
159
|
}) {
|
|
163
|
-
const o =
|
|
160
|
+
const o = H(n);
|
|
164
161
|
return /* @__PURE__ */ i(E.Provider, { value: o, children: e });
|
|
165
162
|
}
|
|
166
|
-
const
|
|
167
|
-
const { context: o, ...t } = v(), l =
|
|
163
|
+
const Y = c.forwardRef(function(e, n) {
|
|
164
|
+
const { context: o, ...t } = v(), l = P([t.refs.setFloating, n]);
|
|
168
165
|
if (!o.open)
|
|
169
166
|
return null;
|
|
170
167
|
const { overlayBackground: r, ...a } = e, s = y("grid place-items-center", {
|
|
171
168
|
[`${r}`]: r,
|
|
172
169
|
"bg-black sm:bg-black/[.8]": !r
|
|
173
170
|
});
|
|
174
|
-
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(
|
|
175
172
|
"div",
|
|
176
173
|
{
|
|
177
174
|
ref: l,
|
|
@@ -181,20 +178,20 @@ const Z = c.forwardRef(function(e, n) {
|
|
|
181
178
|
children: a.children
|
|
182
179
|
}
|
|
183
180
|
) }) }) });
|
|
184
|
-
}),
|
|
185
|
-
const { setLabelId: t } = v(), l =
|
|
181
|
+
}), Z = c.forwardRef(function({ children: e, ...n }, o) {
|
|
182
|
+
const { setLabelId: t } = v(), l = w();
|
|
186
183
|
return c.useLayoutEffect(() => (t(l), () => t(void 0)), [l, t]), /* @__PURE__ */ i("h1", { ...n, ref: o, id: l, children: e });
|
|
187
|
-
}),
|
|
188
|
-
const { setDescriptionId: t } = v(), l =
|
|
184
|
+
}), ee = c.forwardRef(function({ children: e, ...n }, o) {
|
|
185
|
+
const { setDescriptionId: t } = v(), l = w();
|
|
189
186
|
return c.useLayoutEffect(() => (t(l), () => t(void 0)), [l, t]), /* @__PURE__ */ i("div", { ...n, ref: o, id: l, children: e });
|
|
190
|
-
}),
|
|
187
|
+
}), ne = c.forwardRef(function(e, n) {
|
|
191
188
|
const { setOpen: o } = v(), { trigger: t, className: l, ...r } = e, a = c.useCallback(() => o(!1), [o]);
|
|
192
189
|
return /* @__PURE__ */ i("div", { className: l, children: c.cloneElement(t, {
|
|
193
190
|
ref: n,
|
|
194
191
|
onClick: a,
|
|
195
192
|
...r
|
|
196
193
|
}) });
|
|
197
|
-
}),
|
|
194
|
+
}), z = (e) => {
|
|
198
195
|
let n = "";
|
|
199
196
|
if (typeof e == "number" || typeof e == "string")
|
|
200
197
|
n = "m-" + e;
|
|
@@ -203,7 +200,7 @@ const Z = c.forwardRef(function(e, n) {
|
|
|
203
200
|
(e == null ? void 0 : e.t) !== void 0 && o.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && o.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && o.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && o.push(`ml-${e.l}`), n = o.join(" ");
|
|
204
201
|
}
|
|
205
202
|
return n;
|
|
206
|
-
},
|
|
203
|
+
}, oe = ({
|
|
207
204
|
children: e,
|
|
208
205
|
fill: n,
|
|
209
206
|
viewBox: o,
|
|
@@ -212,10 +209,10 @@ const Z = c.forwardRef(function(e, n) {
|
|
|
212
209
|
defaultClassName: r,
|
|
213
210
|
spacing: a,
|
|
214
211
|
title: s,
|
|
215
|
-
semantic:
|
|
212
|
+
semantic: p = !1,
|
|
216
213
|
...u
|
|
217
214
|
}) => {
|
|
218
|
-
const d =
|
|
215
|
+
const d = z(a), m = y(
|
|
219
216
|
d,
|
|
220
217
|
t || r
|
|
221
218
|
);
|
|
@@ -228,34 +225,34 @@ const Z = c.forwardRef(function(e, n) {
|
|
|
228
225
|
viewBox: o || l,
|
|
229
226
|
fill: n || "currentColor",
|
|
230
227
|
role: "img",
|
|
231
|
-
"aria-hidden": !
|
|
228
|
+
"aria-hidden": !p,
|
|
232
229
|
focusable: !1,
|
|
233
230
|
...u,
|
|
234
231
|
children: e
|
|
235
232
|
}
|
|
236
233
|
),
|
|
237
|
-
s &&
|
|
234
|
+
s && p && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
|
|
238
235
|
] });
|
|
239
236
|
};
|
|
240
237
|
/*!
|
|
241
|
-
@versini/ui-private v1.4.
|
|
238
|
+
@versini/ui-private v1.4.17
|
|
242
239
|
© 2024 gizmette.com
|
|
243
240
|
*/
|
|
244
241
|
try {
|
|
245
242
|
window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
|
|
246
|
-
version: "1.4.
|
|
247
|
-
buildTime: "09/
|
|
243
|
+
version: "1.4.17",
|
|
244
|
+
buildTime: "09/28/2024 06:29 PM EDT",
|
|
248
245
|
homepage: "https://github.com/aversini/ui-components",
|
|
249
246
|
license: "MIT"
|
|
250
247
|
});
|
|
251
248
|
} catch {
|
|
252
249
|
}
|
|
253
250
|
export {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
251
|
+
W as LiveRegion,
|
|
252
|
+
X as Modal,
|
|
253
|
+
ne as ModalClose,
|
|
254
|
+
Y as ModalContent,
|
|
255
|
+
ee as ModalDescription,
|
|
256
|
+
Z as ModalHeading,
|
|
257
|
+
oe as SvgIcon
|
|
261
258
|
};
|
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.10
|
|
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: "09/
|
|
10
|
+
version: "1.0.10",
|
|
11
|
+
buildTime: "09/28/2024 06:29 PM EDT",
|
|
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.10
|
|
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: "09/
|
|
296
|
+
version: "1.1.10",
|
|
297
|
+
buildTime: "09/28/2024 06:29 PM EDT",
|
|
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.17
|
|
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: "09/
|
|
430
|
+
version: "1.4.17",
|
|
431
|
+
buildTime: "09/28/2024 06:29 PM EDT",
|
|
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.13.
|
|
458
|
+
@versini/ui-icons v1.13.1
|
|
459
459
|
© 2024 gizmette.com
|
|
460
460
|
*/
|
|
461
461
|
try {
|
|
462
462
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
463
|
-
version: "1.13.
|
|
464
|
-
buildTime: "09/
|
|
463
|
+
version: "1.13.1",
|
|
464
|
+
buildTime: "09/28/2024 06:29 PM EDT",
|
|
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.BV7w1tBT.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.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,19 +37,16 @@
|
|
|
37
37
|
"react": "^18.3.1",
|
|
38
38
|
"react-dom": "^18.3.1"
|
|
39
39
|
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@versini/ui-styles": "1.10.2"
|
|
42
|
-
},
|
|
43
40
|
"dependencies": {
|
|
44
41
|
"@tailwindcss/typography": "0.5.15",
|
|
45
|
-
"@versini/ui-button": "1.1.
|
|
46
|
-
"@versini/ui-icons": "1.13.
|
|
47
|
-
"@versini/ui-private": "1.4.
|
|
42
|
+
"@versini/ui-button": "1.1.10",
|
|
43
|
+
"@versini/ui-icons": "1.13.1",
|
|
44
|
+
"@versini/ui-private": "1.4.17",
|
|
48
45
|
"clsx": "2.1.1",
|
|
49
46
|
"tailwindcss": "3.4.13"
|
|
50
47
|
},
|
|
51
48
|
"sideEffects": [
|
|
52
49
|
"**/*.css"
|
|
53
50
|
],
|
|
54
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "b417963dbfdb84030181bf0aba5b25bba66b21c1"
|
|
55
52
|
}
|