@almadar/ui 5.123.0 → 5.125.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 (63) hide show
  1. package/dist/{TraitProvider-YkK6tXDw.d.cts → TraitProvider-Ch79cUcb.d.cts} +6 -1
  2. package/dist/{TraitProvider-YkK6tXDw.d.ts → TraitProvider-Ch79cUcb.d.ts} +6 -1
  3. package/dist/{UserContext-bziZwgFL.d.cts → UserContext-BKckAUv7.d.cts} +5 -5
  4. package/dist/{UserContext-bziZwgFL.d.ts → UserContext-BKckAUv7.d.ts} +5 -5
  5. package/dist/avl/index.cjs +332 -275
  6. package/dist/avl/index.js +334 -277
  7. package/dist/components/index.cjs +284 -248
  8. package/dist/components/index.d.cts +4 -3
  9. package/dist/components/index.d.ts +4 -3
  10. package/dist/components/index.js +284 -248
  11. package/dist/context/index.cjs +25 -66
  12. package/dist/context/index.d.cts +1 -1
  13. package/dist/context/index.d.ts +1 -1
  14. package/dist/context/index.js +25 -66
  15. package/dist/{offline-executor-aRuNznZx.d.cts → offline-executor-Qz4b6GpF.d.cts} +19 -1
  16. package/dist/{offline-executor-aRuNznZx.d.ts → offline-executor-Qz4b6GpF.d.ts} +19 -1
  17. package/dist/providers/index.cjs +395 -275
  18. package/dist/providers/index.d.cts +6 -6
  19. package/dist/providers/index.d.ts +6 -6
  20. package/dist/providers/index.js +394 -276
  21. package/dist/renderer/index.cjs +8 -0
  22. package/dist/renderer/index.d.cts +2 -2
  23. package/dist/renderer/index.d.ts +2 -2
  24. package/dist/renderer/index.js +1 -1
  25. package/dist/runtime/index.cjs +325 -268
  26. package/dist/runtime/index.d.cts +4 -2
  27. package/dist/runtime/index.d.ts +4 -2
  28. package/dist/runtime/index.js +327 -270
  29. package/package.json +13 -11
  30. package/themes/_contract.md +2 -0
  31. package/themes/almadar-website.css +3 -3
  32. package/themes/almadar.css +4 -4
  33. package/themes/bloomberg-dense.css +2 -2
  34. package/themes/clay.css +417 -0
  35. package/themes/corporate.css +411 -0
  36. package/themes/game-adventure.css +3 -3
  37. package/themes/game-rpg.css +2 -2
  38. package/themes/game-sci-fi.css +1 -1
  39. package/themes/game-ui-pack.css +2 -2
  40. package/themes/gazette.css +2 -2
  41. package/themes/glass.css +428 -0
  42. package/themes/index.css +9 -13
  43. package/themes/kiosk.css +5 -5
  44. package/themes/linear-clean.css +1 -1
  45. package/themes/minimalist.css +2 -2
  46. package/themes/neon.css +3 -3
  47. package/themes/notion-editorial.css +1 -1
  48. package/themes/prism.css +3 -3
  49. package/themes/retro.css +410 -0
  50. package/themes/terminal.css +1 -1
  51. package/themes/trait-wars.css +8 -8
  52. package/themes/wireframe.css +2 -2
  53. package/themes/arctic.css +0 -235
  54. package/themes/copper.css +0 -235
  55. package/themes/ember.css +0 -238
  56. package/themes/forest.css +0 -238
  57. package/themes/lavender.css +0 -233
  58. package/themes/midnight.css +0 -234
  59. package/themes/ocean.css +0 -238
  60. package/themes/rose.css +0 -233
  61. package/themes/sand.css +0 -234
  62. package/themes/slate.css +0 -233
  63. package/themes/sunset.css +0 -238
@@ -1,6 +1,6 @@
1
1
  import * as React82 from 'react';
2
2
  import React82__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
- import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, useGameAudioContextOptional, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
3
+ import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntitySchema, getAllPages, matchPathAmong, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, useGameAudioContextOptional, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
4
4
  export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
5
5
  import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
6
6
  import { clsx } from 'clsx';
@@ -69,7 +69,7 @@ import ReactMarkdown from 'react-markdown';
69
69
  import remarkGfm from 'remark-gfm';
70
70
  import remarkMath from 'remark-math';
71
71
  import rehypeKatex from 'rehype-katex';
72
- import { mergeEntityFrame, isCircuitEvent, schemaToIR, getPage, clearSchemaCache as clearSchemaCache$1, walkSExpr, buildResolvedTraitConfigs, isInlineTrait, isSExpr, isEventPayloadValue } from '@almadar/core';
72
+ import { mergeEntityFrame, isCircuitEvent, applyListenPayloadMapping, schemaToIR, getPage, clearSchemaCache as clearSchemaCache$1, walkSExpr, buildResolvedTraitConfigs, isInlineTrait, isSExpr, isEventPayloadValue } from '@almadar/core';
73
73
  import { DndContext, pointerWithin, rectIntersection, closestCorners, useSensors, useSensor, PointerSensor, KeyboardSensor, useDroppable } from '@dnd-kit/core';
74
74
  import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
75
75
  import { CSS } from '@dnd-kit/utilities';
