bubble-toolbar 0.1.0 → 1.0.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.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/index.ts
@@ -39,15 +29,51 @@ __export(index_exports, {
39
29
  getGlassStyles: () => getGlassStyles,
40
30
  getValidChildren: () => getValidChildren,
41
31
  resolveSize: () => resolveSize,
32
+ useBubbleActivity: () => useBubbleActivity,
42
33
  useBubbleToolbar: () => useBubbleToolbar
43
34
  });
44
35
  module.exports = __toCommonJS(index_exports);
45
36
 
46
- // src/BubbleToolbar.tsx
37
+ // src/activity.ts
38
+ var import_react = require("react");
39
+ var BubbleActivityContext = (0, import_react.createContext)(null);
40
+ var useBubbleActivity = () => {
41
+ const activity = (0, import_react.useContext)(BubbleActivityContext);
42
+ if (!activity) {
43
+ throw new Error("useBubbleActivity must be used inside a BubbleGroup or BubbleToolbar.Group.");
44
+ }
45
+ return activity;
46
+ };
47
+ var useGroupActivity = (externalBusy) => {
48
+ const [pending, setPending] = (0, import_react.useState)(0);
49
+ const mounted = (0, import_react.useRef)(true);
50
+ (0, import_react.useEffect)(() => {
51
+ mounted.current = true;
52
+ return () => {
53
+ mounted.current = false;
54
+ };
55
+ }, []);
56
+ const run = (0, import_react.useCallback)(async (task) => {
57
+ if (mounted.current) {
58
+ setPending((count) => count + 1);
59
+ }
60
+ try {
61
+ return await task();
62
+ } finally {
63
+ if (mounted.current) {
64
+ setPending((count) => count - 1);
65
+ }
66
+ }
67
+ }, []);
68
+ const isBusy = externalBusy || pending > 0;
69
+ return (0, import_react.useMemo)(() => ({ isBusy, run }), [isBusy, run]);
70
+ };
71
+
72
+ // src/BubbleGroup.tsx
47
73
  var import_react4 = require("react");
48
74
 
49
75
  // src/context.ts
