@sybilion/uilib 1.4.12 → 1.4.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.
Files changed (30) hide show
  1. package/dist/esm/components/ui/Button/Button.styl.js +1 -1
  2. package/dist/esm/components/ui/Sidebar/Sidebar.js +21 -7
  3. package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +2 -2
  4. package/dist/esm/components/ui/SmartTextTruncate/SmartTextTruncate.js +260 -67
  5. package/dist/esm/components/ui/SmartTextTruncate/SmartTextTruncate.styl.js +7 -0
  6. package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.js +5 -5
  7. package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl.js +2 -2
  8. package/dist/esm/index.js +1 -1
  9. package/dist/esm/types/src/components/ui/Chat/ChatSheet/ChatSheet.d.ts +1 -1
  10. package/dist/esm/types/src/components/ui/Sidebar/Sidebar.d.ts +9 -2
  11. package/dist/esm/types/src/components/ui/SmartTextTruncate/SmartTextTruncate.d.ts +5 -3
  12. package/dist/esm/types/src/components/ui/SmartTextTruncate/index.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/src/components/ui/Button/Button.styl +2 -2
  15. package/src/components/ui/Chat/ChatSheet/ChatSheet.tsx +1 -1
  16. package/src/components/ui/Sidebar/Sidebar.styl +63 -49
  17. package/src/components/ui/Sidebar/Sidebar.styl.d.ts +4 -0
  18. package/src/components/ui/Sidebar/Sidebar.tsx +78 -6
  19. package/src/components/ui/SmartTextTruncate/SmartTextTruncate.styl +34 -0
  20. package/src/components/ui/SmartTextTruncate/SmartTextTruncate.styl.d.ts +10 -0
  21. package/src/components/ui/SmartTextTruncate/SmartTextTruncate.tsx +335 -81
  22. package/src/components/ui/SmartTextTruncate/index.ts +5 -1
  23. package/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl +0 -24
  24. package/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl.d.ts +0 -2
  25. package/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.tsx +5 -11
  26. package/src/docs/components/DocsSidebar/DocsSidebar.tsx +17 -25
  27. package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +4 -1
  28. package/src/docs/pages/SmartTextTruncatePage.styl +13 -3
  29. package/src/docs/pages/SmartTextTruncatePage.styl.d.ts +2 -1
  30. package/src/docs/pages/SmartTextTruncatePage.tsx +16 -2
@@ -1,6 +1,6 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = ".Button_root__NT88y{align-items:center;border:0;border-radius:var(--radius-button);cursor:pointer;display:inline-flex;flex-shrink:0;font-family:Manrope,sans-serif;font-size:15px;font-weight:500;gap:10px;justify-content:center;line-height:1;outline:none;transition:all var(--dur-base) var(--ease-standard);white-space:nowrap}.Button_root__NT88y:active{opacity:.8}.Button_root__NT88y:disabled{opacity:.5;pointer-events:none}.Button_root__NT88y:focus-visible{border-color:var(--ring);ring:3px var(--ring-50)}.Button_root__NT88y[aria-invalid=true]{border-color:var(--destructive);ring:3px var(--destructive-200)}.Button_root__NT88y svg{flex-shrink:0;pointer-events:none}.Button_default__xZ4lt{background-color:var(--primary);color:var(--primary-foreground)}.Button_default__xZ4lt:hover{background-color:var(--sb-gray-800)}.dark .Button_default__xZ4lt:hover{background-color:var(--sb-gray-600)}.Button_destructive__g1Ume{background-color:var(--destructive-900);color:#fff}.Button_destructive__g1Ume:hover{background-color:var(--destructive-600)}.Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-200)}.dark .Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-400)}.Button_outline__E4R5l{background-color:var(--background);border:1px solid var(--border)}.Button_outline__E4R5l:hover{background-color:var(--sb-gray-50);border-color:var(--border)}.dark .Button_outline__E4R5l{background-color:var(--sb-gray-900);border-color:var(--border)}.dark .Button_outline__E4R5l:hover{background-color:var(--sb-gray-800)}.Button_secondary__ptn3U{background-color:var(--secondary);color:var(--secondary-foreground)}.Button_secondary__ptn3U:hover{background-color:var(--secondary-800)}.Button_ghost__okHgV:hover{background-color:var(--sb-gray-100);color:var(--foreground)}.dark .Button_ghost__okHgV:hover{background-color:var(--sb-gray-900)}.Button_link__yHy2o{color:var(--primary);text-decoration:underline;text-underline-offset:4px}.Button_link__yHy2o:hover{text-decoration:underline}.Button_sizeSm__skgOG{border-radius:var(--p-5);font-size:13px;height:30px;padding:0 14px}.Button_sizeMd__7MeqU{border-radius:var(--p-4);height:44px;padding:0 var(--p-4)}.Button_sizeLg__Xfon-{border-radius:var(--p-4);font-size:var(--text-base);height:48px;padding:0 var(--p-6)}.Button_sizeIcon__9ef49{padding:0}.Button_sizeIcon__9ef49.Button_sizeSm__skgOG{padding:0;width:30px}.Button_sizeIcon__9ef49.Button_sizeMd__7MeqU{padding:0;width:44px}.Button_sizeIcon__9ef49.Button_sizeLg__Xfon-{padding:0;width:48px}";
3
+ var css_248z = ".Button_root__NT88y{align-items:center;border:0;border-radius:var(--radius-button);cursor:pointer;display:inline-flex;flex-shrink:0;font-family:Manrope,sans-serif;font-size:15px;font-weight:500;gap:var(--p-2);justify-content:center;line-height:1;outline:none;transition:all var(--dur-base) var(--ease-standard);white-space:nowrap}.Button_root__NT88y:active{opacity:.8}.Button_root__NT88y:disabled{opacity:.5;pointer-events:none}.Button_root__NT88y:focus-visible{border-color:var(--ring);ring:3px var(--ring-50)}.Button_root__NT88y[aria-invalid=true]{border-color:var(--destructive);ring:3px var(--destructive-200)}.Button_root__NT88y svg{flex-shrink:0;pointer-events:none}.Button_default__xZ4lt{background-color:var(--primary);color:var(--primary-foreground)}.Button_default__xZ4lt:hover{background-color:var(--sb-gray-800)}.dark .Button_default__xZ4lt:hover{background-color:var(--sb-gray-600)}.Button_destructive__g1Ume{background-color:var(--destructive-900);color:#fff}.Button_destructive__g1Ume:hover{background-color:var(--destructive-600)}.Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-200)}.dark .Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-400)}.Button_outline__E4R5l{background-color:var(--background);border:1px solid var(--border)}.Button_outline__E4R5l:hover{background-color:var(--sb-gray-50);border-color:var(--border)}.dark .Button_outline__E4R5l{background-color:var(--sb-gray-900);border-color:var(--border)}.dark .Button_outline__E4R5l:hover{background-color:var(--sb-gray-800)}.Button_secondary__ptn3U{background-color:var(--secondary);color:var(--secondary-foreground)}.Button_secondary__ptn3U:hover{background-color:var(--secondary-800)}.Button_ghost__okHgV:hover{background-color:var(--sb-gray-100);color:var(--foreground)}.dark .Button_ghost__okHgV:hover{background-color:var(--sb-gray-900)}.Button_link__yHy2o{color:var(--primary);text-decoration:underline;text-underline-offset:4px}.Button_link__yHy2o:hover{text-decoration:underline}.Button_sizeSm__skgOG{border-radius:var(--p-5);font-size:var(--text-sm);height:30px;padding:0 14px}.Button_sizeMd__7MeqU{border-radius:var(--p-4);height:44px;padding:0 var(--p-4)}.Button_sizeLg__Xfon-{border-radius:var(--p-4);font-size:var(--text-base);height:48px;padding:0 var(--p-6)}.Button_sizeIcon__9ef49{padding:0}.Button_sizeIcon__9ef49.Button_sizeSm__skgOG{padding:0;width:30px}.Button_sizeIcon__9ef49.Button_sizeMd__7MeqU{padding:0;width:44px}.Button_sizeIcon__9ef49.Button_sizeLg__Xfon-{padding:0;width:48px}";
4
4
  var S = {"root":"Button_root__NT88y","default":"Button_default__xZ4lt","destructive":"Button_destructive__g1Ume","outline":"Button_outline__E4R5l","secondary":"Button_secondary__ptn3U","ghost":"Button_ghost__okHgV","link":"Button_link__yHy2o","sizeSm":"Button_sizeSm__skgOG","sizeMd":"Button_sizeMd__7MeqU","sizeLg":"Button_sizeLg__Xfon-","sizeIcon":"Button_sizeIcon__9ef49"};
5
5
  styleInject(css_248z);
6
6
 
@@ -1,10 +1,11 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import cn from 'classnames';
3
3
  import { createContext, useContext, useMemo, useState, useRef, useCallback, useLayoutEffect, useEffect } from 'react';
4
4
  import { Button } from '../Button/Button.js';
5
5
  import { Logo } from '../Logo/Logo.js';