@@ -5102,15 +5102,15 @@ var init_TextHighlight = __esm({
5102
5102
  const typeStyles = {
5103
5103
  question: cn(
5104
5104
  // Blue border for questions
5105
- "bg-card border-b-2 border-primary-600",
5105
+ "bg-card border-b-2 border-primary",
5106
5106
  "hover:bg-muted",
5107
- isActive && "bg-primary-100 ring-2 ring-primary-600"
5107
+ isActive && "bg-primary/10 ring-2 ring-primary"
5108
5108
  ),
5109
5109
  note: cn(
5110
5110
  // Yellow border for notes
5111
- "bg-card border-b-2 border-amber-500",
5111
+ "bg-card border-b-2 border-warning",
5112
5112
  "hover:bg-muted",
5113
- isActive && "bg-amber-100 ring-2 ring-amber-500"
5113
+ isActive && "bg-warning/10 ring-2 ring-warning"
5114
5114
  )
5115
5115
  };
5116
5116
  return /* @__PURE__ */ jsx(
@@ -5456,7 +5456,7 @@ function DayCell({
5456
5456
  {
5457
5457
  className: cn(
5458
5458
  "p-2 text-center cursor-pointer hover:bg-muted transition-colors",
5459
- isToday && "bg-blue-500/10",
5459
+ isToday && "bg-primary/10",
5460
5460
  className
5461
5461
  ),
5462
5462
  onClick: handleClick,
@@ -5467,7 +5467,7 @@ function DayCell({
5467
5467
  variant: "small",
5468
5468
  className: cn(
5469
5469
  "font-medium",
5470
- isToday ? "text-blue-600" : "text-muted-foreground"
5470
+ isToday ? "text-primary" : "text-muted-foreground"
5471
5471
  ),
5472
5472
  children: dayAbbr
5473
5473
  }
@@ -5479,7 +5479,7 @@ function DayCell({
5479
5479
  rounded: "full",
5480
5480
  className: cn(
5481
5481
  "h-8 w-8 mx-auto items-center justify-center",
5482
- isToday && "bg-blue-600 text-white"
5482
+ isToday && "bg-primary text-primary-foreground"
5483
5483
  ),
5484
5484
  children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-semibold", children: safeDate.getDate() })
5485
5485
  }
@@ -12191,19 +12191,19 @@ var init_ActivationBlock = __esm({
12191
12191
  "div",
12192
12192
  {
12193
12193
  className: cn(
12194
- "bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
12194
+ "bg-primary/10 border-2 border-primary rounded-lg p-5 mb-6",
12195
12195
  className
12196
12196
  ),
12197
12197
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
12198
- /* @__PURE__ */ jsx(Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
12198
+ /* @__PURE__ */ jsx(Lightbulb, { className: "text-primary flex-shrink-0 mt-1", size: 24 }),
12199
12199
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
12200
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
12201
- /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
12200
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-primary mb-2", children: "Before You Begin..." }),
12201
+ /* @__PURE__ */ jsx("p", { className: "text-foreground mb-3 text-sm md:text-base", children: question }),
12202
12202
  isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
12203
12203
  /* @__PURE__ */ jsx(
12204
12204
  "textarea",
12205
12205
  {
12206
- className: "w-full p-3 border border-indigo-300 dark:border-indigo-700 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-sm",
12206
+ className: "w-full p-3 border border-input rounded-md bg-card text-foreground focus:ring-2 focus:ring-ring focus:border-transparent text-sm",
12207
12207
  placeholder: "Jot down your thoughts...",
12208
12208
  value: response,
12209
12209
  onChange: (e) => setResponse(e.target.value),
@@ -12215,7 +12215,7 @@ var init_ActivationBlock = __esm({
12215
12215
  "button",
12216
12216
  {
12217
12217
  onClick: handleSubmit,
12218
- className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
12218
+ className: "px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary-hover text-sm font-medium transition-colors",
12219
12219
  children: "Continue to Lesson \u2192"
12220
12220
  }
12221
12221
  ),
@@ -12226,7 +12226,7 @@ var init_ActivationBlock = __esm({
12226
12226
  emit(`UI:${saveEvent}`, { response: "" });
12227
12227
  setIsExpanded(false);
12228
12228
  },
12229
- className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
12229
+ className: "px-4 py-2 text-primary hover:underline text-sm",
12230
12230
  children: "Skip for now"
12231
12231
  }
12232
12232
  )
@@ -12235,7 +12235,7 @@ var init_ActivationBlock = __esm({
12235
12235
  "button",
12236
12236
  {
12237
12237
  onClick: () => setIsExpanded(true),
12238
- className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
12238
+ className: "text-sm text-primary hover:underline font-medium",
12239
12239
  children: "\u2713 Answered \xB7 Edit response"
12240
12240
  }
12241
12241
  )
@@ -12739,7 +12739,7 @@ var init_AuthLayout = __esm({
12739
12739
  VStack,
12740
12740
  {
12741
12741
  className: cn(
12742
- "hidden lg:flex lg:w-1/2 bg-primary-600 relative overflow-hidden",
12742
+ "hidden lg:flex lg:w-1/2 bg-primary relative overflow-hidden",
12743
12743
  "justify-between p-12"
12744
12744
  ),
12745
12745
  style: backgroundImage ? {
@@ -12748,7 +12748,7 @@ var init_AuthLayout = __esm({
12748
12748
  } : void 0,
12749
12749
  gap: "none",
12750
12750
  children: [
12751
- /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
12751
+ /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary/90 to-primary-hover/90" }),
12752
12752
  /* @__PURE__ */ jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-3", children: [
12753
12753
  logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
12754
12754
  Typography,
@@ -12833,7 +12833,7 @@ var init_AuthLayout = __esm({
12833
12833
  ),
12834
12834
  children: /* @__PURE__ */ jsxs(Box, { className: "w-full max-w-md", children: [
12835
12835
  /* @__PURE__ */ jsx(Box, { className: "lg:hidden mb-8 text-center", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "inline-flex items-center gap-3", children: [
12836
- logo || /* @__PURE__ */ jsx(Box, { className: "w-12 h-12 bg-primary-600 rounded-xl flex items-center justify-center", children: /* @__PURE__ */ jsx(
12836
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-12 h-12 bg-primary rounded-xl flex items-center justify-center", children: /* @__PURE__ */ jsx(
12837
12837
  Typography,
12838
12838
  {
12839
12839
  variant: "body1",
@@ -14824,7 +14824,7 @@ var init_CodeBlock = __esm({
14824
14824
  {
14825
14825
  justify: "between",
14826
14826
  align: "center",
14827
- className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
14827
+ className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-border",
14828
14828
  children: [
14829
14829
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
14830
14830
  effectiveCopy && /* @__PURE__ */ jsx(
@@ -14833,9 +14833,9 @@ var init_CodeBlock = __esm({
14833
14833
  variant: "ghost",
14834
14834
  size: "sm",
14835
14835
  onClick: handleCopy,
14836
- className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-white",
14836
+ className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",
14837
14837
  "aria-label": t("common.copy"),
14838
- children: copied ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "w-4 h-4 text-green-400" }) : /* @__PURE__ */ jsx(Icon, { name: "copy", className: "w-4 h-4" })
14838
+ children: copied ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "w-4 h-4 text-success" }) : /* @__PURE__ */ jsx(Icon, { name: "copy", className: "w-4 h-4" })
14839
14839
  }
14840
14840
  )
14841
14841
  ]
@@ -15203,12 +15203,12 @@ var init_BloomQuizBlock = __esm({
15203
15203
  init_useEventBus();
15204
15204
  init_cn();
15205
15205
  BLOOM_CONFIG = {
15206
- remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
15207
- understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
15208
- apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
15209
- analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
15210
- evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
15211
- create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
15206
+ remember: { color: "bg-secondary text-secondary-foreground", bgColor: "bg-muted", label: "Remember" },
15207
+ understand: { color: "bg-info text-info-foreground", bgColor: "bg-info/10", label: "Understand" },
15208
+ apply: { color: "bg-success text-success-foreground", bgColor: "bg-success/10", label: "Apply" },
15209
+ analyze: { color: "bg-warning text-warning-foreground", bgColor: "bg-warning/10", label: "Analyze" },
15210
+ evaluate: { color: "bg-accent text-accent-foreground", bgColor: "bg-accent/10", label: "Evaluate" },
15211
+ create: { color: "bg-primary text-primary-foreground", bgColor: "bg-primary/10", label: "Create" }
15212
15212
  };
15213
15213
  BloomQuizBlock = ({
15214
15214
  level,
@@ -15234,22 +15234,22 @@ var init_BloomQuizBlock = __esm({
15234
15234
  "div",
15235
15235
  {
15236
15236
  className: cn(
15237
- "rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
15237
+ "rounded-lg border border-primary p-4 my-4 transition-all",
15238
15238
  config.bgColor,
15239
15239
  className
15240
15240
  ),
15241
15241
  children: [
15242
15242
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
15243
15243
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
15244
- index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
15244
+ index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground font-medium text-sm", children: [
15245
15245
  "Question ",
15246
15246
  index + 1
15247
15247
  ] }),
15248
- /* @__PURE__ */ jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
15248
+ /* @__PURE__ */ jsx("span", { className: cn(config.color, "text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
15249
15249
  ] }),
15250
- isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
15250
+ isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-success flex-shrink-0", size: 20 })
15251
15251
  ] }),
15252
- /* @__PURE__ */ jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
15252
+ /* @__PURE__ */ jsx("div", { className: "font-semibold text-primary mb-3 space-y-2", children: questionSegments.map(
15253
15253
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
15254
15254
  CodeBlock,
15255
15255
  {
@@ -15263,13 +15263,13 @@ var init_BloomQuizBlock = __esm({
15263
15263
  "button",
15264
15264
  {
15265
15265
  type: "button",
15266
- className: "inline-flex items-center rounded-md bg-indigo-600 dark:bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors",
15266
+ className: "inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary-hover transition-colors",
15267
15267
  onClick: handleReveal,
15268
15268
  children: revealed ? "Hide Answer" : "Reveal Answer"
15269
15269
  }
15270
15270
  ),
15271
- revealed && /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-white/80 dark:bg-gray-800/80 p-3 text-sm text-slate-800 dark:text-gray-200 shadow-sm border border-indigo-100 dark:border-indigo-800 mt-3 space-y-2", children: [
15272
- /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
15271
+ revealed && /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-card/80 p-3 text-sm text-foreground shadow-sm border border-primary mt-3 space-y-2", children: [
15272
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
15273
15273
  answerSegments.map(
15274
15274
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
15275
15275
  CodeBlock,
@@ -15493,12 +15493,12 @@ var init_QuizBlock = __esm({
15493
15493
  }) => {
15494
15494
  const { t } = useTranslate();
15495
15495
  const [revealed, setRevealed] = useState(false);
15496
- return /* @__PURE__ */ jsx(Card2, { className: cn("my-4 border-blue-200 dark:border-blue-800", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: "p-4", children: [
15496
+ return /* @__PURE__ */ jsx(Card2, { className: cn("my-4 border-primary", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: "p-4", children: [
15497
15497
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
15498
- /* @__PURE__ */ jsx(Icon, { icon: HelpCircle, size: "sm", className: "text-blue-500 mt-0.5 shrink-0" }),
15498
+ /* @__PURE__ */ jsx(Icon, { icon: HelpCircle, size: "sm", className: "text-primary mt-0.5 shrink-0" }),
15499
15499
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-medium", children: question })
15500
15500
  ] }),
15501
- revealed ? /* @__PURE__ */ jsx(Box, { className: "pl-7 pt-2 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground", children: answer }) }) : null,
15501
+ revealed ? /* @__PURE__ */ jsx(Box, { className: "pl-7 pt-2 border-t border-border", children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground", children: answer }) }) : null,
15502
15502
  /* @__PURE__ */ jsx(
15503
15503
  Button,
15504
15504
  {
@@ -17410,7 +17410,7 @@ var init_BookTableOfContents = __esm({
17410
17410
  className: cn(
17411
17411
  "justify-start text-left w-full",
17412
17412
  direction === "rtl" && "text-right",
17413
- isCurrent && "bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400"
17413
+ isCurrent && "bg-primary/10 text-primary"
17414
17414
  ),
17415
17415
  children: /* @__PURE__ */ jsx(Box, { className: "truncate", children: /* @__PURE__ */ jsx(Typography, { variant: "body", children: String(chapter.title ?? "") }) })
17416
17416
  },
@@ -18591,7 +18591,7 @@ function CalendarGrid({
18591
18591
  border: true,
18592
18592
  className: cn(
18593
18593
  "cursor-pointer hover:shadow-sm transition-shadow text-xs truncate",
18594
- color ? color : "bg-blue-500/15 border-blue-500/30 text-blue-600"
18594
+ color ? color : "bg-primary/10 border-primary/30 text-primary"
18595
18595
  ),
18596
18596
  onClick: (e) => handleEventClick(event, e),
18597
18597
  children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
@@ -18689,7 +18689,7 @@ function CalendarGrid({
18689
18689
  onClick: () => handleSlotClick(day, time),
18690
18690
  className: cn(
18691
18691
  "border-l border-border",
18692
- isToday && "bg-blue-50/30"
18692
+ isToday && "bg-primary/10"
18693
18693
  ),
18694
18694
  ...longPressEvent ? {
18695
18695
  onPointerDown: () => startLongPress(day, time),
@@ -20705,31 +20705,31 @@ var init_CodeRunnerPanel = __esm({
20705
20705
  }
20706
20706
  )
20707
20707
  ] }),
20708
- hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
20708
+ hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-border bg-foreground overflow-hidden", children: [
20709
20709
  /* @__PURE__ */ jsxs(
20710
20710
  HStack,
20711
20711
  {
20712
20712
  gap: "sm",
20713
20713
  align: "center",
20714
- className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
20714
+ className: "px-3 py-2 bg-card border-b border-border",
20715
20715
  children: [
20716
- /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
20717
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
20716
+ /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-muted-foreground" }),
20717
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-foreground font-medium", children: "Output" })
20718
20718
  ]
20719
20719
  }
20720
20720
  ),
20721
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
20722
- output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
20723
- output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
20724
- !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
20725
- output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
20726
- test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
20721
+ /* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
20722
+ output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-background whitespace-pre-wrap", children: output.stdout }) : null,
20723
+ output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error whitespace-pre-wrap", children: output.stderr }) : null,
20724
+ !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-background italic", children: "No output" }) : null,
20725
+ output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-border space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
20726
+ test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-success mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-error mt-0.5" }),
20727
20727
  /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
20728
20728
  /* @__PURE__ */ jsxs(
20729
20729
  Typography,
20730
20730
  {
20731
20731
  variant: "small",
20732
- className: test.passed ? "text-green-400" : "text-red-400",
20732
+ className: test.passed ? "text-success" : "text-error",
20733
20733
  children: [
20734
20734
  "Test ",
20735
20735
  index + 1,
@@ -20738,15 +20738,15 @@ var init_CodeRunnerPanel = __esm({
20738
20738
  ]
20739
20739
  }
20740
20740
  ),
20741
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
20741
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
20742
20742
  "Input: ",
20743
20743
  test.input
20744
20744
  ] }),
20745
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
20745
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
20746
20746
  "Expected: ",
20747
20747
  test.expectedOutput
20748
20748
  ] }),
20749
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
20749
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
20750
20750
  "Actual: ",
20751
20751
  test.actualOutput
20752
20752
  ] })
@@ -20931,14 +20931,14 @@ var init_ConnectionBlock = __esm({
20931
20931
  "div",
20932
20932
  {
20933
20933
  className: cn(
20934
- "bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
20934
+ "bg-success/10 border-l-4 border-success rounded-r-lg p-5 mb-6",
20935
20935
  className
20936
20936
  ),
20937
20937
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
20938
- /* @__PURE__ */ jsx(Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
20938
+ /* @__PURE__ */ jsx(Link2, { className: "text-success flex-shrink-0 mt-1", size: 20 }),
20939
20939
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
20940
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
20941
- /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
20940
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-success mb-2", children: "Building On What You Know" }),
20941
+ /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-foreground", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
20942
20942
  ] })
20943
20943
  ] })
20944
20944
  }
@@ -21025,7 +21025,7 @@ function CounterStandard({
21025
21025
  variant: "h1",
21026
21026
  className: cn(
21027
21027
  sizeStyles8[size].display,
21028
- "font-bold tabular-nums text-primary-600"
21028
+ "font-bold tabular-nums text-primary"
21029
21029
  ),
21030
21030
  children: resolved.count
21031
21031
  }
@@ -21098,7 +21098,7 @@ function CounterFull({
21098
21098
  variant: "h1",
21099
21099
  className: cn(
21100
21100
  sizeStyles8[size].display,
21101
- "font-bold tabular-nums text-primary-600"
21101
+ "font-bold tabular-nums text-primary"
21102
21102
  ),
21103
21103
  children: resolved.count
21104
21104
  }
@@ -21345,11 +21345,11 @@ var init_DashboardLayout = __esm({
21345
21345
  className: "h-16 px-4 border-b border-border dark:border-border",
21346
21346
  children: [
21347
21347
  /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
21348
- logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21348
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21349
21349
  Typography,
21350
21350
  {
21351
21351
  variant: "small",
21352
- className: "text-white font-bold text-sm",
21352
+ className: "text-primary-foreground font-bold text-sm",
21353
21353
  as: "span",
21354
21354
  children: appName.charAt(0).toUpperCase()
21355
21355
  }
@@ -21428,11 +21428,11 @@ var init_DashboardLayout = __esm({
21428
21428
  className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
21429
21429
  children: [
21430
21430
  /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
21431
- logo || /* @__PURE__ */ jsx(Box, { className: "w-7 h-7 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21431
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-7 h-7 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21432
21432
  Typography,
21433
21433
  {
21434
21434
  variant: "small",
21435
- className: "text-white font-bold text-xs",
21435
+ className: "text-primary-foreground font-bold text-xs",
21436
21436
  as: "span",
21437
21437
  children: appName.charAt(0).toUpperCase()
21438
21438
  }
@@ -21492,8 +21492,8 @@ var init_DashboardLayout = __esm({
21492
21492
  {
21493
21493
  as: "span",
21494
21494
  className: cn(
21495
- "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-xs font-semibold text-white flex items-center justify-center",
21496
- action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
21495
+ "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-xs font-semibold flex items-center justify-center",
21496
+ action.variant === "danger" ? "bg-error text-error-foreground" : action.variant === "primary" ? "bg-primary text-primary-foreground" : "bg-foreground text-background"
21497
21497
  ),
21498
21498
  children: action.badge
21499
21499
  }
@@ -21515,7 +21515,7 @@ var init_DashboardLayout = __esm({
21515
21515
  Box,
21516
21516
  {
21517
21517
  as: "span",
21518
- className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-xs font-semibold text-white flex items-center justify-center",
21518
+ className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-xs font-semibold text-error-foreground flex items-center justify-center",
21519
21519
  children: unreadCount > 99 ? "99+" : unreadCount
21520
21520
  }
21521
21521
  )
@@ -21798,7 +21798,7 @@ function SubMenu({
21798
21798
  ),
21799
21799
  children: [
21800
21800
  item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm", className: "flex-shrink-0" })),
21801
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: cn("flex-1", isDanger && "text-red-600"), children: item.label }),
21801
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: cn("flex-1", isDanger && "text-error"), children: item.label }),
21802
21802
  item.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs font-medium", children: item.badge })
21803
21803
  ]
21804
21804
  },
@@ -21855,7 +21855,7 @@ function MenuItemRow({
21855
21855
  Typography,
21856
21856
  {
21857
21857
  variant: "small",
21858
- className: cn("flex-1", isDanger && "text-red-600"),
21858
+ className: cn("flex-1", isDanger && "text-error"),
21859
21859
  children: item.label
21860
21860
  }
21861
21861
  ),
@@ -22623,20 +22623,24 @@ function DataGrid({
22623
22623
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
22624
22624
  const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
22625
22625
  const dangerActions = actionDefs.filter((a) => a.variant === "danger");
22626
- const handleActionClick = (action, itemData) => (e) => {
22627
- e.stopPropagation();
22628
- const payload = {
22629
- id: itemData.id,
22630
- row: itemData
22631
- };
22632
- eventBus.emit(`UI:${action.event}`, payload);
22626
+ const fireAction = (action, itemData) => {
22633
22627
  if (action.navigatesTo) {
22634
22628
  const url = action.navigatesTo.replace(
22635
22629
  /\{\{row\.(\w+(?:\.\w+)*)\}\}/g,
22636
22630
  (_, field) => String(itemData[field] ?? "")
22637
22631
  );
22638
- eventBus.emit("UI:NAVIGATE", { url });
22632
+ eventBus.emit("UI:NAVIGATE", { url, row: itemData });
22633
+ return;
22639
22634
  }
22635
+ const payload = {
22636
+ id: itemData.id,
22637
+ row: itemData
22638
+ };
22639
+ eventBus.emit(`UI:${action.event}`, payload);
22640
+ };
22641
+ const handleActionClick = (action, itemData) => (e) => {
22642
+ e.stopPropagation();
22643
+ fireAction(action, itemData);
22640
22644
  };
22641
22645
  const hasRenderProp = typeof children === "function";
22642
22646
  useEffect(() => {
@@ -22738,10 +22742,7 @@ function DataGrid({
22738
22742
  label: action.label,
22739
22743
  icon: action.icon,
22740
22744
  event: action.event,
22741
- onClick: () => eventBus.emit(`UI:${action.event}`, {
22742
- id: itemData.id,
22743
- row: itemData
22744
- })
22745
+ onClick: () => fireAction(action, itemData)
22745
22746
  }))
22746
22747
  }
22747
22748
  )
@@ -22794,13 +22795,13 @@ function DataGrid({
22794
22795
  }
22795
22796
  ),
22796
22797
  /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
22797
- titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
22798
+ titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center min-w-0", children: [
22798
22799
  titleField?.icon && renderIconInput(titleField.icon, { size: "sm", className: "text-primary flex-shrink-0" }),
22799
22800
  /* @__PURE__ */ jsx(
22800
22801
  Typography,
22801
22802
  {
22802
22803
  variant: titleField?.variant === "h3" ? "h3" : "h4",
22803
- className: "font-semibold truncate",
22804
+ className: "font-semibold truncate min-w-0",
22804
22805
  children: String(titleValue)
22805
22806
  }
22806
22807
  )
@@ -22858,7 +22859,7 @@ function DataGrid({
22858
22859
  )
22859
22860
  ] }, field.name);
22860
22861
  }) }) }),
22861
- primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end", children: [
22862
+ primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end flex-wrap", children: [
22862
22863
  (maxInlineActions != null ? primaryActions.slice(0, maxInlineActions) : primaryActions).map((action, idx) => /* @__PURE__ */ jsxs(
22863
22864
  Button,
22864
22865
  {
@@ -22883,10 +22884,7 @@ function DataGrid({
22883
22884
  label: action.label,
22884
22885
  icon: action.icon,
22885
22886
  event: action.event,
22886
- onClick: () => eventBus.emit(`UI:${action.event}`, {
22887
- id: itemData.id,
22888
- row: itemData
22889
- })
22887
+ onClick: () => fireAction(action, itemData)
22890
22888
  }))
22891
22889
  }
22892
22890
  )
@@ -24749,8 +24747,8 @@ var init_RelationSelect = __esm({
24749
24747
  disabled,
24750
24748
  className: cn(
24751
24749
  "w-full justify-between font-normal",
24752
- error && "border-red-300 focus:border-red-500 focus:ring-red-500",
24753
- isOpen && "ring-2 ring-primary-500 border-primary-500"
24750
+ error && "border-error/50 focus:border-error focus:ring-error",
24751
+ isOpen && "ring-2 ring-primary border-primary"
24754
24752
  ),
24755
24753
  children: [
24756
24754
  /* @__PURE__ */ jsx(
@@ -24830,7 +24828,7 @@ var init_RelationSelect = __esm({
24830
24828
  paddingY: "sm",
24831
24829
  className: cn(
24832
24830
  "text-left text-sm hover:bg-muted focus:outline-none focus:bg-muted",
24833
- option.value === value && "bg-primary-50 text-primary-700",
24831
+ option.value === value && "bg-primary/10 text-primary",
24834
24832
  option.disabled && "opacity-50 cursor-not-allowed"
24835
24833
  ),
24836
24834
  onClick: () => handleSelect(option),
@@ -24987,7 +24985,7 @@ var init_SidePanel = __esm({
24987
24985
  showOverlay && /* @__PURE__ */ jsx(Presence, { show: isOpen, animation: "overlay", children: /* @__PURE__ */ jsx(
24988
24986
  Box,
24989
24987
  {
24990
- className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
24988
+ className: "fixed inset-0 bg-background/80 backdrop-blur-sm z-40 lg:hidden",
24991
24989
  onClick: handleClose
24992
24990
  }
24993
24991
  ) }),
@@ -25354,7 +25352,7 @@ var init_WizardNavigation = __esm({
25354
25352
  /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: "sm" }),
25355
25353
  resolvedBackLabel
25356
25354
  ] }) : /* @__PURE__ */ jsx(Box, {}),
25357
- /* @__PURE__ */ jsx(HStack, { align: "center", gap: "sm", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-neutral-500", children: t("wizard.stepOf", { current: String(currentStep + 1), total: String(totalSteps) }) }) }),
25355
+ /* @__PURE__ */ jsx(HStack, { align: "center", gap: "sm", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("wizard.stepOf", { current: String(currentStep + 1), total: String(totalSteps) }) }) }),
25358
25356
  isLastStep && showComplete ? /* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleComplete, disabled: !isValid, children: resolvedCompleteLabel }) : showNext ? /* @__PURE__ */ jsxs(Button, { variant: "primary", onClick: handleNext, disabled: !isValid, children: [
25359
25357
  resolvedNextLabel,
25360
25358
  /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm" })
@@ -27511,6 +27509,7 @@ var init_Lightbox = __esm({
27511
27509
  {
27512
27510
  className: cn(
27513
27511
  "fixed inset-0 z-50 flex items-center justify-center",
27512
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: lightbox scrim behind images
27514
27513
  "bg-black bg-opacity-90",
27515
27514
  className
27516
27515
  ),
@@ -27533,7 +27532,7 @@ var init_Lightbox = __esm({
27533
27532
  "p-2 rounded-full",
27534
27533
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
27535
27534
  "hover:bg-opacity-70 transition-opacity",
27536
- "focus:outline-none focus:ring-2 focus:ring-white"
27535
+ "focus:outline-none focus:ring-2 focus:ring-ring"
27537
27536
  ),
27538
27537
  "aria-label": t("aria.closeModal"),
27539
27538
  children: /* @__PURE__ */ jsx(Icon, { name: "x", className: "w-6 h-6" })
@@ -27552,7 +27551,7 @@ var init_Lightbox = __esm({
27552
27551
  "p-2 rounded-full",
27553
27552
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
27554
27553
  "hover:bg-opacity-70 transition-opacity",
27555
- "focus:outline-none focus:ring-2 focus:ring-white"
27554
+ "focus:outline-none focus:ring-2 focus:ring-ring"
27556
27555
  ),
27557
27556
  "aria-label": t("aria.previousImage"),
27558
27557
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", className: "w-8 h-8" })
@@ -27589,7 +27588,7 @@ var init_Lightbox = __esm({
27589
27588
  "p-2 rounded-full",
27590
27589
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
27591
27590
  "hover:bg-opacity-70 transition-opacity",
27592
- "focus:outline-none focus:ring-2 focus:ring-white"
27591
+ "focus:outline-none focus:ring-2 focus:ring-ring"
27593
27592
  ),
27594
27593
  "aria-label": t("aria.nextImage"),
27595
27594
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", className: "w-8 h-8" })
@@ -27809,7 +27808,7 @@ function TableView({
27809
27808
  col.key
27810
27809
  );
27811
27810
  }),
27812
- hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
27811
+ hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true, className: "sticky right-0 bg-[var(--color-surface-subtle)]" })
27813
27812
  ]
27814
27813
  }
27815
27814
  );
@@ -27853,41 +27852,54 @@ function TableView({
27853
27852
  }
27854
27853
  return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
27855
27854
  }),
27856
- itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "justify-end flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: [
27857
- (maxInlineActions != null ? itemActions.slice(0, maxInlineActions) : itemActions).map((action, i) => /* @__PURE__ */ jsxs(
27858
- Button,
27859
- {
27860
- variant: action.variant ?? "ghost",
27861
- size: "sm",
27862
- onClick: handleActionClick(action, row),
27863
- "data-testid": `action-${action.event}`,
27864
- "data-row-id": String(row.id),
27865
- className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
27866
- children: [
27867
- action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
27868
- action.label
27869
- ]
27870
- },
27871
- i
27872
- )),
27873
- maxInlineActions != null && itemActions.length > maxInlineActions && /* @__PURE__ */ jsx(
27874
- Menu,
27875
- {
27876
- position: "bottom-end",
27877
- trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
27878
- items: itemActions.slice(maxInlineActions).map((action) => ({
27879
- label: action.label,
27880
- icon: action.icon,
27881
- event: action.event,
27882
- variant: action.variant === "danger" ? "danger" : "default",
27883
- onClick: () => eventBus.emit(`UI:${action.event}`, {
27884
- id: row.id,
27885
- row
27886
- })
27887
- }))
27888
- }
27889
- )
27890
- ] })
27855
+ itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxs(
27856
+ HStack,
27857
+ {
27858
+ gap: "xs",
27859
+ className: cn(
27860
+ // Pinned: the fixed column tracks routinely overflow the caller's
27861
+ // scroll container, which used to leave the actions off-screen.
27862
+ // Opaque so scrolled cells pass underneath it.
27863
+ "justify-end flex-shrink-0 sticky right-0 z-[1] transition-colors",
27864
+ lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
27865
+ ),
27866
+ children: [
27867
+ (maxInlineActions != null ? itemActions.slice(0, maxInlineActions) : itemActions).map((action, i) => /* @__PURE__ */ jsxs(
27868
+ Button,
27869
+ {
27870
+ variant: action.variant ?? "ghost",
27871
+ size: "sm",
27872
+ onClick: handleActionClick(action, row),
27873
+ "data-testid": `action-${action.event}`,
27874
+ "data-row-id": String(row.id),
27875
+ className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
27876
+ children: [
27877
+ action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
27878
+ action.label
27879
+ ]
27880
+ },
27881
+ i
27882
+ )),
27883
+ maxInlineActions != null && itemActions.length > maxInlineActions && /* @__PURE__ */ jsx(
27884
+ Menu,
27885
+ {
27886
+ position: "bottom-end",
27887
+ trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
27888
+ items: itemActions.slice(maxInlineActions).map((action) => ({
27889
+ label: action.label,
27890
+ icon: action.icon,
27891
+ event: action.event,
27892
+ variant: action.variant === "danger" ? "danger" : "default",
27893
+ onClick: () => eventBus.emit(`UI:${action.event}`, {
27894
+ id: row.id,
27895
+ row
27896
+ })
27897
+ }))
27898
+ }
27899
+ )
27900
+ ]
27901
+ }
27902
+ )
27891
27903
  ]
27892
27904
  }
27893
27905
  );
@@ -30524,6 +30536,7 @@ var init_QrScanner = __esm({
30524
30536
  overflow: "hidden",
30525
30537
  rounded: "sm",
30526
30538
  className: cn(
30539
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30527
30540
  "bg-black",
30528
30541
  "aspect-square w-full max-w-md",
30529
30542
  className
@@ -30588,7 +30601,9 @@ var init_QrScanner = __esm({
30588
30601
  type: "button",
30589
30602
  onClick: togglePause,
30590
30603
  className: cn(
30604
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30591
30605
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
30606
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30592
30607
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
30593
30608
  ),
30594
30609
  "aria-label": isPaused ? t("qrScanner.resumeScanning") : t("qrScanner.pauseScanning"),
@@ -30601,7 +30616,9 @@ var init_QrScanner = __esm({
30601
30616
  type: "button",
30602
30617
  onClick: toggleFacing,
30603
30618
  className: cn(
30619
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30604
30620
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
30621
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30605
30622
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
30606
30623
  ),
30607
30624
  "aria-label": currentFacing === "environment" ? t("qrScanner.switchToFrontCamera") : t("qrScanner.switchToRearCamera"),
@@ -30614,7 +30631,9 @@ var init_QrScanner = __esm({
30614
30631
  type: "button",
30615
30632
  onClick: handleMockScan,
30616
30633
  className: cn(
30634
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30617
30635
  "rounded-full bg-black bg-opacity-60 px-3 py-2 text-xs text-white",
30636
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30618
30637
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
30619
30638
  ),
30620
30639
  "aria-label": t("aria.mockScanDev"),
@@ -33350,10 +33369,10 @@ var init_ModuleCard = __esm({
33350
33369
  init_avl_atom_types();
33351
33370
  init_MiniStateMachine();
33352
33371
  PERSISTENCE_BORDER = {
33353
- persistent: "border-l-[3px] border-l-blue-500 border-solid",
33354
- runtime: "border-l-[3px] border-l-blue-500 border-dashed",
33355
- singleton: "border-l-[3px] border-l-blue-500 border-double",
33356
- instance: "border-l-[3px] border-l-blue-500 border-dotted"
33372
+ persistent: "border-l-[3px] border-l-primary border-solid",
33373
+ runtime: "border-l-[3px] border-l-primary border-dashed",
33374
+ singleton: "border-l-[3px] border-l-primary border-double",
33375
+ instance: "border-l-[3px] border-l-primary border-dotted"
33357
33376
  };
33358
33377
  PERSISTENCE_ICON = {
33359
33378
  persistent: "\u26C1",
@@ -33383,8 +33402,8 @@ var init_ModuleCard = __esm({
33383
33402
  className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] shadow-sm overflow-hidden",
33384
33403
  style: { minWidth: 280, maxWidth: 400 },
33385
33404
  children: [
33386
- /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
33387
- /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
33405
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, className: "!w-2.5 !h-2.5 !bg-warning" }),
33406
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, className: "!w-2.5 !h-2.5 !bg-warning" }),
33388
33407
  /* @__PURE__ */ jsx("div", { className: "px-3 py-2 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx("span", { className: "text-base font-bold text-[var(--color-foreground)]", children: orbitalName }) }),
33389
33408
  /* @__PURE__ */ jsxs("div", { className: `px-3 py-2 border-b border-[var(--color-border)] ${PERSISTENCE_BORDER[persistence] ?? ""}`, children: [
33390
33409
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 mb-1.5", children: [
@@ -35840,19 +35859,19 @@ var init_ReflectionBlock = __esm({
35840
35859
  "div",
35841
35860
  {
35842
35861
  className: cn(
35843
- "my-6 border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded-r-lg p-4",
35862
+ "my-6 border-l-4 border-warning bg-warning/10 rounded-r-lg p-4",
35844
35863
  className
35845
35864
  ),
35846
35865
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
35847
- /* @__PURE__ */ jsx(PauseCircle, { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 mt-1", size: 20 }),
35866
+ /* @__PURE__ */ jsx(PauseCircle, { className: "text-warning flex-shrink-0 mt-1", size: 20 }),
35848
35867
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
35849
- /* @__PURE__ */ jsx("div", { className: "font-medium text-amber-900 dark:text-amber-100 mb-2", children: "Pause & Reflect" }),
35850
- /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 text-sm mb-3", children: prompt }),
35868
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-warning mb-2", children: "Pause & Reflect" }),
35869
+ /* @__PURE__ */ jsx("p", { className: "text-foreground text-sm mb-3", children: prompt }),
35851
35870
  isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
35852
35871
  /* @__PURE__ */ jsx(
35853
35872
  "textarea",
35854
35873
  {
35855
- className: "w-full p-2 border border-amber-300 dark:border-amber-700 rounded text-sm bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-amber-500 focus:border-transparent",
35874
+ className: "w-full p-2 border border-input rounded text-sm bg-card text-foreground focus:ring-2 focus:ring-ring focus:border-transparent",
35856
35875
  placeholder: "Your thoughts...",
35857
35876
  value: note,
35858
35877
  onChange: (e) => setNote(e.target.value),
@@ -35863,7 +35882,7 @@ var init_ReflectionBlock = __esm({
35863
35882
  "button",
35864
35883
  {
35865
35884
  onClick: handleSave,
35866
- className: "mt-2 text-sm px-3 py-1 bg-amber-600 text-white rounded hover:bg-amber-700 transition-colors",
35885
+ className: "mt-2 text-sm px-3 py-1 bg-warning text-warning-foreground rounded hover:opacity-90 transition-colors",
35867
35886
  children: "Save & Continue"
35868
35887
  }
35869
35888
  )
@@ -35871,7 +35890,7 @@ var init_ReflectionBlock = __esm({
35871
35890
  "button",
35872
35891
  {
35873
35892
  onClick: () => setIsExpanded(true),
35874
- className: "text-sm text-amber-600 dark:text-amber-400 hover:underline",
35893
+ className: "text-sm text-warning hover:underline",
35875
35894
  children: savedNote ? "\u2713 Answered \xB7 Edit" : "Answer this question"
35876
35895
  }
35877
35896
  )
@@ -36157,7 +36176,7 @@ function DataTable({
36157
36176
  )),
36158
36177
  rowActions && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3" })
36159
36178
  ] }) }),
36160
- /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
36179
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
36161
36180
  "td",
36162
36181
  {
36163
36182
  colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
@@ -36477,6 +36496,16 @@ function normalizeFieldDefs(fields) {
36477
36496
  return String(f3);
36478
36497
  });
36479
36498
  }
36499
+ function buildFieldLabelMap(fields) {
36500
+ const map = {};
36501
+ if (!fields) return map;
36502
+ for (const f3 of fields) {
36503
+ if (typeof f3 === "object" && "key" in f3 && f3.header !== void 0 && f3.header !== "") {
36504
+ map[f3.key] = f3.header;
36505
+ }
36506
+ }
36507
+ return map;
36508
+ }
36480
36509
  function buildFieldTypeMap(fields) {
36481
36510
  const map = {};
36482
36511
  if (!fields) return map;
@@ -36528,7 +36557,9 @@ var init_DetailPanel = __esm({
36528
36557
  };
36529
36558
  const effectiveFieldNames = isFieldDefArray(propFields) ? normalizeFieldDefs(propFields) : fieldNames;
36530
36559
  const fieldTypeMap = isFieldDefArray(propFields) ? buildFieldTypeMap(propFields) : {};
36531
- useCallback(
36560
+ const fieldLabelMap = isFieldDefArray(propFields) ? buildFieldLabelMap(propFields) : {};
36561
+ const labelFor = (field) => fieldLabelMap[field] ?? formatFieldLabel(field);
36562
+ const handleActionClick = useCallback(
36532
36563
  (action, data2) => {
36533
36564
  if (action.navigatesTo) {
36534
36565
  const url = action.navigatesTo.replace(
@@ -36563,7 +36594,7 @@ var init_DetailPanel = __esm({
36563
36594
  if (typeof field === "string") {
36564
36595
  const value = getNestedValue(normalizedData, field);
36565
36596
  return {
36566
- label: formatFieldLabel(field),
36597
+ label: labelFor(field),
36567
36598
  value: formatFieldValue(value, field),
36568
36599
  icon: getFieldIcon(field)
36569
36600
  };
@@ -36574,7 +36605,10 @@ var init_DetailPanel = __esm({
36574
36605
  }
36575
36606
  if (normalizedData && effectiveFieldNames) {
36576
36607
  const primaryField = effectiveFieldNames[0];
36577
- if (!title && primaryField && normalizedData[primaryField]) {
36608
+ const titleDerivedFromPrimary = Boolean(
36609
+ !title && primaryField && normalizedData[primaryField]
36610
+ );
36611
+ if (titleDerivedFromPrimary) {
36578
36612
  title = String(normalizedData[primaryField]);
36579
36613
  }
36580
36614
  const statusFields = effectiveFieldNames.filter(
@@ -36593,16 +36627,16 @@ var init_DetailPanel = __esm({
36593
36627
  (f3) => f3.toLowerCase().includes("description") || f3.toLowerCase().includes("note")
36594
36628
  );
36595
36629
  const otherFields = effectiveFieldNames.filter(
36596
- (f3) => f3 !== primaryField && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
36630
+ (f3) => (!titleDerivedFromPrimary || f3 !== primaryField) && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
36597
36631
  );
36598
36632
  sections = [];
36599
36633
  if (statusFields.length > 0 || otherFields.length > 0) {
36600
36634
  const overviewFields = [];
36601
- [...statusFields, ...otherFields.slice(0, 3)].forEach((field) => {
36635
+ [...statusFields, ...otherFields].forEach((field) => {
36602
36636
  const value = getNestedValue(normalizedData, field);
36603
36637
  if (value !== void 0 && value !== null) {
36604
36638
  overviewFields.push({
36605
- label: formatFieldLabel(field),
36639
+ label: labelFor(field),
36606
36640
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
36607
36641
  icon: getFieldIcon(field)
36608
36642
  });
@@ -36618,7 +36652,7 @@ var init_DetailPanel = __esm({
36618
36652
  const value = getNestedValue(normalizedData, field);
36619
36653
  if (value !== void 0 && value !== null) {
36620
36654
  metricsFields.push({
36621
- label: formatFieldLabel(field),
36655
+ label: labelFor(field),
36622
36656
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
36623
36657
  icon: getFieldIcon(field)
36624
36658
  });
@@ -36634,7 +36668,7 @@ var init_DetailPanel = __esm({
36634
36668
  const value = getNestedValue(normalizedData, field);
36635
36669
  if (value !== void 0 && value !== null) {
36636
36670
  timelineFields.push({
36637
- label: formatFieldLabel(field),
36671
+ label: labelFor(field),
36638
36672
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
36639
36673
  icon: getFieldIcon(field)
36640
36674
  });
@@ -36650,7 +36684,7 @@ var init_DetailPanel = __esm({
36650
36684
  const value = getNestedValue(normalizedData, field);
36651
36685
  if (value !== void 0 && value !== null) {
36652
36686
  descFields.push({
36653
- label: formatFieldLabel(field),
36687
+ label: labelFor(field),
36654
36688
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
36655
36689
  icon: getFieldIcon(field)
36656
36690
  });
@@ -36698,7 +36732,7 @@ var init_DetailPanel = __esm({
36698
36732
  if (typeof field === "string") {
36699
36733
  const value = normalizedData ? getNestedValue(normalizedData, field) : void 0;
36700
36734
  allFields.push({
36701
- label: formatFieldLabel(field),
36735
+ label: labelFor(field),
36702
36736
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
36703
36737
  icon: getFieldIcon(field)
36704
36738
  });
@@ -36720,8 +36754,9 @@ var init_DetailPanel = __esm({
36720
36754
  {
36721
36755
  variant: action.variant || "secondary",
36722
36756
  size: "sm",
36723
- action: action.event,
36757
+ action: action.navigatesTo ? void 0 : action.event,
36724
36758
  actionPayload: { row: normalizedData },
36759
+ onClick: action.navigatesTo ? () => handleActionClick(action, normalizedData) : void 0,
36725
36760
  icon: action.icon,
36726
36761
  "data-testid": action.event ? `action-${action.event}` : void 0,
36727
36762
  "data-row-id": normalizedData?.id !== void 0 ? String(normalizedData.id) : void 0,
@@ -38764,8 +38799,9 @@ var init_MediaGallery = __esm({
38764
38799
  )
38765
38800
  }
38766
38801
  ),
38767
- item.caption && /* @__PURE__ */ jsx(Box, { className: "absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/60 to-transparent", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-white truncate", children: item.caption }) }),
38768
- selectable && isSelected && /* @__PURE__ */ jsx(Box, { className: "absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-white text-xs", children: "\u2713" }) })
38802
+ item.caption && // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: caption scrim over image
38803
+ /* @__PURE__ */ jsx(Box, { className: "absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/60 to-transparent", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-white truncate", children: item.caption }) }),
38804
+ selectable && isSelected && /* @__PURE__ */ jsx(Box, { className: "absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-primary-foreground text-xs", children: "\u2713" }) })
38769
38805
  ]
38770
38806
  },
38771
38807
  item.id
@@ -38794,7 +38830,7 @@ var init_MediaGallery = __esm({
38794
38830
  size: "sm",
38795
38831
  icon: X,
38796
38832
  action: "LIGHTBOX_CLOSE",
38797
- className: "text-white hover:bg-white/20"
38833
+ className: "text-foreground hover:bg-muted/50"
38798
38834
  }
38799
38835
  ) }),
38800
38836
  /* @__PURE__ */ jsx(
@@ -38805,7 +38841,7 @@ var init_MediaGallery = __esm({
38805
38841
  className: "max-w-full max-h-[80vh] object-contain rounded-md"
38806
38842
  }
38807
38843
  ),
38808
- lightboxItem.caption && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-white mt-3 text-center", children: lightboxItem.caption })
38844
+ lightboxItem.caption && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground mt-3 text-center", children: lightboxItem.caption })
38809
38845
  ]
38810
38846
  }
38811
38847
  )
@@ -39266,7 +39302,7 @@ function WalkMinimap() {
39266
39302
  {
39267
39303
  variant,
39268
39304
  size: "sm",
39269
- className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
39305
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-info" : ""}`,
39270
39306
  children: [
39271
39307
  isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
39272
39308
  " ",
@@ -39407,13 +39443,13 @@ function WalkMinimap() {
39407
39443
  })
39408
39444
  ] }) }),
39409
39445
  /* @__PURE__ */ jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
39410
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-green-500", children: [
39446
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-success", children: [
39411
39447
  "Engine: ",
39412
39448
  engineCount,
39413
39449
  "/",
39414
39450
  totalTransitions
39415
39451
  ] }),
39416
- domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-cyan-500", children: [
39452
+ domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-info", children: [
39417
39453
  "DOM: ",
39418
39454
  domCount
39419
39455
  ] }),
@@ -39446,13 +39482,13 @@ function TraitsTab({ traits: traits2 }) {
39446
39482
  const accordionItems = traits2.map((trait) => ({
39447
39483
  id: trait.id,
39448
39484
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
39449
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-purple-600 dark:text-purple-400", children: trait.name }),
39485
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-primary", children: trait.name }),
39450
39486
  /* @__PURE__ */ jsx(Badge, { variant: "success", size: "sm", children: trait.currentState }),
39451
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
39487
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
39452
39488
  ] }),
39453
39489
  content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
39454
39490
  /* @__PURE__ */ jsxs("div", { children: [
39455
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.states") }),
39491
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.states") }),
39456
39492
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: trait.states.map((state) => /* @__PURE__ */ jsx(
39457
39493
  Badge,
39458
39494
  {
@@ -39464,18 +39500,18 @@ function TraitsTab({ traits: traits2 }) {
39464
39500
  )) })
39465
39501
  ] }),
39466
39502
  trait.transitions.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39467
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.transitions") }),
39503
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.transitions") }),
39468
39504
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: trait.transitions.map((t2, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono", children: [
39469
39505
  t2.from,
39470
39506
  " \u2192 ",
39471
39507
  t2.to,
39472
39508
  " ",
39473
- /* @__PURE__ */ jsxs("span", { className: "text-gray-500", children: [
39509
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
39474
39510
  "(",
39475
39511
  t2.event,
39476
39512
  ")"
39477
39513
  ] }),
39478
- t2.guard && /* @__PURE__ */ jsxs("span", { className: "text-amber-500", children: [
39514
+ t2.guard && /* @__PURE__ */ jsxs("span", { className: "text-warning", children: [
39479
39515
  " [",
39480
39516
  t2.guard,
39481
39517
  "]"
@@ -39483,7 +39519,7 @@ function TraitsTab({ traits: traits2 }) {
39483
39519
  ] }, i)) })
39484
39520
  ] }),
39485
39521
  trait.guards.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39486
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.guards") }),
39522
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.guards") }),
39487
39523
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: trait.guards.map((g, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
39488
39524
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: g.name }),
39489
39525
  /* @__PURE__ */ jsx(Badge, { variant: g.lastResult === true ? "success" : g.lastResult === false ? "danger" : "default", size: "sm", children: g.lastResult === void 0 ? "?" : g.lastResult ? "\u2713" : "\u2717" })
@@ -39526,11 +39562,11 @@ function TicksTab({ ticks: ticks2 }) {
39526
39562
  };
39527
39563
  const TickCard = ({ tick, active }) => /* @__PURE__ */ jsxs(Card, { className: `p-3 ${!active ? "opacity-50" : ""}`, children: [
39528
39564
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
39529
- /* @__PURE__ */ jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-green-500" : "bg-gray-400"}` }),
39530
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: tick.name }),
39531
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: tick.traitName })
39565
+ /* @__PURE__ */ jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-success" : "bg-muted-foreground"}` }),
39566
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: tick.name }),
39567
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: tick.traitName })
39532
39568
  ] }),
39533
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-xs text-gray-500", children: [
39569
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-xs text-muted-foreground", children: [
39534
39570
  /* @__PURE__ */ jsxs("span", { children: [
39535
39571
  tick.interval,
39536
39572
  "ms"
@@ -39553,7 +39589,7 @@ function TicksTab({ ticks: ticks2 }) {
39553
39589
  ] });
39554
39590
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--ticks", children: [
39555
39591
  activeTicks.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
39556
- /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: [
39592
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
39557
39593
  "Active (",
39558
39594
  activeTicks.length,
39559
39595
  ")"
@@ -39561,7 +39597,7 @@ function TicksTab({ ticks: ticks2 }) {
39561
39597
  /* @__PURE__ */ jsx(Stack, { gap: "sm", children: activeTicks.map((tick) => /* @__PURE__ */ jsx(TickCard, { tick, active: true }, tick.id)) })
39562
39598
  ] }),
39563
39599
  inactiveTicks.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39564
- /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-400 mb-2", children: [
39600
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
39565
39601
  "Inactive (",
39566
39602
  inactiveTicks.length,
39567
39603
  ")"
@@ -39609,33 +39645,33 @@ function EntitiesTab({ snapshot }) {
39609
39645
  id: `singleton-${name}`,
39610
39646
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
39611
39647
  /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: t("debug.singleton") }),
39612
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: name })
39648
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: name })
39613
39649
  ] }),
39614
- content: /* @__PURE__ */ jsx("pre", { className: "text-xs text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 p-2 rounded overflow-auto max-h-40", children: JSON.stringify(data, null, 2) })
39650
+ content: /* @__PURE__ */ jsx("pre", { className: "text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-40", children: JSON.stringify(data, null, 2) })
39615
39651
  }));
39616
39652
  const runtimeItems = runtimeEntities.slice(0, 20).map((entity) => ({
39617
39653
  id: entity.id,
39618
39654
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
39619
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: entity.type }),
39620
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-500", children: [
39655
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: entity.type }),
39656
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground", children: [
39621
39657
  "#",
39622
39658
  entity.id.slice(0, 8)
39623
39659
  ] })
39624
39660
  ] }),
39625
- content: /* @__PURE__ */ jsx("pre", { className: "text-xs text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 p-2 rounded overflow-auto max-h-40", children: JSON.stringify(entity.data, null, 2) })
39661
+ content: /* @__PURE__ */ jsx("pre", { className: "text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-40", children: JSON.stringify(entity.data, null, 2) })
39626
39662
  }));
39627
39663
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--entities", children: [
39628
39664
  singletonItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
39629
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
39665
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
39630
39666
  /* @__PURE__ */ jsx(Accordion, { items: singletonItems, multiple: true })
39631
39667
  ] }),
39632
39668
  runtimeItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
39633
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
39669
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
39634
39670
  /* @__PURE__ */ jsx(Accordion, { items: runtimeItems, multiple: true }),
39635
- runtimeEntities.length > 20 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
39671
+ runtimeEntities.length > 20 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
39636
39672
  ] }),
39637
39673
  persistentEntries.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39638
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.persistent") }),
39674
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.persistent") }),
39639
39675
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: persistentEntries.map(([type, info]) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
39640
39676
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: type }),
39641
39677
  /* @__PURE__ */ jsx(Badge, { variant: info.loaded ? "success" : "default", size: "sm", children: info.loaded ? t("debug.loadedCount", { count: info.count }) : t("debug.notLoaded") })
@@ -39720,7 +39756,7 @@ function EventFlowTab({ events: events2 }) {
39720
39756
  );
39721
39757
  })
39722
39758
  ] }),
39723
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 ml-auto cursor-pointer", children: [
39759
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto cursor-pointer", children: [
39724
39760
  /* @__PURE__ */ jsx(
39725
39761
  Checkbox,
39726
39762
  {
@@ -39735,18 +39771,18 @@ function EventFlowTab({ events: events2 }) {
39735
39771
  "div",
39736
39772
  {
39737
39773
  ref: containerRef,
39738
- className: "max-h-64 overflow-y-auto space-y-1 bg-gray-50 dark:bg-gray-800 rounded p-2",
39774
+ className: "max-h-64 overflow-y-auto space-y-1 bg-muted rounded p-2",
39739
39775
  children: filteredEvents.slice(-100).map((event) => {
39740
39776
  const { variant, icon } = TYPE_BADGES[event.type] || { variant: "default", icon: "\u2022" };
39741
39777
  return /* @__PURE__ */ jsxs(
39742
39778
  "div",
39743
39779
  {
39744
- className: "flex items-start gap-2 text-xs py-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded px-1",
39780
+ className: "flex items-start gap-2 text-xs py-1 hover:bg-muted/50 rounded px-1",
39745
39781
  children: [
39746
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
39782
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
39747
39783
  /* @__PURE__ */ jsx("span", { children: icon }),
39748
39784
  /* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "min-w-[60px] justify-center", children: event.source }),
39749
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-600 dark:text-gray-400", children: event.message })
39785
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: event.message })
39750
39786
  ]
39751
39787
  },
39752
39788
  event.id
@@ -39810,21 +39846,21 @@ function GuardsPanel({ guards }) {
39810
39846
  id: guard.id,
39811
39847
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
39812
39848
  /* @__PURE__ */ jsx(Badge, { variant: guard.result ? "success" : "danger", size: "sm", children: guard.result ? "\u2713" : "\u2717" }),
39813
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: guard.guardName }),
39814
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
39815
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: formatTime2(guard.timestamp) })
39849
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: guard.guardName }),
39850
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
39851
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: formatTime2(guard.timestamp) })
39816
39852
  ] }),
39817
39853
  content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
39818
39854
  /* @__PURE__ */ jsxs("div", { children: [
39819
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.expression") }),
39820
- /* @__PURE__ */ jsx("code", { className: "block mt-1 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-1 rounded", children: guard.expression })
39855
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.expression") }),
39856
+ /* @__PURE__ */ jsx("code", { className: "block mt-1 text-xs text-warning bg-warning/10 px-2 py-1 rounded", children: guard.expression })
39821
39857
  ] }),
39822
39858
  /* @__PURE__ */ jsxs("div", { children: [
39823
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.inputs") }),
39824
- /* @__PURE__ */ jsx("pre", { className: "mt-1 text-xs text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 p-2 rounded overflow-auto max-h-24", children: JSON.stringify(guard.inputs, null, 2) })
39859
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.inputs") }),
39860
+ /* @__PURE__ */ jsx("pre", { className: "mt-1 text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-24", children: JSON.stringify(guard.inputs, null, 2) })
39825
39861
  ] }),
39826
39862
  /* @__PURE__ */ jsxs("div", { children: [
39827
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.trait") }),
39863
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.trait") }),
39828
39864
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: guard.context.traitName })
39829
39865
  ] })
39830
39866
  ] })
@@ -39880,7 +39916,7 @@ function VerificationTab({ checks, summary }) {
39880
39916
  (a, b) => (sortOrder[a.status] ?? 4) - (sortOrder[b.status] ?? 4)
39881
39917
  );
39882
39918
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--verification", children: [
39883
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-gray-50 dark:bg-gray-800 rounded", children: [
39919
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-muted rounded", children: [
39884
39920
  /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
39885
39921
  summary.passed,
39886
39922
  " passed"
@@ -39897,7 +39933,7 @@ function VerificationTab({ checks, summary }) {
39897
39933
  summary.pending,
39898
39934
  " pending"
39899
39935
  ] }),
39900
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: [
39936
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: [
39901
39937
  summary.totalChecks,
39902
39938
  " total checks"
39903
39939
  ] })
@@ -39907,12 +39943,12 @@ function VerificationTab({ checks, summary }) {
39907
39943
  return /* @__PURE__ */ jsxs(
39908
39944
  "div",
39909
39945
  {
39910
- className: "flex items-start gap-2 p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800",
39946
+ className: "flex items-start gap-2 p-2 rounded hover:bg-muted/50",
39911
39947
  children: [
39912
39948
  /* @__PURE__ */ jsx(Badge, { variant: config.variant, size: "sm", className: "min-w-[20px] justify-center mt-0.5", children: config.icon }),
39913
39949
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
39914
39950
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "break-words", children: check.label }),
39915
- check.details && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 break-words", children: check.details })
39951
+ check.details && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground break-words", children: check.details })
39916
39952
  ] }),
39917
39953
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs shrink-0", children: new Date(check.updatedAt).toLocaleTimeString("en-US", {
39918
39954
  hour12: false,
@@ -39947,10 +39983,10 @@ var init_VerificationTab = __esm({
39947
39983
  function EffectBadge({ effect }) {
39948
39984
  const variant = EFFECT_STATUS_VARIANT[effect.status] || "default";
39949
39985
  const icon = effect.status === "executed" ? "\u2713" : effect.status === "failed" ? "\u2717" : "-";
39950
- return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-mono bg-gray-100 dark:bg-gray-700 rounded px-1.5 py-0.5", children: [
39986
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-mono bg-muted rounded px-1.5 py-0.5", children: [
39951
39987
  /* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "!text-[9px] !px-1 !py-0", children: icon }),
39952
- /* @__PURE__ */ jsx("span", { className: "text-gray-600 dark:text-gray-400", children: effect.type }),
39953
- effect.error && /* @__PURE__ */ jsx("span", { className: "text-red-500 truncate max-w-[120px]", title: effect.error, children: effect.error })
39988
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: effect.type }),
39989
+ effect.error && /* @__PURE__ */ jsx("span", { className: "text-error truncate max-w-[120px]", title: effect.error, children: effect.error })
39954
39990
  ] });
39955
39991
  }
39956
39992
  function TransitionTimeline({ transitions }) {
@@ -39985,8 +40021,8 @@ function TransitionTimeline({ transitions }) {
39985
40021
  const sorted = [...transitions].reverse();
39986
40022
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--timeline", children: [
39987
40023
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
39988
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
39989
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 cursor-pointer", children: [
40024
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
40025
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", children: [
39990
40026
  /* @__PURE__ */ jsx(
39991
40027
  Checkbox,
39992
40028
  {
@@ -40011,22 +40047,22 @@ function TransitionTimeline({ transitions }) {
40011
40047
  {
40012
40048
  className: `
40013
40049
  relative pl-6 pb-3 border-l-2 cursor-pointer
40014
- hover:bg-gray-50 dark:hover:bg-gray-800 rounded-r
40015
- ${hasFailedEffects ? "border-red-300 dark:border-red-700" : "border-gray-200 dark:border-gray-700"}
40050
+ hover:bg-muted/50 rounded-r
40051
+ ${hasFailedEffects ? "border-error" : "border-border"}
40016
40052
  `,
40017
40053
  onClick: () => setExpandedId(isExpanded ? null : trace.id),
40018
40054
  children: [
40019
40055
  /* @__PURE__ */ jsx("div", { className: `
40020
40056
  absolute left-[-5px] top-1 w-2 h-2 rounded-full
40021
- ${hasFailedEffects ? "bg-red-500" : allPassed ? "bg-green-500" : "bg-gray-400"}
40057
+ ${hasFailedEffects ? "bg-error" : allPassed ? "bg-success" : "bg-muted-foreground"}
40022
40058
  ` }),
40023
40059
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs py-1 px-2", children: [
40024
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40060
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40025
40061
  /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "min-w-[60px] justify-center", children: trace.traitName }),
40026
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-gray-600 dark:text-gray-400", children: [
40062
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-muted-foreground", children: [
40027
40063
  trace.from,
40028
40064
  " ",
40029
- /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: "\u2192" }),
40065
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50", children: "\u2192" }),
40030
40066
  " ",
40031
40067
  trace.to
40032
40068
  ] }),
@@ -40043,9 +40079,9 @@ function TransitionTimeline({ transitions }) {
40043
40079
  ]
40044
40080
  }
40045
40081
  ),
40046
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40082
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40047
40083
  ] }),
40048
- isExpanded && trace.effects.length > 0 && /* @__PURE__ */ jsx("div", { className: "ml-2 mt-1 mb-2 pl-2 border-l border-gray-200 dark:border-gray-700 space-y-1", children: trace.effects.map((effect, eIdx) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
40084
+ isExpanded && trace.effects.length > 0 && /* @__PURE__ */ jsx("div", { className: "ml-2 mt-1 mb-2 pl-2 border-l border-border space-y-1", children: trace.effects.map((effect, eIdx) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
40049
40085
  /* @__PURE__ */ jsx(EffectBadge, { effect }),
40050
40086
  effect.args.length > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs truncate max-w-[200px]", children: JSON.stringify(effect.args) }),
40051
40087
  effect.durationMs !== void 0 && /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
@@ -40079,8 +40115,8 @@ var init_TransitionTimeline = __esm({
40079
40115
  }
40080
40116
  });
40081
40117
  function StatRow({ label, value, variant }) {
40082
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1.5 border-b border-gray-100 dark:border-gray-800 last:border-b-0", children: [
40083
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: label }),
40118
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1.5 border-b border-border last:border-b-0", children: [
40119
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: label }),
40084
40120
  variant ? /* @__PURE__ */ jsx(Badge, { variant, size: "sm", children: String(value) }) : /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "font-mono", children: String(value) })
40085
40121
  ] });
40086
40122
  }
@@ -40109,7 +40145,7 @@ function ServerBridgeTab({ bridge }) {
40109
40145
  return /* @__PURE__ */ jsx("div", { className: "debug-tab debug-tab--bridge", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
40110
40146
  /* @__PURE__ */ jsxs(Card, { className: "p-3", children: [
40111
40147
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3", children: [
40112
- /* @__PURE__ */ jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-green-500 animate-pulse" : "bg-red-500"}` }),
40148
+ /* @__PURE__ */ jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-success animate-pulse" : "bg-error"}` }),
40113
40149
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: bridge.connected ? t("debug.connected") : t("debug.disconnected") })
40114
40150
  ] }),
40115
40151
  /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
@@ -40144,11 +40180,11 @@ function ServerBridgeTab({ bridge }) {
40144
40180
  )
40145
40181
  ] })
40146
40182
  ] }),
40147
- bridge.lastError && /* @__PURE__ */ jsxs(Card, { className: "p-3 border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950", children: [
40148
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "text-red-600 dark:text-red-400 mb-1", children: t("debug.lastError") }),
40149
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-500 font-mono break-all", children: bridge.lastError })
40183
+ bridge.lastError && /* @__PURE__ */ jsxs(Card, { className: "p-3 border-error/30 bg-error/10", children: [
40184
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "text-error mb-1", children: t("debug.lastError") }),
40185
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error font-mono break-all", children: bridge.lastError })
40150
40186
  ] }),
40151
- bridge.connected && /* @__PURE__ */ jsx("div", { className: "text-center py-2", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400", children: t("debug.totalEventsProcessed", { count: bridge.eventsForwarded + bridge.eventsReceived }) }) })
40187
+ bridge.connected && /* @__PURE__ */ jsx("div", { className: "text-center py-2", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.totalEventsProcessed", { count: bridge.eventsForwarded + bridge.eventsReceived }) }) })
40152
40188
  ] }) });
40153
40189
  }
40154
40190
  var init_ServerBridgeTab = __esm({
@@ -40274,7 +40310,7 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40274
40310
  };
40275
40311
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--dispatch", children: [
40276
40312
  /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40277
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.activeStates") }),
40313
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.activeStates") }),
40278
40314
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: traits2.map((trait) => /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
40279
40315
  trait.name,
40280
40316
  ": ",
@@ -40282,8 +40318,8 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40282
40318
  ] }, trait.id)) })
40283
40319
  ] }),
40284
40320
  /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40285
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.availableEvents") }),
40286
- availableEvents.length === 0 ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 italic", children: t("debug.noTransitionsFromState") }) : /* @__PURE__ */ jsx(Stack, { gap: "xs", children: availableEvents.map(({ event, transitions }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40321
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.availableEvents") }),
40322
+ availableEvents.length === 0 ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground italic", children: t("debug.noTransitionsFromState") }) : /* @__PURE__ */ jsx(Stack, { gap: "xs", children: availableEvents.map(({ event, transitions }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40287
40323
  /* @__PURE__ */ jsx(
40288
40324
  Button,
40289
40325
  {
@@ -40294,22 +40330,22 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40294
40330
  children: event
40295
40331
  }
40296
40332
  ),
40297
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40333
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40298
40334
  transitions.some((tr) => tr.guard) && /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", children: t("debug.guarded") })
40299
40335
  ] }, event)) })
