@versini/ui-panel 1.3.17 → 1.3.18

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.
Files changed (2) hide show
  1. package/dist/index.js +266 -263
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,42 +1,42 @@
1
- import { jsx as c, jsxs as S, Fragment as W } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import P, { useRef as w, useLayoutEffect as F, useMemo as X, useState as ne, useEffect as A, useCallback as ie, useId as q } from "react";
4
- import i from "clsx";
5
- import { useFloating as oe, useClick as se, useDismiss as ce, useRole as le, useInteractions as de, useMergeRefs as ue, FloatingPortal as ge, FloatingOverlay as me, FloatingFocusManager as he } from "@floating-ui/react";
1
+ import { jsx as c, jsxs as M, Fragment as q } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import z, { useRef as I, useLayoutEffect as O, useMemo as H, useState as le, useEffect as V, useCallback as ce, useId as Z } from "react";
4
+ import n from "clsx";
5
+ import { useFloating as se, useClick as de, useDismiss as ue, useRole as me, useInteractions as ge, useMergeRefs as he, FloatingPortal as be, FloatingOverlay as fe, FloatingFocusManager as ve } from "@floating-ui/react";
6
6
  /*!
7
- @versini/ui-panel v1.3.17
7
+ @versini/ui-panel v1.3.18
8
8
  © 2025 gizmette.com
9
9
  */
10
10
  try {
11
11
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
12
- version: "1.3.17",
13
- buildTime: "01/25/2025 10:55 PM EST",
12
+ version: "1.3.18",
13
+ buildTime: "01/26/2025 05:19 PM EST",
14
14
  homepage: "https://github.com/aversini/ui-components",
15
15
  license: "MIT"
16
16
  });
17
17
  } catch {
18
18
  }
