@almadar/ui 5.122.14 → 5.124.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 +354 -234
  6. package/dist/avl/index.js +356 -236
  7. package/dist/components/index.cjs +273 -198
  8. package/dist/components/index.d.cts +18 -12
  9. package/dist/components/index.d.ts +18 -12
  10. package/dist/components/index.js +273 -198
  11. package/dist/context/index.cjs +34 -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 +34 -66
  15. package/dist/hooks/index.cjs +8 -0
  16. package/dist/hooks/index.js +8 -0
  17. package/dist/lib/drawable/three/index.cjs +6 -0
  18. package/dist/lib/drawable/three/index.js +6 -0
  19. package/dist/marketing/index.cjs +7 -0
  20. package/dist/marketing/index.js +7 -0
  21. package/dist/providers/index.cjs +343 -217
  22. package/dist/providers/index.d.cts +6 -6
  23. package/dist/providers/index.d.ts +6 -6
  24. package/dist/providers/index.js +343 -217
  25. package/dist/runtime/index.cjs +347 -227
  26. package/dist/runtime/index.d.cts +4 -2
  27. package/dist/runtime/index.d.ts +4 -2
  28. package/dist/runtime/index.js +349 -229
  29. package/package.json +8 -7
  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, matchPath, 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';
@@ -1568,6 +1568,7 @@ var init_Button = __esm({
1568
1568
  "button",
1569
1569
  {
1570
1570
  ref,
1571
+ type: "button",
1571
1572
  disabled: disabled || isLoading,
1572
1573
  className: cn(
1573
1574
  "relative inline-flex items-center justify-center gap-2",
@@ -1661,6 +1662,11 @@ var init_Typography = __esm({
1661
1662
  inherit: "text-inherit"
1662
1663
  };
1663
1664
  weightStyles = {
1665
+ // Neutral: an atom default of "none" must not override the variant's baked
1666
+ // weight (C-PATTERN-ENUM-BLOCKS-NEUTRAL-OVERRIDE — `variant={h2}` rendered
1667
+ // tiny because the ui-typography atom's `weight: light`/`size: xs` defaults
1668
+ // clobbered every variant).
1669
+ none: "",
1664
1670
  light: "font-light",
1665
1671
  normal: "font-normal",
1666
1672
  medium: "font-medium",
@@ -1686,6 +1692,7 @@ var init_Typography = __esm({
1686
1692
  label: "span"
1687
1693
  };
1688
1694
  typographySizeStyles = {
1695
+ none: "",
1689
1696
  xs: "text-xs",
1690
1697
  sm: "text-sm",
1691
1698
  md: "text-base",
@@ -5095,15 +5102,15 @@ var init_TextHighlight = __esm({
5095
5102
  const typeStyles = {
5096
5103
  question: cn(
5097
5104
  // Blue border for questions
5098
- "bg-card border-b-2 border-primary-600",
5105
+ "bg-card border-b-2 border-primary",
5099
5106
  "hover:bg-muted",
5100
- isActive && "bg-primary-100 ring-2 ring-primary-600"
5107
+ isActive && "bg-primary/10 ring-2 ring-primary"
5101
5108
  ),
5102
5109
  note: cn(
5103
5110
  // Yellow border for notes
5104
- "bg-card border-b-2 border-amber-500",
5111
+ "bg-card border-b-2 border-warning",
5105
5112
  "hover:bg-muted",
5106
- isActive && "bg-amber-100 ring-2 ring-amber-500"
5113
+ isActive && "bg-warning/10 ring-2 ring-warning"
5107
5114
  )
5108
5115
  };
5109
5116
  return /* @__PURE__ */ jsx(
@@ -5449,7 +5456,7 @@ function DayCell({
5449
5456
  {
5450
5457
  className: cn(
5451
5458
  "p-2 text-center cursor-pointer hover:bg-muted transition-colors",
5452
- isToday && "bg-blue-500/10",
5459
+ isToday && "bg-primary/10",
5453
5460
  className
5454
5461
  ),
5455
5462
  onClick: handleClick,
@@ -5460,7 +5467,7 @@ function DayCell({
5460
5467
  variant: "small",
5461
5468
  className: cn(
5462
5469
  "font-medium",
5463
- isToday ? "text-blue-600" : "text-muted-foreground"
5470
+ isToday ? "text-primary" : "text-muted-foreground"
5464
5471
  ),
5465
5472
  children: dayAbbr
5466
5473
  }
@@ -5472,7 +5479,7 @@ function DayCell({
5472
5479
  rounded: "full",
5473
5480
  className: cn(
5474
5481
  "h-8 w-8 mx-auto items-center justify-center",
5475
- isToday && "bg-blue-600 text-white"
5482
+ isToday && "bg-primary text-primary-foreground"
5476
5483
  ),
5477
5484
  children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-semibold", children: safeDate.getDate() })
5478
5485
  }
@@ -12184,19 +12191,19 @@ var init_ActivationBlock = __esm({
12184
12191
  "div",
12185
12192
  {
12186
12193
  className: cn(
12187
- "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",
12188
12195
  className
12189
12196
  ),
12190
12197
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
12191
- /* @__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 }),
12192
12199
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
12193
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
12194
- /* @__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 }),
12195
12202
  isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
12196
12203
  /* @__PURE__ */ jsx(
12197
12204
  "textarea",
12198
12205
  {
12199
- 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",
12200
12207
  placeholder: "Jot down your thoughts...",
12201
12208
  value: response,
12202
12209
  onChange: (e) => setResponse(e.target.value),
@@ -12208,7 +12215,7 @@ var init_ActivationBlock = __esm({
12208
12215
  "button",
12209
12216
  {
12210
12217
  onClick: handleSubmit,
12211
- 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",
12212
12219
  children: "Continue to Lesson \u2192"
12213
12220
  }
12214
12221
  ),
@@ -12219,7 +12226,7 @@ var init_ActivationBlock = __esm({
12219
12226
  emit(`UI:${saveEvent}`, { response: "" });
12220
12227
  setIsExpanded(false);
12221
12228
  },
12222
- 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",
12223
12230
  children: "Skip for now"
12224
12231
  }
12225
12232
  )
@@ -12228,7 +12235,7 @@ var init_ActivationBlock = __esm({
12228
12235
  "button",
12229
12236
  {
12230
12237
  onClick: () => setIsExpanded(true),
12231
- className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
12238
+ className: "text-sm text-primary hover:underline font-medium",
12232
12239
  children: "\u2713 Answered \xB7 Edit response"
12233
12240
  }
12234
12241
  )
@@ -12732,7 +12739,7 @@ var init_AuthLayout = __esm({
12732
12739
  VStack,
12733
12740
  {
12734
12741
  className: cn(
12735
- "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",
12736
12743
  "justify-between p-12"
12737
12744
  ),
12738
12745
  style: backgroundImage ? {
@@ -12741,7 +12748,7 @@ var init_AuthLayout = __esm({
12741
12748
  } : void 0,
12742
12749
  gap: "none",
12743
12750
  children: [
12744
- /* @__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" }),
12745
12752
  /* @__PURE__ */ jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-3", children: [
12746
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(
12747
12754
  Typography,
@@ -12826,7 +12833,7 @@ var init_AuthLayout = __esm({
12826
12833
  ),
12827
12834
  children: /* @__PURE__ */ jsxs(Box, { className: "w-full max-w-md", children: [
12828
12835
  /* @__PURE__ */ jsx(Box, { className: "lg:hidden mb-8 text-center", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "inline-flex items-center gap-3", children: [
12829
- 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(
12830
12837
  Typography,
12831
12838
  {
12832
12839
  variant: "body1",
@@ -14817,7 +14824,7 @@ var init_CodeBlock = __esm({
14817
14824
  {
14818
14825
  justify: "between",
14819
14826
  align: "center",
14820
- 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",
14821
14828
  children: [
14822
14829
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
14823
14830
  effectiveCopy && /* @__PURE__ */ jsx(
@@ -14826,9 +14833,9 @@ var init_CodeBlock = __esm({
14826
14833
  variant: "ghost",
14827
14834
  size: "sm",
14828
14835
  onClick: handleCopy,
14829
- 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",
14830
14837
  "aria-label": t("common.copy"),
14831
- 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" })
14832
14839
  }
14833
14840
  )
14834
14841
  ]
@@ -15196,12 +15203,12 @@ var init_BloomQuizBlock = __esm({
15196
15203
  init_useEventBus();
15197
15204
  init_cn();
15198
15205
  BLOOM_CONFIG = {
15199
- remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
15200
- understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
15201
- apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
15202
- analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
15203
- evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
15204
- 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" }
15205
15212
  };
15206
15213
  BloomQuizBlock = ({
15207
15214
  level,
@@ -15227,22 +15234,22 @@ var init_BloomQuizBlock = __esm({
15227
15234
  "div",
15228
15235
  {
15229
15236
  className: cn(
15230
- "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",
15231
15238
  config.bgColor,
15232
15239
  className
15233
15240
  ),
15234
15241
  children: [
15235
15242
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
15236
15243
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
15237
- 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: [
15238
15245
  "Question ",
15239
15246
  index + 1
15240
15247
  ] }),
15241
- /* @__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 })
15242
15249
  ] }),
15243
- 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 })
15244
15251
  ] }),
15245
- /* @__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(
15246
15253
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
15247
15254
  CodeBlock,
15248
15255
  {
@@ -15256,13 +15263,13 @@ var init_BloomQuizBlock = __esm({
15256
15263
  "button",
15257
15264
  {
15258
15265
  type: "button",
15259
- 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",
15260
15267
  onClick: handleReveal,
15261
15268
  children: revealed ? "Hide Answer" : "Reveal Answer"
15262
15269
  }
15263
15270
  ),
15264
- 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: [
15265
- /* @__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:" }),
15266
15273
  answerSegments.map(
15267
15274
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
15268
15275
  CodeBlock,
@@ -15486,12 +15493,12 @@ var init_QuizBlock = __esm({
15486
15493
  }) => {
15487
15494
  const { t } = useTranslate();
15488
15495
  const [revealed, setRevealed] = useState(false);
15489
- 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: [
15490
15497
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
15491
- /* @__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" }),
15492
15499
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-medium", children: question })
15493
15500
  ] }),
15494
- 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,
15495
15502
  /* @__PURE__ */ jsx(
15496
15503
  Button,
15497
15504
  {
@@ -17403,7 +17410,7 @@ var init_BookTableOfContents = __esm({
17403
17410
  className: cn(
17404
17411
  "justify-start text-left w-full",
17405
17412
  direction === "rtl" && "text-right",
17406
- isCurrent && "bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400"
17413
+ isCurrent && "bg-primary/10 text-primary"
17407
17414
  ),
17408
17415
  children: /* @__PURE__ */ jsx(Box, { className: "truncate", children: /* @__PURE__ */ jsx(Typography, { variant: "body", children: String(chapter.title ?? "") }) })
17409
17416
  },
@@ -18584,7 +18591,7 @@ function CalendarGrid({
18584
18591
  border: true,
18585
18592
  className: cn(
18586
18593
  "cursor-pointer hover:shadow-sm transition-shadow text-xs truncate",
18587
- color ? color : "bg-blue-500/15 border-blue-500/30 text-blue-600"
18594
+ color ? color : "bg-primary/10 border-primary/30 text-primary"
18588
18595
  ),
18589
18596
  onClick: (e) => handleEventClick(event, e),
18590
18597
  children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
@@ -18682,7 +18689,7 @@ function CalendarGrid({
18682
18689
  onClick: () => handleSlotClick(day, time),
18683
18690
  className: cn(
18684
18691
  "border-l border-border",
18685
- isToday && "bg-blue-50/30"
18692
+ isToday && "bg-primary/10"
18686
18693
  ),
18687
18694
  ...longPressEvent ? {
18688
18695
  onPointerDown: () => startLongPress(day, time),
@@ -20698,31 +20705,31 @@ var init_CodeRunnerPanel = __esm({
20698
20705
  }
20699
20706
  )
20700
20707
  ] }),
20701
- 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: [
20702
20709
  /* @__PURE__ */ jsxs(
20703
20710
  HStack,
20704
20711
  {
20705
20712
  gap: "sm",
20706
20713
  align: "center",
20707
- 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",
20708
20715
  children: [
20709
- /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
20710
- /* @__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" })
20711
20718
  ]
20712
20719
  }
20713
20720
  ),
20714
- /* @__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: [
20715
- output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
20716
- output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
20717
- !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
20718
- 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: [
20719
- 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" }),
20720
20727
  /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
20721
20728
  /* @__PURE__ */ jsxs(
20722
20729
  Typography,
20723
20730
  {
20724
20731
  variant: "small",
20725
- className: test.passed ? "text-green-400" : "text-red-400",
20732
+ className: test.passed ? "text-success" : "text-error",
20726
20733
  children: [
20727
20734
  "Test ",
20728
20735
  index + 1,
@@ -20731,15 +20738,15 @@ var init_CodeRunnerPanel = __esm({
20731
20738
  ]
20732
20739
  }
20733
20740
  ),
20734
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
20741
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
20735
20742
  "Input: ",
20736
20743
  test.input
20737
20744
  ] }),
20738
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
20745
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
20739
20746
  "Expected: ",
20740
20747
  test.expectedOutput
20741
20748
  ] }),
20742
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
20749
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
20743
20750
  "Actual: ",
20744
20751
  test.actualOutput
20745
20752
  ] })
@@ -20924,14 +20931,14 @@ var init_ConnectionBlock = __esm({
20924
20931
  "div",
20925
20932
  {
20926
20933
  className: cn(
20927
- "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",
20928
20935
  className
20929
20936
  ),
20930
20937
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
20931
- /* @__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 }),
20932
20939
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
20933
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
20934
- /* @__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 }) })
20935
20942
  ] })
20936
20943
  ] })
20937
20944
  }
@@ -21018,7 +21025,7 @@ function CounterStandard({
21018
21025
  variant: "h1",
21019
21026
  className: cn(
21020
21027
  sizeStyles8[size].display,
21021
- "font-bold tabular-nums text-primary-600"
21028
+ "font-bold tabular-nums text-primary"
21022
21029
  ),
21023
21030
  children: resolved.count
21024
21031
  }
@@ -21091,7 +21098,7 @@ function CounterFull({
21091
21098
  variant: "h1",
21092
21099
  className: cn(
21093
21100
  sizeStyles8[size].display,
21094
- "font-bold tabular-nums text-primary-600"
21101
+ "font-bold tabular-nums text-primary"
21095
21102
  ),
21096
21103
  children: resolved.count
21097
21104
  }
@@ -21338,11 +21345,11 @@ var init_DashboardLayout = __esm({
21338
21345
  className: "h-16 px-4 border-b border-border dark:border-border",
21339
21346
  children: [
21340
21347
  /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
21341
- 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(
21342
21349
  Typography,
21343
21350
  {
21344
21351
  variant: "small",
21345
- className: "text-white font-bold text-sm",
21352
+ className: "text-primary-foreground font-bold text-sm",
21346
21353
  as: "span",
21347
21354
  children: appName.charAt(0).toUpperCase()
21348
21355
  }
@@ -21421,11 +21428,11 @@ var init_DashboardLayout = __esm({
21421
21428
  className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
21422
21429
  children: [
21423
21430
  /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
21424
- 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(
21425
21432
  Typography,
21426
21433
  {
21427
21434
  variant: "small",
21428
- className: "text-white font-bold text-xs",
21435
+ className: "text-primary-foreground font-bold text-xs",
21429
21436
  as: "span",
21430
21437
  children: appName.charAt(0).toUpperCase()
21431
21438
  }
@@ -21485,8 +21492,8 @@ var init_DashboardLayout = __esm({
21485
21492
  {
21486
21493
  as: "span",
21487
21494
  className: cn(
21488
- "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",
21489
- 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"
21490
21497
  ),
21491
21498
  children: action.badge
21492
21499
  }
@@ -21508,7 +21515,7 @@ var init_DashboardLayout = __esm({
21508
21515
  Box,
21509
21516
  {
21510
21517
  as: "span",
21511
- 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",
21512
21519
  children: unreadCount > 99 ? "99+" : unreadCount
21513
21520
  }
21514
21521
  )
@@ -21791,7 +21798,7 @@ function SubMenu({
21791
21798
  ),
21792
21799
  children: [
21793
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" })),
21794
- /* @__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 }),
21795
21802
  item.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs font-medium", children: item.badge })
21796
21803
  ]
21797
21804
  },
@@ -21848,7 +21855,7 @@ function MenuItemRow({
21848
21855
  Typography,
21849
21856
  {
21850
21857
  variant: "small",
21851
- className: cn("flex-1", isDanger && "text-red-600"),
21858
+ className: cn("flex-1", isDanger && "text-error"),
21852
21859
  children: item.label
21853
21860
  }
21854
21861
  ),
@@ -22616,14 +22623,25 @@ function DataGrid({
22616
22623
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
22617
22624
  const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
22618
22625
  const dangerActions = actionDefs.filter((a) => a.variant === "danger");
22619
- const handleActionClick = (action, itemData) => (e) => {
22620
- e.stopPropagation();
22626
+ const fireAction = (action, itemData) => {
22627
+ if (action.navigatesTo) {
22628
+ const url = action.navigatesTo.replace(
22629
+ /\{\{row\.(\w+(?:\.\w+)*)\}\}/g,
22630
+ (_, field) => String(itemData[field] ?? "")
22631
+ );
22632
+ eventBus.emit("UI:NAVIGATE", { url, row: itemData });
22633
+ return;
22634
+ }
22621
22635
  const payload = {
22622
22636
  id: itemData.id,
22623
22637
  row: itemData
22624
22638
  };
22625
22639
  eventBus.emit(`UI:${action.event}`, payload);
22626
22640
  };
22641
+ const handleActionClick = (action, itemData) => (e) => {
22642
+ e.stopPropagation();
22643
+ fireAction(action, itemData);
22644
+ };
22627
22645
  const hasRenderProp = typeof children === "function";
22628
22646
  useEffect(() => {
22629
22647
  if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
@@ -22690,13 +22708,46 @@ function DataGrid({
22690
22708
  const wrapDnd = (node) => dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }, dndId) : node;
22691
22709
  if (hasRenderProp) {
22692
22710
  return wrapDnd(
22693
- /* @__PURE__ */ jsx(
22711
+ /* @__PURE__ */ jsxs(
22694
22712
  Box,
22695
22713
  {
22696
22714
  "data-entity-row": true,
22697
22715
  "data-entity-id": id,
22698
22716
  className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
22699
- children: children(itemData, index)
22717
+ children: [
22718
+ children(itemData, index),
22719
+ actionDefs.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end", children: [
22720
+ (maxInlineActions != null ? actionDefs.slice(0, maxInlineActions) : actionDefs).map((action, idx) => /* @__PURE__ */ jsxs(
22721
+ Button,
22722
+ {
22723
+ variant: action.variant === "primary" ? "primary" : "ghost",
22724
+ size: "sm",
22725
+ onClick: handleActionClick(action, itemData),
22726
+ "data-testid": `action-${action.event}`,
22727
+ "data-row-id": String(itemData.id),
22728
+ className: action.variant === "danger" ? "text-error hover:text-error hover:bg-error/10" : void 0,
22729
+ children: [
22730
+ action.icon && renderIconInput(action.icon, { size: "xs", className: "mr-1" }),
22731
+ action.label
22732
+ ]
22733
+ },
22734
+ idx
22735
+ )),
22736
+ maxInlineActions != null && actionDefs.length > maxInlineActions && /* @__PURE__ */ jsx(
22737
+ Menu,
22738
+ {
22739
+ position: "bottom-end",
22740
+ 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" }) }),
22741
+ items: actionDefs.slice(maxInlineActions).map((action) => ({
22742
+ label: action.label,
22743
+ icon: action.icon,
22744
+ event: action.event,
22745
+ onClick: () => fireAction(action, itemData)
22746
+ }))
22747
+ }
22748
+ )
22749
+ ] }) })
22750
+ ]
22700
22751
  },
22701
22752
  id
22702
22753
  )
@@ -22833,10 +22884,7 @@ function DataGrid({
22833
22884
  label: action.label,
22834
22885
  icon: action.icon,
22835
22886
  event: action.event,
22836
- onClick: () => eventBus.emit(`UI:${action.event}`, {
22837
- id: itemData.id,
22838
- row: itemData
22839
- })
22887
+ onClick: () => fireAction(action, itemData)
22840
22888
  }))
22841
22889
  }
22842
22890
  )
@@ -23656,7 +23704,9 @@ var init_FilterGroup = __esm({
23656
23704
  showIcon = true,
23657
23705
  query,
23658
23706
  isLoading,
23659
- look = "toolbar"
23707
+ look = "toolbar",
23708
+ event,
23709
+ clearEvent
23660
23710
  }) => {
23661
23711
  const { t } = useTranslate();
23662
23712
  const eventBus = useEventBus();
@@ -23693,14 +23743,18 @@ var init_FilterGroup = __esm({
23693
23743
  queryState.setFilter(field, value === "all" ? null : value);
23694
23744
  }
23695
23745
  onFilterChange?.(field, value === "all" ? null : value);
23696
- eventBus.emit("UI:FILTER", {
23746
+ const payload = {
23697
23747
  entity,
23698
23748
  field,
23699
23749
  value: value === "all" || value === null ? "" : value,
23700
23750
  query
23701
- });
23751
+ };
23752
+ if (event && event !== "FILTER") {
23753
+ eventBus.emit(`UI:${event}`, payload);
23754
+ }
23755
+ eventBus.emit("UI:FILTER", payload);
23702
23756
  },
23703
- [onFilterChange, queryState, eventBus, entity, query]
23757
+ [onFilterChange, queryState, eventBus, entity, query, event]
23704
23758
  );
23705
23759
  const handleClearAll = useCallback(() => {
23706
23760
  setSelectedValues({});
@@ -23708,8 +23762,11 @@ var init_FilterGroup = __esm({
23708
23762
  queryState.clearFilters();
23709
23763
  }
23710
23764
  onClearAll?.();
23765
+ if (clearEvent && clearEvent !== "CLEAR_FILTERS") {
23766
+ eventBus.emit(`UI:${clearEvent}`, { entity, query });
23767
+ }
23711
23768
  eventBus.emit("UI:CLEAR_FILTERS", { entity, query });
23712
- }, [onClearAll, queryState, eventBus, entity, query]);
23769
+ }, [onClearAll, queryState, eventBus, entity, query, clearEvent]);
23713
23770
  const activeFilterCount = Object.keys(selectedValues).length;
23714
23771
  if (variant === "pills") {
23715
23772
  return /* @__PURE__ */ jsxs(
@@ -24690,8 +24747,8 @@ var init_RelationSelect = __esm({
24690
24747
  disabled,
24691
24748
  className: cn(
24692
24749
  "w-full justify-between font-normal",
24693
- error && "border-red-300 focus:border-red-500 focus:ring-red-500",
24694
- 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"
24695
24752
  ),
24696
24753
  children: [
24697
24754
  /* @__PURE__ */ jsx(
@@ -24771,7 +24828,7 @@ var init_RelationSelect = __esm({
24771
24828
  paddingY: "sm",
24772
24829
  className: cn(
24773
24830
  "text-left text-sm hover:bg-muted focus:outline-none focus:bg-muted",
24774
- option.value === value && "bg-primary-50 text-primary-700",
24831
+ option.value === value && "bg-primary/10 text-primary",
24775
24832
  option.disabled && "opacity-50 cursor-not-allowed"
24776
24833
  ),
24777
24834
  onClick: () => handleSelect(option),
@@ -24837,7 +24894,7 @@ var init_SearchInput = __esm({
24837
24894
  queryState.setSearch(newValue);
24838
24895
  }
24839
24896
  onSearch?.(newValue);
24840
- if (event) {
24897
+ if (event && event !== "SEARCH") {
24841
24898
  eventBus.emit(`UI:${event}`, { searchTerm: newValue, entity });
24842
24899
  }
24843
24900
  if (event || entity || query) {
@@ -24928,7 +24985,7 @@ var init_SidePanel = __esm({
24928
24985
  showOverlay && /* @__PURE__ */ jsx(Presence, { show: isOpen, animation: "overlay", children: /* @__PURE__ */ jsx(
24929
24986
  Box,
24930
24987
  {
24931
- 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",
24932
24989
  onClick: handleClose
24933
24990
  }
24934
24991
  ) }),
@@ -25295,7 +25352,7 @@ var init_WizardNavigation = __esm({
25295
25352
  /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: "sm" }),
25296
25353
  resolvedBackLabel
25297
25354
  ] }) : /* @__PURE__ */ jsx(Box, {}),
25298
- /* @__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) }) }) }),
25299
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: [
25300
25357
  resolvedNextLabel,
25301
25358
  /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm" })
@@ -27452,6 +27509,7 @@ var init_Lightbox = __esm({
27452
27509
  {
27453
27510
  className: cn(
27454
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
27455
27513
  "bg-black bg-opacity-90",
27456
27514
  className
27457
27515
  ),
@@ -27474,7 +27532,7 @@ var init_Lightbox = __esm({
27474
27532
  "p-2 rounded-full",
27475
27533
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
27476
27534
  "hover:bg-opacity-70 transition-opacity",
27477
- "focus:outline-none focus:ring-2 focus:ring-white"
27535
+ "focus:outline-none focus:ring-2 focus:ring-ring"
27478
27536
  ),
27479
27537
  "aria-label": t("aria.closeModal"),
27480
27538
  children: /* @__PURE__ */ jsx(Icon, { name: "x", className: "w-6 h-6" })
@@ -27493,7 +27551,7 @@ var init_Lightbox = __esm({
27493
27551
  "p-2 rounded-full",
27494
27552
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
27495
27553
  "hover:bg-opacity-70 transition-opacity",
27496
- "focus:outline-none focus:ring-2 focus:ring-white"
27554
+ "focus:outline-none focus:ring-2 focus:ring-ring"
27497
27555
  ),
27498
27556
  "aria-label": t("aria.previousImage"),
27499
27557
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", className: "w-8 h-8" })
@@ -27530,7 +27588,7 @@ var init_Lightbox = __esm({
27530
27588
  "p-2 rounded-full",
27531
27589
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
27532
27590
  "hover:bg-opacity-70 transition-opacity",
27533
- "focus:outline-none focus:ring-2 focus:ring-white"
27591
+ "focus:outline-none focus:ring-2 focus:ring-ring"
27534
27592
  ),
27535
27593
  "aria-label": t("aria.nextImage"),
27536
27594
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", className: "w-8 h-8" })
@@ -30465,6 +30523,7 @@ var init_QrScanner = __esm({
30465
30523
  overflow: "hidden",
30466
30524
  rounded: "sm",
30467
30525
  className: cn(
30526
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30468
30527
  "bg-black",
30469
30528
  "aspect-square w-full max-w-md",
30470
30529
  className
@@ -30529,7 +30588,9 @@ var init_QrScanner = __esm({
30529
30588
  type: "button",
30530
30589
  onClick: togglePause,
30531
30590
  className: cn(
30591
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30532
30592
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
30593
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30533
30594
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
30534
30595
  ),
30535
30596
  "aria-label": isPaused ? t("qrScanner.resumeScanning") : t("qrScanner.pauseScanning"),
@@ -30542,7 +30603,9 @@ var init_QrScanner = __esm({
30542
30603
  type: "button",
30543
30604
  onClick: toggleFacing,
30544
30605
  className: cn(
30606
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30545
30607
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
30608
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30546
30609
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
30547
30610
  ),
30548
30611
  "aria-label": currentFacing === "environment" ? t("qrScanner.switchToFrontCamera") : t("qrScanner.switchToRearCamera"),
@@ -30555,7 +30618,9 @@ var init_QrScanner = __esm({
30555
30618
  type: "button",
30556
30619
  onClick: handleMockScan,
30557
30620
  className: cn(
30621
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30558
30622
  "rounded-full bg-black bg-opacity-60 px-3 py-2 text-xs text-white",
30623
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
30559
30624
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
30560
30625
  ),
30561
30626
  "aria-label": t("aria.mockScanDev"),
@@ -33291,10 +33356,10 @@ var init_ModuleCard = __esm({
33291
33356
  init_avl_atom_types();
33292
33357
  init_MiniStateMachine();
33293
33358
  PERSISTENCE_BORDER = {
33294
- persistent: "border-l-[3px] border-l-blue-500 border-solid",
33295
- runtime: "border-l-[3px] border-l-blue-500 border-dashed",
33296
- singleton: "border-l-[3px] border-l-blue-500 border-double",
33297
- instance: "border-l-[3px] border-l-blue-500 border-dotted"
33359
+ persistent: "border-l-[3px] border-l-primary border-solid",
33360
+ runtime: "border-l-[3px] border-l-primary border-dashed",
33361
+ singleton: "border-l-[3px] border-l-primary border-double",
33362
+ instance: "border-l-[3px] border-l-primary border-dotted"
33298
33363
  };
33299
33364
  PERSISTENCE_ICON = {
33300
33365
  persistent: "\u26C1",
@@ -33324,8 +33389,8 @@ var init_ModuleCard = __esm({
33324
33389
  className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] shadow-sm overflow-hidden",
33325
33390
  style: { minWidth: 280, maxWidth: 400 },
33326
33391
  children: [
33327
- /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
33328
- /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
33392
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, className: "!w-2.5 !h-2.5 !bg-warning" }),
33393
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, className: "!w-2.5 !h-2.5 !bg-warning" }),
33329
33394
  /* @__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 }) }),
33330
33395
  /* @__PURE__ */ jsxs("div", { className: `px-3 py-2 border-b border-[var(--color-border)] ${PERSISTENCE_BORDER[persistence] ?? ""}`, children: [
33331
33396
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 mb-1.5", children: [
@@ -35781,19 +35846,19 @@ var init_ReflectionBlock = __esm({
35781
35846
  "div",
35782
35847
  {
35783
35848
  className: cn(
35784
- "my-6 border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded-r-lg p-4",
35849
+ "my-6 border-l-4 border-warning bg-warning/10 rounded-r-lg p-4",
35785
35850
  className
35786
35851
  ),
35787
35852
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
35788
- /* @__PURE__ */ jsx(PauseCircle, { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 mt-1", size: 20 }),
35853
+ /* @__PURE__ */ jsx(PauseCircle, { className: "text-warning flex-shrink-0 mt-1", size: 20 }),
35789
35854
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
35790
- /* @__PURE__ */ jsx("div", { className: "font-medium text-amber-900 dark:text-amber-100 mb-2", children: "Pause & Reflect" }),
35791
- /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 text-sm mb-3", children: prompt }),
35855
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-warning mb-2", children: "Pause & Reflect" }),
35856
+ /* @__PURE__ */ jsx("p", { className: "text-foreground text-sm mb-3", children: prompt }),
35792
35857
  isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
35793
35858
  /* @__PURE__ */ jsx(
35794
35859
  "textarea",
35795
35860
  {
35796
- 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",
35861
+ className: "w-full p-2 border border-input rounded text-sm bg-card text-foreground focus:ring-2 focus:ring-ring focus:border-transparent",
35797
35862
  placeholder: "Your thoughts...",
35798
35863
  value: note,
35799
35864
  onChange: (e) => setNote(e.target.value),
@@ -35804,7 +35869,7 @@ var init_ReflectionBlock = __esm({
35804
35869
  "button",
35805
35870
  {
35806
35871
  onClick: handleSave,
35807
- className: "mt-2 text-sm px-3 py-1 bg-amber-600 text-white rounded hover:bg-amber-700 transition-colors",
35872
+ className: "mt-2 text-sm px-3 py-1 bg-warning text-warning-foreground rounded hover:opacity-90 transition-colors",
35808
35873
  children: "Save & Continue"
35809
35874
  }
35810
35875
  )
@@ -35812,7 +35877,7 @@ var init_ReflectionBlock = __esm({
35812
35877
  "button",
35813
35878
  {
35814
35879
  onClick: () => setIsExpanded(true),
35815
- className: "text-sm text-amber-600 dark:text-amber-400 hover:underline",
35880
+ className: "text-sm text-warning hover:underline",
35816
35881
  children: savedNote ? "\u2713 Answered \xB7 Edit" : "Answer this question"
35817
35882
  }
35818
35883
  )
@@ -36098,7 +36163,7 @@ function DataTable({
36098
36163
  )),
36099
36164
  rowActions && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3" })
36100
36165
  ] }) }),
36101
- /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
36166
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
36102
36167
  "td",
36103
36168
  {
36104
36169
  colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
@@ -36469,7 +36534,7 @@ var init_DetailPanel = __esm({
36469
36534
  };
36470
36535
  const effectiveFieldNames = isFieldDefArray(propFields) ? normalizeFieldDefs(propFields) : fieldNames;
36471
36536
  const fieldTypeMap = isFieldDefArray(propFields) ? buildFieldTypeMap(propFields) : {};
36472
- useCallback(
36537
+ const handleActionClick = useCallback(
36473
36538
  (action, data2) => {
36474
36539
  if (action.navigatesTo) {
36475
36540
  const url = action.navigatesTo.replace(
@@ -36661,8 +36726,9 @@ var init_DetailPanel = __esm({
36661
36726
  {
36662
36727
  variant: action.variant || "secondary",
36663
36728
  size: "sm",
36664
- action: action.event,
36729
+ action: action.navigatesTo ? void 0 : action.event,
36665
36730
  actionPayload: { row: normalizedData },
36731
+ onClick: action.navigatesTo ? () => handleActionClick(action, normalizedData) : void 0,
36666
36732
  icon: action.icon,
36667
36733
  "data-testid": action.event ? `action-${action.event}` : void 0,
36668
36734
  "data-row-id": normalizedData?.id !== void 0 ? String(normalizedData.id) : void 0,
@@ -38705,8 +38771,9 @@ var init_MediaGallery = __esm({
38705
38771
  )
38706
38772
  }
38707
38773
  ),
38708
- 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 }) }),
38709
- 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" }) })
38774
+ item.caption && // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: caption scrim over image
38775
+ /* @__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 }) }),
38776
+ 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" }) })
38710
38777
  ]
38711
38778
  },
38712
38779
  item.id
@@ -38735,7 +38802,7 @@ var init_MediaGallery = __esm({
38735
38802
  size: "sm",
38736
38803
  icon: X,
38737
38804
  action: "LIGHTBOX_CLOSE",
38738
- className: "text-white hover:bg-white/20"
38805
+ className: "text-foreground hover:bg-muted/50"
38739
38806
  }
38740
38807
  ) }),
38741
38808
  /* @__PURE__ */ jsx(
@@ -38746,7 +38813,7 @@ var init_MediaGallery = __esm({
38746
38813
  className: "max-w-full max-h-[80vh] object-contain rounded-md"
38747
38814
  }
38748
38815
  ),
38749
- lightboxItem.caption && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-white mt-3 text-center", children: lightboxItem.caption })
38816
+ lightboxItem.caption && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground mt-3 text-center", children: lightboxItem.caption })
38750
38817
  ]
38751
38818
  }
38752
38819
  )
@@ -39207,7 +39274,7 @@ function WalkMinimap() {
39207
39274
  {
39208
39275
  variant,
39209
39276
  size: "sm",
39210
- className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
39277
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-info" : ""}`,
39211
39278
  children: [
39212
39279
  isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
39213
39280
  " ",
@@ -39348,13 +39415,13 @@ function WalkMinimap() {
39348
39415
  })
39349
39416
  ] }) }),
39350
39417
  /* @__PURE__ */ jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
39351
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-green-500", children: [
39418
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-success", children: [
39352
39419
  "Engine: ",
39353
39420
  engineCount,
39354
39421
  "/",
39355
39422
  totalTransitions
39356
39423
  ] }),
39357
- domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-cyan-500", children: [
39424
+ domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-info", children: [
39358
39425
  "DOM: ",
39359
39426
  domCount
39360
39427
  ] }),
@@ -39387,13 +39454,13 @@ function TraitsTab({ traits: traits2 }) {
39387
39454
  const accordionItems = traits2.map((trait) => ({
39388
39455
  id: trait.id,
39389
39456
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
39390
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-purple-600 dark:text-purple-400", children: trait.name }),
39457
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-primary", children: trait.name }),
39391
39458
  /* @__PURE__ */ jsx(Badge, { variant: "success", size: "sm", children: trait.currentState }),
39392
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
39459
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
39393
39460
  ] }),
39394
39461
  content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
39395
39462
  /* @__PURE__ */ jsxs("div", { children: [
39396
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.states") }),
39463
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.states") }),
39397
39464
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: trait.states.map((state) => /* @__PURE__ */ jsx(
39398
39465
  Badge,
39399
39466
  {
@@ -39405,18 +39472,18 @@ function TraitsTab({ traits: traits2 }) {
39405
39472
  )) })
39406
39473
  ] }),
39407
39474
  trait.transitions.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39408
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.transitions") }),
39475
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.transitions") }),
39409
39476
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: trait.transitions.map((t2, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono", children: [
39410
39477
  t2.from,
39411
39478
  " \u2192 ",
39412
39479
  t2.to,
39413
39480
  " ",
39414
- /* @__PURE__ */ jsxs("span", { className: "text-gray-500", children: [
39481
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
39415
39482
  "(",
39416
39483
  t2.event,
39417
39484
  ")"
39418
39485
  ] }),
39419
- t2.guard && /* @__PURE__ */ jsxs("span", { className: "text-amber-500", children: [
39486
+ t2.guard && /* @__PURE__ */ jsxs("span", { className: "text-warning", children: [
39420
39487
  " [",
39421
39488
  t2.guard,
39422
39489
  "]"
@@ -39424,7 +39491,7 @@ function TraitsTab({ traits: traits2 }) {
39424
39491
  ] }, i)) })
39425
39492
  ] }),
39426
39493
  trait.guards.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39427
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.guards") }),
39494
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.guards") }),
39428
39495
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: trait.guards.map((g, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
39429
39496
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: g.name }),
39430
39497
  /* @__PURE__ */ jsx(Badge, { variant: g.lastResult === true ? "success" : g.lastResult === false ? "danger" : "default", size: "sm", children: g.lastResult === void 0 ? "?" : g.lastResult ? "\u2713" : "\u2717" })
@@ -39467,11 +39534,11 @@ function TicksTab({ ticks: ticks2 }) {
39467
39534
  };
39468
39535
  const TickCard = ({ tick, active }) => /* @__PURE__ */ jsxs(Card, { className: `p-3 ${!active ? "opacity-50" : ""}`, children: [
39469
39536
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
39470
- /* @__PURE__ */ jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-green-500" : "bg-gray-400"}` }),
39471
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: tick.name }),
39472
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: tick.traitName })
39537
+ /* @__PURE__ */ jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-success" : "bg-muted-foreground"}` }),
39538
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: tick.name }),
39539
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: tick.traitName })
39473
39540
  ] }),
39474
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-xs text-gray-500", children: [
39541
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-xs text-muted-foreground", children: [
39475
39542
  /* @__PURE__ */ jsxs("span", { children: [
39476
39543
  tick.interval,
39477
39544
  "ms"
@@ -39494,7 +39561,7 @@ function TicksTab({ ticks: ticks2 }) {
39494
39561
  ] });
39495
39562
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--ticks", children: [
39496
39563
  activeTicks.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
39497
- /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: [
39564
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
39498
39565
  "Active (",
39499
39566
  activeTicks.length,
39500
39567
  ")"
@@ -39502,7 +39569,7 @@ function TicksTab({ ticks: ticks2 }) {
39502
39569
  /* @__PURE__ */ jsx(Stack, { gap: "sm", children: activeTicks.map((tick) => /* @__PURE__ */ jsx(TickCard, { tick, active: true }, tick.id)) })
39503
39570
  ] }),
39504
39571
  inactiveTicks.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39505
- /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-400 mb-2", children: [
39572
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
39506
39573
  "Inactive (",
39507
39574
  inactiveTicks.length,
39508
39575
  ")"
@@ -39550,33 +39617,33 @@ function EntitiesTab({ snapshot }) {
39550
39617
  id: `singleton-${name}`,
39551
39618
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
39552
39619
  /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: t("debug.singleton") }),
39553
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: name })
39620
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: name })
39554
39621
  ] }),
39555
- 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) })
39622
+ 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) })
39556
39623
  }));
39557
39624
  const runtimeItems = runtimeEntities.slice(0, 20).map((entity) => ({
39558
39625
  id: entity.id,
39559
39626
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
39560
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: entity.type }),
39561
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-500", children: [
39627
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: entity.type }),
39628
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground", children: [
39562
39629
  "#",
39563
39630
  entity.id.slice(0, 8)
39564
39631
  ] })
39565
39632
  ] }),
39566
- 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) })
39633
+ 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) })
39567
39634
  }));
39568
39635
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--entities", children: [
39569
39636
  singletonItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
39570
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
39637
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
39571
39638
  /* @__PURE__ */ jsx(Accordion, { items: singletonItems, multiple: true })
39572
39639
  ] }),
39573
39640
  runtimeItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
39574
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
39641
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
39575
39642
  /* @__PURE__ */ jsx(Accordion, { items: runtimeItems, multiple: true }),
39576
- runtimeEntities.length > 20 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
39643
+ runtimeEntities.length > 20 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
39577
39644
  ] }),
39578
39645
  persistentEntries.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
39579
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.persistent") }),
39646
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.persistent") }),
39580
39647
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: persistentEntries.map(([type, info]) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
39581
39648
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: type }),
39582
39649
  /* @__PURE__ */ jsx(Badge, { variant: info.loaded ? "success" : "default", size: "sm", children: info.loaded ? t("debug.loadedCount", { count: info.count }) : t("debug.notLoaded") })
@@ -39661,7 +39728,7 @@ function EventFlowTab({ events: events2 }) {
39661
39728
  );
39662
39729
  })
39663
39730
  ] }),
39664
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 ml-auto cursor-pointer", children: [
39731
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto cursor-pointer", children: [
39665
39732
  /* @__PURE__ */ jsx(
39666
39733
  Checkbox,
39667
39734
  {
@@ -39676,18 +39743,18 @@ function EventFlowTab({ events: events2 }) {
39676
39743
  "div",
39677
39744
  {
39678
39745
  ref: containerRef,
39679
- className: "max-h-64 overflow-y-auto space-y-1 bg-gray-50 dark:bg-gray-800 rounded p-2",
39746
+ className: "max-h-64 overflow-y-auto space-y-1 bg-muted rounded p-2",
39680
39747
  children: filteredEvents.slice(-100).map((event) => {
39681
39748
  const { variant, icon } = TYPE_BADGES[event.type] || { variant: "default", icon: "\u2022" };
39682
39749
  return /* @__PURE__ */ jsxs(
39683
39750
  "div",
39684
39751
  {
39685
- className: "flex items-start gap-2 text-xs py-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded px-1",
39752
+ className: "flex items-start gap-2 text-xs py-1 hover:bg-muted/50 rounded px-1",
39686
39753
  children: [
39687
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
39754
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
39688
39755
  /* @__PURE__ */ jsx("span", { children: icon }),
39689
39756
  /* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "min-w-[60px] justify-center", children: event.source }),
39690
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-600 dark:text-gray-400", children: event.message })
39757
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: event.message })
39691
39758
  ]
39692
39759
  },
39693
39760
  event.id
@@ -39751,21 +39818,21 @@ function GuardsPanel({ guards }) {
39751
39818
  id: guard.id,
39752
39819
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
39753
39820
  /* @__PURE__ */ jsx(Badge, { variant: guard.result ? "success" : "danger", size: "sm", children: guard.result ? "\u2713" : "\u2717" }),
39754
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: guard.guardName }),
39755
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
39756
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: formatTime2(guard.timestamp) })
39821
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: guard.guardName }),
39822
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
39823
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: formatTime2(guard.timestamp) })
39757
39824
  ] }),
39758
39825
  content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
39759
39826
  /* @__PURE__ */ jsxs("div", { children: [
39760
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.expression") }),
39761
- /* @__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 })
39827
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.expression") }),
39828
+ /* @__PURE__ */ jsx("code", { className: "block mt-1 text-xs text-warning bg-warning/10 px-2 py-1 rounded", children: guard.expression })
39762
39829
  ] }),
39763
39830
  /* @__PURE__ */ jsxs("div", { children: [
39764
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.inputs") }),
39765
- /* @__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) })
39831
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.inputs") }),
39832
+ /* @__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) })
39766
39833
  ] }),
39767
39834
  /* @__PURE__ */ jsxs("div", { children: [
39768
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.trait") }),
39835
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.trait") }),
39769
39836
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: guard.context.traitName })
39770
39837
  ] })
39771
39838
  ] })
@@ -39821,7 +39888,7 @@ function VerificationTab({ checks, summary }) {
39821
39888
  (a, b) => (sortOrder[a.status] ?? 4) - (sortOrder[b.status] ?? 4)
39822
39889
  );
39823
39890
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--verification", children: [
39824
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-gray-50 dark:bg-gray-800 rounded", children: [
39891
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-muted rounded", children: [
39825
39892
  /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
39826
39893
  summary.passed,
39827
39894
  " passed"
@@ -39838,7 +39905,7 @@ function VerificationTab({ checks, summary }) {
39838
39905
  summary.pending,
39839
39906
  " pending"
39840
39907
  ] }),
39841
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: [
39908
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: [
39842
39909
  summary.totalChecks,
39843
39910
  " total checks"
39844
39911
  ] })
@@ -39848,12 +39915,12 @@ function VerificationTab({ checks, summary }) {
39848
39915
  return /* @__PURE__ */ jsxs(
39849
39916
  "div",
39850
39917
  {
39851
- className: "flex items-start gap-2 p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800",
39918
+ className: "flex items-start gap-2 p-2 rounded hover:bg-muted/50",
39852
39919
  children: [
39853
39920
  /* @__PURE__ */ jsx(Badge, { variant: config.variant, size: "sm", className: "min-w-[20px] justify-center mt-0.5", children: config.icon }),
39854
39921
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
39855
39922
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "break-words", children: check.label }),
39856
- check.details && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 break-words", children: check.details })
39923
+ check.details && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground break-words", children: check.details })
39857
39924
  ] }),
39858
39925
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs shrink-0", children: new Date(check.updatedAt).toLocaleTimeString("en-US", {
39859
39926
  hour12: false,
@@ -39888,10 +39955,10 @@ var init_VerificationTab = __esm({
39888
39955
  function EffectBadge({ effect }) {
39889
39956
  const variant = EFFECT_STATUS_VARIANT[effect.status] || "default";
39890
39957
  const icon = effect.status === "executed" ? "\u2713" : effect.status === "failed" ? "\u2717" : "-";
39891
- 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: [
39958
+ 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: [
39892
39959
  /* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "!text-[9px] !px-1 !py-0", children: icon }),
39893
- /* @__PURE__ */ jsx("span", { className: "text-gray-600 dark:text-gray-400", children: effect.type }),
39894
- effect.error && /* @__PURE__ */ jsx("span", { className: "text-red-500 truncate max-w-[120px]", title: effect.error, children: effect.error })
39960
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: effect.type }),
39961
+ effect.error && /* @__PURE__ */ jsx("span", { className: "text-error truncate max-w-[120px]", title: effect.error, children: effect.error })
39895
39962
  ] });
39896
39963
  }
39897
39964
  function TransitionTimeline({ transitions }) {
@@ -39926,8 +39993,8 @@ function TransitionTimeline({ transitions }) {
39926
39993
  const sorted = [...transitions].reverse();
39927
39994
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--timeline", children: [
39928
39995
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
39929
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
39930
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 cursor-pointer", children: [
39996
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
39997
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", children: [
39931
39998
  /* @__PURE__ */ jsx(
39932
39999
  Checkbox,
39933
40000
  {
@@ -39952,22 +40019,22 @@ function TransitionTimeline({ transitions }) {
39952
40019
  {
39953
40020
  className: `
39954
40021
  relative pl-6 pb-3 border-l-2 cursor-pointer
39955
- hover:bg-gray-50 dark:hover:bg-gray-800 rounded-r
39956
- ${hasFailedEffects ? "border-red-300 dark:border-red-700" : "border-gray-200 dark:border-gray-700"}
40022
+ hover:bg-muted/50 rounded-r
40023
+ ${hasFailedEffects ? "border-error" : "border-border"}
39957
40024
  `,
39958
40025
  onClick: () => setExpandedId(isExpanded ? null : trace.id),
39959
40026
  children: [
39960
40027
  /* @__PURE__ */ jsx("div", { className: `
39961
40028
  absolute left-[-5px] top-1 w-2 h-2 rounded-full
39962
- ${hasFailedEffects ? "bg-red-500" : allPassed ? "bg-green-500" : "bg-gray-400"}
40029
+ ${hasFailedEffects ? "bg-error" : allPassed ? "bg-success" : "bg-muted-foreground"}
39963
40030
  ` }),
39964
40031
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs py-1 px-2", children: [
39965
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40032
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
39966
40033
  /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "min-w-[60px] justify-center", children: trace.traitName }),
39967
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-gray-600 dark:text-gray-400", children: [
40034
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-muted-foreground", children: [
39968
40035
  trace.from,
39969
40036
  " ",
39970
- /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: "\u2192" }),
40037
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50", children: "\u2192" }),
39971
40038
  " ",
39972
40039
  trace.to
39973
40040
  ] }),
@@ -39984,9 +40051,9 @@ function TransitionTimeline({ transitions }) {
39984
40051
  ]
39985
40052
  }
39986
40053
  ),
39987
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40054
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
39988
40055
  ] }),
39989
- 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: [
40056
+ 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: [
39990
40057
  /* @__PURE__ */ jsx(EffectBadge, { effect }),
39991
40058
  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) }),
39992
40059
  effect.durationMs !== void 0 && /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
@@ -40020,8 +40087,8 @@ var init_TransitionTimeline = __esm({
40020
40087
  }
40021
40088
  });
