@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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
3
  import * as React23 from 'react';
4
4
  import React23__default, { Component } from 'react';
5
5
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
@@ -28,6 +28,13 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
28
28
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
29
29
 
30
30
  // src/lib/utils.ts
31
+ var twMerge = extendTailwindMerge({
32
+ extend: {
33
+ classGroups: {
34
+ "font-size": [{ text: ["meta"] }]
35
+ }
36
+ }
37
+ });
31
38
  function cn(...inputs) {
32
39
  return twMerge(clsx(inputs));
33
40
  }
@@ -104,7 +111,7 @@ var AlertDescription = React23.forwardRef(({ className, ...props }, ref) => /* @
104
111
  "div",
105
112
  {
106
113
  ref,
107
- className: cn("text-sm [&_p]:leading-relaxed", className),
114
+ className: cn("[&_p]:leading-relaxed", className),
108
115
  ...props
109
116
  }
110
117
  ));
@@ -122,10 +129,19 @@ var buttonVariants = cva(
122
129
  soft: "bg-primary/10 glassable text-primary ring-1 ring-primary/30 shadow-sm hover:bg-primary/20 active:bg-primary/25",
123
130
  link: "text-primary underline-offset-4 hover:underline hover:text-primary/80 active:text-primary/60"
124
131
  },
132
+ /*
133
+ * The scale runs 24 → 48. `xs` and `icon-xs` are the dense tier: a
134
+ * toolbar above a panel, an action inside a list row, a chip-height
135
+ * control beside 13px text. Below `sm` the icon has to come down with
136
+ * the box, so both xs sizes reset `[&_svg]:size-4` — the base class sets
137
+ * size-5, which at h-6 leaves no padding at all.
138
+ */
125
139
  size: {
140
+ xs: "h-6 rounded-control px-2 text-meta gap-1 [&_svg]:size-4",
126
141
  default: "h-9 px-4 py-2",
127
- sm: "h-8 rounded-control px-3 py-2 text-sm",
142
+ sm: "h-8 rounded-control px-3 py-2",
128
143
  lg: "h-12 rounded-control px-8 py-3",
144
+ "icon-xs": "h-6 w-6 rounded-control [&_svg]:size-4",
129
145
  icon: "h-8 w-8 rounded-control",
130
146
  "nav-icon": "h-11 w-11 rounded-control"
131
147
  }
@@ -221,7 +237,7 @@ var AlertDialogDescription = React23.forwardRef(({ className, ...props }, ref) =
221
237
  AlertDialogPrimitive.Description,
222
238
  {
223
239
  ref,
224
- className: cn("text-sm text-muted-foreground", className),
240
+ className: cn("text-muted-foreground", className),
225
241
  ...props
226
242
  }
227
243
  ));
@@ -283,24 +299,51 @@ var AvatarFallback = React23.forwardRef(({ className, ...props }, ref) => /* @__
283
299
  ));
284
300
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
285
301
  var badgeVariants = cva(
286
- "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",
302
+ "inline-flex items-center border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
287
303
  {
288
304
  variants: {
289
305
  variant: {
290
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
306
+ default: "border-transparent bg-[var(--badge-solid)] text-[var(--badge-on-solid)] hover:opacity-90",
291
307
  secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
292
308
  destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
293
- outline: "text-foreground border-border",
294
- soft: "border-primary/25 bg-primary/15 text-primary hover:bg-primary/20"
309
+ outline: "border-border text-[var(--badge-ink)]",
310
+ 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)]"
311
+ },
312
+ tone: {
313
+ primary: "[--badge-solid:var(--color-primary)] [--badge-on-solid:var(--color-primary-foreground)] [--badge-ink:var(--color-foreground)]",
314
+ success: "[--badge-solid:var(--color-success)] [--badge-on-solid:var(--color-success-foreground)] [--badge-ink:var(--color-success)]",
315
+ warning: "[--badge-solid:var(--color-warning)] [--badge-on-solid:var(--color-warning-foreground)] [--badge-ink:var(--color-warning)]",
316
+ info: "[--badge-solid:var(--color-info)] [--badge-on-solid:var(--color-info-foreground)] [--badge-ink:var(--color-info)]",
317
+ muted: "[--badge-solid:var(--color-muted-foreground)] [--badge-on-solid:var(--color-background)] [--badge-ink:var(--color-muted-foreground)]"
318
+ },
319
+ size: {
320
+ /** 18px — inline in a title, or a count against a label. */
321
+ xs: "h-[18px] px-1.5 text-meta",
322
+ /** 22px — the row chip: a status beside an entity name. */
323
+ sm: "h-[22px] px-2 text-meta",
324
+ /**
325
+ * Unchanged from before `size` existed: no explicit height, so it sizes
326
+ * from its text. Every badge already written keeps rendering exactly as
327
+ * it did — the two tiers above are additions, not a re-baseline.
328
+ */
329
+ default: "px-2.5 py-0.5 text-meta"
295
330
  }
296
331
  },
297
332
  defaultVariants: {
298
- variant: "default"
333
+ variant: "default",
334
+ tone: "primary",
335
+ size: "default"
299
336
  }
300
337
  }
301
338
  );