40300
40336
  ] }),
40301
40337
  unavailableEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40302
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
40338
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.otherEvents") }),
40303
40339
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
40304
40340
  ] }),
40305
40341
  log9.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40306
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
40342
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.recentTransitions") }),
40307
40343
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log9.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
40308
- /* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
40344
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: entry.traitName }),
40309
40345
  " ",
40310
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
40346
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: entry.from }),
40311
40347
  " -> ",
40312
- /* @__PURE__ */ jsx("span", { className: "text-green-400", children: entry.to })
40348
+ /* @__PURE__ */ jsx("span", { className: "text-success", children: entry.to })
40313
40349
  ] }, i)) })
40314
40350
  ] })
40315
40351
  ] });
@@ -40335,21 +40371,21 @@ var init_RuntimeDebugger = __esm({
40335
40371
  function ServerResponseRow({ sr }) {
40336
40372
  const { t } = useTranslate();
40337
40373
  const entityEntries = Object.entries(sr.dataEntities);
40338
- return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-xs font-mono", children: [
40374
+ return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-primary py-0.5 text-xs font-mono", children: [
40339
40375
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40340
- /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
40376
+ /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-success" : "text-error", children: [
40341
40377
  sr.success ? "\u2713" : "\u2717",
40342
40378
  " ",
40343
40379
  t("debug.server")
40344
40380
  ] }),
