@almadar/ui 6.51.2 → 6.52.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.
Files changed (121) hide show
  1. package/dist/{Canvas3DHost-CLC_jXh_.d.ts → Canvas3DHost-CWO0tswb.d.ts} +1 -1
  2. package/dist/{FileTree-RKQqRhIM.d.ts → FileTree-DUi7e7Z8.d.ts} +5 -5
  3. package/dist/{GameAudioProvider-BgWLggIy.d.ts → GameAudioProvider-_hPzjqp-.d.ts} +1 -1
  4. package/dist/{NavStackContext-B-XLULCO.d.ts → NavStackContext-04NLdXsY.d.ts} +8 -0
  5. package/dist/Typography-7FRZOS2H.js +5 -0
  6. package/dist/{UISlotContext-DNM8iXna.d.ts → UISlotContext-CS487Uoc.d.ts} +1 -1
  7. package/dist/{UISlotRenderer-7UYHFW4S.js → UISlotRenderer-CR7SCAMR.js} +8 -8
  8. package/dist/avl/index.cjs +3401 -1590
  9. package/dist/avl/index.d.ts +4 -4
  10. package/dist/avl/index.js +26 -23
  11. package/dist/{chunk-6CFYRP4S.js → chunk-2QB2PXOO.js} +1 -3
  12. package/dist/{chunk-R4V7IZQP.js → chunk-5GCI6C7J.js} +2 -2
  13. package/dist/{chunk-BUEIZY54.js → chunk-BHZG4PDZ.js} +420 -422
  14. package/dist/{chunk-MWPX2O4M.js → chunk-CLSLVFSP.js} +3 -16
  15. package/dist/{chunk-GIPZSCND.js → chunk-EERAGPBW.js} +3078 -1832
  16. package/dist/{chunk-OLZ3EEML.js → chunk-G4GMXYMY.js} +109 -15
  17. package/dist/{chunk-HQDKHLFG.js → chunk-IN3BVW2Z.js} +15 -1
  18. package/dist/{chunk-FGHRVJCI.js → chunk-MSBMVG3B.js} +12 -2
  19. package/dist/{chunk-YKHNK5JH.js → chunk-NCNP2RKZ.js} +11 -4
  20. package/dist/{chunk-T7IH5ABO.js → chunk-QWDKMVLX.js} +69 -17
  21. package/dist/{chunk-NTO555KF.js → chunk-TWHYH25Q.js} +136 -15
  22. package/dist/{chunk-GHXWGQTX.js → chunk-V5AGW2JN.js} +1 -1
  23. package/dist/{chunk-L55SAFKL.js → chunk-WB2A6V3I.js} +31 -1
  24. package/dist/{chunk-JXUYEO7U.js → chunk-XUSSAWKL.js} +7 -1
  25. package/dist/{cn-CO-0rolG.d.ts → cn-ClXGlIOY.d.ts} +2 -2
  26. package/dist/components/index.cjs +4933 -3165
  27. package/dist/components/index.d.ts +499 -416
  28. package/dist/components/index.js +11 -11
  29. package/dist/context/index.cjs +12 -4
  30. package/dist/context/index.d.ts +3 -3
  31. package/dist/context/index.js +2 -2
  32. package/dist/hooks/index.cjs +73 -6
  33. package/dist/hooks/index.d.ts +32 -7
  34. package/dist/hooks/index.js +6 -6
  35. package/dist/lib/drawable/three/index.cjs +33 -2
  36. package/dist/lib/drawable/three/index.d.ts +5 -5
  37. package/dist/lib/drawable/three/index.js +7 -7
  38. package/dist/lib/index.cjs +69 -2
  39. package/dist/lib/index.d.ts +29 -6
  40. package/dist/lib/index.js +5 -5
  41. package/dist/locales/index.cjs +93 -3
  42. package/dist/locales/index.js +63 -3
  43. package/dist/{paintDispatch-CMgOyVjS.d.ts → paintDispatch-DHo3WhaU.d.ts} +4 -4
  44. package/dist/providers/index.cjs +3392 -1607
  45. package/dist/providers/index.d.ts +6 -6
  46. package/dist/providers/index.js +55 -16
  47. package/dist/runtime/index.cjs +3417 -1611
  48. package/dist/runtime/index.d.ts +2 -2
  49. package/dist/runtime/index.js +10 -10
  50. package/dist/ssr/index.cjs +306 -141
  51. package/dist/ssr/index.d.cts +32 -44
  52. package/dist/ssr/index.d.ts +32 -44
  53. package/dist/ssr/index.js +249 -84
  54. package/dist/{themeTokens-CN9WCXQc.d.ts → themeTokens-Ccu7EmGY.d.ts} +4 -2
  55. package/dist/{useUISlots-CwUWM1ra.d.ts → useUISlots-1dk2TR4j.d.ts} +1 -9
  56. package/dist/{verificationRegistry-DBHfOR9y.d.ts → verificationRegistry-BYD3cVhS.d.ts} +1 -1
  57. package/locales/ar.json +31 -1
  58. package/locales/en.json +31 -1
  59. package/locales/sl.json +31 -1
  60. package/package.json +12 -9
  61. package/tailwind-preset.cjs +24 -1
  62. package/themes/_base.css +86 -0
  63. package/themes/_contract.md +1 -0
  64. package/themes/almadar-website.css +2 -0
  65. package/themes/almadar.css +2 -0
  66. package/themes/aqua.css +5 -3
  67. package/themes/arabesque.css +9 -7
  68. package/themes/art-deco.css +5 -3
  69. package/themes/art-nouveau.css +4 -0
  70. package/themes/atelier.css +10 -8
  71. package/themes/bauhaus.css +2 -0
  72. package/themes/bloomberg-dense.css +13 -11
  73. package/themes/blueprint.css +2 -0
  74. package/themes/clay.css +2 -0
  75. package/themes/comic.css +12 -10
  76. package/themes/constructivist.css +2 -0
  77. package/themes/corporate.css +4 -2
  78. package/themes/cyberpunk.css +2 -0
  79. package/themes/frutiger-aero.css +2 -0
  80. package/themes/game-adventure.css +1 -0
  81. package/themes/game-rpg.css +1 -0
  82. package/themes/game-sci-fi.css +1 -0
  83. package/themes/game-ui-pack.css +1 -0
  84. package/themes/gazette.css +10 -8
  85. package/themes/glass.css +17 -15
  86. package/themes/gothic.css +2 -0
  87. package/themes/ink-wash.css +2 -0
  88. package/themes/kawaii.css +2 -0
  89. package/themes/kiosk.css +17 -15
  90. package/themes/linear-clean.css +12 -10
  91. package/themes/luxury.css +2 -0
  92. package/themes/mac-classic.css +2 -0
  93. package/themes/material.css +2 -0
  94. package/themes/memphis.css +2 -0
  95. package/themes/mid-century.css +2 -0
  96. package/themes/minimalist.css +2 -0
  97. package/themes/mudcloth.css +2 -0
  98. package/themes/neon.css +2 -0
  99. package/themes/neumorphic.css +2 -0
  100. package/themes/newsprint.css +2 -0
  101. package/themes/notion-editorial.css +12 -10
  102. package/themes/pixel.css +2 -0
  103. package/themes/prism.css +20 -18
  104. package/themes/retro.css +2 -0
  105. package/themes/risograph.css +2 -0
  106. package/themes/scandi.css +2 -0
  107. package/themes/sketch.css +2 -0
  108. package/themes/solarpunk.css +2 -0
  109. package/themes/steampunk.css +2 -0
  110. package/themes/swiss.css +2 -0
  111. package/themes/terminal.css +8 -6
  112. package/themes/trait-wars.css +2 -0
  113. package/themes/ukiyo-e.css +2 -0
  114. package/themes/vaporwave.css +2 -0
  115. package/themes/victorian.css +2 -0
  116. package/themes/wabi-sabi.css +2 -0
  117. package/themes/win95.css +2 -0
  118. package/themes/wireframe.css +2 -0
  119. package/themes/zine.css +2 -0
  120. package/dist/Typography-2Z3JKWHN.js +0 -5
  121. package/dist/{avl-3d-context-MAt_NuU9.d.ts → avl-3d-context-DLteNEwu.d.ts} +3 -3
