@juv/codego-react-ui 3.3.0 → 3.3.3

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.
@@ -271,7 +271,7 @@ var CodegoUI = (() => {
271
271
  }
272
272
  console.error(error);
273
273
  };
274
- var Children = {
274
+ var Children2 = {
275
275
  map: mapChildren,
276
276
  forEach: function(children, forEachFunc, forEachContext) {
277
277
  mapChildren(
@@ -303,7 +303,7 @@ var CodegoUI = (() => {
303
303
  }
304
304
  };
305
305
  exports.Activity = REACT_ACTIVITY_TYPE;
306
- exports.Children = Children;
306
+ exports.Children = Children2;
307
307
  exports.Component = Component;
308
308
  exports.Fragment = REACT_FRAGMENT_TYPE;
309
309
  exports.Profiler = REACT_PROFILER_TYPE;
@@ -69673,15 +69673,16 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
69673
69673
  }
69674
69674
  function FieldRenderer({ field, value, onChange }) {
69675
69675
  if (field.render) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: field.render(value, onChange) });
69676
+ const toLabelValue = (o) => {
69677
+ if (typeof o === "string") return { label: o, value: o };
69678
+ if (Array.isArray(o)) return { label: o[0], value: o[1] };
69679
+ return o;
69680
+ };
69676
69681
  const strOptions = (field.options ?? []).map(
69677
- (o) => typeof o === "string" ? o : o.value
69678
- );
69679
- const comboOptions = (field.options ?? []).map(
69680
- (o) => typeof o === "string" ? { label: o, value: o } : o
69681
- );
69682
- const radioOptions = (field.options ?? []).map(
69683
- (o) => typeof o === "string" ? { label: o, value: o } : o
69682
+ (o) => typeof o === "string" ? o : Array.isArray(o) ? o[1] : o.value
69684
69683
  );
69684
+ const comboOptions = (field.options ?? []).map(toLabelValue);
69685
+ const radioOptions = (field.options ?? []).map(toLabelValue);
69685
69686
  switch (field.type) {
69686
69687
  case "textarea":
69687
69688
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Textarea, { value: value ?? "", onChange: (e) => onChange(e.target.value), placeholder: field.placeholder, rows: 3 });
@@ -70636,15 +70637,16 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
70636
70637
  }
70637
70638
  function DGFieldRenderer({ field, value, onChange }) {
70638
70639
  if (field.render) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: field.render(value, onChange) });
70640
+ const toLabelValue = (o) => {
70641
+ if (typeof o === "string") return { label: o, value: o };
70642
+ if (Array.isArray(o)) return { label: o[0], value: o[1] };
70643
+ return o;
70644
+ };
70639
70645
  const strOptions = (field.options ?? []).map(
70640
- (o) => typeof o === "string" ? o : o.value
70641
- );
70642
- const comboOptions = (field.options ?? []).map(
70643
- (o) => typeof o === "string" ? { label: o, value: o } : o
70644
- );
70645
- const radioOptions = (field.options ?? []).map(
70646
- (o) => typeof o === "string" ? { label: o, value: o } : o
70646
+ (o) => typeof o === "string" ? o : Array.isArray(o) ? o[1] : o.value
70647
70647
  );
70648
+ const comboOptions = (field.options ?? []).map(toLabelValue);
70649
+ const radioOptions = (field.options ?? []).map(toLabelValue);
70648
70650
  switch (field.type) {
70649
70651
  case "textarea":
70650
70652
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Textarea, { value: value ?? "", onChange: (e) => onChange(e.target.value), placeholder: field.placeholder, rows: 3 });
@@ -73801,7 +73803,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
73801
73803
  group.collapsible && "cursor-pointer hover:text-foreground"
73802
73804
  ),
73803
73805
  children: [
73804
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "flex-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: group.label }),
73806
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "flex-1 text-xs font-semibold uppercase tracking-wider text-primary/50 text-left", children: group.label }),
73805
73807
  group.collapsible && (isOpen ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChevronDown, { className: "h-3 w-3 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChevronRight, { className: "h-3 w-3 text-muted-foreground" }))
73806
73808
  ]
73807
73809
  }
@@ -74446,6 +74448,8 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
74446
74448
  // src/components/ui/panel.tsx
74447
74449
  var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
74448
74450
  var PanelCollapsedContext = React42.createContext(false);