40022
40089
  function StatRow({ label, value, variant }) {
40023
- 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: [
40024
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: label }),
40090
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1.5 border-b border-border last:border-b-0", children: [
40091
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: label }),
40025
40092
  variant ? /* @__PURE__ */ jsx(Badge, { variant, size: "sm", children: String(value) }) : /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "font-mono", children: String(value) })
40026
40093
  ] });
40027
40094
  }
@@ -40050,7 +40117,7 @@ function ServerBridgeTab({ bridge }) {
40050
40117
  return /* @__PURE__ */ jsx("div", { className: "debug-tab debug-tab--bridge", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
40051
40118
  /* @__PURE__ */ jsxs(Card, { className: "p-3", children: [
40052
40119
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3", children: [
40053
- /* @__PURE__ */ jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-green-500 animate-pulse" : "bg-red-500"}` }),
40120
+ /* @__PURE__ */ jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-success animate-pulse" : "bg-error"}` }),
40054
40121
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: bridge.connected ? t("debug.connected") : t("debug.disconnected") })
40055
40122
  ] }),
40056
40123
  /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
@@ -40085,11 +40152,11 @@ function ServerBridgeTab({ bridge }) {
40085
40152
  )
40086
40153
  ] })
40087
40154
  ] }),
40088
- bridge.lastError && /* @__PURE__ */ jsxs(Card, { className: "p-3 border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950", children: [
40089
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "text-red-600 dark:text-red-400 mb-1", children: t("debug.lastError") }),
40090
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-500 font-mono break-all", children: bridge.lastError })
40155
+ bridge.lastError && /* @__PURE__ */ jsxs(Card, { className: "p-3 border-error/30 bg-error/10", children: [
40156
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "text-error mb-1", children: t("debug.lastError") }),
40157
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error font-mono break-all", children: bridge.lastError })
40091
40158
  ] }),
