bubble-toolbar 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +194 -2
- package/dist/index.d.mts +188 -0
- package/dist/index.d.ts +188 -0
- package/dist/index.js +487 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +441 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +125 -0
- package/package.json +55 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
BubbleArea: () => BubbleArea,
|
|
34
|
+
BubbleGroup: () => BubbleGroup,
|
|
35
|
+
BubbleIconButton: () => BubbleIconButton,
|
|
36
|
+
BubbleToolbar: () => BubbleToolbar,
|
|
37
|
+
BubbleToolbarContext: () => BubbleToolbarContext,
|
|
38
|
+
formatPx: () => formatPx,
|
|
39
|
+
getGlassStyles: () => getGlassStyles,
|
|
40
|
+
getValidChildren: () => getValidChildren,
|
|
41
|
+
resolveSize: () => resolveSize,
|
|
42
|
+
useBubbleToolbar: () => useBubbleToolbar
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(index_exports);
|
|
45
|
+
|
|
46
|
+
// src/BubbleToolbar.tsx
|
|
47
|
+
var import_react4 = require("react");
|
|
48
|
+
|
|
49
|
+
// src/context.ts
|
|
50
|
+
var import_react = require("react");
|
|
51
|
+
var defaultContextValue = {
|
|
52
|
+
size: "md",
|
|
53
|
+
theme: "glass",
|
|
54
|
+
blurred: true,
|
|
55
|
+
blurAmount: 16,
|
|
56
|
+
itemGap: 8,
|
|
57
|
+
bordered: true,
|
|
58
|
+
shadow: true
|
|
59
|
+
};
|
|
60
|
+
var BubbleToolbarContext = (0, import_react.createContext)(defaultContextValue);
|
|
61
|
+
var useBubbleToolbar = () => {
|
|
62
|
+
return (0, import_react.useContext)(BubbleToolbarContext);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/BubbleGroup.tsx
|
|
66
|
+
var import_react3 = require("react");
|
|
67
|
+
|
|
68
|
+
// src/utils/children.ts
|
|
69
|
+
var import_react2 = __toESM(require("react"));
|
|
70
|
+
function getValidChildren(children) {
|
|
71
|
+
const result = [];
|
|
72
|
+
import_react2.default.Children.forEach(children, (child) => {
|
|
73
|
+
if (child === null || child === void 0 || typeof child === "boolean") {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (import_react2.default.isValidElement(child) && child.type === import_react2.default.Fragment) {
|
|
77
|
+
const fragmentChildren = getValidChildren(
|
|
78
|
+
child.props.children
|
|
79
|
+
);
|
|
80
|
+
result.push(...fragmentChildren);
|
|
81
|
+
} else {
|
|
82
|
+
result.push(child);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/utils/styles.ts
|
|
89
|
+
function resolveSize(size) {
|
|
90
|
+
if (typeof size === "number") return size;
|
|
91
|
+
switch (size) {
|
|
92
|
+
case "sm":
|
|
93
|
+
return 40;
|
|
94
|
+
case "lg":
|
|
95
|
+
return 56;
|
|
96
|
+
case "md":
|
|
97
|
+
default:
|
|
98
|
+
return 48;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function formatPx(val) {
|
|
102
|
+
return typeof val === "number" ? `${val}px` : val;
|
|
103
|
+
}
|
|
104
|
+
function getGlassStyles(theme, blurred, blurAmount, bordered, shadow) {
|
|
105
|
+
const blurVal = formatPx(blurAmount);
|
|
106
|
+
let background;
|
|
107
|
+
let borderColor;
|
|
108
|
+
let color;
|
|
109
|
+
switch (theme) {
|
|
110
|
+
case "dark":
|
|
111
|
+
background = blurred ? "rgba(24, 24, 27, 0.72)" : "rgba(24, 24, 27, 0.95)";
|
|
112
|
+
borderColor = "rgba(255, 255, 255, 0.12)";
|
|
113
|
+
color = "#f4f4f5";
|
|
114
|
+
break;
|
|
115
|
+
case "light":
|
|
116
|
+
background = blurred ? "rgba(255, 255, 255, 0.75)" : "rgba(255, 255, 255, 0.95)";
|
|
117
|
+
borderColor = "rgba(0, 0, 0, 0.08)";
|
|
118
|
+
color = "#18181b";
|
|
119
|
+
break;
|
|
120
|
+
case "auto":
|
|
121
|
+
background = "var(--bubble-bg, rgba(255, 255, 255, 0.75))";
|
|
122
|
+
borderColor = "var(--bubble-border, rgba(0, 0, 0, 0.08))";
|
|
123
|
+
color = "var(--bubble-fg, #18181b)";
|
|
124
|
+
break;
|
|
125
|
+
case "glass":
|
|
126
|
+
default:
|
|
127
|
+
background = blurred ? "rgba(255, 255, 255, 0.65)" : "rgba(255, 255, 255, 0.92)";
|
|
128
|
+
borderColor = "rgba(255, 255, 255, 0.4)";
|
|
129
|
+
color = "#09090b";
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
const boxShadow = typeof shadow === "string" ? shadow : shadow ? "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06)" : "none";
|
|
133
|
+
return {
|
|
134
|
+
backgroundColor: background,
|
|
135
|
+
backdropFilter: blurred ? `blur(${blurVal}) saturate(180%)` : void 0,
|
|
136
|
+
WebkitBackdropFilter: blurred ? `blur(${blurVal}) saturate(180%)` : void 0,
|
|
137
|
+
border: bordered ? `1px solid ${borderColor}` : "none",
|
|
138
|
+
boxShadow,
|
|
139
|
+
color,
|
|
140
|
+
transition: "all 0.25s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/BubbleGroup.tsx
|
|
145
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
146
|
+
var BubbleGroup = (0, import_react3.forwardRef)(
|
|
147
|
+
({
|
|
148
|
+
children,
|
|
149
|
+
shape: explicitShape,
|
|
150
|
+
size: explicitSize,
|
|
151
|
+
itemGap: explicitItemGap,
|
|
152
|
+
className = "",
|
|
153
|
+
style,
|
|
154
|
+
...rest
|
|
155
|
+
}, ref) => {
|
|
156
|
+
const context = useBubbleToolbar();
|
|
157
|
+
const validChildren = getValidChildren(children);
|
|
158
|
+
const count = validChildren.length;
|
|
159
|
+
const computedShape = explicitShape || (count <= 1 ? "circle" : "pill");
|
|
160
|
+
const effectiveSize = resolveSize(explicitSize || context.size);
|
|
161
|
+
const effectiveItemGap = explicitItemGap !== void 0 ? explicitItemGap : context.itemGap;
|
|
162
|
+
const glassStyles = getGlassStyles(
|
|
163
|
+
context.theme,
|
|
164
|
+
context.blurred,
|
|
165
|
+
context.blurAmount,
|
|
166
|
+
context.bordered,
|
|
167
|
+
context.shadow
|
|
168
|
+
);
|
|
169
|
+
const isCircle = computedShape === "circle";
|
|
170
|
+
const groupStyles = {
|
|
171
|
+
...glassStyles,
|
|
172
|
+
height: `${effectiveSize}px`,
|
|
173
|
+
boxSizing: "border-box",
|
|
174
|
+
display: "inline-flex",
|
|
175
|
+
alignItems: "center",
|
|
176
|
+
flexShrink: 0,
|
|
177
|
+
userSelect: "none",
|
|
178
|
+
...isCircle ? {
|
|
179
|
+
width: `${effectiveSize}px`,
|
|
180
|
+
minWidth: `${effectiveSize}px`,
|
|
181
|
+
borderRadius: "9999px",
|
|
182
|
+
justifyContent: "center",
|
|
183
|
+
padding: 0
|
|
184
|
+
} : {
|
|
185
|
+
width: "auto",
|
|
186
|
+
minWidth: `${effectiveSize}px`,
|
|
187
|
+
borderRadius: "9999px",
|
|
188
|
+
flexDirection: "row",
|
|
189
|
+
justifyContent: "flex-start",
|
|
190
|
+
paddingLeft: `${Math.max(12, Math.round(effectiveSize * 0.28))}px`,
|
|
191
|
+
paddingRight: `${Math.max(12, Math.round(effectiveSize * 0.28))}px`,
|
|
192
|
+
gap: formatPx(effectiveItemGap)
|
|
193
|
+
},
|
|
194
|
+
...style
|
|
195
|
+
};
|
|
196
|
+
const combinedClassName = [
|
|
197
|
+
"bubble-group",
|
|
198
|
+
`bubble-group--${computedShape}`,
|
|
199
|
+
className
|
|
200
|
+
].filter(Boolean).join(" ");
|
|
201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
ref,
|
|
205
|
+
role: "group",
|
|
206
|
+
className: combinedClassName,
|
|
207
|
+
style: groupStyles,
|
|
208
|
+
"data-shape": computedShape,
|
|
209
|
+
"data-items-count": count,
|
|
210
|
+
...rest,
|
|
211
|
+
children: validChildren
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
BubbleGroup.displayName = "BubbleGroup";
|
|
217
|
+
|
|
218
|
+
// src/BubbleToolbar.tsx
|
|
219
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
220
|
+
var BubbleToolbar = (0, import_react4.forwardRef)(
|
|
221
|
+
({
|
|
222
|
+
groups,
|
|
223
|
+
children,
|
|
224
|
+
position = "bottom",
|
|
225
|
+
theme = "glass",
|
|
226
|
+
size = "md",
|
|
227
|
+
blurred = true,
|
|
228
|
+
blurAmount = 16,
|
|
229
|
+
groupGap = 8,
|
|
230
|
+
itemGap = 8,
|
|
231
|
+
bordered = true,
|
|
232
|
+
shadow = true,
|
|
233
|
+
className = "",
|
|
234
|
+
style,
|
|
235
|
+
ariaLabel = "Toolbar",
|
|
236
|
+
...rest
|
|
237
|
+
}, ref) => {
|
|
238
|
+
const contextValue = (0, import_react4.useMemo)(
|
|
239
|
+
() => ({
|
|
240
|
+
size,
|
|
241
|
+
theme,
|
|
242
|
+
blurred,
|
|
243
|
+
blurAmount,
|
|
244
|
+
itemGap,
|
|
245
|
+
bordered,
|
|
246
|
+
shadow
|
|
247
|
+
}),
|
|
248
|
+
[size, theme, blurred, blurAmount, itemGap, bordered, shadow]
|
|
249
|
+
);
|
|
250
|
+
const getPositionStyles = () => {
|
|
251
|
+
switch (position) {
|
|
252
|
+
case "bottom":
|
|
253
|
+
return {
|
|
254
|
+
position: "fixed",
|
|
255
|
+
bottom: "24px",
|
|
256
|
+
left: "50%",
|
|
257
|
+
transform: "translateX(-50%)",
|
|
258
|
+
zIndex: 1e3
|
|
259
|
+
};
|
|
260
|
+
case "top":
|
|
261
|
+
return {
|
|
262
|
+
position: "fixed",
|
|
263
|
+
top: "24px",
|
|
264
|
+
left: "50%",
|
|
265
|
+
transform: "translateX(-50%)",
|
|
266
|
+
zIndex: 1e3
|
|
267
|
+
};
|
|
268
|
+
case "static":
|
|
269
|
+
return {
|
|
270
|
+
position: "relative"
|
|
271
|
+
};
|
|
272
|
+
case "custom":
|
|
273
|
+
default:
|
|
274
|
+
return {};
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const containerStyles = {
|
|
278
|
+
...getPositionStyles(),
|
|
279
|
+
display: "inline-flex",
|
|
280
|
+
alignItems: "center",
|
|
281
|
+
gap: formatPx(groupGap),
|
|
282
|
+
maxWidth: "calc(100vw - 32px)",
|
|
283
|
+
overflowX: "auto",
|
|
284
|
+
overflowY: "hidden",
|
|
285
|
+
padding: "4px",
|
|
286
|
+
boxSizing: "border-box",
|
|
287
|
+
scrollbarWidth: "none",
|
|
288
|
+
// Firefox
|
|
289
|
+
msOverflowStyle: "none",
|
|
290
|
+
// IE/Edge
|
|
291
|
+
WebkitOverflowScrolling: "touch",
|
|
292
|
+
pointerEvents: "auto",
|
|
293
|
+
...style
|
|
294
|
+
};
|
|
295
|
+
const combinedClassName = [
|
|
296
|
+
"bubble-toolbar",
|
|
297
|
+
`bubble-toolbar--${position}`,
|
|
298
|
+
`bubble-toolbar--${theme}`,
|
|
299
|
+
className
|
|
300
|
+
].filter(Boolean).join(" ");
|
|
301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BubbleToolbarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
302
|
+
"div",
|
|
303
|
+
{
|
|
304
|
+
ref,
|
|
305
|
+
role: "toolbar",
|
|
306
|
+
"aria-label": ariaLabel,
|
|
307
|
+
className: combinedClassName,
|
|
308
|
+
style: containerStyles,
|
|
309
|
+
...rest,
|
|
310
|
+
children: [
|
|
311
|
+
groups && groups.length > 0 ? groups.map((groupItems, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BubbleGroup, { children: groupItems }, index)) : null,
|
|
312
|
+
children
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
) });
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
BubbleToolbar.displayName = "BubbleToolbar";
|
|
319
|
+
BubbleToolbar.Group = BubbleGroup;
|
|
320
|
+
|
|
321
|
+
// src/components/BubbleIconButton.tsx
|
|
322
|
+
var import_react5 = require("react");
|
|
323
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
324
|
+
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
|
+
] })
|
|
354
|
+
};
|
|
355
|
+
var BubbleIconButton = (0, import_react5.forwardRef)(
|
|
356
|
+
({
|
|
357
|
+
name,
|
|
358
|
+
icon,
|
|
359
|
+
active = false,
|
|
360
|
+
badge,
|
|
361
|
+
tooltip,
|
|
362
|
+
children,
|
|
363
|
+
className = "",
|
|
364
|
+
style,
|
|
365
|
+
onMouseEnter,
|
|
366
|
+
onMouseLeave,
|
|
367
|
+
ariaLabel,
|
|
368
|
+
...rest
|
|
369
|
+
}, ref) => {
|
|
370
|
+
const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
|
|
371
|
+
const iconContent = icon || (name ? ICONS[name] : null) || children;
|
|
372
|
+
const computedAriaLabel = ariaLabel || tooltip || (name ? `${name} button` : "button");
|
|
373
|
+
const buttonStyles = {
|
|
374
|
+
position: "relative",
|
|
375
|
+
display: "inline-flex",
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
justifyContent: "center",
|
|
378
|
+
width: "36px",
|
|
379
|
+
height: "36px",
|
|
380
|
+
borderRadius: "50%",
|
|
381
|
+
border: "none",
|
|
382
|
+
background: active ? "rgba(0, 0, 0, 0.08)" : isHovered ? "rgba(0, 0, 0, 0.05)" : "transparent",
|
|
383
|
+
color: "inherit",
|
|
384
|
+
cursor: "pointer",
|
|
385
|
+
padding: 0,
|
|
386
|
+
margin: 0,
|
|
387
|
+
outline: "none",
|
|
388
|
+
transition: "background-color 0.15s ease, transform 0.15s ease",
|
|
389
|
+
transform: isHovered ? "scale(1.06)" : "scale(1)",
|
|
390
|
+
flexShrink: 0,
|
|
391
|
+
...style
|
|
392
|
+
};
|
|
393
|
+
const badgeStyles = {
|
|
394
|
+
position: "absolute",
|
|
395
|
+
top: "4px",
|
|
396
|
+
right: "4px",
|
|
397
|
+
minWidth: "7px",
|
|
398
|
+
height: "7px",
|
|
399
|
+
padding: typeof badge === "number" || typeof badge === "string" ? "1px 3px" : 0,
|
|
400
|
+
borderRadius: "9999px",
|
|
401
|
+
backgroundColor: "#ef4444",
|
|
402
|
+
color: "#ffffff",
|
|
403
|
+
fontSize: "9px",
|
|
404
|
+
fontWeight: "bold",
|
|
405
|
+
lineHeight: "1",
|
|
406
|
+
display: "flex",
|
|
407
|
+
alignItems: "center",
|
|
408
|
+
justifyContent: "center",
|
|
409
|
+
boxShadow: "0 0 0 1.5px rgba(255, 255, 255, 0.9)"
|
|
410
|
+
};
|
|
411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
412
|
+
"button",
|
|
413
|
+
{
|
|
414
|
+
ref,
|
|
415
|
+
type: "button",
|
|
416
|
+
title: tooltip,
|
|
417
|
+
"aria-label": computedAriaLabel,
|
|
418
|
+
className: `bubble-icon-button ${active ? "bubble-icon-button--active" : ""} ${className}`.trim(),
|
|
419
|
+
style: buttonStyles,
|
|
420
|
+
onMouseEnter: (e) => {
|
|
421
|
+
setIsHovered(true);
|
|
422
|
+
onMouseEnter?.(e);
|
|
423
|
+
},
|
|
424
|
+
onMouseLeave: (e) => {
|
|
425
|
+
setIsHovered(false);
|
|
426
|
+
onMouseLeave?.(e);
|
|
427
|
+
},
|
|
428
|
+
...rest,
|
|
429
|
+
children: [
|
|
430
|
+
iconContent,
|
|
431
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "bubble-icon-button__badge", style: badgeStyles, children: typeof badge !== "boolean" ? badge : null }) : null
|
|
432
|
+
]
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
);
|
|
437
|
+
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
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
475
|
+
0 && (module.exports = {
|
|
476
|
+
BubbleArea,
|
|
477
|
+
BubbleGroup,
|
|
478
|
+
BubbleIconButton,
|
|
479
|
+
BubbleToolbar,
|
|
480
|
+
BubbleToolbarContext,
|
|
481
|
+
formatPx,
|
|
482
|
+
getGlassStyles,
|
|
483
|
+
getValidChildren,
|
|
484
|
+
resolveSize,
|
|
485
|
+
useBubbleToolbar
|
|
486
|
+
});
|
|
487
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/BubbleToolbar.tsx","../src/context.ts","../src/BubbleGroup.tsx","../src/utils/children.ts","../src/utils/styles.ts","../src/components/BubbleIconButton.tsx","../src/components/BubbleArea.tsx"],"sourcesContent":["export { BubbleToolbar } from './BubbleToolbar';\nexport type { BubbleToolbarComponent } from './BubbleToolbar';\nexport { BubbleGroup } from './BubbleGroup';\nexport { BubbleIconButton } from './components/BubbleIconButton';\nexport { BubbleArea } from './components/BubbleArea';\nexport { BubbleToolbarContext, useBubbleToolbar } from './context';\nexport { getValidChildren } from './utils/children';\nexport { resolveSize, formatPx, getGlassStyles } from './utils/styles';\n\nexport type {\n BubbleToolbarProps,\n BubbleGroupProps,\n BubbleIconButtonProps,\n BubbleAreaProps,\n BubbleToolbarTheme,\n BubbleToolbarPosition,\n BubbleToolbarSize,\n BubbleShape,\n} from './types';\n\n","import React, { forwardRef, useMemo } from 'react';\nimport type { BubbleToolbarProps } from './types';\nimport { BubbleToolbarContext, BubbleToolbarContextValue } from './context';\nimport { BubbleGroup } from './BubbleGroup';\nimport { formatPx } from './utils/styles';\n\nexport interface BubbleToolbarComponent\n extends React.ForwardRefExoticComponent<\n BubbleToolbarProps & React.RefAttributes<HTMLDivElement>\n > {\n Group: typeof BubbleGroup;\n}\n\nexport const BubbleToolbar = forwardRef<HTMLDivElement, BubbleToolbarProps>(\n (\n {\n groups,\n children,\n position = 'bottom',\n theme = 'glass',\n size = 'md',\n blurred = true,\n blurAmount = 16,\n groupGap = 8,\n itemGap = 8,\n bordered = true,\n shadow = true,\n className = '',\n style,\n ariaLabel = 'Toolbar',\n ...rest\n },\n ref\n ) => {\n const contextValue = useMemo<BubbleToolbarContextValue>(\n () => ({\n size,\n theme,\n blurred,\n blurAmount,\n itemGap,\n bordered,\n shadow,\n }),\n [size, theme, blurred, blurAmount, itemGap, bordered, shadow]\n );\n\n // Compute positioning styles\n const getPositionStyles = (): React.CSSProperties => {\n switch (position) {\n case 'bottom':\n return {\n position: 'fixed',\n bottom: '24px',\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 1000,\n };\n case 'top':\n return {\n position: 'fixed',\n top: '24px',\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 1000,\n };\n case 'static':\n return {\n position: 'relative',\n };\n case 'custom':\n default:\n return {};\n }\n };\n\n const containerStyles: React.CSSProperties = {\n ...getPositionStyles(),\n display: 'inline-flex',\n alignItems: 'center',\n gap: formatPx(groupGap),\n maxWidth: 'calc(100vw - 32px)',\n overflowX: 'auto',\n overflowY: 'hidden',\n padding: '4px',\n boxSizing: 'border-box',\n scrollbarWidth: 'none', // Firefox\n msOverflowStyle: 'none', // IE/Edge\n WebkitOverflowScrolling: 'touch',\n pointerEvents: 'auto',\n ...style,\n };\n\n const combinedClassName = [\n 'bubble-toolbar',\n `bubble-toolbar--${position}`,\n `bubble-toolbar--${theme}`,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <BubbleToolbarContext.Provider value={contextValue}>\n <div\n ref={ref}\n role=\"toolbar\"\n aria-label={ariaLabel}\n className={combinedClassName}\n style={containerStyles}\n {...rest}\n >\n {groups && groups.length > 0\n ? groups.map((groupItems, index) => (\n <BubbleGroup key={index}>\n {groupItems}\n </BubbleGroup>\n ))\n : null}\n {children}\n </div>\n </BubbleToolbarContext.Provider>\n );\n }\n) as BubbleToolbarComponent;\n\nBubbleToolbar.displayName = 'BubbleToolbar';\nBubbleToolbar.Group = BubbleGroup;\n\n","import { createContext, useContext } from 'react';\nimport type { BubbleToolbarTheme, BubbleToolbarSize } from './types';\n\nexport interface BubbleToolbarContextValue {\n size: BubbleToolbarSize;\n theme: BubbleToolbarTheme;\n blurred: boolean;\n blurAmount: number | string;\n itemGap: number | string;\n bordered: boolean;\n shadow: boolean | string;\n}\n\nexport const defaultContextValue: BubbleToolbarContextValue = {\n size: 'md',\n theme: 'glass',\n blurred: true,\n blurAmount: 16,\n itemGap: 8,\n bordered: true,\n shadow: true,\n};\n\nexport const BubbleToolbarContext = createContext<BubbleToolbarContextValue>(defaultContextValue);\n\nexport const useBubbleToolbar = (): BubbleToolbarContextValue => {\n return useContext(BubbleToolbarContext);\n};\n\n","import React, { forwardRef } from 'react';\nimport type { BubbleGroupProps, BubbleShape } from './types';\nimport { useBubbleToolbar } from './context';\nimport { getValidChildren } from './utils/children';\nimport { resolveSize, formatPx, getGlassStyles } from './utils/styles';\n\nexport const BubbleGroup = forwardRef<HTMLDivElement, BubbleGroupProps>(\n (\n {\n children,\n shape: explicitShape,\n size: explicitSize,\n itemGap: explicitItemGap,\n className = '',\n style,\n ...rest\n },\n ref\n ) => {\n const context = useBubbleToolbar();\n\n const validChildren = getValidChildren(children);\n const count = validChildren.length;\n\n // Morphological logic:\n // 1 node => circle\n // > 1 node => pill / rounded rectangle\n const computedShape: BubbleShape =\n explicitShape || (count <= 1 ? 'circle' : 'pill');\n\n const effectiveSize = resolveSize(explicitSize || context.size);\n const effectiveItemGap =\n explicitItemGap !== undefined ? explicitItemGap : context.itemGap;\n\n const glassStyles = getGlassStyles(\n context.theme,\n context.blurred,\n context.blurAmount,\n context.bordered,\n context.shadow\n );\n\n const isCircle = computedShape === 'circle';\n\n const groupStyles: React.CSSProperties = {\n ...glassStyles,\n height: `${effectiveSize}px`,\n boxSizing: 'border-box',\n display: 'inline-flex',\n alignItems: 'center',\n flexShrink: 0,\n userSelect: 'none',\n ...(isCircle\n ? {\n width: `${effectiveSize}px`,\n minWidth: `${effectiveSize}px`,\n borderRadius: '9999px',\n justifyContent: 'center',\n padding: 0,\n }\n : {\n width: 'auto',\n minWidth: `${effectiveSize}px`,\n borderRadius: '9999px',\n flexDirection: 'row',\n justifyContent: 'flex-start',\n paddingLeft: `${Math.max(12, Math.round(effectiveSize * 0.28))}px`,\n paddingRight: `${Math.max(12, Math.round(effectiveSize * 0.28))}px`,\n gap: formatPx(effectiveItemGap),\n }),\n ...style,\n };\n\n const combinedClassName = [\n 'bubble-group',\n `bubble-group--${computedShape}`,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div\n ref={ref}\n role=\"group\"\n className={combinedClassName}\n style={groupStyles}\n data-shape={computedShape}\n data-items-count={count}\n {...rest}\n >\n {validChildren}\n </div>\n );\n }\n);\n\nBubbleGroup.displayName = 'BubbleGroup';\n\n","import React, { ReactNode } from 'react';\n\n/**\n * Returns an array of non-null, non-undefined, non-boolean child elements.\n * Unpacks React.Fragment if encountered at the top level.\n */\nexport function getValidChildren(children: ReactNode): ReactNode[] {\n const result: ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (child === null || child === undefined || typeof child === 'boolean') {\n return;\n }\n\n if (React.isValidElement(child) && child.type === React.Fragment) {\n const fragmentChildren = getValidChildren(\n (child.props as { children?: ReactNode }).children\n );\n result.push(...fragmentChildren);\n } else {\n result.push(child);\n }\n });\n\n return result;\n}\n\n","import type { CSSProperties } from 'react';\nimport type { BubbleToolbarTheme, BubbleToolbarSize } from '../types';\n\nexport function resolveSize(size: BubbleToolbarSize): number {\n if (typeof size === 'number') return size;\n switch (size) {\n case 'sm':\n return 40;\n case 'lg':\n return 56;\n case 'md':\n default:\n return 48;\n }\n}\n\nexport function formatPx(val: number | string): string {\n return typeof val === 'number' ? `${val}px` : val;\n}\n\nexport function getGlassStyles(\n theme: BubbleToolbarTheme,\n blurred: boolean,\n blurAmount: number | string,\n bordered: boolean,\n shadow: boolean | string\n): CSSProperties {\n const blurVal = formatPx(blurAmount);\n\n // Background and border tint based on theme\n let background: string;\n let borderColor: string;\n let color: string;\n\n switch (theme) {\n case 'dark':\n background = blurred ? 'rgba(24, 24, 27, 0.72)' : 'rgba(24, 24, 27, 0.95)';\n borderColor = 'rgba(255, 255, 255, 0.12)';\n color = '#f4f4f5';\n break;\n case 'light':\n background = blurred ? 'rgba(255, 255, 255, 0.75)' : 'rgba(255, 255, 255, 0.95)';\n borderColor = 'rgba(0, 0, 0, 0.08)';\n color = '#18181b';\n break;\n case 'auto':\n background = 'var(--bubble-bg, rgba(255, 255, 255, 0.75))';\n borderColor = 'var(--bubble-border, rgba(0, 0, 0, 0.08))';\n color = 'var(--bubble-fg, #18181b)';\n break;\n case 'glass':\n default:\n // Neutral luminous frosted glass\n background = blurred ? 'rgba(255, 255, 255, 0.65)' : 'rgba(255, 255, 255, 0.92)';\n borderColor = 'rgba(255, 255, 255, 0.4)';\n color = '#09090b';\n break;\n }\n\n const boxShadow =\n typeof shadow === 'string'\n ? shadow\n : shadow\n ? '0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06)'\n : 'none';\n\n return {\n backgroundColor: background,\n backdropFilter: blurred ? `blur(${blurVal}) saturate(180%)` : undefined,\n WebkitBackdropFilter: blurred ? `blur(${blurVal}) saturate(180%)` : undefined,\n border: bordered ? `1px solid ${borderColor}` : 'none',\n boxShadow,\n color,\n transition: 'all 0.25s cubic-bezier(0.16, 1, 0.3, 1)',\n };\n}\n\n","import React, { forwardRef, useState } from 'react';\nimport type { BubbleIconButtonProps } from '../types';\n\n/**\n * Standard inline SVG icons for quick prototyping out-of-the-box\n */\nconst ICONS: Record<string, React.ReactNode> = {\n search: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n ),\n theme: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"5\" />\n <line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\" />\n <line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\" />\n <line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\" />\n <line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\" />\n <line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\" />\n <line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\" />\n <line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\" />\n <line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\" />\n </svg>\n ),\n chat: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n ),\n notifications: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9\" />\n <path d=\"M13.73 21a2 2 0 0 1-3.46 0\" />\n </svg>\n ),\n logo: (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polygon points=\"12 2 2 7 12 12 22 7 12 2\" />\n <polyline points=\"2 17 12 22 22 17\" />\n <polyline points=\"2 12 12 17 22 12\" />\n </svg>\n ),\n close: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n ),\n};\n\nexport const BubbleIconButton = forwardRef<HTMLButtonElement, BubbleIconButtonProps>(\n (\n {\n name,\n icon,\n active = false,\n badge,\n tooltip,\n children,\n className = '',\n style,\n onMouseEnter,\n onMouseLeave,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n\n const iconContent = icon || (name ? ICONS[name] : null) || children;\n const computedAriaLabel = ariaLabel || tooltip || (name ? `${name} button` : 'button');\n\n const buttonStyles: React.CSSProperties = {\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '36px',\n height: '36px',\n borderRadius: '50%',\n border: 'none',\n background: active\n ? 'rgba(0, 0, 0, 0.08)'\n : isHovered\n ? 'rgba(0, 0, 0, 0.05)'\n : 'transparent',\n color: 'inherit',\n cursor: 'pointer',\n padding: 0,\n margin: 0,\n outline: 'none',\n transition: 'background-color 0.15s ease, transform 0.15s ease',\n transform: isHovered ? 'scale(1.06)' : 'scale(1)',\n flexShrink: 0,\n ...style,\n };\n\n const badgeStyles: React.CSSProperties = {\n position: 'absolute',\n top: '4px',\n right: '4px',\n minWidth: '7px',\n height: '7px',\n padding: typeof badge === 'number' || typeof badge === 'string' ? '1px 3px' : 0,\n borderRadius: '9999px',\n backgroundColor: '#ef4444',\n color: '#ffffff',\n fontSize: '9px',\n fontWeight: 'bold',\n lineHeight: '1',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n boxShadow: '0 0 0 1.5px rgba(255, 255, 255, 0.9)',\n };\n\n return (\n <button\n ref={ref}\n type=\"button\"\n title={tooltip}\n aria-label={computedAriaLabel}\n className={`bubble-icon-button ${active ? 'bubble-icon-button--active' : ''} ${className}`.trim()}\n style={buttonStyles}\n onMouseEnter={(e) => {\n setIsHovered(true);\n onMouseEnter?.(e);\n }}\n onMouseLeave={(e) => {\n setIsHovered(false);\n onMouseLeave?.(e);\n }}\n {...rest}\n >\n {iconContent}\n {badge ? (\n <span className=\"bubble-icon-button__badge\" style={badgeStyles}>\n {typeof badge !== 'boolean' ? badge : null}\n </span>\n ) : null}\n </button>\n );\n }\n);\n\nBubbleIconButton.displayName = 'BubbleIconButton';\n\n","import React, { forwardRef } from 'react';\nimport type { BubbleAreaProps } from '../types';\nimport { formatPx } from '../utils/styles';\n\nexport const BubbleArea = forwardRef<HTMLDivElement, BubbleAreaProps>(\n (\n {\n children,\n minWidth = 120,\n maxWidth,\n className = '',\n style,\n ...rest\n },\n ref\n ) => {\n const areaStyles: React.CSSProperties = {\n display: 'inline-flex',\n alignItems: 'center',\n minWidth: formatPx(minWidth),\n maxWidth: maxWidth ? formatPx(maxWidth) : undefined,\n flex: '1 1 auto',\n fontSize: '14px',\n color: 'inherit',\n ...style,\n };\n\n return (\n <div\n ref={ref}\n className={`bubble-area ${className}`.trim()}\n style={areaStyles}\n {...rest}\n >\n {children}\n </div>\n );\n }\n);\n\nBubbleArea.displayName = 'BubbleArea';\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2C;;;ACA3C,mBAA0C;AAanC,IAAM,sBAAiD;AAAA,EAC5D,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AACV;AAEO,IAAM,2BAAuB,4BAAyC,mBAAmB;AAEzF,IAAM,mBAAmB,MAAiC;AAC/D,aAAO,yBAAW,oBAAoB;AACxC;;;AC3BA,IAAAC,gBAAkC;;;ACAlC,IAAAC,gBAAiC;AAM1B,SAAS,iBAAiB,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AAAA,MACtC,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU,SAAS,QAAQ;AAAA,MAC3B,UAAU,WAAW,SAAS,QAAQ,IAAI;AAAA,MAC1C,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,eAAe,SAAS,GAAG,KAAK;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["import_react","import_react","import_react","React","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
|