74451
+ var PanelGroupsContext = React42.createContext({ expandedGroups: /* @__PURE__ */ new Set(), onGroupToggle: () => {
74452
+ } });
74449
74453
  function PanelThemeToggle() {
74450
74454
  const { theme, setTheme } = useTheme();
74451
74455
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
@@ -74472,15 +74476,109 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
74472
74476
  topbar,
74473
74477
  topbarTrailing,
74474
74478
  defaultCollapsed = false,
74479
+ collapsed: controlledCollapsed,
74480
+ onCollapsedChange,
74475
74481
  collapsible = false,
74476
74482
  showThemeToggle = false,
74477
74483
  defaultPage,
74484
+ currentPage: controlledPage,
74485
+ onPageChange,
74478
74486
  height = "h-[520px]",
74479
74487
  children,
74480
- className
74488
+ className,
74489
+ loading = false,
74490
+ emptyState,
74491
+ error = null,
74492
+ showGroupDividers = false,
74493
+ expandedGroups: controlledExpandedGroups,
74494
+ onGroupToggle,
74495
+ theme: themeProp,
74496
+ collapseIcon,
74497
+ expandIcon,
74498
+ meta,
74499
+ actions,
74500
+ keyboardNavigation = false,
74501
+ draggable = false,
74502
+ onSidebarReorder,
74503
+ animationDuration = 200,
74504
+ animationEasing = "ease-in-out",
74505
+ sidebarTooltip,
74506
+ mobileBreakpoint = 768,
74507
+ mobileCollapsed: controlledMobileCollapsed,
74508
+ onMobileCollapseChange
74481
74509
  }) {
74482
- const [collapsed, setCollapsed] = React42.useState(defaultCollapsed);
74483
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelCollapsedContext.Provider, { value: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
74510
+ const [internalCollapsed, setInternalCollapsed] = React42.useState(defaultCollapsed);
74511
+ const [internalPage, setInternalPage] = React42.useState(defaultPage || "");
74512
+ const [internalExpandedGroups, setInternalExpandedGroups] = React42.useState(
74513
+ new Set(controlledExpandedGroups)
74514
+ );
74515
+ const [isMobile, setIsMobile] = React42.useState(false);
74516
+ const [internalMobileCollapsed, setInternalMobileCollapsed] = React42.useState(true);
74517
+ const isCollapsed = controlledCollapsed !== void 0 ? controlledCollapsed : internalCollapsed;
74518
+ const currentPage = controlledPage !== void 0 ? controlledPage : internalPage;
74519
+ const expandedGroups = controlledExpandedGroups !== void 0 ? new Set(controlledExpandedGroups) : internalExpandedGroups;
74520
+ const mobileCollapsed = controlledMobileCollapsed !== void 0 ? controlledMobileCollapsed : internalMobileCollapsed;
74521
+ const handleCollapsedChange = (value) => {
74522
+ if (controlledCollapsed === void 0) setInternalCollapsed(value);
74523
+ onCollapsedChange?.(value);
74524
+ };
74525
+ const handlePageChange = (page) => {
74526
+ if (controlledPage === void 0) setInternalPage(page);
74527
+ onPageChange?.(page);
74528
+ };
74529
+ const handleGroupToggle = (title, expanded) => {
74530
+ if (controlledExpandedGroups === void 0) {
74531
+ setInternalExpandedGroups((prev) => {
74532
+ const next = new Set(prev);
74533
+ if (expanded) next.add(title);
74534
+ else next.delete(title);
74535
+ return next;
74536
+ });
74537
+ }
74538
+ onGroupToggle?.(title, expanded);
74539
+ };
74540
+ const handleMobileCollapseChange = (value) => {
74541
+ if (controlledMobileCollapsed === void 0) setInternalMobileCollapsed(value);
74542
+ onMobileCollapseChange?.(value);
74543
+ };
74544
+ React42.useEffect(() => {
74545
+ const handleResize = () => {
74546
+ const mobile = window.innerWidth < mobileBreakpoint;
74547
+ setIsMobile(mobile);
74548
+ if (mobile && !internalMobileCollapsed) {
74549
+ handleMobileCollapseChange(true);
74550
+ }
74551
+ };
74552
+ handleResize();
74553
+ window.addEventListener("resize", handleResize);
74554
+ return () => window.removeEventListener("resize", handleResize);
74555
+ }, [mobileBreakpoint, internalMobileCollapsed]);
74556
+ const handleKeyDown = React42.useCallback(
74557
+ (e) => {
74558
+ if (!keyboardNavigation) return;
74559
+ if (e.key === "Escape" && !isCollapsed && collapsible) {
74560
+ handleCollapsedChange(true);
74561
+ }
74562
+ if (e.key === "Enter" && isCollapsed && collapsible) {
74563
+ handleCollapsedChange(false);
74564
+ }
74565
+ },
74566
+ [keyboardNavigation, isCollapsed, collapsible]
74567
+ );
74568
+ React42.useEffect(() => {
74569
+ if (keyboardNavigation) {
74570
+ window.addEventListener("keydown", handleKeyDown);
74571
+ return () => window.removeEventListener("keydown", handleKeyDown);
74572
+ }
74573
+ }, [keyboardNavigation, handleKeyDown]);
74574
+ const effectiveCollapsed = isMobile ? mobileCollapsed : isCollapsed;
74575
+ const animStyle = {
74576
+ transitionDuration: `${animationDuration}ms`,
74577
+ transitionTimingFunction: animationEasing
74578
+ };
74579
+ const hasContent = React42.Children.count(children) > 0;
74580
+ const showEmpty = !loading && !hasContent && emptyState;
74581
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelCollapsedContext.Provider, { value: effectiveCollapsed, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelGroupsContext.Provider, { value: { expandedGroups, onGroupToggle: handleGroupToggle }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
74484
74582
  "div",
74485
74583
  {
74486
74584
  className: cn(
@@ -74488,6 +74586,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
74488
74586
  height,
74489
74587
  className
74490
74588
  ),
74589
+ style: { ...animStyle },
74491
74590
  children: [
74492
74591
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "pointer-events-none absolute inset-0 overflow-hidden", children: [
74493
74592
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "absolute -top-[40%] -left-[20%] h-[80%] w-[60%] rounded-full bg-primary/10 blur-[120px]" }),
@@ -74497,42 +74596,61 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
74497
74596
  "aside",
74498
74597
  {
74499
74598
  className: cn(
74500
- "relative z-10 flex flex-col shrink-0 border-r border-border transition-all duration-200",
74501
- collapsed ? "w-14" : sidebarWidth
74599
+ "relative z-10 flex flex-col shrink-0 border-r border-border transition-all",
74600
+ effectiveCollapsed ? "w-14" : sidebarWidth
74502
74601
  ),
74602
+ style: { transitionDuration: `${animationDuration}ms`, transitionTimingFunction: animationEasing },
74503
74603
  children: [
74504
- (sidebarBrand || sidebarHeader) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn(
74505
- "shrink-0 border-b border-border",
74506
- collapsed ? "flex items-center justify-center py-3" : "flex items-center gap-2 px-4 py-3"
74507
- ), children: sidebarBrand ? collapsed ? sidebarBrand.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarBrand.image, alt: "logo", className: "h-7 w-7 rounded-md object-cover shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarBrand.icon }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
74508
- sidebarBrand.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarBrand.image, alt: "logo", className: "h-7 w-7 rounded-md object-cover shrink-0" }) : sidebarBrand.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarBrand.icon }),
74509
- sidebarBrand.title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "flex-1 truncate text-sm font-semibold", children: sidebarBrand.title }),
74510
- sidebarBrand.trailing && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarBrand.trailing })
74511
- ] }) : !collapsed && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-sm font-semibold", children: sidebarHeader }) }),
74604
+ (sidebarBrand || sidebarHeader) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
74605
+ "div",
74606
+ {
74607
+ className: cn(
74608
+ "shrink-0 border-b border-border",
74609
+ effectiveCollapsed ? "flex items-center justify-center py-3" : "flex items-center gap-2 px-4 py-3"
74610
+ ),
74611
+ children: sidebarBrand ? effectiveCollapsed ? sidebarBrand.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarBrand.image, alt: "logo", className: "h-7 w-7 rounded-md object-cover shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarBrand.icon }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
74612
+ sidebarBrand.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarBrand.image, alt: "logo", className: "h-7 w-7 rounded-md object-cover shrink-0" }) : sidebarBrand.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarBrand.icon }),
74613
+ sidebarBrand.title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "flex-1 truncate text-sm font-semibold", children: sidebarBrand.title }),
74614
+ sidebarBrand.trailing && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarBrand.trailing })
74615
+ ] }) : !effectiveCollapsed && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-sm font-semibold", children: sidebarHeader })
74616
+ }
74617
+ ),
74512
74618
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex-1 overflow-y-auto py-2", children: sidebar }),
74513
- (sidebarProfile || sidebarFooter) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn(
74514
- "shrink-0 border-t border-border",
74515
- collapsed ? "flex items-center justify-center py-3" : "px-4 py-3"
74516
- ), children: sidebarProfile ? collapsed ? sidebarProfile.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarProfile.image, alt: "profile", className: "h-7 w-7 rounded-full object-cover shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarProfile.icon }) : sidebarProfile.content ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center gap-2", children: sidebarProfile.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarProfile.image, alt: "profile", className: "h-7 w-7 rounded-full object-cover shrink-0" }) : sidebarProfile.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarProfile.icon }) }) : !collapsed && sidebarFooter })
74619
+ (sidebarProfile || sidebarFooter) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
74620
+ "div",
74621
+ {
74622
+ className: cn(
74623
+ "shrink-0 border-t border-border",
74624
+ effectiveCollapsed ? "flex items-center justify-center py-3" : "px-4 py-3"
74625
+ ),
74626
+ children: sidebarProfile ? effectiveCollapsed ? sidebarProfile.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarProfile.image, alt: "profile", className: "h-7 w-7 rounded-full object-cover shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarProfile.icon }) : sidebarProfile.content ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center gap-2", children: sidebarProfile.image ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: sidebarProfile.image, alt: "profile", className: "h-7 w-7 rounded-full object-cover shrink-0" }) : sidebarProfile.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "shrink-0", children: sidebarProfile.icon }) }) : !effectiveCollapsed && sidebarFooter
74627
+ }
74628
+ )
74517
74629
  ]