302
- function Badge({ className, variant, ...props }) {
303
- return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
339
+ function Badge({ className, variant, tone, size, ...props }) {
340
+ return /* @__PURE__ */ jsx(
341
+ "div",
342
+ {
343
+ className: cn(badgeVariants({ variant, tone, size }), className),
344
+ ...props
345
+ }
346
+ );
304
347
  }
305
348
  var Breadcrumb = React23.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
306
349
  Breadcrumb.displayName = "Breadcrumb";
@@ -309,7 +352,7 @@ var BreadcrumbList = React23.forwardRef(({ className, ...props }, ref) => /* @__
309
352
  {
310
353
  ref,
311
354
  className: cn(
312
- "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
355
+ "flex flex-wrap items-center gap-1.5 break-words text-muted-foreground sm:gap-2.5",
313
356
  className
314
357
  ),
315
358
  ...props
@@ -438,7 +481,7 @@ function ButtonGroupText({
438
481
  Comp,
439
482
  {
440
483
  className: cn(
441
- "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",
484
+ "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",
442
485
  className
443
486
  ),
444
487
  ...props
@@ -787,7 +830,7 @@ var DialogDescription = React23.forwardRef(({ className, ...props }, ref) => /*
787
830
  DialogPrimitive.Description,
788
831
  {
789
832
  ref,
790
- className: cn("text-sm text-muted-foreground", className),
833
+ className: cn("text-muted-foreground", className),
791
834
  ...props
792
835
  }
793
836
  ));
@@ -814,7 +857,7 @@ var CommandInput = React23.forwardRef(({ className, ...props }, ref) => /* @__PU
814
857
  {
815
858
  ref,
816
859
  className: cn(
817
- "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",
860
+ "flex h-10 w-full rounded-control bg-transparent py-3 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
818
861
  className
819
862
  ),
820
863
  ...props
@@ -835,7 +878,7 @@ var CommandEmpty = React23.forwardRef((props, ref) => /* @__PURE__ */ jsx(
835
878
  Command$1.Empty,
836
879
  {
837
880
  ref,
838
- className: "py-6 text-center text-sm",
881
+ className: "py-6 text-center",
839
882
  ...props
840
883
  }
841
884
  ));
@@ -845,7 +888,7 @@ var CommandGroup = React23.forwardRef(({ className, ...props }, ref) => /* @__PU
845
888
  {
846
889
  ref,
847
890
  className: cn(
848
- "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",
891
+ "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",
849
892
  className
850
893
  ),
851
894
  ...props
@@ -866,7 +909,7 @@ var CommandItem = React23.forwardRef(({ className, ...props }, ref) => /* @__PUR
866
909
  {
867
910
  ref,
868
911
  className: cn(
869
- "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",
912
+ "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",
870
913
  className
871
914
  ),
872
915
  ...props
@@ -881,7 +924,7 @@ var CommandShortcut = ({
881
924
  "span",
882
925
  {
883
926
  className: cn(
884
- "ml-auto text-xs tracking-widest text-muted-foreground",
927
+ "ml-auto text-meta tracking-widest text-muted-foreground",
885
928
  className
886
929
  ),
887
930
  ...props
@@ -1013,7 +1056,7 @@ var DropdownMenuShortcut = ({
1013
1056
  return /* @__PURE__ */ jsx(
1014
1057
  "span",
1015
1058
  {
1016
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
1059
+ className: cn("ml-auto text-meta tracking-widest opacity-60", className),
1017
1060
  ...props
1018
1061
  }
1019
1062
  );
@@ -1061,7 +1104,7 @@ function ItemSeparator({
1061
1104
  );
1062
1105
  }
1063
1106
  var itemVariants = cva(
1064
- "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]",
1107
+ "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]",
1065
1108
  {
1066
1109
  variants: {
1067
1110
  variant: {
@@ -1071,12 +1114,29 @@ var itemVariants = cva(
1071
1114
  },
1072
1115
  size: {
1073
1116
  default: "gap-4 p-4 ",
1074
- sm: "gap-2.5 px-4 py-3"
1117
+ sm: "gap-2.5 px-4 py-3",
1118
+ /**
1119
+ * The application row — 30px, the height a dense list actually uses:
1120
+ * an agent in a roster, a dataset, a schedule, a node type, a queue
1121
+ * entry. `min-h` rather than `h`, so a row that wraps still contains
1122
+ * its content instead of clipping it.
1123
+ */
1124
+ xs: "min-h-[30px] gap-2 px-2 py-1"
1125
+ },
1126
+ /**
1127
+ * Selection, not hover. A row the user has chosen stays marked while
1128
+ * they work elsewhere in the panel, which `:hover` cannot express.
1129
+ * Drive it from the same state that drives `aria-selected`.
1130
+ */
1131
+ selected: {
1132
+ true: "bg-accent",
1133
+ false: ""
1075
1134
  }
1076
1135
  },
1077
1136
  defaultVariants: {
1078
1137
  variant: "default",
1079
- size: "default"
1138
+ size: "default",
1139
+ selected: false
1080
1140
  }
1081
1141
  }
1082
1142
  );
@@ -1084,6 +1144,7 @@ function Item3({
1084
1144
  className,
1085
1145
  variant = "default",
1086
1146
  size = "default",
1147
+ selected,
1087
1148
  asChild = false,
1088
1149
  ...props
1089
1150
  }) {
@@ -1094,7 +1155,8 @@ function Item3({
1094
1155
  "data-slot": "item",
1095
1156
  "data-variant": variant,
1096
1157
  "data-size": size,
1097
- className: cn(itemVariants({ variant, size, className })),
1158
+ "data-selected": selected || void 0,
1159
+ className: cn(itemVariants({ variant, size, selected, className })),
1098
1160
  ...props
1099
1161
  }
1100
1162
  );
@@ -1148,7 +1210,7 @@ function ItemTitle({ className, ...props }) {
1148
1210
  {
1149
1211
  "data-slot": "item-title",
1150
1212
  className: cn(
1151
- "flex w-fit items-center gap-2 text-sm font-medium leading-snug",
1213
+ "flex w-fit items-center gap-2 font-medium leading-snug",
1152
1214
  className
1153
1215
  ),
1154
1216
  ...props
@@ -1161,7 +1223,9 @@ function ItemDescription({ className, ...props }) {
1161
1223
  {
1162
1224
  "data-slot": "item-description",
1163
1225
  className: cn(
1164
- "text-muted-foreground line-clamp-2 text-balance text-sm font-normal leading-normal",
1226
+ "text-muted-foreground line-clamp-2 text-balance font-normal leading-normal",
1227
+ // A dense row's subtitle is one line of meta, not a wrapped paragraph.
1228
+ "group-data-[size=xs]/item:line-clamp-1 group-data-[size=xs]/item:text-meta",
1165
1229
  "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
1166
1230
  className
1167
1231
  ),
@@ -1211,7 +1275,7 @@ function Kbd({ className, ...props }) {
1211
1275
  {
1212
1276
  "data-slot": "kbd",
1213
1277
  className: cn(
1214
- "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",
1278
+ "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",
1215
1279
  "[&_svg:not([class*='size-'])]:size-3",
1216
1280
  "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
1217
1281
  className
@@ -1401,7 +1465,7 @@ var MenubarShortcut = ({
1401
1465
  "span",
1402
1466
  {
1403
1467
  className: cn(
1404
- "ml-auto text-xs tracking-widest text-muted-foreground",
1468
+ "ml-auto text-meta tracking-widest text-muted-foreground",
1405
1469
  className
1406
1470
  ),
1407
1471
  ...props
@@ -1606,12 +1670,13 @@ var PopoverContent = React23.forwardRef(({ className, align = "center", sideOffs
1606
1670
  }
1607
1671
  ) }));
1608
1672
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
1609
- var Progress = React23.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
1673
+ var Progress = React23.forwardRef(({ className, value, size = "default", ...props }, ref) => /* @__PURE__ */ jsx(
1610
1674
  ProgressPrimitive.Root,
1611
1675
  {
1612
1676
  ref,
1613
1677
  className: cn(
1614
- "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
1678
+ "relative w-full overflow-hidden rounded-full bg-secondary",
1679
+ size === "sm" ? "h-1" : "h-4",
1615
1680
  className
1616
1681
  ),
1617
1682
  ...props,
@@ -1771,7 +1836,7 @@ var SheetDescription = React23.forwardRef(({ className, ...props }, ref) => /* @
1771
1836
  DialogPrimitive.Description,
1772
1837
  {
1773
1838
  ref,
1774
- className: cn("text-sm text-muted-foreground", className),
1839
+ className: cn("text-muted-foreground", className),
1775
1840
  ...props
1776
1841
  }
1777
1842
  ));
@@ -2069,7 +2134,7 @@ var SidebarInput = React23.forwardRef(({ className, type, ...props }, ref) => {
2069
2134
  "data-sidebar": "input",
2070
2135
  className: cn(
2071
2136
  // mirrors @invana/forms <Input> styling
2072
- "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",
2137
+ "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",
2073
2138
  "h-8 w-full shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
2074
2139
  className
2075
2140
  ),
@@ -2149,7 +2214,7 @@ var SidebarGroupLabel = React23.forwardRef(({ className, asChild = false, ...pro
2149
2214
  ref,
2150
2215
  "data-sidebar": "group-label",
2151
2216
  className: cn(
2152
- "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",
2217
+ "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",
2153
2218
  "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
2154
2219
  className
2155
2220
  ),
@@ -2182,7 +2247,7 @@ var SidebarGroupContent = React23.forwardRef(({ className, ...props }, ref) => /
2182
2247
  {
2183
2248
  ref,
2184
2249
  "data-sidebar": "group-content",
2185
- className: cn("w-full text-sm", className),
2250
+ className: cn("w-full", className),
2186
2251
  ...props
2187
2252
  }
2188
2253
  ));
@@ -2217,7 +2282,7 @@ var sidebarMenuButtonVariants = cva(
2217
2282
  },
2218
2283
  size: {
2219
2284
  default: "h-8",
2220
- sm: "h-7 text-sm",
2285
+ sm: "h-7",
2221
2286
  lg: "h-12 text-lg group-data-[collapsible=icon]:!p-0"
2222
2287
  }
2223
2288
  },
@@ -2302,7 +2367,7 @@ var SidebarMenuBadge = React23.forwardRef(({ className, ...props }, ref) => /* @
2302
2367
  ref,
2303
2368
  "data-sidebar": "menu-badge",
2304
2369
  className: cn(
2305
- "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",
2370
+ "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",
2306
2371
  "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
2307
2372
  "peer-data-[size=sm]/menu-button:top-1",
2308
2373
  "peer-data-[size=default]/menu-button:top-1.5",
@@ -2376,7 +2441,6 @@ var SidebarMenuSubButton = React23.forwardRef(({ asChild = false, size = "md", i
2376
2441
  className: cn(
2377
2442
  "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",
2378
2443
  "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
2379
- size === "sm" && "text-sm",
2380
2444
  size === "md" && "text-lg",
2381
2445
  "group-data-[collapsible=icon]:hidden",
2382
2446
  className
@@ -2433,14 +2497,69 @@ function Spinner({ className, ...props }) {
2433
2497
  }
2434
2498
  );
2435
2499
  }
2436
- var Table = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto border rounded-md", children: /* @__PURE__ */ jsx(
2437
- "table",
2500
+ var statusDotVariants = cva("inline-block shrink-0 rounded-full", {
2501
+ variants: {
2502
+ tone: {
2503
+ /** Work in flight. The only tone that animates. */
2504
+ running: "bg-primary animate-pulse motion-reduce:animate-none",
2505
+ /** Finished, and the result stands. */
2506
+ success: "bg-success",
2507
+ /** Finished, but something wants a person to look. */
2508
+ warning: "bg-warning",
2509
+ /** Failed. */
2510
+ error: "bg-destructive",
2511
+ /** Informational — a note, a count, a neutral marker. */
2512
+ info: "bg-info",
2513
+ /** Not started. Hollow, because there is nothing in it yet. */
2514
+ queued: "bg-transparent border-[1.5px] border-muted-foreground",
2515
+ /** Present but inactive — retired, paused, skipped, hidden. */
2516
+ muted: "bg-muted-foreground"
2517
+ },
2518
+ size: {
2519
+ /** 5px — inside a dense step row. */
2520
+ xs: "size-[5px]",
2521
+ /** 6px — the default in a thread or a list row. */
2522
+ sm: "size-1.5",
2523
+ /** 8px — a roster row, a legend swatch. */
2524
+ md: "size-2",
2525
+ /** 10px — a legend key that stands on its own. */
2526
+ lg: "size-2.5"
2527
+ }
2528
+ },
2529
+ defaultVariants: {
2530
+ tone: "muted",
2531
+ size: "sm"
2532
+ }
2533
+ });
2534
+ var StatusDot = React23.forwardRef(
2535
+ ({ className, tone, size, label, ...props }, ref) => /* @__PURE__ */ jsx(
2536
+ "span",
2537
+ {
2538
+ ref,
2539
+ className: cn(statusDotVariants({ tone, size }), className),
2540
+ role: label ? "img" : void 0,
2541
+ "aria-label": label,
2542
+ "aria-hidden": label ? void 0 : true,
2543
+ ...props
2544
+ }
2545
+ )
2546
+ );
2547
+ StatusDot.displayName = "StatusDot";
2548
+ var Table = React23.forwardRef(({ className, density = "default", ...props }, ref) => /* @__PURE__ */ jsx(
2549
+ "div",
2438
2550
  {
2439
- ref,
2440
- className: cn("w-full caption-bottom text-sm", className),
2441
- ...props
2551
+ "data-density": density,
2552
+ className: "group/table relative w-full overflow-auto border rounded-md",
2553
+ children: /* @__PURE__ */ jsx(
2554
+ "table",
2555
+ {
2556
+ ref,
2557
+ className: cn("w-full caption-bottom", className),
2558
+ ...props
2559
+ }
2560
+ )
2442
2561
  }
2443
- ) }));
2562
+ ));
2444
2563
  Table.displayName = "Table";
2445
2564
  var TableHeader = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
2446
2565
  TableHeader.displayName = "TableHeader";
@@ -2483,6 +2602,11 @@ var TableHead = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE_
2483
2602
  ref,
2484
2603
  className: cn(
2485
2604
  "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2605
+ // Compact density: `<Table density="compact">` marks the wrapper, and
2606
+ // every cell follows from there. One prop on the table rather than a
2607
+ // size on <TableHead> and <TableCell> individually — four places to
2608
+ // forget, and a table with two densities in it is always a mistake.
2609
+ "group-data-[density=compact]/table:h-[26px] group-data-[density=compact]/table:text-meta",
2486
2610
  className
2487
2611
  ),
2488
2612
  ...props
@@ -2495,6 +2619,7 @@ var TableCell = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE_
2495
2619
  ref,
2496
2620
  className: cn(
2497
2621
  "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2622
+ "group-data-[density=compact]/table:px-2 group-data-[density=compact]/table:py-1",
2498
2623
  className
2499
2624
  ),
2500
2625
  ...props
@@ -2510,30 +2635,40 @@ var TableCaption = React23.forwardRef(({ className, ...props }, ref) => /* @__PU
2510
2635
  }
2511
2636
  ));
2512
2637
  TableCaption.displayName = "TableCaption";
2513
- var Tabs = TabsPrimitive.Root;
2514
- var TabsList = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2515
- TabsPrimitive.List,
2516
- {
2517
- ref,
2518
- className: cn(
2519
- "inline-flex items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
2520
- className
2521
- ),
2522
- ...props
2523
- }
2524
- ));
2638
+ var TabsSizeContext = React23.createContext("default");
2639
+ var Tabs = React23.forwardRef(({ size = "default", ...props }, ref) => /* @__PURE__ */ jsx(TabsSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, ...props }) }));
2640
+ Tabs.displayName = TabsPrimitive.Root.displayName;
2641
+ var TabsList = React23.forwardRef(({ className, ...props }, ref) => {
2642
+ const size = React23.useContext(TabsSizeContext);
2643
+ return /* @__PURE__ */ jsx(
2644
+ TabsPrimitive.List,
2645
+ {
2646
+ ref,
2647
+ className: cn(
2648
+ "inline-flex items-center justify-center text-muted-foreground",
2649
+ size === "sm" ? "h-[30px] gap-1" : "rounded-lg bg-muted p-1",
2650
+ className
2651
+ ),
2652
+ ...props
2653
+ }
2654
+ );
2655
+ });
2525
2656
  TabsList.displayName = TabsPrimitive.List.displayName;
2526
- var TabsTrigger = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2527
- TabsPrimitive.Trigger,
2528
- {
2529
- ref,
2530
- className: cn(
2531
- "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",
2532
- className
2533
- ),
2534
- ...props
2535
- }
2536
- ));
2657
+ var TabsTrigger = React23.forwardRef(({ className, ...props }, ref) => {
2658
+ const size = React23.useContext(TabsSizeContext);
2659
+ return /* @__PURE__ */ jsx(
2660
+ TabsPrimitive.Trigger,
2661
+ {
2662
+ ref,
2663
+ className: cn(
2664
+ size === "sm" ? "h-[26px] px-2 text-meta" : "px-3 py-1",
2665
+ "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",
2666
+ className
2667
+ ),
2668
+ ...props
2669
+ }
2670
+ );
2671
+ });
2537
2672
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
2538
2673
  var TabsContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2539
2674
  TabsPrimitive.Content,
@@ -2609,12 +2744,211 @@ var ToggleGroupItem = React23.forwardRef(({ className, children, variant, size,
2609
2744
  );
2610
2745
  });
2611
2746
  ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
2747
+ var agentChipVariants = cva(
2748
+ "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",
2749
+ {
2750
+ variants: {
2751
+ /**
2752
+ * Who this is. The distinction is the point of the component: a reader
2753
+ * scanning a task list needs to know at a glance whether a person or an
2754
+ * agent is holding it, and reading the name is too slow.
2755
+ */
2756
+ kind: {
2757
+ agent: "border-border bg-transparent text-foreground",
2758
+ person: "border-transparent bg-accent text-foreground"
2759
+ },
2760
+ /** A retired or paused agent still appears in history and lineage. */
2761
+ inactive: {
2762
+ true: "opacity-60",
2763
+ false: ""
2764
+ }
2765
+ },
2766
+ defaultVariants: { kind: "agent", inactive: false }
2767
+ }
2768
+ );
2769
+ var AgentChip = React23.forwardRef(
2770
+ ({ icon, name, kind, inactive, className, ...props }, ref) => /* @__PURE__ */ jsxs(
2771
+ "span",
2772
+ {
2773
+ ref,
2774
+ className: cn(agentChipVariants({ kind, inactive }), className),
2775
+ ...props,
2776
+ children: [
2777
+ icon ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center text-muted-foreground", children: icon }) : null,
2778
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: name })
2779
+ ]
2780
+ }
2781
+ )
2782
+ );
2783
+ AgentChip.displayName = "AgentChip";
2784
+ var stateVariants = cva("inline-flex shrink-0 items-center gap-1.5 font-medium", {
2785
+ variants: {
2786
+ tone: {
2787
+ active: "text-success",
2788
+ running: "text-primary",
2789
+ draft: "text-muted-foreground",
2790
+ review: "text-warning",
2791
+ error: "text-destructive"
2792
+ }
2793
+ },
2794
+ defaultVariants: { tone: "active" }
2795
+ });
2796
+ var AppStatusBar = React23.forwardRef(
2797
+ ({ state, tone, end, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
2798
+ "div",
2799
+ {
2800
+ ref,
2801
+ className: cn(
2802
+ "flex h-[25px] shrink-0 items-center gap-2 border-t border-border px-2 text-meta text-muted-foreground",
2803
+ className
2804
+ ),
2805
+ ...props,
2806
+ children: [
2807
+ state != null ? /* @__PURE__ */ jsxs("span", { className: cn(stateVariants({ tone })), children: [
2808
+ /* @__PURE__ */ jsx(
2809
+ StatusDot,
2810
+ {
2811
+ tone: tone === "error" ? "error" : tone === "review" ? "warning" : tone === "running" ? "running" : tone === "draft" ? "muted" : "success"
2812
+ }
2813
+ ),
2814
+ state
2815
+ ] }) : null,
2816
+ state != null && children ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2022" }) : null,
2817
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children }),
2818
+ end != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: end }) : null
2819
+ ]
2820
+ }
2821
+ )
2822
+ );
2823
+ AppStatusBar.displayName = "AppStatusBar";
2824
+ var BarChartH = React23.forwardRef(
2825
+ ({
2826
+ data,
2827
+ max,
2828
+ labelWidth = 78,
2829
+ color = "var(--color-data-1)",
2830
+ caption,
2831
+ className,
2832
+ ...props
2833
+ }, ref) => {
2834
+ const ceiling = max ?? (Math.max(...data.map((d) => d.value), 0) || 1);
2835
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
2836
+ caption != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
2837
+ data.map((d, i) => /* @__PURE__ */ jsxs("div", { className: "flex h-4 items-center gap-2", children: [
2838
+ /* @__PURE__ */ jsx(
2839
+ "span",
2840
+ {
2841
+ className: "shrink-0 truncate text-meta text-muted-foreground",
2842
+ style: { width: labelWidth },
2843
+ children: d.label
2844
+ }
2845
+ ),
2846
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
2847
+ /* @__PURE__ */ jsx(
2848
+ "span",
2849
+ {
2850
+ title: `${d.label}: ${d.display ?? d.value}`,
2851
+ className: "h-2.5 shrink-0 rounded-e-[4px]",
2852
+ style: {
2853
+ width: `${Math.max(0, d.value / ceiling * 100)}%`,
2854
+ background: d.color ?? color
2855
+ }
2856
+ }
2857
+ ),
2858
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-meta tabular-nums", children: d.display ?? d.value })
2859
+ ] })
2860
+ ] }, i))
2861
+ ] });
2862
+ }
2863
+ );
2864
+ BarChartH.displayName = "BarChartH";
2865
+ var BarChartV = React23.forwardRef(
2866
+ ({
2867
+ data,
2868
+ max,
2869
+ gridlines = [],
2870
+ height = 160,
2871
+ color = "var(--color-data-1)",
2872
+ highlightColor,
2873
+ highlightIndex,
2874
+ labelMode = "last",
2875
+ caption,
2876
+ className,
2877
+ ...props
2878
+ }, ref) => {
2879
+ const ceiling = max ?? (Math.max(...data.map((d) => d.value), 0) || 1);
2880
+ const emphasis = highlightIndex ?? data.length - 1;
2881
+ const labelled = (i) => labelMode === "all" || labelMode === "last" && i === emphasis;
2882
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
2883
+ caption != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
2884
+ /* @__PURE__ */ jsxs("div", { className: "relative mt-2", style: { height }, children: [
2885
+ gridlines.map((g) => /* @__PURE__ */ jsxs(
2886
+ "div",
2887
+ {
2888
+ "aria-hidden": true,
2889
+ className: "absolute inset-x-0 flex translate-y-1/2 items-center",
2890
+ style: { bottom: `${g / ceiling * 100}%` },
2891
+ children: [
2892
+ /* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" }),
2893
+ /* @__PURE__ */ jsx("span", { className: "pl-1 text-meta tabular-nums text-muted-foreground", children: g })
2894
+ ]
2895
+ },
2896
+ g
2897
+ )),
2898
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-end justify-between gap-2", children: data.map((d, i) => /* @__PURE__ */ jsxs(
2899
+ "div",
2900
+ {
2901
+ className: "flex h-full min-w-0 flex-1 flex-col items-center justify-end gap-1",
2902
+ children: [
2903
+ labelled(i) ? /* @__PURE__ */ jsx("span", { className: "text-meta tabular-nums", children: d.display ?? d.value }) : null,
2904
+ /* @__PURE__ */ jsx(
2905
+ "span",
2906
+ {
2907
+ title: `${d.label}: ${d.display ?? d.value}`,
2908
+ className: "w-full max-w-6 rounded-t-[4px]",
2909
+ style: {
2910
+ height: `${Math.max(0, d.value / ceiling * 100)}%`,
2911
+ background: i === emphasis ? highlightColor ?? color : color,
2912
+ opacity: i === emphasis ? 1 : 0.55
2913
+ }
2914
+ }
2915
+ )
2916
+ ]
2917
+ },
2918
+ i
2919
+ )) })
2920
+ ] }),
2921
+ /* @__PURE__ */ jsx("div", { className: "flex justify-between gap-2", children: data.map((d, i) => /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col items-center", children: [
2922
+ /* @__PURE__ */ jsx("span", { className: "truncate text-meta text-muted-foreground", children: d.label }),
2923
+ d.sublabel != null ? /* @__PURE__ */ jsx("span", { className: "truncate text-meta text-muted-foreground/70", children: d.sublabel }) : null
2924
+ ] }, i)) })
2925
+ ] });
2926
+ }
2927
+ );
2928
+ BarChartV.displayName = "BarChartV";
2612
2929
  function ButtonWithTooltip(props) {
2613
2930
  return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { delayDuration: 0, children: [
2614
2931
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", className: cn("hover:bg-transparent", props.className), ...props, children: props.children }) }),
2615
2932
  /* @__PURE__ */ jsx(TooltipContent, { children: props.tooltip })
2616
2933
  ] }) });
