@almadar/ui 2.43.0 → 2.45.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.
@@ -733,6 +733,9 @@ function useEntityDefinition(entityName) {
733
733
  const { entities } = useEntitySchema();
734
734
  return entities.get(entityName);
735
735
  }
736
+ function useEntitySchemaOptional() {
737
+ return useContext(EntitySchemaContext);
738
+ }
736
739
 
737
740
  // lib/traitRegistry.ts
738
741
  var traits = /* @__PURE__ */ new Map();
@@ -5534,9 +5537,9 @@ var shapeMap = {
5534
5537
  square: "rounded-md"
5535
5538
  };
5536
5539
  var variantMap = {
5537
- primary: "bg-blue-600 text-white border-blue-400 hover:bg-blue-500",
5538
- secondary: "bg-gray-700 text-white border-gray-500 hover:bg-gray-600",
5539
- ghost: "bg-transparent text-white border-white/30 hover:bg-white/10"
5540
+ primary: "bg-blue-600 text-[var(--color-foreground)] border-blue-400 hover:bg-blue-500",
5541
+ secondary: "bg-[var(--color-surface,#374151)] text-[var(--color-foreground)] border-gray-500 hover:bg-gray-600",
5542
+ ghost: "bg-transparent text-[var(--color-foreground)] border-white/30 hover:bg-white/10"
5540
5543
  };
