@versini/ui-panel 1.2.2 → 1.2.3

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 CHANGED
@@ -1,20 +1,22 @@
1
- import { jsx as n, jsxs as y, Fragment as U } from "react/jsx-runtime";
2
- import o from "clsx";
3
- import E, { lazy as A, useRef as z, useEffect as O, Suspense as j } from "react";
1
+ import { jsx as i, jsxs as _, Fragment as L } from "react/jsx-runtime";
2
+ import d from "clsx";
3
+ import * as u from "react";
4
+ import T, { useId as P, useRef as j, useEffect as F } from "react";
5
+ import { useFloating as G, useClick as D, useDismiss as W, useRole as X, useInteractions as Y, useMergeRefs as q, FloatingPortal as H, FloatingOverlay as J, FloatingFocusManager as K } from "@floating-ui/react";
4
6
  /*!
5
- @versini/ui-panel v1.2.2
7
+ @versini/ui-panel v1.2.3
6
8
  © 2024 gizmette.com
7
9
  */
8
10
  try {
9
11
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
10
- version: "1.2.2",
11
- buildTime: "12/26/2024 06:05 PM EST",
12
+ version: "1.2.3",
13
+ buildTime: "12/27/2024 07:18 PM EST",
12
14
  homepage: "https://github.com/aversini/ui-components",
13
15
  license: "MIT"
14
16
  });
15
17
  } catch {
16
18
  }
