@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.
@@ -1,76 +1,76 @@
1
- import { jsx as s, jsxs as x, Fragment as Y } from "react/jsx-runtime";
2
- import S, { useRef as N, useLayoutEffect as $, useState as q, useMemo as D, useEffect as V, useCallback as ee } from "react";
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 I = "av-bubble", A = "av-button", L = "icon", F = "button", M = "link", te = ({
4
+ const z = "av-bubble", A = "av-button", L = "icon", D = "button", V = "link", re = ({
5
5
  type: e,
6
- size: r,
7
- labelRight: t,
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 F:
15
- case M:
14
+ case D:
15
+ case V:
16
16
  return o({
17
- [n]: r === "small",
18
- [c]: r === "medium",
19
- [d]: r === "large"
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": r === "small" && !i && !(t || a),
27
- "h-6 px-2": r === "small" && !i && (t || a),
28
- "h-8 w-8 p-1": r === "medium" && !i && !(t || a),
29
- "h-8 px-3": r === "medium" && !i && (t || a),
30
- "h-12 w-12 p-2": r === "large" && !i && !(t || a),
31
- "h-12 px-4": r === "large" && !i && (t || a),
32
- "h-6 py-0": r === "small" && i && !(t || a),
33
- "h-6": r === "small" && i && (t || a),
34
- "h-8 py-1": r === "medium" && i && !(t || a),
35
- "h-8": r === "medium" && i && (t || a),
36
- "h-12 py-2": r === "large" && i && !(t || a),
37
- "h-12": r === "large" && i && (t || a)
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
- }, re = ({
40
+ }, te = ({
41
41
  type: e,
42
- size: r,
43
- labelRight: t,
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 F:
49
- case M:
48
+ case D:
49
+ case V:
50
50
  return o({
51
- "text-center": e === M,
52
- [l]: r === "small",
53
- [i]: r === "medium",
54
- [n]: r === "large"
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]: r === "small" && (t || a),
59
- [i]: r === "medium" && (t || a),
60
- [n]: r === "large" && (t || a)
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: r,
66
- truncate: t,
65
+ noBackground: t,
66
+ truncate: r,
67
67
  variant: a
68
68
  }) => {
69
- if (r)
69
+ if (t)
70
70
  return "not-prose";
71
71
  if (a === "primary")
72
72
  return o("not-prose", {
73
- truncate: t,
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: t,
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: t,
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: t
97
+ truncate: r
98
98
  });
99
99
  }, oe = ({
100
100
  mode: e,
101
- noBackground: r,
102
- variant: t
101
+ noBackground: t,
102
+ variant: r
103
103
  }) => {
104
- if (!r) {
105
- if (t === "primary")
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 (t === "secondary")
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 (t === "danger")
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 (t === "selected")
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: r,
138
- variant: t
137
+ disabled: t,
138
+ variant: r
139
139
  }) => {
140
- if (r)
140
+ if (t)
141
141
  return "";
142
- if (t === "primary")
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 (t === "secondary")
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 (t === "danger")
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 (t === "selected")
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: r,
168
- variant: t
167
+ disabled: t,
168
+ variant: r
169
169
  }) => {
170
- if (r)
170
+ if (t)
171
171
  return "";
172
- if (t === "primary")
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 (t === "secondary")
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 (t === "danger")
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 (t === "selected")
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: r,
198
- variant: t
197
+ noBorder: t,
198
+ variant: r
199
199
  }) => {
200
- if (r)
200
+ if (t)
201
201
  return "border border-transparent";
202
- if (t === "primary")
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 (t === "secondary")
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 (t === "danger")
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 (t === "selected")
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: r,
235
- iconClassName: t
236
- }) => r ? "" : o(
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
- t
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: r,
251
- raw: t,
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: m,
262
+ truncate: g,
263
263
  align: w,
264
264
  radius: B,
265
- animated: g
266
- }) => (b || (b = "primary"), t ? o(A, r) : o(
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: m
272
+ truncate: g
273
273
  }),
274
274
  oe({ mode: a, noBackground: u, variant: b }),
275
275
  ie({ radius: B }),
276
- te({
276
+ re({
277
277
  type: e,
278
278
  size: c,
279
279
  labelRight: h,
280
280
  labelLeft: v,
281
281
  align: w,
282
- animated: g
282
+ animated: m
283
283
  }),
284
- re({ type: e, size: c, labelRight: h, labelLeft: v }),
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": g
294
+ "transition-[width] duration-300 ease-in-out": m
295
295
  }),
296
- r
297
- )), ge = (e, r, t) => {
296
+ t
297
+ )), ge = (e, t, r) => {
298
298
  var a;
299
- !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
300
- }, P = S.forwardRef((e, r) => {
301
- const { onClick: t, noInternalClick: a = !1, ...l } = e;
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: r,
305
+ ref: t,
306
306
  onClick: (i) => {
307
- ge(i, a, t);
307
+ ge(i, a, r);
308
308
  },
309
309
  ...l
310
310
  }
311
311
  );
