@cjlapao/ui-kit 0.2.11 → 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/{CapsuleBlueprint-BfzZrqRA.d.cts → CapsuleBlueprint-DY1EmDQu.d.cts} +1 -1
- package/dist/{CapsuleBlueprint-BfzZrqRA.d.ts → CapsuleBlueprint-DY1EmDQu.d.ts} +1 -1
- package/dist/index.cjs +426 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +49 -0
- package/dist/index.d.cts +84 -40
- package/dist/index.d.ts +84 -40
- package/dist/index.js +476 -200
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -219,6 +219,7 @@ __export(src_exports, {
|
|
|
219
219
|
OTP_VARIANTS: () => OTP_VARIANTS,
|
|
220
220
|
OrganizationChart: () => OrganizationChart_default,
|
|
221
221
|
PAGED_PANEL_LOADERS: () => PAGED_PANEL_LOADERS,
|
|
222
|
+
PAGE_HEADER_VARIANTS: () => SURFACE_VARIANTS,
|
|
222
223
|
PANEL_HERO_TITLE_ELEMENTS: () => PANEL_HERO_TITLE_ELEMENTS,
|
|
223
224
|
PANEL_HERO_VARIANTS: () => PANEL_HERO_VARIANTS,
|
|
224
225
|
PANEL_TONE_FOR_FIELD: () => PANEL_TONE_FOR_FIELD,
|
|
@@ -233,6 +234,7 @@ __export(src_exports, {
|
|
|
233
234
|
PROGRESS_MOTION_DIRECTIONS: () => PROGRESS_MOTION_DIRECTIONS,
|
|
234
235
|
PROGRESS_MOTION_SPEEDS: () => PROGRESS_MOTION_SPEEDS,
|
|
235
236
|
PT_KIT_CATALOG: () => PT_KIT_CATALOG,
|
|
237
|
+
PageBodyLayout: () => PageBodyLayout,
|
|
236
238
|
PageHeader: () => PageHeader_default,
|
|
237
239
|
PagedPanel: () => PagedPanel_default,
|
|
238
240
|
Panel: () => Panel_default,
|
|
@@ -258,7 +260,7 @@ __export(src_exports, {
|
|
|
258
260
|
SIDE_MENU_HEADER_HEIGHT: () => SIDE_MENU_HEADER_HEIGHT,
|
|
259
261
|
SIDE_MENU_HEADER_SEAM: () => SIDE_MENU_HEADER_SEAM,
|
|
260
262
|
SIDE_PANEL_SIDES: () => SIDE_PANEL_SIDES,
|
|
261
|
-
SIDE_PANEL_VARIANTS: () =>
|
|
263
|
+
SIDE_PANEL_VARIANTS: () => SURFACE_VARIANTS,
|
|
262
264
|
SLIDER_ORIENTATIONS: () => SLIDER_ORIENTATIONS,
|
|
263
265
|
SLIDER_VARIANTS: () => SLIDER_VARIANTS,
|
|
264
266
|
SMART_GRID_PALETTE_MIME: () => PALETTE_MIME,
|
|
@@ -23031,6 +23033,10 @@ var PageHeader = ({
|
|
|
23031
23033
|
children,
|
|
23032
23034
|
variant = "default",
|
|
23033
23035
|
accentColor = "blue",
|
|
23036
|
+
tone = "neutral",
|
|
23037
|
+
glassOpacity,
|
|
23038
|
+
vibrancy,
|
|
23039
|
+
specularMode,
|
|
23034
23040
|
padding,
|
|
23035
23041
|
paddingTop,
|
|
23036
23042
|
paddingRight,
|
|
@@ -23040,7 +23046,8 @@ var PageHeader = ({
|
|
|
23040
23046
|
className = "",
|
|
23041
23047
|
...rest
|
|
23042
23048
|
}) => {
|
|
23043
|
-
const
|
|
23049
|
+
const sharedSurface = variant !== "default" && variant !== "floating" && variant !== "floating-glass";
|
|
23050
|
+
const surface = variant === "floating" || variant === "floating-glass" ? getSidebarSurfaceTokens(variant, accentColor) : null;
|
|
23044
23051
|
const pair = surface ? "xs" : "none";
|
|
23045
23052
|
const gutter = {
|
|
23046
23053
|
top: paddingTop ?? padding ?? pair,
|
|
@@ -23053,7 +23060,7 @@ var PageHeader = ({
|
|
|
23053
23060
|
{
|
|
23054
23061
|
...rest,
|
|
23055
23062
|
className: (0, import_classnames53.default)(
|
|
23056
|
-
"flex w-full items-center justify-between gap-4 px-5",
|
|
23063
|
+
"relative isolate flex w-full shrink-0 items-center justify-between gap-4 px-5",
|
|
23057
23064
|
SIDE_MENU_HEADER_HEIGHT,
|
|
23058
23065
|
getSurfaceGutterClass("top", gutter.top),
|
|
23059
23066
|
getSurfaceGutterClass("right", gutter.right),
|
|
@@ -23065,10 +23072,24 @@ var PageHeader = ({
|
|
|
23065
23072
|
surface.border,
|
|
23066
23073
|
surface.shadow,
|
|
23067
23074
|
surface.fill
|
|
23068
|
-
) : (0, import_classnames53.default)("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
|
|
23075
|
+
) : !sharedSurface && (0, import_classnames53.default)("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
|
|
23069
23076
|
className
|
|
23070
23077
|
),
|
|
23071
23078
|
children: [
|
|
23079
|
+
sharedSurface && /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 -z-10", style: { borderRadius: "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
23080
|
+
Panel_default,
|
|
23081
|
+
{
|
|
23082
|
+
variant,
|
|
23083
|
+
tone,
|
|
23084
|
+
glassOpacity,
|
|
23085
|
+
vibrancy,
|
|
23086
|
+
specularMode,
|
|
23087
|
+
padding: "none",
|
|
23088
|
+
corner: "none",
|
|
23089
|
+
className: "h-full w-full",
|
|
23090
|
+
style: { borderRadius: "inherit" }
|
|
23091
|
+
}
|
|
23092
|
+
) }),
|
|
23072
23093
|
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: GROUP_CLASS2, children: start }),
|
|
23073
23094
|
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: GROUP_CLASS2, children: center }),
|
|
23074
23095
|
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: GROUP_CLASS2, children: end }),
|
|
@@ -43762,7 +43783,10 @@ var SideMenu = ({
|
|
|
43762
43783
|
logoIcon,
|
|
43763
43784
|
logoText,
|
|
43764
43785
|
items,
|
|
43786
|
+
activeItemSlug,
|
|
43787
|
+
onItemSelect,
|
|
43765
43788
|
className = "",
|
|
43789
|
+
joinedRole,
|
|
43766
43790
|
collapsed = false,
|
|
43767
43791
|
onToggleCollapse,
|
|
43768
43792
|
mobileOpen = false,
|
|
@@ -43804,7 +43828,7 @@ var SideMenu = ({
|
|
|
43804
43828
|
const [internalSearch, setInternalSearch] = (0, import_react246.useState)("");
|
|
43805
43829
|
const [hoverOpen, setHoverOpen] = (0, import_react246.useState)(false);
|
|
43806
43830
|
const collapseMode = collapsible === true ? "icon" : collapsible === false ? "none" : collapsible;
|
|
43807
|
-
const hoverRail = openOnHover && collapseMode !== "none";
|
|
43831
|
+
const hoverRail = !joinedRole && openOnHover && collapseMode !== "none";
|
|
43808
43832
|
const hoverTimer = (0, import_react246.useRef)(null);
|
|
43809
43833
|
(0, import_react246.useEffect)(() => {
|
|
43810
43834
|
return () => {
|
|
@@ -43833,11 +43857,21 @@ var SideMenu = ({
|
|
|
43833
43857
|
setInternalCollapsed((value) => !value);
|
|
43834
43858
|
}
|
|
43835
43859
|
};
|
|
43836
|
-
const effectiveMode = hoverRail ? "icon" : collapseMode;
|
|
43837
|
-
const expanded = isMobile ? true : hoverRail ? false : effectiveMode === "none" ? true : !collapsedState;
|
|
43838
|
-
const showCollapseControl = !isMobile && !hoverRail && effectiveMode !== "none";
|
|
43839
|
-
const showOffcanvasHandle = !isMobile && effectiveMode === "offcanvas" && !expanded;
|
|
43840
|
-
const
|
|
43860
|
+
const effectiveMode = joinedRole === "rail" ? "icon" : joinedRole === "panel" ? "none" : hoverRail ? "icon" : collapseMode;
|
|
43861
|
+
const expanded = isMobile ? true : joinedRole ? joinedRole === "panel" : hoverRail ? false : effectiveMode === "none" ? true : !collapsedState;
|
|
43862
|
+
const showCollapseControl = !isMobile && !joinedRole && !hoverRail && effectiveMode !== "none";
|
|
43863
|
+
const showOffcanvasHandle = !isMobile && !joinedRole && effectiveMode === "offcanvas" && !expanded;
|
|
43864
|
+
const baseSurface = getSidebarSurfaceTokens(variant, color);
|
|
43865
|
+
const surface = joinedRole && !isMobile ? {
|
|
43866
|
+
...baseSurface,
|
|
43867
|
+
fill: joinedRole === "rail" ? "bg-neutral-100 dark:bg-neutral-950" : "bg-transparent",
|
|
43868
|
+
offset: joinedRole === "panel" ? "my-2" : "",
|
|
43869
|
+
radius: joinedRole === "panel" ? "rounded-l-2xl" : "",
|
|
43870
|
+
border: "",
|
|
43871
|
+
borderSides: "all",
|
|
43872
|
+
shadow: "",
|
|
43873
|
+
shadowRight: ""
|
|
43874
|
+
} : baseSurface;
|
|
43841
43875
|
const idle = SIDEBAR_IDLE_COPY[surface.idleCopy];
|
|
43842
43876
|
const toneTokens3 = getSideMenuItemTokens(color);
|
|
43843
43877
|
const showSkeleton = loading && loaderType === "skeleton";
|
|
@@ -43894,8 +43928,9 @@ var SideMenu = ({
|
|
|
43894
43928
|
if (path === "/") return location.pathname === "/";
|
|
43895
43929
|
return location.pathname === path || location.pathname.startsWith(`${path}/`);
|
|
43896
43930
|
};
|
|
43931
|
+
const isActiveItem = (link) => activeItemSlug !== void 0 ? link.slug === activeItemSlug : isActivePath(link.path);
|
|
43897
43932
|
const hasActiveDescendant = (link) => !!link.children?.some(
|
|
43898
|
-
(child) =>
|
|
43933
|
+
(child) => isActiveItem(child) || hasActiveDescendant(child)
|
|
43899
43934
|
);
|
|
43900
43935
|
const [openSubmenus, setOpenSubmenus] = (0, import_react246.useState)(() => {
|
|
43901
43936
|
const initial = /* @__PURE__ */ new Set();
|
|
@@ -43987,14 +44022,14 @@ var SideMenu = ({
|
|
|
43987
44022
|
const panelPosition = isLeft ? "left-0" : "right-0";
|
|
43988
44023
|
const offcanvasHidden = effectiveMode === "offcanvas" && !expanded;
|
|
43989
44024
|
const desktopClasses = `
|
|
43990
|
-
relative flex-shrink-0 ${heightClass} ${isHoverMode ? RAIL_WIDTH : ""} ${surface.offset}
|
|
44025
|
+
relative ${joinedRole === "panel" ? "min-w-0 flex-1" : "flex-shrink-0"} ${heightClass} ${isHoverMode ? RAIL_WIDTH : ""} ${surface.offset}
|
|
43991
44026
|
`;
|
|
43992
44027
|
const asideClasses = isHoverMode ? `
|
|
43993
44028
|
absolute inset-y-0 ${panelPosition} z-40 overflow-hidden transition-[width] ease-in-out ${asideWidth}
|
|
43994
44029
|
${surface.radius} ${borderClasses} ${isLeft ? surface.shadow : surface.shadowRight}
|
|
43995
44030
|
${className}
|
|
43996
44031
|
` : `
|
|
43997
|
-
relative h-full overflow-hidden transition-all duration-300 ${asideWidth}
|
|
44032
|
+
relative h-full overflow-hidden transition-all duration-300 ${joinedRole === "panel" ? "w-full" : asideWidth}
|
|
43998
44033
|
${surface.radius} ${borderClasses} ${isLeft ? surface.shadow : surface.shadowRight}
|
|
43999
44034
|
${className}
|
|
44000
44035
|
`;
|
|
@@ -44009,7 +44044,7 @@ var SideMenu = ({
|
|
|
44009
44044
|
const logoSection = logoIcon || logoText ? (contentCollapsed2) => /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(
|
|
44010
44045
|
"div",
|
|
44011
44046
|
{
|
|
44012
|
-
className: `relative z-50 flex items-center
|
|
44047
|
+
className: `relative z-50 flex items-center px-4 py-4 ${SIDE_MENU_HEADER_HEIGHT} ${joinedRole && !isMobile ? "" : variant === "glass" || variant === "floating-glass" ? "border-b bg-white/20 border-white/30 dark:bg-white/5 dark:border-white/10" : `border-b ${SIDE_MENU_HEADER_FILL} ${SIDE_MENU_HEADER_SEAM}`} ${contentCollapsed2 ? "justify-center" : ""}`,
|
|
44013
44048
|
children: [
|
|
44014
44049
|
logoIcon && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)("div", { className: "shrink-0", children: logoIcon }),
|
|
44015
44050
|
logoText && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
@@ -44024,7 +44059,7 @@ var SideMenu = ({
|
|
|
44024
44059
|
) : null;
|
|
44025
44060
|
const renderLinkRow = (link, depth, key, contentCollapsed2) => {
|
|
44026
44061
|
const hasChildren = !!link.children?.length;
|
|
44027
|
-
const selfActive =
|
|
44062
|
+
const selfActive = isActiveItem(link);
|
|
44028
44063
|
const childActive = hasChildren ? hasActiveDescendant(link) : false;
|
|
44029
44064
|
const visibleChildren = searchActive ? (link.children ?? []).filter(matchesSubtree) : link.children ?? [];
|
|
44030
44065
|
const showChildren = hasChildren && (searchActive || openSubmenus.has(link.slug)) && visibleChildren.length > 0;
|
|
@@ -44033,7 +44068,7 @@ var SideMenu = ({
|
|
|
44033
44068
|
let revealLimit = paged ? childReveal[link.slug] ?? pageSize : visibleChildren.length;
|
|
44034
44069
|
if (paged) {
|
|
44035
44070
|
const activeIndex = visibleChildren.findIndex(
|
|
44036
|
-
(child) =>
|
|
44071
|
+
(child) => isActiveItem(child) || hasActiveDescendant(child)
|
|
44037
44072
|
);
|
|
44038
44073
|
if (activeIndex >= revealLimit) revealLimit = activeIndex + 1;
|
|
44039
44074
|
}
|
|
@@ -44057,7 +44092,8 @@ var SideMenu = ({
|
|
|
44057
44092
|
import_react_router_dom2.Link,
|
|
44058
44093
|
{
|
|
44059
44094
|
to: link.path,
|
|
44060
|
-
onClick: () => {
|
|
44095
|
+
onClick: (event) => {
|
|
44096
|
+
onItemSelect?.(link, event);
|
|
44061
44097
|
if (mobileOpen) onCloseMobile?.();
|
|
44062
44098
|
if (hoverOpen) closeHover();
|
|
44063
44099
|
},
|
|
@@ -44398,6 +44434,7 @@ var SideMenu = ({
|
|
|
44398
44434
|
"div",
|
|
44399
44435
|
{
|
|
44400
44436
|
className: desktopClasses,
|
|
44437
|
+
"data-joined-role": joinedRole,
|
|
44401
44438
|
onKeyDown: (event) => {
|
|
44402
44439
|
if (event.key === "Escape" && hoverOpen) closeHover();
|
|
44403
44440
|
},
|
|
@@ -44514,6 +44551,7 @@ var SideMenuLayout = ({
|
|
|
44514
44551
|
sideMenuProps,
|
|
44515
44552
|
rightSideMenuProps,
|
|
44516
44553
|
secondarySideMenuProps,
|
|
44554
|
+
multiMenuMode = "hover",
|
|
44517
44555
|
header,
|
|
44518
44556
|
children,
|
|
44519
44557
|
className,
|
|
@@ -44522,8 +44560,10 @@ var SideMenuLayout = ({
|
|
|
44522
44560
|
sideItemActions,
|
|
44523
44561
|
sidePanelActions
|
|
44524
44562
|
}) => {
|
|
44563
|
+
const t = useKitT();
|
|
44525
44564
|
const isMobile = useSidebarIsMobile(sideMenuProps.responsive ?? true);
|
|
44526
44565
|
const isMulti = !!secondarySideMenuProps;
|
|
44566
|
+
const isJoined = isMulti && multiMenuMode === "joined";
|
|
44527
44567
|
const [collapsed, setCollapsed] = (0, import_react248.useState)(sideMenuProps.collapsed ?? false);
|
|
44528
44568
|
const [rightCollapsed, setRightCollapsed] = (0, import_react248.useState)(
|
|
44529
44569
|
rightSideMenuProps?.collapsed ?? false
|
|
@@ -44583,7 +44623,7 @@ var SideMenuLayout = ({
|
|
|
44583
44623
|
// expanding as an overlay on hover. `openOnHover` owns that state, so the
|
|
44584
44624
|
// collapse wiring is not passed through — and since collapsing is opt-in
|
|
44585
44625
|
// on SideMenu, the layout opts the rail in itself.
|
|
44586
|
-
...isMulti ? { collapsible: "icon", openOnHover: true } : {
|
|
44626
|
+
...isJoined ? { joinedRole: "rail", responsive: false, mobileOpen: false } : isMulti ? { collapsible: "icon", openOnHover: true } : {
|
|
44587
44627
|
collapsed: isCollapsed,
|
|
44588
44628
|
onToggleCollapse: handleToggleCollapse
|
|
44589
44629
|
}
|
|
@@ -44602,8 +44642,27 @@ var SideMenuLayout = ({
|
|
|
44602
44642
|
side: "left",
|
|
44603
44643
|
collapsed: isSecondaryCollapsed,
|
|
44604
44644
|
onToggleCollapse: handleSecondaryToggleCollapse,
|
|
44605
|
-
fullHeight: true
|
|
44645
|
+
fullHeight: true,
|
|
44646
|
+
...isJoined ? {
|
|
44647
|
+
joinedRole: "panel",
|
|
44648
|
+
responsive: false,
|
|
44649
|
+
mobileOpen: isMobileOpen,
|
|
44650
|
+
onCloseMobile: handleCloseMobile,
|
|
44651
|
+
// Surface family comes from the primary; content/accent remain independent.
|
|
44652
|
+
variant: sideMenuProps.variant
|
|
44653
|
+
} : {}
|
|
44606
44654
|
};
|
|
44655
|
+
const joinedSurface = isJoined && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
44656
|
+
"div",
|
|
44657
|
+
{
|
|
44658
|
+
"aria-hidden": "true",
|
|
44659
|
+
"data-joined-surface": true,
|
|
44660
|
+
className: (0, import_classnames79.default)(
|
|
44661
|
+
"pointer-events-none absolute inset-y-2 left-[68px] right-0 rounded-l-2xl",
|
|
44662
|
+
getSidebarSurfaceTokens(sideMenuProps.variant ?? "sidebar", sideMenuProps.color ?? "blue").fill
|
|
44663
|
+
)
|
|
44664
|
+
}
|
|
44665
|
+
);
|
|
44607
44666
|
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
44608
44667
|
SideMenuActionsProvider,
|
|
44609
44668
|
{
|
|
@@ -44613,13 +44672,56 @@ var SideMenuLayout = ({
|
|
|
44613
44672
|
"div",
|
|
44614
44673
|
{
|
|
44615
44674
|
className: (0, import_classnames79.default)(
|
|
44616
|
-
"flex h-full w-full overflow-hidden
|
|
44675
|
+
"relative flex h-full w-full overflow-hidden",
|
|
44676
|
+
isJoined ? "bg-neutral-100 dark:bg-neutral-950" : "bg-neutral-50 dark:bg-neutral-950",
|
|
44617
44677
|
className
|
|
44618
44678
|
),
|
|
44619
44679
|
children: [
|
|
44620
|
-
|
|
44621
|
-
|
|
44622
|
-
|
|
44680
|
+
isJoined && !isMobile && joinedSurface,
|
|
44681
|
+
isJoined ? /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [
|
|
44682
|
+
isMobile && isMobileOpen && // Pointer backdrop; the close button and Escape provide keyboard dismissal.
|
|
44683
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
44684
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: "fixed inset-0 z-50 bg-black/20 backdrop-blur-sm", onClick: handleCloseMobile }),
|
|
44685
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(
|
|
44686
|
+
"div",
|
|
44687
|
+
{
|
|
44688
|
+
"data-joined-menu": true,
|
|
44689
|
+
inert: isMobile && !isMobileOpen || void 0,
|
|
44690
|
+
onKeyDown: (event) => {
|
|
44691
|
+
if (isMobile && event.key === "Escape") handleCloseMobile();
|
|
44692
|
+
},
|
|
44693
|
+
className: (0, import_classnames79.default)(
|
|
44694
|
+
"flex w-[324px] max-w-[calc(100vw-1rem)] shrink-0",
|
|
44695
|
+
isMobile ? "fixed inset-y-0 left-0 z-[60] flex-col bg-neutral-100 transition-transform duration-300 dark:bg-neutral-950" : "h-full",
|
|
44696
|
+
isMobile && !isMobileOpen && "-translate-x-full"
|
|
44697
|
+
),
|
|
44698
|
+
children: [
|
|
44699
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: "flex shrink-0 justify-end px-3 pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
44700
|
+
"button",
|
|
44701
|
+
{
|
|
44702
|
+
type: "button",
|
|
44703
|
+
onClick: handleCloseMobile,
|
|
44704
|
+
"aria-label": t("kit.sidemenu.closeAria"),
|
|
44705
|
+
className: "rounded-lg p-2 text-neutral-600 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800",
|
|
44706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(CustomIcon_default, { icon: "Close", className: "h-5 w-5" })
|
|
44707
|
+
}
|
|
44708
|
+
) }),
|
|
44709
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { className: "relative flex h-full min-h-0 min-w-0 flex-1", children: [
|
|
44710
|
+
isMobile && joinedSurface,
|
|
44711
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(SideMenu_default, { ...primaryProps }),
|
|
44712
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(SideMenu_default, { ...secondaryProps })
|
|
44713
|
+
] })
|
|
44714
|
+
]
|
|
44715
|
+
}
|
|
44716
|
+
)
|
|
44717
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_jsx_runtime261.Fragment, { children: [
|
|
44718
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(SideMenu_default, { ...primaryProps }),
|
|
44719
|
+
secondarySideMenuProps && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(SideMenu_default, { ...secondaryProps })
|
|
44720
|
+
] }),
|
|
44721
|
+
/* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { className: (0, import_classnames79.default)(
|
|
44722
|
+
"relative flex min-w-0 flex-1 flex-col",
|
|
44723
|
+
isJoined && !isMobile ? "my-2 h-[calc(100%-1rem)]" : "h-full"
|
|
44724
|
+
), children: [
|
|
44623
44725
|
isMobile && /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { className: "flex items-center gap-1 border-b border-neutral-200 bg-white px-4 py-2 dark:border-neutral-800 dark:bg-neutral-900", children: [
|
|
44624
44726
|
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
44625
44727
|
"button",
|
|
@@ -44715,9 +44817,14 @@ function getNoiseBlendClasses(scheme = "auto") {
|
|
|
44715
44817
|
|
|
44716
44818
|
// src/components/SidePanel.tsx
|
|
44717
44819
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
44718
|
-
var
|
|
44719
|
-
|
|
44720
|
-
|
|
44820
|
+
var LEGACY_PANEL_VARIANTS = {
|
|
44821
|
+
sidebar: "elevated",
|
|
44822
|
+
inset: "tonal",
|
|
44823
|
+
floating: "elevated",
|
|
44824
|
+
"floating-glass": "glass"
|
|
44825
|
+
};
|
|
44826
|
+
var resolvePanelVariant2 = (variant) => variant in LEGACY_PANEL_VARIANTS ? LEGACY_PANEL_VARIANTS[variant] : variant;
|
|
44827
|
+
var getSidePanelTextTokens = (variant) => getSurfaceTextTokens(resolvePanelVariant2(variant));
|
|
44721
44828
|
var INSET_GAP_Y_CLASS = "inset-y-4";
|
|
44722
44829
|
var INNER_CORNER = {
|
|
44723
44830
|
// (`"auto"` is absent by design: SidePanel's own default is `rounded`, and
|
|
@@ -44766,6 +44873,7 @@ var SIZE_TOKENS4 = {
|
|
|
44766
44873
|
};
|
|
44767
44874
|
var SidePanel = ({
|
|
44768
44875
|
isOpen,
|
|
44876
|
+
docked = false,
|
|
44769
44877
|
onClose,
|
|
44770
44878
|
title,
|
|
44771
44879
|
subtitle,
|
|
@@ -44781,7 +44889,10 @@ var SidePanel = ({
|
|
|
44781
44889
|
maxWidth = 900,
|
|
44782
44890
|
tone,
|
|
44783
44891
|
color,
|
|
44784
|
-
variant = "
|
|
44892
|
+
variant = "outlined",
|
|
44893
|
+
glassOpacity,
|
|
44894
|
+
vibrancy,
|
|
44895
|
+
specularMode,
|
|
44785
44896
|
surfaceTone = "neutral",
|
|
44786
44897
|
size = "md",
|
|
44787
44898
|
side = "right",
|
|
@@ -44800,7 +44911,16 @@ var SidePanel = ({
|
|
|
44800
44911
|
warnIfMissingTitle("SidePanel", title);
|
|
44801
44912
|
const effectiveTone = tone ?? color ?? "neutral";
|
|
44802
44913
|
const sizeToken = SIZE_TOKENS4[size] ?? SIZE_TOKENS4.md;
|
|
44803
|
-
const
|
|
44914
|
+
const legacyVariant = variant in LEGACY_PANEL_VARIANTS;
|
|
44915
|
+
const panelVariant = resolvePanelVariant2(variant);
|
|
44916
|
+
const panelOuterChrome = (0, import_classnames80.default)(
|
|
44917
|
+
variantBaseStyles[panelVariant].split(" ").filter((token) => /^(dark:)?(shadow|ring)-/.test(token)),
|
|
44918
|
+
panelVariant === "liquid-glass" && getPanelToneStyles(surfaceTone).liquidShadow
|
|
44919
|
+
);
|
|
44920
|
+
const surface = getSidebarSurfaceTokens(
|
|
44921
|
+
legacyVariant ? variant : "sidebar",
|
|
44922
|
+
surfaceTone
|
|
44923
|
+
);
|
|
44804
44924
|
const surfaceText = getSidePanelTextTokens(variant);
|
|
44805
44925
|
const isInset = inset ?? surface.offset !== "";
|
|
44806
44926
|
const cornerClass = INNER_CORNER[corner === "auto" ? DEFAULT_SURFACE_CORNER : corner][side];
|
|
@@ -44914,7 +45034,7 @@ var SidePanel = ({
|
|
|
44914
45034
|
},
|
|
44915
45035
|
[resizable, side, currentWidth, minWidth, maxWidth]
|
|
44916
45036
|
);
|
|
44917
|
-
if (!mounted) return null;
|
|
45037
|
+
if (!mounted || docked && !isOpen) return null;
|
|
44918
45038
|
const edgeOffset = entered ? shellWidth : 0;
|
|
44919
45039
|
const barTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-70 group-active:opacity-100`;
|
|
44920
45040
|
const edgeProperty = side === "right" ? "right" : "left";
|
|
@@ -44931,15 +45051,15 @@ var SidePanel = ({
|
|
|
44931
45051
|
"data-sp-shell": true,
|
|
44932
45052
|
"data-collapsed": collapsible ? isCollapsed : void 0,
|
|
44933
45053
|
className: (0, import_classnames80.default)(
|
|
44934
|
-
"absolute z-40 overflow-hidden",
|
|
44935
|
-
isInset ? INSET_GAP_Y_CLASS : "top-0 h-full",
|
|
45054
|
+
docked ? "relative h-full w-full overflow-hidden" : "absolute z-40 overflow-hidden",
|
|
45055
|
+
!docked && (isInset ? INSET_GAP_Y_CLASS : "top-0 h-full"),
|
|
44936
45056
|
side === "right" ? "right-0" : "left-0",
|
|
44937
45057
|
cornerClass,
|
|
44938
|
-
borderClass,
|
|
44939
|
-
shadowClass
|
|
45058
|
+
legacyVariant && borderClass,
|
|
45059
|
+
legacyVariant ? shadowClass : panelOuterChrome
|
|
44940
45060
|
),
|
|
44941
45061
|
style: {
|
|
44942
|
-
width: entered ? shellWidth : 0,
|
|
45062
|
+
width: docked ? "100%" : entered ? shellWidth : 0,
|
|
44943
45063
|
// Inline rather than `transition-[width] duration-… ease-…`: an
|
|
44944
45064
|
// arbitrary easing utility would have to survive the safelist, and
|
|
44945
45065
|
// this curve is not themeable anyway. It decelerates hard at the end,
|
|
@@ -44957,8 +45077,22 @@ var SidePanel = ({
|
|
|
44957
45077
|
"data-sp-fill": "true",
|
|
44958
45078
|
className: (0, import_classnames80.default)(
|
|
44959
45079
|
"pointer-events-none absolute inset-0",
|
|
44960
|
-
surface.fill,
|
|
45080
|
+
legacyVariant && surface.fill,
|
|
44961
45081
|
cornerClass
|
|
45082
|
+
),
|
|
45083
|
+
children: !legacyVariant && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
45084
|
+
Panel_default,
|
|
45085
|
+
{
|
|
45086
|
+
variant: panelVariant,
|
|
45087
|
+
tone: surfaceTone,
|
|
45088
|
+
glassOpacity,
|
|
45089
|
+
vibrancy,
|
|
45090
|
+
specularMode,
|
|
45091
|
+
padding: "none",
|
|
45092
|
+
corner: "none",
|
|
45093
|
+
className: "h-full w-full",
|
|
45094
|
+
style: { borderRadius: "inherit" }
|
|
45095
|
+
}
|
|
44962
45096
|
)
|
|
44963
45097
|
}
|
|
44964
45098
|
),
|
|
@@ -44987,7 +45121,7 @@ var SidePanel = ({
|
|
|
44987
45121
|
isCollapsed && "opacity-0",
|
|
44988
45122
|
className
|
|
44989
45123
|
),
|
|
44990
|
-
style: { width: resolvedWidth },
|
|
45124
|
+
style: { width: docked ? "100%" : resolvedWidth },
|
|
44991
45125
|
onKeyDown,
|
|
44992
45126
|
children: [
|
|
44993
45127
|
/* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(
|
|
@@ -45074,7 +45208,7 @@ var SidePanel = ({
|
|
|
45074
45208
|
]
|
|
45075
45209
|
}
|
|
45076
45210
|
),
|
|
45077
|
-
overlay && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
45211
|
+
overlay && !docked && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
45078
45212
|
"div",
|
|
45079
45213
|
{
|
|
45080
45214
|
"aria-hidden": "true",
|
|
@@ -45091,7 +45225,7 @@ var SidePanel = ({
|
|
|
45091
45225
|
}
|
|
45092
45226
|
}
|
|
45093
45227
|
),
|
|
45094
|
-
resizable && // ARIA 1.2 resizable separator: focusable (tabIndex), arrow keys /
|
|
45228
|
+
resizable && !docked && // ARIA 1.2 resizable separator: focusable (tabIndex), arrow keys /
|
|
45095
45229
|
// Home / End resize, aria-valuenow|min|max report the width. Parked
|
|
45096
45230
|
// (collapsed), it drops the role and every aria-* and leaves the tab
|
|
45097
45231
|
// order — see `handleParked`.
|
|
@@ -64909,7 +65043,7 @@ var getStatusTokens = (status, palette) => {
|
|
|
64909
65043
|
const STATUS_STYLES = {
|
|
64910
65044
|
done: {
|
|
64911
65045
|
tone: accent,
|
|
64912
|
-
node: `bg-${accent}-500
|
|
65046
|
+
node: `bg-${accent}-500 border-2 border-${accent}-500`,
|
|
64913
65047
|
glyph: "check",
|
|
64914
65048
|
glyphClass: "text-white",
|
|
64915
65049
|
connector: `bg-${accent}-500 dark:bg-${accent}-500`,
|
|
@@ -65034,14 +65168,15 @@ var WorkflowStatusNode = ({
|
|
|
65034
65168
|
"span",
|
|
65035
65169
|
{
|
|
65036
65170
|
"aria-hidden": "true",
|
|
65171
|
+
"data-workflow-status-node": true,
|
|
65037
65172
|
className: (0, import_classnames111.default)("relative inline-flex shrink-0", node, className),
|
|
65038
65173
|
children: [
|
|
65039
65174
|
tokens.pulse && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
|
|
65040
65175
|
"span",
|
|
65041
65176
|
{
|
|
65042
65177
|
className: (0, import_classnames111.default)(
|
|
65043
|
-
"absolute inset-0 animate-ping rounded-full opacity-60 motion-reduce:hidden",
|
|
65044
|
-
`bg-${tokens.tone}-300 dark:bg-${tokens.tone}-
|
|
65178
|
+
"absolute inset-0 origin-center animate-ping rounded-full opacity-60 motion-reduce:hidden",
|
|
65179
|
+
`bg-${tokens.tone}-300 dark:bg-${tokens.tone}-400`
|
|
65045
65180
|
)
|
|
65046
65181
|
}
|
|
65047
65182
|
),
|
|
@@ -65049,7 +65184,7 @@ var WorkflowStatusNode = ({
|
|
|
65049
65184
|
"span",
|
|
65050
65185
|
{
|
|
65051
65186
|
className: (0, import_classnames111.default)(
|
|
65052
|
-
"
|
|
65187
|
+
"absolute inset-0 inline-flex h-full w-full items-center justify-center rounded-full",
|
|
65053
65188
|
tokens.node
|
|
65054
65189
|
),
|
|
65055
65190
|
children: [
|
|
@@ -65249,6 +65384,7 @@ var WorkflowTimeline = ({
|
|
|
65249
65384
|
renderStepPopover,
|
|
65250
65385
|
stepPopoverProps,
|
|
65251
65386
|
collapsed = false,
|
|
65387
|
+
side = "left",
|
|
65252
65388
|
fillHeight = false,
|
|
65253
65389
|
steps,
|
|
65254
65390
|
activeStepId,
|
|
@@ -65381,6 +65517,7 @@ var WorkflowTimeline = ({
|
|
|
65381
65517
|
{
|
|
65382
65518
|
status,
|
|
65383
65519
|
palette,
|
|
65520
|
+
size: collapsed ? "sm" : "md",
|
|
65384
65521
|
className: collapsed ? void 0 : "mt-0.5"
|
|
65385
65522
|
}
|
|
65386
65523
|
),
|
|
@@ -65440,9 +65577,10 @@ var WorkflowTimeline = ({
|
|
|
65440
65577
|
type: "button",
|
|
65441
65578
|
onClick: () => onStepSelect(step.id),
|
|
65442
65579
|
className: (0, import_classnames114.default)(
|
|
65443
|
-
"relative flex text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400
|
|
65580
|
+
"relative flex text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 dark:focus-visible:ring-neutral-500",
|
|
65581
|
+
collapsed ? "focus-visible:ring-inset" : "focus-visible:ring-offset-2",
|
|
65444
65582
|
collapsed ? "h-9 w-9 items-center justify-center rounded-xl" : "w-full items-start gap-3 rounded-sm",
|
|
65445
|
-
collapsed &&
|
|
65583
|
+
collapsed && "transition-colors hover:bg-neutral-100 dark:hover:bg-white/5"
|
|
65446
65584
|
),
|
|
65447
65585
|
children: rowContent
|
|
65448
65586
|
}
|
|
@@ -65451,9 +65589,10 @@ var WorkflowTimeline = ({
|
|
|
65451
65589
|
{
|
|
65452
65590
|
tabIndex: collapsed ? 0 : void 0,
|
|
65453
65591
|
className: (0, import_classnames114.default)(
|
|
65454
|
-
"relative flex focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400",
|
|
65592
|
+
"relative flex focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 dark:focus-visible:ring-neutral-500",
|
|
65593
|
+
collapsed && "focus-visible:ring-inset",
|
|
65455
65594
|
collapsed ? "h-9 w-9 items-center justify-center rounded-xl" : "w-full items-start gap-3 rounded-sm",
|
|
65456
|
-
collapsed &&
|
|
65595
|
+
collapsed && "transition-colors hover:bg-neutral-100 dark:hover:bg-white/5"
|
|
65457
65596
|
),
|
|
65458
65597
|
children: rowContent
|
|
65459
65598
|
}
|
|
@@ -65471,7 +65610,12 @@ var WorkflowTimeline = ({
|
|
|
65471
65610
|
"span",
|
|
65472
65611
|
{
|
|
65473
65612
|
"aria-hidden": "true",
|
|
65474
|
-
|
|
65613
|
+
"data-workflow-selection-marker": true,
|
|
65614
|
+
style: { position: "absolute", pointerEvents: "none" },
|
|
65615
|
+
className: (0, import_classnames114.default)(
|
|
65616
|
+
`absolute top-1.5 h-6 w-1 bg-${palette.accent}-600`,
|
|
65617
|
+
side === "left" ? "-left-2 rounded-r-full" : "-right-2 rounded-l-full"
|
|
65618
|
+
)
|
|
65475
65619
|
}
|
|
65476
65620
|
),
|
|
65477
65621
|
!isLast && /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
@@ -65925,6 +66069,7 @@ var sampleWorkflow = {
|
|
|
65925
66069
|
// src/components/WorkflowTracker/WorkflowTrackerRail.tsx
|
|
65926
66070
|
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
65927
66071
|
var WorkflowTrackerRail = ({
|
|
66072
|
+
side = "left",
|
|
65928
66073
|
collapsible = false,
|
|
65929
66074
|
collapsed,
|
|
65930
66075
|
defaultCollapsed = false,
|
|
@@ -65977,7 +66122,11 @@ var WorkflowTrackerRail = ({
|
|
|
65977
66122
|
className,
|
|
65978
66123
|
cardClassName
|
|
65979
66124
|
),
|
|
65980
|
-
style: collapsible ? {
|
|
66125
|
+
style: collapsible ? {
|
|
66126
|
+
...style,
|
|
66127
|
+
width: isCollapsed ? COLLAPSED_RAIL_WIDTH : style?.width ?? 360,
|
|
66128
|
+
...isCollapsed ? side === "left" ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } : { borderTopRightRadius: 0, borderBottomRightRadius: 0 } : {}
|
|
66129
|
+
} : style,
|
|
65981
66130
|
"aria-busy": loading || void 0,
|
|
65982
66131
|
"data-collapsed": collapsible ? isCollapsed : void 0,
|
|
65983
66132
|
children: [
|
|
@@ -65986,16 +66135,16 @@ var WorkflowTrackerRail = ({
|
|
|
65986
66135
|
{
|
|
65987
66136
|
className: (0, import_classnames115.default)(
|
|
65988
66137
|
"absolute z-20 flex",
|
|
65989
|
-
isCollapsed ? "inset-x-0 top-2 justify-center" : "right-4 top-4"
|
|
66138
|
+
isCollapsed ? "inset-x-0 top-2 justify-center" : side === "left" ? "right-4 top-4" : "left-4 top-4"
|
|
65990
66139
|
),
|
|
65991
66140
|
children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
65992
66141
|
CollapseToggleButton,
|
|
65993
66142
|
{
|
|
65994
66143
|
collapsed: isCollapsed,
|
|
65995
|
-
edge:
|
|
66144
|
+
edge: side,
|
|
65996
66145
|
srLabel: isCollapsed ? expandLabel : collapseLabel,
|
|
65997
66146
|
tooltip: isCollapsed ? expandLabel : collapseLabel,
|
|
65998
|
-
tooltipPosition: "right",
|
|
66147
|
+
tooltipPosition: side === "left" ? "right" : "left",
|
|
65999
66148
|
"aria-controls": timelineId,
|
|
66000
66149
|
onClick: () => {
|
|
66001
66150
|
const next = !isCollapsed;
|
|
@@ -66017,9 +66166,11 @@ var WorkflowTrackerRail = ({
|
|
|
66017
66166
|
{
|
|
66018
66167
|
controls: renderControls?.({ collapsed: isCollapsed }),
|
|
66019
66168
|
collapsed: isCollapsed,
|
|
66169
|
+
side,
|
|
66020
66170
|
hasCollapseToggle: collapsible,
|
|
66021
66171
|
renderStepPopover,
|
|
66022
66172
|
stepPopoverProps: {
|
|
66173
|
+
placement: side === "left" ? "right" : "left",
|
|
66023
66174
|
variant: cardProps.variant,
|
|
66024
66175
|
tone: cardProps.tone,
|
|
66025
66176
|
corner: cardProps.corner,
|
|
@@ -73558,12 +73709,137 @@ var TerminalTabs = (0, import_react309.forwardRef)(
|
|
|
73558
73709
|
}
|
|
73559
73710
|
);
|
|
73560
73711
|
|
|
73561
|
-
// src/
|
|
73712
|
+
// src/components/PageBodyLayout.tsx
|
|
73562
73713
|
var import_react310 = require("react");
|
|
73563
|
-
var import_react_dom19 = require("react-dom");
|
|
73564
73714
|
var import_classnames141 = __toESM(require("classnames"), 1);
|
|
73565
73715
|
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
73566
|
-
|
|
73716
|
+
function Region({ config, side }) {
|
|
73717
|
+
const vertical = side === "bottom";
|
|
73718
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react310.useState)(config.defaultCollapsed ?? false);
|
|
73719
|
+
const [internalSize, setInternalSize] = (0, import_react310.useState)(config.defaultSize ?? (vertical ? 200 : 280));
|
|
73720
|
+
const collapsed = config.collapsed ?? internalCollapsed;
|
|
73721
|
+
const min = Math.max(0, config.minSize ?? (vertical ? 100 : 160));
|
|
73722
|
+
const max = Math.max(min, config.maxSize ?? (vertical ? 600 : 640));
|
|
73723
|
+
const size = Math.max(min, Math.min(max, config.size ?? internalSize));
|
|
73724
|
+
const collapsedSize = Math.max(0, config.collapsedSize ?? (vertical ? 40 : COLLAPSED_RAIL_WIDTH));
|
|
73725
|
+
const setCollapsed = (next) => {
|
|
73726
|
+
if (config.collapsed === void 0) setInternalCollapsed(next);
|
|
73727
|
+
config.onCollapsedChange?.(next);
|
|
73728
|
+
};
|
|
73729
|
+
const updateSize = (0, import_react310.useCallback)((next) => {
|
|
73730
|
+
const value = Math.max(min, Math.min(max, next));
|
|
73731
|
+
if (config.size === void 0) setInternalSize(value);
|
|
73732
|
+
config.onSizeChange?.(value);
|
|
73733
|
+
}, [min, max, config.size, config.onSizeChange]);
|
|
73734
|
+
const drag = (0, import_react310.useRef)(null);
|
|
73735
|
+
const [dragging, setDragging] = (0, import_react310.useState)(false);
|
|
73736
|
+
(0, import_react310.useEffect)(() => {
|
|
73737
|
+
if (!dragging) return;
|
|
73738
|
+
const previousCursor = document.body.style.cursor;
|
|
73739
|
+
const previousSelect = document.body.style.userSelect;
|
|
73740
|
+
document.body.style.cursor = vertical ? "row-resize" : "col-resize";
|
|
73741
|
+
document.body.style.userSelect = "none";
|
|
73742
|
+
const move = (event) => {
|
|
73743
|
+
if (!drag.current) return;
|
|
73744
|
+
const delta = (vertical ? event.clientY : event.clientX) - drag.current.position;
|
|
73745
|
+
updateSize(drag.current.size + delta * (side === "left" ? 1 : -1));
|
|
73746
|
+
};
|
|
73747
|
+
const stop = () => {
|
|
73748
|
+
drag.current = null;
|
|
73749
|
+
setDragging(false);
|
|
73750
|
+
};
|
|
73751
|
+
window.addEventListener("pointermove", move);
|
|
73752
|
+
window.addEventListener("pointerup", stop);
|
|
73753
|
+
window.addEventListener("pointercancel", stop);
|
|
73754
|
+
return () => {
|
|
73755
|
+
window.removeEventListener("pointermove", move);
|
|
73756
|
+
window.removeEventListener("pointerup", stop);
|
|
73757
|
+
window.removeEventListener("pointercancel", stop);
|
|
73758
|
+
document.body.style.cursor = previousCursor;
|
|
73759
|
+
document.body.style.userSelect = previousSelect;
|
|
73760
|
+
};
|
|
73761
|
+
}, [dragging, vertical, side, updateSize]);
|
|
73762
|
+
const canResize = !collapsed && (config.resizable ?? side !== "left");
|
|
73763
|
+
const dimension = collapsed ? collapsedSize : size;
|
|
73764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
|
|
73765
|
+
"section",
|
|
73766
|
+
{
|
|
73767
|
+
"aria-label": config.label,
|
|
73768
|
+
"data-page-region": side,
|
|
73769
|
+
"data-collapsed": collapsed,
|
|
73770
|
+
className: "relative min-h-0 min-w-0 shrink-0 overflow-hidden",
|
|
73771
|
+
style: vertical ? { height: dimension } : { width: dimension },
|
|
73772
|
+
children: [
|
|
73773
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
73774
|
+
config.showToggle !== false && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "flex shrink-0 justify-end px-2 py-1", children: /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
73775
|
+
IconButton_default,
|
|
73776
|
+
{
|
|
73777
|
+
size: "xs",
|
|
73778
|
+
variant: "ghost",
|
|
73779
|
+
color: "neutral",
|
|
73780
|
+
icon: vertical ? collapsed ? "ArrowChevronUp" : "ArrowChevronDown" : collapsed === (side === "left") ? "ArrowChevronRight" : "ArrowChevronLeft",
|
|
73781
|
+
"aria-label": `${collapsed ? "Expand" : "Collapse"} ${config.label}`,
|
|
73782
|
+
"aria-expanded": !collapsed,
|
|
73783
|
+
onClick: () => setCollapsed(!collapsed)
|
|
73784
|
+
}
|
|
73785
|
+
) }),
|
|
73786
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: (0, import_classnames141.default)("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: typeof config.content === "function" ? config.content({ collapsed, setCollapsed, size }) : /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "h-full", hidden: collapsed, inert: collapsed || void 0, children: config.content }) })
|
|
73787
|
+
] }),
|
|
73788
|
+
canResize && // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-noninteractive-tabindex -- focusable ARIA separator provides keyboard and pointer resizing
|
|
73789
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
73790
|
+
"div",
|
|
73791
|
+
{
|
|
73792
|
+
role: "separator",
|
|
73793
|
+
tabIndex: 0,
|
|
73794
|
+
"aria-label": `Resize ${config.label}`,
|
|
73795
|
+
"aria-orientation": vertical ? "horizontal" : "vertical",
|
|
73796
|
+
"aria-valuemin": min,
|
|
73797
|
+
"aria-valuemax": max,
|
|
73798
|
+
"aria-valuenow": size,
|
|
73799
|
+
className: (0, import_classnames141.default)("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"),
|
|
73800
|
+
onPointerDown: (event) => {
|
|
73801
|
+
if (event.button !== 0) return;
|
|
73802
|
+
event.preventDefault();
|
|
73803
|
+
drag.current = { position: vertical ? event.clientY : event.clientX, size };
|
|
73804
|
+
setDragging(true);
|
|
73805
|
+
},
|
|
73806
|
+
onKeyDown: (event) => {
|
|
73807
|
+
const grow = vertical ? "ArrowUp" : side === "right" ? "ArrowLeft" : "ArrowRight";
|
|
73808
|
+
const shrink = vertical ? "ArrowDown" : side === "right" ? "ArrowRight" : "ArrowLeft";
|
|
73809
|
+
if (![grow, shrink, "Home", "End"].includes(event.key)) return;
|
|
73810
|
+
event.preventDefault();
|
|
73811
|
+
updateSize(event.key === "Home" ? min : event.key === "End" ? max : size + (event.key === grow ? 20 : -20));
|
|
73812
|
+
},
|
|
73813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { "aria-hidden": "true", className: (0, import_classnames141.default)(
|
|
73814
|
+
"pointer-events-none absolute rounded-full bg-neutral-300 dark:bg-neutral-600",
|
|
73815
|
+
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"
|
|
73816
|
+
) })
|
|
73817
|
+
}
|
|
73818
|
+
)
|
|
73819
|
+
]
|
|
73820
|
+
}
|
|
73821
|
+
);
|
|
73822
|
+
}
|
|
73823
|
+
function PageBodyLayout({ header, left, right, bottom, children, className, minCenterWidth = 240, minCenterHeight = 120, variant = "outlined", ...surface }) {
|
|
73824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(Panel_default, { ...surface, variant, padding: "none", scrollable: false, flexBody: true, className: (0, import_classnames141.default)("h-full min-h-0 min-w-0", className), children: [
|
|
73825
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "shrink-0", children: header }),
|
|
73826
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: (0, import_classnames141.default)("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: "flex h-full min-h-0", style: { minWidth: minCenterWidth }, children: [
|
|
73827
|
+
left && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(Region, { side: "left", config: left }),
|
|
73828
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
73829
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { "data-page-region": "center", className: (0, import_classnames141.default)("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), style: { minHeight: minCenterHeight, minWidth: minCenterWidth }, children }),
|
|
73830
|
+
bottom && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(Region, { side: "bottom", config: bottom })
|
|
73831
|
+
] }),
|
|
73832
|
+
right && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(Region, { side: "right", config: right })
|
|
73833
|
+
] }) })
|
|
73834
|
+
] });
|
|
73835
|
+
}
|
|
73836
|
+
|
|
73837
|
+
// src/contexts/BottomSheetContext.tsx
|
|
73838
|
+
var import_react311 = require("react");
|
|
73839
|
+
var import_react_dom19 = require("react-dom");
|
|
73840
|
+
var import_classnames142 = __toESM(require("classnames"), 1);
|
|
73841
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
73842
|
+
var BottomSheetContext = (0, import_react311.createContext)(null);
|
|
73567
73843
|
var TRANSITION_MS2 = 260;
|
|
73568
73844
|
var renderSlot = (slot, controls) => {
|
|
73569
73845
|
if (!slot) {
|
|
@@ -73574,13 +73850,13 @@ var renderSlot = (slot, controls) => {
|
|
|
73574
73850
|
var BottomSheetProvider = ({
|
|
73575
73851
|
children
|
|
73576
73852
|
}) => {
|
|
73577
|
-
const [sheet, setSheet] = (0,
|
|
73578
|
-
const [isVisible, setIsVisible] = (0,
|
|
73579
|
-
const pendingCloseRef = (0,
|
|
73580
|
-
const dismissSheet = (0,
|
|
73853
|
+
const [sheet, setSheet] = (0, import_react311.useState)(null);
|
|
73854
|
+
const [isVisible, setIsVisible] = (0, import_react311.useState)(false);
|
|
73855
|
+
const pendingCloseRef = (0, import_react311.useRef)(null);
|
|
73856
|
+
const dismissSheet = (0, import_react311.useCallback)(() => {
|
|
73581
73857
|
setIsVisible(false);
|
|
73582
73858
|
}, []);
|
|
73583
|
-
const presentSheet = (0,
|
|
73859
|
+
const presentSheet = (0, import_react311.useCallback)((options) => {
|
|
73584
73860
|
if (pendingCloseRef.current) {
|
|
73585
73861
|
clearTimeout(pendingCloseRef.current);
|
|
73586
73862
|
pendingCloseRef.current = null;
|
|
@@ -73593,7 +73869,7 @@ var BottomSheetProvider = ({
|
|
|
73593
73869
|
setTimeout(animateIn, 0);
|
|
73594
73870
|
}
|
|
73595
73871
|
}, []);
|
|
73596
|
-
(0,
|
|
73872
|
+
(0, import_react311.useEffect)(() => {
|
|
73597
73873
|
if (!isVisible && sheet) {
|
|
73598
73874
|
pendingCloseRef.current = setTimeout(() => {
|
|
73599
73875
|
sheet.onClose?.();
|
|
@@ -73608,7 +73884,7 @@ var BottomSheetProvider = ({
|
|
|
73608
73884
|
}
|
|
73609
73885
|
return void 0;
|
|
73610
73886
|
}, [isVisible, sheet]);
|
|
73611
|
-
(0,
|
|
73887
|
+
(0, import_react311.useEffect)(
|
|
73612
73888
|
() => () => {
|
|
73613
73889
|
if (pendingCloseRef.current) {
|
|
73614
73890
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -73616,13 +73892,13 @@ var BottomSheetProvider = ({
|
|
|
73616
73892
|
},
|
|
73617
73893
|
[]
|
|
73618
73894
|
);
|
|
73619
|
-
const controls = (0,
|
|
73895
|
+
const controls = (0, import_react311.useMemo)(
|
|
73620
73896
|
() => ({
|
|
73621
73897
|
dismiss: dismissSheet
|
|
73622
73898
|
}),
|
|
73623
73899
|
[dismissSheet]
|
|
73624
73900
|
);
|
|
73625
|
-
const contextValue = (0,
|
|
73901
|
+
const contextValue = (0, import_react311.useMemo)(
|
|
73626
73902
|
() => ({
|
|
73627
73903
|
presentSheet,
|
|
73628
73904
|
dismissSheet,
|
|
@@ -73632,11 +73908,11 @@ var BottomSheetProvider = ({
|
|
|
73632
73908
|
[presentSheet, dismissSheet, sheet, isVisible]
|
|
73633
73909
|
);
|
|
73634
73910
|
const overlayNode = typeof document !== "undefined" && sheet ? (0, import_react_dom19.createPortal)(
|
|
73635
|
-
/* @__PURE__ */ (0,
|
|
73636
|
-
/* @__PURE__ */ (0,
|
|
73911
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
|
|
73912
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
73637
73913
|
"div",
|
|
73638
73914
|
{
|
|
73639
|
-
className: (0,
|
|
73915
|
+
className: (0, import_classnames142.default)(
|
|
73640
73916
|
"absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
|
|
73641
73917
|
isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
73642
73918
|
),
|
|
@@ -73646,24 +73922,24 @@ var BottomSheetProvider = ({
|
|
|
73646
73922
|
}
|
|
73647
73923
|
}
|
|
73648
73924
|
),
|
|
73649
|
-
/* @__PURE__ */ (0,
|
|
73925
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)(
|
|
73650
73926
|
"section",
|
|
73651
73927
|
{
|
|
73652
73928
|
role: "dialog",
|
|
73653
73929
|
"aria-modal": "true",
|
|
73654
|
-
className: (0,
|
|
73930
|
+
className: (0, import_classnames142.default)(
|
|
73655
73931
|
"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",
|
|
73656
73932
|
sheet.className,
|
|
73657
73933
|
isVisible ? "translate-y-0" : "translate-y-full"
|
|
73658
73934
|
),
|
|
73659
73935
|
style: { minHeight: "25vh", maxHeight: "85vh" },
|
|
73660
73936
|
children: [
|
|
73661
|
-
/* @__PURE__ */ (0,
|
|
73662
|
-
/* @__PURE__ */ (0,
|
|
73663
|
-
sheet.title && /* @__PURE__ */ (0,
|
|
73664
|
-
sheet.description && /* @__PURE__ */ (0,
|
|
73937
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
73938
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { className: "space-y-1", children: [
|
|
73939
|
+
sheet.title && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
|
|
73940
|
+
sheet.description && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
|
|
73665
73941
|
] }),
|
|
73666
|
-
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0,
|
|
73942
|
+
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
73667
73943
|
IconButton_default,
|
|
73668
73944
|
{
|
|
73669
73945
|
icon: "Close",
|
|
@@ -73675,21 +73951,21 @@ var BottomSheetProvider = ({
|
|
|
73675
73951
|
}
|
|
73676
73952
|
)
|
|
73677
73953
|
] }),
|
|
73678
|
-
/* @__PURE__ */ (0,
|
|
73679
|
-
sheet.actions && /* @__PURE__ */ (0,
|
|
73954
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
|
|
73955
|
+
sheet.actions && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("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) })
|
|
73680
73956
|
]
|
|
73681
73957
|
}
|
|
73682
73958
|
) })
|
|
73683
73959
|
] }),
|
|
73684
73960
|
document.body
|
|
73685
73961
|
) : null;
|
|
73686
|
-
return /* @__PURE__ */ (0,
|
|
73962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)(BottomSheetContext.Provider, { value: contextValue, children: [
|
|
73687
73963
|
children,
|
|
73688
73964
|
overlayNode
|
|
73689
73965
|
] });
|
|
73690
73966
|
};
|
|
73691
73967
|
var useBottomSheet = () => {
|
|
73692
|
-
const context = (0,
|
|
73968
|
+
const context = (0, import_react311.useContext)(BottomSheetContext);
|
|
73693
73969
|
if (!context) {
|
|
73694
73970
|
throw new Error("useBottomSheet must be used within a BottomSheetProvider");
|
|
73695
73971
|
}
|
|
@@ -74323,8 +74599,8 @@ var SYSTEM_VARIABLES = [
|
|
|
74323
74599
|
];
|
|
74324
74600
|
|
|
74325
74601
|
// src/components/MetricBar.tsx
|
|
74326
|
-
var
|
|
74327
|
-
var
|
|
74602
|
+
var import_classnames143 = __toESM(require("classnames"), 1);
|
|
74603
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
74328
74604
|
var MetricBar = ({
|
|
74329
74605
|
label,
|
|
74330
74606
|
value,
|
|
@@ -74334,7 +74610,7 @@ var MetricBar = ({
|
|
|
74334
74610
|
size = "sm",
|
|
74335
74611
|
className,
|
|
74336
74612
|
...rest
|
|
74337
|
-
}) => /* @__PURE__ */ (0,
|
|
74613
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
74338
74614
|
Progress_default,
|
|
74339
74615
|
{
|
|
74340
74616
|
...rest,
|
|
@@ -74344,13 +74620,13 @@ var MetricBar = ({
|
|
|
74344
74620
|
formatValue: value !== void 0 ? () => String(value) : void 0,
|
|
74345
74621
|
size,
|
|
74346
74622
|
color: tone ?? color ?? "blue",
|
|
74347
|
-
className: (0,
|
|
74623
|
+
className: (0, import_classnames143.default)("w-full", className)
|
|
74348
74624
|
}
|
|
74349
74625
|
);
|
|
74350
74626
|
MetricBar.displayName = "MetricBar";
|
|
74351
74627
|
|
|
74352
74628
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74353
|
-
var
|
|
74629
|
+
var import_react313 = require("react");
|
|
74354
74630
|
|
|
74355
74631
|
// src/components/NetworkGraph/model.ts
|
|
74356
74632
|
var CELL = 64;
|
|
@@ -74494,17 +74770,17 @@ function findNetworkPath(edges, source, target) {
|
|
|
74494
74770
|
}
|
|
74495
74771
|
|
|
74496
74772
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
74497
|
-
var
|
|
74773
|
+
var import_react312 = require("react");
|
|
74498
74774
|
function useNetworkCanvas(options) {
|
|
74499
|
-
const canvasRef = (0,
|
|
74500
|
-
const view = (0,
|
|
74501
|
-
const size = (0,
|
|
74502
|
-
const latest = (0,
|
|
74503
|
-
const frame = (0,
|
|
74504
|
-
const [zoom, setZoom] = (0,
|
|
74505
|
-
const colors3 = (0,
|
|
74506
|
-
const textColor = (0,
|
|
74507
|
-
const draw = (0,
|
|
74775
|
+
const canvasRef = (0, import_react312.useRef)(null);
|
|
74776
|
+
const view = (0, import_react312.useRef)({ x: 0, y: 0, zoom: 1 });
|
|
74777
|
+
const size = (0, import_react312.useRef)({ width: 1, height: 1 });
|
|
74778
|
+
const latest = (0, import_react312.useRef)(options);
|
|
74779
|
+
const frame = (0, import_react312.useRef)(null);
|
|
74780
|
+
const [zoom, setZoom] = (0, import_react312.useState)(1);
|
|
74781
|
+
const colors3 = (0, import_react312.useRef)(/* @__PURE__ */ new Map());
|
|
74782
|
+
const textColor = (0, import_react312.useRef)("#737373");
|
|
74783
|
+
const draw = (0, import_react312.useCallback)(() => {
|
|
74508
74784
|
const canvas = canvasRef.current;
|
|
74509
74785
|
const ctx = canvas?.getContext("2d");
|
|
74510
74786
|
if (!canvas || !ctx) return;
|
|
@@ -74604,14 +74880,14 @@ function useNetworkCanvas(options) {
|
|
|
74604
74880
|
}
|
|
74605
74881
|
ctx.globalAlpha = 1;
|
|
74606
74882
|
}, []);
|
|
74607
|
-
const requestDraw = (0,
|
|
74883
|
+
const requestDraw = (0, import_react312.useCallback)(() => {
|
|
74608
74884
|
if (frame.current !== null) return;
|
|
74609
74885
|
frame.current = requestAnimationFrame(() => {
|
|
74610
74886
|
frame.current = null;
|
|
74611
74887
|
draw();
|
|
74612
74888
|
});
|
|
74613
74889
|
}, [draw]);
|
|
74614
|
-
const update = (0,
|
|
74890
|
+
const update = (0, import_react312.useCallback)(
|
|
74615
74891
|
(next) => {
|
|
74616
74892
|
view.current = next;
|
|
74617
74893
|
setZoom(next.zoom);
|
|
@@ -74620,7 +74896,7 @@ function useNetworkCanvas(options) {
|
|
|
74620
74896
|
},
|
|
74621
74897
|
[requestDraw]
|
|
74622
74898
|
);
|
|
74623
|
-
const fit = (0,
|
|
74899
|
+
const fit = (0, import_react312.useCallback)(
|
|
74624
74900
|
() => update(
|
|
74625
74901
|
fitNetwork(
|
|
74626
74902
|
latest.current.nodes,
|
|
@@ -74630,11 +74906,11 @@ function useNetworkCanvas(options) {
|
|
|
74630
74906
|
),
|
|
74631
74907
|
[update]
|
|
74632
74908
|
);
|
|
74633
|
-
const zoomBy = (0,
|
|
74909
|
+
const zoomBy = (0, import_react312.useCallback)(
|
|
74634
74910
|
(factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
|
|
74635
74911
|
[update]
|
|
74636
74912
|
);
|
|
74637
|
-
const focusNode = (0,
|
|
74913
|
+
const focusNode = (0, import_react312.useCallback)(
|
|
74638
74914
|
(node) => {
|
|
74639
74915
|
update({
|
|
74640
74916
|
...view.current,
|
|
@@ -74644,14 +74920,14 @@ function useNetworkCanvas(options) {
|
|
|
74644
74920
|
},
|
|
74645
74921
|
[update]
|
|
74646
74922
|
);
|
|
74647
|
-
(0,
|
|
74923
|
+
(0, import_react312.useEffect)(() => {
|
|
74648
74924
|
latest.current = options;
|
|
74649
74925
|
requestDraw();
|
|
74650
74926
|
}, [options, requestDraw]);
|
|
74651
|
-
(0,
|
|
74927
|
+
(0, import_react312.useEffect)(() => {
|
|
74652
74928
|
fit();
|
|
74653
74929
|
}, [options.model, fit]);
|
|
74654
|
-
(0,
|
|
74930
|
+
(0, import_react312.useEffect)(() => {
|
|
74655
74931
|
const canvas = canvasRef.current;
|
|
74656
74932
|
if (!canvas) return;
|
|
74657
74933
|
const measure = () => {
|
|
@@ -74704,7 +74980,7 @@ function useNetworkCanvas(options) {
|
|
|
74704
74980
|
}
|
|
74705
74981
|
|
|
74706
74982
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74707
|
-
var
|
|
74983
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
74708
74984
|
var NO_COMMUNITIES = [];
|
|
74709
74985
|
var NO_HIGHLIGHTS = [];
|
|
74710
74986
|
function NetworkGraph({
|
|
@@ -74735,11 +75011,11 @@ function NetworkGraph({
|
|
|
74735
75011
|
...panelProps
|
|
74736
75012
|
}) {
|
|
74737
75013
|
const t = useKitT();
|
|
74738
|
-
const helpId = (0,
|
|
74739
|
-
const layoutRef = (0,
|
|
74740
|
-
const [hasLegendSpace, setHasLegendSpace] = (0,
|
|
75014
|
+
const helpId = (0, import_react313.useId)();
|
|
75015
|
+
const layoutRef = (0, import_react313.useRef)(null);
|
|
75016
|
+
const [hasLegendSpace, setHasLegendSpace] = (0, import_react313.useState)(true);
|
|
74741
75017
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
74742
|
-
(0,
|
|
75018
|
+
(0, import_react313.useEffect)(() => {
|
|
74743
75019
|
const element = layoutRef.current;
|
|
74744
75020
|
if (!element || legendPosition !== "auto") return;
|
|
74745
75021
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -74748,38 +75024,38 @@ function NetworkGraph({
|
|
|
74748
75024
|
observer.observe(element);
|
|
74749
75025
|
return () => observer.disconnect();
|
|
74750
75026
|
}, [legendPosition, loading]);
|
|
74751
|
-
const model = (0,
|
|
75027
|
+
const model = (0, import_react313.useMemo)(
|
|
74752
75028
|
() => buildNetwork(nodes, edges, communities),
|
|
74753
75029
|
[nodes, edges, communities]
|
|
74754
75030
|
);
|
|
74755
|
-
const [internalSelected, setInternalSelected] = (0,
|
|
75031
|
+
const [internalSelected, setInternalSelected] = (0, import_react313.useState)(
|
|
74756
75032
|
defaultSelectedNodeId
|
|
74757
75033
|
);
|
|
74758
|
-
const [hidden, setHidden] = (0,
|
|
74759
|
-
const [focused, setFocused] = (0,
|
|
74760
|
-
const [query, setQuery] = (0,
|
|
74761
|
-
const enabled = (0,
|
|
75034
|
+
const [hidden, setHidden] = (0, import_react313.useState)(() => /* @__PURE__ */ new Set());
|
|
75035
|
+
const [focused, setFocused] = (0, import_react313.useState)(null);
|
|
75036
|
+
const [query, setQuery] = (0, import_react313.useState)("");
|
|
75037
|
+
const enabled = (0, import_react313.useMemo)(
|
|
74762
75038
|
() => new Set(
|
|
74763
75039
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
74764
75040
|
),
|
|
74765
75041
|
[visibleCommunityIds, model, hidden]
|
|
74766
75042
|
);
|
|
74767
|
-
const visibleNodes = (0,
|
|
75043
|
+
const visibleNodes = (0, import_react313.useMemo)(
|
|
74768
75044
|
() => model.nodes.filter((n) => !n.community || enabled.has(n.community)),
|
|
74769
75045
|
[model, enabled]
|
|
74770
75046
|
);
|
|
74771
|
-
const visible = (0,
|
|
75047
|
+
const visible = (0, import_react313.useMemo)(
|
|
74772
75048
|
() => new Set(visibleNodes.map((n) => n.id)),
|
|
74773
75049
|
[visibleNodes]
|
|
74774
75050
|
);
|
|
74775
75051
|
const selection = selectedNodeId === void 0 ? internalSelected : selectedNodeId;
|
|
74776
75052
|
const selected = selection !== null && visible.has(selection) ? selection : null;
|
|
74777
75053
|
const activeFocus = focused !== null && visible.has(focused) ? focused : null;
|
|
74778
|
-
const highlighted = (0,
|
|
75054
|
+
const highlighted = (0, import_react313.useMemo)(
|
|
74779
75055
|
() => new Set(highlightedEdgeIds),
|
|
74780
75056
|
[highlightedEdgeIds]
|
|
74781
75057
|
);
|
|
74782
|
-
const counts = (0,
|
|
75058
|
+
const counts = (0, import_react313.useMemo)(() => {
|
|
74783
75059
|
const result = /* @__PURE__ */ new Map();
|
|
74784
75060
|
for (const n of model.nodes)
|
|
74785
75061
|
if (n.community)
|
|
@@ -74799,7 +75075,7 @@ function NetworkGraph({
|
|
|
74799
75075
|
onViewportChange
|
|
74800
75076
|
});
|
|
74801
75077
|
const locked = disabled || loading;
|
|
74802
|
-
const drag = (0,
|
|
75078
|
+
const drag = (0, import_react313.useRef)(null);
|
|
74803
75079
|
const select = (id) => {
|
|
74804
75080
|
if (locked) return;
|
|
74805
75081
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -74815,7 +75091,7 @@ function NetworkGraph({
|
|
|
74815
75091
|
);
|
|
74816
75092
|
onVisibleCommunitiesChange?.(ids);
|
|
74817
75093
|
};
|
|
74818
|
-
(0,
|
|
75094
|
+
(0, import_react313.useEffect)(() => {
|
|
74819
75095
|
const element = canvas.canvasRef.current;
|
|
74820
75096
|
if (!element || locked) return;
|
|
74821
75097
|
const wheel = (event) => {
|
|
@@ -74864,13 +75140,13 @@ function NetworkGraph({
|
|
|
74864
75140
|
}
|
|
74865
75141
|
};
|
|
74866
75142
|
const focusedNode = model.byId.get(activeFocus ?? selected ?? "");
|
|
74867
|
-
const matchingNodes = (0,
|
|
75143
|
+
const matchingNodes = (0, import_react313.useMemo)(() => {
|
|
74868
75144
|
const search = query.toLocaleLowerCase();
|
|
74869
75145
|
return visibleNodes.filter((n) => (n.label ?? n.id).toLocaleLowerCase().includes(search)).slice(0, 50).map((n) => ({ value: n.id, label: n.label ?? n.id }));
|
|
74870
75146
|
}, [visibleNodes, query]);
|
|
74871
75147
|
const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
|
|
74872
75148
|
const resolvedLegendTone = legendTone === "auto" ? tone : legendTone;
|
|
74873
|
-
const legendContent = /* @__PURE__ */ (0,
|
|
75149
|
+
const legendContent = /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
74874
75150
|
"fieldset",
|
|
74875
75151
|
{
|
|
74876
75152
|
disabled: locked,
|
|
@@ -74879,8 +75155,8 @@ function NetworkGraph({
|
|
|
74879
75155
|
maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
|
|
74880
75156
|
},
|
|
74881
75157
|
children: [
|
|
74882
|
-
/* @__PURE__ */ (0,
|
|
74883
|
-
/* @__PURE__ */ (0,
|
|
75158
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
|
|
75159
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
74884
75160
|
Checkbox_default,
|
|
74885
75161
|
{
|
|
74886
75162
|
size: "sm",
|
|
@@ -74891,8 +75167,8 @@ function NetworkGraph({
|
|
|
74891
75167
|
onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
|
|
74892
75168
|
}
|
|
74893
75169
|
),
|
|
74894
|
-
model.groups.map((group) => /* @__PURE__ */ (0,
|
|
74895
|
-
/* @__PURE__ */ (0,
|
|
75170
|
+
model.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
75171
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
74896
75172
|
Checkbox_default,
|
|
74897
75173
|
{
|
|
74898
75174
|
size: "sm",
|
|
@@ -74904,12 +75180,12 @@ function NetworkGraph({
|
|
|
74904
75180
|
)
|
|
74905
75181
|
}
|
|
74906
75182
|
),
|
|
74907
|
-
/* @__PURE__ */ (0,
|
|
75183
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
|
|
74908
75184
|
] }, group.id))
|
|
74909
75185
|
]
|
|
74910
75186
|
}
|
|
74911
75187
|
);
|
|
74912
|
-
return /* @__PURE__ */ (0,
|
|
75188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
74913
75189
|
Panel_default,
|
|
74914
75190
|
{
|
|
74915
75191
|
...panelProps,
|
|
@@ -74920,7 +75196,7 @@ function NetworkGraph({
|
|
|
74920
75196
|
loading,
|
|
74921
75197
|
clickable: false,
|
|
74922
75198
|
scrollable: false,
|
|
74923
|
-
children: /* @__PURE__ */ (0,
|
|
75199
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
74924
75200
|
"div",
|
|
74925
75201
|
{
|
|
74926
75202
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -74928,7 +75204,7 @@ function NetworkGraph({
|
|
|
74928
75204
|
"aria-label": ariaLabel ?? t("kit.networkGraph.name"),
|
|
74929
75205
|
"aria-disabled": locked || void 0,
|
|
74930
75206
|
children: [
|
|
74931
|
-
showControls && /* @__PURE__ */ (0,
|
|
75207
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
74932
75208
|
Combobox_default,
|
|
74933
75209
|
{
|
|
74934
75210
|
size: "sm",
|
|
@@ -74950,7 +75226,7 @@ function NetworkGraph({
|
|
|
74950
75226
|
}
|
|
74951
75227
|
}
|
|
74952
75228
|
) }) }),
|
|
74953
|
-
/* @__PURE__ */ (0,
|
|
75229
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
74954
75230
|
"div",
|
|
74955
75231
|
{
|
|
74956
75232
|
ref: layoutRef,
|
|
@@ -74958,13 +75234,13 @@ function NetworkGraph({
|
|
|
74958
75234
|
style: { flexDirection: legendOnRight ? "row" : "column" },
|
|
74959
75235
|
"data-legend-position": legendOnRight ? "right" : "bottom",
|
|
74960
75236
|
children: [
|
|
74961
|
-
/* @__PURE__ */ (0,
|
|
75237
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
74962
75238
|
"div",
|
|
74963
75239
|
{
|
|
74964
75240
|
className: "relative min-w-0 flex-1",
|
|
74965
75241
|
style: { height: graphHeight, minHeight: graphHeight },
|
|
74966
75242
|
children: [
|
|
74967
|
-
/* @__PURE__ */ (0,
|
|
75243
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
74968
75244
|
"canvas",
|
|
74969
75245
|
{
|
|
74970
75246
|
ref: canvas.canvasRef,
|
|
@@ -75033,11 +75309,11 @@ function NetworkGraph({
|
|
|
75033
75309
|
}
|
|
75034
75310
|
}
|
|
75035
75311
|
),
|
|
75036
|
-
showControls && /* @__PURE__ */ (0,
|
|
75037
|
-
/* @__PURE__ */ (0,
|
|
75312
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("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: [
|
|
75313
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75038
75314
|
IconButton_default,
|
|
75039
75315
|
{
|
|
75040
|
-
icon: /* @__PURE__ */ (0,
|
|
75316
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
75041
75317
|
"svg",
|
|
75042
75318
|
{
|
|
75043
75319
|
viewBox: "0 0 24 24",
|
|
@@ -75048,10 +75324,10 @@ function NetworkGraph({
|
|
|
75048
75324
|
strokeLinejoin: "round",
|
|
75049
75325
|
"aria-hidden": "true",
|
|
75050
75326
|
children: [
|
|
75051
|
-
/* @__PURE__ */ (0,
|
|
75052
|
-
/* @__PURE__ */ (0,
|
|
75053
|
-
/* @__PURE__ */ (0,
|
|
75054
|
-
/* @__PURE__ */ (0,
|
|
75327
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
|
|
75328
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
|
|
75329
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
|
|
75330
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
|
|
75055
75331
|
]
|
|
75056
75332
|
}
|
|
75057
75333
|
),
|
|
@@ -75064,10 +75340,10 @@ function NetworkGraph({
|
|
|
75064
75340
|
onClick: canvas.fit
|
|
75065
75341
|
}
|
|
75066
75342
|
),
|
|
75067
|
-
/* @__PURE__ */ (0,
|
|
75343
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75068
75344
|
IconButton_default,
|
|
75069
75345
|
{
|
|
75070
|
-
icon: /* @__PURE__ */ (0,
|
|
75346
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75071
75347
|
"svg",
|
|
75072
75348
|
{
|
|
75073
75349
|
viewBox: "0 0 24 24",
|
|
@@ -75076,7 +75352,7 @@ function NetworkGraph({
|
|
|
75076
75352
|
strokeWidth: 2,
|
|
75077
75353
|
strokeLinecap: "round",
|
|
75078
75354
|
"aria-hidden": "true",
|
|
75079
|
-
children: /* @__PURE__ */ (0,
|
|
75355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("path", { d: "M6 12h12" })
|
|
75080
75356
|
}
|
|
75081
75357
|
),
|
|
75082
75358
|
size: "xs",
|
|
@@ -75088,7 +75364,7 @@ function NetworkGraph({
|
|
|
75088
75364
|
onClick: () => canvas.zoomBy(0.8)
|
|
75089
75365
|
}
|
|
75090
75366
|
),
|
|
75091
|
-
/* @__PURE__ */ (0,
|
|
75367
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
75092
75368
|
"span",
|
|
75093
75369
|
{
|
|
75094
75370
|
className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
|
|
@@ -75099,7 +75375,7 @@ function NetworkGraph({
|
|
|
75099
75375
|
]
|
|
75100
75376
|
}
|
|
75101
75377
|
),
|
|
75102
|
-
/* @__PURE__ */ (0,
|
|
75378
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75103
75379
|
IconButton_default,
|
|
75104
75380
|
{
|
|
75105
75381
|
icon: "Add",
|
|
@@ -75112,7 +75388,7 @@ function NetworkGraph({
|
|
|
75112
75388
|
onClick: () => canvas.zoomBy(1.25)
|
|
75113
75389
|
}
|
|
75114
75390
|
),
|
|
75115
|
-
/* @__PURE__ */ (0,
|
|
75391
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75116
75392
|
IconButton_default,
|
|
75117
75393
|
{
|
|
75118
75394
|
icon: "Reset",
|
|
@@ -75130,18 +75406,18 @@ function NetworkGraph({
|
|
|
75130
75406
|
}
|
|
75131
75407
|
)
|
|
75132
75408
|
] }),
|
|
75133
|
-
!visibleNodes.length && /* @__PURE__ */ (0,
|
|
75409
|
+
!visibleNodes.length && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
|
|
75134
75410
|
]
|
|
75135
75411
|
}
|
|
75136
75412
|
),
|
|
75137
|
-
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0,
|
|
75413
|
+
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75138
75414
|
"div",
|
|
75139
75415
|
{
|
|
75140
75416
|
className: "min-w-0 shrink-0",
|
|
75141
75417
|
style: {
|
|
75142
75418
|
width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
|
|
75143
75419
|
},
|
|
75144
|
-
children: legendPanel ? /* @__PURE__ */ (0,
|
|
75420
|
+
children: legendPanel ? /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75145
75421
|
Panel_default,
|
|
75146
75422
|
{
|
|
75147
75423
|
variant: legendVariant === "auto" ? variant : legendVariant,
|
|
@@ -75160,8 +75436,8 @@ function NetworkGraph({
|
|
|
75160
75436
|
]
|
|
75161
75437
|
}
|
|
75162
75438
|
),
|
|
75163
|
-
/* @__PURE__ */ (0,
|
|
75164
|
-
/* @__PURE__ */ (0,
|
|
75439
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
|
|
75440
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
75165
75441
|
"p",
|
|
75166
75442
|
{
|
|
75167
75443
|
role: "status",
|
|
@@ -75374,6 +75650,7 @@ function NetworkGraph({
|
|
|
75374
75650
|
OTP_VARIANTS,
|
|
75375
75651
|
OrganizationChart,
|
|
75376
75652
|
PAGED_PANEL_LOADERS,
|
|
75653
|
+
PAGE_HEADER_VARIANTS,
|
|
75377
75654
|
PANEL_HERO_TITLE_ELEMENTS,
|
|
75378
75655
|
PANEL_HERO_VARIANTS,
|
|
75379
75656
|
PANEL_TONE_FOR_FIELD,
|
|
@@ -75388,6 +75665,7 @@ function NetworkGraph({
|
|
|
75388
75665
|
PROGRESS_MOTION_DIRECTIONS,
|
|
75389
75666
|
PROGRESS_MOTION_SPEEDS,
|
|
75390
75667
|
PT_KIT_CATALOG,
|
|
75668
|
+
PageBodyLayout,
|
|
75391
75669
|
PageHeader,
|
|
75392
75670
|
PagedPanel,
|
|
75393
75671
|
Panel,
|