40345
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
40346
- sr.clientEffects > 0 && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
40347
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
40381
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: sr.orbitalName }),
40382
+ sr.clientEffects > 0 && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-primary/10 text-primary", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
40383
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-primary/10 text-primary", children: [
40348
40384
  t("debug.emitLabel"),
40349
40385
  " ",
40350
40386
  sr.emittedEvents.join(", ")
40351
40387
  ] }),
40352
- sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-500/15 text-red-600 dark:text-red-400 truncate max-w-[300px]", children: sr.error })
40388
+ sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-error/10 text-error truncate max-w-[300px]", children: sr.error })
40353
40389
  ] }),
40354
40390
  entityEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-[var(--color-card)] text-foreground", children: [
40355
40391
  name,
@@ -40365,9 +40401,9 @@ function TransitionRow({ trace }) {
40365
40401
  if (isServerEntry && trace.serverResponse) {
40366
40402
  return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
40367
40403
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
40368
- /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
40404
+ /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-primary" }),
40369
40405
  /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
40370
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: t("debug.serverResponse") })
40406
+ /* @__PURE__ */ jsx("span", { className: "text-primary flex-shrink-0", children: t("debug.serverResponse") })
40371
40407
  ] }),
40372
40408
  /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
40373
40409
  ] });