5541
5544
  function ControlButton({
5542
5545
  label,
@@ -5765,11 +5768,11 @@ function TimerDisplay({
5765
5768
  {
5766
5769
  className: cn(
5767
5770
  "inline-flex items-center justify-center rounded-lg",
5768
- "bg-gray-800/80 border border-gray-600 font-mono font-bold tabular-nums",
5771
+ "bg-[var(--color-card)]/80 border border-gray-600 font-mono font-bold tabular-nums",
5769
5772
  sizeMap4[size],
5770
5773
  running && "border-green-500/50",
5771
5774
  isLow && "text-red-400 border-red-500/50 animate-pulse",
5772
- !isLow && "text-white",
5775
+ !isLow && "text-[var(--color-foreground)]",
5773
5776
  className
5774
5777
  ),
5775
5778
  children: formatTime(seconds, format)
@@ -5797,7 +5800,7 @@ function ResourceCounter({
5797
5800
  {
5798
5801
  className: cn(
5799
5802
  "inline-flex items-center rounded-md",
5800
- "bg-gray-800/80 border border-gray-600 font-medium text-white",
5803
+ "bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
5801
5804
  sizes.wrapper,
5802
5805
  className
5803
5806
  ),
@@ -5856,9 +5859,9 @@ function ItemSlot({
5856
5859
  title: label,
5857
5860
  className: cn(
5858
5861
  "relative flex items-center justify-center rounded-lg border-2",
5859
- "bg-gray-800/80 transition-all duration-150",
5862
+ "bg-[var(--color-card)]/80 transition-all duration-150",
5860
5863
  sizeMap6[size],
5861
- empty ? "border-gray-700 bg-gray-900/50" : rarityBorderMap[rarity],
5864
+ empty ? "border-gray-700 bg-[var(--color-card)]/50" : rarityBorderMap[rarity],
5862
5865
  !empty && rarityGlowMap[rarity],
5863
5866
  selected && "ring-2 ring-white ring-offset-1 ring-offset-gray-900",
5864
5867
  isClickable && !empty && "hover:brightness-125 cursor-pointer",
@@ -5874,7 +5877,7 @@ function ItemSlot({
5874
5877
  className: cn(
5875
5878
  "absolute -bottom-1 -right-1 flex items-center justify-center",
5876
5879
  "min-w-[18px] h-[18px] rounded-full px-1",
5877
- "bg-gray-700 border border-gray-500 text-[10px] font-bold text-white"
5880
+ "bg-[var(--color-surface,#374151)] border border-gray-500 text-[10px] font-bold text-[var(--color-foreground)]"
5878
5881
  ),
5879
5882
  children: quantity
5880
5883
  }
@@ -5903,7 +5906,7 @@ function TurnIndicator({
5903
5906
  {
5904
5907
  className: cn(
5905
5908
  "inline-flex items-center rounded-lg",
5906
- "bg-gray-800/80 border border-gray-600 font-medium text-white",
5909
+ "bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
5907
5910
  sizes.wrapper,
5908
5911
  className
5909
5912
  ),
@@ -5939,7 +5942,7 @@ function getComboIntensity(combo) {
5939
5942
  if (combo >= 10) return "text-red-400 animate-pulse";
5940
5943
  if (combo >= 7) return "text-orange-400";
5941
5944
  if (combo >= 4) return "text-yellow-400";
5942
- return "text-white";
5945
+ return "text-[var(--color-foreground)]";
5943
5946
  }
5944
5947
  function getComboScale(combo) {
5945
5948
  if (combo >= 10) return "scale-110";
@@ -5960,7 +5963,7 @@ function ComboCounter({
5960
5963
  {
5961
5964
  className: cn(
5962
5965
  "inline-flex flex-col items-center justify-center",
5963
- "rounded-xl bg-gray-800/80 border border-gray-600 px-3 py-1.5",
5966
+ "rounded-xl bg-[var(--color-card)]/80 border border-gray-600 px-3 py-1.5",
5964
5967
  "transition-transform duration-200",
5965
5968
  getComboScale(combo),
5966
5969
  className
@@ -6161,7 +6164,7 @@ function StatusEffect({
6161
6164
  "span",
6162
6165
  {
6163
6166
  className: cn(
6164
- "absolute flex items-center justify-center rounded-full bg-white text-black font-bold leading-none",
6167
+ "absolute flex items-center justify-center rounded-full bg-[var(--color-card)] text-[var(--color-foreground)] font-bold leading-none",
6165
6168
  sizes.badge
6166
6169
  ),
6167
6170
  children: stacks
@@ -6240,7 +6243,7 @@ function DialogueBubble({
6240
6243
  ) }),
6241
6244
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
6242
6245
  speaker && /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-yellow-400", children: speaker }),
6243
- /* @__PURE__ */ jsx("span", { className: "text-sm text-white leading-relaxed", children: text })
6246
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-[var(--color-foreground)] leading-relaxed", children: text })
6244
6247
  ] })
6245
6248
  ]
6246
6249
  }
@@ -6264,7 +6267,7 @@ function ChoiceButton({
6264
6267
  className: cn(
6265
6268
  "w-full text-left px-4 py-2.5 rounded-md border transition-all duration-150",
6266
6269
  "flex items-center gap-2",
6267
- selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-white hover:bg-white/10 hover:border-white/30",
6270
+ selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-[var(--color-foreground)] hover:bg-white/10 hover:border-white/30",
6268
6271
  disabled && "opacity-40 cursor-not-allowed hover:bg-white/5 hover:border-white/10",
6269
6272
  className
6270
6273
  ),
@@ -6320,7 +6323,7 @@ function ActionButton({
6320
6323
  disabled: isDisabled,
6321
6324
  onClick,
6322
6325
  className: cn(
6323
- "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-white overflow-hidden transition-colors duration-150",
6326
+ "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-[var(--color-foreground)] overflow-hidden transition-colors duration-150",
6324
6327
  sizes.button,
6325
6328
  variantStyles7[variant],
6326
6329
  isDisabled && "opacity-60 cursor-not-allowed",
@@ -8273,11 +8276,11 @@ var AuthLayout = ({
8273
8276
  children: [
8274
8277
  /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
8275
8278
  /* @__PURE__ */ jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-3", children: [
8276
- logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
8279
+ 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(
8277
8280
  Typography,
8278
8281
  {
8279
8282
  variant: "body1",
8280
- className: "text-white font-bold text-lg",
8283
+ className: "text-[var(--color-foreground)] font-bold text-lg",
8281
8284
  children: appName.charAt(0).toUpperCase()
8282
8285
  }
8283
8286
  ) }),
@@ -8285,7 +8288,7 @@ var AuthLayout = ({
8285
8288
  Typography,
8286
8289
  {
8287
8290
  variant: "body1",
8288
- className: "text-2xl font-bold text-white",
8291
+ className: "text-2xl font-bold text-[var(--color-foreground)]",
8289
8292
  children: appName
8290
8293
  }
8291
8294
  )
@@ -8295,7 +8298,7 @@ var AuthLayout = ({
8295
8298
  Typography,
8296
8299
  {
8297
8300
  variant: "h1",
8298
- className: "text-4xl font-bold text-white leading-tight",
8301
+ className: "text-4xl font-bold text-[var(--color-foreground)] leading-tight",
8299
8302
  children: [
8300
8303
  "Welcome to ",
8301
8304
  appName
@@ -8306,27 +8309,27 @@ var AuthLayout = ({
8306
8309
  Typography,
8307
8310
  {
8308
8311
  variant: "body1",
8309
- className: "text-lg text-white/80 max-w-md",
8312
+ className: "text-lg text-[var(--color-foreground)]/80 max-w-md",
8310
8313
  children: "Sign in to access your dashboard and manage your account."
8311
8314
  }
8312
8315
  ),
8313
- /* @__PURE__ */ jsxs(Box, { className: "mt-12 p-6 bg-white/10 rounded-xl backdrop-blur", children: [
8316
+ /* @__PURE__ */ jsxs(Box, { className: "mt-12 p-6 bg-[var(--color-card)]/10 rounded-xl backdrop-blur", children: [
8314
8317
  /* @__PURE__ */ jsx(
8315
8318
  Typography,
8316
8319
  {
8317
8320
  variant: "body1",
8318
- className: "text-white/90 italic",
8321
+ className: "text-[var(--color-foreground)]/90 italic",
8319
8322
  children: '"This platform has transformed how we work. Highly recommended!"'
8320
8323
  }
8321
8324
  ),
8322
8325
  /* @__PURE__ */ jsxs(HStack, { className: "mt-4", gap: "sm", align: "center", children: [
8323
- /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-white/20 rounded-full" }),
8326
+ /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-full" }),
8324
8327
  /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
8325
8328
  /* @__PURE__ */ jsx(
8326
8329
  Typography,
8327
8330
  {
8328
8331
  variant: "body1",
8329
- className: "text-white font-medium",
8332
+ className: "text-[var(--color-foreground)] font-medium",
8330
8333
  children: "Jane Doe"
8331
8334
  }
8332
8335
  ),
@@ -8334,7 +8337,7 @@ var AuthLayout = ({
8334
8337
  Typography,
8335
8338
  {
8336
8339
  variant: "body1",
8337
- className: "text-white/60 text-sm",
8340
+ className: "text-[var(--color-foreground)]/60 text-sm",
8338
8341
  children: "CEO, Example Co."
8339
8342
  }
8340
8343
  )
@@ -8342,8 +8345,8 @@ var AuthLayout = ({
8342
8345
  ] })
8343
8346
  ] })
8344
8347
  ] }) }),
8345
- /* @__PURE__ */ jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-white/5 rounded-full" }),
8346
- /* @__PURE__ */ jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-white/5 rounded-full" })
8348
+ /* @__PURE__ */ jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-[var(--color-card)]/5 rounded-full" }),
8349
+ /* @__PURE__ */ jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-[var(--color-card)]/5 rounded-full" })
8347
8350
  ]
8348
8351
  }
8349
8352
  ),
@@ -8360,7 +8363,7 @@ var AuthLayout = ({
8360
8363
  Typography,
8361
8364
  {
8362
8365
  variant: "body1",
8363
- className: "text-white font-bold text-xl",
8366
+ className: "text-[var(--color-foreground)] font-bold text-xl",
8364
8367
  children: appName.charAt(0).toUpperCase()
8365
8368
  }
8366
8369
  ) }),
@@ -9231,7 +9234,7 @@ function IsometricCanvas({
9231
9234
  className: cn("relative w-full overflow-hidden rounded-lg", className),
9232
9235
  style: { height: viewportSize.height },
9233
9236
  "data-testid": "game-canvas-empty",
9234
- children: /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-full bg-slate-800 rounded-lg", children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
9237
+ children: /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-full bg-[var(--color-card)] rounded-lg", children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
9235
9238
  /* @__PURE__ */ jsx(Icon, { name: "map", size: "xl" }),
9236
9239
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-slate-400", children: t("canvas.emptyMessage") || "No map data loaded" })
9237
9240
  ] }) })
@@ -9816,7 +9819,7 @@ var MarkdownContent = React117__default.memo(
9816
9819
  "th",
9817
9820
  {
9818
9821
  ...props,
9819
- className: "border border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-800 px-4 py-2 text-left font-semibold",
9822
+ className: "border border-gray-300 dark:border-gray-600 bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
9820
9823
  children
9821
9824
  }
9822
9825
  );
@@ -10094,7 +10097,7 @@ var CodeBlock = React117__default.memo(
10094
10097
  {
10095
10098
  justify: "between",
10096
10099
  align: "center",
10097
- className: "px-3 py-2 bg-gray-800 rounded-t-lg border-b border-gray-700",
10100
+ className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
10098
10101
  children: [
10099
10102
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
10100
10103
  showCopyButton && /* @__PURE__ */ jsx(
@@ -19350,7 +19353,7 @@ var sizeMap17 = {
19350
19353
  lg: "text-base px-4 py-2"
19351
19354
  };
19352
19355
  var variantMap2 = {
19353
- default: "bg-gray-800/80 border-gray-700",
19356
+ default: "bg-[var(--color-card)]/80 border-gray-700",
19354
19357
  primary: "bg-blue-900/80 border-blue-700",
19355
19358
  success: "bg-green-900/80 border-green-700",
19356
19359
  warning: "bg-yellow-900/80 border-yellow-700",
@@ -19411,7 +19414,7 @@ function StatBadge({
19411
19414
  animated: true
19412
19415
  }
19413
19416
  ),
19414
- format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-white", children: value })
19417
+ format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-[var(--color-foreground)]", children: value })
19415
19418
  ]
19416
19419
  }
19417
19420
  );
@@ -19684,7 +19687,7 @@ function HealthPanel({
19684
19687
  Box,
19685
19688
  {
19686
19689
  className: cn(
19687
- "rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm",
19690
+ "rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm",
19688
19691
  sizes.padding,
19689
19692
  className
19690
19693
  ),
@@ -19786,7 +19789,7 @@ function ScoreBoard({
19786
19789
  Card,
19787
19790
  {
19788
19791
  className: cn(
19789
- "bg-gray-900/90 border-gray-700 backdrop-blur-sm",
19792
+ "bg-[var(--color-card)]/90 border-gray-700 backdrop-blur-sm",
19790
19793
  className
19791
19794
  ),
19792
19795
  children: /* @__PURE__ */ jsx(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-wrap", children: [
@@ -19885,7 +19888,7 @@ function TurnPanel({
19885
19888
  Box,
19886
19889
  {
19887
19890
  className: cn(
19888
- "flex items-center gap-3 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
19891
+ "flex items-center gap-3 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
19889
19892
  className
19890
19893
  ),
19891
19894
  children: [
@@ -19932,7 +19935,7 @@ function EnemyPlate({
19932
19935
  Box,
19933
19936
  {
19934
19937
  className: cn(
19935
- "inline-flex flex-col gap-1 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
19938
+ "inline-flex flex-col gap-1 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
19936
19939
  "min-w-[120px]",
19937
19940
  className
19938
19941
  ),
@@ -19943,7 +19946,7 @@ function EnemyPlate({
19943
19946
  {
19944
19947
  variant: "caption",
19945
19948
  weight: "bold",
19946
- className: "text-white truncate",
19949
+ className: "text-[var(--color-foreground)] truncate",
19947
19950
  children: name
19948
19951
  }
19949
19952
  ),
@@ -20010,7 +20013,7 @@ function UnitCommandBar({
20010
20013
  Box,
20011
20014
  {
20012
20015
  className: cn(
20013
- "flex items-center gap-1.5 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
20016
+ "flex items-center gap-1.5 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
20014
20017
  className
20015
20018
  ),
20016
20019
  children: commands.map((command, i) => /* @__PURE__ */ jsxs(Box, { className: "flex flex-col items-center gap-0.5", children: [
@@ -20237,7 +20240,7 @@ function DialogueBox({
20237
20240
  tabIndex: 0,
20238
20241
  role: "dialog",
20239
20242
  "aria-label": "Dialogue",
20240
- children: /* @__PURE__ */ jsx("div", { className: "mx-4 my-4 bg-gray-900 bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
20243
+ children: /* @__PURE__ */ jsx("div", { className: "mx-4 my-4 bg-[var(--color-card)] bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
20241
20244
  dialogue.portrait && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 p-4 border-r border-gray-700", children: /* @__PURE__ */ jsx(
20242
20245
  "img",
20243
20246
  {
@@ -20249,7 +20252,7 @@ function DialogueBox({
20249
20252
  ) }),
20250
20253
  /* @__PURE__ */ jsxs("div", { className: "flex-1 p-4", children: [
20251
20254
  /* @__PURE__ */ jsx("div", { className: "text-yellow-400 font-bold mb-2", children: dialogue.speaker }),
20252
- /* @__PURE__ */ jsxs("div", { className: "text-white text-lg leading-relaxed min-h-[60px]", children: [
20255
+ /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-lg leading-relaxed min-h-[60px]", children: [
20253
20256
  displayedText,
20254
20257
  isTyping && /* @__PURE__ */ jsx("span", { className: "animate-pulse", children: "\u258C" })
20255
20258
  ] }),
@@ -20259,8 +20262,8 @@ function DialogueBox({
20259
20262
  type: "button",
20260
20263
  className: cn(
20261
20264
  "block w-full text-left px-4 py-2 rounded transition-colors",
20262
- "hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-yellow-400",
20263
- selectedChoice === index ? "bg-gray-700 text-yellow-400" : "bg-gray-800 text-white"
20265
+ "hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-yellow-400",
20266
+ selectedChoice === index ? "bg-[var(--color-surface,#374151)] text-yellow-400" : "bg-[var(--color-card)] text-[var(--color-foreground)]"
20264
20267
  ),
20265
20268
  onClick: (e) => {
20266
20269
  e.stopPropagation();
@@ -20373,7 +20376,7 @@ function InventoryPanel({
20373
20376
  /* @__PURE__ */ jsx(
20374
20377
  "div",
20375
20378
  {
20376
- className: "grid gap-1 bg-gray-900 p-2 rounded-lg border border-gray-700",
20379
+ className: "grid gap-1 bg-[var(--color-card)] p-2 rounded-lg border border-gray-700",
20377
20380
  style: {
20378
20381
  gridTemplateColumns: `repeat(${safeColumns}, ${slotSize}px)`,
20379
20382
  gridTemplateRows: `repeat(${rows}, ${slotSize}px)`
@@ -20384,9 +20387,9 @@ function InventoryPanel({
20384
20387
  type: "button",
20385
20388
  className: cn(
20386
20389
  "relative flex items-center justify-center",
20387
- "bg-gray-800 border rounded transition-colors",
20388
- "hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",
20389
- selectedSlot === index ? "border-yellow-400 bg-gray-700" : "border-gray-600"
20390
+ "bg-[var(--color-card)] border rounded transition-colors",
20391
+ "hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-blue-500",
20392
+ selectedSlot === index ? "border-yellow-400 bg-[var(--color-surface,#374151)]" : "border-gray-600"
20390
20393
  ),
20391
20394
  style: { width: slotSize, height: slotSize },
20392
20395
  onClick: () => handleSlotClick(index),
@@ -20416,14 +20419,14 @@ function InventoryPanel({
20416
20419
  showTooltips && hoveredItem && /* @__PURE__ */ jsxs(
20417
20420
  "div",
20418
20421
  {
20419
- className: "fixed z-50 bg-gray-900 border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
20422
+ className: "fixed z-50 bg-[var(--color-card)] border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
20420
20423
  style: {
20421
20424
  left: tooltipPosition.x,
20422
20425
  top: tooltipPosition.y,
20423
20426
  maxWidth: 200
20424
20427
  },
20425
20428
  children: [
20426
- /* @__PURE__ */ jsx("div", { className: "font-semibold text-white", children: hoveredItem.name || hoveredItem.type }),
20429
+ /* @__PURE__ */ jsx("div", { className: "font-semibold text-[var(--color-foreground)]", children: hoveredItem.name || hoveredItem.type }),
20427
20430
  hoveredItem.description && /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-400 mt-1", children: hoveredItem.description }),
20428
20431
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500 mt-1", children: [
20429
20432
  "Quantity: ",
@@ -20435,9 +20438,9 @@ function InventoryPanel({
20435
20438
  ] });
20436
20439
  }
20437
20440
  var variantMap3 = {
20438
- primary: "bg-blue-600 hover:bg-blue-500 text-white border-blue-400 shadow-lg shadow-blue-500/25",
20439
- secondary: "bg-gray-700 hover:bg-gray-600 text-white border-gray-500",
20440
- ghost: "bg-transparent hover:bg-white/10 text-white border-white/20"
20441
+ primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400 shadow-lg shadow-blue-500/25",
20442
+ secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
20443
+ ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
20441
20444
  };
20442
20445
  function GameMenu({
20443
20446
  title,
@@ -20494,7 +20497,7 @@ function GameMenu({
20494
20497
  /* @__PURE__ */ jsx(
20495
20498
  "h1",
20496
20499
  {
20497
- className: "text-5xl md:text-7xl font-bold text-white tracking-tight",
20500
+ className: "text-5xl md:text-7xl font-bold text-[var(--color-foreground)] tracking-tight",
20498
20501
  style: {
20499
20502
  textShadow: "0 4px 12px rgba(0,0,0,0.5)"
20500
20503
  },
@@ -20550,9 +20553,9 @@ var variantColors = {
20550
20553
  }
20551
20554
  };
20552
20555
  var buttonVariants = {
20553
- primary: "bg-blue-600 hover:bg-blue-500 text-white border-blue-400",
20554
- secondary: "bg-gray-700 hover:bg-gray-600 text-white border-gray-500",
20555
- ghost: "bg-transparent hover:bg-white/10 text-white border-white/20"
20556
+ primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400",
20557
+ secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
20558
+ ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
20556
20559
  };
20557
20560
  function formatTime3(ms) {
20558
20561
  const seconds = Math.floor(ms / 1e3);
@@ -20633,7 +20636,7 @@ function GameOverScreen({
20633
20636
  }
20634
20637
  return /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
20635
20638
  /* @__PURE__ */ jsx("div", { className: "text-gray-400 text-sm mb-1", children: stat.label }),
20636
- /* @__PURE__ */ jsxs("div", { className: "text-white text-2xl font-bold flex items-center justify-center gap-2", children: [
20639
+ /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-2xl font-bold flex items-center justify-center gap-2", children: [
20637
20640
  stat.icon && /* @__PURE__ */ jsx("span", { children: stat.icon }),
20638
20641
  /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: displayValue })
20639
20642
  ] })
@@ -21804,7 +21807,7 @@ var Lightbox = ({
21804
21807
  className: cn(
21805
21808
  "absolute top-4 right-4 z-10",
21806
21809
  "p-2 rounded-full",
21807
- "text-white bg-black bg-opacity-50",
21810
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
21808
21811
  "hover:bg-opacity-70 transition-opacity",
21809
21812
  "focus:outline-none focus:ring-2 focus:ring-white"
21810
21813
  ),
@@ -21823,7 +21826,7 @@ var Lightbox = ({
21823
21826
  className: cn(
21824
21827
  "absolute left-4 z-10",
21825
21828
  "p-2 rounded-full",
21826
- "text-white bg-black bg-opacity-50",
21829
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
21827
21830
  "hover:bg-opacity-70 transition-opacity",
21828
21831
  "focus:outline-none focus:ring-2 focus:ring-white"
21829
21832
  ),
@@ -21860,7 +21863,7 @@ var Lightbox = ({
21860
21863
  className: cn(
21861
21864
  "absolute right-4 z-10",
21862
21865
  "p-2 rounded-full",
21863
- "text-white bg-black bg-opacity-50",
21866
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
21864
21867
  "hover:bg-opacity-70 transition-opacity",
21865
21868
  "focus:outline-none focus:ring-2 focus:ring-white"
21866
21869
  ),
@@ -21869,12 +21872,12 @@ var Lightbox = ({
21869
21872
  }
21870
21873
  ),
21871
21874
  /* @__PURE__ */ jsxs("div", { className: "absolute bottom-4 left-0 right-0 text-center", children: [
21872
- showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-white text-sm mb-1", children: [
21875
+ showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-sm mb-1", children: [
21873
21876
  index + 1,
21874
21877
  " of ",
21875
21878
  safeImages.length
21876
21879
  ] }),
21877
- currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-white text-sm opacity-80 px-8", children: currentImage.caption })
21880
+ currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-[var(--color-foreground)] text-sm opacity-80 px-8", children: currentImage.caption })
21878
21881
  ] })
21879
21882
  ]
21880
21883
  }
@@ -27449,6 +27452,254 @@ function onDebugToggle(listener) {
27449
27452
  listeners5.add(listener);
27450
27453
  return () => listeners5.delete(listener);
27451
27454
  }
27455
+ function layoutGraph(states, transitions, initialState, width, height) {
27456
+ if (states.length === 0) return [];
27457
+ const layers = /* @__PURE__ */ new Map();
27458
+ const queue = [initialState];
27459
+ layers.set(initialState, 0);
27460
+ while (queue.length > 0) {
27461
+ const current = queue.shift();
27462
+ const layer = layers.get(current);
27463
+ for (const tr of transitions) {
27464
+ if (tr.from === current && !layers.has(tr.to)) {
27465
+ layers.set(tr.to, layer + 1);
27466
+ queue.push(tr.to);
27467
+ }
27468
+ }
27469
+ }
27470
+ for (const s of states) {
27471
+ if (!layers.has(s)) layers.set(s, layers.size > 0 ? Math.max(...layers.values()) + 1 : 0);
27472
+ }
27473
+ const layerGroups = /* @__PURE__ */ new Map();
27474
+ for (const [state, layer] of layers) {
27475
+ const group = layerGroups.get(layer) ?? [];
27476
+ group.push(state);
27477
+ layerGroups.set(layer, group);
27478
+ }
27479
+ const maxLayer = Math.max(...layerGroups.keys(), 0);
27480
+ const padX = 24;
27481
+ const padY = 20;
27482
+ const usableW = width - padX * 2;
27483
+ const usableH = height - padY * 2;
27484
+ const positions = [];
27485
+ for (const [layer, group] of layerGroups) {
27486
+ const y = maxLayer === 0 ? usableH / 2 + padY : padY + layer / maxLayer * usableH;
27487
+ for (let i = 0; i < group.length; i++) {
27488
+ const x = group.length === 1 ? width / 2 : padX + i / (group.length - 1) * usableW;
27489
+ positions.push({ x, y, state: group[i] });
27490
+ }
27491
+ }
27492
+ return positions;
27493
+ }
27494
+ function WalkMinimap() {
27495
+ const [walkStep, setWalkStep] = React117.useState(null);
27496
+ const [traits2, setTraits] = React117.useState([]);
27497
+ const [coveredEdges, setCoveredEdges] = React117.useState([]);
27498
+ const [completedTraits, setCompletedTraits] = React117.useState(/* @__PURE__ */ new Set());
27499
+ const prevTraitRef = React117.useRef(null);
27500
+ React117.useEffect(() => {
27501
+ const interval = setInterval(() => {
27502
+ const w = window;
27503
+ const step = w.__orbitalWalkStep;
27504
+ const traitConfigs = w.__orbitalWalkTraits;
27505
+ const edges = w.__orbitalCoveredEdges;
27506
+ if (step) setWalkStep(step);
27507
+ if (traitConfigs) setTraits(traitConfigs);
27508
+ if (edges) setCoveredEdges(edges);
27509
+ if (step && prevTraitRef.current && prevTraitRef.current !== step.traitName) {
27510
+ setCompletedTraits((prev) => new Set(prev).add(prevTraitRef.current));
27511
+ }
27512
+ if (step) prevTraitRef.current = step.traitName;
27513
+ }, 250);
27514
+ return () => clearInterval(interval);
27515
+ }, []);
27516
+ if (!walkStep || traits2.length === 0) return null;
27517
+ const activeTrait = traits2.find((t) => t.name === walkStep.traitName);
27518
+ const engineCount = coveredEdges.filter((e) => e.phase === "engine").length;
27519
+ const domCount = coveredEdges.filter((e) => e.phase === "dom").length;
27520
+ const totalTransitions = traits2.reduce((sum, t) => sum + t.transitions.length, 0);
27521
+ const activeEdgeKeys = new Set(
27522
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => `${e.from}+${e.event}->${e.to}`)
27523
+ );
27524
+ const activeEdgePhases = new Map(
27525
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => [`${e.from}+${e.event}->${e.to}`, e.phase])
27526
+ );
27527
+ const currentEdgeKey = `${walkStep.from}+${walkStep.event}->${walkStep.to}`;
27528
+ const graphW = 260;
27529
+ const graphH = 120;
27530
+ const nodeR = 10;
27531
+ const positions = activeTrait ? layoutGraph(activeTrait.states, activeTrait.transitions, activeTrait.initialState, graphW, graphH) : [];
27532
+ const posMap = new Map(positions.map((p2) => [p2.state, p2]));
27533
+ const visitedStates = new Set(
27534
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).flatMap((e) => [e.from, e.to])
27535
+ );
27536
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "w-64 flex-shrink-0 border-l border-border bg-[var(--color-card)] overflow-hidden", children: [
27537
+ /* @__PURE__ */ jsx(Box, { className: "px-2 py-1.5 border-b border-border overflow-x-auto", children: /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-nowrap", children: traits2.map((t) => {
27538
+ const isDone = completedTraits.has(t.name);
27539
+ const isActive = t.name === walkStep.traitName;
27540
+ const variant = isDone ? "success" : isActive ? "info" : "neutral";
27541
+ const shortName = t.name.replace(/^[A-Z][a-z]+/, "");
27542
+ return /* @__PURE__ */ jsxs(
27543
+ Badge,
27544
+ {
27545
+ variant,
27546
+ size: "sm",
27547
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
27548
+ children: [
27549
+ isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
27550
+ " ",
27551
+ shortName || t.name
27552
+ ]
27553
+ },
27554
+ t.name
27555
+ );
27556
+ }) }) }),
27557
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-1 py-1", children: activeTrait && /* @__PURE__ */ jsxs("svg", { width: graphW, height: graphH, viewBox: `0 0 ${graphW} ${graphH}`, children: [
27558
+ /* @__PURE__ */ jsxs("defs", { children: [
27559
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#888" }) }),
27560
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-green", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#22c55e" }) }),
27561
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-cyan", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#06b6d4" }) }),
27562
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-yellow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#eab308" }) })
27563
+ ] }),
27564
+ activeTrait.transitions.map((tr, i) => {
27565
+ const fromPos = posMap.get(tr.from);
27566
+ const toPos = posMap.get(tr.to);
27567
+ if (!fromPos || !toPos) return null;
27568
+ const key = `${tr.from}+${tr.event}->${tr.to}`;
27569
+ const isCurrent = key === currentEdgeKey && !walkStep.isRepositioning;
27570
+ const isCovered = activeEdgeKeys.has(key);
27571
+ const phase = activeEdgePhases.get(key);
27572
+ let stroke = "#555";
27573
+ let markerEnd = "url(#mm-arrow)";
27574
+ let strokeWidth = 1;
27575
+ let opacity = 0.4;
27576
+ if (isCurrent) {
27577
+ stroke = "#eab308";
27578
+ markerEnd = "url(#mm-arrow-yellow)";
27579
+ strokeWidth = 2.5;
27580
+ opacity = 1;
27581
+ } else if (isCovered && phase === "dom") {
27582
+ stroke = "#06b6d4";
27583
+ markerEnd = "url(#mm-arrow-cyan)";
27584
+ strokeWidth = 1.5;
27585
+ opacity = 0.9;
27586
+ } else if (isCovered) {
27587
+ stroke = "#22c55e";
27588
+ markerEnd = "url(#mm-arrow-green)";
27589
+ strokeWidth = 1.5;
27590
+ opacity = 0.9;
27591
+ }
27592
+ if (tr.from === tr.to) {
27593
+ const cx = fromPos.x;
27594
+ const cy = fromPos.y - nodeR - 8;
27595
+ return /* @__PURE__ */ jsxs("g", { children: [
27596
+ /* @__PURE__ */ jsx(
27597
+ "path",
27598
+ {
27599
+ d: `M${cx - 5},${fromPos.y - nodeR} C${cx - 18},${cy - 14} ${cx + 18},${cy - 14} ${cx + 5},${fromPos.y - nodeR}`,
27600
+ fill: "none",
27601
+ stroke,
27602
+ strokeWidth,
27603
+ opacity,
27604
+ markerEnd
27605
+ }
27606
+ ),
27607
+ /* @__PURE__ */ jsx("text", { x: cx, y: cy - 12, textAnchor: "middle", fontSize: "7", fill: stroke, opacity, children: tr.event.length > 10 ? tr.event.slice(0, 8) + ".." : tr.event })
27608
+ ] }, `e-${i}`);
27609
+ }
27610
+ const dx = toPos.x - fromPos.x;
27611
+ const dy = toPos.y - fromPos.y;
27612
+ const len = Math.sqrt(dx * dx + dy * dy) || 1;
27613
+ const nx = -dy / len;
27614
+ const ny = dx / len;
27615
+ const hasReverse = activeTrait.transitions.some(
27616
+ (t2) => t2.from === tr.to && t2.to === tr.from
27617
+ );
27618
+ const offset = hasReverse ? 4 : 0;
27619
+ const x1 = fromPos.x + dx / len * nodeR + nx * offset;
27620
+ const y1 = fromPos.y + dy / len * nodeR + ny * offset;
27621
+ const x2 = toPos.x - dx / len * (nodeR + 6) + nx * offset;
27622
+ const y2 = toPos.y - dy / len * (nodeR + 6) + ny * offset;
27623
+ const mx = (x1 + x2) / 2 + nx * 8;
27624
+ const my = (y1 + y2) / 2 + ny * 8;
27625
+ return /* @__PURE__ */ jsxs("g", { children: [
27626
+ /* @__PURE__ */ jsx(
27627
+ "line",
27628
+ {
27629
+ x1,
27630
+ y1,
27631
+ x2,
27632
+ y2,
27633
+ stroke,
27634
+ strokeWidth,
27635
+ opacity,
27636
+ markerEnd,
27637
+ children: isCurrent && /* @__PURE__ */ jsx("animate", { attributeName: "opacity", values: "1;0.4;1", dur: "0.8s", repeatCount: "indefinite" })
27638
+ }
27639
+ ),
27640
+ /* @__PURE__ */ jsx("text", { x: mx, y: my, textAnchor: "middle", fontSize: "7", fill: stroke, opacity: Math.min(opacity + 0.2, 1), children: tr.event.length > 12 ? tr.event.slice(0, 10) + ".." : tr.event })
27641
+ ] }, `e-${i}`);
27642
+ }),
27643
+ positions.map((pos) => {
27644
+ const isCurrentState = pos.state === walkStep.from || pos.state === walkStep.to;
27645
+ const isVisited = visitedStates.has(pos.state);
27646
+ const isInitial = pos.state === activeTrait.initialState;
27647
+ let fill = "#333";
27648
+ let strokeColor = "#555";
27649
+ let sw = 1;
27650
+ if (isCurrentState) {
27651
+ fill = "#1e40af";
27652
+ strokeColor = "#3b82f6";
27653
+ sw = 2;
27654
+ } else if (isVisited) {
27655
+ fill = "#166534";
27656
+ strokeColor = "#22c55e";
27657
+ sw = 1.5;
27658
+ }
27659
+ return /* @__PURE__ */ jsxs("g", { children: [
27660
+ isInitial && /* @__PURE__ */ jsx("circle", { cx: pos.x, cy: pos.y, r: nodeR + 3, fill: "none", stroke: "#3b82f6", strokeWidth: 1, opacity: 0.4 }),
27661
+ /* @__PURE__ */ jsx(
27662
+ "circle",
27663
+ {
27664
+ cx: pos.x,
27665
+ cy: pos.y,
27666
+ r: nodeR,
27667
+ fill,
27668
+ stroke: strokeColor,
27669
+ strokeWidth: sw,
27670
+ children: isCurrentState && /* @__PURE__ */ jsx("animate", { attributeName: "r", values: `${nodeR};${nodeR + 2};${nodeR}`, dur: "1s", repeatCount: "indefinite" })
27671
+ }
27672
+ ),
27673
+ /* @__PURE__ */ jsx(
27674
+ "text",
27675
+ {
27676
+ x: pos.x,
27677
+ y: pos.y + nodeR + 10,
27678
+ textAnchor: "middle",
27679
+ fontSize: "8",
27680
+ fill: "#aaa",
27681
+ children: pos.state.length > 10 ? pos.state.slice(0, 8) + ".." : pos.state
27682
+ }
27683
+ )
27684
+ ] }, pos.state);
27685
+ })
27686
+ ] }) }),
27687
+ /* @__PURE__ */ jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
27688
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-green-500", children: [
27689
+ "Engine: ",
27690
+ engineCount,
27691
+ "/",
27692
+ totalTransitions
27693
+ ] }),
27694
+ domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-cyan-500", children: [
27695
+ "DOM: ",
27696
+ domCount
27697
+ ] }),
27698
+ /* @__PURE__ */ jsx(Badge, { variant: walkStep.phase === "engine" ? "info" : "warning", size: "sm", className: "text-[9px]", children: walkStep.phase === "engine" ? "Engine" : "DOM" })
27699
+ ] }) })
27700
+ ] });
27701
+ }
27702
+ WalkMinimap.displayName = "WalkMinimap";
27452
27703
  function TraitsTab({ traits: traits2 }) {
27453
27704
  if (traits2.length === 0) {
27454
27705
  return /* @__PURE__ */ jsx(
@@ -28272,25 +28523,25 @@ function EventDispatcherTab({ traits: traits2, schema }) {
28272
28523
  EventDispatcherTab.displayName = "EventDispatcherTab";
28273
28524
  function ServerResponseRow({ sr }) {
28274
28525
  const entityEntries = Object.entries(sr.dataEntities);
28275
- return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-700/50 py-0.5 text-[10px] font-mono", children: [
28526
+ return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-[10px] font-mono", children: [
28276
28527
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
28277
- /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-400" : "text-red-400", children: [
28528
+ /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
28278
28529
  sr.success ? "\u2713" : "\u2717",
28279
28530
  " server"
28280
28531
  ] }),
28281
- /* @__PURE__ */ jsx("span", { className: "text-purple-300", children: sr.orbitalName }),
28282
- sr.clientEffects > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-purple-900/50 text-purple-300", children: [
28532
+ /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
28533
+ sr.clientEffects > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: [
28283
28534
  sr.clientEffects,
28284
28535
  " clientEffect",
28285
28536
  sr.clientEffects !== 1 ? "s" : ""
28286
28537
  ] }),
28287
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-900/50 text-blue-300", children: [
28538
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
28288
28539
  "emit: ",
28289
28540
  sr.emittedEvents.join(", ")
28290
28541
  ] }),
28291
- sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-900/50 text-red-400 truncate max-w-[300px]", children: sr.error })
28542
+ 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 })
28292
28543
  ] }),
28293
- 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-gray-800 text-gray-300", children: [
28544
+ 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: [
28294
28545
  name,
28295
28546
  ": ",
28296
28547
  count,
@@ -28303,24 +28554,24 @@ function TransitionRow({ trace }) {
28303
28554
  const isServerEntry = !!trace.serverResponse && trace.traitName.startsWith("server:");
28304
28555
  const hasFailedEffects = trace.effects.some((e) => e.status === "failed");
28305
28556
  if (isServerEntry && trace.serverResponse) {
28306
- return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-gray-800 last:border-0", children: [
28557
+ return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
28307
28558
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
28308
28559
  /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
28309
28560
  /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
28310
- /* @__PURE__ */ jsx("span", { className: "text-purple-400 flex-shrink-0", children: "server response" })
28561
+ /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: "server response" })
28311
28562
  ] }),
28312
28563
  /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
28313
28564
  ] });
28314
28565
  }
28315
- return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-gray-800 last:border-0", children: [
28566
+ return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
28316
28567
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
28317
28568
  /* @__PURE__ */ jsx("span", { className: cn(
28318
28569
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
28319
28570
  hasFailedEffects ? "bg-red-500" : "bg-green-500"
28320
28571
  ) }),
28321
28572
  /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
28322
- /* @__PURE__ */ jsx("span", { className: "text-gray-300 flex-shrink-0", children: trace.traitName }),
28323
- /* @__PURE__ */ jsxs("span", { className: "text-gray-400 flex-shrink-0", children: [
28573
+ /* @__PURE__ */ jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
28574
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground/70 flex-shrink-0", children: [
28324
28575
  trace.from,
28325
28576
  " ",
28326
28577
  "\u2192",
@@ -28330,12 +28581,12 @@ function TransitionRow({ trace }) {
28330
28581
  ] }),
28331
28582
  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(
28332
28583
  "px-1 rounded text-[10px]",
28333
- eff.status === "executed" ? "bg-green-900/50 text-green-400" : eff.status === "failed" ? "bg-red-900/50 text-red-400" : "bg-yellow-900/50 text-yellow-400"
28584
+ 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"
28334
28585
  ), children: [
28335
28586
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
28336
28587
  " ",
28337
28588
  eff.type,
28338
- eff.args.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-500 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
28589
+ eff.args.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground/50 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
28339
28590
  ] }, i)) }),
28340
28591
  trace.serverResponse && /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
28341
28592
  ] });
@@ -28350,15 +28601,6 @@ function VerifyModePanel({
28350
28601
  }) {
28351
28602
  const scrollRef = React117.useRef(null);
28352
28603
  const prevCountRef = React117.useRef(0);
28353
- const [walkStep, setWalkStep] = React117.useState(null);
28354
- React117.useEffect(() => {
28355
- const interval = setInterval(() => {
28356
- const w = window;
28357
- const step = w.__orbitalWalkStep;
28358
- if (step) setWalkStep(step);
28359
- }, 300);
28360
- return () => clearInterval(interval);
28361
- }, []);
28362
28604
  React117.useEffect(() => {
28363
28605
  if (transitions.length > prevCountRef.current && scrollRef.current) {
28364
28606
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
@@ -28371,49 +28613,28 @@ function VerifyModePanel({
28371
28613
  {
28372
28614
  className: cn(
28373
28615
  "runtime-debugger runtime-debugger--verify",
28374
- "flex flex-col bg-gray-900 text-white border-t-2 border-cyan-500",
28616
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
28375
28617
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
28376
28618
  className
28377
28619
  ),
28378
28620
  "data-testid": "debugger-verify",
28379
28621
  style: { height: "25vh", zIndex: hudBottom ? void 0 : 40 },
28380
28622
  children: [
28381
- /* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-gray-700 flex-shrink-0", children: [
28623
+ /* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-border flex-shrink-0", children: [
28382
28624
  /* @__PURE__ */ jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? `${failedChecks} fail` : "OK" }),
28383
- /* @__PURE__ */ jsxs("span", { className: "text-gray-400", children: [
28625
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground/70", children: [
28384
28626
  localCount,
28385
28627
  " local"
28386
28628
  ] }),
28387
- /* @__PURE__ */ jsxs("span", { className: "text-purple-400", children: [
28629
+ /* @__PURE__ */ jsxs("span", { className: "text-purple-600 dark:text-purple-400", children: [
28388
28630
  serverCount,
28389
28631
  " server"
28390
28632
  ] }),
28391
- traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-400 truncate max-w-[400px]", children: traitStates })
28633
+ traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates })
28392
28634
  ] }),
28393
28635
  /* @__PURE__ */ jsxs("div", { className: "flex-1 flex overflow-hidden", children: [
28394
- /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-gray-500 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsx(TransitionRow, { trace }, trace.id)) }) }) }),
28395
- walkStep && /* @__PURE__ */ jsxs("div", { className: "w-56 flex-shrink-0 border-l border-gray-700 px-2 py-1 text-xs font-mono overflow-y-auto", children: [
28396
- /* @__PURE__ */ jsxs("div", { className: "text-cyan-400 font-bold mb-1", children: [
28397
- "Walk Step ",
28398
- walkStep.stepIndex,
28399
- "/",
28400
- walkStep.stepTotal
28401
- ] }),
28402
- /* @__PURE__ */ jsx("div", { className: "text-gray-300 mb-1", children: walkStep.traitName }),
28403
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 mb-1", children: [
28404
- /* @__PURE__ */ jsx("span", { className: "text-yellow-300", children: walkStep.from }),
28405
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "--" }),
28406
- /* @__PURE__ */ jsx("span", { className: "text-green-300", children: walkStep.event }),
28407
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "-->" }),
28408
- /* @__PURE__ */ jsx("span", { className: "text-yellow-300", children: walkStep.to })
28409
- ] }),
28410
- walkStep.guardCase && /* @__PURE__ */ jsxs("div", { className: walkStep.guardCase === "pass" ? "text-green-400" : "text-red-400", children: [
28411
- "guard: ",
28412
- walkStep.guardCase
28413
- ] }),
28414
- walkStep.isRepositioning && /* @__PURE__ */ jsx("div", { className: "text-gray-500 italic", children: "repositioning" }),
28415
- /* @__PURE__ */ jsx("div", { className: walkStep.accepted ? "text-green-400 mt-1" : "text-red-400 mt-1", children: walkStep.accepted ? "\u2713 accepted" : "\u2717 rejected" })
28416
- ] })
28636
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-foreground/50 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsx(TransitionRow, { trace }, trace.id)) }) }) }),
28637
+ /* @__PURE__ */ jsx(WalkMinimap, {})
28417
28638
  ] })
28418
28639
  ]
28419
28640
  }
@@ -28638,7 +28859,7 @@ function RuntimeDebugger({
28638
28859
  className: "runtime-debugger__tabs"
28639
28860
  }
28640
28861
  ) }),
