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