50
- var import_react = require("react");
76
+ var import_react2 = require("react");
51
77
  var defaultContextValue = {
52
78
  size: "md",
53
79
  theme: "glass",
@@ -57,26 +83,21 @@ var defaultContextValue = {
57
83
  bordered: true,
58
84
  shadow: true
59
85
  };
60
- var BubbleToolbarContext = (0, import_react.createContext)(defaultContextValue);
86
+ var BubbleToolbarContext = (0, import_react2.createContext)(defaultContextValue);
61
87
  var useBubbleToolbar = () => {
62
- return (0, import_react.useContext)(BubbleToolbarContext);
88
+ return (0, import_react2.useContext)(BubbleToolbarContext);
63
89
  };
64
90
 
65
- // src/BubbleGroup.tsx
66
- var import_react3 = require("react");
67
-
68
91
  // src/utils/children.ts
69
- var import_react2 = __toESM(require("react"));
92
+ var import_react3 = require("react");
70
93
  function getValidChildren(children) {
71
94
  const result = [];
72
- import_react2.default.Children.forEach(children, (child) => {
95
+ import_react3.Children.forEach(children, (child) => {
73
96
  if (child === null || child === void 0 || typeof child === "boolean") {
74
97
  return;
75
98
  }
76
- if (import_react2.default.isValidElement(child) && child.type === import_react2.default.Fragment) {
77
- const fragmentChildren = getValidChildren(
78
- child.props.children
79
- );
99
+ if ((0, import_react3.isValidElement)(child) && child.type === import_react3.Fragment) {
100
+ const fragmentChildren = getValidChildren(child.props.children);
80
101
  result.push(...fragmentChildren);
81
102
  } else {
82
103
  result.push(child);
@@ -87,13 +108,14 @@ function getValidChildren(children) {
87
108
 
88
109
  // src/utils/styles.ts
89
110
  function resolveSize(size) {
90
- if (typeof size === "number") return size;
111
+ if (typeof size === "number") {
112
+ return size;
113
+ }
91
114
  switch (size) {
92
115
  case "sm":
93
116
  return 40;
94
117
  case "lg":
95
118
  return 56;
96
- case "md":
97
119
  default:
98
120
  return 48;
99
121
  }
@@ -122,7 +144,6 @@ function getGlassStyles(theme, blurred, blurAmount, bordered, shadow) {
122
144
  borderColor = "var(--bubble-border, rgba(0, 0, 0, 0.08))";
123
145
  color = "var(--bubble-fg, #18181b)";
124
146
  break;
125
- case "glass":
126
147
  default:
127
148
  background = blurred ? "rgba(255, 255, 255, 0.65)" : "rgba(255, 255, 255, 0.92)";
128
149
  borderColor = "rgba(255, 255, 255, 0.4)";
@@ -143,17 +164,23 @@ function getGlassStyles(theme, blurred, blurAmount, bordered, shadow) {
143
164
 
144
165
  // src/BubbleGroup.tsx
145
166
  var import_jsx_runtime = require("react/jsx-runtime");
146
- var BubbleGroup = (0, import_react3.forwardRef)(
167
+ var BubbleGroup = (0, import_react4.forwardRef)(
147
168
  ({
148
169
  children,
149
170
  shape: explicitShape,
150
171
  size: explicitSize,
151
172
  itemGap: explicitItemGap,
173
+ busy = false,
174
+ activityColors,
175
+ activityDuration,
152
176
  className = "",
153
177
  style,
154
178
  ...rest
155
179
  }, ref) => {
156
180
  const context = useBubbleToolbar();
181
+ const activity = useGroupActivity(Boolean(context.busy || busy));
182
+ const colors = activityColors ?? context.activityColors ?? ["#22d3ee", "#8b5cf6", "#ec4899"];
183
+ const duration = activityDuration ?? context.activityDuration ?? 2.4;
157
184
  const validChildren = getValidChildren(children);
158
185
  const count = validChildren.length;
159
186
  const computedShape = explicitShape || (count <= 1 ? "circle" : "pill");
@@ -168,6 +195,10 @@ var BubbleGroup = (0, import_react3.forwardRef)(
168
195
  );
169
196
  const isCircle = computedShape === "circle";
170
197
  const groupStyles = {
198
+ "--bubble-activity-color-1": colors[0],
199
+ "--bubble-activity-color-2": colors[1],
200
+ "--bubble-activity-color-3": colors[2],
201
+ "--bubble-activity-duration": `${Number.isFinite(duration) && duration > 0 ? duration : 2.4}s`,
171
202
  ...glassStyles,
172
203
  height: `${effectiveSize}px`,
173
204
  boxSizing: "border-box",
@@ -196,9 +227,10 @@ var BubbleGroup = (0, import_react3.forwardRef)(
196
227
  const combinedClassName = [
197
228
  "bubble-group",
198
229
  `bubble-group--${computedShape}`,
230
+ activity.isBusy && "bubble-group--busy",
199
231
  className
200
232
  ].filter(Boolean).join(" ");
201
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
233
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BubbleActivityContext.Provider, { value: activity, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
202
234
  "div",
203
235
  {
204
236
  ref,
@@ -208,16 +240,18 @@ var BubbleGroup = (0, import_react3.forwardRef)(
208
240
  "data-shape": computedShape,
209
241
  "data-items-count": count,
210
242
  ...rest,
243
+ "aria-busy": activity.isBusy,
211
244
  children: validChildren
212
245
  }
213
- );
246
+ ) });
214
247
  }
215
248
  );
216
249
  BubbleGroup.displayName = "BubbleGroup";
217
250
 
218
251
  // src/BubbleToolbar.tsx
252
+ var import_react5 = require("react");
219
253
  var import_jsx_runtime2 = require("react/jsx-runtime");
220
- var BubbleToolbar = (0, import_react4.forwardRef)(
254
+ var BubbleToolbar = (0, import_react5.forwardRef)(
221
255
  ({
222
256
  groups,
223
257
  children,
@@ -230,12 +264,15 @@ var BubbleToolbar = (0, import_react4.forwardRef)(
230
264
  itemGap = 8,
231
265
  bordered = true,
232
266
  shadow = true,
267
+ busy = false,
268
+ activityColors,
269
+ activityDuration,
233
270
  className = "",
234
271
  style,
235
272
  ariaLabel = "Toolbar",
236
273
  ...rest
237
274
  }, ref) => {
238
- const contextValue = (0, import_react4.useMemo)(
275
+ const contextValue = (0, import_react5.useMemo)(
239
276
  () => ({
240
277
  size,
241
278
  theme,
@@ -243,9 +280,23 @@ var BubbleToolbar = (0, import_react4.forwardRef)(
243
280
  blurAmount,
244
281
  itemGap,
245
282
  bordered,
246
- shadow
283
+ shadow,
284
+ busy,
285
+ activityColors,
286
+ activityDuration
247
287
  }),
248
- [size, theme, blurred, blurAmount, itemGap, bordered, shadow]
288
+ [
289
+ size,
290
+ theme,
291
+ blurred,
292
+ blurAmount,
293
+ itemGap,
294
+ bordered,
295
+ shadow,
296
+ busy,
297
+ activityColors,
298
+ activityDuration
299
+ ]
249
300
  );
250
301
  const getPositionStyles = () => {
251
302
  switch (position) {
@@ -269,7 +320,6 @@ var BubbleToolbar = (0, import_react4.forwardRef)(
269
320
  return {
270
321
  position: "relative"
271
322
  };
272
- case "custom":
273
323
  default:
274
324
  return {};
275
325
  }
@@ -308,7 +358,10 @@ var BubbleToolbar = (0, import_react4.forwardRef)(
308
358
  style: containerStyles,
309
359
  ...rest,
310
360
  children: [
311
- groups && groups.length > 0 ? groups.map((groupItems, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BubbleGroup, { children: groupItems }, index)) : null,
361
+ groups && groups.length > 0 ? groups.map((groupItems, index) => (
362
+ // biome-ignore lint/suspicious/noArrayIndexKey: The groups array API identifies groups by position; use compound children for keyed groups.
363
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BubbleGroup, { children: groupItems }, index)
364
+ )) : null,
312
365
  children
313
366
  ]
314
367
  }
@@ -318,41 +371,151 @@ var BubbleToolbar = (0, import_react4.forwardRef)(
318
371
  BubbleToolbar.displayName = "BubbleToolbar";
319
372
  BubbleToolbar.Group = BubbleGroup;
320
373
 
321
- // src/components/BubbleIconButton.tsx
322
- var import_react5 = require("react");
374
+ // src/components/BubbleArea.tsx
375
+ var import_react6 = require("react");
323
376
  var import_jsx_runtime3 = require("react/jsx-runtime");
377
+ var BubbleArea = (0, import_react6.forwardRef)(
378
+ ({ children, minWidth = 120, maxWidth, className = "", style, ...rest }, ref) => {
379
+ const areaStyles = {
380
+ display: "inline-flex",
381
+ alignItems: "center",
382
+ minWidth: formatPx(minWidth),
383
+ maxWidth: maxWidth ? formatPx(maxWidth) : void 0,
384
+ flex: "1 1 auto",
385
+ fontSize: "14px",
386
+ color: "inherit",
387
+ ...style
388
+ };
389
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref, className: `bubble-area ${className}`.trim(), style: areaStyles, ...rest, children });
390
+ }
391
+ );
392
+ BubbleArea.displayName = "BubbleArea";
393
+
394
+ // src/components/BubbleIconButton.tsx
395
+ var import_react7 = require("react");
396
+ var import_jsx_runtime4 = require("react/jsx-runtime");
324
397
  var ICONS = {
325
- search: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
326
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
327
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
328
- ] }),
329
- theme: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
330
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "12", cy: "12", r: "5" }),
331
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
332
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
333
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
334
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
335
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
336
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
337
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
338
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
339
- ] }),
340
- chat: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }),
341
- notifications: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
342
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }),
343
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })
344
- ] }),
345
- logo: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
346
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("polygon", { points: "12 2 2 7 12 12 22 7 12 2" }),
347
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("polyline", { points: "2 17 12 22 22 17" }),
348
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("polyline", { points: "2 12 12 17 22 12" })
349
- ] }),
350
- close: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
351
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
352
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
353
- ] })
398
+ search: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
399
+ "svg",
400
+ {
401
+ "aria-hidden": "true",
402
+ focusable: "false",
403
+ width: "18",
404
+ height: "18",
405
+ viewBox: "0 0 24 24",
406
+ fill: "none",
407
+ stroke: "currentColor",
408
+ strokeWidth: "2",
409
+ strokeLinecap: "round",
410
+ strokeLinejoin: "round",
411
+ children: [
412
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
413
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
414
+ ]
415
+ }
416
+ ),
417
+ theme: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
418
+ "svg",
419
+ {
420
+ "aria-hidden": "true",
421
+ focusable: "false",
422
+ width: "18",
423
+ height: "18",
424
+ viewBox: "0 0 24 24",
425
+ fill: "none",
426
+ stroke: "currentColor",
427
+ strokeWidth: "2",
428
+ strokeLinecap: "round",
429
+ strokeLinejoin: "round",
430
+ children: [
431
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "12", r: "5" }),
432
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
433
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
434
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
435
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
436
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
437
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
438
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
439
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
440
+ ]
441
+ }
442
+ ),
443
+ chat: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
444
+ "svg",
445
+ {
446
+ "aria-hidden": "true",
447
+ focusable: "false",
448
+ width: "18",
449
+ height: "18",
450
+ viewBox: "0 0 24 24",
451
+ fill: "none",
452
+ stroke: "currentColor",
453
+ strokeWidth: "2",
454
+ strokeLinecap: "round",
455
+ strokeLinejoin: "round",
456
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
457
+ }
458
+ ),
459
+ notifications: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
460
+ "svg",
461
+ {
462
+ "aria-hidden": "true",
463
+ focusable: "false",
464
+ width: "18",
465
+ height: "18",
466
+ viewBox: "0 0 24 24",
467
+ fill: "none",
468
+ stroke: "currentColor",
469
+ strokeWidth: "2",
470
+ strokeLinecap: "round",
471
+ strokeLinejoin: "round",
472
+ children: [
473
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }),
474
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })
475
+ ]
476
+ }
477
+ ),
478
+ logo: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
479
+ "svg",
480
+ {
481
+ "aria-hidden": "true",
482
+ focusable: "false",
483
+ width: "20",
484
+ height: "20",
485
+ viewBox: "0 0 24 24",
486
+ fill: "none",
487
+ stroke: "currentColor",
488
+ strokeWidth: "2",
489
+ strokeLinecap: "round",
490
+ strokeLinejoin: "round",
491
+ children: [
492
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polygon", { points: "12 2 2 7 12 12 22 7 12 2" }),
493
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "2 17 12 22 22 17" }),
494
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "2 12 12 17 22 12" })
495
+ ]
496
+ }
497
+ ),
498
+ close: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
499
+ "svg",
500
+ {
501
+ "aria-hidden": "true",
502
+ focusable: "false",
503
+ width: "18",
504
+ height: "18",
505
+ viewBox: "0 0 24 24",
506
+ fill: "none",
507
+ stroke: "currentColor",
508
+ strokeWidth: "2",
509
+ strokeLinecap: "round",
510
+ strokeLinejoin: "round",
511
+ children: [
512
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
513
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
514
+ ]
515
+ }
516
+ )
354
517
  };