@@ -1,444 +1,108 @@
1
- import { domPassthrough } from './chunk-MWPX2O4M.js';
2
1
  import { useTapReveal } from './chunk-XJTHMW4G.js';
3
2
  import { useEventBus } from './chunk-6EV3OEBQ.js';
4
3
  import { updateAssetStatus } from './chunk-O7OLVVBR.js';
5
- import { cn } from './chunk-HQDKHLFG.js';
6
- import { createLogger } from '@almadar/logger';
4
+ import { cn, domPassthrough } from './chunk-IN3BVW2Z.js';
7
5
  import React, { useCallback, createContext, useContext } from 'react';
8
6
  import { useThemeScope } from '@almadar/ui/context';
9
7
  import { jsx } from 'react/jsx-runtime';
8
+ import { createLogger } from '@almadar/logger';
10
9
  import { renderUiEntriesOf } from '@almadar/core/patterns';
11
10
  import { isInlineTrait } from '@almadar/core';
12
11
  import { parseListenSource } from '@almadar/runtime';
13
12
 
14
- var log = createLogger("almadar:ui:theme-color");
15
- var THEME_SERIES = [
16
- "var(--color-primary)",
17
- "var(--color-success)",
18
- "var(--color-warning)",
19
- "var(--color-error)",
20
- "var(--color-info)",
21
- "var(--color-accent)"
22
- ];
23
- function channel(value, unitScale) {
24
- return Math.round(Math.min(255, Math.max(0, Number(value) * unitScale)));
25
- }
26
- function make(r, g, b, a) {
27
- return { r, g, b, a, css: `rgb(${r}, ${g}, ${b})` };
28
- }
29
- function parseComputedColor(value) {
30
- const v = value.trim();
31
- const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(v);
32
- if (hex) {
33
- const h = hex[1].length === 3 ? hex[1].split("").map((c) => c + c).join("") : hex[1];
34
- return make(parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16), 1);
35
- }
36
- const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/i.exec(v);
37
- if (rgb) {
38
- return make(channel(rgb[1], 1), channel(rgb[2], 1), channel(rgb[3], 1), rgb[4] === void 0 ? 1 : Number(rgb[4]));
39
- }
40
- const srgb = /^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+)\s*)?\)$/i.exec(v);
41
- if (srgb) {
42
- return make(channel(srgb[1], 255), channel(srgb[2], 255), channel(srgb[3], 255), srgb[4] === void 0 ? 1 : Number(srgb[4]));
43
- }
44
- return null;
13
+ // lib/pressable.ts
14
+ function clickElement(el) {
15
+ el.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true }));
45
16
  }
