@cjlapao/ui-kit 0.2.12 → 0.2.13

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
@@ -22464,6 +22464,10 @@ var PageHeader = ({
22464
22464
  children,
22465
22465
  variant = "default",
22466
22466
  accentColor = "blue",
22467
+ tone = "neutral",
22468
+ glassOpacity,
22469
+ vibrancy,
22470
+ specularMode,
22467
22471
  padding,
22468
22472
  paddingTop,
22469
22473
  paddingRight,
@@ -22473,7 +22477,8 @@ var PageHeader = ({
22473
22477
  className = "",
22474
22478
  ...rest
22475
22479
  }) => {
22476
- const surface = variant === "default" ? null : getSidebarSurfaceTokens(variant, accentColor);
22480
+ const sharedSurface = variant !== "default" && variant !== "floating" && variant !== "floating-glass";
22481
+ const surface = variant === "floating" || variant === "floating-glass" ? getSidebarSurfaceTokens(variant, accentColor) : null;
22477
22482
  const pair = surface ? "xs" : "none";
22478
22483
  const gutter = {
22479
22484
  top: paddingTop ?? padding ?? pair,
@@ -22486,7 +22491,7 @@ var PageHeader = ({
22486
22491
  {
22487
22492
  ...rest,
22488
22493
  className: classNames53(
22489
- "flex w-full items-center justify-between gap-4 px-5",
22494
+ "relative isolate flex w-full shrink-0 items-center justify-between gap-4 px-5",
22490
22495
  SIDE_MENU_HEADER_HEIGHT,
22491
22496
  getSurfaceGutterClass("top", gutter.top),
22492
22497
  getSurfaceGutterClass("right", gutter.right),
@@ -22498,10 +22503,24 @@ var PageHeader = ({
22498
22503
  surface.border,
22499
22504
  surface.shadow,
22500
22505
  surface.fill
22501
- ) : classNames53("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
22506
+ ) : !sharedSurface && classNames53("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
22502
22507
  className
22503
22508
  ),
22504
22509
  children: [
22510
+ sharedSurface && /* @__PURE__ */ jsx203("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 -z-10", style: { borderRadius: "inherit" }, children: /* @__PURE__ */ jsx203(
22511
+ Panel_default,
22512
+ {
22513
+ variant,
22514
+ tone,
22515
+ glassOpacity,
22516
+ vibrancy,
22517
+ specularMode,
22518
+ padding: "none",
22519
+ corner: "none",
22520
+ className: "h-full w-full",
22521
+ style: { borderRadius: "inherit" }
22522
+ }
22523
+ ) }),
22505
22524
  /* @__PURE__ */ jsx203("div", { className: GROUP_CLASS2, children: start }),
22506
22525
  /* @__PURE__ */ jsx203("div", { className: GROUP_CLASS2, children: center }),
22507
22526
  /* @__PURE__ */ jsx203("div", { className: GROUP_CLASS2, children: end }),
@@ -44381,6 +44400,7 @@ var SIZE_TOKENS4 = {
44381
44400
  };
44382
44401
  var SidePanel = ({
44383
44402
  isOpen,
44403
+ docked = false,
44384
44404
  onClose,
44385
44405
  title,
44386
44406
  subtitle,
@@ -44541,7 +44561,7 @@ var SidePanel = ({
44541
44561
  },
44542
44562
  [resizable, side, currentWidth, minWidth, maxWidth]
44543
44563
  );
44544
- if (!mounted) return null;
44564
+ if (!mounted || docked && !isOpen) return null;
44545
44565
  const edgeOffset = entered ? shellWidth : 0;
44546
44566
  const barTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-70 group-active:opacity-100`;
44547
44567
  const edgeProperty = side === "right" ? "right" : "left";
@@ -44558,15 +44578,15 @@ var SidePanel = ({
44558
44578
  "data-sp-shell": true,
44559
44579
  "data-collapsed": collapsible ? isCollapsed : void 0,
44560
44580
  className: classNames80(
44561
- "absolute z-40 overflow-hidden",
44562
- isInset ? INSET_GAP_Y_CLASS : "top-0 h-full",
44581
+ docked ? "relative h-full w-full overflow-hidden" : "absolute z-40 overflow-hidden",
44582
+ !docked && (isInset ? INSET_GAP_Y_CLASS : "top-0 h-full"),
44563
44583
  side === "right" ? "right-0" : "left-0",
44564
44584
  cornerClass,
44565
44585
  legacyVariant && borderClass,
44566
44586
  legacyVariant ? shadowClass : panelOuterChrome
44567
44587
  ),
44568
44588
  style: {
44569
- width: entered ? shellWidth : 0,
44589
+ width: docked ? "100%" : entered ? shellWidth : 0,
44570
44590
  // Inline rather than `transition-[width] duration-… ease-…`: an
44571
44591
  // arbitrary easing utility would have to survive the safelist, and
44572
44592
  // this curve is not themeable anyway. It decelerates hard at the end,
@@ -44628,7 +44648,7 @@ var SidePanel = ({
44628
44648
  isCollapsed && "opacity-0",
44629
44649
  className
44630
44650
  ),
44631
- style: { width: resolvedWidth },
44651
+ style: { width: docked ? "100%" : resolvedWidth },
44632
44652
  onKeyDown,
44633
44653
  children: [
44634
44654
  /* @__PURE__ */ jsxs148(
@@ -44715,7 +44735,7 @@ var SidePanel = ({
44715
44735
  ]
44716
44736
  }
44717
44737
  ),
44718
- overlay && /* @__PURE__ */ jsx263(
44738
+ overlay && !docked && /* @__PURE__ */ jsx263(
44719
44739
  "div",
44720
44740
  {
44721
44741
  "aria-hidden": "true",
@@ -44732,7 +44752,7 @@ var SidePanel = ({
44732
44752
  }
44733
44753
  }
44734
44754
  ),
44735
- resizable && // ARIA 1.2 resizable separator: focusable (tabIndex), arrow keys /
44755
+ resizable && !docked && // ARIA 1.2 resizable separator: focusable (tabIndex), arrow keys /
44736
44756
  // Home / End resize, aria-valuenow|min|max report the width. Parked
44737
44757
  // (collapsed), it drops the role and every aria-* and leaves the tab
44738
44758
  // order — see `handleParked`.
@@ -73315,19 +73335,144 @@ var TerminalTabs = forwardRef165(
73315
73335
  }
73316
73336
  );
73317
73337
 
73338
+ // src/components/PageBodyLayout.tsx
73339
+ import { useCallback as useCallback53, useEffect as useEffect81, useRef as useRef80, useState as useState96 } from "react";
73340
+ import classNames141 from "classnames";
73341
+ import { jsx as jsx334, jsxs as jsxs208 } from "react/jsx-runtime";
73342
+ function Region({ config, side }) {
73343
+ const vertical = side === "bottom";
73344
+ const [internalCollapsed, setInternalCollapsed] = useState96(config.defaultCollapsed ?? false);
73345
+ const [internalSize, setInternalSize] = useState96(config.defaultSize ?? (vertical ? 200 : 280));
73346
+ const collapsed = config.collapsed ?? internalCollapsed;
73347
+ const min = Math.max(0, config.minSize ?? (vertical ? 100 : 160));
73348
+ const max = Math.max(min, config.maxSize ?? (vertical ? 600 : 640));
73349
+ const size = Math.max(min, Math.min(max, config.size ?? internalSize));
73350
+ const collapsedSize = Math.max(0, config.collapsedSize ?? (vertical ? 40 : COLLAPSED_RAIL_WIDTH));
73351
+ const setCollapsed = (next) => {
73352
+ if (config.collapsed === void 0) setInternalCollapsed(next);
73353
+ config.onCollapsedChange?.(next);
73354
+ };
73355
+ const updateSize = useCallback53((next) => {
73356
+ const value = Math.max(min, Math.min(max, next));
73357
+ if (config.size === void 0) setInternalSize(value);
73358
+ config.onSizeChange?.(value);
73359
+ }, [min, max, config.size, config.onSizeChange]);
73360
+ const drag = useRef80(null);
73361
+ const [dragging, setDragging] = useState96(false);
73362
+ useEffect81(() => {
73363
+ if (!dragging) return;
73364
+ const previousCursor = document.body.style.cursor;
73365
+ const previousSelect = document.body.style.userSelect;
73366
+ document.body.style.cursor = vertical ? "row-resize" : "col-resize";
73367
+ document.body.style.userSelect = "none";
73368
+ const move = (event) => {
73369
+ if (!drag.current) return;
73370
+ const delta = (vertical ? event.clientY : event.clientX) - drag.current.position;
73371
+ updateSize(drag.current.size + delta * (side === "left" ? 1 : -1));
73372
+ };
73373
+ const stop = () => {
73374
+ drag.current = null;
73375
+ setDragging(false);
73376
+ };
73377
+ window.addEventListener("pointermove", move);
73378
+ window.addEventListener("pointerup", stop);
73379
+ window.addEventListener("pointercancel", stop);
73380
+ return () => {
73381
+ window.removeEventListener("pointermove", move);
73382
+ window.removeEventListener("pointerup", stop);
73383
+ window.removeEventListener("pointercancel", stop);
73384
+ document.body.style.cursor = previousCursor;
73385
+ document.body.style.userSelect = previousSelect;
73386
+ };
73387
+ }, [dragging, vertical, side, updateSize]);
73388
+ const canResize = !collapsed && (config.resizable ?? side !== "left");
73389
+ const dimension = collapsed ? collapsedSize : size;
73390
+ return /* @__PURE__ */ jsxs208(
73391
+ "section",
73392
+ {
73393
+ "aria-label": config.label,
73394
+ "data-page-region": side,
73395
+ "data-collapsed": collapsed,
73396
+ className: "relative min-h-0 min-w-0 shrink-0 overflow-hidden",
73397
+ style: vertical ? { height: dimension } : { width: dimension },
73398
+ children: [
73399
+ /* @__PURE__ */ jsxs208("div", { className: "flex h-full min-h-0 flex-col", children: [
73400
+ config.showToggle !== false && /* @__PURE__ */ jsx334("div", { className: "flex shrink-0 justify-end px-2 py-1", children: /* @__PURE__ */ jsx334(
73401
+ IconButton_default,
73402
+ {
73403
+ size: "xs",
73404
+ variant: "ghost",
73405
+ color: "neutral",
73406
+ icon: vertical ? collapsed ? "ArrowChevronUp" : "ArrowChevronDown" : collapsed === (side === "left") ? "ArrowChevronRight" : "ArrowChevronLeft",
73407
+ "aria-label": `${collapsed ? "Expand" : "Collapse"} ${config.label}`,
73408
+ "aria-expanded": !collapsed,
73409
+ onClick: () => setCollapsed(!collapsed)
73410
+ }
73411
+ ) }),
73412
+ /* @__PURE__ */ jsx334("div", { className: classNames141("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: typeof config.content === "function" ? config.content({ collapsed, setCollapsed, size }) : /* @__PURE__ */ jsx334("div", { className: "h-full", hidden: collapsed, inert: collapsed || void 0, children: config.content }) })
73413
+ ] }),
73414
+ canResize && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-noninteractive-tabindex -- focusable ARIA separator provides keyboard and pointer resizing
73415
+ /* @__PURE__ */ jsx334(
73416
+ "div",
73417
+ {
73418
+ role: "separator",
73419
+ tabIndex: 0,
73420
+ "aria-label": `Resize ${config.label}`,
73421
+ "aria-orientation": vertical ? "horizontal" : "vertical",
73422
+ "aria-valuemin": min,
73423
+ "aria-valuemax": max,
73424
+ "aria-valuenow": size,
73425
+ className: classNames141("absolute z-20 touch-none bg-transparent hover:bg-blue-400/30 focus-visible:bg-blue-400/30 focus-visible:outline-none", vertical ? "inset-x-0 top-0 h-2 cursor-row-resize" : side === "right" ? "inset-y-0 left-0 w-2 cursor-col-resize" : "inset-y-0 right-0 w-2 cursor-col-resize"),
73426
+ onPointerDown: (event) => {
73427
+ if (event.button !== 0) return;
73428
+ event.preventDefault();
73429
+ drag.current = { position: vertical ? event.clientY : event.clientX, size };
73430
+ setDragging(true);
73431
+ },
73432
+ onKeyDown: (event) => {
73433
+ const grow = vertical ? "ArrowUp" : side === "right" ? "ArrowLeft" : "ArrowRight";
73434
+ const shrink = vertical ? "ArrowDown" : side === "right" ? "ArrowRight" : "ArrowLeft";
73435
+ if (![grow, shrink, "Home", "End"].includes(event.key)) return;
73436
+ event.preventDefault();
73437
+ updateSize(event.key === "Home" ? min : event.key === "End" ? max : size + (event.key === grow ? 20 : -20));
73438
+ },
73439
+ children: /* @__PURE__ */ jsx334("span", { "aria-hidden": "true", className: classNames141(
73440
+ "pointer-events-none absolute rounded-full bg-neutral-300 dark:bg-neutral-600",
73441
+ vertical ? "left-1/2 top-0 h-1 w-10 -translate-x-1/2" : "left-0 top-1/2 h-10 w-1 -translate-y-1/2"
73442
+ ) })
73443
+ }
73444
+ )
73445
+ ]
73446
+ }
73447
+ );
73448
+ }
73449
+ function PageBodyLayout({ header, left, right, bottom, children, className, minCenterWidth = 240, minCenterHeight = 120, variant = "outlined", ...surface }) {
73450
+ return /* @__PURE__ */ jsxs208(Panel_default, { ...surface, variant, padding: "none", scrollable: false, flexBody: true, className: classNames141("h-full min-h-0 min-w-0", className), children: [
73451
+ header && /* @__PURE__ */ jsx334("div", { className: "shrink-0", children: header }),
73452
+ /* @__PURE__ */ jsx334("div", { className: classNames141("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: /* @__PURE__ */ jsxs208("div", { className: "flex h-full min-h-0", style: { minWidth: minCenterWidth }, children: [
73453
+ left && /* @__PURE__ */ jsx334(Region, { side: "left", config: left }),
73454
+ /* @__PURE__ */ jsxs208("div", { className: "flex min-w-0 flex-1 flex-col", children: [
73455
+ /* @__PURE__ */ jsx334("div", { "data-page-region": "center", className: classNames141("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), style: { minHeight: minCenterHeight, minWidth: minCenterWidth }, children }),
73456
+ bottom && /* @__PURE__ */ jsx334(Region, { side: "bottom", config: bottom })
73457
+ ] }),
73458
+ right && /* @__PURE__ */ jsx334(Region, { side: "right", config: right })
73459
+ ] }) })
73460
+ ] });
73461
+ }
73462
+
73318
73463
  // src/contexts/BottomSheetContext.tsx
73319
73464
  import {
73320
73465
  createContext as createContext9,
73321
- useCallback as useCallback53,
73466
+ useCallback as useCallback54,
73322
73467
  useContext as useContext9,
73323
- useEffect as useEffect81,
73468
+ useEffect as useEffect82,
73324
73469
  useMemo as useMemo69,
73325
- useRef as useRef80,
73326
- useState as useState96
73470
+ useRef as useRef81,
73471
+ useState as useState97
73327
73472
  } from "react";
73328
73473
  import { createPortal as createPortal19 } from "react-dom";
73329
- import classNames141 from "classnames";
73330
- import { jsx as jsx334, jsxs as jsxs208 } from "react/jsx-runtime";
73474
+ import classNames142 from "classnames";
73475
+ import { jsx as jsx335, jsxs as jsxs209 } from "react/jsx-runtime";
73331
73476
  var BottomSheetContext = createContext9(null);
73332
73477
  var TRANSITION_MS2 = 260;
73333
73478
  var renderSlot = (slot, controls) => {
@@ -73339,13 +73484,13 @@ var renderSlot = (slot, controls) => {
73339
73484
  var BottomSheetProvider = ({
73340
73485
  children
73341
73486
  }) => {
73342
- const [sheet, setSheet] = useState96(null);
73343
- const [isVisible, setIsVisible] = useState96(false);
73344
- const pendingCloseRef = useRef80(null);
73345
- const dismissSheet = useCallback53(() => {
73487
+ const [sheet, setSheet] = useState97(null);
73488
+ const [isVisible, setIsVisible] = useState97(false);
73489
+ const pendingCloseRef = useRef81(null);
73490
+ const dismissSheet = useCallback54(() => {
73346
73491
  setIsVisible(false);
73347
73492
  }, []);
73348
- const presentSheet = useCallback53((options) => {
73493
+ const presentSheet = useCallback54((options) => {
73349
73494
  if (pendingCloseRef.current) {
73350
73495
  clearTimeout(pendingCloseRef.current);
73351
73496
  pendingCloseRef.current = null;
@@ -73358,7 +73503,7 @@ var BottomSheetProvider = ({
73358
73503
  setTimeout(animateIn, 0);
73359
73504
  }
73360
73505
  }, []);
73361
- useEffect81(() => {
73506
+ useEffect82(() => {
73362
73507
  if (!isVisible && sheet) {
73363
73508
  pendingCloseRef.current = setTimeout(() => {
73364
73509
  sheet.onClose?.();
@@ -73373,7 +73518,7 @@ var BottomSheetProvider = ({
73373
73518
  }
73374
73519
  return void 0;
73375
73520
  }, [isVisible, sheet]);
73376
- useEffect81(
73521
+ useEffect82(
73377
73522
  () => () => {
73378
73523
  if (pendingCloseRef.current) {
73379
73524
  clearTimeout(pendingCloseRef.current);
@@ -73397,11 +73542,11 @@ var BottomSheetProvider = ({
73397
73542
  [presentSheet, dismissSheet, sheet, isVisible]
73398
73543
  );
73399
73544
  const overlayNode = typeof document !== "undefined" && sheet ? createPortal19(
73400
- /* @__PURE__ */ jsxs208("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
73401
- /* @__PURE__ */ jsx334(
73545
+ /* @__PURE__ */ jsxs209("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
73546
+ /* @__PURE__ */ jsx335(
73402
73547
  "div",
73403
73548
  {
73404
- className: classNames141(
73549
+ className: classNames142(
73405
73550
  "absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
73406
73551
  isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
73407
73552
  ),
@@ -73411,24 +73556,24 @@ var BottomSheetProvider = ({
73411
73556
  }
73412
73557
  }
73413
73558
  ),
73414
- /* @__PURE__ */ jsx334("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs208(
73559
+ /* @__PURE__ */ jsx335("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs209(
73415
73560
  "section",
73416
73561
  {
73417
73562
  role: "dialog",
73418
73563
  "aria-modal": "true",
73419
- className: classNames141(
73564
+ className: classNames142(
73420
73565
  "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",
73421
73566
  sheet.className,
73422
73567
  isVisible ? "translate-y-0" : "translate-y-full"
73423
73568
  ),
73424
73569
  style: { minHeight: "25vh", maxHeight: "85vh" },
73425
73570
  children: [
73426
- /* @__PURE__ */ jsxs208("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
73427
- /* @__PURE__ */ jsxs208("div", { className: "space-y-1", children: [
73428
- sheet.title && /* @__PURE__ */ jsx334("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
73429
- sheet.description && /* @__PURE__ */ jsx334("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
73571
+ /* @__PURE__ */ jsxs209("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
73572
+ /* @__PURE__ */ jsxs209("div", { className: "space-y-1", children: [
73573
+ sheet.title && /* @__PURE__ */ jsx335("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
73574
+ sheet.description && /* @__PURE__ */ jsx335("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
73430
73575
  ] }),
73431
- (sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx334(
73576
+ (sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx335(
73432
73577
  IconButton_default,
73433
73578
  {
73434
73579
  icon: "Close",
@@ -73440,15 +73585,15 @@ var BottomSheetProvider = ({
73440
73585
  }
73441
73586
  )
73442
73587
  ] }),
73443
- /* @__PURE__ */ jsx334("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx334("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
73444
- sheet.actions && /* @__PURE__ */ jsx334("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) })
73588
+ /* @__PURE__ */ jsx335("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx335("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
73589
+ sheet.actions && /* @__PURE__ */ jsx335("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) })
73445
73590
  ]
73446
73591
  }
73447
73592
  ) })
73448
73593
  ] }),
73449
73594
  document.body
73450
73595
  ) : null;
73451
- return /* @__PURE__ */ jsxs208(BottomSheetContext.Provider, { value: contextValue, children: [
73596
+ return /* @__PURE__ */ jsxs209(BottomSheetContext.Provider, { value: contextValue, children: [
73452
73597
  children,
73453
73598
  overlayNode
73454
73599
  ] });
@@ -74088,8 +74233,8 @@ var SYSTEM_VARIABLES = [
74088
74233
  ];
74089
74234
 
74090
74235
  // src/components/MetricBar.tsx
74091
- import classNames142 from "classnames";
74092
- import { jsx as jsx335 } from "react/jsx-runtime";
74236
+ import classNames143 from "classnames";
74237
+ import { jsx as jsx336 } from "react/jsx-runtime";
74093
74238
  var MetricBar = ({
74094
74239
  label,
74095
74240
  value,
@@ -74099,7 +74244,7 @@ var MetricBar = ({
74099
74244
  size = "sm",
74100
74245
  className,
74101
74246
  ...rest
74102
- }) => /* @__PURE__ */ jsx335(
74247
+ }) => /* @__PURE__ */ jsx336(
74103
74248
  Progress_default,
74104
74249
  {
74105
74250
  ...rest,
@@ -74109,13 +74254,13 @@ var MetricBar = ({
74109
74254
  formatValue: value !== void 0 ? () => String(value) : void 0,
74110
74255
  size,
74111
74256
  color: tone ?? color ?? "blue",
74112
- className: classNames142("w-full", className)
74257
+ className: classNames143("w-full", className)
74113
74258
  }
74114
74259
  );
74115
74260
  MetricBar.displayName = "MetricBar";
74116
74261
 
74117
74262
  // src/components/NetworkGraph/NetworkGraph.tsx
74118
- import { useEffect as useEffect83, useId as useId47, useMemo as useMemo70, useRef as useRef82, useState as useState98 } from "react";
74263
+ import { useEffect as useEffect84, useId as useId47, useMemo as useMemo70, useRef as useRef83, useState as useState99 } from "react";
74119
74264
 
74120
74265
  // src/components/NetworkGraph/model.ts
74121
74266
  var CELL = 64;
@@ -74259,17 +74404,17 @@ function findNetworkPath(edges, source, target) {
74259
74404
  }
74260
74405
 
74261
74406
  // src/components/NetworkGraph/useNetworkCanvas.ts
74262
- import { useCallback as useCallback54, useEffect as useEffect82, useRef as useRef81, useState as useState97 } from "react";
74407
+ import { useCallback as useCallback55, useEffect as useEffect83, useRef as useRef82, useState as useState98 } from "react";
74263
74408
  function useNetworkCanvas(options) {
74264
- const canvasRef = useRef81(null);
74265
- const view = useRef81({ x: 0, y: 0, zoom: 1 });
74266
- const size = useRef81({ width: 1, height: 1 });
74267
- const latest = useRef81(options);
74268
- const frame = useRef81(null);
74269
- const [zoom, setZoom] = useState97(1);
74270
- const colors3 = useRef81(/* @__PURE__ */ new Map());
74271
- const textColor = useRef81("#737373");
74272
- const draw = useCallback54(() => {
74409
+ const canvasRef = useRef82(null);
74410
+ const view = useRef82({ x: 0, y: 0, zoom: 1 });
74411
+ const size = useRef82({ width: 1, height: 1 });
74412
+ const latest = useRef82(options);
74413
+ const frame = useRef82(null);
74414
+ const [zoom, setZoom] = useState98(1);
74415
+ const colors3 = useRef82(/* @__PURE__ */ new Map());
74416
+ const textColor = useRef82("#737373");
74417
+ const draw = useCallback55(() => {
74273
74418
  const canvas = canvasRef.current;
74274
74419
  const ctx = canvas?.getContext("2d");
74275
74420
  if (!canvas || !ctx) return;
@@ -74369,14 +74514,14 @@ function useNetworkCanvas(options) {
74369
74514
  }
74370
74515
  ctx.globalAlpha = 1;
74371
74516
  }, []);
74372
- const requestDraw = useCallback54(() => {
74517
+ const requestDraw = useCallback55(() => {
74373
74518
  if (frame.current !== null) return;
74374
74519
  frame.current = requestAnimationFrame(() => {
74375
74520
  frame.current = null;
74376
74521
  draw();
74377
74522
  });
74378
74523
  }, [draw]);
74379
- const update = useCallback54(
74524
+ const update = useCallback55(
74380
74525
  (next) => {
74381
74526
  view.current = next;
74382
74527
  setZoom(next.zoom);
@@ -74385,7 +74530,7 @@ function useNetworkCanvas(options) {
74385
74530
  },
74386
74531
  [requestDraw]
74387
74532
  );
74388
- const fit = useCallback54(
74533
+ const fit = useCallback55(
74389
74534
  () => update(
74390
74535
  fitNetwork(
74391
74536
  latest.current.nodes,
@@ -74395,11 +74540,11 @@ function useNetworkCanvas(options) {
74395
74540
  ),
74396
74541
  [update]
74397
74542
  );
74398
- const zoomBy = useCallback54(
74543
+ const zoomBy = useCallback55(
74399
74544
  (factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
74400
74545
  [update]
74401
74546
  );
74402
- const focusNode = useCallback54(
74547
+ const focusNode = useCallback55(
74403
74548
  (node) => {
74404
74549
  update({
74405
74550
  ...view.current,
@@ -74409,14 +74554,14 @@ function useNetworkCanvas(options) {
74409
74554
  },
74410
74555
  [update]
74411
74556
  );
74412
- useEffect82(() => {
74557
+ useEffect83(() => {
74413
74558
  latest.current = options;
74414
74559
  requestDraw();
74415
74560
  }, [options, requestDraw]);
74416
- useEffect82(() => {
74561
+ useEffect83(() => {
74417
74562
  fit();
74418
74563
  }, [options.model, fit]);
74419
- useEffect82(() => {
74564
+ useEffect83(() => {
74420
74565
  const canvas = canvasRef.current;
74421
74566
  if (!canvas) return;
74422
74567
  const measure = () => {
@@ -74469,7 +74614,7 @@ function useNetworkCanvas(options) {
74469
74614
  }
74470
74615
 
74471
74616
  // src/components/NetworkGraph/NetworkGraph.tsx
74472
- import { jsx as jsx336, jsxs as jsxs209 } from "react/jsx-runtime";
74617
+ import { jsx as jsx337, jsxs as jsxs210 } from "react/jsx-runtime";
74473
74618
  var NO_COMMUNITIES = [];
74474
74619
  var NO_HIGHLIGHTS = [];
74475
74620
  function NetworkGraph({
@@ -74501,10 +74646,10 @@ function NetworkGraph({
74501
74646
  }) {
74502
74647
  const t = useKitT();
74503
74648
  const helpId = useId47();
74504
- const layoutRef = useRef82(null);
74505
- const [hasLegendSpace, setHasLegendSpace] = useState98(true);
74649
+ const layoutRef = useRef83(null);
74650
+ const [hasLegendSpace, setHasLegendSpace] = useState99(true);
74506
74651
  const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
74507
- useEffect83(() => {
74652
+ useEffect84(() => {
74508
74653
  const element = layoutRef.current;
74509
74654
  if (!element || legendPosition !== "auto") return;
74510
74655
  const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
@@ -74517,12 +74662,12 @@ function NetworkGraph({
74517
74662
  () => buildNetwork(nodes, edges, communities),
74518
74663
  [nodes, edges, communities]
74519
74664
  );
74520
- const [internalSelected, setInternalSelected] = useState98(
74665
+ const [internalSelected, setInternalSelected] = useState99(
74521
74666
  defaultSelectedNodeId
74522
74667
  );
74523
- const [hidden, setHidden] = useState98(() => /* @__PURE__ */ new Set());
74524
- const [focused, setFocused] = useState98(null);
74525
- const [query, setQuery] = useState98("");
74668
+ const [hidden, setHidden] = useState99(() => /* @__PURE__ */ new Set());
74669
+ const [focused, setFocused] = useState99(null);
74670
+ const [query, setQuery] = useState99("");
74526
74671
  const enabled = useMemo70(
74527
74672
  () => new Set(
74528
74673
  visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
@@ -74564,7 +74709,7 @@ function NetworkGraph({
74564
74709
  onViewportChange
74565
74710
  });
74566
74711
  const locked = disabled || loading;
74567
- const drag = useRef82(null);
74712
+ const drag = useRef83(null);
74568
74713
  const select = (id) => {
74569
74714
  if (locked) return;
74570
74715
  if (selectedNodeId === void 0) setInternalSelected(id);
@@ -74580,7 +74725,7 @@ function NetworkGraph({
74580
74725
  );
74581
74726
  onVisibleCommunitiesChange?.(ids);
74582
74727
  };
74583
- useEffect83(() => {
74728
+ useEffect84(() => {
74584
74729
  const element = canvas.canvasRef.current;
74585
74730
  if (!element || locked) return;
74586
74731
  const wheel = (event) => {
@@ -74635,7 +74780,7 @@ function NetworkGraph({
74635
74780
  }, [visibleNodes, query]);
74636
74781
  const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
74637
74782
  const resolvedLegendTone = legendTone === "auto" ? tone : legendTone;
74638
- const legendContent = /* @__PURE__ */ jsxs209(
74783
+ const legendContent = /* @__PURE__ */ jsxs210(
74639
74784
  "fieldset",
74640
74785
  {
74641
74786
  disabled: locked,
@@ -74644,8 +74789,8 @@ function NetworkGraph({
74644
74789
  maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
74645
74790
  },
74646
74791
  children: [
74647
- /* @__PURE__ */ jsx336("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
74648
- /* @__PURE__ */ jsx336(
74792
+ /* @__PURE__ */ jsx337("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
74793
+ /* @__PURE__ */ jsx337(
74649
74794
  Checkbox_default,
74650
74795
  {
74651
74796
  size: "sm",
@@ -74656,8 +74801,8 @@ function NetworkGraph({
74656
74801
  onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
74657
74802
  }
74658
74803
  ),
74659
- model.groups.map((group) => /* @__PURE__ */ jsxs209("div", { className: "flex items-center justify-between gap-2", children: [
74660
- /* @__PURE__ */ jsx336(
74804
+ model.groups.map((group) => /* @__PURE__ */ jsxs210("div", { className: "flex items-center justify-between gap-2", children: [
74805
+ /* @__PURE__ */ jsx337(
74661
74806
  Checkbox_default,
74662
74807
  {
74663
74808
  size: "sm",
@@ -74669,12 +74814,12 @@ function NetworkGraph({
74669
74814
  )
74670
74815
  }
74671
74816
  ),
74672
- /* @__PURE__ */ jsx336("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
74817
+ /* @__PURE__ */ jsx337("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
74673
74818
  ] }, group.id))
74674
74819
  ]
74675
74820
  }
74676
74821
  );
74677
- return /* @__PURE__ */ jsx336(
74822
+ return /* @__PURE__ */ jsx337(
74678
74823
  Panel_default,
74679
74824
  {
74680
74825
  ...panelProps,
@@ -74685,7 +74830,7 @@ function NetworkGraph({
74685
74830
  loading,
74686
74831
  clickable: false,
74687
74832
  scrollable: false,
74688
- children: /* @__PURE__ */ jsxs209(
74833
+ children: /* @__PURE__ */ jsxs210(
74689
74834
  "div",
74690
74835
  {
74691
74836
  className: "flex min-w-0 flex-col gap-3",
@@ -74693,7 +74838,7 @@ function NetworkGraph({
74693
74838
  "aria-label": ariaLabel ?? t("kit.networkGraph.name"),
74694
74839
  "aria-disabled": locked || void 0,
74695
74840
  children: [
74696
- showControls && /* @__PURE__ */ jsx336("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx336("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx336(
74841
+ showControls && /* @__PURE__ */ jsx337("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx337("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx337(
74697
74842
  Combobox_default,
74698
74843
  {
74699
74844
  size: "sm",
@@ -74715,7 +74860,7 @@ function NetworkGraph({
74715
74860
  }
74716
74861
  }
74717
74862
  ) }) }),
74718
- /* @__PURE__ */ jsxs209(
74863
+ /* @__PURE__ */ jsxs210(
74719
74864
  "div",
74720
74865
  {
74721
74866
  ref: layoutRef,
@@ -74723,13 +74868,13 @@ function NetworkGraph({
74723
74868
  style: { flexDirection: legendOnRight ? "row" : "column" },
74724
74869
  "data-legend-position": legendOnRight ? "right" : "bottom",
74725
74870
  children: [
74726
- /* @__PURE__ */ jsxs209(
74871
+ /* @__PURE__ */ jsxs210(
74727
74872
  "div",
74728
74873
  {
74729
74874
  className: "relative min-w-0 flex-1",
74730
74875
  style: { height: graphHeight, minHeight: graphHeight },
74731
74876
  children: [
74732
- /* @__PURE__ */ jsx336(
74877
+ /* @__PURE__ */ jsx337(
74733
74878
  "canvas",
74734
74879
  {
74735
74880
  ref: canvas.canvasRef,
@@ -74798,11 +74943,11 @@ function NetworkGraph({
74798
74943
  }
74799
74944
  }
74800
74945
  ),
74801
- showControls && /* @__PURE__ */ jsxs209("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: [
74802
- /* @__PURE__ */ jsx336(
74946
+ showControls && /* @__PURE__ */ jsxs210("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: [
74947
+ /* @__PURE__ */ jsx337(
74803
74948
  IconButton_default,
74804
74949
  {
74805
- icon: /* @__PURE__ */ jsxs209(
74950
+ icon: /* @__PURE__ */ jsxs210(
74806
74951
  "svg",
74807
74952
  {
74808
74953
  viewBox: "0 0 24 24",
@@ -74813,10 +74958,10 @@ function NetworkGraph({
74813
74958
  strokeLinejoin: "round",
74814
74959
  "aria-hidden": "true",
74815
74960
  children: [
74816
- /* @__PURE__ */ jsx336("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
74817
- /* @__PURE__ */ jsx336("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
74818
- /* @__PURE__ */ jsx336("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
74819
- /* @__PURE__ */ jsx336("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
74961
+ /* @__PURE__ */ jsx337("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
74962
+ /* @__PURE__ */ jsx337("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
74963
+ /* @__PURE__ */ jsx337("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
74964
+ /* @__PURE__ */ jsx337("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
74820
74965
  ]
74821
74966
  }
74822
74967
  ),
@@ -74829,10 +74974,10 @@ function NetworkGraph({
74829
74974
  onClick: canvas.fit
74830
74975
  }
74831
74976
  ),
74832
- /* @__PURE__ */ jsx336(
74977
+ /* @__PURE__ */ jsx337(
74833
74978
  IconButton_default,
74834
74979
  {
74835
- icon: /* @__PURE__ */ jsx336(
74980
+ icon: /* @__PURE__ */ jsx337(
74836
74981
  "svg",
74837
74982
  {
74838
74983
  viewBox: "0 0 24 24",
@@ -74841,7 +74986,7 @@ function NetworkGraph({
74841
74986
  strokeWidth: 2,
74842
74987
  strokeLinecap: "round",
74843
74988
  "aria-hidden": "true",
74844
- children: /* @__PURE__ */ jsx336("path", { d: "M6 12h12" })
74989
+ children: /* @__PURE__ */ jsx337("path", { d: "M6 12h12" })
74845
74990
  }
74846
74991
  ),
74847
74992
  size: "xs",
@@ -74853,7 +74998,7 @@ function NetworkGraph({
74853
74998
  onClick: () => canvas.zoomBy(0.8)
74854
74999
  }
74855
75000
  ),
74856
- /* @__PURE__ */ jsxs209(
75001
+ /* @__PURE__ */ jsxs210(
74857
75002
  "span",
74858
75003
  {
74859
75004
  className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
@@ -74864,7 +75009,7 @@ function NetworkGraph({
74864
75009
  ]
74865
75010
  }
74866
75011
  ),
74867
- /* @__PURE__ */ jsx336(
75012
+ /* @__PURE__ */ jsx337(
74868
75013
  IconButton_default,
74869
75014
  {
74870
75015
  icon: "Add",
@@ -74877,7 +75022,7 @@ function NetworkGraph({
74877
75022
  onClick: () => canvas.zoomBy(1.25)
74878
75023
  }
74879
75024
  ),
74880
- /* @__PURE__ */ jsx336(
75025
+ /* @__PURE__ */ jsx337(
74881
75026
  IconButton_default,
74882
75027
  {
74883
75028
  icon: "Reset",
@@ -74895,18 +75040,18 @@ function NetworkGraph({
74895
75040
  }
74896
75041
  )
74897
75042
  ] }),
74898
- !visibleNodes.length && /* @__PURE__ */ jsx336("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
75043
+ !visibleNodes.length && /* @__PURE__ */ jsx337("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
74899
75044
  ]
74900
75045
  }
74901
75046
  ),
74902
- showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx336(
75047
+ showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx337(
74903
75048
  "div",
74904
75049
  {
74905
75050
  className: "min-w-0 shrink-0",
74906
75051
  style: {
74907
75052
  width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
74908
75053
  },
74909
- children: legendPanel ? /* @__PURE__ */ jsx336(
75054
+ children: legendPanel ? /* @__PURE__ */ jsx337(
74910
75055
  Panel_default,
74911
75056
  {
74912
75057
  variant: legendVariant === "auto" ? variant : legendVariant,
@@ -74925,8 +75070,8 @@ function NetworkGraph({
74925
75070
  ]
74926
75071
  }
74927
75072
  ),
74928
- /* @__PURE__ */ jsx336("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
74929
- /* @__PURE__ */ jsx336(
75073
+ /* @__PURE__ */ jsx337("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
75074
+ /* @__PURE__ */ jsx337(
74930
75075
  "p",
74931
75076
  {
74932
75077
  role: "status",
@@ -75138,6 +75283,7 @@ export {
75138
75283
  OTP_VARIANTS,
75139
75284
  OrganizationChart_default as OrganizationChart,
75140
75285
  PAGED_PANEL_LOADERS,
75286
+ SURFACE_VARIANTS as PAGE_HEADER_VARIANTS,
75141
75287
  PANEL_HERO_TITLE_ELEMENTS,
75142
75288
  PANEL_HERO_VARIANTS,
75143
75289
  PANEL_TONE_FOR_FIELD,
@@ -75152,6 +75298,7 @@ export {
75152
75298
  PROGRESS_MOTION_DIRECTIONS,
75153
75299
  PROGRESS_MOTION_SPEEDS,
75154
75300
  PT_KIT_CATALOG,
75301
+ PageBodyLayout,
75155
75302
  PageHeader_default as PageHeader,
75156
75303
  PagedPanel_default as PagedPanel,
75157
75304
  Panel_default as Panel,