6
6
  import { Separator } from '../Separator/Separator.js';
7
7
  import { Sheet, SheetContent } from '../Sheet/Sheet.js';
8
+ import { notifyPanelWidthDragStart, notifyPanelWidthDragEnd, SmartTextTruncate } from '../SmartTextTruncate/SmartTextTruncate.js';
8
9
  import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
9
10
  import { clampSidebarWidthPx, CHAT_WIDTH_STORAGE_KEY, clampChatWidthPx, shellFitsSidebarsLayout, SIDEBAR_WIDTH_DEFAULT_PX, SIDEBAR_WIDTH_MIN_PX, SIDEBAR_WIDTH_STORAGE_KEY_PX, SIDEBAR_WIDTH_STORAGE_KEY_PCT, CHAT_WIDTH_DEFAULT_PX, CHAT_WIDTH_MIN_PX, defaultChatWidthPx } from '../../../hooks/panelWidth.js';
10
11
  import useElemDrag from '../../../hooks/useDragElem.js';
@@ -15,7 +16,7 @@ import { setCookie, getCookie } from '../../../lib/cookie.js';
15
16
  import { getCookiePreferences } from '../../../lib/cookie-consent/cookie-consent.js';
16
17
  import { LS, Scroll } from '@homecode/ui';
17
18
  import { Slot } from '@radix-ui/react-slot';
18
- import { PanelLeft } from 'lucide-react';
19
+ import { PanelLeft, ChevronRight } from 'lucide-react';
19
20
  import SidebarStem from './Sidebar.styl.js';
20
21
 
21
22
  const SIDEBAR_WIDTH_MOBILE = '18rem';
@@ -133,8 +134,15 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
133
134
  chatPanelOpen: chatPanelOpenRef.current,
134
135
  chatWidthPx: chatWidthRef.current,
135
136
  });
137
+ sidebarWidthRef.current = next;
138
+ // Live drag: update CSS var only — avoid re-rendering the whole nav tree each frame.
139
+ if (wrapperRef.current) {
140
+ wrapperRef.current.style.setProperty('--sidebar-width', `${next}px`);
141
+ }
142
+ if (!persist)
143
+ return;
136
144
  _setSidebarWidthPx(next);
137
- if (persist && allowPersistSidebarWidth) {
145
+ if (allowPersistSidebarWidth) {
138
146
  LS.set(sidebarLsKey, next);
139
147
  }
140
148
  }, [getShellWidth, sidebarLsKey, allowPersistSidebarWidth]);
@@ -411,6 +419,7 @@ function PanelResizeHandle({ className, edge, isActive, startWidthPx, getShellWi
411
419
  const startWidthRef = useRef(0);
412
420
  const lastRawRef = useRef(0);
413
421
  const handleDrag = useCallback((delta) => {
422
+ notifyPanelWidthDragStart();
414
423
  const shellW = getShellWidth();
415
424
  if (shellW <= 0)
416
425
  return;
@@ -427,6 +436,7 @@ function PanelResizeHandle({ className, edge, isActive, startWidthPx, getShellWi
427
436
  }, [startWidthPx]);
428
437
  const handleDragEnd = useCallback((e) => {
429
438
  onDragComplete?.(lastRawRef.current);
439
+ notifyPanelWidthDragEnd();
430
440
  try {
431
441
  handleRef.current?.releasePointerCapture(e.pointerId);
432
442
  }
@@ -488,8 +498,12 @@ function SidebarMenu({ className, ...props }) {
488
498
  function SidebarMenuItem({ className, ...props }) {
489
499
  return (jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn(SidebarStem.sidebarMenuItem, className), ...props }));
490
500
  }
491
- function SidebarMenuButton({ asChild = false, isActive = false, variant = 'ghost', size = 'sm', className, ...props }) {
492
- return (jsx(Button, { asChild: asChild, variant: variant, size: size, "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-active": isActive, className: cn(variant === 'default' ? SidebarStem.sidebarMenuButtonCta : SidebarStem.sidebarMenuButton, SidebarStem[`size-${size}`], className), ...props }));
501
+ function SidebarMenuButton({ asChild = false, isActive = false, hasSubItems = false, isExpanded = false, variant = 'ghost', size = 'sm', className, icon, children, addon, ...props }) {
502
+ const effectiveAsChild = asChild && !hasSubItems;
503
+ const label = (jsx(SmartTextTruncate, { className: SidebarStem.sidebarMenuButtonLabel, children: children }));
504
+ const chevron = hasSubItems ? (jsx("span", { className: cn(SidebarStem.sidebarMenuButtonChevron, isExpanded && SidebarStem.expanded), "aria-hidden": "true", children: jsx(ChevronRight, { size: 16 }) })) : null;
505
+ const userContent = (jsxs(Fragment, { children: [label, addon] }));
506
+ return (jsxs(Button, { asChild: effectiveAsChild, variant: variant, size: size, "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-active": isActive, "aria-expanded": hasSubItems ? isExpanded : undefined, className: cn(variant === 'default' ? SidebarStem.sidebarMenuButtonCta : SidebarStem.sidebarMenuButton, SidebarStem[`size-${size}`], className), ...props, children: [icon, effectiveAsChild ? (userContent) : (jsxs(Fragment, { children: [userContent, chevron] }))] }));
493
507
  }
494
508
  function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
495
509
  const Comp = asChild ? Slot : 'button';
@@ -504,7 +518,7 @@ function SidebarMenuSub({ className, ...props }) {
504
518
  function SidebarMenuSubItem({ className, ...props }) {
505
519
  return (jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn(SidebarStem.sidebarMenuSubItem, className), ...props }));
506
520
  }
507
- function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, tooltip, className, onClick, ...props }) {
521
+ function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, tooltip, className, onClick, children, addon, ...props }) {
508
522
  const Comp = asChild ? Slot : 'a';
509
523
  const { isOpen } = useSidebarState();
510
524
  const { setOpen } = useSidebarActions();
@@ -514,7 +528,7 @@ function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false,
514
528
  setOpen(false);
515
529
  onClick?.(event);
516
530
  };
517
- const button = (jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn(SidebarStem.sidebarMenuSubButton, SidebarStem[`size-${size}`], className), onClick: handleClick, ...props }));
531
+ const button = (jsxs(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn(SidebarStem.sidebarMenuSubButton, SidebarStem[`size-${size}`], className), onClick: handleClick, ...props, children: [jsx(SmartTextTruncate, { className: SidebarStem.sidebarMenuSubButtonLabel, children: children }), addon] }));
518
532
  if (!tooltip)
519
533
  return button;