312
312
  });
313
- P.displayName = "BaseButton";
313
+ G.displayName = "BaseButton";
314
314
  function me() {
315
- const e = N(!1);
316
- return V(() => (e.current = !0, () => {
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 D(() => e.every((r) => r == null) ? () => {
322
- } : (r) => {
323
- e.forEach((t) => {
324
- typeof t == "function" ? t(r) : t != null && (t.current = r);
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 T(e) {
339
- const r = me(), t = N(0), a = N(null), [l, i] = q(fe), n = D(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
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(t.current), t.current = requestAnimationFrame(() => {
342
- a.current && r() && i(d.contentRect);
341
+ d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
342
+ a.current && t() && i(d.contentRect);
343
343
  }));
344
- }), [r]);
345
- return V(() => (a.current && (n == null || n.observe(a.current, e)), () => {
346
- n == null || n.disconnect(), t.current && cancelAnimationFrame(t.current);
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, O = S.forwardRef(
363
+ }, ye = 2, U = S.forwardRef(
364
364
  ({
365
365
  children: e,
366
- disabled: r = !1,
367
- mode: t = "system",
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: m,
378
+ labelLeft: g,
379
379
  noBackground: w = !1,
380
380
  align: B = "center",
381
- radius: g = "large",
382
- variant: C = "primary",
383
- iconClassName: W,
381
+ radius: m = "large",
382
+ variant: I = "primary",
383
+ iconClassName: N,
384
384
  animated: p = !1,
385
- ...X
386
- }, Z) => {
387
- const J = ue({
385
+ ...Y
386
+ }, X) => {
387
+ const Z = ue({
388
388
  type: L,
389
- mode: t,
389
+ mode: r,
390
390
  focusMode: a,
391
391
  fullWidth: l,
392
- disabled: r,
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: m,
398
+ labelLeft: g,
399
399
  noBackground: w,
400
400
  align: B,
401
- radius: g,
402
- variant: C,
401
+ radius: m,
402
+ variant: I,
403
403
  animated: p
404
- }), K = de({ mode: t, raw: c, iconClassName: W }), U = be({ animated: p }), [f, z] = T(), [y, R] = T(), [_, j] = T(), E = N(0), k = N(null), Q = he([Z, k]);
405
- return $(() => {
406
- _ && _.current && p && (E.current = j.width + pe[u] + (d ? 0 : ye));
407
- }, [j, _, u, d, p]), $(() => {
408
- k && k.current && p && (b && f && z.width > 0 ? (f.current && (f.current.style.opacity = "100"), k.current.style.width = `${z.width + E.current}px`) : m && R.width > 0 ? (y.current && (y.current.style.opacity = "100"), k.current.style.width = `${R.width + E.current}px`) : (f.current && (f.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"), k.current.style.width = `${ve[u]}px`));
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
- z,
410
+ E,
411
411
  b,
412
412
  f,
413
413
  R,
414
- m,
414
+ g,
415
415
  y,
416
416
  u,
417
417
  p
418
418
  ]), /* @__PURE__ */ x(
419
- P,
419
+ G,
420
420
  {
421
- ref: Q,
422
- className: J,
423
- disabled: r,
421
+ ref: K,
422
+ className: Z,
423
+ disabled: t,
424
424
  type: n,
425
425
  "aria-label": h || v,
426
- ...X,
426
+ ...Y,
427
427
  children: [
428
428
  /* @__PURE__ */ s(
429
- H,
429
+ F,
430
430
  {
431
- label: m,
431
+ label: g,
432
432
  labelRef: y,
433
- labelClass: U,
433
+ labelClass: $,
434
434
  labelInnerClass: "pr-2"
435
435
  }
436
436
  ),
437
- /* @__PURE__ */ s("span", { ref: _, className: K, children: e }),
437
+ /* @__PURE__ */ s("span", { ref: C, className: J, children: e }),
438
438
  /* @__PURE__ */ s(
439
- H,
439
+ F,
440
440
  {
441
441
  label: b,
442
442
  labelRef: f,
443
- labelClass: U,
443
+ labelClass: $,
444
444
  labelInnerClass: "pl-2"
445
445
  }
446
446
  )
@@ -448,13 +448,13 @@ const ve = {
448
448
  }
449
449
  );
450
450
  }
451
- ), H = ({
451
+ ), F = ({
452
452
  labelRef: e,
453
- labelClass: r,
454
- label: t,
453
+ labelClass: t,
454
+ label: r,
455
455
  labelInnerClass: a
456
- }) => /* @__PURE__ */ s("span", { ref: e, className: r, children: t && /* @__PURE__ */ s("span", { className: a, children: t }) });
457
- O.displayName = "ButtonIcon";
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/12/2025 09:18 AM EDT",
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: r = "system",
475
- className: t,
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": r === "dark",
491
- "after:border-table-light": r === "light",
492
- "after:border-table-dark dark:after:border-table-light": r === "system",
493
- "after:border-table-light dark:after:border-table-dark": r === "alt-system"
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
- O,
497
+ U,
498
498
  {
499
- className: o("justify-center", t),
499
+ className: o("justify-center", r),
500
500
  ref: i,
501
- mode: r,
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 G = ({
510
+ const W = ({
511
511
  children: e,
512
- fill: r,
513
- viewBox: t,
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(Y, { children: /* @__PURE__ */ x(
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: t || l,
528
- fill: r || "currentColor",
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: r,
556
- title: t,
555
+ viewBox: t,
556
+ title: r,
557
557
  monotone: a,
558
558
  ...l
559
559
  }) => /* @__PURE__ */ x(
560
- G,
560
+ W,
561
561
  {
562
562
  defaultViewBox: "0 0 448 512",
563
563
  size: "size-5",
564
- viewBox: r,
564
+ viewBox: t,
565
565
  className: e,
566
- title: t || "Copied",
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: r,
582
- title: t,
581
+ viewBox: t,
582
+ title: r,
583
583
  monotone: a,
584
584
  ...l
585
585
  }) => /* @__PURE__ */ s(
586
- G,
586
+ W,
587
587
  {
588
588
  defaultViewBox: "0 0 512 512",
589
589
  size: "size-5",
590
- viewBox: r,
590
+ viewBox: t,
591
591
  className: e,
592
- title: t || "Copy",
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: r }) => o("px-4 py-2", {
611
- "max-w-xs sm:max-w-md md:max-w-2xl": !r,
612
- "lg:max-w-3xl": e === "left" && !r
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: r }) => {
624
- if (r)
623
+ ), Ie = ({ kind: e, tail: t }) => {
624
+ if (t)
625
625
  return o(
626
- `${I}-${e}-tail`,
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 (!r)
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: r,
647
- contentClassName: t,
646
+ className: t,
647
+ contentClassName: r,
648
648
  noMaxWidth: a,
649
649
  tail: l
650
650
  }) => {
651
651
  const i = o(
652
- I,
653
- `${I}-${e}`,
652
+ z,
653
+ `${z}-${e}`,
654
654
  "flex items-start",
655
655
  {
656
656
  "flex-row-reverse": e === "right"
657
657
  },
658
- r
658
+ t
659
659
  ), n = o(
660
- `${I}-content`,
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
- t
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
- }, Te = ({
679
+ }, ze = "FOOTER_EMPTY", Me = ({
680
680
  children: e,
681
- kind: r = "left",
682
- className: t,
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] = q(!1), m = Ce({
693
- kind: r,
694
- className: t,
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 V(() => {
702
- let g;
703
- return u && (g = window.setTimeout(() => {
701
+ return O(() => {
702
+ let m;
703
+ return u && (m = window.setTimeout(() => {
704
704
  b(!1);
705
705
  }, 3e3)), () => {
706
- clearTimeout(g);
706
+ clearTimeout(m);
707
707
  };
708
- }, [u]), /* @__PURE__ */ x("div", { className: m.wrapper, children: [
708
+ }, [u]), /* @__PURE__ */ x("div", { className: g.wrapper, children: [
709
709
  /* @__PURE__ */ x("div", { children: [
710
- /* @__PURE__ */ s("div", { className: m.main, children: e }),
711
- l && Object.keys(l).map((g, C) => l[g] ? /* @__PURE__ */ s("div", { className: "prose-p:m-0", children: /* @__PURE__ */ x("p", { className: m.footer, children: [
712
- g,
713
- ": ",
714
- l[g]
715
- ] }) }, `${g}-${C}`) : null),
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: m.copyButton, children: /* @__PURE__ */ s(
719
- O,
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
- I as BUBBLE_CLASSNAME,
736
- Te as Bubble
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 B } from "./components/Bubble/Bubble.js";
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.6
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.6",
9
- buildTime: "04/12/2025 09:18 AM EDT",
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
- o as BUBBLE_CLASSNAME,
17
- B as Bubble
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.6",
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": "1bc09c4f0904bd8c01a22b1a32299fdd7598ae32"
54
+ "gitHead": "063765b85f3384f58ae1890c98736029a590ff79"
55
55
  }