40092
- 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 }) }) })
40159
+ 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 }) }) })
40093
40160
  ] }) });
40094
40161
  }
40095
40162
  var init_ServerBridgeTab = __esm({
@@ -40215,7 +40282,7 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40215
40282
  };
40216
40283
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--dispatch", children: [
40217
40284
  /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40218
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.activeStates") }),
40285
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.activeStates") }),
40219
40286
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: traits2.map((trait) => /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
40220
40287
  trait.name,
40221
40288
  ": ",
@@ -40223,8 +40290,8 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40223
40290
  ] }, trait.id)) })
40224
40291
  ] }),
40225
40292
  /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40226
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.availableEvents") }),
40227
- 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: [
40293
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.availableEvents") }),
40294
+ 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: [
40228
40295
  /* @__PURE__ */ jsx(
40229
40296
  Button,
40230
40297
  {
@@ -40235,22 +40302,22 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40235
40302
  children: event
40236
40303
  }
40237
40304
  ),
40238
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40305
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40239
40306
  transitions.some((tr) => tr.guard) && /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", children: t("debug.guarded") })
40240
40307
  ] }, event)) })
40241
40308
  ] }),
40242
40309
  unavailableEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40243
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
40310
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.otherEvents") }),
40244
40311
  /* @__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)) })
40245
40312
  ] }),
40246
40313
  log9.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40247
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
40314
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.recentTransitions") }),
40248
40315
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log9.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
40249
- /* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
40316
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: entry.traitName }),
40250
40317
  " ",
40251
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
40318
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: entry.from }),
40252
40319
  " -> ",
40253
- /* @__PURE__ */ jsx("span", { className: "text-green-400", children: entry.to })
40320
+ /* @__PURE__ */ jsx("span", { className: "text-success", children: entry.to })
40254
40321
  ] }, i)) })
