@cjlapao/ui-kit 0.2.13 → 0.2.14
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/{CapsuleBlueprint-DY1EmDQu.d.cts → CapsuleBlueprint-sug3nUbg.d.cts} +13 -1
- package/dist/{CapsuleBlueprint-DY1EmDQu.d.ts → CapsuleBlueprint-sug3nUbg.d.ts} +13 -1
- package/dist/index.cjs +249 -246
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +74 -16
- package/dist/index.d.cts +89 -48
- package/dist/index.d.ts +89 -48
- package/dist/index.js +237 -238
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5287,6 +5287,9 @@ var surfaceCornerRem = {
|
|
|
5287
5287
|
};
|
|
5288
5288
|
var DEFAULT_SURFACE_CORNER = "rounded-md";
|
|
5289
5289
|
var COLLAPSED_RAIL_WIDTH = 56;
|
|
5290
|
+
var PANEL_SLIDE_DURATION_MS = 450;
|
|
5291
|
+
var PANEL_SLIDE_EASING = "cubic-bezier(0.32, 0.72, 0, 1)";
|
|
5292
|
+
var panelSlideTransition = (...properties) => properties.map((property) => `${property} ${PANEL_SLIDE_DURATION_MS}ms ${PANEL_SLIDE_EASING}`).join(", ");
|
|
5290
5293
|
var DEFAULT_CONTROL_CORNER = "rounded-lg";
|
|
5291
5294
|
var SURFACE_VARIANT_FOR_FIELD = {
|
|
5292
5295
|
flat: "outlined",
|
|
@@ -14285,7 +14288,13 @@ var CollapseToggleButton = ({
|
|
|
14285
14288
|
size = "sm",
|
|
14286
14289
|
...rest
|
|
14287
14290
|
}) => {
|
|
14288
|
-
const
|
|
14291
|
+
const towardEdge = !collapsed;
|
|
14292
|
+
const rotation = {
|
|
14293
|
+
right: towardEdge ? "" : "rotate-180",
|
|
14294
|
+
left: towardEdge ? "rotate-180" : "",
|
|
14295
|
+
bottom: towardEdge ? "rotate-90" : "-rotate-90",
|
|
14296
|
+
top: towardEdge ? "-rotate-90" : "rotate-90"
|
|
14297
|
+
}[edge];
|
|
14289
14298
|
return /* @__PURE__ */ jsx172(
|
|
14290
14299
|
IconButton_default,
|
|
14291
14300
|
{
|
|
@@ -14294,7 +14303,7 @@ var CollapseToggleButton = ({
|
|
|
14294
14303
|
{
|
|
14295
14304
|
className: classNames23(
|
|
14296
14305
|
"transition-transform duration-200 motion-reduce:transition-none",
|
|
14297
|
-
|
|
14306
|
+
rotation
|
|
14298
14307
|
)
|
|
14299
14308
|
}
|
|
14300
14309
|
),
|
|
@@ -22477,7 +22486,8 @@ var PageHeader = ({
|
|
|
22477
22486
|
className = "",
|
|
22478
22487
|
...rest
|
|
22479
22488
|
}) => {
|
|
22480
|
-
const
|
|
22489
|
+
const plain = variant === "none" || variant === "plain";
|
|
22490
|
+
const sharedSurface = !plain && variant !== "default" && variant !== "floating" && variant !== "floating-glass";
|
|
22481
22491
|
const surface = variant === "floating" || variant === "floating-glass" ? getSidebarSurfaceTokens(variant, accentColor) : null;
|
|
22482
22492
|
const pair = surface ? "xs" : "none";
|
|
22483
22493
|
const gutter = {
|
|
@@ -22503,7 +22513,7 @@ var PageHeader = ({
|
|
|
22503
22513
|
surface.border,
|
|
22504
22514
|
surface.shadow,
|
|
22505
22515
|
surface.fill
|
|
22506
|
-
) : !sharedSurface && classNames53("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
|
|
22516
|
+
) : !sharedSurface && !plain && classNames53("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
|
|
22507
22517
|
className
|
|
22508
22518
|
),
|
|
22509
22519
|
children: [
|
|
@@ -42985,6 +42995,21 @@ import React60, {
|
|
|
42985
42995
|
useRef as useRef51,
|
|
42986
42996
|
useState as useState52
|
|
42987
42997
|
} from "react";
|
|
42998
|
+
|
|
42999
|
+
// ../common/theme/noise.ts
|
|
43000
|
+
var NOISE_BACKGROUND_IMAGE = `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`;
|
|
43001
|
+
var LIGHT = "mix-blend-multiply opacity-[0.08]";
|
|
43002
|
+
var DARK = "mix-blend-overlay opacity-[0.4]";
|
|
43003
|
+
function getNoiseBlendClasses(scheme = "auto") {
|
|
43004
|
+
if (scheme === "light") return LIGHT;
|
|
43005
|
+
if (scheme === "dark") return DARK;
|
|
43006
|
+
return `${LIGHT} dark:mix-blend-overlay dark:opacity-[0.4]`;
|
|
43007
|
+
}
|
|
43008
|
+
function getNoiseBackgroundSize(scale) {
|
|
43009
|
+
return scale !== void 0 && Number.isFinite(scale) && scale > 0 ? `${200 * scale}px ${200 * scale}px` : void 0;
|
|
43010
|
+
}
|
|
43011
|
+
|
|
43012
|
+
// src/components/SideMenu.tsx
|
|
42988
43013
|
import { Fragment as Fragment33, jsx as jsx259, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
42989
43014
|
var EMPTY_VIEW_OPTIONS = [];
|
|
42990
43015
|
var NOISE_STYLE = {
|
|
@@ -43329,6 +43354,7 @@ var SideMenu = ({
|
|
|
43329
43354
|
footerDetails,
|
|
43330
43355
|
footerDetailsTone,
|
|
43331
43356
|
noise = false,
|
|
43357
|
+
noiseScale,
|
|
43332
43358
|
loading = false,
|
|
43333
43359
|
loaderType = "skeleton",
|
|
43334
43360
|
loaderTitle,
|
|
@@ -43979,7 +44005,8 @@ var SideMenu = ({
|
|
|
43979
44005
|
"div",
|
|
43980
44006
|
{
|
|
43981
44007
|
className: `absolute inset-0 opacity-[0.4] pointer-events-none mix-blend-overlay ${surface.radius}`,
|
|
43982
|
-
|
|
44008
|
+
"data-sidemenu-noise": true,
|
|
44009
|
+
style: { ...NOISE_STYLE, backgroundSize: getNoiseBackgroundSize(noiseScale) }
|
|
43983
44010
|
}
|
|
43984
44011
|
),
|
|
43985
44012
|
/* @__PURE__ */ jsx259(
|
|
@@ -44331,18 +44358,6 @@ import {
|
|
|
44331
44358
|
useState as useState55
|
|
44332
44359
|
} from "react";
|
|
44333
44360
|
import classNames80 from "classnames";
|
|
44334
|
-
|
|
44335
|
-
// ../common/theme/noise.ts
|
|
44336
|
-
var NOISE_BACKGROUND_IMAGE = `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`;
|
|
44337
|
-
var LIGHT = "mix-blend-multiply opacity-[0.08]";
|
|
44338
|
-
var DARK = "mix-blend-overlay opacity-[0.4]";
|
|
44339
|
-
function getNoiseBlendClasses(scheme = "auto") {
|
|
44340
|
-
if (scheme === "light") return LIGHT;
|
|
44341
|
-
if (scheme === "dark") return DARK;
|
|
44342
|
-
return `${LIGHT} dark:mix-blend-overlay dark:opacity-[0.4]`;
|
|
44343
|
-
}
|
|
44344
|
-
|
|
44345
|
-
// src/components/SidePanel.tsx
|
|
44346
44361
|
import { Fragment as Fragment36, jsx as jsx263, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
44347
44362
|
var LEGACY_PANEL_VARIANTS = {
|
|
44348
44363
|
sidebar: "elevated",
|
|
@@ -44352,20 +44367,46 @@ var LEGACY_PANEL_VARIANTS = {
|
|
|
44352
44367
|
};
|
|
44353
44368
|
var resolvePanelVariant2 = (variant) => variant in LEGACY_PANEL_VARIANTS ? LEGACY_PANEL_VARIANTS[variant] : variant;
|
|
44354
44369
|
var getSidePanelTextTokens = (variant) => getSurfaceTextTokens(resolvePanelVariant2(variant));
|
|
44355
|
-
var
|
|
44370
|
+
var INSET_GAP = {
|
|
44371
|
+
xs: { x: "inset-x-1", y: "inset-y-1", px: "px-1", py: "py-1" },
|
|
44372
|
+
sm: { x: "inset-x-2", y: "inset-y-2", px: "px-2", py: "py-2" },
|
|
44373
|
+
md: { x: "inset-x-4", y: "inset-y-4", px: "px-4", py: "py-4" },
|
|
44374
|
+
lg: { x: "inset-x-6", y: "inset-y-6", px: "px-6", py: "py-6" },
|
|
44375
|
+
xl: { x: "inset-x-8", y: "inset-y-8", px: "px-8", py: "py-8" }
|
|
44376
|
+
};
|
|
44377
|
+
var INSET_BORDER = {
|
|
44378
|
+
right: "border-y border-l",
|
|
44379
|
+
left: "border-y border-r",
|
|
44380
|
+
top: "border-x border-b",
|
|
44381
|
+
bottom: "border-x border-t"
|
|
44382
|
+
};
|
|
44383
|
+
var FLUSH_BORDER = {
|
|
44384
|
+
right: "border-l",
|
|
44385
|
+
left: "border-r",
|
|
44386
|
+
top: "border-b",
|
|
44387
|
+
bottom: "border-t"
|
|
44388
|
+
};
|
|
44389
|
+
var BAR_INSET = {
|
|
44390
|
+
none: { x: "inset-x-0", y: "inset-y-0" },
|
|
44391
|
+
rounded: { x: "inset-x-1", y: "inset-y-1" },
|
|
44392
|
+
"rounded-sm": { x: "inset-x-2", y: "inset-y-2" },
|
|
44393
|
+
"rounded-md": { x: "inset-x-4", y: "inset-y-4" },
|
|
44394
|
+
"rounded-lg": { x: "inset-x-6", y: "inset-y-6" },
|
|
44395
|
+
"rounded-xl": { x: "inset-x-8", y: "inset-y-8" }
|
|
44396
|
+
};
|
|
44356
44397
|
var INNER_CORNER = {
|
|
44357
44398
|
// (`"auto"` is absent by design: SidePanel's own default is `rounded`, and
|
|
44358
44399
|
// corner lookups below resolve it to the theme default.)
|
|
44359
|
-
none: { right: "", left: "" },
|
|
44360
|
-
rounded: { right: "rounded-l-sm", left: "rounded-r-sm" },
|
|
44361
|
-
"rounded-sm": { right: "rounded-l-lg", left: "rounded-r-lg" },
|
|
44362
|
-
"rounded-md": { right: "rounded-l-2xl", left: "rounded-r-2xl" },
|
|
44363
|
-
"rounded-lg": { right: "rounded-l-3xl", left: "rounded-r-3xl" },
|
|
44364
|
-
"rounded-xl": { right: "rounded-l-4xl", left: "rounded-r-4xl" }
|
|
44365
|
-
};
|
|
44366
|
-
var SIDE_PANEL_SIDES = ["left", "right"];
|
|
44367
|
-
var OPEN_DURATION_MS =
|
|
44368
|
-
var OPEN_EASING =
|
|
44400
|
+
none: { right: "", left: "", top: "", bottom: "" },
|
|
44401
|
+
rounded: { right: "rounded-l-sm", left: "rounded-r-sm", top: "rounded-b-sm", bottom: "rounded-t-sm" },
|
|
44402
|
+
"rounded-sm": { right: "rounded-l-lg", left: "rounded-r-lg", top: "rounded-b-lg", bottom: "rounded-t-lg" },
|
|
44403
|
+
"rounded-md": { right: "rounded-l-2xl", left: "rounded-r-2xl", top: "rounded-b-2xl", bottom: "rounded-t-2xl" },
|
|
44404
|
+
"rounded-lg": { right: "rounded-l-3xl", left: "rounded-r-3xl", top: "rounded-b-3xl", bottom: "rounded-t-3xl" },
|
|
44405
|
+
"rounded-xl": { right: "rounded-l-4xl", left: "rounded-r-4xl", top: "rounded-b-4xl", bottom: "rounded-t-4xl" }
|
|
44406
|
+
};
|
|
44407
|
+
var SIDE_PANEL_SIDES = ["left", "right", "top", "bottom"];
|
|
44408
|
+
var OPEN_DURATION_MS = PANEL_SLIDE_DURATION_MS;
|
|
44409
|
+
var OPEN_EASING = PANEL_SLIDE_EASING;
|
|
44369
44410
|
var SIZE_TOKENS4 = {
|
|
44370
44411
|
xs: {
|
|
44371
44412
|
pad: "px-2 py-1.5",
|
|
@@ -44406,6 +44447,9 @@ var SidePanel = ({
|
|
|
44406
44447
|
subtitle,
|
|
44407
44448
|
icon,
|
|
44408
44449
|
width = 420,
|
|
44450
|
+
height = 240,
|
|
44451
|
+
minHeight = 120,
|
|
44452
|
+
maxHeight = 600,
|
|
44409
44453
|
headerActions,
|
|
44410
44454
|
footer,
|
|
44411
44455
|
children,
|
|
@@ -44425,6 +44469,7 @@ var SidePanel = ({
|
|
|
44425
44469
|
side = "right",
|
|
44426
44470
|
overlay = false,
|
|
44427
44471
|
noise = false,
|
|
44472
|
+
noiseScale,
|
|
44428
44473
|
inset,
|
|
44429
44474
|
corner = DEFAULT_SURFACE_CORNER,
|
|
44430
44475
|
collapsible = false,
|
|
@@ -44436,6 +44481,7 @@ var SidePanel = ({
|
|
|
44436
44481
|
}) => {
|
|
44437
44482
|
const t = useKitT();
|
|
44438
44483
|
warnIfMissingTitle("SidePanel", title);
|
|
44484
|
+
const vertical = side === "top" || side === "bottom";
|
|
44439
44485
|
const effectiveTone = tone ?? color ?? "neutral";
|
|
44440
44486
|
const sizeToken = SIZE_TOKENS4[size] ?? SIZE_TOKENS4.md;
|
|
44441
44487
|
const legacyVariant = variant in LEGACY_PANEL_VARIANTS;
|
|
@@ -44449,10 +44495,13 @@ var SidePanel = ({
|
|
|
44449
44495
|
surfaceTone
|
|
44450
44496
|
);
|
|
44451
44497
|
const surfaceText = getSidePanelTextTokens(variant);
|
|
44452
|
-
const
|
|
44453
|
-
const
|
|
44454
|
-
const
|
|
44455
|
-
const
|
|
44498
|
+
const insetValue = inset ?? surface.offset !== "";
|
|
44499
|
+
const insetSize = insetValue === true ? "md" : insetValue === false || insetValue === "none" ? null : insetValue;
|
|
44500
|
+
const isInset = insetSize !== null;
|
|
44501
|
+
const insetGap = insetSize ? INSET_GAP[insetSize] : null;
|
|
44502
|
+
const cornerClass = docked ? getSurfaceCornerClass(corner) : INNER_CORNER[corner === "auto" ? DEFAULT_SURFACE_CORNER : corner][side];
|
|
44503
|
+
const borderClass = surface.border ? `${surface.border} ${docked ? "border" : isInset ? INSET_BORDER[side] : surface.borderSides === "all" ? "border" : FLUSH_BORDER[side]}` : "";
|
|
44504
|
+
const shadowClass = side === "right" ? surface.shadowRight : surface.shadow;
|
|
44456
44505
|
const [mounted, setMounted] = useState55(isOpen);
|
|
44457
44506
|
const [entered, setEntered] = useState55(isOpen);
|
|
44458
44507
|
const prevOpenRef = useRef52(isOpen);
|
|
@@ -44473,10 +44522,11 @@ var SidePanel = ({
|
|
|
44473
44522
|
}, [mounted, isOpen, entered]);
|
|
44474
44523
|
const handleTransitionEnd = (event) => {
|
|
44475
44524
|
if (event.target !== event.currentTarget) return;
|
|
44476
|
-
if (event.propertyName !== "width") return;
|
|
44525
|
+
if (event.propertyName !== (vertical ? "height" : "width")) return;
|
|
44477
44526
|
if (!isOpen) setMounted(false);
|
|
44478
44527
|
};
|
|
44479
44528
|
const [currentWidth, setCurrentWidth] = useState55(width);
|
|
44529
|
+
const [currentHeight, setCurrentHeight] = useState55(height);
|
|
44480
44530
|
const isDraggingRef = useRef52(false);
|
|
44481
44531
|
const [isDragging, setIsDragging] = useState55(false);
|
|
44482
44532
|
const startXRef = useRef52(0);
|
|
@@ -44484,15 +44534,25 @@ var SidePanel = ({
|
|
|
44484
44534
|
useEffect54(() => {
|
|
44485
44535
|
if (!isDraggingRef.current) setCurrentWidth(width);
|
|
44486
44536
|
}, [width]);
|
|
44537
|
+
useEffect54(() => {
|
|
44538
|
+
if (!isDraggingRef.current) setCurrentHeight(height);
|
|
44539
|
+
}, [height]);
|
|
44487
44540
|
const onMouseDown = useCallback32(
|
|
44488
44541
|
(e) => {
|
|
44489
44542
|
if (!resizable) return;
|
|
44490
44543
|
e.preventDefault();
|
|
44491
44544
|
isDraggingRef.current = true;
|
|
44492
44545
|
setIsDragging(true);
|
|
44493
|
-
startXRef.current = e.clientX;
|
|
44494
|
-
startWidthRef.current = currentWidth;
|
|
44546
|
+
startXRef.current = vertical ? e.clientY : e.clientX;
|
|
44547
|
+
startWidthRef.current = vertical ? currentHeight : currentWidth;
|
|
44495
44548
|
const onMouseMove = (ev) => {
|
|
44549
|
+
if (vertical) {
|
|
44550
|
+
const delta2 = side === "bottom" ? startXRef.current - ev.clientY : ev.clientY - startXRef.current;
|
|
44551
|
+
setCurrentHeight(
|
|
44552
|
+
Math.min(maxHeight, Math.max(minHeight, startWidthRef.current + delta2))
|
|
44553
|
+
);
|
|
44554
|
+
return;
|
|
44555
|
+
}
|
|
44496
44556
|
const delta = side === "right" ? startXRef.current - ev.clientX : ev.clientX - startXRef.current;
|
|
44497
44557
|
const next = Math.min(
|
|
44498
44558
|
maxWidth,
|
|
@@ -44501,7 +44561,7 @@ var SidePanel = ({
|
|
|
44501
44561
|
setCurrentWidth(next);
|
|
44502
44562
|
};
|
|
44503
44563
|
document.body.style.userSelect = "none";
|
|
44504
|
-
document.body.style.cursor = "col-resize";
|
|
44564
|
+
document.body.style.cursor = vertical ? "row-resize" : "col-resize";
|
|
44505
44565
|
const onMouseUp = () => {
|
|
44506
44566
|
isDraggingRef.current = false;
|
|
44507
44567
|
setIsDragging(false);
|
|
@@ -44513,9 +44573,10 @@ var SidePanel = ({
|
|
|
44513
44573
|
window.addEventListener("mousemove", onMouseMove);
|
|
44514
44574
|
window.addEventListener("mouseup", onMouseUp);
|
|
44515
44575
|
},
|
|
44516
|
-
[resizable, currentWidth, minWidth, maxWidth, side]
|
|
44576
|
+
[resizable, vertical, currentWidth, currentHeight, minWidth, maxWidth, minHeight, maxHeight, side]
|
|
44517
44577
|
);
|
|
44518
44578
|
const resolvedWidth = resizable ? currentWidth : width;
|
|
44579
|
+
const resolvedHeight = resizable ? currentHeight : height;
|
|
44519
44580
|
const [internalCollapsed, setInternalCollapsed] = useState55(defaultCollapsed);
|
|
44520
44581
|
const isCollapsed = collapsible && (collapsed ?? internalCollapsed);
|
|
44521
44582
|
const toggleCollapsed = () => {
|
|
@@ -44524,6 +44585,7 @@ var SidePanel = ({
|
|
|
44524
44585
|
onCollapsedChange?.(next);
|
|
44525
44586
|
};
|
|
44526
44587
|
const shellWidth = isCollapsed ? COLLAPSED_RAIL_WIDTH : resolvedWidth;
|
|
44588
|
+
const shellHeight = isCollapsed ? COLLAPSED_RAIL_WIDTH : resolvedHeight;
|
|
44527
44589
|
const collapseButton = (label) => /* @__PURE__ */ jsx263(
|
|
44528
44590
|
CollapseToggleButton,
|
|
44529
44591
|
{
|
|
@@ -44538,39 +44600,38 @@ var SidePanel = ({
|
|
|
44538
44600
|
(e) => {
|
|
44539
44601
|
if (!resizable) return;
|
|
44540
44602
|
const step = 20;
|
|
44541
|
-
const
|
|
44542
|
-
const
|
|
44603
|
+
const growKey = { right: "ArrowLeft", left: "ArrowRight", bottom: "ArrowUp", top: "ArrowDown" }[side];
|
|
44604
|
+
const shrinkKey = { right: "ArrowRight", left: "ArrowLeft", bottom: "ArrowDown", top: "ArrowUp" }[side];
|
|
44605
|
+
const grow = e.key === growKey;
|
|
44606
|
+
const shrink = e.key === shrinkKey;
|
|
44607
|
+
const [min, max, current, set] = vertical ? [minHeight, maxHeight, currentHeight, setCurrentHeight] : [minWidth, maxWidth, currentWidth, setCurrentWidth];
|
|
44543
44608
|
if (e.key === "Home") {
|
|
44544
44609
|
e.preventDefault();
|
|
44545
|
-
|
|
44610
|
+
set(min);
|
|
44546
44611
|
return;
|
|
44547
44612
|
}
|
|
44548
44613
|
if (e.key === "End") {
|
|
44549
44614
|
e.preventDefault();
|
|
44550
|
-
|
|
44615
|
+
set(max);
|
|
44551
44616
|
return;
|
|
44552
44617
|
}
|
|
44553
44618
|
if (!grow && !shrink) return;
|
|
44554
44619
|
e.preventDefault();
|
|
44555
|
-
|
|
44556
|
-
Math.min(
|
|
44557
|
-
maxWidth,
|
|
44558
|
-
Math.max(minWidth, currentWidth + (grow ? step : -step))
|
|
44559
|
-
)
|
|
44560
|
-
);
|
|
44620
|
+
set(Math.min(max, Math.max(min, current + (grow ? step : -step))));
|
|
44561
44621
|
},
|
|
44562
|
-
[resizable, side, currentWidth, minWidth, maxWidth]
|
|
44622
|
+
[resizable, vertical, side, currentWidth, currentHeight, minWidth, maxWidth, minHeight, maxHeight]
|
|
44563
44623
|
);
|
|
44564
44624
|
if (!mounted || docked && !isOpen) return null;
|
|
44565
|
-
const edgeOffset = entered ? shellWidth : 0;
|
|
44625
|
+
const edgeOffset = entered ? vertical ? shellHeight : shellWidth : 0;
|
|
44566
44626
|
const barTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-70 group-active:opacity-100`;
|
|
44567
|
-
const
|
|
44627
|
+
const gripTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`;
|
|
44628
|
+
const edgeProperty = side;
|
|
44568
44629
|
const handleStyle = {
|
|
44569
44630
|
[edgeProperty]: edgeOffset,
|
|
44570
44631
|
transition: isDragging ? void 0 : `${edgeProperty} ${OPEN_DURATION_MS}ms ${OPEN_EASING}, opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
44571
44632
|
};
|
|
44572
44633
|
const handleParked = isCollapsed;
|
|
44573
|
-
|
|
44634
|
+
const panel = /* @__PURE__ */ jsxs148(Fragment36, { children: [
|
|
44574
44635
|
/* @__PURE__ */ jsxs148(
|
|
44575
44636
|
"div",
|
|
44576
44637
|
{
|
|
@@ -44578,22 +44639,22 @@ var SidePanel = ({
|
|
|
44578
44639
|
"data-sp-shell": true,
|
|
44579
44640
|
"data-collapsed": collapsible ? isCollapsed : void 0,
|
|
44580
44641
|
className: classNames80(
|
|
44581
|
-
docked ? "relative
|
|
44582
|
-
!docked && (
|
|
44583
|
-
|
|
44642
|
+
docked ? classNames80("relative shrink-0 overflow-hidden", vertical ? "w-full" : "h-full") : "absolute z-40 overflow-hidden",
|
|
44643
|
+
!docked && (vertical ? insetGap ? insetGap.x : "left-0 w-full" : insetGap ? insetGap.y : "top-0 h-full"),
|
|
44644
|
+
!docked && { right: "right-0", left: "left-0", top: "top-0", bottom: "bottom-0" }[side],
|
|
44584
44645
|
cornerClass,
|
|
44585
44646
|
legacyVariant && borderClass,
|
|
44586
44647
|
legacyVariant ? shadowClass : panelOuterChrome
|
|
44587
44648
|
),
|
|
44588
44649
|
style: {
|
|
44589
|
-
|
|
44650
|
+
...vertical ? { height: entered ? shellHeight : 0 } : { width: entered ? shellWidth : 0 },
|
|
44590
44651
|
// Inline rather than `transition-[width] duration-… ease-…`: an
|
|
44591
44652
|
// arbitrary easing utility would have to survive the safelist, and
|
|
44592
44653
|
// this curve is not themeable anyway. It decelerates hard at the end,
|
|
44593
44654
|
// which is what stops the panel feeling like it snaps into place.
|
|
44594
44655
|
// Suppressed while resizing so the panel tracks the pointer exactly
|
|
44595
44656
|
// rather than lagging a third of a second behind it.
|
|
44596
|
-
transition: isDragging ? void 0 :
|
|
44657
|
+
transition: isDragging ? void 0 : `${vertical ? "height" : "width"} ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
44597
44658
|
},
|
|
44598
44659
|
onTransitionEnd: handleTransitionEnd,
|
|
44599
44660
|
children: [
|
|
@@ -44633,7 +44694,7 @@ var SidePanel = ({
|
|
|
44633
44694
|
getNoiseBlendClasses(),
|
|
44634
44695
|
cornerClass
|
|
44635
44696
|
),
|
|
44636
|
-
style: { backgroundImage: NOISE_BACKGROUND_IMAGE }
|
|
44697
|
+
style: { backgroundImage: NOISE_BACKGROUND_IMAGE, backgroundSize: getNoiseBackgroundSize(noiseScale) }
|
|
44637
44698
|
}
|
|
44638
44699
|
),
|
|
44639
44700
|
/* @__PURE__ */ jsxs148(
|
|
@@ -44643,12 +44704,13 @@ var SidePanel = ({
|
|
|
44643
44704
|
inert: isCollapsed || void 0,
|
|
44644
44705
|
"aria-hidden": isCollapsed || void 0,
|
|
44645
44706
|
className: classNames80(
|
|
44646
|
-
"
|
|
44707
|
+
"flex flex-col transition-opacity duration-200 motion-reduce:transition-none",
|
|
44708
|
+
side === "top" ? "absolute inset-x-0 bottom-0" : "relative h-full",
|
|
44647
44709
|
side === "left" && "ml-auto",
|
|
44648
44710
|
isCollapsed && "opacity-0",
|
|
44649
44711
|
className
|
|
44650
44712
|
),
|
|
44651
|
-
style: {
|
|
44713
|
+
style: vertical ? { height: resolvedHeight } : { width: resolvedWidth },
|
|
44652
44714
|
onKeyDown,
|
|
44653
44715
|
children: [
|
|
44654
44716
|
/* @__PURE__ */ jsxs148(
|
|
@@ -44685,7 +44747,9 @@ var SidePanel = ({
|
|
|
44685
44747
|
)
|
|
44686
44748
|
] }),
|
|
44687
44749
|
/* @__PURE__ */ jsxs148("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: [
|
|
44688
|
-
collapsible && collapseButton(
|
|
44750
|
+
collapsible && collapseButton(
|
|
44751
|
+
t("kit.sidepanel.collapse")
|
|
44752
|
+
),
|
|
44689
44753
|
headerActions,
|
|
44690
44754
|
onClose && !collapsible && /* @__PURE__ */ jsx263(
|
|
44691
44755
|
IconButton_default,
|
|
@@ -44712,10 +44776,10 @@ var SidePanel = ({
|
|
|
44712
44776
|
{
|
|
44713
44777
|
"data-sp-collapsed": true,
|
|
44714
44778
|
className: classNames80(
|
|
44715
|
-
"absolute
|
|
44716
|
-
side === "right" ? "left-0" : "right-0"
|
|
44779
|
+
"absolute flex items-center gap-3",
|
|
44780
|
+
vertical ? "inset-x-0 top-0 flex-row px-3" : classNames80("inset-y-0 flex-col py-3", side === "right" ? "left-0" : "right-0")
|
|
44717
44781
|
),
|
|
44718
|
-
style: { width: COLLAPSED_RAIL_WIDTH },
|
|
44782
|
+
style: vertical ? { height: COLLAPSED_RAIL_WIDTH } : { width: COLLAPSED_RAIL_WIDTH },
|
|
44719
44783
|
children: [
|
|
44720
44784
|
collapseButton(t("kit.sidepanel.expand")),
|
|
44721
44785
|
(collapsedLabel ?? title) && /* @__PURE__ */ jsx263(
|
|
@@ -44723,7 +44787,8 @@ var SidePanel = ({
|
|
|
44723
44787
|
{
|
|
44724
44788
|
"data-sp-collapsed-label": true,
|
|
44725
44789
|
className: classNames80(
|
|
44726
|
-
"
|
|
44790
|
+
"truncate text-xs font-semibold uppercase tracking-[0.2em]",
|
|
44791
|
+
vertical ? "min-w-0" : "min-h-0 [writing-mode:vertical-rl]",
|
|
44727
44792
|
surfaceText.muted
|
|
44728
44793
|
),
|
|
44729
44794
|
children: collapsedLabel ?? title
|
|
@@ -44752,7 +44817,7 @@ var SidePanel = ({
|
|
|
44752
44817
|
}
|
|
44753
44818
|
}
|
|
44754
44819
|
),
|
|
44755
|
-
resizable &&
|
|
44820
|
+
resizable && // ARIA 1.2 resizable separator: focusable (tabIndex), arrow keys /
|
|
44756
44821
|
// Home / End resize, aria-valuenow|min|max report the width. Parked
|
|
44757
44822
|
// (collapsed), it drops the role and every aria-* and leaves the tab
|
|
44758
44823
|
// order — see `handleParked`.
|
|
@@ -44764,15 +44829,16 @@ var SidePanel = ({
|
|
|
44764
44829
|
onKeyDown: handleParked ? void 0 : onSeparatorKeyDown,
|
|
44765
44830
|
role: handleParked ? void 0 : "separator",
|
|
44766
44831
|
"aria-hidden": handleParked || void 0,
|
|
44767
|
-
"aria-orientation": handleParked ? void 0 : "vertical",
|
|
44832
|
+
"aria-orientation": handleParked ? void 0 : vertical ? "horizontal" : "vertical",
|
|
44768
44833
|
"aria-label": handleParked ? void 0 : t("kit.sidepanel.resize"),
|
|
44769
|
-
"aria-valuenow": handleParked ? void 0 : resolvedWidth,
|
|
44770
|
-
"aria-valuemin": handleParked ? void 0 : minWidth,
|
|
44771
|
-
"aria-valuemax": handleParked ? void 0 : maxWidth,
|
|
44834
|
+
"aria-valuenow": handleParked ? void 0 : vertical ? resolvedHeight : resolvedWidth,
|
|
44835
|
+
"aria-valuemin": handleParked ? void 0 : vertical ? minHeight : minWidth,
|
|
44836
|
+
"aria-valuemax": handleParked ? void 0 : vertical ? maxHeight : maxWidth,
|
|
44772
44837
|
tabIndex: handleParked ? -1 : 0,
|
|
44773
44838
|
className: classNames80(
|
|
44774
|
-
"group absolute z-40
|
|
44775
|
-
|
|
44839
|
+
"group absolute z-40 bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 dark:focus-visible:ring-blue-500",
|
|
44840
|
+
vertical ? "h-3 cursor-row-resize" : "w-3 cursor-col-resize",
|
|
44841
|
+
vertical ? insetGap ? insetGap.x : "inset-x-0" : insetGap ? insetGap.y : "inset-y-0",
|
|
44776
44842
|
handleParked && "pointer-events-none opacity-0"
|
|
44777
44843
|
),
|
|
44778
44844
|
style: handleStyle,
|
|
@@ -44783,8 +44849,16 @@ var SidePanel = ({
|
|
|
44783
44849
|
className: classNames80(
|
|
44784
44850
|
// A hairline bar, centred on the panel edge (2px wide at -1px),
|
|
44785
44851
|
// so the grip below sits on it as a bulge on one centre line.
|
|
44786
|
-
|
|
44787
|
-
|
|
44852
|
+
// Inset by the corner radius, so the line stops where the
|
|
44853
|
+
// rounded corner starts instead of running past the curve.
|
|
44854
|
+
"absolute rounded-full transition duration-150",
|
|
44855
|
+
BAR_INSET[corner === "auto" ? DEFAULT_SURFACE_CORNER : corner][vertical ? "x" : "y"],
|
|
44856
|
+
{
|
|
44857
|
+
right: "w-0.5 -right-px",
|
|
44858
|
+
left: "w-0.5 -left-px",
|
|
44859
|
+
bottom: "h-0.5 -bottom-px",
|
|
44860
|
+
top: "h-0.5 -top-px"
|
|
44861
|
+
}[side],
|
|
44788
44862
|
barTone
|
|
44789
44863
|
)
|
|
44790
44864
|
}
|
|
@@ -44795,8 +44869,8 @@ var SidePanel = ({
|
|
|
44795
44869
|
"aria-hidden": "true",
|
|
44796
44870
|
"data-sp-grip": true,
|
|
44797
44871
|
className: classNames80(
|
|
44798
|
-
"pointer-events-none absolute
|
|
44799
|
-
side === "right" ? "-right-0.5" : "-left-0.5"
|
|
44872
|
+
"pointer-events-none absolute",
|
|
44873
|
+
vertical ? classNames80("left-1/2 h-1 w-10 -translate-x-1/2", side === "bottom" ? "-bottom-0.5" : "-top-0.5") : classNames80("top-1/2 h-10 w-1 -translate-y-1/2", side === "right" ? "-right-0.5" : "-left-0.5")
|
|
44800
44874
|
),
|
|
44801
44875
|
children: [
|
|
44802
44876
|
/* @__PURE__ */ jsx263(
|
|
@@ -44804,8 +44878,8 @@ var SidePanel = ({
|
|
|
44804
44878
|
{
|
|
44805
44879
|
"data-sp-grip-rest": true,
|
|
44806
44880
|
className: classNames80(
|
|
44807
|
-
"absolute inset-0 rounded-full bg-neutral-
|
|
44808
|
-
isDragging ? "opacity-0" : "opacity-
|
|
44881
|
+
"absolute inset-0 rounded-full bg-neutral-300 transition-opacity duration-150 dark:bg-neutral-600",
|
|
44882
|
+
isDragging ? "opacity-0" : "opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0"
|
|
44809
44883
|
)
|
|
44810
44884
|
}
|
|
44811
44885
|
),
|
|
@@ -44813,7 +44887,7 @@ var SidePanel = ({
|
|
|
44813
44887
|
"span",
|
|
44814
44888
|
{
|
|
44815
44889
|
"data-sp-grip-active": true,
|
|
44816
|
-
className: classNames80("absolute inset-0 rounded-full transition duration-150",
|
|
44890
|
+
className: classNames80("absolute inset-0 rounded-full transition duration-150", gripTone)
|
|
44817
44891
|
}
|
|
44818
44892
|
)
|
|
44819
44893
|
]
|
|
@@ -44823,6 +44897,20 @@ var SidePanel = ({
|
|
|
44823
44897
|
}
|
|
44824
44898
|
)
|
|
44825
44899
|
] });
|
|
44900
|
+
return docked ? /* @__PURE__ */ jsx263(
|
|
44901
|
+
"div",
|
|
44902
|
+
{
|
|
44903
|
+
"data-sp-dock": true,
|
|
44904
|
+
className: classNames80(
|
|
44905
|
+
"relative flex shrink-0",
|
|
44906
|
+
vertical ? "w-full flex-col" : "h-full",
|
|
44907
|
+
// Inset docked: the gap is padding on the wrapper, so the panel is
|
|
44908
|
+
// shorter (narrower) than its zone; the handle matches it above.
|
|
44909
|
+
insetGap && (vertical ? insetGap.px : insetGap.py)
|
|
44910
|
+
),
|
|
44911
|
+
children: panel
|
|
44912
|
+
}
|
|
44913
|
+
) : panel;
|
|
44826
44914
|
};
|
|
44827
44915
|
var SidePanel_default = SidePanel;
|
|
44828
44916
|
|
|
@@ -65686,6 +65774,7 @@ var WorkflowTrackerRail = ({
|
|
|
65686
65774
|
defaultCollapsed = false,
|
|
65687
65775
|
onCollapsedChange,
|
|
65688
65776
|
fillHeight = false,
|
|
65777
|
+
flush = true,
|
|
65689
65778
|
expandLabel = "Expand workflow rail",
|
|
65690
65779
|
collapseLabel = "Collapse workflow rail",
|
|
65691
65780
|
renderStepPopover,
|
|
@@ -65728,15 +65817,19 @@ var WorkflowTrackerRail = ({
|
|
|
65728
65817
|
scrollable: false,
|
|
65729
65818
|
flexBody: scrollBody,
|
|
65730
65819
|
className: classNames115(
|
|
65731
|
-
collapsible && "max-w-full shrink-0
|
|
65820
|
+
collapsible && "max-w-full shrink-0",
|
|
65732
65821
|
fillHeight && "h-full min-h-0 self-stretch",
|
|
65733
65822
|
className,
|
|
65734
65823
|
cardClassName
|
|
65735
65824
|
),
|
|
65736
65825
|
style: collapsible ? {
|
|
65826
|
+
// SidePanel's curve, not `duration-200 ease-in-out` (which read
|
|
65827
|
+
// as a snap). Padding rides it too: collapsing drops it to none,
|
|
65828
|
+
// and snapping it mid-sweep was a visible jump.
|
|
65829
|
+
transition: panelSlideTransition("width", "padding"),
|
|
65737
65830
|
...style,
|
|
65738
65831
|
width: isCollapsed ? COLLAPSED_RAIL_WIDTH : style?.width ?? 360,
|
|
65739
|
-
...
|
|
65832
|
+
...flush ? side === "left" ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } : { borderTopRightRadius: 0, borderBottomRightRadius: 0 } : {}
|
|
65740
65833
|
} : style,
|
|
65741
65834
|
"aria-busy": loading || void 0,
|
|
65742
65835
|
"data-collapsed": collapsible ? isCollapsed : void 0,
|
|
@@ -72794,7 +72887,7 @@ function gradientBackdropCss(colors3, s) {
|
|
|
72794
72887
|
import { jsx as jsx330, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
72795
72888
|
var GRADIENT_BACKDROP_SCHEMES = ["auto", "light", "dark"];
|
|
72796
72889
|
var GradientBackdrop = React104.forwardRef(
|
|
72797
|
-
({ theme = "slate", scheme = "auto", noise = false, className, style, children, ...rest }, ref) => {
|
|
72890
|
+
({ theme = "slate", scheme = "auto", noise = false, noiseScale, className, style, children, ...rest }, ref) => {
|
|
72798
72891
|
const themeKey = typeof theme === "string" ? theme : JSON.stringify(theme);
|
|
72799
72892
|
const resolved = useMemo67(() => {
|
|
72800
72893
|
const t = resolveGradientBackdropTheme(theme);
|
|
@@ -72828,7 +72921,11 @@ var GradientBackdrop = React104.forwardRef(
|
|
|
72828
72921
|
"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",
|
|
72829
72922
|
getNoiseBlendClasses(scheme)
|
|
72830
72923
|
),
|
|
72831
|
-
style: {
|
|
72924
|
+
style: {
|
|
72925
|
+
backgroundImage: NOISE_BACKGROUND_IMAGE,
|
|
72926
|
+
backgroundSize: getNoiseBackgroundSize(noiseScale),
|
|
72927
|
+
backgroundRepeat: "repeat"
|
|
72928
|
+
}
|
|
72832
72929
|
}
|
|
72833
72930
|
),
|
|
72834
72931
|
children
|
|
@@ -73336,139 +73433,37 @@ var TerminalTabs = forwardRef165(
|
|
|
73336
73433
|
);
|
|
73337
73434
|
|
|
73338
73435
|
// src/components/PageBodyLayout.tsx
|
|
73339
|
-
import { useCallback as useCallback53, useEffect as useEffect81, useRef as useRef80, useState as useState96 } from "react";
|
|
73340
73436
|
import classNames141 from "classnames";
|
|
73341
|
-
import { jsx as jsx334, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
73342
|
-
|
|
73343
|
-
|
|
73344
|
-
const
|
|
73345
|
-
const
|
|
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: [
|
|
73437
|
+
import { Fragment as Fragment53, jsx as jsx334, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
73438
|
+
var PAGE_BODY_LAYOUT_VARIANTS = ["none", ...SURFACE_VARIANTS];
|
|
73439
|
+
function PageBodyLayout({ header, left, right, bottom, children, className, minCenterWidth = 240, minCenterHeight = 120, gap = 8, variant = "outlined", ...surface }) {
|
|
73440
|
+
const plain = variant === "none" || variant === "plain";
|
|
73441
|
+
const body = /* @__PURE__ */ jsxs208(Fragment53, { children: [
|
|
73451
73442
|
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:
|
|
73453
|
-
left && /* @__PURE__ */ jsx334(
|
|
73454
|
-
/* @__PURE__ */ jsxs208("div", { className: "flex min-
|
|
73455
|
-
/* @__PURE__ */ jsx334("div", { "data-page-region": "center", className: classNames141("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), style: { minHeight: minCenterHeight
|
|
73456
|
-
bottom && /* @__PURE__ */ jsx334(
|
|
73443
|
+
/* @__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: "fit-content", gap, ...plain ? { paddingTop: header ? gap : 0 } : { padding: gap } }, children: [
|
|
73444
|
+
hasZone(left) && /* @__PURE__ */ jsx334("div", { "data-page-region": "left", className: "flex min-h-0 shrink-0", children: left }),
|
|
73445
|
+
/* @__PURE__ */ jsxs208("div", { className: "flex min-h-0 flex-1 flex-col", style: { gap, minWidth: minCenterWidth }, children: [
|
|
73446
|
+
/* @__PURE__ */ jsx334("div", { "data-page-region": "center", className: classNames141("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), style: { minHeight: minCenterHeight }, children }),
|
|
73447
|
+
hasZone(bottom) && /* @__PURE__ */ jsx334("div", { "data-page-region": "bottom", className: "flex min-w-0 shrink-0 flex-col", children: bottom })
|
|
73457
73448
|
] }),
|
|
73458
|
-
right && /* @__PURE__ */ jsx334(
|
|
73449
|
+
hasZone(right) && /* @__PURE__ */ jsx334("div", { "data-page-region": "right", className: "flex min-h-0 shrink-0", children: right })
|
|
73459
73450
|
] }) })
|
|
73460
73451
|
] });
|
|
73452
|
+
return plain ? /* @__PURE__ */ jsx334("div", { "data-page-layout": "none", className: classNames141("flex h-full min-h-0 min-w-0 flex-col", className), children: body }) : /* @__PURE__ */ jsx334(Panel_default, { ...surface, variant, padding: "none", scrollable: false, flexBody: true, className: classNames141("h-full min-h-0 min-w-0", className), children: body });
|
|
73453
|
+
}
|
|
73454
|
+
function hasZone(node) {
|
|
73455
|
+
return node != null && node !== false;
|
|
73461
73456
|
}
|
|
73462
73457
|
|
|
73463
73458
|
// src/contexts/BottomSheetContext.tsx
|
|
73464
73459
|
import {
|
|
73465
73460
|
createContext as createContext9,
|
|
73466
|
-
useCallback as
|
|
73461
|
+
useCallback as useCallback53,
|
|
73467
73462
|
useContext as useContext9,
|
|
73468
|
-
useEffect as
|
|
73463
|
+
useEffect as useEffect81,
|
|
73469
73464
|
useMemo as useMemo69,
|
|
73470
|
-
useRef as
|
|
73471
|
-
useState as
|
|
73465
|
+
useRef as useRef80,
|
|
73466
|
+
useState as useState96
|
|
73472
73467
|
} from "react";
|
|
73473
73468
|
import { createPortal as createPortal19 } from "react-dom";
|
|
73474
73469
|
import classNames142 from "classnames";
|
|
@@ -73484,13 +73479,13 @@ var renderSlot = (slot, controls) => {
|
|
|
73484
73479
|
var BottomSheetProvider = ({
|
|
73485
73480
|
children
|
|
73486
73481
|
}) => {
|
|
73487
|
-
const [sheet, setSheet] =
|
|
73488
|
-
const [isVisible, setIsVisible] =
|
|
73489
|
-
const pendingCloseRef =
|
|
73490
|
-
const dismissSheet =
|
|
73482
|
+
const [sheet, setSheet] = useState96(null);
|
|
73483
|
+
const [isVisible, setIsVisible] = useState96(false);
|
|
73484
|
+
const pendingCloseRef = useRef80(null);
|
|
73485
|
+
const dismissSheet = useCallback53(() => {
|
|
73491
73486
|
setIsVisible(false);
|
|
73492
73487
|
}, []);
|
|
73493
|
-
const presentSheet =
|
|
73488
|
+
const presentSheet = useCallback53((options) => {
|
|
73494
73489
|
if (pendingCloseRef.current) {
|
|
73495
73490
|
clearTimeout(pendingCloseRef.current);
|
|
73496
73491
|
pendingCloseRef.current = null;
|
|
@@ -73503,7 +73498,7 @@ var BottomSheetProvider = ({
|
|
|
73503
73498
|
setTimeout(animateIn, 0);
|
|
73504
73499
|
}
|
|
73505
73500
|
}, []);
|
|
73506
|
-
|
|
73501
|
+
useEffect81(() => {
|
|
73507
73502
|
if (!isVisible && sheet) {
|
|
73508
73503
|
pendingCloseRef.current = setTimeout(() => {
|
|
73509
73504
|
sheet.onClose?.();
|
|
@@ -73518,7 +73513,7 @@ var BottomSheetProvider = ({
|
|
|
73518
73513
|
}
|
|
73519
73514
|
return void 0;
|
|
73520
73515
|
}, [isVisible, sheet]);
|
|
73521
|
-
|
|
73516
|
+
useEffect81(
|
|
73522
73517
|
() => () => {
|
|
73523
73518
|
if (pendingCloseRef.current) {
|
|
73524
73519
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -74260,7 +74255,7 @@ var MetricBar = ({
|
|
|
74260
74255
|
MetricBar.displayName = "MetricBar";
|
|
74261
74256
|
|
|
74262
74257
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74263
|
-
import { useEffect as
|
|
74258
|
+
import { useEffect as useEffect83, useId as useId47, useMemo as useMemo70, useRef as useRef82, useState as useState98 } from "react";
|
|
74264
74259
|
|
|
74265
74260
|
// src/components/NetworkGraph/model.ts
|
|
74266
74261
|
var CELL = 64;
|
|
@@ -74404,17 +74399,17 @@ function findNetworkPath(edges, source, target) {
|
|
|
74404
74399
|
}
|
|
74405
74400
|
|
|
74406
74401
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
74407
|
-
import { useCallback as
|
|
74402
|
+
import { useCallback as useCallback54, useEffect as useEffect82, useRef as useRef81, useState as useState97 } from "react";
|
|
74408
74403
|
function useNetworkCanvas(options) {
|
|
74409
|
-
const canvasRef =
|
|
74410
|
-
const view =
|
|
74411
|
-
const size =
|
|
74412
|
-
const latest =
|
|
74413
|
-
const frame =
|
|
74414
|
-
const [zoom, setZoom] =
|
|
74415
|
-
const colors3 =
|
|
74416
|
-
const textColor =
|
|
74417
|
-
const draw =
|
|
74404
|
+
const canvasRef = useRef81(null);
|
|
74405
|
+
const view = useRef81({ x: 0, y: 0, zoom: 1 });
|
|
74406
|
+
const size = useRef81({ width: 1, height: 1 });
|
|
74407
|
+
const latest = useRef81(options);
|
|
74408
|
+
const frame = useRef81(null);
|
|
74409
|
+
const [zoom, setZoom] = useState97(1);
|
|
74410
|
+
const colors3 = useRef81(/* @__PURE__ */ new Map());
|
|
74411
|
+
const textColor = useRef81("#737373");
|
|
74412
|
+
const draw = useCallback54(() => {
|
|
74418
74413
|
const canvas = canvasRef.current;
|
|
74419
74414
|
const ctx = canvas?.getContext("2d");
|
|
74420
74415
|
if (!canvas || !ctx) return;
|
|
@@ -74514,14 +74509,14 @@ function useNetworkCanvas(options) {
|
|
|
74514
74509
|
}
|
|
74515
74510
|
ctx.globalAlpha = 1;
|
|
74516
74511
|
}, []);
|
|
74517
|
-
const requestDraw =
|
|
74512
|
+
const requestDraw = useCallback54(() => {
|
|
74518
74513
|
if (frame.current !== null) return;
|
|
74519
74514
|
frame.current = requestAnimationFrame(() => {
|
|
74520
74515
|
frame.current = null;
|
|
74521
74516
|
draw();
|
|
74522
74517
|
});
|
|
74523
74518
|
}, [draw]);
|
|
74524
|
-
const update =
|
|
74519
|
+
const update = useCallback54(
|
|
74525
74520
|
(next) => {
|
|
74526
74521
|
view.current = next;
|
|
74527
74522
|
setZoom(next.zoom);
|
|
@@ -74530,7 +74525,7 @@ function useNetworkCanvas(options) {
|
|
|
74530
74525
|
},
|
|
74531
74526
|
[requestDraw]
|
|
74532
74527
|
);
|
|
74533
|
-
const fit =
|
|
74528
|
+
const fit = useCallback54(
|
|
74534
74529
|
() => update(
|
|
74535
74530
|
fitNetwork(
|
|
74536
74531
|
latest.current.nodes,
|
|
@@ -74540,11 +74535,11 @@ function useNetworkCanvas(options) {
|
|
|
74540
74535
|
),
|
|
74541
74536
|
[update]
|
|
74542
74537
|
);
|
|
74543
|
-
const zoomBy =
|
|
74538
|
+
const zoomBy = useCallback54(
|
|
74544
74539
|
(factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
|
|
74545
74540
|
[update]
|
|
74546
74541
|
);
|
|
74547
|
-
const focusNode =
|
|
74542
|
+
const focusNode = useCallback54(
|
|
74548
74543
|
(node) => {
|
|
74549
74544
|
update({
|
|
74550
74545
|
...view.current,
|
|
@@ -74554,14 +74549,14 @@ function useNetworkCanvas(options) {
|
|
|
74554
74549
|
},
|
|
74555
74550
|
[update]
|
|
74556
74551
|
);
|
|
74557
|
-
|
|
74552
|
+
useEffect82(() => {
|
|
74558
74553
|
latest.current = options;
|
|
74559
74554
|
requestDraw();
|
|
74560
74555
|
}, [options, requestDraw]);
|
|
74561
|
-
|
|
74556
|
+
useEffect82(() => {
|
|
74562
74557
|
fit();
|
|
74563
74558
|
}, [options.model, fit]);
|
|
74564
|
-
|
|
74559
|
+
useEffect82(() => {
|
|
74565
74560
|
const canvas = canvasRef.current;
|
|
74566
74561
|
if (!canvas) return;
|
|
74567
74562
|
const measure = () => {
|
|
@@ -74646,10 +74641,10 @@ function NetworkGraph({
|
|
|
74646
74641
|
}) {
|
|
74647
74642
|
const t = useKitT();
|
|
74648
74643
|
const helpId = useId47();
|
|
74649
|
-
const layoutRef =
|
|
74650
|
-
const [hasLegendSpace, setHasLegendSpace] =
|
|
74644
|
+
const layoutRef = useRef82(null);
|
|
74645
|
+
const [hasLegendSpace, setHasLegendSpace] = useState98(true);
|
|
74651
74646
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
74652
|
-
|
|
74647
|
+
useEffect83(() => {
|
|
74653
74648
|
const element = layoutRef.current;
|
|
74654
74649
|
if (!element || legendPosition !== "auto") return;
|
|
74655
74650
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -74662,12 +74657,12 @@ function NetworkGraph({
|
|
|
74662
74657
|
() => buildNetwork(nodes, edges, communities),
|
|
74663
74658
|
[nodes, edges, communities]
|
|
74664
74659
|
);
|
|
74665
|
-
const [internalSelected, setInternalSelected] =
|
|
74660
|
+
const [internalSelected, setInternalSelected] = useState98(
|
|
74666
74661
|
defaultSelectedNodeId
|
|
74667
74662
|
);
|
|
74668
|
-
const [hidden, setHidden] =
|
|
74669
|
-
const [focused, setFocused] =
|
|
74670
|
-
const [query, setQuery] =
|
|
74663
|
+
const [hidden, setHidden] = useState98(() => /* @__PURE__ */ new Set());
|
|
74664
|
+
const [focused, setFocused] = useState98(null);
|
|
74665
|
+
const [query, setQuery] = useState98("");
|
|
74671
74666
|
const enabled = useMemo70(
|
|
74672
74667
|
() => new Set(
|
|
74673
74668
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
@@ -74709,7 +74704,7 @@ function NetworkGraph({
|
|
|
74709
74704
|
onViewportChange
|
|
74710
74705
|
});
|
|
74711
74706
|
const locked = disabled || loading;
|
|
74712
|
-
const drag =
|
|
74707
|
+
const drag = useRef82(null);
|
|
74713
74708
|
const select = (id) => {
|
|
74714
74709
|
if (locked) return;
|
|
74715
74710
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -74725,7 +74720,7 @@ function NetworkGraph({
|
|
|
74725
74720
|
);
|
|
74726
74721
|
onVisibleCommunitiesChange?.(ids);
|
|
74727
74722
|
};
|
|
74728
|
-
|
|
74723
|
+
useEffect83(() => {
|
|
74729
74724
|
const element = canvas.canvasRef.current;
|
|
74730
74725
|
if (!element || locked) return;
|
|
74731
74726
|
const wheel = (event) => {
|
|
@@ -75283,9 +75278,12 @@ export {
|
|
|
75283
75278
|
OTP_VARIANTS,
|
|
75284
75279
|
OrganizationChart_default as OrganizationChart,
|
|
75285
75280
|
PAGED_PANEL_LOADERS,
|
|
75281
|
+
PAGE_BODY_LAYOUT_VARIANTS,
|
|
75286
75282
|
SURFACE_VARIANTS as PAGE_HEADER_VARIANTS,
|
|
75287
75283
|
PANEL_HERO_TITLE_ELEMENTS,
|
|
75288
75284
|
PANEL_HERO_VARIANTS,
|
|
75285
|
+
PANEL_SLIDE_DURATION_MS,
|
|
75286
|
+
PANEL_SLIDE_EASING,
|
|
75289
75287
|
PANEL_TONE_FOR_FIELD,
|
|
75290
75288
|
PANE_EMPTY_STATE_SIZE,
|
|
75291
75289
|
PILL_CORNERS,
|
|
@@ -75676,6 +75674,7 @@ export {
|
|
|
75676
75674
|
normalizeString,
|
|
75677
75675
|
normalizeStringToUpper,
|
|
75678
75676
|
oklchToHex,
|
|
75677
|
+
panelSlideTransition,
|
|
75679
75678
|
parseImageSource,
|
|
75680
75679
|
parseMessage,
|
|
75681
75680
|
parseSmartVariable,
|