@ultrst-armada/floks 1.2.4 → 1.2.6

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.
Files changed (43) hide show
  1. package/README.md +10 -0
  2. package/package.json +13 -9
  3. package/packages/canvas-ui/dist/chunk-QRYNQ36L.js +123 -0
  4. package/packages/canvas-ui/dist/{chunk-OOTTFWXA.js → chunk-RH5NINIT.js} +1 -122
  5. package/packages/canvas-ui/dist/chunk-VESG3VP3.js +1522 -0
  6. package/packages/canvas-ui/dist/frnl-editable-node-graph/index.d.ts +110 -0
  7. package/packages/canvas-ui/dist/frnl-editable-node-graph/index.js +9 -0
  8. package/packages/canvas-ui/dist/index.d.ts +13 -2
  9. package/packages/canvas-ui/dist/index.js +63 -485
  10. package/packages/canvas-ui/dist/predictive/index.js +4 -2
  11. package/packages/canvas-ui/floks.manifest.json +25 -4
  12. package/packages/canvas-ui/package.json +11 -7
  13. package/packages/contracts/dist/index.js +2 -2
  14. package/packages/ui/dist/chunk-2SD6BIUX.js +0 -0
  15. package/packages/ui/dist/chunk-DGZBP3ND.js +832 -0
  16. package/packages/ui/dist/{chunk-2SFOC7KZ.js → chunk-KQAFKNQH.js} +77 -67
  17. package/packages/ui/dist/chunk-PH4NEHWR.js +99 -0
  18. package/packages/ui/dist/chunk-PRMOURNW.js +324 -0
  19. package/packages/ui/dist/{chunk-KYFSUQVT.js → chunk-SXRIBCJX.js} +124 -110
  20. package/packages/ui/dist/chunk-X4B3EBMY.js +22 -0
  21. package/packages/ui/dist/{chunk-DT6DZU63.js → chunk-X67KXI3H.js} +190 -152
  22. package/packages/ui/dist/chunk-YVWJ4SW7.js +394 -0
  23. package/packages/ui/dist/components/auth/index.d.ts +56 -14
  24. package/packages/ui/dist/components/auth/index.js +12 -3
  25. package/packages/ui/dist/components/graph/index.d.ts +29 -0
  26. package/packages/ui/dist/components/graph/index.js +10 -0
  27. package/packages/ui/dist/components/settings/index.js +2 -2
  28. package/packages/ui/dist/components/tiles/index.d.ts +83 -0
  29. package/packages/ui/dist/components/tiles/index.js +10 -0
  30. package/packages/ui/dist/components/workspace/index.d.ts +108 -33
  31. package/packages/ui/dist/components/workspace/index.js +15 -3
  32. package/packages/ui/dist/frnl/index.css +183 -0
  33. package/packages/ui/dist/frnl/index.d.ts +555 -0
  34. package/packages/ui/dist/frnl/index.js +48 -0
  35. package/packages/ui/dist/frnl/store.d.ts +29 -0
  36. package/packages/ui/dist/frnl/store.js +12 -0
  37. package/packages/ui/dist/hierarchy/index.d.ts +15 -51
  38. package/packages/ui/dist/hierarchy/index.js +6 -19
  39. package/packages/ui/dist/index.d.ts +9 -4
  40. package/packages/ui/dist/index.js +101 -46
  41. package/packages/ui/floks.manifest.json +99 -17
  42. package/packages/ui/package.json +24 -2
  43. package/packages/ui/dist/{chunk-ROILFUZW.js → chunk-ZPQC46RO.js} +3 -3