2617
2934
  }
2935
+ var CannotAnswerCard = React23.forwardRef(({ label = "cannot answer", remedy, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
2936
+ "div",
2937
+ {
2938
+ ref,
2939
+ className: cn(
2940
+ "flex flex-col gap-1 border border-dashed border-border bg-card p-2",
2941
+ className
2942
+ ),
2943
+ ...props,
2944
+ children: [
2945
+ /* @__PURE__ */ jsx("span", { className: "text-meta font-medium text-muted-foreground", children: label }),
2946
+ /* @__PURE__ */ jsx("span", { children }),
2947
+ remedy != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: remedy }) : null
2948
+ ]
2949
+ }
2950
+ ));
2951
+ CannotAnswerCard.displayName = "CannotAnswerCard";
2618
2952
  function ChatSession({
2619
2953
  children,
2620
2954
  footer,
@@ -2752,12 +3086,14 @@ var NavItems = ({
2752
3086
  return /* @__PURE__ */ jsx(Fragment, { children: items.map((item) => {
2753
3087
  const isActive = activeItem === item.name;
2754
3088
  const padding = item.label ? "px-3 py-1.5" : "px-2 py-2";
2755
- const isInteractive = Boolean(item.href || item.onClick);
2756
- const itemClass = `inline-flex border-0 items-center justify-center gap-2
3089
+ const hasMenu = !item.href && Boolean(item.menuItems?.length);
3090
+ const isInteractive = Boolean(item.href || item.onClick || hasMenu);
3091
+ const itemClass = `relative inline-flex border-0 items-center justify-center gap-2
2757
3092
  whitespace-nowrap rounded-control transition-colors
2758
3093
  ring-1 ring-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
2759
3094
  ${padding}
2760
3095
  ${isInteractive ? "cursor-pointer hover:bg-primary/10 hover:text-primary hover:ring-primary/25" : ""}
3096
+ ${hasMenu ? "data-[state=open]:bg-primary/15 data-[state=open]:text-primary data-[state=open]:ring-primary/25" : ""}
2761
3097
  ${isActive ? `bg-primary/15 text-primary ring-primary/25 ${item.activeClass || ""}` : ""}
2762
3098
  ${item.className || ""}`;
2763
3099
  const icon = item.icon && /* @__PURE__ */ jsx(
@@ -2767,40 +3103,76 @@ var NavItems = ({
2767
3103
  className: item.iconClassName || iconClassName
2768
3104
  }
2769
3105
  );
2770
- const label = item.label && /* @__PURE__ */ jsx("span", { className: "text-sm", children: item.label });
3106
+ const label = item.label && /* @__PURE__ */ jsx("span", { children: item.label });
3107
+ const badge = item.badge != null && /* @__PURE__ */ jsx(
3108
+ "span",
3109
+ {
3110
+ 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",
3111
+ children: item.badge
3112
+ }
3113
+ );
3114
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3115
+ icon,
3116
+ label,
3117
+ badge
3118
+ ] });
3119
+ const control = item.href ? /* @__PURE__ */ jsx(
3120
+ "a",
3121
+ {
3122
+ href: item.href,
3123
+ onClick: () => setActiveItem(item.name),
3124
+ className: itemClass,
3125
+ children: inner
3126
+ }
3127
+ ) : item.onClick || hasMenu ? /* @__PURE__ */ jsx(
3128
+ "button",
3129
+ {
3130
+ type: "button",
3131
+ onClick: () => {
3132
+ item.onClick?.();
3133
+ if (!hasMenu) setActiveItem(isActive ? null : item.name);
3134
+ },
3135
+ className: itemClass,
3136
+ children: inner
3137
+ }
3138
+ ) : /* @__PURE__ */ jsx("div", { className: itemClass, children: inner });
3139
+ const withTooltip = /* @__PURE__ */ jsxs(Tooltip, { children: [
3140
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: hasMenu ? /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: control }) : control }),
3141
+ /* @__PURE__ */ jsx(TooltipContent, { side: item.tooltipSide || tooltipSide, children: item.tooltip || item.name })
3142
+ ] });
2771
3143
  return /* @__PURE__ */ jsxs(React23__default.Fragment, { children: [
2772
- /* @__PURE__ */ jsxs(Tooltip, { children: [
2773
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: item.href ? /* @__PURE__ */ jsxs(
2774
- "a",
2775
- {
2776
- href: item.href,
2777
- onClick: () => setActiveItem(item.name),
2778
- className: itemClass,
2779
- children: [
2780
- icon,
2781
- label
2782
- ]
2783
- }
2784
- ) : item.onClick ? /* @__PURE__ */ jsxs(
2785
- "button",
3144
+ hasMenu ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3145
+ withTooltip,
3146
+ /* @__PURE__ */ jsx(
3147
+ DropdownMenuContent,
2786
3148
  {
2787
- type: "button",
2788
- onClick: () => {
2789
- item.onClick?.();
2790
- setActiveItem(isActive ? null : item.name);
2791
- },
2792
- className: itemClass,
2793
- children: [
2794
- icon,
2795
- label
2796
- ]
3149
+ side: isVertical ? "right" : "bottom",
3150
+ align: isVertical ? "start" : "end",
3151
+ children: item.menuItems?.map((menuItem) => {
3152
+ const MenuIcon = menuItem.icon;
3153
+ const gutter = item.menuItems?.some((m) => m.icon);
3154
+ return /* @__PURE__ */ jsxs(React23__default.Fragment, { children: [
3155
+ menuItem.separatorBefore && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3156
+ /* @__PURE__ */ jsxs(
3157
+ DropdownMenuItem,
3158
+ {
3159
+ disabled: menuItem.disabled,
3160
+ onSelect: () => menuItem.onSelect?.(),
3161
+ className: cn(
3162
+ menuItem.destructive && "text-destructive focus:bg-destructive/15 focus:text-destructive hover:bg-destructive/10 hover:text-destructive"
3163
+ ),
3164
+ children: [
3165
+ MenuIcon ? /* @__PURE__ */ jsx(MenuIcon, {}) : gutter ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "size-4 shrink-0" }) : null,
3166
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: menuItem.label }),
3167
+ menuItem.shortcut && /* @__PURE__ */ jsx(DropdownMenuShortcut, { children: menuItem.shortcut })
3168
+ ]
3169
+ }
3170
+ )
3171
+ ] }, menuItem.id);
3172
+ })
2797
3173
  }
2798
- ) : /* @__PURE__ */ jsxs("div", { className: itemClass, children: [
2799
- icon,
2800
- label
2801
- ] }) }),
2802
- /* @__PURE__ */ jsx(TooltipContent, { side: item.tooltipSide || tooltipSide, children: item.tooltip || item.name })
2803
- ] }),
3174
+ )
3175
+ ] }) : withTooltip,
2804
3176
  item.showSeperator && /* @__PURE__ */ jsx(
2805
3177
  Separator,
2806
3178
  {
@@ -3207,67 +3579,604 @@ function ChatSessionStatusBar({
3207
3579
  }
3208
3580
  );
3209
3581
  }
3210
- var ErrorBoundary = class extends Component {
3211
- constructor(props) {
3212
- super(props);
3213
- this.state = { hasError: false };
3214
- }
3215
- static getDerivedStateFromError(_) {
3216
- return { hasError: true };
3217
- }
3218
- componentDidCatch(error, errorInfo) {
3219
- console.error("ErrorBoundary caught an error", error, errorInfo);
3220
- }
3221
- render() {
3222
- if (this.state.hasError) {
3223
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center h-full w-full text-sm", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center", children: [
3224
- /* @__PURE__ */ jsx(Frown, { className: "mr-1 h-4" }),
3225
- "Oops ! something went wrong."
3226
- ] }) });
3227
- }
3228
- return this.props.children;
3229
- }
3230
- };
3231
- var MenuItem = ({
3232
- label,
3233
- icon: Icon,
3234
- shortcut,
3235
- children,
3582
+ function ChatSessionContextChip({
3583
+ icon,
3584
+ onDismiss,
3585
+ dismissLabel = "Remove context",
3236
3586
  className,
3237
- level = 0,
3238
- href,
3239
- onClick
3240
- }) => {
3241
- const hasChildren = children && children.length > 0;
3242
- const ButtonOrLink = href ? "a" : "button";
3243
- const clickTrigger = href ? { href } : { onClick };
3244
- return /* @__PURE__ */ jsxs("li", { className: "relative group/item", children: [
3245
- /* @__PURE__ */ jsxs(
3246
- ButtonOrLink,
3247
- {
3248
- ...clickTrigger,
3249
- className: cn(
3250
- "flex w-full items-center justify-between px-4 py-2 ",
3251
- "hover:bg-accent hover:text-accent-foreground",
3252
- "focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",
3253
- className,
3254
- level === 0 ? "font-medium" : "font-normal"
3255
- // "group-hover/item:bg-accent/50"
3256
- ),
3257
- role: hasChildren ? "menuitem" : void 0,
3258
- "aria-haspopup": hasChildren ? "true" : void 0,
3259
- "aria-expanded": hasChildren ? "true" : void 0,
3260
- children: [
3261
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
3262
- Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
3263
- /* @__PURE__ */ jsx("span", { children: label })
3264
- ] }),
3265
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
3266
- shortcut && /* @__PURE__ */ 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 }),
3267
- hasChildren && /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
3268
- ] })
3269
- ]
3270
- }
3587
+ children,
3588
+ ...props
3589
+ }) {
3590
+ return /* @__PURE__ */ jsxs(
3591
+ "div",
3592
+ {
3593
+ className: cn(
3594
+ "flex min-h-[26px] items-center gap-1.5 border border-border bg-muted/40 px-1.5 text-meta",
3595
+ className
3596
+ ),
3597
+ ...props,
3598
+ children: [
3599
+ icon ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center text-muted-foreground [&_svg]:size-3", children: icon }) : null,
3600
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children }),
3601
+ onDismiss ? /* @__PURE__ */ jsx(
3602
+ "button",
3603
+ {
3604
+ type: "button",
3605
+ onClick: onDismiss,
3606
+ "aria-label": dismissLabel,
3607
+ className: "shrink-0 px-1 text-muted-foreground hover:text-foreground",
3608
+ children: "\xD7"
3609
+ }
3610
+ ) : null
3611
+ ]
3612
+ }
3613
+ );
3614
+ }
3615
+ var CitationList = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("ul", { ref, className: cn("flex flex-col", className), ...props, children }));
3616
+ CitationList.displayName = "CitationList";
3617
+ var CitationRow = React23.forwardRef(
3618
+ ({ kind, source, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
3619
+ "li",
3620
+ {
3621
+ ref,
3622
+ className: cn("flex min-h-[26px] items-center gap-2 py-0.5", className),
3623
+ ...props,
3624
+ children: [
3625
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 border border-border px-1 text-meta text-muted-foreground", children: kind }),
3626
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children }),
3627
+ source != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: source }) : null
3628
+ ]
3629
+ }
3630
+ )
3631
+ );
3632
+ CitationRow.displayName = "CitationRow";
3633
+ var ClarifyCard = React23.forwardRef(
3634
+ ({
3635
+ step,
3636
+ waiting,
3637
+ question,
3638
+ options,
3639
+ value,
3640
+ onSelect,
3641
+ actions,
3642
+ footnote,
3643
+ className,
3644
+ ...props
3645
+ }, ref) => {
3646
+ const name = React23.useId();
3647
+ return /* @__PURE__ */ jsxs(
3648
+ "div",
3649
+ {
3650
+ ref,
3651
+ className: cn("flex flex-col overflow-hidden border border-border bg-card", className),
3652
+ ...props,
3653
+ children: [
3654
+ /* @__PURE__ */ jsxs("div", { className: "flex h-6 shrink-0 items-center gap-2 border-b border-border bg-muted/40 px-2 text-meta", children: [
3655
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium", children: "question" }),
3656
+ step != null ? /* @__PURE__ */ jsx("span", { className: "truncate text-muted-foreground", children: step }) : null,
3657
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
3658
+ waiting != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: waiting }) : null
3659
+ ] }),
3660
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 p-2", children: [
3661
+ /* @__PURE__ */ jsx("p", { children: question }),
3662
+ /* @__PURE__ */ jsx("div", { role: "radiogroup", className: "flex flex-col gap-1", children: options.map((o) => {
3663
+ const checked = value === o.value;
3664
+ return /* @__PURE__ */ jsxs(
3665
+ "label",
3666
+ {
3667
+ className: cn(
3668
+ "flex min-h-[30px] cursor-pointer items-center gap-2 border px-2 py-1",
3669
+ checked ? "border-primary/40 bg-primary/10" : "border-border",
3670
+ o.disabled && "cursor-not-allowed opacity-50"
3671
+ ),
3672
+ children: [
3673
+ /* @__PURE__ */ jsx(
3674
+ "input",
3675
+ {
3676
+ type: "radio",
3677
+ name,
3678
+ value: o.value,
3679
+ checked,
3680
+ disabled: o.disabled,
3681
+ onChange: () => onSelect?.(o.value),
3682
+ className: "sr-only"
3683
+ }
3684
+ ),
3685
+ /* @__PURE__ */ jsx(
3686
+ "span",
3687
+ {
3688
+ "aria-hidden": true,
3689
+ className: cn(
3690
+ "flex size-3.5 shrink-0 items-center justify-center rounded-full border",
3691
+ checked ? "border-primary" : "border-muted-foreground"
3692
+ ),
3693
+ children: checked ? /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-primary" }) : null
3694
+ }
3695
+ ),
3696
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: o.label }),
3697
+ o.detail != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 font-mono text-meta text-muted-foreground", children: o.detail }) : null
3698
+ ]
3699
+ },
3700
+ o.value
3701
+ );
3702
+ }) }),
3703
+ actions || footnote != null ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
3704
+ actions,
3705
+ footnote != null ? /* @__PURE__ */ jsx("span", { className: "flex-1 text-meta text-muted-foreground", children: footnote }) : null
3706
+ ] }) : null
3707
+ ] })
3708
+ ]
3709
+ }
3710
+ );
3711
+ }
3712
+ );
3713
+ ClarifyCard.displayName = "ClarifyCard";
3714
+ var ContextBar = React23.forwardRef(
3715
+ ({ counters, hint, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
3716
+ "div",
3717
+ {
3718
+ ref,
3719
+ className: cn(
3720
+ "flex h-7 shrink-0 items-center gap-3 border-t border-border px-2 text-meta",
3721
+ className
3722
+ ),
3723
+ ...props,
3724
+ children: [
3725
+ children ? /* @__PURE__ */ jsx("div", { className: "flex min-w-0 shrink-0 items-center gap-2", children }) : null,
3726
+ counters ? /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center gap-3 text-muted-foreground", children: counters }) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
3727
+ hint != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: hint }) : null
3728
+ ]
3729
+ }
3730
+ )
3731
+ );
3732
+ ContextBar.displayName = "ContextBar";
3733
+ var DiagnosisCard = React23.forwardRef(({ code, attempted, target, actions, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
3734
+ "div",
3735
+ {
3736
+ ref,
3737
+ className: cn("flex flex-col gap-2 border border-destructive/40 bg-card p-2", className),
3738
+ ...props,
3739
+ children: [
3740
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-meta", children: [
3741
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium text-destructive", children: "diagnosis" }),
3742
+ /* @__PURE__ */ jsx("span", { className: "truncate font-mono text-muted-foreground", children: code })
3743
+ ] }),
3744
+ children != null ? /* @__PURE__ */ jsx("div", { children }) : null,
3745
+ attempted != null || target != null ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 border border-border bg-muted/40 p-1.5", children: [
3746
+ /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: "what was tried" }),
3747
+ attempted != null ? /* @__PURE__ */ jsx("code", { className: "whitespace-pre-wrap break-all font-mono text-meta", children: attempted }) : null,
3748
+ target != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: target }) : null
3749
+ ] }) : null,
3750
+ actions ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: actions }) : null
3751
+ ]
3752
+ }
3753
+ ));
3754
+ DiagnosisCard.displayName = "DiagnosisCard";
3755
+ var OP_SIGN = { add: "+", remove: "\u2212", change: "~" };
3756
+ var OP_CLASS = {
3757
+ add: "text-success",
3758
+ remove: "text-destructive",
3759
+ change: "text-warning"
3760
+ };
3761
+ var DiffList = React23.forwardRef(
3762
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("ul", { ref, className: cn("flex flex-col", className), ...props, children })
3763
+ );
3764
+ DiffList.displayName = "DiffList";
3765
+ var DiffRow = React23.forwardRef(
3766
+ ({ op = "add", kind, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
3767
+ "li",
3768
+ {
3769
+ ref,
3770
+ className: cn("flex items-baseline gap-2 py-0.5 text-meta", className),
3771
+ ...props,
3772
+ children: [
3773
+ /* @__PURE__ */ jsx("span", { className: cn("w-3 shrink-0 text-center font-mono", OP_CLASS[op]), children: OP_SIGN[op] }),
3774
+ kind != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: kind }) : null,
3775
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children })
3776
+ ]
3777
+ }
3778
+ )
3779
+ );
3780
+ DiffRow.displayName = "DiffRow";
3781
+ var DivergingBar = React23.forwardRef(
3782
+ ({
3783
+ data,
3784
+ max,
3785
+ labelWidth = 104,
3786
+ positiveColor = "var(--color-success)",
3787
+ negativeColor = "var(--color-destructive)",
3788
+ caption,
3789
+ className,
3790
+ ...props
3791
+ }, ref) => {
3792
+ const ceiling = max ?? (Math.max(...data.map((d) => Math.abs(d.value)), 0) || 1);
3793
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
3794
+ caption != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
3795
+ data.map((d, i) => {
3796
+ const positive = d.value >= 0;
3797
+ const width = `${Math.abs(d.value) / ceiling * 50}%`;
3798
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-4 items-center gap-2", children: [
3799
+ /* @__PURE__ */ jsx(
3800
+ "span",
3801
+ {
3802
+ className: "shrink-0 truncate text-meta text-muted-foreground",
3803
+ style: { width: labelWidth },
3804
+ children: d.label
3805
+ }
3806
+ ),
3807
+ /* @__PURE__ */ jsxs("span", { className: "relative flex min-w-0 flex-1 items-center", children: [
3808
+ /* @__PURE__ */ jsx(
3809
+ "span",
3810
+ {
3811
+ "aria-hidden": true,
3812
+ className: "absolute left-1/2 h-4 w-px -translate-x-1/2 bg-border"
3813
+ }
3814
+ ),
3815
+ /* @__PURE__ */ jsx("span", { className: "flex w-1/2 justify-end", children: !positive ? /* @__PURE__ */ jsx(
3816
+ "span",
3817
+ {
3818
+ title: `${d.label}: ${d.display ?? d.value}`,
3819
+ className: "h-2.5 rounded-s-[4px]",
3820
+ style: { width, background: negativeColor }
3821
+ }
3822
+ ) : null }),
3823
+ /* @__PURE__ */ jsx("span", { className: "flex w-1/2 justify-start", children: positive ? /* @__PURE__ */ jsx(
3824
+ "span",
3825
+ {
3826
+ title: `${d.label}: ${d.display ?? d.value}`,
3827
+ className: "h-2.5 rounded-e-[4px]",
3828
+ style: { width, background: positiveColor }
3829
+ }
3830
+ ) : null })
3831
+ ] }),
3832
+ /* @__PURE__ */ jsx("span", { className: "w-8 shrink-0 text-right text-meta tabular-nums", children: d.display ?? (d.value > 0 ? `+${d.value}` : d.value) })
3833
+ ] }, i);
3834
+ })
3835
+ ] });
3836
+ }
3837
+ );
3838
+ DivergingBar.displayName = "DivergingBar";
3839
+ var EmissionHeader = React23.forwardRef(({ kind, template, citation, note, actions, className, ...props }, ref) => /* @__PURE__ */ jsxs(
3840
+ "div",
3841
+ {
3842
+ ref,
3843
+ className: cn(
3844
+ "flex h-6 shrink-0 items-center gap-2 border-b border-border bg-muted/40 px-2 text-meta",
3845
+ className
3846
+ ),
3847
+ ...props,
3848
+ children: [
3849
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium", children: kind }),
3850
+ template != null ? /* @__PURE__ */ jsx("span", { className: "truncate font-mono text-muted-foreground", children: template }) : null,
3851
+ note != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 border border-border px-1 text-muted-foreground", children: note }) : null,
3852
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
3853
+ citation != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: citation }) : null,
3854
+ actions ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: actions }) : null
3855
+ ]
3856
+ }
3857
+ ));
3858
+ EmissionHeader.displayName = "EmissionHeader";
3859
+ var EmissionCard = React23.forwardRef(
3860
+ ({
3861
+ kind,
3862
+ template,
3863
+ citation,
3864
+ note,
3865
+ actions,
3866
+ showHeader = true,
3867
+ className,
3868
+ children,
3869
+ ...props
3870
+ }, ref) => /* @__PURE__ */ jsxs(
3871
+ "div",
3872
+ {
3873
+ ref,
3874
+ "data-kind": kind,
3875
+ className: cn("flex flex-col overflow-hidden border border-border bg-card", className),
3876
+ ...props,
3877
+ children: [
3878
+ showHeader ? /* @__PURE__ */ jsx(
3879
+ EmissionHeader,
3880
+ {
3881
+ kind,
3882
+ template,
3883
+ citation,
3884
+ note,
3885
+ actions
3886
+ }
3887
+ ) : null,
3888
+ children
3889
+ ]
3890
+ }
3891
+ )
3892
+ );
3893
+ EmissionCard.displayName = "EmissionCard";
3894
+ var CitationMarker = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
3895
+ "sup",
3896
+ {
3897
+ ref,
3898
+ className: cn("px-0.5 align-super text-[0.7em] text-primary", className),
3899
+ ...props,
3900
+ children
3901
+ }
3902
+ ));
3903
+ CitationMarker.displayName = "CitationMarker";
3904
+ var EmptyState = React23.forwardRef(
3905
+ ({ icon, title, description, actions, locks, className, ...props }, ref) => /* @__PURE__ */ jsxs(
3906
+ "div",
3907
+ {
3908
+ ref,
3909
+ className: cn(
3910
+ "flex flex-col items-center justify-center gap-2 p-6 text-center",
3911
+ className
3912
+ ),
3913
+ ...props,
3914
+ children: [
3915
+ icon ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: icon }) : null,
3916
+ /* @__PURE__ */ jsx("h3", { className: "font-medium", children: title }),
3917
+ description != null ? /* @__PURE__ */ jsx("p", { className: "max-w-prose text-muted-foreground", children: description }) : null,
3918
+ actions ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-center gap-1.5 pt-1", children: actions }) : null,
3919
+ locks ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-center gap-1.5 pt-1", children: locks }) : null
3920
+ ]
3921
+ }
3922
+ )
3923
+ );
3924
+ EmptyState.displayName = "EmptyState";
3925
+ var EmptyStateLock = React23.forwardRef(({ icon, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
3926
+ "span",
3927
+ {
3928
+ ref,
3929
+ className: cn(
3930
+ "inline-flex h-6 items-center gap-1.5 border border-dashed border-border px-2 text-meta text-muted-foreground [&_svg]:size-3",
3931
+ className
3932
+ ),
3933
+ ...props,
3934
+ children: [
3935
+ icon,
3936
+ children
3937
+ ]
3938
+ }
3939
+ ));
3940
+ EmptyStateLock.displayName = "EmptyStateLock";
3941
+ var ErrorBoundary = class extends Component {
3942
+ constructor(props) {
3943
+ super(props);
3944
+ this.state = { hasError: false };
3945
+ }
3946
+ static getDerivedStateFromError(_) {
3947
+ return { hasError: true };
3948
+ }
3949
+ componentDidCatch(error, errorInfo) {
3950
+ console.error("ErrorBoundary caught an error", error, errorInfo);
3951
+ }
3952
+ render() {
3953
+ if (this.state.hasError) {
3954
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center h-full w-full", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center", children: [
3955
+ /* @__PURE__ */ jsx(Frown, { className: "mr-1 h-4" }),
3956
+ "Oops ! something went wrong."
3957
+ ] }) });
3958
+ }
3959
+ return this.props.children;
3960
+ }
3961
+ };
3962
+ var FilterBar = React23.forwardRef(
3963
+ ({ summary, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
3964
+ "div",
3965
+ {
3966
+ ref,
3967
+ className: cn(
3968
+ "flex h-[30px] shrink-0 items-center gap-1.5 border-b border-border px-2",
3969
+ className
3970
+ ),
3971
+ ...props,
3972
+ children: [
3973
+ children,
3974
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
3975
+ summary != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: summary }) : null
3976
+ ]
3977
+ }
3978
+ )
3979
+ );
3980
+ FilterBar.displayName = "FilterBar";
3981
+ var FilterChip = React23.forwardRef(
3982
+ ({ label, value, active, className, ...props }, ref) => /* @__PURE__ */ jsxs(
3983
+ Button,
3984
+ {
3985
+ ref,
3986
+ type: "button",
3987
+ variant: "outline",
3988
+ size: "xs",
3989
+ "data-active": active || void 0,
3990
+ className: cn(
3991
+ "h-[22px] gap-1 px-1.5 font-normal",
3992
+ active && "border-primary/40 text-primary",
3993
+ className
3994
+ ),
3995
+ ...props,
3996
+ children: [
3997
+ /* @__PURE__ */ jsx("span", { className: cn(value != null && "text-muted-foreground"), children: label }),
3998
+ value != null ? /* @__PURE__ */ jsx("span", { className: "truncate", children: value }) : null,
3999
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: "\u25BE" })
4000
+ ]
4001
+ }
4002
+ )
4003
+ );
4004
+ FilterChip.displayName = "FilterChip";
4005
+ var HeatStrip = React23.forwardRef(
4006
+ ({ cells, states, ticks, cellSize = 14, className, ...props }, ref) => {
4007
+ const byKey = React23.useMemo(
4008
+ () => new Map(states.map((s) => [s.key, s])),
4009
+ [states]
4010
+ );
4011
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
4012
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: cells.map((c, i) => {
4013
+ const s = byKey.get(c.state);
4014
+ return /* @__PURE__ */ jsx(
4015
+ "span",
4016
+ {
4017
+ title: `${c.at} \xB7 ${s?.label ?? c.state}${c.detail ? ` \xB7 ${c.detail}` : ""}`,
4018
+ className: cn("shrink-0 rounded-[2px]", s?.hollow && "border"),
4019
+ style: {
4020
+ width: cellSize,
4021
+ height: cellSize,
4022
+ background: s?.hollow ? "transparent" : s?.color ?? "var(--color-muted)",
4023
+ borderColor: s?.hollow ? s.color ?? "var(--color-border)" : void 0
4024
+ }
4025
+ },
4026
+ i
4027
+ );
4028
+ }) }),
4029
+ ticks?.length ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", "aria-hidden": true, children: cells.map((_, i) => {
4030
+ const tick = ticks.find((t) => t.at === i);
4031
+ return /* @__PURE__ */ jsx(
4032
+ "span",
4033
+ {
4034
+ className: "shrink-0 text-meta tabular-nums text-muted-foreground",
4035
+ style: { width: cellSize },
4036
+ children: tick ? tick.label : ""
4037
+ },
4038
+ i
4039
+ );
4040
+ }) }) : null,
4041
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-meta", children: states.map((s) => /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
4042
+ /* @__PURE__ */ jsx(
4043
+ "span",
4044
+ {
4045
+ "aria-hidden": true,
4046
+ className: cn("size-2.5 shrink-0 rounded-[2px]", s.hollow && "border"),
4047
+ style: {
4048
+ background: s.hollow ? "transparent" : s.color ?? "var(--color-muted)",
4049
+ borderColor: s.hollow ? s.color ?? "var(--color-border)" : void 0
4050
+ }
4051
+ }
4052
+ ),
4053
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: s.label })
4054
+ ] }, s.key)) })
4055
+ ] });
4056
+ }
4057
+ );
4058
+ HeatStrip.displayName = "HeatStrip";
4059
+ function Swatch({ kind = "dot", color }) {
4060
+ const style = { color };
4061
+ if (kind === "dot")
4062
+ return /* @__PURE__ */ jsx(
4063
+ "span",
4064
+ {
4065
+ "aria-hidden": true,
4066
+ style,
4067
+ className: "size-2 shrink-0 rounded-full bg-current"
4068
+ }
4069
+ );
4070
+ if (kind === "ring")
4071
+ return /* @__PURE__ */ jsx(
4072
+ "span",
4073
+ {
4074
+ "aria-hidden": true,
4075
+ style,
4076
+ className: "size-2 shrink-0 rounded-full border-[1.5px] border-current"
4077
+ }
4078
+ );
4079
+ if (kind === "line")
4080
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": true, style, className: "h-0.5 w-4 shrink-0 bg-current" });
4081
+ if (kind === "dashed")
4082
+ return /* @__PURE__ */ jsx(
4083
+ "span",
4084
+ {
4085
+ "aria-hidden": true,
4086
+ style,
4087
+ className: "h-0 w-4 shrink-0 border-t-[1.5px] border-dashed border-current"
4088
+ }
4089
+ );
4090
+ return /* @__PURE__ */ jsxs(
4091
+ "svg",
4092
+ {
4093
+ "aria-hidden": true,
4094
+ style,
4095
+ className: "w-4 shrink-0 overflow-visible",
4096
+ viewBox: "0 0 16 6",
4097
+ height: "6",
4098
+ fill: "none",
4099
+ children: [
4100
+ /* @__PURE__ */ jsx("path", { d: "M0 3h11", stroke: "currentColor", strokeWidth: "2" }),
4101
+ /* @__PURE__ */ jsx("path", { d: "M10 0l6 3-6 3z", fill: "currentColor" })
4102
+ ]
4103
+ }
4104
+ );
4105
+ }
4106
+ var Legend = React23.forwardRef(
4107
+ ({ orientation = "row", className, children, ...props }, ref) => /* @__PURE__ */ jsx(
4108
+ "div",
4109
+ {
4110
+ ref,
4111
+ role: "list",
4112
+ className: cn(
4113
+ "flex gap-x-3 gap-y-1 text-meta",
4114
+ orientation === "row" ? "flex-wrap items-center" : "flex-col",
4115
+ className
4116
+ ),
4117
+ ...props,
4118
+ children
4119
+ }
4120
+ )
4121
+ );
4122
+ Legend.displayName = "Legend";
4123
+ var LegendItem = React23.forwardRef(
4124
+ ({ kind, color, label, count, className, ...props }, ref) => /* @__PURE__ */ jsxs(
4125
+ "div",
4126
+ {
4127
+ ref,
4128
+ role: "listitem",
4129
+ className: cn("flex min-w-0 items-center gap-1.5", className),
4130
+ ...props,
4131
+ children: [
4132
+ /* @__PURE__ */ jsx(Swatch, { kind, color }),
4133
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: label }),
4134
+ count != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: count }) : null
4135
+ ]
4136
+ }
4137
+ )
4138
+ );
4139
+ LegendItem.displayName = "LegendItem";
4140
+ var MenuItem = ({
4141
+ label,
4142
+ icon: Icon,
4143
+ shortcut,
4144
+ children,
4145
+ className,
4146
+ level = 0,
4147
+ href,
4148
+ onClick
4149
+ }) => {
4150
+ const hasChildren = children && children.length > 0;
4151
+ const ButtonOrLink = href ? "a" : "button";
4152
+ const clickTrigger = href ? { href } : { onClick };
4153
+ return /* @__PURE__ */ jsxs("li", { className: "relative group/item", children: [
4154
+ /* @__PURE__ */ jsxs(
4155
+ ButtonOrLink,
4156
+ {
4157
+ ...clickTrigger,
4158
+ className: cn(
4159
+ "flex w-full items-center justify-between px-4 py-2 ",
4160
+ "hover:bg-accent hover:text-accent-foreground",
4161
+ "focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",
4162
+ className,
4163
+ level === 0 ? "font-medium" : "font-normal"
4164
+ // "group-hover/item:bg-accent/50"
4165
+ ),
4166
+ role: hasChildren ? "menuitem" : void 0,
4167
+ "aria-haspopup": hasChildren ? "true" : void 0,
4168
+ "aria-expanded": hasChildren ? "true" : void 0,
4169
+ children: [
4170
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
4171
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
4172
+ /* @__PURE__ */ jsx("span", { children: label })
4173
+ ] }),
4174
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
4175
+ shortcut && /* @__PURE__ */ 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 }),
4176
+ hasChildren && /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
4177
+ ] })
4178
+ ]
4179
+ }
3271
4180
  ),
3272
4181
  hasChildren && /* @__PURE__ */ jsx(
3273
4182
  "ul",
@@ -3288,6 +4197,39 @@ var MenuItem = ({
3288
4197
  )
3289
4198
  ] });
3290
4199
  };
4200
+ var MetricTile = React23.forwardRef(
4201
+ ({ label, value, caption, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
4202
+ "div",
4203
+ {
4204
+ ref,
4205
+ className: cn("flex flex-col gap-0.5 border border-border bg-card p-2", className),
4206
+ ...props,
4207
+ children: [
4208
+ /* @__PURE__ */ jsx("span", { className: "truncate text-meta text-muted-foreground", children: label }),
4209
+ /* @__PURE__ */ jsx("span", { className: "text-base font-medium leading-tight", children: value }),
4210
+ caption != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: caption }) : null,
4211
+ children
4212
+ ]
4213
+ }
4214
+ )
4215
+ );
4216
+ MetricTile.displayName = "MetricTile";
4217
+ var MetricGrid = React23.forwardRef(
4218
+ ({ minTileWidth = 120, className, style, children, ...props }, ref) => /* @__PURE__ */ jsx(
4219
+ "div",
4220
+ {
4221
+ ref,
4222
+ className: cn("grid gap-1.5", className),
4223
+ style: {
4224
+ gridTemplateColumns: `repeat(auto-fit, minmax(${minTileWidth}px, 1fr))`,
4225
+ ...style
4226
+ },
4227
+ ...props,
4228
+ children
4229
+ }
4230
+ )
4231
+ );
4232
+ MetricGrid.displayName = "MetricGrid";
3291
4233
  var NavVerticalItems = ({ items }) => /* @__PURE__ */ jsx(NavItems, { items, orientation: "vertical" });
3292
4234
  var NavVertical = ({
3293
4235
  className = "",
@@ -3334,35 +4276,42 @@ function PanelContent({
3334
4276
  title,
3335
4277
  titleText,
3336
4278
  children,
3337
- onClose,
3338
- showClose,
4279
+ className,
3339
4280
  headerClassName,
3340
4281
  bodyClassName,
3341
4282
  footerContent,
3342
4283
  footerClassName,
3343
- closeIcon
4284
+ headerActions,
4285
+ actionsOnHover = false
3344
4286
  }) {
3345
- return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Card, { className: `h-full border-none ${headerClassName}`, children: [
3346
- /* @__PURE__ */ jsxs(CardHeader, { className: "relative flex flex-row items-center py-0 border-b h-[30px]", children: [
3347
- title && /* @__PURE__ */ jsx("span", { className: "leading-none font-bold ", children: title }),
3348
- titleText && /* @__PURE__ */ jsx("h4", { className: "font-bold leading-none", children: titleText }),
3349
- showClose && /* @__PURE__ */ jsxs(
3350
- Button,
3351
- {
3352
- variant: "ghost",
3353
- size: "icon",
3354
- className: "absolute top-[0px] right-[5px] h-6 w-6 hover:bg-transparent hover:text-primary/80",
3355
- onClick: onClose,
3356
- children: [
3357
- closeIcon ? closeIcon : /* @__PURE__ */ jsx(X, { className: "h-3 w-3" }),
3358
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close panel" })
3359
- ]
3360
- }
3361
- )
3362
- ] }),
3363
- /* @__PURE__ */ jsx(CardContent, { className: `overflow-y-auto h-full ${bodyClassName}`, children }),
3364
- footerContent ? /* @__PURE__ */ jsx(CardFooter, { className: footerClassName, children: footerContent }) : /* @__PURE__ */ jsx(Fragment, {})
3365
- ] }) });
4287
+ return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Card, { className: cn("flex h-full min-h-0 flex-col border-none", className), children: [
4288
+ /* @__PURE__ */ jsxs(
4289
+ CardHeader,
4290
+ {
4291
+ className: cn(
4292
+ "group/panel-header flex h-[35px] shrink-0 flex-row items-center gap-2",
4293
+ "space-y-0 border-b py-0 pr-1",
4294
+ headerClassName
4295
+ ),
4296
+ children: [
4297
+ title && /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate font-bold leading-none", children: title }),
4298
+ titleText && /* @__PURE__ */ jsx("h4", { className: "min-w-0 truncate font-bold leading-none", children: titleText }),
4299
+ headerActions && headerActions.length > 0 && /* @__PURE__ */ jsx(
4300
+ "div",
4301
+ {
4302
+ className: cn(
4303
+ "ml-auto flex shrink-0 items-center gap-1 pl-2",
4304
+ actionsOnHover && "opacity-0 transition-opacity group-hover/panel-header:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100"
4305
+ ),
4306
+ children: /* @__PURE__ */ jsx(NavHorizontalItems, { items: headerActions })
4307
+ }
4308
+ )
4309
+ ]
4310
+ }
4311
+ ),
4312
+ /* @__PURE__ */ jsx(CardContent, { className: cn("min-h-0 flex-1 overflow-y-auto", bodyClassName), children }),
4313
+ footerContent ? /* @__PURE__ */ jsx(CardFooter, { className: cn("shrink-0 border-t", footerClassName), children: footerContent }) : null
4314
+ ] }) }) });
3366
4315
  }
3367
4316
  function PanelStack({
3368
4317
  sections,
@@ -3372,6 +4321,7 @@ function PanelStack({
3372
4321
  headerClassName,
3373
4322
  bodyClassName
3374
4323
  }) {
4324
+ const groupRef = React23.useRef(null);
3375
4325
  const refs = React23.useRef({});
3376
4326
  const [collapsed, setCollapsed] = React23.useState(
3377
4327
  () => Object.fromEntries(sections.map((s) => [s.id, !!s.defaultCollapsed]))
@@ -3380,94 +4330,366 @@ function PanelStack({
3380
4330
  React23.useLayoutEffect(() => {
3381
4331
  if (didInit.current) return;
3382
4332
  didInit.current = true;
3383
- for (const section of sections) {
3384
- if (section.defaultCollapsed) refs.current[section.id]?.collapse();
4333
+ const targets = sections.filter((s) => s.defaultCollapsed);
4334
+ const expanded = sections.filter((s) => !s.defaultCollapsed);
4335
+ if (targets.length === 0 || expanded.length === 0) return;
4336
+ const group = groupRef.current;
4337
+ const probe = refs.current[sections[0].id]?.getSize();
4338
+ if (!group || !probe || probe.asPercentage <= 0) {
4339
+ for (const s of targets) refs.current[s.id]?.collapse();
4340
+ return;
4341
+ }
4342
+ const groupPx = probe.inPixels / probe.asPercentage * 100;
4343
+ const collapsedPct = headerHeight / groupPx * 100;
4344
+ const layout = group.getLayout();
4345
+ const next = { ...layout };
4346
+ let freed = 0;
4347
+ for (const s of targets) {
4348
+ const current = layout[s.id] ?? 0;
4349
+ if (current <= collapsedPct) continue;
4350
+ freed += current - collapsedPct;
4351
+ next[s.id] = collapsedPct;
3385
4352
  }
4353
+ if (freed === 0) return;
4354
+ const total = expanded.reduce((sum, s) => sum + (layout[s.id] ?? 0), 0);
4355
+ for (const s of expanded) {
4356
+ const share = total > 0 ? (layout[s.id] ?? 0) / total : 1 / expanded.length;
4357
+ next[s.id] = (layout[s.id] ?? 0) + freed * share;
4358
+ }
4359
+ for (const s of targets) refs.current[s.id]?.collapse();
4360
+ group.setLayout(next);
3386
4361
  }, []);
3387
4362
  const toggle = (id) => {
3388
4363
  const ref = refs.current[id];
3389
4364
  if (!ref) return;
3390
- if (ref.isCollapsed()) ref.expand();
3391
- else ref.collapse();
4365
+ if (!ref.isCollapsed()) {
4366
+ ref.collapse();
4367
+ return;
4368
+ }
4369
+ ref.expand();
4370
+ if (!ref.isCollapsed()) return;
4371
+ const group = groupRef.current;
4372
+ if (!group) return;
4373
+ const layout = group.getLayout();
4374
+ const donor = Object.entries(layout).filter(([panelId]) => panelId !== id && !collapsed[panelId]).sort((a, b) => b[1] - a[1])[0];
4375
+ if (!donor) return;
4376
+ const [donorId, donorPct] = donor;
4377
+ const share = donorPct / 2;
4378
+ group.setLayout({
4379
+ ...layout,
4380
+ [id]: (layout[id] ?? 0) + share,
4381
+ [donorId]: donorPct - share
4382
+ });
3392
4383
  };
3393
- return /* @__PURE__ */ jsx(
3394
- ResizablePanelGroup,
4384
+ return (
4385
+ // Header actions are nav items, and those carry tooltips — provide the
4386
+ // context here so a `PanelStack` works outside an app shell too. Nesting
4387
+ // inside an app's own provider is harmless.
4388
+ /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
4389
+ ResizablePanelGroup,
4390
+ {
4391
+ groupRef,
4392
+ orientation: "vertical",
4393
+ className: cn("h-full w-full", className),
4394
+ children: sections.map((section, index) => {
4395
+ const Icon = section.icon;
4396
+ const isCollapsed = collapsed[section.id];
4397
+ const flush = index > 0 && (isCollapsed || collapsed[sections[index - 1].id]);
4398
+ return /* @__PURE__ */ jsxs(React23.Fragment, { children: [
4399
+ index > 0 && /* @__PURE__ */ jsx(
4400
+ ResizableHandle,
4401
+ {
4402
+ withHandle: withHandle && !flush,
4403
+ className: cn(
4404
+ flush && "pointer-events-none bg-border aria-[orientation=horizontal]:h-px aria-[orientation=vertical]:w-px"
4405
+ )
4406
+ }
4407
+ ),
4408
+ /* @__PURE__ */ jsxs(
4409
+ ResizablePanel,
4410
+ {
4411
+ id: section.id,
4412
+ collapsible: true,
4413
+ collapsedSize: `${headerHeight}px`,
4414
+ minSize: section.minSize ?? `${headerHeight + 64}px`,
4415
+ defaultSize: section.defaultSize,
4416
+ panelRef: (ref) => {
4417
+ refs.current[section.id] = ref;
4418
+ },
4419
+ onResize: (size) => {
4420
+ const next = size.inPixels <= headerHeight + 1;
4421
+ setCollapsed(
4422
+ (prev) => prev[section.id] === next ? prev : { ...prev, [section.id]: next }
4423
+ );
4424
+ },
4425
+ className: "flex flex-col overflow-hidden",
4426
+ children: [
4427
+ /* @__PURE__ */ jsxs(
4428
+ "div",
4429
+ {
4430
+ style: { height: headerHeight },
4431
+ className: cn(
4432
+ "group/panel-header flex shrink-0 items-center pr-2 text-muted-foreground",
4433
+ headerClassName
4434
+ ),
4435
+ children: [
4436
+ /* @__PURE__ */ jsxs(
4437
+ "button",
4438
+ {
4439
+ type: "button",
4440
+ onClick: () => toggle(section.id),
4441
+ "aria-expanded": !isCollapsed,
4442
+ className: cn(
4443
+ "flex h-full min-w-0 flex-1 items-center gap-1 pl-2 text-left",
4444
+ "transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
4445
+ ),
4446
+ children: [
4447
+ isCollapsed ? /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5 shrink-0" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-5 w-5 shrink-0" }),
4448
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
4449
+ typeof section.title === "string" ? /* @__PURE__ */ jsx("span", { className: "truncate text-meta font-semibold uppercase tracking-wide", children: section.title }) : (
4450
+ // Custom node: rendered as-is so the consumer owns the
4451
+ // styling (icon, casing, colour, badges…).
4452
+ /* @__PURE__ */ jsx("span", { className: "flex min-w-0 flex-1 items-center", children: section.title })
4453
+ )
4454
+ ]
4455
+ }
4456
+ ),
4457
+ section.headerActions && section.headerActions.length > 0 && /* @__PURE__ */ jsx(
4458
+ "div",
4459
+ {
4460
+ className: cn(
4461
+ "flex items-center gap-1 pl-2",
4462
+ // Quiet at rest: the actions appear on hover over the
4463
+ // header, and never hide while one of them holds focus
4464
+ // or has its menu open — so the keyboard path stays
4465
+ // visible.
4466
+ (section.actionsOnHover ?? true) && "opacity-0 transition-opacity group-hover/panel-header:opacity-100 focus-within:opacity-100 has-[[data-state=open]]:opacity-100"
4467
+ ),
4468
+ children: /* @__PURE__ */ jsx(NavHorizontalItems, { items: section.headerActions })
4469
+ }
4470
+ )
4471
+ ]
4472
+ }
4473
+ ),
4474
+ /* @__PURE__ */ jsx(
4475
+ "div",
4476
+ {
4477
+ className: cn("min-h-0 flex-1 overflow-auto", bodyClassName),
4478
+ hidden: isCollapsed,
4479
+ children: section.content
4480
+ }
4481
+ )
4482
+ ]
4483
+ }
4484
+ )
4485
+ ] }, section.id);
4486
+ })
4487
+ }
4488
+ ) })
4489
+ );
4490
+ }
4491
+ var PropertyList = React23.forwardRef(
4492
+ ({ labelWidth = 78, className, style, children, ...props }, ref) => /* @__PURE__ */ jsx(
4493
+ "dl",
3395
4494
  {
3396
- orientation: "vertical",
3397
- className: cn("h-full w-full", className),
3398
- children: sections.map((section, index) => {
3399
- const Icon = section.icon;
3400
- const isCollapsed = collapsed[section.id];
3401
- return /* @__PURE__ */ jsxs(React23.Fragment, { children: [
3402
- index > 0 && /* @__PURE__ */ jsx(ResizableHandle, { withHandle }),
3403
- /* @__PURE__ */ jsxs(
3404
- ResizablePanel,
4495
+ ref,
4496
+ className: cn("flex flex-col", className),
4497
+ style: {
4498
+ "--property-label-width": typeof labelWidth === "number" ? `${labelWidth}px` : labelWidth,
4499
+ ...style
4500
+ },
4501
+ ...props,
4502
+ children
4503
+ }
4504
+ )
4505
+ );
4506
+ PropertyList.displayName = "PropertyList";
4507
+ var PropertyRow = React23.forwardRef(
4508
+ ({ label, mono, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
4509
+ "div",
4510
+ {
4511
+ ref,
4512
+ className: cn("flex items-baseline gap-2 py-1", className),
4513
+ ...props,
4514
+ children: [
4515
+ /* @__PURE__ */ jsx("dt", { className: "shrink-0 truncate text-meta text-muted-foreground [width:var(--property-label-width,78px)]", children: label }),
4516
+ /* @__PURE__ */ jsx("dd", { className: cn("min-w-0 flex-1", mono && "font-mono text-meta"), children })
4517
+ ]
4518
+ }
4519
+ )
4520
+ );
4521
+ PropertyRow.displayName = "PropertyRow";
4522
+ var ProposalCard = React23.forwardRef(
4523
+ ({
4524
+ title,
4525
+ source,
4526
+ evidence,
4527
+ evidenceTitle,
4528
+ evidenceMeta,
4529
+ consequence,
4530
+ actions,
4531
+ className,
4532
+ children,
4533
+ ...props
4534
+ }, ref) => /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-3", className), ...props, children: [
4535
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-1", children: [
4536
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
4537
+ /* @__PURE__ */ jsx("h4", { className: "font-medium", children: title }),
4538
+ source != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: source }) : null
4539
+ ] }),
4540
+ /* @__PURE__ */ jsx("div", { className: "border border-border bg-muted/30 p-2", children })
4541
+ ] }),
4542
+ evidence ? /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-1", children: [
4543
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
4544
+ /* @__PURE__ */ jsx("h4", { className: "font-medium", children: evidenceTitle }),
4545
+ evidenceMeta != null ? /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: evidenceMeta }) : null
4546
+ ] }),
4547
+ /* @__PURE__ */ jsx("div", { className: "overflow-hidden border border-border", children: evidence })
4548
+ ] }) : null,
4549
+ consequence != null ? /* @__PURE__ */ jsx("p", { className: "text-meta text-muted-foreground", children: consequence }) : null,
4550
+ actions ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: actions }) : null
4551
+ ] })
4552
+ );
4553
+ ProposalCard.displayName = "ProposalCard";
4554
+ var DotRating = React23.forwardRef(
4555
+ ({ value, max = 3, onChange, readOnly, label, className, ...props }, ref) => /* @__PURE__ */ jsx(
4556
+ "div",
4557
+ {
4558
+ ref,
4559
+ role: readOnly ? "img" : "radiogroup",
4560
+ "aria-label": label ?? `weight ${value} of ${max}`,
4561
+ className: cn("inline-flex items-center gap-1", className),
4562
+ ...props,
4563
+ children: Array.from({ length: max }, (_, i) => {
4564
+ const n = i + 1;
4565
+ const on = n <= value;
4566
+ if (readOnly) {
4567
+ return /* @__PURE__ */ jsx(
4568
+ "span",
3405
4569
  {
3406
- collapsible: true,
3407
- collapsedSize: `${headerHeight}px`,
3408
- minSize: section.minSize ?? `${headerHeight + 64}px`,
3409
- defaultSize: section.defaultSize,
3410
- panelRef: (ref) => {
3411
- refs.current[section.id] = ref;
3412
- },
3413
- onResize: (size) => {
3414
- const next = size.inPixels <= headerHeight + 1;
3415
- setCollapsed(
3416
- (prev) => prev[section.id] === next ? prev : { ...prev, [section.id]: next }
3417
- );
3418
- },
3419
- className: "flex flex-col overflow-hidden",
3420
- children: [
3421
- /* @__PURE__ */ jsxs(
3422
- "div",
3423
- {
3424
- style: { height: headerHeight },
3425
- className: cn(
3426
- "flex shrink-0 items-center pr-2 text-muted-foreground",
3427
- headerClassName
3428
- ),
3429
- children: [
3430
- /* @__PURE__ */ jsxs(
3431
- "button",
3432
- {
3433
- type: "button",
3434
- onClick: () => toggle(section.id),
3435
- "aria-expanded": !isCollapsed,
3436
- className: cn(
3437
- "flex h-full min-w-0 flex-1 items-center gap-1 pl-2 text-left",
3438
- "transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
3439
- ),
3440
- children: [
3441
- isCollapsed ? /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0" }),
3442
- Icon && /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
3443
- typeof section.title === "string" ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-semibold uppercase tracking-wide", children: section.title }) : (
3444
- // Custom node: rendered as-is so the consumer owns the
3445
- // styling (icon, casing, colour, badges…).
3446
- /* @__PURE__ */ jsx("span", { className: "flex min-w-0 flex-1 items-center", children: section.title })
3447
- )
3448
- ]
3449
- }
3450
- ),
3451
- section.actions && !isCollapsed && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 pl-2", children: section.actions })
3452
- ]
3453
- }
3454
- ),
3455
- /* @__PURE__ */ jsx(
3456
- "div",
3457
- {
3458
- className: cn("min-h-0 flex-1 overflow-auto", bodyClassName),
3459
- hidden: isCollapsed,
3460
- children: section.content
3461
- }
3462
- )
3463
- ]
3464
- }
3465
- )
3466
- ] }, section.id);
4570
+ "aria-hidden": true,
4571
+ className: cn(
4572
+ "size-2.5 rounded-full border",
4573
+ on ? "border-primary bg-primary" : "border-muted-foreground bg-transparent"
4574
+ )
4575
+ },
4576
+ n
4577
+ );
4578
+ }
4579
+ return /* @__PURE__ */ jsx(
4580
+ "button",
4581
+ {
4582
+ type: "button",
4583
+ role: "radio",
4584
+ "aria-checked": value === n,
4585
+ "aria-label": String(n),
4586
+ onClick: () => onChange?.(n),
4587
+ className: cn(
4588
+ "size-2.5 cursor-pointer rounded-full border",
4589
+ on ? "border-primary bg-primary" : "border-muted-foreground bg-transparent"
4590
+ )
4591
+ },
4592
+ n
4593
+ );
3467
4594
  })
3468
4595
  }
3469
- );
3470
- }
4596
+ )
4597
+ );
4598
+ DotRating.displayName = "DotRating";
4599
+ var RatingControl = React23.forwardRef(
4600
+ ({
4601
+ verdict,
4602
+ onVerdictChange,
4603
+ weight,
4604
+ onWeightChange,
4605
+ maxWeight = 3,
4606
+ refines,
4607
+ by,
4608
+ className,
4609
+ children,
4610
+ ...props
4611
+ }, ref) => /* @__PURE__ */ jsxs(
4612
+ "div",
4613
+ {
4614
+ ref,
4615
+ className: cn("flex flex-col gap-2 border border-border bg-card p-2", className),
4616
+ ...props,
4617
+ children: [
4618
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-meta", children: [
4619
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Your verdict" }),
4620
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "becomes a Learning" }),
4621
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
4622
+ by
4623
+ ] }),
4624
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
4625
+ /* @__PURE__ */ jsx("div", { role: "radiogroup", className: "inline-flex border border-border", children: ["appreciate", "depreciate"].map((v) => /* @__PURE__ */ jsx(
4626
+ "button",
4627
+ {
4628
+ type: "button",
4629
+ role: "radio",
4630
+ "aria-checked": verdict === v,
4631
+ onClick: () => onVerdictChange?.(v),
4632
+ className: cn(
4633
+ "h-[22px] px-2 text-meta capitalize",
4634
+ verdict === v ? v === "appreciate" ? "bg-success text-success-foreground" : "bg-warning text-warning-foreground" : "text-muted-foreground hover:bg-accent"
4635
+ ),
4636
+ children: v
4637
+ },
4638
+ v
4639
+ )) }),
4640
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
4641
+ /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: "weight" }),
4642
+ /* @__PURE__ */ jsx(DotRating, { value: weight, max: maxWeight, onChange: onWeightChange }),
4643
+ /* @__PURE__ */ jsx("span", { className: "text-meta tabular-nums", children: weight })
4644
+ ] }),
4645
+ refines != null ? /* @__PURE__ */ jsxs("span", { className: "text-meta text-muted-foreground", children: [
4646
+ "refines ",
4647
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: refines })
4648
+ ] }) : null
4649
+ ] }),
4650
+ children
4651
+ ]
4652
+ }
4653
+ )
4654
+ );
4655
+ RatingControl.displayName = "RatingControl";
4656
+ var RepairNote = React23.forwardRef(
4657
+ ({ from, to, className, ...props }, ref) => /* @__PURE__ */ jsxs(
4658
+ "div",
4659
+ {
4660
+ ref,
4661
+ className: cn(
4662
+ "flex flex-wrap items-center gap-1 py-0.5 pl-4 text-meta text-muted-foreground",
4663
+ className
4664
+ ),
4665
+ ...props,
4666
+ children: [
4667
+ /* @__PURE__ */ jsx("span", { className: "font-mono line-through decoration-muted-foreground/60", children: from }),
4668
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" }),
4669
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-foreground", children: to })
4670
+ ]
4671
+ }
4672
+ )
4673
+ );
4674
+ RepairNote.displayName = "RepairNote";
4675
+ var RetryNote = React23.forwardRef(
4676
+ ({ attempt, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
4677
+ "div",
4678
+ {
4679
+ ref,
4680
+ className: cn(
4681
+ "flex flex-wrap items-baseline gap-1.5 py-0.5 pl-4 text-meta text-muted-foreground",
4682
+ className
4683
+ ),
4684
+ ...props,
4685
+ children: [
4686
+ attempt != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium text-warning", children: attempt }) : null,
4687
+ /* @__PURE__ */ jsx("span", { children })
4688
+ ]
4689
+ }
4690
+ )
4691
+ );
4692
+ RetryNote.displayName = "RetryNote";
3471
4693
  function OptionRow({ option }) {
3472
4694
  const Icon = option.icon;
3473
4695
  return /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
@@ -3476,7 +4698,7 @@ function OptionRow({ option }) {
3476
4698
  /* @__PURE__ */ jsx("span", { className: "truncate", children: option.label }),
3477
4699
  option.badge != null && /* @__PURE__ */ jsx("span", { className: "ml-auto pl-2", children: option.badge })
3478
4700
  ] }),
3479
- option.description != null && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: option.description })
4701
+ option.description != null && /* @__PURE__ */ jsx("span", { className: "text-meta text-muted-foreground", children: option.description })
3480
4702
  ] });
3481
4703
  }
3482
4704
  function RichSelect({
@@ -3590,6 +4812,123 @@ function RichSelect({
3590
4812
  )
3591
4813
  ] });
3592
4814
  }
4815
+ var SearchInput = ({
4816
+ value,
4817
+ onChange,
4818
+ className,
4819
+ inputSize = "default",
4820
+ placeholder = "Search...",
4821
+ ...props
4822
+ }) => {
4823
+ return /* @__PURE__ */ jsx(
4824
+ "input",
4825
+ {
4826
+ type: "text",
4827
+ value,
4828
+ onChange: (e) => onChange(e.target.value),
4829
+ placeholder,
4830
+ className: cn(
4831
+ "flex w-full rounded-control border border-input bg-background ring-offset-background",
4832
+ "placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2",
4833
+ "focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
4834
+ inputSize === "sm" ? "h-[26px] px-2 py-0 text-meta" : "h-10 px-3 py-2 text-base",
4835
+ className
4836
+ ),
4837
+ ...props
4838
+ }
4839
+ );
4840
+ };
4841
+ var SectionHeader = React23.forwardRef(({ icon, title, count, actions, bare, className, ...props }, ref) => /* @__PURE__ */ jsxs(
4842
+ "div",
4843
+ {
4844
+ ref,
4845
+ className: cn(
4846
+ "flex h-[35px] shrink-0 items-center gap-2 px-2",
4847
+ !bare && "border-b border-border",
4848
+ className
4849
+ ),
4850
+ ...props,
4851
+ children: [
4852
+ icon ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center text-muted-foreground [&_svg]:size-3.5", children: icon }) : null,
4853
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate font-medium", children: title }),
4854
+ count != null ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: count }) : null,
4855
+ actions ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center gap-1", children: actions }) : null
4856
+ ]
4857
+ }
4858
+ ));
4859
+ SectionHeader.displayName = "SectionHeader";
4860
+ var Sparkline = React23.forwardRef(
4861
+ ({
4862
+ values,
4863
+ width = 72,
4864
+ height = 20,
4865
+ color = "var(--color-data-1)",
4866
+ area,
4867
+ endMarker = true,
4868
+ label,
4869
+ className,
4870
+ ...props
4871
+ }, ref) => {
4872
+ const pad = 3;
4873
+ const min = Math.min(...values);
4874
+ const max = Math.max(...values);
4875
+ const span = max - min || 1;
4876
+ const stepX = values.length > 1 ? (width - pad * 2) / (values.length - 1) : 0;
4877
+ const points = values.map((v, i) => [
4878
+ pad + i * stepX,
4879
+ height - pad - (v - min) / span * (height - pad * 2)
4880
+ ]);
4881
+ const d = points.map((p, i) => `${i ? "L" : "M"}${p[0]} ${p[1]}`).join(" ");
4882
+ const last = points[points.length - 1];
4883
+ return /* @__PURE__ */ jsxs(
4884
+ "svg",
4885
+ {
4886
+ ref,
4887
+ width,
4888
+ height,
4889
+ viewBox: `0 0 ${width} ${height}`,
4890
+ className: cn("shrink-0 overflow-visible", className),
4891
+ role: label ? "img" : void 0,
4892
+ "aria-label": label,
4893
+ "aria-hidden": label ? void 0 : true,
4894
+ ...props,
4895
+ children: [
4896
+ area ? /* @__PURE__ */ jsx(
4897
+ "path",
4898
+ {
4899
+ d: `${d} L${last[0]} ${height} L${points[0][0]} ${height} Z`,
4900
+ fill: color,
4901
+ opacity: 0.1
4902
+ }
4903
+ ) : null,
4904
+ /* @__PURE__ */ jsx(
4905
+ "path",
4906
+ {
4907
+ d,
4908
+ fill: "none",
4909
+ stroke: color,
4910
+ strokeWidth: 2,
4911
+ strokeLinecap: "round",
4912
+ strokeLinejoin: "round"
4913
+ }
4914
+ ),
4915
+ endMarker ? /* @__PURE__ */ jsx(
4916
+ "circle",
4917
+ {
4918
+ cx: last[0],
4919
+ cy: last[1],
4920
+ r: 4,
4921
+ fill: color,
4922
+ stroke: "var(--color-card)",
4923
+ strokeWidth: 2
4924
+ }
4925
+ ) : null
4926
+ ]
4927
+ }
4928
+ );
4929
+ }
4930
+ );
4931
+ Sparkline.displayName = "Sparkline";
3593
4932
  function TabbedPanel({
3594
4933
  tabs,
3595
4934
  defaultTab,
@@ -3600,10 +4939,7 @@ function TabbedPanel({
3600
4939
  headerClassName,
3601
4940
  bodyClassName,
3602
4941
  footerClassName,
3603
- footerContent,
3604
- showClose: _showClose,
3605
- onClose: _onClose,
3606
- closeIcon: _closeIcon
4942
+ footerContent
3607
4943
  }) {
3608
4944
  const [internalTab, setInternalTab] = React23__default.useState(defaultTab || tabs[0]?.value);
3609
4945
  const currentTab = activeTab !== void 0 ? activeTab : internalTab;
@@ -3628,13 +4964,7 @@ function TabbedPanel({
3628
4964
  },
3629
4965
  tab.value
3630
4966
  )) }),
3631
- headerActions && /* @__PURE__ */ jsx("div", { className: "flex items-center h-full", children: /* @__PURE__ */ jsx(
3632
- NavHorizontal,
3633
- {
3634
- className: "h-full",
3635
- ...headerActions
3636
- }
3637
- ) })
4967
+ headerActions && headerActions.length > 0 && /* @__PURE__ */ jsx("div", { className: "ml-auto flex h-full shrink-0 items-center gap-1 pr-1", children: /* @__PURE__ */ jsx(NavHorizontalItems, { items: headerActions }) })
3638
4968
  ] }),
3639
4969
  tabs.map((tab) => /* @__PURE__ */ jsx(
3640
4970
  TabsContent,
@@ -3648,24 +4978,139 @@ function TabbedPanel({
3648
4978
  footerContent && /* @__PURE__ */ jsx(CardFooter, { className: footerClassName, children: footerContent })
3649
4979
  ] }) }) }) });
3650
4980
  }
3651
- var SearchInput = ({ value, onChange, ...props }) => {
3652
- return /* @__PURE__ */ jsx(
3653
- "input",
4981
+ var TemplatePicker = React23.forwardRef(({ heading, options, value, onSelect, footnote, className, ...props }, ref) => /* @__PURE__ */ jsxs(
4982
+ "div",
4983
+ {
4984
+ ref,
4985
+ className: cn("flex w-full flex-col border border-border bg-card", className),
4986
+ ...props,
4987
+ children: [
4988
+ heading != null ? /* @__PURE__ */ jsx("div", { className: "flex h-6 shrink-0 items-center border-b border-border px-2 text-meta text-muted-foreground", children: heading }) : null,
4989
+ /* @__PURE__ */ jsx("div", { role: "listbox", className: "flex flex-col", children: options.map((o) => {
4990
+ const disabled = o.unavailable != null;
4991
+ const selected = value === o.id;
4992
+ return /* @__PURE__ */ jsxs(
4993
+ "button",
4994
+ {
4995
+ type: "button",
4996
+ role: "option",
4997
+ "aria-selected": selected,
4998
+ disabled,
4999
+ onClick: () => onSelect?.(o.id),
5000
+ className: cn(
5001
+ "flex h-7 items-center gap-2 px-2 text-left",
5002
+ selected && "bg-accent",
5003
+ disabled ? "cursor-not-allowed opacity-50" : "hover:bg-accent/60"
5004
+ ),
5005
+ children: [
5006
+ /* @__PURE__ */ jsx("span", { className: "w-3 shrink-0 text-primary", children: selected ? "\u2022" : "" }),
5007
+ /* @__PURE__ */ jsx("span", { className: "truncate font-mono text-meta", children: o.id }),
5008
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-meta text-muted-foreground", children: o.kind }),
5009
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
5010
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 truncate text-meta text-muted-foreground", children: o.unavailable ?? o.note })
5011
+ ]
5012
+ },
5013
+ o.id
5014
+ );
5015
+ }) }),
5016
+ footnote != null ? /* @__PURE__ */ jsx("div", { className: "border-t border-border px-2 py-1 text-meta text-muted-foreground", children: footnote }) : null
5017
+ ]
5018
+ }
5019
+ ));
5020
+ TemplatePicker.displayName = "TemplatePicker";
5021
+ var MARKER = {
5022
+ prompt: "$",
5023
+ output: "\u2192",
5024
+ comment: "#"
5025
+ };
5026
+ var Terminal = React23.forwardRef(
5027
+ ({ cursor, columnTemplate = "150px minmax(0,1fr) auto auto", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
5028
+ "div",
3654
5029
  {
3655
- type: "text",
3656
- value,
3657
- onChange: (e) => onChange(e.target.value),
3658
- placeholder: "Search...",
5030
+ ref,
5031
+ style: { "--terminal-cols": columnTemplate },
3659
5032
  className: cn(
3660
- "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",
3661
- "w-full px-2 py-1 border rounded-control dark:bg-neutral-800",
3662
- props?.className
3663
- )
5033
+ "overflow-x-auto border border-border bg-muted/40 p-2 font-mono text-meta",
5034
+ className
5035
+ ),
5036
+ ...props,
5037
+ children: [
5038
+ children,
5039
+ cursor ? /* @__PURE__ */ jsx(
5040
+ "span",
5041
+ {
5042
+ "aria-hidden": true,
5043
+ className: "mt-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-foreground align-middle motion-reduce:animate-none"
5044
+ }
5045
+ ) : null
5046
+ ]
3664
5047
  }
3665
- );
3666
- };
5048
+ )
5049
+ );
5050
+ Terminal.displayName = "Terminal";
5051
+ var TerminalLine = React23.forwardRef(
5052
+ ({ kind = "output", columns, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
5053
+ "div",
5054
+ {
5055
+ ref,
5056
+ className: cn(
5057
+ "items-baseline gap-2 whitespace-pre",
5058
+ columns ? "grid [grid-template-columns:auto_var(--terminal-cols)]" : "flex",
5059
+ kind === "comment" && "text-muted-foreground",
5060
+ className
5061
+ ),
5062
+ ...props,
5063
+ children: [
5064
+ /* @__PURE__ */ jsx(
5065
+ "span",
5066
+ {
5067
+ "aria-hidden": true,
5068
+ className: cn(
5069
+ "w-3 shrink-0",
5070
+ kind === "prompt" ? "text-primary" : "text-muted-foreground"
5071
+ ),
5072
+ children: MARKER[kind]
5073
+ }
5074
+ ),
5075
+ columns ? columns.map((c, i) => /* @__PURE__ */ jsx(
5076
+ "span",
5077
+ {
5078
+ className: cn(
5079
+ "min-w-0 truncate",
5080
+ i === columns.length - 1 && "text-muted-foreground"
5081
+ ),
5082
+ children: c
5083
+ },
5084
+ i
5085
+ )) : /* @__PURE__ */ jsx("span", { className: "min-w-0", children })
5086
+ ]
5087
+ }
5088
+ )
5089
+ );
5090
+ TerminalLine.displayName = "TerminalLine";
5091
+ var TimelineList = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("ol", { ref, className: cn("flex flex-col", className), ...props, children }));
5092
+ TimelineList.displayName = "TimelineList";
5093
+ var TimelineEntry = React23.forwardRef(({ when, title, marker, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
5094
+ "li",
5095
+ {
5096
+ ref,
5097
+ className: cn("flex gap-2 border-b border-border py-1.5 last:border-b-0", className),
5098
+ ...props,
5099
+ children: [
5100
+ /* @__PURE__ */ jsxs("span", { className: "flex w-[72px] shrink-0 items-baseline gap-1.5 text-meta text-muted-foreground", children: [
5101
+ marker ? /* @__PURE__ */ jsx("span", { className: "translate-y-1", children: marker }) : null,
5102
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: when })
5103
+ ] }),
5104
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
5105
+ title != null ? /* @__PURE__ */ jsx("span", { className: "font-medium", children: title }) : null,
5106
+ children
5107
+ ] })
5108
+ ]
5109
+ }
5110
+ ));
5111
+ TimelineEntry.displayName = "TimelineEntry";
3667
5112
  var Toolbar = () => {
3668
- return /* @__PURE__ */ jsxs("div", { className: "flex h-5 items-center space-x-2 text-sm", children: [
5113
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-5 items-center space-x-2", children: [
3669
5114
  /* @__PURE__ */ jsx(
3670
5115
  ButtonWithTooltip,
3671
5116
  {
@@ -3793,7 +5238,7 @@ function Tour({
3793
5238
  /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 p-3", children: [
3794
5239
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3795
5240
  /* @__PURE__ */ jsx(Badge, { variant: "soft", className: "tracking-wider", children: badgeLabel }),
3796
- showCounter && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
5241
+ showCounter && /* @__PURE__ */ jsxs("span", { className: "text-meta text-muted-foreground", children: [
3797
5242
  current + 1,
3798
5243
  " / ",
3799
5244
  total
@@ -3804,7 +5249,7 @@ function Tour({
3804
5249
  {
3805
5250
  variant: "ghost",
3806
5251
  size: "sm",
3807
- className: "-mr-1 h-7 gap-1 px-2 text-xs text-muted-foreground [&_svg]:size-3.5",
5252
+ className: "-mr-1 h-7 gap-1 px-2 text-meta text-muted-foreground [&_svg]:size-3.5",
3808
5253
  onClick: ctrl.exit,
3809
5254
  children: [
3810
5255
  /* @__PURE__ */ jsx(X, {}),
@@ -3823,10 +5268,10 @@ function Tour({
3823
5268
  /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-3 pt-2", children: [
3824
5269
  /* @__PURE__ */ jsx("h3", { className: "text-base font-semibold leading-snug", children: step.title }),
3825
5270
  step.content ?? /* @__PURE__ */ jsxs(Fragment, { children: [
3826
- step.body && /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed text-muted-foreground", children: step.body }),
5271
+ step.body && /* @__PURE__ */ jsx("div", { className: "leading-relaxed text-muted-foreground", children: step.body }),
3827
5272
  step.callout && /* @__PURE__ */ jsxs("div", { className: "rounded-r-md border-l-2 border-primary bg-muted/40 p-3", children: [
3828
5273
  step.callout.label && /* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wider text-primary", children: step.callout.label }),
3829
- /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed", children: step.callout.content })
5274
+ /* @__PURE__ */ jsx("div", { className: "leading-relaxed", children: step.callout.content })
3830
5275
  ] }),
3831
5276
  step.references && step.references.items.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
3832
5277
  step.references.label && /* @__PURE__ */ jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: step.references.label }),
@@ -3987,7 +5432,7 @@ function UnderDevelopment({
3987
5432
  /* @__PURE__ */ jsx(Construction, { size: iconSize, className: "text-primary" }),
3988
5433
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold", children: title }),
3989
5434
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-md", children: description }),
3990
- /* @__PURE__ */ jsx("span", { className: "mt-4 px-3 py-1 bg-yellow-100 text-yellow-800 text-sm", children: "Coming Soon" })
5435
+ /* @__PURE__ */ jsx("span", { className: "mt-4 px-3 py-1 bg-yellow-100 text-yellow-800", children: "Coming Soon" })
3991
5436
  ] });
3992
5437
  }
3993
5438
  var TypographyH1 = React23.forwardRef(
@@ -4125,7 +5570,7 @@ var TypographyInlineCode = React23.forwardRef(
4125
5570
  {
4126
5571
  ref,
4127
5572
  className: cn(
4128
- "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
5573
+ "relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-meta font-semibold",
4129
5574
  className
4130
5575
  ),
4131
5576
  ...props
@@ -4173,7 +5618,7 @@ var TypographySmall = React23.forwardRef(
4173
5618
  {
4174
5619
  ref,
4175
5620
  className: cn(
4176
- "text-sm font-medium leading-none",
5621
+ "text-meta font-medium leading-none",
4177
5622
  className
4178
5623
  ),
4179
5624
  ...props
@@ -4189,7 +5634,7 @@ var TypographyMuted = React23.forwardRef(
4189
5634
  {
4190
5635
  ref,
4191
5636
  className: cn(
4192
- "text-sm text-muted-foreground",
5637
+ "text-muted-foreground",
4193
5638
  className
4194
5639
  ),
4195
5640
  ...props
@@ -4250,6 +5695,6 @@ var Typography = {
4250
5695
  Pre: TypographyPre
4251
5696
  };
4252
5697
 
4253
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, ButtonWithTooltip, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardWithHeader, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChatSession, ChatSessionActivityRow, ChatSessionActivitySubLine, ChatSessionComposer, ChatSessionDisclosure, ChatSessionMessage, ChatSessionMessageOptions, ChatSessionProgressLine, ChatSessionPromptRow, ChatSessionStatusBar, ChatSessionTaskGroup, ChatSessionTaskRow, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorBoundary, HoverCard, HoverCardContent, HoverCardTrigger, Item3 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, MenuItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavBase, NavHorizontal, NavHorizontalItems, NavItems, NavVertical, NavVerticalItems, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NestedMenu, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PanelContent, PanelStack, Popover, PopoverContent, PopoverTrigger, Progress, ResizableHandle, ResizablePanel, ResizablePanelGroup, RichSelect, ScrollArea, ScrollBar, SearchInput, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, TabbedPanel, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tour, TreeItem, TreeView, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyH5, TypographyH6, TypographyInlineCode, TypographyLarge, TypographyLead, TypographyList, TypographyMuted, TypographyP, TypographyPre, TypographySmall, UnderDevelopment, badgeVariants, buttonGroupVariants, buttonVariants, chatSessionGutterClass, cn, navigationMenuTriggerStyle, toggleVariants, useSidebar, useTour };
5698
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgentChip, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppStatusBar, Avatar, AvatarFallback, AvatarImage, Badge, BarChartH, BarChartV, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, ButtonWithTooltip, CannotAnswerCard, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardWithHeader, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChatSession, ChatSessionActivityRow, ChatSessionActivitySubLine, ChatSessionComposer, ChatSessionContextChip, ChatSessionDisclosure, ChatSessionMessage, ChatSessionMessageOptions, ChatSessionProgressLine, ChatSessionPromptRow, ChatSessionStatusBar, ChatSessionTaskGroup, ChatSessionTaskRow, CitationList, CitationMarker, CitationRow, ClarifyCard, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextBar, DiagnosisCard, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffList, DiffRow, DivergingBar, DotRating, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmissionCard, EmissionHeader, EmptyState, EmptyStateLock, ErrorBoundary, FilterBar, FilterChip, HeatStrip, HoverCard, HoverCardContent, HoverCardTrigger, Item3 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Legend, LegendItem, MenuItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MetricGrid, MetricTile, NavBase, NavHorizontal, NavHorizontalItems, NavItems, NavVertical, NavVerticalItems, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NestedMenu, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PanelContent, PanelStack, Popover, PopoverContent, PopoverTrigger, Progress, PropertyList, PropertyRow, ProposalCard, RatingControl, RepairNote, ResizableHandle, ResizablePanel, ResizablePanelGroup, RetryNote, RichSelect, ScrollArea, ScrollBar, SearchInput, SectionHeader, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Sparkline, Spinner, StatusDot, TabbedPanel, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TemplatePicker, Terminal, TerminalLine, TimelineEntry, TimelineList, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tour, TreeItem, TreeView, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyH5, TypographyH6, TypographyInlineCode, TypographyLarge, TypographyLead, TypographyList, TypographyMuted, TypographyP, TypographyPre, TypographySmall, UnderDevelopment, agentChipVariants, badgeVariants, buttonGroupVariants, buttonVariants, chatSessionGutterClass, cn, navigationMenuTriggerStyle, statusDotVariants, toggleVariants, useSidebar, useTour };
4254
5699
  //# sourceMappingURL=index.js.map
4255
5700
  //# sourceMappingURL=index.js.map