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