@@ -0,0 +1,832 @@
1
+ import {
2
+ useFloksFrnlStore
3
+ } from "./chunk-X4B3EBMY.js";
4
+ import {
5
+ BottomStripProvider,
6
+ useBottomStrip
7
+ } from "./chunk-62ITRDJX.js";
8
+
9
+ // src/frnl/frnlControls.tsx
10
+ import { useId, useMemo } from "react";
11
+ import { defineFrnlComponent } from "@ultrst-armada/frnlts";
12
+ import { useFrnlComponent } from "@ultrst-armada/frnlts/react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ var frnlSelectDefinition = defineFrnlComponent({
15
+ name: "frnlSelect",
16
+ states: {
17
+ idle: {
18
+ name: "idle",
19
+ events: { change: { functionId: "frnlSelect.idle.change" } },
20
+ visualParameters: {},
21
+ phases: {
22
+ attackPhase: { visualDefinition: { parameters: {} } },
23
+ sustainPhase: { visualDefinition: { parameters: {} } },
24
+ releasePhase: { visualDefinition: { parameters: {} } }
25
+ }
26
+ },
27
+ disabled: {
28
+ name: "disabled",
29
+ events: {},
30
+ visualParameters: { opacity: 0.5 },
31
+ phases: {
32
+ attackPhase: { visualDefinition: { parameters: {} } },
33
+ sustainPhase: { visualDefinition: { parameters: {} } },
34
+ releasePhase: { visualDefinition: { parameters: {} } }
35
+ }
36
+ }
37
+ }
38
+ });
39
+ var frnlSelect = ({
40
+ id,
41
+ label,
42
+ description,
43
+ options,
44
+ size = "md",
45
+ disabled = false,
46
+ value,
47
+ onChange,
48
+ onMouseEnter,
49
+ onMouseLeave,
50
+ className = "",
51
+ style,
52
+ ...rest
53
+ }) => {
54
+ const store = useFloksFrnlStore();
55
+ const { setInspectionText } = useBottomStrip();
56
+ const generatedId = useId().replace(/[:/]/g, "");
57
+ const componentId = id ?? `frnlSelect.${label ? label.toLowerCase().replace(/[^a-z0-9]/g, "-") : generatedId}`;
58
+ const handlers = useMemo(
59
+ () => ({
60
+ "frnlSelect.idle.change": (payload) => onChange?.(payload)
61
+ }),
62
+ [onChange]
63
+ );
64
+ const frnl = useFrnlComponent({
65
+ id: componentId,
66
+ definition: frnlSelectDefinition,
67
+ store,
68
+ state: disabled ? "disabled" : "idle",
69
+ properties: { label, disabled },
70
+ handlers
71
+ });
72
+ const heightClass = size === "sm" ? "h-7 text-xs" : size === "lg" ? "h-10 text-sm" : "h-8 text-xs";
73
+ return /* @__PURE__ */ jsxs("div", { className: `flex flex-col gap-1 font-mono select-none ${className}`, children: [
74
+ label && /* @__PURE__ */ jsx(
75
+ "label",
76
+ {
77
+ htmlFor: componentId,
78
+ className: "text-[10px] font-bold uppercase tracking-wider text-[var(--skipo-text-muted,#94a3b8)]",
79
+ children: label
80
+ }
81
+ ),
82
+ /* @__PURE__ */ jsx(
83
+ "select",
84
+ {
85
+ ...rest,
86
+ id: componentId,
87
+ value,
88
+ disabled,
89
+ "data-frnl-component": "frnlSelect",
90
+ "data-frnl-state": frnl.state,
91
+ onChange: (e) => {
92
+ onChange?.(e);
93
+ frnl.events.change?.(e);
94
+ },
95
+ onMouseEnter: (e) => {
96
+ onMouseEnter?.(e);
97
+ if (label || description) setInspectionText(label || null, description || null);
98
+ },
99
+ onMouseLeave: (e) => {
100
+ onMouseLeave?.(e);
101
+ setInspectionText(null);
102
+ },
103
+ className: `w-full bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-text-primary,#f8fafc)] border border-[var(--skipo-border-subtle,#334155)] rounded px-2.5 py-1 focus:outline-none focus:border-[var(--skipo-accent,#38bdf8)] disabled:opacity-40 disabled:cursor-not-allowed ${heightClass}`,
104
+ style,
105
+ children: options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, disabled: opt.disabled, className: "bg-[#0f172a] text-white", children: opt.label }, opt.value))
106
+ }
107
+ )
108
+ ] });
109
+ };
110
+ frnlSelect.displayName = "frnlSelect";
111
+ var frnlToggleDefinition = defineFrnlComponent({
112
+ name: "frnlToggle",
113
+ states: {
114
+ off: {
115
+ name: "off",
116
+ events: { toggle: { functionId: "frnlToggle.off.toggle" } },
117
+ visualParameters: { checked: false },
118
+ phases: {
119
+ attackPhase: { visualDefinition: { parameters: {} } },
120
+ sustainPhase: { visualDefinition: { parameters: {} } },
121
+ releasePhase: { visualDefinition: { parameters: {} } }
122
+ }
123
+ },
124
+ on: {
125
+ name: "on",
126
+ events: { toggle: { functionId: "frnlToggle.on.toggle" } },
127
+ visualParameters: { checked: true },
128
+ phases: {
129
+ attackPhase: { visualDefinition: { parameters: {} } },
130
+ sustainPhase: { visualDefinition: { parameters: {} } },
131
+ releasePhase: { visualDefinition: { parameters: {} } }
132
+ }
133
+ }
134
+ }
135
+ });
136
+ var frnlToggle = ({
137
+ id,
138
+ checked,
139
+ onChange,
140
+ label,
141
+ description,
142
+ disabled = false,
143
+ className = ""
144
+ }) => {
145
+ const store = useFloksFrnlStore();
146
+ const { setInspectionText } = useBottomStrip();
147
+ const generatedId = useId().replace(/[:/]/g, "");
148
+ const componentId = id ?? `frnlToggle.${label ? label.toLowerCase().replace(/[^a-z0-9]/g, "-") : generatedId}`;
149
+ const handlers = useMemo(
150
+ () => ({
151
+ "frnlToggle.off.toggle": () => onChange(true),
152
+ "frnlToggle.on.toggle": () => onChange(false)
153
+ }),
154
+ [onChange]
155
+ );
156
+ const frnl = useFrnlComponent({
157
+ id: componentId,
158
+ definition: frnlToggleDefinition,
159
+ store,
160
+ state: checked ? "on" : "off",
161
+ properties: { label, checked, disabled },
162
+ handlers
163
+ });
164
+ return /* @__PURE__ */ jsxs(
165
+ "button",
166
+ {
167
+ type: "button",
168
+ role: "switch",
169
+ id: componentId,
170
+ "aria-checked": checked,
171
+ disabled,
172
+ "data-frnl-component": "frnlToggle",
173
+ "data-frnl-state": frnl.state,
174
+ onClick: () => {
175
+ if (disabled) return;
176
+ frnl.events.toggle?.(void 0);
177
+ },
178
+ onMouseEnter: () => {
179
+ if (label || description) setInspectionText(label || null, description || null);
180
+ },
181
+ onMouseLeave: () => setInspectionText(null),
182
+ className: `inline-flex items-center gap-2 select-none font-mono text-xs cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${className}`,
183
+ children: [
184
+ /* @__PURE__ */ jsx(
185
+ "div",
186
+ {
187
+ className: `w-8 h-4 rounded-full transition-colors relative flex items-center p-0.5 ${checked ? "bg-[var(--skipo-accent,#38bdf8)]" : "bg-[var(--skipo-border-subtle,#334155)]"}`,
188
+ children: /* @__PURE__ */ jsx(
189
+ "div",
190
+ {
191
+ className: `w-3 h-3 rounded-full bg-black transition-transform ${checked ? "translate-x-4" : "translate-x-0"}`
192
+ }
193
+ )
194
+ }
195
+ ),
196
+ label && /* @__PURE__ */ jsx("span", { className: "text-[var(--skipo-text-primary,#f8fafc)] uppercase text-[11px] font-semibold", children: label })
197
+ ]
198
+ }
199
+ );
200
+ };
201
+ frnlToggle.displayName = "frnlToggle";
202
+ var frnlSlider = ({
203
+ id,
204
+ value,
205
+ onChange,
206
+ min = 0,
207
+ max = 100,
208
+ step = 1,
209
+ label,
210
+ unit = "",
211
+ description,
212
+ disabled = false,
213
+ className = ""
214
+ }) => {
215
+ const { setInspectionText } = useBottomStrip();
216
+ const generatedId = useId().replace(/[:/]/g, "");
217
+ const componentId = id ?? `frnlSlider.${label ? label.toLowerCase().replace(/[^a-z0-9]/g, "-") : generatedId}`;
218
+ return /* @__PURE__ */ jsxs(
219
+ "div",
220
+ {
221
+ id: componentId,
222
+ "data-frnl-component": "frnlSlider",
223
+ onMouseEnter: () => {
224
+ if (label || description) setInspectionText(label || null, description || null);
225
+ },
226
+ onMouseLeave: () => setInspectionText(null),
227
+ className: `flex flex-col gap-1 font-mono select-none ${className}`,
228
+ children: [
229
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center text-[10px] uppercase font-bold tracking-wider", children: [
230
+ label && /* @__PURE__ */ jsx("span", { className: "text-[var(--skipo-text-muted,#94a3b8)]", children: label }),
231
+ /* @__PURE__ */ jsxs("span", { className: "text-[var(--skipo-accent,#38bdf8)]", children: [
232
+ value,
233
+ unit
234
+ ] })
235
+ ] }),
236
+ /* @__PURE__ */ jsx(
237
+ "input",
238
+ {
239
+ type: "range",
240
+ min,
241
+ max,
242
+ step,
243
+ value,
244
+ disabled,
245
+ onChange: (e) => onChange(parseFloat(e.target.value)),
246
+ className: "w-full h-1.5 bg-[var(--skipo-border-subtle,#334155)] accent-[var(--skipo-accent,#38bdf8)] cursor-pointer disabled:opacity-40"
247
+ }
248
+ )
249
+ ]
250
+ }
251
+ );
252
+ };
253
+ frnlSlider.displayName = "frnlSlider";
254
+ var BADGE_STYLES = {
255
+ neutral: "bg-[var(--skipo-bg-subtle,#1e293b)] border-[var(--skipo-border-subtle,#334155)] text-[var(--skipo-text-muted,#94a3b8)]",
256
+ accent: "bg-cyan-500/10 border-cyan-500/30 text-cyan-400",
257
+ success: "bg-emerald-500/10 border-emerald-500/30 text-emerald-400",
258
+ danger: "bg-rose-500/10 border-rose-500/30 text-rose-400",
259
+ warning: "bg-amber-500/10 border-amber-500/30 text-amber-400",
260
+ info: "bg-blue-500/10 border-blue-500/30 text-blue-400"
261
+ };
262
+ var frnlBadge = ({
263
+ variant = "neutral",
264
+ size = "md",
265
+ dot = false,
266
+ children,
267
+ className = "",
268
+ ...rest
269
+ }) => {
270
+ const sizeClasses = size === "sm" ? "px-1.5 py-0.2 text-[9px]" : "px-2 py-0.5 text-[10px]";
271
+ return /* @__PURE__ */ jsxs(
272
+ "span",
273
+ {
274
+ ...rest,
275
+ "data-frnl-component": "frnlBadge",
276
+ className: `inline-flex items-center gap-1.5 font-mono font-bold uppercase tracking-wider border rounded select-none ${BADGE_STYLES[variant]} ${sizeClasses} ${className}`,
277
+ children: [
278
+ dot && /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-current animate-pulse" }),
279
+ children
280
+ ]
281
+ }
282
+ );
283
+ };
284
+ frnlBadge.displayName = "frnlBadge";
285
+
286
+ // src/frnl/frnlTabWindow.tsx
287
+ import { useState } from "react";
288
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
289
+ var frnlTabWindow = ({
290
+ id = "frnl-tab-window",
291
+ tabs,
292
+ activeTabId,
293
+ onTabChange,
294
+ className = "",
295
+ children
296
+ }) => {
297
+ const [internalActiveTab, setInternalActiveTab] = useState(tabs[0]?.id);
298
+ const activeId = activeTabId ?? internalActiveTab;
299
+ const { setInspectionText } = useBottomStrip();
300
+ const handleSelect = (tab) => {
301
+ if (tab.disabled) return;
302
+ if (onTabChange) onTabChange(tab.id);
303
+ else setInternalActiveTab(tab.id);
304
+ };
305
+ const currentTab = tabs.find((t) => t.id === activeId);
306
+ return /* @__PURE__ */ jsxs2(
307
+ "div",
308
+ {
309
+ id,
310
+ "data-frnl-component": "frnlTabWindow",
311
+ className: `flex flex-col w-full h-full min-h-0 bg-[var(--skipo-bg,#0a0c10)] text-[var(--skipo-text-primary,#f8fafc)] font-mono ${className}`,
312
+ children: [
313
+ /* @__PURE__ */ jsx2("div", { className: "h-10 border-b border-[var(--skipo-border-color,#334155)] bg-[var(--skipo-surface,#14171f)] px-3 flex items-center gap-1 shrink-0 select-none overflow-x-auto", children: tabs.map((tab) => {
314
+ const isActive = tab.id === activeId;
315
+ return /* @__PURE__ */ jsxs2(
316
+ "button",
317
+ {
318
+ type: "button",
319
+ role: "tab",
320
+ "aria-selected": isActive,
321
+ disabled: tab.disabled,
322
+ onClick: () => handleSelect(tab),
323
+ onMouseEnter: () => {
324
+ if (tab.label || tab.description) {
325
+ setInspectionText(
326
+ `TAB: ${tab.label.toUpperCase()}`,
327
+ tab.description || `Switch to ${tab.label} tab view`
328
+ );
329
+ }
330
+ },
331
+ onMouseLeave: () => setInspectionText(null),
332
+ className: `flex items-center gap-2 px-3 py-1.5 text-xs font-bold uppercase tracking-wider rounded transition-all cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${isActive ? "bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-accent,#38bdf8)] border border-[var(--skipo-border-subtle,#334155)]" : "text-[var(--skipo-text-muted,#94a3b8)] hover:text-white hover:bg-[var(--skipo-bg-subtle,#1e293b)] border border-transparent"}`,
333
+ children: [
334
+ tab.icon && /* @__PURE__ */ jsx2("span", { className: "w-3.5 h-3.5 shrink-0 flex items-center", children: tab.icon }),
335
+ /* @__PURE__ */ jsx2("span", { children: tab.label })
336
+ ]
337
+ },
338
+ tab.id
339
+ );
340
+ }) }),
341
+ /* @__PURE__ */ jsx2("div", { className: "flex-1 overflow-auto p-4 min-h-0 relative", children: currentTab?.content ?? children })
342
+ ]
343
+ }
344
+ );
345
+ };
346
+ frnlTabWindow.displayName = "frnlTabWindow";
347
+
348
+ // src/frnl/frnlTopBar.tsx
349
+ import React3, { useState as useState2, useRef, useEffect } from "react";
350
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
351
+ var frnlTopBar = ({
352
+ id = "frnl-top-bar",
353
+ breadcrumbs = [],
354
+ appLogo,
355
+ appName,
356
+ tabs = [],
357
+ activeTabId,
358
+ onTabChange,
359
+ user,
360
+ onLogout,
361
+ onOpenSettings,
362
+ actions,
363
+ className = ""
364
+ }) => {
365
+ const { setInspectionText } = useBottomStrip();
366
+ const [profileOpen, setProfileOpen] = useState2(false);
367
+ const profileMenuRef = useRef(null);
368
+ useEffect(() => {
369
+ const handleClickOutside = (e) => {
370
+ if (profileMenuRef.current && !profileMenuRef.current.contains(e.target)) {
371
+ setProfileOpen(false);
372
+ }
373
+ };
374
+ if (profileOpen) {
375
+ document.addEventListener("mousedown", handleClickOutside);
376
+ }
377
+ return () => document.removeEventListener("mousedown", handleClickOutside);
378
+ }, [profileOpen]);
379
+ return /* @__PURE__ */ jsxs3(
380
+ "header",
381
+ {
382
+ id,
383
+ "data-frnl-component": "frnlTopBar",
384
+ className: `h-11 border-b border-[var(--skipo-border-color,#334155)] bg-[var(--skipo-surface,#14171f)] px-3 flex items-center justify-between select-none shrink-0 font-mono text-xs z-40 relative ${className}`,
385
+ children: [
386
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 min-w-0", children: [
387
+ appLogo ? /* @__PURE__ */ jsx3("div", { className: "shrink-0 flex items-center justify-center", children: appLogo }) : appName ? /* @__PURE__ */ jsx3(
388
+ "div",
389
+ {
390
+ className: "w-6 h-6 rounded bg-[var(--skipo-accent,#38bdf8)] text-black font-black flex items-center justify-center text-xs shrink-0 cursor-default",
391
+ onMouseEnter: () => setInspectionText(`APPLICATION: ${appName.toUpperCase()}`),
392
+ onMouseLeave: () => setInspectionText(null),
393
+ children: appName.slice(0, 2).toUpperCase()
394
+ }
395
+ ) : null,
396
+ breadcrumbs.length > 0 && /* @__PURE__ */ jsx3("nav", { "aria-label": "Breadcrumb", className: "flex items-center gap-1.5 text-xs text-[var(--skipo-text-muted,#94a3b8)]", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs3(React3.Fragment, { children: [
397
+ crumb.onClick ? /* @__PURE__ */ jsx3(
398
+ "button",
399
+ {
400
+ type: "button",
401
+ onClick: crumb.onClick,
402
+ onMouseEnter: () => setInspectionText(`NAVIGATE: ${crumb.label.toUpperCase()}`),
403
+ onMouseLeave: () => setInspectionText(null),
404
+ className: "hover:text-white transition-colors cursor-pointer truncate max-w-[140px]",
405
+ children: crumb.label
406
+ }
407
+ ) : crumb.href ? /* @__PURE__ */ jsx3(
408
+ "a",
409
+ {
410
+ href: crumb.href,
411
+ onMouseEnter: () => setInspectionText(`NAVIGATE: ${crumb.label.toUpperCase()}`),
412
+ onMouseLeave: () => setInspectionText(null),
413
+ className: "hover:text-white transition-colors truncate max-w-[140px]",
414
+ children: crumb.label
415
+ }
416
+ ) : /* @__PURE__ */ jsx3("span", { className: "text-[var(--skipo-text-primary,#f8fafc)] font-semibold truncate max-w-[140px]", children: crumb.label }),
417
+ idx < breadcrumbs.length - 1 && /* @__PURE__ */ jsx3("span", { className: "opacity-40", children: "/" })
418
+ ] }, idx)) })
419
+ ] }),
420
+ tabs.length > 0 && /* @__PURE__ */ jsx3(
421
+ "nav",
422
+ {
423
+ role: "tablist",
424
+ className: "flex items-center gap-1 bg-[var(--skipo-bg-panel,#0f172a)] p-0.5 rounded border border-[var(--skipo-border-subtle,#334155)]",
425
+ children: tabs.map((tab) => {
426
+ const isActive = tab.id === activeTabId;
427
+ return /* @__PURE__ */ jsx3(
428
+ "button",
429
+ {
430
+ type: "button",
431
+ role: "tab",
432
+ "aria-selected": isActive,
433
+ disabled: tab.disabled,
434
+ onClick: () => onTabChange?.(tab.id),
435
+ onMouseEnter: () => setInspectionText(
436
+ `TAB: ${tab.label.toUpperCase()}`,
437
+ tab.description || `Switch view to ${tab.label}`
438
+ ),
439
+ onMouseLeave: () => setInspectionText(null),
440
+ className: `p-1.5 rounded transition-all flex items-center justify-center cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed ${isActive ? "bg-[var(--skipo-accent,#38bdf8)] text-black shadow-xs" : "text-[var(--skipo-text-muted,#94a3b8)] hover:text-white hover:bg-[var(--skipo-surface,#14171f)]"}`,
441
+ "aria-label": tab.label,
442
+ children: /* @__PURE__ */ jsx3("span", { className: "w-4 h-4 flex items-center justify-center", children: tab.icon })
443
+ },
444
+ tab.id
445
+ );
446
+ })
447
+ }
448
+ ),
449
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5 shrink-0", children: [
450
+ actions,
451
+ onOpenSettings && /* @__PURE__ */ jsx3(
452
+ "button",
453
+ {
454
+ type: "button",
455
+ onClick: onOpenSettings,
456
+ onMouseEnter: () => setInspectionText("SETTINGS", "Open system preferences, theme and configurations"),
457
+ onMouseLeave: () => setInspectionText(null),
458
+ className: "p-1.5 rounded border border-[var(--skipo-border-subtle,#334155)] bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-text-muted,#94a3b8)] hover:text-white hover:border-[var(--skipo-accent,#38bdf8)] cursor-pointer transition-colors",
459
+ "aria-label": "Settings",
460
+ children: /* @__PURE__ */ jsxs3("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
461
+ /* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "3" }),
462
+ /* @__PURE__ */ jsx3("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
463
+ ] })
464
+ }
465
+ ),
466
+ user && /* @__PURE__ */ jsxs3("div", { className: "relative", ref: profileMenuRef, children: [
467
+ /* @__PURE__ */ jsx3(
468
+ "button",
469
+ {
470
+ type: "button",
471
+ onClick: () => setProfileOpen((prev) => !prev),
472
+ onMouseEnter: () => setInspectionText(
473
+ `USER: ${user.name || user.username || "PROFILE"}`,
474
+ `Active session as ${user.email || user.username || "user"}`
475
+ ),
476
+ onMouseLeave: () => setInspectionText(null),
477
+ className: "w-7 h-7 rounded border border-[var(--skipo-border-subtle,#334155)] bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-text-primary,#f8fafc)] hover:border-[var(--skipo-accent,#38bdf8)] flex items-center justify-center cursor-pointer transition-colors",
478
+ "aria-label": "User Profile",
479
+ "aria-expanded": profileOpen,
480
+ children: /* @__PURE__ */ jsx3("span", { children: user.avatarGlyph || "\u{1F464}" })
481
+ }
482
+ ),
483
+ profileOpen && /* @__PURE__ */ jsxs3("div", { className: "absolute right-0 top-full mt-1.5 w-56 rounded border border-[var(--skipo-border-color,#334155)] bg-[var(--skipo-surface,#14171f)] p-3 shadow-xl z-50 flex flex-col gap-2.5 font-mono animate-fade-in", children: [
484
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 pb-2 border-b border-[var(--skipo-border-subtle,#334155)]", children: [
485
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-8 rounded bg-[var(--skipo-bg-panel,#0f172a)] border border-[var(--skipo-border-subtle,#334155)] flex items-center justify-center text-sm", children: user.avatarGlyph || "\u{1F464}" }),
486
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col min-w-0", children: [
487
+ /* @__PURE__ */ jsx3("span", { className: "font-bold text-[var(--skipo-text-primary,#f8fafc)] truncate text-xs", children: user.name || user.username || "User" }),
488
+ /* @__PURE__ */ jsx3("span", { className: "text-[10px] text-[var(--skipo-text-muted,#94a3b8)] truncate", children: user.email || `@${user.username || "active"}` })
489
+ ] })
490
+ ] }),
491
+ user.role && /* @__PURE__ */ jsxs3("div", { className: "text-[10px] px-1.5 py-0.5 rounded bg-[var(--skipo-bg-panel,#0f172a)] border border-[var(--skipo-border-subtle,#334155)] text-[var(--skipo-accent,#38bdf8)] uppercase font-bold self-start", children: [
492
+ "ROLE: ",
493
+ user.role
494
+ ] }),
495
+ onLogout && /* @__PURE__ */ jsxs3(
496
+ "button",
497
+ {
498
+ type: "button",
499
+ onClick: () => {
500
+ setProfileOpen(false);
501
+ onLogout();
502
+ },
503
+ className: "w-full flex items-center gap-2 px-2.5 py-1.5 rounded text-rose-400 hover:bg-rose-500/10 border border-transparent hover:border-rose-500/30 text-xs font-bold uppercase tracking-wider transition-colors cursor-pointer",
504
+ children: [
505
+ /* @__PURE__ */ jsxs3("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
506
+ /* @__PURE__ */ jsx3("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
507
+ /* @__PURE__ */ jsx3("polyline", { points: "16 17 21 12 16 7" }),
508
+ /* @__PURE__ */ jsx3("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
509
+ ] }),
510
+ /* @__PURE__ */ jsx3("span", { children: "Sign Out" })
511
+ ]
512
+ }
513
+ )
514
+ ] })
515
+ ] })
516
+ ] })
517
+ ]
518
+ }
519
+ );
520
+ };
521
+ frnlTopBar.displayName = "frnlTopBar";
522
+
523
+ // src/frnl/frnlBottomBar.tsx
524
+ import { useState as useState3, useRef as useRef2, useEffect as useEffect2 } from "react";
525
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
526
+ var frnlBottomBar = ({
527
+ id = "frnl-bottom-bar",
528
+ onManualSave,
529
+ isSaving = false,
530
+ recentApiRequests = [],
531
+ className = ""
532
+ }) => {
533
+ const {
534
+ inspectionText,
535
+ inspectionDescription,
536
+ isDKeyPressed,
537
+ autoSave,
538
+ apiActivity,
539
+ setInspectionText
540
+ } = useBottomStrip();
541
+ const [apiPanelOpen, setApiPanelOpen] = useState3(false);
542
+ const apiPanelRef = useRef2(null);
543
+ useEffect2(() => {
544
+ const handleClick = (e) => {
545
+ if (apiPanelRef.current && !apiPanelRef.current.contains(e.target)) {
546
+ setApiPanelOpen(false);
547
+ }
548
+ };
549
+ if (apiPanelOpen) document.addEventListener("mousedown", handleClick);
550
+ return () => document.removeEventListener("mousedown", handleClick);
551
+ }, [apiPanelOpen]);
552
+ const showDescription = isDKeyPressed && Boolean(inspectionDescription);
553
+ const displayText = showDescription ? inspectionDescription : inspectionText || 'HOVER UI ELEMENT // HOLD "D" TO INSPECT';
554
+ return /* @__PURE__ */ jsxs4(
555
+ "footer",
556
+ {
557
+ id,
558
+ "data-frnl-component": "frnlBottomBar",
559
+ className: `h-[30px] min-h-[30px] border-t border-[var(--skipo-border-color,#334155)] bg-[var(--skipo-surface,#14171f)] px-3 flex items-center justify-between select-none shrink-0 font-mono text-[11px] z-40 relative text-[var(--skipo-text-muted,#94a3b8)] ${className}`,
560
+ children: [
561
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 shrink-0", children: [
562
+ /* @__PURE__ */ jsxs4(
563
+ "button",
564
+ {
565
+ type: "button",
566
+ onClick: () => autoSave.toggle(),
567
+ onMouseEnter: () => setInspectionText(
568
+ autoSave.enabled ? "AUTO-SAVE: ACTIVE" : "AUTO-SAVE: PAUSED",
569
+ autoSave.enabled ? "Automatic background persistence active" : "Changes require manual save"
570
+ ),
571
+ onMouseLeave: () => setInspectionText(null),
572
+ className: `flex items-center gap-1.5 px-2 py-0.5 rounded border transition-colors cursor-pointer ${autoSave.enabled ? "border-emerald-500/40 bg-emerald-500/10 text-emerald-400" : "border-[var(--skipo-border-subtle,#334155)] bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-text-muted,#64748b)]"}`,
573
+ "aria-label": "Toggle Auto Save",
574
+ children: [
575
+ /* @__PURE__ */ jsx4(
576
+ "span",
577
+ {
578
+ className: `w-1.5 h-1.5 rounded-full ${autoSave.enabled ? "bg-emerald-400 animate-pulse" : "bg-slate-500"}`
579
+ }
580
+ ),
581
+ /* @__PURE__ */ jsx4("span", { className: "text-[10px] font-bold uppercase tracking-wider", children: autoSave.enabled ? "AUTO" : "MANUAL" })
582
+ ]
583
+ }
584
+ ),
585
+ onManualSave && /* @__PURE__ */ jsxs4(
586
+ "button",
587
+ {
588
+ type: "button",
589
+ disabled: isSaving,
590
+ onClick: () => onManualSave(),
591
+ onMouseEnter: () => setInspectionText("MANUAL SAVE", "Trigger immediate persistence to disk / database"),
592
+ onMouseLeave: () => setInspectionText(null),
593
+ className: "flex items-center gap-1 px-2 py-0.5 rounded border border-[var(--skipo-border-subtle,#334155)] bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-text-primary,#f8fafc)] hover:border-[var(--skipo-accent,#38bdf8)] hover:text-[var(--skipo-accent,#38bdf8)] transition-colors cursor-pointer disabled:opacity-40",
594
+ "aria-label": "Save Now",
595
+ children: [
596
+ isSaving ? /* @__PURE__ */ jsx4("span", { className: "w-2.5 h-2.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : /* @__PURE__ */ jsxs4("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
597
+ /* @__PURE__ */ jsx4("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
598
+ /* @__PURE__ */ jsx4("polyline", { points: "17 21 17 13 7 13 7 21" }),
599
+ /* @__PURE__ */ jsx4("polyline", { points: "7 3 7 8 15 8" })
600
+ ] }),
601
+ /* @__PURE__ */ jsx4("span", { className: "text-[10px] font-bold uppercase tracking-wider", children: "Save" })
602
+ ]
603
+ }
604
+ )
605
+ ] }),
606
+ /* @__PURE__ */ jsx4("div", { className: "flex-1 flex items-center justify-center px-4 overflow-hidden", children: /* @__PURE__ */ jsxs4(
607
+ "div",
608
+ {
609
+ "data-testid": "frnl-bottom-strip-center",
610
+ className: "flex items-center gap-1.5 truncate transition-all duration-150 max-w-2xl",
611
+ children: [
612
+ showDescription && /* @__PURE__ */ jsx4("span", { className: "px-1 py-0.2 rounded text-[9px] font-bold uppercase tracking-wider bg-amber-400 text-black shrink-0", children: "D-INSPECT" }),
613
+ /* @__PURE__ */ jsx4(
614
+ "span",
615
+ {
616
+ className: `truncate ${showDescription ? "text-[11px] font-light italic text-[var(--skipo-text-primary,#f8fafc)]" : inspectionText ? "text-xs font-bold text-[var(--skipo-accent,#38bdf8)]" : "text-xs font-medium text-[var(--skipo-text-muted,#64748b)]"}`,
617
+ children: displayText
618
+ }
619
+ )
620
+ ]
621
+ }
622
+ ) }),
623
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 shrink-0 relative", ref: apiPanelRef, children: [
624
+ /* @__PURE__ */ jsxs4(
625
+ "button",
626
+ {
627
+ type: "button",
628
+ onClick: () => setApiPanelOpen((prev) => !prev),
629
+ onMouseEnter: () => setInspectionText(
630
+ `API: ${apiActivity.activeCount} IN-FLIGHT`,
631
+ "Toggle recent API requests inspector log"
632
+ ),
633
+ onMouseLeave: () => setInspectionText(null),
634
+ className: `flex items-center gap-1.5 px-2 py-0.5 rounded border transition-colors cursor-pointer ${apiActivity.activeCount > 0 ? "border-cyan-500/40 bg-cyan-500/10 text-cyan-400" : "border-[var(--skipo-border-subtle,#334155)] bg-[var(--skipo-bg-panel,#0f172a)] text-[var(--skipo-text-muted,#94a3b8)] hover:text-white"}`,
635
+ "aria-label": "API Requests",
636
+ "aria-expanded": apiPanelOpen,
637
+ children: [
638
+ /* @__PURE__ */ jsx4(
639
+ "svg",
640
+ {
641
+ width: "12",
642
+ height: "12",
643
+ viewBox: "0 0 24 24",
644
+ fill: "none",
645
+ stroke: "currentColor",
646
+ strokeWidth: "2",
647
+ strokeLinecap: "round",
648
+ strokeLinejoin: "round",
649
+ className: apiActivity.activeCount > 0 ? "animate-pulse" : "",
650
+ children: /* @__PURE__ */ jsx4("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })
651
+ }
652
+ ),
653
+ /* @__PURE__ */ jsxs4("span", { className: "text-[10px] font-bold uppercase tracking-wider", children: [
654
+ "API ",
655
+ apiActivity.activeCount > 0 ? `(${apiActivity.activeCount})` : "LOG"
656
+ ] })
657
+ ]
658
+ }
659
+ ),
660
+ apiPanelOpen && /* @__PURE__ */ jsxs4("div", { className: "absolute right-0 bottom-full mb-1.5 w-80 rounded border border-[var(--skipo-border-color,#334155)] bg-[var(--skipo-surface,#14171f)] p-3 shadow-2xl z-50 flex flex-col gap-2 font-mono text-xs animate-fade-in max-h-72 overflow-hidden", children: [
661
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between pb-1.5 border-b border-[var(--skipo-border-subtle,#334155)]", children: [
662
+ /* @__PURE__ */ jsx4("span", { className: "font-bold text-[var(--skipo-text-primary,#f8fafc)] uppercase text-[10px] tracking-wider", children: "Recent API Requests" }),
663
+ /* @__PURE__ */ jsxs4("span", { className: "text-[10px] text-[var(--skipo-accent,#38bdf8)] font-bold", children: [
664
+ apiActivity.activeCount,
665
+ " In-Flight"
666
+ ] })
667
+ ] }),
668
+ /* @__PURE__ */ jsx4("div", { className: "overflow-y-auto max-h-52 flex flex-col gap-1.5 pr-1", children: recentApiRequests.length > 0 ? recentApiRequests.map((req) => /* @__PURE__ */ jsxs4(
669
+ "div",
670
+ {
671
+ className: "p-1.5 rounded bg-[var(--skipo-bg-panel,#0f172a)] border border-[var(--skipo-border-subtle,#334155)] flex items-center justify-between text-[10px]",
672
+ children: [
673
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5 truncate mr-2", children: [
674
+ /* @__PURE__ */ jsx4("span", { className: "font-bold text-[var(--skipo-accent,#38bdf8)]", children: req.method }),
675
+ /* @__PURE__ */ jsx4("span", { className: "truncate text-[var(--skipo-text-primary,#f8fafc)]", children: req.endpoint })
676
+ ] }),
677
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 shrink-0", children: [
678
+ req.status && /* @__PURE__ */ jsx4(
679
+ "span",
680
+ {
681
+ className: `font-bold ${req.status < 400 ? "text-emerald-400" : "text-rose-400"}`,
682
+ children: req.status
683
+ }
684
+ ),
685
+ req.durationMs !== void 0 && /* @__PURE__ */ jsxs4("span", { className: "text-[var(--skipo-text-muted,#64748b)]", children: [
686
+ req.durationMs,
687
+ "ms"
688
+ ] })
689
+ ] })
690
+ ]
691
+ },
692
+ req.id
693
+ )) : /* @__PURE__ */ jsx4("div", { className: "py-4 text-center text-[var(--skipo-text-muted,#64748b)] text-[10px]", children: "No recent backend requests recorded." }) })
694
+ ] })
695
+ ] })
696
+ ]
697
+ }
698
+ );
699
+ };
700
+ frnlBottomBar.displayName = "frnlBottomBar";
701
+
702
+ // src/frnl/frnlPage.tsx
703
+ import React5, { useEffect as useEffect3, useState as useState4 } from "react";
704
+ import { mountFrnlOrchestration } from "@ultrst-armada/frnlts";
705
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
706
+ function FrnlGlobalHoverInspector() {
707
+ const { setInspectionText } = useBottomStrip();
708
+ useEffect3(() => {
709
+ const handleMouseOver = (e) => {
710
+ const target = e.target;
711
+ if (!target) return;
712
+ const el = target.closest(
713
+ '[data-skipo-label], [data-hover], [title], [aria-label], button, a, input, select, textarea, [role="tab"], [role="button"]'
714
+ );
715
+ if (el) {
716
+ const label = el.getAttribute("data-skipo-label") || el.getAttribute("data-hover") || el.getAttribute("title") || el.getAttribute("aria-label");
717
+ const desc = el.getAttribute("data-skipo-desc");
718
+ if (label || desc) {
719
+ if (el.hasAttribute("title") && !el.hasAttribute("data-frnl-original-title")) {
720
+ el.setAttribute("data-frnl-original-title", el.getAttribute("title") || "");
721
+ el.removeAttribute("title");
722
+ }
723
+ setInspectionText(label || null, desc || null);
724
+ }
725
+ }
726
+ };
727
+ const handleMouseOut = (e) => {
728
+ const target = e.target;
729
+ if (!target) return;
730
+ const el = target.closest("[data-frnl-original-title]");
731
+ if (el) {
732
+ const orig = el.getAttribute("data-frnl-original-title");
733
+ if (orig) {
734
+ el.setAttribute("title", orig);
735
+ el.removeAttribute("data-frnl-original-title");
736
+ }
737
+ }
738
+ setInspectionText(null);
739
+ };
740
+ document.addEventListener("mouseover", handleMouseOver);
741
+ document.addEventListener("mouseout", handleMouseOut);
742
+ return () => {
743
+ document.removeEventListener("mouseover", handleMouseOver);
744
+ document.removeEventListener("mouseout", handleMouseOut);
745
+ };
746
+ }, [setInspectionText]);
747
+ return null;
748
+ }
749
+ function FrnlPageInner({
750
+ id = "frnl-page",
751
+ appName = "Skipo App",
752
+ appLogo,
753
+ breadcrumbs,
754
+ tabs = [],
755
+ activeTabId,
756
+ onTabChange,
757
+ showTopBar = true,
758
+ showBottomBar = true,
759
+ topBarActions,
760
+ user,
761
+ onLogout,
762
+ onOpenSettings,
763
+ onSave,
764
+ isSaving = false,
765
+ recentApiRequests = [],
766
+ orchestrations = [],
767
+ className = "",
768
+ children
769
+ }) {
770
+ const store = useFloksFrnlStore();
771
+ const [internalActiveTab, setInternalActiveTab] = useState4(tabs[0]?.id);
772
+ const activeTab = activeTabId ?? internalActiveTab;
773
+ useEffect3(() => {
774
+ const cleanups = orchestrations.map(
775
+ (orchestration) => mountFrnlOrchestration(store, orchestration)
776
+ );
777
+ return () => {
778
+ for (const cleanup of cleanups.reverse()) cleanup();
779
+ };
780
+ }, [orchestrations, store]);
781
+ const handleTabChange = (tabId) => {
782
+ if (onTabChange) onTabChange(tabId);
783
+ else setInternalActiveTab(tabId);
784
+ };
785
+ const currentTab = tabs.find((t) => t.id === activeTab);
786
+ return /* @__PURE__ */ jsxs5(
787
+ "div",
788
+ {
789
+ id,
790
+ "data-frnl-component": "frnlPage",
791
+ className: `h-screen w-screen flex flex-col bg-[var(--skipo-bg,#0a0c10)] text-[var(--skipo-text-primary,#f8fafc)] font-mono select-none overflow-hidden ${className}`,
792
+ children: [
793
+ /* @__PURE__ */ jsx5(FrnlGlobalHoverInspector, {}),
794
+ showTopBar && React5.createElement(frnlTopBar, {
795
+ appName,
796
+ appLogo,
797
+ breadcrumbs,
798
+ tabs,
799
+ activeTabId: activeTab,
800
+ onTabChange: handleTabChange,
801
+ user,
802
+ onLogout,
803
+ onOpenSettings,
804
+ actions: topBarActions
805
+ }),
806
+ /* @__PURE__ */ jsx5("main", { className: "flex-1 flex flex-col min-h-0 overflow-y-auto relative p-4", children: currentTab?.content ?? children }),
807
+ showBottomBar && React5.createElement(frnlBottomBar, {
808
+ onManualSave: onSave,
809
+ isSaving,
810
+ recentApiRequests
811
+ })
812
+ ]
813
+ }
814
+ );
815
+ }
816
+ var frnlPage = (props) => {
817
+ return /* @__PURE__ */ jsx5(BottomStripProvider, { initialAutoSave: props.autoSaveEnabled ?? true, children: /* @__PURE__ */ jsx5(FrnlPageInner, { ...props }) });
818
+ };
819
+ frnlPage.displayName = "frnlPage";
820
+
821
+ export {
822
+ frnlSelectDefinition,
823
+ frnlSelect,
824
+ frnlToggleDefinition,
825
+ frnlToggle,
826
+ frnlSlider,
827
+ frnlBadge,
828
+ frnlTabWindow,
829
+ frnlTopBar,
830
+ frnlBottomBar,
831
+ frnlPage
832
+ };