28641
- /* @__PURE__ */ jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
28862
+ /* @__PURE__ */ jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-foreground/50", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
28642
28863
  ] })
28643
28864
  }
28644
28865
  );
@@ -32216,6 +32437,62 @@ function getComponentForPattern(patternType) {
32216
32437
  if (!name) return null;
32217
32438
  return COMPONENT_REGISTRY[name] ?? null;
32218
32439
  }
32440
+ var FORM_PATTERNS = /* @__PURE__ */ new Set([
32441
+ "form",
32442
+ "form-section",
32443
+ "inline-edit-form",
32444
+ "wizard-step"
32445
+ ]);
32446
+ function enrichFormFields(fields, entityDef) {
32447
+ const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
32448
+ return fields.map((field) => {
32449
+ if (typeof field === "string") {
32450
+ const entityField = fieldMap.get(field);
32451
+ if (entityField) {
32452
+ const enriched = {
32453
+ name: field,
32454
+ label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
32455
+ type: entityField.type,
32456
+ required: entityField.required
32457
+ };
32458
+ if (entityField.values && entityField.values.length > 0) {
32459
+ enriched.values = entityField.values;
32460
+ } else if (entityField.enumValues && entityField.enumValues.length > 0) {
32461
+ enriched.values = entityField.enumValues;
32462
+ }
32463
+ if (entityField.relation) {
32464
+ enriched.relation = entityField.relation;
32465
+ }
32466
+ return enriched;
32467
+ }
32468
+ return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
32469
+ }
32470
+ if (field && typeof field === "object" && !Array.isArray(field)) {
32471
+ const obj = field;
32472
+ const fieldName = obj.name ?? obj.field;
32473
+ if (!fieldName) return field;
32474
+ if (obj.type || obj.inputType) return field;
32475
+ const entityField = fieldMap.get(fieldName);
32476
+ if (!entityField) return field;
32477
+ const enriched = { ...obj, type: entityField.type };
32478
+ if (entityField.required && !("required" in obj)) {
32479
+ enriched.required = true;
32480
+ }
32481
+ if (!obj.values && !obj.options) {
32482
+ if (entityField.values && entityField.values.length > 0) {
32483
+ enriched.values = entityField.values;
32484
+ } else if (entityField.enumValues && entityField.enumValues.length > 0) {
32485
+ enriched.values = entityField.enumValues;
32486
+ }
32487
+ }
32488
+ if (!obj.relation && entityField.relation) {
32489
+ enriched.relation = entityField.relation;
32490
+ }
32491
+ return enriched;
32492
+ }
32493
+ return field;
32494
+ });
32495
+ }
32219
32496
  var PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