40255
40322
  ] })
40256
40323
  ] });
@@ -40276,21 +40343,21 @@ var init_RuntimeDebugger = __esm({
40276
40343
  function ServerResponseRow({ sr }) {
40277
40344
  const { t } = useTranslate();
40278
40345
  const entityEntries = Object.entries(sr.dataEntities);
40279
- return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-xs font-mono", children: [
40346
+ return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-primary py-0.5 text-xs font-mono", children: [
40280
40347
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40281
- /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
40348
+ /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-success" : "text-error", children: [
40282
40349
  sr.success ? "\u2713" : "\u2717",
40283
40350
  " ",
40284
40351
  t("debug.server")
40285
40352
  ] }),
40286
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
40287
- 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 }) }),
40288
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
40353
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: sr.orbitalName }),
40354
+ sr.clientEffects > 0 && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-primary/10 text-primary", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
40355
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-primary/10 text-primary", children: [
40289
40356
  t("debug.emitLabel"),
40290
40357
  " ",
40291
40358
  sr.emittedEvents.join(", ")
40292
40359
  ] }),
40293
- 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 })
40360
+ sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-error/10 text-error truncate max-w-[300px]", children: sr.error })
40294
40361
  ] }),
40295
40362
  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: [
40296
40363
  name,
@@ -40306,9 +40373,9 @@ function TransitionRow({ trace }) {
40306
40373
  if (isServerEntry && trace.serverResponse) {
40307
40374
  return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
40308
40375
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
40309
- /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
40376
+ /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-primary" }),
40310
40377
  /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
40311
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: t("debug.serverResponse") })
40378
+ /* @__PURE__ */ jsx("span", { className: "text-primary flex-shrink-0", children: t("debug.serverResponse") })
40312
40379
  ] }),
