@cjlapao/ui-kit 0.2.8 → 0.2.9

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
@@ -7723,6 +7723,9 @@ function getLocalizedParseNames(locale, catalog) {
7723
7723
  // ../common/i18n/builtIn/de.ts
7724
7724
  var DE_KIT_CATALOG = {
7725
7725
  kit: {
7726
+ connectionFlowConnection: {
7727
+ label: "Verbindung von {source} zu {target}"
7728
+ },
7726
7729
  connectionFlowEdit: {
7727
7730
  connected: "Verbindung angefordert",
7728
7731
  add: "Knoten {side} von {label} hinzuf\xFCgen",
@@ -7850,7 +7853,9 @@ var DE_KIT_CATALOG = {
7850
7853
  acceptsFrom: "Nimmt Karten an aus",
7851
7854
  acceptsAny: "Nichts ausgew\xE4hlt: jede Spalte.",
7852
7855
  save: "Speichern",
7853
- cancel: "Abbrechen"
7856
+ cancel: "Abbrechen",
7857
+ maxItems: "Max. Karten",
7858
+ maxItemsHint: "Leer nutzt den Board-Standard."
7854
7859
  },
7855
7860
  help: {
7856
7861
  show: "Hilfe anzeigen",
@@ -8133,6 +8138,9 @@ var DE_KIT_CATALOG = {
8133
8138
  // ../common/i18n/builtIn/en.ts
8134
8139
  var EN_KIT_CATALOG = {
8135
8140
  kit: {
8141
+ connectionFlowConnection: {
8142
+ label: "Connection from {source} to {target}"
8143
+ },
8136
8144
  connectionFlowEdit: {
8137
8145
  connected: "Connection requested",
8138
8146
  add: "Add a node {side} {label}",
@@ -8260,7 +8268,9 @@ var EN_KIT_CATALOG = {
8260
8268
  acceptsFrom: "Accepts cards from",
8261
8269
  acceptsAny: "None ticked: any column.",
8262
8270
  save: "Save",
8263
- cancel: "Cancel"
8271
+ cancel: "Cancel",
8272
+ maxItems: "Max items",
8273
+ maxItemsHint: "Empty uses the board default."
8264
8274
  },
8265
8275
  help: {
8266
8276
  show: "Show help",
@@ -8543,6 +8553,9 @@ var EN_KIT_CATALOG = {
8543
8553
  // ../common/i18n/builtIn/es.ts
8544
8554
  var ES_KIT_CATALOG = {
8545
8555
  kit: {
8556
+ connectionFlowConnection: {
8557
+ label: "Conexi\xF3n de {source} a {target}"
8558
+ },
8546
8559
  connectionFlowEdit: {
8547
8560
  connected: "Conexi\xF3n solicitada",
8548
8561
  add: "A\xF1adir un nodo {side} de {label}",
@@ -8670,7 +8683,9 @@ var ES_KIT_CATALOG = {
8670
8683
  acceptsFrom: "Acepta tarjetas de",
8671
8684
  acceptsAny: "Ninguna marcada: cualquier columna.",
8672
8685
  save: "Guardar",
8673
- cancel: "Cancelar"
8686
+ cancel: "Cancelar",
8687
+ maxItems: "M\xE1x. tarjetas",
8688
+ maxItemsHint: "Vac\xEDo usa el valor del tablero."
8674
8689
  },
8675
8690
  help: {
8676
8691
  show: "Mostrar ayuda",
@@ -8953,6 +8968,9 @@ var ES_KIT_CATALOG = {
8953
8968
  // ../common/i18n/builtIn/fr.ts
8954
8969
  var FR_KIT_CATALOG = {
8955
8970
  kit: {
8971
+ connectionFlowConnection: {
8972
+ label: "Connexion de {source} vers {target}"
8973
+ },
8956
8974
  connectionFlowEdit: {
8957
8975
  connected: "Connexion demand\xE9e",
8958
8976
  add: "Ajouter un n\u0153ud {side} de {label}",
@@ -9080,7 +9098,9 @@ var FR_KIT_CATALOG = {
9080
9098
  acceptsFrom: "Accepte les cartes de",
9081
9099
  acceptsAny: "Aucune coch\xE9e : toutes les colonnes.",
9082
9100
  save: "Enregistrer",
9083
- cancel: "Annuler"
9101
+ cancel: "Annuler",
9102
+ maxItems: "Cartes max.",
9103
+ maxItemsHint: "Vide : valeur du tableau."
9084
9104
  },
9085
9105
  help: {
9086
9106
  show: "Afficher l\\'aide",
@@ -9363,6 +9383,9 @@ var FR_KIT_CATALOG = {
9363
9383
  // ../common/i18n/builtIn/pt.ts
9364
9384
  var PT_KIT_CATALOG = {
9365
9385
  kit: {
9386
+ connectionFlowConnection: {
9387
+ label: "Liga\xE7\xE3o de {source} para {target}"
9388
+ },
9366
9389
  connectionFlowEdit: {
9367
9390
  connected: "Liga\xE7\xE3o solicitada",
9368
9391
  add: "Adicionar um n\xF3 {side} de {label}",
@@ -9490,7 +9513,9 @@ var PT_KIT_CATALOG = {
9490
9513
  acceptsFrom: "Aceita cart\xF5es de",
9491
9514
  acceptsAny: "Nenhuma marcada: qualquer coluna.",
9492
9515
  save: "Salvar",
9493
- cancel: "Cancelar"
9516
+ cancel: "Cancelar",
9517
+ maxItems: "M\xE1x. de cart\xF5es",
9518
+ maxItemsHint: "Vazio usa o padr\xE3o do quadro."
9494
9519
  },
9495
9520
  help: {
9496
9521
  show: "Mostrar ajuda",
@@ -10373,6 +10398,7 @@ var TooltipWrapper = ({
10373
10398
  const tooltipRef = useRef(null);
10374
10399
  const triggerRectRef = useRef(null);
10375
10400
  const [visible, setVisible] = useState2(false);
10401
+ const [colorScheme, setColorScheme] = useState2(null);
10376
10402
  const [placement, setPlacement] = useState2(null);
10377
10403
  useEffect(() => {
10378
10404
  return () => {
@@ -10434,6 +10460,9 @@ var TooltipWrapper = ({
10434
10460
  const show = useCallback(
10435
10461
  (e) => {
10436
10462
  if (text) {
10463
+ setColorScheme(
10464
+ e.currentTarget.closest("[data-color-scheme]")?.getAttribute("data-color-scheme") ?? null
10465
+ );
10437
10466
  triggerRectRef.current = e.currentTarget.getBoundingClientRect();
10438
10467
  setPlacement(null);
10439
10468
  timerRef.current = setTimeout(() => setVisible(true), delay);
@@ -10485,6 +10514,7 @@ var TooltipWrapper = ({
10485
10514
  ref: tooltipRef,
10486
10515
  id: tooltipId,
10487
10516
  role: "tooltip",
10517
+ "data-color-scheme": colorScheme ?? void 0,
10488
10518
  "data-side": side,
10489
10519
  style: {
10490
10520
  position: "fixed",
@@ -10495,7 +10525,8 @@ var TooltipWrapper = ({
10495
10525
  },
10496
10526
  className: classNames5(
10497
10527
  "pointer-events-none max-w-xs rounded-md px-2.5 py-1.5 text-xs leading-snug",
10498
- tokens.box
10528
+ tokens.box,
10529
+ colorScheme === "dark" && "dark"
10499
10530
  ),
10500
10531
  children: [
10501
10532
  text,
@@ -16519,6 +16550,7 @@ var BAR_BASE = "absolute select-none touch-none opacity-100 transition-opacity d
16519
16550
  var THUMB_BASE = "absolute left-0 top-0 cursor-grab rounded-full bg-neutral-300 transition-colors active:cursor-grabbing dark:bg-neutral-600 hover:bg-neutral-400 dark:hover:bg-neutral-500";
16520
16551
  var FITTING_THUMB = { size: 0, offset: 0, ratio: 0 };
16521
16552
  var ScrollArea = ({
16553
+ virtualScroll,
16522
16554
  variant = "auto",
16523
16555
  mask = false,
16524
16556
  horizontal = true,
@@ -16530,6 +16562,7 @@ var ScrollArea = ({
16530
16562
  className = "",
16531
16563
  ...rest
16532
16564
  }) => {
16565
+ horizontal = horizontal && !virtualScroll;
16533
16566
  const viewportId = useId7();
16534
16567
  const viewportRef = useRef10(null);
16535
16568
  const setViewportRef = useCallback5(
@@ -16553,36 +16586,36 @@ var ScrollArea = ({
16553
16586
  const dragging = useRef10(null);
16554
16587
  const thumb = useCallback5(
16555
16588
  (viewport, track, axis) => {
16556
- const viewportSize = axis === "y" ? viewport.clientHeight : viewport.clientWidth;
16557
- const contentSize = axis === "y" ? viewport.scrollHeight : viewport.scrollWidth;
16589
+ const viewportSize = axis === "y" && virtualScroll ? virtualScroll.viewportSize : axis === "y" ? viewport.clientHeight : viewport.clientWidth;
16590
+ const contentSize = axis === "y" && virtualScroll ? virtualScroll.contentSize : axis === "y" ? viewport.scrollHeight : viewport.scrollWidth;
16558
16591
  const trackSize = (track ? axis === "y" ? track.clientHeight : track.clientWidth : viewportSize) || 1;
16559
16592
  const scrollable = contentSize - viewportSize;
16560
- if (scrollable <= 1) return FITTING_THUMB;
16593
+ if (scrollable <= (virtualScroll ? 0 : 1)) return FITTING_THUMB;
16561
16594
  const size = Math.max(
16562
16595
  MIN_THUMB,
16563
16596
  viewportSize / contentSize * trackSize
16564
16597
  );
16565
- const position = axis === "y" ? viewport.scrollTop : viewport.scrollLeft;
16598
+ const position = axis === "y" && virtualScroll ? virtualScroll.offset : axis === "y" ? viewport.scrollTop : viewport.scrollLeft;
16566
16599
  return {
16567
16600
  size,
16568
16601
  offset: position / scrollable * (trackSize - size),
16569
16602
  ratio: position / scrollable
16570
16603
  };
16571
16604
  },
16572
- []
16605
+ [virtualScroll]
16573
16606
  );
16574
16607
  const update = useCallback5(() => {
16575
16608
  const viewport = viewportRef.current;
16576
16609
  if (!viewport) return;
16577
16610
  setOverflow({
16578
16611
  x: horizontal && viewport.scrollWidth - viewport.clientWidth > 1,
16579
- y: viewport.scrollHeight - viewport.clientHeight > 1
16612
+ y: virtualScroll ? virtualScroll.contentSize > virtualScroll.viewportSize : viewport.scrollHeight - viewport.clientHeight > 1
16580
16613
  });
16581
16614
  setThumbY(thumb(viewport, yTrackRef.current, "y"));
16582
16615
  setThumbX(
16583
16616
  horizontal ? thumb(viewport, xTrackRef.current, "x") : FITTING_THUMB
16584
16617
  );
16585
- }, [thumb, horizontal]);
16618
+ }, [thumb, horizontal, virtualScroll]);
16586
16619
  useEffect6(() => {
16587
16620
  update();
16588
16621
  let observer;
@@ -16608,6 +16641,18 @@ var ScrollArea = ({
16608
16641
  SCROLL_LINGER_MS
16609
16642
  );
16610
16643
  };
16644
+ const previousVirtualOffset = useRef10(virtualScroll?.offset);
16645
+ useEffect6(() => {
16646
+ if (previousVirtualOffset.current === virtualScroll?.offset) return;
16647
+ previousVirtualOffset.current = virtualScroll?.offset;
16648
+ if (!virtualScroll) return;
16649
+ setScrolling(true);
16650
+ window.clearTimeout(lingerTimer.current);
16651
+ lingerTimer.current = window.setTimeout(
16652
+ () => setScrolling(false),
16653
+ SCROLL_LINGER_MS
16654
+ );
16655
+ }, [virtualScroll]);
16611
16656
  const visible = (overflows) => {
16612
16657
  if (!overflows || variant === "hidden") return false;
16613
16658
  if (variant === "always") return true;
@@ -16625,11 +16670,11 @@ var ScrollArea = ({
16625
16670
  const track = axis === "y" ? yTrackRef.current : xTrackRef.current;
16626
16671
  const metrics = axis === "y" ? thumbY : thumbX;
16627
16672
  const travel = (track ? axis === "y" ? track.clientHeight : track.clientWidth : 0) - metrics.size;
16628
- const scrollable = (axis === "y" ? viewport.scrollHeight : viewport.scrollWidth) - (axis === "y" ? viewport.clientHeight : viewport.clientWidth);
16673
+ const scrollable = axis === "y" && virtualScroll ? virtualScroll.contentSize - virtualScroll.viewportSize : (axis === "y" ? viewport.scrollHeight : viewport.scrollWidth) - (axis === "y" ? viewport.clientHeight : viewport.clientWidth);
16629
16674
  dragging.current = {
16630
16675
  axis,
16631
16676
  pointer: axis === "y" ? event.clientY : event.clientX,
16632
- scroll: axis === "y" ? viewport.scrollTop : viewport.scrollLeft,
16677
+ scroll: axis === "y" && virtualScroll ? virtualScroll.offset : axis === "y" ? viewport.scrollTop : viewport.scrollLeft,
16633
16678
  ratio: travel > 0 ? scrollable / travel : 0
16634
16679
  };
16635
16680
  };
@@ -16639,7 +16684,17 @@ var ScrollArea = ({
16639
16684
  if (!drag || !viewport) return;
16640
16685
  const pointer = drag.axis === "y" ? event.clientY : event.clientX;
16641
16686
  const delta = (pointer - drag.pointer) * drag.ratio;
16642
- if (drag.axis === "y") viewport.scrollTop = drag.scroll + delta;
16687
+ if (drag.axis === "y" && virtualScroll)
16688
+ virtualScroll.onScroll(
16689
+ Math.max(
16690
+ 0,
16691
+ Math.min(
16692
+ virtualScroll.contentSize - virtualScroll.viewportSize,
16693
+ drag.scroll + delta
16694
+ )
16695
+ )
16696
+ );
16697
+ else if (drag.axis === "y") viewport.scrollTop = drag.scroll + delta;
16643
16698
  else viewport.scrollLeft = drag.scroll + delta;
16644
16699
  };
16645
16700
  const endDrag = (event) => {
@@ -16693,6 +16748,7 @@ var ScrollArea = ({
16693
16748
  onScroll: handleScroll,
16694
16749
  style: {
16695
16750
  ...maskStyle(),
16751
+ ...virtualScroll ? { overflow: "hidden" } : null,
16696
16752
  ...horizontal ? null : { overflowX: "hidden" }
16697
16753
  },
16698
16754
  className: classNames33(
@@ -16710,7 +16766,10 @@ var ScrollArea = ({
16710
16766
  {
16711
16767
  ref: contentRef,
16712
16768
  "data-slot": "scrollarea-content",
16713
- className: classNames33("table min-w-full", contentClassName),
16769
+ className: classNames33(
16770
+ virtualScroll ? "h-full min-w-full" : "table min-w-full",
16771
+ contentClassName
16772
+ ),
16714
16773
  children
16715
16774
  }
16716
16775
  )
@@ -22410,7 +22469,7 @@ var ColorSwatches = ({
22410
22469
  maxVisible = 5,
22411
22470
  expandOn = "click",
22412
22471
  defaultExpanded = false,
22413
- shape = "circle",
22472
+ shape: shape2 = "circle",
22414
22473
  showNames = false,
22415
22474
  selectable = false,
22416
22475
  value,
@@ -22512,7 +22571,7 @@ var ColorSwatches = ({
22512
22571
  "absolute inset-0 scale-100 opacity-0 transition duration-200 ease-out",
22513
22572
  "group-hover:scale-[1.45] group-hover:opacity-40",
22514
22573
  getTrueColorDotClass(tone),
22515
- shape === "circle" ? "rounded-full" : "rounded-md"
22574
+ shape2 === "circle" ? "rounded-full" : "rounded-md"
22516
22575
  )
22517
22576
  }
22518
22577
  ),
@@ -22523,7 +22582,7 @@ var ColorSwatches = ({
22523
22582
  "relative block transition-transform duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] group-hover:scale-[1.15]",
22524
22583
  getTrueColorDotClass(tone),
22525
22584
  DOT_CLASS[size],
22526
- shape === "circle" ? "rounded-full" : "rounded-md",
22585
+ shape2 === "circle" ? "rounded-full" : "rounded-md",
22527
22586
  // The chosen tone: a tone-neutral ring on its own offset, so it
22528
22587
  // reads on every dot and both colour schemes.
22529
22588
  selected && "ring-2 ring-offset-2 ring-neutral-900 ring-offset-white dark:ring-white dark:ring-offset-neutral-900"
@@ -22554,7 +22613,7 @@ var ColorSwatches = ({
22554
22613
  },
22555
22614
  className: classNames53(
22556
22615
  "group relative block shrink-0 hover:z-10",
22557
- shape === "circle" ? "rounded-full" : "rounded-md",
22616
+ shape2 === "circle" ? "rounded-full" : "rounded-md",
22558
22617
  "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-neutral-900 dark:focus-visible:outline-white"
22559
22618
  ),
22560
22619
  children: glyph
@@ -22717,7 +22776,7 @@ var UserAvatar = ({
22717
22776
  user,
22718
22777
  size = "md",
22719
22778
  tone = "neutral",
22720
- shape,
22779
+ shape: shape2,
22721
22780
  variant,
22722
22781
  label,
22723
22782
  icon,
@@ -22738,7 +22797,7 @@ var UserAvatar = ({
22738
22797
  }, [src]);
22739
22798
  const px = sizePx(size);
22740
22799
  const key = sizeKey(size);
22741
- const resolvedShape = shape ?? variant ?? "circle";
22800
+ const resolvedShape = shape2 ?? variant ?? "circle";
22742
22801
  const shapeClass = SHAPE_CLASS[resolvedShape];
22743
22802
  const chip = getPillColorClasses(tone, "soft");
22744
22803
  const identifier = user?.name || user?.username || user?.email;
@@ -26038,7 +26097,7 @@ function framePolarSweep(geometry, progress, input) {
26038
26097
  return { ...geometry, segments };
26039
26098
  }
26040
26099
  function computePolarGrid(input) {
26041
- const { categories, cx, cy, R, rings, domainMax, shape, format: format2, innerR = 0 } = input;
26100
+ const { categories, cx, cy, R, rings, domainMax, shape: shape2, format: format2, innerR = 0 } = input;
26042
26101
  const n = categories.length;
26043
26102
  const ringValues = [];
26044
26103
  const ringPaths = [];
@@ -26053,7 +26112,7 @@ function computePolarGrid(input) {
26053
26112
  y: cy - r + 4,
26054
26113
  text: format2 ? format2(v) : String(Math.round(v * 10) / 10)
26055
26114
  });
26056
- if (shape === "circle") {
26115
+ if (shape2 === "circle") {
26057
26116
  ringPaths.push(
26058
26117
  `M${r2(cx - r)},${r2(cy)}A${r2(r)} ${r2(r)} 0 1 1 ${r2(cx + r)},${r2(cy)}A${r2(r)} ${r2(r)} 0 1 1 ${r2(cx - r)},${r2(cy)}Z`
26059
26118
  );
@@ -29472,8 +29531,8 @@ function frameGeometry(cur, prev, p, curve, baselineY, baselinePoints, prevBasel
29472
29531
  last: points[points.length - 1] ?? null
29473
29532
  };
29474
29533
  }
29475
- function markerPath(shape, x, y, r) {
29476
- switch (shape) {
29534
+ function markerPath(shape2, x, y, r) {
29535
+ switch (shape2) {
29477
29536
  case "square":
29478
29537
  return `M${x - r},${y - r}h${r * 2}v${r * 2}h${-r * 2}Z`;
29479
29538
  case "triangle":
@@ -31997,8 +32056,8 @@ function PolarCenter(props = {}) {
31997
32056
  // src/components/chart/react/series/ScatterSeries.tsx
31998
32057
  import { useEffect as useEffect27, useRef as useRef33 } from "react";
31999
32058
  import { jsx as jsx219 } from "react/jsx-runtime";
32000
- function markerPath2(shape, x, y, r) {
32001
- switch (shape) {
32059
+ function markerPath2(shape2, x, y, r) {
32060
+ switch (shape2) {
32002
32061
  case "square":
32003
32062
  return `M${x - r},${y - r}h${r * 2}v${r * 2}h${-r * 2}Z`;
32004
32063
  case "triangle":
@@ -39182,6 +39241,8 @@ var PopoverSkeleton = ({ lines }) => /* @__PURE__ */ jsxs139("div", { className:
39182
39241
  ] });
39183
39242
  var Popover = ({
39184
39243
  trigger,
39244
+ triggerMode = "click",
39245
+ closeOnTriggerClick = false,
39185
39246
  children,
39186
39247
  placement = "auto",
39187
39248
  variant = "elevated",
@@ -39220,6 +39281,13 @@ var Popover = ({
39220
39281
  const wrapperRef = useRef44(null);
39221
39282
  const triggerWrapperRef = useRef44(null);
39222
39283
  const anchorRef = useRef44(null);
39284
+ const hoverTimer = useRef44(
39285
+ void 0
39286
+ );
39287
+ const suppressFocusOpen = useRef44(false);
39288
+ const pointerInside = useRef44(false);
39289
+ const clearHoverTimer = () => clearTimeout(hoverTimer.current);
39290
+ useEffect48(() => () => clearTimeout(hoverTimer.current), []);
39223
39291
  const onShowRef = useRef44(onShow);
39224
39292
  onShowRef.current = onShow;
39225
39293
  const onHideRef = useRef44(onHide);
@@ -39236,10 +39304,31 @@ var Popover = ({
39236
39304
  },
39237
39305
  [isControlled]
39238
39306
  );
39307
+ const enterHover = () => {
39308
+ pointerInside.current = true;
39309
+ clearHoverTimer();
39310
+ setOpen(true);
39311
+ };
39312
+ const leaveHover = () => {
39313
+ pointerInside.current = false;
39314
+ clearHoverTimer();
39315
+ hoverTimer.current = setTimeout(() => {
39316
+ if (!pointerInside.current) setOpen(false);
39317
+ }, 150);
39318
+ };
39319
+ const focusHover = () => {
39320
+ clearHoverTimer();
39321
+ if (!suppressFocusOpen.current) setOpen(true);
39322
+ };
39323
+ const blurHover = (event) => {
39324
+ const next = event.relatedTarget;
39325
+ if (!pointerInside.current && !triggerWrapperRef.current?.contains(next) && !wrapperRef.current?.contains(next))
39326
+ setOpen(false);
39327
+ };
39239
39328
  useEffect48(() => {
39240
39329
  const p = phaseRef.current;
39241
39330
  if (open) {
39242
- if (p === "closed") {
39331
+ if (p === "closed" || p === "leaving") {
39243
39332
  hideFiredRef.current = false;
39244
39333
  setPhase("entering");
39245
39334
  }
@@ -39346,8 +39435,12 @@ var Popover = ({
39346
39435
  const target = anchorRef.current ?? triggerWrapperRef.current?.querySelector(
39347
39436
  "button, [href], input, select, textarea, [tabindex]"
39348
39437
  );
39349
- target?.focus({ preventScroll: true });
39350
- }, [phase]);
39438
+ if (triggerMode === "click" || wrapperRef.current?.contains(document.activeElement)) {
39439
+ suppressFocusOpen.current = true;
39440
+ target?.focus({ preventScroll: true });
39441
+ suppressFocusOpen.current = false;
39442
+ }
39443
+ }, [phase, triggerMode]);
39351
39444
  useEffect48(() => {
39352
39445
  if (!overlayVisible) return;
39353
39446
  let frame = 0;
@@ -39408,7 +39501,8 @@ var Popover = ({
39408
39501
  const handleTriggerClick = (event) => {
39409
39502
  const existing = (trigger.props ?? {}).onClick;
39410
39503
  existing?.(event);
39411
- setOpen(!open);
39504
+ clearHoverTimer();
39505
+ setOpen(closeOnTriggerClick ? false : triggerMode === "hover" ? true : !open);
39412
39506
  };
39413
39507
  const renderedTrigger = isValidElement2(trigger) ? cloneElement3(trigger, {
39414
39508
  ref: setAnchorNode,
@@ -39551,123 +39645,136 @@ var Popover = ({
39551
39645
  }
39552
39646
  })();
39553
39647
  const showSkeleton = loading && loaderType === "skeleton";
39554
- return /* @__PURE__ */ jsxs139("span", { ref: triggerWrapperRef, className: "inline-flex", children: [
39555
- renderedTrigger,
39556
- overlayVisible && createPortal9(
39557
- /* @__PURE__ */ jsxs139(
39558
- "div",
39559
- {
39560
- ref: wrapperRef,
39561
- id: popoverId,
39562
- role: "dialog",
39563
- "aria-modal": "false",
39564
- tabIndex: -1,
39565
- "data-variant": variant,
39566
- "data-tone": tone,
39567
- "data-placement": position?.placement.side,
39568
- "aria-busy": loading,
39569
- onAnimationEnd: handleOverlayAnimationEnd,
39570
- className: classNames71(
39571
- "popover-overlay outline-none",
39572
- phase === "entering" && "popover-overlay--enter",
39573
- phase === "leaving" && "popover-overlay--leave",
39574
- // The Loader overlay's `rounded-[inherit]` reads this.
39575
- getSurfaceCornerClass(corner),
39576
- className
39577
- ),
39578
- style: overlayStyle,
39579
- children: [
39580
- arrowMode === "arrow" && position && /* @__PURE__ */ jsxs139(Fragment30, { children: [
39581
- /* @__PURE__ */ jsx250(
39582
- "span",
39583
- {
39584
- "aria-hidden": "true",
39585
- "data-popover-notch": true,
39586
- className: classNames71(
39587
- "pointer-events-none absolute z-10",
39588
- chrome.fill,
39589
- chrome.backdrop
39590
- ),
39591
- style: notchStyle
39592
- }
39648
+ return /* @__PURE__ */ jsxs139(
39649
+ "span",
39650
+ {
39651
+ ref: triggerWrapperRef,
39652
+ className: "inline-flex",
39653
+ onMouseEnter: triggerMode === "hover" ? enterHover : void 0,
39654
+ onMouseLeave: triggerMode === "hover" ? leaveHover : void 0,
39655
+ onFocus: triggerMode === "hover" ? focusHover : void 0,
39656
+ onBlur: triggerMode === "hover" ? blurHover : void 0,
39657
+ children: [
39658
+ renderedTrigger,
39659
+ overlayVisible && createPortal9(
39660
+ /* @__PURE__ */ jsxs139(
39661
+ "div",
39662
+ {
39663
+ ref: wrapperRef,
39664
+ id: popoverId,
39665
+ role: "dialog",
39666
+ "aria-modal": "false",
39667
+ tabIndex: -1,
39668
+ "data-variant": variant,
39669
+ "data-tone": tone,
39670
+ "data-placement": position?.placement.side,
39671
+ "aria-busy": loading,
39672
+ onAnimationEnd: handleOverlayAnimationEnd,
39673
+ onMouseEnter: triggerMode === "hover" ? enterHover : void 0,
39674
+ onMouseLeave: triggerMode === "hover" ? leaveHover : void 0,
39675
+ className: classNames71(
39676
+ "popover-overlay outline-none",
39677
+ phase === "entering" && "popover-overlay--enter",
39678
+ phase === "leaving" && "popover-overlay--leave",
39679
+ // The Loader overlay's `rounded-[inherit]` reads this.
39680
+ getSurfaceCornerClass(corner),
39681
+ className
39593
39682
  ),
39594
- /* @__PURE__ */ jsx250(
39595
- "span",
39596
- {
39597
- "aria-hidden": "true",
39598
- className: "pointer-events-none absolute z-20 overflow-hidden",
39599
- style: arrowClipStyle,
39600
- children: /* @__PURE__ */ jsx250(
39683
+ style: overlayStyle,
39684
+ children: [
39685
+ arrowMode === "arrow" && position && /* @__PURE__ */ jsxs139(Fragment30, { children: [
39686
+ /* @__PURE__ */ jsx250(
39601
39687
  "span",
39602
39688
  {
39603
39689
  "aria-hidden": "true",
39690
+ "data-popover-notch": true,
39604
39691
  className: classNames71(
39605
- "absolute block h-4 w-4 rotate-45",
39606
- ARROW_SIDE_BORDERS[position.placement.side],
39607
- chrome.border,
39692
+ "pointer-events-none absolute z-10",
39608
39693
  chrome.fill,
39609
39694
  chrome.backdrop
39610
39695
  ),
39611
- style: arrowDiamondStyle
39696
+ style: notchStyle
39697
+ }
39698
+ ),
39699
+ /* @__PURE__ */ jsx250(
39700
+ "span",
39701
+ {
39702
+ "aria-hidden": "true",
39703
+ className: "pointer-events-none absolute z-20 overflow-hidden",
39704
+ style: arrowClipStyle,
39705
+ children: /* @__PURE__ */ jsx250(
39706
+ "span",
39707
+ {
39708
+ "aria-hidden": "true",
39709
+ className: classNames71(
39710
+ "absolute block h-4 w-4 rotate-45",
39711
+ ARROW_SIDE_BORDERS[position.placement.side],
39712
+ chrome.border,
39713
+ chrome.fill,
39714
+ chrome.backdrop
39715
+ ),
39716
+ style: arrowDiamondStyle
39717
+ }
39718
+ )
39612
39719
  }
39613
39720
  )
39614
- }
39615
- )
39616
- ] }),
39617
- arrowMode === "bubble" && position && /*
39618
- The detached "thinking-bubble" dot: a small circle floating in
39619
- the MIDDLE of the trigger↔panel gap, centred on the caret. It
39620
- wears the panel's edge chrome (fill + a full circular border +
39621
- backdrop) so it reads as a bead of the same surface. Being
39622
- detached it never touches the panel edge, so no notch is
39623
- needed — the border/ring runs unbroken. It shrinks to fit a
39624
- gap clamped smaller than the nominal offset.
39625
- */
39626
- /* @__PURE__ */ jsx250(
39627
- "span",
39628
- {
39629
- "aria-hidden": "true",
39630
- "data-popover-bubble": true,
39631
- className: classNames71(
39632
- "pointer-events-none absolute z-20 block rounded-full border",
39633
- chrome.border,
39634
- chrome.fill,
39635
- chrome.backdrop
39721
+ ] }),
39722
+ arrowMode === "bubble" && position && /*
39723
+ The detached "thinking-bubble" dot: a small circle floating in
39724
+ the MIDDLE of the trigger↔panel gap, centred on the caret. It
39725
+ wears the panel's edge chrome (fill + a full circular border +
39726
+ backdrop) so it reads as a bead of the same surface. Being
39727
+ detached it never touches the panel edge, so no notch is
39728
+ needed — the border/ring runs unbroken. It shrinks to fit a
39729
+ gap clamped smaller than the nominal offset.
39730
+ */
39731
+ /* @__PURE__ */ jsx250(
39732
+ "span",
39733
+ {
39734
+ "aria-hidden": "true",
39735
+ "data-popover-bubble": true,
39736
+ className: classNames71(
39737
+ "pointer-events-none absolute z-20 block rounded-full border",
39738
+ chrome.border,
39739
+ chrome.fill,
39740
+ chrome.backdrop
39741
+ ),
39742
+ style: bubbleStyle
39743
+ }
39636
39744
  ),
39637
- style: bubbleStyle
39638
- }
39639
- ),
39640
- /* @__PURE__ */ jsx250(
39641
- Panel_default,
39642
- {
39643
- variant,
39644
- tone,
39645
- corner,
39646
- padding: "none",
39647
- scrollable: false,
39648
- vibrancy,
39649
- glassOpacity,
39650
- specularMode,
39651
- children: /* @__PURE__ */ jsx250("div", { className: "max-h-[55vh] overflow-y-auto", children: /* @__PURE__ */ jsx250("div", { className: getSurfacePaddingClass(padding), children: showSkeleton ? /* @__PURE__ */ jsx250(PopoverSkeleton, { lines: skeletonLines }) : children }) })
39652
- }
39653
- ),
39654
- loading && !showSkeleton && /* @__PURE__ */ jsx250(
39655
- Loader_default,
39656
- {
39657
- overlay: true,
39658
- variant: loaderType,
39659
- title: loaderTitle,
39660
- label: loaderMessage,
39661
- progress: loaderProgress,
39662
- color: loaderColor
39663
- }
39664
- )
39665
- ]
39666
- }
39667
- ),
39668
- document.body
39669
- )
39670
- ] });
39745
+ /* @__PURE__ */ jsx250(
39746
+ Panel_default,
39747
+ {
39748
+ variant,
39749
+ tone,
39750
+ corner,
39751
+ padding: "none",
39752
+ scrollable: false,
39753
+ vibrancy,
39754
+ glassOpacity,
39755
+ specularMode,
39756
+ children: /* @__PURE__ */ jsx250("div", { className: "max-h-[55vh] overflow-y-auto", children: /* @__PURE__ */ jsx250("div", { className: getSurfacePaddingClass(padding), children: showSkeleton ? /* @__PURE__ */ jsx250(PopoverSkeleton, { lines: skeletonLines }) : children }) })
39757
+ }
39758
+ ),
39759
+ loading && !showSkeleton && /* @__PURE__ */ jsx250(
39760
+ Loader_default,
39761
+ {
39762
+ overlay: true,
39763
+ variant: loaderType,
39764
+ title: loaderTitle,
39765
+ label: loaderMessage,
39766
+ progress: loaderProgress,
39767
+ color: loaderColor
39768
+ }
39769
+ )
39770
+ ]
39771
+ }
39772
+ ),
39773
+ document.body
39774
+ )
39775
+ ]
39776
+ }
39777
+ );
39671
39778
  };
39672
39779
  Popover.displayName = "Popover";
39673
39780
  var Popover_default = Popover;
@@ -41273,42 +41380,58 @@ var Tabs = ({
41273
41380
  isGlass && isActive && glassActiveRing
41274
41381
  );
41275
41382
  const showDividerAfter = shouldShowDividers && index < items.length - 1;
41383
+ const tabButton = /* @__PURE__ */ jsxs143(
41384
+ "button",
41385
+ {
41386
+ type: "button",
41387
+ role: "tab",
41388
+ id: `tab-${item.id}`,
41389
+ "aria-selected": isActive,
41390
+ "aria-controls": item.panel !== void 0 ? controlsId : void 0,
41391
+ disabled: isDisabled,
41392
+ className: classNames75(
41393
+ baseClassesForItem,
41394
+ Boolean(item.trailingAction) && "pr-10"
41395
+ ),
41396
+ onClick: () => selectTab(item),
41397
+ tabIndex: isActive ? 0 : -1,
41398
+ ref: (node) => {
41399
+ tabRefs.current.set(item.id, node);
41400
+ },
41401
+ children: [
41402
+ isGlass && glassSpecular ? /* @__PURE__ */ jsx255(
41403
+ "div",
41404
+ {
41405
+ "aria-hidden": "true",
41406
+ className: classNames75(
41407
+ "pointer-events-none absolute inset-0 rounded-[inherit]",
41408
+ glassSpecular
41409
+ )
41410
+ }
41411
+ ) : null,
41412
+ renderTabIcon(item.icon),
41413
+ /* @__PURE__ */ jsxs143("span", { className: "flex min-w-0 flex-col text-left", children: [
41414
+ /* @__PURE__ */ jsx255("span", { className: "truncate", children: item.label }),
41415
+ item.description ? /* @__PURE__ */ jsx255("span", { className: "mt-1 text-xs opacity-70", children: item.description }) : null
41416
+ ] }),
41417
+ item.badge ? /* @__PURE__ */ jsx255(Badge_default, { count: item.badge, tone: item.badgeColor }) : null
41418
+ ]
41419
+ }
41420
+ );
41276
41421
  return /* @__PURE__ */ jsxs143(React57.Fragment, { children: [
41277
- /* @__PURE__ */ jsxs143(
41278
- "button",
41422
+ item.trailingAction ? /* @__PURE__ */ jsxs143(
41423
+ "div",
41279
41424
  {
41280
- type: "button",
41281
- role: "tab",
41282
- id: `tab-${item.id}`,
41283
- "aria-selected": isActive,
41284
- "aria-controls": item.panel !== void 0 ? controlsId : void 0,
41285
- disabled: isDisabled,
41286
- className: baseClassesForItem,
41287
- onClick: () => selectTab(item),
41288
- tabIndex: isActive ? 0 : -1,
41289
- ref: (node) => {
41290
- tabRefs.current.set(item.id, node);
41291
- },
41425
+ className: classNames75(
41426
+ "relative inline-flex shrink-0",
41427
+ fullWidth && "flex-1"
41428
+ ),
41292
41429
  children: [
41293
- isGlass && glassSpecular ? /* @__PURE__ */ jsx255(
41294
- "div",
41295
- {
41296
- "aria-hidden": "true",
41297
- className: classNames75(
41298
- "pointer-events-none absolute inset-0 rounded-[inherit]",
41299
- glassSpecular
41300
- )
41301
- }
41302
- ) : null,
41303
- renderTabIcon(item.icon),
41304
- /* @__PURE__ */ jsxs143("span", { className: "flex min-w-0 flex-col text-left", children: [
41305
- /* @__PURE__ */ jsx255("span", { className: "truncate", children: item.label }),
41306
- item.description ? /* @__PURE__ */ jsx255("span", { className: "mt-1 text-xs opacity-70", children: item.description }) : null
41307
- ] }),
41308
- item.badge ? /* @__PURE__ */ jsx255(Badge_default, { count: item.badge, tone: item.badgeColor }) : null
41430
+ tabButton,
41431
+ /* @__PURE__ */ jsx255("span", { className: "absolute right-1 top-1/2 -translate-y-1/2", children: item.trailingAction })
41309
41432
  ]
41310
41433
  }
41311
- ),
41434
+ ) : tabButton,
41312
41435
  showDividerAfter ? /* @__PURE__ */ jsx255(
41313
41436
  "span",
41314
41437
  {
@@ -57546,14 +57669,14 @@ TimelinePanel.displayName = "TimelinePanel";
57546
57669
  var TimelinePanel_default = TimelinePanel;
57547
57670
 
57548
57671
  // src/components/ConnectionFlow/ConnectionFlow.tsx
57549
- import React83, {
57672
+ import React84, {
57550
57673
  useCallback as useCallback42,
57551
57674
  useEffect as useEffect68,
57552
57675
  useLayoutEffect as useLayoutEffect22,
57553
57676
  useImperativeHandle as useImperativeHandle3,
57554
57677
  useMemo as useMemo49,
57555
57678
  useRef as useRef65,
57556
- useState as useState75
57679
+ useState as useState76
57557
57680
  } from "react";
57558
57681
  import classNames104 from "classnames";
57559
57682
 
@@ -59895,8 +60018,8 @@ var layoutWithRowSpace = (input, rowSpace, pass) => {
59895
60018
  toPort: sidePort(to, toSide),
59896
60019
  prefer: { from: [fromSide], to: [toSide] },
59897
60020
  state: connection.state ?? (input.autoState ? toneOf(from.node) !== "neutral" ? nodeIsActive(to.node) ? "flowing" : "stopped" : "disabled" : input.flowState ?? "flowing"),
59898
- sourceTone: connection.sourceTone ?? toneOf(from.node),
59899
- targetTone: connection.targetTone ?? toneOf(to.node),
60021
+ sourceTone: connection.sourceTone ?? connection.tone ?? toneOf(from.node),
60022
+ targetTone: connection.targetTone ?? connection.tone ?? toneOf(from.node),
59900
60023
  label: connection.label,
59901
60024
  cfg: connection
59902
60025
  });
@@ -60242,6 +60365,7 @@ ConnectionFlowSkeleton.displayName = "ConnectionFlowSkeleton";
60242
60365
  var ConnectionFlowSkeleton_default = ConnectionFlowSkeleton;
60243
60366
 
60244
60367
  // src/components/ConnectionFlow/ConnectionFlowSvg.tsx
60368
+ import { useId as useId40, useState as useState74 } from "react";
60245
60369
  import classNames103 from "classnames";
60246
60370
 
60247
60371
  // src/components/ConnectionFlow/ConnectionFlowNodeBody.tsx
@@ -60464,6 +60588,11 @@ var ConnectionFlowSvg = ({
60464
60588
  highlightEdges,
60465
60589
  hoveredId,
60466
60590
  selectedId,
60591
+ editableConnections,
60592
+ selectedConnectionId,
60593
+ onSelectConnection,
60594
+ onEditConnection,
60595
+ onRemoveConnection,
60467
60596
  scale,
60468
60597
  offsetX,
60469
60598
  offsetY,
@@ -60471,7 +60600,13 @@ var ConnectionFlowSvg = ({
60471
60600
  onSelect,
60472
60601
  renderNode
60473
60602
  }) => {
60474
- const isLit = (edge) => highlightEdges.size === 0 || highlightEdges.has(edge.id);
60603
+ const t = useKitT();
60604
+ const descriptionPrefix = useId40();
60605
+ const [focusedConnectionId, setFocusedConnectionId] = useState74(null);
60606
+ const emphasized = (id) => !!editableConnections && (id === selectedConnectionId || id === focusedConnectionId);
60607
+ const connectionById = new Map(editableConnections?.map((c) => [c.id, c]));
60608
+ const nodeById = new Map(layout.nodes.map((n) => [n.id, n]));
60609
+ const isLit = (edge) => emphasized(edge.id) || highlightEdges.size === 0 || highlightEdges.has(edge.id);
60475
60610
  const nodeOpacity = (node) => highlightNodes.size === 0 || highlightNodes.has(node.id) ? 1 : 0.22;
60476
60611
  const connectorOpacity = (connector) => highlightEdges.size === 0 || connector.edgeIds.some((id) => highlightEdges.has(id)) ? 1 : 0.22;
60477
60612
  const cardContent = (laid) => {
@@ -60522,13 +60657,25 @@ var ConnectionFlowSvg = ({
60522
60657
  ) : null;
60523
60658
  const edgeTone = getToneClasses(edge.targetTone);
60524
60659
  return /* @__PURE__ */ jsxs174("g", { "data-flow-edge": edge.id, "data-flow-from": edge.fromId, "data-flow-to": edge.toId, children: [
60660
+ emphasized(edge.id) && /* @__PURE__ */ jsx291(
60661
+ "path",
60662
+ {
60663
+ d: edge.d,
60664
+ fill: "none",
60665
+ className: edgeTone.line,
60666
+ strokeWidth: 8,
60667
+ opacity: 0.22,
60668
+ strokeLinecap: "round",
60669
+ strokeLinejoin: "round"
60670
+ }
60671
+ ),
60525
60672
  /* @__PURE__ */ jsx291(
60526
60673
  "path",
60527
60674
  {
60528
60675
  d: edge.d,
60529
60676
  fill: "none",
60530
60677
  className: edgeTone.line,
60531
- strokeWidth: edge.state === "disabled" ? 1 : 1.75,
60678
+ strokeWidth: emphasized(edge.id) ? 3 : edge.state === "disabled" ? 1 : 1.75,
60532
60679
  strokeDasharray: edge.state === "disabled" ? "4 4" : void 0,
60533
60680
  strokeLinecap: "round",
60534
60681
  strokeLinejoin: "round"
@@ -60643,7 +60790,85 @@ var ConnectionFlowSvg = ({
60643
60790
  }) })
60644
60791
  }
60645
60792
  ),
60646
- /* @__PURE__ */ jsx291("div", { className: "absolute inset-0", children: layout.nodes.map((laid) => /* @__PURE__ */ jsx291(
60793
+ !!editableConnections?.length && /* @__PURE__ */ jsx291("svg", { className: "pointer-events-none absolute inset-0 h-full w-full", style: { overflow: "visible" }, children: /* @__PURE__ */ jsx291("g", { transform: `translate(${offsetX}, ${offsetY}) scale(${scale})`, children: layout.edges.map((edge) => {
60794
+ const connection = connectionById.get(edge.id);
60795
+ if (!connection) return null;
60796
+ const source = nodeById.get(connection.fromId);
60797
+ const target = nodeById.get(connection.toId);
60798
+ const name = t("kit.connectionFlowConnection.label", {
60799
+ source: source?.node.title || connection.fromId,
60800
+ target: target?.node.title || connection.toId
60801
+ });
60802
+ const descriptionId = `${descriptionPrefix}-${encodeURIComponent(connection.id)}`;
60803
+ return /* @__PURE__ */ jsxs174(
60804
+ "g",
60805
+ {
60806
+ "data-flow-connection-hit": edge.id,
60807
+ "data-no-pan": true,
60808
+ "data-no-edit": true,
60809
+ role: "button",
60810
+ tabIndex: 0,
60811
+ "aria-pressed": selectedConnectionId === edge.id,
60812
+ "aria-label": [name, connection.label, connection.type].filter(Boolean).join(" \xB7 "),
60813
+ "aria-describedby": connection.description ? descriptionId : void 0,
60814
+ className: "cursor-pointer outline-none",
60815
+ onFocus: () => setFocusedConnectionId(edge.id),
60816
+ onBlur: () => setFocusedConnectionId(null),
60817
+ onClick: (event) => {
60818
+ event.stopPropagation();
60819
+ onSelectConnection?.(connection);
60820
+ },
60821
+ onDoubleClick: (event) => {
60822
+ event.stopPropagation();
60823
+ if (connection.editable !== false) onEditConnection?.(connection);
60824
+ },
60825
+ onKeyDown: (event) => {
60826
+ if (event.target !== event.currentTarget) return;
60827
+ if (event.key === "Enter" || event.key === " ") {
60828
+ event.preventDefault();
60829
+ event.stopPropagation();
60830
+ if (event.key === "Enter" && connection.editable !== false && onEditConnection) onEditConnection(connection);
60831
+ else onSelectConnection?.(connection);
60832
+ } else if (event.key === "Escape") {
60833
+ event.preventDefault();
60834
+ event.stopPropagation();
60835
+ onSelectConnection?.(null);
60836
+ } else if ((event.key === "Delete" || event.key === "Backspace") && connection.deletable !== false && onRemoveConnection) {
60837
+ event.preventDefault();
60838
+ event.stopPropagation();
60839
+ onRemoveConnection(connection);
60840
+ }
60841
+ },
60842
+ children: [
60843
+ connection.description && /* @__PURE__ */ jsx291("desc", { id: descriptionId, children: connection.description }),
60844
+ /* @__PURE__ */ jsx291(
60845
+ "path",
60846
+ {
60847
+ d: edge.d,
60848
+ fill: "none",
60849
+ stroke: "transparent",
60850
+ strokeWidth: 14,
60851
+ vectorEffect: "non-scaling-stroke",
60852
+ style: { pointerEvents: "stroke" }
60853
+ }
60854
+ ),
60855
+ edge.caption && /* @__PURE__ */ jsx291(
60856
+ "rect",
60857
+ {
60858
+ x: edge.caption.x,
60859
+ y: edge.caption.y,
60860
+ width: edge.caption.width,
60861
+ height: edge.caption.height,
60862
+ fill: "transparent",
60863
+ style: { pointerEvents: "all" }
60864
+ }
60865
+ )
60866
+ ]
60867
+ },
60868
+ edge.id
60869
+ );
60870
+ }) }) }),
60871
+ /* @__PURE__ */ jsx291("div", { className: "pointer-events-none absolute inset-0", children: layout.nodes.map((laid) => /* @__PURE__ */ jsx291(
60647
60872
  "div",
60648
60873
  {
60649
60874
  "data-flow-node": laid.id,
@@ -60718,7 +60943,7 @@ var ConnectionFlowSvg = ({
60718
60943
  var ConnectionFlowSvg_default = ConnectionFlowSvg;
60719
60944
 
60720
60945
  // src/components/ConnectionFlow/ConnectionFlowEditor.tsx
60721
- import { forwardRef as forwardRef161, useEffect as useEffect67, useId as useId40, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect21, useRef as useRef64, useState as useState74 } from "react";
60946
+ import { forwardRef as forwardRef161, useEffect as useEffect67, useId as useId41, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect21, useRef as useRef64, useState as useState75 } from "react";
60722
60947
 
60723
60948
  // src/components/ConnectionFlow/editGeometry.ts
60724
60949
  var EDIT_SIDES = ["top", "right", "bottom", "left"];
@@ -60902,14 +61127,14 @@ var ConnectionFlowEditor = forwardRef161(function ConnectionFlowEditor2({
60902
61127
  onBounds
60903
61128
  }, ref) {
60904
61129
  const t = useKitT();
60905
- const editorId = useId40();
61130
+ const editorId = useId41();
60906
61131
  const idSequence = useRef64(0);
60907
61132
  const root = useRef64(null);
60908
- const [hover, setHover] = useState74(null);
60909
- const [drag, setDrag] = useState74(null);
61133
+ const [hover, setHover] = useState75(null);
61134
+ const [drag, setDrag] = useState75(null);
60910
61135
  const dragRef = useRef64(null);
60911
- const [pending, setPending] = useState74([]);
60912
- const [message, setMessage] = useState74("");
61136
+ const [pending, setPending] = useState75([]);
61137
+ const [message, setMessage] = useState75("");
60913
61138
  const captured = useRef64(null);
60914
61139
  const updateDrag = (next) => {
60915
61140
  dragRef.current = next;
@@ -61279,9 +61504,13 @@ var MINUS_ICON = /* @__PURE__ */ jsx293(
61279
61504
  children: /* @__PURE__ */ jsx293("path", { d: "M6 12h12" })
61280
61505
  }
61281
61506
  );
61282
- var ConnectionFlow = React83.forwardRef(function ConnectionFlow2({
61507
+ var ConnectionFlow = React84.forwardRef(function ConnectionFlow2({
61283
61508
  nodes,
61284
61509
  connections,
61510
+ selectedConnectionId,
61511
+ onConnectionSelect,
61512
+ onConnectionEdit,
61513
+ onConnectionRemove,
61285
61514
  onConnect,
61286
61515
  editMode = false,
61287
61516
  onNodeCreate,
@@ -61326,19 +61555,37 @@ var ConnectionFlow = React83.forwardRef(function ConnectionFlow2({
61326
61555
  renderNode
61327
61556
  }, ref) {
61328
61557
  const editorRef = useRef65(null);
61329
- const [editBounds, setEditBounds] = useState75(null);
61558
+ const [editBounds, setEditBounds] = useState76(null);
61330
61559
  const onEditBounds = useCallback42((next) => setEditBounds(
61331
61560
  (current) => current?.x === next?.x && current?.y === next?.y && current?.width === next?.width && current?.height === next?.height ? current : next
61332
61561
  ), []);
61333
61562
  const viewportRef = useRef65(null);
61334
61563
  const wheelAreaRef = useRef65(null);
61335
61564
  const manuallyNavigated = useRef65(false);
61336
- const [viewport, setViewport] = useState75({ width: 0, height: 0 });
61337
- const [hoveredId, setHoveredId] = useState75(null);
61338
- const [selectedId, setSelectedId] = useState75(null);
61339
- const [scale, setScale] = useState75(1);
61340
- const [panning, setPanning] = useState75(false);
61341
- const [expanded, setExpanded] = useState75(
61565
+ const [viewport, setViewport] = useState76({ width: 0, height: 0 });
61566
+ const [hoveredId, setHoveredId] = useState76(null);
61567
+ const [selectedId, setSelectedId] = useState76(null);
61568
+ const [internalConnectionId, setInternalConnectionId] = useState76(null);
61569
+ const connectionId = selectedConnectionId === void 0 ? internalConnectionId : selectedConnectionId;
61570
+ const selectedConnection = connections?.find((c) => c.id === connectionId) ?? null;
61571
+ useEffect68(() => {
61572
+ if (internalConnectionId && !connections?.some((c) => c.id === internalConnectionId)) setInternalConnectionId(null);
61573
+ }, [connections, internalConnectionId]);
61574
+ const selectConnection = (connection) => {
61575
+ if (selectedConnectionId === void 0) setInternalConnectionId(connection?.id ?? null);
61576
+ if (connection) {
61577
+ setSelectedId(null);
61578
+ setHoveredId(null);
61579
+ }
61580
+ if (selectedConnection?.id !== connection?.id) onConnectionSelect?.(connection);
61581
+ };
61582
+ const editConnection = (connection) => {
61583
+ selectConnection(connection);
61584
+ if (connection.editable !== false) onConnectionEdit?.(connection);
61585
+ };
61586
+ const [scale, setScale] = useState76(1);
61587
+ const [panning, setPanning] = useState76(false);
61588
+ const [expanded, setExpanded] = useState76(
61342
61589
  () => /* @__PURE__ */ new Set()
61343
61590
  );
61344
61591
  const panStart = useRef65({ x: 0, y: 0, scrollLeft: 0, scrollTop: 0 });
@@ -61494,6 +61741,7 @@ var ConnectionFlow = React83.forwardRef(function ConnectionFlow2({
61494
61741
  onNodeHover?.(node?.node ?? null);
61495
61742
  };
61496
61743
  const onSelect = (node) => {
61744
+ if (editMode) selectConnection(null);
61497
61745
  setSelectedId((current) => current === node.id ? null : node.id);
61498
61746
  onNodeClick?.(node.node);
61499
61747
  };
@@ -61518,6 +61766,11 @@ var ConnectionFlow = React83.forwardRef(function ConnectionFlow2({
61518
61766
  highlightEdges: highlight.edges,
61519
61767
  hoveredId,
61520
61768
  selectedId,
61769
+ editableConnections: editMode ? connections : void 0,
61770
+ selectedConnectionId: editMode ? selectedConnection?.id ?? null : null,
61771
+ onSelectConnection: selectConnection,
61772
+ onEditConnection: onConnectionEdit ? editConnection : void 0,
61773
+ onRemoveConnection: onConnectionRemove,
61521
61774
  scale,
61522
61775
  // The canvas is sized to the content and scrolled natively, so the only
61523
61776
  // offset the renderers need is the overhang: a bypass arc lifts above the
@@ -61608,6 +61861,7 @@ var ConnectionFlow = React83.forwardRef(function ConnectionFlow2({
61608
61861
  className: "h-full w-full min-w-0 select-none",
61609
61862
  style: { cursor: panning ? "grabbing" : void 0 },
61610
61863
  onPointerDown: (event) => {
61864
+ if (event.button === 0 && editMode && !event.target.closest("[data-flow-node], [data-flow-connection-hit], button, input, select, textarea")) selectConnection(null);
61611
61865
  if (!interactive || event.button !== 0) return;
61612
61866
  if (editMode && event.target.closest("[data-flow-node]")) return;
61613
61867
  if (event.target.closest(
@@ -61668,7 +61922,10 @@ var ConnectionFlow = React83.forwardRef(function ConnectionFlow2({
61668
61922
  tone,
61669
61923
  variant: surfaceVariant,
61670
61924
  edgeStyle,
61671
- onCreate: onNodeCreate,
61925
+ onCreate: (id, placement) => {
61926
+ selectConnection(null);
61927
+ onNodeCreate?.(id, placement);
61928
+ },
61672
61929
  onConnect,
61673
61930
  onBounds: onEditBounds,
61674
61931
  onStart: () => {
@@ -61780,10 +62037,10 @@ var ConnectionFlow_default = ConnectionFlow;
61780
62037
 
61781
62038
  // src/components/Tree.tsx
61782
62039
  import {
61783
- useId as useId41,
62040
+ useId as useId42,
61784
62041
  useMemo as useMemo50,
61785
62042
  useRef as useRef66,
61786
- useState as useState76
62043
+ useState as useState77
61787
62044
  } from "react";
61788
62045
  import classNames105 from "classnames";
61789
62046
  import { jsx as jsx294, jsxs as jsxs177 } from "react/jsx-runtime";
@@ -61850,15 +62107,15 @@ var Tree = ({
61850
62107
  }) => {
61851
62108
  warnIfMissingName("Tree", ariaLabel);
61852
62109
  const renderIcon2 = useIconRenderer();
61853
- const uid = useId41().replace(/:/g, "");
62110
+ const uid = useId42().replace(/:/g, "");
61854
62111
  const sizeTokens12 = SIZES2[size];
61855
- const [internalSelected, setInternalSelected] = useState76(
62112
+ const [internalSelected, setInternalSelected] = useState77(
61856
62113
  defaultSelectedIds ?? []
61857
62114
  );
61858
- const [internalExpanded, setInternalExpanded] = useState76(
62115
+ const [internalExpanded, setInternalExpanded] = useState77(
61859
62116
  defaultExpandedIds ?? []
61860
62117
  );
61861
- const [focusedId, setFocusedId] = useState76(null);
62118
+ const [focusedId, setFocusedId] = useState77(null);
61862
62119
  const rowRefs = useRef66(/* @__PURE__ */ new Map());
61863
62120
  const selectedSet = useMemo50(
61864
62121
  () => new Set(selectedIds ?? internalSelected),
@@ -62236,9 +62493,9 @@ var Tree_default = Tree;
62236
62493
 
62237
62494
  // src/components/OrganizationChart.tsx
62238
62495
  import {
62239
- useId as useId42,
62496
+ useId as useId43,
62240
62497
  useMemo as useMemo51,
62241
- useState as useState77
62498
+ useState as useState78
62242
62499
  } from "react";
62243
62500
  import classNames106 from "classnames";
62244
62501
  import { Fragment as Fragment45, jsx as jsx295, jsxs as jsxs178 } from "react/jsx-runtime";
@@ -62281,11 +62538,11 @@ var OrganizationChart = ({
62281
62538
  ...rest
62282
62539
  }) => {
62283
62540
  const renderIcon2 = useIconRenderer();
62284
- const uid = useId42().replace(/:/g, "");
62285
- const [internalExpanded, setInternalExpanded] = useState77(
62541
+ const uid = useId43().replace(/:/g, "");
62542
+ const [internalExpanded, setInternalExpanded] = useState78(
62286
62543
  () => defaultExpandedIds ?? collectExpandable(nodes)
62287
62544
  );
62288
- const [internalSelected, setInternalSelected] = useState77(
62545
+ const [internalSelected, setInternalSelected] = useState78(
62289
62546
  defaultSelectedIds ?? []
62290
62547
  );
62291
62548
  const expandedSet = useMemo51(
@@ -62562,12 +62819,12 @@ import {
62562
62819
  useEffect as useEffect71,
62563
62820
  useLayoutEffect as useLayoutEffect23,
62564
62821
  useRef as useRef68,
62565
- useState as useState80
62822
+ useState as useState81
62566
62823
  } from "react";
62567
62824
  import classNames108 from "classnames";
62568
62825
 
62569
62826
  // src/components/TreeView/TreeItemCard.tsx
62570
- import { useEffect as useEffect69, useRef as useRef67, useState as useState78 } from "react";
62827
+ import { useEffect as useEffect69, useRef as useRef67, useState as useState79 } from "react";
62571
62828
  import classNames107 from "classnames";
62572
62829
  import { jsx as jsx296, jsxs as jsxs179 } from "react/jsx-runtime";
62573
62830
  var TreeItemCard = ({
@@ -62598,11 +62855,11 @@ var TreeItemCard = ({
62598
62855
  activePulse = false
62599
62856
  }) => {
62600
62857
  const tokens = getTreeColorTokens(tone);
62601
- const [internalExpanded, setInternalExpanded] = useState78(defaultExpanded);
62858
+ const [internalExpanded, setInternalExpanded] = useState79(defaultExpanded);
62602
62859
  const isExpanded = expanded ?? internalExpanded;
62603
62860
  const canExpand = forceToggle || body !== void 0 && body !== null;
62604
62861
  const titleRef = useRef67(null);
62605
- const [isTitleClamped, setIsTitleClamped] = useState78(false);
62862
+ const [isTitleClamped, setIsTitleClamped] = useState79(false);
62606
62863
  useEffect69(() => {
62607
62864
  if (!titleWrap || titleScroll) {
62608
62865
  setIsTitleClamped(false);
@@ -62755,7 +63012,7 @@ var TreeItemCard = ({
62755
63012
  var TreeItemCard_default = TreeItemCard;
62756
63013
 
62757
63014
  // src/components/TreeView/TreeFlowSvg.tsx
62758
- import { useEffect as useEffect70, useState as useState79 } from "react";
63015
+ import { useEffect as useEffect70, useState as useState80 } from "react";
62759
63016
  import { Fragment as Fragment46, jsx as jsx297, jsxs as jsxs180 } from "react/jsx-runtime";
62760
63017
  function useIsDark2() {
62761
63018
  const detectDark = () => {
@@ -62767,7 +63024,7 @@ function useIsDark2() {
62767
63024
  probe.remove();
62768
63025
  return darkActive;
62769
63026
  };
62770
- const [isDark, setIsDark] = useState79(() => detectDark());
63027
+ const [isDark, setIsDark] = useState80(() => detectDark());
62771
63028
  useEffect70(() => {
62772
63029
  const update = () => setIsDark(detectDark());
62773
63030
  const obs = new MutationObserver(update);
@@ -63243,7 +63500,7 @@ function moveItem(list, from, to) {
63243
63500
  return next;
63244
63501
  }
63245
63502
  function useElementHeight(ref) {
63246
- const [h, setH] = useState80(0);
63503
+ const [h, setH] = useState81(0);
63247
63504
  useEffect71(() => {
63248
63505
  const el = ref.current;
63249
63506
  if (!el) return;
@@ -63277,11 +63534,11 @@ var TreeItemRow = ({
63277
63534
  const childLevelWrapRef = useRef68(null);
63278
63535
  const rowHeight2 = useElementHeight(rowRef);
63279
63536
  const cardHeight = useElementHeight(cardRef);
63280
- const [childLevelOffset, setChildLevelOffset] = useState80(0);
63537
+ const [childLevelOffset, setChildLevelOffset] = useState81(0);
63281
63538
  const resolvedTone = item.tone ?? globalTone ?? "neutral";
63282
63539
  const isActive = item.active ?? false;
63283
63540
  const hasChildren = Boolean(item.children && item.children.length > 0);
63284
- const [childrenExpanded, setChildrenExpanded] = useState80(
63541
+ const [childrenExpanded, setChildrenExpanded] = useState81(
63285
63542
  item.defaultExpanded ?? true
63286
63543
  );
63287
63544
  const setRowElement = useCallback43(
@@ -63419,7 +63676,7 @@ var TreeLevel = ({
63419
63676
  const resolvedRowGap = svgProps.rowGap ?? 8;
63420
63677
  const indentPx = INDENT_PX[resolvedIndent];
63421
63678
  const isReorderEnabled = Boolean(svgProps.reorderable && items.length > 1);
63422
- const [orderedItems, setOrderedItems] = useState80(items);
63679
+ const [orderedItems, setOrderedItems] = useState81(items);
63423
63680
  const prevIncomingOrderKeyRef = useRef68(buildOrderKey(items));
63424
63681
  const hasLocalOrderOverride = useRef68(false);
63425
63682
  useEffect71(() => {
@@ -63436,20 +63693,20 @@ var TreeLevel = ({
63436
63693
  });
63437
63694
  prevIncomingOrderKeyRef.current = incomingKey;
63438
63695
  }, [items]);
63439
- const [cardHeightById, setCardHeightById] = useState80(
63696
+ const [cardHeightById, setCardHeightById] = useState81(
63440
63697
  {}
63441
63698
  );
63442
- const [cardAnchorById, setCardAnchorById] = useState80(
63699
+ const [cardAnchorById, setCardAnchorById] = useState81(
63443
63700
  {}
63444
63701
  );
63445
- const [toneById, setToneById] = useState80({});
63446
- const [activeById, setActiveById] = useState80({});
63702
+ const [toneById, setToneById] = useState81({});
63703
+ const [activeById, setActiveById] = useState81({});
63447
63704
  const rowElementsRef = useRef68({});
63448
63705
  const previousTopByIdRef = useRef68({});
63449
63706
  const dragStartRef = useRef68(null);
63450
63707
  const dropTargetRef = useRef68(null);
63451
- const [draggingId, setDraggingId] = useState80(null);
63452
- const [dropTarget, setDropTarget] = useState80(null);
63708
+ const [draggingId, setDraggingId] = useState81(null);
63709
+ const [dropTarget, setDropTarget] = useState81(null);
63453
63710
  useEffect71(() => {
63454
63711
  const validIds = new Set(orderedItems.map((item) => item.id));
63455
63712
  const prune = (prev) => {
@@ -63824,11 +64081,11 @@ import { useMemo as useMemo57 } from "react";
63824
64081
  import classNames121 from "classnames";
63825
64082
 
63826
64083
  // src/components/WorkflowTracker/WorkflowTrackerRail.tsx
63827
- import { useMemo as useMemo53 } from "react";
64084
+ import { useId as useId44, useMemo as useMemo53, useState as useState82 } from "react";
63828
64085
  import classNames114 from "classnames";
63829
64086
 
63830
64087
  // src/components/WorkflowTracker/WorkflowTimeline.tsx
63831
- import React89 from "react";
64088
+ import React90 from "react";
63832
64089
  import classNames113 from "classnames";
63833
64090
 
63834
64091
  // src/components/WorkflowTracker/WorkflowSkeleton.tsx
@@ -63864,25 +64121,37 @@ var WorkflowHeaderSkeleton = ({ hasIcon = false, iconCorner = DEFAULT_SURFACE_CO
63864
64121
  ] }),
63865
64122
  /* @__PURE__ */ jsx299(Bar3, { width: "9rem", className: "h-6 rounded-full" })
63866
64123
  ] });
63867
- var WorkflowRailSkeleton = ({
63868
- rows = 6
63869
- }) => /* @__PURE__ */ jsxs182("div", { className: "animate-pulse motion-reduce:animate-none", children: [
63870
- /* @__PURE__ */ jsxs182("div", { className: "border-b border-neutral-200 px-5 pb-4 pt-5 dark:border-neutral-800", children: [
63871
- /* @__PURE__ */ jsxs182("div", { className: "flex items-center justify-between", children: [
63872
- /* @__PURE__ */ jsx299(Bar3, { width: "4.5rem" }),
63873
- /* @__PURE__ */ jsx299(Bar3, { width: "2rem" })
63874
- ] }),
63875
- /* @__PURE__ */ jsx299("span", { className: "mt-3 block h-1 w-full rounded-full bg-neutral-200 dark:bg-neutral-800" }),
63876
- /* @__PURE__ */ jsx299(Bar3, { width: "80%", className: "mt-3" })
63877
- ] }),
63878
- /* @__PURE__ */ jsx299("div", { className: "space-y-5 px-5 py-5", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ jsxs182("div", { className: "flex items-start gap-3", children: [
63879
- /* @__PURE__ */ jsx299(Dot, {}),
63880
- /* @__PURE__ */ jsxs182("div", { className: "flex-1 space-y-2", children: [
63881
- /* @__PURE__ */ jsx299(Bar3, { width: index % 2 === 0 ? "62%" : "48%" }),
63882
- /* @__PURE__ */ jsx299(Bar3, { width: "34%", className: "h-2" })
63883
- ] })
63884
- ] }, index)) })
63885
- ] });
64124
+ var WorkflowRailSkeleton = ({ rows = 6, collapsed = false }) => /* @__PURE__ */ jsxs182(
64125
+ "div",
64126
+ {
64127
+ className: "min-h-0 overflow-hidden animate-pulse motion-reduce:animate-none",
64128
+ "aria-hidden": "true",
64129
+ children: [
64130
+ !collapsed && /* @__PURE__ */ jsxs182("div", { className: "border-b border-neutral-200 px-5 pb-4 pt-5 dark:border-neutral-800", children: [
64131
+ /* @__PURE__ */ jsxs182("div", { className: "flex items-center justify-between", children: [
64132
+ /* @__PURE__ */ jsx299(Bar3, { width: "4.5rem" }),
64133
+ /* @__PURE__ */ jsx299(Bar3, { width: "2rem" })
64134
+ ] }),
64135
+ /* @__PURE__ */ jsx299("span", { className: "mt-3 block h-1 w-full rounded-full bg-neutral-200 dark:bg-neutral-800" }),
64136
+ /* @__PURE__ */ jsx299(Bar3, { width: "80%", className: "mt-3" })
64137
+ ] }),
64138
+ /* @__PURE__ */ jsx299("div", { className: collapsed ? "space-y-6 px-2 py-6" : "space-y-5 px-5 py-5", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ jsxs182(
64139
+ "div",
64140
+ {
64141
+ className: collapsed ? "flex justify-center" : "flex items-start gap-3",
64142
+ children: [
64143
+ /* @__PURE__ */ jsx299(Dot, {}),
64144
+ !collapsed && /* @__PURE__ */ jsxs182("div", { className: "flex-1 space-y-2", children: [
64145
+ /* @__PURE__ */ jsx299(Bar3, { width: index % 2 === 0 ? "62%" : "48%" }),
64146
+ /* @__PURE__ */ jsx299(Bar3, { width: "34%", className: "h-2" })
64147
+ ] })
64148
+ ]
64149
+ },
64150
+ index
64151
+ )) })
64152
+ ]
64153
+ }
64154
+ );
63886
64155
  var WorkflowDetailSkeleton = () => /* @__PURE__ */ jsxs182("div", { className: "animate-pulse motion-reduce:animate-none", children: [
63887
64156
  /* @__PURE__ */ jsxs182("div", { className: "space-y-4 px-5 pb-6 pt-5 sm:px-6", children: [
63888
64157
  /* @__PURE__ */ jsxs182("div", { className: "flex items-center justify-between", children: [
@@ -64108,7 +64377,12 @@ var WorkflowStatusNode = ({
64108
64377
  tokens.glyph === "check" && /* @__PURE__ */ jsx300(Check, { className: classNames110(glyph, tokens.glyphClass) }),
64109
64378
  tokens.glyph === "pause" && /* @__PURE__ */ jsx300(Pause, { className: classNames110(glyph, tokens.glyphClass) }),
64110
64379
  tokens.glyph === "alert" && /* @__PURE__ */ jsx300(AlertGlyph, { className: classNames110(glyph, tokens.glyphClass) }),
64111
- tokens.glyph === "dashed" && /* @__PURE__ */ jsx300(DashedRing, { className: classNames110("h-full w-full", tokens.glyphClass) })
64380
+ tokens.glyph === "dashed" && /* @__PURE__ */ jsx300(
64381
+ DashedRing,
64382
+ {
64383
+ className: classNames110("h-full w-full", tokens.glyphClass)
64384
+ }
64385
+ )
64112
64386
  ]
64113
64387
  }
64114
64388
  )
@@ -64266,14 +64540,7 @@ var NestedSubSteps = ({
64266
64540
  const status = normalizeStatus(subStep.status);
64267
64541
  const isActive = status === "running" || status === "in_progress";
64268
64542
  const content = /* @__PURE__ */ jsxs185(Fragment47, { children: [
64269
- /* @__PURE__ */ jsx303(
64270
- WorkflowStatusNode_default,
64271
- {
64272
- status,
64273
- palette,
64274
- size: "sm"
64275
- }
64276
- ),
64543
+ /* @__PURE__ */ jsx303(WorkflowStatusNode_default, { status, palette, size: "sm" }),
64277
64544
  /* @__PURE__ */ jsx303(
64278
64545
  "span",
64279
64546
  {
@@ -64298,6 +64565,12 @@ var NestedSubSteps = ({
64298
64565
  }
64299
64566
  );
64300
64567
  var WorkflowTimeline = ({
64568
+ controls,
64569
+ hasCollapseToggle = false,
64570
+ renderStepPopover,
64571
+ stepPopoverProps,
64572
+ collapsed = false,
64573
+ fillHeight = false,
64301
64574
  steps,
64302
64575
  activeStepId,
64303
64576
  palette,
@@ -64313,9 +64586,6 @@ var WorkflowTimeline = ({
64313
64586
  onSubStepSelect,
64314
64587
  onStepAction
64315
64588
  }) => {
64316
- if (loading) {
64317
- return /* @__PURE__ */ jsx303(WorkflowRailSkeleton, { rows: loadingRows });
64318
- }
64319
64589
  const isEmpty2 = steps.length === 0;
64320
64590
  const tallyEntries = [
64321
64591
  { count: tallies.done, label: labels.done },
@@ -64323,168 +64593,309 @@ var WorkflowTimeline = ({
64323
64593
  { count: tallies.flagged, label: labels.flagged },
64324
64594
  { count: tallies.remaining, label: labels.remaining }
64325
64595
  ].filter((entry) => entry.count > 0);
64326
- return /* @__PURE__ */ jsxs185("div", { className: "flex flex-col", children: [
64327
- !isEmpty2 && /* @__PURE__ */ jsxs185("div", { className: classNames113("border-b px-5 pb-4 pt-5", surfaces.border), children: [
64328
- /* @__PURE__ */ jsxs185("div", { className: "flex items-baseline justify-between gap-3", children: [
64329
- /* @__PURE__ */ jsx303(SectionTitle, { surfaces, children: labels.progress }),
64330
- /* @__PURE__ */ jsxs185("span", { className: "text-sm font-semibold text-neutral-900 dark:text-white", children: [
64331
- progress,
64332
- "%"
64333
- ] })
64334
- ] }),
64335
- /* @__PURE__ */ jsx303(
64336
- Progress_default,
64337
- {
64338
- className: classNames113(
64339
- "mt-2",
64340
- surfaces.translucent ? "bg-white/40 dark:bg-white/15" : "bg-neutral-200 dark:bg-neutral-700"
64341
- ),
64342
- value: progress,
64343
- size: "xs",
64344
- color: palette.accent,
64345
- motion: "none"
64346
- }
64347
- ),
64348
- tallyEntries.length > 0 && /* @__PURE__ */ jsx303("div", { className: "mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs", children: tallyEntries.map((entry, index) => /* @__PURE__ */ jsxs185(React89.Fragment, { children: [
64349
- index > 0 && /* @__PURE__ */ jsx303(
64350
- "span",
64596
+ return /* @__PURE__ */ jsxs185(
64597
+ "div",
64598
+ {
64599
+ className: classNames113("flex flex-col", fillHeight && "min-h-0 flex-1"),
64600
+ children: [
64601
+ !loading && !isEmpty2 && collapsed && /* @__PURE__ */ jsx303(
64602
+ "div",
64351
64603
  {
64352
- "aria-hidden": "true",
64353
- className: "text-neutral-300 dark:text-neutral-600",
64354
- children: "\xB7"
64604
+ className: classNames113(
64605
+ "mx-2 flex shrink-0 justify-center border-b pb-3 pt-1",
64606
+ surfaces.border
64607
+ ),
64608
+ children: /* @__PURE__ */ jsxs185(
64609
+ "span",
64610
+ {
64611
+ role: "progressbar",
64612
+ "aria-label": labels.progress,
64613
+ "aria-valuemin": 0,
64614
+ "aria-valuemax": 100,
64615
+ "aria-valuenow": progress,
64616
+ "aria-valuetext": `${progress}%`,
64617
+ className: `rounded px-1 py-0.5 text-[10px] font-semibold tabular-nums bg-${palette.accent}-100 text-${palette.accent}-700 dark:bg-${palette.accent}-900 dark:text-${palette.accent}-200`,
64618
+ children: [
64619
+ progress,
64620
+ "%"
64621
+ ]
64622
+ }
64623
+ )
64355
64624
  }
64356
64625
  ),
64357
- /* @__PURE__ */ jsx303(
64358
- Tally,
64626
+ !loading && !isEmpty2 && !collapsed && /* @__PURE__ */ jsxs185(
64627
+ "div",
64359
64628
  {
64360
- count: entry.count,
64361
- label: entry.label,
64362
- surfaces
64629
+ className: classNames113(
64630
+ "shrink-0 border-b px-5 pb-4 pt-5",
64631
+ hasCollapseToggle && "pr-14",
64632
+ surfaces.border
64633
+ ),
64634
+ children: [
64635
+ /* @__PURE__ */ jsxs185("div", { className: "flex items-baseline justify-between gap-3", children: [
64636
+ /* @__PURE__ */ jsx303(SectionTitle, { surfaces, children: labels.progress }),
64637
+ /* @__PURE__ */ jsxs185("span", { className: "text-sm font-semibold text-neutral-900 dark:text-white", children: [
64638
+ progress,
64639
+ "%"
64640
+ ] })
64641
+ ] }),
64642
+ /* @__PURE__ */ jsx303(
64643
+ Progress_default,
64644
+ {
64645
+ className: classNames113(
64646
+ "mt-2",
64647
+ surfaces.translucent ? "bg-white/40 dark:bg-white/15" : "bg-neutral-200 dark:bg-neutral-700"
64648
+ ),
64649
+ value: progress,
64650
+ size: "xs",
64651
+ color: palette.accent,
64652
+ motion: "none"
64653
+ }
64654
+ ),
64655
+ tallyEntries.length > 0 && /* @__PURE__ */ jsx303("div", { className: "mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs", children: tallyEntries.map((entry, index) => /* @__PURE__ */ jsxs185(React90.Fragment, { children: [
64656
+ index > 0 && /* @__PURE__ */ jsx303(
64657
+ "span",
64658
+ {
64659
+ "aria-hidden": "true",
64660
+ className: "text-neutral-300 dark:text-neutral-600",
64661
+ children: "\xB7"
64662
+ }
64663
+ ),
64664
+ /* @__PURE__ */ jsx303(
64665
+ Tally,
64666
+ {
64667
+ count: entry.count,
64668
+ label: entry.label,
64669
+ surfaces
64670
+ }
64671
+ )
64672
+ ] }, entry.label)) })
64673
+ ]
64363
64674
  }
64364
- )
64365
- ] }, entry.label)) })
64366
- ] }),
64367
- /* @__PURE__ */ jsx303("div", { className: classNames113(isEmpty2 ? "" : "px-5 py-5"), children: isEmpty2 ? emptyState ?? /* @__PURE__ */ jsx303(
64368
- WorkflowPlaceholder,
64369
- {
64370
- title: labels.empty,
64371
- subtitle: labels.emptySubtitle,
64372
- palette,
64373
- surfaces
64374
- }
64375
- ) : /* @__PURE__ */ jsx303("ol", { className: "m-0 list-none p-0", children: steps.map((step, index) => {
64376
- const status = normalizeStatus(step.status);
64377
- const tokens = getStatusTokens(status, palette);
64378
- const isActive = step.id === activeStepId;
64379
- const isLast = index === steps.length - 1;
64380
- const nested = isActive && step.subSteps && step.subSteps.length > 0 ? step.subSteps : void 0;
64381
- const rowContent = /* @__PURE__ */ jsxs185(Fragment47, { children: [
64382
- /* @__PURE__ */ jsx303(
64383
- WorkflowStatusNode_default,
64675
+ ),
64676
+ /* @__PURE__ */ jsxs185(
64677
+ ScrollArea_default,
64384
64678
  {
64385
- status,
64386
- palette,
64387
- className: "mt-0.5"
64679
+ variant: "hover",
64680
+ className: fillHeight ? "min-h-0 flex-1" : void 0,
64681
+ contentClassName: classNames113(
64682
+ !loading && !isEmpty2 && (collapsed ? "px-2 py-4" : "px-5 py-5")
64683
+ ),
64684
+ children: [
64685
+ loading ? /* @__PURE__ */ jsx303(WorkflowRailSkeleton, { rows: loadingRows, collapsed }) : isEmpty2 ? collapsed ? /* @__PURE__ */ jsx303("span", { className: "sr-only", children: labels.empty }) : emptyState ?? /* @__PURE__ */ jsx303(
64686
+ WorkflowPlaceholder,
64687
+ {
64688
+ title: labels.empty,
64689
+ subtitle: labels.emptySubtitle,
64690
+ palette,
64691
+ surfaces
64692
+ }
64693
+ ) : /* @__PURE__ */ jsx303("ol", { className: "m-0 list-none p-0", children: steps.map((step, index) => {
64694
+ const status = normalizeStatus(step.status);
64695
+ const tokens = getStatusTokens(status, palette);
64696
+ const isActive = step.id === activeStepId;
64697
+ const isLast = index === steps.length - 1;
64698
+ const nested = isActive && step.subSteps && step.subSteps.length > 0 ? step.subSteps : void 0;
64699
+ const rowContent = /* @__PURE__ */ jsxs185(Fragment47, { children: [
64700
+ /* @__PURE__ */ jsx303(
64701
+ WorkflowStatusNode_default,
64702
+ {
64703
+ status,
64704
+ palette,
64705
+ className: collapsed ? void 0 : "mt-0.5"
64706
+ }
64707
+ ),
64708
+ collapsed && /* @__PURE__ */ jsxs185("span", { className: "sr-only", children: [
64709
+ step.label,
64710
+ " \u2014 ",
64711
+ labels.statuses[status]
64712
+ ] }),
64713
+ /* @__PURE__ */ jsxs185(
64714
+ "div",
64715
+ {
64716
+ "aria-hidden": collapsed || void 0,
64717
+ className: classNames113(
64718
+ "min-w-0 transition-opacity duration-200 motion-reduce:transition-none",
64719
+ collapsed ? "invisible absolute w-0 overflow-hidden opacity-0" : "flex-1 opacity-100"
64720
+ ),
64721
+ children: [
64722
+ /* @__PURE__ */ jsxs185("div", { className: "flex flex-wrap items-center gap-2", children: [
64723
+ /* @__PURE__ */ jsx303(
64724
+ "span",
64725
+ {
64726
+ className: classNames113(
64727
+ "text-sm",
64728
+ isActive ? "font-semibold text-neutral-900 dark:text-white" : "font-medium text-neutral-700 dark:text-neutral-200"
64729
+ ),
64730
+ children: step.label
64731
+ }
64732
+ ),
64733
+ step.badge && /* @__PURE__ */ jsx303(
64734
+ WorkflowBadge,
64735
+ {
64736
+ status,
64737
+ palette,
64738
+ tone: step.badgeTone,
64739
+ children: step.badge
64740
+ }
64741
+ )
64742
+ ] }),
64743
+ step.meta && /* @__PURE__ */ jsx303(
64744
+ "p",
64745
+ {
64746
+ className: classNames113(
64747
+ "mt-1 text-xs leading-5",
64748
+ surfaces.mutedText
64749
+ ),
64750
+ children: step.meta
64751
+ }
64752
+ )
64753
+ ]
64754
+ }
64755
+ )
64756
+ ] });
64757
+ const popupContent = collapsed ? renderStepPopover?.(step) : void 0;
64758
+ const row = onStepSelect ? /* @__PURE__ */ jsx303(
64759
+ "button",
64760
+ {
64761
+ type: "button",
64762
+ onClick: () => onStepSelect(step.id),
64763
+ className: classNames113(
64764
+ "relative flex text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 dark:focus-visible:ring-neutral-500",
64765
+ collapsed ? "h-9 w-9 items-center justify-center rounded-xl" : "w-full items-start gap-3 rounded-sm",
64766
+ collapsed && isActive && "bg-neutral-200 dark:bg-neutral-700"
64767
+ ),
64768
+ children: rowContent
64769
+ }
64770
+ ) : /* @__PURE__ */ jsx303(
64771
+ "div",
64772
+ {
64773
+ tabIndex: collapsed ? 0 : void 0,
64774
+ className: classNames113(
64775
+ "relative flex focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400",
64776
+ collapsed ? "h-9 w-9 items-center justify-center rounded-xl" : "w-full items-start gap-3 rounded-sm",
64777
+ collapsed && isActive && "bg-neutral-200 dark:bg-neutral-700"
64778
+ ),
64779
+ children: rowContent
64780
+ }
64781
+ );
64782
+ return /* @__PURE__ */ jsxs185(
64783
+ "li",
64784
+ {
64785
+ className: classNames113(
64786
+ "relative",
64787
+ !isLast && (collapsed ? "pb-2" : "pb-5")
64788
+ ),
64789
+ "aria-current": isActive ? "step" : void 0,
64790
+ children: [
64791
+ collapsed && isActive && /* @__PURE__ */ jsx303(
64792
+ "span",
64793
+ {
64794
+ "aria-hidden": "true",
64795
+ className: `absolute -left-2 top-1.5 h-6 w-1 rounded-r-full bg-${palette.accent}-600`
64796
+ }
64797
+ ),
64798
+ !isLast && /* @__PURE__ */ jsx303(
64799
+ "span",
64800
+ {
64801
+ "aria-hidden": "true",
64802
+ className: classNames113(
64803
+ "absolute bottom-0",
64804
+ tokens.connectorDashed ? `border-l-2 border-dashed ${tokens.connector}` : `w-0.5 rounded-full ${tokens.connector}`
64805
+ ),
64806
+ style: {
64807
+ left: collapsed ? "calc(50% - 1px)" : CONNECTOR_LEFT,
64808
+ top: collapsed ? 32 : CONNECTOR_TOP
64809
+ }
64810
+ }
64811
+ ),
64812
+ /* @__PURE__ */ jsx303(
64813
+ "div",
64814
+ {
64815
+ className: collapsed ? "flex justify-center" : void 0,
64816
+ children: popupContent != null && popupContent !== false ? /* @__PURE__ */ jsx303(
64817
+ Popover_default,
64818
+ {
64819
+ ...stepPopoverProps,
64820
+ placement: stepPopoverProps?.placement ?? "right",
64821
+ triggerMode: "hover",
64822
+ closeOnTriggerClick: Boolean(onStepSelect),
64823
+ trigger: row,
64824
+ children: popupContent
64825
+ }
64826
+ ) : /* @__PURE__ */ jsx303(
64827
+ TooltipWrapper_default,
64828
+ {
64829
+ position: "right",
64830
+ text: collapsed ? `${typeof step.label === "string" || typeof step.label === "number" ? step.label : `${labels.step} ${index + 1}`} \u2014 ${labels.statuses[status]}` : void 0,
64831
+ children: row
64832
+ }
64833
+ )
64834
+ }
64835
+ ),
64836
+ !collapsed && /* @__PURE__ */ jsx303(
64837
+ WorkflowQuickActions_default,
64838
+ {
64839
+ stepId: step.id,
64840
+ actions: step.actions ?? [],
64841
+ palette,
64842
+ groupLabel: labels.quickActions,
64843
+ onAction: onStepAction,
64844
+ className: "ml-8 mt-2"
64845
+ }
64846
+ ),
64847
+ !collapsed && nested && /* @__PURE__ */ jsx303(
64848
+ NestedSubSteps,
64849
+ {
64850
+ stepId: step.id,
64851
+ subSteps: nested,
64852
+ palette,
64853
+ surfaces,
64854
+ onSubStepSelect
64855
+ }
64856
+ )
64857
+ ]
64858
+ },
64859
+ step.id
64860
+ );
64861
+ }) }),
64862
+ controls != null && controls !== false && /* @__PURE__ */ jsx303(
64863
+ "div",
64864
+ {
64865
+ className: classNames113(
64866
+ "mt-4 border-t pt-4",
64867
+ surfaces.border,
64868
+ (loading || isEmpty2) && (collapsed ? "px-2 pb-4" : "px-5 pb-5")
64869
+ ),
64870
+ children: controls
64871
+ }
64872
+ )
64873
+ ]
64388
64874
  }
64389
64875
  ),
64390
- /* @__PURE__ */ jsxs185("div", { className: "min-w-0 flex-1", children: [
64391
- /* @__PURE__ */ jsxs185("div", { className: "flex flex-wrap items-center gap-2", children: [
64392
- /* @__PURE__ */ jsx303(
64393
- "span",
64394
- {
64395
- className: classNames113(
64396
- "text-sm",
64397
- isActive ? "font-semibold text-neutral-900 dark:text-white" : "font-medium text-neutral-700 dark:text-neutral-200"
64398
- ),
64399
- children: step.label
64400
- }
64876
+ showLegend && !isEmpty2 && !collapsed && /* @__PURE__ */ jsx303(
64877
+ "div",
64878
+ {
64879
+ className: classNames113(
64880
+ "mt-auto shrink-0 border-t px-5 py-4",
64881
+ surfaces.border
64401
64882
  ),
64402
- step.badge && /* @__PURE__ */ jsx303(
64403
- WorkflowBadge,
64404
- {
64405
- status,
64406
- palette,
64407
- tone: step.badgeTone,
64408
- children: step.badge
64409
- }
64410
- )
64411
- ] }),
64412
- step.meta && /* @__PURE__ */ jsx303(
64413
- "p",
64414
- {
64415
- className: classNames113(
64416
- "mt-1 text-xs leading-5",
64417
- surfaces.mutedText
64883
+ children: /* @__PURE__ */ jsx303("ul", { className: "flex flex-wrap gap-x-4 gap-y-2", children: LEGEND_ORDER.map((status) => /* @__PURE__ */ jsxs185("li", { className: "flex items-center gap-2", children: [
64884
+ /* @__PURE__ */ jsx303(
64885
+ WorkflowStatusNode_default,
64886
+ {
64887
+ status,
64888
+ palette,
64889
+ size: "sm"
64890
+ }
64418
64891
  ),
64419
- children: step.meta
64420
- }
64421
- )
64422
- ] })
64423
- ] });
64424
- return /* @__PURE__ */ jsxs185(
64425
- "li",
64426
- {
64427
- className: classNames113("relative", !isLast && "pb-5"),
64428
- "aria-current": isActive ? "step" : void 0,
64429
- children: [
64430
- !isLast && /* @__PURE__ */ jsx303(
64431
- "span",
64432
- {
64433
- "aria-hidden": "true",
64434
- className: classNames113(
64435
- "absolute bottom-0",
64436
- tokens.connectorDashed ? `border-l-2 border-dashed ${tokens.connector}` : `w-0.5 rounded-full ${tokens.connector}`
64437
- ),
64438
- style: { left: CONNECTOR_LEFT, top: CONNECTOR_TOP }
64439
- }
64440
- ),
64441
- onStepSelect ? /* @__PURE__ */ jsx303(
64442
- "button",
64443
- {
64444
- type: "button",
64445
- onClick: () => onStepSelect(step.id),
64446
- className: "flex w-full items-start gap-3 rounded-sm text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 dark:focus-visible:ring-neutral-500",
64447
- children: rowContent
64448
- }
64449
- ) : /* @__PURE__ */ jsx303("div", { className: "flex items-start gap-3", children: rowContent }),
64450
- /* @__PURE__ */ jsx303(
64451
- WorkflowQuickActions_default,
64452
- {
64453
- stepId: step.id,
64454
- actions: step.actions ?? [],
64455
- palette,
64456
- groupLabel: labels.quickActions,
64457
- onAction: onStepAction,
64458
- className: "ml-8 mt-2"
64459
- }
64460
- ),
64461
- nested && /* @__PURE__ */ jsx303(
64462
- NestedSubSteps,
64463
- {
64464
- stepId: step.id,
64465
- subSteps: nested,
64466
- palette,
64467
- surfaces,
64468
- onSubStepSelect
64469
- }
64470
- )
64471
- ]
64472
- },
64473
- step.id
64474
- );
64475
- }) }) }),
64476
- showLegend && !isEmpty2 && /* @__PURE__ */ jsx303("div", { className: classNames113("mt-auto border-t px-5 py-4", surfaces.border), children: /* @__PURE__ */ jsx303("ul", { className: "flex flex-wrap gap-x-4 gap-y-2", children: LEGEND_ORDER.map((status) => /* @__PURE__ */ jsxs185("li", { className: "flex items-center gap-2", children: [
64477
- /* @__PURE__ */ jsx303(
64478
- WorkflowStatusNode_default,
64479
- {
64480
- status,
64481
- palette,
64482
- size: "sm"
64483
- }
64484
- ),
64485
- /* @__PURE__ */ jsx303("span", { className: classNames113("text-xs", surfaces.mutedText), children: labels.statuses[status] })
64486
- ] }, status)) }) })
64487
- ] });
64892
+ /* @__PURE__ */ jsx303("span", { className: classNames113("text-xs", surfaces.mutedText), children: labels.statuses[status] })
64893
+ ] }, status)) })
64894
+ }
64895
+ )
64896
+ ]
64897
+ }
64898
+ );
64488
64899
  };
64489
64900
  var WorkflowTimeline_default = WorkflowTimeline;
64490
64901
 
@@ -64833,8 +65244,18 @@ var sampleWorkflow = {
64833
65244
  };
64834
65245
 
64835
65246
  // src/components/WorkflowTracker/WorkflowTrackerRail.tsx
64836
- import { jsx as jsx305 } from "react/jsx-runtime";
65247
+ import { jsx as jsx305, jsxs as jsxs187 } from "react/jsx-runtime";
64837
65248
  var WorkflowTrackerRail = ({
65249
+ collapsible = false,
65250
+ collapsed,
65251
+ defaultCollapsed = false,
65252
+ onCollapsedChange,
65253
+ fillHeight = false,
65254
+ expandLabel = "Expand workflow rail",
65255
+ collapseLabel = "Collapse workflow rail",
65256
+ renderStepPopover,
65257
+ renderControls,
65258
+ stepPopoverProps,
64838
65259
  data = sampleWorkflow,
64839
65260
  loading = false,
64840
65261
  loadingRows = 6,
@@ -64850,6 +65271,10 @@ var WorkflowTrackerRail = ({
64850
65271
  style,
64851
65272
  ...styleProps
64852
65273
  }) => {
65274
+ const [internalCollapsed, setInternalCollapsed] = useState82(defaultCollapsed);
65275
+ const isCollapsed = collapsible && (collapsed ?? internalCollapsed);
65276
+ const timelineId = useId44();
65277
+ const scrollBody = fillHeight || (cardScrollable ?? false);
64853
65278
  const steps = data?.steps ?? [];
64854
65279
  const { palette, surfaces } = useWorkflowChrome(styleProps);
64855
65280
  const labels = useMemo53(() => resolveLabels(labelOverrides), [labelOverrides]);
@@ -64860,32 +65285,105 @@ var WorkflowTrackerRail = ({
64860
65285
  );
64861
65286
  const progress = useMemo53(() => computeProgress(steps), [steps]);
64862
65287
  const tallies = useMemo53(() => computeTallies(steps), [steps]);
64863
- return /* @__PURE__ */ jsx305(
65288
+ return /* @__PURE__ */ jsxs187(
64864
65289
  Panel_default,
64865
65290
  {
64866
65291
  ...cardProps,
64867
- scrollable: cardScrollable ?? false,
64868
- className: classNames114(className, cardClassName),
64869
- style,
64870
- children: /* @__PURE__ */ jsx305(
64871
- WorkflowTimeline_default,
64872
- {
64873
- steps,
64874
- activeStepId: active?.step.id,
64875
- palette,
64876
- surfaces,
64877
- labels,
64878
- progress,
64879
- tallies,
64880
- showLegend: showLegend && !loading,
64881
- loading,
64882
- loadingRows,
64883
- emptyState,
64884
- onStepSelect,
64885
- onSubStepSelect,
64886
- onStepAction
64887
- }
64888
- )
65292
+ padding: isCollapsed ? "none" : cardProps.padding,
65293
+ scrollable: false,
65294
+ flexBody: scrollBody,
65295
+ className: classNames114(
65296
+ collapsible && "max-w-full shrink-0 transition-[width] duration-200 ease-in-out motion-reduce:transition-none",
65297
+ fillHeight && "h-full min-h-0 self-stretch",
65298
+ className,
65299
+ cardClassName
65300
+ ),
65301
+ style: collapsible ? { ...style, width: isCollapsed ? 56 : style?.width ?? 360 } : style,
65302
+ "aria-busy": loading || void 0,
65303
+ "data-collapsed": collapsible ? isCollapsed : void 0,
65304
+ children: [
65305
+ collapsible && /* @__PURE__ */ jsx305(
65306
+ "div",
65307
+ {
65308
+ className: classNames114(
65309
+ "absolute z-20 flex",
65310
+ isCollapsed ? "inset-x-0 top-2 justify-center" : "right-4 top-4"
65311
+ ),
65312
+ children: /* @__PURE__ */ jsx305(
65313
+ IconButton_default,
65314
+ {
65315
+ icon: /* @__PURE__ */ jsx305(
65316
+ ChevronRight,
65317
+ {
65318
+ className: classNames114(
65319
+ "transition-transform duration-200 motion-reduce:transition-none",
65320
+ !isCollapsed && "rotate-180"
65321
+ )
65322
+ }
65323
+ ),
65324
+ size: "xs",
65325
+ rounded: "md",
65326
+ variant: SURFACE_TO_BUTTON_VARIANT[cardProps.variant ?? "outlined"],
65327
+ color: styleProps.cardTone ?? "neutral",
65328
+ glassOpacity: styleProps.glassOpacity,
65329
+ vibrancy: styleProps.vibrancy,
65330
+ specularMode: styleProps.specularMode,
65331
+ srLabel: isCollapsed ? expandLabel : collapseLabel,
65332
+ tooltip: isCollapsed ? expandLabel : collapseLabel,
65333
+ tooltipPosition: "right",
65334
+ "aria-expanded": !isCollapsed,
65335
+ "aria-controls": timelineId,
65336
+ onClick: () => {
65337
+ const next = !isCollapsed;
65338
+ if (collapsed === void 0) setInternalCollapsed(next);
65339
+ onCollapsedChange?.(next);
65340
+ }
65341
+ }
65342
+ )
65343
+ }
65344
+ ),
65345
+ collapsible && (isCollapsed || loading || steps.length === 0) && /* @__PURE__ */ jsx305("div", { className: "h-10 shrink-0" }),
65346
+ /* @__PURE__ */ jsx305(
65347
+ "div",
65348
+ {
65349
+ id: timelineId,
65350
+ className: scrollBody ? "flex min-h-0 flex-1 flex-col" : void 0,
65351
+ children: /* @__PURE__ */ jsx305(
65352
+ WorkflowTimeline_default,
65353
+ {
65354
+ controls: renderControls?.({ collapsed: isCollapsed }),
65355
+ collapsed: isCollapsed,
65356
+ hasCollapseToggle: collapsible,
65357
+ renderStepPopover,
65358
+ stepPopoverProps: {
65359
+ variant: cardProps.variant,
65360
+ tone: cardProps.tone,
65361
+ corner: cardProps.corner,
65362
+ glassOpacity: cardProps.glassOpacity,
65363
+ vibrancy: cardProps.vibrancy,
65364
+ specularMode: cardProps.specularMode,
65365
+ ...stepPopoverProps
65366
+ },
65367
+ fillHeight: scrollBody,
65368
+ steps,
65369
+ activeStepId: active?.step.id,
65370
+ palette,
65371
+ surfaces,
65372
+ labels,
65373
+ progress,
65374
+ tallies,
65375
+ showLegend: showLegend && !loading,
65376
+ loading,
65377
+ loadingRows,
65378
+ emptyState,
65379
+ onStepSelect,
65380
+ onSubStepSelect,
65381
+ onStepAction
65382
+ }
65383
+ )
65384
+ }
65385
+ )
65386
+ ]
64889
65387
  }
64890
65388
  );
64891
65389
  };
@@ -64897,7 +65395,7 @@ import classNames116 from "classnames";
64897
65395
 
64898
65396
  // src/components/WorkflowTracker/WorkflowDetailPanel.tsx
64899
65397
  import classNames115 from "classnames";
64900
- import { Fragment as Fragment48, jsx as jsx306, jsxs as jsxs187 } from "react/jsx-runtime";
65398
+ import { Fragment as Fragment48, jsx as jsx306, jsxs as jsxs188 } from "react/jsx-runtime";
64901
65399
  var WorkflowDetailPanel = ({
64902
65400
  active,
64903
65401
  totalSteps,
@@ -64930,11 +65428,11 @@ var WorkflowDetailPanel = ({
64930
65428
  step.startedAt ? { label: labels.started, value: step.startedAt } : void 0,
64931
65429
  step.sla ? { label: labels.sla, value: step.sla } : void 0
64932
65430
  ].filter(Boolean);
64933
- return /* @__PURE__ */ jsxs187("div", { className: "flex flex-col", children: [
64934
- /* @__PURE__ */ jsxs187("div", { className: "px-5 pb-6 pt-5 sm:px-6", children: [
64935
- /* @__PURE__ */ jsxs187("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [
64936
- /* @__PURE__ */ jsxs187("div", { className: "flex flex-wrap items-center gap-3", children: [
64937
- /* @__PURE__ */ jsxs187(SectionTitle, { surfaces, children: [
65431
+ return /* @__PURE__ */ jsxs188("div", { className: "flex flex-col", children: [
65432
+ /* @__PURE__ */ jsxs188("div", { className: "px-5 pb-6 pt-5 sm:px-6", children: [
65433
+ /* @__PURE__ */ jsxs188("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [
65434
+ /* @__PURE__ */ jsxs188("div", { className: "flex flex-wrap items-center gap-3", children: [
65435
+ /* @__PURE__ */ jsxs188(SectionTitle, { surfaces, children: [
64938
65436
  labels.step,
64939
65437
  " ",
64940
65438
  index,
@@ -64953,8 +65451,8 @@ var WorkflowDetailPanel = ({
64953
65451
  }
64954
65452
  )
64955
65453
  ] }),
64956
- /* @__PURE__ */ jsxs187("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-2", children: [
64957
- step.elapsed && /* @__PURE__ */ jsxs187(SectionMeta, { surfaces, children: [
65454
+ /* @__PURE__ */ jsxs188("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-2", children: [
65455
+ step.elapsed && /* @__PURE__ */ jsxs188(SectionMeta, { surfaces, children: [
64958
65456
  labels.elapsed,
64959
65457
  " ",
64960
65458
  step.elapsed
@@ -64992,8 +65490,8 @@ var WorkflowDetailPanel = ({
64992
65490
  field.label
64993
65491
  )) })
64994
65492
  ] }),
64995
- subSteps.length > 0 && /* @__PURE__ */ jsxs187(Fragment48, { children: [
64996
- /* @__PURE__ */ jsxs187(
65493
+ subSteps.length > 0 && /* @__PURE__ */ jsxs188(Fragment48, { children: [
65494
+ /* @__PURE__ */ jsxs188(
64997
65495
  "div",
64998
65496
  {
64999
65497
  className: classNames115(
@@ -65003,7 +65501,7 @@ var WorkflowDetailPanel = ({
65003
65501
  ),
65004
65502
  children: [
65005
65503
  /* @__PURE__ */ jsx306(SectionTitle, { surfaces, children: labels.subSteps }),
65006
- /* @__PURE__ */ jsxs187(SectionMeta, { surfaces, children: [
65504
+ /* @__PURE__ */ jsxs188(SectionMeta, { surfaces, children: [
65007
65505
  summary.accepted,
65008
65506
  " ",
65009
65507
  labels.accepted,
@@ -65029,9 +65527,9 @@ var WorkflowDetailPanel = ({
65029
65527
  children: subSteps.map((subStep) => {
65030
65528
  const subStatus = normalizeStatus(subStep.status);
65031
65529
  const isRunning = subStatus === "running";
65032
- const rowContent = /* @__PURE__ */ jsxs187(Fragment48, { children: [
65530
+ const rowContent = /* @__PURE__ */ jsxs188(Fragment48, { children: [
65033
65531
  /* @__PURE__ */ jsx306(WorkflowStatusNode_default, { status: subStatus, palette }),
65034
- /* @__PURE__ */ jsxs187("div", { className: "min-w-0 flex-1", children: [
65532
+ /* @__PURE__ */ jsxs188("div", { className: "min-w-0 flex-1", children: [
65035
65533
  /* @__PURE__ */ jsx306("p", { className: "text-sm font-medium text-neutral-800 dark:text-neutral-100", children: subStep.label }),
65036
65534
  subStep.note && /* @__PURE__ */ jsx306(
65037
65535
  "p",
@@ -65156,7 +65654,17 @@ var WorkflowDetailsCard = ({
65156
65654
  flexBody: true,
65157
65655
  className: classNames117("flex-1", className),
65158
65656
  style,
65159
- children: /* @__PURE__ */ jsx308(ScrollArea_default, { className: "h-full", mask: true, role: "region", "aria-label": ariaLabel, children: details })
65657
+ children: /* @__PURE__ */ jsx308(
65658
+ ScrollArea_default,
65659
+ {
65660
+ variant: "hover",
65661
+ className: "h-full",
65662
+ mask: true,
65663
+ role: "region",
65664
+ "aria-label": ariaLabel,
65665
+ children: details
65666
+ }
65667
+ )
65160
65668
  }
65161
65669
  );
65162
65670
  var WorkflowDetailsCard_default = WorkflowDetailsCard;
@@ -65200,15 +65708,15 @@ import classNames120 from "classnames";
65200
65708
 
65201
65709
  // src/components/WorkflowTracker/WorkflowSummaryCard.tsx
65202
65710
  import classNames119 from "classnames";
65203
- import { jsx as jsx310, jsxs as jsxs188 } from "react/jsx-runtime";
65711
+ import { jsx as jsx310, jsxs as jsxs189 } from "react/jsx-runtime";
65204
65712
  var WorkflowSummaryCard = ({
65205
65713
  title,
65206
65714
  steps,
65207
65715
  palette,
65208
65716
  surfaces
65209
- }) => /* @__PURE__ */ jsxs188("div", { className: "px-5 py-4", children: [
65717
+ }) => /* @__PURE__ */ jsxs189("div", { className: "px-5 py-4", children: [
65210
65718
  /* @__PURE__ */ jsx310(SectionTitle, { surfaces, children: title }),
65211
- /* @__PURE__ */ jsx310("ul", { className: "mt-3 space-y-3", children: steps.map((step) => /* @__PURE__ */ jsxs188("li", { className: "flex items-start gap-3", children: [
65719
+ /* @__PURE__ */ jsx310("ul", { className: "mt-3 space-y-3", children: steps.map((step) => /* @__PURE__ */ jsxs189("li", { className: "flex items-start gap-3", children: [
65212
65720
  /* @__PURE__ */ jsx310(
65213
65721
  WorkflowStatusNode_default,
65214
65722
  {
@@ -65217,7 +65725,7 @@ var WorkflowSummaryCard = ({
65217
65725
  className: "mt-0.5"
65218
65726
  }
65219
65727
  ),
65220
- /* @__PURE__ */ jsxs188("div", { className: "min-w-0 flex-1", children: [
65728
+ /* @__PURE__ */ jsxs189("div", { className: "min-w-0 flex-1", children: [
65221
65729
  /* @__PURE__ */ jsx310("p", { className: "text-sm font-medium text-neutral-800 dark:text-neutral-100", children: step.label }),
65222
65730
  step.meta && /* @__PURE__ */ jsx310(
65223
65731
  "p",
@@ -65235,7 +65743,7 @@ var WorkflowSummaryCard = ({
65235
65743
  var WorkflowSummaryCard_default = WorkflowSummaryCard;
65236
65744
 
65237
65745
  // src/components/WorkflowTracker/WorkflowTrackerRollups.tsx
65238
- import { jsx as jsx311, jsxs as jsxs189 } from "react/jsx-runtime";
65746
+ import { jsx as jsx311, jsxs as jsxs190 } from "react/jsx-runtime";
65239
65747
  var WorkflowTrackerRollups = ({
65240
65748
  data = sampleWorkflow,
65241
65749
  loading = false,
@@ -65253,7 +65761,7 @@ var WorkflowTrackerRollups = ({
65253
65761
  if (loading || attentionSteps.length === 0 && skippedSteps.length === 0) {
65254
65762
  return null;
65255
65763
  }
65256
- return /* @__PURE__ */ jsxs189(
65764
+ return /* @__PURE__ */ jsxs190(
65257
65765
  "div",
65258
65766
  {
65259
65767
  className: classNames120("grid grid-cols-1 gap-5 @xl:grid-cols-2", className),
@@ -65284,7 +65792,7 @@ var WorkflowTrackerRollups = ({
65284
65792
  var WorkflowTrackerRollups_default = WorkflowTrackerRollups;
65285
65793
 
65286
65794
  // src/components/WorkflowTracker/WorkflowTracker.tsx
65287
- import { jsx as jsx312, jsxs as jsxs190 } from "react/jsx-runtime";
65795
+ import { jsx as jsx312, jsxs as jsxs191 } from "react/jsx-runtime";
65288
65796
  var WorkflowTracker = ({
65289
65797
  data = sampleWorkflow,
65290
65798
  accentColor = "blue",
@@ -65338,7 +65846,7 @@ var WorkflowTracker = ({
65338
65846
  "--wt-rail-width": typeof railWidth === "number" ? `${railWidth}px` : railWidth,
65339
65847
  "--wt-fill-offset": typeof fillHeightOffset === "number" ? `${fillHeightOffset}px` : fillHeightOffset
65340
65848
  };
65341
- return /* @__PURE__ */ jsxs190(
65849
+ return /* @__PURE__ */ jsxs191(
65342
65850
  "div",
65343
65851
  {
65344
65852
  className: classNames121("@container w-full", className),
@@ -65353,8 +65861,8 @@ var WorkflowTracker = ({
65353
65861
  iconCorner
65354
65862
  }
65355
65863
  ),
65356
- showHeader && !loading && /* @__PURE__ */ jsxs190("header", { className: "mb-5 flex flex-wrap items-start justify-between gap-3", children: [
65357
- /* @__PURE__ */ jsxs190("div", { className: "flex min-w-0 items-center gap-3", children: [
65864
+ showHeader && !loading && /* @__PURE__ */ jsxs191("header", { className: "mb-5 flex flex-wrap items-start justify-between gap-3", children: [
65865
+ /* @__PURE__ */ jsxs191("div", { className: "flex min-w-0 items-center gap-3", children: [
65358
65866
  data?.icon && // `overflow-hidden` plus the shared corner class clips whatever
65359
65867
  // the caller passes, so an <img> needs no rounding of its own.
65360
65868
  /* @__PURE__ */ jsx312(
@@ -65368,7 +65876,7 @@ var WorkflowTracker = ({
65368
65876
  children: data.icon
65369
65877
  }
65370
65878
  ),
65371
- /* @__PURE__ */ jsxs190("div", { className: "min-w-0", children: [
65879
+ /* @__PURE__ */ jsxs191("div", { className: "min-w-0", children: [
65372
65880
  data?.eyebrow && /* @__PURE__ */ jsx312(
65373
65881
  "p",
65374
65882
  {
@@ -65382,7 +65890,7 @@ var WorkflowTracker = ({
65382
65890
  /* @__PURE__ */ jsx312("h2", { className: "mt-1 text-2xl font-semibold tracking-tight text-neutral-900 dark:text-white sm:text-3xl", children: data?.title })
65383
65891
  ] })
65384
65892
  ] }),
65385
- data?.live && /* @__PURE__ */ jsxs190(
65893
+ data?.live && /* @__PURE__ */ jsxs191(
65386
65894
  Pill_default,
65387
65895
  {
65388
65896
  size: "md",
@@ -65405,7 +65913,7 @@ var WorkflowTracker = ({
65405
65913
  }
65406
65914
  )
65407
65915
  ] }),
65408
- /* @__PURE__ */ jsxs190(
65916
+ /* @__PURE__ */ jsxs191(
65409
65917
  "div",
65410
65918
  {
65411
65919
  className: classNames121(
@@ -65433,7 +65941,7 @@ var WorkflowTracker = ({
65433
65941
  onStepAction
65434
65942
  }
65435
65943
  ),
65436
- /* @__PURE__ */ jsxs190(
65944
+ /* @__PURE__ */ jsxs191(
65437
65945
  "div",
65438
65946
  {
65439
65947
  className: classNames121(
@@ -65483,7 +65991,7 @@ var WorkflowTracker = ({
65483
65991
  var WorkflowTracker_default = WorkflowTracker;
65484
65992
 
65485
65993
  // src/components/Gantt/Gantt.tsx
65486
- import { useCallback as useCallback45, useEffect as useEffect73, useMemo as useMemo61, useRef as useRef71, useState as useState82 } from "react";
65994
+ import { useCallback as useCallback45, useEffect as useEffect73, useMemo as useMemo61, useRef as useRef71, useState as useState84 } from "react";
65487
65995
  import { createPortal as createPortal15 } from "react-dom";
65488
65996
  import classNames125 from "classnames";
65489
65997
 
@@ -66832,7 +67340,7 @@ var sampleGantt = {
66832
67340
 
66833
67341
  // src/components/Gantt/GanttScale.tsx
66834
67342
  import classNames122 from "classnames";
66835
- import { jsx as jsx313, jsxs as jsxs191 } from "react/jsx-runtime";
67343
+ import { jsx as jsx313, jsxs as jsxs192 } from "react/jsx-runtime";
66836
67344
  var GanttScale = ({ levels, height }) => {
66837
67345
  if (levels.length === 0) {
66838
67346
  return /* @__PURE__ */ jsx313("div", { style: { height } });
@@ -66843,7 +67351,7 @@ var GanttScale = ({ levels, height }) => {
66843
67351
  {
66844
67352
  className: classNames122("flex w-full", li === 0 ? "shrink-0" : "min-h-0 flex-1"),
66845
67353
  style: li === 0 ? { height: coarseHeight } : void 0,
66846
- children: level.columns.map((col) => /* @__PURE__ */ jsxs191(
67354
+ children: level.columns.map((col) => /* @__PURE__ */ jsxs192(
66847
67355
  "div",
66848
67356
  {
66849
67357
  className: classNames122(
@@ -66875,7 +67383,7 @@ GanttScale.displayName = "GanttScale";
66875
67383
 
66876
67384
  // src/components/Gantt/GanttLinkLayer.tsx
66877
67385
  import { forwardRef as forwardRef162, useRef as useRef69 } from "react";
66878
- import { jsx as jsx314, jsxs as jsxs192 } from "react/jsx-runtime";
67386
+ import { jsx as jsx314, jsxs as jsxs193 } from "react/jsx-runtime";
66879
67387
  var GanttLinkLayer = forwardRef162(
66880
67388
  function GanttLinkLayer2({
66881
67389
  width,
@@ -66911,19 +67419,19 @@ var GanttLinkLayer = forwardRef162(
66911
67419
  const pick = pickFromEvent(e) ?? clicked;
66912
67420
  if (interactive && onDeleteLink) onDeleteLink(pick.link);
66913
67421
  };
66914
- return /* @__PURE__ */ jsxs192(
67422
+ return /* @__PURE__ */ jsxs193(
66915
67423
  "div",
66916
67424
  {
66917
67425
  ref,
66918
67426
  className: "pointer-events-none absolute top-0 z-10",
66919
67427
  style: { left: offsetLeft, width, height },
66920
67428
  children: [
66921
- /* @__PURE__ */ jsxs192("svg", { ref: svgRef, width, height, className: "block overflow-visible", children: [
67429
+ /* @__PURE__ */ jsxs193("svg", { ref: svgRef, width, height, className: "block overflow-visible", children: [
66922
67430
  paths.map((p, i) => {
66923
67431
  const tokens = getGanttLinkTokens(p.color ?? color);
66924
67432
  const sel = selected != null && p.link === selected;
66925
67433
  const nodeR = sel ? 4.5 : 3.5;
66926
- return /* @__PURE__ */ jsxs192(
67434
+ return /* @__PURE__ */ jsxs193(
66927
67435
  "g",
66928
67436
  {
66929
67437
  style: sel ? { filter: `drop-shadow(0 0 3px var(--color-${p.color ?? color}-500))` } : void 0,
@@ -66978,7 +67486,7 @@ var GanttLinkLayer = forwardRef162(
66978
67486
  }),
66979
67487
  rubber && (() => {
66980
67488
  const tokens = getGanttLinkTokens(rubber.color);
66981
- return /* @__PURE__ */ jsxs192("g", { children: [
67489
+ return /* @__PURE__ */ jsxs193("g", { children: [
66982
67490
  /* @__PURE__ */ jsx314(
66983
67491
  "path",
66984
67492
  {
@@ -66998,7 +67506,7 @@ var GanttLinkLayer = forwardRef162(
66998
67506
  ] });
66999
67507
  })()
67000
67508
  ] }),
67001
- canDelete && selMid && /* @__PURE__ */ jsxs192(
67509
+ canDelete && selMid && /* @__PURE__ */ jsxs193(
67002
67510
  "button",
67003
67511
  {
67004
67512
  type: "button",
@@ -67032,7 +67540,7 @@ GanttLinkLayer.displayName = "GanttLinkLayer";
67032
67540
  // src/components/Gantt/GanttBodyRow.tsx
67033
67541
  import { useMemo as useMemo58 } from "react";
67034
67542
  import classNames123 from "classnames";
67035
- import { Fragment as Fragment49, jsx as jsx315, jsxs as jsxs193 } from "react/jsx-runtime";
67543
+ import { Fragment as Fragment49, jsx as jsx315, jsxs as jsxs194 } from "react/jsx-runtime";
67036
67544
  var BAR_HEIGHT = 24;
67037
67545
  var MILESTONE_SIZE = 14;
67038
67546
  var GanttBodyRow = ({
@@ -67103,8 +67611,8 @@ var GanttBodyRow = ({
67103
67611
  dividerClass,
67104
67612
  liveProgress: liveLane
67105
67613
  }
67106
- ) : /* @__PURE__ */ jsxs193(Fragment49, { children: [
67107
- /* @__PURE__ */ jsxs193(
67614
+ ) : /* @__PURE__ */ jsxs194(Fragment49, { children: [
67615
+ /* @__PURE__ */ jsxs194(
67108
67616
  "div",
67109
67617
  {
67110
67618
  className: classNames123(
@@ -67194,8 +67702,8 @@ var LaneHeader = ({ row, columns, leftWidth, color, onCaretClick, dividerClass =
67194
67702
  const laneColor = lane.color ?? color;
67195
67703
  const tokens = getGanttLaneTokens(laneColor);
67196
67704
  const isOpen = lane.open !== false;
67197
- return /* @__PURE__ */ jsxs193(Fragment49, { children: [
67198
- /* @__PURE__ */ jsxs193(
67705
+ return /* @__PURE__ */ jsxs194(Fragment49, { children: [
67706
+ /* @__PURE__ */ jsxs194(
67199
67707
  "div",
67200
67708
  {
67201
67709
  className: classNames123(
@@ -67223,7 +67731,7 @@ var LaneHeader = ({ row, columns, leftWidth, color, onCaretClick, dividerClass =
67223
67731
  dividerClass
67224
67732
  ),
67225
67733
  style: { width: col.width ?? "160px" },
67226
- children: i === 0 ? /* @__PURE__ */ jsxs193(Fragment49, { children: [
67734
+ children: i === 0 ? /* @__PURE__ */ jsxs194(Fragment49, { children: [
67227
67735
  /* @__PURE__ */ jsx315("span", { className: classNames123("truncate text-[13px] font-semibold", tokens.label), children: lane.label }),
67228
67736
  lane.description && /* @__PURE__ */ jsx315("span", { className: "hidden truncate text-[11px] text-neutral-500 dark:text-neutral-400 lg:inline", children: lane.description }),
67229
67737
  row.childCount > 0 && /* @__PURE__ */ jsx315("span", { className: "shrink-0 rounded-full bg-white/70 px-1.5 py-0.5 text-[10px] font-semibold text-neutral-600 dark:bg-white/10 dark:text-neutral-300", children: row.childCount })
@@ -67252,7 +67760,7 @@ var Cell = ({ col, task, depth, isGroup, childCount, first, onCaretClick, render
67252
67760
  width: col.width ?? "160px",
67253
67761
  justifyContent: col.align === "center" ? "center" : col.align === "right" ? "flex-end" : "flex-start"
67254
67762
  },
67255
- children: first ? /* @__PURE__ */ jsxs193(Fragment49, { children: [
67763
+ children: first ? /* @__PURE__ */ jsxs194(Fragment49, { children: [
67256
67764
  /* @__PURE__ */ jsx315("span", { className: "shrink-0", style: { width: depth * 14 + 18 }, children: isGroup && /* @__PURE__ */ jsx315(
67257
67765
  "button",
67258
67766
  {
@@ -67263,11 +67771,11 @@ var Cell = ({ col, task, depth, isGroup, childCount, first, onCaretClick, render
67263
67771
  children: /* @__PURE__ */ jsx315(ChevronRight, { className: classNames123("h-3 w-3 transition-transform", task.open !== false && "rotate-90") })
67264
67772
  }
67265
67773
  ) }),
67266
- isGroup && childCount > 0 ? /* @__PURE__ */ jsxs193("span", { className: "flex min-w-0 items-center gap-1 font-semibold text-neutral-800 dark:text-neutral-100", children: [
67774
+ isGroup && childCount > 0 ? /* @__PURE__ */ jsxs194("span", { className: "flex min-w-0 items-center gap-1 font-semibold text-neutral-800 dark:text-neutral-100", children: [
67267
67775
  /* @__PURE__ */ jsx315("span", { className: "truncate", children: task.name }),
67268
67776
  /* @__PURE__ */ jsx315("span", { className: "shrink-0 rounded-full bg-neutral-100 px-1 text-[10px] font-semibold text-neutral-500 dark:bg-white/10 dark:text-neutral-400", children: childCount })
67269
67777
  ] }) : /* @__PURE__ */ jsx315("span", { className: "truncate font-medium text-neutral-700 dark:text-neutral-300", children: task.name })
67270
- ] }) : col.kind === "owner" ? value != null ? /* @__PURE__ */ jsxs193("span", { className: "flex min-w-0 items-center gap-1.5 text-neutral-600 dark:text-neutral-400", children: [
67778
+ ] }) : col.kind === "owner" ? value != null ? /* @__PURE__ */ jsxs194("span", { className: "flex min-w-0 items-center gap-1.5 text-neutral-600 dark:text-neutral-400", children: [
67271
67779
  /* @__PURE__ */ jsx315(
67272
67780
  "span",
67273
67781
  {
@@ -67293,9 +67801,9 @@ var Cell = ({ col, task, depth, isGroup, childCount, first, onCaretClick, render
67293
67801
  }
67294
67802
  );
67295
67803
  };
67296
- var ProgressCell = ({ value, barClass = "bg-emerald-500" }) => /* @__PURE__ */ jsxs193("span", { className: "flex w-full items-center gap-1.5", children: [
67804
+ var ProgressCell = ({ value, barClass = "bg-emerald-500" }) => /* @__PURE__ */ jsxs194("span", { className: "flex w-full items-center gap-1.5", children: [
67297
67805
  /* @__PURE__ */ jsx315("span", { className: "h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-neutral-200/80 dark:bg-white/10", children: /* @__PURE__ */ jsx315("span", { className: classNames123("block h-full rounded-full", barClass), style: { width: `${Math.round(value * 100)}%` } }) }),
67298
- /* @__PURE__ */ jsxs193("span", { className: "w-7 shrink-0 text-right text-[10px] font-semibold tabular-nums text-neutral-500 dark:text-neutral-400", children: [
67806
+ /* @__PURE__ */ jsxs194("span", { className: "w-7 shrink-0 text-right text-[10px] font-semibold tabular-nums text-neutral-500 dark:text-neutral-400", children: [
67299
67807
  Math.round(value * 100),
67300
67808
  "%"
67301
67809
  ] })
@@ -67352,7 +67860,7 @@ var TaskBar = ({
67352
67860
  pct: progressPct
67353
67861
  });
67354
67862
  if (milestone) {
67355
- return /* @__PURE__ */ jsxs193(
67863
+ return /* @__PURE__ */ jsxs194(
67356
67864
  "div",
67357
67865
  {
67358
67866
  role: "button",
@@ -67376,7 +67884,7 @@ var TaskBar = ({
67376
67884
  }
67377
67885
  );
67378
67886
  }
67379
- return /* @__PURE__ */ jsxs193(
67887
+ return /* @__PURE__ */ jsxs194(
67380
67888
  "div",
67381
67889
  {
67382
67890
  role: "button",
@@ -67422,7 +67930,7 @@ var TaskBar = ({
67422
67930
  children: /* @__PURE__ */ jsx315("div", { className: "mx-auto h-full w-0.5 rounded-full bg-white/90" })
67423
67931
  }
67424
67932
  ),
67425
- liveProgress != null && /* @__PURE__ */ jsxs193(
67933
+ liveProgress != null && /* @__PURE__ */ jsxs194(
67426
67934
  "div",
67427
67935
  {
67428
67936
  className: "pointer-events-none absolute -top-5 z-30 -translate-x-1/2 rounded-full bg-neutral-900/90 px-1.5 py-px text-[10px] font-semibold tabular-nums text-white shadow-md",
@@ -67434,7 +67942,7 @@ var TaskBar = ({
67434
67942
  }
67435
67943
  ),
67436
67944
  showName && (renderBar != null ? /* @__PURE__ */ jsx315("div", { className: classNames123("pointer-events-none absolute inset-0 flex items-center px-1.5 text-[11px] font-medium", labelText), children: renderBar(task, { taskId: task.id, left, width, top, height: row.height, milestone: false }) }) : /* @__PURE__ */ jsx315("span", { className: classNames123("pointer-events-none absolute inset-0 flex items-center truncate px-1.5 text-[11px] font-medium", labelText), children: task.name })),
67437
- canEdit && /* @__PURE__ */ jsxs193(Fragment49, { children: [
67945
+ canEdit && /* @__PURE__ */ jsxs194(Fragment49, { children: [
67438
67946
  /* @__PURE__ */ jsx315(
67439
67947
  "div",
67440
67948
  {
@@ -67456,7 +67964,7 @@ var TaskBar = ({
67456
67964
  }
67457
67965
  )
67458
67966
  ] }),
67459
- canEdit && /* @__PURE__ */ jsxs193(Fragment49, { children: [
67967
+ canEdit && /* @__PURE__ */ jsxs194(Fragment49, { children: [
67460
67968
  /* @__PURE__ */ jsx315(
67461
67969
  "button",
67462
67970
  {
@@ -67488,7 +67996,7 @@ var TaskBar = ({
67488
67996
  // src/components/Gantt/GanttToolbar.tsx
67489
67997
  import { useMemo as useMemo59 } from "react";
67490
67998
  import classNames124 from "classnames";
67491
- import { jsx as jsx316, jsxs as jsxs194 } from "react/jsx-runtime";
67999
+ import { jsx as jsx316, jsxs as jsxs195 } from "react/jsx-runtime";
67492
68000
  function nearestPreset(zoom, presets) {
67493
68001
  let best = null;
67494
68002
  let bestDist = Infinity;
@@ -67520,7 +68028,7 @@ var GanttToolbar = ({
67520
68028
  () => getSurfaceVariantClasses(variant, "neutral"),
67521
68029
  [variant]
67522
68030
  );
67523
- return /* @__PURE__ */ jsxs194(
68031
+ return /* @__PURE__ */ jsxs195(
67524
68032
  "div",
67525
68033
  {
67526
68034
  className: classNames124(
@@ -67551,10 +68059,10 @@ var GanttToolbar = ({
67551
68059
  GanttToolbar.displayName = "GanttToolbar";
67552
68060
 
67553
68061
  // src/components/Gantt/useGanttDrag.ts
67554
- import { useCallback as useCallback44, useEffect as useEffect72, useMemo as useMemo60, useRef as useRef70, useState as useState81 } from "react";
68062
+ import { useCallback as useCallback44, useEffect as useEffect72, useMemo as useMemo60, useRef as useRef70, useState as useState83 } from "react";
67555
68063
  function useGanttDrag(opts) {
67556
- const [drag, setDrag] = useState81(null);
67557
- const [linkSelected, setLinkSelected] = useState81(null);
68064
+ const [drag, setDrag] = useState83(null);
68065
+ const [linkSelected, setLinkSelected] = useState83(null);
67558
68066
  const optsRef = useRef70(opts);
67559
68067
  optsRef.current = opts;
67560
68068
  const dragRef = useRef70(null);
@@ -67901,7 +68409,7 @@ function useGanttDrag(opts) {
67901
68409
  }
67902
68410
 
67903
68411
  // src/components/Gantt/Gantt.tsx
67904
- import { jsx as jsx317, jsxs as jsxs195 } from "react/jsx-runtime";
68412
+ import { jsx as jsx317, jsxs as jsxs196 } from "react/jsx-runtime";
67905
68413
  var HEADER_HEIGHT = 52;
67906
68414
  var GRIP_WIDTH = 36;
67907
68415
  var DEFAULT_COLUMNS = [
@@ -67984,7 +68492,7 @@ var Gantt = ({
67984
68492
  }));
67985
68493
  const interactive = editable ?? Boolean(onTasksChange || onLinksChange || onReorder);
67986
68494
  const surfaceText = useMemo61(() => getSurfaceTextTokens(variant), [variant]);
67987
- const [internalZoom, setInternalZoom] = useState82(initialZoom);
68495
+ const [internalZoom, setInternalZoom] = useState84(initialZoom);
67988
68496
  const zoom = zoomProp ?? internalZoom;
67989
68497
  const setZoom = useCallback45(
67990
68498
  (z) => {
@@ -67994,7 +68502,7 @@ var Gantt = ({
67994
68502
  },
67995
68503
  [minZoom, maxZoom, onZoomChange]
67996
68504
  );
67997
- const [internalSelection, setInternalSelection] = useState82(null);
68505
+ const [internalSelection, setInternalSelection] = useState84(null);
67998
68506
  const selectedId = selectedIdProp !== void 0 ? selectedIdProp : internalSelection;
67999
68507
  const setSelected = useCallback45(
68000
68508
  (id) => {
@@ -68003,7 +68511,7 @@ var Gantt = ({
68003
68511
  },
68004
68512
  [onSelect, selectedIdProp]
68005
68513
  );
68006
- const [internalOrder, setInternalOrder] = useState82(void 0);
68514
+ const [internalOrder, setInternalOrder] = useState84(void 0);
68007
68515
  const rowOrder = rowOrderProp ?? internalOrder;
68008
68516
  const handleReorder = useCallback45(
68009
68517
  (order) => {
@@ -68012,10 +68520,10 @@ var Gantt = ({
68012
68520
  },
68013
68521
  [onReorder, rowOrderProp]
68014
68522
  );
68015
- const [collapsed, setCollapsed] = useState82(
68523
+ const [collapsed, setCollapsed] = useState84(
68016
68524
  () => new Set(tasks.filter((t2) => t2.open === false).map((t2) => t2.id))
68017
68525
  );
68018
- const [closedLanes, setClosedLanes] = useState82(
68526
+ const [closedLanes, setClosedLanes] = useState84(
68019
68527
  () => new Set((lanes ?? []).filter((l) => l.open === false).map((l) => l.id))
68020
68528
  );
68021
68529
  const tasksRef = useRef71(tasks);
@@ -68073,7 +68581,7 @@ var Gantt = ({
68073
68581
  () => buildTimeScale(range.start, range.end, zoom, dateLocale),
68074
68582
  [range, zoom, dateLocale]
68075
68583
  );
68076
- const [colWidths, setColWidths] = useState82(
68584
+ const [colWidths, setColWidths] = useState84(
68077
68585
  () => columnWidths ? { ...columnWidths } : {}
68078
68586
  );
68079
68587
  useEffect73(() => {
@@ -68099,7 +68607,7 @@ var Gantt = ({
68099
68607
  [resolvedColumns, colWidths]
68100
68608
  );
68101
68609
  const resizingRef = useRef71(null);
68102
- const [resizingKey, setResizingKey] = useState82(null);
68610
+ const [resizingKey, setResizingKey] = useState84(null);
68103
68611
  const startColumnResize = useCallback45(
68104
68612
  (e, key) => {
68105
68613
  if (e.button !== 0) return;
@@ -68458,8 +68966,8 @@ var Gantt = ({
68458
68966
  "aria-label": t("kit.gantt.root"),
68459
68967
  onKeyDown: onRootKeyDown,
68460
68968
  onPointerDown: handleRootPointerDown,
68461
- children: /* @__PURE__ */ jsxs195("div", { className: "flex h-full min-h-0 flex-col", children: [
68462
- /* @__PURE__ */ jsxs195(
68969
+ children: /* @__PURE__ */ jsxs196("div", { className: "flex h-full min-h-0 flex-col", children: [
68970
+ /* @__PURE__ */ jsxs196(
68463
68971
  "div",
68464
68972
  {
68465
68973
  className: classNames125(
@@ -68477,7 +68985,7 @@ var Gantt = ({
68477
68985
  children: icon
68478
68986
  }
68479
68987
  ),
68480
- (title != null || subtitle != null) && /* @__PURE__ */ jsxs195("div", { className: "min-w-0 flex-1", children: [
68988
+ (title != null || subtitle != null) && /* @__PURE__ */ jsxs196("div", { className: "min-w-0 flex-1", children: [
68481
68989
  subtitle != null && /* @__PURE__ */ jsx317("div", { className: "truncate text-[11px] font-semibold uppercase tracking-wider text-neutral-500 dark:text-neutral-400", children: subtitle }),
68482
68990
  title != null && /* @__PURE__ */ jsx317("div", { className: "truncate text-lg font-semibold text-neutral-900 dark:text-white", children: title })
68483
68991
  ] }),
@@ -68495,7 +69003,7 @@ var Gantt = ({
68495
69003
  ]
68496
69004
  }
68497
69005
  ),
68498
- /* @__PURE__ */ jsxs195(
69006
+ /* @__PURE__ */ jsxs196(
68499
69007
  "div",
68500
69008
  {
68501
69009
  className: classNames125(
@@ -68504,7 +69012,7 @@ var Gantt = ({
68504
69012
  ),
68505
69013
  style: { height: HEADER_HEIGHT },
68506
69014
  children: [
68507
- /* @__PURE__ */ jsxs195(
69015
+ /* @__PURE__ */ jsxs196(
68508
69016
  "div",
68509
69017
  {
68510
69018
  className: classNames125(
@@ -68516,7 +69024,7 @@ var Gantt = ({
68516
69024
  /* @__PURE__ */ jsx317("div", { className: "w-9 shrink-0" }),
68517
69025
  sizedColumns.map((col) => {
68518
69026
  const resizable = resizableColumns && col.resizable !== false;
68519
- return /* @__PURE__ */ jsxs195(
69027
+ return /* @__PURE__ */ jsxs196(
68520
69028
  "div",
68521
69029
  {
68522
69030
  className: classNames125(
@@ -68563,7 +69071,7 @@ var Gantt = ({
68563
69071
  ]
68564
69072
  }
68565
69073
  ),
68566
- /* @__PURE__ */ jsx317("div", { className: "relative min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsxs195(
69074
+ /* @__PURE__ */ jsx317("div", { className: "relative min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ jsxs196(
68567
69075
  "div",
68568
69076
  {
68569
69077
  ref: headerScaleRef,
@@ -68601,8 +69109,8 @@ var Gantt = ({
68601
69109
  ref: scrollRef,
68602
69110
  className: `gantt-scroller min-h-0 flex-1 overflow-auto overscroll-contain [&::-webkit-scrollbar]:h-1.5 ${THIN_SCROLLBAR}`,
68603
69111
  onScroll: syncHeaderScale,
68604
- children: /* @__PURE__ */ jsx317("div", { style: { width: leftWidth + timelineWidth + LINK_RIGHT_GUTTER, minWidth: "100%" }, children: loading ? /* @__PURE__ */ jsx317(GanttSkeleton, { rows: 12, rowHeight: rowHeight2, leftWidth }) : isEmpty2 ? /* @__PURE__ */ jsx317("div", { className: "flex items-center justify-center text-sm text-neutral-500", style: { height: bodyHeight || 160, width: leftWidth + timelineWidth }, children: emptyState ?? allLabels.empty }) : /* @__PURE__ */ jsxs195("div", { className: "relative", style: { height: bodyHeight }, children: [
68605
- /* @__PURE__ */ jsxs195(
69112
+ children: /* @__PURE__ */ jsx317("div", { style: { width: leftWidth + timelineWidth + LINK_RIGHT_GUTTER, minWidth: "100%" }, children: loading ? /* @__PURE__ */ jsx317(GanttSkeleton, { rows: 12, rowHeight: rowHeight2, leftWidth }) : isEmpty2 ? /* @__PURE__ */ jsx317("div", { className: "flex items-center justify-center text-sm text-neutral-500", style: { height: bodyHeight || 160, width: leftWidth + timelineWidth }, children: emptyState ?? allLabels.empty }) : /* @__PURE__ */ jsxs196("div", { className: "relative", style: { height: bodyHeight }, children: [
69113
+ /* @__PURE__ */ jsxs196(
68606
69114
  "div",
68607
69115
  {
68608
69116
  className: "pointer-events-none absolute inset-y-0 z-0",
@@ -68820,7 +69328,7 @@ var GanttSkeleton = ({
68820
69328
  rows,
68821
69329
  rowHeight: rowHeight2,
68822
69330
  leftWidth
68823
- }) => /* @__PURE__ */ jsx317("div", { className: "animate-pulse", "aria-busy": "true", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs195("div", { className: "flex", style: { height: rowHeight2 }, children: [
69331
+ }) => /* @__PURE__ */ jsx317("div", { className: "animate-pulse", "aria-busy": "true", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs196("div", { className: "flex", style: { height: rowHeight2 }, children: [
68824
69332
  /* @__PURE__ */ jsx317(
68825
69333
  "div",
68826
69334
  {
@@ -68848,7 +69356,7 @@ var GanttSkeleton = ({
68848
69356
  ] }, i)) });
68849
69357
 
68850
69358
  // src/components/TaskBoard/TaskBoard.tsx
68851
- import { useCallback as useCallback51, useEffect as useEffect78, useMemo as useMemo66, useRef as useRef77, useState as useState91 } from "react";
69359
+ import { useCallback as useCallback51, useEffect as useEffect78, useMemo as useMemo66, useRef as useRef77, useState as useState93 } from "react";
68852
69360
  import classNames136 from "classnames";
68853
69361
 
68854
69362
  // ../common/taskboard/types.ts
@@ -68892,7 +69400,9 @@ var DEFAULT_TASKBOARD_LABELS = {
68892
69400
  acceptsFrom: "Accepts cards from",
68893
69401
  acceptsAny: "None ticked: any column.",
68894
69402
  save: "Save",
68895
- cancel: "Cancel"
69403
+ cancel: "Cancel",
69404
+ maxItems: "Max items",
69405
+ maxItemsHint: "Empty uses the board default."
68896
69406
  };
68897
69407
 
68898
69408
  // ../common/taskboard/layout.ts
@@ -69054,6 +69564,11 @@ function validateMove(ctx, move) {
69054
69564
  if (changesColumn && toCol.accepts && !toCol.accepts.includes(move.from.column)) {
69055
69565
  return no("not-accepted");
69056
69566
  }
69567
+ const max = effectiveMaxItems(toCol, ctx.maxItems);
69568
+ if (changesColumn && max !== void 0) {
69569
+ const others = ctx.cards.filter((c) => c.column === toCol.id && c.id !== card.id).length;
69570
+ if (others >= max) return no("max-items");
69571
+ }
69057
69572
  if (changesColumn && toCol.wipLimit !== void 0) {
69058
69573
  const others = ctx.cards.filter((c) => c.column === toCol.id && c.id !== card.id).length;
69059
69574
  if (others >= toCol.wipLimit) return no("wip-column");
@@ -69066,6 +69581,16 @@ function validateMove(ctx, move) {
69066
69581
  }
69067
69582
  return OK;
69068
69583
  }
69584
+ function effectiveMaxItems(column, boardMax) {
69585
+ return column.maxItems ?? boardMax;
69586
+ }
69587
+ function columnAtMax(cards, column, boardMax) {
69588
+ const max = effectiveMaxItems(column, boardMax);
69589
+ if (max === void 0) return false;
69590
+ let n = 0;
69591
+ for (const c of cards) if (c.column === column.id) n++;
69592
+ return n >= max;
69593
+ }
69069
69594
  function applyMove(cards, move, columns, lanes) {
69070
69595
  const card = cards.find((c) => c.id === move.cardId);
69071
69596
  if (!card) return cards;
@@ -69387,7 +69912,7 @@ import classNames130 from "classnames";
69387
69912
  import classNames127 from "classnames";
69388
69913
 
69389
69914
  // src/components/TaskBoard/TaskBoardCard.tsx
69390
- import React98 from "react";
69915
+ import React99 from "react";
69391
69916
  import classNames126 from "classnames";
69392
69917
 
69393
69918
  // src/components/TaskBoard/context.ts
@@ -69399,6 +69924,7 @@ var TASKBOARD_SIZES = {
69399
69924
  lg: { columnWidth: 320, cardPad: "p-3.5", title: "text-[15px]", meta: "text-xs", gap: "gap-2.5" },
69400
69925
  xl: { columnWidth: 352, cardPad: "p-4", title: "text-base", meta: "text-sm", gap: "gap-3" }
69401
69926
  };
69927
+ var REFUSED_DROP = "cursor-not-allowed bg-red-500/10 ring-2 ring-inset ring-red-500/40 dark:bg-red-500/15";
69402
69928
  var TaskBoardContext = createContext8(null);
69403
69929
  function useTaskBoard() {
69404
69930
  const ctx = useContext8(TaskBoardContext);
@@ -69407,7 +69933,7 @@ function useTaskBoard() {
69407
69933
  }
69408
69934
 
69409
69935
  // src/components/TaskBoard/TaskBoardCard.tsx
69410
- import { Fragment as Fragment50, jsx as jsx318, jsxs as jsxs196 } from "react/jsx-runtime";
69936
+ import { Fragment as Fragment50, jsx as jsx318, jsxs as jsxs197 } from "react/jsx-runtime";
69411
69937
  var tagLabel = (t) => typeof t === "string" ? t : t.label;
69412
69938
  function formatDue(due, locale) {
69413
69939
  if (due === void 0 || due === null || due === "") return null;
@@ -69461,18 +69987,18 @@ var TaskBoardCardBody = ({ card }) => {
69461
69987
  );
69462
69988
  if (cardLayout === "compact") {
69463
69989
  const first = card.tags?.[0];
69464
- return /* @__PURE__ */ jsxs196("div", { className: classNames126("flex flex-col", size.gap), children: [
69465
- /* @__PURE__ */ jsxs196("div", { "data-card-title-row": true, className: "flex items-start gap-2", children: [
69990
+ return /* @__PURE__ */ jsxs197("div", { className: classNames126("flex flex-col", size.gap), children: [
69991
+ /* @__PURE__ */ jsxs197("div", { "data-card-title-row": true, className: "flex items-start gap-2", children: [
69466
69992
  /* @__PURE__ */ jsx318("div", { className: classNames126("min-w-0 flex-1 font-semibold leading-snug", size.title, surface.heading), children: card.title }),
69467
69993
  /* @__PURE__ */ jsx318(Avatars, { users: card.assignees })
69468
69994
  ] }),
69469
- /* @__PURE__ */ jsxs196("div", { className: classNames126("flex flex-wrap items-center gap-1.5", size.meta), children: [
69995
+ /* @__PURE__ */ jsxs197("div", { className: classNames126("flex flex-wrap items-center gap-1.5", size.meta), children: [
69470
69996
  priorityChip,
69471
- card.points !== void 0 && /* @__PURE__ */ jsxs196("span", { className: classNames126(chip, "text-[10px]", plainChip), children: [
69997
+ card.points !== void 0 && /* @__PURE__ */ jsxs197("span", { className: classNames126(chip, "text-[10px]", plainChip), children: [
69472
69998
  card.points,
69473
69999
  "p"
69474
70000
  ] }),
69475
- first !== void 0 && /* @__PURE__ */ jsxs196("span", { className: classNames126("text-[10px]", surface.muted), children: [
70001
+ first !== void 0 && /* @__PURE__ */ jsxs197("span", { className: classNames126("text-[10px]", surface.muted), children: [
69476
70002
  "#",
69477
70003
  tagLabel(first)
69478
70004
  ] })
@@ -69480,14 +70006,14 @@ var TaskBoardCardBody = ({ card }) => {
69480
70006
  ] });
69481
70007
  }
69482
70008
  const hasMeta = priority || card.description || card.checklist || due;
69483
- return /* @__PURE__ */ jsxs196("div", { className: classNames126("flex flex-col", size.gap), children: [
70009
+ return /* @__PURE__ */ jsxs197("div", { className: classNames126("flex flex-col", size.gap), children: [
69484
70010
  card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx318("div", { className: "flex flex-wrap gap-1", children: card.tags.map(tagChip) }),
69485
70011
  /* @__PURE__ */ jsx318("div", { className: classNames126("font-semibold leading-snug", size.title, surface.heading), children: card.title }),
69486
- (hasMeta || card.assignees?.length) && /* @__PURE__ */ jsxs196("div", { className: "flex items-end gap-2", children: [
69487
- /* @__PURE__ */ jsxs196("div", { className: classNames126("flex min-w-0 flex-1 flex-wrap items-center gap-2", size.meta, surface.muted), children: [
70012
+ (hasMeta || card.assignees?.length) && /* @__PURE__ */ jsxs197("div", { className: "flex items-end gap-2", children: [
70013
+ /* @__PURE__ */ jsxs197("div", { className: classNames126("flex min-w-0 flex-1 flex-wrap items-center gap-2", size.meta, surface.muted), children: [
69488
70014
  priorityChip,
69489
70015
  card.description && /* @__PURE__ */ jsx318("span", { title: text("notes"), "aria-label": text("notes"), role: "img", children: /* @__PURE__ */ jsx318(Details, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) }),
69490
- card.checklist && /* @__PURE__ */ jsxs196(
70016
+ card.checklist && /* @__PURE__ */ jsxs197(
69491
70017
  "span",
69492
70018
  {
69493
70019
  className: "inline-flex items-center gap-1",
@@ -69500,7 +70026,7 @@ var TaskBoardCardBody = ({ card }) => {
69500
70026
  ]
69501
70027
  }
69502
70028
  ),
69503
- due && /* @__PURE__ */ jsxs196("span", { "data-card-due": true, className: "inline-flex items-center gap-1", title: text("due", { date: due }), children: [
70029
+ due && /* @__PURE__ */ jsxs197("span", { "data-card-due": true, className: "inline-flex items-center gap-1", title: text("due", { date: due }), children: [
69504
70030
  /* @__PURE__ */ jsx318(Calendar, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
69505
70031
  due
69506
70032
  ] })
@@ -69509,7 +70035,7 @@ var TaskBoardCardBody = ({ card }) => {
69509
70035
  ] })
69510
70036
  ] });
69511
70037
  };
69512
- var TaskBoardCard = React98.forwardRef(
70038
+ var TaskBoardCard = React99.forwardRef(
69513
70039
  ({ card, column, lane, index, state, className, onClick, onContextMenu, onKeyDown, ...rest }, ref) => {
69514
70040
  const ctx = useTaskBoard();
69515
70041
  const { renderCard, onCardOpen, onCardContextMenu, cardSurface, size, color } = ctx;
@@ -69517,7 +70043,7 @@ var TaskBoardCard = React98.forwardRef(
69517
70043
  const tone = card.tone ? getTaskBoardCardToneTokens(card.tone) : null;
69518
70044
  const heldTone = state.held ? state.held.color ?? peerColor(state.held.id) : null;
69519
70045
  const held = heldTone ? getTaskBoardPeerTokens(heldTone) : null;
69520
- return /* @__PURE__ */ jsxs196(
70046
+ return /* @__PURE__ */ jsxs197(
69521
70047
  "div",
69522
70048
  {
69523
70049
  ref,
@@ -69570,7 +70096,7 @@ var TaskBoardCard = React98.forwardRef(
69570
70096
  },
69571
70097
  children: [
69572
70098
  renderCard ? renderCard(card, state) : /* @__PURE__ */ jsx318(TaskBoardCardBody, { card }),
69573
- state.held && heldTone && /* @__PURE__ */ jsxs196(Fragment50, { children: [
70099
+ state.held && heldTone && /* @__PURE__ */ jsxs197(Fragment50, { children: [
69574
70100
  /* @__PURE__ */ jsx318("span", { className: "sr-only", children: ctx.text("held", { name: state.held.name }) }),
69575
70101
  /* @__PURE__ */ jsx318(
69576
70102
  "span",
@@ -69619,7 +70145,7 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
69619
70145
  className: classNames127(
69620
70146
  "flex min-h-12 flex-col rounded-lg transition-colors",
69621
70147
  size.gap,
69622
- target && !target.valid && "cursor-not-allowed bg-red-500/5 ring-1 ring-inset ring-red-500/30",
70148
+ // The refused tint is painted by the column / lane cell around this list.
69623
70149
  className
69624
70150
  ),
69625
70151
  children: cards.map((card, index) => /* @__PURE__ */ jsx319(
@@ -69639,10 +70165,10 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
69639
70165
  };
69640
70166
 
69641
70167
  // src/components/TaskBoard/usePresence.ts
69642
- import { useEffect as useEffect74, useState as useState83 } from "react";
70168
+ import { useEffect as useEffect74, useState as useState85 } from "react";
69643
70169
  var COLLAPSE_MS = 200;
69644
70170
  function usePresence(open, ms = COLLAPSE_MS) {
69645
- const [mounted, setMounted] = useState83(open);
70171
+ const [mounted, setMounted] = useState85(open);
69646
70172
  useEffect74(() => {
69647
70173
  if (open) {
69648
70174
  setMounted(true);
@@ -69660,10 +70186,10 @@ function usePresence(open, ms = COLLAPSE_MS) {
69660
70186
  }
69661
70187
 
69662
70188
  // src/components/TaskBoard/TaskBoardColumnEdit.tsx
69663
- import { useState as useState84 } from "react";
70189
+ import { useState as useState86 } from "react";
69664
70190
  import { createPortal as createPortal16 } from "react-dom";
69665
70191
  import classNames128 from "classnames";
69666
- import { jsx as jsx320, jsxs as jsxs197 } from "react/jsx-runtime";
70192
+ import { jsx as jsx320, jsxs as jsxs198 } from "react/jsx-runtime";
69667
70193
  var TaskBoardColumnGrip = ({ column, index }) => {
69668
70194
  const { columnGripProps, surface, color } = useTaskBoard();
69669
70195
  if (!columnGripProps) return null;
@@ -69688,8 +70214,8 @@ var TaskBoardAddColumn = ({
69688
70214
  variant
69689
70215
  }) => {
69690
70216
  const { text, surface, color, size, columnCornerClass } = useTaskBoard();
69691
- const [editing, setEditing] = useState84(false);
69692
- const [title, setTitle] = useState84("");
70217
+ const [editing, setEditing] = useState86(false);
70218
+ const [title, setTitle] = useState86("");
69693
70219
  const trigger = getSurfaceTriggerTokens(color);
69694
70220
  const close = () => {
69695
70221
  setEditing(false);
@@ -69735,7 +70261,7 @@ var TaskBoardAddColumn = ({
69735
70261
  trigger.focusRing
69736
70262
  )
69737
70263
  }
69738
- ) : /* @__PURE__ */ jsxs197(
70264
+ ) : /* @__PURE__ */ jsxs198(
69739
70265
  "button",
69740
70266
  {
69741
70267
  type: "button",
@@ -69760,7 +70286,7 @@ var TaskBoardColumnClone = ({ drag, column, cards, count }) => {
69760
70286
  if (!drag || drag.keyboard || !column || typeof document === "undefined") return null;
69761
70287
  const tone = column.color ?? color;
69762
70288
  return createPortal16(
69763
- /* @__PURE__ */ jsxs197(
70289
+ /* @__PURE__ */ jsxs198(
69764
70290
  "div",
69765
70291
  {
69766
70292
  "data-taskboard-column-clone": true,
@@ -69777,7 +70303,7 @@ var TaskBoardColumnClone = ({ drag, column, cards, count }) => {
69777
70303
  transform: `translate3d(${drag.x - drag.grabOffset.x}px, ${drag.y - drag.grabOffset.y}px, 0)`
69778
70304
  },
69779
70305
  children: [
69780
- /* @__PURE__ */ jsxs197("div", { className: "flex items-center gap-2 px-3 pt-3 pb-2", children: [
70306
+ /* @__PURE__ */ jsxs198("div", { className: "flex items-center gap-2 px-3 pt-3 pb-2", children: [
69781
70307
  /* @__PURE__ */ jsx320(Drag, { className: classNames128("h-3.5 w-3.5 shrink-0", surface.muted), "aria-hidden": "true" }),
69782
70308
  /* @__PURE__ */ jsx320("span", { className: classNames128("truncate text-sm font-semibold", surface.heading), children: column.title }),
69783
70309
  /* @__PURE__ */ jsx320("span", { className: classNames128("text-xs font-semibold tabular-nums", surface.muted), children: count })
@@ -69802,34 +70328,36 @@ var TaskBoardColumnClone = ({ drag, column, cards, count }) => {
69802
70328
  };
69803
70329
 
69804
70330
  // src/components/TaskBoard/TaskBoardColumnEditor.tsx
69805
- import { useId as useId43, useState as useState85 } from "react";
70331
+ import { useId as useId45, useState as useState87 } from "react";
69806
70332
  import classNames129 from "classnames";
69807
- import { jsx as jsx321, jsxs as jsxs198 } from "react/jsx-runtime";
70333
+ import { jsx as jsx321, jsxs as jsxs199 } from "react/jsx-runtime";
69808
70334
  var toDraft = (c) => ({
69809
70335
  title: c.title,
69810
70336
  color: c.color,
69811
70337
  wip: c.wipLimit === void 0 ? "" : String(c.wipLimit),
70338
+ max: c.maxItems === void 0 ? "" : String(c.maxItems),
69812
70339
  locked: Boolean(c.locked),
69813
70340
  accepts: c.accepts ?? []
69814
70341
  });
69815
70342
  function fromDraft(column, d) {
69816
- const { wipLimit: _w, locked: _l, accepts: _a, color: _c, ...rest } = column;
70343
+ const { wipLimit: _w, maxItems: _m, locked: _l, accepts: _a, color: _c, ...rest } = column;
69817
70344
  const next = { ...rest, title: d.title.trim() };
69818
70345
  if (d.color) next.color = d.color;
69819
70346
  if (d.wip.trim() !== "") next.wipLimit = Number(d.wip);
70347
+ if (d.max.trim() !== "") next.maxItems = Number(d.max);
69820
70348
  if (d.locked) next.locked = true;
69821
70349
  if (d.accepts.length) next.accepts = d.accepts;
69822
70350
  return next;
69823
70351
  }
69824
- var wipValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
70352
+ var limitValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
69825
70353
  var TaskBoardColumnEditButton = ({ column }) => {
69826
70354
  const { onEditColumn, allColumns, text, surface, color } = useTaskBoard();
69827
- const [open, setOpen] = useState85(false);
69828
- const [draft, setDraft] = useState85(() => toDraft(column));
69829
- const id = useId43();
70355
+ const [open, setOpen] = useState87(false);
70356
+ const [draft, setDraft] = useState87(() => toDraft(column));
70357
+ const id = useId45();
69830
70358
  if (!onEditColumn) return null;
69831
70359
  const trigger = getSurfaceTriggerTokens(color);
69832
- const valid = draft.title.trim() !== "" && wipValid(draft.wip);
70360
+ const valid = draft.title.trim() !== "" && limitValid(draft.wip) && limitValid(draft.max);
69833
70361
  const others = (allColumns ?? []).filter((c) => c.id !== column.id);
69834
70362
  const save = () => {
69835
70363
  if (!valid) return;
@@ -69855,7 +70383,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
69855
70383
  children: /* @__PURE__ */ jsx321(Edit, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
69856
70384
  }
69857
70385
  ),
69858
- children: /* @__PURE__ */ jsxs198(
70386
+ children: /* @__PURE__ */ jsxs199(
69859
70387
  "form",
69860
70388
  {
69861
70389
  className: "flex w-64 flex-col gap-3",
@@ -69880,7 +70408,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
69880
70408
  }
69881
70409
  }
69882
70410
  ),
69883
- /* @__PURE__ */ jsxs198("div", { className: "flex flex-col gap-1.5", children: [
70411
+ /* @__PURE__ */ jsxs199("div", { className: "flex flex-col gap-1.5", children: [
69884
70412
  /* @__PURE__ */ jsx321("span", { className: classNames129("text-xs font-semibold", surface.muted), children: text("columnColor") }),
69885
70413
  /* @__PURE__ */ jsx321(
69886
70414
  ColorSwatches,
@@ -69893,7 +70421,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
69893
70421
  }
69894
70422
  )
69895
70423
  ] }),
69896
- /* @__PURE__ */ jsxs198("div", { className: "flex flex-col gap-1", children: [
70424
+ /* @__PURE__ */ jsxs199("div", { className: "flex flex-col gap-1", children: [
69897
70425
  /* @__PURE__ */ jsx321("label", { htmlFor: `${id}-wip`, className: classNames129("text-xs font-semibold", surface.muted), children: text("wipLimit") }),
69898
70426
  /* @__PURE__ */ jsx321(
69899
70427
  Input_default,
@@ -69906,7 +70434,24 @@ var TaskBoardColumnEditButton = ({ column }) => {
69906
70434
  placeholder: text("wipLimitHint"),
69907
70435
  value: draft.wip,
69908
70436
  onChange: (e) => setDraft({ ...draft, wip: e.target.value }),
69909
- "aria-invalid": !wipValid(draft.wip) || void 0
70437
+ "aria-invalid": !limitValid(draft.wip) || void 0
70438
+ }
70439
+ )
70440
+ ] }),
70441
+ /* @__PURE__ */ jsxs199("div", { className: "flex flex-col gap-1", children: [
70442
+ /* @__PURE__ */ jsx321("label", { htmlFor: `${id}-max`, className: classNames129("text-xs font-semibold", surface.muted), children: text("maxItems") }),
70443
+ /* @__PURE__ */ jsx321(
70444
+ Input_default,
70445
+ {
70446
+ id: `${id}-max`,
70447
+ size: "sm",
70448
+ type: "number",
70449
+ min: 1,
70450
+ inputMode: "numeric",
70451
+ placeholder: text("maxItemsHint"),
70452
+ value: draft.max,
70453
+ onChange: (e) => setDraft({ ...draft, max: e.target.value }),
70454
+ "aria-invalid": !limitValid(draft.max) || void 0
69910
70455
  }
69911
70456
  )
69912
70457
  ] }),
@@ -69920,7 +70465,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
69920
70465
  onChange: (e) => setDraft({ ...draft, locked: e.target.checked })
69921
70466
  }
69922
70467
  ),
69923
- others.length > 0 && /* @__PURE__ */ jsxs198("fieldset", { className: "flex flex-col gap-1.5", children: [
70468
+ others.length > 0 && /* @__PURE__ */ jsxs199("fieldset", { className: "flex flex-col gap-1.5", children: [
69924
70469
  /* @__PURE__ */ jsx321("legend", { className: classNames129("mb-1 text-xs font-semibold", surface.muted), children: text("acceptsFrom") }),
69925
70470
  others.map((c) => /* @__PURE__ */ jsx321(
69926
70471
  Checkbox_default,
@@ -69937,7 +70482,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
69937
70482
  )),
69938
70483
  /* @__PURE__ */ jsx321("span", { className: classNames129("text-[11px]", surface.muted), children: text("acceptsAny") })
69939
70484
  ] }),
69940
- /* @__PURE__ */ jsxs198("div", { className: "flex justify-end gap-2 pt-1", children: [
70485
+ /* @__PURE__ */ jsxs199("div", { className: "flex justify-end gap-2 pt-1", children: [
69941
70486
  /* @__PURE__ */ jsx321(Button_default, { type: "button", size: "sm", variant: "soft", color: "slate", onClick: () => setOpen(false), children: text("cancel") }),
69942
70487
  /* @__PURE__ */ jsx321(Button_default, { type: "submit", size: "sm", color, disabled: !valid, children: text("save") })
69943
70488
  ] })
@@ -69949,7 +70494,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
69949
70494
  };
69950
70495
 
69951
70496
  // src/components/TaskBoard/TaskBoardColumn.tsx
69952
- import { jsx as jsx322, jsxs as jsxs199 } from "react/jsx-runtime";
70497
+ import { jsx as jsx322, jsxs as jsxs200 } from "react/jsx-runtime";
69953
70498
  var COLLAPSED_WIDTH = 44;
69954
70499
  function columnCountLabel(count, limit) {
69955
70500
  return limit === void 0 ? String(count) : `${count} / ${limit}`;
@@ -69961,7 +70506,10 @@ var TaskBoardColumn = ({
69961
70506
  index = 0,
69962
70507
  onToggle
69963
70508
  }) => {
69964
- const { surface, text, color, size, wellSurface, columnCornerClass, onAddCard, draggingColumnId } = useTaskBoard();
70509
+ const { surface, text, color, size, wellSurface, columnCornerClass, onAddCard, draggingColumnId, boardMaxItems, dropTarget } = useTaskBoard();
70510
+ const refused = Boolean(dropTarget && !dropTarget.valid && dropTarget.bucket === bucketKey(column.id, null));
70511
+ const max = effectiveMaxItems(column, boardMaxItems);
70512
+ const full = max !== void 0 && count >= max;
69965
70513
  const dragging = draggingColumnId === column.id;
69966
70514
  const tone = column.color ?? color;
69967
70515
  const tokens = getTaskBoardColumnTokens(tone);
@@ -70002,18 +70550,20 @@ var TaskBoardColumn = ({
70002
70550
  title: column.wipLimit !== void 0 ? text("wip", { count, limit: column.wipLimit }) : void 0,
70003
70551
  className: classNames130(
70004
70552
  "text-xs font-semibold tabular-nums",
70005
- wip === "full" || wip === "over" ? tokens.wipFull : surface.muted
70553
+ wip === "full" || wip === "over" || full ? tokens.wipFull : surface.muted
70006
70554
  ),
70007
- children: columnCountLabel(count, column.wipLimit)
70555
+ children: columnCountLabel(count, column.wipLimit ?? max)
70008
70556
  }
70009
70557
  );
70010
- return /* @__PURE__ */ jsxs199(
70558
+ return /* @__PURE__ */ jsxs200(
70011
70559
  "div",
70012
70560
  {
70013
70561
  "data-column-id": column.id,
70014
70562
  "data-column-target": column.id,
70015
70563
  "data-flip-key": column.id,
70016
70564
  "data-column-dragging": dragging || void 0,
70565
+ "data-full": full || void 0,
70566
+ "data-drop": refused ? "invalid" : void 0,
70017
70567
  "data-collapsed": column.collapsed ? "true" : void 0,
70018
70568
  "data-wip": wip,
70019
70569
  "data-drop-zone": column.collapsed ? void 0 : true,
@@ -70023,12 +70573,12 @@ var TaskBoardColumn = ({
70023
70573
  columnCornerClass,
70024
70574
  "transition-[width] duration-200 ease-out motion-reduce:transition-none",
70025
70575
  tokens.edge,
70026
- wellSurface,
70576
+ refused ? REFUSED_DROP : wellSurface,
70027
70577
  // Edit-mode drag: the column's slot holds as a dashed placeholder.
70028
70578
  dragging && "opacity-50 outline-2 -outline-offset-2 outline-dashed outline-black/25 dark:outline-white/30"
70029
70579
  ),
70030
70580
  children: [
70031
- stripMounted && /* @__PURE__ */ jsxs199(
70581
+ stripMounted && /* @__PURE__ */ jsxs200(
70032
70582
  "div",
70033
70583
  {
70034
70584
  "aria-hidden": !column.collapsed,
@@ -70056,7 +70606,7 @@ var TaskBoardColumn = ({
70056
70606
  ]
70057
70607
  }
70058
70608
  ),
70059
- bodyMounted && /* @__PURE__ */ jsxs199(
70609
+ bodyMounted && /* @__PURE__ */ jsxs200(
70060
70610
  "div",
70061
70611
  {
70062
70612
  "data-column-body": true,
@@ -70068,7 +70618,7 @@ var TaskBoardColumn = ({
70068
70618
  column.collapsed && "opacity-0"
70069
70619
  ),
70070
70620
  children: [
70071
- /* @__PURE__ */ jsxs199("div", { className: "flex items-center gap-2 px-3 pt-3 pb-2", children: [
70621
+ /* @__PURE__ */ jsxs200("div", { className: "flex items-center gap-2 px-3 pt-3 pb-2", children: [
70072
70622
  /* @__PURE__ */ jsx322(TaskBoardColumnGrip, { column, index }),
70073
70623
  /* @__PURE__ */ jsx322(
70074
70624
  "span",
@@ -70105,7 +70655,7 @@ var TaskBoardColumn = ({
70105
70655
  )
70106
70656
  }
70107
70657
  ),
70108
- onAddCard && /* @__PURE__ */ jsxs199(
70658
+ onAddCard && !full && /* @__PURE__ */ jsxs200(
70109
70659
  "button",
70110
70660
  {
70111
70661
  type: "button",
@@ -70132,7 +70682,7 @@ var TaskBoardColumn = ({
70132
70682
 
70133
70683
  // src/components/TaskBoard/TaskBoardHeader.tsx
70134
70684
  import classNames131 from "classnames";
70135
- import { jsx as jsx323, jsxs as jsxs200 } from "react/jsx-runtime";
70685
+ import { jsx as jsx323, jsxs as jsxs201 } from "react/jsx-runtime";
70136
70686
  var MAX_AVATARS = 5;
70137
70687
  var hasNode = (v) => v != null && v !== false;
70138
70688
  var TaskBoardHeader = ({
@@ -70147,7 +70697,7 @@ var TaskBoardHeader = ({
70147
70697
  const { surface, text } = useTaskBoard();
70148
70698
  const shown = people?.slice(0, MAX_AVATARS) ?? [];
70149
70699
  const extra = (people?.length ?? 0) - shown.length;
70150
- return /* @__PURE__ */ jsxs200(
70700
+ return /* @__PURE__ */ jsxs201(
70151
70701
  "div",
70152
70702
  {
70153
70703
  "data-taskboard-header": true,
@@ -70164,12 +70714,12 @@ var TaskBoardHeader = ({
70164
70714
  children: icon
70165
70715
  }
70166
70716
  ),
70167
- (hasNode(title) || hasNode(subtitle)) && /* @__PURE__ */ jsxs200("div", { className: "min-w-0", children: [
70717
+ (hasNode(title) || hasNode(subtitle)) && /* @__PURE__ */ jsxs201("div", { className: "min-w-0", children: [
70168
70718
  hasNode(title) && /* @__PURE__ */ jsx323("div", { className: classNames131("truncate text-lg font-bold leading-tight", surface.heading), children: title }),
70169
70719
  hasNode(subtitle) && /* @__PURE__ */ jsx323("div", { className: classNames131("truncate text-xs", surface.muted), children: subtitle })
70170
70720
  ] }),
70171
70721
  /* @__PURE__ */ jsx323("div", { className: "flex min-w-0 flex-1 flex-wrap items-center justify-center gap-2", children: hasNode(summary) && summary }),
70172
- shown.length > 0 && /* @__PURE__ */ jsxs200(
70722
+ shown.length > 0 && /* @__PURE__ */ jsxs201(
70173
70723
  "div",
70174
70724
  {
70175
70725
  "data-taskboard-people": true,
@@ -70200,7 +70750,7 @@ var TaskBoardHeader = ({
70200
70750
 
70201
70751
  // src/components/TaskBoard/TaskBoardLaneGrid.tsx
70202
70752
  import classNames132 from "classnames";
70203
- import { jsx as jsx324, jsxs as jsxs201 } from "react/jsx-runtime";
70753
+ import { jsx as jsx324, jsxs as jsxs202 } from "react/jsx-runtime";
70204
70754
  var LANE_LABEL_WIDTH = 220;
70205
70755
  var ADD_COLUMN_WIDTH = 180;
70206
70756
  var TaskBoardLaneGrid = ({
@@ -70212,7 +70762,8 @@ var TaskBoardLaneGrid = ({
70212
70762
  onToggleColumn,
70213
70763
  onAddColumn
70214
70764
  }) => {
70215
- const { surface, text, color, size, stickySurface, draggingColumnId } = useTaskBoard();
70765
+ const { surface, text, color, size, stickySurface, draggingColumnId, boardMaxItems } = useTaskBoard();
70766
+ const fullColumns = new Set(columns.filter((c) => columnAtMax(cards, c, boardMaxItems)).map((c) => c.id));
70216
70767
  const trigger = getSurfaceTriggerTokens(color);
70217
70768
  const template = [
70218
70769
  `${LANE_LABEL_WIDTH}px`,
@@ -70236,7 +70787,7 @@ var TaskBoardLaneGrid = ({
70236
70787
  )
70237
70788
  }
70238
70789
  );
70239
- return /* @__PURE__ */ jsx324(ScrollArea, { "data-taskboard-scroll": true, variant: "hover", tabIndex: -1, className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxs201(
70790
+ return /* @__PURE__ */ jsx324(ScrollArea, { "data-taskboard-scroll": true, variant: "hover", tabIndex: -1, className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxs202(
70240
70791
  "div",
70241
70792
  {
70242
70793
  "data-lane-grid": true,
@@ -70247,7 +70798,7 @@ var TaskBoardLaneGrid = ({
70247
70798
  columns.map((col, index) => {
70248
70799
  const count = columnCount(cards, col.id);
70249
70800
  const wip = wipState(count, col.wipLimit);
70250
- return /* @__PURE__ */ jsxs201(
70801
+ return /* @__PURE__ */ jsxs202(
70251
70802
  "div",
70252
70803
  {
70253
70804
  "data-lane-column-header": col.id,
@@ -70271,9 +70822,9 @@ var TaskBoardLaneGrid = ({
70271
70822
  "data-column-count": true,
70272
70823
  className: classNames132(
70273
70824
  "rounded-full bg-black/5 px-1.5 text-[11px] font-semibold tabular-nums dark:bg-white/10",
70274
- wip === "full" || wip === "over" ? getTaskBoardColumnTokens(col.color ?? color).wipFull : surface.muted
70825
+ wip === "full" || wip === "over" || fullColumns.has(col.id) ? getTaskBoardColumnTokens(col.color ?? color).wipFull : surface.muted
70275
70826
  ),
70276
- children: columnCountLabel(count, col.wipLimit)
70827
+ children: columnCountLabel(count, col.wipLimit ?? effectiveMaxItems(col, boardMaxItems))
70277
70828
  }
70278
70829
  ),
70279
70830
  /* @__PURE__ */ jsx324(TaskBoardColumnEditButton, { column: col }),
@@ -70293,6 +70844,7 @@ var TaskBoardLaneGrid = ({
70293
70844
  buckets,
70294
70845
  cellBorder,
70295
70846
  trailingCell: Boolean(onAddColumn),
70847
+ fullColumns,
70296
70848
  caret: onToggleLane && caret(lane.collapsed, lane.title, () => onToggleLane(lane.id))
70297
70849
  },
70298
70850
  lane.id
@@ -70308,14 +70860,16 @@ var TaskBoardLaneRow = ({
70308
70860
  buckets,
70309
70861
  cellBorder,
70310
70862
  caret,
70311
- trailingCell
70863
+ trailingCell,
70864
+ fullColumns
70312
70865
  }) => {
70313
- const { surface, text, color, stickySurface, onAddCard } = useTaskBoard();
70866
+ const { surface, text, color, stickySurface, onAddCard, dropTarget } = useTaskBoard();
70867
+ const refusedBucket = dropTarget && !dropTarget.valid ? dropTarget.bucket : null;
70314
70868
  const trigger = getSurfaceTriggerTokens(color);
70315
70869
  const open = !lane.collapsed;
70316
70870
  const bodyMounted = usePresence(open);
70317
- return /* @__PURE__ */ jsxs201("div", { "data-lane-id": lane.id, "data-collapsed": lane.collapsed ? "true" : void 0, className: "contents", children: [
70318
- /* @__PURE__ */ jsxs201("div", { className: classNames132("sticky left-0 z-10 flex items-start gap-2 px-3 py-3", stickySurface, cellBorder), children: [
70871
+ return /* @__PURE__ */ jsxs202("div", { "data-lane-id": lane.id, "data-collapsed": lane.collapsed ? "true" : void 0, className: "contents", children: [
70872
+ /* @__PURE__ */ jsxs202("div", { className: classNames132("sticky left-0 z-10 flex items-start gap-2 px-3 py-3", stickySurface, cellBorder), children: [
70319
70873
  caret,
70320
70874
  /* @__PURE__ */ jsx324("span", { className: classNames132("min-w-0 flex-1 truncate pt-0.5 text-sm font-semibold", surface.heading), children: lane.title }),
70321
70875
  /* @__PURE__ */ jsx324(
@@ -70335,7 +70889,8 @@ var TaskBoardLaneRow = ({
70335
70889
  {
70336
70890
  "data-flip-key": `${col.id}:${lane.id}`,
70337
70891
  "data-drop-zone": open && !col.collapsed ? true : void 0,
70338
- className: cellBorder,
70892
+ "data-drop": refusedBucket === bucketKey(col.id, lane.id) ? "invalid" : void 0,
70893
+ className: classNames132(cellBorder, refusedBucket === bucketKey(col.id, lane.id) && REFUSED_DROP),
70339
70894
  children: /* @__PURE__ */ jsx324(
70340
70895
  "div",
70341
70896
  {
@@ -70344,7 +70899,7 @@ var TaskBoardLaneRow = ({
70344
70899
  "grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
70345
70900
  open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
70346
70901
  ),
70347
- children: /* @__PURE__ */ jsx324("div", { className: "min-h-0 overflow-hidden", inert: !open, "aria-hidden": !open || void 0, children: bodyMounted && !col.collapsed && /* @__PURE__ */ jsxs201("div", { className: "flex flex-col gap-1 p-2", children: [
70902
+ children: /* @__PURE__ */ jsx324("div", { className: "min-h-0 overflow-hidden", inert: !open, "aria-hidden": !open || void 0, children: bodyMounted && !col.collapsed && /* @__PURE__ */ jsxs202("div", { className: "flex flex-col gap-1 p-2", children: [
70348
70903
  /* @__PURE__ */ jsx324(
70349
70904
  TaskBoardBucket,
70350
70905
  {
@@ -70354,7 +70909,7 @@ var TaskBoardLaneRow = ({
70354
70909
  label: `${col.title}, ${lane.title}`
70355
70910
  }
70356
70911
  ),
70357
- onAddCard && /* @__PURE__ */ jsx324(
70912
+ onAddCard && !fullColumns.has(col.id) && /* @__PURE__ */ jsx324(
70358
70913
  "button",
70359
70914
  {
70360
70915
  type: "button",
@@ -70412,7 +70967,7 @@ var TaskBoardDragLayer = ({ drag, card }) => {
70412
70967
  };
70413
70968
 
70414
70969
  // src/components/TaskBoard/useTaskBoardDrag.ts
70415
- import { useCallback as useCallback46, useEffect as useEffect75, useMemo as useMemo62, useRef as useRef72, useState as useState86 } from "react";
70970
+ import { useCallback as useCallback46, useEffect as useEffect75, useMemo as useMemo62, useRef as useRef72, useState as useState88 } from "react";
70416
70971
  var DRAG_THRESHOLD_PX = 4;
70417
70972
  var TOUCH_GRAB_DELAY_MS = 250;
70418
70973
  var TOUCH_SLOP_PX = 8;
@@ -70427,8 +70982,8 @@ function bucketOf(el) {
70427
70982
  return column === null ? null : { column, lane: lane || null, el: bucket };
70428
70983
  }
70429
70984
  function useTaskBoardDrag(opts) {
70430
- const [drag, setDrag] = useState86(null);
70431
- const [pending, setPending] = useState86(null);
70985
+ const [drag, setDrag] = useState88(null);
70986
+ const [pending, setPending] = useState88(null);
70432
70987
  const optsRef = useRef72(opts);
70433
70988
  optsRef.current = opts;
70434
70989
  const dragRef = useRef72(null);
@@ -70444,7 +70999,7 @@ function useTaskBoardDrag(opts) {
70444
70999
  }, []);
70445
71000
  const ctxFor = () => {
70446
71001
  const o = optsRef.current;
70447
- return { cards: o.cards, columns: o.columns, lanes: o.lanes, heldBy: o.heldBy, selfId: o.selfId };
71002
+ return { cards: o.cards, columns: o.columns, lanes: o.lanes, heldBy: o.heldBy, selfId: o.selfId, maxItems: o.maxItems };
70448
71003
  };
70449
71004
  const resolveTarget = useCallback46((x, y) => {
70450
71005
  const d = dragRef.current;
@@ -70711,13 +71266,13 @@ function useTaskBoardDrag(opts) {
70711
71266
  }
70712
71267
 
70713
71268
  // src/components/TaskBoard/useTaskBoardKeyboard.ts
70714
- import { useCallback as useCallback47, useLayoutEffect as useLayoutEffect24, useMemo as useMemo63, useRef as useRef73, useState as useState87 } from "react";
71269
+ import { useCallback as useCallback47, useLayoutEffect as useLayoutEffect24, useMemo as useMemo63, useRef as useRef73, useState as useState89 } from "react";
70715
71270
  var isRtl = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
70716
71271
  function useTaskBoardKeyboard(o) {
70717
71272
  const { rootRef, cards, viewCards, columns, lanes, text, drag } = o;
70718
- const [message, setMessage] = useState87("");
70719
- const [activeId, setActiveId] = useState87(null);
70720
- const [ownSelection, setOwnSelection] = useState87([]);
71273
+ const [message, setMessage] = useState89("");
71274
+ const [activeId, setActiveId] = useState89(null);
71275
+ const [ownSelection, setOwnSelection] = useState89([]);
70721
71276
  const selection = o.selectedIds ?? ownSelection;
70722
71277
  const anchorRef = useRef73(null);
70723
71278
  const refocusRef = useRef73(null);
@@ -70829,7 +71384,7 @@ function useTaskBoardKeyboard(o) {
70829
71384
  if (dir2) {
70830
71385
  e.preventDefault();
70831
71386
  const to = keyboardTarget(
70832
- { cards, columns, lanes, heldBy: o.heldBy, selfId: o.selfId },
71387
+ { cards, columns, lanes, heldBy: o.heldBy, selfId: o.selfId, maxItems: o.maxItems },
70833
71388
  drag.to ?? drag.from,
70834
71389
  card.id,
70835
71390
  dir2
@@ -70898,11 +71453,11 @@ function useTaskBoardKeyboard(o) {
70898
71453
  }
70899
71454
 
70900
71455
  // src/components/TaskBoard/useTaskBoardColumnDrag.ts
70901
- import { useCallback as useCallback48, useEffect as useEffect76, useLayoutEffect as useLayoutEffect25, useMemo as useMemo64, useRef as useRef74, useState as useState88 } from "react";
71456
+ import { useCallback as useCallback48, useEffect as useEffect76, useLayoutEffect as useLayoutEffect25, useMemo as useMemo64, useRef as useRef74, useState as useState90 } from "react";
70902
71457
  var DRAG_THRESHOLD_PX2 = 4;
70903
71458
  var isRtl2 = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
70904
71459
  function useTaskBoardColumnDrag(opts) {
70905
- const [drag, setDrag] = useState88(null);
71460
+ const [drag, setDrag] = useState90(null);
70906
71461
  const optsRef = useRef74(opts);
70907
71462
  optsRef.current = opts;
70908
71463
  const dragRef = useRef74(null);
@@ -71079,10 +71634,10 @@ function useFlip(rootRef, orderKey) {
71079
71634
  }
71080
71635
 
71081
71636
  // src/components/TaskBoard/useTaskBoardCollab.ts
71082
- import { useCallback as useCallback49, useEffect as useEffect77, useMemo as useMemo65, useRef as useRef76, useState as useState89 } from "react";
71637
+ import { useCallback as useCallback49, useEffect as useEffect77, useMemo as useMemo65, useRef as useRef76, useState as useState91 } from "react";
71083
71638
  var EXPIRE_TICK_MS = 1e3;
71084
71639
  function useTaskBoardCollab(transport, currentUser) {
71085
- const [presence, setPresence] = useState89(emptyPresence);
71640
+ const [presence, setPresence] = useState91(emptyPresence);
71086
71641
  const active = Boolean(transport && currentUser);
71087
71642
  const mountedRef = useRef76(false);
71088
71643
  const userRef = useRef76(currentUser);
@@ -71199,14 +71754,14 @@ function safePublish(transport, event) {
71199
71754
  }
71200
71755
 
71201
71756
  // src/components/TaskBoard/TaskBoardRemoteGhosts.tsx
71202
- import { useLayoutEffect as useLayoutEffect27, useState as useState90 } from "react";
71757
+ import { useLayoutEffect as useLayoutEffect27, useState as useState92 } from "react";
71203
71758
  import { createPortal as createPortal18 } from "react-dom";
71204
71759
  import classNames134 from "classnames";
71205
- import { Fragment as Fragment51, jsx as jsx326, jsxs as jsxs202 } from "react/jsx-runtime";
71760
+ import { Fragment as Fragment51, jsx as jsx326, jsxs as jsxs203 } from "react/jsx-runtime";
71206
71761
  var GHOST_HEIGHT = 40;
71207
71762
  var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
71208
- const [ghosts, setGhosts] = useState90([]);
71209
- const [tick, setTick] = useState90(0);
71763
+ const [ghosts, setGhosts] = useState92([]);
71764
+ const [tick, setTick] = useState92(0);
71210
71765
  useLayoutEffect27(() => {
71211
71766
  const root = rootRef.current;
71212
71767
  if (!root) return;
@@ -71250,7 +71805,7 @@ var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
71250
71805
  return createPortal18(
71251
71806
  /* @__PURE__ */ jsx326(Fragment51, { children: ghosts.map((g) => {
71252
71807
  const tokens = getTaskBoardPeerTokens(g.peer.color ?? peerColor(g.peer.id));
71253
- return /* @__PURE__ */ jsxs202(
71808
+ return /* @__PURE__ */ jsxs203(
71254
71809
  "div",
71255
71810
  {
71256
71811
  "data-taskboard-ghost": true,
@@ -71276,9 +71831,9 @@ var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
71276
71831
 
71277
71832
  // src/components/TaskBoard/TaskBoardSkeleton.tsx
71278
71833
  import classNames135 from "classnames";
71279
- import { jsx as jsx327, jsxs as jsxs203 } from "react/jsx-runtime";
71834
+ import { jsx as jsx327, jsxs as jsxs204 } from "react/jsx-runtime";
71280
71835
  var CARD_HEIGHTS = [[72, 96, 64], [88, 64], [64, 104, 72], [96, 72, 88, 64], [72]];
71281
- var TaskBoardSkeleton = ({ columns, columnWidth, wellSurface, cornerClass }) => /* @__PURE__ */ jsx327("div", { "data-taskboard-skeleton": true, "aria-hidden": "true", className: "flex min-h-0 flex-1 gap-3 overflow-hidden p-3", children: Array.from({ length: Math.max(1, columns) }, (_, i) => /* @__PURE__ */ jsxs203(
71836
+ var TaskBoardSkeleton = ({ columns, columnWidth, wellSurface, cornerClass }) => /* @__PURE__ */ jsx327("div", { "data-taskboard-skeleton": true, "aria-hidden": "true", className: "flex min-h-0 flex-1 gap-3 overflow-hidden p-3", children: Array.from({ length: Math.max(1, columns) }, (_, i) => /* @__PURE__ */ jsxs204(
71282
71837
  "div",
71283
71838
  {
71284
71839
  style: { width: columnWidth },
@@ -71338,7 +71893,9 @@ var KEYS = {
71338
71893
  acceptsFrom: "kit.taskboard.acceptsFrom",
71339
71894
  acceptsAny: "kit.taskboard.acceptsAny",
71340
71895
  save: "kit.taskboard.save",
71341
- cancel: "kit.taskboard.cancel"
71896
+ cancel: "kit.taskboard.cancel",
71897
+ maxItems: "kit.taskboard.maxItems",
71898
+ maxItemsHint: "kit.taskboard.maxItemsHint"
71342
71899
  };
71343
71900
  var interpolate = (s, values) => values ? s.replace(/\{(\w+)\}/g, (m, k) => k in values ? String(values[k]) : m) : s;
71344
71901
  function useTaskBoardText(labels) {
@@ -71353,7 +71910,7 @@ function useTaskBoardText(labels) {
71353
71910
  }
71354
71911
 
71355
71912
  // src/components/TaskBoard/TaskBoard.tsx
71356
- import { jsx as jsx328, jsxs as jsxs204 } from "react/jsx-runtime";
71913
+ import { jsx as jsx328, jsxs as jsxs205 } from "react/jsx-runtime";
71357
71914
  var NOTICE_MS = 2e3;
71358
71915
  var SOLID_CARD = "bg-white shadow-sm ring-1 ring-black/5 dark:bg-neutral-900 dark:ring-white/10";
71359
71916
  var GLASS_CARD = "bg-white/70 shadow-sm ring-1 ring-white/60 backdrop-blur-md dark:bg-white/10 dark:ring-white/10";
@@ -71376,6 +71933,7 @@ var TaskBoardBody = (props) => {
71376
71933
  onBeforeMove,
71377
71934
  editable,
71378
71935
  editMode = false,
71936
+ maxItems,
71379
71937
  onCardOpen,
71380
71938
  onCardContextMenu,
71381
71939
  onAddCard,
@@ -71419,13 +71977,14 @@ var TaskBoardBody = (props) => {
71419
71977
  editable: isEditable,
71420
71978
  heldBy: collab.heldBy,
71421
71979
  selfId,
71980
+ maxItems,
71422
71981
  onBeforeMove,
71423
71982
  onCommit: commitMove,
71424
71983
  onDragStart: collab.grab,
71425
71984
  onDragTarget: (cardId, slot) => slot && collab.hover(cardId, slot),
71426
71985
  onDragEnd: collab.release
71427
71986
  });
71428
- const [notice, setNotice] = useState91(null);
71987
+ const [notice, setNotice] = useState93(null);
71429
71988
  useEffect78(() => {
71430
71989
  if (!drag || !selfId) return;
71431
71990
  const holder = collab.heldBy.get(drag.cardId);
@@ -71453,6 +72012,7 @@ var TaskBoardBody = (props) => {
71453
72012
  cancel,
71454
72013
  heldBy: collab.heldBy,
71455
72014
  selfId,
72015
+ maxItems,
71456
72016
  onCardContextMenu,
71457
72017
  selectedIds,
71458
72018
  onSelectionChange
@@ -71503,6 +72063,7 @@ var TaskBoardBody = (props) => {
71503
72063
  draggingColumnId: columnDrag.drag?.id ?? null,
71504
72064
  onEditColumn: columnEditing ? editColumn : void 0,
71505
72065
  allColumns: columns,
72066
+ boardMaxItems: maxItems,
71506
72067
  stickySurface: surface.translucent ? GLASS_STICKY : SOLID_STICKY,
71507
72068
  cardState: (card) => ({
71508
72069
  held: heldPeer(card.id),
@@ -71516,7 +72077,7 @@ var TaskBoardBody = (props) => {
71516
72077
  cardProps: (card, slot) => ({ ...isEditable ? cardHandlers(card, slot) : {}, ...keyboardProps(card, slot) }),
71517
72078
  dropTarget: drag?.to && !drag.valid ? { bucket: bucketKey(drag.to.column, drag.to.lane), index: drag.to.index, valid: false } : null
71518
72079
  }),
71519
- [text, surface, color, sizeTokens12, cardLayout, priorities, locale, isEditable, renderCard, onCardOpen, onCardContextMenu, onAddCard, wellSurface, columnCornerClass, columnEditing, columnDrag.gripProps, columnDrag.drag, editColumn, columns, selected, drag, pending, cardHandlers, keyboardProps, heldPeer, notice]
72080
+ [text, surface, color, sizeTokens12, cardLayout, priorities, locale, isEditable, renderCard, onCardOpen, onCardContextMenu, onAddCard, wellSurface, columnCornerClass, columnEditing, columnDrag.gripProps, columnDrag.drag, editColumn, columns, maxItems, selected, drag, pending, cardHandlers, keyboardProps, heldPeer, notice]
71520
72081
  );
71521
72082
  const buckets = useMemo66(() => bucketCards(previewCards, columns, viewLanes), [previewCards, columns, viewLanes]);
71522
72083
  const draggedCard = drag ? cards.find((c) => c.id === drag.cardId) : void 0;
@@ -71536,12 +72097,12 @@ var TaskBoardBody = (props) => {
71536
72097
  }
71537
72098
  );
71538
72099
  } else if (error) {
71539
- content = /* @__PURE__ */ jsxs204("div", { role: "alert", className: "flex flex-1 flex-col items-center justify-center gap-3 p-10 text-center", children: [
72100
+ content = /* @__PURE__ */ jsxs205("div", { role: "alert", className: "flex flex-1 flex-col items-center justify-center gap-3 p-10 text-center", children: [
71540
72101
  /* @__PURE__ */ jsx328("p", { className: classNames136("text-sm font-medium", surface.body), children: error === true ? text("error") : error }),
71541
72102
  onRetry && /* @__PURE__ */ jsx328(Button_default, { size: "sm", variant: "outline", color, onClick: onRetry, children: text("retry") })
71542
72103
  ] });
71543
72104
  } else {
71544
- content = /* @__PURE__ */ jsxs204("div", { className: "flex min-h-0 flex-1 flex-col", children: [
72105
+ content = /* @__PURE__ */ jsxs205("div", { className: "flex min-h-0 flex-1 flex-col", children: [
71545
72106
  cards.length === 0 && /* @__PURE__ */ jsx328("div", { "data-taskboard-empty": true, className: classNames136("px-4 pt-4 text-center text-sm", surface.muted), children: emptyState ?? text("empty") }),
71546
72107
  laneView ? /* @__PURE__ */ jsx328(
71547
72108
  TaskBoardLaneGrid,
@@ -71562,7 +72123,7 @@ var TaskBoardBody = (props) => {
71562
72123
  tabIndex: -1,
71563
72124
  className: "min-h-0 flex-1",
71564
72125
  contentClassName: "flex! h-full",
71565
- children: /* @__PURE__ */ jsxs204("div", { "data-taskboard-columns": true, className: "flex w-max items-stretch gap-3 p-3", children: [
72126
+ children: /* @__PURE__ */ jsxs205("div", { "data-taskboard-columns": true, className: "flex w-max items-stretch gap-3 p-3", children: [
71566
72127
  viewColumns.map((col, index) => /* @__PURE__ */ jsx328(
71567
72128
  TaskBoardColumn,
71568
72129
  {
@@ -71580,8 +72141,8 @@ var TaskBoardBody = (props) => {
71580
72141
  )
71581
72142
  ] });
71582
72143
  }
71583
- return /* @__PURE__ */ jsxs204(TaskBoardContext.Provider, { value: ctx, children: [
71584
- /* @__PURE__ */ jsxs204(
72144
+ return /* @__PURE__ */ jsxs205(TaskBoardContext.Provider, { value: ctx, children: [
72145
+ /* @__PURE__ */ jsxs205(
71585
72146
  "div",
71586
72147
  {
71587
72148
  ref: rootRef,
@@ -71669,19 +72230,681 @@ var TaskBoard = (props) => {
71669
72230
  );
71670
72231
  };
71671
72232
 
71672
- // src/contexts/BottomSheetContext.tsx
72233
+ // src/components/GradientBackdrop/GradientBackdrop.tsx
72234
+ import React104, { useMemo as useMemo67 } from "react";
72235
+ import classNames137 from "classnames";
72236
+
72237
+ // ../common/backdrop/color.ts
72238
+ var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
72239
+ var toGamma = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055;
72240
+ function parseHex(hex2) {
72241
+ const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex2.trim());
72242
+ if (!m) throw new Error(`Expected a hex colour (#rgb or #rrggbb), got "${hex2}"`);
72243
+ const h = m[1].length === 3 ? m[1].replace(/./g, (c) => c + c) : m[1];
72244
+ const n = parseInt(h, 16);
72245
+ return [n >> 16 & 255, n >> 8 & 255, n & 255];
72246
+ }
72247
+ function hexToOklch(hex2) {
72248
+ const [r, g, b] = parseHex(hex2).map((v) => toLinear(v / 255));
72249
+ const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
72250
+ const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
72251
+ const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
72252
+ const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
72253
+ const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
72254
+ const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
72255
+ const H = Math.atan2(B, A) * 180 / Math.PI;
72256
+ return { L, C: Math.hypot(A, B), H: H < 0 ? H + 360 : H };
72257
+ }
72258
+ function oklchToLinear({ L, C, H }) {
72259
+ const h = H * Math.PI / 180;
72260
+ const A = C * Math.cos(h);
72261
+ const B = C * Math.sin(h);
72262
+ const l = (L + 0.3963377774 * A + 0.2158037573 * B) ** 3;
72263
+ const m = (L - 0.1055613458 * A - 0.0638541728 * B) ** 3;
72264
+ const s = (L - 0.0894841775 * A - 1.291485548 * B) ** 3;
72265
+ return [
72266
+ 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
72267
+ -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
72268
+ -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s
72269
+ ];
72270
+ }
72271
+ var inGamut = (rgb) => rgb.every((c) => c >= -1e-4 && c <= 1 + 1e-4);
72272
+ function oklchToHex(color) {
72273
+ const L = Math.min(1, Math.max(0, color.L));
72274
+ let rgb = oklchToLinear({ ...color, L });
72275
+ if (!inGamut(rgb)) {
72276
+ let lo = 0;
72277
+ let hi = color.C;
72278
+ for (let i = 0; i < 24; i++) {
72279
+ const mid = (lo + hi) / 2;
72280
+ if (inGamut(oklchToLinear({ L, C: mid, H: color.H }))) lo = mid;
72281
+ else hi = mid;
72282
+ }
72283
+ rgb = oklchToLinear({ L, C: lo, H: color.H });
72284
+ }
72285
+ return "#" + rgb.map((c) => Math.round(Math.min(1, Math.max(0, toGamma(Math.min(1, Math.max(0, c))))) * 255)).map((v) => v.toString(16).padStart(2, "0")).join("");
72286
+ }
72287
+ function hexToRgba(hex2, alpha) {
72288
+ const [r, g, b] = parseHex(hex2);
72289
+ return `rgba(${r},${g},${b},${alpha})`;
72290
+ }
72291
+
72292
+ // ../common/backdrop/gradient.ts
72293
+ var GRADIENT_BACKDROP_TEMPLATE_IDS = ["slate", "mist", "stone", "dune", "fog", "graphite"];
72294
+ var shape = (angle, viaStop, glowWidth, glowHeight, glowX, glowY, glowFade) => ({ angle, viaStop, glowWidth, glowHeight, glowX, glowY, glowFade });
72295
+ var GRADIENT_BACKDROP_TEMPLATES = {
72296
+ slate: {
72297
+ label: "Slate",
72298
+ light: { glow: "#e2e8f0", from: "#f8fafc", via: "#e2e8f0", to: "#cbd5e1" },
72299
+ dark: { glow: "#334155", from: "#0f172a", via: "#1e293b", to: "#334155" },
72300
+ shape: shape(135, 55, 1100, 560, 18, -8, 62)
72301
+ },
72302
+ mist: {
72303
+ label: "Mist",
72304
+ light: { glow: "#dbeafe", from: "#f8fafc", via: "#e6edf5", to: "#d3dde9" },
72305
+ dark: { glow: "#16304f", from: "#0b1220", via: "#16202e", to: "#1f2c3d" },
72306
+ shape: shape(160, 55, 900, 500, 82, 8, 58)
72307
+ },
72308
+ stone: {
72309
+ label: "Stone",
72310
+ light: { glow: "#e7e5e4", from: "#fafaf9", via: "#e7e5e4", to: "#d6d3d1" },
72311
+ dark: { glow: "#292524", from: "#1c1917", via: "#292524", to: "#44403c" },
72312
+ shape: shape(135, 55, 1e3, 560, 14, 108, 62)
72313
+ },
72314
+ dune: {
72315
+ label: "Dune",
72316
+ light: { glow: "#ece7df", from: "#f7f4ef", via: "#ece7df", to: "#ded5c8" },
72317
+ dark: { glow: "#221e1a", from: "#141210", via: "#221e1a", to: "#35302a" },
72318
+ shape: shape(180, 55, 900, 480, 50, 118, 60)
72319
+ },
72320
+ fog: {
72321
+ label: "Fog",
72322
+ light: { glow: "#e2e8f0", from: "#f5f7fa", via: "#e8edf3", to: "#f5f7fa" },
72323
+ dark: { glow: "#1e293b", from: "#0f1420", via: "#1a2332", to: "#0f1420" },
72324
+ shape: shape(120, 50, 820, 420, 50, 118, 60)
72325
+ },
72326
+ graphite: {
72327
+ label: "Graphite",
72328
+ light: { glow: "#d1d5db", from: "#e5e7eb", via: "#d1d5db", to: "#9ca3af" },
72329
+ dark: { glow: "#3f3f46", from: "#18181b", via: "#27272a", to: "#3f3f46" },
72330
+ shape: shape(135, 45, 1e3, 520, 22, -10, 60)
72331
+ }
72332
+ };
72333
+ var GRADIENT_BACKDROP_DERIVATION = {
72334
+ glow: { toDark: [1.5005, -1.3003], toLight: [0.9904, -0.2338] },
72335
+ from: { toDark: [0.3317, -0.1368], toLight: [1.0358, -0.3275] },
72336
+ via: { toDark: [0.5799, -0.3472], toLight: [1.1357, -0.8186] },
72337
+ to: { toDark: [0.8527, -0.6169], toLight: [1.1453, -0.8766] }
72338
+ };
72339
+ var DARK_CHROMA_GAIN = 2;
72340
+ var DARK_CHROMA_MAX = 0.08;
72341
+ var clampL = (L) => Math.min(0.99, Math.max(0.05, L));
72342
+ function deriveDarkColor(hex2, role = "via") {
72343
+ const c = hexToOklch(hex2);
72344
+ const [a, b] = GRADIENT_BACKDROP_DERIVATION[role].toDark;
72345
+ return oklchToHex({ L: clampL(a + b * c.L), C: Math.min(c.C * DARK_CHROMA_GAIN, DARK_CHROMA_MAX), H: c.H });
72346
+ }
72347
+ function deriveLightColor(hex2, role = "via") {
72348
+ const c = hexToOklch(hex2);
72349
+ const [a, b] = GRADIENT_BACKDROP_DERIVATION[role].toLight;
72350
+ return oklchToHex({ L: clampL(a + b * c.L), C: c.C / DARK_CHROMA_GAIN, H: c.H });
72351
+ }
72352
+ var ROLES = ["glow", "from", "via", "to"];
72353
+ var derive = (colors3, fn) => Object.fromEntries(ROLES.map((r) => [r, fn(colors3[r], r)]));
72354
+ function resolveGradientBackdropTheme(theme = "slate") {
72355
+ if (typeof theme === "string") return GRADIENT_BACKDROP_TEMPLATES[theme] ?? GRADIENT_BACKDROP_TEMPLATES.slate;
72356
+ const base = GRADIENT_BACKDROP_TEMPLATES.slate;
72357
+ const shapeOut = { ...base.shape, ...theme.shape };
72358
+ if (!theme.light && !theme.dark) return { ...base, label: theme.label ?? base.label, shape: shapeOut };
72359
+ const light = theme.light ?? derive(theme.dark, deriveLightColor);
72360
+ const dark = theme.dark ?? derive(theme.light, deriveDarkColor);
72361
+ return { label: theme.label, light, dark, shape: shapeOut };
72362
+ }
72363
+ function gradientBackdropCss(colors3, s) {
72364
+ return `radial-gradient(${s.glowWidth}px ${s.glowHeight}px at ${s.glowX}% ${s.glowY}%, ${colors3.glow} 0%, ${hexToRgba(colors3.glow, 0)} ${s.glowFade}%), linear-gradient(${s.angle}deg, ${colors3.from} 0%, ${colors3.via} ${s.viaStop}%, ${colors3.to} 100%)`;
72365
+ }
72366
+
72367
+ // src/components/GradientBackdrop/GradientBackdrop.tsx
72368
+ import { jsx as jsx329 } from "react/jsx-runtime";
72369
+ var GRADIENT_BACKDROP_SCHEMES = ["auto", "light", "dark"];
72370
+ var GradientBackdrop = React104.forwardRef(
72371
+ ({ theme = "slate", scheme = "auto", className, style, children, ...rest }, ref) => {
72372
+ const themeKey = typeof theme === "string" ? theme : JSON.stringify(theme);
72373
+ const resolved = useMemo67(() => {
72374
+ const t = resolveGradientBackdropTheme(theme);
72375
+ return { light: gradientBackdropCss(t.light, t.shape), dark: gradientBackdropCss(t.dark, t.shape) };
72376
+ }, [themeKey]);
72377
+ const backdropStyle = scheme === "auto" ? { "--gradient-backdrop-light": resolved.light, "--gradient-backdrop-dark": resolved.dark } : { background: resolved[scheme] };
72378
+ return /* @__PURE__ */ jsx329(
72379
+ "div",
72380
+ {
72381
+ ref,
72382
+ ...rest,
72383
+ "data-gradient-backdrop": true,
72384
+ "data-theme": typeof theme === "string" ? theme : "custom",
72385
+ "data-scheme": scheme,
72386
+ className: classNames137(
72387
+ "relative",
72388
+ scheme === "auto" && "[background:var(--gradient-backdrop-light)] dark:[background:var(--gradient-backdrop-dark)]",
72389
+ className
72390
+ ),
72391
+ style: { ...backdropStyle, ...style },
72392
+ children
72393
+ }
72394
+ );
72395
+ }
72396
+ );
72397
+ GradientBackdrop.displayName = "GradientBackdrop";
72398
+
72399
+ // src/components/Terminal/Terminal.tsx
72400
+ import classNames138 from "classnames";
72401
+ import { forwardRef as forwardRef164 } from "react";
72402
+
72403
+ // src/components/Terminal/TerminalViewport.tsx
71673
72404
  import {
71674
- createContext as createContext9,
72405
+ forwardRef as forwardRef163,
71675
72406
  useCallback as useCallback52,
71676
- useContext as useContext9,
71677
72407
  useEffect as useEffect79,
71678
- useMemo as useMemo67,
72408
+ useImperativeHandle as useImperativeHandle4,
72409
+ useMemo as useMemo68,
71679
72410
  useRef as useRef78,
71680
- useState as useState92
72411
+ useState as useState94
72412
+ } from "react";
72413
+
72414
+ // src/components/Terminal/engine.ts
72415
+ async function loadTerminalEngine() {
72416
+ const [{ Terminal: Terminal3 }, { FitAddon }] = await Promise.all([
72417
+ import("@xterm/xterm"),
72418
+ import("@xterm/addon-fit")
72419
+ ]);
72420
+ return { Terminal: Terminal3, FitAddon };
72421
+ }
72422
+
72423
+ // src/components/Terminal/themes.ts
72424
+ var TERMINAL_LIGHT_THEME = {
72425
+ background: "#00000000",
72426
+ foreground: "#1e293b",
72427
+ cursor: "#2563eb",
72428
+ selectionBackground: "#3b82f640",
72429
+ black: "#334155",
72430
+ red: "#dc2626",
72431
+ green: "#15803d",
72432
+ yellow: "#a16207",
72433
+ blue: "#2563eb",
72434
+ magenta: "#9333ea",
72435
+ cyan: "#0e7490",
72436
+ white: "#cbd5e1",
72437
+ brightBlack: "#64748b",
72438
+ brightRed: "#ef4444",
72439
+ brightGreen: "#16a34a",
72440
+ brightYellow: "#ca8a04",
72441
+ brightBlue: "#3b82f6",
72442
+ brightMagenta: "#a855f7",
72443
+ brightCyan: "#0891b2",
72444
+ brightWhite: "#f8fafc"
72445
+ };
72446
+ var TERMINAL_DARK_THEME = {
72447
+ background: "#00000000",
72448
+ foreground: "#e2e8f0",
72449
+ cursor: "#38bdf8",
72450
+ selectionBackground: "#60a5fa50",
72451
+ black: "#334155",
72452
+ red: "#f87171",
72453
+ green: "#34d399",
72454
+ yellow: "#fbbf24",
72455
+ blue: "#60a5fa",
72456
+ magenta: "#c084fc",
72457
+ cyan: "#22d3ee",
72458
+ white: "#e2e8f0",
72459
+ brightBlack: "#94a3b8",
72460
+ brightRed: "#fca5a5",
72461
+ brightGreen: "#6ee7b7",
72462
+ brightYellow: "#fde68a",
72463
+ brightBlue: "#93c5fd",
72464
+ brightMagenta: "#d8b4fe",
72465
+ brightCyan: "#67e8f9",
72466
+ brightWhite: "#ffffff"
72467
+ };
72468
+
72469
+ // src/components/Terminal/TerminalViewport.tsx
72470
+ import { jsx as jsx330 } from "react/jsx-runtime";
72471
+ var TerminalViewport = forwardRef163(function TerminalViewport2(props, ref) {
72472
+ const host = useRef78(null);
72473
+ const engine = useRef78(null);
72474
+ const fitAddon = useRef78(null);
72475
+ const [scroll, setScroll] = useState94({
72476
+ contentSize: 0,
72477
+ viewportSize: 0,
72478
+ offset: 0
72479
+ });
72480
+ const scrollTo = useCallback52(
72481
+ (offset) => engine.current?.scrollToLine(Math.round(offset)),
72482
+ []
72483
+ );
72484
+ const virtualScroll = useMemo68(
72485
+ () => ({ ...scroll, onScroll: scrollTo }),
72486
+ [scroll, scrollTo]
72487
+ );
72488
+ const latest = useRef78(props);
72489
+ latest.current = props;
72490
+ const initialData = useRef78(props.initialData);
72491
+ const pending = useRef78([]);
72492
+ const handle = useMemo68(
72493
+ () => ({
72494
+ write(data) {
72495
+ if (engine.current) engine.current.write(data);
72496
+ else pending.current.push({ data, newline: false });
72497
+ },
72498
+ writeln(data) {
72499
+ if (engine.current) engine.current.writeln(data);
72500
+ else pending.current.push({ data, newline: true });
72501
+ },
72502
+ clear() {
72503
+ pending.current = [];
72504
+ engine.current?.clear();
72505
+ },
72506
+ reset() {
72507
+ pending.current = [];
72508
+ engine.current?.reset();
72509
+ },
72510
+ focus() {
72511
+ engine.current?.focus();
72512
+ },
72513
+ fit() {
72514
+ if (host.current?.clientWidth && host.current?.clientHeight)
72515
+ fitAddon.current?.fit();
72516
+ }
72517
+ }),
72518
+ []
72519
+ );
72520
+ useImperativeHandle4(ref, () => handle, [handle]);
72521
+ const applyOptions = () => {
72522
+ const term = engine.current;
72523
+ if (!term) return;
72524
+ const p = latest.current;
72525
+ const dark = p.scheme === "dark" || (p.scheme ?? "auto") === "auto" && Boolean(host.current?.closest(".dark"));
72526
+ term.options = {
72527
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
72528
+ fontSize: 14,
72529
+ cursorBlink: true,
72530
+ screenReaderMode: true,
72531
+ scrollback: 5e3,
72532
+ ...p.options,
72533
+ disableStdin: p.readOnly ?? false,
72534
+ theme: {
72535
+ ...dark ? TERMINAL_DARK_THEME : TERMINAL_LIGHT_THEME,
72536
+ ...p.terminalTheme
72537
+ }
72538
+ };
72539
+ };
72540
+ const updateOptions = useRef78(applyOptions);
72541
+ updateOptions.current = applyOptions;
72542
+ useEffect79(() => {
72543
+ let cancelled = false;
72544
+ let initialized = false;
72545
+ let instance;
72546
+ let observer;
72547
+ let themeObserver;
72548
+ let frame = 0;
72549
+ const disposables = [];
72550
+ const scheduleFit = () => {
72551
+ cancelAnimationFrame(frame);
72552
+ frame = requestAnimationFrame(() => handle.fit());
72553
+ };
72554
+ void loadTerminalEngine().then(({ Terminal: Terminal3, FitAddon }) => {
72555
+ if (cancelled || !host.current) return;
72556
+ instance = new Terminal3({ allowTransparency: true });
72557
+ engine.current = instance;
72558
+ updateOptions.current();
72559
+ const fit = new FitAddon();
72560
+ fitAddon.current = fit;
72561
+ instance.loadAddon(fit);
72562
+ instance.open(host.current);
72563
+ const syncScroll = () => {
72564
+ if (!instance || cancelled) return;
72565
+ const buffer = instance.buffer.active;
72566
+ const next = {
72567
+ contentSize: buffer.baseY + instance.rows,
72568
+ viewportSize: instance.rows,
72569
+ offset: buffer.viewportY
72570
+ };
72571
+ setScroll(
72572
+ (previous) => previous.contentSize === next.contentSize && previous.viewportSize === next.viewportSize && previous.offset === next.offset ? previous : next
72573
+ );
72574
+ };
72575
+ disposables.push(
72576
+ instance.onScroll(syncScroll),
72577
+ instance.onWriteParsed(syncScroll)
72578
+ );
72579
+ disposables.push(
72580
+ instance.onData((data) => latest.current.onData?.(data))
72581
+ );
72582
+ disposables.push(
72583
+ instance.onResize((size) => {
72584
+ latest.current.onResize?.(size);
72585
+ syncScroll();
72586
+ })
72587
+ );
72588
+ if (initialData.current !== void 0)
72589
+ instance.write(initialData.current);
72590
+ for (const entry of pending.current) {
72591
+ if (entry.newline) instance.writeln(entry.data);
72592
+ else instance.write(entry.data);
72593
+ }
72594
+ pending.current = [];
72595
+ if (typeof ResizeObserver !== "undefined") {
72596
+ observer = new ResizeObserver(scheduleFit);
72597
+ observer.observe(host.current);
72598
+ }
72599
+ window.addEventListener("resize", scheduleFit);
72600
+ themeObserver = new MutationObserver(() => {
72601
+ updateOptions.current();
72602
+ scheduleFit();
72603
+ });
72604
+ for (let node = host.current; node; node = node.parentElement) {
72605
+ themeObserver.observe(node, {
72606
+ attributes: true,
72607
+ attributeFilter: ["class"]
72608
+ });
72609
+ }
72610
+ handle.fit();
72611
+ syncScroll();
72612
+ initialized = true;
72613
+ latest.current.onReady?.(handle);
72614
+ }).catch((error) => {
72615
+ if (!cancelled)
72616
+ latest.current.onError?.(
72617
+ error instanceof Error ? error : new Error(String(error))
72618
+ );
72619
+ });
72620
+ return () => {
72621
+ cancelled = true;
72622
+ cancelAnimationFrame(frame);
72623
+ observer?.disconnect();
72624
+ themeObserver?.disconnect();
72625
+ window.removeEventListener("resize", scheduleFit);
72626
+ disposables.forEach((d) => d.dispose());
72627
+ instance?.dispose();
72628
+ if (initialized) latest.current.onDispose?.();
72629
+ engine.current = null;
72630
+ fitAddon.current = null;
72631
+ };
72632
+ }, [handle]);
72633
+ useEffect79(() => {
72634
+ updateOptions.current();
72635
+ if (props.active !== false) handle.fit();
72636
+ }, [
72637
+ props.options,
72638
+ props.terminalTheme,
72639
+ props.scheme,
72640
+ props.readOnly,
72641
+ props.active,
72642
+ handle
72643
+ ]);
72644
+ return /* @__PURE__ */ jsx330(
72645
+ ScrollArea_default,
72646
+ {
72647
+ variant: "hover",
72648
+ horizontal: false,
72649
+ tabIndex: -1,
72650
+ virtualScroll,
72651
+ className: "h-full min-h-0 w-full",
72652
+ contentClassName: "h-full",
72653
+ children: /* @__PURE__ */ jsx330(
72654
+ "div",
72655
+ {
72656
+ ref: host,
72657
+ className: "kit-terminal-viewport h-full min-h-0 min-w-0 w-full",
72658
+ style: { backgroundColor: props.terminalTheme?.background },
72659
+ role: "group",
72660
+ "aria-label": props.ariaLabel ?? "Terminal"
72661
+ }
72662
+ )
72663
+ }
72664
+ );
72665
+ });
72666
+
72667
+ // src/components/Terminal/Terminal.tsx
72668
+ import { jsx as jsx331 } from "react/jsx-runtime";
72669
+ var Terminal = forwardRef164(
72670
+ function Terminal2({
72671
+ initialData,
72672
+ readOnly,
72673
+ scheme,
72674
+ terminalTheme,
72675
+ options,
72676
+ onData,
72677
+ onResize,
72678
+ onReady,
72679
+ onError,
72680
+ onDispose,
72681
+ ariaLabel,
72682
+ height = 320,
72683
+ style,
72684
+ padding = "sm",
72685
+ variant = "outlined",
72686
+ tone = "neutral",
72687
+ ...surface
72688
+ }, ref) {
72689
+ return /* @__PURE__ */ jsx331(
72690
+ Panel_default,
72691
+ {
72692
+ ...surface,
72693
+ "data-color-scheme": scheme ?? "auto",
72694
+ className: classNames138(surface.className, scheme === "dark" && "dark"),
72695
+ variant,
72696
+ tone,
72697
+ padding,
72698
+ flexBody: true,
72699
+ scrollable: false,
72700
+ style: {
72701
+ height,
72702
+ colorScheme: scheme === "auto" ? void 0 : scheme,
72703
+ ...style
72704
+ },
72705
+ children: /* @__PURE__ */ jsx331(
72706
+ TerminalViewport,
72707
+ {
72708
+ ref,
72709
+ ...{
72710
+ initialData,
72711
+ readOnly,
72712
+ scheme,
72713
+ terminalTheme,
72714
+ options,
72715
+ onData,
72716
+ onResize,
72717
+ onReady,
72718
+ onError,
72719
+ onDispose,
72720
+ ariaLabel
72721
+ }
72722
+ }
72723
+ )
72724
+ }
72725
+ );
72726
+ }
72727
+ );
72728
+
72729
+ // src/components/Terminal/TerminalTabs.tsx
72730
+ import classNames139 from "classnames";
72731
+ import {
72732
+ forwardRef as forwardRef165,
72733
+ useEffect as useEffect80,
72734
+ useId as useId46,
72735
+ useImperativeHandle as useImperativeHandle5,
72736
+ useRef as useRef79,
72737
+ useState as useState95
72738
+ } from "react";
72739
+ import { jsx as jsx332, jsxs as jsxs206 } from "react/jsx-runtime";
72740
+ var TerminalTabs = forwardRef165(
72741
+ function TerminalTabs2({
72742
+ sessions,
72743
+ value,
72744
+ defaultValue,
72745
+ onValueChange,
72746
+ onAdd,
72747
+ onClose,
72748
+ onData,
72749
+ onResize,
72750
+ onReady,
72751
+ onError,
72752
+ onDispose,
72753
+ height = 360,
72754
+ style,
72755
+ variant = "outlined",
72756
+ tone = "neutral",
72757
+ padding = "sm",
72758
+ readOnly,
72759
+ scheme,
72760
+ terminalTheme,
72761
+ options,
72762
+ ariaLabel = "Terminal sessions",
72763
+ addLabel = "New terminal",
72764
+ closeLabel = "Close terminal",
72765
+ emptyState = "No terminal sessions",
72766
+ ...surface
72767
+ }, ref) {
72768
+ const prefix = useId46();
72769
+ const [selected, setSelected] = useState95(defaultValue ?? sessions[0]?.id);
72770
+ const requested = value ?? selected;
72771
+ const active = sessions.find((session) => session.id === requested) ?? sessions[0];
72772
+ const activeId = active?.id;
72773
+ const handles = useRef79(/* @__PURE__ */ new Map());
72774
+ useImperativeHandle5(
72775
+ ref,
72776
+ () => ({ getSession: (id) => handles.current.get(id) }),
72777
+ []
72778
+ );
72779
+ useEffect80(() => {
72780
+ if (value === void 0 && selected !== activeId) setSelected(activeId);
72781
+ }, [value, selected, activeId]);
72782
+ return /* @__PURE__ */ jsx332(
72783
+ Panel_default,
72784
+ {
72785
+ ...surface,
72786
+ "data-color-scheme": scheme ?? "auto",
72787
+ className: classNames139(surface.className, scheme === "dark" && "dark"),
72788
+ ...{ variant, tone, padding },
72789
+ flexBody: true,
72790
+ scrollable: false,
72791
+ style: {
72792
+ height,
72793
+ colorScheme: scheme === "auto" ? void 0 : scheme,
72794
+ ...{
72795
+ "--terminal-tab-color": `var(--color-${tone}-600)`,
72796
+ "--terminal-tab-text": `var(--color-${tone}-800)`,
72797
+ "--terminal-tab-text-dark": `var(--color-${tone}-200)`
72798
+ },
72799
+ ...style
72800
+ },
72801
+ children: /* @__PURE__ */ jsxs206("div", { className: "flex h-full min-h-0 flex-1 flex-col", children: [
72802
+ /* @__PURE__ */ jsxs206("div", { className: "flex shrink-0 items-start gap-2 border-b border-neutral-200 dark:border-neutral-700", children: [
72803
+ /* @__PURE__ */ jsx332("div", { className: "min-w-0 flex-1", role: "group", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx332(
72804
+ Tabs_default,
72805
+ {
72806
+ size: "sm",
72807
+ className: "kit-terminal-tabs font-mono",
72808
+ variant: "minimal",
72809
+ color: tone,
72810
+ value: active ? `${prefix}-${active.id}` : void 0,
72811
+ items: sessions.map((session) => ({
72812
+ id: `${prefix}-${session.id}`,
72813
+ label: session.label,
72814
+ icon: session.icon,
72815
+ trailingAction: onClose && session.closable !== false ? /* @__PURE__ */ jsx332(
72816
+ IconButton_default,
72817
+ {
72818
+ icon: /* @__PURE__ */ jsx332(Close, { style: { width: 12, height: 12 } }),
72819
+ size: "xs",
72820
+ customSizeClass: "h-5 w-5",
72821
+ rounded: "md",
72822
+ className: "kit-terminal-tab-close",
72823
+ "data-selected": session.id === activeId,
72824
+ variant: "ghost",
72825
+ color: tone,
72826
+ srLabel: `${closeLabel}: ${session.label}`,
72827
+ tooltip: closeLabel,
72828
+ onClick: () => onClose(session.id)
72829
+ }
72830
+ ) : void 0
72831
+ })),
72832
+ onChange: (id) => {
72833
+ const session = sessions.find(
72834
+ (item) => `${prefix}-${item.id}` === id
72835
+ );
72836
+ if (!session) return;
72837
+ if (value === void 0) setSelected(session.id);
72838
+ onValueChange?.(session.id);
72839
+ }
72840
+ }
72841
+ ) }),
72842
+ onAdd && /* @__PURE__ */ jsx332(
72843
+ IconButton_default,
72844
+ {
72845
+ icon: /* @__PURE__ */ jsx332(Add, {}),
72846
+ size: "xs",
72847
+ variant: "ghost",
72848
+ color: tone,
72849
+ srLabel: addLabel,
72850
+ tooltip: addLabel,
72851
+ className: "mt-0.5",
72852
+ onClick: onAdd
72853
+ }
72854
+ ),
72855
+ active?.metadata != null && /* @__PURE__ */ jsx332("span", { className: "mt-2 shrink-0 text-xs text-neutral-500 dark:text-neutral-400", children: active.metadata })
72856
+ ] }),
72857
+ /* @__PURE__ */ jsxs206("div", { className: "min-h-0 flex-1 pt-3", children: [
72858
+ sessions.map((session) => /* @__PURE__ */ jsx332(
72859
+ "div",
72860
+ {
72861
+ role: "tabpanel",
72862
+ "aria-labelledby": `tab-${prefix}-${session.id}`,
72863
+ hidden: session.id !== activeId,
72864
+ className: session.id === activeId ? "h-full min-h-0" : "hidden",
72865
+ children: /* @__PURE__ */ jsx332(
72866
+ TerminalViewport,
72867
+ {
72868
+ ref: (handle) => {
72869
+ if (handle) handles.current.set(session.id, handle);
72870
+ else handles.current.delete(session.id);
72871
+ },
72872
+ active: session.id === activeId,
72873
+ initialData: session.initialData,
72874
+ readOnly: session.readOnly ?? readOnly,
72875
+ ...{ scheme, terminalTheme, options },
72876
+ ariaLabel: session.label,
72877
+ onData: (data) => onData?.(session.id, data),
72878
+ onResize: (size) => onResize?.(session.id, size),
72879
+ onReady: (handle) => onReady?.(session.id, handle),
72880
+ onError: (error) => onError?.(session.id, error),
72881
+ onDispose: () => onDispose?.(session.id)
72882
+ }
72883
+ )
72884
+ },
72885
+ session.id
72886
+ )),
72887
+ sessions.length === 0 && /* @__PURE__ */ jsx332("div", { className: "flex h-full items-center justify-center text-sm text-neutral-500 dark:text-neutral-400", children: emptyState })
72888
+ ] })
72889
+ ] })
72890
+ }
72891
+ );
72892
+ }
72893
+ );
72894
+
72895
+ // src/contexts/BottomSheetContext.tsx
72896
+ import {
72897
+ createContext as createContext9,
72898
+ useCallback as useCallback53,
72899
+ useContext as useContext9,
72900
+ useEffect as useEffect81,
72901
+ useMemo as useMemo69,
72902
+ useRef as useRef80,
72903
+ useState as useState96
71681
72904
  } from "react";
71682
72905
  import { createPortal as createPortal19 } from "react-dom";
71683
- import classNames137 from "classnames";
71684
- import { jsx as jsx329, jsxs as jsxs205 } from "react/jsx-runtime";
72906
+ import classNames140 from "classnames";
72907
+ import { jsx as jsx333, jsxs as jsxs207 } from "react/jsx-runtime";
71685
72908
  var BottomSheetContext = createContext9(null);
71686
72909
  var TRANSITION_MS2 = 260;
71687
72910
  var renderSlot = (slot, controls) => {
@@ -71693,13 +72916,13 @@ var renderSlot = (slot, controls) => {
71693
72916
  var BottomSheetProvider = ({
71694
72917
  children
71695
72918
  }) => {
71696
- const [sheet, setSheet] = useState92(null);
71697
- const [isVisible, setIsVisible] = useState92(false);
71698
- const pendingCloseRef = useRef78(null);
71699
- const dismissSheet = useCallback52(() => {
72919
+ const [sheet, setSheet] = useState96(null);
72920
+ const [isVisible, setIsVisible] = useState96(false);
72921
+ const pendingCloseRef = useRef80(null);
72922
+ const dismissSheet = useCallback53(() => {
71700
72923
  setIsVisible(false);
71701
72924
  }, []);
71702
- const presentSheet = useCallback52((options) => {
72925
+ const presentSheet = useCallback53((options) => {
71703
72926
  if (pendingCloseRef.current) {
71704
72927
  clearTimeout(pendingCloseRef.current);
71705
72928
  pendingCloseRef.current = null;
@@ -71712,7 +72935,7 @@ var BottomSheetProvider = ({
71712
72935
  setTimeout(animateIn, 0);
71713
72936
  }
71714
72937
  }, []);
71715
- useEffect79(() => {
72938
+ useEffect81(() => {
71716
72939
  if (!isVisible && sheet) {
71717
72940
  pendingCloseRef.current = setTimeout(() => {
71718
72941
  sheet.onClose?.();
@@ -71727,7 +72950,7 @@ var BottomSheetProvider = ({
71727
72950
  }
71728
72951
  return void 0;
71729
72952
  }, [isVisible, sheet]);
71730
- useEffect79(
72953
+ useEffect81(
71731
72954
  () => () => {
71732
72955
  if (pendingCloseRef.current) {
71733
72956
  clearTimeout(pendingCloseRef.current);
@@ -71735,13 +72958,13 @@ var BottomSheetProvider = ({
71735
72958
  },
71736
72959
  []
71737
72960
  );
71738
- const controls = useMemo67(
72961
+ const controls = useMemo69(
71739
72962
  () => ({
71740
72963
  dismiss: dismissSheet
71741
72964
  }),
71742
72965
  [dismissSheet]
71743
72966
  );
71744
- const contextValue = useMemo67(
72967
+ const contextValue = useMemo69(
71745
72968
  () => ({
71746
72969
  presentSheet,
71747
72970
  dismissSheet,
@@ -71751,11 +72974,11 @@ var BottomSheetProvider = ({
71751
72974
  [presentSheet, dismissSheet, sheet, isVisible]
71752
72975
  );
71753
72976
  const overlayNode = typeof document !== "undefined" && sheet ? createPortal19(
71754
- /* @__PURE__ */ jsxs205("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
71755
- /* @__PURE__ */ jsx329(
72977
+ /* @__PURE__ */ jsxs207("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
72978
+ /* @__PURE__ */ jsx333(
71756
72979
  "div",
71757
72980
  {
71758
- className: classNames137(
72981
+ className: classNames140(
71759
72982
  "absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
71760
72983
  isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
71761
72984
  ),
@@ -71765,24 +72988,24 @@ var BottomSheetProvider = ({
71765
72988
  }
71766
72989
  }
71767
72990
  ),
71768
- /* @__PURE__ */ jsx329("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs205(
72991
+ /* @__PURE__ */ jsx333("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs207(
71769
72992
  "section",
71770
72993
  {
71771
72994
  role: "dialog",
71772
72995
  "aria-modal": "true",
71773
- className: classNames137(
72996
+ className: classNames140(
71774
72997
  "pointer-events-auto ml-auto flex w-full flex-col rounded-t-3xl border border-slate-200 bg-white shadow-2xl transition-transform duration-300 dark:border-slate-700 dark:bg-slate-900",
71775
72998
  sheet.className,
71776
72999
  isVisible ? "translate-y-0" : "translate-y-full"
71777
73000
  ),
71778
73001
  style: { minHeight: "25vh", maxHeight: "85vh" },
71779
73002
  children: [
71780
- /* @__PURE__ */ jsxs205("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
71781
- /* @__PURE__ */ jsxs205("div", { className: "space-y-1", children: [
71782
- sheet.title && /* @__PURE__ */ jsx329("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
71783
- sheet.description && /* @__PURE__ */ jsx329("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
73003
+ /* @__PURE__ */ jsxs207("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
73004
+ /* @__PURE__ */ jsxs207("div", { className: "space-y-1", children: [
73005
+ sheet.title && /* @__PURE__ */ jsx333("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
73006
+ sheet.description && /* @__PURE__ */ jsx333("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
71784
73007
  ] }),
71785
- (sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx329(
73008
+ (sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx333(
71786
73009
  IconButton_default,
71787
73010
  {
71788
73011
  icon: "Close",
@@ -71794,15 +73017,15 @@ var BottomSheetProvider = ({
71794
73017
  }
71795
73018
  )
71796
73019
  ] }),
71797
- /* @__PURE__ */ jsx329("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx329("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
71798
- sheet.actions && /* @__PURE__ */ jsx329("div", { className: "flex flex-wrap items-center justify-end gap-3 border-t border-slate-200 px-6 py-4 dark:border-slate-800", children: renderSlot(sheet.actions, controls) })
73020
+ /* @__PURE__ */ jsx333("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx333("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
73021
+ sheet.actions && /* @__PURE__ */ jsx333("div", { className: "flex flex-wrap items-center justify-end gap-3 border-t border-slate-200 px-6 py-4 dark:border-slate-800", children: renderSlot(sheet.actions, controls) })
71799
73022
  ]
71800
73023
  }
71801
73024
  ) })
71802
73025
  ] }),
71803
73026
  document.body
71804
73027
  ) : null;
71805
- return /* @__PURE__ */ jsxs205(BottomSheetContext.Provider, { value: contextValue, children: [
73028
+ return /* @__PURE__ */ jsxs207(BottomSheetContext.Provider, { value: contextValue, children: [
71806
73029
  children,
71807
73030
  overlayNode
71808
73031
  ] });
@@ -72442,8 +73665,8 @@ var SYSTEM_VARIABLES = [
72442
73665
  ];
72443
73666
 
72444
73667
  // src/components/MetricBar.tsx
72445
- import classNames138 from "classnames";
72446
- import { jsx as jsx330 } from "react/jsx-runtime";
73668
+ import classNames141 from "classnames";
73669
+ import { jsx as jsx334 } from "react/jsx-runtime";
72447
73670
  var MetricBar = ({
72448
73671
  label,
72449
73672
  value,
@@ -72453,7 +73676,7 @@ var MetricBar = ({
72453
73676
  size = "sm",
72454
73677
  className,
72455
73678
  ...rest
72456
- }) => /* @__PURE__ */ jsx330(
73679
+ }) => /* @__PURE__ */ jsx334(
72457
73680
  Progress_default,
72458
73681
  {
72459
73682
  ...rest,
@@ -72463,13 +73686,13 @@ var MetricBar = ({
72463
73686
  formatValue: value !== void 0 ? () => String(value) : void 0,
72464
73687
  size,
72465
73688
  color: tone ?? color ?? "blue",
72466
- className: classNames138("w-full", className)
73689
+ className: classNames141("w-full", className)
72467
73690
  }
72468
73691
  );
72469
73692
  MetricBar.displayName = "MetricBar";
72470
73693
 
72471
73694
  // src/components/NetworkGraph/NetworkGraph.tsx
72472
- import { useEffect as useEffect81, useId as useId44, useMemo as useMemo68, useRef as useRef80, useState as useState94 } from "react";
73695
+ import { useEffect as useEffect83, useId as useId47, useMemo as useMemo70, useRef as useRef82, useState as useState98 } from "react";
72473
73696
 
72474
73697
  // src/components/NetworkGraph/model.ts
72475
73698
  var CELL = 64;
@@ -72613,17 +73836,17 @@ function findNetworkPath(edges, source, target) {
72613
73836
  }
72614
73837
 
72615
73838
  // src/components/NetworkGraph/useNetworkCanvas.ts
72616
- import { useCallback as useCallback53, useEffect as useEffect80, useRef as useRef79, useState as useState93 } from "react";
73839
+ import { useCallback as useCallback54, useEffect as useEffect82, useRef as useRef81, useState as useState97 } from "react";
72617
73840
  function useNetworkCanvas(options) {
72618
- const canvasRef = useRef79(null);
72619
- const view = useRef79({ x: 0, y: 0, zoom: 1 });
72620
- const size = useRef79({ width: 1, height: 1 });
72621
- const latest = useRef79(options);
72622
- const frame = useRef79(null);
72623
- const [zoom, setZoom] = useState93(1);
72624
- const colors3 = useRef79(/* @__PURE__ */ new Map());
72625
- const textColor = useRef79("#737373");
72626
- const draw = useCallback53(() => {
73841
+ const canvasRef = useRef81(null);
73842
+ const view = useRef81({ x: 0, y: 0, zoom: 1 });
73843
+ const size = useRef81({ width: 1, height: 1 });
73844
+ const latest = useRef81(options);
73845
+ const frame = useRef81(null);
73846
+ const [zoom, setZoom] = useState97(1);
73847
+ const colors3 = useRef81(/* @__PURE__ */ new Map());
73848
+ const textColor = useRef81("#737373");
73849
+ const draw = useCallback54(() => {
72627
73850
  const canvas = canvasRef.current;
72628
73851
  const ctx = canvas?.getContext("2d");
72629
73852
  if (!canvas || !ctx) return;
@@ -72723,14 +73946,14 @@ function useNetworkCanvas(options) {
72723
73946
  }
72724
73947
  ctx.globalAlpha = 1;
72725
73948
  }, []);
72726
- const requestDraw = useCallback53(() => {
73949
+ const requestDraw = useCallback54(() => {
72727
73950
  if (frame.current !== null) return;
72728
73951
  frame.current = requestAnimationFrame(() => {
72729
73952
  frame.current = null;
72730
73953
  draw();
72731
73954
  });
72732
73955
  }, [draw]);
72733
- const update = useCallback53(
73956
+ const update = useCallback54(
72734
73957
  (next) => {
72735
73958
  view.current = next;
72736
73959
  setZoom(next.zoom);
@@ -72739,7 +73962,7 @@ function useNetworkCanvas(options) {
72739
73962
  },
72740
73963
  [requestDraw]
72741
73964
  );
72742
- const fit = useCallback53(
73965
+ const fit = useCallback54(
72743
73966
  () => update(
72744
73967
  fitNetwork(
72745
73968
  latest.current.nodes,
@@ -72749,11 +73972,11 @@ function useNetworkCanvas(options) {
72749
73972
  ),
72750
73973
  [update]
72751
73974
  );
72752
- const zoomBy = useCallback53(
73975
+ const zoomBy = useCallback54(
72753
73976
  (factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
72754
73977
  [update]
72755
73978
  );
72756
- const focusNode = useCallback53(
73979
+ const focusNode = useCallback54(
72757
73980
  (node) => {
72758
73981
  update({
72759
73982
  ...view.current,
@@ -72763,14 +73986,14 @@ function useNetworkCanvas(options) {
72763
73986
  },
72764
73987
  [update]
72765
73988
  );
72766
- useEffect80(() => {
73989
+ useEffect82(() => {
72767
73990
  latest.current = options;
72768
73991
  requestDraw();
72769
73992
  }, [options, requestDraw]);
72770
- useEffect80(() => {
73993
+ useEffect82(() => {
72771
73994
  fit();
72772
73995
  }, [options.model, fit]);
72773
- useEffect80(() => {
73996
+ useEffect82(() => {
72774
73997
  const canvas = canvasRef.current;
72775
73998
  if (!canvas) return;
72776
73999
  const measure = () => {
@@ -72823,7 +74046,7 @@ function useNetworkCanvas(options) {
72823
74046
  }
72824
74047
 
72825
74048
  // src/components/NetworkGraph/NetworkGraph.tsx
72826
- import { jsx as jsx331, jsxs as jsxs206 } from "react/jsx-runtime";
74049
+ import { jsx as jsx335, jsxs as jsxs208 } from "react/jsx-runtime";
72827
74050
  var NO_COMMUNITIES = [];
72828
74051
  var NO_HIGHLIGHTS = [];
72829
74052
  function NetworkGraph({
@@ -72854,11 +74077,11 @@ function NetworkGraph({
72854
74077
  ...panelProps
72855
74078
  }) {
72856
74079
  const t = useKitT();
72857
- const helpId = useId44();
72858
- const layoutRef = useRef80(null);
72859
- const [hasLegendSpace, setHasLegendSpace] = useState94(true);
74080
+ const helpId = useId47();
74081
+ const layoutRef = useRef82(null);
74082
+ const [hasLegendSpace, setHasLegendSpace] = useState98(true);
72860
74083
  const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
72861
- useEffect81(() => {
74084
+ useEffect83(() => {
72862
74085
  const element = layoutRef.current;
72863
74086
  if (!element || legendPosition !== "auto") return;
72864
74087
  const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
@@ -72867,38 +74090,38 @@ function NetworkGraph({
72867
74090
  observer.observe(element);
72868
74091
  return () => observer.disconnect();
72869
74092
  }, [legendPosition, loading]);
72870
- const model = useMemo68(
74093
+ const model = useMemo70(
72871
74094
  () => buildNetwork(nodes, edges, communities),
72872
74095
  [nodes, edges, communities]
72873
74096
  );
72874
- const [internalSelected, setInternalSelected] = useState94(
74097
+ const [internalSelected, setInternalSelected] = useState98(
72875
74098
  defaultSelectedNodeId
72876
74099
  );
72877
- const [hidden, setHidden] = useState94(() => /* @__PURE__ */ new Set());
72878
- const [focused, setFocused] = useState94(null);
72879
- const [query, setQuery] = useState94("");
72880
- const enabled = useMemo68(
74100
+ const [hidden, setHidden] = useState98(() => /* @__PURE__ */ new Set());
74101
+ const [focused, setFocused] = useState98(null);
74102
+ const [query, setQuery] = useState98("");
74103
+ const enabled = useMemo70(
72881
74104
  () => new Set(
72882
74105
  visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
72883
74106
  ),
72884
74107
  [visibleCommunityIds, model, hidden]
72885
74108
  );
72886
- const visibleNodes = useMemo68(
74109
+ const visibleNodes = useMemo70(
72887
74110
  () => model.nodes.filter((n) => !n.community || enabled.has(n.community)),
72888
74111
  [model, enabled]
72889
74112
  );
72890
- const visible = useMemo68(
74113
+ const visible = useMemo70(
72891
74114
  () => new Set(visibleNodes.map((n) => n.id)),
72892
74115
  [visibleNodes]
72893
74116
  );
72894
74117
  const selection = selectedNodeId === void 0 ? internalSelected : selectedNodeId;
72895
74118
  const selected = selection !== null && visible.has(selection) ? selection : null;
72896
74119
  const activeFocus = focused !== null && visible.has(focused) ? focused : null;
72897
- const highlighted = useMemo68(
74120
+ const highlighted = useMemo70(
72898
74121
  () => new Set(highlightedEdgeIds),
72899
74122
  [highlightedEdgeIds]
72900
74123
  );
72901
- const counts = useMemo68(() => {
74124
+ const counts = useMemo70(() => {
72902
74125
  const result = /* @__PURE__ */ new Map();
72903
74126
  for (const n of model.nodes)
72904
74127
  if (n.community)
@@ -72918,7 +74141,7 @@ function NetworkGraph({
72918
74141
  onViewportChange
72919
74142
  });
72920
74143
  const locked = disabled || loading;
72921
- const drag = useRef80(null);
74144
+ const drag = useRef82(null);
72922
74145
  const select = (id) => {
72923
74146
  if (locked) return;
72924
74147
  if (selectedNodeId === void 0) setInternalSelected(id);
@@ -72934,7 +74157,7 @@ function NetworkGraph({
72934
74157
  );
72935
74158
  onVisibleCommunitiesChange?.(ids);
72936
74159
  };
72937
- useEffect81(() => {
74160
+ useEffect83(() => {
72938
74161
  const element = canvas.canvasRef.current;
72939
74162
  if (!element || locked) return;
72940
74163
  const wheel = (event) => {
@@ -72983,13 +74206,13 @@ function NetworkGraph({
72983
74206
  }
72984
74207
  };
72985
74208
  const focusedNode = model.byId.get(activeFocus ?? selected ?? "");
72986
- const matchingNodes = useMemo68(() => {
74209
+ const matchingNodes = useMemo70(() => {
72987
74210
  const search = query.toLocaleLowerCase();
72988
74211
  return visibleNodes.filter((n) => (n.label ?? n.id).toLocaleLowerCase().includes(search)).slice(0, 50).map((n) => ({ value: n.id, label: n.label ?? n.id }));
72989
74212
  }, [visibleNodes, query]);
72990
74213
  const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
72991
74214
  const resolvedLegendTone = legendTone === "auto" ? tone : legendTone;
72992
- const legendContent = /* @__PURE__ */ jsxs206(
74215
+ const legendContent = /* @__PURE__ */ jsxs208(
72993
74216
  "fieldset",
72994
74217
  {
72995
74218
  disabled: locked,
@@ -72998,8 +74221,8 @@ function NetworkGraph({
72998
74221
  maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
72999
74222
  },
73000
74223
  children: [
73001
- /* @__PURE__ */ jsx331("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
73002
- /* @__PURE__ */ jsx331(
74224
+ /* @__PURE__ */ jsx335("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
74225
+ /* @__PURE__ */ jsx335(
73003
74226
  Checkbox_default,
73004
74227
  {
73005
74228
  size: "sm",
@@ -73010,8 +74233,8 @@ function NetworkGraph({
73010
74233
  onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
73011
74234
  }
73012
74235
  ),
73013
- model.groups.map((group) => /* @__PURE__ */ jsxs206("div", { className: "flex items-center justify-between gap-2", children: [
73014
- /* @__PURE__ */ jsx331(
74236
+ model.groups.map((group) => /* @__PURE__ */ jsxs208("div", { className: "flex items-center justify-between gap-2", children: [
74237
+ /* @__PURE__ */ jsx335(
73015
74238
  Checkbox_default,
73016
74239
  {
73017
74240
  size: "sm",
@@ -73023,12 +74246,12 @@ function NetworkGraph({
73023
74246
  )
73024
74247
  }
73025
74248
  ),
73026
- /* @__PURE__ */ jsx331("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
74249
+ /* @__PURE__ */ jsx335("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
73027
74250
  ] }, group.id))
73028
74251
  ]
73029
74252
  }
73030
74253
  );
73031
- return /* @__PURE__ */ jsx331(
74254
+ return /* @__PURE__ */ jsx335(
73032
74255
  Panel_default,
73033
74256
  {
73034
74257
  ...panelProps,
@@ -73039,7 +74262,7 @@ function NetworkGraph({
73039
74262
  loading,
73040
74263
  clickable: false,
73041
74264
  scrollable: false,
73042
- children: /* @__PURE__ */ jsxs206(
74265
+ children: /* @__PURE__ */ jsxs208(
73043
74266
  "div",
73044
74267
  {
73045
74268
  className: "flex min-w-0 flex-col gap-3",
@@ -73047,7 +74270,7 @@ function NetworkGraph({
73047
74270
  "aria-label": ariaLabel ?? t("kit.networkGraph.name"),
73048
74271
  "aria-disabled": locked || void 0,
73049
74272
  children: [
73050
- showControls && /* @__PURE__ */ jsx331("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx331("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx331(
74273
+ showControls && /* @__PURE__ */ jsx335("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx335("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx335(
73051
74274
  Combobox_default,
73052
74275
  {
73053
74276
  size: "sm",
@@ -73069,7 +74292,7 @@ function NetworkGraph({
73069
74292
  }
73070
74293
  }
73071
74294
  ) }) }),
73072
- /* @__PURE__ */ jsxs206(
74295
+ /* @__PURE__ */ jsxs208(
73073
74296
  "div",
73074
74297
  {
73075
74298
  ref: layoutRef,
@@ -73077,13 +74300,13 @@ function NetworkGraph({
73077
74300
  style: { flexDirection: legendOnRight ? "row" : "column" },
73078
74301
  "data-legend-position": legendOnRight ? "right" : "bottom",
73079
74302
  children: [
73080
- /* @__PURE__ */ jsxs206(
74303
+ /* @__PURE__ */ jsxs208(
73081
74304
  "div",
73082
74305
  {
73083
74306
  className: "relative min-w-0 flex-1",
73084
74307
  style: { height: graphHeight, minHeight: graphHeight },
73085
74308
  children: [
73086
- /* @__PURE__ */ jsx331(
74309
+ /* @__PURE__ */ jsx335(
73087
74310
  "canvas",
73088
74311
  {
73089
74312
  ref: canvas.canvasRef,
@@ -73152,11 +74375,11 @@ function NetworkGraph({
73152
74375
  }
73153
74376
  }
73154
74377
  ),
73155
- showControls && /* @__PURE__ */ jsxs206("div", { className: "absolute bottom-3 right-3 z-10 flex items-center gap-0.5 rounded-lg border border-neutral-200 bg-white/90 p-1 shadow-sm backdrop-blur dark:border-neutral-700 dark:bg-neutral-900/90", children: [
73156
- /* @__PURE__ */ jsx331(
74378
+ showControls && /* @__PURE__ */ jsxs208("div", { className: "absolute bottom-3 right-3 z-10 flex items-center gap-0.5 rounded-lg border border-neutral-200 bg-white/90 p-1 shadow-sm backdrop-blur dark:border-neutral-700 dark:bg-neutral-900/90", children: [
74379
+ /* @__PURE__ */ jsx335(
73157
74380
  IconButton_default,
73158
74381
  {
73159
- icon: /* @__PURE__ */ jsxs206(
74382
+ icon: /* @__PURE__ */ jsxs208(
73160
74383
  "svg",
73161
74384
  {
73162
74385
  viewBox: "0 0 24 24",
@@ -73167,10 +74390,10 @@ function NetworkGraph({
73167
74390
  strokeLinejoin: "round",
73168
74391
  "aria-hidden": "true",
73169
74392
  children: [
73170
- /* @__PURE__ */ jsx331("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
73171
- /* @__PURE__ */ jsx331("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
73172
- /* @__PURE__ */ jsx331("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
73173
- /* @__PURE__ */ jsx331("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
74393
+ /* @__PURE__ */ jsx335("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
74394
+ /* @__PURE__ */ jsx335("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
74395
+ /* @__PURE__ */ jsx335("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
74396
+ /* @__PURE__ */ jsx335("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
73174
74397
  ]
73175
74398
  }
73176
74399
  ),
@@ -73183,10 +74406,10 @@ function NetworkGraph({
73183
74406
  onClick: canvas.fit
73184
74407
  }
73185
74408
  ),
73186
- /* @__PURE__ */ jsx331(
74409
+ /* @__PURE__ */ jsx335(
73187
74410
  IconButton_default,
73188
74411
  {
73189
- icon: /* @__PURE__ */ jsx331(
74412
+ icon: /* @__PURE__ */ jsx335(
73190
74413
  "svg",
73191
74414
  {
73192
74415
  viewBox: "0 0 24 24",
@@ -73195,7 +74418,7 @@ function NetworkGraph({
73195
74418
  strokeWidth: 2,
73196
74419
  strokeLinecap: "round",
73197
74420
  "aria-hidden": "true",
73198
- children: /* @__PURE__ */ jsx331("path", { d: "M6 12h12" })
74421
+ children: /* @__PURE__ */ jsx335("path", { d: "M6 12h12" })
73199
74422
  }
73200
74423
  ),
73201
74424
  size: "xs",
@@ -73207,7 +74430,7 @@ function NetworkGraph({
73207
74430
  onClick: () => canvas.zoomBy(0.8)
73208
74431
  }
73209
74432
  ),
73210
- /* @__PURE__ */ jsxs206(
74433
+ /* @__PURE__ */ jsxs208(
73211
74434
  "span",
73212
74435
  {
73213
74436
  className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
@@ -73218,7 +74441,7 @@ function NetworkGraph({
73218
74441
  ]
73219
74442
  }
73220
74443
  ),
73221
- /* @__PURE__ */ jsx331(
74444
+ /* @__PURE__ */ jsx335(
73222
74445
  IconButton_default,
73223
74446
  {
73224
74447
  icon: "Add",
@@ -73231,7 +74454,7 @@ function NetworkGraph({
73231
74454
  onClick: () => canvas.zoomBy(1.25)
73232
74455
  }
73233
74456
  ),
73234
- /* @__PURE__ */ jsx331(
74457
+ /* @__PURE__ */ jsx335(
73235
74458
  IconButton_default,
73236
74459
  {
73237
74460
  icon: "Reset",
@@ -73249,18 +74472,18 @@ function NetworkGraph({
73249
74472
  }
73250
74473
  )
73251
74474
  ] }),
73252
- !visibleNodes.length && /* @__PURE__ */ jsx331("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
74475
+ !visibleNodes.length && /* @__PURE__ */ jsx335("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
73253
74476
  ]
73254
74477
  }
73255
74478
  ),
73256
- showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx331(
74479
+ showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx335(
73257
74480
  "div",
73258
74481
  {
73259
74482
  className: "min-w-0 shrink-0",
73260
74483
  style: {
73261
74484
  width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
73262
74485
  },
73263
- children: legendPanel ? /* @__PURE__ */ jsx331(
74486
+ children: legendPanel ? /* @__PURE__ */ jsx335(
73264
74487
  Panel_default,
73265
74488
  {
73266
74489
  variant: legendVariant === "auto" ? variant : legendVariant,
@@ -73279,8 +74502,8 @@ function NetworkGraph({
73279
74502
  ]
73280
74503
  }
73281
74504
  ),
73282
- /* @__PURE__ */ jsx331("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
73283
- /* @__PURE__ */ jsx331(
74505
+ /* @__PURE__ */ jsx335("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
74506
+ /* @__PURE__ */ jsx335(
73284
74507
  "p",
73285
74508
  {
73286
74509
  role: "status",
@@ -73425,11 +74648,16 @@ export {
73425
74648
  GANTT_ZOOM_PRESETS,
73426
74649
  GAUGE_ZONE_SUBDIVISIONS,
73427
74650
  GLOW_INTENSITIES,
74651
+ GRADIENT_BACKDROP_DERIVATION,
74652
+ GRADIENT_BACKDROP_SCHEMES,
74653
+ GRADIENT_BACKDROP_TEMPLATES,
74654
+ GRADIENT_BACKDROP_TEMPLATE_IDS,
73428
74655
  GRID_LAYOUT_STORAGE_VERSION,
73429
74656
  GRID_STORAGE_DEFAULT_PREFIX,
73430
74657
  Gantt,
73431
74658
  GlassBackground_default as GlassBackground,
73432
74659
  Globe,
74660
+ GradientBackdrop,
73433
74661
  HERO_TITLE_ELEMENTS,
73434
74662
  HERO_VARIANTS,
73435
74663
  HOVER_THROTTLE_MS,
@@ -73589,6 +74817,8 @@ export {
73589
74817
  TABLE_STORAGE_DEFAULT_PREFIX,
73590
74818
  TASKBOARD_CARD_LAYOUTS,
73591
74819
  TASKBOARD_LAYOUTS,
74820
+ TERMINAL_DARK_THEME,
74821
+ TERMINAL_LIGHT_THEME,
73592
74822
  THIN_SCROLLBAR,
73593
74823
  THIN_SCROLLBAR_FIELD,
73594
74824
  TOAST_DEFAULT_WIDTH,
@@ -73612,6 +74842,8 @@ export {
73612
74842
  TagPanel_default as TagPanel,
73613
74843
  TagPicker_default as TagPicker,
73614
74844
  TaskBoard,
74845
+ Terminal,
74846
+ TerminalTabs,
73615
74847
  Textarea_default as Textarea,
73616
74848
  ThemeAuto,
73617
74849
  TimelinePanel_default as TimelinePanel,
@@ -73702,6 +74934,8 @@ export {
73702
74934
  decodeStoredLayout,
73703
74935
  decodeStoredSettings,
73704
74936
  defaultIconRenderer,
74937
+ deriveDarkColor,
74938
+ deriveLightColor,
73705
74939
  emptyPresence,
73706
74940
  encodeStoredLayout,
73707
74941
  encodeStoredSettings,
@@ -73806,6 +75040,7 @@ export {
73806
75040
  getTreeColorTokens,
73807
75041
  getTrueColorDotClass,
73808
75042
  getTrueColorTextClass,
75043
+ gradientBackdropCss,
73809
75044
  gridDashArray,
73810
75045
  gridLineDash,
73811
75046
  groupToVariables,
@@ -73815,6 +75050,7 @@ export {
73815
75050
  headerGlyph,
73816
75051
  headerReservesGlyph,
73817
75052
  heightTokenRegex,
75053
+ hexToOklch,
73818
75054
  hitTestNode,
73819
75055
  hitTestPolar,
73820
75056
  hitTestScatter,
@@ -73866,6 +75102,7 @@ export {
73866
75102
  normalizeStatus,
73867
75103
  normalizeString,
73868
75104
  normalizeStringToUpper,
75105
+ oklchToHex,
73869
75106
  parseImageSource,
73870
75107
  parseMessage,
73871
75108
  parseSmartVariable,
@@ -73887,6 +75124,7 @@ export {
73887
75124
  resolveActiveStep,
73888
75125
  resolveColor,
73889
75126
  resolveGlowGradient,
75127
+ resolveGradientBackdropTheme,
73890
75128
  resolveGrid,
73891
75129
  resolveMargins,
73892
75130
  resolveSmartValue,