@versini/ui-bubble 4.0.4 → 4.0.6

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,6 +1,737 @@
1
- import "react/jsx-runtime";
2
- import { Bubble as t } from "../../index.js";
3
- import "react";
1
+ import { jsx as s, jsxs as x, Fragment as Y } from "react/jsx-runtime";
2
+ import S, { useRef as N, useLayoutEffect as $, useState as q, useMemo as D, useEffect as V, useCallback as ee } from "react";
3
+ import o from "clsx";
4
+ const I = "av-bubble", A = "av-button", L = "icon", F = "button", M = "link", te = ({
5
+ type: e,
6
+ size: r,
7
+ labelRight: t,
8
+ labelLeft: a,
9
+ align: l,
10
+ animated: i
11
+ }) => {
12
+ const n = "max-h-8 py-0 px-2", c = "max-h-9 h-8 px-3", d = "max-h-12 py-2 px-4";
13
+ switch (e) {
14
+ case F:
15
+ case M:
16
+ return o({
17
+ [n]: r === "small",
18
+ [c]: r === "medium",
19
+ [d]: r === "large"
20
+ });
21
+ case L:
22
+ return o("flex items-center", {
23
+ "justify-center": l === "center",
24
+ "justify-start": l === "left",
25
+ "justify-end": l === "right",
26
+ "h-6 w-6 p-0": r === "small" && !i && !(t || a),
27
+ "h-6 px-2": r === "small" && !i && (t || a),
28
+ "h-8 w-8 p-1": r === "medium" && !i && !(t || a),
29
+ "h-8 px-3": r === "medium" && !i && (t || a),
30
+ "h-12 w-12 p-2": r === "large" && !i && !(t || a),
31
+ "h-12 px-4": r === "large" && !i && (t || a),
32
+ "h-6 py-0": r === "small" && i && !(t || a),
33
+ "h-6": r === "small" && i && (t || a),
34
+ "h-8 py-1": r === "medium" && i && !(t || a),
35
+ "h-8": r === "medium" && i && (t || a),
36
+ "h-12 py-2": r === "large" && i && !(t || a),
37
+ "h-12": r === "large" && i && (t || a)
38
+ });
39
+ }
40
+ }, re = ({
41
+ type: e,
42
+ size: r,
43
+ labelRight: t,
44
+ labelLeft: a
45
+ }) => {
46
+ const l = "text-sm font-medium", i = "text-base font-medium", n = "text-lg font-medium";
47
+ switch (e) {
48
+ case F:
49
+ case M:
50
+ return o({
51
+ "text-center": e === M,
52
+ [l]: r === "small",
53
+ [i]: r === "medium",
54
+ [n]: r === "large"
55
+ });
56
+ case L:
57
+ return o({
58
+ [l]: r === "small" && (t || a),
59
+ [i]: r === "medium" && (t || a),
60
+ [n]: r === "large" && (t || a)
61
+ });
62
+ }
63
+ }, ae = ({
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-light": e === "dark" || e === "system",
75
+ "text-copy-lighter": e === "light" || e === "alt-system",
76
+ "dark:text-copy-lighter": e === "system",
77
+ "dark:text-copy-light": e === "alt-system"
78
+ });
79
+ if (a === "secondary")
80
+ return o("not-prose", {
81
+ truncate: t,
82
+ "text-copy-light": e === "light" || e === "system",
83
+ "text-copy-lighter": e === "dark" || e === "alt-system",
84
+ "dark:text-copy-lighter": e === "alt-system",
85
+ "dark:text-copy-light": e === "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
+ }, oe = ({
100
+ mode: e,
101
+ noBackground: r,
102
+ variant: t
103
+ }) => {
104
+ if (!r) {
105
+ if (t === "primary")
106
+ return o({
107
+ "bg-action-dark": e === "dark",
108
+ "bg-action-light": e === "light",
109
+ "bg-action-dark dark:bg-action-light": e === "system",
110
+ "bg-action-light dark:bg-action-dark": e === "alt-system"
111
+ });
112
+ if (t === "secondary")
113
+ return o({
114
+ "bg-action-dark": e === "light",
115
+ "bg-action-light": e === "dark",
116
+ "bg-action-dark dark:bg-action-light": e === "alt-system",
117
+ "bg-action-light dark:bg-action-dark": 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
+ }, ie = ({
130
+ radius: e
131
+ }) => o({
132
+ "rounded-full": e === "large",
133
+ "rounded-md": e === "medium",
134
+ "rounded-xs": e === "small"
135
+ }), le = ({
136
+ mode: e,
137
+ disabled: r,
138
+ variant: t
139
+ }) => {
140
+ if (r)
141
+ return "";
142
+ if (t === "primary")
143
+ return o("hover:text-copy-light-hover", {
144
+ "hover:bg-action-dark-hover": e === "dark",
145
+ "hover:bg-action-light-hover": e === "light",
146
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
147
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
148
+ });
149
+ if (t === "secondary")
150
+ return o("hover:text-copy-light-hover", {
151
+ "hover:bg-action-dark-hover": e === "light",
152
+ "hover:bg-action-light-hover": e === "dark",
153
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
154
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
155
+ });
156
+ if (t === "danger")
157
+ return o("hover:text-copy-light-hover", {
158
+ "hover:bg-action-danger-dark-hover": e === "dark",
159
+ "hover:bg-action-danger-light-hover": e === "light",
160
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
161
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
162
+ });
163
+ if (t === "selected")
164
+ return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
165
+ }, ne = ({
166
+ mode: e,
167
+ disabled: r,
168
+ variant: t
169
+ }) => {
170
+ if (r)
171
+ return "";
172
+ if (t === "primary")
173
+ return o("active:text-copy-light-active", {
174
+ "active:bg-action-dark-active": e === "dark",
175
+ "active:bg-action-light-active": e === "light",
176
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
177
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
178
+ });
179
+ if (t === "secondary")
180
+ return o("active:text-copy-light-active", {
181
+ "active:bg-action-dark-active": e === "light",
182
+ "active:bg-action-light-active": e === "dark",
183
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
184
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
185
+ });
186
+ if (t === "danger")
187
+ return o("active:text-copy-lighter-active", {
188
+ "active:bg-action-danger-dark-active": e === "dark",
189
+ "active:bg-action-danger-light-active": e === "light",
190
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
191
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
192
+ });
193
+ if (t === "selected")
194
+ return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
195
+ }, se = ({
196
+ mode: e,
197
+ noBorder: r,
198
+ variant: t
199
+ }) => {
200
+ if (r)
201
+ return "border border-transparent";
202
+ if (t === "primary")
203
+ return o("border", {
204
+ "border-border-dark": e === "dark",
205
+ "border-border-accent": e === "light",
206
+ "border-border-dark dark:border-border-accent": e === "system",
207
+ "border-border-accent dark:border-border-dark": e === "alt-system"
208
+ });
209
+ if (t === "secondary")
210
+ return o("border", {
211
+ "border-border-dark": e === "light",
212
+ "border-border-accent": e === "dark",
213
+ "border-border-dark dark:border-border-accent": e === "alt-system",
214
+ "border-border-accent dark:border-border-dark": e === "system"
215
+ });
216
+ if (t === "danger")
217
+ return o("border", {
218
+ "border-border-danger-dark": e === "dark",
219
+ "border-border-danger-medium": e === "light",
220
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
221
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
222
+ });
223
+ if (t === "selected")
224
+ return "border border-border-selected-dark";
225
+ }, ce = ({
226
+ focusMode: e
227
+ }) => o("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
228
+ "focus:outline-focus-dark": e === "dark",
229
+ "focus:outline-focus-light": e === "light",
230
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
231
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
232
+ }), de = ({
233
+ mode: e,
234
+ raw: r,
235
+ iconClassName: t
236
+ }) => r ? "" : o(
237
+ {
238
+ "text-copy-accent-dark": e === "light" || e === "alt-system",
239
+ "text-copy-light": e === "dark" || e === "system",
240
+ "dark:text-copy-light": e === "alt-system",
241
+ "dark:text-copy-accent-dark": e === "system"
242
+ },
243
+ t
244
+ ), be = ({
245
+ animated: e
246
+ }) => o({
247
+ "transition-opacity duration-300 ease-in": e
248
+ }), ue = ({
249
+ type: e,
250
+ className: r,
251
+ raw: t,
252
+ mode: a,
253
+ focusMode: l,
254
+ disabled: i,
255
+ fullWidth: n,
256
+ size: c,
257
+ noBorder: d,
258
+ labelRight: h,
259
+ labelLeft: v,
260
+ noBackground: u,
261
+ variant: b,
262
+ truncate: m,
263
+ align: w,
264
+ radius: B,
265
+ animated: g
266
+ }) => (b || (b = "primary"), t ? o(A, r) : o(
267
+ A,
268
+ ae({
269
+ mode: a,
270
+ variant: b,
271
+ noBackground: u,
272
+ truncate: m
273
+ }),
274
+ oe({ mode: a, noBackground: u, variant: b }),
275
+ ie({ radius: B }),
276
+ te({
277
+ type: e,
278
+ size: c,
279
+ labelRight: h,
280
+ labelLeft: v,
281
+ align: w,
282
+ animated: g
283
+ }),
284
+ re({ type: e, size: c, labelRight: h, labelLeft: v }),
285
+ se({ mode: a, variant: b, noBorder: d }),
286
+ ce({ focusMode: l }),
287
+ le({ mode: a, variant: b, disabled: i }),
288
+ ne({ mode: a, variant: b, disabled: i }),
289
+ {
290
+ "w-full": n,
291
+ "disabled:cursor-not-allowed disabled:opacity-50": i
292
+ },
293
+ o({
294
+ "transition-[width] duration-300 ease-in-out": g
295
+ }),
296
+ r
297
+ )), ge = (e, r, t) => {
298
+ var a;
299
+ !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);
300
+ }, P = S.forwardRef((e, r) => {
301
+ const { onClick: t, noInternalClick: a = !1, ...l } = e;
302
+ return /* @__PURE__ */ s(
303
+ "button",
304
+ {
305
+ ref: r,
306
+ onClick: (i) => {
307
+ ge(i, a, t);
308
+ },
309
+ ...l
310
+ }
311
+ );
312
+ });
313
+ P.displayName = "BaseButton";
314
+ function me() {
315
+ const e = N(!1);
316
+ return V(() => (e.current = !0, () => {
317
+ e.current = !1;
318
+ }), []), ee(() => e.current, []);
319
+ }
320
+ function he(e) {
321
+ return D(() => e.every((r) => r == null) ? () => {
322
+ } : (r) => {
323
+ e.forEach((t) => {
324
+ typeof t == "function" ? t(r) : t != null && (t.current = r);
325
+ });
326
+ }, e);
327
+ }
328
+ const fe = {
329
+ x: 0,
330
+ y: 0,
331
+ width: 0,
332
+ height: 0,
333
+ top: 0,
334
+ left: 0,
335
+ bottom: 0,
336
+ right: 0
337
+ };
338
+ function T(e) {
339
+ const r = me(), t = N(0), a = N(null), [l, i] = q(fe), n = D(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
340
+ const d = c[0];
341
+ d && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
342
+ a.current && r() && i(d.contentRect);
343
+ }));
344
+ }), [r]);
345
+ return V(() => (a.current && (n == null || n.observe(a.current, e)), () => {
346
+ n == null || n.disconnect(), t.current && cancelAnimationFrame(t.current);
347
+ }), [n, e]), [a, l];
348
+ }
349
+ const ve = {
350
+ small: 24,
351
+ // w-6
352
+ medium: 32,
353
+ // w-8
354
+ large: 48
355
+ // w-12
356
+ }, pe = {
357
+ small: 8 * 2,
358
+ // px-2 x 2
359
+ medium: 12 * 2,
360
+ // px-3 x 2
361
+ large: 16 * 2
362
+ // px-4 x 2
363
+ }, ye = 2, O = S.forwardRef(
364
+ ({
365
+ children: e,
366
+ disabled: r = !1,
367
+ mode: t = "system",
368
+ focusMode: a = "system",
369
+ fullWidth: l = !1,
370
+ className: i,
371
+ type: n = "button",
372
+ raw: c = !1,
373
+ noBorder: d = !1,
374
+ "aria-label": h,
375
+ label: v,
376
+ size: u = "medium",
377
+ labelRight: b,
378
+ labelLeft: m,
379
+ noBackground: w = !1,
380
+ align: B = "center",
381
+ radius: g = "large",
382
+ variant: C = "primary",
383
+ iconClassName: W,
384
+ animated: p = !1,
385
+ ...X
386
+ }, Z) => {
387
+ const J = ue({
388
+ type: L,
389
+ mode: t,
390
+ focusMode: a,
391
+ fullWidth: l,
392
+ disabled: r,
393
+ raw: c,
394
+ className: i,
395
+ noBorder: d,
396
+ size: u,
397
+ labelRight: b,
398
+ labelLeft: m,
399
+ noBackground: w,
400
+ align: B,
401
+ radius: g,
402
+ variant: C,
403
+ animated: p
404
+ }), K = de({ mode: t, raw: c, iconClassName: W }), U = be({ animated: p }), [f, z] = T(), [y, R] = T(), [_, j] = T(), E = N(0), k = N(null), Q = he([Z, k]);
405
+ return $(() => {
406
+ _ && _.current && p && (E.current = j.width + pe[u] + (d ? 0 : ye));
407
+ }, [j, _, u, d, p]), $(() => {
408
+ k && k.current && p && (b && f && z.width > 0 ? (f.current && (f.current.style.opacity = "100"), k.current.style.width = `${z.width + E.current}px`) : m && R.width > 0 ? (y.current && (y.current.style.opacity = "100"), k.current.style.width = `${R.width + E.current}px`) : (f.current && (f.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"), k.current.style.width = `${ve[u]}px`));
409
+ }, [
410
+ z,
411
+ b,
412
+ f,
413
+ R,
414
+ m,
415
+ y,
416
+ u,
417
+ p
418
+ ]), /* @__PURE__ */ x(
419
+ P,
420
+ {
421
+ ref: Q,
422
+ className: J,
423
+ disabled: r,
424
+ type: n,
425
+ "aria-label": h || v,
426
+ ...X,
427
+ children: [
428
+ /* @__PURE__ */ s(
429
+ H,
430
+ {
431
+ label: m,
432
+ labelRef: y,
433
+ labelClass: U,
434
+ labelInnerClass: "pr-2"
435
+ }
436
+ ),
437
+ /* @__PURE__ */ s("span", { ref: _, className: K, children: e }),
438
+ /* @__PURE__ */ s(
439
+ H,
440
+ {
441
+ label: b,
442
+ labelRef: f,
443
+ labelClass: U,
444
+ labelInnerClass: "pl-2"
445
+ }
446
+ )
447
+ ]
448
+ }
449
+ );
450
+ }
451
+ ), H = ({
452
+ labelRef: e,
453
+ labelClass: r,
454
+ label: t,
455
+ labelInnerClass: a
456
+ }) => /* @__PURE__ */ s("span", { ref: e, className: r, children: t && /* @__PURE__ */ s("span", { className: a, children: t }) });
457
+ O.displayName = "ButtonIcon";
458
+ /*!
459
+ @versini/ui-button v6.0.5
460
+ © 2025 gizmette.com
461
+ */
462
+ try {
463
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
464
+ version: "6.0.5",
465
+ buildTime: "04/12/2025 09:18 AM EDT",
466
+ homepage: "https://github.com/aversini/ui-components",
467
+ license: "MIT"
468
+ });
469
+ } catch {
470
+ }
471
+ const ke = S.forwardRef(
472
+ ({
473
+ children: e,
474
+ mode: r = "system",
475
+ className: t,
476
+ active: a = !1,
477
+ ...l
478
+ }, i) => {
479
+ const n = a ? o(
480
+ "relative",
481
+ "focus-within:static",
482
+ "focus-within:after:border-transparent",
483
+ "after:absolute",
484
+ "after:content-['']",
485
+ "after:border-b-2",
486
+ "after:bottom-[-4px]",
487
+ "after:left-0",
488
+ "after:right-0",
489
+ {
490
+ "after:border-table-dark": r === "dark",
491
+ "after:border-table-light": r === "light",
492
+ "after:border-table-dark dark:after:border-table-light": r === "system",
493
+ "after:border-table-light dark:after:border-table-dark": r === "alt-system"
494
+ }
495
+ ) : "";
496
+ return /* @__PURE__ */ s("div", { className: n, children: /* @__PURE__ */ s(
497
+ O,
498
+ {
499
+ className: o("justify-center", t),
500
+ ref: i,
501
+ mode: r,
502
+ radius: "small",
503
+ ...l,
504
+ children: e
505
+ }
506
+ ) });
507
+ }
508
+ );
509
+ ke.displayName = "ButtonSort";
510
+ const G = ({
511
+ children: e,
512
+ fill: r,
513
+ viewBox: t,
514
+ className: a,
515
+ defaultViewBox: l,
516
+ size: i,
517
+ title: n,
518
+ semantic: c = !1,
519
+ ...d
520
+ }) => {
521
+ const h = o(i, a);
522
+ return /* @__PURE__ */ s(Y, { children: /* @__PURE__ */ x(
523
+ "svg",
524
+ {
525
+ xmlns: "http://www.w3.org/2000/svg",
526
+ className: h,
527
+ viewBox: t || l,
528
+ fill: r || "currentColor",
529
+ role: "img",
530
+ "aria-hidden": !c,
531
+ focusable: !1,
532
+ ...d,
533
+ children: [
534
+ n && c && /* @__PURE__ */ s("title", { children: n }),
535
+ e
536
+ ]
537
+ }
538
+ ) });
539
+ };
540
+ /*!
541
+ @versini/ui-svgicon v4.2.0
542
+ © 2025 gizmette.com
543
+ */
544
+ try {
545
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
546
+ version: "4.2.0",
547
+ buildTime: "04/05/2025 07:49 PM EDT",
548
+ homepage: "https://github.com/aversini/ui-components",
549
+ license: "MIT"
550
+ });
551
+ } catch {
552
+ }
553
+ const xe = ({
554
+ className: e,
555
+ viewBox: r,
556
+ title: t,
557
+ monotone: a,
558
+ ...l
559
+ }) => /* @__PURE__ */ x(
560
+ G,
561
+ {
562
+ defaultViewBox: "0 0 448 512",
563
+ size: "size-5",
564
+ viewBox: r,
565
+ className: e,
566
+ title: t || "Copied",
567
+ ...l,
568
+ children: [
569
+ /* @__PURE__ */ s(
570
+ "path",
571
+ {
572
+ 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",
573
+ opacity: ".4"
574
+ }
575
+ ),
576
+ /* @__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" })
577
+ ]
578
+ }
579
+ ), we = ({
580
+ className: e,
581
+ viewBox: r,
582
+ title: t,
583
+ monotone: a,
584
+ ...l
585
+ }) => /* @__PURE__ */ s(
586
+ G,
587
+ {
588
+ defaultViewBox: "0 0 512 512",
589
+ size: "size-5",
590
+ viewBox: r,
591
+ className: e,
592
+ title: t || "Copy",
593
+ ...l,
594
+ 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" })
595
+ }
596
+ );
597
+ /*!
598
+ @versini/ui-icons v4.9.0
599
+ © 2025 gizmette.com
600
+ */
601
+ try {
602
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
603
+ version: "4.9.0",
604
+ buildTime: "04/05/2025 07:49 PM EDT",
605
+ homepage: "https://github.com/aversini/ui-components",
606
+ license: "MIT"
607
+ });
608
+ } catch {
609
+ }
610
+ const Be = ({ kind: e, noMaxWidth: r }) => o("px-4 py-2", {
611
+ "max-w-xs sm:max-w-md md:max-w-2xl": !r,
612
+ "lg:max-w-3xl": e === "left" && !r
613
+ }), Ne = ({ kind: e }) => o({
614
+ "bg-surface-lighter dark:bg-surface-dark": e === "left",
615
+ "bg-surface-accent": e === "right"
616
+ }), _e = ({ kind: e }) => o(
617
+ "prose prose-dark dark:prose-lighter",
618
+ "prose-blockquote:my-1",
619
+ "prose-ol:my-1 prose-ul:my-1",
620
+ {
621
+ "text-copy-lighter": e === "right"
622
+ }
623
+ ), Ie = ({ kind: e, tail: r }) => {
624
+ if (r)
625
+ return o(
626
+ `${I}-${e}-tail`,
627
+ "rounded-3xl",
628
+ "relative",
629
+ "before:content-['']",
630
+ "before:w-3",
631
+ "before:h-2",
632
+ "before:absolute",
633
+ "before:bottom-0",
634
+ {
635
+ "last-bubble-right:before:right-[2px] last-bubble-right:before:border-l-[8px] last-bubble-right:before:border-l-surface-accent last-bubble-right:before:rounded-bl-[100%]": e === "right",
636
+ "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"
637
+ }
638
+ );
639
+ if (!r)
640
+ return o("rounded-b-xl", {
641
+ "rounded-tr-xl": e === "left",
642
+ "rounded-tl-xl": e === "right"
643
+ });
644
+ }, Ce = ({
645
+ kind: e,
646
+ className: r,
647
+ contentClassName: t,
648
+ noMaxWidth: a,
649
+ tail: l
650
+ }) => {
651
+ const i = o(
652
+ I,
653
+ `${I}-${e}`,
654
+ "flex items-start",
655
+ {
656
+ "flex-row-reverse": e === "right"
657
+ },
658
+ r
659
+ ), n = o(
660
+ `${I}-content`,
661
+ "flex flex-col empty:hidden",
662
+ Be({ kind: e, noMaxWidth: a }),
663
+ _e({ kind: e }),
664
+ Ne({ kind: e }),
665
+ Ie({ kind: e, tail: l }),
666
+ t
667
+ ), c = "pr-2 pt-1 text-end text-xs text-copy-light", d = o("flex flex-col-reverse sm:flex-row", {
668
+ "ml-2": e === "left" && !l,
669
+ "mr-2": e === "right" && !l,
670
+ "ml-1": e === "left" && l,
671
+ "mr-1": e === "right" && l
672
+ });
673
+ return {
674
+ wrapper: i,
675
+ main: n,
676
+ footer: c,
677
+ copyButton: d
678
+ };
679
+ }, Te = ({
680
+ children: e,
681
+ kind: r = "left",
682
+ className: t,
683
+ contentClassName: a,
684
+ footer: l,
685
+ rawFooter: i,
686
+ copyToClipboard: n,
687
+ copyToClipboardFocusMode: c = "system",
688
+ copyToClipboardMode: d = "system",
689
+ noMaxWidth: h = !1,
690
+ tail: v = !1
691
+ }) => {
692
+ const [u, b] = q(!1), m = Ce({
693
+ kind: r,
694
+ className: t,
695
+ contentClassName: a,
696
+ noMaxWidth: h,
697
+ tail: v
698
+ }), w = !!n && (typeof n == "function" || typeof n == "string" || typeof e == "string"), B = () => {
699
+ b(!0), typeof n == "function" ? n(e) : typeof n == "string" ? navigator.clipboard.writeText(n) : typeof e == "string" && navigator.clipboard.writeText(e);
700
+ };
701
+ return V(() => {
702
+ let g;
703
+ return u && (g = window.setTimeout(() => {
704
+ b(!1);
705
+ }, 3e3)), () => {
706
+ clearTimeout(g);
707
+ };
708
+ }, [u]), /* @__PURE__ */ x("div", { className: m.wrapper, children: [
709
+ /* @__PURE__ */ x("div", { children: [
710
+ /* @__PURE__ */ s("div", { className: m.main, children: e }),
711
+ l && Object.keys(l).map((g, C) => l[g] ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */ x("p", { className: m.footer, children: [
712
+ g,
713
+ ": ",
714
+ l[g]
715
+ ] }) }, `${g}-${C}`) : null),
716
+ i && i
717
+ ] }),
718
+ w && /* @__PURE__ */ s("div", { className: m.copyButton, children: /* @__PURE__ */ s(
719
+ O,
720
+ {
721
+ noBorder: !0,
722
+ noBackground: !0,
723
+ size: "small",
724
+ mode: d,
725
+ focusMode: c,
726
+ label: u ? "Copied to clipboard" : "Copy to clipboard",
727
+ onClick: B,
728
+ disabled: u,
729
+ children: u ? /* @__PURE__ */ s(xe, { size: "size-3" }) : /* @__PURE__ */ s(we, { size: "size-3" })
730
+ }
731
+ ) })
732
+ ] });
733
+ };
4
734
  export {
5
- t as Bubble
735
+ I as BUBBLE_CLASSNAME,
736
+ Te as Bubble
6
737
  };