@versini/ui-bubble 3.2.0 → 3.2.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.
- package/dist/index.js +144 -141
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as c, jsxs as B, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import V, { useRef as I, useLayoutEffect as S, useMemo as P, useState as F, useEffect as L, useCallback as te } from "react";
|
|
3
3
|
import i from "clsx";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/ui-bubble v3.2.
|
|
5
|
+
@versini/ui-bubble v3.2.1
|
|
6
6
|
© 2025 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_UI_BUBBLE__ || (window.__VERSINI_UI_BUBBLE__ = {
|
|
10
|
-
version: "3.2.
|
|
11
|
-
buildTime: "01/
|
|
10
|
+
version: "3.2.1",
|
|
11
|
+
buildTime: "01/26/2025 05:19 PM EST",
|
|
12
12
|
homepage: "https://github.com/aversini/ui-components",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
|
15
15
|
} catch {
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const re = "av-bubble", O = "av-button", T = "icon", G = "button", M = "link", ae = ({
|
|
18
18
|
type: e,
|
|
19
19
|
size: r,
|
|
20
20
|
labelRight: t,
|
|
21
21
|
labelLeft: a,
|
|
22
22
|
align: n
|
|
23
23
|
}) => {
|
|
24
|
-
const o = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3",
|
|
24
|
+
const o = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", u = "max-h-12 py-2 px-4";
|
|
25
25
|
switch (e) {
|
|
26
|
-
case
|
|
27
|
-
case
|
|
26
|
+
case G:
|
|
27
|
+
case M:
|
|
28
28
|
return i({
|
|
29
29
|
[o]: r === "small",
|
|
30
30
|
[s]: r === "medium",
|
|
31
|
-
[
|
|
31
|
+
[u]: r === "large"
|
|
32
32
|
});
|
|
33
|
-
case
|
|
33
|
+
case T:
|
|
34
34
|
return i("inline-flex items-center", {
|
|
35
35
|
"justify-center": n === "center",
|
|
36
36
|
"justify-start": n === "left",
|
|
@@ -43,7 +43,7 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
43
43
|
"h-12": r === "large" && (t || a)
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, ie = ({
|
|
47
47
|
type: e,
|
|
48
48
|
size: r,
|
|
49
49
|
labelRight: t,
|
|
@@ -51,22 +51,22 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
51
51
|
}) => {
|
|
52
52
|
const n = "text-sm font-medium", o = "text-base font-medium", s = "text-lg font-medium";
|
|
53
53
|
switch (e) {
|
|
54
|
-
case
|
|
55
|
-
case
|
|
54
|
+
case G:
|
|
55
|
+
case M:
|
|
56
56
|
return i({
|
|
57
|
-
"text-center": e ===
|
|
57
|
+
"text-center": e === M,
|
|
58
58
|
[n]: r === "small",
|
|
59
59
|
[o]: r === "medium",
|
|
60
60
|
[s]: r === "large"
|
|
61
61
|
});
|
|
62
|
-
case
|
|
62
|
+
case T:
|
|
63
63
|
return i({
|
|
64
64
|
[n]: r === "small" && (t || a),
|
|
65
65
|
[o]: r === "medium" && (t || a),
|
|
66
66
|
[s]: r === "large" && (t || a)
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, oe = ({
|
|
70
70
|
mode: e,
|
|
71
71
|
noBackground: r,
|
|
72
72
|
noTruncate: t,
|
|
@@ -102,7 +102,7 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
102
102
|
return i("not-prose text-copy-lighter", {
|
|
103
103
|
truncate: !t
|
|
104
104
|
});
|
|
105
|
-
},
|
|
105
|
+
}, ne = ({
|
|
106
106
|
mode: e,
|
|
107
107
|
noBackground: r,
|
|
108
108
|
variant: t
|
|
@@ -132,13 +132,13 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
132
132
|
if (t === "selected")
|
|
133
133
|
return "bg-action-selected-dark";
|
|
134
134
|
}
|
|
135
|
-
},
|
|
135
|
+
}, se = ({
|
|
136
136
|
radius: e
|
|
137
137
|
}) => i({
|
|
138
138
|
"rounded-full": e === "large",
|
|
139
139
|
"rounded-md": e === "medium",
|
|
140
140
|
"rounded-sm": e === "small"
|
|
141
|
-
}),
|
|
141
|
+
}), ce = ({
|
|
142
142
|
mode: e,
|
|
143
143
|
disabled: r,
|
|
144
144
|
variant: t
|
|
@@ -168,7 +168,7 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
168
168
|
});
|
|
169
169
|
if (t === "selected")
|
|
170
170
|
return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
|
|
171
|
-
},
|
|
171
|
+
}, le = ({
|
|
172
172
|
mode: e,
|
|
173
173
|
disabled: r,
|
|
174
174
|
variant: t
|
|
@@ -198,7 +198,7 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
198
198
|
});
|
|
199
199
|
if (t === "selected")
|
|
200
200
|
return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
|
|
201
|
-
},
|
|
201
|
+
}, de = ({
|
|
202
202
|
mode: e,
|
|
203
203
|
noBorder: r,
|
|
204
204
|
variant: t
|
|
@@ -228,14 +228,14 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
228
228
|
});
|
|
229
229
|
if (t === "selected")
|
|
230
230
|
return "border border-border-selected-dark";
|
|
231
|
-
},
|
|
231
|
+
}, ue = ({
|
|
232
232
|
focusMode: e
|
|
233
233
|
}) => i("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
234
234
|
"focus:outline-focus-dark": e === "dark",
|
|
235
235
|
"focus:outline-focus-light": e === "light",
|
|
236
236
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
237
237
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
238
|
-
}),
|
|
238
|
+
}), ge = ({
|
|
239
239
|
mode: e,
|
|
240
240
|
raw: r,
|
|
241
241
|
iconClassName: t
|
|
@@ -247,11 +247,11 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
247
247
|
"dark:text-copy-accent-dark": e === "system"
|
|
248
248
|
},
|
|
249
249
|
t
|
|
250
|
-
),
|
|
250
|
+
), me = ({
|
|
251
251
|
animated: e
|
|
252
252
|
}) => i({
|
|
253
253
|
"transition-opacity duration-300 ease-in": e
|
|
254
|
-
}),
|
|
254
|
+
}), he = ({
|
|
255
255
|
type: e,
|
|
256
256
|
className: r,
|
|
257
257
|
raw: t,
|
|
@@ -259,78 +259,78 @@ const $ = "av-bubble", j = "av-button", B = "icon", P = "button", E = "link", ee
|
|
|
259
259
|
focusMode: n,
|
|
260
260
|
disabled: o,
|
|
261
261
|
fullWidth: s,
|
|
262
|
-
size:
|
|
262
|
+
size: u,
|
|
263
263
|
noBorder: g,
|
|
264
264
|
labelRight: m,
|
|
265
|
-
labelLeft:
|
|
266
|
-
noBackground:
|
|
267
|
-
variant:
|
|
268
|
-
noTruncate:
|
|
265
|
+
labelLeft: p,
|
|
266
|
+
noBackground: l,
|
|
267
|
+
variant: d,
|
|
268
|
+
noTruncate: f,
|
|
269
269
|
align: h,
|
|
270
|
-
radius:
|
|
271
|
-
animated:
|
|
272
|
-
}) => (
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
radius: N,
|
|
271
|
+
animated: z
|
|
272
|
+
}) => (d || (d = "primary"), t ? i(O, r) : i(
|
|
273
|
+
O,
|
|
274
|
+
oe({
|
|
275
275
|
mode: a,
|
|
276
|
-
variant:
|
|
277
|
-
noBackground:
|
|
278
|
-
noTruncate:
|
|
276
|
+
variant: d,
|
|
277
|
+
noBackground: l,
|
|
278
|
+
noTruncate: f
|
|
279
279
|
}),
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
ne({ mode: a, noBackground: l, variant: d }),
|
|
281
|
+
se({ radius: N }),
|
|
282
|
+
ae({
|
|
283
283
|
type: e,
|
|
284
|
-
size:
|
|
284
|
+
size: u,
|
|
285
285
|
labelRight: m,
|
|
286
|
-
labelLeft:
|
|
286
|
+
labelLeft: p,
|
|
287
287
|
align: h
|
|
288
288
|
}),
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
289
|
+
ie({ type: e, size: u, labelRight: m, labelLeft: p }),
|
|
290
|
+
de({ mode: a, variant: d, noBorder: g }),
|
|
291
|
+
ue({ focusMode: n }),
|
|
292
|
+
ce({ mode: a, variant: d, disabled: o }),
|
|
293
|
+
le({ mode: a, variant: d, disabled: o }),
|
|
294
294
|
{
|
|
295
295
|
"w-full": s,
|
|
296
296
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
297
297
|
},
|
|
298
298
|
i({
|
|
299
|
-
"transition-[width] duration-300 ease-in-out": e ===
|
|
299
|
+
"transition-[width] duration-300 ease-in-out": e === T && z
|
|
300
300
|
}),
|
|
301
301
|
r
|
|
302
|
-
)),
|
|
302
|
+
)), be = (e, r, t) => {
|
|
303
303
|
var a;
|
|
304
304
|
!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);
|
|
305
|
-
}, q =
|
|
305
|
+
}, q = V.forwardRef((e, r) => {
|
|
306
306
|
const { onClick: t, noInternalClick: a = !1, ...n } = e;
|
|
307
307
|
return /* @__PURE__ */ c(
|
|
308
308
|
"button",
|
|
309
309
|
{
|
|
310
310
|
ref: r,
|
|
311
311
|
onClick: (o) => {
|
|
312
|
-
|
|
312
|
+
be(o, a, t);
|
|
313
313
|
},
|
|
314
314
|
...n
|
|
315
315
|
}
|
|
316
316
|
);
|
|
317
317
|
});
|
|
318
318
|
q.displayName = "BaseButton";
|
|
319
|
-
function
|
|
320
|
-
const e =
|
|
321
|
-
return
|
|
319
|
+
function fe() {
|
|
320
|
+
const e = I(!1);
|
|
321
|
+
return L(() => (e.current = !0, () => {
|
|
322
322
|
e.current = !1;
|
|
323
|
-
}), []),
|
|
323
|
+
}), []), te(() => e.current, []);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
return
|
|
325
|
+
function ve(e) {
|
|
326
|
+
return P(() => e.every((r) => r == null) ? () => {
|
|
327
327
|
} : (r) => {
|
|
328
328
|
e.forEach((t) => {
|
|
329
329
|
typeof t == "function" ? t(r) : t != null && (t.current = r);
|
|
330
330
|
});
|
|
331
331
|
}, e);
|
|
332
332
|
}
|
|
333
|
-
const
|
|
333
|
+
const pe = {
|
|
334
334
|
x: 0,
|
|
335
335
|
y: 0,
|
|
336
336
|
width: 0,
|
|
@@ -340,32 +340,32 @@ const be = {
|
|
|
340
340
|
bottom: 0,
|
|
341
341
|
right: 0
|
|
342
342
|
};
|
|
343
|
-
function
|
|
344
|
-
const r =
|
|
345
|
-
const g =
|
|
343
|
+
function R(e) {
|
|
344
|
+
const r = fe(), t = I(0), a = I(null), [n, o] = F(pe), s = P(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((u) => {
|
|
345
|
+
const g = u[0];
|
|
346
346
|
g && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
347
347
|
a.current && r() && o(g.contentRect);
|
|
348
348
|
}));
|
|
349
349
|
}), [r]);
|
|
350
|
-
return
|
|
350
|
+
return L(() => (a.current && (s == null || s.observe(a.current, e)), () => {
|
|
351
351
|
s == null || s.disconnect(), t.current && cancelAnimationFrame(t.current);
|
|
352
352
|
}), [s, e]), [a, n];
|
|
353
353
|
}
|
|
354
|
-
const
|
|
354
|
+
const j = {
|
|
355
355
|
small: 24,
|
|
356
356
|
// w-6
|
|
357
357
|
medium: 32,
|
|
358
358
|
// w-8
|
|
359
359
|
large: 48
|
|
360
360
|
// w-12
|
|
361
|
-
},
|
|
361
|
+
}, A = {
|
|
362
362
|
small: 8 * 2,
|
|
363
363
|
// px-2 x 2
|
|
364
364
|
medium: 12 * 2,
|
|
365
365
|
// px-3 x 2
|
|
366
366
|
large: 16 * 2
|
|
367
367
|
// px-4 x 2
|
|
368
|
-
},
|
|
368
|
+
}, H = 2, U = V.forwardRef(
|
|
369
369
|
({
|
|
370
370
|
children: e,
|
|
371
371
|
disabled: r = !1,
|
|
@@ -374,84 +374,87 @@ const fe = {
|
|
|
374
374
|
fullWidth: n = !1,
|
|
375
375
|
className: o,
|
|
376
376
|
type: s = "button",
|
|
377
|
-
raw:
|
|
377
|
+
raw: u = !1,
|
|
378
378
|
noBorder: g = !1,
|
|
379
379
|
"aria-label": m,
|
|
380
|
-
label:
|
|
381
|
-
size:
|
|
382
|
-
labelRight:
|
|
383
|
-
labelLeft:
|
|
380
|
+
label: p,
|
|
381
|
+
size: l = "medium",
|
|
382
|
+
labelRight: d,
|
|
383
|
+
labelLeft: f,
|
|
384
384
|
noBackground: h = !1,
|
|
385
|
-
align:
|
|
386
|
-
radius:
|
|
387
|
-
variant:
|
|
388
|
-
iconClassName:
|
|
389
|
-
animated:
|
|
390
|
-
...
|
|
391
|
-
},
|
|
392
|
-
const
|
|
393
|
-
type:
|
|
385
|
+
align: N = "center",
|
|
386
|
+
radius: z = "large",
|
|
387
|
+
variant: Z = "primary",
|
|
388
|
+
iconClassName: D,
|
|
389
|
+
animated: v = !1,
|
|
390
|
+
...J
|
|
391
|
+
}, K) => {
|
|
392
|
+
const Q = he({
|
|
393
|
+
type: T,
|
|
394
394
|
mode: t,
|
|
395
395
|
focusMode: a,
|
|
396
396
|
fullWidth: n,
|
|
397
397
|
disabled: r,
|
|
398
|
-
raw:
|
|
398
|
+
raw: u,
|
|
399
399
|
className: o,
|
|
400
400
|
noBorder: g,
|
|
401
|
-
size:
|
|
402
|
-
labelRight:
|
|
403
|
-
labelLeft:
|
|
401
|
+
size: l,
|
|
402
|
+
labelRight: d,
|
|
403
|
+
labelLeft: f,
|
|
404
404
|
noBackground: h,
|
|
405
|
-
align:
|
|
406
|
-
radius:
|
|
407
|
-
variant:
|
|
408
|
-
animated:
|
|
409
|
-
}),
|
|
410
|
-
return
|
|
411
|
-
_ &&
|
|
412
|
-
}, [
|
|
413
|
-
|
|
405
|
+
align: N,
|
|
406
|
+
radius: z,
|
|
407
|
+
variant: Z,
|
|
408
|
+
animated: v
|
|
409
|
+
}), X = ge({ mode: t, raw: u, iconClassName: D }), $ = me({ animated: v }), [y, k] = R(), [x, w] = R(), [C, E] = R(), _ = I(0), b = I(null), Y = ve([K, b]);
|
|
410
|
+
return S(() => {
|
|
411
|
+
v || (_.current = E.width + A[l] + (g ? 0 : H), b && b.current && (k.width > 0 ? b.current.style.width = `${k.width + _.current}px` : w.width > 0 ? b.current.style.width = `${w.width + _.current}px` : b.current.style.width = `${j[l]}px`));
|
|
412
|
+
}, [v, E, l, g, k, w]), S(() => {
|
|
413
|
+
C && C.current && v && (_.current = E.width + A[l] + (g ? 0 : H));
|
|
414
|
+
}, [E, C, l, g, v]), S(() => {
|
|
415
|
+
b && b.current && v && (d && y && k.width > 0 ? (y.current && (y.current.style.opacity = "100"), b.current.style.width = `${k.width + _.current}px`) : f && w.width > 0 ? (x.current && (x.current.style.opacity = "100"), b.current.style.width = `${w.width + _.current}px`) : (y.current && (y.current.style.opacity = "0"), x.current && (x.current.style.opacity = "0"), b.current.style.width = `${j[l]}px`));
|
|
414
416
|
}, [
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
v,
|
|
418
|
-
C,
|
|
419
|
-
b,
|
|
417
|
+
k,
|
|
418
|
+
d,
|
|
420
419
|
y,
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
w,
|
|
421
|
+
f,
|
|
422
|
+
x,
|
|
423
|
+
l,
|
|
424
|
+
v
|
|
425
|
+
]), /* @__PURE__ */ B(
|
|
423
426
|
q,
|
|
424
427
|
{
|
|
425
|
-
ref:
|
|
426
|
-
className:
|
|
428
|
+
ref: Y,
|
|
429
|
+
className: Q,
|
|
427
430
|
disabled: r,
|
|
428
431
|
type: s,
|
|
429
|
-
"aria-label": m ||
|
|
430
|
-
...
|
|
432
|
+
"aria-label": m || p,
|
|
433
|
+
...J,
|
|
431
434
|
children: [
|
|
432
|
-
/* @__PURE__ */ c("span", { ref:
|
|
433
|
-
/* @__PURE__ */ c("span", { ref:
|
|
434
|
-
/* @__PURE__ */ c("span", { ref:
|
|
435
|
+
/* @__PURE__ */ c("span", { ref: x, className: $, children: f && /* @__PURE__ */ c("span", { className: "pr-2", children: f }) }),
|
|
436
|
+
/* @__PURE__ */ c("span", { ref: C, className: X, children: e }),
|
|
437
|
+
/* @__PURE__ */ c("span", { ref: y, className: $, children: d && /* @__PURE__ */ c("span", { className: "pl-2", children: d }) })
|
|
435
438
|
]
|
|
436
439
|
}
|
|
437
440
|
);
|
|
438
441
|
}
|
|
439
442
|
);
|
|
440
|
-
|
|
443
|
+
U.displayName = "ButtonIcon";
|
|
441
444
|
/*!
|
|
442
|
-
@versini/ui-button v4.2.
|
|
445
|
+
@versini/ui-button v4.2.1
|
|
443
446
|
© 2025 gizmette.com
|
|
444
447
|
*/
|
|
445
448
|
try {
|
|
446
449
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
447
|
-
version: "4.2.
|
|
448
|
-
buildTime: "01/
|
|
450
|
+
version: "4.2.1",
|
|
451
|
+
buildTime: "01/26/2025 05:19 PM EST",
|
|
449
452
|
homepage: "https://github.com/aversini/ui-components",
|
|
450
453
|
license: "MIT"
|
|
451
454
|
});
|
|
452
455
|
} catch {
|
|
453
456
|
}
|
|
454
|
-
const
|
|
457
|
+
const ye = V.forwardRef(
|
|
455
458
|
({
|
|
456
459
|
children: e,
|
|
457
460
|
mode: r = "system",
|
|
@@ -477,7 +480,7 @@ const pe = R.forwardRef(
|
|
|
477
480
|
}
|
|
478
481
|
) : "";
|
|
479
482
|
return /* @__PURE__ */ c("div", { className: s, children: /* @__PURE__ */ c(
|
|
480
|
-
|
|
483
|
+
U,
|
|
481
484
|
{
|
|
482
485
|
className: i("justify-center", t),
|
|
483
486
|
ref: o,
|
|
@@ -489,8 +492,8 @@ const pe = R.forwardRef(
|
|
|
489
492
|
) });
|
|
490
493
|
}
|
|
491
494
|
);
|
|
492
|
-
|
|
493
|
-
const
|
|
495
|
+
ye.displayName = "ButtonSort";
|
|
496
|
+
const W = ({
|
|
494
497
|
children: e,
|
|
495
498
|
fill: r,
|
|
496
499
|
viewBox: t,
|
|
@@ -498,11 +501,11 @@ const F = ({
|
|
|
498
501
|
defaultViewBox: n,
|
|
499
502
|
size: o,
|
|
500
503
|
title: s,
|
|
501
|
-
semantic:
|
|
504
|
+
semantic: u = !1,
|
|
502
505
|
...g
|
|
503
506
|
}) => {
|
|
504
507
|
const m = i(o, a);
|
|
505
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ B(ee, { children: [
|
|
506
509
|
/* @__PURE__ */ c(
|
|
507
510
|
"svg",
|
|
508
511
|
{
|
|
@@ -511,13 +514,13 @@ const F = ({
|
|
|
511
514
|
viewBox: t || n,
|
|
512
515
|
fill: r || "currentColor",
|
|
513
516
|
role: "img",
|
|
514
|
-
"aria-hidden": !
|
|
517
|
+
"aria-hidden": !u,
|
|
515
518
|
focusable: !1,
|
|
516
519
|
...g,
|
|
517
520
|
children: e
|
|
518
521
|
}
|
|
519
522
|
),
|
|
520
|
-
s &&
|
|
523
|
+
s && u && /* @__PURE__ */ c("span", { className: "sr-only", children: s })
|
|
521
524
|
] });
|
|
522
525
|
};
|
|
523
526
|
/*!
|
|
@@ -539,8 +542,8 @@ const ke = ({
|
|
|
539
542
|
title: t,
|
|
540
543
|
monotone: a,
|
|
541
544
|
...n
|
|
542
|
-
}) => /* @__PURE__ */
|
|
543
|
-
|
|
545
|
+
}) => /* @__PURE__ */ B(
|
|
546
|
+
W,
|
|
544
547
|
{
|
|
545
548
|
defaultViewBox: "0 0 448 512",
|
|
546
549
|
size: "size-5",
|
|
@@ -566,7 +569,7 @@ const ke = ({
|
|
|
566
569
|
monotone: a,
|
|
567
570
|
...n
|
|
568
571
|
}) => /* @__PURE__ */ c(
|
|
569
|
-
|
|
572
|
+
W,
|
|
570
573
|
{
|
|
571
574
|
defaultViewBox: "0 0 512 512",
|
|
572
575
|
size: "size-5",
|
|
@@ -613,7 +616,7 @@ const we = ({
|
|
|
613
616
|
noMaxWidth: t
|
|
614
617
|
}) => {
|
|
615
618
|
const a = i(
|
|
616
|
-
|
|
619
|
+
re,
|
|
617
620
|
"flex items-start",
|
|
618
621
|
{
|
|
619
622
|
"flex-row-reverse": e === "right"
|
|
@@ -635,7 +638,7 @@ const we = ({
|
|
|
635
638
|
footer: o,
|
|
636
639
|
copyButton: s
|
|
637
640
|
};
|
|
638
|
-
},
|
|
641
|
+
}, ze = ({
|
|
639
642
|
children: e,
|
|
640
643
|
kind: r = "left",
|
|
641
644
|
className: t,
|
|
@@ -643,39 +646,39 @@ const we = ({
|
|
|
643
646
|
rawFooter: n,
|
|
644
647
|
copyToClipboard: o,
|
|
645
648
|
copyToClipboardFocusMode: s = "system",
|
|
646
|
-
copyToClipboardMode:
|
|
649
|
+
copyToClipboardMode: u = "system",
|
|
647
650
|
noMaxWidth: g = !1
|
|
648
651
|
}) => {
|
|
649
|
-
const [m,
|
|
650
|
-
|
|
652
|
+
const [m, p] = F(!1), l = Ie({ kind: r, className: t, noMaxWidth: g }), d = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), f = () => {
|
|
653
|
+
p(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
|
|
651
654
|
};
|
|
652
|
-
return
|
|
655
|
+
return L(() => {
|
|
653
656
|
let h;
|
|
654
657
|
return m && (h = window.setTimeout(() => {
|
|
655
|
-
|
|
658
|
+
p(!1);
|
|
656
659
|
}, 3e3)), () => {
|
|
657
660
|
clearTimeout(h);
|
|
658
661
|
};
|
|
659
|
-
}, [m]), /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */ c("div", { className:
|
|
662
|
-
a && Object.keys(a).map((h,
|
|
662
|
+
}, [m]), /* @__PURE__ */ B("div", { className: l.wrapper, children: [
|
|
663
|
+
/* @__PURE__ */ B("div", { children: [
|
|
664
|
+
/* @__PURE__ */ c("div", { className: l.main, children: e }),
|
|
665
|
+
a && Object.keys(a).map((h, N) => a[h] ? /* @__PURE__ */ c("div", { className: "prose-p:m-0", children: /* @__PURE__ */ B("p", { className: l.footer, children: [
|
|
663
666
|
h,
|
|
664
667
|
": ",
|
|
665
668
|
a[h]
|
|
666
|
-
] }) }, `${h}-${
|
|
669
|
+
] }) }, `${h}-${N}`) : null),
|
|
667
670
|
n && n
|
|
668
671
|
] }),
|
|
669
|
-
|
|
670
|
-
|
|
672
|
+
d && /* @__PURE__ */ c("div", { className: l.copyButton, children: /* @__PURE__ */ c(
|
|
673
|
+
U,
|
|
671
674
|
{
|
|
672
675
|
noBorder: !0,
|
|
673
676
|
noBackground: !0,
|
|
674
677
|
size: "small",
|
|
675
|
-
mode:
|
|
678
|
+
mode: u,
|
|
676
679
|
focusMode: s,
|
|
677
680
|
label: m ? "Copied to clipboard" : "Copy to clipboard",
|
|
678
|
-
onClick:
|
|
681
|
+
onClick: f,
|
|
679
682
|
disabled: m,
|
|
680
683
|
children: m ? /* @__PURE__ */ c(ke, { size: "size-3" }) : /* @__PURE__ */ c(xe, { size: "size-3" })
|
|
681
684
|
}
|
|
@@ -683,6 +686,6 @@ const we = ({
|
|
|
683
686
|
] });
|
|
684
687
|
};
|
|
685
688
|
export {
|
|
686
|
-
|
|
687
|
-
|
|
689
|
+
re as BUBBLE_CLASSNAME,
|
|
690
|
+
ze as Bubble
|
|
688
691
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-bubble",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@tailwindcss/typography": "0.5.16",
|
|
46
|
-
"@versini/ui-button": "4.2.
|
|
46
|
+
"@versini/ui-button": "4.2.1",
|
|
47
47
|
"@versini/ui-icons": "4.6.0",
|
|
48
48
|
"clsx": "2.1.1",
|
|
49
49
|
"tailwindcss": "3.4.17"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"sideEffects": [
|
|
52
52
|
"**/*.css"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2afa12a4fcc5da2231f908342e8e18524126274b"
|
|
55
55
|
}
|