74518
74630
  }
74519
74631
  ),
74520
74632
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "relative z-10 flex flex-1 min-w-0 flex-col", children: [
74521
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "flex h-14 shrink-0 items-center justify-between border-b glass px-4 gap-2", children: [
74633
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "flex h-14 shrink-0 items-center justify-between border-b border-b-slate-300/50 px-4 gap-2", children: [
74522
74634
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2", children: [
74523
74635
  collapsible && sidebar && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
74524
74636
  Tooltip,
74525
74637
  {
74526
- content: collapsed ? "Expand sidebar" : "Collapse sidebar",
74638
+ content: effectiveCollapsed ? "Expand sidebar" : "Collapse sidebar",
74527
74639
  side: "bottom",
74528
74640
  children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
74529
74641
  "button",
74530
74642
  {
74531
74643
  type: "button",
74532
- onClick: () => setCollapsed((c) => !c),
74644
+ onClick: () => {
74645
+ if (isMobile) {
74646
+ handleMobileCollapseChange(!mobileCollapsed);
74647
+ } else {
74648
+ handleCollapsedChange(!isCollapsed);
74649
+ }
74650
+ },
74533
74651
  className: "text-muted-foreground hover:text-foreground transition-colors",
74534
- "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
74535
- children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelLeftOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelLeftClose, { className: "h-5 w-5" })
74652
+ "aria-label": effectiveCollapsed ? "Expand sidebar" : "Collapse sidebar",
74653
+ children: effectiveCollapsed ? expandIcon || /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelLeftOpen, { className: "h-5 w-5" }) : collapseIcon || /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelLeftClose, { className: "h-5 w-5" })
74536
74654
  }
74537
74655
  )