40313
40380
  /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
40314
40381
  ] });
@@ -40317,7 +40384,7 @@ function TransitionRow({ trace }) {
40317
40384
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
40318
40385
  /* @__PURE__ */ jsx("span", { className: cn(
40319
40386
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
40320
- hasFailedEffects ? "bg-red-500" : "bg-green-500"
40387
+ hasFailedEffects ? "bg-error" : "bg-success"
40321
40388
  ) }),
40322
40389
  /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
40323
40390
  /* @__PURE__ */ jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
@@ -40331,7 +40398,7 @@ function TransitionRow({ trace }) {
40331
40398
  ] }),
40332
40399
  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(
40333
40400
  "px-1 rounded text-xs",
40334
- 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"
40401
+ eff.status === "executed" ? "bg-success/10 text-success" : eff.status === "failed" ? "bg-error/10 text-error" : "bg-warning/10 text-warning"
40335
40402
  ), children: [
40336
40403
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
40337
40404
  " ",
@@ -40365,7 +40432,7 @@ function VerifyModePanel({
40365
40432
  {
40366
40433
  className: cn(
40367
40434
  "runtime-debugger runtime-debugger--verify",
40368
- "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
40435
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-accent",
40369
40436
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
40370
40437
  className
40371
40438
  ),
@@ -40386,8 +40453,8 @@ function VerifyModePanel({
40386
40453
  /* @__PURE__ */ jsx("span", { className: "text-foreground/50 w-3", "aria-hidden": true, children: expanded ? "\u25BE" : "\u25B8" }),
40387
40454
  /* @__PURE__ */ jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? t("debug.failCount", { count: failedChecks }) : t("debug.ok") }),
40388
40455
  /* @__PURE__ */ jsx("span", { className: "text-foreground/70", children: t("debug.localCount", { count: localCount }) }),
40389
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400", children: t("debug.serverCount", { count: serverCount }) }),
40390
- traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates }),
40456
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: t("debug.serverCount", { count: serverCount }) }),
40457
+ traitStates && /* @__PURE__ */ jsx("span", { className: "text-accent truncate max-w-[400px]", children: traitStates }),
40391
40458
  !expanded && transitions.length > 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-foreground/50", children: t("debug.transitionsCount", { count: transitions.length }) })