@@ -40376,7 +40412,7 @@ function TransitionRow({ trace }) {
40376
40412
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
40377
40413
  /* @__PURE__ */ jsx("span", { className: cn(
40378
40414
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
40379
- hasFailedEffects ? "bg-red-500" : "bg-green-500"
40415
+ hasFailedEffects ? "bg-error" : "bg-success"
40380
40416
  ) }),
40381
40417
  /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
40382
40418
  /* @__PURE__ */ jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
@@ -40390,7 +40426,7 @@ function TransitionRow({ trace }) {
40390
40426
  ] }),
40391
40427
  trace.effects.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 ml-6 mt-0.5", children: trace.effects.map((eff, i) => /* @__PURE__ */ jsxs("span", { className: cn(
40392
40428
  "px-1 rounded text-xs",
40393
- eff.status === "executed" ? "bg-green-500/15 text-green-600 dark:text-green-400" : eff.status === "failed" ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-yellow-500/15 text-yellow-600 dark:text-yellow-400"
40429
+ eff.status === "executed" ? "bg-success/10 text-success" : eff.status === "failed" ? "bg-error/10 text-error" : "bg-warning/10 text-warning"
40394
40430
  ), children: [
40395
40431
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
40396
40432
  " ",
@@ -40424,7 +40460,7 @@ function VerifyModePanel({
40424
40460
  {
40425
40461
  className: cn(
40426
40462
  "runtime-debugger runtime-debugger--verify",
40427
- "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
40463
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-accent",
40428
40464
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
40429
40465
  className
40430
40466
  ),
@@ -40445,8 +40481,8 @@ function VerifyModePanel({
40445
40481
  /* @__PURE__ */ jsx("span", { className: "text-foreground/50 w-3", "aria-hidden": true, children: expanded ? "\u25BE" : "\u25B8" }),
40446
40482
  /* @__PURE__ */ jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? t("debug.failCount", { count: failedChecks }) : t("debug.ok") }),
40447
40483
  /* @__PURE__ */ jsx("span", { className: "text-foreground/70", children: t("debug.localCount", { count: localCount }) }),
40448
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400", children: t("debug.serverCount", { count: serverCount }) }),
40449
- traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates }),
40484
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: t("debug.serverCount", { count: serverCount }) }),
40485
+ traitStates && /* @__PURE__ */ jsx("span", { className: "text-accent truncate max-w-[400px]", children: traitStates }),
40450
40486
  !expanded && transitions.length > 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-foreground/50", children: t("debug.transitionsCount", { count: transitions.length }) })
