@versini/ui-bubble 6.0.0 → 6.0.1

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,587 +1,32 @@
1
- import { jsx as c, jsxs as B } from "react/jsx-runtime";
2
- import U, { useRef as N, useLayoutEffect as P, useEffect as M, useState as G, useMemo as W, useCallback as ae } from "react";
3
- import o from "clsx";
4
- const R = "av-bubble", q = "av-button", j = "icon", Y = "button", L = "link", ie = ({
5
- type: e,
6
- size: r,
7
- labelRight: t,
8
- labelLeft: a,
9
- align: i,
10
- animated: l
11
- }) => {
12
- const s = "max-h-8 py-0 px-2", d = "max-h-9 h-8 px-3", u = "max-h-12 py-2 px-4";
13
- switch (e) {
14
- case Y:
15
- case L:
16
- return o({
17
- [s]: r === "small",
18
- [d]: r === "medium",
19
- [u]: r === "large"
20
- });
21
- case j:
22
- return o("flex items-center", {
23
- "justify-center": i === "center",
24
- "justify-start": i === "left",
25
- "justify-end": i === "right",
26
- "h-6 w-6 p-0": r === "small" && !l && !(t || a),
27
- "h-6 px-1 sm:px-2": r === "small" && !l && (t || a),
28
- "h-8 w-8 p-1": r === "medium" && !l && !(t || a),
29
- "h-8 px-3": r === "medium" && !l && (t || a),
30
- "h-12 w-12 p-2": r === "large" && !l && !(t || a),
31
- "h-12 px-4": r === "large" && !l && (t || a),
32
- "h-6 py-0": r === "small" && l && !(t || a),
33
- "h-6": r === "small" && l && (t || a),
34
- "h-8 py-1": r === "medium" && l && !(t || a),
35
- "h-8": r === "medium" && l && (t || a),
36
- "h-12 py-2": r === "large" && l && !(t || a),
37
- "h-12": r === "large" && l && (t || a)
38
- });
39
- }
40
- }, oe = ({
41
- type: e,
42
- size: r,
43
- labelRight: t,
44
- labelLeft: a
45
- }) => {
46
- const i = "text-sm font-medium", l = "text-base font-medium", s = "text-lg font-medium";
47
- switch (e) {
48
- case Y:
49
- case L:
50
- return o({
51
- "text-center": e === L,
52
- [i]: r === "small",
53
- [l]: r === "medium",
54
- [s]: r === "large"
55
- });
56
- case j:
57
- return o({
58
- [i]: r === "small" && (t || a),
59
- [l]: r === "medium" && (t || a),
60
- [s]: r === "large" && (t || a)
61
- });
62
- }
63
- }, le = ({
64
- mode: e,
65
- noBackground: r,
66
- truncate: t,
67
- variant: a
68
- }) => {
69
- if (r)
70
- return "not-prose";
71
- if (a === "primary")
72
- return o("not-prose", {
73
- truncate: t,
74
- "text-copy-dark": e === "dark" || e === "system",
75
- "text-copy-light": e === "light" || e === "alt-system",
76
- "dark:text-copy-light": e === "system",
77
- "dark:text-copy-dark": e === "alt-system"
78
- });
79
- if (a === "secondary")
80
- return o("not-prose", {
81
- truncate: t,
82
- "text-copy-light": e === "dark" || e === "system",
83
- "text-copy-dark": e === "light" || e === "alt-system",
84
- "dark:text-copy-dark": e === "system",
85
- "dark:text-copy-light": e === "alt-system"
86
- });
87
- if (a === "danger")
88
- return o("not-prose", {
89
- truncate: t,
90
- "text-copy-light": e === "dark" || e === "system",
91
- "text-copy-lighter": e === "light" || e === "alt-system",
92
- "dark:text-copy-lighter": e === "system",
93
- "dark:text-copy-light": e === "alt-system"
94
- });
95
- if (a === "selected")
96
- return o("not-prose text-copy-lighter", {
97
- truncate: t
98
- });
99
- }, se = ({
100
- mode: e,
101
- noBackground: r,
102
- variant: t
103
- }) => {
104
- if (!r) {
105
- if (t === "primary")
106
- return o({
107
- "bg-action-light": e === "dark",
108
- "bg-action-dark": e === "light",
109
- "bg-action-light dark:bg-action-dark": e === "system",
110
- "bg-action-dark dark:bg-action-light": e === "alt-system"
111
- });
112
- if (t === "secondary")
113
- return o({
114
- "bg-action-light": e === "light",
115
- "bg-action-dark": e === "dark",
116
- "bg-action-light dark:bg-action-dark": e === "alt-system",
117
- "bg-action-dark dark:bg-action-light": e === "system"
118
- });
119
- if (t === "danger")
120
- return o({
121
- "bg-action-danger-dark": e === "dark",
122
- "bg-action-danger-light": e === "light",
123
- "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
124
- "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
125
- });
126
- if (t === "selected")
127
- return "bg-action-selected-dark";
128
- }
129
- }, ce = ({
130
- radius: e
131
- }) => o({
132
- "rounded-full": e === "large",
133
- "rounded-md": e === "medium",
134
- "rounded-xs": e === "small"
135
- }), ne = ({
136
- mode: e,
137
- disabled: r,
138
- variant: t
139
- }) => {
140
- if (r)
141
- return "";
142
- if (t === "primary")
143
- return o({
144
- "hover:text-copy-dark-hover": e === "dark" || e === "system",
145
- "hover:text-copy-light-hover": e === "light" || e === "alt-system",
146
- "dark:hover:text-copy-light-hover": e === "system",
147
- "dark:hover:text-copy-dark-hover": e === "alt-system",
148
- "hover:bg-action-light-hover": e === "dark",
149
- "hover:bg-action-dark-hover": e === "light",
150
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system",
151
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system"
152
- });
153
- if (t === "secondary")
154
- return o({
155
- "hover:text-copy-light-hover": e === "dark" || e === "system",
156
- "hover:text-copy-dark-hover": e === "light" || e === "alt-system",
157
- "dark:hover:text-copy-dark-hover": e === "system",
158
- "dark:hover:text-copy-light-hover": e === "alt-system",
159
- "hover:bg-action-light-hover": e === "light",
160
- "hover:bg-action-dark-hover": e === "dark",
161
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system",
162
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system"
163
- });
164
- if (t === "danger")
165
- return o("hover:text-copy-light-hover", {
166
- "hover:bg-action-danger-dark-hover": e === "dark",
167
- "hover:bg-action-danger-light-hover": e === "light",
168
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
169
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
170
- });
171
- if (t === "selected")
172
- return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
173
- }, de = ({
174
- mode: e,
175
- disabled: r,
176
- variant: t
177
- }) => {
178
- if (r)
179
- return "";
180
- if (t === "primary")
181
- return o({
182
- "active:text-copy-dark-active": e === "dark" || e === "system",
183
- "active:text-copy-light-active": e === "light" || e === "alt-system",
184
- "dark:active:text-copy-light-active": e === "system",
185
- "dark:active:text-copy-dark-active": e === "alt-system",
186
- "active:bg-action-light-active": e === "dark",
187
- "active:bg-action-dark-active": e === "light",
188
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system",
189
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system"
190
- });
191
- if (t === "secondary")
192
- return o({
193
- "active:text-copy-light-active": e === "dark" || e === "system",
194
- "active:text-copy-dark-active": e === "light" || e === "alt-system",
195
- "dark:active:text-copy-dark-active": e === "system",
196
- "dark:active:text-copy-light-active": e === "alt-system",
197
- "active:bg-action-light-active": e === "light",
198
- "active:bg-action-dark-active": e === "dark",
199
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system",
200
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system"
201
- });
202
- if (t === "danger")
203
- return o("active:text-copy-lighter-active", {
204
- "active:bg-action-danger-dark-active": e === "dark",
205
- "active:bg-action-danger-light-active": e === "light",
206
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
207
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
208
- });
209
- if (t === "selected")
210
- return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
211
- }, ue = ({
212
- mode: e,
213
- noBorder: r,
214
- variant: t
215
- }) => {
216
- if (r)
217
- return "border border-transparent";
218
- if (t === "primary")
219
- return o("border", {
220
- "border-border-medium": e === "dark",
221
- "border-border-accent": e === "light",
222
- "border-border-medium dark:border-border-accent": e === "system",
223
- "border-border-accent dark:border-border-medium": e === "alt-system"
224
- });
225
- if (t === "secondary")
226
- return o("border", {
227
- "border-border-medium": e === "light",
228
- "border-border-accent": e === "dark",
229
- "border-border-medium dark:border-border-accent": e === "alt-system",
230
- "border-border-accent dark:border-border-medium": e === "system"
231
- });
232
- if (t === "danger")
233
- return o("border", {
234
- "border-border-danger-dark": e === "dark",
235
- "border-border-danger-medium": e === "light",
236
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
237
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
238
- });
239
- if (t === "selected")
240
- return "border border-border-selected-dark";
241
- }, me = ({
242
- focusMode: e
243
- }) => o("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
244
- "focus:outline-focus-dark": e === "dark",
245
- "focus:outline-focus-light": e === "light",
246
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
247
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
248
- }), ge = ({
249
- mode: e,
250
- raw: r,
251
- iconClassName: t,
252
- variant: a = "primary"
253
- }) => {
254
- if (r)
255
- return "";
256
- let i = {};
257
- return a === "primary" ? i = {
258
- "text-copy-dark": e === "dark" || e === "system",
259
- "text-copy-light": e === "light" || e === "alt-system",
260
- "dark:text-copy-light": e === "system",
261
- "dark:text-copy-dark": e === "alt-system"
262
- } : a === "secondary" ? i = {
263
- "text-copy-light": e === "dark" || e === "system",
264
- "text-copy-dark": e === "light" || e === "alt-system",
265
- "dark:text-copy-dark": e === "system",
266
- "dark:text-copy-light": e === "alt-system"
267
- } : a === "danger" ? i = {
268
- "text-copy-light": e === "dark" || e === "system",
269
- "text-copy-lighter": e === "light" || e === "alt-system",
270
- "dark:text-copy-lighter": e === "system",
271
- "dark:text-copy-light": e === "alt-system"
272
- } : a === "selected" && (i = {
273
- "text-copy-lighter": !0
274
- }), o(i, t);
275
- }, be = ({
276
- animated: e
277
- }) => o({
278
- "transition-opacity duration-300 ease-in-out": e
279
- }), he = ({
280
- type: e,
281
- className: r,
282
- raw: t,
283
- mode: a,
284
- focusMode: i,
285
- disabled: l,
286
- fullWidth: s,
287
- size: d,
288
- noBorder: u,
289
- labelRight: y,
290
- labelLeft: k,
291
- noBackground: n,
292
- variant: m,
293
- truncate: g,
294
- align: _,
295
- radius: I,
296
- animated: b
297
- }) => (m || (m = "primary"), t ? o(q, r) : o(
298
- q,
299
- le({
300
- mode: a,
301
- variant: m,
302
- noBackground: n,
303
- truncate: g
304
- }),
305
- se({ mode: a, noBackground: n, variant: m }),
306
- ce({ radius: I }),
307
- ie({
308
- type: e,
309
- size: d,
310
- labelRight: y,
311
- labelLeft: k,
312
- align: _,
313
- animated: b
314
- }),
315
- oe({ type: e, size: d, labelRight: y, labelLeft: k }),
316
- ue({ mode: a, variant: m, noBorder: u }),
317
- me({ focusMode: i }),
318
- ne({ mode: a, variant: m, disabled: l }),
319
- de({ mode: a, variant: m, disabled: l }),
320
- {
321
- "w-full": s,
322
- "disabled:cursor-not-allowed disabled:opacity-50": l
323
- },
324
- o({
325
- "transition-[width] duration-300 ease-in": b
326
- }),
327
- r
328
- )), fe = (e, r, t) => {
329
- !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof e?.currentTarget?.focus == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
330
- }, J = U.forwardRef((e, r) => {
331
- const { onClick: t, noInternalClick: a = !1, ...i } = e;
332
- return /* @__PURE__ */ c(
333
- "button",
334
- {
335
- ref: r,
336
- onClick: (l) => {
337
- fe(l, a, t);
338
- },
339
- ...i
340
- }
341
- );
342
- });
343
- J.displayName = "BaseButton";
344
- function ye() {
345
- const e = N(!1);
346
- return M(() => (e.current = !0, () => {
347
- e.current = !1;
348
- }), []), ae(() => e.current, []);
349
- }
350
- function ve(e) {
351
- return W(() => e.every((r) => r == null) ? () => {
352
- } : (r) => {
353
- e.forEach((t) => {
354
- typeof t == "function" ? t(r) : t != null && (t.current = r);
355
- });
356
- }, [...e]);
357
- }
358
- const pe = {
359
- x: 0,
360
- y: 0,
361
- width: 0,
362
- height: 0,
363
- top: 0,
364
- left: 0,
365
- bottom: 0,
366
- right: 0
367
- };
368
- function O(e) {
369
- const r = ye(), t = N(0), a = N(null), [i, l] = G(pe), s = W(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
370
- const u = d[0];
371
- u && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
372
- a.current && r() && l(u.contentRect);
373
- }));
374
- }), [r]);
375
- return M(() => (a.current && s?.observe(a.current, e), () => {
376
- s?.disconnect(), t.current && cancelAnimationFrame(t.current);
377
- }), [s, e]), [a, i];
378
- }
379
- const z = {
380
- small: 24,
381
- // w-6
382
- medium: 32,
383
- // w-8
384
- large: 48
385
- // w-12
386
- }, ke = {
387
- small: 16,
388
- // px-2 x 2
389
- medium: 24,
390
- // px-3 x 2
391
- large: 32
392
- // px-4 x 2
393
- }, xe = 2, we = 300, A = U.forwardRef(
394
- ({
395
- children: e,
396
- disabled: r = !1,
397
- mode: t = "system",
398
- focusMode: a = "system",
399
- fullWidth: i = !1,
400
- className: l,
401
- type: s = "button",
402
- raw: d = !1,
403
- noBorder: u = !1,
404
- "aria-label": y,
405
- label: k,
406
- size: n = "medium",
407
- labelRight: m,
408
- labelLeft: g,
409
- noBackground: _ = !1,
410
- align: I = "center",
411
- radius: b = "large",
412
- variant: C = "secondary",
413
- iconClassName: T,
414
- animated: v = !1,
415
- ...Q
416
- }, X) => {
417
- const Z = he({
418
- type: j,
419
- mode: t,
420
- focusMode: a,
421
- fullWidth: i,
422
- disabled: r,
423
- raw: d,
424
- className: l,
425
- noBorder: u,
426
- size: n,
427
- labelRight: m,
428
- labelLeft: g,
429
- noBackground: _,
430
- align: I,
431
- radius: b,
432
- variant: C,
433
- animated: v
434
- }), ee = ge({ mode: t, raw: d, iconClassName: T, variant: C }), H = be({ animated: v }), te = "flex items-center justify-center relative w-full h-full overflow-hidden", [h, $] = O(), [f, S] = O(), [E, F] = O(), V = N(0), p = N(null), x = N(null), re = ve([X, p]);
435
- return P(() => {
436
- E && E.current && v && (V.current = F.width + ke[n] + (u ? 0 : xe), p.current && !p.current.style.width && (p.current.style.width = `${z[n]}px`));
437
- }, [F, E, n, u, v]), P(() => {
438
- if (p && p.current && v) {
439
- let w = z[n];
440
- m && h && $.width > 0 ? w = $.width + V.current : g && f && S.width > 0 && (w = S.width + V.current), x.current && clearTimeout(x.current), w !== parseInt(p.current.style.width || "0", 10) && (h.current && (h.current.style.opacity = "0"), f.current && (f.current.style.opacity = "0"), p.current.style.width = `${w}px`, w > z[n] && (x.current = setTimeout(() => {
441
- h.current && m && (h.current.style.opacity = "1"), f.current && g && (f.current.style.opacity = "1"), x.current = null;
442
- }, we * 0.8))), w === z[n] && (h.current && (h.current.style.opacity = "0"), f.current && (f.current.style.opacity = "0"));
443
- }
444
- }, [
445
- $,
446
- m,
447
- h,
448
- S,
449
- g,
450
- f,
451
- n,
452
- v
453
- ]), M(() => () => {
454
- x.current && clearTimeout(x.current);
455
- }, []), /* @__PURE__ */ c(
456
- J,
457
- {
458
- ref: re,
459
- className: Z,
460
- disabled: r,
461
- type: s,
462
- "aria-label": y || k,
463
- ...Q,
464
- children: /* @__PURE__ */ B("div", { className: te, children: [
465
- /* @__PURE__ */ c(
466
- D,
467
- {
468
- label: g,
469
- labelRef: f,
470
- labelClass: H,
471
- labelInnerClass: "pr-2",
472
- initiallyHidden: v
473
- }
474
- ),
475
- /* @__PURE__ */ c("span", { ref: E, className: ee, children: e }),
476
- /* @__PURE__ */ c(
477
- D,
478
- {
479
- label: m,
480
- labelRef: h,
481
- labelClass: H,
482
- labelInnerClass: "pl-2",
483
- initiallyHidden: v
484
- }
485
- )
486
- ] })
487
- }
488
- );
489
- }
490
- ), D = ({
491
- labelRef: e,
492
- labelClass: r,
493
- label: t,
494
- labelInnerClass: a,
495
- initiallyHidden: i = !1
496
- }) => /* @__PURE__ */ c(
497
- "span",
498
- {
499
- ref: e,
500
- className: r,
501
- style: i ? { opacity: 0 } : void 0,
502
- children: t && /* @__PURE__ */ c("span", { className: a, children: t })
503
- }
504
- );
505
- A.displayName = "ButtonIcon";
506
- /*!
507
- @versini/ui-button v8.0.0
508
- © 2025 gizmette.com
509
- */
510
- try {
511
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
512
- version: "8.0.0",
513
- buildTime: "09/01/2025 03:17 PM EDT",
514
- homepage: "https://github.com/aversini/ui-components",
515
- license: "MIT"
516
- });
517
- } catch {
518
- }
519
- const Be = U.forwardRef(
520
- ({
521
- children: e,
522
- mode: r = "system",
523
- className: t,
524
- active: a = !1,
525
- ...i
526
- }, l) => {
527
- const s = a ? o(
528
- "relative",
529
- "focus-within:static",
530
- "focus-within:after:border-transparent",
531
- "after:absolute",
532
- "after:content-['']",
533
- "after:border-b-2",
534
- "after:bottom-[-4px]",
535
- "after:left-0",
536
- "after:right-0",
537
- {
538
- "after:border-table-dark": r === "dark",
539
- "after:border-table-light": r === "light",
540
- "after:border-table-dark dark:after:border-table-light": r === "system",
541
- "after:border-table-light dark:after:border-table-dark": r === "alt-system"
542
- }
543
- ) : "";
544
- return /* @__PURE__ */ c("div", { className: s, children: /* @__PURE__ */ c(
545
- A,
546
- {
547
- className: t,
548
- ref: l,
549
- mode: r,
550
- radius: "small",
551
- size: "small",
552
- align: "center",
553
- ...i,
554
- children: e
555
- }
556
- ) });
557
- }
558
- );
559
- Be.displayName = "ButtonSort";
560
- const K = ({
1
+ import { jsxs as d, jsx as s } from "react/jsx-runtime";
2
+ import { ButtonIcon as I } from "@versini/ui-button";
3
+ import { useState as y, useEffect as C } from "react";
4
+ import c from "clsx";
5
+ const p = "av-bubble", v = ({
561
6
  children: e,
562
- fill: r,
563
- viewBox: t,
564
- className: a,
565
- defaultViewBox: i,
566
- size: l,
567
- title: s,
568
- semantic: d = !1,
569
- ...u
7
+ fill: t,
8
+ viewBox: o,
9
+ className: i,
10
+ defaultViewBox: r,
11
+ size: n,
12
+ title: l,
13
+ semantic: b = !1,
14
+ ...f
570
15
  }) => {
571
- const y = o(l, a);
572
- return /* @__PURE__ */ B(
16
+ const h = c(n, i);
17
+ return /* @__PURE__ */ d(
573
18
  "svg",
574
19
  {
575
20
  xmlns: "http://www.w3.org/2000/svg",
576
- className: y,
577
- viewBox: t || i,
578
- fill: r || "currentColor",
21
+ className: h,
22
+ viewBox: o || r,
23
+ fill: t || "currentColor",
579
24
  role: "img",
580
- "aria-hidden": !d,
25
+ "aria-hidden": !b,
581
26
  focusable: !1,
582
- ...u,
27
+ ...f,
583
28
  children: [
584
- s && d && /* @__PURE__ */ c("title", { children: s }),
29
+ l && b && /* @__PURE__ */ s("title", { children: l }),
585
30
  e
586
31
  ]
587
32
  }
@@ -600,48 +45,48 @@ try {
600
45
  });
601
46
  } catch {
602
47
  }
603
- const Ne = ({
48
+ const E = ({
604
49
  className: e,
605
- viewBox: r,
606
- title: t,
607
- monotone: a,
608
- ...i
609
- }) => /* @__PURE__ */ B(
610
- K,
50
+ viewBox: t,
51
+ title: o,
52
+ monotone: i,
53
+ ...r
54
+ }) => /* @__PURE__ */ d(
55
+ v,
611
56
  {
612
57
  defaultViewBox: "0 0 448 512",
613
58
  size: "size-5",
614
- viewBox: r,
59
+ viewBox: t,
615
60
  className: e,
616
- title: t || "Copied",
617
- ...i,
61
+ title: o || "Copied",
62
+ ...r,
618
63
  children: [
619
- /* @__PURE__ */ c(
64
+ /* @__PURE__ */ s(
620
65
  "path",
621
66
  {
622
67
  d: "M0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96m104 160c0-6.1 2.3-12.3 7-17 9.4-9.4 24.6-9.4 33.9 0l47 47 111-111c4.7-4.7 10.8-7 17-7s12.3 2.3 17 7c2.3 2.3 4.1 5 5.3 7.9.6 1.5 1 2.9 1.3 4.4.2 1.1.3 2.2.3 2.2.1 1.2.1 1.2.1 2.5-.1 1.5-.1 1.9-.1 2.3-.1.7-.2 1.5-.3 2.2-.3 1.5-.7 3-1.3 4.4-1.2 2.9-2.9 5.6-5.3 7.9l-128 128c-4.7 4.7-10.8 7-17 7s-12.3-2.3-17-7l-64-64c-4.7-4.7-7-10.8-7-17z",
623
68
  opacity: ".4"
624
69
  }
625
70
  ),
626
- /* @__PURE__ */ c("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
71
+ /* @__PURE__ */ s("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
627
72
  ]
628
73
  }
629
- ), _e = ({
74
+ ), V = ({
630
75
  className: e,
631
- viewBox: r,
632
- title: t,
633
- monotone: a,
634
- ...i
635
- }) => /* @__PURE__ */ c(
636
- K,
76
+ viewBox: t,
77
+ title: o,
78
+ monotone: i,
79
+ ...r
80
+ }) => /* @__PURE__ */ s(
81
+ v,
637
82
  {
638
83
  defaultViewBox: "0 0 512 512",
639
84
  size: "size-5",
640
- viewBox: r,
85
+ viewBox: t,
641
86
  className: e,
642
- title: t || "Copy",
643
- ...i,
644
- children: /* @__PURE__ */ c("path", { d: "M64 464h224c8.8 0 16-7.2 16-16v-64h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16v224c0 8.8 7.2 16 16 16m160-160h224c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16v224c0 8.8 7.2 16 16 16m-64-16V64c0-35.3 28.7-64 64-64h224c35.3 0 64 28.7 64 64v224c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64" })
87
+ title: o || "Copy",
88
+ ...r,
89
+ children: /* @__PURE__ */ s("path", { d: "M64 464h224c8.8 0 16-7.2 16-16v-64h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16v224c0 8.8 7.2 16 16 16m160-160h224c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16v224c0 8.8 7.2 16 16 16m-64-16V64c0-35.3 28.7-64 64-64h224c35.3 0 64 28.7 64 64v224c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64" })
645
90
  }
646
91
  );
647
92
  /*!
@@ -657,23 +102,23 @@ try {
657
102
  });
658
103
  } catch {
659
104
  }
660
- const Ie = ({ kind: e, noMaxWidth: r }) => o("px-4 py-2", {
661
- "max-w-xs sm:max-w-md md:max-w-2xl": !r,
662
- "lg:max-w-3xl": e === "left" && !r
663
- }), Ce = ({ kind: e }) => o({
105
+ const z = ({ kind: e, noMaxWidth: t }) => c("px-4 py-2", {
106
+ "max-w-xs sm:max-w-md md:max-w-2xl": !t,
107
+ "lg:max-w-3xl": e === "left" && !t
108
+ }), S = ({ kind: e }) => c({
664
109
  "bg-surface-lighter dark:bg-surface-dark": e === "left",
665
110
  "bg-surface-accent": e === "right"
666
- }), Te = ({ kind: e }) => o(
111
+ }), T = ({ kind: e }) => c(
667
112
  "prose prose-dark dark:prose-lighter",
668
113
  "prose-blockquote:my-1",
669
114
  "prose-ol:my-1 prose-ul:my-1",
670
115
  {
671
116
  "text-copy-lighter": e === "right"
672
117
  }
673
- ), Ee = ({ kind: e, tail: r }) => {
674
- if (r)
675
- return o(
676
- `${R}-${e}-tail`,
118
+ ), M = ({ kind: e, tail: t }) => {
119
+ if (t)
120
+ return c(
121
+ `${p}-${e}-tail`,
677
122
  "rounded-3xl",
678
123
  "relative",
679
124
  "before:content-['']",
@@ -686,106 +131,106 @@ const Ie = ({ kind: e, noMaxWidth: r }) => o("px-4 py-2", {
686
131
  "last-bubble-left:before:left-[2px] last-bubble-left:before:border-r-[8px] last-bubble-left:before:border-r-surface-lighter last-bubble-left:dark:before:border-r-surface-dark last-bubble-left:before:rounded-br-[100%]": e === "left"
687
132
  }
688
133
  );
689
- if (!r)
690
- return o("rounded-b-xl", {
134
+ if (!t)
135
+ return c("rounded-b-xl", {
691
136
  "rounded-tr-xl": e === "left",
692
137
  "rounded-tl-xl": e === "right"
693
138
  });
694
- }, ze = ({
139
+ }, O = ({
695
140
  kind: e,
696
- className: r,
697
- contentClassName: t,
698
- noMaxWidth: a,
699
- tail: i
141
+ className: t,
142
+ contentClassName: o,
143
+ noMaxWidth: i,
144
+ tail: r
700
145
  }) => {
701
- const l = o(
702
- R,
703
- `${R}-${e}`,
146
+ const n = c(
147
+ p,
148
+ `${p}-${e}`,
704
149
  "flex items-start",
705
150
  {
706
151
  "flex-row-reverse": e === "right"
707
152
  },
708
- r
709
- ), s = o(
710
- `${R}-content`,
711
- "flex flex-col empty:hidden",
712
- Ie({ kind: e, noMaxWidth: a }),
713
- Te({ kind: e }),
714
- Ce({ kind: e }),
715
- Ee({ kind: e, tail: i }),
716
153
  t
717
- ), d = "pr-2 pt-1 text-end text-xs text-copy-light", u = o("flex flex-col-reverse sm:flex-row", {
718
- "ml-2": e === "left" && !i,
719
- "mr-2": e === "right" && !i,
720
- "ml-1": e === "left" && i,
721
- "mr-1": e === "right" && i
154
+ ), l = c(
155
+ `${p}-content`,
156
+ "flex flex-col empty:hidden",
157
+ z({ kind: e, noMaxWidth: i }),
158
+ T({ kind: e }),
159
+ S({ kind: e }),
160
+ M({ kind: e, tail: r }),
161
+ o
162
+ ), b = "pr-2 pt-1 text-end text-xs text-copy-light", f = c("flex flex-col-reverse sm:flex-row", {
163
+ "ml-2": e === "left" && !r,
164
+ "mr-2": e === "right" && !r,
165
+ "ml-1": e === "left" && r,
166
+ "mr-1": e === "right" && r
722
167
  });
723
168
  return {
724
- wrapper: l,
725
- main: s,
726
- footer: d,
727
- copyButton: u
169
+ wrapper: n,
170
+ main: l,
171
+ footer: b,
172
+ copyButton: f
728
173
  };
729
- }, Re = "FOOTER_EMPTY", Ve = ({
174
+ }, $ = "FOOTER_EMPTY", A = ({
730
175
  children: e,
731
- kind: r = "left",
732
- className: t,
733
- contentClassName: a,
734
- footer: i,
735
- rawFooter: l,
736
- copyToClipboard: s,
737
- copyToClipboardFocusMode: d = "system",
738
- copyToClipboardMode: u = "system",
739
- noMaxWidth: y = !1,
740
- tail: k = !1
176
+ kind: t = "left",
177
+ className: o,
178
+ contentClassName: i,
179
+ footer: r,
180
+ rawFooter: n,
181
+ copyToClipboard: l,
182
+ copyToClipboardFocusMode: b = "system",
183
+ copyToClipboardMode: f = "system",
184
+ noMaxWidth: h = !1,
185
+ tail: B = !1
741
186
  }) => {
742
- const [n, m] = G(!1), g = ze({
743
- kind: r,
744
- className: t,
745
- contentClassName: a,
746
- noMaxWidth: y,
747
- tail: k
748
- }), _ = !!s && (typeof s == "function" || typeof s == "string" || typeof e == "string"), I = () => {
749
- m(!0), typeof s == "function" ? s(e) : typeof s == "string" ? navigator.clipboard.writeText(s) : typeof e == "string" && navigator.clipboard.writeText(e);
187
+ const [u, x] = y(!1), m = O({
188
+ kind: t,
189
+ className: o,
190
+ contentClassName: i,
191
+ noMaxWidth: h,
192
+ tail: B
193
+ }), _ = !!l && (typeof l == "function" || typeof l == "string" || typeof e == "string"), N = () => {
194
+ x(!0), typeof l == "function" ? l(e) : typeof l == "string" ? navigator.clipboard.writeText(l) : typeof e == "string" && navigator.clipboard.writeText(e);
750
195
  };
751
- return M(() => {
752
- let b;
753
- return n && (b = window.setTimeout(() => {
754
- m(!1);
196
+ return C(() => {
197
+ let a;
198
+ return u && (a = window.setTimeout(() => {
199
+ x(!1);
755
200
  }, 3e3)), () => {
756
- clearTimeout(b);
201
+ clearTimeout(a);
757
202
  };
758
- }, [n]), /* @__PURE__ */ B("div", { className: g.wrapper, children: [
759
- /* @__PURE__ */ B("div", { children: [
760
- /* @__PURE__ */ c("div", { className: g.main, children: e }),
761
- i && Object.keys(i).map((b, C) => {
762
- const T = i[b];
763
- return T === Re ? /* @__PURE__ */ c("div", { className: "prose-p:m-0", children: /* @__PURE__ */ c("p", { className: g.footer, "aria-hidden": "true", children: /* @__PURE__ */ c("span", { className: "invisible", children: " " }) }) }, `${b}-${C}`) : T ? /* @__PURE__ */ c("div", { className: "prose-p:m-0", children: /* @__PURE__ */ B("p", { className: g.footer, children: [
764
- b,
203
+ }, [u]), /* @__PURE__ */ d("div", { className: m.wrapper, children: [
204
+ /* @__PURE__ */ d("div", { children: [
205
+ /* @__PURE__ */ s("div", { className: m.main, children: e }),
206
+ r && Object.keys(r).map((a, w) => {
207
+ const g = r[a];
208
+ return g === $ ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */ s("p", { className: m.footer, "aria-hidden": "true", children: /* @__PURE__ */ s("span", { className: "invisible", children: " " }) }) }, `${a}-${w}`) : g ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */ d("p", { className: m.footer, children: [
209
+ a,
765
210
  ": ",
766
- T
767
- ] }) }, `${b}-${C}`) : null;
211
+ g
212
+ ] }) }, `${a}-${w}`) : null;
768
213
  }),
769
- l && l
214
+ n && n
770
215
  ] }),
771
- _ && /* @__PURE__ */ c("div", { className: g.copyButton, children: /* @__PURE__ */ c(
772
- A,
216
+ _ && /* @__PURE__ */ s("div", { className: m.copyButton, children: /* @__PURE__ */ s(
217
+ I,
773
218
  {
774
219
  noBorder: !0,
775
220
  noBackground: !0,
776
221
  size: "small",
777
- mode: u,
778
- focusMode: d,
779
- label: n ? "Copied to clipboard" : "Copy to clipboard",
780
- onClick: I,
781
- disabled: n,
782
- children: n ? /* @__PURE__ */ c(Ne, { size: "size-3" }) : /* @__PURE__ */ c(_e, { size: "size-3" })
222
+ mode: f,
223
+ focusMode: b,
224
+ label: u ? "Copied to clipboard" : "Copy to clipboard",
225
+ onClick: N,
226
+ disabled: u,
227
+ children: u ? /* @__PURE__ */ s(E, { size: "size-3" }) : /* @__PURE__ */ s(V, { size: "size-3" })
783
228
  }
784
229
  ) })
785
230
  ] });
786
231
  };
787
232
  export {
788
- R as BUBBLE_CLASSNAME,
789
- Re as BUBBLE_FOOTER_EMPTY,
790
- Ve as Bubble
233
+ p as BUBBLE_CLASSNAME,
234
+ $ as BUBBLE_FOOTER_EMPTY,
235
+ A as Bubble
791
236
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { BUBBLE_CLASSNAME as i, BUBBLE_FOOTER_EMPTY as o, Bubble as E } from "./components/Bubble/Bubble.js";
2
2
  /*!
3
- @versini/ui-bubble v6.0.0
3
+ @versini/ui-bubble v6.0.1
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_BUBBLE__ || (window.__VERSINI_UI_BUBBLE__ = {
8
- version: "6.0.0",
9
- buildTime: "09/01/2025 03:19 PM EDT",
8
+ version: "6.0.1",
9
+ buildTime: "09/01/2025 04:02 PM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-bubble",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -37,16 +37,16 @@
37
37
  "test": "vitest run"
38
38
  },
39
39
  "peerDependencies": {
40
- "react": "^19.0.0",
41
- "react-dom": "^19.0.0"
40
+ "react": "^19.1.0",
41
+ "react-dom": "^19.1.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/jest-dom": "6.8.0",
45
- "@versini/ui-types": "6.0.0"
45
+ "@versini/ui-types": "6.0.1"
46
46
  },
47
47
  "dependencies": {
48
48
  "@tailwindcss/typography": "0.5.16",
49
- "@versini/ui-button": "8.0.0",
49
+ "@versini/ui-button": "8.0.1",
50
50
  "@versini/ui-icons": "4.11.0",
51
51
  "clsx": "2.1.1",
52
52
  "tailwindcss": "4.1.12"
@@ -54,5 +54,5 @@
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "70a47e9e30172dbb7b36306773fe9511e437fba6"
57
+ "gitHead": "dcc216644c8c3e7d43a49ea655a22aed21fa4b83"
58
58
  }