19
- const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "button", O = "link", be = ({
19
+ const j = "av-messagebox", D = "av-panel", G = "av-button", L = "icon", J = "button", A = "link", ye = ({
20
20
  type: e,
21
21
  size: t,
22
22
  labelRight: r,
23
23
  labelLeft: a,
24
- align: n
24
+ align: i
25
25
  }) => {
26
- const o = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", l = "max-h-12 py-2 px-4";
26
+ const o = "max-h-8 py-0 px-2", l = "max-h-9 h-8 px-3", s = "max-h-12 py-2 px-4";
27
27
  switch (e) {
28
- case Y:
29
- case O:
30
- return i({
28
+ case J:
29
+ case A:
30
+ return n({
31
31
  [o]: t === "small",
32
- [s]: t === "medium",
33
- [l]: t === "large"
32
+ [l]: t === "medium",
33
+ [s]: t === "large"
34
34
  });
35
- case R:
36
- return i("inline-flex items-center", {
37
- "justify-center": n === "center",
38
- "justify-start": n === "left",
39
- "justify-end": n === "right",
35
+ case L:
36
+ return n("inline-flex items-center", {
37
+ "justify-center": i === "center",
38
+ "justify-start": i === "left",
39
+ "justify-end": i === "right",
40
40
  "h-6 py-0": t === "small" && !(r || a),
41
41
  "h-6": t === "small" && (r || a),
42
42
  "h-8 py-1": t === "medium" && !(r || a),
@@ -45,30 +45,30 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
45
45
  "h-12": t === "large" && (r || a)
46
46
  });
47
47
  }
48
- }, fe = ({
48
+ }, pe = ({
49
49
  type: e,
50
50
  size: t,
51
51
  labelRight: r,
52
52
  labelLeft: a
53
53
  }) => {
54
- const n = "text-sm font-medium", o = "text-base font-medium", s = "text-lg font-medium";
54
+ const i = "text-sm font-medium", o = "text-base font-medium", l = "text-lg font-medium";
55
55
  switch (e) {
56
- case Y:
57
- case O:
58
- return i({
59
- "text-center": e === O,
60
- [n]: t === "small",
56
+ case J:
57
+ case A:
58
+ return n({
59
+ "text-center": e === A,
60
+ [i]: t === "small",
61
61
  [o]: t === "medium",
62
- [s]: t === "large"
62
+ [l]: t === "large"
63
63
  });
64
- case R:
65
- return i({
66
- [n]: t === "small" && (r || a),
64
+ case L:
65
+ return n({
66
+ [i]: t === "small" && (r || a),
67
67
  [o]: t === "medium" && (r || a),
68
- [s]: t === "large" && (r || a)
68
+ [l]: t === "large" && (r || a)
69
69
  });
70
70
  }
71
- }, ve = ({
71
+ }, ke = ({
72
72
  mode: e,
73
73
  noBackground: t,
74
74
  noTruncate: r,
@@ -77,7 +77,7 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
77
77
  if (t)
78
78
  return "not-prose";
79
79
  if (a === "primary")
80
- return i("not-prose", {
80
+ return n("not-prose", {
81
81
  truncate: !r,
82
82
  "text-copy-light": e === "dark" || e === "system",
83
83
  "text-copy-lighter": e === "light" || e === "alt-system",
@@ -85,7 +85,7 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
85
85
  "dark:text-copy-light": e === "alt-system"
86
86
  });
87
87
  if (a === "secondary")
88
- return i("not-prose", {
88
+ return n("not-prose", {
89
89
  truncate: !r,
90
90
  "text-copy-light": e === "light" || e === "system",
91
91
  "text-copy-lighter": e === "dark" || e === "alt-system",
@@ -93,7 +93,7 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
93
93
  "dark:text-copy-light": e === "system"
94
94
  });
95
95
  if (a === "danger")
96
- return i("not-prose", {
96
+ return n("not-prose", {
97
97
  truncate: !r,
98
98
  "text-copy-light": e === "dark" || e === "system",
99
99
  "text-copy-lighter": e === "light" || e === "alt-system",
@@ -101,31 +101,31 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
101
101
  "dark:text-copy-light": e === "alt-system"
102
102
  });
103
103
  if (a === "selected")
104
- return i("not-prose text-copy-lighter", {
104
+ return n("not-prose text-copy-lighter", {
105
105
  truncate: !r
106
106
  });
107
- }, ye = ({
107
+ }, we = ({
108
108
  mode: e,
109
109
  noBackground: t,
110
110
  variant: r
111
111
  }) => {
112
112
  if (!t) {
113
113
  if (r === "primary")
114
- return i({
114
+ return n({
115
115
  "bg-action-dark": e === "dark",
116
116
  "bg-action-light": e === "light",
117
117
  "bg-action-dark dark:bg-action-light": e === "system",
118
118
  "bg-action-light dark:bg-action-dark": e === "alt-system"
119
119
  });
120
120
  if (r === "secondary")
121
- return i({
121
+ return n({
122
122
  "bg-action-dark": e === "light",
123
123
  "bg-action-light": e === "dark",
124
124
  "bg-action-dark dark:bg-action-light": e === "alt-system",
125
125
  "bg-action-light dark:bg-action-dark": e === "system"
126
126
  });
127
127
  if (r === "danger")
128
- return i({
128
+ return n({
129
129
  "bg-action-danger-dark": e === "dark",
130
130
  "bg-action-danger-light": e === "light",
131
131
  "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
@@ -134,13 +134,13 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
134
134
  if (r === "selected")
135
135
  return "bg-action-selected-dark";
136
136
  }
137
- }, pe = ({
137
+ }, xe = ({
138
138
  radius: e
139
- }) => i({
139
+ }) => n({
140
140
  "rounded-full": e === "large",
141
141
  "rounded-md": e === "medium",
142
142
  "rounded-sm": e === "small"
143
- }), ke = ({
143
+ }), _e = ({
144
144
  mode: e,
145
145
  disabled: t,
146
146
  variant: r
@@ -148,21 +148,21 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
148
148
  if (t)
149
149
  return "";
150
150
  if (r === "primary")
151
- return i("hover:text-copy-light-hover", {
151
+ return n("hover:text-copy-light-hover", {
152
152
  "hover:bg-action-dark-hover": e === "dark",
153
153
  "hover:bg-action-light-hover": e === "light",
154
154
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
155
155
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
156
156
  });
157
157
  if (r === "secondary")
158
- return i("hover:text-copy-light-hover", {
158
+ return n("hover:text-copy-light-hover", {
159
159
  "hover:bg-action-dark-hover": e === "light",
160
160
  "hover:bg-action-light-hover": e === "dark",
161
161
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
162
162
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
163
163
  });
164
164
  if (r === "danger")
165
- return i("hover:text-copy-light-hover", {
165
+ return n("hover:text-copy-light-hover", {
166
166
  "hover:bg-action-danger-dark-hover": e === "dark",
167
167
  "hover:bg-action-danger-light-hover": e === "light",
168
168
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
@@ -170,7 +170,7 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
170
170
  });
171
171
  if (r === "selected")
172
172
  return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
173
- }, we = ({
173
+ }, Ne = ({
174
174
  mode: e,
175
175
  disabled: t,
176
176
  variant: r
@@ -178,21 +178,21 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
178
178
  if (t)
179
179
  return "";
180
180
  if (r === "primary")
181
- return i("active:text-copy-light-active", {
181
+ return n("active:text-copy-light-active", {
182
182
  "active:bg-action-dark-active": e === "dark",
183
183
  "active:bg-action-light-active": e === "light",
184
184
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
185
185
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
186
186
  });
187
187
  if (r === "secondary")
188
- return i("active:text-copy-light-active", {
188
+ return n("active:text-copy-light-active", {
189
189
  "active:bg-action-dark-active": e === "light",
190
190
  "active:bg-action-light-active": e === "dark",
191
191
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
192
192
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
193
193
  });
194
194
  if (r === "danger")
195
- return i("active:text-copy-lighter-active", {
195
+ return n("active:text-copy-lighter-active", {
196
196
  "active:bg-action-danger-dark-active": e === "dark",
197
197
  "active:bg-action-danger-light-active": e === "light",
198
198
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
@@ -200,7 +200,7 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
200
200
  });
201
201
  if (r === "selected")
202
202
  return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
203
- }, xe = ({
203
+ }, Ie = ({
204
204
  mode: e,
205
205
  noBorder: t,
206
206
  variant: r
@@ -208,21 +208,21 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
208
208
  if (t)
209
209
  return "border border-transparent";
210
210
  if (r === "primary")
211
- return i("border", {
211
+ return n("border", {
212
212
  "border-border-dark": e === "dark",
213
213
  "border-border-accent": e === "light",
214
214
  "border-border-dark dark:border-border-accent": e === "system",
215
215
  "border-border-accent dark:border-border-dark": e === "alt-system"
216
216
  });
217
217
  if (r === "secondary")
218
- return i("border", {
218
+ return n("border", {
219
219
  "border-border-dark": e === "light",
220
220
  "border-border-accent": e === "dark",
221
221
  "border-border-dark dark:border-border-accent": e === "alt-system",
222
222
  "border-border-accent dark:border-border-dark": e === "system"
223
223
  });
224
224
  if (r === "danger")
225
- return i("border", {
225
+ return n("border", {
226
226
  "border-border-danger-dark": e === "dark",
227
227
  "border-border-danger-medium": e === "light",
228
228
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
@@ -230,18 +230,18 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
230
230
  });
231
231
  if (r === "selected")
232
232
  return "border border-border-selected-dark";
233
- }, _e = ({
233
+ }, Ee = ({
234
234
  focusMode: e
235
- }) => i("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
235
+ }) => n("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
236
236
  "focus:outline-focus-dark": e === "dark",
237
237
  "focus:outline-focus-light": e === "light",
238
238
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
239
239
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
240
- }), Ne = ({
240
+ }), Se = ({
241
241
  mode: e,
242
242
  raw: t,
243
243
  iconClassName: r
244
- }) => t ? "" : i(
244
+ }) => t ? "" : n(
245
245
  {
246
246
  "text-copy-accent-dark": e === "light" || e === "alt-system",
247
247
  "text-copy-light": e === "dark" || e === "system",
@@ -249,90 +249,90 @@ const j = "av-messagebox", D = "av-panel", G = "av-button", R = "icon", Y = "but
249
249
  "dark:text-copy-accent-dark": e === "system"
250
250
  },
251
251
  r
252
- ), Ie = ({
252
+ ), Re = ({
253
253
  animated: e
254
- }) => i({
254
+ }) => n({
255
255
  "transition-opacity duration-300 ease-in": e
256
- }), Ee = ({
256
+ }), Be = ({
257
257
  type: e,
258
258
  className: t,
259
259
  raw: r,
260
260
  mode: a,
261
- focusMode: n,
261
+ focusMode: i,
262
262
  disabled: o,
263
- fullWidth: s,
264
- size: l,
265
- noBorder: u,
266
- labelRight: g,
267
- labelLeft: f,
268
- noBackground: h,
269
- variant: d,
270
- noTruncate: b,
271
- align: x,
272
- radius: _,
273
- animated: y
274
- }) => (d || (d = "primary"), r ? i(G, t) : i(
263
+ fullWidth: l,
264
+ size: s,
265
+ noBorder: d,
266
+ labelRight: m,
267
+ labelLeft: v,
268
+ noBackground: g,
269
+ variant: u,
270
+ noTruncate: f,
271
+ align: E,
272
+ radius: S,
273
+ animated: k
274
+ }) => (u || (u = "primary"), r ? n(G, t) : n(
275
275
  G,
276
- ve({
276
+ ke({
277
277
  mode: a,
278
- variant: d,
279
- noBackground: h,
280
- noTruncate: b
278
+ variant: u,
279
+ noBackground: g,
280
+ noTruncate: f
281
281
  }),
282
- ye({ mode: a, noBackground: h, variant: d }),
283
- pe({ radius: _ }),
284
- be({
282
+ we({ mode: a, noBackground: g, variant: u }),
283
+ xe({ radius: S }),
284
+ ye({
285
285
  type: e,
286
- size: l,
287
- labelRight: g,
288
- labelLeft: f,
289
- align: x
286
+ size: s,
287
+ labelRight: m,
288
+ labelLeft: v,
289
+ align: E
290
290
  }),
291
- fe({ type: e, size: l, labelRight: g, labelLeft: f }),
292
- xe({ mode: a, variant: d, noBorder: u }),
293
- _e({ focusMode: n }),
294
- ke({ mode: a, variant: d, disabled: o }),
295
- we({ mode: a, variant: d, disabled: o }),
291
+ pe({ type: e, size: s, labelRight: m, labelLeft: v }),
292
+ Ie({ mode: a, variant: u, noBorder: d }),
293
+ Ee({ focusMode: i }),
294
+ _e({ mode: a, variant: u, disabled: o }),
295
+ Ne({ mode: a, variant: u, disabled: o }),
296
296
  {
297
- "w-full": s,
297
+ "w-full": l,
298
298
  "disabled:cursor-not-allowed disabled:opacity-50": o
299
299
  },
300
- i({
301
- "transition-[width] duration-300 ease-in-out": e === R && y
300
+ n({
301
+ "transition-[width] duration-300 ease-in-out": e === L && k
302
302
  }),
303
303
  t
304
- )), Se = (e, t, r) => {
304
+ )), Te = (e, t, r) => {
305
305
  var a;
306
306
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
307
- }, Z = P.forwardRef((e, t) => {
308
- const { onClick: r, noInternalClick: a = !1, ...n } = e;
307
+ }, K = z.forwardRef((e, t) => {
308
+ const { onClick: r, noInternalClick: a = !1, ...i } = e;
309
309
  return /* @__PURE__ */ c(
310
310
  "button",
311
311
  {
312
312
  ref: t,
313
313
  onClick: (o) => {
314
- Se(o, a, r);
314
+ Te(o, a, r);
315
315
  },
316
- ...n
316
+ ...i
317
317
  }
318
318
  );
319
319
  });
320
- Z.displayName = "BaseButton";
321
- function Re() {
322
- const e = w(!1);
323
- return A(() => (e.current = !0, () => {
320
+ K.displayName = "BaseButton";
321
+ function Ce() {
322
+ const e = I(!1);
323
+ return V(() => (e.current = !0, () => {
324
324
  e.current = !1;
325
- }), []), ie(() => e.current, []);
325
+ }), []), ce(() => e.current, []);
326
326
  }
327
- function Be(e) {
328
- return X(() => e.every((t) => t == null) ? () => {
327
+ function Me(e) {
328
+ return H(() => e.every((t) => t == null) ? () => {
329
329
  } : (t) => {
330
330
  e.forEach((r) => {
331
331
  typeof r == "function" ? r(t) : r != null && (r.current = t);
332
332
  });
333
333
  }, e);
334
334
  }
335
- const Te = {
335
+ const Le = {
336
336
  x: 0,
337
337
  y: 0,
338
338
  width: 0,
@@ -342,126 +342,129 @@ const Te = {
342
342
  bottom: 0,
343
343
  right: 0
344
344
  };
345
- function L(e) {
346
- const t = Re(), r = w(0), a = w(null), [n, o] = ne(Te), s = X(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((l) => {
347
- const u = l[0];
348
- u && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
349
- a.current && t() && o(u.contentRect);
345
+ function P(e) {
346
+ const t = Ce(), r = I(0), a = I(null), [i, o] = le(Le), l = H(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((s) => {
347
+ const d = s[0];
348
+ d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
349
+ a.current && t() && o(d.contentRect);
350
350
  }));
351
351
  }), [t]);
352
- return A(() => (a.current && (s == null || s.observe(a.current, e)), () => {
353
- s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
354
- }), [s, e]), [a, n];
352
+ return V(() => (a.current && (l == null || l.observe(a.current, e)), () => {
353
+ l == null || l.disconnect(), r.current && cancelAnimationFrame(r.current);
354
+ }), [l, e]), [a, i];
355
355
  }
356
- const Ce = {
356
+ const W = {
357
357
  small: 24,
358
358
  // w-6
359
359
  medium: 32,
360
360
  // w-8
361
361
  large: 48
362
362
  // w-12
363
- }, Me = {
363
+ }, X = {
364
364
  small: 8 * 2,
365
365
  // px-2 x 2
366
366
  medium: 12 * 2,
367
367
  // px-3 x 2
368
368
  large: 16 * 2
369
369
  // px-4 x 2
370
- }, Le = 2, V = P.forwardRef(
370
+ }, Y = 2, U = z.forwardRef(
371
371
  ({
372
372
  children: e,
373
373
  disabled: t = !1,
374
374
  mode: r = "system",
375
375
  focusMode: a = "system",
376
- fullWidth: n = !1,
376
+ fullWidth: i = !1,
377
377
  className: o,
378
- type: s = "button",
379
- raw: l = !1,
380
- noBorder: u = !1,
381
- "aria-label": g,
382
- label: f,
383
- size: h = "medium",
384
- labelRight: d,
385
- labelLeft: b,
386
- noBackground: x = !1,
387
- align: _ = "center",
388
- radius: y = "large",
389
- variant: J = "primary",
390
- iconClassName: K,
391
- animated: z = !1,
392
- ...Q
393
- }, ee) => {
394
- const re = Ee({
395
- type: R,
378
+ type: l = "button",
379
+ raw: s = !1,
380
+ noBorder: d = !1,
381
+ "aria-label": m,
382
+ label: v,
383
+ size: g = "medium",
384
+ labelRight: u,
385
+ labelLeft: f,
386
+ noBackground: E = !1,
387
+ align: S = "center",
388
+ radius: k = "large",
389
+ variant: ee = "primary",
390
+ iconClassName: re,
391
+ animated: y = !1,
392
+ ...te
393
+ }, ae) => {
394
+ const ie = Be({
395
+ type: L,
396
396
  mode: r,
397
397
  focusMode: a,
398
- fullWidth: n,
398
+ fullWidth: i,
399
399
  disabled: t,
400
- raw: l,
400
+ raw: s,
401
401
  className: o,
402
- noBorder: u,
403
- size: h,
404
- labelRight: d,
405
- labelLeft: b,
406
- noBackground: x,
407
- align: _,
408
- radius: y,
409
- variant: J,
410
- animated: z
411
- }), te = Ne({ mode: r, raw: l, iconClassName: K }), U = Ie({ animated: z }), [v, T] = L(), [p, C] = L(), [I, $] = L(), M = w(0), k = w(null), ae = Be([ee, k]);
412
- return F(() => {
413
- I && I.current && (M.current = $.width + Me[h] + (u ? 0 : Le));
414
- }, [$, I, h, u]), F(() => {
415
- k && k.current && (d && v && T.width > 0 ? (v.current && (v.current.style.opacity = "100"), k.current.style.width = `${T.width + M.current}px`) : b && C.width > 0 ? (p.current && (p.current.style.opacity = "100"), k.current.style.width = `${C.width + M.current}px`) : (v.current && (v.current.style.opacity = "0"), p.current && (p.current.style.opacity = "0"), k.current.style.width = `${Ce[h]}px`));
402
+ noBorder: d,
403
+ size: g,
404
+ labelRight: u,
405
+ labelLeft: f,
406
+ noBackground: E,
407
+ align: S,
408
+ radius: k,
409
+ variant: ee,
410
+ animated: y
411
+ }), ne = Se({ mode: r, raw: s, iconClassName: re }), F = Re({ animated: y }), [p, w] = P(), [x, _] = P(), [B, T] = P(), N = I(0), b = I(null), oe = Me([ae, b]);
412
+ return O(() => {
413
+ y || (N.current = T.width + X[g] + (d ? 0 : Y), b && b.current && (w.width > 0 ? b.current.style.width = `${w.width + N.current}px` : _.width > 0 ? b.current.style.width = `${_.width + N.current}px` : b.current.style.width = `${W[g]}px`));
414
+ }, [y, T, g, d, w, _]), O(() => {
415
+ B && B.current && y && (N.current = T.width + X[g] + (d ? 0 : Y));
416
+ }, [T, B, g, d, y]), O(() => {
417
+ b && b.current && y && (u && p && w.width > 0 ? (p.current && (p.current.style.opacity = "100"), b.current.style.width = `${w.width + N.current}px`) : f && _.width > 0 ? (x.current && (x.current.style.opacity = "100"), b.current.style.width = `${_.width + N.current}px`) : (p.current && (p.current.style.opacity = "0"), x.current && (x.current.style.opacity = "0"), b.current.style.width = `${W[g]}px`));
416
418
  }, [
417
- T,
418
- d,
419
- v,
420
- C,
421
- b,
419
+ w,
420
+ u,
422
421
  p,
423
- h
424
- ]), /* @__PURE__ */ S(
425
- Z,
422
+ _,
423
+ f,
424
+ x,
425
+ g,
426
+ y
427
+ ]), /* @__PURE__ */ M(
428
+ K,
426
429
  {
427
- ref: ae,
428
- className: re,
430
+ ref: oe,
431
+ className: ie,
429
432
  disabled: t,
430
- type: s,
431
- "aria-label": g || f,
432
- ...Q,
433
+ type: l,
434
+ "aria-label": m || v,
435
+ ...te,
433
436
  children: [
434
- /* @__PURE__ */ c("span", { ref: p, className: U, children: b && /* @__PURE__ */ c("span", { className: "pr-2", children: b }) }),
435
- /* @__PURE__ */ c("span", { ref: I, className: te, children: e }),
436
- /* @__PURE__ */ c("span", { ref: v, className: U, children: d && /* @__PURE__ */ c("span", { className: "pl-2", children: d }) })
437
+ /* @__PURE__ */ c("span", { ref: x, className: F, children: f && /* @__PURE__ */ c("span", { className: "pr-2", children: f }) }),
438
+ /* @__PURE__ */ c("span", { ref: B, className: ne, children: e }),
439
+ /* @__PURE__ */ c("span", { ref: p, className: F, children: u && /* @__PURE__ */ c("span", { className: "pl-2", children: u }) })
437
440
  ]
438
441
  }
439
442
  );
440
443
  }
441
444
  );
442
- V.displayName = "ButtonIcon";
445
+ U.displayName = "ButtonIcon";
443
446
  /*!
444
- @versini/ui-button v4.2.0
447
+ @versini/ui-button v4.2.1
445
448
  © 2025 gizmette.com
446
449
  */
447
450
  try {
448
451
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
449
- version: "4.2.0",
450
- buildTime: "01/25/2025 10:54 PM EST",
452
+ version: "4.2.1",
453
+ buildTime: "01/26/2025 05:19 PM EST",
451
454
  homepage: "https://github.com/aversini/ui-components",
452
455
  license: "MIT"
453
456
  });
454
457
  } catch {
455
458
  }
456
- const Oe = P.forwardRef(
459
+ const $e = z.forwardRef(
457
460
  ({
458
461
  children: e,
459
462
  mode: t = "system",
460
463
  className: r,
461
464
  active: a = !1,
462
- ...n
465
+ ...i
463
466
  }, o) => {
464
- const s = a ? i(
467
+ const l = a ? n(
465
468
  "relative",
466
469
  "focus-within:static",
467
470
  "focus-within:after:border-transparent",
@@ -478,48 +481,48 @@ const Oe = P.forwardRef(
478
481
  "after:border-table-light dark:after:border-table-dark": t === "alt-system"
479
482
  }
480
483
  ) : "";
481
- return /* @__PURE__ */ c("div", { className: s, children: /* @__PURE__ */ c(
482
- V,
484
+ return /* @__PURE__ */ c("div", { className: l, children: /* @__PURE__ */ c(
485
+ U,
483
486
  {
484
- className: i("justify-center", r),
487
+ className: n("justify-center", r),
485
488
  ref: o,
486
489
  mode: t,
487
490
  radius: "small",
488
- ...n,
491
+ ...i,
489
492
  children: e
490
493
  }
491
494
  ) });
492
495
  }
493
496
  );
494
- Oe.displayName = "ButtonSort";
495
- const Pe = ({
497
+ $e.displayName = "ButtonSort";
498
+ const Oe = ({
496
499
  children: e,
497
500
  fill: t,
498
501
  viewBox: r,
499
502
  className: a,
500
- defaultViewBox: n,
503
+ defaultViewBox: i,
501
504
  size: o,
502
- title: s,
503
- semantic: l = !1,
504
- ...u
505
+ title: l,
506
+ semantic: s = !1,
507
+ ...d
505
508
  }) => {
506
- const g = i(o, a);
507
- return /* @__PURE__ */ S(W, { children: [
509
+ const m = n(o, a);
510
+ return /* @__PURE__ */ M(q, { children: [
508
511
  /* @__PURE__ */ c(
509
512
  "svg",
510
513
  {
511
514
  xmlns: "http://www.w3.org/2000/svg",
512
- className: g,
513
- viewBox: r || n,
515
+ className: m,
516
+ viewBox: r || i,
514
517
  fill: t || "currentColor",
515
518
  role: "img",
516
- "aria-hidden": !l,
519
+ "aria-hidden": !s,
517
520
  focusable: !1,
518
- ...u,
521
+ ...d,
519
522
  children: e
520
523
  }
521
524
  ),
522
- s && l && /* @__PURE__ */ c("span", { className: "sr-only", children: s })
525
+ l && s && /* @__PURE__ */ c("span", { className: "sr-only", children: l })
523
526
  ] });
524
527
  };
525
528
  /*!
@@ -535,21 +538,21 @@ try {
535
538
  });
536
539
  } catch {
537
540
  }
538
- const Ae = ({
541
+ const Pe = ({
539
542
  className: e,
540
543
  viewBox: t,
541
544
  title: r,
542
545
  monotone: a,
543
- ...n
546
+ ...i
544
547
  }) => /* @__PURE__ */ c(
545
- Pe,
548
+ Oe,
546
549
  {
547
550
  defaultViewBox: "0 0 384 512",
548
551
  size: "size-5",
549
552
  viewBox: t,
550
553
  className: e,
551
554
  title: r || "Close",
552
- ...n,
555
+ ...i,
553
556
  children: /* @__PURE__ */ c(
554
557
  "path",
555
558
  {
@@ -572,37 +575,37 @@ try {
572
575
  });
573
576
  } catch {
574
577
  }
575
- const H = m.createContext(null);
576
- function Ve({
578
+ const Q = h.createContext(null);
579
+ function Ae({
577
580
  initialOpen: e = !1,
578
581
  open: t,
579
582
  onOpenChange: r
580
583
  } = {}) {
581
- const [a, n] = m.useState(e), [o, s] = m.useState(), [l, u] = m.useState(), g = t ?? a, f = r ?? n, h = oe({
582
- open: g,
583
- onOpenChange: f
584
- }), d = h.context, b = se(d, {
584
+ const [a, i] = h.useState(e), [o, l] = h.useState(), [s, d] = h.useState(), m = t ?? a, v = r ?? i, g = se({
585
+ open: m,
586
+ onOpenChange: v
587
+ }), u = g.context, f = de(u, {
585
588
  enabled: t == null
586
- }), x = ce(d, {
589
+ }), E = ue(u, {
587
590
  outsidePress: !1,
588
591
  outsidePressEvent: "mousedown"
589
- }), _ = le(d), y = de([b, x, _]);
590
- return m.useMemo(
592
+ }), S = me(u), k = ge([f, E, S]);
593
+ return h.useMemo(
591
594
  () => ({
592
- open: g,
593
- setOpen: f,
594
- ...y,
595
- ...h,
595
+ open: m,
596
+ setOpen: v,
597
+ ...k,
598
+ ...g,
596
599
  labelId: o,
597
- descriptionId: l,
598
- setLabelId: s,
599
- setDescriptionId: u
600
+ descriptionId: s,
601
+ setLabelId: l,
602
+ setDescriptionId: d
600
603
  }),
601
- [g, f, y, h, o, l]
604
+ [m, v, k, g, o, s]
602
605
  );
603
606
  }
604
- const B = () => {
605
- const e = m.useContext(H);
607
+ const $ = () => {
608
+ const e = h.useContext(Q);
606
609
  if (e == null)
607
610
  throw new Error("Modal components must be wrapped in <Modal />");
608
611
  return e;
@@ -611,38 +614,38 @@ function ze({
611
614
  children: e,
612
615
  ...t
613
616
  }) {
614
- const r = Ve(t);
615
- return /* @__PURE__ */ c(H.Provider, { value: r, children: e });
617
+ const r = Ae(t);
618
+ return /* @__PURE__ */ c(Q.Provider, { value: r, children: e });
616
619
  }
617
- const Ue = m.forwardRef(function(e, t) {
618
- const { context: r, ...a } = B(), n = ue([a.refs.setFloating, t]);
620
+ const Ve = h.forwardRef(function(e, t) {
621
+ const { context: r, ...a } = $(), i = he([a.refs.setFloating, t]);
619
622
  if (!r.open)
620
623
  return null;
621
- const { overlayBackground: o, ...s } = e, l = i("grid place-items-center", {
624
+ const { overlayBackground: o, ...l } = e, s = n("grid place-items-center", {
622
625
  [`${o}`]: o,
623
626
  "bg-black sm:bg-black/[.8]": !o
624
627
  });
625
- return /* @__PURE__ */ c(ge, { children: /* @__PURE__ */ c(me, { className: l, lockScroll: !0, children: /* @__PURE__ */ c(he, { context: r, children: /* @__PURE__ */ c(
628
+ return /* @__PURE__ */ c(be, { children: /* @__PURE__ */ c(fe, { className: s, lockScroll: !0, children: /* @__PURE__ */ c(ve, { context: r, children: /* @__PURE__ */ c(
626
629
  "div",
627
630
  {
628
- ref: n,
631
+ ref: i,
629
632
  "aria-labelledby": a.labelId,
630
633
  "aria-describedby": a.descriptionId,
631
- ...a.getFloatingProps(s),
632
- children: s.children
634
+ ...a.getFloatingProps(l),
635
+ children: l.children
633
636
  }
634
637
  ) }) }) });
635
- }), $e = m.forwardRef(function({ children: e, ...t }, r) {
636
- const { setLabelId: a } = B(), n = q();
637
- return m.useLayoutEffect(() => (a(n), () => a(void 0)), [n, a]), /* @__PURE__ */ c("h1", { ...t, ref: r, id: n, children: e });
638
- }), Fe = m.forwardRef(function({ children: e, ...t }, r) {
639
- const { setDescriptionId: a } = B(), n = q();
640
- return m.useLayoutEffect(() => (a(n), () => a(void 0)), [n, a]), /* @__PURE__ */ c("div", { ...t, ref: r, id: n, children: e });
641
- }), je = m.forwardRef(function(e, t) {
642
- const { setOpen: r } = B(), { trigger: a, className: n, ...o } = e, s = m.useCallback(() => r(!1), [r]);
643
- return /* @__PURE__ */ c("div", { className: n, children: m.cloneElement(a, {
638
+ }), Ue = h.forwardRef(function({ children: e, ...t }, r) {
639
+ const { setLabelId: a } = $(), i = Z();
640
+ return h.useLayoutEffect(() => (a(i), () => a(void 0)), [i, a]), /* @__PURE__ */ c("h1", { ...t, ref: r, id: i, children: e });
641
+ }), Fe = h.forwardRef(function({ children: e, ...t }, r) {
642
+ const { setDescriptionId: a } = $(), i = Z();
643
+ return h.useLayoutEffect(() => (a(i), () => a(void 0)), [i, a]), /* @__PURE__ */ c("div", { ...t, ref: r, id: i, children: e });
644
+ }), je = h.forwardRef(function(e, t) {
645
+ const { setOpen: r } = $(), { trigger: a, className: i, ...o } = e, l = h.useCallback(() => r(!1), [r]);
646
+ return /* @__PURE__ */ c("div", { className: i, children: h.cloneElement(a, {
644
647
  ref: t,
645
- onClick: s,
648
+ onClick: l,
646
649
  ...o
647
650
  }) });
648
651
  });
@@ -653,71 +656,71 @@ const Ue = m.forwardRef(function(e, t) {
653
656
  try {
654
657
  window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
655
658
  version: "1.2.9",
656
- buildTime: "01/25/2025 10:54 PM EST",
659
+ buildTime: "01/26/2025 05:19 PM EST",
657
660
  homepage: "https://github.com/aversini/ui-components",
658
661
  license: "MIT"
659
662
  });
660
663
  } catch {
661
664
  }
662
- const N = "panel", E = "messagebox", De = ({
665
+ const R = "panel", C = "messagebox", De = ({
663
666
  className: e,
664
667
  kind: t,
665
668
  borderMode: r
666
669
  }) => ({
667
- main: i("prose prose-lighter flex flex-col bg-surface-medium", {
668
- [`${D} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === N,
669
- [`${D} w-full sm:w-[95%] md:max-w-2xl`]: t === N && !e,
670
- [`${j} rounded-lg border-2`]: t === E,
671
- [`${j} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === E && !e,
670
+ main: n("prose prose-lighter flex flex-col bg-surface-medium", {
671
+ [`${D} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === R,
672
+ [`${D} w-full sm:w-[95%] md:max-w-2xl`]: t === R && !e,
673
+ [`${j} rounded-lg border-2`]: t === C,
674
+ [`${j} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === C && !e,
672
675
  [`${e}`]: !!e,
673
- "sm:border-border-dark": r === "dark" && t === N,
674
- "sm:border-border-accent": r === "light" && t === N,
675
- "border-border-dark": r === "dark" && t === E,
676
- "border-border-accent": r === "light" && t === E
676
+ "sm:border-border-dark": r === "dark" && t === R,
677
+ "sm:border-border-accent": r === "light" && t === R,
678
+ "border-border-dark": r === "dark" && t === C,
679
+ "border-border-accent": r === "light" && t === C
677
680
  }),
678
681
  content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
679
682
  footer: "flex flex-grow flex-col sm:p-4 p-2",
680
683
  header: "sm:p-4 mb-0 p-2",
681
684
  close: "sm:p-4 p-2"
682
- }), Ye = ({
685
+ }), qe = ({
683
686
  open: e,
684
687
  onOpenChange: t,
685
688
  title: r,
686
689
  children: a,
687
- footer: n,
690
+ footer: i,
688
691
  borderMode: o = "light",
689
- kind: s = N,
690
- className: l
692
+ kind: l = R,
693
+ className: s
691
694
  }) => {
692
- const u = w(""), g = De({ className: l, kind: s, borderMode: o });
693
- return A(() => (e && (u.current = document.title, document.title = `${r} | ${u.current}`), () => {
694
- e && (document.title = u.current);
695
- }), [r, e]), /* @__PURE__ */ c(W, { children: e && /* @__PURE__ */ c(ze, { open: e, onOpenChange: t, children: /* @__PURE__ */ S(Ue, { className: g.main, children: [
696
- /* @__PURE__ */ S("div", { className: "flex flex-row-reverse items-center justify-between", children: [
695
+ const d = I(""), m = De({ className: s, kind: l, borderMode: o });
696
+ return V(() => (e && (d.current = document.title, document.title = `${r} | ${d.current}`), () => {
697
+ e && (document.title = d.current);
698
+ }), [r, e]), /* @__PURE__ */ c(q, { children: e && /* @__PURE__ */ c(ze, { open: e, onOpenChange: t, children: /* @__PURE__ */ M(Ve, { className: m.main, children: [
699
+ /* @__PURE__ */ M("div", { className: "flex flex-row-reverse items-center justify-between", children: [
697
700
  /* @__PURE__ */ c(
698
701
  je,
699
702
  {
700
- className: g.close,
703
+ className: m.close,
701
704
  trigger: /* @__PURE__ */ c(
702
- V,
705
+ U,
703
706
  {
704
707
  mode: "dark",
705
708
  focusMode: "light",
706
709
  noBorder: !0,
707
710
  label: "Close",
708
- children: /* @__PURE__ */ c(Ae, {})
711
+ children: /* @__PURE__ */ c(Pe, {})
709
712
  }
710
713
  )
711
714
  }
712
715
  ),
713
- /* @__PURE__ */ c($e, { className: g.header, children: r })
716
+ /* @__PURE__ */ c(Ue, { className: m.header, children: r })
714
717
  ] }),
715
- /* @__PURE__ */ c(Fe, { className: g.content, children: a }),
716
- n && /* @__PURE__ */ c("div", { className: g.footer, children: n })
718
+ /* @__PURE__ */ c(Fe, { className: m.content, children: a }),
719
+ i && /* @__PURE__ */ c("div", { className: m.footer, children: i })
717
720
  ] }) }) });
718
721
  };
719
722
  export {
720
723
  j as MESSAGEBOX_CLASSNAME,
721
724
  D as PANEL_CLASSNAME,
722
- Ye as Panel
725
+ qe as Panel
723
726
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@tailwindcss/typography": "0.5.16",
43
- "@versini/ui-button": "4.2.0",
43
+ "@versini/ui-button": "4.2.1",
44
44
  "@versini/ui-icons": "4.6.0",
45
45
  "@versini/ui-modal": "1.2.9",
46
46
  "clsx": "2.1.1",
@@ -49,5 +49,5 @@
49
49
  "sideEffects": [
50
50
  "**/*.css"
51
51
  ],
52
- "gitHead": "95add63a475dc1307dd4ada55909553876a55b73"
52
+ "gitHead": "2afa12a4fcc5da2231f908342e8e18524126274b"
53
53
  }