40451
40487
  ]
40452
40488
  }
@@ -40641,7 +40677,7 @@ function RuntimeDebugger({
40641
40677
  title: t("debug.openDebugger"),
40642
40678
  children: failedChecks > 0 ? /* @__PURE__ */ jsxs("span", { className: "relative", children: [
40643
40679
  /* @__PURE__ */ jsx("span", { children: "V" }),
40644
- /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-red-500 rounded-full" })
40680
+ /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-error rounded-full" })
40645
40681
  ] }) : /* @__PURE__ */ jsx("span", { children: "V" })
40646
40682
  }
40647
40683
  ) : /* @__PURE__ */ jsxs(Card, { className: "runtime-debugger__panel", children: [
@@ -40729,7 +40765,7 @@ var init_SegmentRenderer = __esm({
40729
40765
  "div",
40730
40766
  {
40731
40767
  className: cn(
40732
- "border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
40768
+ "border border-border rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
40733
40769
  containerClassName,
40734
40770
  className
40735
40771
  ),
@@ -45274,7 +45310,11 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45274
45310
  crossTraitLog.debug("listen:subscribed", { busKey, targetTrait: binding.trait.name, sourceOrbital, sourceTrait, listenEvent: listen.event, triggers: listen.triggers });
45275
45311
  const unsub = eventBus.on(busKey, (event) => {
45276
45312
  crossTraitLog.debug("listen:fired", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
45277
- enqueueAndDrain(listen.triggers, event.payload, binding.trait.name);
45313
+ enqueueAndDrain(
45314
+ listen.triggers,
45315
+ applyListenPayloadMapping(listen.payloadMapping, event.payload),
45316
+ binding.trait.name
45317
+ );
45278
45318
  });
45279
45319
  unsubscribes.push(() => {
45280
45320
  crossTraitLog.debug("listen:unsubscribe", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
@@ -45304,7 +45344,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45304
45344
  }
45305
45345
  for (const event of eventsToFire) {
45306
45346
  stateLog.debug("mount:fire-lifecycle", { event, traitCount: traitBindings.length });
45307
- enqueueAndDrain(event, {});
45347
+ enqueueAndDrain(event, { ...optionsRef.current?.initPayload ?? {} });
45308
45348
  }
45309
45349
  return () => {
45310
45350
  initedTraitsRef.current = /* @__PURE__ */ new Set();
@@ -45345,7 +45385,9 @@ function useResolvedSchema(schema, pageName) {
45345
45385
  trait.listens = callSiteListens.map((l) => ({
45346
45386
  event: l.event,
45347
45387
  triggers: l.triggers,
45348
- source: l.source
45388
+ source: l.source,
45389
+ guard: l.guard,
45390
+ payloadMapping: l.payloadMapping
45349
45391
  }));
45350
45392
  resolvedSchemaLog.info("listens:restored", {
45351
45393
  trait: traitName,
@@ -45504,7 +45546,7 @@ function collectServerActiveTraits(ir, allTraits, mountedTraitNames) {
45504
45546
  }
45505
45547
  return active;
45506
45548
  }
45507
- function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, serverActiveTraits }) {
45549
+ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNavigate, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, serverActiveTraits }) {
45508
45550
  const bridge = useServerBridge();
45509
45551
  const activeTraitNames = useMemo(
45510
45552
  () => new Set(traits2.map((b) => b.trait.name).filter((n) => !!n)),
@@ -45533,43 +45575,48 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
45533
45575
  applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits, activeTraitNames);
45534
45576
  }
45535
45577
  }, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, embeddedTraits, activeTraitNames, withActiveTraits]);
45536
- const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait, embeddedTraits } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits };
45578
+ const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait, embeddedTraits, initPayload: routeParams } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, initPayload: routeParams };
45537
45579
  const { sendEvent } = useTraitStateMachine(traits2, uiSlots, opts);
45538
45580
  const initSentRef = useRef(false);
45539
45581
  const prevTraitsRef = useRef(void 0);
45582
+ const paramsKey = JSON.stringify(routeParams ?? {});
45583
+ const prevParamsKeyRef = useRef(void 0);
45540
45584
  useEffect(() => {
45541
45585
  const refChanged = prevTraitsRef.current !== void 0 && prevTraitsRef.current !== traits2;
45586
+ const paramsChanged = prevParamsKeyRef.current !== void 0 && prevParamsKeyRef.current !== paramsKey;
45542
45587
  navLog.debug("page:traits-effect", () => ({
45543
45588
  refChanged,
45589
+ paramsChanged,
45544
45590
  traitsCount: Array.isArray(traits2) ? traits2.length : -1,
45545
45591
  hadPrev: prevTraitsRef.current !== void 0
45546
45592
  }));
45547
- if (refChanged) {
45548
- navLog.info("page:traits-reset", { traitsCount: Array.isArray(traits2) ? traits2.length : -1 });
45593
+ if (refChanged || paramsChanged) {
45594
+ navLog.info("page:traits-reset", { traitsCount: Array.isArray(traits2) ? traits2.length : -1, paramsChanged });
45549
45595
  uiSlots.clearAll();
45550
45596
  initSentRef.current = false;
45551
45597
  }
45552
45598
  prevTraitsRef.current = traits2;
45553
- }, [traits2, uiSlots]);
45599
+ prevParamsKeyRef.current = paramsKey;
45600
+ }, [traits2, uiSlots, paramsKey]);
45554
45601
  useEffect(() => {
45555
45602
  if (!orbitalNames?.length) {
45556
- const t = setTimeout(() => sendEvent("INIT"), 50);
45603
+ const t = setTimeout(() => sendEvent("INIT", routeParams), 50);
45557
45604
  return () => clearTimeout(t);
45558
45605
  }
45559
45606
  const fallback = setTimeout(() => {
45560
45607
  if (!initSentRef.current) {
45561
- sendEvent("INIT");
45608
+ sendEvent("INIT", routeParams);
45562
45609
  onLocalFallback?.();
45563
45610
  }
45564
45611
  }, 5e3);
45565
45612
  return () => clearTimeout(fallback);
45566
- }, [traits2, orbitalNames, sendEvent, onLocalFallback]);
45613
+ }, [traits2, orbitalNames, sendEvent, onLocalFallback, routeParams]);
45567
45614
  useEffect(() => {
45568
45615
  if (!bridge.connected || !orbitalNames?.length || initSentRef.current) return;
45569
45616
  initSentRef.current = true;
45570
45617
  (async () => {
45571
45618
  for (const name of orbitalNames) {
45572
- const { effects, meta } = await bridge.sendEvent(name, "INIT", withActiveTraits({}));
45619
+ const { effects, meta } = await bridge.sendEvent(name, "INIT", withActiveTraits({ ...routeParams ?? {} }));
45573
45620
  recordServerResponse(name, "INIT", meta);
45574
45621
  const effectTraces = [
45575
45622
  { type: "fetch", args: [], status: "executed" },
@@ -45590,10 +45637,10 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
45590
45637
  applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits, activeTraitNames);
45591
45638
  }
45592
45639
  })();
45593
- }, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate, embeddedTraits, activeTraitNames, withActiveTraits]);
45640
+ }, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate, embeddedTraits, activeTraitNames, withActiveTraits, routeParams]);
45594
45641
  return null;
