@ultrst-armada/floks 2.0.2 → 2.0.4

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,783 +0,0 @@
1
- import {
2
- useFloksFrnlStore
3
- } from "./chunk-B4XTM5TI.js";
4
- import {
5
- usePalette
6
- } from "./chunk-ZQK5I5ZL.js";
7
- import {
8
- useBottomStrip
9
- } from "./chunk-62ITRDJX.js";
10
-
11
- // src/hierarchy/UIParent.tsx
12
- import React from "react";
13
- var UIParent = ({
14
- as: Component = "div",
15
- children,
16
- className = "",
17
- ...props
18
- }) => {
19
- return React.createElement(Component, { className, ...props }, children);
20
- };
21
-
22
- // src/hierarchy/ButtonParent.tsx
23
- import React2, { useMemo } from "react";
24
- import { jsx, jsxs } from "react/jsx-runtime";
25
- var SIZE_STYLES = {
26
- xs: "px-1.5 py-0.5 text-[9px] gap-1",
27
- sm: "px-2 py-1 text-[10px] gap-1.5",
28
- md: "px-3 py-1.5 text-xs gap-2",
29
- lg: "px-4 py-2 text-sm gap-2.5",
30
- xl: "px-5 py-2.5 text-base gap-3"
31
- };
32
- var ButtonParent = ({
33
- id,
34
- variant = "primary",
35
- size = "md",
36
- label,
37
- tooltip,
38
- description,
39
- tooltipDirection = "bottom",
40
- shortcutHint,
41
- isActive = false,
42
- icon,
43
- className = "",
44
- disabled = false,
45
- children,
46
- onClick,
47
- style,
48
- ...rest
49
- }) => {
50
- const palette = usePalette();
51
- const { setInspectionText } = useBottomStrip();
52
- const variantStyle = useMemo(() => {
53
- switch (variant) {
54
- case "accent":
55
- return {
56
- backgroundColor: palette.accentPrimary,
57
- borderColor: palette.accentSecondary,
58
- color: palette.textInverse,
59
- boxShadow: `0 0 10px ${palette.accentGlow}`
60
- };
61
- case "dock":
62
- return {
63
- backgroundColor: palette.bgPrimary,
64
- borderColor: isActive ? palette.accentPrimary : palette.borderMedium,
65
- color: isActive ? palette.accentPrimary : palette.textPrimary
66
- };
67
- case "danger":
68
- return {
69
- backgroundColor: `${palette.danger}25`,
70
- borderColor: `${palette.danger}80`,
71
- color: palette.danger
72
- };
73
- case "emerald":
74
- return {
75
- backgroundColor: `${palette.success}25`,
76
- borderColor: `${palette.success}80`,
77
- color: palette.success
78
- };
79
- case "sky":
80
- return {
81
- backgroundColor: `${palette.info}25`,
82
- borderColor: `${palette.info}80`,
83
- color: palette.info
84
- };
85
- case "amber":
86
- return {
87
- backgroundColor: `${palette.warning}25`,
88
- borderColor: `${palette.warning}80`,
89
- color: palette.warning
90
- };
91
- case "ghost":
92
- return {
93
- backgroundColor: "transparent",
94
- borderColor: "transparent",
95
- color: palette.textMuted
96
- };
97
- case "outline":
98
- return {
99
- backgroundColor: "transparent",
100
- borderColor: palette.borderMedium,
101
- color: palette.textPrimary
102
- };
103
- case "secondary":
104
- return {
105
- backgroundColor: palette.bgSurface,
106
- borderColor: palette.borderSubtle,
107
- color: palette.textSecondary
108
- };
109
- case "primary":
110
- default:
111
- return {
112
- backgroundColor: palette.bgElevated,
113
- borderColor: palette.borderMedium,
114
- color: palette.textPrimary
115
- };
116
- }
117
- }, [variant, palette, isActive]);
118
- const activeDynamicStyle = isActive ? {
119
- borderColor: palette.accentPrimary,
120
- boxShadow: `0 0 12px ${palette.accentGlow}`,
121
- color: variant === "accent" ? palette.textInverse : palette.accentPrimary
122
- } : {};
123
- const handleMouseEnter = () => {
124
- const effectiveLabel = label || tooltip || (typeof children === "string" ? children : void 0);
125
- const effectiveDesc = description || (shortcutHint ? `[${shortcutHint}]` : void 0);
126
- if (effectiveLabel || effectiveDesc) {
127
- setInspectionText(effectiveLabel || null, effectiveDesc || null);
128
- }
129
- };
130
- const handleMouseLeave = () => {
131
- setInspectionText(null);
132
- };
133
- const store = useFloksFrnlStore();
134
- const autoId = React2.useId().replace(/[:/]/g, "");
135
- const effectiveId = id ?? (label ? `floks.button.${label.toLowerCase().replace(/[^a-z0-9]/g, "-")}.${autoId}` : `floks.button.${autoId}`);
136
- const effectiveState = disabled ? "disabled" : isActive ? "active" : "default";
137
- React2.useEffect(() => {
138
- store.getState().registerEntity(effectiveId, {
139
- state: effectiveState,
140
- properties: { variant, size, disabled, isActive, label, kind: "primitive" }
141
- });
142
- return () => {
143
- store.getState().unregisterEntity(effectiveId);
144
- };
145
- }, [effectiveId, store]);
146
- React2.useEffect(() => {
147
- const entity = store.getState().entities[effectiveId];
148
- if (entity) {
149
- if (entity.state !== effectiveState) {
150
- store.getState().setEntityState(effectiveId, effectiveState);
151
- }
152
- store.getState().setEntityProperties(effectiveId, {
153
- variant,
154
- size,
155
- disabled,
156
- isActive,
157
- label,
158
- kind: "primitive"
159
- });
160
- }
161
- }, [effectiveId, effectiveState, variant, size, disabled, isActive, label, store]);
162
- return /* @__PURE__ */ jsxs(
163
- "button",
164
- {
165
- ...rest,
166
- id: effectiveId,
167
- "data-ui-parent": "ButtonParent",
168
- "data-frnl-id": effectiveId,
169
- "data-frnl-kind": "ui-primitive",
170
- "data-frnl-state": effectiveState,
171
- type: "button",
172
- disabled,
173
- onMouseEnter: handleMouseEnter,
174
- onMouseLeave: handleMouseLeave,
175
- onFocus: handleMouseEnter,
176
- onBlur: handleMouseLeave,
177
- onClick: (e) => {
178
- if (disabled) return;
179
- onClick?.(e);
180
- },
181
- className: `inline-flex items-center justify-center font-mono font-bold uppercase tracking-wider border transition-all duration-150 active:scale-95 select-none disabled:opacity-40 disabled:pointer-events-none ${SIZE_STYLES[size]} ${className}`,
182
- style: { ...variantStyle, ...activeDynamicStyle, ...style },
183
- children: [
184
- icon && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: icon }),
185
- children && /* @__PURE__ */ jsx("span", { children })
186
- ]
187
- }
188
- );
189
- };
190
- var SplitButton = ({
191
- id,
192
- label,
193
- onPrimaryClick,
194
- onDropdownClick,
195
- variant = "primary",
196
- size = "md",
197
- disabled = false,
198
- isOpen = false,
199
- dropdownMenu,
200
- menuOccupants,
201
- className = "",
202
- style
203
- }) => {
204
- const store = useFloksFrnlStore();
205
- const autoId = React2.useId().replace(/[:/]/g, "");
206
- const compositeId = id ?? (label ? `floks.splitbutton.${label.toLowerCase().replace(/[^a-z0-9]/g, "-")}.${autoId}` : `floks.splitbutton.${autoId}`);
207
- const effectiveState = disabled ? "disabled" : isOpen ? "open" : "default";
208
- React2.useEffect(() => {
209
- store.getState().registerEntity(compositeId, {
210
- state: effectiveState,
211
- properties: { variant, size, isOpen, label, kind: "composite" }
212
- });
213
- return () => {
214
- store.getState().unregisterEntity(compositeId);
215
- };
216
- }, [compositeId, store]);
217
- React2.useEffect(() => {
218
- const entity = store.getState().entities[compositeId];
219
- if (entity) {
220
- if (entity.state !== effectiveState) {
221
- store.getState().setEntityState(compositeId, effectiveState);
222
- }
223
- store.getState().setEntityProperties(compositeId, {
224
- variant,
225
- size,
226
- isOpen,
227
- label,
228
- kind: "composite"
229
- });
230
- }
231
- }, [compositeId, effectiveState, variant, size, isOpen, label, store]);
232
- return /* @__PURE__ */ jsxs(
233
- "div",
234
- {
235
- id: compositeId,
236
- "data-frnl-id": compositeId,
237
- "data-frnl-kind": "ui-composite",
238
- "data-frnl-state": effectiveState,
239
- className: `inline-flex items-center relative ${className}`,
240
- style,
241
- children: [
242
- /* @__PURE__ */ jsx(
243
- ButtonParent,
244
- {
245
- id: `${compositeId}.primaryAction`,
246
- variant,
247
- size,
248
- disabled,
249
- onClick: onPrimaryClick,
250
- className: "rounded-r-none border-r-0",
251
- children: label
252
- }
253
- ),
254
- /* @__PURE__ */ jsx(
255
- ButtonParent,
256
- {
257
- id: `${compositeId}.dropdownAction`,
258
- variant,
259
- size,
260
- disabled,
261
- onClick: onDropdownClick,
262
- className: "rounded-l-none px-2",
263
- "aria-label": "Toggle Menu",
264
- "aria-expanded": isOpen,
265
- children: "\u25BE"
266
- }
267
- ),
268
- isOpen && (dropdownMenu || menuOccupants) && /* @__PURE__ */ jsx("div", { className: "absolute top-full left-0 mt-1 z-50", children: dropdownMenu || menuOccupants && Object.values(menuOccupants)[0] })
269
- ]
270
- }
271
- );
272
- };
273
- var ActionButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "accent", ...props });
274
- var IconButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "secondary", ...props });
275
- var ToggleButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "dock", ...props });
276
- var DangerButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "danger", ...props });
277
- var GhostButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "ghost", ...props });
278
-
279
- // src/hierarchy/PanelParent.tsx
280
- import { useMemo as useMemo2 } from "react";
281
- import { Pin, X, Move } from "lucide-react";
282
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
283
- var PanelParent = ({
284
- id,
285
- title,
286
- subtitle,
287
- badge,
288
- isPinned = false,
289
- accentColor,
290
- zIndex = 50,
291
- width,
292
- height,
293
- position,
294
- children,
295
- headerActions,
296
- className = "",
297
- onTogglePin,
298
- onClose,
299
- onMouseDown
300
- }) => {
301
- const palette = usePalette();
302
- const effectiveAccent = accentColor || palette.accentPrimary;
303
- const style = useMemo2(() => ({
304
- zIndex,
305
- width: width ? `${width}px` : void 0,
306
- height: height ? `${height}px` : void 0,
307
- left: position ? `${position.x}px` : void 0,
308
- top: position ? `${position.y}px` : void 0,
309
- position: position ? "fixed" : "relative",
310
- backgroundColor: palette.bgSurface,
311
- borderColor: palette.borderMedium,
312
- boxShadow: `4px 4px 0px ${palette.bgPrimary}, 0 0 20px rgba(0,0,0,0.6)`,
313
- color: palette.textPrimary
314
- }), [zIndex, width, height, position, palette]);
315
- return /* @__PURE__ */ jsxs2(
316
- "div",
317
- {
318
- id,
319
- "data-ui-parent": "PanelParent",
320
- onMouseDown,
321
- style,
322
- className: `flex flex-col border-2 select-none font-mono transition-colors ${className}`,
323
- children: [
324
- /* @__PURE__ */ jsxs2(
325
- "div",
326
- {
327
- style: {
328
- backgroundColor: palette.bgElevated,
329
- borderBottomColor: palette.borderSubtle
330
- },
331
- className: "flex items-center justify-between px-3 py-2 border-b cursor-move",
332
- children: [
333
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 truncate", children: [
334
- /* @__PURE__ */ jsx2(Move, { className: "w-3.5 h-3.5 shrink-0", style: { color: palette.textMuted } }),
335
- /* @__PURE__ */ jsxs2("div", { className: "flex flex-col truncate", children: [
336
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1.5 truncate", children: [
337
- /* @__PURE__ */ jsx2(
338
- "span",
339
- {
340
- style: { color: effectiveAccent },
341
- className: "text-xs font-black uppercase tracking-wider truncate",
342
- children: title
343
- }
344
- ),
345
- badge && /* @__PURE__ */ jsx2(
346
- "span",
347
- {
348
- style: {
349
- backgroundColor: palette.bgInput,
350
- borderColor: palette.borderSubtle,
351
- color: palette.textSecondary
352
- },
353
- className: "text-[8px] border px-1 py-0.2 rounded font-bold",
354
- children: badge
355
- }
356
- )
357
- ] }),
358
- subtitle && /* @__PURE__ */ jsx2("span", { style: { color: palette.textMuted }, className: "text-[9px] truncate", children: subtitle })
359
- ] })
360
- ] }),
361
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1 shrink-0", children: [
362
- headerActions,
363
- onTogglePin && /* @__PURE__ */ jsx2(
364
- ButtonParent,
365
- {
366
- variant: isPinned ? "accent" : "ghost",
367
- size: "xs",
368
- tooltip: isPinned ? "Unpin Window" : "Pin Window in Workspace",
369
- tooltipDirection: "bottom",
370
- onClick: (e) => {
371
- e.stopPropagation();
372
- onTogglePin();
373
- },
374
- children: /* @__PURE__ */ jsx2(Pin, { className: `w-3.5 h-3.5 ${isPinned ? "rotate-45" : ""}` })
375
- }
376
- ),
377
- onClose && /* @__PURE__ */ jsx2(
378
- ButtonParent,
379
- {
380
- variant: "danger",
381
- size: "xs",
382
- tooltip: "Close Window",
383
- tooltipDirection: "bottom",
384
- onClick: (e) => {
385
- e.stopPropagation();
386
- onClose();
387
- },
388
- children: /* @__PURE__ */ jsx2(X, { className: "w-3.5 h-3.5" })
389
- }
390
- )
391
- ] })
392
- ]
393
- }
394
- ),
395
- /* @__PURE__ */ jsx2("div", { className: "flex-1 overflow-auto p-3", children })
396
- ]
397
- }
398
- );
399
- };
400
- var ModalPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { zIndex: 100, ...props });
401
- var InspectorPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { ...props });
402
- var CardPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { ...props });
403
- var ToolbarPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { ...props });
404
-
405
- // src/hierarchy/InputParent.tsx
406
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
407
- var SliderInput = ({
408
- id,
409
- value,
410
- min = 0,
411
- max = 100,
412
- step = 1,
413
- label,
414
- unit = "",
415
- onChange,
416
- className = "",
417
- disabled = false
418
- }) => {
419
- const palette = usePalette();
420
- return /* @__PURE__ */ jsxs3("div", { id, "data-ui-parent": "InputParent", className: `flex flex-col gap-1 select-none font-mono ${className}`, children: [
421
- label && /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center text-[10px] tracking-wider uppercase", children: [
422
- /* @__PURE__ */ jsx3("span", { style: { color: palette.textSecondary }, children: label }),
423
- /* @__PURE__ */ jsxs3("span", { style: { color: palette.accentPrimary }, className: "font-bold", children: [
424
- value,
425
- unit
426
- ] })
427
- ] }),
428
- /* @__PURE__ */ jsx3(
429
- "input",
430
- {
431
- type: "range",
432
- min,
433
- max,
434
- step,
435
- value,
436
- disabled,
437
- onChange: (e) => onChange(parseFloat(e.target.value)),
438
- style: {
439
- accentColor: palette.accentPrimary,
440
- backgroundColor: palette.bgInput
441
- },
442
- className: "w-full h-1.5 rounded-none border cursor-pointer disabled:opacity-40"
443
- }
444
- )
445
- ] });
446
- };
447
- var TextInput = ({
448
- id,
449
- label,
450
- value,
451
- className = "",
452
- style,
453
- ...props
454
- }) => {
455
- const palette = usePalette();
456
- return /* @__PURE__ */ jsxs3("div", { "data-ui-parent": "InputParent", className: "flex flex-col gap-1 select-none font-mono", children: [
457
- label && /* @__PURE__ */ jsx3("label", { style: { color: palette.textSecondary }, className: "text-[10px] uppercase font-bold tracking-wider", children: label }),
458
- /* @__PURE__ */ jsx3(
459
- "input",
460
- {
461
- id,
462
- value,
463
- style: {
464
- backgroundColor: palette.bgInput,
465
- borderColor: palette.borderMedium,
466
- color: palette.textPrimary,
467
- ...style
468
- },
469
- className: `w-full px-2.5 py-1.5 text-xs border rounded-none focus:outline-none transition-colors ${className}`,
470
- ...props
471
- }
472
- )
473
- ] });
474
- };
475
- var SelectInput = ({
476
- id,
477
- label,
478
- value,
479
- options = [],
480
- children,
481
- className = "",
482
- style,
483
- ...props
484
- }) => {
485
- const palette = usePalette();
486
- return /* @__PURE__ */ jsxs3("div", { "data-ui-parent": "InputParent", className: "flex flex-col gap-1 select-none font-mono", children: [
487
- label && /* @__PURE__ */ jsx3("label", { style: { color: palette.textSecondary }, className: "text-[10px] uppercase font-bold tracking-wider", children: label }),
488
- /* @__PURE__ */ jsxs3(
489
- "select",
490
- {
491
- id,
492
- value,
493
- style: {
494
- backgroundColor: palette.bgInput,
495
- borderColor: palette.borderMedium,
496
- color: palette.textPrimary,
497
- ...style
498
- },
499
- className: `w-full px-2.5 py-1.5 text-xs border rounded-none focus:outline-none transition-colors cursor-pointer ${className}`,
500
- ...props,
501
- children: [
502
- options.map((opt) => /* @__PURE__ */ jsx3("option", { value: opt.value, style: { backgroundColor: palette.bgSurface, color: palette.textPrimary }, children: opt.label }, opt.value)),
503
- children
504
- ]
505
- }
506
- )
507
- ] });
508
- };
509
- var ToggleInput = ({
510
- id,
511
- checked,
512
- onChange,
513
- label,
514
- disabled = false
515
- }) => {
516
- const palette = usePalette();
517
- return /* @__PURE__ */ jsxs3(
518
- "label",
519
- {
520
- id,
521
- "data-ui-parent": "InputParent",
522
- className: "inline-flex items-center gap-2 cursor-pointer select-none font-mono text-xs",
523
- style: { color: palette.textPrimary },
524
- children: [
525
- /* @__PURE__ */ jsx3(
526
- "input",
527
- {
528
- type: "checkbox",
529
- checked,
530
- disabled,
531
- onChange: (e) => onChange(e.target.checked),
532
- style: { accentColor: palette.accentPrimary },
533
- className: "w-3.5 h-3.5 cursor-pointer rounded-none border"
534
- }
535
- ),
536
- /* @__PURE__ */ jsx3("span", { children: label })
537
- ]
538
- }
539
- );
540
- };
541
-
542
- // src/hierarchy/TileParent.tsx
543
- import { useState, useRef, useEffect } from "react";
544
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
545
- var TileParent = ({
546
- id,
547
- icon,
548
- accentColor,
549
- badge,
550
- badgeColor,
551
- title,
552
- description,
553
- primaryActionText = "Click to focus",
554
- secondaryActionText = "Double-click to open",
555
- isSelected = false,
556
- isPlaying = false,
557
- onClick,
558
- onDoubleClick,
559
- children,
560
- hideDecorations = false,
561
- className = "",
562
- style
563
- }) => {
564
- const [isHovered, setIsHovered] = useState(false);
565
- const tileRef = useRef(null);
566
- const palette = usePalette();
567
- const { setInspectionText } = useBottomStrip();
568
- useEffect(() => {
569
- if (isHovered && title) {
570
- const words = title.trim().split(/\s+/);
571
- const label = words.slice(0, 3).join(" ").toUpperCase();
572
- const descRest = words.length > 3 ? words.slice(3).join(" ") : "";
573
- const descItems = [descRest, description, primaryActionText || "Click to focus"].filter(Boolean);
574
- const desc = descItems.join(" \u2022 ");
575
- setInspectionText({
576
- label,
577
- description: desc || void 0
578
- });
579
- }
580
- return () => {
581
- if (isHovered) {
582
- setInspectionText(null);
583
- }
584
- };
585
- }, [isHovered, title, description, badge, primaryActionText, setInspectionText]);
586
- const effectiveAccent = accentColor || palette.accentPrimary;
587
- const isHighlighted = isSelected || isHovered;
588
- const dynamicStyle = {
589
- backgroundColor: isSelected ? palette.bgElevated : palette.bgSurface,
590
- borderColor: isSelected ? effectiveAccent : isHovered ? palette.accentHover : palette.borderSubtle,
591
- boxShadow: isHighlighted ? `0 0 12px ${palette.accentGlow}` : "none",
592
- ...style
593
- };
594
- return /* @__PURE__ */ jsxs4(
595
- "div",
596
- {
597
- ref: tileRef,
598
- id,
599
- "data-ui-parent": "TileParent",
600
- onMouseEnter: () => setIsHovered(true),
601
- onMouseLeave: () => setIsHovered(false),
602
- onClick,
603
- onDoubleClick,
604
- style: dynamicStyle,
605
- className: `relative group flex flex-col items-center justify-center w-full aspect-square border-2 transition-all cursor-pointer select-none font-mono ${isSelected ? "scale-[1.02]" : "hover:scale-[1.02]"} ${className}`,
606
- children: [
607
- !hideDecorations && icon && /* @__PURE__ */ jsx4(
608
- "div",
609
- {
610
- style: {
611
- backgroundColor: isSelected ? palette.bgPrimary : palette.bgInput,
612
- borderColor: isSelected ? effectiveAccent : palette.borderSubtle,
613
- color: isSelected ? palette.accentHover : palette.textPrimary
614
- },
615
- className: `p-3 border transition-all flex items-center justify-center ${isPlaying ? "animate-pulse ring-2 ring-rose-500" : ""}`,
616
- children: icon
617
- }
618
- ),
619
- children,
620
- !hideDecorations && /* @__PURE__ */ jsx4(
621
- "div",
622
- {
623
- className: `w-1.5 h-1.5 rounded-full mt-1.5 transition-transform ${isSelected ? "scale-150 ring-2 ring-white/40" : "group-hover:scale-125"}`,
624
- style: { backgroundColor: effectiveAccent }
625
- }
626
- )
627
- ]
628
- }
629
- );
630
- };
631
- var SpawnOptionTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
632
- var CategoryCardTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
633
- var ClipCardTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
634
- var ChannelStripTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
635
-
636
- // src/hierarchy/BadgeParent.tsx
637
- import React5 from "react";
638
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
639
- var Badge = ({
640
- id,
641
- label,
642
- variant = "primary",
643
- size = "sm",
644
- className = ""
645
- }) => {
646
- const palette = usePalette();
647
- const colorStyle = React5.useMemo(() => {
648
- switch (variant) {
649
- case "accent":
650
- return {
651
- backgroundColor: `${palette.accentPrimary}25`,
652
- borderColor: palette.accentPrimary,
653
- color: palette.accentHover
654
- };
655
- case "success":
656
- return {
657
- backgroundColor: `${palette.success}25`,
658
- borderColor: palette.success,
659
- color: palette.success
660
- };
661
- case "warning":
662
- return {
663
- backgroundColor: `${palette.warning}25`,
664
- borderColor: palette.warning,
665
- color: palette.warning
666
- };
667
- case "danger":
668
- return {
669
- backgroundColor: `${palette.danger}25`,
670
- borderColor: palette.danger,
671
- color: palette.danger
672
- };
673
- case "info":
674
- return {
675
- backgroundColor: `${palette.info}25`,
676
- borderColor: palette.info,
677
- color: palette.info
678
- };
679
- case "primary":
680
- default:
681
- return {
682
- backgroundColor: palette.bgInput,
683
- borderColor: palette.borderMedium,
684
- color: palette.textSecondary
685
- };
686
- }
687
- }, [variant, palette]);
688
- const sizeClasses = size === "xs" ? "text-[8px] px-1 py-0.2" : size === "md" ? "text-xs px-2 py-0.5" : "text-[9px] px-1.5 py-0.5";
689
- return /* @__PURE__ */ jsx5(
690
- "span",
691
- {
692
- id,
693
- "data-ui-parent": "BadgeParent",
694
- style: colorStyle,
695
- className: `inline-flex items-center justify-center font-mono font-bold uppercase tracking-wider border select-none ${sizeClasses} ${className}`,
696
- children: label
697
- }
698
- );
699
- };
700
- var TelemetryPill = ({
701
- id,
702
- label,
703
- value,
704
- unit,
705
- accent = false
706
- }) => {
707
- const palette = usePalette();
708
- return /* @__PURE__ */ jsxs5(
709
- "div",
710
- {
711
- id,
712
- "data-ui-parent": "BadgeParent",
713
- style: {
714
- backgroundColor: palette.bgPrimary,
715
- borderColor: accent ? palette.accentPrimary : palette.borderSubtle
716
- },
717
- className: "inline-flex items-center gap-1.5 px-2 py-0.5 border font-mono text-[10px] select-none",
718
- children: [
719
- /* @__PURE__ */ jsx5("span", { style: { color: palette.textMuted }, className: "uppercase text-[8px] font-bold", children: label }),
720
- /* @__PURE__ */ jsxs5(
721
- "span",
722
- {
723
- style: { color: accent ? palette.accentHover : palette.textPrimary },
724
- className: "font-black",
725
- children: [
726
- value,
727
- unit && /* @__PURE__ */ jsx5("span", { style: { color: palette.textMuted }, className: "ml-0.5 text-[8px] font-normal", children: unit })
728
- ]
729
- }
730
- )
731
- ]
732
- }
733
- );
734
- };
735
- var StatusDot = ({
736
- id,
737
- active = true,
738
- color,
739
- pulse = false
740
- }) => {
741
- const palette = usePalette();
742
- const effectiveColor = color || (active ? palette.accentPrimary : palette.borderMedium);
743
- return /* @__PURE__ */ jsx5(
744
- "span",
745
- {
746
- id,
747
- "data-ui-parent": "BadgeParent",
748
- style: {
749
- backgroundColor: effectiveColor,
750
- boxShadow: active ? `0 0 6px ${effectiveColor}` : "none"
751
- },
752
- className: `inline-block w-2 h-2 rounded-full shrink-0 ${pulse && active ? "animate-pulse" : ""}`
753
- }
754
- );
755
- };
756
-
757
- export {
758
- UIParent,
759
- ButtonParent,
760
- SplitButton,
761
- ActionButton,
762
- IconButton,
763
- ToggleButton,
764
- DangerButton,
765
- GhostButton,
766
- PanelParent,
767
- ModalPanel,
768
- InspectorPanel,
769
- CardPanel,
770
- ToolbarPanel,
771
- SliderInput,
772
- TextInput,
773
- SelectInput,
774
- ToggleInput,
775
- TileParent,
776
- SpawnOptionTile,
777
- CategoryCardTile,
778
- ClipCardTile,
779
- ChannelStripTile,
780
- Badge,
781
- TelemetryPill,
782
- StatusDot
783
- };