@versini/ui-bubble 3.3.1 → 3.4.0
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.d.ts +9 -1
- package/dist/index.js +209 -205
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,16 @@ type BubbleProps = {
|
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
/**
|
|
11
11
|
* CSS class(es) to add to the main component wrapper.
|
|
12
|
+
* Bubble is made of a wrapper, a main content, and a footer. This prop
|
|
13
|
+
* allows you to add classes to the main component wrapper.
|
|
12
14
|
*/
|
|
13
15
|
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* CSS class(es) to add to the content wrapper.
|
|
18
|
+
* Bubble is made of a wrapper, a main content, and a footer. This prop
|
|
19
|
+
* allows you to add classes to the content wrapper.
|
|
20
|
+
*/
|
|
21
|
+
contentClassName?: string;
|
|
14
22
|
/**
|
|
15
23
|
* Whether or not to show a "copy/paste" icon next to the Bubble.
|
|
16
24
|
* - If a function is passed, it will be called with the text to copy.
|
|
@@ -80,6 +88,6 @@ type BubbleProps = {
|
|
|
80
88
|
tail?: boolean;
|
|
81
89
|
};
|
|
82
90
|
|
|
83
|
-
declare const Bubble: ({ children, kind, className, footer, rawFooter, copyToClipboard, copyToClipboardFocusMode, copyToClipboardMode, noMaxWidth, tail, }: BubbleProps) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
declare const Bubble: ({ children, kind, className, contentClassName, footer, rawFooter, copyToClipboard, copyToClipboardFocusMode, copyToClipboardMode, noMaxWidth, tail, }: BubbleProps) => react_jsx_runtime.JSX.Element;
|
|
84
92
|
|
|
85
93
|
export { BUBBLE_CLASSNAME, Bubble };
|
package/dist/index.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as s, jsxs as x, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import V, { useRef as B, useLayoutEffect as j, useMemo as P, useState as q, useEffect as L, useCallback as ee } from "react";
|
|
3
|
+
import o from "clsx";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/ui-bubble v3.
|
|
5
|
+
@versini/ui-bubble v3.4.0
|
|
6
6
|
© 2025 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_UI_BUBBLE__ || (window.__VERSINI_UI_BUBBLE__ = {
|
|
10
|
-
version: "3.
|
|
11
|
-
buildTime: "03/
|
|
10
|
+
version: "3.4.0",
|
|
11
|
+
buildTime: "03/05/2025 01:31 PM EST",
|
|
12
12
|
homepage: "https://github.com/aversini/ui-components",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
|
15
15
|
} catch {
|
|
16
16
|
}
|
|
17
|
-
const I = "av-bubble",
|
|
17
|
+
const I = "av-bubble", A = "av-button", C = "icon", F = "button", M = "link", re = ({
|
|
18
18
|
type: e,
|
|
19
19
|
size: t,
|
|
20
20
|
labelRight: r,
|
|
21
21
|
labelLeft: a,
|
|
22
22
|
align: l,
|
|
23
|
-
animated:
|
|
23
|
+
animated: i
|
|
24
24
|
}) => {
|
|
25
|
-
const n = "max-h-8 py-0 px-2",
|
|
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
26
|
switch (e) {
|
|
27
|
-
case
|
|
28
|
-
case
|
|
29
|
-
return
|
|
27
|
+
case F:
|
|
28
|
+
case M:
|
|
29
|
+
return o({
|
|
30
30
|
[n]: t === "small",
|
|
31
|
-
[
|
|
32
|
-
[
|
|
31
|
+
[c]: t === "medium",
|
|
32
|
+
[d]: t === "large"
|
|
33
33
|
});
|
|
34
34
|
case C:
|
|
35
|
-
return
|
|
35
|
+
return o("flex items-center", {
|
|
36
36
|
"justify-center": l === "center",
|
|
37
37
|
"justify-start": l === "left",
|
|
38
38
|
"justify-end": l === "right",
|
|
39
|
-
"h-6 w-6 p-0": t === "small" && !
|
|
40
|
-
"h-6 px-2": t === "small" && !
|
|
41
|
-
"h-8 w-8 p-1": t === "medium" && !
|
|
42
|
-
"h-8 px-3": t === "medium" && !
|
|
43
|
-
"h-12 w-12 p-2": t === "large" && !
|
|
44
|
-
"h-12 px-4": t === "large" && !
|
|
45
|
-
"h-6 py-0": t === "small" &&
|
|
46
|
-
"h-6": t === "small" &&
|
|
47
|
-
"h-8 py-1": t === "medium" &&
|
|
48
|
-
"h-8": t === "medium" &&
|
|
49
|
-
"h-12 py-2": t === "large" &&
|
|
50
|
-
"h-12": t === "large" &&
|
|
39
|
+
"h-6 w-6 p-0": t === "small" && !i && !(r || a),
|
|
40
|
+
"h-6 px-2": t === "small" && !i && (r || a),
|
|
41
|
+
"h-8 w-8 p-1": t === "medium" && !i && !(r || a),
|
|
42
|
+
"h-8 px-3": t === "medium" && !i && (r || a),
|
|
43
|
+
"h-12 w-12 p-2": t === "large" && !i && !(r || a),
|
|
44
|
+
"h-12 px-4": t === "large" && !i && (r || a),
|
|
45
|
+
"h-6 py-0": t === "small" && i && !(r || a),
|
|
46
|
+
"h-6": t === "small" && i && (r || a),
|
|
47
|
+
"h-8 py-1": t === "medium" && i && !(r || a),
|
|
48
|
+
"h-8": t === "medium" && i && (r || a),
|
|
49
|
+
"h-12 py-2": t === "large" && i && !(r || a),
|
|
50
|
+
"h-12": t === "large" && i && (r || a)
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}, te = ({
|
|
@@ -56,20 +56,20 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
56
56
|
labelRight: r,
|
|
57
57
|
labelLeft: a
|
|
58
58
|
}) => {
|
|
59
|
-
const l = "text-sm font-medium",
|
|
59
|
+
const l = "text-sm font-medium", i = "text-base font-medium", n = "text-lg font-medium";
|
|
60
60
|
switch (e) {
|
|
61
|
-
case
|
|
62
|
-
case
|
|
63
|
-
return
|
|
64
|
-
"text-center": e ===
|
|
61
|
+
case F:
|
|
62
|
+
case M:
|
|
63
|
+
return o({
|
|
64
|
+
"text-center": e === M,
|
|
65
65
|
[l]: t === "small",
|
|
66
|
-
[
|
|
66
|
+
[i]: t === "medium",
|
|
67
67
|
[n]: t === "large"
|
|
68
68
|
});
|
|
69
69
|
case C:
|
|
70
|
-
return
|
|
70
|
+
return o({
|
|
71
71
|
[l]: t === "small" && (r || a),
|
|
72
|
-
[
|
|
72
|
+
[i]: t === "medium" && (r || a),
|
|
73
73
|
[n]: t === "large" && (r || a)
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -82,7 +82,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
82
82
|
if (t)
|
|
83
83
|
return "not-prose";
|
|
84
84
|
if (a === "primary")
|
|
85
|
-
return
|
|
85
|
+
return o("not-prose", {
|
|
86
86
|
truncate: !r,
|
|
87
87
|
"text-copy-light": e === "dark" || e === "system",
|
|
88
88
|
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
@@ -90,7 +90,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
90
90
|
"dark:text-copy-light": e === "alt-system"
|
|
91
91
|
});
|
|
92
92
|
if (a === "secondary")
|
|
93
|
-
return
|
|
93
|
+
return o("not-prose", {
|
|
94
94
|
truncate: !r,
|
|
95
95
|
"text-copy-light": e === "light" || e === "system",
|
|
96
96
|
"text-copy-lighter": e === "dark" || e === "alt-system",
|
|
@@ -98,7 +98,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
98
98
|
"dark:text-copy-light": e === "system"
|
|
99
99
|
});
|
|
100
100
|
if (a === "danger")
|
|
101
|
-
return
|
|
101
|
+
return o("not-prose", {
|
|
102
102
|
truncate: !r,
|
|
103
103
|
"text-copy-light": e === "dark" || e === "system",
|
|
104
104
|
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
@@ -106,7 +106,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
106
106
|
"dark:text-copy-light": e === "alt-system"
|
|
107
107
|
});
|
|
108
108
|
if (a === "selected")
|
|
109
|
-
return
|
|
109
|
+
return o("not-prose text-copy-lighter", {
|
|
110
110
|
truncate: !r
|
|
111
111
|
});
|
|
112
112
|
}, oe = ({
|
|
@@ -116,21 +116,21 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
116
116
|
}) => {
|
|
117
117
|
if (!t) {
|
|
118
118
|
if (r === "primary")
|
|
119
|
-
return
|
|
119
|
+
return o({
|
|
120
120
|
"bg-action-dark": e === "dark",
|
|
121
121
|
"bg-action-light": e === "light",
|
|
122
122
|
"bg-action-dark dark:bg-action-light": e === "system",
|
|
123
123
|
"bg-action-light dark:bg-action-dark": e === "alt-system"
|
|
124
124
|
});
|
|
125
125
|
if (r === "secondary")
|
|
126
|
-
return
|
|
126
|
+
return o({
|
|
127
127
|
"bg-action-dark": e === "light",
|
|
128
128
|
"bg-action-light": e === "dark",
|
|
129
129
|
"bg-action-dark dark:bg-action-light": e === "alt-system",
|
|
130
130
|
"bg-action-light dark:bg-action-dark": e === "system"
|
|
131
131
|
});
|
|
132
132
|
if (r === "danger")
|
|
133
|
-
return
|
|
133
|
+
return o({
|
|
134
134
|
"bg-action-danger-dark": e === "dark",
|
|
135
135
|
"bg-action-danger-light": e === "light",
|
|
136
136
|
"bg-action-danger-dark dark:bg-action-danger-light": e === "system",
|
|
@@ -141,7 +141,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
141
141
|
}
|
|
142
142
|
}, ie = ({
|
|
143
143
|
radius: e
|
|
144
|
-
}) =>
|
|
144
|
+
}) => o({
|
|
145
145
|
"rounded-full": e === "large",
|
|
146
146
|
"rounded-md": e === "medium",
|
|
147
147
|
"rounded-sm": e === "small"
|
|
@@ -153,21 +153,21 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
153
153
|
if (t)
|
|
154
154
|
return "";
|
|
155
155
|
if (r === "primary")
|
|
156
|
-
return
|
|
156
|
+
return o("hover:text-copy-light-hover", {
|
|
157
157
|
"hover:bg-action-dark-hover": e === "dark",
|
|
158
158
|
"hover:bg-action-light-hover": e === "light",
|
|
159
159
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
|
|
160
160
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
|
|
161
161
|
});
|
|
162
162
|
if (r === "secondary")
|
|
163
|
-
return
|
|
163
|
+
return o("hover:text-copy-light-hover", {
|
|
164
164
|
"hover:bg-action-dark-hover": e === "light",
|
|
165
165
|
"hover:bg-action-light-hover": e === "dark",
|
|
166
166
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
|
|
167
167
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
|
|
168
168
|
});
|
|
169
169
|
if (r === "danger")
|
|
170
|
-
return
|
|
170
|
+
return o("hover:text-copy-light-hover", {
|
|
171
171
|
"hover:bg-action-danger-dark-hover": e === "dark",
|
|
172
172
|
"hover:bg-action-danger-light-hover": e === "light",
|
|
173
173
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
@@ -183,21 +183,21 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
183
183
|
if (t)
|
|
184
184
|
return "";
|
|
185
185
|
if (r === "primary")
|
|
186
|
-
return
|
|
186
|
+
return o("active:text-copy-light-active", {
|
|
187
187
|
"active:bg-action-dark-active": e === "dark",
|
|
188
188
|
"active:bg-action-light-active": e === "light",
|
|
189
189
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
|
|
190
190
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
|
|
191
191
|
});
|
|
192
192
|
if (r === "secondary")
|
|
193
|
-
return
|
|
193
|
+
return o("active:text-copy-light-active", {
|
|
194
194
|
"active:bg-action-dark-active": e === "light",
|
|
195
195
|
"active:bg-action-light-active": e === "dark",
|
|
196
196
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
|
|
197
197
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
|
|
198
198
|
});
|
|
199
199
|
if (r === "danger")
|
|
200
|
-
return
|
|
200
|
+
return o("active:text-copy-lighter-active", {
|
|
201
201
|
"active:bg-action-danger-dark-active": e === "dark",
|
|
202
202
|
"active:bg-action-danger-light-active": e === "light",
|
|
203
203
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
@@ -213,21 +213,21 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
213
213
|
if (t)
|
|
214
214
|
return "border border-transparent";
|
|
215
215
|
if (r === "primary")
|
|
216
|
-
return
|
|
216
|
+
return o("border", {
|
|
217
217
|
"border-border-dark": e === "dark",
|
|
218
218
|
"border-border-accent": e === "light",
|
|
219
219
|
"border-border-dark dark:border-border-accent": e === "system",
|
|
220
220
|
"border-border-accent dark:border-border-dark": e === "alt-system"
|
|
221
221
|
});
|
|
222
222
|
if (r === "secondary")
|
|
223
|
-
return
|
|
223
|
+
return o("border", {
|
|
224
224
|
"border-border-dark": e === "light",
|
|
225
225
|
"border-border-accent": e === "dark",
|
|
226
226
|
"border-border-dark dark:border-border-accent": e === "alt-system",
|
|
227
227
|
"border-border-accent dark:border-border-dark": e === "system"
|
|
228
228
|
});
|
|
229
229
|
if (r === "danger")
|
|
230
|
-
return
|
|
230
|
+
return o("border", {
|
|
231
231
|
"border-border-danger-dark": e === "dark",
|
|
232
232
|
"border-border-danger-medium": e === "light",
|
|
233
233
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
@@ -237,7 +237,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
237
237
|
return "border border-border-selected-dark";
|
|
238
238
|
}, ce = ({
|
|
239
239
|
focusMode: e
|
|
240
|
-
}) =>
|
|
240
|
+
}) => o("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
241
241
|
"focus:outline-focus-dark": e === "dark",
|
|
242
242
|
"focus:outline-focus-light": e === "light",
|
|
243
243
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
@@ -246,7 +246,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
246
246
|
mode: e,
|
|
247
247
|
raw: t,
|
|
248
248
|
iconClassName: r
|
|
249
|
-
}) => t ? "" :
|
|
249
|
+
}) => t ? "" : o(
|
|
250
250
|
{
|
|
251
251
|
"text-copy-accent-dark": e === "light" || e === "alt-system",
|
|
252
252
|
"text-copy-light": e === "dark" || e === "system",
|
|
@@ -256,7 +256,7 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
256
256
|
r
|
|
257
257
|
), be = ({
|
|
258
258
|
animated: e
|
|
259
|
-
}) =>
|
|
259
|
+
}) => o({
|
|
260
260
|
"transition-opacity duration-300 ease-in": e
|
|
261
261
|
}), ue = ({
|
|
262
262
|
type: e,
|
|
@@ -264,74 +264,74 @@ const I = "av-bubble", j = "av-button", C = "icon", q = "button", S = "link", re
|
|
|
264
264
|
raw: r,
|
|
265
265
|
mode: a,
|
|
266
266
|
focusMode: l,
|
|
267
|
-
disabled:
|
|
267
|
+
disabled: i,
|
|
268
268
|
fullWidth: n,
|
|
269
|
-
size:
|
|
270
|
-
noBorder:
|
|
269
|
+
size: c,
|
|
270
|
+
noBorder: d,
|
|
271
271
|
labelRight: h,
|
|
272
|
-
labelLeft:
|
|
272
|
+
labelLeft: v,
|
|
273
273
|
noBackground: u,
|
|
274
|
-
variant:
|
|
275
|
-
noTruncate:
|
|
276
|
-
align:
|
|
277
|
-
radius:
|
|
278
|
-
animated:
|
|
279
|
-
}) => (
|
|
280
|
-
|
|
274
|
+
variant: b,
|
|
275
|
+
noTruncate: m,
|
|
276
|
+
align: w,
|
|
277
|
+
radius: _,
|
|
278
|
+
animated: g
|
|
279
|
+
}) => (b || (b = "primary"), r ? o(A, t) : o(
|
|
280
|
+
A,
|
|
281
281
|
ae({
|
|
282
282
|
mode: a,
|
|
283
|
-
variant:
|
|
283
|
+
variant: b,
|
|
284
284
|
noBackground: u,
|
|
285
|
-
noTruncate:
|
|
285
|
+
noTruncate: m
|
|
286
286
|
}),
|
|
287
|
-
oe({ mode: a, noBackground: u, variant:
|
|
288
|
-
ie({ radius:
|
|
287
|
+
oe({ mode: a, noBackground: u, variant: b }),
|
|
288
|
+
ie({ radius: _ }),
|
|
289
289
|
re({
|
|
290
290
|
type: e,
|
|
291
|
-
size:
|
|
291
|
+
size: c,
|
|
292
292
|
labelRight: h,
|
|
293
|
-
labelLeft:
|
|
294
|
-
align:
|
|
295
|
-
animated:
|
|
293
|
+
labelLeft: v,
|
|
294
|
+
align: w,
|
|
295
|
+
animated: g
|
|
296
296
|
}),
|
|
297
|
-
te({ type: e, size:
|
|
298
|
-
se({ mode: a, variant:
|
|
297
|
+
te({ type: e, size: c, labelRight: h, labelLeft: v }),
|
|
298
|
+
se({ mode: a, variant: b, noBorder: d }),
|
|
299
299
|
ce({ focusMode: l }),
|
|
300
|
-
le({ mode: a, variant:
|
|
301
|
-
ne({ mode: a, variant:
|
|
300
|
+
le({ mode: a, variant: b, disabled: i }),
|
|
301
|
+
ne({ mode: a, variant: b, disabled: i }),
|
|
302
302
|
{
|
|
303
303
|
"w-full": n,
|
|
304
|
-
"disabled:cursor-not-allowed disabled:opacity-50":
|
|
304
|
+
"disabled:cursor-not-allowed disabled:opacity-50": i
|
|
305
305
|
},
|
|
306
|
-
|
|
307
|
-
"transition-[width] duration-300 ease-in-out": e === C &&
|
|
306
|
+
o({
|
|
307
|
+
"transition-[width] duration-300 ease-in-out": e === C && g
|
|
308
308
|
}),
|
|
309
309
|
t
|
|
310
310
|
)), ge = (e, t, r) => {
|
|
311
311
|
var a;
|
|
312
312
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
313
|
-
},
|
|
313
|
+
}, G = V.forwardRef((e, t) => {
|
|
314
314
|
const { onClick: r, noInternalClick: a = !1, ...l } = e;
|
|
315
315
|
return /* @__PURE__ */ s(
|
|
316
316
|
"button",
|
|
317
317
|
{
|
|
318
318
|
ref: t,
|
|
319
|
-
onClick: (
|
|
320
|
-
ge(
|
|
319
|
+
onClick: (i) => {
|
|
320
|
+
ge(i, a, r);
|
|
321
321
|
},
|
|
322
322
|
...l
|
|
323
323
|
}
|
|
324
324
|
);
|
|
325
325
|
});
|
|
326
|
-
|
|
326
|
+
G.displayName = "BaseButton";
|
|
327
327
|
function me() {
|
|
328
328
|
const e = B(!1);
|
|
329
|
-
return
|
|
329
|
+
return L(() => (e.current = !0, () => {
|
|
330
330
|
e.current = !1;
|
|
331
331
|
}), []), ee(() => e.current, []);
|
|
332
332
|
}
|
|
333
333
|
function he(e) {
|
|
334
|
-
return
|
|
334
|
+
return P(() => e.every((t) => t == null) ? () => {
|
|
335
335
|
} : (t) => {
|
|
336
336
|
e.forEach((r) => {
|
|
337
337
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
@@ -348,14 +348,14 @@ const fe = {
|
|
|
348
348
|
bottom: 0,
|
|
349
349
|
right: 0
|
|
350
350
|
};
|
|
351
|
-
function
|
|
352
|
-
const t = me(), r = B(0), a = B(null), [l,
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
a.current && t() &&
|
|
351
|
+
function S(e) {
|
|
352
|
+
const t = me(), r = B(0), a = B(null), [l, i] = q(fe), n = P(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
|
|
353
|
+
const d = c[0];
|
|
354
|
+
d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
355
|
+
a.current && t() && i(d.contentRect);
|
|
356
356
|
}));
|
|
357
357
|
}), [t]);
|
|
358
|
-
return
|
|
358
|
+
return L(() => (a.current && (n == null || n.observe(a.current, e)), () => {
|
|
359
359
|
n == null || n.disconnect(), r.current && cancelAnimationFrame(r.current);
|
|
360
360
|
}), [n, e]), [a, l];
|
|
361
361
|
}
|
|
@@ -373,28 +373,28 @@ const ve = {
|
|
|
373
373
|
// px-3 x 2
|
|
374
374
|
large: 16 * 2
|
|
375
375
|
// px-4 x 2
|
|
376
|
-
}, ye = 2,
|
|
376
|
+
}, ye = 2, U = V.forwardRef(
|
|
377
377
|
({
|
|
378
378
|
children: e,
|
|
379
379
|
disabled: t = !1,
|
|
380
380
|
mode: r = "system",
|
|
381
381
|
focusMode: a = "system",
|
|
382
382
|
fullWidth: l = !1,
|
|
383
|
-
className:
|
|
383
|
+
className: i,
|
|
384
384
|
type: n = "button",
|
|
385
|
-
raw:
|
|
386
|
-
noBorder:
|
|
385
|
+
raw: c = !1,
|
|
386
|
+
noBorder: d = !1,
|
|
387
387
|
"aria-label": h,
|
|
388
|
-
label:
|
|
388
|
+
label: v,
|
|
389
389
|
size: u = "medium",
|
|
390
|
-
labelRight:
|
|
391
|
-
labelLeft:
|
|
392
|
-
noBackground:
|
|
393
|
-
align:
|
|
394
|
-
radius:
|
|
395
|
-
variant:
|
|
390
|
+
labelRight: b,
|
|
391
|
+
labelLeft: m,
|
|
392
|
+
noBackground: w = !1,
|
|
393
|
+
align: _ = "center",
|
|
394
|
+
radius: g = "large",
|
|
395
|
+
variant: T = "primary",
|
|
396
396
|
iconClassName: X,
|
|
397
|
-
animated:
|
|
397
|
+
animated: p = !1,
|
|
398
398
|
...Z
|
|
399
399
|
}, D) => {
|
|
400
400
|
const J = ue({
|
|
@@ -403,57 +403,57 @@ const ve = {
|
|
|
403
403
|
focusMode: a,
|
|
404
404
|
fullWidth: l,
|
|
405
405
|
disabled: t,
|
|
406
|
-
raw:
|
|
407
|
-
className:
|
|
408
|
-
noBorder:
|
|
406
|
+
raw: c,
|
|
407
|
+
className: i,
|
|
408
|
+
noBorder: d,
|
|
409
409
|
size: u,
|
|
410
|
-
labelRight:
|
|
411
|
-
labelLeft:
|
|
412
|
-
noBackground:
|
|
413
|
-
align:
|
|
414
|
-
radius:
|
|
415
|
-
variant:
|
|
416
|
-
animated:
|
|
417
|
-
}), K = de({ mode: r, raw:
|
|
418
|
-
return
|
|
419
|
-
N && N.current &&
|
|
420
|
-
}, [
|
|
421
|
-
|
|
410
|
+
labelRight: b,
|
|
411
|
+
labelLeft: m,
|
|
412
|
+
noBackground: w,
|
|
413
|
+
align: _,
|
|
414
|
+
radius: g,
|
|
415
|
+
variant: T,
|
|
416
|
+
animated: p
|
|
417
|
+
}), K = de({ mode: r, raw: c, iconClassName: X }), $ = be({ animated: p }), [f, z] = S(), [y, E] = S(), [N, O] = S(), R = B(0), k = B(null), Q = he([D, k]);
|
|
418
|
+
return j(() => {
|
|
419
|
+
N && N.current && p && (R.current = O.width + pe[u] + (d ? 0 : ye));
|
|
420
|
+
}, [O, N, u, d, p]), j(() => {
|
|
421
|
+
k && k.current && p && (b && f && z.width > 0 ? (f.current && (f.current.style.opacity = "100"), k.current.style.width = `${z.width + R.current}px`) : m && E.width > 0 ? (y.current && (y.current.style.opacity = "100"), k.current.style.width = `${E.width + R.current}px`) : (f.current && (f.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"), k.current.style.width = `${ve[u]}px`));
|
|
422
422
|
}, [
|
|
423
|
-
T,
|
|
424
|
-
c,
|
|
425
|
-
v,
|
|
426
423
|
z,
|
|
424
|
+
b,
|
|
427
425
|
f,
|
|
428
|
-
|
|
426
|
+
E,
|
|
427
|
+
m,
|
|
428
|
+
y,
|
|
429
429
|
u,
|
|
430
|
-
|
|
431
|
-
]), /* @__PURE__ */
|
|
432
|
-
|
|
430
|
+
p
|
|
431
|
+
]), /* @__PURE__ */ x(
|
|
432
|
+
G,
|
|
433
433
|
{
|
|
434
434
|
ref: Q,
|
|
435
435
|
className: J,
|
|
436
436
|
disabled: t,
|
|
437
437
|
type: n,
|
|
438
|
-
"aria-label": h ||
|
|
438
|
+
"aria-label": h || v,
|
|
439
439
|
...Z,
|
|
440
440
|
children: [
|
|
441
441
|
/* @__PURE__ */ s(
|
|
442
|
-
|
|
442
|
+
H,
|
|
443
443
|
{
|
|
444
|
-
label:
|
|
445
|
-
labelRef:
|
|
446
|
-
labelClass:
|
|
444
|
+
label: m,
|
|
445
|
+
labelRef: y,
|
|
446
|
+
labelClass: $,
|
|
447
447
|
labelInnerClass: "pr-2"
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
450
|
/* @__PURE__ */ s("span", { ref: N, className: K, children: e }),
|
|
451
451
|
/* @__PURE__ */ s(
|
|
452
|
-
|
|
452
|
+
H,
|
|
453
453
|
{
|
|
454
|
-
label:
|
|
455
|
-
labelRef:
|
|
456
|
-
labelClass:
|
|
454
|
+
label: b,
|
|
455
|
+
labelRef: f,
|
|
456
|
+
labelClass: $,
|
|
457
457
|
labelInnerClass: "pl-2"
|
|
458
458
|
}
|
|
459
459
|
)
|
|
@@ -461,35 +461,35 @@ const ve = {
|
|
|
461
461
|
}
|
|
462
462
|
);
|
|
463
463
|
}
|
|
464
|
-
),
|
|
464
|
+
), H = ({
|
|
465
465
|
labelRef: e,
|
|
466
466
|
labelClass: t,
|
|
467
467
|
label: r,
|
|
468
468
|
labelInnerClass: a
|
|
469
469
|
}) => /* @__PURE__ */ s("span", { ref: e, className: t, children: r && /* @__PURE__ */ s("span", { className: a, children: r }) });
|
|
470
|
-
|
|
470
|
+
U.displayName = "ButtonIcon";
|
|
471
471
|
/*!
|
|
472
|
-
@versini/ui-button v4.2.
|
|
472
|
+
@versini/ui-button v4.2.10
|
|
473
473
|
© 2025 gizmette.com
|
|
474
474
|
*/
|
|
475
475
|
try {
|
|
476
476
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
477
|
-
version: "4.2.
|
|
478
|
-
buildTime: "03/
|
|
477
|
+
version: "4.2.10",
|
|
478
|
+
buildTime: "03/05/2025 01:30 PM EST",
|
|
479
479
|
homepage: "https://github.com/aversini/ui-components",
|
|
480
480
|
license: "MIT"
|
|
481
481
|
});
|
|
482
482
|
} catch {
|
|
483
483
|
}
|
|
484
|
-
const ke =
|
|
484
|
+
const ke = V.forwardRef(
|
|
485
485
|
({
|
|
486
486
|
children: e,
|
|
487
487
|
mode: t = "system",
|
|
488
488
|
className: r,
|
|
489
489
|
active: a = !1,
|
|
490
490
|
...l
|
|
491
|
-
},
|
|
492
|
-
const n = a ?
|
|
491
|
+
}, i) => {
|
|
492
|
+
const n = a ? o(
|
|
493
493
|
"relative",
|
|
494
494
|
"focus-within:static",
|
|
495
495
|
"focus-within:after:border-transparent",
|
|
@@ -507,10 +507,10 @@ const ke = M.forwardRef(
|
|
|
507
507
|
}
|
|
508
508
|
) : "";
|
|
509
509
|
return /* @__PURE__ */ s("div", { className: n, children: /* @__PURE__ */ s(
|
|
510
|
-
|
|
510
|
+
U,
|
|
511
511
|
{
|
|
512
|
-
className:
|
|
513
|
-
ref:
|
|
512
|
+
className: o("justify-center", r),
|
|
513
|
+
ref: i,
|
|
514
514
|
mode: t,
|
|
515
515
|
radius: "small",
|
|
516
516
|
...l,
|
|
@@ -520,19 +520,19 @@ const ke = M.forwardRef(
|
|
|
520
520
|
}
|
|
521
521
|
);
|
|
522
522
|
ke.displayName = "ButtonSort";
|
|
523
|
-
const
|
|
523
|
+
const W = ({
|
|
524
524
|
children: e,
|
|
525
525
|
fill: t,
|
|
526
526
|
viewBox: r,
|
|
527
527
|
className: a,
|
|
528
528
|
defaultViewBox: l,
|
|
529
|
-
size:
|
|
529
|
+
size: i,
|
|
530
530
|
title: n,
|
|
531
|
-
semantic:
|
|
532
|
-
...
|
|
531
|
+
semantic: c = !1,
|
|
532
|
+
...d
|
|
533
533
|
}) => {
|
|
534
|
-
const h = i
|
|
535
|
-
return /* @__PURE__ */
|
|
534
|
+
const h = o(i, a);
|
|
535
|
+
return /* @__PURE__ */ x(Y, { children: [
|
|
536
536
|
/* @__PURE__ */ s(
|
|
537
537
|
"svg",
|
|
538
538
|
{
|
|
@@ -541,13 +541,13 @@ const G = ({
|
|
|
541
541
|
viewBox: r || l,
|
|
542
542
|
fill: t || "currentColor",
|
|
543
543
|
role: "img",
|
|
544
|
-
"aria-hidden": !
|
|
544
|
+
"aria-hidden": !c,
|
|
545
545
|
focusable: !1,
|
|
546
|
-
...
|
|
546
|
+
...d,
|
|
547
547
|
children: e
|
|
548
548
|
}
|
|
549
549
|
),
|
|
550
|
-
n &&
|
|
550
|
+
n && c && /* @__PURE__ */ s("span", { className: "sr-only", children: n })
|
|
551
551
|
] });
|
|
552
552
|
};
|
|
553
553
|
/*!
|
|
@@ -569,8 +569,8 @@ const xe = ({
|
|
|
569
569
|
title: r,
|
|
570
570
|
monotone: a,
|
|
571
571
|
...l
|
|
572
|
-
}) => /* @__PURE__ */
|
|
573
|
-
|
|
572
|
+
}) => /* @__PURE__ */ x(
|
|
573
|
+
W,
|
|
574
574
|
{
|
|
575
575
|
defaultViewBox: "0 0 448 512",
|
|
576
576
|
size: "size-5",
|
|
@@ -596,7 +596,7 @@ const xe = ({
|
|
|
596
596
|
monotone: a,
|
|
597
597
|
...l
|
|
598
598
|
}) => /* @__PURE__ */ s(
|
|
599
|
-
|
|
599
|
+
W,
|
|
600
600
|
{
|
|
601
601
|
defaultViewBox: "0 0 512 512",
|
|
602
602
|
size: "size-5",
|
|
@@ -620,13 +620,13 @@ try {
|
|
|
620
620
|
});
|
|
621
621
|
} catch {
|
|
622
622
|
}
|
|
623
|
-
const _e = ({ kind: e, noMaxWidth: t }) =>
|
|
623
|
+
const _e = ({ kind: e, noMaxWidth: t }) => o("px-4 py-2", {
|
|
624
624
|
"max-w-xs sm:max-w-md md:max-w-2xl": !t,
|
|
625
625
|
"lg:max-w-3xl": e === "left" && !t
|
|
626
|
-
}), Be = ({ kind: e }) =>
|
|
626
|
+
}), Be = ({ kind: e }) => o({
|
|
627
627
|
"bg-surface-lighter dark:bg-surface-dark": e === "left",
|
|
628
628
|
"bg-surface-accent": e === "right"
|
|
629
|
-
}), Ne = ({ kind: e }) =>
|
|
629
|
+
}), Ne = ({ kind: e }) => o(
|
|
630
630
|
"prose prose-dark dark:prose-lighter",
|
|
631
631
|
"prose-ul:prose-li:marker:text-black",
|
|
632
632
|
"prose-blockquote:my-1",
|
|
@@ -636,7 +636,7 @@ const _e = ({ kind: e, noMaxWidth: t }) => i("px-4 py-2", {
|
|
|
636
636
|
}
|
|
637
637
|
), Ie = ({ kind: e, tail: t }) => {
|
|
638
638
|
if (t)
|
|
639
|
-
return
|
|
639
|
+
return o(
|
|
640
640
|
`${I}-${e}-tail`,
|
|
641
641
|
"rounded-3xl",
|
|
642
642
|
"relative",
|
|
@@ -651,17 +651,18 @@ const _e = ({ kind: e, noMaxWidth: t }) => i("px-4 py-2", {
|
|
|
651
651
|
}
|
|
652
652
|
);
|
|
653
653
|
if (!t)
|
|
654
|
-
return
|
|
654
|
+
return o("rounded-b-xl", {
|
|
655
655
|
"rounded-tr-xl": e === "left",
|
|
656
656
|
"rounded-tl-xl": e === "right"
|
|
657
657
|
});
|
|
658
658
|
}, Ce = ({
|
|
659
659
|
kind: e,
|
|
660
660
|
className: t,
|
|
661
|
-
|
|
662
|
-
|
|
661
|
+
contentClassName: r,
|
|
662
|
+
noMaxWidth: a,
|
|
663
|
+
tail: l
|
|
663
664
|
}) => {
|
|
664
|
-
const
|
|
665
|
+
const i = o(
|
|
665
666
|
I,
|
|
666
667
|
`${I}-${e}`,
|
|
667
668
|
"flex items-start",
|
|
@@ -669,74 +670,77 @@ const _e = ({ kind: e, noMaxWidth: t }) => i("px-4 py-2", {
|
|
|
669
670
|
"flex-row-reverse": e === "right"
|
|
670
671
|
},
|
|
671
672
|
t
|
|
672
|
-
),
|
|
673
|
+
), n = o(
|
|
673
674
|
`${I}-content`,
|
|
674
675
|
"flex flex-col empty:hidden",
|
|
675
|
-
_e({ kind: e, noMaxWidth:
|
|
676
|
+
_e({ kind: e, noMaxWidth: a }),
|
|
676
677
|
Ne({ kind: e }),
|
|
677
678
|
Be({ kind: e }),
|
|
678
|
-
Ie({ kind: e, tail:
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
"
|
|
682
|
-
"
|
|
683
|
-
"
|
|
679
|
+
Ie({ kind: e, tail: l }),
|
|
680
|
+
r
|
|
681
|
+
), c = "pr-2 pt-1 text-end text-xs text-copy-light", d = o("flex flex-col-reverse sm:flex-row", {
|
|
682
|
+
"ml-2": e === "left" && !l,
|
|
683
|
+
"mr-2": e === "right" && !l,
|
|
684
|
+
"ml-1": e === "left" && l,
|
|
685
|
+
"mr-1": e === "right" && l
|
|
684
686
|
});
|
|
685
687
|
return {
|
|
686
|
-
wrapper:
|
|
687
|
-
main:
|
|
688
|
-
footer:
|
|
688
|
+
wrapper: i,
|
|
689
|
+
main: n,
|
|
690
|
+
footer: c,
|
|
689
691
|
copyButton: d
|
|
690
692
|
};
|
|
691
693
|
}, Re = ({
|
|
692
694
|
children: e,
|
|
693
695
|
kind: t = "left",
|
|
694
696
|
className: r,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
697
|
+
contentClassName: a,
|
|
698
|
+
footer: l,
|
|
699
|
+
rawFooter: i,
|
|
700
|
+
copyToClipboard: n,
|
|
701
|
+
copyToClipboardFocusMode: c = "system",
|
|
699
702
|
copyToClipboardMode: d = "system",
|
|
700
|
-
noMaxWidth:
|
|
701
|
-
tail:
|
|
703
|
+
noMaxWidth: h = !1,
|
|
704
|
+
tail: v = !1
|
|
702
705
|
}) => {
|
|
703
|
-
const [
|
|
706
|
+
const [u, b] = q(!1), m = Ce({
|
|
704
707
|
kind: t,
|
|
705
708
|
className: r,
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
709
|
+
contentClassName: a,
|
|
710
|
+
noMaxWidth: h,
|
|
711
|
+
tail: v
|
|
712
|
+
}), w = !!n && (typeof n == "function" || typeof n == "string" || typeof e == "string"), _ = () => {
|
|
713
|
+
b(!0), typeof n == "function" ? n(e) : typeof n == "string" ? navigator.clipboard.writeText(n) : typeof e == "string" && navigator.clipboard.writeText(e);
|
|
710
714
|
};
|
|
711
|
-
return
|
|
715
|
+
return L(() => {
|
|
712
716
|
let g;
|
|
713
|
-
return
|
|
714
|
-
|
|
717
|
+
return u && (g = window.setTimeout(() => {
|
|
718
|
+
b(!1);
|
|
715
719
|
}, 3e3)), () => {
|
|
716
720
|
clearTimeout(g);
|
|
717
721
|
};
|
|
718
|
-
}, [
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */ s("div", { className:
|
|
721
|
-
|
|
722
|
+
}, [u]), /* @__PURE__ */ x("div", { className: m.wrapper, children: [
|
|
723
|
+
/* @__PURE__ */ x("div", { children: [
|
|
724
|
+
/* @__PURE__ */ s("div", { className: m.main, children: e }),
|
|
725
|
+
l && Object.keys(l).map((g, T) => l[g] ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */ x("p", { className: m.footer, children: [
|
|
722
726
|
g,
|
|
723
727
|
": ",
|
|
724
|
-
|
|
725
|
-
] }) }, `${g}-${
|
|
726
|
-
|
|
728
|
+
l[g]
|
|
729
|
+
] }) }, `${g}-${T}`) : null),
|
|
730
|
+
i && i
|
|
727
731
|
] }),
|
|
728
|
-
|
|
729
|
-
|
|
732
|
+
w && /* @__PURE__ */ s("div", { className: m.copyButton, children: /* @__PURE__ */ s(
|
|
733
|
+
U,
|
|
730
734
|
{
|
|
731
735
|
noBorder: !0,
|
|
732
736
|
noBackground: !0,
|
|
733
737
|
size: "small",
|
|
734
738
|
mode: d,
|
|
735
|
-
focusMode:
|
|
736
|
-
label:
|
|
739
|
+
focusMode: c,
|
|
740
|
+
label: u ? "Copied to clipboard" : "Copy to clipboard",
|
|
737
741
|
onClick: _,
|
|
738
|
-
disabled:
|
|
739
|
-
children:
|
|
742
|
+
disabled: u,
|
|
743
|
+
children: u ? /* @__PURE__ */ s(xe, { size: "size-3" }) : /* @__PURE__ */ s(we, { size: "size-3" })
|
|
740
744
|
}
|
|
741
745
|
) })
|
|
742
746
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-bubble",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
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.10",
|
|
47
47
|
"@versini/ui-icons": "*",
|
|
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": "9e5d6d4b86a1c509628c6e5ea0a101921cd8eb78"
|
|
55
55
|
}
|