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