46
- var SENTINEL = "rgb(1, 2, 3)";
47
- function getComputedSentinel(doc) {
48
- const s = doc.createElement("span");
49
- s.style.display = "none";
50
- s.style.color = SENTINEL;
51
- doc.body.appendChild(s);
52
- const c = getComputedStyle(s).color;
53
- doc.body.removeChild(s);
54
- return c;
17
+ function pressableProps(onPress, options = {}) {
18
+ if (!onPress) return {};
19
+ const { disabled = false } = options;
20
+ return {
21
+ role: "button",
22
+ tabIndex: disabled ? -1 : 0,
23
+ ...disabled ? { "aria-disabled": true } : void 0,
24
+ onClick: (e) => {
25
+ if (!disabled) onPress(e);
26
+ },
27
+ onKeyDown: (e) => {
28
+ if (disabled || e.target !== e.currentTarget) return;
29
+ if (e.key === "Enter" || e.key === " ") {
30
+ e.preventDefault();
31
+ clickElement(e.currentTarget);
32
+ }
33
+ }
34
+ };
55
35
  }
56
- function resolveThemeColor(value, scope) {
57
- const doc = scope.ownerDocument;
58
- const wrapper = doc.createElement("span");
59
- wrapper.style.display = "none";
60
- wrapper.style.color = SENTINEL;
61
- const probe = doc.createElement("span");
62
- probe.style.color = value;
63
- wrapper.appendChild(probe);
64
- scope.appendChild(wrapper);
65
- const computed = probe.style.color === "" ? "" : getComputedStyle(probe).color;
66
- scope.removeChild(wrapper);
67
- const parsed = computed === getComputedSentinel(doc) ? null : parseComputedColor(computed);
68
- if (!parsed) log.error("unresolvable-theme-color", { value, computed });
69
- return parsed;
36
+ function rowActivationProps(onActivate) {
37
+ if (!onActivate) return {};
38
+ return {
39
+ tabIndex: 0,
40
+ onClick: onActivate,
41
+ onKeyDown: (e) => {
42
+ if (e.target !== e.currentTarget || e.key !== "Enter") return;
43
+ e.preventDefault();
44
+ clickElement(e.currentTarget);
45
+ }
46
+ };
70
47
  }
71
48
 
72
- // lib/avl-theme.ts
73
- function avlTint(token, percent) {
74
- return `color-mix(in srgb, ${token} ${percent}%, transparent)`;
75
- }
76
- function avlBlend(token, percent, other) {
77
- return `color-mix(in srgb, ${token} ${percent}%, ${other})`;
78
- }
79
- var AVL_INK = {
80
- text: "var(--color-foreground)",
81
- quiet: "var(--color-muted-foreground)",
82
- line: "var(--color-border)",
83
- surface: "var(--color-card)",
84
- wash: "var(--color-muted)",
85
- canvas: "var(--color-background)",
86
- focus: "var(--color-primary)",
87
- onFocus: "var(--color-primary-foreground)",
88
- pass: "var(--color-success)",
89
- fail: "var(--color-error)",
90
- caution: "var(--color-warning)"
91
- };
92
- var AVL_STROKE = {
93
- hairline: 1,
94
- wire: 1.5,
95
- active: 2.5
49
+ // components/core/atoms/Box.tsx
50
+ var paddingStyles = {
51
+ none: "p-0",
52
+ xs: "p-1",
53
+ sm: "p-2",
54
+ md: "p-4",
55
+ lg: "p-6",
56
+ xl: "p-8",
57
+ "2xl": "p-12"
96
58
  };
97
- var AVL_FONT = {
98
- body: "var(--font-family-body, var(--font-family))",
99
- mono: "var(--font-family-mono, monospace)"
59
+ var paddingXStyles = {
60
+ none: "px-0",
61
+ xs: "px-1",
62
+ sm: "px-2",
63
+ md: "px-4",
64
+ lg: "px-6",
65
+ xl: "px-8",
66
+ "2xl": "px-12"
100
67
  };
101
- function avlSeries(i) {
102
- const base = THEME_SERIES[i % THEME_SERIES.length];
103
- const band = Math.floor(i / THEME_SERIES.length) % 3;
104
- if (band === 0) return base;
105
- return avlBlend(base, 65, band === 1 ? AVL_INK.text : AVL_INK.canvas);
106
- }
107
- var STATE_COLORS = {
108
- initial: { fill: avlTint("var(--color-success)", 12), border: "var(--color-success)" },
109
- terminal: { fill: avlTint("var(--color-foreground)", 6), border: "var(--color-foreground)" },
110
- hub: { fill: avlTint("var(--color-info)", 12), border: "var(--color-info)" },
111
- default: { fill: avlTint("var(--color-muted-foreground)", 8), border: "var(--color-muted-foreground)" }
68
+ var paddingYStyles = {
69
+ none: "py-0",
70
+ xs: "py-1",
71
+ sm: "py-2",
72
+ md: "py-4",
73
+ lg: "py-6",
74
+ xl: "py-8",
75
+ "2xl": "py-12"
112
76
  };
113
- function getStateRole(isInitial, isTerminal, transitionCount, maxTransitionCount) {
114
- if (isInitial) return "initial";
115
- if (isTerminal) return "terminal";
116
- if (transitionCount != null && maxTransitionCount != null && transitionCount === maxTransitionCount && transitionCount >= 3) return "hub";
117
- return "default";
118
- }
119
- var CONNECTION_COLORS = {
120
- forward: { color: "var(--color-muted-foreground)", width: 1.5, dash: "none" },
121
- backward: { color: "var(--color-muted-foreground)", width: 1.5, dash: "5 4" },
122
- selfLoop: { color: "var(--color-muted-foreground)", width: 1, dash: "3 2" },
123
- emitListen: { color: "var(--color-warning)", width: 1.5, dash: "4 3" }
77
+ var marginStyles = {
78
+ none: "m-0",
79
+ xs: "m-1",
80
+ sm: "m-2",
81
+ md: "m-4",
82
+ lg: "m-6",
83
+ xl: "m-8",
84
+ "2xl": "m-12",
85
+ auto: "m-auto"
124
86
  };
125
- var EFFECT_CATEGORY_COLORS = {
126
- ui: { color: "var(--color-accent)", bg: avlTint("var(--color-accent)", 10) },
127
- data: { color: "var(--color-info)", bg: avlTint("var(--color-info)", 10) },
128
- communication: { color: "var(--color-warning)", bg: avlTint("var(--color-warning)", 10) },
129
- lifecycle: { color: "var(--color-success)", bg: avlTint("var(--color-success)", 10) },
130
- control: { color: "var(--color-muted-foreground)", bg: avlTint("var(--color-muted-foreground)", 10) },
131
- async: { color: avlBlend("var(--color-info)", 50, "var(--color-accent)"), bg: avlTint(avlBlend("var(--color-info)", 50, "var(--color-accent)"), 10) },
132
- compute: { color: "var(--color-primary)", bg: avlTint("var(--color-primary)", 10) },
133
- system: { color: avlBlend("var(--color-muted-foreground)", 60, "var(--color-primary)"), bg: avlTint("var(--color-muted-foreground)", 10) }
87
+ var marginXStyles = {
88
+ none: "mx-0",
89
+ xs: "mx-1",
90
+ sm: "mx-2",
91
+ md: "mx-4",
92
+ lg: "mx-6",
93
+ xl: "mx-8",
94
+ "2xl": "mx-12",
95
+ auto: "mx-auto"
134
96
  };
135
- var EFFECT_OPERATOR_CATEGORY = {
136
- "render-ui": "ui",
137
- "navigate": "ui",
138
- "navigate-back": "ui",
139
- "set": "data",
140
- "persist": "data",
141
- "fetch": "data",
142
- "fetch-stream": "data",
143
- "ref": "data",
144
- "deref": "data",
145
- "swap": "data",
146
- "watch": "data",
147
- "emit": "communication",
148
- "notify": "communication",
149
- "send-server": "communication",
150
- "call-service": "communication",
151
- "integration/http": "communication",
152
- "integration/github-get-repo": "communication",
153
- "integration/github-create-issue": "communication",
154
- "spawn": "lifecycle",
155
- "despawn": "lifecycle",
156
- "do": "control",
157
- "if": "control",
158
- "when": "control",
159
- "let": "control",
160
- "log": "control",
161
- "atomic": "control",
162
- "wait": "async",
163
- "async/delay": "async",
164
- "async/debounce": "async",
165
- "async/throttle": "async",
166
- "async/interval": "async",
167
- "async/race": "async",
168
- "async/all": "async",
169
- "async/sequence": "async",
170
- "async/timeout": "async",
171
- "async/retry": "async",
172
- "forward": "compute",
173
- "train": "compute",
174
- "evaluate": "compute",
175
- "checkpoint/save": "compute",
176
- "checkpoint/load": "compute",
177
- "nn/setWeights": "compute",
178
- "train/loop": "compute",
179
- "train/step": "compute",
180
- "train/clipGradients": "compute",
181
- "train/clipWeights": "compute",
182
- "train/sgd": "compute",
183
- "train/adam": "compute",
184
- "prob/seed": "compute",
185
- "prob/condition": "compute",
186
- "workspace/write-orbital": "system",
187
- "workspace/write-file": "system",
188
- "workspace/write-schema": "system",
189
- "workspace/write-plan": "system",
190
- "workspace/archive-orbital": "system",
191
- "lolo/emit-body": "system"
192
- };
193
- var EFFECT_FAMILY_CATEGORY = {
194
- agent: "system",
195
- os: "system",
196
- browser: "system",
197
- llm: "system",
198
- behavior: "system",
199
- validate: "control",
200
- session: "system",
201
- compose: "system",
202
- trace: "control",
203
- memory: "data",
204
- application: "system"
205
- };
206
- var EFFECT_OPERATOR_ZONE = {
207
- "render-ui": "screen",
208
- "navigate": "route",
209
- "navigate-back": "route",
210
- "set": "entity",
211
- "swap": "entity",
212
- "ref": "store",
213
- "deref": "store",
214
- "watch": "store",
215
- "persist": "store",
216
- "fetch": "store",
217
- "fetch-stream": "store",
218
- "emit": "bus",
219
- "send-server": "bus",
220
- "notify": "toast",
221
- "call-service": "remote",
222
- "integration/http": "remote",
223
- "integration/github-get-repo": "remote",
224
- "integration/github-create-issue": "remote",
225
- "spawn": "instances",
226
- "despawn": "instances",
227
- "do": "flow",
228
- "if": "flow",
229
- "when": "flow",
230
- "let": "flow",
231
- "log": "flow",
232
- "atomic": "flow",
233
- "wait": "timer",
234
- "async/delay": "timer",
235
- "async/debounce": "timer",
236
- "async/throttle": "timer",
237
- "async/interval": "timer",
238
- "async/race": "timer",
239
- "async/all": "timer",
240
- "async/sequence": "timer",
241
- "async/timeout": "timer",
242
- "async/retry": "timer",
243
- "forward": "model",
244
- "train": "model",
245
- "evaluate": "model",
246
- "checkpoint/save": "model",
247
- "checkpoint/load": "model",
248
- "nn/setWeights": "model",
249
- "train/loop": "model",
250
- "train/step": "model",
251
- "train/clipGradients": "model",
252
- "train/clipWeights": "model",
253
- "train/sgd": "model",
254
- "train/adam": "model",
255
- "prob/seed": "model",
256
- "prob/condition": "model",
257
- "workspace/write-orbital": "system",
258
- "workspace/write-file": "system",
259
- "workspace/write-schema": "system",
260
- "workspace/write-plan": "system",
261
- "workspace/archive-orbital": "system",
262
- "lolo/emit-body": "system"
263
- };
264
- var EFFECT_FAMILY_ZONE = {
265
- agent: "system",
266
- os: "system",
267
- browser: "system",
268
- llm: "remote",
269
- behavior: "system",
270
- validate: "flow",
271
- session: "system",
272
- compose: "system",
273
- trace: "flow",
274
- memory: "store",
275
- application: "system"
276
- };
277
- function isEffectOperator(head) {
278
- return head in EFFECT_OPERATOR_CATEGORY;
279
- }
280
- function isEffectFamily(prefix) {
281
- return prefix in EFFECT_FAMILY_CATEGORY;
282
- }
283
- function effectCategoryOf(head) {
284
- if (isEffectOperator(head)) return EFFECT_OPERATOR_CATEGORY[head];
285
- const slash = head.indexOf("/");
286
- if (slash > 0) {
287
- const prefix = head.slice(0, slash);
288
- if (isEffectFamily(prefix)) return EFFECT_FAMILY_CATEGORY[prefix];
289
- }
290
- return null;
291
- }
292
- function asEffectOperator(head) {
293
- return isEffectOperator(head) ? head : null;
294
- }
295
- var OPERATOR_CATEGORY_COLORS = {
296
- "arithmetic": "var(--color-primary)",
297
- "comparison": "var(--color-warning)",
298
- "logic": "var(--color-accent)",
299
- "control": "var(--color-error)",
300
- "effect": avlBlend("var(--color-warning)", 60, "var(--color-error)"),
301
- "collection": "var(--color-info)",
302
- "std-math": "var(--color-primary)",
303
- "std-str": "var(--color-success)",
304
- "std-array": "var(--color-info)",
305
- "std-object": avlBlend("var(--color-info)", 60, "var(--color-foreground)"),
306
- "std-validate": "var(--color-warning)",
307
- "std-json": avlBlend("var(--color-success)", 60, "var(--color-foreground)"),
308
- "std-time": avlBlend("var(--color-info)", 50, "var(--color-success)"),
309
- "std-format": avlBlend("var(--color-success)", 60, "var(--color-background)"),
310
- "std-async": avlBlend("var(--color-accent)", 50, "var(--color-error)"),
311
- "std-nn": avlBlend("var(--color-primary)", 60, "var(--color-accent)"),
312
- "std-tensor": avlBlend("var(--color-primary)", 60, "var(--color-info)"),
313
- "std-train": avlBlend("var(--color-primary)", 60, "var(--color-warning)"),
314
- "std-prob": avlBlend("var(--color-accent)", 60, "var(--color-warning)"),
315
- "std-os": avlBlend("var(--color-muted-foreground)", 60, "var(--color-primary)"),
316
- "std-browser": avlBlend("var(--color-muted-foreground)", 60, "var(--color-info)"),
317
- "std-composition": avlBlend("var(--color-accent)", 60, "var(--color-foreground)"),
318
- "std-vec": avlBlend("var(--color-primary)", 60, "var(--color-background)"),
319
- "std-geo": avlBlend("var(--color-success)", 50, "var(--color-info)"),
320
- "std-grid": avlBlend("var(--color-info)", 60, "var(--color-background)"),
321
- "std-anim": avlBlend("var(--color-accent)", 60, "var(--color-background)"),
322
- "std-ease": avlBlend("var(--color-accent)", 50, "var(--color-info)"),
323
- "std-noise": avlBlend("var(--color-muted-foreground)", 60, "var(--color-accent)"),
324
- "std-path": avlBlend("var(--color-success)", 60, "var(--color-primary)"),
325
- "ml-arch": avlBlend("var(--color-primary)", 70, "var(--color-foreground)"),
326
- "ml-effect": avlBlend("var(--color-primary)", 50, "var(--color-error)"),
327
- "ml-tensor": avlBlend("var(--color-primary)", 50, "var(--color-info)"),
328
- "ml-graph": avlBlend("var(--color-primary)", 50, "var(--color-success)"),
329
- "ml-contract": avlBlend("var(--color-primary)", 50, "var(--color-warning)"),
330
- "ml-data": avlBlend("var(--color-primary)", 50, "var(--color-background)"),
331
- "std-llm": avlBlend("var(--color-accent)", 70, "var(--color-primary)"),
332
- "std-workspace": avlBlend("var(--color-muted-foreground)", 60, "var(--color-warning)"),
333
- "std-session": avlBlend("var(--color-muted-foreground)", 60, "var(--color-success)"),
334
- "std-memory": avlBlend("var(--color-info)", 60, "var(--color-accent)"),
335
- "std-trace": "var(--color-muted-foreground)",
336
- "std-behavior": avlBlend("var(--color-accent)", 60, "var(--color-success)"),
337
- "std-integration": avlBlend("var(--color-warning)", 60, "var(--color-info)")
338
- };
339
- function effectZoneOf(head) {
340
- if (isEffectOperator(head)) return EFFECT_OPERATOR_ZONE[head];
341
- const slash = head.indexOf("/");
342
- if (slash > 0) {
343
- const prefix = head.slice(0, slash);
344
- if (isEffectFamily(prefix)) return EFFECT_FAMILY_ZONE[prefix];
345
- }
346
- return null;
347
- }
348
-
349
- // lib/pressable.ts
350
- function clickElement(el) {
351
- el.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true }));
352
- }
353
- function pressableProps(onPress, options = {}) {
354
- if (!onPress) return {};
355
- const { disabled = false } = options;
356
- return {
357
- role: "button",
358
- tabIndex: disabled ? -1 : 0,
359
- ...disabled ? { "aria-disabled": true } : void 0,
360
- onClick: (e) => {
361
- if (!disabled) onPress(e);
362
- },
363
- onKeyDown: (e) => {
364
- if (disabled || e.target !== e.currentTarget) return;
365
- if (e.key === "Enter" || e.key === " ") {
366
- e.preventDefault();
367
- clickElement(e.currentTarget);
368
- }
369
- }
370
- };
371
- }
372
- function rowActivationProps(onActivate) {
373
- if (!onActivate) return {};
374
- return {
375
- tabIndex: 0,
376
- onClick: onActivate,
377
- onKeyDown: (e) => {
378
- if (e.target !== e.currentTarget || e.key !== "Enter") return;
379
- e.preventDefault();
380
- clickElement(e.currentTarget);
381
- }
382
- };
383
- }
384
-
385
- // components/core/atoms/Box.tsx
386
- var paddingStyles = {
387
- none: "p-0",
388
- xs: "p-1",
389
- sm: "p-2",
390
- md: "p-4",
391
- lg: "p-6",
392
- xl: "p-8",
393
- "2xl": "p-12"
394
- };
395
- var paddingXStyles = {
396
- none: "px-0",
397
- xs: "px-1",
398
- sm: "px-2",
399
- md: "px-4",
400
- lg: "px-6",
401
- xl: "px-8",
402
- "2xl": "px-12"
403
- };
404
- var paddingYStyles = {
405
- none: "py-0",
406
- xs: "py-1",
407
- sm: "py-2",
408
- md: "py-4",
409
- lg: "py-6",
410
- xl: "py-8",
411
- "2xl": "py-12"
412
- };
413
- var marginStyles = {
414
- none: "m-0",
415
- xs: "m-1",
416
- sm: "m-2",
417
- md: "m-4",
418
- lg: "m-6",
419
- xl: "m-8",
420
- "2xl": "m-12",
421
- auto: "m-auto"
422
- };
423
- var marginXStyles = {
424
- none: "mx-0",
425
- xs: "mx-1",
426
- sm: "mx-2",
427
- md: "mx-4",
428
- lg: "mx-6",
429
- xl: "mx-8",
430
- "2xl": "mx-12",
431
- auto: "mx-auto"
432
- };
433
- var marginYStyles = {
434
- none: "my-0",
435
- xs: "my-1",
436
- sm: "my-2",
437
- md: "my-4",
438
- lg: "my-6",
439
- xl: "my-8",
440
- "2xl": "my-12",
441
- auto: "my-auto"
97
+ var marginYStyles = {
98
+ none: "my-0",
99
+ xs: "my-1",
100
+ sm: "my-2",
101
+ md: "my-4",
102
+ lg: "my-6",
103
+ xl: "my-8",
104
+ "2xl": "my-12",
105
+ auto: "my-auto"
442
106
  };
443
107
  var bgStyles = {
444
108
  transparent: "bg-transparent",
@@ -670,6 +334,340 @@ var Stack = ({
670
334
  };
671
335
  var VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
672
336
  var HStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "horizontal", ...props });
337
+ var log = createLogger("almadar:ui:theme-color");
338
+ var THEME_SERIES = [
339
+ "var(--color-primary)",
340
+ "var(--color-success)",
341
+ "var(--color-warning)",
342
+ "var(--color-error)",
343
+ "var(--color-info)",
344
+ "var(--color-accent)"
345
+ ];
346
+ function channel(value, unitScale) {
347
+ return Math.round(Math.min(255, Math.max(0, Number(value) * unitScale)));
348
+ }
349
+ function make(r, g, b, a) {
350
+ return { r, g, b, a, css: `rgb(${r}, ${g}, ${b})` };
351
+ }
352
+ function parseComputedColor(value) {
353
+ const v = value.trim();
354
+ const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(v);
355
+ if (hex) {
356
+ const h = hex[1].length === 3 ? hex[1].split("").map((c) => c + c).join("") : hex[1];
357
+ return make(parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16), 1);
358
+ }
359
+ const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/i.exec(v);
360
+ if (rgb) {
361
+ return make(channel(rgb[1], 1), channel(rgb[2], 1), channel(rgb[3], 1), rgb[4] === void 0 ? 1 : Number(rgb[4]));
362
+ }
363
+ const srgb = /^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+)\s*)?\)$/i.exec(v);
364
+ if (srgb) {
365
+ return make(channel(srgb[1], 255), channel(srgb[2], 255), channel(srgb[3], 255), srgb[4] === void 0 ? 1 : Number(srgb[4]));
366
+ }
367
+ return null;
368
+ }
369
+ var SENTINEL = "rgb(1, 2, 3)";
370
+ function getComputedSentinel(doc) {
371
+ const s = doc.createElement("span");
372
+ s.style.display = "none";
373
+ s.style.color = SENTINEL;
374
+ doc.body.appendChild(s);
375
+ const c = getComputedStyle(s).color;
376
+ doc.body.removeChild(s);
377
+ return c;
378
+ }
379
+ function resolveThemeColor(value, scope) {
380
+ const doc = scope.ownerDocument;
381
+ const wrapper = doc.createElement("span");
382
+ wrapper.style.display = "none";
383
+ wrapper.style.color = SENTINEL;
384
+ const probe = doc.createElement("span");
385
+ probe.style.color = value;
386
+ wrapper.appendChild(probe);
387
+ scope.appendChild(wrapper);
388
+ const computed = probe.style.color === "" ? "" : getComputedStyle(probe).color;
389
+ scope.removeChild(wrapper);
390
+ const parsed = computed === getComputedSentinel(doc) ? null : parseComputedColor(computed);
391
+ if (!parsed) log.error("unresolvable-theme-color", { value, computed });
392
+ return parsed;
393
+ }
394
+
395
+ // lib/avl-theme.ts
396
+ function avlTint(token, percent) {
397
+ return `color-mix(in srgb, ${token} ${percent}%, transparent)`;
398
+ }
399
+ function avlBlend(token, percent, other) {
400
+ return `color-mix(in srgb, ${token} ${percent}%, ${other})`;
401
+ }
402
+ var AVL_INK = {
403
+ text: "var(--color-foreground)",
404
+ quiet: "var(--color-muted-foreground)",
405
+ line: "var(--color-border)",
406
+ surface: "var(--color-card)",
407
+ wash: "var(--color-muted)",
408
+ canvas: "var(--color-background)",
409
+ focus: "var(--color-primary)",
410
+ onFocus: "var(--color-primary-foreground)",
411
+ pass: "var(--color-success)",
412
+ fail: "var(--color-error)",
413
+ caution: "var(--color-warning)"
414
+ };
415
+ var AVL_STROKE = {
416
+ hairline: 1,
417
+ wire: 1.5,
418
+ active: 2.5
419
+ };
420
+ var AVL_FONT = {
421
+ body: "var(--font-family-body, var(--font-family))",
422
+ mono: "var(--font-family-mono, monospace)"
423
+ };
424
+ function avlSeries(i) {
425
+ const base = THEME_SERIES[i % THEME_SERIES.length];
426
+ const band = Math.floor(i / THEME_SERIES.length) % 3;
427
+ if (band === 0) return base;
428
+ return avlBlend(base, 65, band === 1 ? AVL_INK.text : AVL_INK.canvas);
429
+ }
430
+ var STATE_COLORS = {
431
+ initial: { fill: avlTint("var(--color-success)", 12), border: "var(--color-success)" },
432
+ terminal: { fill: avlTint("var(--color-foreground)", 6), border: "var(--color-foreground)" },
433
+ hub: { fill: avlTint("var(--color-info)", 12), border: "var(--color-info)" },
434
+ default: { fill: avlTint("var(--color-muted-foreground)", 8), border: "var(--color-muted-foreground)" }
435
+ };
436
+ function getStateRole(isInitial, isTerminal, transitionCount, maxTransitionCount) {
437
+ if (isInitial) return "initial";
438
+ if (isTerminal) return "terminal";
439
+ if (transitionCount != null && maxTransitionCount != null && transitionCount === maxTransitionCount && transitionCount >= 3) return "hub";
440
+ return "default";
441
+ }
442
+ var CONNECTION_COLORS = {
443
+ forward: { color: "var(--color-muted-foreground)", width: 1.5, dash: "none" },
444
+ backward: { color: "var(--color-muted-foreground)", width: 1.5, dash: "5 4" },
445
+ selfLoop: { color: "var(--color-muted-foreground)", width: 1, dash: "3 2" },
446
+ emitListen: { color: "var(--color-warning)", width: 1.5, dash: "4 3" }
447
+ };
448
+ var EFFECT_CATEGORY_COLORS = {
449
+ ui: { color: "var(--color-accent)", bg: avlTint("var(--color-accent)", 10) },
450
+ data: { color: "var(--color-info)", bg: avlTint("var(--color-info)", 10) },
451
+ communication: { color: "var(--color-warning)", bg: avlTint("var(--color-warning)", 10) },
452
+ lifecycle: { color: "var(--color-success)", bg: avlTint("var(--color-success)", 10) },
453
+ control: { color: "var(--color-muted-foreground)", bg: avlTint("var(--color-muted-foreground)", 10) },
454
+ async: { color: avlBlend("var(--color-info)", 50, "var(--color-accent)"), bg: avlTint(avlBlend("var(--color-info)", 50, "var(--color-accent)"), 10) },
455
+ compute: { color: "var(--color-primary)", bg: avlTint("var(--color-primary)", 10) },
456
+ system: { color: avlBlend("var(--color-muted-foreground)", 60, "var(--color-primary)"), bg: avlTint("var(--color-muted-foreground)", 10) }
457
+ };
458
+ var EFFECT_OPERATOR_CATEGORY = {
459
+ "render-ui": "ui",
460
+ "navigate": "ui",
461
+ "navigate-back": "ui",
462
+ "set": "data",
463
+ "persist": "data",
464
+ "fetch": "data",
465
+ "fetch-stream": "data",
466
+ "ref": "data",
467
+ "deref": "data",
468
+ "swap": "data",
469
+ "watch": "data",
470
+ "emit": "communication",
471
+ "notify": "communication",
472
+ "send-server": "communication",
473
+ "call-service": "communication",
474
+ "integration/http": "communication",
475
+ "integration/github-get-repo": "communication",
476
+ "integration/github-create-issue": "communication",
477
+ "spawn": "lifecycle",
478
+ "despawn": "lifecycle",
479
+ "do": "control",
480
+ "if": "control",
481
+ "when": "control",
482
+ "let": "control",
483
+ "log": "control",
484
+ "atomic": "control",
485
+ "wait": "async",
486
+ "async/delay": "async",
487
+ "async/debounce": "async",
488
+ "async/throttle": "async",
489
+ "async/interval": "async",
490
+ "async/race": "async",
491
+ "async/all": "async",
492
+ "async/sequence": "async",
493
+ "async/timeout": "async",
494
+ "async/retry": "async",
495
+ "forward": "compute",
496
+ "train": "compute",
497
+ "evaluate": "compute",
498
+ "checkpoint/save": "compute",
499
+ "checkpoint/load": "compute",
500
+ "nn/setWeights": "compute",
501
+ "train/loop": "compute",
502
+ "train/step": "compute",
503
+ "train/clipGradients": "compute",
504
+ "train/clipWeights": "compute",
505
+ "train/sgd": "compute",
506
+ "train/adam": "compute",
507
+ "prob/seed": "compute",
508
+ "prob/condition": "compute",
509
+ "workspace/write-orbital": "system",
510
+ "workspace/write-file": "system",
511
+ "workspace/write-schema": "system",
512
+ "workspace/write-plan": "system",
513
+ "workspace/archive-orbital": "system",
514
+ "lolo/emit-body": "system"
515
+ };
516
+ var EFFECT_FAMILY_CATEGORY = {
517
+ agent: "system",
518
+ os: "system",
519
+ browser: "system",
520
+ llm: "system",
521
+ behavior: "system",
522
+ validate: "control",
523
+ session: "system",
524
+ compose: "system",
525
+ trace: "control",
526
+ memory: "data",
527
+ application: "system"
528
+ };
529
+ var EFFECT_OPERATOR_ZONE = {
530
+ "render-ui": "screen",
531
+ "navigate": "route",
532
+ "navigate-back": "route",
533
+ "set": "entity",
534
+ "swap": "entity",
535
+ "ref": "store",
536
+ "deref": "store",
537
+ "watch": "store",
538
+ "persist": "store",
539
+ "fetch": "store",
540
+ "fetch-stream": "store",
541
+ "emit": "bus",
542
+ "send-server": "bus",
543
+ "notify": "toast",
544
+ "call-service": "remote",
545
+ "integration/http": "remote",
546
+ "integration/github-get-repo": "remote",
547
+ "integration/github-create-issue": "remote",
548
+ "spawn": "instances",
549
+ "despawn": "instances",
550
+ "do": "flow",
551
+ "if": "flow",
552
+ "when": "flow",
553
+ "let": "flow",
554
+ "log": "flow",
555
+ "atomic": "flow",
556
+ "wait": "timer",
557
+ "async/delay": "timer",
558
+ "async/debounce": "timer",
559
+ "async/throttle": "timer",
560
+ "async/interval": "timer",
561
+ "async/race": "timer",
562
+ "async/all": "timer",
563
+ "async/sequence": "timer",
564
+ "async/timeout": "timer",
565
+ "async/retry": "timer",
566
+ "forward": "model",
567
+ "train": "model",
568
+ "evaluate": "model",
569
+ "checkpoint/save": "model",
570
+ "checkpoint/load": "model",
571
+ "nn/setWeights": "model",
572
+ "train/loop": "model",
573
+ "train/step": "model",
574
+ "train/clipGradients": "model",
575
+ "train/clipWeights": "model",
576
+ "train/sgd": "model",
577
+ "train/adam": "model",
578
+ "prob/seed": "model",
579
+ "prob/condition": "model",
580
+ "workspace/write-orbital": "system",
581
+ "workspace/write-file": "system",
582
+ "workspace/write-schema": "system",
583
+ "workspace/write-plan": "system",
584
+ "workspace/archive-orbital": "system",
585
+ "lolo/emit-body": "system"
586
+ };
587
+ var EFFECT_FAMILY_ZONE = {
588
+ agent: "system",
589
+ os: "system",
590
+ browser: "system",
591
+ llm: "remote",
592
+ behavior: "system",
593
+ validate: "flow",
594
+ session: "system",
595
+ compose: "system",
596
+ trace: "flow",
597
+ memory: "store",
598
+ application: "system"
599
+ };
600
+ function isEffectOperator(head) {
601
+ return head in EFFECT_OPERATOR_CATEGORY;
602
+ }
603
+ function isEffectFamily(prefix) {
604
+ return prefix in EFFECT_FAMILY_CATEGORY;
605
+ }
606
+ function effectCategoryOf(head) {
607
+ if (isEffectOperator(head)) return EFFECT_OPERATOR_CATEGORY[head];
608
+ const slash = head.indexOf("/");
609
+ if (slash > 0) {
610
+ const prefix = head.slice(0, slash);
611
+ if (isEffectFamily(prefix)) return EFFECT_FAMILY_CATEGORY[prefix];
612
+ }
613
+ return null;
614
+ }
615
+ function asEffectOperator(head) {
616
+ return isEffectOperator(head) ? head : null;
617
+ }
618
+ var OPERATOR_CATEGORY_COLORS = {
619
+ "arithmetic": "var(--color-primary)",
620
+ "comparison": "var(--color-warning)",
621
+ "logic": "var(--color-accent)",
622
+ "control": "var(--color-error)",
623
+ "effect": avlBlend("var(--color-warning)", 60, "var(--color-error)"),
624
+ "collection": "var(--color-info)",
625
+ "std-math": "var(--color-primary)",
626
+ "std-str": "var(--color-success)",
627
+ "std-array": "var(--color-info)",
628
+ "std-object": avlBlend("var(--color-info)", 60, "var(--color-foreground)"),
629
+ "std-validate": "var(--color-warning)",
630
+ "std-json": avlBlend("var(--color-success)", 60, "var(--color-foreground)"),
631
+ "std-time": avlBlend("var(--color-info)", 50, "var(--color-success)"),
632
+ "std-format": avlBlend("var(--color-success)", 60, "var(--color-background)"),
633
+ "std-async": avlBlend("var(--color-accent)", 50, "var(--color-error)"),
634
+ "std-nn": avlBlend("var(--color-primary)", 60, "var(--color-accent)"),
635
+ "std-tensor": avlBlend("var(--color-primary)", 60, "var(--color-info)"),
636
+ "std-train": avlBlend("var(--color-primary)", 60, "var(--color-warning)"),
637
+ "std-prob": avlBlend("var(--color-accent)", 60, "var(--color-warning)"),
638
+ "std-os": avlBlend("var(--color-muted-foreground)", 60, "var(--color-primary)"),
639
+ "std-browser": avlBlend("var(--color-muted-foreground)", 60, "var(--color-info)"),
640
+ "std-composition": avlBlend("var(--color-accent)", 60, "var(--color-foreground)"),
641
+ "std-vec": avlBlend("var(--color-primary)", 60, "var(--color-background)"),
642
+ "std-geo": avlBlend("var(--color-success)", 50, "var(--color-info)"),
643
+ "std-grid": avlBlend("var(--color-info)", 60, "var(--color-background)"),
644
+ "std-anim": avlBlend("var(--color-accent)", 60, "var(--color-background)"),
645
+ "std-ease": avlBlend("var(--color-accent)", 50, "var(--color-info)"),
646
+ "std-noise": avlBlend("var(--color-muted-foreground)", 60, "var(--color-accent)"),
647
+ "std-path": avlBlend("var(--color-success)", 60, "var(--color-primary)"),
648
+ "ml-arch": avlBlend("var(--color-primary)", 70, "var(--color-foreground)"),
649
+ "ml-effect": avlBlend("var(--color-primary)", 50, "var(--color-error)"),
650
+ "ml-tensor": avlBlend("var(--color-primary)", 50, "var(--color-info)"),
651
+ "ml-graph": avlBlend("var(--color-primary)", 50, "var(--color-success)"),
652
+ "ml-contract": avlBlend("var(--color-primary)", 50, "var(--color-warning)"),
653
+ "ml-data": avlBlend("var(--color-primary)", 50, "var(--color-background)"),
654
+ "std-llm": avlBlend("var(--color-accent)", 70, "var(--color-primary)"),
655
+ "std-workspace": avlBlend("var(--color-muted-foreground)", 60, "var(--color-warning)"),
656
+ "std-session": avlBlend("var(--color-muted-foreground)", 60, "var(--color-success)"),
657
+ "std-memory": avlBlend("var(--color-info)", 60, "var(--color-accent)"),
658
+ "std-trace": "var(--color-muted-foreground)",
659
+ "std-behavior": avlBlend("var(--color-accent)", 60, "var(--color-success)"),
660
+ "std-integration": avlBlend("var(--color-warning)", 60, "var(--color-info)")
661
+ };
662
+ function effectZoneOf(head) {
663
+ if (isEffectOperator(head)) return EFFECT_OPERATOR_ZONE[head];
664
+ const slash = head.indexOf("/");
665
+ if (slash > 0) {
666
+ const prefix = head.slice(0, slash);
667
+ if (isEffectFamily(prefix)) return EFFECT_FAMILY_ZONE[prefix];
668
+ }
669
+ return null;
670
+ }
673
671
  function instanceOf(orbital, orbitalId, ref) {
674
672
  const at = orbitalId === void 0 ? { orbital } : { orbital, orbitalId };
675
673
  if (isInlineTrait(ref)) return { ...at, name: ref.name, trait: ref };