45595
45642
  }
45596
- function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavigate, onLocalFallback, persistence }) {
45643
+ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, routeParams, onNavigate, onLocalFallback, persistence }) {
45597
45644
  const { traits: traits2, allEntities, allTraits, ir } = useResolvedSchema(schema, pageName);
45598
45645
  const allPageTraits = useMemo(() => {
45599
45646
  let base;
@@ -45735,6 +45782,7 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
45735
45782
  TraitInitializer,
45736
45783
  {
45737
45784
  traits: allPageTraits,
45785
+ routeParams,
45738
45786
  orbitalNames: serverUrl || transport ? pageOrbitalNames : void 0,
45739
45787
  traitConfigsByName,
45740
45788
  orbitalsByTrait,
@@ -45812,27 +45860,35 @@ function OrbPreview({
45812
45860
  return [];
45813
45861
  }
45814
45862
  }, [parsedSchema]);
45815
- const initialPageName = useMemo(() => {
45863
+ const initialPageMatch = useMemo(() => {
45816
45864
  if (!initialPagePath) return void 0;
45817
- const match = pages.find(({ page }) => page.path === initialPagePath);
45818
- return match?.page.name;
45865
+ const hit = matchPathAmong(pages, initialPagePath, (entry) => entry.page.path);
45866
+ if (!hit) return void 0;
45867
+ return { name: hit.candidate.page.name, params: hit.params };
45819
45868
  }, [pages, initialPagePath]);
45869
+ const initialPageName = initialPageMatch?.name;
45820
45870
  const [currentPage, setCurrentPage] = useState(initialPageName);
45871
+ const [routeParams, setRouteParams] = useState(initialPageMatch?.params ?? {});
45821
45872
  const prevInitialPagePathRef = useRef(initialPagePath);
45822
45873
  useEffect(() => {
45823
45874
  if (prevInitialPagePathRef.current !== initialPagePath) {
45824
45875
  prevInitialPagePathRef.current = initialPagePath;
45825
45876
  setCurrentPage(initialPageName);
45877
+ setRouteParams(initialPageMatch?.params ?? {});
45826
45878
  }
45827
- }, [initialPagePath, initialPageName]);
45879
+ }, [initialPagePath, initialPageName, initialPageMatch]);
45828
45880
  const handleNavigate = useCallback((path) => {
45829
- const match = pages.find(({ page }) => page.path === path);
45881
+ const hit = matchPathAmong(pages, path, (entry) => entry.page.path);
45882
+ const match = hit?.candidate;
45883
+ const params = hit?.params ?? {};
45830
45884
  navLog.debug("handleNavigate", () => ({
45831
45885
  path,
45832
45886
  matched: match?.page.name ?? null,
45887
+ params,
45833
45888
  availablePaths: pages.map((p) => p.page.path)
45834
45889
  }));
45835
- if (match) {
45890
+ if (match?.page.name) {
45891
+ setRouteParams(params);
45836
45892
  setCurrentPage(match.page.name);
45837
45893
  if (typeof window !== "undefined") {
45838
45894
  const url = new URL(window.location.href);
@@ -45902,6 +45958,7 @@ function OrbPreview({
45902
45958
  transport,
45903
45959
  mockData: effectiveMockData,
45904
45960
  pageName: currentPage,
45961
+ routeParams,
45905
45962
  onNavigate: handleNavigate,
45906
45963
  onLocalFallback: handleLocalFallback,
45907
45964
  persistence