355
- var BubbleIconButton = (0, import_react5.forwardRef)(
518
+ var BubbleIconButton = (0, import_react7.forwardRef)(
356
519
  ({
357
520
  name,
358
521
  icon,
@@ -367,7 +530,7 @@ var BubbleIconButton = (0, import_react5.forwardRef)(
367
530
  ariaLabel,
368
531
  ...rest
369
532
  }, ref) => {
370
- const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
533
+ const [isHovered, setIsHovered] = (0, import_react7.useState)(false);
371
534
  const iconContent = icon || (name ? ICONS[name] : null) || children;
372
535
  const computedAriaLabel = ariaLabel || tooltip || (name ? `${name} button` : "button");
373
536
  const buttonStyles = {
@@ -408,7 +571,7 @@ var BubbleIconButton = (0, import_react5.forwardRef)(
408
571
  justifyContent: "center",
409
572
  boxShadow: "0 0 0 1.5px rgba(255, 255, 255, 0.9)"
410
573
  };
411
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
574
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
412
575
  "button",
413
576
  {
414
577
  ref,
@@ -428,49 +591,13 @@ var BubbleIconButton = (0, import_react5.forwardRef)(
428
591
  ...rest,
429
592
  children: [
430
593
  iconContent,
431
- badge ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "bubble-icon-button__badge", style: badgeStyles, children: typeof badge !== "boolean" ? badge : null }) : null
594
+ badge ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "bubble-icon-button__badge", style: badgeStyles, children: typeof badge !== "boolean" ? badge : null }) : null
432
595
  ]
433
596
  }
434
597
  );
435
598
  }
