@alkimi.org/ui-kit 0.12.5 → 0.12.6

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 (81) hide show
  1. package/dist/COMPONENTS.md +1711 -0
  2. package/dist/chunk-372VUZFE.js.map +1 -1
  3. package/dist/chunk-3BVMHDYA.js.map +1 -1
  4. package/dist/chunk-3PEPOFYU.js.map +1 -1
  5. package/dist/chunk-3TLCOZ5R.js.map +1 -1
  6. package/dist/chunk-5L5DM2X5.js.map +1 -1
  7. package/dist/chunk-5X26XR44.js.map +1 -1
  8. package/dist/chunk-7J2ETVGK.js.map +1 -1
  9. package/dist/chunk-7SOZ6MOV.js.map +1 -1
  10. package/dist/chunk-BV7RXRSL.js.map +1 -1
  11. package/dist/chunk-CT2CRYC2.js.map +1 -1
  12. package/dist/chunk-DEWWZMYC.js.map +1 -1
  13. package/dist/chunk-DHHZMQ72.js.map +1 -1
  14. package/dist/chunk-DMMKR6TY.js.map +1 -1
  15. package/dist/chunk-EBNJXPHG.js.map +1 -1
  16. package/dist/chunk-EIM5R7AJ.js.map +1 -1
  17. package/dist/chunk-EJTY2ABY.js.map +1 -1
  18. package/dist/chunk-FUYXCJOQ.js.map +1 -1
  19. package/dist/chunk-GRXC46JC.js.map +1 -1
  20. package/dist/chunk-I5INE4KG.js.map +1 -1
  21. package/dist/chunk-K4GMCVHO.js.map +1 -1
  22. package/dist/chunk-LQMOWEA7.js.map +1 -1
  23. package/dist/chunk-ODXDXJ72.js.map +1 -1
  24. package/dist/chunk-RJMIOBXZ.js.map +1 -1
  25. package/dist/chunk-RKRTEMMZ.js.map +1 -1
  26. package/dist/chunk-RRAIGAHU.js.map +1 -1
  27. package/dist/chunk-TDMRUCR6.js.map +1 -1
  28. package/dist/chunk-UJZP6L4S.js.map +1 -1
  29. package/dist/chunk-ULIOO55I.js.map +1 -1
  30. package/dist/chunk-UNR6ATUH.js.map +1 -1
  31. package/dist/chunk-USPGZYMV.js.map +1 -1
  32. package/dist/chunk-VBPIXXIA.js.map +1 -1
  33. package/dist/chunk-WFD523CV.js.map +1 -1
  34. package/dist/chunk-WYRD4UAK.js.map +1 -1
  35. package/dist/chunk-XQILGD5B.js.map +1 -1
  36. package/dist/chunk-XYO4VLMF.js.map +1 -1
  37. package/dist/chunk-Z5V4P3EC.js.map +1 -1
  38. package/dist/components/GeometricFluidGrid.js.map +1 -1
  39. package/dist/components/GlitchLink.js.map +1 -1
  40. package/dist/components/PixelLoad.js.map +1 -1
  41. package/dist/components/TextDecoder.js.map +1 -1
  42. package/dist/components/accordion.js.map +1 -1
  43. package/dist/components/avatar.js.map +1 -1
  44. package/dist/components/breadcrumb.js.map +1 -1
  45. package/dist/components/button.d.mts +2 -2
  46. package/dist/components/button.d.ts +2 -2
  47. package/dist/components/button.js.map +1 -1
  48. package/dist/components/calendar.js.map +1 -1
  49. package/dist/components/card.js.map +1 -1
  50. package/dist/components/checkbox.js.map +1 -1
  51. package/dist/components/combobox.js.map +1 -1
  52. package/dist/components/command.d.mts +1 -1
  53. package/dist/components/command.d.ts +1 -1
  54. package/dist/components/command.js.map +1 -1
  55. package/dist/components/date-picker.js.map +1 -1
  56. package/dist/components/date-range-picker.js.map +1 -1
  57. package/dist/components/dialog.js.map +1 -1
  58. package/dist/components/drawer.js.map +1 -1
  59. package/dist/components/dropdown-menu.js.map +1 -1
  60. package/dist/components/field.js.map +1 -1
  61. package/dist/components/file-upload.js.map +1 -1
  62. package/dist/components/input.js.map +1 -1
  63. package/dist/components/label.js.map +1 -1
  64. package/dist/components/popover.js.map +1 -1
  65. package/dist/components/progress.js.map +1 -1
  66. package/dist/components/radio-group.js.map +1 -1
  67. package/dist/components/scroll-area.js.map +1 -1
  68. package/dist/components/separator.js.map +1 -1
  69. package/dist/components/sheet.js.map +1 -1
  70. package/dist/components/sidebar.js.map +1 -1
  71. package/dist/components/skeleton.js.map +1 -1
  72. package/dist/components/slider.js.map +1 -1
  73. package/dist/components/switch.js.map +1 -1
  74. package/dist/components/table.js.map +1 -1
  75. package/dist/components/tabs.js.map +1 -1
  76. package/dist/components/textarea.js.map +1 -1
  77. package/dist/components/toast.js.map +1 -1
  78. package/dist/components/tooltip.js.map +1 -1
  79. package/dist/components/tree-select.js.map +1 -1
  80. package/dist/index.js.map +1 -1
  81. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-DMMKR6TY.js","../src/components/sidebar.tsx"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SIDEBAR_BANNER_HEIGHT","SidebarContext","SidebarMobileContext","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","bannerHeightProp","className","style","children","props","ref","openMobile","setOpenMobile","isFullyOpen","setIsFullyOpen","isAnimating","setIsAnimating","bannerVisible","setBannerVisible","_open","_setOpen","open","setOpen","value","openState"],"mappings":"AAAA,+8BAAY;AACZ,sDAA4D,sDAAwC,sDAAoE,sDAAwC,sDAAwC,sDAA+C,sDAAwC,uECCxT,iDACF,kEACkB,2CACJ,+CAuNrB,IAlMRA,EAAAA,CAAsB,eAAA,CACtBC,EAAAA,CAAyB,IAAA,CAAU,EAAA,CAAK,CAAA,CACxCC,EAAAA,CAAgB,UAAA,CAChBC,EAAAA,CAAuB,OAAA,CACvBC,EAAAA,CAAqB,sBAAA,CACrBC,EAAAA,CAA4B,GAAA,CAC5BC,EAAAA,CAAwB,MAAA,CAkBxBC,EAAAA,CAAuB,CAAA,CAAA,aAAA,CAA0C,IAAI,CAAA,CACrEC,EAAAA,CAA6B,CAAA,CAAA,aAAA,CAAc,CAAA,CAAK,CAAA,CAEtD,SAASC,CAAAA,CAAAA,CAAa,CACpB,IAAMC,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAAWH,EAA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ui-kit/dist/chunk-DMMKR6TY.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { PanelLeft, X, Menu } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/button\"\nimport { Input } from \"@/components/input\"\nimport { Separator } from \"@/components/separator\"\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"@/components/sheet\"\nimport { Skeleton } from \"@/components/skeleton\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/tooltip\"\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = \"16.75rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"23rem\"\nconst SIDEBAR_WIDTH_ICON = \"calc(3rem + 0.75rem)\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\nconst SIDEBAR_BANNER_HEIGHT = \"55px\"\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\"\n isOpen: boolean\n setOpen: (open: boolean) => void\n openMobile: boolean\n setOpenMobile: (open: boolean) => void\n toggleSidebar: () => void\n toggleMobileSidebar: () => void\n setIsFullyOpen: (open: boolean) => void\n isAnimating: boolean\n setIsAnimating: (animating: boolean) => void\n isBannerClosing: boolean\n bannerVisible: boolean\n setBannerVisible: (visible: boolean) => void\n}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\nconst SidebarMobileContext = React.createContext(false)\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext)\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\")\n }\n\n return context\n}\n\nconst SidebarProvider = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n bannerHeight?: string\n }\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n bannerHeight: bannerHeightProp = SIDEBAR_BANNER_HEIGHT,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const [openMobile, setOpenMobile] = React.useState(false)\n const [isFullyOpen, setIsFullyOpen] = React.useState(defaultOpen)\n const [isAnimating, setIsAnimating] = React.useState(false)\n const [bannerVisible, setBannerVisible] = React.useState(false)\n\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value\n if (setOpenProp) {\n setOpenProp(openState)\n } else {\n _setOpen(openState)\n }\n\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n },\n [setOpenProp, open]\n )\n\n const toggleSidebar = React.useCallback(() => {\n setOpen((open) => !open)\n }, [setOpen])\n\n const toggleMobileSidebar = React.useCallback(() => {\n const mdBreakpoint = getComputedStyle(document.documentElement)\n .getPropertyValue(\"--breakpoint-md\")\n .trim()\n if (\n mdBreakpoint &&\n window.matchMedia(`(min-width: ${mdBreakpoint})`).matches\n ) {\n return\n }\n setOpenMobile((open) => !open)\n }, [setOpenMobile])\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [toggleSidebar])\n\n const state = open ? \"expanded\" : \"collapsed\"\n\n const previousBannerChildrenRef = React.useRef<React.ReactNode[]>([])\n\n // Separate banner children (SidebarBanner) from layout children (Sidebar, SidebarInset)\n const childArray = React.Children.toArray(children)\n const bannerChildren = childArray.filter(\n (child) =>\n React.isValidElement(child) &&\n (child.type as React.FC & { displayName?: string })?.displayName ===\n \"SidebarBanner\"\n )\n const layoutChildren = childArray.filter(\n (child) =>\n !React.isValidElement(child) ||\n (child.type as React.FC & { displayName?: string })?.displayName !==\n \"SidebarBanner\"\n )\n\n // Store previous banner children for closing animation\n if (bannerChildren.length > 0 && bannerVisible) {\n previousBannerChildrenRef.current = bannerChildren\n }\n\n const hasBannerSlot = bannerChildren.length > 0\n const hasBanner = hasBannerSlot && bannerVisible\n const isClosing =\n !hasBanner && previousBannerChildrenRef.current.length > 0\n const displayBanner = hasBannerSlot\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n isOpen: isFullyOpen,\n setOpen,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n toggleMobileSidebar,\n setIsFullyOpen,\n isAnimating,\n setIsAnimating,\n isBannerClosing: isClosing,\n bannerVisible,\n setBannerVisible,\n }),\n [\n state,\n isFullyOpen,\n setOpen,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n toggleMobileSidebar,\n setIsFullyOpen,\n isAnimating,\n setIsAnimating,\n isClosing,\n bannerVisible,\n ]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n \"--sidebar-top\": hasBanner ? bannerHeightProp : \"0px\",\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n displayBanner && \"flex-col\",\n className\n )}\n ref={ref}\n {...props}\n >\n {displayBanner ? (\n <>\n <div\n className=\"relative overflow-hidden transition-[height] duration-200 ease-linear\"\n style={\n {\n height: hasBanner ? bannerHeightProp : \"0px\",\n } as React.CSSProperties\n }\n >\n <div\n className=\"fixed top-0 left-0 right-0 z-20 w-full transition-transform duration-200 ease-linear data-[state=closed]:-translate-y-full\"\n style={{ height: bannerHeightProp }}\n data-state={hasBanner ? \"open\" : \"closed\"}\n onTransitionEnd={() => {\n if (isClosing) {\n previousBannerChildrenRef.current = []\n }\n }}\n >\n {bannerChildren}\n </div>\n </div>\n <div className=\"flex flex-1\">{layoutChildren}</div>\n </>\n ) : (\n children\n )}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n }\n)\nSidebarProvider.displayName = \"SidebarProvider\"\n\nconst SidebarBanner = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"banner\"\n className={cn(\"w-full\", className)}\n {...props}\n />\n )\n})\nSidebarBanner.displayName = \"SidebarBanner\"\n\nconst Sidebar = React.forwardRef<\n HTMLElement,\n React.ComponentProps<\"aside\"> & {\n side?: \"left\" | \"right\"\n variant?: \"sidebar\" | \"floating\" | \"inset\"\n collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n }\n>(\n (\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n const {\n state,\n openMobile,\n setOpenMobile,\n setIsFullyOpen,\n setIsAnimating,\n isBannerClosing,\n } = useSidebar()\n const sidebarRef = React.useRef<HTMLDivElement>(null)\n const isFirstRenderRef = React.useRef(true)\n\n // Track when the sidebar animation completes\n React.useEffect(() => {\n const sidebar = sidebarRef.current\n if (!sidebar) return\n\n // On first render, set isFullyOpen immediately without waiting for animation\n if (isFirstRenderRef.current) {\n isFirstRenderRef.current = false\n setIsFullyOpen(state === \"expanded\")\n setIsAnimating(false)\n return\n }\n\n // Mark as animating when state changes\n setIsAnimating(true)\n\n // Fallback timeout in case transitionend doesn't fire\n const fallbackTimeout = setTimeout(() => {\n setIsFullyOpen(state === \"expanded\")\n setIsAnimating(false)\n }, 300) // Slightly longer than the 200ms transition duration\n\n const handleTransitionEnd = (event: TransitionEvent) => {\n // Only respond to transitions on the sidebar itself, not children\n if (event.target !== sidebar) return\n\n // Check if we're transitioning width, left, or right properties\n if (\n event.propertyName === \"left\" ||\n event.propertyName === \"right\" ||\n event.propertyName === \"width\"\n ) {\n clearTimeout(fallbackTimeout)\n setIsFullyOpen(state === \"expanded\")\n setIsAnimating(false)\n }\n }\n\n sidebar.addEventListener(\"transitionend\", handleTransitionEnd)\n return () => {\n sidebar.removeEventListener(\"transitionend\", handleTransitionEnd)\n clearTimeout(fallbackTimeout)\n }\n }, [state, setIsFullyOpen, setIsAnimating])\n\n if (collapsible === \"none\") {\n return (\n <aside\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </aside>\n )\n }\n\n return (\n <>\n {/* Mobile Sheet - visible only on mobile (< md) */}\n <Sheet open={openMobile} onOpenChange={setOpenMobile}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n className=\"md:hidden bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n width: SIDEBAR_WIDTH_MOBILE,\n maxWidth: SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <SidebarMobileContext.Provider value={true}>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SidebarMobileContext.Provider>\n </SheetContent>\n </Sheet>\n\n {/* Desktop Sidebar - visible only on desktop (md+) */}\n <aside\n ref={ref}\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n >\n {/* Spacer to reserve horizontal space */}\n <div\n className={cn(\n \"w-(--sidebar-width) transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n {/* Fixed sidebar */}\n <div\n ref={sidebarRef}\n data-banner-closing={isBannerClosing}\n className={cn(\n \"fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width,top,height] duration-200 ease-linear md:flex\",\n \"top-(--sidebar-top) h-[calc(100svh-var(--sidebar-top))]\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow\"\n >\n <div className=\"flex flex-col my-2.5 ml-2.5 rounded-2xl border bg-sidebar border-sidebar-border flex-1 min-h-0\">\n {children}\n </div>\n </div>\n </div>\n </aside>\n </>\n )\n }\n)\nSidebar.displayName = \"Sidebar\"\n\nconst SidebarTrigger = React.forwardRef<\n React.ElementRef<typeof Button>,\n React.ComponentProps<typeof Button>\n>(({ className, onClick, ...props }, ref) => {\n const { toggleSidebar, toggleMobileSidebar, openMobile } = useSidebar()\n\n return (\n <>\n {/* Mobile trigger - visible below md */}\n <Button\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"md:hidden bg-transparent hover:bg-transparent\",\n className\n )}\n onClick={(event) => {\n onClick?.(event)\n toggleMobileSidebar()\n }}\n {...props}\n >\n {openMobile ? (\n <span\n className={cn(\n buttonVariants({ variant: \"secondary\", size: \"icon\" })\n )}\n >\n <X size={16} />\n </span>\n ) : (\n <span\n className={cn(buttonVariants({ variant: \"outline\", size: \"icon\" }))}\n >\n <Menu size={16} />\n </span>\n )}\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n\n {/* Desktop trigger - visible at md+ */}\n <Button\n ref={ref}\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"hidden md:inline-flex h-7 w-7\", className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <span className=\"rounded-full p-2\">\n <PanelLeft size={16} />\n </span>\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n </>\n )\n})\nSidebarTrigger.displayName = \"SidebarTrigger\"\n\nconst SidebarRail = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\">\n>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n ref={ref}\n data-sidebar=\"rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarRail.displayName = \"SidebarRail\"\n\nconst SidebarInset = React.memo(\n React.forwardRef<HTMLDivElement, React.ComponentProps<\"main\">>(\n ({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n \"relative flex min-w-0 w-full flex-1 flex-col\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow\",\n className\n )}\n {...props}\n />\n )\n }\n )\n)\nSidebarInset.displayName = \"SidebarInset\"\n\nconst SidebarInput = React.forwardRef<\n React.ElementRef<typeof Input>,\n React.ComponentProps<typeof Input>\n>(({ className, ...props }, ref) => {\n return (\n <Input\n ref={ref}\n data-sidebar=\"input\"\n className={cn(\n \"h-8 w-full bg-sidebar shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarInput.displayName = \"SidebarInput\"\n\nconst SidebarHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showTrigger?: boolean\n }\n>(({ className, showTrigger = false, children, ...props }, ref) => {\n const { state } = useSidebar()\n const isMobile = React.useContext(SidebarMobileContext)\n\n const isCollapsed = state === \"collapsed\" && !isMobile\n\n return (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn(\n \"flex w-full gap-2 p-2 items-center\",\n isCollapsed\n ? \"justify-center items-center\"\n : \"justify-between items-start\",\n className\n )}\n {...props}\n >\n {!isCollapsed && (\n <div className=\"transition-all duration-200 w-full h-fit flex justify-between overflow-hidden\">\n <div className=\"whitespace-nowrap\">{children}</div>\n </div>\n )}\n\n {showTrigger && <SidebarTrigger />}\n </div>\n )\n})\nSidebarHeader.displayName = \"SidebarHeader\"\n\nconst SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n})\nSidebarFooter.displayName = \"SidebarFooter\"\n\nconst SidebarSeparator = React.forwardRef<\n React.ElementRef<typeof Separator>,\n React.ComponentProps<typeof Separator>\n>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-border\", className)}\n {...props}\n />\n )\n})\nSidebarSeparator.displayName = \"SidebarSeparator\"\n\nconst SidebarContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden p-2\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarContent.displayName = \"SidebarContent\"\n\nconst SidebarGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"group\"\n className={cn(\n \"relative flex w-full min-w-0 flex-col\",\n \"group-data-[collapsible=icon]:p-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroup.displayName = \"SidebarGroup\"\n\nconst SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"div\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md text-xs font-medium text-secondary-text outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\"\n\nconst SidebarGroupAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 after:md:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupAction.displayName = \"SidebarGroupAction\"\n\nconst SidebarGroupContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n))\nSidebarGroupContent.displayName = \"SidebarGroupContent\"\n\nconst SidebarMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n))\nSidebarMenu.displayName = \"SidebarMenu\"\n\nconst SidebarMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n))\nSidebarMenuItem.displayName = \"SidebarMenuItem\"\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"\",\n outline:\n \"bg-sidebar shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:!p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n } & VariantProps<typeof sidebarMenuButtonVariants>\n>(\n (\n {\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const { state } = useSidebar()\n\n const button = (\n <Comp\n ref={ref}\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n )\n\n if (!tooltip) {\n return button\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n }\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\"}\n {...tooltip}\n />\n </Tooltip>\n )\n }\n)\nSidebarMenuButton.displayName = \"SidebarMenuButton\"\n\nconst SidebarMenuAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n showOnHover?: boolean\n }\n>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 after:md:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-base-accent-foreground md:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuAction.displayName = \"SidebarMenuAction\"\n\nconst SidebarMenuBadge = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\"\n\nconst SidebarMenuSkeleton = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showIcon?: boolean\n }\n>(({ className, showIcon = false, ...props }, ref) => {\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n }, [])\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n )\n})\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\"\n\nconst SidebarMenuSub = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuSub.displayName = \"SidebarMenuSub\"\n\nconst SidebarMenuSubItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ ...props }, ref) => <li ref={ref} {...props} />)\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\"\n\nconst SidebarMenuSubButton = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<\"a\"> & {\n asChild?: boolean\n size?: \"sm\" | \"md\"\n isActive?: boolean\n }\n>(({ asChild = false, size = \"md\", isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\"\n\nexport {\n Sidebar,\n SidebarBanner,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n}\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-DMMKR6TY.js","../src/components/sidebar.tsx"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SIDEBAR_BANNER_HEIGHT","SidebarContext","SidebarMobileContext","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","bannerHeightProp","className","style","children","props","ref","openMobile","setOpenMobile","isFullyOpen","setIsFullyOpen","isAnimating","setIsAnimating","bannerVisible","setBannerVisible","_open","_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A,QAAA,CAAS,CAAA,CAAK,CAAA,CACpD,CAACC,CAAAA,CAAeC,CAAgB,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAExD,CAACC,CAAAA,CAAOC,CAAQ,CAAA,CAAU,CAAA,CAAA,QAAA,CAASlB,CAAW,CAAA,CAC9CmB,CAAAA,kBAAOlB,CAAAA,SAAYgB,GAAAA,CACnBG,CAAAA,CAAgB,CAAA,CAAA,WAAA,CACnBC,CAAAA,EAAmD,CAClD,IAAMC,CAAAA,CAAY,OAAOD,CAAAA,EAAU,UAAA,CAAaA,CAAAA,CAAMF,CAAI,CAAA,CAAIE,CAAAA,CAC1DnB,CAAAA,CACFA,CAAAA,CAAYoB,CAAS,CAAA,CAErBJ,CAAAA,CAASI,CAAS,CAAA,CAGpB,QAAA,CAAS,MAAA,CAAS,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-DMMKR6TY.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { PanelLeft, X, Menu } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/button\"\nimport { Input } from \"@/components/input\"\nimport { Separator } from \"@/components/separator\"\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"@/components/sheet\"\nimport { Skeleton } from \"@/components/skeleton\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/tooltip\"\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = \"16.75rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"23rem\"\nconst SIDEBAR_WIDTH_ICON = \"calc(3rem + 0.75rem)\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\nconst SIDEBAR_BANNER_HEIGHT = \"55px\"\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\"\n isOpen: boolean\n setOpen: (open: boolean) => void\n openMobile: boolean\n setOpenMobile: (open: boolean) => void\n toggleSidebar: () => void\n toggleMobileSidebar: () => void\n setIsFullyOpen: (open: boolean) => void\n isAnimating: boolean\n setIsAnimating: (animating: boolean) => void\n isBannerClosing: boolean\n bannerVisible: boolean\n setBannerVisible: (visible: boolean) => void\n}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\nconst SidebarMobileContext = React.createContext(false)\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext)\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\")\n }\n\n return context\n}\n\nconst SidebarProvider = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n bannerHeight?: string\n }\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n bannerHeight: bannerHeightProp = SIDEBAR_BANNER_HEIGHT,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const [openMobile, setOpenMobile] = React.useState(false)\n const [isFullyOpen, setIsFullyOpen] = React.useState(defaultOpen)\n const [isAnimating, setIsAnimating] = React.useState(false)\n const [bannerVisible, setBannerVisible] = React.useState(false)\n\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value\n if (setOpenProp) {\n setOpenProp(openState)\n } else {\n _setOpen(openState)\n }\n\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n },\n [setOpenProp, open]\n )\n\n const toggleSidebar = React.useCallback(() => {\n setOpen((open) => !open)\n }, [setOpen])\n\n const toggleMobileSidebar = React.useCallback(() => {\n const mdBreakpoint = getComputedStyle(document.documentElement)\n .getPropertyValue(\"--breakpoint-md\")\n .trim()\n if (\n mdBreakpoint &&\n window.matchMedia(`(min-width: ${mdBreakpoint})`).matches\n ) {\n return\n }\n setOpenMobile((open) => !open)\n }, [setOpenMobile])\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [toggleSidebar])\n\n const state = open ? \"expanded\" : \"collapsed\"\n\n const previousBannerChildrenRef = React.useRef<React.ReactNode[]>([])\n\n // Separate banner children (SidebarBanner) from layout children (Sidebar, SidebarInset)\n const childArray = React.Children.toArray(children)\n const bannerChildren = childArray.filter(\n (child) =>\n React.isValidElement(child) &&\n (child.type as React.FC & { displayName?: string })?.displayName ===\n \"SidebarBanner\"\n )\n const layoutChildren = childArray.filter(\n (child) =>\n !React.isValidElement(child) ||\n (child.type as React.FC & { displayName?: string })?.displayName !==\n \"SidebarBanner\"\n )\n\n // Store previous banner children for closing animation\n if (bannerChildren.length > 0 && bannerVisible) {\n previousBannerChildrenRef.current = bannerChildren\n }\n\n const hasBannerSlot = bannerChildren.length > 0\n const hasBanner = hasBannerSlot && bannerVisible\n const isClosing =\n !hasBanner && previousBannerChildrenRef.current.length > 0\n const displayBanner = hasBannerSlot\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n isOpen: isFullyOpen,\n setOpen,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n toggleMobileSidebar,\n setIsFullyOpen,\n isAnimating,\n setIsAnimating,\n isBannerClosing: isClosing,\n bannerVisible,\n setBannerVisible,\n }),\n [\n state,\n isFullyOpen,\n setOpen,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n toggleMobileSidebar,\n setIsFullyOpen,\n isAnimating,\n setIsAnimating,\n isClosing,\n bannerVisible,\n ]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n \"--sidebar-top\": hasBanner ? bannerHeightProp : \"0px\",\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n displayBanner && \"flex-col\",\n className\n )}\n ref={ref}\n {...props}\n >\n {displayBanner ? (\n <>\n <div\n className=\"relative overflow-hidden transition-[height] duration-200 ease-linear\"\n style={\n {\n height: hasBanner ? bannerHeightProp : \"0px\",\n } as React.CSSProperties\n }\n >\n <div\n className=\"fixed top-0 left-0 right-0 z-20 w-full transition-transform duration-200 ease-linear data-[state=closed]:-translate-y-full\"\n style={{ height: bannerHeightProp }}\n data-state={hasBanner ? \"open\" : \"closed\"}\n onTransitionEnd={() => {\n if (isClosing) {\n previousBannerChildrenRef.current = []\n }\n }}\n >\n {bannerChildren}\n </div>\n </div>\n <div className=\"flex flex-1\">{layoutChildren}</div>\n </>\n ) : (\n children\n )}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n }\n)\nSidebarProvider.displayName = \"SidebarProvider\"\n\nconst SidebarBanner = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"banner\"\n className={cn(\"w-full\", className)}\n {...props}\n />\n )\n})\nSidebarBanner.displayName = \"SidebarBanner\"\n\nconst Sidebar = React.forwardRef<\n HTMLElement,\n React.ComponentProps<\"aside\"> & {\n side?: \"left\" | \"right\"\n variant?: \"sidebar\" | \"floating\" | \"inset\"\n collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n }\n>(\n (\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n const {\n state,\n openMobile,\n setOpenMobile,\n setIsFullyOpen,\n setIsAnimating,\n isBannerClosing,\n } = useSidebar()\n const sidebarRef = React.useRef<HTMLDivElement>(null)\n const isFirstRenderRef = React.useRef(true)\n\n // Track when the sidebar animation completes\n React.useEffect(() => {\n const sidebar = sidebarRef.current\n if (!sidebar) return\n\n // On first render, set isFullyOpen immediately without waiting for animation\n if (isFirstRenderRef.current) {\n isFirstRenderRef.current = false\n setIsFullyOpen(state === \"expanded\")\n setIsAnimating(false)\n return\n }\n\n // Mark as animating when state changes\n setIsAnimating(true)\n\n // Fallback timeout in case transitionend doesn't fire\n const fallbackTimeout = setTimeout(() => {\n setIsFullyOpen(state === \"expanded\")\n setIsAnimating(false)\n }, 300) // Slightly longer than the 200ms transition duration\n\n const handleTransitionEnd = (event: TransitionEvent) => {\n // Only respond to transitions on the sidebar itself, not children\n if (event.target !== sidebar) return\n\n // Check if we're transitioning width, left, or right properties\n if (\n event.propertyName === \"left\" ||\n event.propertyName === \"right\" ||\n event.propertyName === \"width\"\n ) {\n clearTimeout(fallbackTimeout)\n setIsFullyOpen(state === \"expanded\")\n setIsAnimating(false)\n }\n }\n\n sidebar.addEventListener(\"transitionend\", handleTransitionEnd)\n return () => {\n sidebar.removeEventListener(\"transitionend\", handleTransitionEnd)\n clearTimeout(fallbackTimeout)\n }\n }, [state, setIsFullyOpen, setIsAnimating])\n\n if (collapsible === \"none\") {\n return (\n <aside\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </aside>\n )\n }\n\n return (\n <>\n {/* Mobile Sheet - visible only on mobile (< md) */}\n <Sheet open={openMobile} onOpenChange={setOpenMobile}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n className=\"md:hidden bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n width: SIDEBAR_WIDTH_MOBILE,\n maxWidth: SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <SidebarMobileContext.Provider value={true}>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SidebarMobileContext.Provider>\n </SheetContent>\n </Sheet>\n\n {/* Desktop Sidebar - visible only on desktop (md+) */}\n <aside\n ref={ref}\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n >\n {/* Spacer to reserve horizontal space */}\n <div\n className={cn(\n \"w-(--sidebar-width) transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n {/* Fixed sidebar */}\n <div\n ref={sidebarRef}\n data-banner-closing={isBannerClosing}\n className={cn(\n \"fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width,top,height] duration-200 ease-linear md:flex\",\n \"top-(--sidebar-top) h-[calc(100svh-var(--sidebar-top))]\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow\"\n >\n <div className=\"flex flex-col my-2.5 ml-2.5 rounded-2xl border bg-sidebar border-sidebar-border flex-1 min-h-0\">\n {children}\n </div>\n </div>\n </div>\n </aside>\n </>\n )\n }\n)\nSidebar.displayName = \"Sidebar\"\n\nconst SidebarTrigger = React.forwardRef<\n React.ElementRef<typeof Button>,\n React.ComponentProps<typeof Button>\n>(({ className, onClick, ...props }, ref) => {\n const { toggleSidebar, toggleMobileSidebar, openMobile } = useSidebar()\n\n return (\n <>\n {/* Mobile trigger - visible below md */}\n <Button\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"md:hidden bg-transparent hover:bg-transparent\",\n className\n )}\n onClick={(event) => {\n onClick?.(event)\n toggleMobileSidebar()\n }}\n {...props}\n >\n {openMobile ? (\n <span\n className={cn(\n buttonVariants({ variant: \"secondary\", size: \"icon\" })\n )}\n >\n <X size={16} />\n </span>\n ) : (\n <span\n className={cn(buttonVariants({ variant: \"outline\", size: \"icon\" }))}\n >\n <Menu size={16} />\n </span>\n )}\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n\n {/* Desktop trigger - visible at md+ */}\n <Button\n ref={ref}\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"hidden md:inline-flex h-7 w-7\", className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <span className=\"rounded-full p-2\">\n <PanelLeft size={16} />\n </span>\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n </>\n )\n})\nSidebarTrigger.displayName = \"SidebarTrigger\"\n\nconst SidebarRail = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\">\n>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n ref={ref}\n data-sidebar=\"rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarRail.displayName = \"SidebarRail\"\n\nconst SidebarInset = React.memo(\n React.forwardRef<HTMLDivElement, React.ComponentProps<\"main\">>(\n ({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n \"relative flex min-w-0 w-full flex-1 flex-col\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow\",\n className\n )}\n {...props}\n />\n )\n }\n )\n)\nSidebarInset.displayName = \"SidebarInset\"\n\nconst SidebarInput = React.forwardRef<\n React.ElementRef<typeof Input>,\n React.ComponentProps<typeof Input>\n>(({ className, ...props }, ref) => {\n return (\n <Input\n ref={ref}\n data-sidebar=\"input\"\n className={cn(\n \"h-8 w-full bg-sidebar shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarInput.displayName = \"SidebarInput\"\n\nconst SidebarHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showTrigger?: boolean\n }\n>(({ className, showTrigger = false, children, ...props }, ref) => {\n const { state } = useSidebar()\n const isMobile = React.useContext(SidebarMobileContext)\n\n const isCollapsed = state === \"collapsed\" && !isMobile\n\n return (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn(\n \"flex w-full gap-2 p-2 items-center\",\n isCollapsed\n ? \"justify-center items-center\"\n : \"justify-between items-start\",\n className\n )}\n {...props}\n >\n {!isCollapsed && (\n <div className=\"transition-all duration-200 w-full h-fit flex justify-between overflow-hidden\">\n <div className=\"whitespace-nowrap\">{children}</div>\n </div>\n )}\n\n {showTrigger && <SidebarTrigger />}\n </div>\n )\n})\nSidebarHeader.displayName = \"SidebarHeader\"\n\nconst SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n})\nSidebarFooter.displayName = \"SidebarFooter\"\n\nconst SidebarSeparator = React.forwardRef<\n React.ElementRef<typeof Separator>,\n React.ComponentProps<typeof Separator>\n>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-border\", className)}\n {...props}\n />\n )\n})\nSidebarSeparator.displayName = \"SidebarSeparator\"\n\nconst SidebarContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden p-2\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarContent.displayName = \"SidebarContent\"\n\nconst SidebarGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"group\"\n className={cn(\n \"relative flex w-full min-w-0 flex-col\",\n \"group-data-[collapsible=icon]:p-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroup.displayName = \"SidebarGroup\"\n\nconst SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"div\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md text-xs font-medium text-secondary-text outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\"\n\nconst SidebarGroupAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 after:md:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupAction.displayName = \"SidebarGroupAction\"\n\nconst SidebarGroupContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n))\nSidebarGroupContent.displayName = \"SidebarGroupContent\"\n\nconst SidebarMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n))\nSidebarMenu.displayName = \"SidebarMenu\"\n\nconst SidebarMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n))\nSidebarMenuItem.displayName = \"SidebarMenuItem\"\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"\",\n outline:\n \"bg-sidebar shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:!p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n } & VariantProps<typeof sidebarMenuButtonVariants>\n>(\n (\n {\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const { state } = useSidebar()\n\n const button = (\n <Comp\n ref={ref}\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n )\n\n if (!tooltip) {\n return button\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n }\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\"}\n {...tooltip}\n />\n </Tooltip>\n )\n }\n)\nSidebarMenuButton.displayName = \"SidebarMenuButton\"\n\nconst SidebarMenuAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n showOnHover?: boolean\n }\n>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 after:md:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-base-accent-foreground md:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuAction.displayName = \"SidebarMenuAction\"\n\nconst SidebarMenuBadge = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\"\n\nconst SidebarMenuSkeleton = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showIcon?: boolean\n }\n>(({ className, showIcon = false, ...props }, ref) => {\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n }, [])\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n )\n})\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\"\n\nconst SidebarMenuSub = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuSub.displayName = \"SidebarMenuSub\"\n\nconst SidebarMenuSubItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ ...props }, ref) => <li ref={ref} {...props} />)\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\"\n\nconst SidebarMenuSubButton = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<\"a\"> & {\n asChild?: boolean\n size?: \"sm\" | \"md\"\n isActive?: boolean\n }\n>(({ asChild = false, size = \"md\", isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\"\n\nexport {\n Sidebar,\n SidebarBanner,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-EBNJXPHG.js","../src/components/TextDecoder.tsx"],"names":["SYMBOLS","randomChar","symbols","extractText","node","React","props","injectScrambledText","scrambledChars","indexObj","text","result","i","jsx"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,4ECOhC,+CAgCC,IA9BFA,CAAAA,CAAU,kCAAA,CAEVC,CAAAA,CAAcC,CAAAA,EAClBA,CAAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,CAAA,CAAIA,CAAAA,CAAQ,MAAM,CAAC,CAAA,CAE9CC,CAAAA,CAAeC,CAAAA,EAA4B,CAC/C,EAAA,CAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAAU,OAAO,MAAA,CAAOA,CAAI,CAAA,CAC5E,EAAA,CAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CAAG,OAAOA,CAAAA,CAAK,GAAA,CAAID,CAAW,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CAC7D,EAAA,CAAIE,eAAAA,CAAM,cAAA,CAAeD,CAAI,CAAA,CAAG,CAC9B,IAAME,CAAAA,CAAQF,CAAAA,CAAK,KAAA,CACnB,MAAA,CACGE,CAAAA,CAAM,IAAA,EAAQ,EAAA,CAAA,CAAA,CACdA,CAAAA,CAAM,KAAA,EAAS,EAAA,CAAA,CAAA,CACfA,CAAAA,CAAM,KAAA,EAAS,EAAA,CAAA,CAChBH,CAAAA,CAAYG,CAAAA,CAAM,QAAQ,CAE9B,CACA,MAAO,EACT,CAAA,CAEMC,CAAAA,CAAsB,CAC1BH,CAAAA,CACAI,CAAAA,CACAC,CAAAA,CAAAA,EACc,CACd,EAAA,CAAI,OAAOL,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAAU,CACxD,IAAMM,CAAAA,CAAO,MAAA,CAAON,CAAI,CAAA,CAClBO,CAAAA,CAAiC,CAAC,CAAA,CACxC,GAAA,CAAA,IAASC,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAIF,CAAAA,CAAK,MAAA,CAAQE,CAAAA,EAAAA,CAC/BD,CAAAA,CAAO,IAAA,CACLE,6BAAAA,eAACR,CAAM,QAAA,CAAN,CACE,QAAA,CAAAG,CAAAA,CAAeC,CAAAA,CAAS,OAAO,CAAA,EAAK,EAAA,CAAA,CADlB,CAAA,KAAA,EAAQA,CAAAA,CAAS,OAAO,CAAA,CAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-EBNJXPHG.js","sourcesContent":[null,"\"use client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\n ReactNode,\n} from \"react\"\n\nconst SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\nconst randomChar = (symbols: string) =>\n symbols[Math.floor(Math.random() * symbols.length)]\n\nconst extractText = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(extractText).join(\"\")\n if (React.isValidElement(node)) {\n const props = node.props as any\n return (\n (props.text || \"\") +\n (props.label || \"\") +\n (props.title || \"\") +\n extractText(props.children)\n )\n }\n return \"\"\n}\n\nconst injectScrambledText = (\n node: ReactNode,\n scrambledChars: (string | ReactNode)[],\n indexObj: { current: number }\n): ReactNode => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n const text = String(node)\n const result: (string | ReactNode)[] = []\n for (let i = 0; i < text.length; i++) {\n result.push(\n <React.Fragment key={`char-${indexObj.current}`}>\n {scrambledChars[indexObj.current] || \"\"}\n </React.Fragment>\n )\n indexObj.current++\n }\n return result\n }\n\n if (Array.isArray(node)) {\n return node.map((child, idx) => (\n <React.Fragment key={`arr-${idx}-${indexObj.current}`}>\n {injectScrambledText(child, scrambledChars, indexObj)}\n </React.Fragment>\n ))\n }\n\n if (React.isValidElement(node)) {\n const props = node.props as any\n const newProps: any = {}\n\n if (props.children) {\n newProps.children = injectScrambledText(\n props.children,\n scrambledChars,\n indexObj\n )\n }\n return React.cloneElement(node, newProps)\n }\n return node\n}\n\nexport interface TextDecoderProps {\n children: ReactNode\n className?: string\n duration?: number\n symbols?: string\n delay?: number\n isLoading?: boolean\n speed?: number\n hoverContent?: ReactNode\n}\n\nexport default function TextDecoder ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n isLoading = false,\n speed = 0.28,\n hoverContent,\n}: TextDecoderProps) {\n const [outputNodes, setOutputNodes] = useState<ReactNode>(null)\n const [isComplete, setIsComplete] = useState(false)\n const [targetContent, setTargetContent] = useState<ReactNode>(children)\n const elementRef = useRef<HTMLSpanElement>(null)\n const frameRef = useRef(0)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n const rafRef = useRef<number | null>(null)\n const hasAnimatedRef = useRef(false)\n\n const fullText = useMemo(() => extractText(targetContent), [targetContent])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < fullText.length; i++) {\n const to = fullText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n frameRef.current = 0\n setIsComplete(false)\n }\n\n const loadingCharsRef = useRef<(string | undefined)[]>([])\n\n const updateLoading = () => {\n const currentScrambledChars: (string | ReactNode)[] = []\n\n if (loadingCharsRef.current.length !== fullText.length) {\n loadingCharsRef.current = new Array(fullText.length).fill(undefined)\n }\n\n for (let i = 0; i < fullText.length; i++) {\n const char = fullText[i]\n\n if (char === \" \") {\n currentScrambledChars.push(\" \")\n } else {\n if (!loadingCharsRef.current[i] || Math.random() < speed) {\n loadingCharsRef.current[i] = randomChar(symbols)\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {char}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none\">\n {loadingCharsRef.current[i]}\n </span>\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(targetContent, currentScrambledChars, indexObj)\n )\n\n rafRef.current = requestAnimationFrame(updateLoading)\n }\n\n const update = () => {\n let complete = 0\n const currentScrambledChars: (string | ReactNode)[] = []\n\n for (let i = 0; i < queueRef.current.length; i++) {\n const item = queueRef.current[i]\n\n if (frameRef.current >= item.end) {\n complete++\n currentScrambledChars.push(item.to)\n } else {\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < speed) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none\">\n {item.char}\n </span>\n )}\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(targetContent, currentScrambledChars, indexObj)\n )\n\n if (complete === queueRef.current.length) {\n setIsComplete(true)\n } else {\n frameRef.current++\n rafRef.current = requestAnimationFrame(update)\n }\n }\n\n const triggerAnimation = (content: ReactNode) => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setTargetContent(content)\n setIsComplete(false)\n }\n\n const wasLoadingRef = useRef(false)\n\n useEffect(() => {\n if (isLoading) {\n wasLoadingRef.current = true\n hasAnimatedRef.current = true\n setIsComplete(false)\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n rafRef.current = requestAnimationFrame(updateLoading)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n\n if (wasLoadingRef.current) {\n wasLoadingRef.current = false\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n }, [isLoading, fullText])\n\n useEffect(() => {\n if (isLoading) return\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting && !hasAnimatedRef.current) {\n hasAnimatedRef.current = true\n const timeoutId = setTimeout(() => {\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n }, delay)\n return () => clearTimeout(timeoutId)\n }\n },\n { threshold: 0.1 }\n )\n\n if (elementRef.current) observer.observe(elementRef.current)\n\n return () => {\n observer.disconnect()\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [fullText, delay, isLoading])\n\n // Handle hover mode animation triggers\n useEffect(() => {\n if (!hoverContent || isLoading || !hasAnimatedRef.current) return\n\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [targetContent])\n\n const handleMouseEnter = () => {\n if (!hoverContent) return\n triggerAnimation(hoverContent)\n }\n\n const handleMouseLeave = () => {\n if (!hoverContent) return\n triggerAnimation(children)\n }\n\n return (\n <span\n ref={elementRef}\n className={cn(\"inline-block whitespace-pre-wrap\", className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {isComplete ? targetContent : outputNodes}\n </span>\n )\n}\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EBNJXPHG.js","../src/components/TextDecoder.tsx"],"names":["SYMBOLS","randomChar","symbols","extractText","node","React","props","injectScrambledText","scrambledChars","indexObj","text","result","i","jsx"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,4ECOhC,+CAgCC,IA9BFA,CAAAA,CAAU,kCAAA,CAEVC,CAAAA,CAAcC,CAAAA,EAClBA,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CAAA,KAAA,EAAQA,CAAAA,CAAS,OAAO,CAAA,CAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EBNJXPHG.js","sourcesContent":[null,"\"use client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\n ReactNode,\n} from \"react\"\n\nconst SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\nconst randomChar = (symbols: string) =>\n symbols[Math.floor(Math.random() * symbols.length)]\n\nconst extractText = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(extractText).join(\"\")\n if (React.isValidElement(node)) {\n const props = node.props as any\n return (\n (props.text || \"\") +\n (props.label || \"\") +\n (props.title || \"\") +\n extractText(props.children)\n )\n }\n return \"\"\n}\n\nconst injectScrambledText = (\n node: ReactNode,\n scrambledChars: (string | ReactNode)[],\n indexObj: { current: number }\n): ReactNode => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n const text = String(node)\n const result: (string | ReactNode)[] = []\n for (let i = 0; i < text.length; i++) {\n result.push(\n <React.Fragment key={`char-${indexObj.current}`}>\n {scrambledChars[indexObj.current] || \"\"}\n </React.Fragment>\n )\n indexObj.current++\n }\n return result\n }\n\n if (Array.isArray(node)) {\n return node.map((child, idx) => (\n <React.Fragment key={`arr-${idx}-${indexObj.current}`}>\n {injectScrambledText(child, scrambledChars, indexObj)}\n </React.Fragment>\n ))\n }\n\n if (React.isValidElement(node)) {\n const props = node.props as any\n const newProps: any = {}\n\n if (props.children) {\n newProps.children = injectScrambledText(\n props.children,\n scrambledChars,\n indexObj\n )\n }\n return React.cloneElement(node, newProps)\n }\n return node\n}\n\nexport interface TextDecoderProps {\n children: ReactNode\n className?: string\n duration?: number\n symbols?: string\n delay?: number\n isLoading?: boolean\n speed?: number\n hoverContent?: ReactNode\n}\n\nexport default function TextDecoder ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n isLoading = false,\n speed = 0.28,\n hoverContent,\n}: TextDecoderProps) {\n const [outputNodes, setOutputNodes] = useState<ReactNode>(null)\n const [isComplete, setIsComplete] = useState(false)\n const [targetContent, setTargetContent] = useState<ReactNode>(children)\n const elementRef = useRef<HTMLSpanElement>(null)\n const frameRef = useRef(0)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n const rafRef = useRef<number | null>(null)\n const hasAnimatedRef = useRef(false)\n\n const fullText = useMemo(() => extractText(targetContent), [targetContent])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < fullText.length; i++) {\n const to = fullText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n frameRef.current = 0\n setIsComplete(false)\n }\n\n const loadingCharsRef = useRef<(string | undefined)[]>([])\n\n const updateLoading = () => {\n const currentScrambledChars: (string | ReactNode)[] = []\n\n if (loadingCharsRef.current.length !== fullText.length) {\n loadingCharsRef.current = new Array(fullText.length).fill(undefined)\n }\n\n for (let i = 0; i < fullText.length; i++) {\n const char = fullText[i]\n\n if (char === \" \") {\n currentScrambledChars.push(\" \")\n } else {\n if (!loadingCharsRef.current[i] || Math.random() < speed) {\n loadingCharsRef.current[i] = randomChar(symbols)\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {char}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none\">\n {loadingCharsRef.current[i]}\n </span>\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(targetContent, currentScrambledChars, indexObj)\n )\n\n rafRef.current = requestAnimationFrame(updateLoading)\n }\n\n const update = () => {\n let complete = 0\n const currentScrambledChars: (string | ReactNode)[] = []\n\n for (let i = 0; i < queueRef.current.length; i++) {\n const item = queueRef.current[i]\n\n if (frameRef.current >= item.end) {\n complete++\n currentScrambledChars.push(item.to)\n } else {\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < speed) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none\">\n {item.char}\n </span>\n )}\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(targetContent, currentScrambledChars, indexObj)\n )\n\n if (complete === queueRef.current.length) {\n setIsComplete(true)\n } else {\n frameRef.current++\n rafRef.current = requestAnimationFrame(update)\n }\n }\n\n const triggerAnimation = (content: ReactNode) => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setTargetContent(content)\n setIsComplete(false)\n }\n\n const wasLoadingRef = useRef(false)\n\n useEffect(() => {\n if (isLoading) {\n wasLoadingRef.current = true\n hasAnimatedRef.current = true\n setIsComplete(false)\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n rafRef.current = requestAnimationFrame(updateLoading)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n\n if (wasLoadingRef.current) {\n wasLoadingRef.current = false\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n }, [isLoading, fullText])\n\n useEffect(() => {\n if (isLoading) return\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting && !hasAnimatedRef.current) {\n hasAnimatedRef.current = true\n const timeoutId = setTimeout(() => {\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n }, delay)\n return () => clearTimeout(timeoutId)\n }\n },\n { threshold: 0.1 }\n )\n\n if (elementRef.current) observer.observe(elementRef.current)\n\n return () => {\n observer.disconnect()\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [fullText, delay, isLoading])\n\n // Handle hover mode animation triggers\n useEffect(() => {\n if (!hoverContent || isLoading || !hasAnimatedRef.current) return\n\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [targetContent])\n\n const handleMouseEnter = () => {\n if (!hoverContent) return\n triggerAnimation(hoverContent)\n }\n\n const handleMouseLeave = () => {\n if (!hoverContent) return\n triggerAnimation(children)\n }\n\n return (\n <span\n ref={elementRef}\n className={cn(\"inline-block whitespace-pre-wrap\", className)}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {isComplete ? targetContent : outputNodes}\n </span>\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-EIM5R7AJ.js","../src/components/dropdown-menu.tsx"],"names":["DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"AAAA,uWAAY;AACZ,sDAAkC,uECCX,uHACgB,2CACK,+CAsB1C,IAlBIA,CAAAA,CAAqC,CAAA,CAAA,IAAA,CAErCC,CAAAA,aAA4C,CAAA,CAAA,OAAA,CAE5CC,CAAAA,aAA0C,CAAA,CAAA,KAAA,CAE1CC,CAAAA,aAA2C,CAAA,CAAA,MAAA,CAE3CC,CAAAA,aAAwC,CAAA,CAAA,GAAA,CAExCC,CAAAA,aAA+C,CAAA,CAAA,UAAA,CAE/CC,CAAAA,aAA+B,CAAA,CAAA,UAAA,CAKnC,CAAC,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,CAAAA,CAAsB,WAAA,CAAoC,CAAA,CAAA,SAAA,CAAU,WAAA,CAEpE,IAAMC,CAAAA,CAAuB,CAAC,CAC5B,SAAA,CAAApB,CAAAA,CACA,GAAGG,CACL,CAAA,CAAA,EAEII,6BAAAA,MAAC,CAAA,CACC,SAAA,CAAWD,gCAAAA,4CAAG,CAA8CN,CAAS,CAAA,CACpE,GAAGG,CAAAA,CACN,CAAA,CAGJiB,CAAAA,CAAqB,WAAA,CAAc,sBAAA,CAAA,gOAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-EIM5R7AJ.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-[12px] px-2 py-1.5 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-[state=open]:bg-secondary\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-dropdown-menu p-1 text-dropdown-menu-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-xl border border-border bg-dropdown-menu p-1 text-dropdown-menu-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-[12px] p-2 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-[12px] py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-[12px] py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EIM5R7AJ.js","../src/components/dropdown-menu.tsx"],"names":["DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"AAAA,uWAAY;AACZ,sDAAkC,uECCX,uHACgB,2CACK,+CAsB1C,IAlBIA,CAAAA,CAAqC,CAAA,CAAA,IAAA,CAErCC,CAAAA,aAA4C,CAAA,CAAA,OAAA,CAE5CC,CAAAA,aAA0C,CAAA,CAAA,KAAA,CAE1CC,CAAAA,aAA2C,CAAA,CAAA,MAAA,CAE3CC,CAAAA,aAAwC,CAAA,CAAA,GAAA,CAExCC,CAAAA,aAA+C,CAAA,CAAA,UAAA,CAE/CC,CAAAA,aAA+B,CAAA,CAAA,UAAA,CAKnC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAO,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC3CC,8BAAAA,CAAuB,CAAA,UAAA,CAAtB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,uMACT,CACAL,CAAAA,EAAS,MAAA,CACTD,CACF,CAAA,CACC,GAAGG,CAAAA,CAEH,QAAA,CAAA,CAAAD,CAAAA,CACDK,6BAAAA,yBAACC,CAAA,CAAa,SAAA,CAAU,iBAAA,CAAkB,CAAA,CAAA,CAC5C,CACD,CAAA,CACDT,CAAAA,CAAuB,WAAA,CACC,CAAA,CAAA,UAAA,CAAW,WAAA,CAEnC,IAAMU,CAAAA,CAA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oC,CAAA,CAAA,SAAA,CAAU,WAAA,CAEpE,IAAME,CAAAA,CAA0B,CAAA,CAAA,UAAA,CAK9B,CAAC,CAAE,SAAA,CAAAlB,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAO,GAAGE,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACjCG,6BAAAA,CAAuB,CAAA,KAAA,CAAtB,CACC,GAAA,CAAKH,CAAAA,CACL,SAAA,CAAWE,gCAAAA,mCACT,CACAL,CAAAA,EAAS,MAAA,CACTD,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CACD,CAAA,CACDe,CAAAA,CAAkB,WAAA,CAAoC,CAAA,CAAA,KAAA,CAAM,WAAA,CAE5D,IAAMC,CAAAA,CAA8B,CAAA,CAAA,UAAA,CAGlC,CAAC,CAAE,SAAA,CAAAnB,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BG,6BAAAA,CAAuB,CAAA,SAAA,CAAtB,CACC,GAAA,CAAKH,CAAAA,CACL,SAAA,CAAWE,gCAAAA,0BAAG,CAA4BN,CAAS,CAAA,CAClD,GAAGG,CAAAA,CACN,CACD,CAAA,CACDgB,CAAAA,CAAsB,WAAA,CAAoC,CAAA,CAAA,SAAA,CAAU,WAAA,CAEpE,IAAMC,CAAAA,CAAuB,CAAC,CAC5B,SAAA,CAAApB,CAAAA,CACA,GAAGG,CACL,CAAA,CAAA,EAEII,6BAAAA,MAAC,CAAA,CACC,SAAA,CAAWD,gCAAAA,4CAAG,CAA8CN,CAAS,CAAA,CACpE,GAAGG,CAAAA,CACN,CAAA,CAGJiB,CAAAA,CAAqB,WAAA,CAAc,sBAAA,CAAA,gOAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EIM5R7AJ.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-[12px] px-2 py-1.5 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-[state=open]:bg-secondary\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-dropdown-menu p-1 text-dropdown-menu-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-xl border border-border bg-dropdown-menu p-1 text-dropdown-menu-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-[12px] p-2 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-[12px] py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-[12px] py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-secondary focus:bg-secondary active:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-EJTY2ABY.js","../src/components/GlitchLink.tsx"],"names":["DEFAULT_SYMBOLS","GlitchLink","href","children","symbols","className","asChild","duration","props","isHovering","setIsHovering","useState","frame","setFrame","rafRef","useRef","queueRef","getTextContent","node","isValidElement","originalText","useMemo","setupQueue","newQueue","i","to","start","end","useEffect","update","prev","renderContent","char","item","jsx","jsxs","commonProps","cn","e","target"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,6ECAtB,4EAQV,iDACc,+CAmFN,IAhFFA,CAAAA,CAAkB,kCAAA,CAWzBC,CAAAA,CAAa,CAAC,CAClB,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,OAAA,CAA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riukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-EJTY2ABY.js","sourcesContent":[null,"\"use client\"\nimport Link from \"next/link\"\nimport React, {\n useState,\n useEffect,\n useRef,\n ReactNode,\n isValidElement,\n useMemo,\n} from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cn } from \"@/lib/utils\"\n\nexport const DEFAULT_SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\ntype GlitchLinkProps = {\n href?: string\n children: ReactNode\n symbols?: string\n className?: string\n asChild?: boolean\n duration?: number\n}\n\nconst GlitchLink = ({\n href,\n children,\n symbols = DEFAULT_SYMBOLS,\n className,\n asChild = false,\n duration = 40,\n ...props\n}: GlitchLinkProps) => {\n const [isHovering, setIsHovering] = useState(false)\n const [frame, setFrame] = useState(0)\n const rafRef = useRef<number | null>(null)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n\n const getTextContent = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\")\n return String(node)\n if (isValidElement(node)) {\n const children = (node.props as any).children\n if (children) return getTextContent(children)\n }\n return \"\"\n }\n\n const originalText = useMemo(() => getTextContent(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < originalText.length; i++) {\n const to = originalText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n setFrame(0)\n }\n\n useEffect(() => {\n if (isHovering && originalText) {\n setupQueue()\n const update = () => {\n setFrame((prev) => prev + 1)\n rafRef.current = requestAnimationFrame(update)\n }\n rafRef.current = requestAnimationFrame(update)\n } else {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setFrame(0)\n }\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [isHovering, originalText])\n\n const renderContent = () => {\n // When not hovering, just render children as-is\n if (!isHovering) {\n return children\n }\n\n // When hovering, apply glitch effect to the text\n return originalText.split(\"\").map((char, i) => {\n const item = queueRef.current[i]\n\n // If animation for this char hasn't started, or it's finished\n if (!item || frame >= item.end) {\n return <span key={i}>{char}</span>\n }\n\n // If we are in the scrambling phase for this specific character\n if (frame >= item.start) {\n // Don't scramble spaces, just render them\n if (char === \" \") {\n return <span key={i}> </span>\n }\n\n if (!item.char || Math.random() < 0.28) {\n item.char = symbols[Math.floor(Math.random() * symbols.length)]\n }\n return (\n <span key={i} className=\"relative inline-block\">\n {/* The invisible real character preserves the exact width */}\n <span className=\"invisible opacity-0\" aria-hidden=\"true\">\n {char}\n </span>\n {/* The absolute symbol sits exactly on top of that width */}\n <span className=\"absolute inset-0 flex items-center justify-center font-mono opacity-50\">\n {item.char}\n </span>\n </span>\n )\n }\n\n // Default: show original character\n return <span key={i}>{char}</span>\n })\n }\n\n const commonProps = {\n className: cn(\"inline-block whitespace-nowrap\", className),\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget\n if (target && !target.style.width) {\n target.style.width = `${target.offsetWidth}px`\n }\n setIsHovering(true)\n },\n onMouseLeave: () => setIsHovering(false),\n ...props,\n }\n\n if (asChild && isValidElement(children)) {\n return (\n <Slot {...commonProps}>\n {React.cloneElement(children as any, {}, renderContent())}\n </Slot>\n )\n }\n\n // If no href is provided, render as a span instead of a Link\n if (!href) {\n return <span {...commonProps}>{renderContent()}</span>\n }\n\n return (\n <Link href={href} {...commonProps}>\n {renderContent()}\n </Link>\n )\n}\n\nexport default GlitchLink\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EJTY2ABY.js","../src/components/GlitchLink.tsx"],"names":["DEFAULT_SYMBOLS","GlitchLink","href","children","symbols","className","asChild","duration","props","isHovering","setIsHovering","useState","frame","setFrame","rafRef","useRef","queueRef","getTextContent","node","isValidElement","originalText","useMemo","setupQueue","newQueue","i","to","start","end","useEffect","update","prev","renderContent","char","item","jsx","jsxs","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A,CAAeiC,CAAAA,EAAqC,CAClD,IAAMC,CAAAA,CAASD,CAAAA,CAAE,aAAA,CACbC,CAAAA,EAAU,CAACA,CAAAA,CAAO,KAAA,CAAM,KAAA,EAAA,CAC1BA,CAAAA,CAAO,KAAA,CAAM,KAAA,CAAQ,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EJTY2ABY.js","sourcesContent":[null,"\"use client\"\nimport Link from \"next/link\"\nimport React, {\n useState,\n useEffect,\n useRef,\n ReactNode,\n isValidElement,\n useMemo,\n} from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cn } from \"@/lib/utils\"\n\nexport const DEFAULT_SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\ntype GlitchLinkProps = {\n href?: string\n children: ReactNode\n symbols?: string\n className?: string\n asChild?: boolean\n duration?: number\n}\n\nconst GlitchLink = ({\n href,\n children,\n symbols = DEFAULT_SYMBOLS,\n className,\n asChild = false,\n duration = 40,\n ...props\n}: GlitchLinkProps) => {\n const [isHovering, setIsHovering] = useState(false)\n const [frame, setFrame] = useState(0)\n const rafRef = useRef<number | null>(null)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n\n const getTextContent = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\")\n return String(node)\n if (isValidElement(node)) {\n const children = (node.props as any).children\n if (children) return getTextContent(children)\n }\n return \"\"\n }\n\n const originalText = useMemo(() => getTextContent(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < originalText.length; i++) {\n const to = originalText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n setFrame(0)\n }\n\n useEffect(() => {\n if (isHovering && originalText) {\n setupQueue()\n const update = () => {\n setFrame((prev) => prev + 1)\n rafRef.current = requestAnimationFrame(update)\n }\n rafRef.current = requestAnimationFrame(update)\n } else {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setFrame(0)\n }\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [isHovering, originalText])\n\n const renderContent = () => {\n // When not hovering, just render children as-is\n if (!isHovering) {\n return children\n }\n\n // When hovering, apply glitch effect to the text\n return originalText.split(\"\").map((char, i) => {\n const item = queueRef.current[i]\n\n // If animation for this char hasn't started, or it's finished\n if (!item || frame >= item.end) {\n return <span key={i}>{char}</span>\n }\n\n // If we are in the scrambling phase for this specific character\n if (frame >= item.start) {\n // Don't scramble spaces, just render them\n if (char === \" \") {\n return <span key={i}> </span>\n }\n\n if (!item.char || Math.random() < 0.28) {\n item.char = symbols[Math.floor(Math.random() * symbols.length)]\n }\n return (\n <span key={i} className=\"relative inline-block\">\n {/* The invisible real character preserves the exact width */}\n <span className=\"invisible opacity-0\" aria-hidden=\"true\">\n {char}\n </span>\n {/* The absolute symbol sits exactly on top of that width */}\n <span className=\"absolute inset-0 flex items-center justify-center font-mono opacity-50\">\n {item.char}\n </span>\n </span>\n )\n }\n\n // Default: show original character\n return <span key={i}>{char}</span>\n })\n }\n\n const commonProps = {\n className: cn(\"inline-block whitespace-nowrap\", className),\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget\n if (target && !target.style.width) {\n target.style.width = `${target.offsetWidth}px`\n }\n setIsHovering(true)\n },\n onMouseLeave: () => setIsHovering(false),\n ...props,\n }\n\n if (asChild && isValidElement(children)) {\n return (\n <Slot {...commonProps}>\n {React.cloneElement(children as any, {}, renderContent())}\n </Slot>\n )\n }\n\n // If no href is provided, render as a span instead of a Link\n if (!href) {\n return <span {...commonProps}>{renderContent()}</span>\n }\n\n return (\n <Link href={href} {...commonProps}>\n {renderContent()}\n </Link>\n )\n}\n\nexport default GlitchLink\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","../src/lib/utils.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"AAAA,qFAAY;ACAZ,4BAAsC,+CACd,SAERA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,oCAAAA,wBAAQC,CAAW,CAAC,CAC7B,CAAA,cAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","sourcesContent":[null,"import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","../src/lib/utils.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"AAAA,qFAAY;ACAZ,4BAAsC,+CACd,SAERA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,oCAAAA,wBAAQC,CAAW,CAAC,CAC7B,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","sourcesContent":[null,"import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-GRXC46JC.js","../src/components/calendar.tsx"],"names":["Calendar","className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","props","defaultClassNames","getDefaultClassNames","jsx","DayPicker","cn","date","buttonVariants","rootRef","orientation","Icon","ChevronLeftIcon","ChevronRightIcon","CalendarDayButton","children","day","modifiers","ref","Button"],"mappings":"AAAA,22BAAY;AACZ,sDAA8C,sDAAwC,uECC/D,kDAKhB,2CAI2C,+CA4HtC,SA1HHA,CAAAA,CAAS,CACh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ACL,CAAA,CAA2C,CACzC,IAAMC,CAAAA,CAAoBC,kDAAAA,CAAqB,CAEzCe,CAAAA,CAAY,CAAA,CAAA,MAAA,CAA0B,IAAI,CAAA,CAChD,OAAM,CAAA,CAAA,SAAA,CAAU,CAAA,CAAA,EAAM,CAChBD,CAAAA,CAAU,OAAA,kBAASC,CAAAA,qBAAI,OAAA,6BAAS,KAAA,mBAAM,GAC5C,CAAA,CAAG,CAACD,CAAAA,CAAU,OAAO,CAAC,CAAA,CAGpBb,6BAAAA,kBAACe,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,OAAA,CAAQ,OAAA,CACR,IAAA,CAAK,MAAA,CACL,UAAA,CAAUF,CAAAA,CAAI,IAAA,CAAK,kBAAA,CAAmB,CAAA,CACtC,sBAAA,CACEC,CAAAA,CAAU,QAAA,EACV,CAACA,CAAAA,CAAU,WAAA,EACX,CAACA,CAAAA,CAAU,SAAA,EACX,CAACA,CAAAA,CAAU,YAAA,CAEb,kBAAA,CAAkBA,CAAAA,CAAU,WAAA,CAC5B,gBAAA,CAAgBA,CAAAA,CAAU,SAAA,CAC1B,mBAAA,CAAmBA,CAAAA,CAAU,YAAA,CAC7B,SAAA,CAAWX,gCAAAA,m3BACT,CACAJ,CAAAA,CAAkB,GAAA,CAClBR,CACF,CAAA,CACC,GAAGO,CAAAA,CACN,CAEJ,CAAA,6BAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-GRXC46JC.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport {\n DayPicker,\n getDefaultClassNames,\n type DayButton,\n} from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"p-3 text-primary-accent group/calendar rounded-sm\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"h-7 w-7 aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"h-7 w-7 aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center justify-center h-7 w-full\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-7 gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative cn-calendar-dropdown-root rounded-sm\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"cn-calendar-caption-label rounded-sm flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-sm flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-9\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full rounded-sm h-full p-0 text-center group/day aspect-square select-none [&:first-child_button[data-range-start]]:!rounded-l-sm [&:first-child_button[data-range-middle]]:!rounded-l-sm [&:last-child_button[data-range-end]]:!rounded-r-sm [&:last-child_button[data-range-middle]]:!rounded-r-sm z-20 [&:has(button:not([data-range-start]):not([data-range-end]):hover)]:z-10 data-[focused=true]:z-30\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\n \"rounded-none bg-transparent\",\n defaultClassNames.range_middle\n ),\n range_end: cn(\n \"rounded-r-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate\",\n defaultClassNames.range_end\n ),\n today: cn(\n \"bg-muted text-foreground rounded-sm data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground opacity-20 aria-selected:text-muted-foreground aria-selected:opacity-20\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n const Icon =\n orientation === \"left\" ? ChevronLeftIcon : ChevronRightIcon\n return (\n <span\n className={cn(\n buttonVariants({ variant: \"outline\", size: \"icon\" }),\n \"shrink-0 pointer-events-none\"\n )}\n >\n <Icon className={cn(\"size-4 shrink-0\", className)} {...props} />\n </span>\n )\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex h-9 w-9 items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"rounded-sm data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-9 flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-30 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-sm! data-[range-end=true]:rounded-r-sm! data-[range-middle=true]:rounded-none! data-[range-start=true]:rounded-sm! data-[range-start=true]:rounded-l-sm! [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-GRXC46JC.js","../src/components/calendar.tsx"],"names":["Calendar","className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","props","defaultClassNames","getDefaultClassNames","jsx","DayPicker","cn","date","buttonVariants","rootRef","orientation","Icon","ChevronLeftIcon","ChevronRightIcon","CalendarDayButton","children","day","modifiers","ref","Button"],"mappings":"AAAA,22BAAY;AACZ,sDAA8C,sDAAwC,uECC/D,kDAKhB,2CAI2C,+CA4HtC,SA1HHA,CAAAA,CAAS,CAChB,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CAAA,CAClB,aAAA,CAAAC,CAAAA,CAAgB,OAAA,CAChB,aAAA,CAAAC,CAAAA,CAAgB,OAAA,CAChB,UAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAEG,CACD,IAAMC,CAAAA,CAAoBC,kDAAAA,CAAqB,CAE/C,OACEC,6BAAAA,yBAACC,CAAA,CACC,eAAA,CAAiBT,CAAAA,CACjB,SAAA,CAAWU,gCAAAA,mDACT,CACA,MAAA,CAAO,GAAA,CAAA,yCAAA,CAAA,CACP,MAAA,CAAO,GAAA,CAAA,6CAAA,CAAA,CACPZ,CACF,CAAA,CACA,aAAA,CAAeG,CAAAA,CACf,UAAA,CAAY,CACV,mBAAA,CAAsBU,CAAAA,EACpBA,CAAAA,CAAK,cAAA,CAAe,SAAA,CAAW,CAAE,KAAA,CAAO,OAAQ,CAAC,CAAA,CACnD,GAAGR,CACL,CAAA,CACA,UAAA,CAAY,CACV,IAAA,CAAMO,gCAAAA,OAAG,CAASJ,CAAAA,CAAkB,IAAI,CAAA,CACxC,MAAA,CAAQI,gCAAAA,0CACN,CACAJ,CAAAA,CAAkB,MACpB,CAAA,CACA,KAAA,CAAOI,gCAAAA,4BAAG,CAA8BJ,CAAAA,CAAkB,KAAK,CAAA,CAC/D,G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k-GRXC46JC.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport {\n DayPicker,\n getDefaultClassNames,\n type DayButton,\n} from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"p-3 text-primary-accent group/calendar rounded-sm\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"h-7 w-7 aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"h-7 w-7 aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center justify-center h-7 w-full\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-7 gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative cn-calendar-dropdown-root rounded-sm\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"cn-calendar-caption-label rounded-sm flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-sm flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-9\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full rounded-sm h-full p-0 text-center group/day aspect-square select-none [&:first-child_button[data-range-start]]:!rounded-l-sm [&:first-child_button[data-range-middle]]:!rounded-l-sm [&:last-child_button[data-range-end]]:!rounded-r-sm [&:last-child_button[data-range-middle]]:!rounded-r-sm z-20 [&:has(button:not([data-range-start]):not([data-range-end]):hover)]:z-10 data-[focused=true]:z-30\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\n \"rounded-none bg-transparent\",\n defaultClassNames.range_middle\n ),\n range_end: cn(\n \"rounded-r-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate\",\n defaultClassNames.range_end\n ),\n today: cn(\n \"bg-muted text-foreground rounded-sm data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground opacity-20 aria-selected:text-muted-foreground aria-selected:opacity-20\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n const Icon =\n orientation === \"left\" ? ChevronLeftIcon : ChevronRightIcon\n return (\n <span\n className={cn(\n buttonVariants({ variant: \"outline\", size: \"icon\" }),\n \"shrink-0 pointer-events-none\"\n )}\n >\n <Icon className={cn(\"size-4 shrink-0\", className)} {...props} />\n </span>\n )\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex h-9 w-9 items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"rounded-sm data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-9 flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-30 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-sm! data-[range-end=true]:rounded-r-sm! data-[range-middle=true]:rounded-none! data-[range-start=true]:rounded-sm! data-[range-start=true]:rounded-l-sm! [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-I5INE4KG.js","../src/components/label.tsx"],"names":["Label","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,+CAOnB,IAFEA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,OAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,yFACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAAA,CACAF,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-I5INE4KG.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-I5INE4KG.js","../src/components/label.tsx"],"names":["Label","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,+CAOnB,IAFEA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,OAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,yFACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAAA,CACAF,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-I5INE4KG.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-K4GMCVHO.js","../src/components/input.tsx"],"names":["Input","className","type","error","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,+CAWjB,IAHAA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAEnCC,6BAAAA,OAAC,CAAA,CACC,IAAA,CAAMJ,CAAAA,CACN,SAAA,CAAWK,gCAAAA,2XACT,CACAJ,CAAAA,CACI,yEAAA,CACA,eAAA,CACJF,CACF,CAAA,CACA,GAAA,CAAKI,CAAAA,CACJ,GAAGD,CAAAA,CACN,CAGN,CAAA,CACAJ,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-K4GMCVHO.js","sourcesContent":[null,"import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n error?: boolean\n}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, error, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex my-2 h-9 w-full rounded-3xl border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-secondary-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n error\n ? \"border-destructive-foreground focus-visible:ring-destructive-foreground\"\n : \"border-border\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-K4GMCVHO.js","../src/components/input.tsx"],"names":["Input","className","type","error","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,+CAWjB,IAHAA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAEnCC,6BAAAA,OAAC,CAAA,CACC,IAAA,CAAMJ,CAAAA,CACN,SAAA,CAAWK,gCAAAA,2XACT,CACAJ,CAAAA,CACI,yEAAA,CACA,eAAA,CACJF,CACF,CAAA,CACA,GAAA,CAAKI,CAAAA,CACJ,GAAGD,CAAAA,CACN,CAGN,CAAA,CACAJ,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-K4GMCVHO.js","sourcesContent":[null,"import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n error?: boolean\n}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, error, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex my-2 h-9 w-full rounded-3xl border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-secondary-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n error\n ? \"border-destructive-foreground focus-visible:ring-destructive-foreground\"\n : \"border-border\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","../src/components/tree-select.tsx"],"names":["getAllDescendantValues","node","values","child","getCheckState","selectedSet","descendants","selectedCount","v","filterTree","nodes","searchTerm","term","result","labelMatches","filteredChildren","getValuesOfMatchingNodes","walk","nodeList","hasMatch","childHasMatch","findNodeByValue","value","found","collectAllBranchValues","renderHighlightedLabel","label","index","jsxs","Fragment","jsx","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn"],"mappings":"AAAA,+8BAAY;AACZ,sDAAuC,sDAAsD,sDAAwC,uECC9G,2CACqC,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CACC,SAAA,CAAWe,gCAAAA,kIACT,CACA,gBAAA,CACAF,CAAAA,GAAe,SAAA,EAAa,CAACR,CAAAA,EAAY,UAG3C,CAAA,CACA,KAAA,CAAO,CAAE,WAAA,CAAa,CAAA,EAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, ChevronRight, Search, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Checkbox } from \"@/components/checkbox\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\n// --- Public types ---\n\nexport interface TreeSelectNode {\n value: string\n label: string\n children?: TreeSelectNode[]\n}\n\nexport interface TreeSelectProps {\n nodes: TreeSelectNode[]\n value?: string\n onValueChange?: (value: string) => void\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n defaultExpandedValues?: string[]\n expandAll?: boolean\n}\n\n// --- Internal types ---\n\ntype CheckState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n// --- Utility functions ---\n\nfunction getAllDescendantValues(node: TreeSelectNode): string[] {\n const values: string[] = [node.value]\n if (node.children) {\n for (const child of node.children) {\n values.push(...getAllDescendantValues(child))\n }\n }\n return values\n}\n\nfunction getCheckState(\n node: TreeSelectNode,\n selectedSet: Set<string>\n): CheckState {\n if (!node.children || node.children.length === 0) {\n return selectedSet.has(node.value) ? \"checked\" : \"unchecked\"\n }\n\n const descendants = getAllDescendantValues(node)\n const selectedCount = descendants.filter((v) => selectedSet.has(v)).length\n\n if (selectedCount === 0) return \"unchecked\"\n if (selectedCount === descendants.length) return \"checked\"\n return \"indeterminate\"\n}\n\nfunction filterTree(\n nodes: TreeSelectNode[],\n searchTerm: string\n): TreeSelectNode[] | null {\n const term = searchTerm.toLowerCase().trim()\n if (!term) return nodes\n\n const result: TreeSelectNode[] = []\n\n for (const node of nodes) {\n const labelMatches = node.label.toLowerCase().includes(term)\n\n if (node.children && node.children.length > 0) {\n const filteredChildren = filterTree(node.children, searchTerm)\n\n if (labelMatches) {\n result.push(node)\n } else if (filteredChildren && filteredChildren.length > 0) {\n result.push({ ...node, children: filteredChildren })\n }\n } else if (labelMatches) {\n result.push(node)\n }\n }\n\n return result.length > 0 ? result : null\n}\n\nfunction getValuesOfMatchingNodes(\n nodes: TreeSelectNode[],\n searchTerm: string\n): Set<string> {\n const term = searchTerm.toLowerCase().trim()\n const result = new Set<string>()\n\n function walk(nodeList: TreeSelectNode[]): boolean {\n let hasMatch = false\n for (const node of nodeList) {\n const labelMatches = node.label.toLowerCase().includes(term)\n let childHasMatch = false\n\n if (node.children) {\n childHasMatch = walk(node.children)\n }\n\n if (labelMatches || childHasMatch) {\n result.add(node.value)\n hasMatch = true\n }\n }\n return hasMatch\n }\n\n walk(nodes)\n return result\n}\n\nfunction findNodeByValue(\n nodes: TreeSelectNode[],\n value: string\n): TreeSelectNode | undefined {\n for (const node of nodes) {\n if (node.value === value) return node\n if (node.children) {\n const found = findNodeByValue(node.children, value)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction collectAllBranchValues(nodes: TreeSelectNode[]): Set<string> {\n const result = new Set<string>()\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n result.add(node.value)\n for (const v of collectAllBranchValues(node.children)) {\n result.add(v)\n }\n }\n }\n return result\n}\n\nfunction renderHighlightedLabel(\n label: string,\n searchTerm: string\n): React.ReactNode {\n if (!searchTerm) return label\n\n const term = searchTerm.toLowerCase().trim()\n if (!term) return label\n\n const index = label.toLowerCase().indexOf(term)\n if (index === -1) return label\n\n return (\n <>\n {label.slice(0, index)}\n <span className=\"font-semibold underline\">\n {label.slice(index, index + term.length)}\n </span>\n {label.slice(index + term.length)}\n </>\n )\n}\n\n// --- TreeNodeItem (internal) ---\n\ninterface TreeNodeItemProps {\n node: TreeSelectNode\n depth: number\n multiple: boolean\n selectedSet: Set<string>\n expandedValues: Set<string>\n focusedValue: string | null\n onToggleExpand: (value: string) => void\n onSelect: (node: TreeSelectNode) => void\n onFocus: (value: string) => void\n searchTerm: string\n}\n\nfunction TreeNodeItem({\n node,\n depth,\n multiple,\n selectedSet,\n expandedValues,\n focusedValue,\n onToggleExpand,\n onSelect,\n onFocus,\n searchTerm,\n}: TreeNodeItemProps) {\n const hasChildren = node.children && node.children.length > 0\n const isExpanded = expandedValues.has(node.value)\n const checkState = multiple\n ? getCheckState(node, selectedSet)\n : selectedSet.has(node.value)\n ? \"checked\"\n : \"unchecked\"\n\n const indentPx = depth * 20\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={checkState === \"checked\"}\n >\n <div\n className={cn(\n \"relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50\",\n \"hover:bg-muted\",\n checkState === \"checked\" && !multiple && \"bg-muted\"\n // This adds a focus ring when the node is focused, but it's not needed for the tree-select component.\n // focusedValue === node.value && \"z-10 ring-2 ring-ring\"\n )}\n style={{ paddingLeft: `${8 + indentPx}px` }}\n onClick={() => onSelect(node)}\n onFocus={() => onFocus(node.value)}\n data-tree-value={node.value}\n tabIndex={focusedValue === node.value ? 0 : -1}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n className=\"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50\"\n onClick={(e) => {\n e.stopPropagation()\n onToggleExpand(node.value)\n }}\n aria-label={\n isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`\n }\n tabIndex={-1}\n >\n {isExpanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </button>\n ) : (\n <span className=\"h-4 w-4 shrink-0\" />\n )}\n\n {multiple ? (\n <Checkbox\n checked={\n checkState === \"checked\"\n ? true\n : checkState === \"indeterminate\"\n ? \"indeterminate\"\n : false\n }\n onCheckedChange={() => onSelect(node)}\n onClick={(e) => e.stopPropagation()}\n className=\"shrink-0\"\n aria-label={node.label}\n />\n ) : (\n <Check\n className={cn(\n \"h-4 w-4 shrink-0\",\n checkState === \"checked\" ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n )}\n\n <span className=\"truncate\">\n {renderHighlightedLabel(node.label, searchTerm)}\n </span>\n </div>\n\n {hasChildren && isExpanded && (\n <div role=\"group\">\n {node.children!.map((child) => (\n <TreeNodeItem\n key={child.value}\n node={child}\n depth={depth + 1}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={onToggleExpand}\n onSelect={onSelect}\n onFocus={onFocus}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n\n// --- TreeSelect (main component) ---\n\nexport function TreeSelect({\n nodes,\n value,\n onValueChange,\n multiple = false,\n values = [],\n onValuesChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No results found.\",\n disabled = false,\n className,\n error = false,\n defaultExpandedValues,\n expandAll = false,\n}: TreeSelectProps) {\n const [open, setOpen] = React.useState(false)\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null)\n const [expandedValues, setExpandedValues] = React.useState<Set<string>>(\n () => {\n if (expandAll) return collectAllBranchValues(nodes)\n if (defaultExpandedValues) return new Set(defaultExpandedValues)\n return new Set<string>()\n }\n )\n\n const preSearchExpandedRef = React.useRef<Set<string> | null>(null)\n const treeRef = React.useRef<HTMLDivElement>(null)\n\n const selectedSet = React.useMemo(\n () => new Set(multiple ? values : value ? [value] : []),\n [multiple, values, value]\n )\n\n const filteredNodes = React.useMemo(\n () => (searchTerm ? filterTree(nodes, searchTerm) : nodes),\n [nodes, searchTerm]\n )\n\n // Auto-expand matching ancestors during search\n React.useEffect(() => {\n if (searchTerm) {\n if (!preSearchExpandedRef.current) {\n preSearchExpandedRef.current = new Set(expandedValues)\n }\n const matchingAncestors = getValuesOfMatchingNodes(nodes, searchTerm)\n setExpandedValues(matchingAncestors)\n } else if (preSearchExpandedRef.current) {\n setExpandedValues(preSearchExpandedRef.current)\n preSearchExpandedRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchTerm, nodes])\n\n const handleOpenChange = React.useCallback((isOpen: boolean) => {\n setOpen(isOpen)\n if (!isOpen) {\n setSearchTerm(\"\")\n setFocusedValue(null)\n }\n }, [])\n\n const handleToggleExpand = React.useCallback((nodeValue: string) => {\n setExpandedValues((prev) => {\n const next = new Set(prev)\n if (next.has(nodeValue)) {\n next.delete(nodeValue)\n } else {\n next.add(nodeValue)\n }\n return next\n })\n }, [])\n\n const handleSelect = React.useCallback(\n (node: TreeSelectNode) => {\n if (multiple) {\n const allDescendants = getAllDescendantValues(node)\n const currentState = getCheckState(node, selectedSet)\n\n let newValues: string[]\n if (currentState === \"checked\") {\n const toRemove = new Set(allDescendants)\n newValues = values.filter((v) => !toRemove.has(v))\n } else {\n const toAdd = allDescendants.filter((v) => !selectedSet.has(v))\n newValues = [...values, ...toAdd]\n }\n onValuesChange?.(newValues)\n } else {\n // Single-select: clicking a parent toggles expand instead of selecting\n const hasChildren = node.children && node.children.length > 0\n if (hasChildren) {\n handleToggleExpand(node.value)\n return\n }\n const newValue = node.value === value ? \"\" : node.value\n onValueChange?.(newValue)\n setOpen(false)\n }\n },\n [\n multiple,\n values,\n value,\n selectedSet,\n onValuesChange,\n onValueChange,\n handleToggleExpand,\n ]\n )\n\n const handleRemoveChip = React.useCallback(\n (chipValue: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const node = findNodeByValue(nodes, chipValue)\n if (node) {\n const toRemove = new Set(getAllDescendantValues(node))\n const newValues = values.filter((v) => !toRemove.has(v))\n onValuesChange?.(newValues)\n }\n },\n [nodes, values, onValuesChange]\n )\n\n // Smart chips: minimal set representing the selection\n const chipValues = React.useMemo(() => {\n if (!multiple) return []\n\n const chips: string[] = []\n\n function walk(nodeList: TreeSelectNode[]) {\n for (const node of nodeList) {\n const state = getCheckState(node, selectedSet)\n if (state === \"checked\") {\n chips.push(node.value)\n } else if (state === \"indeterminate\" && node.children) {\n walk(node.children)\n }\n }\n }\n\n walk(nodes)\n return chips\n }, [nodes, selectedSet, multiple])\n\n // Keyboard navigation\n const getVisibleNodes = React.useCallback((): HTMLElement[] => {\n if (!treeRef.current) return []\n return Array.from(treeRef.current.querySelectorAll(\"[data-tree-value]\"))\n }, [])\n\n const handleTreeKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n const visibleNodes = getVisibleNodes()\n const currentIndex = visibleNodes.findIndex(\n (el) => el.dataset.treeValue === focusedValue\n )\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault()\n const nextIndex = Math.min(currentIndex + 1, visibleNodes.length - 1)\n const nextValue = visibleNodes[nextIndex]?.dataset.treeValue\n if (nextValue) {\n setFocusedValue(nextValue)\n visibleNodes[nextIndex]?.focus()\n }\n break\n }\n case \"ArrowUp\": {\n e.preventDefault()\n const prevIndex = Math.max(currentIndex - 1, 0)\n const prevValue = visibleNodes[prevIndex]?.dataset.treeValue\n if (prevValue) {\n setFocusedValue(prevValue)\n visibleNodes[prevIndex]?.focus()\n }\n break\n }\n case \"ArrowRight\": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node?.children?.length) {\n if (!expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n } else {\n const firstChildValue = node.children[0].value\n setFocusedValue(firstChildValue)\n requestAnimationFrame(() => {\n const els = getVisibleNodes()\n const el = els.find(\n (n) => n.dataset.treeValue === firstChildValue\n )\n el?.focus()\n })\n }\n }\n }\n break\n }\n case \"ArrowLeft\": {\n e.preventDefault()\n if (focusedValue && expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n }\n break\n }\n case \"Enter\":\n case \" \": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node) handleSelect(node)\n }\n break\n }\n case \"Home\": {\n e.preventDefault()\n const firstValue = visibleNodes[0]?.dataset.treeValue\n if (firstValue) {\n setFocusedValue(firstValue)\n visibleNodes[0]?.focus()\n }\n break\n }\n case \"End\": {\n e.preventDefault()\n const lastValue =\n visibleNodes[visibleNodes.length - 1]?.dataset.treeValue\n if (lastValue) {\n setFocusedValue(lastValue)\n visibleNodes[visibleNodes.length - 1]?.focus()\n }\n break\n }\n }\n },\n [\n focusedValue,\n nodes,\n expandedValues,\n getVisibleNodes,\n handleToggleExpand,\n handleSelect,\n ]\n )\n\n const getDisplayText = () => {\n if (multiple) {\n if (values.length === 0) return placeholder\n if (values.length === 1) {\n const node = findNodeByValue(nodes, values[0])\n return node?.label ?? values[0]\n }\n return `${values.length} selected`\n }\n if (value) {\n const node = findNodeByValue(nodes, value)\n return node?.label ?? value\n }\n return placeholder\n }\n\n const renderSelectedChips = () => {\n if (!multiple || chipValues.length === 0) return null\n\n const chipNodes = chipValues\n .map((v) => findNodeByValue(nodes, v))\n .filter(Boolean) as TreeSelectNode[]\n\n return (\n <div className=\"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border\">\n <div className=\"flex flex-wrap gap-1\">\n {chipNodes.map((node) => (\n <div\n key={node.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate max-w-[120px]\">{node.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer shrink-0\"\n onClick={(e) => handleRemoveChip(node.value, e)}\n aria-label={`Remove ${node.label}`}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div className=\"flex items-center border-b px-3\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder={searchPlaceholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Search tree\"\n />\n </div>\n\n {renderSelectedChips()}\n\n <div className=\"max-h-[300px] overflow-y-auto\">\n {filteredNodes && filteredNodes.length > 0 ? (\n <div\n ref={treeRef}\n role=\"tree\"\n aria-label=\"Options\"\n className=\"p-1\"\n onKeyDown={handleTreeKeyDown}\n >\n {filteredNodes.map((node) => (\n <TreeNodeItem\n key={node.value}\n node={node}\n depth={0}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={handleToggleExpand}\n onSelect={handleSelect}\n onFocus={setFocusedValue}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n ) : (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {emptyMessage}\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","../src/components/tree-select.tsx"],"names":["getAllDescendantValues","node","values","child","getCheckState","selectedSet","descendants","selectedCount","v","filterTree","nodes","searchTerm","term","result","labelMatches","filteredChildren","getValuesOfMatchingNodes","walk","nodeList","hasMatch","childHasMatch","findNodeByValue","value","found","collectAllBranchValues","renderHighlightedLabel","label","index","jsxs","Fragment","jsx","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn"],"mappings":"AAAA,+8BAAY;AACZ,sDAAuC,sDAAsD,sDAAwC,uECC9G,2CACqC,+CAgKxD,SA3HKA,CAAAA,CAAuBC,CAAAA,CAAgC,CAC9D,IAAMC,CAAAA,CAAmB,CAACD,CAAAA,CAAK,KAAK,CAAA,CACpC,EAAA,CAAIA,CAAAA,CAAK,QAAA,CACP,GAAA,CAAA,IAAWE,EAAAA,GAASF,CAAAA,CAAK,QAAA,CACvBC,CAAAA,CAAO,IAAA,CAAK,GAAGF,CAAAA,CAAuBG,CAAK,CAAC,CAAA,CAGhD,OAAOD,CACT,CAEA,SAASE,CAAAA,CACPH,CAAAA,CACAI,CAAAA,CACY,CACZ,EAAA,CAAI,CAACJ,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,GAAW,CAAA,CAC7C,OAAOI,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CAAI,SAAA,CAAY,WAAA,CAGnD,IAAMK,CAAAA,CAAcN,CAAAA,CAAuBC,CAAI,CAAA,CACzCM,CAAAA,CAAgBD,CAAAA,CAAY,MAAA,CAAQE,CAAAA,EAAMH,CAAAA,CAAY,GAAA,CAAIG,CAAC,CAAC,CAAA,CAAE,MAAA,CAEpE,OAAID,CAAAA,GAAkB,CAAA,CAAU,WAAA,CAC5BA,CAAAA,GAAkBD,CAAAA,CAAY,MAAA,CAAe,SAAA,CAC1C,eACT,CAEA,SA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,CAAAA,CAAaR,CAAAA,CACf7B,CAAAA,CAAcH,CAAAA,CAAMI,CAAW,CAAA,CAC/BA,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CACxB,SAAA,CACA,WAAA,CAEAyC,CAAAA,CAAWV,CAAAA,CAAQ,EAAA,CAEzB,OACEJ,8BAAAA,KAAC,CAAA,CACC,IAAA,CAAK,UAAA,CACL,eAAA,CAAeW,CAAAA,CAAcC,CAAAA,CAAa,KAAA,CAAA,CAC1C,eAAA,CAAeC,CAAAA,GAAe,SAAA,CAE9B,QAAA,CAAA,CAAAb,8BAAAA,KAAC,CAAA,CACC,SAAA,CAAWe,gCAAAA,kIACT,CACA,gBAAA,CACAF,CAAAA,GAAe,SAAA,EAAa,CAACR,CAAAA,EAAY,UAG3C,CAAA,CACA,KAAA,CAAO,CAAE,WAAA,CAAa,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-LQMOWEA7.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, ChevronRight, Search, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Checkbox } from \"@/components/checkbox\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\n// --- Public types ---\n\nexport interface TreeSelectNode {\n value: string\n label: string\n children?: TreeSelectNode[]\n}\n\nexport interface TreeSelectProps {\n nodes: TreeSelectNode[]\n value?: string\n onValueChange?: (value: string) => void\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n defaultExpandedValues?: string[]\n expandAll?: boolean\n}\n\n// --- Internal types ---\n\ntype CheckState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n// --- Utility functions ---\n\nfunction getAllDescendantValues(node: TreeSelectNode): string[] {\n const values: string[] = [node.value]\n if (node.children) {\n for (const child of node.children) {\n values.push(...getAllDescendantValues(child))\n }\n }\n return values\n}\n\nfunction getCheckState(\n node: TreeSelectNode,\n selectedSet: Set<string>\n): CheckState {\n if (!node.children || node.children.length === 0) {\n return selectedSet.has(node.value) ? \"checked\" : \"unchecked\"\n }\n\n const descendants = getAllDescendantValues(node)\n const selectedCount = descendants.filter((v) => selectedSet.has(v)).length\n\n if (selectedCount === 0) return \"unchecked\"\n if (selectedCount === descendants.length) return \"checked\"\n return \"indeterminate\"\n}\n\nfunction filterTree(\n nodes: TreeSelectNode[],\n searchTerm: string\n): TreeSelectNode[] | null {\n const term = searchTerm.toLowerCase().trim()\n if (!term) return nodes\n\n const result: TreeSelectNode[] = []\n\n for (const node of nodes) {\n const labelMatches = node.label.toLowerCase().includes(term)\n\n if (node.children && node.children.length > 0) {\n const filteredChildren = filterTree(node.children, searchTerm)\n\n if (labelMatches) {\n result.push(node)\n } else if (filteredChildren && filteredChildren.length > 0) {\n result.push({ ...node, children: filteredChildren })\n }\n } else if (labelMatches) {\n result.push(node)\n }\n }\n\n return result.length > 0 ? result : null\n}\n\nfunction getValuesOfMatchingNodes(\n nodes: TreeSelectNode[],\n searchTerm: string\n): Set<string> {\n const term = searchTerm.toLowerCase().trim()\n const result = new Set<string>()\n\n function walk(nodeList: TreeSelectNode[]): boolean {\n let hasMatch = false\n for (const node of nodeList) {\n const labelMatches = node.label.toLowerCase().includes(term)\n let childHasMatch = false\n\n if (node.children) {\n childHasMatch = walk(node.children)\n }\n\n if (labelMatches || childHasMatch) {\n result.add(node.value)\n hasMatch = true\n }\n }\n return hasMatch\n }\n\n walk(nodes)\n return result\n}\n\nfunction findNodeByValue(\n nodes: TreeSelectNode[],\n value: string\n): TreeSelectNode | undefined {\n for (const node of nodes) {\n if (node.value === value) return node\n if (node.children) {\n const found = findNodeByValue(node.children, value)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction collectAllBranchValues(nodes: TreeSelectNode[]): Set<string> {\n const result = new Set<string>()\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n result.add(node.value)\n for (const v of collectAllBranchValues(node.children)) {\n result.add(v)\n }\n }\n }\n return result\n}\n\nfunction renderHighlightedLabel(\n label: string,\n searchTerm: string\n): React.ReactNode {\n if (!searchTerm) return label\n\n const term = searchTerm.toLowerCase().trim()\n if (!term) return label\n\n const index = label.toLowerCase().indexOf(term)\n if (index === -1) return label\n\n return (\n <>\n {label.slice(0, index)}\n <span className=\"font-semibold underline\">\n {label.slice(index, index + term.length)}\n </span>\n {label.slice(index + term.length)}\n </>\n )\n}\n\n// --- TreeNodeItem (internal) ---\n\ninterface TreeNodeItemProps {\n node: TreeSelectNode\n depth: number\n multiple: boolean\n selectedSet: Set<string>\n expandedValues: Set<string>\n focusedValue: string | null\n onToggleExpand: (value: string) => void\n onSelect: (node: TreeSelectNode) => void\n onFocus: (value: string) => void\n searchTerm: string\n}\n\nfunction TreeNodeItem({\n node,\n depth,\n multiple,\n selectedSet,\n expandedValues,\n focusedValue,\n onToggleExpand,\n onSelect,\n onFocus,\n searchTerm,\n}: TreeNodeItemProps) {\n const hasChildren = node.children && node.children.length > 0\n const isExpanded = expandedValues.has(node.value)\n const checkState = multiple\n ? getCheckState(node, selectedSet)\n : selectedSet.has(node.value)\n ? \"checked\"\n : \"unchecked\"\n\n const indentPx = depth * 20\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={checkState === \"checked\"}\n >\n <div\n className={cn(\n \"relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50\",\n \"hover:bg-muted\",\n checkState === \"checked\" && !multiple && \"bg-muted\"\n // This adds a focus ring when the node is focused, but it's not needed for the tree-select component.\n // focusedValue === node.value && \"z-10 ring-2 ring-ring\"\n )}\n style={{ paddingLeft: `${8 + indentPx}px` }}\n onClick={() => onSelect(node)}\n onFocus={() => onFocus(node.value)}\n data-tree-value={node.value}\n tabIndex={focusedValue === node.value ? 0 : -1}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n className=\"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50\"\n onClick={(e) => {\n e.stopPropagation()\n onToggleExpand(node.value)\n }}\n aria-label={\n isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`\n }\n tabIndex={-1}\n >\n {isExpanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </button>\n ) : (\n <span className=\"h-4 w-4 shrink-0\" />\n )}\n\n {multiple ? (\n <Checkbox\n checked={\n checkState === \"checked\"\n ? true\n : checkState === \"indeterminate\"\n ? \"indeterminate\"\n : false\n }\n onCheckedChange={() => onSelect(node)}\n onClick={(e) => e.stopPropagation()}\n className=\"shrink-0\"\n aria-label={node.label}\n />\n ) : (\n <Check\n className={cn(\n \"h-4 w-4 shrink-0\",\n checkState === \"checked\" ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n )}\n\n <span className=\"truncate\">\n {renderHighlightedLabel(node.label, searchTerm)}\n </span>\n </div>\n\n {hasChildren && isExpanded && (\n <div role=\"group\">\n {node.children!.map((child) => (\n <TreeNodeItem\n key={child.value}\n node={child}\n depth={depth + 1}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={onToggleExpand}\n onSelect={onSelect}\n onFocus={onFocus}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n\n// --- TreeSelect (main component) ---\n\nexport function TreeSelect({\n nodes,\n value,\n onValueChange,\n multiple = false,\n values = [],\n onValuesChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No results found.\",\n disabled = false,\n className,\n error = false,\n defaultExpandedValues,\n expandAll = false,\n}: TreeSelectProps) {\n const [open, setOpen] = React.useState(false)\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null)\n const [expandedValues, setExpandedValues] = React.useState<Set<string>>(\n () => {\n if (expandAll) return collectAllBranchValues(nodes)\n if (defaultExpandedValues) return new Set(defaultExpandedValues)\n return new Set<string>()\n }\n )\n\n const preSearchExpandedRef = React.useRef<Set<string> | null>(null)\n const treeRef = React.useRef<HTMLDivElement>(null)\n\n const selectedSet = React.useMemo(\n () => new Set(multiple ? values : value ? [value] : []),\n [multiple, values, value]\n )\n\n const filteredNodes = React.useMemo(\n () => (searchTerm ? filterTree(nodes, searchTerm) : nodes),\n [nodes, searchTerm]\n )\n\n // Auto-expand matching ancestors during search\n React.useEffect(() => {\n if (searchTerm) {\n if (!preSearchExpandedRef.current) {\n preSearchExpandedRef.current = new Set(expandedValues)\n }\n const matchingAncestors = getValuesOfMatchingNodes(nodes, searchTerm)\n setExpandedValues(matchingAncestors)\n } else if (preSearchExpandedRef.current) {\n setExpandedValues(preSearchExpandedRef.current)\n preSearchExpandedRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchTerm, nodes])\n\n const handleOpenChange = React.useCallback((isOpen: boolean) => {\n setOpen(isOpen)\n if (!isOpen) {\n setSearchTerm(\"\")\n setFocusedValue(null)\n }\n }, [])\n\n const handleToggleExpand = React.useCallback((nodeValue: string) => {\n setExpandedValues((prev) => {\n const next = new Set(prev)\n if (next.has(nodeValue)) {\n next.delete(nodeValue)\n } else {\n next.add(nodeValue)\n }\n return next\n })\n }, [])\n\n const handleSelect = React.useCallback(\n (node: TreeSelectNode) => {\n if (multiple) {\n const allDescendants = getAllDescendantValues(node)\n const currentState = getCheckState(node, selectedSet)\n\n let newValues: string[]\n if (currentState === \"checked\") {\n const toRemove = new Set(allDescendants)\n newValues = values.filter((v) => !toRemove.has(v))\n } else {\n const toAdd = allDescendants.filter((v) => !selectedSet.has(v))\n newValues = [...values, ...toAdd]\n }\n onValuesChange?.(newValues)\n } else {\n // Single-select: clicking a parent toggles expand instead of selecting\n const hasChildren = node.children && node.children.length > 0\n if (hasChildren) {\n handleToggleExpand(node.value)\n return\n }\n const newValue = node.value === value ? \"\" : node.value\n onValueChange?.(newValue)\n setOpen(false)\n }\n },\n [\n multiple,\n values,\n value,\n selectedSet,\n onValuesChange,\n onValueChange,\n handleToggleExpand,\n ]\n )\n\n const handleRemoveChip = React.useCallback(\n (chipValue: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const node = findNodeByValue(nodes, chipValue)\n if (node) {\n const toRemove = new Set(getAllDescendantValues(node))\n const newValues = values.filter((v) => !toRemove.has(v))\n onValuesChange?.(newValues)\n }\n },\n [nodes, values, onValuesChange]\n )\n\n // Smart chips: minimal set representing the selection\n const chipValues = React.useMemo(() => {\n if (!multiple) return []\n\n const chips: string[] = []\n\n function walk(nodeList: TreeSelectNode[]) {\n for (const node of nodeList) {\n const state = getCheckState(node, selectedSet)\n if (state === \"checked\") {\n chips.push(node.value)\n } else if (state === \"indeterminate\" && node.children) {\n walk(node.children)\n }\n }\n }\n\n walk(nodes)\n return chips\n }, [nodes, selectedSet, multiple])\n\n // Keyboard navigation\n const getVisibleNodes = React.useCallback((): HTMLElement[] => {\n if (!treeRef.current) return []\n return Array.from(treeRef.current.querySelectorAll(\"[data-tree-value]\"))\n }, [])\n\n const handleTreeKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n const visibleNodes = getVisibleNodes()\n const currentIndex = visibleNodes.findIndex(\n (el) => el.dataset.treeValue === focusedValue\n )\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault()\n const nextIndex = Math.min(currentIndex + 1, visibleNodes.length - 1)\n const nextValue = visibleNodes[nextIndex]?.dataset.treeValue\n if (nextValue) {\n setFocusedValue(nextValue)\n visibleNodes[nextIndex]?.focus()\n }\n break\n }\n case \"ArrowUp\": {\n e.preventDefault()\n const prevIndex = Math.max(currentIndex - 1, 0)\n const prevValue = visibleNodes[prevIndex]?.dataset.treeValue\n if (prevValue) {\n setFocusedValue(prevValue)\n visibleNodes[prevIndex]?.focus()\n }\n break\n }\n case \"ArrowRight\": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node?.children?.length) {\n if (!expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n } else {\n const firstChildValue = node.children[0].value\n setFocusedValue(firstChildValue)\n requestAnimationFrame(() => {\n const els = getVisibleNodes()\n const el = els.find(\n (n) => n.dataset.treeValue === firstChildValue\n )\n el?.focus()\n })\n }\n }\n }\n break\n }\n case \"ArrowLeft\": {\n e.preventDefault()\n if (focusedValue && expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n }\n break\n }\n case \"Enter\":\n case \" \": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node) handleSelect(node)\n }\n break\n }\n case \"Home\": {\n e.preventDefault()\n const firstValue = visibleNodes[0]?.dataset.treeValue\n if (firstValue) {\n setFocusedValue(firstValue)\n visibleNodes[0]?.focus()\n }\n break\n }\n case \"End\": {\n e.preventDefault()\n const lastValue =\n visibleNodes[visibleNodes.length - 1]?.dataset.treeValue\n if (lastValue) {\n setFocusedValue(lastValue)\n visibleNodes[visibleNodes.length - 1]?.focus()\n }\n break\n }\n }\n },\n [\n focusedValue,\n nodes,\n expandedValues,\n getVisibleNodes,\n handleToggleExpand,\n handleSelect,\n ]\n )\n\n const getDisplayText = () => {\n if (multiple) {\n if (values.length === 0) return placeholder\n if (values.length === 1) {\n const node = findNodeByValue(nodes, values[0])\n return node?.label ?? values[0]\n }\n return `${values.length} selected`\n }\n if (value) {\n const node = findNodeByValue(nodes, value)\n return node?.label ?? value\n }\n return placeholder\n }\n\n const renderSelectedChips = () => {\n if (!multiple || chipValues.length === 0) return null\n\n const chipNodes = chipValues\n .map((v) => findNodeByValue(nodes, v))\n .filter(Boolean) as TreeSelectNode[]\n\n return (\n <div className=\"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border\">\n <div className=\"flex flex-wrap gap-1\">\n {chipNodes.map((node) => (\n <div\n key={node.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate max-w-[120px]\">{node.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer shrink-0\"\n onClick={(e) => handleRemoveChip(node.value, e)}\n aria-label={`Remove ${node.label}`}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div className=\"flex items-center border-b px-3\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder={searchPlaceholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Search tree\"\n />\n </div>\n\n {renderSelectedChips()}\n\n <div className=\"max-h-[300px] overflow-y-auto\">\n {filteredNodes && filteredNodes.length > 0 ? (\n <div\n ref={treeRef}\n role=\"tree\"\n aria-label=\"Options\"\n className=\"p-1\"\n onKeyDown={handleTreeKeyDown}\n >\n {filteredNodes.map((node) => (\n <TreeNodeItem\n key={node.value}\n node={node}\n depth={0}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={handleToggleExpand}\n onSelect={handleSelect}\n onFocus={setFocusedValue}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n ) : (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {emptyMessage}\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n"]}