74538
74656
  }
@@ -74544,11 +74662,16 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
74544
74662
  showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PanelThemeToggle, {})
74545
74663
  ] })
74546
74664
  ] }),
74547
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("main", { className: "flex-1 overflow-y-auto p-4", children })
74665
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("main", { className: "flex-1 overflow-y-auto p-4", children: [
74666
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "mb-4 p-3 rounded-md bg-destructive/50 text-destructive text-sm", children: error }),
74667
+ loading && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LoaderCircle, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }),
74668
+ showEmpty && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: emptyState }),
74669
+ !loading && !showEmpty && children
74670
+ ] })
74548
74671
  ] })
74549
74672
  ]
74550
74673
  }
74551
- ) });
74674
+ ) }) });
74552
74675
  }
74553
74676
  function PanelSidebarItem({
74554
74677
  icon: Icon2,
@@ -74579,10 +74702,20 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
74579
74702
  children
74580
74703
  }) {
74581
74704
  const collapsed = React42.useContext(PanelCollapsedContext);
74705
+ const { expandedGroups, onGroupToggle } = React42.useContext(PanelGroupsContext);
74706
+ const isExpanded = title ? expandedGroups.has(title) : true;
74582
74707
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "px-2 py-1", children: [
74583
- title && !collapsed && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
74708
+ title && !collapsed && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
74709
+ "button",
74710
+ {
74711
+ type: "button",
74712
+ onClick: () => onGroupToggle(title, !isExpanded),
74713
+ className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground hover:text-foreground transition-colors w-full text-left",
74714
+ children: title
74715
+ }
74716
+ ),
74584
74717
  title && collapsed && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "mx-1 mb-1 h-px bg-border" }),
74585
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("main", { className: "space-y-0.5", children })
74718
+ (!title || isExpanded) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("main", { className: "space-y-0.5", children })
74586
74719
  ] });
74587
74720
  }
74588
74721