436
599
  );
437
600
  BubbleIconButton.displayName = "BubbleIconButton";
438
-
439
- // src/components/BubbleArea.tsx
440
- var import_react6 = require("react");
441
- var import_jsx_runtime4 = require("react/jsx-runtime");
442
- var BubbleArea = (0, import_react6.forwardRef)(
443
- ({
444
- children,
445
- minWidth = 120,
446
- maxWidth,
447
- className = "",
448
- style,
449
- ...rest
450
- }, ref) => {
451
- const areaStyles = {
452
- display: "inline-flex",
453
- alignItems: "center",
454
- minWidth: formatPx(minWidth),
455
- maxWidth: maxWidth ? formatPx(maxWidth) : void 0,
456
- flex: "1 1 auto",
457
- fontSize: "14px",
458
- color: "inherit",
459
- ...style
460
- };
461
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
462
- "div",
463
- {
464
- ref,
465
- className: `bubble-area ${className}`.trim(),
466
- style: areaStyles,
467
- ...rest,
468
- children
469
- }
470
- );
471
- }
472
- );
473
- BubbleArea.displayName = "BubbleArea";
474
601
  // Annotate the CommonJS export names for ESM import in node:
475
602
  0 && (module.exports = {
476
603
  BubbleArea,
@@ -482,6 +609,7 @@ BubbleArea.displayName = "BubbleArea";
482
609
  getGlassStyles,
483
610
  getValidChildren,
484
611
  resolveSize,
612
+ useBubbleActivity,
485
613
  useBubbleToolbar
486
614
  });
487
615
  //# sourceMappingURL=index.js.map