32220
32497
  "stack",
32221
32498
  "vstack",
@@ -32649,6 +32926,8 @@ function SlotContentRenderer({
32649
32926
  const entityProp = content.props.entity;
32650
32927
  const entityType = typeof entityProp === "string" ? entityProp : "";
32651
32928
  const storeData = useEntityRef(entityType);
32929
+ const schemaCtx = useEntitySchemaOptional();
32930
+ const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
32652
32931
  const PatternComponent = getComponentForPattern(content.pattern);
32653
32932
  if (PatternComponent) {
32654
32933
  const childrenConfig = content.props.children;
@@ -32670,6 +32949,13 @@ function SlotContentRenderer({
32670
32949
  } else {
32671
32950
  finalProps = renderedProps;
32672
32951
  }
32952
+ const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
32953
+ if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
32954
+ finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
32955
+ if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
32956
+ finalProps.initialData = storeData[0];
32957
+ }
32958
+ }
32673
32959
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
32674
32960
  return /* @__PURE__ */ jsx(
32675
32961
  Box,
@@ -33311,4 +33597,4 @@ function OrbPreview({
33311
33597
  }
33312
33598
  OrbPreview.displayName = "OrbPreview";
33313
33599
 
33314
- export { EntitySchemaProvider, OrbPreview, ServerBridgeProvider, SlotsProvider, TraitContext, TraitProvider, clearSchemaCache, createClientEffectHandlers, useEntityDefinition, useEntitySchema, useResolvedSchema, useServerBridge, useSlotContent, useSlots, useSlotsActions, useTrait, useTraitContext, useTraitStateMachine };
33600
+ export { EntitySchemaProvider, OrbPreview, ServerBridgeProvider, SlotsProvider, TraitContext, TraitProvider, clearSchemaCache, createClientEffectHandlers, useEntityDefinition, useEntitySchema, useEntitySchemaOptional, useResolvedSchema, useServerBridge, useSlotContent, useSlots, useSlotsActions, useTrait, useTraitContext, useTraitStateMachine };