@invana/ui 0.0.21 → 0.0.23

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.
package/dist/index.cjs CHANGED
@@ -68,8 +68,15 @@ var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespace(TogglePrimitive)
68
68
  var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
69
69
 
70
70
  // src/lib/utils.ts
71
+ var twMerge = tailwindMerge.extendTailwindMerge({
72
+ extend: {
73
+ classGroups: {
74
+ "font-size": [{ text: ["meta"] }]
75
+ }
76
+ }
77
+ });
71
78
  function cn(...inputs) {
72
- return tailwindMerge.twMerge(clsx.clsx(inputs));
79
+ return twMerge(clsx.clsx(inputs));
73
80
  }
74
81
  var Accordion = AccordionPrimitive__namespace.Root;
75
82
  var AccordionItem = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -144,7 +151,7 @@ var AlertDescription = React23__namespace.forwardRef(({ className, ...props }, r
144
151
  "div",
145
152
  {
146
153
  ref,
147
- className: cn("text-sm [&_p]:leading-relaxed", className),
154
+ className: cn("[&_p]:leading-relaxed", className),
148
155
  ...props
149
156
  }
150
157
  ));
@@ -162,10 +169,19 @@ var buttonVariants = classVarianceAuthority.cva(
162
169
  soft: "bg-primary/10 glassable text-primary ring-1 ring-primary/30 shadow-sm hover:bg-primary/20 active:bg-primary/25",
163
170
  link: "text-primary underline-offset-4 hover:underline hover:text-primary/80 active:text-primary/60"
164
171
  },
172
+ /*
173
+ * The scale runs 24 → 48. `xs` and `icon-xs` are the dense tier: a
174
+ * toolbar above a panel, an action inside a list row, a chip-height
175
+ * control beside 13px text. Below `sm` the icon has to come down with
176
+ * the box, so both xs sizes reset `[&_svg]:size-4` — the base class sets
177
+ * size-5, which at h-6 leaves no padding at all.
178
+ */
165
179
  size: {
180
+ xs: "h-6 rounded-control px-2 text-meta gap-1 [&_svg]:size-4",
166
181
  default: "h-9 px-4 py-2",
167
- sm: "h-8 rounded-control px-3 py-2 text-sm",
182
+ sm: "h-8 rounded-control px-3 py-2",
168
183
  lg: "h-12 rounded-control px-8 py-3",
184
+ "icon-xs": "h-6 w-6 rounded-control [&_svg]:size-4",
169
185
  icon: "h-8 w-8 rounded-control",
170
186
  "nav-icon": "h-11 w-11 rounded-control"
171
187
  }
