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