17
- const M = "av-messagebox", C = "av-panel", R = "av-button";
19
+ const R = "av-messagebox", C = "av-panel", $ = "av-button";
18
20
  /*!
19
21
  @versini/ui-spacing v1.1.0
20
22
  © 2024 gizmette.com
@@ -22,13 +24,13 @@ const M = "av-messagebox", C = "av-panel", R = "av-button";
22
24
  try {
23
25
  window.__VERSINI_UI_SPACING__ || (window.__VERSINI_UI_SPACING__ = {
24
26
  version: "1.1.0",
25
- buildTime: "12/26/2024 06:05 PM EST",
27
+ buildTime: "12/27/2024 07:18 PM EST",
26
28
  homepage: "https://github.com/aversini/ui-components",
27
29
  license: "MIT"
28
30
  });
29
31
  } catch {
30
32
  }
31
- const G = (e) => {
33
+ const Q = (e) => {
32
34
  let r = "";
33
35
  if (typeof e == "number" || typeof e == "string")
34
36
  r = "m-" + e;
@@ -37,32 +39,32 @@ const G = (e) => {
37
39
  (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
38
40
  }
39
41
  return r;
40
- }, T = "icon", W = "button", D = "link", H = ({
42
+ }, B = "icon", Z = "button", ee = "link", te = ({
41
43
  type: e,
42
44
  size: r,
43
45
  labelRight: t,
44
46
  labelLeft: a,
45
- align: d
47
+ align: o
46
48
  }) => {
47
- const l = "text-sm font-medium max-h-8 py-0", g = "text-base font-medium max-h-9 py-1", i = "text-lg font-medium max-h-12 py-2";
49
+ const n = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", l = "text-lg font-medium max-h-12 py-2";
48
50
  switch (e) {
49
- case W:
50
- return o("px-4", {
51
- [l]: r === "small",
52
- [g]: r === "medium",
53
- [i]: r === "large"
51
+ case Z:
52
+ return d("px-4", {
53
+ [n]: r === "small",
54
+ [c]: r === "medium",
55
+ [l]: r === "large"
54
56
  });
55
- case D:
56
- return o("px-4 text-center", {
57
- [l]: r === "small",
58
- [g]: r === "medium",
59
- [i]: r === "large"
57
+ case ee:
58
+ return d("px-4 text-center", {
59
+ [n]: r === "small",
60
+ [c]: r === "medium",
61
+ [l]: r === "large"
60
62
  });
61
- case T:
62
- return o("inline-flex items-center", {
63
- "justify-center": d === "center",
64
- "justify-start": d === "left",
65
- "justify-end": d === "right",
63
+ case B:
64
+ return d("inline-flex items-center", {
65
+ "justify-center": o === "center",
66
+ "justify-start": o === "left",
67
+ "justify-end": o === "right",
66
68
  "h-6 w-6 p-0": r === "small" && !(t || a),
67
69
  "h-6 px-4 text-sm font-medium": r === "small" && (t || a),
68
70
  "h-8 w-8 p-1": r === "medium" && !(t || a),
@@ -71,7 +73,7 @@ const G = (e) => {
71
73
  "h-12 px-4 text-lg font-medium": r === "large" && (t || a)
72
74
  });
73
75
  }
74
- }, X = ({
76
+ }, re = ({
75
77
  mode: e,
76
78
  noBackground: r,
77
79
  noTruncate: t,
@@ -80,7 +82,7 @@ const G = (e) => {
80
82
  if (r)
81
83
  return "not-prose rounded-full";
82
84
  if (a === "primary")
83
- return o("not-prose rounded-full", {
85
+ return d("not-prose rounded-full", {
84
86
  truncate: !t,
85
87
  "bg-action-dark text-copy-light": e === "dark",
86
88
  "bg-action-light text-copy-lighter": e === "light",
@@ -88,7 +90,7 @@ const G = (e) => {
88
90
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
89
91
  });
90
92
  if (a === "secondary")
91
- return o("not-prose rounded-full", {
93
+ return d("not-prose rounded-full", {
92
94
  truncate: !t,
93
95
  "bg-action-dark text-copy-light": e === "light",
94
96
  "bg-action-light text-copy-lighter": e === "dark",
@@ -96,14 +98,14 @@ const G = (e) => {
96
98
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
97
99
  });
98
100
  if (a === "danger")
99
- return o("not-prose rounded-full", {
101
+ return d("not-prose rounded-full", {
100
102
  truncate: !t,
101
103
  "bg-action-danger-dark text-copy-light": e === "dark",
102
104
  "bg-action-danger-light text-copy-lighter": e === "light",
103
105
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
104
106
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
105
107
  });
106
- }, Y = ({
108
+ }, ae = ({
107
109
  mode: e,
108
110
  disabled: r,
109
111
  variant: t
@@ -111,27 +113,27 @@ const G = (e) => {
111
113
  if (r)
112
114
  return "";
113
115
  if (t === "primary")
114
- return o("hover:text-copy-light-hover", {
116
+ return d("hover:text-copy-light-hover", {
115
117
  "hover:bg-action-dark-hover": e === "dark",
116
118
  "hover:bg-action-light-hover": e === "light",
117
119
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
118
120
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
119
121
  });
120
122
  if (t === "secondary")
121
- return o("hover:text-copy-light-hover", {
123
+ return d("hover:text-copy-light-hover", {
122
124
  "hover:bg-action-dark-hover": e === "light",
123
125
  "hover:bg-action-light-hover": e === "dark",
124
126
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
125
127
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
126
128
  });
127
129
  if (t === "danger")
128
- return o("hover:text-copy-light-hover", {
130
+ return d("hover:text-copy-light-hover", {
129
131
  "hover:bg-action-danger-dark-hover": e === "dark",
130
132
  "hover:bg-action-danger-light-hover": e === "light",
131
133
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
132
134
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
133
135
  });
134
- }, F = ({
136
+ }, oe = ({
135
137
  mode: e,
136
138
  disabled: r,
137
139
  variant: t
@@ -139,27 +141,27 @@ const G = (e) => {
139
141
  if (r)
140
142
  return "";
141
143
  if (t === "primary")
142
- return o("active:text-copy-light-active", {
144
+ return d("active:text-copy-light-active", {
143
145
  "active:bg-action-dark-active": e === "dark",
144
146
  "active:bg-action-light-active": e === "light",
145
147
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
146
148
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
147
149
  });
148
150
  if (t === "secondary")
149
- return o("active:text-copy-light-active", {
151
+ return d("active:text-copy-light-active", {
150
152
  "active:bg-action-dark-active": e === "light",
151
153
  "active:bg-action-light-active": e === "dark",
152
154
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
153
155
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
154
156
  });
155
157
  if (t === "danger")
156
- return o("active:text-copy-lighter-active", {
158
+ return d("active:text-copy-lighter-active", {
157
159
  "active:bg-action-danger-dark-active": e === "dark",
158
160
  "active:bg-action-danger-light-active": e === "light",
159
161
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
160
162
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
161
163
  });
162
- }, q = ({
164
+ }, ie = ({
163
165
  mode: e,
164
166
  noBorder: r,
165
167
  variant: t
@@ -167,140 +169,140 @@ const G = (e) => {
167
169
  if (r)
168
170
  return "border border-transparent";
169
171
  if (t === "primary")
170
- return o("border", {
172
+ return d("border", {
171
173
  "border-border-dark": e === "dark",
172
174
  "border-border-accent": e === "light",
173
175
  "border-border-dark dark:border-border-accent": e === "system",
174
176
  "border-border-accent dark:border-border-dark": e === "alt-system"
175
177
  });
176
178
  if (t === "secondary")
177
- return o("border", {
179
+ return d("border", {
178
180
  "border-border-dark": e === "light",
179
181
  "border-border-accent": e === "dark",
180
182
  "border-border-dark dark:border-border-accent": e === "alt-system",
181
183
  "border-border-accent dark:border-border-dark": e === "system"
182
184
  });
183
185
  if (t === "danger")
184
- return o("border", {
186
+ return d("border", {
185
187
  "border-border-danger-dark": e === "dark",
186
188
  "border-border-danger-medium": e === "light",
187
189
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
188
190
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
189
191
  });
190
- }, J = ({ focusMode: e }) => o("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
192
+ }, ne = ({ focusMode: e }) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
191
193
  "focus:outline-focus-dark": e === "dark",
192
194
  "focus:outline-focus-light": e === "light",
193
195
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
194
196
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
195
- }), $ = ({
197
+ }), V = ({
196
198
  type: e,
197
199
  className: r,
198
200
  raw: t,
199
201
  mode: a,
200
- focusMode: d,
201
- disabled: l,
202
- fullWidth: g,
203
- size: i,
202
+ focusMode: o,
203
+ disabled: n,
204
+ fullWidth: c,
205
+ size: l,
204
206
  noBorder: h,
205
207
  labelRight: s,
206
- labelLeft: u,
207
- spacing: b,
208
+ labelLeft: b,
209
+ spacing: f,
208
210
  noBackground: m,
209
- variant: c,
210
- noTruncate: v,
211
- align: f
212
- }) => (c || (c = "primary"), t ? o(R, r) : o(
213
- R,
211
+ variant: g,
212
+ noTruncate: p,
213
+ align: v
214
+ }) => (g || (g = "primary"), t ? d($, r) : d(
215
+ $,
214
216
  r,
215
- G(b),
216
- X({ mode: a, variant: c, noBackground: m, noTruncate: v }),
217
- H({ type: e, size: i, labelRight: s, labelLeft: u, align: f }),
218
- q({ mode: a, variant: c, noBorder: h }),
219
- J({ focusMode: d }),
220
- Y({ mode: a, variant: c, disabled: l }),
221
- F({ mode: a, variant: c, disabled: l }),
217
+ Q(f),
218
+ re({ mode: a, variant: g, noBackground: m, noTruncate: p }),
219
+ te({ type: e, size: l, labelRight: s, labelLeft: b, align: v }),
220
+ ie({ mode: a, variant: g, noBorder: h }),
221
+ ne({ focusMode: o }),
222
+ ae({ mode: a, variant: g, disabled: n }),
223
+ oe({ mode: a, variant: g, disabled: n }),
222
224
  {
223
- "w-full": g,
224
- "disabled:cursor-not-allowed disabled:opacity-50": l
225
+ "w-full": c,
226
+ "disabled:cursor-not-allowed disabled:opacity-50": n
225
227
  }
226
- )), K = (e, r, t) => {
228
+ )), le = (e, r, t) => {
227
229
  var a;
228
230
  !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
229
- }, B = E.forwardRef((e, r) => {
230
- const { onClick: t, noInternalClick: a = !1, ...d } = e;
231
- return /* @__PURE__ */ n(
231
+ }, M = T.forwardRef((e, r) => {
232
+ const { onClick: t, noInternalClick: a = !1, ...o } = e;
233
+ return /* @__PURE__ */ i(
232
234
  "button",
233
235
  {
234
236
  ref: r,
235
- onClick: (l) => {
236
- K(l, a, t);
237
+ onClick: (n) => {
238
+ le(n, a, t);
237
239
  },
238
- ...d
240
+ ...o
239
241
  }
240
242
  );
241
243
  });
242
- B.displayName = "BaseButton";
243
- const L = E.forwardRef(
244
+ M.displayName = "BaseButton";
245
+ const O = T.forwardRef(
244
246
  ({
245
247
  children: e,
246
248
  disabled: r = !1,
247
249
  mode: t = "system",
248
250
  focusMode: a = "system",
249
- fullWidth: d = !1,
250
- className: l,
251
- type: g = "button",
252
- raw: i = !1,
251
+ fullWidth: o = !1,
252
+ className: n,
253
+ type: c = "button",
254
+ raw: l = !1,
253
255
  noBorder: h = !1,
254
256
  "aria-label": s,
255
- label: u,
256
- size: b = "medium",
257
+ label: b,
258
+ size: f = "medium",
257
259
  labelRight: m,
258
- labelLeft: c,
259
- spacing: v,
260
- noBackground: f = !1,
261
- align: _ = "center",
262
- ...w
260
+ labelLeft: g,
261
+ spacing: p,
262
+ noBackground: v = !1,
263
+ align: y = "center",
264
+ ...I
263
265
  }, N) => {
264
- const I = $({
265
- type: T,
266
+ const E = V({
267
+ type: B,
266
268
  mode: t,
267
269
  focusMode: a,
268
- fullWidth: d,
270
+ fullWidth: o,
269
271
  disabled: r,
270
- raw: i,
271
- className: l,
272
+ raw: l,
273
+ className: n,
272
274
  noBorder: h,
273
- size: b,
275
+ size: f,
274
276
  labelRight: m,
275
- labelLeft: c,
276
- spacing: v,
277
- noBackground: f,
278
- align: _
279
- }), S = o({
280
- "text-copy-accent-dark": t === "light" && !i,
281
- "text-copy-light": t === "dark" && !i,
282
- "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !i,
283
- "text-copy-light dark:text-copy-accent-dark": t === "system" && !i
277
+ labelLeft: g,
278
+ spacing: p,
279
+ noBackground: v,
280
+ align: y
281
+ }), S = d({
282
+ "text-copy-accent-dark": t === "light" && !l,
283
+ "text-copy-light": t === "dark" && !l,
284
+ "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !l,
285
+ "text-copy-light dark:text-copy-accent-dark": t === "system" && !l
284
286
  });
285
- return /* @__PURE__ */ y(
286
- B,
287
+ return /* @__PURE__ */ _(
288
+ M,
287
289
  {
288
290
  ref: N,
289
- className: I,
291
+ className: E,
290
292
  disabled: r,
291
- type: g,
292
- "aria-label": s || u,
293
- ...w,
293
+ type: c,
294
+ "aria-label": s || b,
295
+ ...I,
294
296
  children: [
295
- c && /* @__PURE__ */ n("span", { className: "pr-2", children: c }),
296
- /* @__PURE__ */ n("div", { className: S, children: e }),
297
- m && /* @__PURE__ */ n("span", { className: "pl-2", children: m })
297
+ g && /* @__PURE__ */ i("span", { className: "pr-2", children: g }),
298
+ /* @__PURE__ */ i("div", { className: S, children: e }),
299
+ m && /* @__PURE__ */ i("span", { className: "pl-2", children: m })
298
300
  ]
299
301
  }
300
302
  );
301
303
  }
302
304
  );
303
- L.displayName = "ButtonIcon";
305
+ O.displayName = "ButtonIcon";
304
306
  /*!
305
307
  @versini/ui-button v1.6.0
306
308
  © 2024 gizmette.com
@@ -308,55 +310,55 @@ L.displayName = "ButtonIcon";
308
310
  try {
309
311
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
310
312
  version: "1.6.0",
311
- buildTime: "12/26/2024 06:05 PM EST",
313
+ buildTime: "12/27/2024 07:18 PM EST",
312
314
  homepage: "https://github.com/aversini/ui-components",
313
315
  license: "MIT"
314
316
  });
315
317
  } catch {
316
318
  }
317
- const Q = E.forwardRef(
319
+ const de = T.forwardRef(
318
320
  ({
319
321
  children: e,
320
322
  disabled: r = !1,
321
323
  mode: t = "system",
322
324
  focusMode: a = "system",
323
- fullWidth: d = !1,
324
- className: l,
325
- type: g = "button",
326
- raw: i = !1,
325
+ fullWidth: o = !1,
326
+ className: n,
327
+ type: c = "button",
328
+ raw: l = !1,
327
329
  noBorder: h = !1,
328
330
  "aria-label": s,
329
- label: u,
330
- size: b = "medium",
331
+ label: b,
332
+ size: f = "medium",
331
333
  labelRight: m,
332
- labelLeft: c,
333
- spacing: v,
334
- noBackground: f = !1,
335
- align: _ = "center",
336
- active: w = !1,
334
+ labelLeft: g,
335
+ spacing: p,
336
+ noBackground: v = !1,
337
+ align: y = "center",
338
+ active: I = !1,
337
339
  ...N
338
- }, I) => {
339
- const S = $({
340
- type: T,
340
+ }, E) => {
341
+ const S = V({
342
+ type: B,
341
343
  mode: t,
342
344
  focusMode: a,
343
- fullWidth: d,
345
+ fullWidth: o,
344
346
  disabled: r,
345
- raw: i,
346
- className: l,
347
+ raw: l,
348
+ className: n,
347
349
  noBorder: h,
348
- size: b,
350
+ size: f,
349
351
  labelRight: m,
350
- labelLeft: c,
351
- spacing: v,
352
- noBackground: f,
353
- align: _
354
- }), P = o({
355
- "text-copy-accent-dark": t === "light" && !i,
356
- "text-copy-light": t === "dark" && !i,
357
- "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !i,
358
- "text-copy-light dark:text-copy-accent-dark": t === "system" && !i
359
- }), V = w ? o(
352
+ labelLeft: g,
353
+ spacing: p,
354
+ noBackground: v,
355
+ align: y
356
+ }), A = d({
357
+ "text-copy-accent-dark": t === "light" && !l,
358
+ "text-copy-light": t === "dark" && !l,
359
+ "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !l,
360
+ "text-copy-light dark:text-copy-accent-dark": t === "system" && !l
361
+ }), z = I ? d(
360
362
  "relative",
361
363
  "focus-within:static",
362
364
  "focus-within:after:border-transparent",
@@ -373,25 +375,25 @@ const Q = E.forwardRef(
373
375
  "after:border-table-light dark:after:border-table-dark": t === "alt-system"
374
376
  }
375
377
  ) : "";
376
- return /* @__PURE__ */ n("div", { className: V, children: /* @__PURE__ */ y(
377
- B,
378
+ return /* @__PURE__ */ i("div", { className: z, children: /* @__PURE__ */ _(
379
+ M,
378
380
  {
379
- ref: I,
381
+ ref: E,
380
382
  className: S,
381
383
  disabled: r,
382
- type: g,
383
- "aria-label": s || u,
384
+ type: c,
385
+ "aria-label": s || b,
384
386
  ...N,
385
387
  children: [
386
- c && /* @__PURE__ */ n("span", { className: "pr-2", children: c }),
387
- /* @__PURE__ */ n("div", { className: P, children: e }),
388
- m && /* @__PURE__ */ n("span", { className: "pl-2", children: m })
388
+ g && /* @__PURE__ */ i("span", { className: "pr-2", children: g }),
389
+ /* @__PURE__ */ i("div", { className: A, children: e }),
390
+ m && /* @__PURE__ */ i("span", { className: "pl-2", children: m })
389
391
  ]
390
392
  }
391
393
  ) });
392
394
  }
393
395
  );
394
- Q.displayName = "ButtonSort";
396
+ de.displayName = "ButtonSort";
395
397
  /*!
396
398
  @versini/ui-spacing v1.1.0
397
399
  © 2024 gizmette.com
@@ -399,13 +401,13 @@ Q.displayName = "ButtonSort";
399
401
  try {
400
402
  window.__VERSINI_UI_SPACING__ || (window.__VERSINI_UI_SPACING__ = {
401
403
  version: "1.1.0",
402
- buildTime: "12/26/2024 06:05 PM EST",
404
+ buildTime: "12/27/2024 07:18 PM EST",
403
405
  homepage: "https://github.com/aversini/ui-components",
404
406
  license: "MIT"
405
407
  });
406
408
  } catch {
407
409
  }
408
- const Z = (e) => {
410
+ const ce = (e) => {
409
411
  let r = "";
410
412
  if (typeof e == "number" || typeof e == "string")
411
413
  r = "m-" + e;
@@ -414,29 +416,29 @@ const Z = (e) => {
414
416
  (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
415
417
  }
416
418
  return r;
417
- }, ee = ({
419
+ }, se = ({
418
420
  children: e,
419
421
  fill: r,
420
422
  viewBox: t,
421
423
  className: a,
422
- defaultViewBox: d,
423
- defaultClassName: l,
424
- spacing: g,
425
- title: i,
424
+ defaultViewBox: o,
425
+ defaultClassName: n,
426
+ spacing: c,
427
+ title: l,
426
428
  semantic: h = !1,
427
429
  ...s
428
430
  }) => {
429
- const u = Z(g), b = o(
430
- u,
431
- a || l
431
+ const b = ce(c), f = d(
432
+ b,
433
+ a || n
432
434
  );
433
- return /* @__PURE__ */ y(U, { children: [
434
- /* @__PURE__ */ n(
435
+ return /* @__PURE__ */ _(L, { children: [
436
+ /* @__PURE__ */ i(
435
437
  "svg",
436
438
  {
437
439
  xmlns: "http://www.w3.org/2000/svg",
438
- className: b,
439
- viewBox: t || d,
440
+ className: f,
441
+ viewBox: t || o,
440
442
  fill: r || "currentColor",
441
443
  role: "img",
442
444
  "aria-hidden": !h,
@@ -445,7 +447,7 @@ const Z = (e) => {
445
447
  children: e
446
448
  }
447
449
  ),
448
- i && h && /* @__PURE__ */ n("span", { className: "sr-only", children: i })
450
+ l && h && /* @__PURE__ */ i("span", { className: "sr-only", children: l })
449
451
  ] });
450
452
  };
451
453
  /*!
@@ -455,21 +457,21 @@ const Z = (e) => {
455
457
  try {
456
458
  window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
457
459
  version: "1.1.0",
458
- buildTime: "12/26/2024 06:05 PM EST",
460
+ buildTime: "12/27/2024 07:18 PM EST",
459
461
  homepage: "https://github.com/aversini/ui-components",
460
462
  license: "MIT"
461
463
  });
462
464
  } catch {
463
465
  }
464
- const te = ({
466
+ const ge = ({
465
467
  className: e,
466
468
  viewBox: r,
467
469
  spacing: t,
468
470
  title: a,
469
- monotone: d,
470
- ...l
471
- }) => /* @__PURE__ */ n(
472
- ee,
471
+ monotone: o,
472
+ ...n
473
+ }) => /* @__PURE__ */ i(
474
+ se,
473
475
  {
474
476
  defaultViewBox: "0 0 384 512",
475
477
  defaultClassName: "size-5",
@@ -477,8 +479,8 @@ const te = ({
477
479
  className: e,
478
480
  spacing: t,
479
481
  title: a || "Close",
480
- ...l,
481
- children: /* @__PURE__ */ n("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
482
+ ...n,
483
+ children: /* @__PURE__ */ i("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
482
484
  }
483
485
  );
484
486
  /*!
@@ -488,25 +490,112 @@ const te = ({
488
490
  try {
489
491
  window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
490
492
  version: "1.19.0",
491
- buildTime: "12/26/2024 06:05 PM EST",
493
+ buildTime: "12/27/2024 07:18 PM EST",
492
494
  homepage: "https://github.com/aversini/ui-components",
493
495
  license: "MIT"
494
496
  });
495
497
  } catch {
496
498
  }
497
- const p = "panel", x = "messagebox", re = ({
499
+ const U = u.createContext(null);
500
+ function he({
501
+ initialOpen: e = !1,
502
+ open: r,
503
+ onOpenChange: t
504
+ } = {}) {
505
+ const [a, o] = u.useState(e), [n, c] = u.useState(), [l, h] = u.useState(), s = r ?? a, b = t ?? o, f = G({
506
+ open: s,
507
+ onOpenChange: b
508
+ }), m = f.context, g = D(m, {
509
+ enabled: r == null
510
+ }), p = W(m, {
511
+ outsidePress: !1,
512
+ outsidePressEvent: "mousedown"
513
+ }), v = X(m), y = Y([g, p, v]);
514
+ return u.useMemo(
515
+ () => ({
516
+ open: s,
517
+ setOpen: b,
518
+ ...y,
519
+ ...f,
520
+ labelId: n,
521
+ descriptionId: l,
522
+ setLabelId: c,
523
+ setDescriptionId: h
524
+ }),
525
+ [s, b, y, f, n, l]
526
+ );
527
+ }
528
+ const w = () => {
529
+ const e = u.useContext(U);
530
+ if (e == null)
531
+ throw new Error("Modal components must be wrapped in <Modal />");
532
+ return e;
533
+ };
534
+ function ue({
535
+ children: e,
536
+ ...r
537
+ }) {
538
+ const t = he(r);
539
+ return /* @__PURE__ */ i(U.Provider, { value: t, children: e });
540
+ }
541
+ const me = u.forwardRef(function(e, r) {
542
+ const { context: t, ...a } = w(), o = q([a.refs.setFloating, r]);
543
+ if (!t.open)
544
+ return null;
545
+ const { overlayBackground: n, ...c } = e, l = d("grid place-items-center", {
546
+ [`${n}`]: n,
547
+ "bg-black sm:bg-black/[.8]": !n
548
+ });
549
+ return /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(J, { className: l, lockScroll: !0, children: /* @__PURE__ */ i(K, { context: t, children: /* @__PURE__ */ i(
550
+ "div",
551
+ {
552
+ ref: o,
553
+ "aria-labelledby": a.labelId,
554
+ "aria-describedby": a.descriptionId,
555
+ ...a.getFloatingProps(c),
556
+ children: c.children
557
+ }
558
+ ) }) }) });
559
+ }), be = u.forwardRef(function({ children: e, ...r }, t) {
560
+ const { setLabelId: a } = w(), o = P();
561
+ return u.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ i("h1", { ...r, ref: t, id: o, children: e });
562
+ }), fe = u.forwardRef(function({ children: e, ...r }, t) {
563
+ const { setDescriptionId: a } = w(), o = P();
564
+ return u.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ i("div", { ...r, ref: t, id: o, children: e });
565
+ }), pe = u.forwardRef(function(e, r) {
566
+ const { setOpen: t } = w(), { trigger: a, className: o, ...n } = e, c = u.useCallback(() => t(!1), [t]);
567
+ return /* @__PURE__ */ i("div", { className: o, children: u.cloneElement(a, {
568
+ ref: r,
569
+ onClick: c,
570
+ ...n
571
+ }) });
572
+ });
573
+ /*!
574
+ @versini/ui-modal v1.1.0
575
+ © 2024 gizmette.com
576
+ */
577
+ try {
578
+ window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
579
+ version: "1.1.0",
580
+ buildTime: "12/27/2024 07:18 PM EST",
581
+ homepage: "https://github.com/aversini/ui-components",
582
+ license: "MIT"
583
+ });
584
+ } catch {
585
+ }
586
+ const k = "panel", x = "messagebox", ve = ({
498
587
  className: e,
499
588
  kind: r,
500
589
  borderMode: t
501
590
  }) => ({
502
- main: o("prose prose-lighter flex flex-col bg-surface-medium", {
503
- [`${C} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: r === p,
504
- [`${C} w-full sm:w-[95%] md:max-w-2xl`]: r === p && !e,
505
- [`${M} rounded-lg border-2`]: r === x,
506
- [`${M} w-[95%] sm:w-[50%] md:max-w-2xl`]: r === x && !e,
591
+ main: d("prose prose-lighter flex flex-col bg-surface-medium", {
592
+ [`${C} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: r === k,
593
+ [`${C} w-full sm:w-[95%] md:max-w-2xl`]: r === k && !e,
594
+ [`${R} rounded-lg border-2`]: r === x,
595
+ [`${R} w-[95%] sm:w-[50%] md:max-w-2xl`]: r === x && !e,
507
596
  [`${e}`]: !!e,
508
- "sm:border-border-dark": t === "dark" && r === p,
509
- "sm:border-border-accent": t === "light" && r === p,
597
+ "sm:border-border-dark": t === "dark" && r === k,
598
+ "sm:border-border-accent": t === "light" && r === k,
510
599
  "border-border-dark": t === "dark" && r === x,
511
600
  "border-border-accent": t === "light" && r === x
512
601
  }),
@@ -514,49 +603,45 @@ const p = "panel", x = "messagebox", re = ({
514
603
  footer: "flex flex-grow flex-col sm:p-4 p-2",
515
604
  header: "sm:p-4 mb-0 p-2",
516
605
  close: "sm:p-4 p-2"
517
- }), k = (e) => A(
518
- () => import("./chunks/index.DaIz2ggm.js").then((r) => ({
519
- default: r[e]
520
- }))
521
- ), ae = k("Modal"), oe = k("ModalClose"), ie = k("ModalContent"), ne = k("ModalDescription"), le = k("ModalHeading"), ge = ({
606
+ }), we = ({
522
607
  open: e,
523
608
  onOpenChange: r,
524
609
  title: t,
525
610
  children: a,
526
- footer: d,
527
- borderMode: l = "light",
528
- kind: g = p,
529
- className: i
611
+ footer: o,
612
+ borderMode: n = "light",
613
+ kind: c = k,
614
+ className: l
530
615
  }) => {
531
- const h = z(""), s = re({ className: i, kind: g, borderMode: l });
532
- return O(() => (e && (h.current = document.title, document.title = `${t} | ${h.current}`), () => {
616
+ const h = j(""), s = ve({ className: l, kind: c, borderMode: n });
617
+ return F(() => (e && (h.current = document.title, document.title = `${t} | ${h.current}`), () => {
533
618
  e && (document.title = h.current);
534
- }), [t, e]), /* @__PURE__ */ n(j, { fallback: /* @__PURE__ */ n("div", {}), children: e && /* @__PURE__ */ n(ae, { open: e, onOpenChange: r, children: /* @__PURE__ */ y(ie, { className: s.main, children: [
535
- /* @__PURE__ */ y("div", { className: "flex flex-row-reverse items-center justify-between", children: [
536
- /* @__PURE__ */ n(
537
- oe,
619
+ }), [t, e]), /* @__PURE__ */ i(L, { children: e && /* @__PURE__ */ i(ue, { open: e, onOpenChange: r, children: /* @__PURE__ */ _(me, { className: s.main, children: [
620
+ /* @__PURE__ */ _("div", { className: "flex flex-row-reverse items-center justify-between", children: [
621
+ /* @__PURE__ */ i(
622
+ pe,
538
623
  {
539
624
  className: s.close,
540
- trigger: /* @__PURE__ */ n(
541
- L,
625
+ trigger: /* @__PURE__ */ i(
626
+ O,
542
627
  {
543
628
  mode: "dark",
544
629
  focusMode: "light",
545
630
  noBorder: !0,
546
631
  label: "Close",
547
- children: /* @__PURE__ */ n(te, {})
632
+ children: /* @__PURE__ */ i(ge, {})
548
633
  }
549
634
  )
550
635
  }
551
636
  ),
552
- /* @__PURE__ */ n(le, { className: s.header, children: t })
637
+ /* @__PURE__ */ i(be, { className: s.header, children: t })
553
638
  ] }),
554
- /* @__PURE__ */ n(ne, { className: s.content, children: a }),
555
- d && /* @__PURE__ */ n("div", { className: s.footer, children: d })
639
+ /* @__PURE__ */ i(fe, { className: s.content, children: a }),
640
+ o && /* @__PURE__ */ i("div", { className: s.footer, children: o })
556
641
  ] }) }) });
557
642
  };
558
643
  export {
559
- M as MESSAGEBOX_CLASSNAME,
644
+ R as MESSAGEBOX_CLASSNAME,
560
645
  C as PANEL_CLASSNAME,
561
- ge as Panel
646
+ we as Panel
562
647
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -48,5 +48,5 @@
48
48
  "sideEffects": [
49
49
  "**/*.css"
50
50
  ],
51
- "gitHead": "abbb7b1770a9130157721d514fe20267fd15f35e"
51
+ "gitHead": "29ca97023df61f090d2e994c0fee52521a7a7791"
52
52
  }
@@ -1,99 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useFloating as _, useClick as C, useDismiss as E, useRole as x, useInteractions as D, useMergeRefs as O, FloatingPortal as R, FloatingOverlay as k, FloatingFocusManager as y } from "@floating-ui/react";
3
- import F from "clsx";
4
- import * as o from "react";
5
- import { useId as h } from "react";
6
- const I = o.createContext(null);
7
- function L({
8
- initialOpen: n = !1,
9
- open: i,
10
- onOpenChange: t
11
- } = {}) {
12
- const [e, r] = o.useState(n), [s, l] = o.useState(), [c, b] = o.useState(), u = i ?? e, f = t ?? r, p = _({
13
- open: u,
14
- onOpenChange: f
15
- }), m = p.context, M = C(m, {
16
- enabled: i == null
17
- }), w = E(m, {
18
- outsidePress: !1,
19
- outsidePressEvent: "mousedown"
20
- }), v = x(m), g = D([M, w, v]);
21
- return o.useMemo(
22
- () => ({
23
- open: u,
24
- setOpen: f,
25
- ...g,
26
- ...p,
27
- labelId: s,
28
- descriptionId: c,
29
- setLabelId: l,
30
- setDescriptionId: b
31
- }),
32
- [u, f, g, p, s, c]
33
- );
34
- }
35
- const d = () => {
36
- const n = o.useContext(I);
37
- if (n == null)
38
- throw new Error("Modal components must be wrapped in <Modal />");
39
- return n;
40
- };
41
- function T({
42
- children: n,
43
- ...i
44
- }) {
45
- const t = L(i);
46
- return /* @__PURE__ */ a(I.Provider, { value: t, children: n });
47
- }
48
- const A = o.forwardRef(function(n, i) {
49
- const { context: t, ...e } = d(), r = O([e.refs.setFloating, i]);
50
- if (!t.open)
51
- return null;
52
- const { overlayBackground: s, ...l } = n, c = F("grid place-items-center", {
53
- [`${s}`]: s,
54
- "bg-black sm:bg-black/[.8]": !s
55
- });
56
- return /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(k, { className: c, lockScroll: !0, children: /* @__PURE__ */ a(y, { context: t, children: /* @__PURE__ */ a(
57
- "div",
58
- {
59
- ref: r,
60
- "aria-labelledby": e.labelId,
61
- "aria-describedby": e.descriptionId,
62
- ...e.getFloatingProps(l),
63
- children: l.children
64
- }
65
- ) }) }) });
66
- }), U = o.forwardRef(function({ children: n, ...i }, t) {
67
- const { setLabelId: e } = d(), r = h();
68
- return o.useLayoutEffect(() => (e(r), () => e(void 0)), [r, e]), /* @__PURE__ */ a("h1", { ...i, ref: t, id: r, children: n });
69
- }), V = o.forwardRef(function({ children: n, ...i }, t) {
70
- const { setDescriptionId: e } = d(), r = h();
71
- return o.useLayoutEffect(() => (e(r), () => e(void 0)), [r, e]), /* @__PURE__ */ a("div", { ...i, ref: t, id: r, children: n });
72
- }), j = o.forwardRef(function(n, i) {
73
- const { setOpen: t } = d(), { trigger: e, className: r, ...s } = n, l = o.useCallback(() => t(!1), [t]);
74
- return /* @__PURE__ */ a("div", { className: r, children: o.cloneElement(e, {
75
- ref: i,
76
- onClick: l,
77
- ...s
78
- }) });
79
- });
80
- /*!
81
- @versini/ui-modal v1.1.0
82
- © 2024 gizmette.com
83
- */
84
- try {
85
- window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
86
- version: "1.1.0",
87
- buildTime: "12/26/2024 06:05 PM EST",
88
- homepage: "https://github.com/aversini/ui-components",
89
- license: "MIT"
90
- });
91
- } catch {
92
- }
93
- export {
94
- T as Modal,
95
- j as ModalClose,
96
- A as ModalContent,
97
- V as ModalDescription,
98
- U as ModalHeading
99
- };