@@ -261,7 +277,7 @@ var AlertDialogDescription = React23__namespace.forwardRef(({ className, ...prop
261
277
  AlertDialogPrimitive__namespace.Description,
262
278
  {
263
279
  ref,
264
- className: cn("text-sm text-muted-foreground", className),
280
+ className: cn("text-muted-foreground", className),
265
281
  ...props
266
282
  }
267
283
  ));
@@ -323,24 +339,51 @@ var AvatarFallback = React23__namespace.forwardRef(({ className, ...props }, ref
323
339
  ));
324
340
  AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
325
341
  var badgeVariants = classVarianceAuthority.cva(
326
- "inline-flex items-center border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
342
+ "inline-flex items-center border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
327
343
  {
328
344
  variants: {
329
345
  variant: {
330
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
346
+ default: "border-transparent bg-[var(--badge-solid)] text-[var(--badge-on-solid)] hover:opacity-90",
331
347
  secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
332
348
  destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
333
- outline: "text-foreground border-border",
334
- soft: "border-primary/25 bg-primary/15 text-primary hover:bg-primary/20"
349
+ outline: "border-border text-[var(--badge-ink)]",
350
+ soft: "border-[color-mix(in_srgb,var(--badge-solid)_25%,transparent)] bg-[color-mix(in_srgb,var(--badge-solid)_15%,transparent)] text-[var(--badge-solid)] hover:bg-[color-mix(in_srgb,var(--badge-solid)_22%,transparent)]"
351
+ },
352
+ tone: {
353
+ primary: "[--badge-solid:var(--color-primary)] [--badge-on-solid:var(--color-primary-foreground)] [--badge-ink:var(--color-foreground)]",
354
+ success: "[--badge-solid:var(--color-success)] [--badge-on-solid:var(--color-success-foreground)] [--badge-ink:var(--color-success)]",
355
+ warning: "[--badge-solid:var(--color-warning)] [--badge-on-solid:var(--color-warning-foreground)] [--badge-ink:var(--color-warning)]",
356
+ info: "[--badge-solid:var(--color-info)] [--badge-on-solid:var(--color-info-foreground)] [--badge-ink:var(--color-info)]",
357
+ muted: "[--badge-solid:var(--color-muted-foreground)] [--badge-on-solid:var(--color-background)] [--badge-ink:var(--color-muted-foreground)]"
358
+ },
359
+ size: {
360
+ /** 18px — inline in a title, or a count against a label. */
361
+ xs: "h-[18px] px-1.5 text-meta",
362
+ /** 22px — the row chip: a status beside an entity name. */
363
+ sm: "h-[22px] px-2 text-meta",
364
+ /**
365
+ * Unchanged from before `size` existed: no explicit height, so it sizes
366
+ * from its text. Every badge already written keeps rendering exactly as
367
+ * it did — the two tiers above are additions, not a re-baseline.
368
+ */
369
+ default: "px-2.5 py-0.5 text-meta"
335
370
  }
336
371
  },
337
372
  defaultVariants: {
338
- variant: "default"
373
+ variant: "default",
374
+ tone: "primary",
375
+ size: "default"
339
376
  }
340
377
  }
341
378
  );
342
- function Badge({ className, variant, ...props }) {
343
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
379
+ function Badge({ className, variant, tone, size, ...props }) {
380
+ return /* @__PURE__ */ jsxRuntime.jsx(
381
+ "div",
382
+ {
383
+ className: cn(badgeVariants({ variant, tone, size }), className),
384
+ ...props
385
+ }
386
+ );
344
387
  }
345
388
  var Breadcrumb = React23__namespace.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
346
389
  Breadcrumb.displayName = "Breadcrumb";
@@ -349,7 +392,7 @@ var BreadcrumbList = React23__namespace.forwardRef(({ className, ...props }, ref
349
392
  {
350
393
  ref,
351
394
  className: cn(
352
- "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
395
+ "flex flex-wrap items-center gap-1.5 break-words text-muted-foreground sm:gap-2.5",
353
396
  className
354
397
  ),
355
398
  ...props
@@ -478,7 +521,7 @@ function ButtonGroupText({
478
521
  Comp,
479
522
  {
480
523
  className: cn(
481
- "bg-muted shadow-xs flex items-center gap-2 rounded-control border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
524
+ "bg-muted shadow-xs flex items-center gap-2 rounded-control border px-4 font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
482
525
  className
483
526
  ),
484
527
  ...props
@@ -827,7 +870,7 @@ var DialogDescription = React23__namespace.forwardRef(({ className, ...props },
827
870
  DialogPrimitive__namespace.Description,
828
871
  {
829
872
  ref,
830
- className: cn("text-sm text-muted-foreground", className),
873
+ className: cn("text-muted-foreground", className),
831
874
  ...props
832
875
  }
833
876
  ));
@@ -854,7 +897,7 @@ var CommandInput = React23__namespace.forwardRef(({ className, ...props }, ref)
854
897
  {
855
898
  ref,
856
899
  className: cn(
857
- "flex h-10 w-full rounded-control bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
900
+ "flex h-10 w-full rounded-control bg-transparent py-3 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
858
901
  className
859
902
  ),
860
903
  ...props
@@ -875,7 +918,7 @@ var CommandEmpty = React23__namespace.forwardRef((props, ref) => /* @__PURE__ */
875
918
  cmdk.Command.Empty,
876
919
  {
877
920
  ref,
878
- className: "py-6 text-center text-sm",
921
+ className: "py-6 text-center",
879
922
  ...props
880
923
  }
881
924
  ));
@@ -885,7 +928,7 @@ var CommandGroup = React23__namespace.forwardRef(({ className, ...props }, ref)
885
928
  {
886
929
  ref,
887
930
  className: cn(
888
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
931
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-meta [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
889
932
  className
890
933
  ),
891
934
  ...props
@@ -906,7 +949,7 @@ var CommandItem = React23__namespace.forwardRef(({ className, ...props }, ref) =
906
949
  {
907
950
  ref,
908
951
  className: cn(
909
- "relative flex cursor-default gap-2 select-none items-center rounded-control px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary/15 data-[selected=true]:text-primary data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
952
+ "relative flex cursor-default gap-2 select-none items-center rounded-control px-2 py-1.5 outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary/15 data-[selected=true]:text-primary data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
910
953
  className
911
954
  ),
912
955
  ...props
@@ -921,7 +964,7 @@ var CommandShortcut = ({
921
964
  "span",
922
965
  {
923
966
  className: cn(
924
- "ml-auto text-xs tracking-widest text-muted-foreground",
967
+ "ml-auto text-meta tracking-widest text-muted-foreground",
925
968
  className
926
969
  ),
927
970
  ...props
@@ -1053,7 +1096,7 @@ var DropdownMenuShortcut = ({
1053
1096
  return /* @__PURE__ */ jsxRuntime.jsx(
1054
1097
  "span",
1055
1098
  {
1056
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
1099
+ className: cn("ml-auto text-meta tracking-widest opacity-60", className),
1057
1100
  ...props
1058
1101
  }
1059
1102
  );
@@ -1101,7 +1144,7 @@ function ItemSeparator({
1101
1144
  );
1102
1145
  }
1103
1146
  var itemVariants = classVarianceAuthority.cva(
1104
- "group/item [a]:hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring/50 [a]:transition-colors flex flex-wrap items-center rounded-md border border-transparent text-sm outline-none transition-colors duration-100 focus-visible:ring-[3px]",
1147
+ "group/item [a]:hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring/50 [a]:transition-colors flex flex-wrap items-center rounded-md border border-transparent outline-none transition-colors duration-100 focus-visible:ring-[3px]",
1105
1148
  {
1106
1149
  variants: {
1107
1150
  variant: {
@@ -1111,12 +1154,29 @@ var itemVariants = classVarianceAuthority.cva(
1111
1154
  },
1112
1155
  size: {
1113
1156
  default: "gap-4 p-4 ",
1114
- sm: "gap-2.5 px-4 py-3"
1157
+ sm: "gap-2.5 px-4 py-3",
1158
+ /**
1159
+ * The application row — 30px, the height a dense list actually uses:
1160
+ * an agent in a roster, a dataset, a schedule, a node type, a queue
1161
+ * entry. `min-h` rather than `h`, so a row that wraps still contains
1162
+ * its content instead of clipping it.
1163
+ */
1164
+ xs: "min-h-[30px] gap-2 px-2 py-1"
1165
+ },
1166
+ /**
1167
+ * Selection, not hover. A row the user has chosen stays marked while
1168
+ * they work elsewhere in the panel, which `:hover` cannot express.
1169
+ * Drive it from the same state that drives `aria-selected`.
1170
+ */
1171
+ selected: {
1172
+ true: "bg-accent",
1173
+ false: ""
1115
1174
  }
1116
1175
  },
1117
1176
  defaultVariants: {
1118
1177
  variant: "default",
1119
- size: "default"
1178
+ size: "default",
1179
+ selected: false
1120
1180
  }
1121
1181
  }
1122
1182
  );
@@ -1124,6 +1184,7 @@ function Item3({
1124
1184
  className,
1125
1185
  variant = "default",
1126
1186
  size = "default",
1187
+ selected,
1127
1188
  asChild = false,
1128
1189
  ...props
1129
1190
  }) {
@@ -1134,7 +1195,8 @@ function Item3({
1134
1195
  "data-slot": "item",
1135
1196
  "data-variant": variant,
1136
1197
  "data-size": size,
1137
- className: cn(itemVariants({ variant, size, className })),
1198
+ "data-selected": selected || void 0,
1199
+ className: cn(itemVariants({ variant, size, selected, className })),
1138
1200
  ...props
1139
1201
  }
1140
1202
  );
@@ -1188,7 +1250,7 @@ function ItemTitle({ className, ...props }) {
1188
1250
  {
1189
1251
  "data-slot": "item-title",
1190
1252
  className: cn(
1191
- "flex w-fit items-center gap-2 text-sm font-medium leading-snug",
1253
+ "flex w-fit items-center gap-2 font-medium leading-snug",
1192
1254
  className
1193
1255
  ),
1194
1256
  ...props
@@ -1201,7 +1263,9 @@ function ItemDescription({ className, ...props }) {
1201
1263
  {
1202
1264
  "data-slot": "item-description",
1203
1265
  className: cn(
1204
- "text-muted-foreground line-clamp-2 text-balance text-sm font-normal leading-normal",
1266
+ "text-muted-foreground line-clamp-2 text-balance font-normal leading-normal",
1267
+ // A dense row's subtitle is one line of meta, not a wrapped paragraph.
1268
+ "group-data-[size=xs]/item:line-clamp-1 group-data-[size=xs]/item:text-meta",
1205
1269
  "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
1206
1270
  className
1207
1271
  ),
@@ -1251,7 +1315,7 @@ function Kbd({ className, ...props }) {
1251
1315
  {
1252
1316
  "data-slot": "kbd",
1253
1317
  className: cn(
1254
- "bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-control px-1 font-sans text-xs font-medium",
1318
+ "bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-control px-1 font-sans text-meta font-medium",
1255
1319
  "[&_svg:not([class*='size-'])]:size-3",
1256
1320
  "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
1257
1321
  className
@@ -1441,7 +1505,7 @@ var MenubarShortcut = ({
1441
1505
  "span",
1442
1506
  {
1443
1507
  className: cn(
1444
- "ml-auto text-xs tracking-widest text-muted-foreground",
1508
+ "ml-auto text-meta tracking-widest text-muted-foreground",
1445
1509
  className
1446
1510
  ),
1447
1511
  ...props
@@ -1646,12 +1710,13 @@ var PopoverContent = React23__namespace.forwardRef(({ className, align = "center
1646
1710
  }
1647
1711
  ) }));
1648
1712
  PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
1649
- var Progress = React23__namespace.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1713
+ var Progress = React23__namespace.forwardRef(({ className, value, size = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1650
1714
  ProgressPrimitive__namespace.Root,
1651
1715
  {
1652
1716
  ref,
1653
1717
  className: cn(
1654
- "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
1718
+ "relative w-full overflow-hidden rounded-full bg-secondary",
1719
+ size === "sm" ? "h-1" : "h-4",
1655
1720
  className
1656
1721
  ),
1657
1722
  ...props,
@@ -1811,7 +1876,7 @@ var SheetDescription = React23__namespace.forwardRef(({ className, ...props }, r
1811
1876
  DialogPrimitive__namespace.Description,
1812
1877
  {
1813
1878
  ref,
1814
- className: cn("text-sm text-muted-foreground", className),
1879
+ className: cn("text-muted-foreground", className),
1815
1880
  ...props
1816
1881
  }
1817
1882
  ));
@@ -2109,7 +2174,7 @@ var SidebarInput = React23__namespace.forwardRef(({ className, type, ...props },
2109
2174
  "data-sidebar": "input",
2110
2175
  className: cn(
2111
2176
  // mirrors @invana/forms <Input> styling
2112
- "flex h-10 w-full rounded-control border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
2177
+ "flex h-10 w-full rounded-control border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2113
2178
  "h-8 w-full shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
2114
2179
  className
2115
2180
  ),
@@ -2189,7 +2254,7 @@ var SidebarGroupLabel = React23__namespace.forwardRef(({ className, asChild = fa
2189
2254
  ref,
2190
2255
  "data-sidebar": "group-label",
2191
2256
  className: cn(
2192
- "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
2257
+ "flex h-8 shrink-0 items-center rounded-md px-2 text-meta font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
2193
2258
  "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
2194
2259
  className
2195
2260
  ),
@@ -2222,7 +2287,7 @@ var SidebarGroupContent = React23__namespace.forwardRef(({ className, ...props }
2222
2287
  {
2223
2288
  ref,
2224
2289
  "data-sidebar": "group-content",
2225
- className: cn("w-full text-sm", className),
2290
+ className: cn("w-full", className),
2226
2291
  ...props
2227
2292
  }
2228
2293
  ));
@@ -2257,7 +2322,7 @@ var sidebarMenuButtonVariants = classVarianceAuthority.cva(
2257
2322
  },
2258
2323
  size: {
2259
2324
  default: "h-8",
2260
- sm: "h-7 text-sm",
2325
+ sm: "h-7",
2261
2326
  lg: "h-12 text-lg group-data-[collapsible=icon]:!p-0"
2262
2327
  }
2263
2328
  },
@@ -2342,7 +2407,7 @@ var SidebarMenuBadge = React23__namespace.forwardRef(({ className, ...props }, r
2342
2407
  ref,
2343
2408
  "data-sidebar": "menu-badge",
2344
2409
  className: cn(
2345
- "pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground",
2410
+ "pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-meta font-medium tabular-nums text-sidebar-foreground",
2346
2411
  "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
2347
2412
  "peer-data-[size=sm]/menu-button:top-1",
2348
2413
  "peer-data-[size=default]/menu-button:top-1.5",
@@ -2416,7 +2481,6 @@ var SidebarMenuSubButton = React23__namespace.forwardRef(({ asChild = false, siz
2416
2481
  className: cn(
2417
2482
  "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-control px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
2418
2483
  "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
2419
- size === "sm" && "text-sm",
2420
2484
  size === "md" && "text-lg",
2421
2485
  "group-data-[collapsible=icon]:hidden",
2422
2486
  className
@@ -2473,14 +2537,69 @@ function Spinner({ className, ...props }) {
2473
2537
  }
2474
2538
  );
2475
2539
  }
2476
- var Table = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto border rounded-md", children: /* @__PURE__ */ jsxRuntime.jsx(
2477
- "table",
2540
+ var statusDotVariants = classVarianceAuthority.cva("inline-block shrink-0 rounded-full", {
2541
+ variants: {
2542
+ tone: {
2543
+ /** Work in flight. The only tone that animates. */
2544
+ running: "bg-primary animate-pulse motion-reduce:animate-none",
2545
+ /** Finished, and the result stands. */
2546
+ success: "bg-success",
2547
+ /** Finished, but something wants a person to look. */
2548
+ warning: "bg-warning",
2549
+ /** Failed. */
2550
+ error: "bg-destructive",
2551
+ /** Informational — a note, a count, a neutral marker. */
2552
+ info: "bg-info",
2553
+ /** Not started. Hollow, because there is nothing in it yet. */
2554
+ queued: "bg-transparent border-[1.5px] border-muted-foreground",
2555
+ /** Present but inactive — retired, paused, skipped, hidden. */
2556
+ muted: "bg-muted-foreground"
2557
+ },
2558
+ size: {
2559
+ /** 5px — inside a dense step row. */
2560
+ xs: "size-[5px]",
2561
+ /** 6px — the default in a thread or a list row. */
2562
+ sm: "size-1.5",
2563
+ /** 8px — a roster row, a legend swatch. */
2564
+ md: "size-2",
2565
+ /** 10px — a legend key that stands on its own. */
2566
+ lg: "size-2.5"
2567
+ }
2568
+ },
2569
+ defaultVariants: {
2570
+ tone: "muted",
2571
+ size: "sm"
2572
+ }
2573
+ });
2574
+ var StatusDot = React23__namespace.forwardRef(
2575
+ ({ className, tone, size, label, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2576
+ "span",
2577
+ {
2578
+ ref,
2579
+ className: cn(statusDotVariants({ tone, size }), className),
2580
+ role: label ? "img" : void 0,
2581
+ "aria-label": label,
2582
+ "aria-hidden": label ? void 0 : true,
2583
+ ...props
2584
+ }
2585
+ )
2586
+ );
2587
+ StatusDot.displayName = "StatusDot";
2588
+ var Table = React23__namespace.forwardRef(({ className, density = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2589
+ "div",
2478
2590
  {
2479
- ref,
2480
- className: cn("w-full caption-bottom text-sm", className),
2481
- ...props
2591
+ "data-density": density,
2592
+ className: "group/table relative w-full overflow-auto border rounded-md",
2593
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2594
+ "table",
2595
+ {
2596
+ ref,
2597
+ className: cn("w-full caption-bottom", className),
2598
+ ...props
2599
+ }
2600
+ )
2482
2601
  }
2483
- ) }));
2602
+ ));
2484
2603
  Table.displayName = "Table";
2485
2604
  var TableHeader = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
2486
2605
  TableHeader.displayName = "TableHeader";
@@ -2523,6 +2642,11 @@ var TableHead = React23__namespace.forwardRef(({ className, ...props }, ref) =>
2523
2642
  ref,
2524
2643
  className: cn(
2525
2644
  "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2645
+ // Compact density: `<Table density="compact">` marks the wrapper, and
2646
+ // every cell follows from there. One prop on the table rather than a
2647
+ // size on <TableHead> and <TableCell> individually — four places to
2648
+ // forget, and a table with two densities in it is always a mistake.
2649
+ "group-data-[density=compact]/table:h-[26px] group-data-[density=compact]/table:text-meta",
2526
2650
  className
2527
2651
  ),
2528
2652
  ...props
@@ -2535,6 +2659,7 @@ var TableCell = React23__namespace.forwardRef(({ className, ...props }, ref) =>
2535
2659
  ref,
2536
2660
  className: cn(
2537
2661
  "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2662
+ "group-data-[density=compact]/table:px-2 group-data-[density=compact]/table:py-1",
2538
2663
  className
2539
2664
  ),
2540
2665
  ...props
@@ -2550,30 +2675,40 @@ var TableCaption = React23__namespace.forwardRef(({ className, ...props }, ref)
2550
2675
  }
2551
2676
  ));
2552
2677
  TableCaption.displayName = "TableCaption";
2553
- var Tabs = TabsPrimitive__namespace.Root;
2554
- var TabsList = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2555
- TabsPrimitive__namespace.List,
2556
- {
2557
- ref,
2558
- className: cn(
2559
- "inline-flex items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
2560
- className
2561
- ),
2562
- ...props
2563
- }
2564
- ));
2678
+ var TabsSizeContext = React23__namespace.createContext("default");
2679
+ var Tabs = React23__namespace.forwardRef(({ size = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, ...props }) }));
2680
+ Tabs.displayName = TabsPrimitive__namespace.Root.displayName;
2681
+ var TabsList = React23__namespace.forwardRef(({ className, ...props }, ref) => {
2682
+ const size = React23__namespace.useContext(TabsSizeContext);
2683
+ return /* @__PURE__ */ jsxRuntime.jsx(
2684
+ TabsPrimitive__namespace.List,
2685
+ {
2686
+ ref,
2687
+ className: cn(
2688
+ "inline-flex items-center justify-center text-muted-foreground",
2689
+ size === "sm" ? "h-[30px] gap-1" : "rounded-lg bg-muted p-1",
2690
+ className
2691
+ ),
2692
+ ...props
2693
+ }
2694
+ );
2695
+ });
2565
2696
  TabsList.displayName = TabsPrimitive__namespace.List.displayName;
2566
- var TabsTrigger = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2567
- TabsPrimitive__namespace.Trigger,
2568
- {
2569
- ref,
2570
- className: cn(
2571
- "inline-flex items-center justify-center whitespace-nowrap rounded-control px-3 py-1 font-medium ring-offset-background transition-colors text-muted-foreground hover:text-foreground hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary/15 data-[state=active]:text-primary data-[state=active]:ring-1 data-[state=active]:ring-primary/25 data-[state=active]:shadow-sm",
2572
- className
2573
- ),
2574
- ...props
2575
- }
2576
- ));
2697
+ var TabsTrigger = React23__namespace.forwardRef(({ className, ...props }, ref) => {
2698
+ const size = React23__namespace.useContext(TabsSizeContext);
2699
+ return /* @__PURE__ */ jsxRuntime.jsx(
2700
+ TabsPrimitive__namespace.Trigger,
2701
+ {
2702
+ ref,
2703
+ className: cn(
2704
+ size === "sm" ? "h-[26px] px-2 text-meta" : "px-3 py-1",
2705
+ "inline-flex items-center justify-center whitespace-nowrap rounded-control font-medium ring-offset-background transition-colors text-muted-foreground hover:text-foreground hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary/15 data-[state=active]:text-primary data-[state=active]:ring-1 data-[state=active]:ring-primary/25 data-[state=active]:shadow-sm",
2706
+ className
2707
+ ),
2708
+ ...props
2709
+ }
2710
+ );
2711
+ });
2577
2712
  TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
2578
2713
  var TabsContent = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2579
2714
  TabsPrimitive__namespace.Content,
@@ -2649,12 +2784,211 @@ var ToggleGroupItem = React23__namespace.forwardRef(({ className, children, vari
2649
2784
  );
2650
2785
  });
2651
2786
  ToggleGroupItem.displayName = ToggleGroupPrimitive__namespace.Item.displayName;
2787
+ var agentChipVariants = classVarianceAuthority.cva(
2788
+ "inline-flex max-w-full shrink-0 items-center gap-1 rounded-control border px-1.5 text-meta [&_svg]:size-3 [&_svg]:shrink-0",
2789
+ {
2790
+ variants: {
2791
+ /**
2792
+ * Who this is. The distinction is the point of the component: a reader
2793
+ * scanning a task list needs to know at a glance whether a person or an
2794
+ * agent is holding it, and reading the name is too slow.
2795
+ */
2796
+ kind: {
2797
+ agent: "border-border bg-transparent text-foreground",
2798
+ person: "border-transparent bg-accent text-foreground"
2799
+ },
2800
+ /** A retired or paused agent still appears in history and lineage. */
2801
+ inactive: {
2802
+ true: "opacity-60",
2803
+ false: ""
2804
+ }
2805
+ },
2806
+ defaultVariants: { kind: "agent", inactive: false }
2807
+ }
2808
+ );
2809
+ var AgentChip = React23__namespace.forwardRef(
2810
+ ({ icon, name, kind, inactive, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
2811
+ "span",
2812
+ {
2813
+ ref,
2814
+ className: cn(agentChipVariants({ kind, inactive }), className),
2815
+ ...props,
2816
+ children: [
2817
+ icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center text-muted-foreground", children: icon }) : null,
2818
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: name })
2819
+ ]
2820
+ }
2821
+ )
2822
+ );
2823
+ AgentChip.displayName = "AgentChip";
2824
+ var stateVariants = classVarianceAuthority.cva("inline-flex shrink-0 items-center gap-1.5 font-medium", {
2825
+ variants: {
2826
+ tone: {
2827
+ active: "text-success",
2828
+ running: "text-primary",
2829
+ draft: "text-muted-foreground",
2830
+ review: "text-warning",
2831
+ error: "text-destructive"
2832
+ }
2833
+ },
2834
+ defaultVariants: { tone: "active" }
2835
+ });
2836
+ var AppStatusBar = React23__namespace.forwardRef(
2837
+ ({ state, tone, end, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
2838
+ "div",
2839
+ {
2840
+ ref,
2841
+ className: cn(
2842
+ "flex h-[25px] shrink-0 items-center gap-2 border-t border-border px-2 text-meta text-muted-foreground",
2843
+ className
2844
+ ),
2845
+ ...props,
2846
+ children: [
2847
+ state != null ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(stateVariants({ tone })), children: [
2848
+ /* @__PURE__ */ jsxRuntime.jsx(
2849
+ StatusDot,
2850
+ {
2851
+ tone: tone === "error" ? "error" : tone === "review" ? "warning" : tone === "running" ? "running" : tone === "draft" ? "muted" : "success"
2852
+ }
2853
+ ),
2854
+ state
2855
+ ] }) : null,
2856
+ state != null && children ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u2022" }) : null,
2857
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
2858
+ end != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: end }) : null
2859
+ ]
2860
+ }
2861
+ )
2862
+ );
2863
+ AppStatusBar.displayName = "AppStatusBar";
2864
+ var BarChartH = React23__namespace.forwardRef(
2865
+ ({
2866
+ data,
2867
+ max,
2868
+ labelWidth = 78,
2869
+ color = "var(--color-data-1)",
2870
+ caption,
2871
+ className,
2872
+ ...props
2873
+ }, ref) => {
2874
+ const ceiling = max ?? (Math.max(...data.map((d) => d.value), 0) || 1);
2875
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
2876
+ caption != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
2877
+ data.map((d, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-4 items-center gap-2", children: [
2878
+ /* @__PURE__ */ jsxRuntime.jsx(
2879
+ "span",
2880
+ {
2881
+ className: "shrink-0 truncate text-meta text-muted-foreground",
2882
+ style: { width: labelWidth },
2883
+ children: d.label
2884
+ }
2885
+ ),
2886
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
2887
+ /* @__PURE__ */ jsxRuntime.jsx(
2888
+ "span",
2889
+ {
2890
+ title: `${d.label}: ${d.display ?? d.value}`,
2891
+ className: "h-2.5 shrink-0 rounded-e-[4px]",
2892
+ style: {
2893
+ width: `${Math.max(0, d.value / ceiling * 100)}%`,
2894
+ background: d.color ?? color
2895
+ }
2896
+ }
2897
+ ),
2898
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-meta tabular-nums", children: d.display ?? d.value })
2899
+ ] })
2900
+ ] }, i))
2901
+ ] });
2902
+ }
2903
+ );
2904
+ BarChartH.displayName = "BarChartH";
2905
+ var BarChartV = React23__namespace.forwardRef(
2906
+ ({
2907
+ data,
2908
+ max,
2909
+ gridlines = [],
2910
+ height = 160,
2911
+ color = "var(--color-data-1)",
2912
+ highlightColor,
2913
+ highlightIndex,
2914
+ labelMode = "last",
2915
+ caption,
2916
+ className,
2917
+ ...props
2918
+ }, ref) => {
2919
+ const ceiling = max ?? (Math.max(...data.map((d) => d.value), 0) || 1);
2920
+ const emphasis = highlightIndex ?? data.length - 1;
2921
+ const labelled = (i) => labelMode === "all" || labelMode === "last" && i === emphasis;
2922
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
2923
+ caption != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
2924
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative mt-2", style: { height }, children: [
2925
+ gridlines.map((g) => /* @__PURE__ */ jsxRuntime.jsxs(
2926
+ "div",
2927
+ {
2928
+ "aria-hidden": true,
2929
+ className: "absolute inset-x-0 flex translate-y-1/2 items-center",
2930
+ style: { bottom: `${g / ceiling * 100}%` },
2931
+ children: [
2932
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-px flex-1 bg-border" }),
2933
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pl-1 text-meta tabular-nums text-muted-foreground", children: g })
2934
+ ]
2935
+ },
2936
+ g
2937
+ )),
2938
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-end justify-between gap-2", children: data.map((d, i) => /* @__PURE__ */ jsxRuntime.jsxs(
2939
+ "div",
2940
+ {
2941
+ className: "flex h-full min-w-0 flex-1 flex-col items-center justify-end gap-1",
2942
+ children: [
2943
+ labelled(i) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta tabular-nums", children: d.display ?? d.value }) : null,
2944
+ /* @__PURE__ */ jsxRuntime.jsx(
2945
+ "span",
2946
+ {
2947
+ title: `${d.label}: ${d.display ?? d.value}`,
2948
+ className: "w-full max-w-6 rounded-t-[4px]",
2949
+ style: {
2950
+ height: `${Math.max(0, d.value / ceiling * 100)}%`,
2951
+ background: i === emphasis ? highlightColor ?? color : color,
2952
+ opacity: i === emphasis ? 1 : 0.55
2953
+ }
2954
+ }
2955
+ )
2956
+ ]
2957
+ },
2958
+ i
2959
+ )) })
2960
+ ] }),
2961
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between gap-2", children: data.map((d, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col items-center", children: [
2962
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-meta text-muted-foreground", children: d.label }),
2963
+ d.sublabel != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-meta text-muted-foreground/70", children: d.sublabel }) : null
2964
+ ] }, i)) })
2965
+ ] });
2966
+ }
2967
+ );
2968
+ BarChartV.displayName = "BarChartV";
2652
2969
  function ButtonWithTooltip(props) {
2653
2970
  return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { delayDuration: 0, children: [
2654
2971
  /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", className: cn("hover:bg-transparent", props.className), ...props, children: props.children }) }),
2655
2972
  /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: props.tooltip })
2656
2973
  ] }) });
2657
2974
  }
2975
+ var CannotAnswerCard = React23__namespace.forwardRef(({ label = "cannot answer", remedy, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
2976
+ "div",
2977
+ {
2978
+ ref,
2979
+ className: cn(
2980
+ "flex flex-col gap-1 border border-dashed border-border bg-card p-2",
2981
+ className
2982
+ ),
2983
+ ...props,
2984
+ children: [
2985
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta font-medium text-muted-foreground", children: label }),
2986
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
2987
+ remedy != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: remedy }) : null
2988
+ ]
2989
+ }
2990
+ ));
2991
+ CannotAnswerCard.displayName = "CannotAnswerCard";
2658
2992
  function ChatSession({
2659
2993
  children,
2660
2994
  footer,
@@ -2792,12 +3126,14 @@ var NavItems = ({
2792
3126
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.map((item) => {
2793
3127
  const isActive = activeItem === item.name;
2794
3128
  const padding = item.label ? "px-3 py-1.5" : "px-2 py-2";
2795
- const isInteractive = Boolean(item.href || item.onClick);
2796
- const itemClass = `inline-flex border-0 items-center justify-center gap-2
3129
+ const hasMenu = !item.href && Boolean(item.menuItems?.length);
3130
+ const isInteractive = Boolean(item.href || item.onClick || hasMenu);
3131
+ const itemClass = `relative inline-flex border-0 items-center justify-center gap-2
2797
3132
  whitespace-nowrap rounded-control transition-colors
2798
3133
  ring-1 ring-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
2799
3134
  ${padding}
2800
3135
  ${isInteractive ? "cursor-pointer hover:bg-primary/10 hover:text-primary hover:ring-primary/25" : ""}
3136
+ ${hasMenu ? "data-[state=open]:bg-primary/15 data-[state=open]:text-primary data-[state=open]:ring-primary/25" : ""}
2801
3137
  ${isActive ? `bg-primary/15 text-primary ring-primary/25 ${item.activeClass || ""}` : ""}
2802
3138
  ${item.className || ""}`;
2803
3139
  const icon = item.icon && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2807,40 +3143,76 @@ var NavItems = ({
2807
3143
  className: item.iconClassName || iconClassName
2808
3144
  }
2809
3145
  );
2810
- const label = item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: item.label });
3146
+ const label = item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label });
3147
+ const badge = item.badge != null && /* @__PURE__ */ jsxRuntime.jsx(
3148
+ "span",
3149
+ {
3150
+ className: "pointer-events-none absolute -right-0.5 -top-0.5 inline-flex h-3.5\n min-w-3.5 items-center justify-center rounded-full bg-primary px-1\n text-[9px] font-semibold leading-none text-primary-foreground",
3151
+ children: item.badge
3152
+ }
3153
+ );
3154
+ const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3155
+ icon,
3156
+ label,
3157
+ badge
3158
+ ] });
3159
+ const control = item.href ? /* @__PURE__ */ jsxRuntime.jsx(
3160
+ "a",
3161
+ {
3162
+ href: item.href,
3163
+ onClick: () => setActiveItem(item.name),
3164
+ className: itemClass,
3165
+ children: inner
3166
+ }
3167
+ ) : item.onClick || hasMenu ? /* @__PURE__ */ jsxRuntime.jsx(
3168
+ "button",
3169
+ {
3170
+ type: "button",
3171
+ onClick: () => {
3172
+ item.onClick?.();
3173
+ if (!hasMenu) setActiveItem(isActive ? null : item.name);
3174
+ },
3175
+ className: itemClass,
3176
+ children: inner
3177
+ }
3178
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: itemClass, children: inner });
3179
+ const withTooltip = /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
3180
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: hasMenu ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: control }) : control }),
3181
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: item.tooltipSide || tooltipSide, children: item.tooltip || item.name })
3182
+ ] });
2811
3183
  return /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.default.Fragment, { children: [
2812
- /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
2813
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: item.href ? /* @__PURE__ */ jsxRuntime.jsxs(
2814
- "a",
2815
- {
2816
- href: item.href,
2817
- onClick: () => setActiveItem(item.name),
2818
- className: itemClass,
2819
- children: [
2820
- icon,
2821
- label
2822
- ]
2823
- }
2824
- ) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsxs(
2825
- "button",
3184
+ hasMenu ? /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
3185
+ withTooltip,
3186
+ /* @__PURE__ */ jsxRuntime.jsx(
3187
+ DropdownMenuContent,
2826
3188
  {
2827
- type: "button",
2828
- onClick: () => {
2829
- item.onClick?.();
2830
- setActiveItem(isActive ? null : item.name);
2831
- },
2832
- className: itemClass,
2833
- children: [
2834
- icon,
2835
- label
2836
- ]
3189
+ side: isVertical ? "right" : "bottom",
3190
+ align: isVertical ? "start" : "end",
3191
+ children: item.menuItems?.map((menuItem) => {
3192
+ const MenuIcon = menuItem.icon;
3193
+ const gutter = item.menuItems?.some((m) => m.icon);
3194
+ return /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.default.Fragment, { children: [
3195
+ menuItem.separatorBefore && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
3196
+ /* @__PURE__ */ jsxRuntime.jsxs(
3197
+ DropdownMenuItem,
3198
+ {
3199
+ disabled: menuItem.disabled,
3200
+ onSelect: () => menuItem.onSelect?.(),
3201
+ className: cn(
3202
+ menuItem.destructive && "text-destructive focus:bg-destructive/15 focus:text-destructive hover:bg-destructive/10 hover:text-destructive"
3203
+ ),
3204
+ children: [
3205
+ MenuIcon ? /* @__PURE__ */ jsxRuntime.jsx(MenuIcon, {}) : gutter ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "size-4 shrink-0" }) : null,
3206
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: menuItem.label }),
3207
+ menuItem.shortcut && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuShortcut, { children: menuItem.shortcut })
3208
+ ]
3209
+ }
3210
+ )
3211
+ ] }, menuItem.id);
3212
+ })
2837
3213
  }
2838
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: itemClass, children: [
2839
- icon,
2840
- label
2841
- ] }) }),
2842
- /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: item.tooltipSide || tooltipSide, children: item.tooltip || item.name })
2843
- ] }),
3214
+ )
3215
+ ] }) : withTooltip,
2844
3216
  item.showSeperator && /* @__PURE__ */ jsxRuntime.jsx(
2845
3217
  Separator,
2846
3218
  {
@@ -3247,67 +3619,604 @@ function ChatSessionStatusBar({
3247
3619
  }
3248
3620
  );
3249
3621
  }
3250
- var ErrorBoundary = class extends React23.Component {
3251
- constructor(props) {
3252
- super(props);
3253
- this.state = { hasError: false };
3254
- }
3255
- static getDerivedStateFromError(_) {
3256
- return { hasError: true };
3257
- }
3258
- componentDidCatch(error, errorInfo) {
3259
- console.error("ErrorBoundary caught an error", error, errorInfo);
3260
- }
3261
- render() {
3262
- if (this.state.hasError) {
3263
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center h-full w-full text-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center", children: [
3264
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Frown, { className: "mr-1 h-4" }),
3265
- "Oops ! something went wrong."
3266
- ] }) });
3267
- }
3268
- return this.props.children;
3269
- }
3270
- };
3271
- var MenuItem = ({
3272
- label,
3273
- icon: Icon,
3274
- shortcut,
3275
- children,
3622
+ function ChatSessionContextChip({
3623
+ icon,
3624
+ onDismiss,
3625
+ dismissLabel = "Remove context",
3276
3626
  className,
3277
- level = 0,
3278
- href,
3279
- onClick
3280
- }) => {
3281
- const hasChildren = children && children.length > 0;
3282
- const ButtonOrLink = href ? "a" : "button";
3283
- const clickTrigger = href ? { href } : { onClick };
3284
- return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "relative group/item", children: [
3285
- /* @__PURE__ */ jsxRuntime.jsxs(
3286
- ButtonOrLink,
3287
- {
3288
- ...clickTrigger,
3289
- className: cn(
3290
- "flex w-full items-center justify-between px-4 py-2 ",
3291
- "hover:bg-accent hover:text-accent-foreground",
3292
- "focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",
3293
- className,
3294
- level === 0 ? "font-medium" : "font-normal"
3295
- // "group-hover/item:bg-accent/50"
3296
- ),
3297
- role: hasChildren ? "menuitem" : void 0,
3298
- "aria-haspopup": hasChildren ? "true" : void 0,
3299
- "aria-expanded": hasChildren ? "true" : void 0,
3300
- children: [
3301
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
3302
- Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-4 w-4" }),
3303
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
3304
- ] }),
3305
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
3306
- shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100", children: shortcut }),
3307
- hasChildren && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
3308
- ] })
3309
- ]
3310
- }
3627
+ children,
3628
+ ...props
3629
+ }) {
3630
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3631
+ "div",
3632
+ {
3633
+ className: cn(
3634
+ "flex min-h-[26px] items-center gap-1.5 border border-border bg-muted/40 px-1.5 text-meta",
3635
+ className
3636
+ ),
3637
+ ...props,
3638
+ children: [
3639
+ icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center text-muted-foreground [&_svg]:size-3", children: icon }) : null,
3640
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
3641
+ onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
3642
+ "button",
3643
+ {
3644
+ type: "button",
3645
+ onClick: onDismiss,
3646
+ "aria-label": dismissLabel,
3647
+ className: "shrink-0 px-1 text-muted-foreground hover:text-foreground",
3648
+ children: "\xD7"
3649
+ }
3650
+ ) : null
3651
+ ]
3652
+ }
3653
+ );
3654
+ }
3655
+ var CitationList = React23__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("ul", { ref, className: cn("flex flex-col", className), ...props, children }));
3656
+ CitationList.displayName = "CitationList";
3657
+ var CitationRow = React23__namespace.forwardRef(
3658
+ ({ kind, source, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3659
+ "li",
3660
+ {
3661
+ ref,
3662
+ className: cn("flex min-h-[26px] items-center gap-2 py-0.5", className),
3663
+ ...props,
3664
+ children: [
3665
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 border border-border px-1 text-meta text-muted-foreground", children: kind }),
3666
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children }),
3667
+ source != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: source }) : null
3668
+ ]
3669
+ }
3670
+ )
3671
+ );
3672
+ CitationRow.displayName = "CitationRow";
3673
+ var ClarifyCard = React23__namespace.forwardRef(
3674
+ ({
3675
+ step,
3676
+ waiting,
3677
+ question,
3678
+ options,
3679
+ value,
3680
+ onSelect,
3681
+ actions,
3682
+ footnote,
3683
+ className,
3684
+ ...props
3685
+ }, ref) => {
3686
+ const name = React23__namespace.useId();
3687
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3688
+ "div",
3689
+ {
3690
+ ref,
3691
+ className: cn("flex flex-col overflow-hidden border border-border bg-card", className),
3692
+ ...props,
3693
+ children: [
3694
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-6 shrink-0 items-center gap-2 border-b border-border bg-muted/40 px-2 text-meta", children: [
3695
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium", children: "question" }),
3696
+ step != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-muted-foreground", children: step }) : null,
3697
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
3698
+ waiting != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: waiting }) : null
3699
+ ] }),
3700
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 p-2", children: [
3701
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: question }),
3702
+ /* @__PURE__ */ jsxRuntime.jsx("div", { role: "radiogroup", className: "flex flex-col gap-1", children: options.map((o) => {
3703
+ const checked = value === o.value;
3704
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3705
+ "label",
3706
+ {
3707
+ className: cn(
3708
+ "flex min-h-[30px] cursor-pointer items-center gap-2 border px-2 py-1",
3709
+ checked ? "border-primary/40 bg-primary/10" : "border-border",
3710
+ o.disabled && "cursor-not-allowed opacity-50"
3711
+ ),
3712
+ children: [
3713
+ /* @__PURE__ */ jsxRuntime.jsx(
3714
+ "input",
3715
+ {
3716
+ type: "radio",
3717
+ name,
3718
+ value: o.value,
3719
+ checked,
3720
+ disabled: o.disabled,
3721
+ onChange: () => onSelect?.(o.value),
3722
+ className: "sr-only"
3723
+ }
3724
+ ),
3725
+ /* @__PURE__ */ jsxRuntime.jsx(
3726
+ "span",
3727
+ {
3728
+ "aria-hidden": true,
3729
+ className: cn(
3730
+ "flex size-3.5 shrink-0 items-center justify-center rounded-full border",
3731
+ checked ? "border-primary" : "border-muted-foreground"
3732
+ ),
3733
+ children: checked ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-1.5 rounded-full bg-primary" }) : null
3734
+ }
3735
+ ),
3736
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: o.label }),
3737
+ o.detail != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-meta text-muted-foreground", children: o.detail }) : null
3738
+ ]
3739
+ },
3740
+ o.value
3741
+ );
3742
+ }) }),
3743
+ actions || footnote != null ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
3744
+ actions,
3745
+ footnote != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-meta text-muted-foreground", children: footnote }) : null
3746
+ ] }) : null
3747
+ ] })
3748
+ ]
3749
+ }
3750
+ );
3751
+ }
3752
+ );
3753
+ ClarifyCard.displayName = "ClarifyCard";
3754
+ var ContextBar = React23__namespace.forwardRef(
3755
+ ({ counters, hint, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3756
+ "div",
3757
+ {
3758
+ ref,
3759
+ className: cn(
3760
+ "flex h-7 shrink-0 items-center gap-3 border-t border-border px-2 text-meta",
3761
+ className
3762
+ ),
3763
+ ...props,
3764
+ children: [
3765
+ children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 shrink-0 items-center gap-2", children }) : null,
3766
+ counters ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 items-center gap-3 text-muted-foreground", children: counters }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
3767
+ hint != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: hint }) : null
3768
+ ]
3769
+ }
3770
+ )
3771
+ );
3772
+ ContextBar.displayName = "ContextBar";
3773
+ var DiagnosisCard = React23__namespace.forwardRef(({ code, attempted, target, actions, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3774
+ "div",
3775
+ {
3776
+ ref,
3777
+ className: cn("flex flex-col gap-2 border border-destructive/40 bg-card p-2", className),
3778
+ ...props,
3779
+ children: [
3780
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-meta", children: [
3781
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium text-destructive", children: "diagnosis" }),
3782
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-mono text-muted-foreground", children: code })
3783
+ ] }),
3784
+ children != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { children }) : null,
3785
+ attempted != null || target != null ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 border border-border bg-muted/40 p-1.5", children: [
3786
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: "what was tried" }),
3787
+ attempted != null ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: "whitespace-pre-wrap break-all font-mono text-meta", children: attempted }) : null,
3788
+ target != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: target }) : null
3789
+ ] }) : null,
3790
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5", children: actions }) : null
3791
+ ]
3792
+ }
3793
+ ));
3794
+ DiagnosisCard.displayName = "DiagnosisCard";
3795
+ var OP_SIGN = { add: "+", remove: "\u2212", change: "~" };
3796
+ var OP_CLASS = {
3797
+ add: "text-success",
3798
+ remove: "text-destructive",
3799
+ change: "text-warning"
3800
+ };
3801
+ var DiffList = React23__namespace.forwardRef(
3802
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("ul", { ref, className: cn("flex flex-col", className), ...props, children })
3803
+ );
3804
+ DiffList.displayName = "DiffList";
3805
+ var DiffRow = React23__namespace.forwardRef(
3806
+ ({ op = "add", kind, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3807
+ "li",
3808
+ {
3809
+ ref,
3810
+ className: cn("flex items-baseline gap-2 py-0.5 text-meta", className),
3811
+ ...props,
3812
+ children: [
3813
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("w-3 shrink-0 text-center font-mono", OP_CLASS[op]), children: OP_SIGN[op] }),
3814
+ kind != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: kind }) : null,
3815
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children })
3816
+ ]
3817
+ }
3818
+ )
3819
+ );
3820
+ DiffRow.displayName = "DiffRow";
3821
+ var DivergingBar = React23__namespace.forwardRef(
3822
+ ({
3823
+ data,
3824
+ max,
3825
+ labelWidth = 104,
3826
+ positiveColor = "var(--color-success)",
3827
+ negativeColor = "var(--color-destructive)",
3828
+ caption,
3829
+ className,
3830
+ ...props
3831
+ }, ref) => {
3832
+ const ceiling = max ?? (Math.max(...data.map((d) => Math.abs(d.value)), 0) || 1);
3833
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
3834
+ caption != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
3835
+ data.map((d, i) => {
3836
+ const positive = d.value >= 0;
3837
+ const width = `${Math.abs(d.value) / ceiling * 50}%`;
3838
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-4 items-center gap-2", children: [
3839
+ /* @__PURE__ */ jsxRuntime.jsx(
3840
+ "span",
3841
+ {
3842
+ className: "shrink-0 truncate text-meta text-muted-foreground",
3843
+ style: { width: labelWidth },
3844
+ children: d.label
3845
+ }
3846
+ ),
3847
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex min-w-0 flex-1 items-center", children: [
3848
+ /* @__PURE__ */ jsxRuntime.jsx(
3849
+ "span",
3850
+ {
3851
+ "aria-hidden": true,
3852
+ className: "absolute left-1/2 h-4 w-px -translate-x-1/2 bg-border"
3853
+ }
3854
+ ),
3855
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex w-1/2 justify-end", children: !positive ? /* @__PURE__ */ jsxRuntime.jsx(
3856
+ "span",
3857
+ {
3858
+ title: `${d.label}: ${d.display ?? d.value}`,
3859
+ className: "h-2.5 rounded-s-[4px]",
3860
+ style: { width, background: negativeColor }
3861
+ }
3862
+ ) : null }),
3863
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex w-1/2 justify-start", children: positive ? /* @__PURE__ */ jsxRuntime.jsx(
3864
+ "span",
3865
+ {
3866
+ title: `${d.label}: ${d.display ?? d.value}`,
3867
+ className: "h-2.5 rounded-e-[4px]",
3868
+ style: { width, background: positiveColor }
3869
+ }
3870
+ ) : null })
3871
+ ] }),
3872
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-8 shrink-0 text-right text-meta tabular-nums", children: d.display ?? (d.value > 0 ? `+${d.value}` : d.value) })
3873
+ ] }, i);
3874
+ })
3875
+ ] });
3876
+ }
3877
+ );
3878
+ DivergingBar.displayName = "DivergingBar";
3879
+ var EmissionHeader = React23__namespace.forwardRef(({ kind, template, citation, note, actions, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3880
+ "div",
3881
+ {
3882
+ ref,
3883
+ className: cn(
3884
+ "flex h-6 shrink-0 items-center gap-2 border-b border-border bg-muted/40 px-2 text-meta",
3885
+ className
3886
+ ),
3887
+ ...props,
3888
+ children: [
3889
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium", children: kind }),
3890
+ template != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-mono text-muted-foreground", children: template }) : null,
3891
+ note != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 border border-border px-1 text-muted-foreground", children: note }) : null,
3892
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
3893
+ citation != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: citation }) : null,
3894
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center", children: actions }) : null
3895
+ ]
3896
+ }
3897
+ ));
3898
+ EmissionHeader.displayName = "EmissionHeader";
3899
+ var EmissionCard = React23__namespace.forwardRef(
3900
+ ({
3901
+ kind,
3902
+ template,
3903
+ citation,
3904
+ note,
3905
+ actions,
3906
+ showHeader = true,
3907
+ className,
3908
+ children,
3909
+ ...props
3910
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3911
+ "div",
3912
+ {
3913
+ ref,
3914
+ "data-kind": kind,
3915
+ className: cn("flex flex-col overflow-hidden border border-border bg-card", className),
3916
+ ...props,
3917
+ children: [
3918
+ showHeader ? /* @__PURE__ */ jsxRuntime.jsx(
3919
+ EmissionHeader,
3920
+ {
3921
+ kind,
3922
+ template,
3923
+ citation,
3924
+ note,
3925
+ actions
3926
+ }
3927
+ ) : null,
3928
+ children
3929
+ ]
3930
+ }
3931
+ )
3932
+ );
3933
+ EmissionCard.displayName = "EmissionCard";
3934
+ var CitationMarker = React23__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3935
+ "sup",
3936
+ {
3937
+ ref,
3938
+ className: cn("px-0.5 align-super text-[0.7em] text-primary", className),
3939
+ ...props,
3940
+ children
3941
+ }
3942
+ ));
3943
+ CitationMarker.displayName = "CitationMarker";
3944
+ var EmptyState = React23__namespace.forwardRef(
3945
+ ({ icon, title, description, actions, locks, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3946
+ "div",
3947
+ {
3948
+ ref,
3949
+ className: cn(
3950
+ "flex flex-col items-center justify-center gap-2 p-6 text-center",
3951
+ className
3952
+ ),
3953
+ ...props,
3954
+ children: [
3955
+ icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children: icon }) : null,
3956
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-medium", children: title }),
3957
+ description != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-prose text-muted-foreground", children: description }) : null,
3958
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center justify-center gap-1.5 pt-1", children: actions }) : null,
3959
+ locks ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center justify-center gap-1.5 pt-1", children: locks }) : null
3960
+ ]
3961
+ }
3962
+ )
3963
+ );
3964
+ EmptyState.displayName = "EmptyState";
3965
+ var EmptyStateLock = React23__namespace.forwardRef(({ icon, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
3966
+ "span",
3967
+ {
3968
+ ref,
3969
+ className: cn(
3970
+ "inline-flex h-6 items-center gap-1.5 border border-dashed border-border px-2 text-meta text-muted-foreground [&_svg]:size-3",
3971
+ className
3972
+ ),
3973
+ ...props,
3974
+ children: [
3975
+ icon,
3976
+ children
3977
+ ]
3978
+ }
3979
+ ));
3980
+ EmptyStateLock.displayName = "EmptyStateLock";
3981
+ var ErrorBoundary = class extends React23.Component {
3982
+ constructor(props) {
3983
+ super(props);
3984
+ this.state = { hasError: false };
3985
+ }
3986
+ static getDerivedStateFromError(_) {
3987
+ return { hasError: true };
3988
+ }
3989
+ componentDidCatch(error, errorInfo) {
3990
+ console.error("ErrorBoundary caught an error", error, errorInfo);
3991
+ }
3992
+ render() {
3993
+ if (this.state.hasError) {
3994
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center", children: [
3995
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Frown, { className: "mr-1 h-4" }),
3996
+ "Oops ! something went wrong."
3997
+ ] }) });
3998
+ }
3999
+ return this.props.children;
4000
+ }
4001
+ };
4002
+ var FilterBar = React23__namespace.forwardRef(
4003
+ ({ summary, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4004
+ "div",
4005
+ {
4006
+ ref,
4007
+ className: cn(
4008
+ "flex h-[30px] shrink-0 items-center gap-1.5 border-b border-border px-2",
4009
+ className
4010
+ ),
4011
+ ...props,
4012
+ children: [
4013
+ children,
4014
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
4015
+ summary != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: summary }) : null
4016
+ ]
4017
+ }
4018
+ )
4019
+ );
4020
+ FilterBar.displayName = "FilterBar";
4021
+ var FilterChip = React23__namespace.forwardRef(
4022
+ ({ label, value, active, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4023
+ Button,
4024
+ {
4025
+ ref,
4026
+ type: "button",
4027
+ variant: "outline",
4028
+ size: "xs",
4029
+ "data-active": active || void 0,
4030
+ className: cn(
4031
+ "h-[22px] gap-1 px-1.5 font-normal",
4032
+ active && "border-primary/40 text-primary",
4033
+ className
4034
+ ),
4035
+ ...props,
4036
+ children: [
4037
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(value != null && "text-muted-foreground"), children: label }),
4038
+ value != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: value }) : null,
4039
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: "\u25BE" })
4040
+ ]
4041
+ }
4042
+ )
4043
+ );
4044
+ FilterChip.displayName = "FilterChip";
4045
+ var HeatStrip = React23__namespace.forwardRef(
4046
+ ({ cells, states, ticks, cellSize = 14, className, ...props }, ref) => {
4047
+ const byKey = React23__namespace.useMemo(
4048
+ () => new Map(states.map((s) => [s.key, s])),
4049
+ [states]
4050
+ );
4051
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
4052
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: cells.map((c, i) => {
4053
+ const s = byKey.get(c.state);
4054
+ return /* @__PURE__ */ jsxRuntime.jsx(
4055
+ "span",
4056
+ {
4057
+ title: `${c.at} \xB7 ${s?.label ?? c.state}${c.detail ? ` \xB7 ${c.detail}` : ""}`,
4058
+ className: cn("shrink-0 rounded-[2px]", s?.hollow && "border"),
4059
+ style: {
4060
+ width: cellSize,
4061
+ height: cellSize,
4062
+ background: s?.hollow ? "transparent" : s?.color ?? "var(--color-muted)",
4063
+ borderColor: s?.hollow ? s.color ?? "var(--color-border)" : void 0
4064
+ }
4065
+ },
4066
+ i
4067
+ );
4068
+ }) }),
4069
+ ticks?.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", "aria-hidden": true, children: cells.map((_, i) => {
4070
+ const tick = ticks.find((t) => t.at === i);
4071
+ return /* @__PURE__ */ jsxRuntime.jsx(
4072
+ "span",
4073
+ {
4074
+ className: "shrink-0 text-meta tabular-nums text-muted-foreground",
4075
+ style: { width: cellSize },
4076
+ children: tick ? tick.label : ""
4077
+ },
4078
+ i
4079
+ );
4080
+ }) }) : null,
4081
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-meta", children: states.map((s) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
4082
+ /* @__PURE__ */ jsxRuntime.jsx(
4083
+ "span",
4084
+ {
4085
+ "aria-hidden": true,
4086
+ className: cn("size-2.5 shrink-0 rounded-[2px]", s.hollow && "border"),
4087
+ style: {
4088
+ background: s.hollow ? "transparent" : s.color ?? "var(--color-muted)",
4089
+ borderColor: s.hollow ? s.color ?? "var(--color-border)" : void 0
4090
+ }
4091
+ }
4092
+ ),
4093
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: s.label })
4094
+ ] }, s.key)) })
4095
+ ] });
4096
+ }
4097
+ );
4098
+ HeatStrip.displayName = "HeatStrip";
4099
+ function Swatch({ kind = "dot", color }) {
4100
+ const style = { color };
4101
+ if (kind === "dot")
4102
+ return /* @__PURE__ */ jsxRuntime.jsx(
4103
+ "span",
4104
+ {
4105
+ "aria-hidden": true,
4106
+ style,
4107
+ className: "size-2 shrink-0 rounded-full bg-current"
4108
+ }
4109
+ );
4110
+ if (kind === "ring")
4111
+ return /* @__PURE__ */ jsxRuntime.jsx(
4112
+ "span",
4113
+ {
4114
+ "aria-hidden": true,
4115
+ style,
4116
+ className: "size-2 shrink-0 rounded-full border-[1.5px] border-current"
4117
+ }
4118
+ );
4119
+ if (kind === "line")
4120
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, style, className: "h-0.5 w-4 shrink-0 bg-current" });
4121
+ if (kind === "dashed")
4122
+ return /* @__PURE__ */ jsxRuntime.jsx(
4123
+ "span",
4124
+ {
4125
+ "aria-hidden": true,
4126
+ style,
4127
+ className: "h-0 w-4 shrink-0 border-t-[1.5px] border-dashed border-current"
4128
+ }
4129
+ );
4130
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4131
+ "svg",
4132
+ {
4133
+ "aria-hidden": true,
4134
+ style,
4135
+ className: "w-4 shrink-0 overflow-visible",
4136
+ viewBox: "0 0 16 6",
4137
+ height: "6",
4138
+ fill: "none",
4139
+ children: [
4140
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 3h11", stroke: "currentColor", strokeWidth: "2" }),
4141
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 0l6 3-6 3z", fill: "currentColor" })
4142
+ ]
4143
+ }
4144
+ );
4145
+ }
4146
+ var Legend = React23__namespace.forwardRef(
4147
+ ({ orientation = "row", className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4148
+ "div",
4149
+ {
4150
+ ref,
4151
+ role: "list",
4152
+ className: cn(
4153
+ "flex gap-x-3 gap-y-1 text-meta",
4154
+ orientation === "row" ? "flex-wrap items-center" : "flex-col",
4155
+ className
4156
+ ),
4157
+ ...props,
4158
+ children
4159
+ }
4160
+ )
4161
+ );
4162
+ Legend.displayName = "Legend";
4163
+ var LegendItem = React23__namespace.forwardRef(
4164
+ ({ kind, color, label, count, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4165
+ "div",
4166
+ {
4167
+ ref,
4168
+ role: "listitem",
4169
+ className: cn("flex min-w-0 items-center gap-1.5", className),
4170
+ ...props,
4171
+ children: [
4172
+ /* @__PURE__ */ jsxRuntime.jsx(Swatch, { kind, color }),
4173
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label }),
4174
+ count != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: count }) : null
4175
+ ]
4176
+ }
4177
+ )
4178
+ );
4179
+ LegendItem.displayName = "LegendItem";
4180
+ var MenuItem = ({
4181
+ label,
4182
+ icon: Icon,
4183
+ shortcut,
4184
+ children,
4185
+ className,
4186
+ level = 0,
4187
+ href,
4188
+ onClick
4189
+ }) => {
4190
+ const hasChildren = children && children.length > 0;
4191
+ const ButtonOrLink = href ? "a" : "button";
4192
+ const clickTrigger = href ? { href } : { onClick };
4193
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "relative group/item", children: [
4194
+ /* @__PURE__ */ jsxRuntime.jsxs(
4195
+ ButtonOrLink,
4196
+ {
4197
+ ...clickTrigger,
4198
+ className: cn(
4199
+ "flex w-full items-center justify-between px-4 py-2 ",
4200
+ "hover:bg-accent hover:text-accent-foreground",
4201
+ "focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",
4202
+ className,
4203
+ level === 0 ? "font-medium" : "font-normal"
4204
+ // "group-hover/item:bg-accent/50"
4205
+ ),
4206
+ role: hasChildren ? "menuitem" : void 0,
4207
+ "aria-haspopup": hasChildren ? "true" : void 0,
4208
+ "aria-expanded": hasChildren ? "true" : void 0,
4209
+ children: [
4210
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
4211
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-4 w-4" }),
4212
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
4213
+ ] }),
4214
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
4215
+ shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100", children: shortcut }),
4216
+ hasChildren && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
4217
+ ] })
4218
+ ]
4219
+ }
3311
4220
  ),
3312
4221
  hasChildren && /* @__PURE__ */ jsxRuntime.jsx(
3313
4222
  "ul",
@@ -3328,6 +4237,39 @@ var MenuItem = ({
3328
4237
  )
3329
4238
  ] });
3330
4239
  };
4240
+ var MetricTile = React23__namespace.forwardRef(
4241
+ ({ label, value, caption, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4242
+ "div",
4243
+ {
4244
+ ref,
4245
+ className: cn("flex flex-col gap-0.5 border border-border bg-card p-2", className),
4246
+ ...props,
4247
+ children: [
4248
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-meta text-muted-foreground", children: label }),
4249
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-medium leading-tight", children: value }),
4250
+ caption != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
4251
+ children
4252
+ ]
4253
+ }
4254
+ )
4255
+ );
4256
+ MetricTile.displayName = "MetricTile";
4257
+ var MetricGrid = React23__namespace.forwardRef(
4258
+ ({ minTileWidth = 120, className, style, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4259
+ "div",
4260
+ {
4261
+ ref,
4262
+ className: cn("grid gap-1.5", className),
4263
+ style: {
4264
+ gridTemplateColumns: `repeat(auto-fit, minmax(${minTileWidth}px, 1fr))`,
4265
+ ...style
4266
+ },
4267
+ ...props,
4268
+ children
4269
+ }
4270
+ )
4271
+ );
4272
+ MetricGrid.displayName = "MetricGrid";
3331
4273
  var NavVerticalItems = ({ items }) => /* @__PURE__ */ jsxRuntime.jsx(NavItems, { items, orientation: "vertical" });
3332
4274
  var NavVertical = ({
3333
4275
  className = "",
@@ -3374,35 +4316,42 @@ function PanelContent({
3374
4316
  title,
3375
4317
  titleText,
3376
4318
  children,
3377
- onClose,
3378
- showClose,
4319
+ className,
3379
4320
  headerClassName,
3380
4321
  bodyClassName,
3381
4322
  footerContent,
3382
4323
  footerClassName,
3383
- closeIcon
4324
+ headerActions,
4325
+ actionsOnHover = false
3384
4326
  }) {
3385
- return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: `h-full border-none ${headerClassName}`, children: [
3386
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "relative flex flex-row items-center py-0 border-b h-[30px]", children: [
3387
- title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-none font-bold ", children: title }),
3388
- titleText && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-bold leading-none", children: titleText }),
3389
- showClose && /* @__PURE__ */ jsxRuntime.jsxs(
3390
- Button,
3391
- {
3392
- variant: "ghost",
3393
- size: "icon",
3394
- className: "absolute top-[0px] right-[5px] h-6 w-6 hover:bg-transparent hover:text-primary/80",
3395
- onClick: onClose,
3396
- children: [
3397
- closeIcon ? closeIcon : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" }),
3398
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close panel" })
3399
- ]
3400
- }
3401
- )
3402
- ] }),
3403
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: `overflow-y-auto h-full ${bodyClassName}`, children }),
3404
- footerContent ? /* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: footerClassName, children: footerContent }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
3405
- ] }) });
4327
+ return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: cn("flex h-full min-h-0 flex-col border-none", className), children: [
4328
+ /* @__PURE__ */ jsxRuntime.jsxs(
4329
+ CardHeader,
4330
+ {
4331
+ className: cn(
4332
+ "group/panel-header flex h-[35px] shrink-0 flex-row items-center gap-2",
4333
+ "space-y-0 border-b py-0 pr-1",
4334
+ headerClassName
4335
+ ),
4336
+ children: [
4337
+ title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate font-bold leading-none", children: title }),
4338
+ titleText && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "min-w-0 truncate font-bold leading-none", children: titleText }),
4339
+ headerActions && headerActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
4340
+ "div",
4341
+ {
4342
+ className: cn(
4343
+ "ml-auto flex shrink-0 items-center gap-1 pl-2",
4344
+ actionsOnHover && "opacity-0 transition-opacity group-hover/panel-header:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100"
4345
+ ),
4346
+ children: /* @__PURE__ */ jsxRuntime.jsx(NavHorizontalItems, { items: headerActions })
4347
+ }
4348
+ )
4349
+ ]
4350
+ }
4351
+ ),
4352
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("min-h-0 flex-1 overflow-y-auto", bodyClassName), children }),
4353
+ footerContent ? /* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: cn("shrink-0 border-t", footerClassName), children: footerContent }) : null
4354
+ ] }) }) });
3406
4355
  }
3407
4356
  function PanelStack({
3408
4357
  sections,
@@ -3412,6 +4361,7 @@ function PanelStack({
3412
4361
  headerClassName,
3413
4362
  bodyClassName
3414
4363
  }) {
4364
+ const groupRef = React23__namespace.useRef(null);
3415
4365
  const refs = React23__namespace.useRef({});
3416
4366
  const [collapsed, setCollapsed] = React23__namespace.useState(
3417
4367
  () => Object.fromEntries(sections.map((s) => [s.id, !!s.defaultCollapsed]))
@@ -3420,94 +4370,366 @@ function PanelStack({
3420
4370
  React23__namespace.useLayoutEffect(() => {
3421
4371
  if (didInit.current) return;
3422
4372
  didInit.current = true;
3423
- for (const section of sections) {
3424
- if (section.defaultCollapsed) refs.current[section.id]?.collapse();
4373
+ const targets = sections.filter((s) => s.defaultCollapsed);
4374
+ const expanded = sections.filter((s) => !s.defaultCollapsed);
4375
+ if (targets.length === 0 || expanded.length === 0) return;
4376
+ const group = groupRef.current;
4377
+ const probe = refs.current[sections[0].id]?.getSize();
4378
+ if (!group || !probe || probe.asPercentage <= 0) {
4379
+ for (const s of targets) refs.current[s.id]?.collapse();
4380
+ return;
4381
+ }
4382
+ const groupPx = probe.inPixels / probe.asPercentage * 100;
4383
+ const collapsedPct = headerHeight / groupPx * 100;
4384
+ const layout = group.getLayout();
4385
+ const next = { ...layout };
4386
+ let freed = 0;
4387
+ for (const s of targets) {
4388
+ const current = layout[s.id] ?? 0;
4389
+ if (current <= collapsedPct) continue;
4390
+ freed += current - collapsedPct;
4391
+ next[s.id] = collapsedPct;
3425
4392
  }
4393
+ if (freed === 0) return;
4394
+ const total = expanded.reduce((sum, s) => sum + (layout[s.id] ?? 0), 0);
4395
+ for (const s of expanded) {
4396
+ const share = total > 0 ? (layout[s.id] ?? 0) / total : 1 / expanded.length;
4397
+ next[s.id] = (layout[s.id] ?? 0) + freed * share;
4398
+ }
4399
+ for (const s of targets) refs.current[s.id]?.collapse();
4400
+ group.setLayout(next);
3426
4401
  }, []);
3427
4402
  const toggle = (id) => {
3428
4403
  const ref = refs.current[id];
3429
4404
  if (!ref) return;
3430
- if (ref.isCollapsed()) ref.expand();
3431
- else ref.collapse();
4405
+ if (!ref.isCollapsed()) {
4406
+ ref.collapse();
4407
+ return;
4408
+ }
4409
+ ref.expand();
4410
+ if (!ref.isCollapsed()) return;
4411
+ const group = groupRef.current;
4412
+ if (!group) return;
4413
+ const layout = group.getLayout();
4414
+ const donor = Object.entries(layout).filter(([panelId]) => panelId !== id && !collapsed[panelId]).sort((a, b) => b[1] - a[1])[0];
4415
+ if (!donor) return;
4416
+ const [donorId, donorPct] = donor;
4417
+ const share = donorPct / 2;
4418
+ group.setLayout({
4419
+ ...layout,
4420
+ [id]: (layout[id] ?? 0) + share,
4421
+ [donorId]: donorPct - share
4422
+ });
3432
4423
  };
3433
- return /* @__PURE__ */ jsxRuntime.jsx(
3434
- ResizablePanelGroup,
4424
+ return (
4425
+ // Header actions are nav items, and those carry tooltips — provide the
4426
+ // context here so a `PanelStack` works outside an app shell too. Nesting
4427
+ // inside an app's own provider is harmless.
4428
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsx(
4429
+ ResizablePanelGroup,
4430
+ {
4431
+ groupRef,
4432
+ orientation: "vertical",
4433
+ className: cn("h-full w-full", className),
4434
+ children: sections.map((section, index) => {
4435
+ const Icon = section.icon;
4436
+ const isCollapsed = collapsed[section.id];
4437
+ const flush = index > 0 && (isCollapsed || collapsed[sections[index - 1].id]);
4438
+ return /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.Fragment, { children: [
4439
+ index > 0 && /* @__PURE__ */ jsxRuntime.jsx(
4440
+ ResizableHandle,
4441
+ {
4442
+ withHandle: withHandle && !flush,
4443
+ className: cn(
4444
+ flush && "pointer-events-none bg-border aria-[orientation=horizontal]:h-px aria-[orientation=vertical]:w-px"
4445
+ )
4446
+ }
4447
+ ),
4448
+ /* @__PURE__ */ jsxRuntime.jsxs(
4449
+ ResizablePanel,
4450
+ {
4451
+ id: section.id,
4452
+ collapsible: true,
4453
+ collapsedSize: `${headerHeight}px`,
4454
+ minSize: section.minSize ?? `${headerHeight + 64}px`,
4455
+ defaultSize: section.defaultSize,
4456
+ panelRef: (ref) => {
4457
+ refs.current[section.id] = ref;
4458
+ },
4459
+ onResize: (size) => {
4460
+ const next = size.inPixels <= headerHeight + 1;
4461
+ setCollapsed(
4462
+ (prev) => prev[section.id] === next ? prev : { ...prev, [section.id]: next }
4463
+ );
4464
+ },
4465
+ className: "flex flex-col overflow-hidden",
4466
+ children: [
4467
+ /* @__PURE__ */ jsxRuntime.jsxs(
4468
+ "div",
4469
+ {
4470
+ style: { height: headerHeight },
4471
+ className: cn(
4472
+ "group/panel-header flex shrink-0 items-center pr-2 text-muted-foreground",
4473
+ headerClassName
4474
+ ),
4475
+ children: [
4476
+ /* @__PURE__ */ jsxRuntime.jsxs(
4477
+ "button",
4478
+ {
4479
+ type: "button",
4480
+ onClick: () => toggle(section.id),
4481
+ "aria-expanded": !isCollapsed,
4482
+ className: cn(
4483
+ "flex h-full min-w-0 flex-1 items-center gap-1 pl-2 text-left",
4484
+ "transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
4485
+ ),
4486
+ children: [
4487
+ isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-5 w-5 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-5 w-5 shrink-0" }),
4488
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
4489
+ typeof section.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-meta font-semibold uppercase tracking-wide", children: section.title }) : (
4490
+ // Custom node: rendered as-is so the consumer owns the
4491
+ // styling (icon, casing, colour, badges…).
4492
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex min-w-0 flex-1 items-center", children: section.title })
4493
+ )
4494
+ ]
4495
+ }
4496
+ ),
4497
+ section.headerActions && section.headerActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
4498
+ "div",
4499
+ {
4500
+ className: cn(
4501
+ "flex items-center gap-1 pl-2",
4502
+ // Quiet at rest: the actions appear on hover over the
4503
+ // header, and never hide while one of them holds focus
4504
+ // or has its menu open — so the keyboard path stays
4505
+ // visible.
4506
+ (section.actionsOnHover ?? true) && "opacity-0 transition-opacity group-hover/panel-header:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100"
4507
+ ),
4508
+ children: /* @__PURE__ */ jsxRuntime.jsx(NavHorizontalItems, { items: section.headerActions })
4509
+ }
4510
+ )
4511
+ ]
4512
+ }
4513
+ ),
4514
+ /* @__PURE__ */ jsxRuntime.jsx(
4515
+ "div",
4516
+ {
4517
+ className: cn("min-h-0 flex-1 overflow-auto", bodyClassName),
4518
+ hidden: isCollapsed,
4519
+ children: section.content
4520
+ }
4521
+ )
4522
+ ]
4523
+ }
4524
+ )
4525
+ ] }, section.id);
4526
+ })
4527
+ }
4528
+ ) })
4529
+ );
4530
+ }
4531
+ var PropertyList = React23__namespace.forwardRef(
4532
+ ({ labelWidth = 78, className, style, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4533
+ "dl",
3435
4534
  {
3436
- orientation: "vertical",
3437
- className: cn("h-full w-full", className),
3438
- children: sections.map((section, index) => {
3439
- const Icon = section.icon;
3440
- const isCollapsed = collapsed[section.id];
3441
- return /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.Fragment, { children: [
3442
- index > 0 && /* @__PURE__ */ jsxRuntime.jsx(ResizableHandle, { withHandle }),
3443
- /* @__PURE__ */ jsxRuntime.jsxs(
3444
- ResizablePanel,
4535
+ ref,
4536
+ className: cn("flex flex-col", className),
4537
+ style: {
4538
+ "--property-label-width": typeof labelWidth === "number" ? `${labelWidth}px` : labelWidth,
4539
+ ...style
4540
+ },
4541
+ ...props,
4542
+ children
4543
+ }
4544
+ )
4545
+ );
4546
+ PropertyList.displayName = "PropertyList";
4547
+ var PropertyRow = React23__namespace.forwardRef(
4548
+ ({ label, mono, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4549
+ "div",
4550
+ {
4551
+ ref,
4552
+ className: cn("flex items-baseline gap-2 py-1", className),
4553
+ ...props,
4554
+ children: [
4555
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "shrink-0 truncate text-meta text-muted-foreground [width:var(--property-label-width,78px)]", children: label }),
4556
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn("min-w-0 flex-1", mono && "font-mono text-meta"), children })
4557
+ ]
4558
+ }
4559
+ )
4560
+ );
4561
+ PropertyRow.displayName = "PropertyRow";
4562
+ var ProposalCard = React23__namespace.forwardRef(
4563
+ ({
4564
+ title,
4565
+ source,
4566
+ evidence,
4567
+ evidenceTitle,
4568
+ evidenceMeta,
4569
+ consequence,
4570
+ actions,
4571
+ className,
4572
+ children,
4573
+ ...props
4574
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-3", className), ...props, children: [
4575
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-1", children: [
4576
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2", children: [
4577
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium", children: title }),
4578
+ source != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: source }) : null
4579
+ ] }),
4580
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border border-border bg-muted/30 p-2", children })
4581
+ ] }),
4582
+ evidence ? /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-1", children: [
4583
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2", children: [
4584
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium", children: evidenceTitle }),
4585
+ evidenceMeta != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: evidenceMeta }) : null
4586
+ ] }),
4587
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden border border-border", children: evidence })
4588
+ ] }) : null,
4589
+ consequence != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-meta text-muted-foreground", children: consequence }) : null,
4590
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: actions }) : null
4591
+ ] })
4592
+ );
4593
+ ProposalCard.displayName = "ProposalCard";
4594
+ var DotRating = React23__namespace.forwardRef(
4595
+ ({ value, max = 3, onChange, readOnly, label, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4596
+ "div",
4597
+ {
4598
+ ref,
4599
+ role: readOnly ? "img" : "radiogroup",
4600
+ "aria-label": label ?? `weight ${value} of ${max}`,
4601
+ className: cn("inline-flex items-center gap-1", className),
4602
+ ...props,
4603
+ children: Array.from({ length: max }, (_, i) => {
4604
+ const n = i + 1;
4605
+ const on = n <= value;
4606
+ if (readOnly) {
4607
+ return /* @__PURE__ */ jsxRuntime.jsx(
4608
+ "span",
3445
4609
  {
3446
- collapsible: true,
3447
- collapsedSize: `${headerHeight}px`,
3448
- minSize: section.minSize ?? `${headerHeight + 64}px`,
3449
- defaultSize: section.defaultSize,
3450
- panelRef: (ref) => {
3451
- refs.current[section.id] = ref;
3452
- },
3453
- onResize: (size) => {
3454
- const next = size.inPixels <= headerHeight + 1;
3455
- setCollapsed(
3456
- (prev) => prev[section.id] === next ? prev : { ...prev, [section.id]: next }
3457
- );
3458
- },
3459
- className: "flex flex-col overflow-hidden",
3460
- children: [
3461
- /* @__PURE__ */ jsxRuntime.jsxs(
3462
- "div",
3463
- {
3464
- style: { height: headerHeight },
3465
- className: cn(
3466
- "flex shrink-0 items-center pr-2 text-muted-foreground",
3467
- headerClassName
3468
- ),
3469
- children: [
3470
- /* @__PURE__ */ jsxRuntime.jsxs(
3471
- "button",
3472
- {
3473
- type: "button",
3474
- onClick: () => toggle(section.id),
3475
- "aria-expanded": !isCollapsed,
3476
- className: cn(
3477
- "flex h-full min-w-0 flex-1 items-center gap-1 pl-2 text-left",
3478
- "transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
3479
- ),
3480
- children: [
3481
- isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 shrink-0" }),
3482
- Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
3483
- typeof section.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs font-semibold uppercase tracking-wide", children: section.title }) : (
3484
- // Custom node: rendered as-is so the consumer owns the
3485
- // styling (icon, casing, colour, badges…).
3486
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex min-w-0 flex-1 items-center", children: section.title })
3487
- )
3488
- ]
3489
- }
3490
- ),
3491
- section.actions && !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 pl-2", children: section.actions })
3492
- ]
3493
- }
3494
- ),
3495
- /* @__PURE__ */ jsxRuntime.jsx(
3496
- "div",
3497
- {
3498
- className: cn("min-h-0 flex-1 overflow-auto", bodyClassName),
3499
- hidden: isCollapsed,
3500
- children: section.content
3501
- }
3502
- )
3503
- ]
3504
- }
3505
- )
3506
- ] }, section.id);
4610
+ "aria-hidden": true,
4611
+ className: cn(
4612
+ "size-2.5 rounded-full border",
4613
+ on ? "border-primary bg-primary" : "border-muted-foreground bg-transparent"
4614
+ )
4615
+ },
4616
+ n
4617
+ );
4618
+ }
4619
+ return /* @__PURE__ */ jsxRuntime.jsx(
4620
+ "button",
4621
+ {
4622
+ type: "button",
4623
+ role: "radio",
4624
+ "aria-checked": value === n,
4625
+ "aria-label": String(n),
4626
+ onClick: () => onChange?.(n),
4627
+ className: cn(
4628
+ "size-2.5 cursor-pointer rounded-full border",
4629
+ on ? "border-primary bg-primary" : "border-muted-foreground bg-transparent"
4630
+ )
4631
+ },
4632
+ n
4633
+ );
3507
4634
  })
3508
4635
  }
3509
- );
3510
- }
4636
+ )
4637
+ );
4638
+ DotRating.displayName = "DotRating";
4639
+ var RatingControl = React23__namespace.forwardRef(
4640
+ ({
4641
+ verdict,
4642
+ onVerdictChange,
4643
+ weight,
4644
+ onWeightChange,
4645
+ maxWeight = 3,
4646
+ refines,
4647
+ by,
4648
+ className,
4649
+ children,
4650
+ ...props
4651
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4652
+ "div",
4653
+ {
4654
+ ref,
4655
+ className: cn("flex flex-col gap-2 border border-border bg-card p-2", className),
4656
+ ...props,
4657
+ children: [
4658
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-meta", children: [
4659
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Your verdict" }),
4660
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "becomes a Learning" }),
4661
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
4662
+ by
4663
+ ] }),
4664
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
4665
+ /* @__PURE__ */ jsxRuntime.jsx("div", { role: "radiogroup", className: "inline-flex border border-border", children: ["appreciate", "depreciate"].map((v) => /* @__PURE__ */ jsxRuntime.jsx(
4666
+ "button",
4667
+ {
4668
+ type: "button",
4669
+ role: "radio",
4670
+ "aria-checked": verdict === v,
4671
+ onClick: () => onVerdictChange?.(v),
4672
+ className: cn(
4673
+ "h-[22px] px-2 text-meta capitalize",
4674
+ verdict === v ? v === "appreciate" ? "bg-success text-success-foreground" : "bg-warning text-warning-foreground" : "text-muted-foreground hover:bg-accent"
4675
+ ),
4676
+ children: v
4677
+ },
4678
+ v
4679
+ )) }),
4680
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
4681
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: "weight" }),
4682
+ /* @__PURE__ */ jsxRuntime.jsx(DotRating, { value: weight, max: maxWeight, onChange: onWeightChange }),
4683
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta tabular-nums", children: weight })
4684
+ ] }),
4685
+ refines != null ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-meta text-muted-foreground", children: [
4686
+ "refines ",
4687
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: refines })
4688
+ ] }) : null
4689
+ ] }),
4690
+ children
4691
+ ]
4692
+ }
4693
+ )
4694
+ );
4695
+ RatingControl.displayName = "RatingControl";
4696
+ var RepairNote = React23__namespace.forwardRef(
4697
+ ({ from, to, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4698
+ "div",
4699
+ {
4700
+ ref,
4701
+ className: cn(
4702
+ "flex flex-wrap items-center gap-1 py-0.5 pl-4 text-meta text-muted-foreground",
4703
+ className
4704
+ ),
4705
+ ...props,
4706
+ children: [
4707
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono line-through decoration-muted-foreground/60", children: from }),
4708
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u2192" }),
4709
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-foreground", children: to })
4710
+ ]
4711
+ }
4712
+ )
4713
+ );
4714
+ RepairNote.displayName = "RepairNote";
4715
+ var RetryNote = React23__namespace.forwardRef(
4716
+ ({ attempt, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4717
+ "div",
4718
+ {
4719
+ ref,
4720
+ className: cn(
4721
+ "flex flex-wrap items-baseline gap-1.5 py-0.5 pl-4 text-meta text-muted-foreground",
4722
+ className
4723
+ ),
4724
+ ...props,
4725
+ children: [
4726
+ attempt != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium text-warning", children: attempt }) : null,
4727
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children })
4728
+ ]
4729
+ }
4730
+ )
4731
+ );
4732
+ RetryNote.displayName = "RetryNote";
3511
4733
  function OptionRow({ option }) {
3512
4734
  const Icon = option.icon;
3513
4735
  return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
@@ -3516,7 +4738,7 @@ function OptionRow({ option }) {
3516
4738
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: option.label }),
3517
4739
  option.badge != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto pl-2", children: option.badge })
3518
4740
  ] }),
3519
- option.description != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: option.description })
4741
+ option.description != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-meta text-muted-foreground", children: option.description })
3520
4742
  ] });
3521
4743
  }
3522
4744
  function RichSelect({
@@ -3630,6 +4852,123 @@ function RichSelect({
3630
4852
  )
3631
4853
  ] });
3632
4854
  }
4855
+ var SearchInput = ({
4856
+ value,
4857
+ onChange,
4858
+ className,
4859
+ inputSize = "default",
4860
+ placeholder = "Search...",
4861
+ ...props
4862
+ }) => {
4863
+ return /* @__PURE__ */ jsxRuntime.jsx(
4864
+ "input",
4865
+ {
4866
+ type: "text",
4867
+ value,
4868
+ onChange: (e) => onChange(e.target.value),
4869
+ placeholder,
4870
+ className: cn(
4871
+ "flex w-full rounded-control border border-input bg-background ring-offset-background",
4872
+ "placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2",
4873
+ "focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
4874
+ inputSize === "sm" ? "h-[26px] px-2 py-0 text-meta" : "h-10 px-3 py-2 text-base",
4875
+ className
4876
+ ),
4877
+ ...props
4878
+ }
4879
+ );
4880
+ };
4881
+ var SectionHeader = React23__namespace.forwardRef(({ icon, title, count, actions, bare, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
4882
+ "div",
4883
+ {
4884
+ ref,
4885
+ className: cn(
4886
+ "flex h-[35px] shrink-0 items-center gap-2 px-2",
4887
+ !bare && "border-b border-border",
4888
+ className
4889
+ ),
4890
+ ...props,
4891
+ children: [
4892
+ icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center text-muted-foreground [&_svg]:size-3.5", children: icon }) : null,
4893
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate font-medium", children: title }),
4894
+ count != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: count }) : null,
4895
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center gap-1", children: actions }) : null
4896
+ ]
4897
+ }
4898
+ ));
4899
+ SectionHeader.displayName = "SectionHeader";
4900
+ var Sparkline = React23__namespace.forwardRef(
4901
+ ({
4902
+ values,
4903
+ width = 72,
4904
+ height = 20,
4905
+ color = "var(--color-data-1)",
4906
+ area,
4907
+ endMarker = true,
4908
+ label,
4909
+ className,
4910
+ ...props
4911
+ }, ref) => {
4912
+ const pad = 3;
4913
+ const min = Math.min(...values);
4914
+ const max = Math.max(...values);
4915
+ const span = max - min || 1;
4916
+ const stepX = values.length > 1 ? (width - pad * 2) / (values.length - 1) : 0;
4917
+ const points = values.map((v, i) => [
4918
+ pad + i * stepX,
4919
+ height - pad - (v - min) / span * (height - pad * 2)
4920
+ ]);
4921
+ const d = points.map((p, i) => `${i ? "L" : "M"}${p[0]} ${p[1]}`).join(" ");
4922
+ const last = points[points.length - 1];
4923
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4924
+ "svg",
4925
+ {
4926
+ ref,
4927
+ width,
4928
+ height,
4929
+ viewBox: `0 0 ${width} ${height}`,
4930
+ className: cn("shrink-0 overflow-visible", className),
4931
+ role: label ? "img" : void 0,
4932
+ "aria-label": label,
4933
+ "aria-hidden": label ? void 0 : true,
4934
+ ...props,
4935
+ children: [
4936
+ area ? /* @__PURE__ */ jsxRuntime.jsx(
4937
+ "path",
4938
+ {
4939
+ d: `${d} L${last[0]} ${height} L${points[0][0]} ${height} Z`,
4940
+ fill: color,
4941
+ opacity: 0.1
4942
+ }
4943
+ ) : null,
4944
+ /* @__PURE__ */ jsxRuntime.jsx(
4945
+ "path",
4946
+ {
4947
+ d,
4948
+ fill: "none",
4949
+ stroke: color,
4950
+ strokeWidth: 2,
4951
+ strokeLinecap: "round",
4952
+ strokeLinejoin: "round"
4953
+ }
4954
+ ),
4955
+ endMarker ? /* @__PURE__ */ jsxRuntime.jsx(
4956
+ "circle",
4957
+ {
4958
+ cx: last[0],
4959
+ cy: last[1],
4960
+ r: 4,
4961
+ fill: color,
4962
+ stroke: "var(--color-card)",
4963
+ strokeWidth: 2
4964
+ }
4965
+ ) : null
4966
+ ]
4967
+ }
4968
+ );
4969
+ }
4970
+ );
4971
+ Sparkline.displayName = "Sparkline";
3633
4972
  function TabbedPanel({
3634
4973
  tabs,
3635
4974
  defaultTab,
@@ -3640,10 +4979,7 @@ function TabbedPanel({
3640
4979
  headerClassName,
3641
4980
  bodyClassName,
3642
4981
  footerClassName,
3643
- footerContent,
3644
- showClose: _showClose,
3645
- onClose: _onClose,
3646
- closeIcon: _closeIcon
4982
+ footerContent
3647
4983
  }) {
3648
4984
  const [internalTab, setInternalTab] = React23__namespace.default.useState(defaultTab || tabs[0]?.value);
3649
4985
  const currentTab = activeTab !== void 0 ? activeTab : internalTab;
@@ -3668,13 +5004,7 @@ function TabbedPanel({
3668
5004
  },
3669
5005
  tab.value
3670
5006
  )) }),
3671
- headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center h-full", children: /* @__PURE__ */ jsxRuntime.jsx(
3672
- NavHorizontal,
3673
- {
3674
- className: "h-full",
3675
- ...headerActions
3676
- }
3677
- ) })
5007
+ headerActions && headerActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex h-full shrink-0 items-center gap-1 pr-1", children: /* @__PURE__ */ jsxRuntime.jsx(NavHorizontalItems, { items: headerActions }) })
3678
5008
  ] }),
3679
5009
  tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
3680
5010
  TabsContent,
@@ -3688,24 +5018,139 @@ function TabbedPanel({
3688
5018
  footerContent && /* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: footerClassName, children: footerContent })
3689
5019
  ] }) }) }) });
3690
5020
  }
3691
- var SearchInput = ({ value, onChange, ...props }) => {
3692
- return /* @__PURE__ */ jsxRuntime.jsx(
3693
- "input",
5021
+ var TemplatePicker = React23__namespace.forwardRef(({ heading, options, value, onSelect, footnote, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
5022
+ "div",
5023
+ {
5024
+ ref,
5025
+ className: cn("flex w-full flex-col border border-border bg-card", className),
5026
+ ...props,
5027
+ children: [
5028
+ heading != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-6 shrink-0 items-center border-b border-border px-2 text-meta text-muted-foreground", children: heading }) : null,
5029
+ /* @__PURE__ */ jsxRuntime.jsx("div", { role: "listbox", className: "flex flex-col", children: options.map((o) => {
5030
+ const disabled = o.unavailable != null;
5031
+ const selected = value === o.id;
5032
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5033
+ "button",
5034
+ {
5035
+ type: "button",
5036
+ role: "option",
5037
+ "aria-selected": selected,
5038
+ disabled,
5039
+ onClick: () => onSelect?.(o.id),
5040
+ className: cn(
5041
+ "flex h-7 items-center gap-2 px-2 text-left",
5042
+ selected && "bg-accent",
5043
+ disabled ? "cursor-not-allowed opacity-50" : "hover:bg-accent/60"
5044
+ ),
5045
+ children: [
5046
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-3 shrink-0 text-primary", children: selected ? "\u2022" : "" }),
5047
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-mono text-meta", children: o.id }),
5048
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: o.kind }),
5049
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1" }),
5050
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 truncate text-meta text-muted-foreground", children: o.unavailable ?? o.note })
5051
+ ]
5052
+ },
5053
+ o.id
5054
+ );
5055
+ }) }),
5056
+ footnote != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border px-2 py-1 text-meta text-muted-foreground", children: footnote }) : null
5057
+ ]
5058
+ }
5059
+ ));
5060
+ TemplatePicker.displayName = "TemplatePicker";
5061
+ var MARKER = {
5062
+ prompt: "$",
5063
+ output: "\u2192",
5064
+ comment: "#"
5065
+ };
5066
+ var Terminal = React23__namespace.forwardRef(
5067
+ ({ cursor, columnTemplate = "150px minmax(0,1fr) auto auto", className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
5068
+ "div",
3694
5069
  {
3695
- type: "text",
3696
- value,
3697
- onChange: (e) => onChange(e.target.value),
3698
- placeholder: "Search...",
5070
+ ref,
5071
+ style: { "--terminal-cols": columnTemplate },
3699
5072
  className: cn(
3700
- "flex h-10 w-full rounded-control border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
3701
- "w-full px-2 py-1 border rounded-control dark:bg-neutral-800",
3702
- props?.className
3703
- )
5073
+ "overflow-x-auto border border-border bg-muted/40 p-2 font-mono text-meta",
5074
+ className
5075
+ ),
5076
+ ...props,
5077
+ children: [
5078
+ children,
5079
+ cursor ? /* @__PURE__ */ jsxRuntime.jsx(
5080
+ "span",
5081
+ {
5082
+ "aria-hidden": true,
5083
+ className: "mt-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-foreground align-middle motion-reduce:animate-none"
5084
+ }
5085
+ ) : null
5086
+ ]
3704
5087
  }
3705
- );
3706
- };
5088
+ )
5089
+ );
5090
+ Terminal.displayName = "Terminal";
5091
+ var TerminalLine = React23__namespace.forwardRef(
5092
+ ({ kind = "output", columns, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
5093
+ "div",
5094
+ {
5095
+ ref,
5096
+ className: cn(
5097
+ "items-baseline gap-2 whitespace-pre",
5098
+ columns ? "grid [grid-template-columns:auto_var(--terminal-cols)]" : "flex",
5099
+ kind === "comment" && "text-muted-foreground",
5100
+ className
5101
+ ),
5102
+ ...props,
5103
+ children: [
5104
+ /* @__PURE__ */ jsxRuntime.jsx(
5105
+ "span",
5106
+ {
5107
+ "aria-hidden": true,
5108
+ className: cn(
5109
+ "w-3 shrink-0",
5110
+ kind === "prompt" ? "text-primary" : "text-muted-foreground"
5111
+ ),
5112
+ children: MARKER[kind]
5113
+ }
5114
+ ),
5115
+ columns ? columns.map((c, i) => /* @__PURE__ */ jsxRuntime.jsx(
5116
+ "span",
5117
+ {
5118
+ className: cn(
5119
+ "min-w-0 truncate",
5120
+ i === columns.length - 1 && "text-muted-foreground"
5121
+ ),
5122
+ children: c
5123
+ },
5124
+ i
5125
+ )) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0", children })
5126
+ ]
5127
+ }
5128
+ )
5129
+ );
5130
+ TerminalLine.displayName = "TerminalLine";
5131
+ var TimelineList = React23__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("ol", { ref, className: cn("flex flex-col", className), ...props, children }));
5132
+ TimelineList.displayName = "TimelineList";
5133
+ var TimelineEntry = React23__namespace.forwardRef(({ when, title, marker, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
5134
+ "li",
5135
+ {
5136
+ ref,
5137
+ className: cn("flex gap-2 border-b border-border py-1.5 last:border-b-0", className),
5138
+ ...props,
5139
+ children: [
5140
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-[72px] shrink-0 items-baseline gap-1.5 text-meta text-muted-foreground", children: [
5141
+ marker ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "translate-y-1", children: marker }) : null,
5142
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: when })
5143
+ ] }),
5144
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
5145
+ title != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: title }) : null,
5146
+ children
5147
+ ] })
5148
+ ]
5149
+ }
5150
+ ));
5151
+ TimelineEntry.displayName = "TimelineEntry";
3707
5152
  var Toolbar = () => {
3708
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-5 items-center space-x-2 text-sm", children: [
5153
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-5 items-center space-x-2", children: [
3709
5154
  /* @__PURE__ */ jsxRuntime.jsx(
3710
5155
  ButtonWithTooltip,
3711
5156
  {
@@ -3833,7 +5278,7 @@ function Tour({
3833
5278
  /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 p-3", children: [
3834
5279
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3835
5280
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "soft", className: "tracking-wider", children: badgeLabel }),
3836
- showCounter && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
5281
+ showCounter && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-meta text-muted-foreground", children: [
3837
5282
  current + 1,
3838
5283
  " / ",
3839
5284
  total
@@ -3844,7 +5289,7 @@ function Tour({
3844
5289
  {
3845
5290
  variant: "ghost",
3846
5291
  size: "sm",
3847
- className: "-mr-1 h-7 gap-1 px-2 text-xs text-muted-foreground [&_svg]:size-3.5",
5292
+ className: "-mr-1 h-7 gap-1 px-2 text-meta text-muted-foreground [&_svg]:size-3.5",
3848
5293
  onClick: ctrl.exit,
3849
5294
  children: [
3850
5295
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}),
@@ -3863,10 +5308,10 @@ function Tour({
3863
5308
  /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-4 p-3 pt-2", children: [
3864
5309
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold leading-snug", children: step.title }),
3865
5310
  step.content ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3866
- step.body && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm leading-relaxed text-muted-foreground", children: step.body }),
5311
+ step.body && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "leading-relaxed text-muted-foreground", children: step.body }),
3867
5312
  step.callout && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-r-md border-l-2 border-primary bg-muted/40 p-3", children: [
3868
5313
  step.callout.label && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wider text-primary", children: step.callout.label }),
3869
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm leading-relaxed", children: step.callout.content })
5314
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "leading-relaxed", children: step.callout.content })
3870
5315
  ] }),
3871
5316
  step.references && step.references.items.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
3872
5317
  step.references.label && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: step.references.label }),
@@ -4027,7 +5472,7 @@ function UnderDevelopment({
4027
5472
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Construction, { size: iconSize, className: "text-primary" }),
4028
5473
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold", children: title }),
4029
5474
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground max-w-md", children: description }),
4030
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-4 px-3 py-1 bg-yellow-100 text-yellow-800 text-sm", children: "Coming Soon" })
5475
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-4 px-3 py-1 bg-yellow-100 text-yellow-800", children: "Coming Soon" })
4031
5476
  ] });
4032
5477
  }
4033
5478
  var TypographyH1 = React23__namespace.forwardRef(
@@ -4165,7 +5610,7 @@ var TypographyInlineCode = React23__namespace.forwardRef(
4165
5610
  {
4166
5611
  ref,
4167
5612
  className: cn(
4168
- "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
5613
+ "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-meta font-semibold",
4169
5614
  className
4170
5615
  ),
4171
5616
  ...props
@@ -4213,7 +5658,7 @@ var TypographySmall = React23__namespace.forwardRef(
4213
5658
  {
4214
5659
  ref,
4215
5660
  className: cn(
4216
- "text-sm font-medium leading-none",
5661
+ "text-meta font-medium leading-none",
4217
5662
  className
4218
5663
  ),
4219
5664
  ...props
@@ -4229,7 +5674,7 @@ var TypographyMuted = React23__namespace.forwardRef(
4229
5674
  {
4230
5675
  ref,
4231
5676
  className: cn(
4232
- "text-sm text-muted-foreground",
5677
+ "text-muted-foreground",
4233
5678
  className
4234
5679
  ),
4235
5680
  ...props
@@ -4294,6 +5739,7 @@ exports.Accordion = Accordion;
4294
5739
  exports.AccordionContent = AccordionContent;
4295
5740
  exports.AccordionItem = AccordionItem;
4296
5741
  exports.AccordionTrigger = AccordionTrigger;
5742
+ exports.AgentChip = AgentChip;
4297
5743
  exports.Alert = Alert;
4298
5744
  exports.AlertDescription = AlertDescription;
4299
5745
  exports.AlertDialog = AlertDialog;
@@ -4308,10 +5754,13 @@ exports.AlertDialogPortal = AlertDialogPortal;
4308
5754
  exports.AlertDialogTitle = AlertDialogTitle;
4309
5755
  exports.AlertDialogTrigger = AlertDialogTrigger;
4310
5756
  exports.AlertTitle = AlertTitle;
5757
+ exports.AppStatusBar = AppStatusBar;
4311
5758
  exports.Avatar = Avatar;
4312
5759
  exports.AvatarFallback = AvatarFallback;
4313
5760
  exports.AvatarImage = AvatarImage;
4314
5761
  exports.Badge = Badge;
5762
+ exports.BarChartH = BarChartH;
5763
+ exports.BarChartV = BarChartV;
4315
5764
  exports.Breadcrumb = Breadcrumb;
4316
5765
  exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
4317
5766
  exports.BreadcrumbItem = BreadcrumbItem;
@@ -4324,6 +5773,7 @@ exports.ButtonGroup = ButtonGroup;
4324
5773
  exports.ButtonGroupSeparator = ButtonGroupSeparator;
4325
5774
  exports.ButtonGroupText = ButtonGroupText;
4326
5775
  exports.ButtonWithTooltip = ButtonWithTooltip;
5776
+ exports.CannotAnswerCard = CannotAnswerCard;
4327
5777
  exports.Card = Card;
4328
5778
  exports.CardContent = CardContent;
4329
5779
  exports.CardDescription = CardDescription;
@@ -4340,6 +5790,7 @@ exports.ChatSession = ChatSession;
4340
5790
  exports.ChatSessionActivityRow = ChatSessionActivityRow;
4341
5791
  exports.ChatSessionActivitySubLine = ChatSessionActivitySubLine;
4342
5792
  exports.ChatSessionComposer = ChatSessionComposer;
5793
+ exports.ChatSessionContextChip = ChatSessionContextChip;
4343
5794
  exports.ChatSessionDisclosure = ChatSessionDisclosure;
4344
5795
  exports.ChatSessionMessage = ChatSessionMessage;
4345
5796
  exports.ChatSessionMessageOptions = ChatSessionMessageOptions;
@@ -4348,6 +5799,10 @@ exports.ChatSessionPromptRow = ChatSessionPromptRow;
4348
5799
  exports.ChatSessionStatusBar = ChatSessionStatusBar;
4349
5800
  exports.ChatSessionTaskGroup = ChatSessionTaskGroup;
4350
5801
  exports.ChatSessionTaskRow = ChatSessionTaskRow;
5802
+ exports.CitationList = CitationList;
5803
+ exports.CitationMarker = CitationMarker;
5804
+ exports.CitationRow = CitationRow;
5805
+ exports.ClarifyCard = ClarifyCard;
4351
5806
  exports.Command = Command;
4352
5807
  exports.CommandDialog = CommandDialog;
4353
5808
  exports.CommandEmpty = CommandEmpty;
@@ -4357,6 +5812,8 @@ exports.CommandItem = CommandItem;
4357
5812
  exports.CommandList = CommandList;
4358
5813
  exports.CommandSeparator = CommandSeparator;
4359
5814
  exports.CommandShortcut = CommandShortcut;
5815
+ exports.ContextBar = ContextBar;
5816
+ exports.DiagnosisCard = DiagnosisCard;
4360
5817
  exports.Dialog = Dialog;
4361
5818
  exports.DialogClose = DialogClose;
4362
5819
  exports.DialogContent = DialogContent;
@@ -4367,6 +5824,10 @@ exports.DialogOverlay = DialogOverlay;
4367
5824
  exports.DialogPortal = DialogPortal;
4368
5825
  exports.DialogTitle = DialogTitle;
4369
5826
  exports.DialogTrigger = DialogTrigger;
5827
+ exports.DiffList = DiffList;
5828
+ exports.DiffRow = DiffRow;
5829
+ exports.DivergingBar = DivergingBar;
5830
+ exports.DotRating = DotRating;
4370
5831
  exports.DropdownMenu = DropdownMenu;
4371
5832
  exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
4372
5833
  exports.DropdownMenuContent = DropdownMenuContent;
@@ -4382,7 +5843,14 @@ exports.DropdownMenuSub = DropdownMenuSub;
4382
5843
  exports.DropdownMenuSubContent = DropdownMenuSubContent;
4383
5844
  exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
4384
5845
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
5846
+ exports.EmissionCard = EmissionCard;
5847
+ exports.EmissionHeader = EmissionHeader;
5848
+ exports.EmptyState = EmptyState;
5849
+ exports.EmptyStateLock = EmptyStateLock;
4385
5850
  exports.ErrorBoundary = ErrorBoundary;
5851
+ exports.FilterBar = FilterBar;
5852
+ exports.FilterChip = FilterChip;
5853
+ exports.HeatStrip = HeatStrip;
4386
5854
  exports.HoverCard = HoverCard;
4387
5855
  exports.HoverCardContent = HoverCardContent;
4388
5856
  exports.HoverCardTrigger = HoverCardTrigger;
@@ -4398,6 +5866,8 @@ exports.ItemSeparator = ItemSeparator;
4398
5866
  exports.ItemTitle = ItemTitle;
4399
5867
  exports.Kbd = Kbd;
4400
5868
  exports.KbdGroup = KbdGroup;
5869
+ exports.Legend = Legend;
5870
+ exports.LegendItem = LegendItem;
4401
5871
  exports.MenuItem = MenuItem;
4402
5872
  exports.Menubar = Menubar;
4403
5873
  exports.MenubarCheckboxItem = MenubarCheckboxItem;
@@ -4415,6 +5885,8 @@ exports.MenubarSub = MenubarSub;
4415
5885
  exports.MenubarSubContent = MenubarSubContent;
4416
5886
  exports.MenubarSubTrigger = MenubarSubTrigger;
4417
5887
  exports.MenubarTrigger = MenubarTrigger;
5888
+ exports.MetricGrid = MetricGrid;
5889
+ exports.MetricTile = MetricTile;
4418
5890
  exports.NavBase = NavBase;
4419
5891
  exports.NavHorizontal = NavHorizontal;
4420
5892
  exports.NavHorizontalItems = NavHorizontalItems;
@@ -4443,13 +5915,20 @@ exports.Popover = Popover;
4443
5915
  exports.PopoverContent = PopoverContent;
4444
5916
  exports.PopoverTrigger = PopoverTrigger;
4445
5917
  exports.Progress = Progress;
5918
+ exports.PropertyList = PropertyList;
5919
+ exports.PropertyRow = PropertyRow;
5920
+ exports.ProposalCard = ProposalCard;
5921
+ exports.RatingControl = RatingControl;
5922
+ exports.RepairNote = RepairNote;
4446
5923
  exports.ResizableHandle = ResizableHandle;
4447
5924
  exports.ResizablePanel = ResizablePanel;
4448
5925
  exports.ResizablePanelGroup = ResizablePanelGroup;
5926
+ exports.RetryNote = RetryNote;
4449
5927
  exports.RichSelect = RichSelect;
4450
5928
  exports.ScrollArea = ScrollArea;
4451
5929
  exports.ScrollBar = ScrollBar;
4452
5930
  exports.SearchInput = SearchInput;
5931
+ exports.SectionHeader = SectionHeader;
4453
5932
  exports.Separator = Separator;
4454
5933
  exports.Sheet = Sheet;
4455
5934
  exports.SheetClose = SheetClose;
@@ -4485,7 +5964,9 @@ exports.SidebarRail = SidebarRail;
4485
5964
  exports.SidebarSeparator = SidebarSeparator;
4486
5965
  exports.SidebarTrigger = SidebarTrigger;
4487
5966
  exports.Skeleton = Skeleton;
5967
+ exports.Sparkline = Sparkline;
4488
5968
  exports.Spinner = Spinner;
5969
+ exports.StatusDot = StatusDot;
4489
5970
  exports.TabbedPanel = TabbedPanel;
4490
5971
  exports.Table = Table;
4491
5972
  exports.TableBody = TableBody;
@@ -4499,6 +5980,11 @@ exports.Tabs = Tabs;
4499
5980
  exports.TabsContent = TabsContent;
4500
5981
  exports.TabsList = TabsList;
4501
5982
  exports.TabsTrigger = TabsTrigger;
5983
+ exports.TemplatePicker = TemplatePicker;
5984
+ exports.Terminal = Terminal;
5985
+ exports.TerminalLine = TerminalLine;
5986
+ exports.TimelineEntry = TimelineEntry;
5987
+ exports.TimelineList = TimelineList;
4502
5988
  exports.Toaster = Toaster;
4503
5989
  exports.Toggle = Toggle;
4504
5990
  exports.ToggleGroup = ToggleGroup;
@@ -4528,12 +6014,14 @@ exports.TypographyP = TypographyP;
4528
6014
  exports.TypographyPre = TypographyPre;
4529
6015
  exports.TypographySmall = TypographySmall;
4530
6016
  exports.UnderDevelopment = UnderDevelopment;
6017
+ exports.agentChipVariants = agentChipVariants;
4531
6018
  exports.badgeVariants = badgeVariants;
4532
6019
  exports.buttonGroupVariants = buttonGroupVariants;
4533
6020
  exports.buttonVariants = buttonVariants;
4534
6021
  exports.chatSessionGutterClass = chatSessionGutterClass;
4535
6022
  exports.cn = cn;
4536
6023
  exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
6024
+ exports.statusDotVariants = statusDotVariants;
4537
6025
  exports.toggleVariants = toggleVariants;
4538
6026
  exports.useSidebar = useSidebar;
4539
6027
  exports.useTour = useTour;