520
534
  if (typeof tooltip === 'string') {
@@ -1,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.Sidebar_sidebarWrapper__DGm4P{align-items:stretch;display:flex;flex-direction:row;height:100%;min-height:0;width:100%}.Sidebar_sidebarWrapper__DGm4P #page-sidebar-actions{min-height:100%}@media (max-width:768px){.Sidebar_sidebarWrapper__DGm4P{flex-direction:column;height:100dvh;max-height:100dvh}}.Sidebar_sidebarMainShell__pSWDC{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0}.Sidebar_chatPanelMount__1Zctx{background:var(--background);border-left:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-width,0px);min-height:0;min-width:0;overflow:hidden;width:0;width:var(--chat-panel-width,0)}@media (max-width:768px){.Sidebar_chatPanelMount__1Zctx{border-left:none;border-top:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-height,0px);height:0;height:var(--chat-panel-height,0);transition:flex-basis .2s ease,height .2s ease;width:100%}}.Sidebar_sidebar__0vqNZ{height:0;position:fixed;--top-offset:-10px;--gap-top:calc(var(--header-height) + var(--top-offset));align-self:flex-start;color:var(--sidebar-foreground);display:none;flex-direction:column;top:calc(var(--gap-top));top:calc(var(--gap-top) + var(--app-banner-height, 0px));width:var(--sidebar-width)}@media (min-width:768px){.Sidebar_sidebar__0vqNZ[data-state=expanded]{display:flex;height:calc(100vh - var(--gap-top));height:calc(100vh - var(--gap-top) - var(--app-banner-height, 0px));min-height:0}}.Sidebar_sidebar__0vqNZ[data-collapsible=offcanvas]{overflow:hidden;padding:0;width:0}.Sidebar_sidebarTrigger__ipx2C{cursor:pointer;margin-left:calc(var(--p-4)*-1);width:var(--p-5)}.Sidebar_sidebarTrigger__ipx2C svg{height:20px;width:20px}.Sidebar_sidebarRail__uvSpl{position:absolute;inset-y:0;display:hidden;transition:all ease-out;width:1rem;z-index:20}.Sidebar_sidebarRail__uvSpl:hover:after{background-color:var(--sidebar-border)}.Sidebar_sidebarRail__uvSpl[data-side=left]{right:-1rem}.Sidebar_sidebarRail__uvSpl[data-side=right]{left:0}.Sidebar_sidebarRail__uvSpl:after{content:\"\";position:absolute;inset-y:0;left:50%;width:2px}@media (min-width:640px){.Sidebar_sidebarRail__uvSpl{display:flex}}.Sidebar_sidebarRail__uvSpl[data-side=left]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-side=left][data-state=collapsed],.Sidebar_sidebarRail__uvSpl[data-side=right]{cursor:e-resize}.Sidebar_sidebarRail__uvSpl[data-side=right][data-state=collapsed]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]{transform:translateX(0)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:hover{background-color:var(--sidebar)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:after{left:100%}.Sidebar_sidebarRail__uvSpl[data-side=left][data-collapsible=offcanvas]{right:-.5rem}.Sidebar_sidebarRail__uvSpl[data-side=right][data-collapsible=offcanvas]{left:-.5rem}.Sidebar_sidebarResizeHandle__kuD6t{background-color:transparent;background-color:var(--page-color);border-radius:2.5px;height:calc(100vh + 200px);height:calc(100vh + 200px - var(--app-banner-height, 0px));opacity:0;position:absolute;top:-200px;touch-action:none;transition:opacity .15s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5px;z-index:30}.Sidebar_sidebarResizeHandle__kuD6t:before{content:\"\";cursor:col-resize;height:100%;position:absolute;right:0;width:30px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=left]{right:2px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=right]{left:0}.Sidebar_sidebarResizeHandle__kuD6t:hover{opacity:1}.Sidebar_sidebarResizeHandle__kuD6t:active{opacity:0}.Sidebar_fullHeightResizer__jZXnw .Sidebar_sidebarResizeHandle__kuD6t{height:calc(100vh - var(--gap-top)*-1);height:calc(100vh - var(--gap-top)*-1 - var(--app-banner-height, 0px));top:-80px}.Sidebar_sidebarInput__ujQLX{background-color:var(--background);box-shadow:none;height:2rem;width:100%}.Sidebar_sidebarFooter__V3O-l,.Sidebar_sidebarHeader__X33ii{display:flex;flex-direction:column;gap:0;padding:0}.Sidebar_sidebarSeparator__oUkYG{background-color:var(--sidebar-border);margin-left:0;margin-right:0;width:auto}.Sidebar_sidebarContent__Ywe1o{display:flex;flex:1;flex-direction:column;gap:var(--p-16);height:100vh;max-height:100%;min-height:0;overflow:auto;position:absolute;width:100%}@media (min-width:768px){.Sidebar_sidebarContent__Ywe1o{height:calc(100vh - var(--gap-top));height:calc(100vh - var(--gap-top) - var(--app-banner-height, 0px))}}.Sidebar_sidebarContent__Ywe1o[data-collapsible=icon]{overflow:hidden}.Sidebar_sidebarGroup__7Mhg2{display:flex;flex-direction:column;min-width:0;padding:40px 0 0;position:relative;width:100%}.Sidebar_sidebarGroupAction__OhVZq{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;justify-content:center;outline:none;padding:0;position:absolute;right:.75rem;top:.875rem;transition:transform;width:1.25rem}.Sidebar_sidebarGroupAction__OhVZq:hover{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarGroupAction__OhVZq:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarGroupAction__OhVZq>svg{flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarGroupAction__OhVZq:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarGroupAction__OhVZq:after{display:none}}.Sidebar_sidebarGroupAction__OhVZq[data-collapsible=icon]{display:none}.Sidebar_sidebarMenu__hYXIo{display:flex;flex-direction:column;gap:var(--p-4);list-style:none;min-width:0;padding:0 var(--p-11) var(--p-10) var(--p-8);width:100%}@media (max-width:768px){.Sidebar_sidebarMenu__hYXIo{padding-right:var(--p-8)}}.Sidebar_sidebarMenuItem__CRhM8{cursor:pointer;position:relative}.Sidebar_sidebarMenuBadge__ttvCR{align-items:center;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;font-size:.75rem;font-weight:500;height:1.25rem;justify-content:center;min-width:1.25rem;padding-left:.25rem;padding-right:.25rem;pointer-events:none;position:absolute;right:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Sidebar_sidebarMenuBadge__ttvCR[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=md]{top:.375rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuBadge__ttvCR[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSkeleton__u2KoI{align-items:center;border-radius:.375rem;display:flex;gap:.5rem;height:2rem;padding-left:.5rem;padding-right:.5rem}.Sidebar_sidebarMenuSkeletonIcon__-1tvv{border-radius:.375rem;height:1rem;width:1rem}.Sidebar_sidebarMenuSkeletonText__dWzWo{flex:1;height:1rem;max-width:var(--skeleton-width)}.Sidebar_sidebarMenuSub__gh8Rn{border-color:var(--sidebar-border);border-left:none;display:flex;flex-direction:column;gap:var(--p-2);list-style:none;margin-left:0;margin-right:0;min-width:0;padding:0;padding-top:var(--p-1);position:relative;transform:translateX(1px)}.Sidebar_sidebarMenuSub__gh8Rn:before{background:var(--sidebar-border);bottom:26px;content:\"\";left:var(--p-5);pointer-events:none;position:absolute;top:0;width:1px}.Sidebar_sidebarMenuSub__gh8Rn[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubItem__fTHJa{margin-left:var(--p-6);min-width:0;position:relative}.Sidebar_sidebarMenuSubItem__fTHJa:before{border-bottom:1px solid var(--sidebar-border);border-bottom-left-radius:var(--p-2);border-left:1px solid var(--sidebar-border);bottom:0;content:\"\";height:var(--p-3);left:calc(var(--p-1)*-1);position:absolute;top:var(--p-2);width:var(--p-3)}.Sidebar_sidebarMenuSubItem__fTHJa a:hover{text-decoration:none}.Sidebar_sheetContentSidebar__cM2h2{color:var(--sidebar-foreground);padding:0;width:var(--sidebar-width)}.Sidebar_sheetContentSidebar__cM2h2>button{display:none}@media (max-width:768px){.Sidebar_sheetContentSidebar__cM2h2{z-index:100}}.Sidebar_sheetSidebarLogo__eGVDC{flex-shrink:0;padding:var(--p-6) var(--p-8) var(--p-2);position:relative}.Sidebar_sheetSidebarInner__U-SMQ{background-color:var(--sidebar);display:flex;flex-direction:column;height:100%;width:100%}.Sidebar_sheetSidebarInner__U-SMQ .Sidebar_sidebarContent__Ywe1o{flex:1;height:auto;max-height:none;min-height:0;position:relative}.Sidebar_sidebarNone__crRsF{color:var(--sidebar-foreground);display:flex;flex-direction:column;height:100%;width:var(--sidebar-width)}.Sidebar_variant-floating__-qvkJ{padding:.5rem}.Sidebar_variant-floating__-qvkJ[data-collapsible=icon],.Sidebar_variant-inset__oTfrV[data-collapsible=icon]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.Sidebar_variant-sidebar__fAe77[data-collapsible=icon]{width:var(--sidebar-width-icon)}.Sidebar_variant-sidebar__fAe77[data-side=left]{border-right:1px solid #e5e7eb}.Sidebar_variant-sidebar__fAe77[data-side=right]{border-left:1px solid #e5e7eb}.Sidebar_sidebarMenuButton__vIEh->span,.Sidebar_sidebarMenuSubButton__c9flh>span{min-width:0;text-transform:capitalize}.Sidebar_sidebarMenuButton__vIEh->span:first-child,.Sidebar_sidebarMenuSubButton__c9flh>span:first-child{flex-grow:1}.Sidebar_sidebarMenuButton__vIEh-{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;font-size:.875rem;gap:var(--p-2);justify-content:flex-start;outline:none;overflow:hidden;padding:var(--p-6) var(--p-3);text-align:left;text-decoration:none;transition:all;width:100%}.Sidebar_sidebarMenuButton__vIEh-:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuButton__vIEh-:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa[data-state=open] .Sidebar_sidebarMenuButton__vIEh-{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButton__vIEh-:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuButton__vIEh-:disabled,.Sidebar_sidebarMenuButton__vIEh-[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuButton__vIEh-[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground);font-weight:500}.Sidebar_sidebarMenuButton__vIEh-[data-collapsible=icon]{height:2rem!important;padding:.5rem!important;width:2rem!important}.Sidebar_sidebarMenuButton__vIEh->span{flex-grow:1;line-height:20px;overflow:hidden;white-space:nowrap}.Sidebar_sidebarMenuButton__vIEh->svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-sm__7aIbu{font-size:.75rem;height:1.75rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-md__rcjmO{font-size:.875rem;height:var(--p-12)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S{font-size:.875rem;height:3rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S[data-collapsible=icon]{padding:0!important}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz{background-color:var(--background);box-shadow:0 0 0 1px var(--sidebar-border)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz:hover{background-color:var(--sidebar-accent);box-shadow:0 0 0 1px var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButtonCta__dQAhv{display:flex;justify-content:flex-start;text-align:left;width:100%}.Sidebar_sidebarMenuButtonCta__dQAhv>svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuAction__mFZa1{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);cursor:pointer;display:flex;justify-content:center;opacity:0;outline:none;padding:0;position:absolute;right:var(--p-2);top:var(--p-2);transition:transform;width:1.25rem}.Sidebar_sidebarMenuAction__mFZa1:before{background-image:linear-gradient(to left,var(--sidebar-accent) 70%,transparent 100%);content:\"\";height:100%;pointer-events:none;position:absolute;right:0;transition:opacity .2s ease-in-out;width:calc(100% + var(--p-4))}.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuAction__mFZa1{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuAction__mFZa1>svg{flex-shrink:0;height:1rem;opacity:.5;pointer-events:none;transition:opacity .2s ease-in-out;width:1rem;z-index:1}.Sidebar_sidebarMenuAction__mFZa1:hover>svg{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1:after{display:none}}.Sidebar_sidebarMenuAction__mFZa1[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=md]{top:.375rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuAction__mFZa1[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-active=true]{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-state=open]{opacity:1}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA{opacity:0}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:focus-within,.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:hover{opacity:1}}.Sidebar_sidebarMenuSubButton__c9flh{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;gap:var(--p-1);height:var(--p-9);margin-left:var(--p-3);min-width:0;outline:none;overflow:hidden;padding:var(--p-1) var(--p-2);text-decoration:none;transform:translateX(-1px);width:calc(100% - var(--p-3))}.Sidebar_sidebarMenuSubButton__c9flh:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuSubButton__c9flh,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuSubButton__c9flh{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuSubButton__c9flh:disabled,.Sidebar_sidebarMenuSubButton__c9flh[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]:visited{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubButton__c9flh>span{flex-grow:1;flex-shrink:1;line-height:20px;min-width:0;overflow:hidden;white-space:nowrap}.Sidebar_sidebarMenuSubButton__c9flh>span>span{display:block;min-width:0;width:100%}.Sidebar_sidebarMenuSubButton__c9flh>svg{color:var(--sidebar-accent-foreground);flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-sm__7aIbu{font-size:.75rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-md__rcjmO{font-size:.875rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-lg__1k76S{font-size:1rem}::view-transition-old(sidebar-container),::view-transition-old(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtOld__hlKqn;animation-timing-function:ease-out;transform:translateZ(0)}::view-transition-new(sidebar-container),::view-transition-new(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtNew__FFhYU;animation-timing-function:ease-out;transform:translateZ(0)}@keyframes Sidebar_sidebarVtOld__hlKqn{0%{opacity:1}to{opacity:0}}@keyframes Sidebar_sidebarVtNew__FFhYU{0%{opacity:0}to{opacity:1}}";
4
- var SidebarStem = {"sidebarWrapper":"Sidebar_sidebarWrapper__DGm4P","sidebarMainShell":"Sidebar_sidebarMainShell__pSWDC","chatPanelMount":"Sidebar_chatPanelMount__1Zctx","sidebar":"Sidebar_sidebar__0vqNZ","sidebarTrigger":"Sidebar_sidebarTrigger__ipx2C","sidebarRail":"Sidebar_sidebarRail__uvSpl","sidebarResizeHandle":"Sidebar_sidebarResizeHandle__kuD6t","fullHeightResizer":"Sidebar_fullHeightResizer__jZXnw","sidebarInput":"Sidebar_sidebarInput__ujQLX","sidebarHeader":"Sidebar_sidebarHeader__X33ii","sidebarFooter":"Sidebar_sidebarFooter__V3O-l","sidebarSeparator":"Sidebar_sidebarSeparator__oUkYG","sidebarContent":"Sidebar_sidebarContent__Ywe1o","sidebarGroup":"Sidebar_sidebarGroup__7Mhg2","sidebarGroupAction":"Sidebar_sidebarGroupAction__OhVZq","sidebarMenu":"Sidebar_sidebarMenu__hYXIo","sidebarMenuItem":"Sidebar_sidebarMenuItem__CRhM8","sidebarMenuBadge":"Sidebar_sidebarMenuBadge__ttvCR","sidebarMenuSkeleton":"Sidebar_sidebarMenuSkeleton__u2KoI","sidebarMenuSkeletonIcon":"Sidebar_sidebarMenuSkeletonIcon__-1tvv","sidebarMenuSkeletonText":"Sidebar_sidebarMenuSkeletonText__dWzWo","sidebarMenuSub":"Sidebar_sidebarMenuSub__gh8Rn","sidebarMenuSubItem":"Sidebar_sidebarMenuSubItem__fTHJa","sheetContentSidebar":"Sidebar_sheetContentSidebar__cM2h2","sheetSidebarLogo":"Sidebar_sheetSidebarLogo__eGVDC","sheetSidebarInner":"Sidebar_sheetSidebarInner__U-SMQ","sidebarNone":"Sidebar_sidebarNone__crRsF","variant-floating":"Sidebar_variant-floating__-qvkJ","variant-inset":"Sidebar_variant-inset__oTfrV","variant-sidebar":"Sidebar_variant-sidebar__fAe77","sidebarMenuButton":"Sidebar_sidebarMenuButton__vIEh-","sidebarMenuSubButton":"Sidebar_sidebarMenuSubButton__c9flh","size-sm":"Sidebar_size-sm__7aIbu","size-md":"Sidebar_size-md__rcjmO","size-lg":"Sidebar_size-lg__1k76S","variant-outline":"Sidebar_variant-outline__UmtAz","sidebarMenuButtonCta":"Sidebar_sidebarMenuButtonCta__dQAhv","sidebarMenuAction":"Sidebar_sidebarMenuAction__mFZa1","showOnHover":"Sidebar_showOnHover__itXsA","sidebarVtOld":"Sidebar_sidebarVtOld__hlKqn","sidebarVtNew":"Sidebar_sidebarVtNew__FFhYU"};
3
+ var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.Sidebar_sidebarWrapper__DGm4P{align-items:stretch;display:flex;flex-direction:row;height:100%;min-height:0;width:100%}.Sidebar_sidebarWrapper__DGm4P #page-sidebar-actions{min-height:100%}@media (max-width:768px){.Sidebar_sidebarWrapper__DGm4P{flex-direction:column;height:100dvh;max-height:100dvh}}.Sidebar_sidebarMainShell__pSWDC{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0}.Sidebar_chatPanelMount__1Zctx{background:var(--background);border-left:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-width,0px);min-height:0;min-width:0;overflow:hidden;width:0;width:var(--chat-panel-width,0)}@media (max-width:768px){.Sidebar_chatPanelMount__1Zctx{border-left:none;border-top:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-height,0px);height:0;height:var(--chat-panel-height,0);transition:flex-basis .2s ease,height .2s ease;width:100%}}.Sidebar_sidebar__0vqNZ{height:0;position:fixed;--top-offset:-10px;--gap-top:calc(var(--header-height) + var(--top-offset));align-self:flex-start;color:var(--sidebar-foreground);display:none;flex-direction:column;top:calc(var(--gap-top));top:calc(var(--gap-top) + var(--app-banner-height, 0px));width:var(--sidebar-width)}@media (min-width:768px){.Sidebar_sidebar__0vqNZ[data-state=expanded]{display:flex;height:calc(100vh - var(--gap-top));height:calc(100vh - var(--gap-top) - var(--app-banner-height, 0px));min-height:0}}.Sidebar_sidebar__0vqNZ[data-collapsible=offcanvas]{overflow:hidden;padding:0;width:0}.Sidebar_sidebarTrigger__ipx2C{cursor:pointer;margin-left:calc(var(--p-4)*-1);width:var(--p-5)}.Sidebar_sidebarTrigger__ipx2C svg{height:20px;width:20px}.Sidebar_sidebarRail__uvSpl{position:absolute;inset-y:0;display:hidden;transition:all ease-out;width:1rem;z-index:20}.Sidebar_sidebarRail__uvSpl:hover:after{background-color:var(--sidebar-border)}.Sidebar_sidebarRail__uvSpl[data-side=left]{right:-1rem}.Sidebar_sidebarRail__uvSpl[data-side=right]{left:0}.Sidebar_sidebarRail__uvSpl:after{content:\"\";position:absolute;inset-y:0;left:50%;width:2px}@media (min-width:640px){.Sidebar_sidebarRail__uvSpl{display:flex}}.Sidebar_sidebarRail__uvSpl[data-side=left]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-side=left][data-state=collapsed],.Sidebar_sidebarRail__uvSpl[data-side=right]{cursor:e-resize}.Sidebar_sidebarRail__uvSpl[data-side=right][data-state=collapsed]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]{transform:translateX(0)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:hover{background-color:var(--sidebar)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:after{left:100%}.Sidebar_sidebarRail__uvSpl[data-side=left][data-collapsible=offcanvas]{right:-.5rem}.Sidebar_sidebarRail__uvSpl[data-side=right][data-collapsible=offcanvas]{left:-.5rem}.Sidebar_sidebarResizeHandle__kuD6t{background-color:transparent;background-color:var(--page-color);border-radius:2.5px;height:calc(100vh + 200px);height:calc(100vh + 200px - var(--app-banner-height, 0px));opacity:0;position:absolute;top:-200px;touch-action:none;transition:opacity .15s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5px;z-index:30}.Sidebar_sidebarResizeHandle__kuD6t:before{content:\"\";cursor:col-resize;height:100%;position:absolute;right:0;width:30px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=left]{right:2px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=right]{left:0}.Sidebar_sidebarResizeHandle__kuD6t:hover{opacity:1}.Sidebar_sidebarResizeHandle__kuD6t:active{opacity:0}.Sidebar_fullHeightResizer__jZXnw .Sidebar_sidebarResizeHandle__kuD6t{height:calc(100vh - var(--gap-top)*-1);height:calc(100vh - var(--gap-top)*-1 - var(--app-banner-height, 0px));top:-80px}.Sidebar_sidebarInput__ujQLX{background-color:var(--background);box-shadow:none;height:2rem;width:100%}.Sidebar_sidebarFooter__V3O-l,.Sidebar_sidebarHeader__X33ii{display:flex;flex-direction:column;gap:0;padding:0}.Sidebar_sidebarSeparator__oUkYG{background-color:var(--sidebar-border);margin-left:0;margin-right:0;width:auto}.Sidebar_sidebarContent__Ywe1o{display:flex;flex:1;flex-direction:column;gap:var(--p-16);height:100vh;max-height:100%;min-height:0;overflow:auto;position:absolute;width:100%}@media (min-width:768px){.Sidebar_sidebarContent__Ywe1o{height:calc(100vh - var(--gap-top));height:calc(100vh - var(--gap-top) - var(--app-banner-height, 0px))}}.Sidebar_sidebarContent__Ywe1o[data-collapsible=icon]{overflow:hidden}.Sidebar_sidebarGroup__7Mhg2{display:flex;flex-direction:column;min-width:0;padding:40px 0 0;position:relative;width:100%}.Sidebar_sidebarGroupAction__OhVZq{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;justify-content:center;outline:none;padding:0;position:absolute;right:.75rem;top:.875rem;transition:transform;width:1.25rem}.Sidebar_sidebarGroupAction__OhVZq:hover{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarGroupAction__OhVZq:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarGroupAction__OhVZq>svg{flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarGroupAction__OhVZq:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarGroupAction__OhVZq:after{display:none}}.Sidebar_sidebarGroupAction__OhVZq[data-collapsible=icon]{display:none}.Sidebar_sidebarMenu__hYXIo{display:flex;flex-direction:column;gap:var(--p-4);list-style:none;min-width:0;padding:0 var(--p-11) var(--p-10) var(--p-8);width:100%}@media (max-width:768px){.Sidebar_sidebarMenu__hYXIo{padding-right:var(--p-8)}}.Sidebar_sidebarMenuItem__CRhM8{cursor:pointer;position:relative}.Sidebar_sidebarMenuBadge__ttvCR{align-items:center;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;font-weight:500;height:1.25rem;justify-content:center;min-width:1.25rem;padding-left:.25rem;padding-right:.25rem;pointer-events:none;position:absolute;right:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Sidebar_sidebarMenuBadge__ttvCR[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=md]{top:.375rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuBadge__ttvCR[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSkeleton__u2KoI{align-items:center;border-radius:.375rem;display:flex;gap:.5rem;height:2rem;padding-left:.5rem;padding-right:.5rem}.Sidebar_sidebarMenuSkeletonIcon__-1tvv{border-radius:.375rem;height:1rem;width:1rem}.Sidebar_sidebarMenuSkeletonText__dWzWo{flex:1;height:1rem;max-width:var(--skeleton-width)}.Sidebar_sidebarMenuSub__gh8Rn{border-color:var(--sidebar-border);border-left:none;display:flex;flex-direction:column;gap:var(--p-1);list-style:none;margin-left:0;margin-right:0;min-width:0;padding:0;padding-top:var(--p-1);position:relative;transform:translateX(1px)}.Sidebar_sidebarMenuSub__gh8Rn:before{background:var(--sidebar-border);bottom:0;content:\"\";left:var(--p-5);pointer-events:none;position:absolute;top:0;width:1px}.Sidebar_sidebarMenuSub__gh8Rn[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubItem__fTHJa{margin-left:var(--p-4);min-width:0;position:relative}.Sidebar_sidebarMenuSubItem__fTHJa a:hover{text-decoration:none}.Sidebar_sheetContentSidebar__cM2h2{color:var(--sidebar-foreground);padding:0;width:var(--sidebar-width)}.Sidebar_sheetContentSidebar__cM2h2>button{display:none}@media (max-width:768px){.Sidebar_sheetContentSidebar__cM2h2{z-index:100}}.Sidebar_sheetSidebarLogo__eGVDC{flex-shrink:0;padding:var(--p-6) var(--p-8) var(--p-2);position:relative}.Sidebar_sheetSidebarInner__U-SMQ{background-color:var(--sidebar);display:flex;flex-direction:column;height:100%;width:100%}.Sidebar_sheetSidebarInner__U-SMQ .Sidebar_sidebarContent__Ywe1o{flex:1;height:auto;max-height:none;min-height:0;position:relative}.Sidebar_sidebarNone__crRsF{color:var(--sidebar-foreground);display:flex;flex-direction:column;height:100%;width:var(--sidebar-width)}.Sidebar_variant-floating__-qvkJ{padding:.5rem}.Sidebar_variant-floating__-qvkJ[data-collapsible=icon],.Sidebar_variant-inset__oTfrV[data-collapsible=icon]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.Sidebar_variant-sidebar__fAe77[data-collapsible=icon]{width:var(--sidebar-width-icon)}.Sidebar_variant-sidebar__fAe77[data-side=left]{border-right:1px solid #e5e7eb}.Sidebar_variant-sidebar__fAe77[data-side=right]{border-left:1px solid #e5e7eb}.Sidebar_sidebarMenuButton__vIEh->span,.Sidebar_sidebarMenuSubButton__c9flh>span{min-width:0;text-transform:capitalize}.Sidebar_sidebarMenuButton__vIEh->span:first-child,.Sidebar_sidebarMenuSubButton__c9flh>span:first-child{flex-grow:1}.Sidebar_sidebarMenuButton__vIEh-{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;gap:var(--p-2);justify-content:flex-start;outline:none;overflow:hidden;padding:var(--p-6) var(--p-3);text-align:left;text-decoration:none;transition:all;width:100%}.Sidebar_sidebarMenuButton__vIEh-:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuButton__vIEh-:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa[data-state=open] .Sidebar_sidebarMenuButton__vIEh-{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButton__vIEh-:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuButton__vIEh-:disabled,.Sidebar_sidebarMenuButton__vIEh-[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuButton__vIEh-[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground);font-weight:500}.Sidebar_sidebarMenuButton__vIEh-[data-collapsible=icon]{height:2rem!important;padding:.5rem!important;width:2rem!important}.Sidebar_sidebarMenuButton__vIEh->svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-sm__7aIbu{height:1.75rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-md__rcjmO{height:var(--p-12)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S{height:3rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S[data-collapsible=icon]{padding:0!important}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz{background-color:var(--background);box-shadow:0 0 0 1px var(--sidebar-border)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz:hover{background-color:var(--sidebar-accent);box-shadow:0 0 0 1px var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButtonLabel__ropmN{flex-grow:1}.Sidebar_sidebarMenuSubButtonLabel__L23CG{flex-grow:1;min-width:0}.Sidebar_sidebarMenuButtonChevron__IPWNA{align-items:center;display:flex;flex-shrink:0;margin-left:auto;opacity:.5;transition:transform .1s ease-out}.Sidebar_sidebarMenuButton__vIEh-:hover .Sidebar_sidebarMenuButtonChevron__IPWNA{opacity:1}.Sidebar_sidebarMenuButtonChevron__IPWNA.Sidebar_expanded__iPddE{transform:rotate(90deg)}.Sidebar_sidebarMenuButtonChevron__IPWNA>svg{height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuButtonCta__dQAhv{display:flex;justify-content:flex-start;text-align:left;width:100%}.Sidebar_sidebarMenuButtonCta__dQAhv>svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuAction__mFZa1{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);cursor:pointer;display:flex;justify-content:center;opacity:0;outline:none;padding:0;position:absolute;right:var(--p-2);top:var(--p-2);transition:transform;width:1.25rem}.Sidebar_sidebarMenuAction__mFZa1:before{background-image:linear-gradient(to left,var(--sidebar-accent) 70%,transparent 100%);content:\"\";height:100%;pointer-events:none;position:absolute;right:0;transition:opacity .2s ease-in-out;width:calc(100% + var(--p-4))}.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuAction__mFZa1{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuAction__mFZa1>svg{flex-shrink:0;height:1rem;opacity:.5;pointer-events:none;transition:opacity .2s ease-in-out;width:1rem;z-index:1}.Sidebar_sidebarMenuAction__mFZa1:hover>svg{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1:after{display:none}}.Sidebar_sidebarMenuAction__mFZa1[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=md]{top:.375rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuAction__mFZa1[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-active=true]{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-state=open]{opacity:1}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA{opacity:0}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:focus-within,.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:hover{opacity:1}}.Sidebar_sidebarMenuSubButton__c9flh{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;gap:var(--p-1);height:var(--p-9);margin-left:var(--p-3);min-width:0;outline:none;overflow:hidden;padding:var(--p-2) var(--p-3);text-decoration:none;transform:translateX(-1px);width:calc(100% - var(--p-3))}.Sidebar_sidebarMenuSubButton__c9flh:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuSubButton__c9flh,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuSubButton__c9flh{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuSubButton__c9flh:disabled,.Sidebar_sidebarMenuSubButton__c9flh[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]:visited{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubButton__c9flh>svg{color:var(--sidebar-accent-foreground);flex-shrink:0;height:1rem;width:1rem}::view-transition-old(sidebar-container),::view-transition-old(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtOld__hlKqn;animation-timing-function:ease-out;transform:translateZ(0)}::view-transition-new(sidebar-container),::view-transition-new(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtNew__FFhYU;animation-timing-function:ease-out;transform:translateZ(0)}@keyframes Sidebar_sidebarVtOld__hlKqn{0%{opacity:1}to{opacity:0}}@keyframes Sidebar_sidebarVtNew__FFhYU{0%{opacity:0}to{opacity:1}}";
4
+ var SidebarStem = {"sidebarWrapper":"Sidebar_sidebarWrapper__DGm4P","sidebarMainShell":"Sidebar_sidebarMainShell__pSWDC","chatPanelMount":"Sidebar_chatPanelMount__1Zctx","sidebar":"Sidebar_sidebar__0vqNZ","sidebarTrigger":"Sidebar_sidebarTrigger__ipx2C","sidebarRail":"Sidebar_sidebarRail__uvSpl","sidebarResizeHandle":"Sidebar_sidebarResizeHandle__kuD6t","fullHeightResizer":"Sidebar_fullHeightResizer__jZXnw","sidebarInput":"Sidebar_sidebarInput__ujQLX","sidebarHeader":"Sidebar_sidebarHeader__X33ii","sidebarFooter":"Sidebar_sidebarFooter__V3O-l","sidebarSeparator":"Sidebar_sidebarSeparator__oUkYG","sidebarContent":"Sidebar_sidebarContent__Ywe1o","sidebarGroup":"Sidebar_sidebarGroup__7Mhg2","sidebarGroupAction":"Sidebar_sidebarGroupAction__OhVZq","sidebarMenu":"Sidebar_sidebarMenu__hYXIo","sidebarMenuItem":"Sidebar_sidebarMenuItem__CRhM8","sidebarMenuBadge":"Sidebar_sidebarMenuBadge__ttvCR","sidebarMenuSkeleton":"Sidebar_sidebarMenuSkeleton__u2KoI","sidebarMenuSkeletonIcon":"Sidebar_sidebarMenuSkeletonIcon__-1tvv","sidebarMenuSkeletonText":"Sidebar_sidebarMenuSkeletonText__dWzWo","sidebarMenuSub":"Sidebar_sidebarMenuSub__gh8Rn","sidebarMenuSubItem":"Sidebar_sidebarMenuSubItem__fTHJa","sheetContentSidebar":"Sidebar_sheetContentSidebar__cM2h2","sheetSidebarLogo":"Sidebar_sheetSidebarLogo__eGVDC","sheetSidebarInner":"Sidebar_sheetSidebarInner__U-SMQ","sidebarNone":"Sidebar_sidebarNone__crRsF","variant-floating":"Sidebar_variant-floating__-qvkJ","variant-inset":"Sidebar_variant-inset__oTfrV","variant-sidebar":"Sidebar_variant-sidebar__fAe77","sidebarMenuButton":"Sidebar_sidebarMenuButton__vIEh-","sidebarMenuSubButton":"Sidebar_sidebarMenuSubButton__c9flh","size-sm":"Sidebar_size-sm__7aIbu","size-md":"Sidebar_size-md__rcjmO","size-lg":"Sidebar_size-lg__1k76S","variant-outline":"Sidebar_variant-outline__UmtAz","sidebarMenuButtonLabel":"Sidebar_sidebarMenuButtonLabel__ropmN","sidebarMenuSubButtonLabel":"Sidebar_sidebarMenuSubButtonLabel__L23CG","sidebarMenuButtonChevron":"Sidebar_sidebarMenuButtonChevron__IPWNA","expanded":"Sidebar_expanded__iPddE","sidebarMenuButtonCta":"Sidebar_sidebarMenuButtonCta__dQAhv","sidebarMenuAction":"Sidebar_sidebarMenuAction__mFZa1","showOnHover":"Sidebar_showOnHover__itXsA","sidebarVtOld":"Sidebar_sidebarVtOld__hlKqn","sidebarVtNew":"Sidebar_sidebarVtNew__FFhYU"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { SidebarStem as default };
@@ -1,98 +1,291 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useRef, useState, useLayoutEffect } from 'react';
2
+ import cn from 'classnames';
3
+ import { memo, useRef, useState, useCallback, useLayoutEffect } from 'react';
4
+ import S from './SmartTextTruncate.styl.js';
3
5
 
4
6
  const ELLIPSIS = ' ... ';
5
7
  const END_CHARS_COUNT = 10;
6
- function SmartTextTruncate({ children, className, ...props }) {
8
+ const RESIZE_SETTLE_MS = 120;
9
+ const GLOBAL_KEY = '__sybilionSmartTextTruncate';
10
+ const RESIZE_ROOT_SELECTOR = '[data-smart-text-truncate-resize-root]';
11
+ const DRAG_THRESHOLD_PX = 3;
12
+ function getGlobalState() {
13
+ const w = window;
14
+ if (!w[GLOBAL_KEY]) {
15
+ w[GLOBAL_KEY] = {
16
+ store: {
17
+ isPanelDragging: false,
18
+ isResizeRootDragging: false,
19
+ },
20
+ settleTimer: null,
21
+ resizeRafId: 0,
22
+ recalcCallbacks: new Set(),
23
+ resizeRootListenersInit: false,
24
+ panelDragActive: false,
25
+ };
26
+ }
27
+ return w[GLOBAL_KEY];
28
+ }
29
+ let pendingResizeRootDrag = null;
30
+ function getIsFastMode(store) {
31
+ return store.isPanelDragging || store.isResizeRootDragging;
32
+ }
33
+ function syncFastModeDom(store) {
34
+ if (typeof document === 'undefined') {
35
+ return;
36
+ }
37
+ if (getIsFastMode(store)) {
38
+ document.documentElement.dataset.smartTextTruncateFast = '';
39
+ }
40
+ else {
41
+ delete document.documentElement.dataset.smartTextTruncateFast;
42
+ }
43
+ }
44
+ function clearSettleTimer() {
45
+ const g = getGlobalState();
46
+ if (g.settleTimer) {
47
+ clearTimeout(g.settleTimer);
48
+ g.settleTimer = null;
49
+ }
50
+ }
51
+ function runSettleRecalc() {
52
+ getGlobalState().recalcCallbacks.forEach(recalc => recalc());
53
+ }
54
+ function scheduleSettle() {
55
+ const g = getGlobalState();
56
+ clearSettleTimer();
57
+ g.settleTimer = setTimeout(() => {
58
+ g.settleTimer = null;
59
+ runSettleRecalc();
60
+ }, RESIZE_SETTLE_MS);
61
+ }
62
+ function notifyContainerResize() {
63
+ const g = getGlobalState();
64
+ if (getIsFastMode(g.store)) {
65
+ return;
66
+ }
67
+ scheduleSettle();
68
+ }
69
+ function beginResizeRootDrag() {
70
+ const g = getGlobalState();
71
+ if (g.store.isResizeRootDragging) {
72
+ return;
73
+ }
74
+ clearSettleTimer();
75
+ g.store = { ...g.store, isResizeRootDragging: true };
76
+ syncFastModeDom(g.store);
77
+ }
78
+ function endResizeRootDrag() {
79
+ const g = getGlobalState();
80
+ pendingResizeRootDrag = null;
81
+ if (!g.store.isResizeRootDragging) {
82
+ return;
83
+ }
84
+ g.store = { ...g.store, isResizeRootDragging: false };
85
+ syncFastModeDom(g.store);
86
+ scheduleSettle();
87
+ }
88
+ function onResizeRootPointerDown(e) {
89
+ if (e.button !== 0) {
90
+ return;
91
+ }
92
+ const root = e.target?.closest(RESIZE_ROOT_SELECTOR);
93
+ if (!root) {
94
+ return;
95
+ }
96
+ clearSettleTimer();
97
+ pendingResizeRootDrag = {
98
+ pointerId: e.pointerId,
99
+ startX: e.clientX,
100
+ startY: e.clientY,
101
+ };
102
+ }
103
+ function onResizeRootPointerMove(e) {
104
+ const pending = pendingResizeRootDrag;
105
+ if (!pending || e.pointerId !== pending.pointerId) {
106
+ return;
107
+ }
108
+ const dx = e.clientX - pending.startX;
109
+ const dy = e.clientY - pending.startY;
110
+ if (Math.hypot(dx, dy) < DRAG_THRESHOLD_PX) {
111
+ return;
112
+ }
113
+ beginResizeRootDrag();
114
+ }
115
+ function onResizeRootPointerUp(e) {
116
+ const pending = pendingResizeRootDrag;
117
+ if (!pending || e.pointerId !== pending.pointerId) {
118
+ return;
119
+ }
120
+ endResizeRootDrag();
121
+ }
122
+ function ensureResizeRootListeners() {
123
+ const g = getGlobalState();
124
+ if (g.resizeRootListenersInit) {
125
+ return;
126
+ }
127
+ g.resizeRootListenersInit = true;
128
+ window.addEventListener('pointerdown', onResizeRootPointerDown);
129
+ window.addEventListener('pointermove', onResizeRootPointerMove);
130
+ window.addEventListener('pointerup', onResizeRootPointerUp);
131
+ window.addEventListener('pointercancel', onResizeRootPointerUp);
132
+ }
133
+ function scheduleContainerResize() {
134
+ const g = getGlobalState();
135
+ if (g.resizeRafId !== 0) {
136
+ return;
137
+ }
138
+ g.resizeRafId = requestAnimationFrame(() => {
139
+ g.resizeRafId = 0;
140
+ notifyContainerResize();
141
+ });
142
+ }
143
+ let sharedResizeObserver = null;
144
+ let widthProbe = null;
145
+ function observeWidthProbe(container) {
146
+ if (widthProbe) {
147
+ return;
148
+ }
149
+ if (!sharedResizeObserver) {
150
+ sharedResizeObserver = new ResizeObserver(() => {
151
+ const g = getGlobalState();
152
+ if (getIsFastMode(g.store)) {
153
+ return;
154
+ }
155
+ scheduleContainerResize();
156
+ });
157
+ }
158
+ widthProbe = container;
159
+ sharedResizeObserver.observe(container);
160
+ }
161
+ function unobserveWidthProbe(container) {
162
+ if (widthProbe !== container) {
163
+ return;
164
+ }
165
+ sharedResizeObserver?.unobserve(container);
166
+ widthProbe = null;
167
+ }
168
+ /** Panel resize handle — call on first pointer move after press, not on pointer down. */
169
+ function notifyPanelWidthDragStart() {
170
+ const g = getGlobalState();
171
+ if (g.panelDragActive) {
172
+ return;
173
+ }
174
+ clearSettleTimer();
175
+ g.panelDragActive = true;
176
+ g.store = { ...g.store, isPanelDragging: true };
177
+ syncFastModeDom(g.store);
178
+ }
179
+ function notifyPanelWidthDragEnd() {
180
+ const g = getGlobalState();
181
+ if (!g.panelDragActive) {
182
+ return;
183
+ }
184
+ g.panelDragActive = false;
185
+ g.store = { ...g.store, isPanelDragging: false };
186
+ syncFastModeDom(g.store);
187
+ scheduleSettle();
188
+ }
189
+ function computeTruncatedText(fullTextEl, text, containerWidth) {
190
+ if (text.length <= END_CHARS_COUNT) {
191
+ return text;
192
+ }
193
+ fullTextEl.textContent = text;
194
+ if (fullTextEl.scrollWidth <= containerWidth) {
195
+ return text;
196
+ }
197
+ const endPart = text.slice(-END_CHARS_COUNT);
198
+ let left = 0;
199
+ let right = text.length - END_CHARS_COUNT;
200
+ let bestStart = 0;
201
+ while (left <= right) {
202
+ const mid = Math.floor((left + right) / 2);
203
+ const startPart = text.slice(0, mid);
204
+ const truncated = startPart + ELLIPSIS + endPart;
205
+ fullTextEl.textContent = truncated;
206
+ if (fullTextEl.scrollWidth <= containerWidth) {
207
+ bestStart = mid;
208
+ left = mid + 1;
209
+ }
210
+ else {
211
+ right = mid - 1;
212
+ }
213
+ }
214
+ if (bestStart === 0) {
215
+ fullTextEl.textContent = ELLIPSIS + endPart;
216
+ if (fullTextEl.scrollWidth <= containerWidth) {
217
+ return ELLIPSIS + endPart;
218
+ }
219
+ return endPart;
220
+ }
221
+ return text.slice(0, bestStart) + ELLIPSIS + endPart;
222
+ }
223
+ const SmartTextTruncate = memo(function SmartTextTruncate({ children, className, ...props }) {
7
224
  const containerRef = useRef(null);
8
225
  const fullTextRef = useRef(null);
226
+ const lastMeasuredWidthRef = useRef(0);
227
+ const childrenRef = useRef(children);
228
+ childrenRef.current = children;
9
229
  const [displayText, setDisplayText] = useState(typeof children === 'string' ? children : '');
10
- const [resizeTrigger, setResizeTrigger] = useState(0);
11
- useLayoutEffect(() => {
230
+ const displayTextRef = useRef(displayText);
231
+ displayTextRef.current = displayText;
232
+ const recalc = useCallback(() => {
233
+ if (getIsFastMode(getGlobalState().store)) {
234
+ return;
235
+ }
12
236
  const container = containerRef.current;
13
237
  const fullText = fullTextRef.current;
14
- if (!container || !fullText || typeof children !== 'string') {
238
+ const text = childrenRef.current;
239
+ if (!container || !fullText || typeof text !== 'string') {
15
240
  return;
16
241
  }
17
- const text = children;
18
- // If text is shorter than END_CHARS_COUNT, no truncation needed
19
242
  if (text.length <= END_CHARS_COUNT) {
20
- setDisplayText(text);
243
+ if (displayTextRef.current !== text) {
244
+ setDisplayText(text);
245
+ }
21
246
  return;
22
247
  }
23
- // Measure container width
24
248
  const containerWidth = container.clientWidth;
25
249
  if (containerWidth === 0) {
26
- // Container not yet rendered, keep current text
27
250
  return;
28
251
  }
29
- // Measure full text width
30
- fullText.textContent = text;
31
- const fullTextWidth = fullText.scrollWidth;
32
- // If text fits, show full text
33
- if (fullTextWidth <= containerWidth) {
34
- setDisplayText(text);
252
+ if (containerWidth === lastMeasuredWidthRef.current &&
253
+ lastMeasuredWidthRef.current !== 0) {
35
254
  return;
36
255
  }
37
- // Calculate truncated text: <start>...<last 10 chars>
38
- const endPart = text.slice(-END_CHARS_COUNT);
39
- // Binary search for optimal start length
40
- let left = 0;
41
- let right = text.length - END_CHARS_COUNT;
42
- let bestStart = 0;
43
- while (left <= right) {
44
- const mid = Math.floor((left + right) / 2);
45
- const startPart = text.slice(0, mid);
46
- const truncated = startPart + ELLIPSIS + endPart;
47
- fullText.textContent = truncated;
48
- const truncatedWidth = fullText.scrollWidth;
49
- if (truncatedWidth <= containerWidth) {
50
- bestStart = mid;
51
- left = mid + 1;
52
- }
53
- else {
54
- right = mid - 1;
55
- }
56
- }
57
- // Ensure we have at least some start text
58
- if (bestStart === 0) {
59
- // If even just ellipsis + end doesn't fit, show only end part
60
- fullText.textContent = ELLIPSIS + endPart;
61
- if (fullText.scrollWidth <= containerWidth) {
62
- setDisplayText(ELLIPSIS + endPart);
63
- }
64
- else {
65
- // Last resort: show only end part without ellipsis
66
- setDisplayText(endPart);
67
- }
68
- }
69
- else {
70
- setDisplayText(text.slice(0, bestStart) + ELLIPSIS + endPart);
256
+ lastMeasuredWidthRef.current = containerWidth;
257
+ const nextText = computeTruncatedText(fullText, text, containerWidth);
258
+ if (nextText !== displayTextRef.current) {
259
+ setDisplayText(nextText);
71
260
  }
72
- }, [children, resizeTrigger]);
73
- // Handle ResizeObserver for container resizing
261
+ }, []);
262
+ useLayoutEffect(() => {
263
+ lastMeasuredWidthRef.current = 0;
264
+ recalc();
265
+ }, [children, recalc]);
266
+ useLayoutEffect(() => {
267
+ ensureResizeRootListeners();
268
+ const g = getGlobalState();
269
+ g.recalcCallbacks.add(recalc);
270
+ return () => {
271
+ g.recalcCallbacks.delete(recalc);
272
+ };
273
+ }, [recalc]);
74
274
  useLayoutEffect(() => {
275
+ ensureResizeRootListeners();
75
276
  const container = containerRef.current;
76
- if (!container)
277
+ if (!container) {
77
278
  return;
78
- const resizeObserver = new ResizeObserver(() => {
79
- // Trigger recalculation by updating resizeTrigger
80
- setResizeTrigger(prev => prev + 1);
81
- });
82
- resizeObserver.observe(container);
279
+ }
280
+ observeWidthProbe(container);
83
281
  return () => {
84
- resizeObserver.disconnect();
282
+ unobserveWidthProbe(container);
85
283
  };
86
284
  }, []);
87
285
  if (typeof children !== 'string') {
88
286
  return (jsx("span", { className: className, ...props, children: children }));
89
287
  }
90
- return (jsxs("span", { ref: containerRef, className: className, ...props, style: { position: 'relative', ...props.style }, children: [displayText, jsx("span", { ref: fullTextRef, style: {
91
- position: 'absolute',
92
- visibility: 'hidden',
93
- whiteSpace: 'nowrap',
94
- top: '-9999px',
95
- }, "aria-hidden": "true", children: children })] }));
96
- }
288
+ return (jsxs("span", { ref: containerRef, className: cn(S.root, className), ...props, children: [jsx("span", { className: S.measuredLabel, children: displayText || children }), jsx("span", { className: S.liveLabel, children: children }), jsx("span", { ref: fullTextRef, className: S.fullText, "aria-hidden": "true", children: children })] }));
289
+ });
97
290
 
98
- export { SmartTextTruncate };
291
+ export { SmartTextTruncate, notifyPanelWidthDragEnd, notifyPanelWidthDragStart };
@@ -0,0 +1,7 @@
1
+ import styleInject from 'style-inject';
2
+
3
+ var css_248z = ".SmartTextTruncate_root__GtH6n{min-width:0;overflow:hidden;position:relative}.SmartTextTruncate_measuredLabel__f2OgX{display:block;min-width:0;overflow:hidden;white-space:nowrap}.SmartTextTruncate_liveLabel__pAn3y{display:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}html[data-smart-text-truncate-fast] .SmartTextTruncate_measuredLabel__f2OgX{display:none}html[data-smart-text-truncate-fast] .SmartTextTruncate_liveLabel__pAn3y{display:block}html[data-smart-text-truncate-fast] .SmartTextTruncate_fullText__juggj{display:none}.SmartTextTruncate_fullText__juggj{position:absolute;top:-9999px;visibility:hidden;white-space:nowrap}";
4
+ var S = {"root":"SmartTextTruncate_root__GtH6n","measuredLabel":"SmartTextTruncate_measuredLabel__f2OgX","liveLabel":"SmartTextTruncate_liveLabel__pAn3y","fullText":"SmartTextTruncate_fullText__juggj"};
5
+ styleInject(css_248z);
6
+
7
+ export { S as default };
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useMemo, useState, useEffect } from 'react';
3
3
  import { SidebarGroup, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton } from '../../ui/Sidebar/Sidebar.js';
4
4
  import { SmartTextTruncate } from '../../ui/SmartTextTruncate/SmartTextTruncate.js';
5
- import { PackageOpen, ChevronDown, ChevronRight } from 'lucide-react';
5
+ import { PackageOpen } from 'lucide-react';
6
6
  import S from './SidebarDatasetsItemsGrouped.styl.js';
7
7
  import { groupSidebarDatasets } from './groupSidebarDatasets.js';
8
8
 
@@ -44,10 +44,10 @@ function SidebarDatasetsItemsGrouped({ groupBy, datasets, preItems, postItems, s
44
44
  return (jsx(SidebarGroup, { className: className, children: jsxs(SidebarMenu, { children: [preItems, grouped.map(([groupName, groupDatasets]) => {
45
45
  const isExpanded = expanded.has(groupName);
46
46
  const parentActive = groupDatasets.some(d => d.id === selectedDatasetId);
47
- return (jsxs(SidebarMenuItem, { children: [jsxs(SidebarMenuButton, { type: "button", isActive: parentActive, onClick: () => toggleGroup(groupName), children: [jsx(PackageOpen, { strokeWidth: 1.5, size: 16 }), jsx(SmartTextTruncate, { children: groupName }), jsx("div", { className: S.chevronContainer, children: isExpanded ? (jsx(ChevronDown, { size: 12 })) : (jsx(ChevronRight, { size: 12 })) })] }), isExpanded && (jsxs(SidebarMenuSub, { className: S.subMenuContainer, children: [jsx("div", { className: S.subMenuBorder }), groupDatasets.map(dataset => (jsx(SidebarMenuSubItem, { className: S.subMenuItem, children: jsx(SidebarMenuSubButton, { href: `#dataset-${dataset.id}`, isActive: dataset.id === selectedDatasetId, onClick: e => {
48
- e.preventDefault();
49
- onDatasetClick?.(dataset.id);
50
- }, children: jsx(SmartTextTruncate, { "data-dataset-id": dataset.id, children: dataset.name }) }) }, dataset.id)))] }))] }, groupName));
47
+ return (jsxs(SidebarMenuItem, { children: [jsx(SidebarMenuButton, { type: "button", isActive: parentActive, hasSubItems: true, isExpanded: isExpanded, onClick: () => toggleGroup(groupName), icon: jsx(PackageOpen, { strokeWidth: 1.5, size: 16 }), children: groupName }), isExpanded && (jsx(SidebarMenuSub, { className: S.subMenuContainer, children: groupDatasets.map(dataset => (jsx(SidebarMenuSubItem, { className: S.subMenuItem, children: jsx(SidebarMenuSubButton, { href: `#dataset-${dataset.id}`, isActive: dataset.id === selectedDatasetId, onClick: e => {
48
+ e.preventDefault();
49
+ onDatasetClick?.(dataset.id);
50
+ }, children: jsx(SmartTextTruncate, { "data-dataset-id": dataset.id, children: dataset.name }) }) }, dataset.id))) }))] }, groupName));
51
51
  }), postItems] }) }));
52
52
  }
53
53
 
@@ -1,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = ".SidebarDatasetsItemsGrouped_chevronContainer__CoQnn{margin-left:auto}.SidebarDatasetsItemsGrouped_subMenuContainer__utcha{position:relative}.SidebarDatasetsItemsGrouped_subMenuBorder__LN-Fq{background:var(--sidebar-border);bottom:26px;left:var(--p-5);position:absolute;top:0;width:1px}.SidebarDatasetsItemsGrouped_subMenuItem__9gFCe{margin-left:var(--p-6);position:relative}.SidebarDatasetsItemsGrouped_subMenuItem__9gFCe:before{border-bottom:1px solid var(--sidebar-border);border-bottom-left-radius:var(--p-2);border-left:1px solid var(--sidebar-border);bottom:0;content:\"\";height:var(--p-3);left:calc(var(--p-1)*-1);position:absolute;top:var(--p-2);width:var(--p-3)}";
4
- var S = {"chevronContainer":"SidebarDatasetsItemsGrouped_chevronContainer__CoQnn","subMenuContainer":"SidebarDatasetsItemsGrouped_subMenuContainer__utcha","subMenuBorder":"SidebarDatasetsItemsGrouped_subMenuBorder__LN-Fq","subMenuItem":"SidebarDatasetsItemsGrouped_subMenuItem__9gFCe"};
3
+ var css_248z = ".SidebarDatasetsItemsGrouped_subMenuContainer__utcha,.SidebarDatasetsItemsGrouped_subMenuItem__9gFCe{position:relative}";
4
+ var S = {"subMenuContainer":"SidebarDatasetsItemsGrouped_subMenuContainer__utcha","subMenuItem":"SidebarDatasetsItemsGrouped_subMenuItem__9gFCe"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
package/dist/esm/index.js CHANGED
@@ -95,7 +95,7 @@ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHe
95
95
  export { DISMISS_CHAT_FOR_LAYOUT_EVENT, PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarActions, useSidebarState } from './components/ui/Sidebar/Sidebar.js';
96
96
  export { Skeleton } from './components/ui/Skeleton/Skeleton.js';
97
97
  export { Slider } from './components/ui/Slider/Slider.js';
98
- export { SmartTextTruncate } from './components/ui/SmartTextTruncate/SmartTextTruncate.js';
98
+ export { SmartTextTruncate, notifyPanelWidthDragEnd, notifyPanelWidthDragStart } from './components/ui/SmartTextTruncate/SmartTextTruncate.js';
99
99
  export { Sparkline } from './components/ui/Sparkline/Sparkline.js';
100
100
  export { Switch } from './components/ui/Switch/Switch.js';
101
101
  export { Table, TableBody, TableCell, TableCellValue, TableFooter, TableHead, TableHeader, TableRow } from './components/ui/Table/Table.js';
@@ -14,7 +14,7 @@ export interface ChatSheetProps extends Omit<UseChatPanelChromeModelInput, 'embe
14
14
  actionsRef?: React.MutableRefObject<ChatSheetActions | null>;
15
15
  renderTrigger?: (toggleOpen: () => void, isOpen: boolean) => React.ReactNode;
16
16
  triggerIcon?: React.ReactNode;
17
- triggerLabel?: string;
17
+ triggerLabel?: React.ReactNode;
18
18
  /** aria-label for icon-only trigger (required when trigger has no visible text) */
19
19
  triggerAriaLabel?: string;
20
20
  label?: string;