40392
40459
  ]
40393
40460
  }
@@ -40582,7 +40649,7 @@ function RuntimeDebugger({
40582
40649
  title: t("debug.openDebugger"),
40583
40650
  children: failedChecks > 0 ? /* @__PURE__ */ jsxs("span", { className: "relative", children: [
40584
40651
  /* @__PURE__ */ jsx("span", { children: "V" }),
40585
- /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-red-500 rounded-full" })
40652
+ /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-error rounded-full" })
40586
40653
  ] }) : /* @__PURE__ */ jsx("span", { children: "V" })
40587
40654
  }
40588
40655
  ) : /* @__PURE__ */ jsxs(Card, { className: "runtime-debugger__panel", children: [
@@ -40670,7 +40737,7 @@ var init_SegmentRenderer = __esm({
40670
40737
  "div",
40671
40738
  {
40672
40739
  className: cn(
40673
- "border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
40740
+ "border border-border rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
40674
40741
  containerClassName,
40675
40742
  className
40676
40743
  ),
@@ -44253,6 +44320,14 @@ function createSharedEntityWriter(binding, tick, traitStatesRef, emit) {
44253
44320
  return writes;
44254
44321
  };
44255
44322
  }
44323
+ function containsConfigForward(value) {
44324
+ if (typeof value === "string") return value.startsWith("@config.");
44325
+ if (Array.isArray(value)) return value.some(containsConfigForward);
44326
+ if (value !== null && typeof value === "object") {
44327
+ return Object.values(value).some(containsConfigForward);
44328
+ }
44329
+ return false;
44330
+ }
44256
44331
  function getBindingConfig(binding) {
44257
44332
  const raw = binding.config;
44258
44333
  const normalized = normalizeCallSiteConfigToValues(raw);
@@ -44605,7 +44680,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
44605
44680
  const sharedCallSite = sharedCallSiteRaw ? resolveCallSitePayloadCaptures(
44606
44681
  Object.fromEntries(
44607
44682
  Object.entries(sharedCallSiteRaw).filter(
44608
- ([, v]) => !(typeof v === "string" && v.startsWith("@config."))
44683
+ ([, v]) => !containsConfigForward(v)
44609
44684
  )
44610
44685
  ),
44611
44686
  payload || {}
@@ -44670,7 +44745,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
44670
44745
  const callSiteOverrides = callSiteConfig ? resolveCallSitePayloadCaptures(
44671
44746
  Object.fromEntries(
44672
44747
  Object.entries(callSiteConfig).filter(
44673
- ([, v]) => !(typeof v === "string" && v.startsWith("@config."))
44748
+ ([, v]) => !containsConfigForward(v)
44674
44749
  )
44675
44750
  ),
44676
44751
  payload || {}
@@ -44912,7 +44987,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
44912
44987
  }
44913
44988
  return () => scheduler.stopAll();
44914
44989
  }, [traitBindings, runTickEffects, sharedGroups, sharedEntityStore, emitFromSharedWriter]);
44915
- const processEventQueued = useCallback(async (eventKey, payload) => {
44990
+ const processEventQueued = useCallback(async (eventKey, payload, targetTrait) => {
44916
44991
  const normalizedEvent = normalizeEventKey(eventKey);
44917
44992
  const bindings = traitBindingsRef.current;
44918
44993
  const currentManager = managerRef.current;
@@ -44941,7 +45016,9 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
44941
45016
  normalizedEvent,
44942
45017
  payload,
44943
45018
  void 0,
44944
- entityByTrait
45019
+ entityByTrait,
45020
+ void 0,
45021
+ targetTrait
44945
45022
  );
44946
45023
  crossTraitLog.debug("processEvent:results", {
44947
45024
  event: normalizedEvent,
@@ -45034,8 +45111,11 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45034
45111
  const effectTraces = result.effects.map(
45035
45112
  (e) => {
45036
45113
  if (Array.isArray(e)) {
45114
+ const head = String(e[0] ?? "unknown");
45115
+ const entityName = head === "fetch" && typeof e[1] === "string" ? e[1] : head === "persist" && typeof e[2] === "string" ? e[2] : void 0;
45037
45116
  return {
45038
- type: String(e[0] ?? "unknown"),
45117
+ type: head,
45118
+ ...entityName !== void 0 ? { entityName } : {},
45039
45119
  args: e.slice(1),
45040
45120
  status: "executed"
45041
45121
  };
@@ -45088,7 +45168,8 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45088
45168
  const orbital = orbitalsByTrait?.[traitName];
45089
45169
  if (orbital) dispatchedOrbitals.add(orbital);
45090
45170
  }
45091
- await onEventProcessed(normalizedEvent, payload, dispatchedOrbitals);
45171
+ const relayPayload = targetTrait !== void 0 ? { ...payload ?? {}, _targetTrait: targetTrait } : payload;
45172
+ await onEventProcessed(normalizedEvent, relayPayload, dispatchedOrbitals);
45092
45173
  }
45093
45174
  }, [entities, eventBus, sharedEntityStore]);
45094
45175
  const drainEventQueue = useCallback(async () => {
@@ -45097,14 +45178,14 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45097
45178
  try {
45098
45179
  while (eventQueueRef.current.length > 0) {
45099
45180
  const entry = eventQueueRef.current.shift();
45100
- await processEventQueued(entry.eventKey, entry.payload);
45181
+ await processEventQueued(entry.eventKey, entry.payload, entry.targetTrait);
45101
45182
  }
45102
45183
  } finally {
45103
45184
  processingRef.current = false;
45104
45185
  }
45105
45186
  }, [processEventQueued]);
45106
- const enqueueAndDrain = useCallback((eventKey, payload) => {
45107
- eventQueueRef.current.push({ eventKey, payload });
45187
+ const enqueueAndDrain = useCallback((eventKey, payload, targetTrait) => {
45188
+ eventQueueRef.current.push({ eventKey, payload, targetTrait });
45108
45189
  void drainEventQueue();
45109
45190
  }, [drainEventQueue]);
45110
45191
  useCallback((eventKey, payload) => {
@@ -45201,7 +45282,11 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45201
45282
  crossTraitLog.debug("listen:subscribed", { busKey, targetTrait: binding.trait.name, sourceOrbital, sourceTrait, listenEvent: listen.event, triggers: listen.triggers });
45202
45283
  const unsub = eventBus.on(busKey, (event) => {
45203
45284
  crossTraitLog.debug("listen:fired", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
45204
- enqueueAndDrain(listen.triggers, event.payload);
45285
+ enqueueAndDrain(
45286
+ listen.triggers,
45287
+ applyListenPayloadMapping(listen.payloadMapping, event.payload),
45288
+ binding.trait.name
45289
+ );
45205
45290
  });
45206
45291
  unsubscribes.push(() => {
45207
45292
  crossTraitLog.debug("listen:unsubscribe", { busKey, targetTrait: binding.trait.name, triggers: listen.triggers });
@@ -45231,7 +45316,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
45231
45316
  }
45232
45317
  for (const event of eventsToFire) {
45233
45318
  stateLog.debug("mount:fire-lifecycle", { event, traitCount: traitBindings.length });
45234
- enqueueAndDrain(event, {});
45319
+ enqueueAndDrain(event, { ...optionsRef.current?.initPayload ?? {} });
45235
45320
  }
45236
45321
  return () => {
45237
45322
  initedTraitsRef.current = /* @__PURE__ */ new Set();
@@ -45272,7 +45357,9 @@ function useResolvedSchema(schema, pageName) {
45272
45357
  trait.listens = callSiteListens.map((l) => ({
45273
45358
  event: l.event,
45274
45359
  triggers: l.triggers,
45275
- source: l.source
45360
+ source: l.source,
45361
+ guard: l.guard,
45362
+ payloadMapping: l.payloadMapping
45276
45363
  }));
45277
45364
  resolvedSchemaLog.info("listens:restored", {
45278
45365
  trait: traitName,
@@ -45431,7 +45518,7 @@ function collectServerActiveTraits(ir, allTraits, mountedTraitNames) {
45431
45518
  }
45432
45519
  return active;
45433
45520
  }
45434
- function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, serverActiveTraits }) {
45521
+ function TraitInitializer({ traits: traits2, routeParams, orbitalNames, onNavigate, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, serverActiveTraits }) {
45435
45522
  const bridge = useServerBridge();
45436
45523
  const activeTraitNames = useMemo(
45437
45524
  () => new Set(traits2.map((b) => b.trait.name).filter((n) => !!n)),
@@ -45460,43 +45547,48 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
45460
45547
  applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits, activeTraitNames);
45461
45548
  }
45462
45549
  }, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, embeddedTraits, activeTraitNames, withActiveTraits]);
45463
- const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait, embeddedTraits } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits };
45550
+ const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait, embeddedTraits, initPayload: routeParams } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits, initPayload: routeParams };
45464
45551
  const { sendEvent } = useTraitStateMachine(traits2, uiSlots, opts);
45465
45552
  const initSentRef = useRef(false);
45466
45553
  const prevTraitsRef = useRef(void 0);
45554
+ const paramsKey = JSON.stringify(routeParams ?? {});
45555
+ const prevParamsKeyRef = useRef(void 0);
45467
45556
  useEffect(() => {
45468
45557
  const refChanged = prevTraitsRef.current !== void 0 && prevTraitsRef.current !== traits2;
45558
+ const paramsChanged = prevParamsKeyRef.current !== void 0 && prevParamsKeyRef.current !== paramsKey;
45469
45559
  navLog.debug("page:traits-effect", () => ({
45470
45560
  refChanged,
45561
+ paramsChanged,
45471
45562
  traitsCount: Array.isArray(traits2) ? traits2.length : -1,
45472
45563
  hadPrev: prevTraitsRef.current !== void 0
45473
45564
  }));
45474
- if (refChanged) {
45475
- navLog.info("page:traits-reset", { traitsCount: Array.isArray(traits2) ? traits2.length : -1 });
45565
+ if (refChanged || paramsChanged) {
45566
+ navLog.info("page:traits-reset", { traitsCount: Array.isArray(traits2) ? traits2.length : -1, paramsChanged });
45476
45567
  uiSlots.clearAll();
45477
45568
  initSentRef.current = false;
45478
45569
  }
45479
45570
  prevTraitsRef.current = traits2;
45480
- }, [traits2, uiSlots]);
45571
+ prevParamsKeyRef.current = paramsKey;
45572
+ }, [traits2, uiSlots, paramsKey]);
45481
45573
  useEffect(() => {
45482
45574
  if (!orbitalNames?.length) {
45483
- const t = setTimeout(() => sendEvent("INIT"), 50);
45575
+ const t = setTimeout(() => sendEvent("INIT", routeParams), 50);
45484
45576
  return () => clearTimeout(t);
45485
45577
  }
45486
45578
  const fallback = setTimeout(() => {
45487
45579
  if (!initSentRef.current) {
45488
- sendEvent("INIT");
45580
+ sendEvent("INIT", routeParams);
45489
45581
  onLocalFallback?.();
45490
45582
  }
45491
45583
  }, 5e3);
45492
45584
  return () => clearTimeout(fallback);
45493
- }, [traits2, orbitalNames, sendEvent, onLocalFallback]);
45585
+ }, [traits2, orbitalNames, sendEvent, onLocalFallback, routeParams]);
45494
45586
  useEffect(() => {
45495
45587
  if (!bridge.connected || !orbitalNames?.length || initSentRef.current) return;
45496
45588
  initSentRef.current = true;
45497
45589
  (async () => {
45498
45590
  for (const name of orbitalNames) {
45499
- const { effects, meta } = await bridge.sendEvent(name, "INIT", withActiveTraits({}));
45591
+ const { effects, meta } = await bridge.sendEvent(name, "INIT", withActiveTraits({ ...routeParams ?? {} }));
45500
45592
  recordServerResponse(name, "INIT", meta);
45501
45593
  const effectTraces = [
45502
45594
  { type: "fetch", args: [], status: "executed" },
@@ -45517,10 +45609,10 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
45517
45609
  applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits, activeTraitNames);
45518
45610
  }
45519
45611
  })();
45520
- }, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate, embeddedTraits, activeTraitNames, withActiveTraits]);
45612
+ }, [bridge.connected, orbitalNames, bridge.sendEvent, uiSlots, onNavigate, embeddedTraits, activeTraitNames, withActiveTraits, routeParams]);
45521
45613
  return null;
45522
45614
  }
45523
- function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavigate, onLocalFallback, persistence }) {
45615
+ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, routeParams, onNavigate, onLocalFallback, persistence }) {
45524
45616
  const { traits: traits2, allEntities, allTraits, ir } = useResolvedSchema(schema, pageName);
45525
45617
  const allPageTraits = useMemo(() => {
45526
45618
  let base;
@@ -45662,6 +45754,7 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
45662
45754
  TraitInitializer,
45663
45755
  {
45664
45756
  traits: allPageTraits,
45757
+ routeParams,
45665
45758
  orbitalNames: serverUrl || transport ? pageOrbitalNames : void 0,
45666
45759
  traitConfigsByName,
45667
45760
  orbitalsByTrait,
@@ -45739,27 +45832,44 @@ function OrbPreview({
45739
45832
  return [];
45740
45833
  }
45741
45834
  }, [parsedSchema]);
45742
- const initialPageName = useMemo(() => {
45835
+ const initialPageMatch = useMemo(() => {
45743
45836
  if (!initialPagePath) return void 0;
45744
- const match = pages.find(({ page }) => page.path === initialPagePath);
45745
- return match?.page.name;
45837
+ for (const { page } of pages) {
45838
+ const params = page.path ? matchPath(page.path, initialPagePath) : null;
45839
+ if (params !== null) return { name: page.name, params };
45840
+ }
45841
+ return void 0;
45746
45842
  }, [pages, initialPagePath]);
45843
+ const initialPageName = initialPageMatch?.name;
45747
45844
  const [currentPage, setCurrentPage] = useState(initialPageName);
45845
+ const [routeParams, setRouteParams] = useState(initialPageMatch?.params ?? {});
45748
45846
  const prevInitialPagePathRef = useRef(initialPagePath);
45749
45847
  useEffect(() => {
45750
45848
  if (prevInitialPagePathRef.current !== initialPagePath) {
45751
45849
  prevInitialPagePathRef.current = initialPagePath;
45752
45850
  setCurrentPage(initialPageName);
45851
+ setRouteParams(initialPageMatch?.params ?? {});
45753
45852
  }
45754
- }, [initialPagePath, initialPageName]);
45853
+ }, [initialPagePath, initialPageName, initialPageMatch]);
45755
45854
  const handleNavigate = useCallback((path) => {
45756
- const match = pages.find(({ page }) => page.path === path);
45855
+ let match;
45856
+ let params = {};
45857
+ for (const entry of pages) {
45858
+ const m = entry.page.path ? matchPath(entry.page.path, path) : null;
45859
+ if (m !== null) {
45860
+ match = entry;
45861
+ params = m;
45862
+ break;
45863
+ }
45864
+ }
45757
45865
  navLog.debug("handleNavigate", () => ({
45758
45866
  path,
45759
45867
  matched: match?.page.name ?? null,
45868
+ params,
45760
45869
  availablePaths: pages.map((p) => p.page.path)
45761
45870
  }));
45762
- if (match) {
45871
+ if (match?.page.name) {
45872
+ setRouteParams(params);
45763
45873
  setCurrentPage(match.page.name);
45764
45874
  if (typeof window !== "undefined") {
45765
45875
  const url = new URL(window.location.href);
@@ -45769,6 +45879,15 @@ function OrbPreview({
45769
45879
  }
45770
45880
  }
45771
45881
  }, [pages]);
45882
+ useEffect(() => {
45883
+ const unsubscribe = eventBus.on("UI:NAVIGATE", (event) => {
45884
+ const url = event.payload?.url;
45885
+ if (typeof url === "string" && url.length > 0) {
45886
+ handleNavigate(url);
45887
+ }
45888
+ });
45889
+ return unsubscribe;
45890
+ }, [eventBus, handleNavigate]);
45772
45891
  if (!parseResult.ok) {
45773
45892
  return /* @__PURE__ */ jsx(Box, { className, style: { height }, children: /* @__PURE__ */ jsxs(Typography, { as: "pre", color: "error", variant: "small", className: "font-mono whitespace-pre-wrap break-all m-0 p-4", children: [
45774
45893
  "Parse error: ",
@@ -45820,6 +45939,7 @@ function OrbPreview({
45820
45939
  transport,
45821
45940
  mockData: effectiveMockData,
45822
45941
  pageName: currentPage,
45942
+ routeParams,
45823
45943
  onNavigate: handleNavigate,
45824
45944
  onLocalFallback: handleLocalFallback,
45825
45945
  persistence