@cryptlex/web-components 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/input-otp.es.js +6 -6
- package/dist/components/inputs/input-otp.es.js.map +1 -1
- package/dist/components/ui/dropdown-menu.es.js +1 -1
- package/dist/components/ui/dropdown-menu.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +1 -1
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +135 -200
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/tabs.es.js +20 -20
- package/dist/components/ui/tabs.es.js.map +1 -1
- package/dist/index.es.d.ts +32 -28
- package/dist/index.es.js +163 -160
- package/dist/index.es.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/theme.css +5 -0
- package/lib/utilities.css +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.es.js","sources":["../../../lib/components/ui/sidebar.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { ChevronLeft, ChevronRight, Menu } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Separator } from \"@/components/ui/separator\";\nimport {\n\tSheet,\n\tSheetContent,\n\tSheetDescription,\n\tSheetHeader,\n\tSheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { useIsMobile } from \"@/hooks/use-mobile\";\nimport { cn } from \"@/utils\";\n\n// TODO migrate sizes to tailwind\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\n\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContext = {\n\tstate: \"expanded\" | \"collapsed\";\n\topen: boolean;\n\tsetOpen: (open: boolean) => void;\n\topenMobile: boolean;\n\tsetOpenMobile: (open: boolean) => void;\n\tisMobile: boolean;\n\ttoggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContext | null>(null);\n\nexport function useSidebar() {\n\tconst context = React.use(SidebarContext);\n\tif (!context) {\n\t\tthrow new Error(\"useSidebar must be used within a SidebarProvider.\");\n\t}\n\n\treturn context;\n}\n\nexport function SidebarProvider({\n\tdefaultOpen = true,\n\topen: openProp,\n\tonOpenChange: setOpenProp,\n\tclassName,\n\tstyle,\n\tchildren,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tdefaultOpen?: boolean;\n\topen?: boolean;\n\tonOpenChange?: (o: boolean) => void;\n}) {\n\tconst isMobile = useIsMobile();\n\tconst [openMobile, setOpenMobile] = React.useState(false);\n\n\t// This is the internal state of the sidebar.\n\t// We use openProp and setOpenProp for control from outside the component.\n\tconst [_open, _setOpen] = React.useState(defaultOpen);\n\tconst open = openProp ?? _open;\n\tconst setOpen = React.useCallback(\n\t\t(value: boolean | ((value: boolean) => boolean)) => {\n\t\t\tif (setOpenProp) {\n\t\t\t\treturn setOpenProp?.(typeof value === \"function\" ? value(open) : value);\n\t\t\t}\n\n\t\t\t_setOpen(value);\n\n\t\t\t// TODO persistent sidebar state without cookies\n\t\t\t// This sets the cookie to keep the sidebar state.\n\t\t\t// document.cookie = `${SIDEBAR_COOKIE_NAME}=${open}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n\t\t},\n\t\t[setOpenProp, open],\n\t);\n\n\t// Helper to toggle the sidebar.\n\tconst toggleSidebar = React.useCallback(() => {\n\t\treturn isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n\t}, [isMobile, setOpen, setOpenMobile]);\n\n\t// Adds a keyboard shortcut to toggle the sidebar.\n\tReact.useEffect(() => {\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (\n\t\t\t\tevent.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n\t\t\t\t(event.metaKey || event.ctrlKey)\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleSidebar();\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener(\"keydown\", handleKeyDown);\n\t\treturn () => window.removeEventListener(\"keydown\", handleKeyDown);\n\t}, [toggleSidebar]);\n\n\t// We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n\t// This makes it easier to style the sidebar with Tailwind classes.\n\tconst state = open ? \"expanded\" : \"collapsed\";\n\n\tconst contextValue = React.useMemo<SidebarContext>(\n\t\t() => ({\n\t\t\tstate,\n\t\t\topen,\n\t\t\tsetOpen,\n\t\t\tisMobile,\n\t\t\topenMobile,\n\t\t\tsetOpenMobile,\n\t\t\ttoggleSidebar,\n\t\t}),\n\t\t[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n\t);\n\n\treturn (\n\t\t<SidebarContext value={contextValue}>\n\t\t\t<TooltipProvider delayDuration={0}>\n\t\t\t\t<div\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--sidebar-width\": SIDEBAR_WIDTH,\n\t\t\t\t\t\t\t\"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"group/sidebar-wrapper flex w-full has-data-[variant=inset]:bg-sidebar\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</TooltipProvider>\n\t\t</SidebarContext>\n\t);\n};\n\nexport function Sidebar({\n\tside = \"left\",\n\tvariant = \"sidebar\",\n\tcollapsible = \"offcanvas\",\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tside?: \"left\" | \"right\";\n\tvariant?: \"sidebar\" | \"floating\" | \"inset\";\n\tcollapsible?: \"offcanvas\" | \"none\";\n}) {\n\tconst { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n\tif (collapsible === \"none\") {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (isMobile) {\n\t\treturn (\n\t\t\t<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n\t\t\t\t<SheetContent\n\t\t\t\t\tdata-sidebar=\"sidebar\"\n\t\t\t\t\tdata-mobile=\"true\"\n\t\t\t\t\tclassName=\"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\tside={side}\n\t\t\t\t>\n\t\t\t\t\t<SheetHeader>\n\t\t\t\t\t\t<SheetTitle />\n\t\t\t\t\t\t<SheetDescription />\n\t\t\t\t\t</SheetHeader>\n\t\t\t\t\t<div className=\"flex h-full w-full flex-col\">{children}</div>\n\t\t\t\t</SheetContent>\n\t\t\t</Sheet>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"group peer hidden md:block text-sidebar-foreground\"\n\t\t\tdata-state={state}\n\t\t\tdata-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n\t\t\tdata-variant={variant}\n\t\t\tdata-side={side}\n\t\t>\n\t\t\t{/* This is what handles the sidebar gap on desktop */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"duration-200 relative w-(--sidebar-width) bg-transparent transition-[width] ease-linear\",\n\t\t\t\t\t\"group-data-[collapsible=offcanvas]:w-0\",\n\t\t\t\t\t\"group-data-[side=right]:rotate-180\",\n\t\t\t\t\tvariant === \"floating\" || variant === \"inset\"\n\t\t\t\t\t\t? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n\t\t\t\t\t\t: \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\",\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"duration-200 fixed inset-y-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex\",\n\t\t\t\t\tside === \"left\"\n\t\t\t\t\t\t? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n\t\t\t\t\t\t: \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n\t\t\t\t\t// Adjust the padding for floating and inset variants.\n\t\t\t\t\tvariant === \"floating\" || variant === \"inset\"\n\t\t\t\t\t\t? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n\t\t\t\t\t\t: \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tdata-sidebar=\"sidebar\"\n\t\t\t\t\tclassName=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport function SidebarTrigger({\n\tclassName,\n\tonClick,\n\t...props\n}: React.ComponentProps<typeof Button>) {\n\tconst { toggleSidebar, open, isMobile } = useSidebar();\n\n\treturn (\n\t\t<Button\n\t\t\tdata-sidebar=\"trigger\"\n\t\t\tvariant=\"ghost\"\n\t\t\tsize=\"sm\"\n\t\t\tonClick={(event) => {\n\t\t\t\tonClick?.(event);\n\t\t\t\ttoggleSidebar();\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isMobile ? <Menu /> : open ? <ChevronLeft /> : <ChevronRight />}\n\t\t\t<span className=\"sr-only\">Toggle Sidebar</span>\n\t\t</Button>\n\t);\n};\n\nexport function SidebarRail({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"button\">) {\n\tconst { toggleSidebar } = useSidebar();\n\n\treturn (\n\t\t<button\n\t\t\tdata-sidebar=\"rail\"\n\t\t\taria-label=\"Toggle Sidebar\"\n\t\t\ttabIndex={-1}\n\t\t\tonClick={toggleSidebar}\n\t\t\ttitle=\"Toggle Sidebar\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex\",\n\t\t\t\t\"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n\t\t\t\t\"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n\t\t\t\t\"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar\",\n\t\t\t\t\"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n\t\t\t\t\"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarInset({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"main\">) {\n\treturn (\n\t\t<main\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex flex-1 flex-col bg-background\",\n\t\t\t\t\"peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:shadow-sm\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarHeader({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarFooter({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"footer\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof Separator>) {\n\treturn (\n\t\t<Separator\n\t\t\tdata-sidebar=\"separator\"\n\t\t\tclassName={cn(\"mx-2 w-auto bg-sidebar-border\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group\"\n\t\t\tclassName={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarGroupLabel({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group-label\"\n\t\t\tclassName={cn(\n\t\t\t\t\"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 caption font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-1 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\t\"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport function SidebarGroupAction({\n\tclassName,\n\tasChild = false,\n\t...props\n}: React.ComponentProps<\"button\"> & {\n\tasChild?: boolean;\n}) {\n\tconst Comp = asChild ? Slot : \"button\";\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"group-action\"\n\t\t\tclassName={cn(\n\t\t\t\t\"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-1 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\t// Increases the hit area of the button on mobile.\n\t\t\t\t\"after:absolute after:-inset-2 md:after:hidden\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\n\nexport function SidebarGroupContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group-content\"\n\t\t\tclassName={cn(\"w-full body\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n\nexport function SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n\treturn (\n\t\t<ul\n\t\t\tdata-sidebar=\"menu\"\n\t\t\tclassName={cn(\"flex w-full min-w-0 flex-col\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n\nexport function SidebarMenuItem({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"li\">) {\n\treturn (\n\t\t<li\n\t\t\tdata-sidebar=\"menu-item\"\n\t\t\tclassName={cn(\"group/menu-item relative\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function SidebarMenuButton({\n\tasChild = false,\n\tisActive = false,\n\ttooltip,\n\tclassName,\n\t...props\n}: React.ComponentProps<\"button\"> & {\n\tisActive?: boolean;\n\tasChild?: boolean;\n\ttooltip?: string | React.ComponentProps<typeof TooltipContent>;\n}) {\n\tconst Comp = asChild ? Slot : \"button\";\n\tconst { isMobile, state } = useSidebar();\n\n\tconst button = (\n\t\t<Comp\n\t\t\tdata-sidebar=\"menu-button\"\n\t\t\tdata-active={isActive}\n\t\t\tclassName={cn(\"peer/menu-button btn h-input flex w-full items-center gap-2 overflow-hidden p-2 text-left body hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none 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\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n\n\tif (!tooltip) {\n\t\treturn button;\n\t}\n\n\tif (typeof tooltip === \"string\") {\n\t\ttooltip = {\n\t\t\tchildren: tooltip,\n\t\t};\n\t}\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>{button}</TooltipTrigger>\n\t\t\t<TooltipContent\n\t\t\t\tside=\"right\"\n\t\t\t\talign=\"center\"\n\t\t\t\thidden={state !== \"collapsed\" || isMobile}\n\t\t\t\t{...tooltip}\n\t\t\t/>\n\t\t</Tooltip>\n\t);\n};\n\nexport function SidebarMenuAction({\n\tclassName,\n\tasChild = false,\n\tshowOnHover = false,\n\t...props\n}: React.ComponentProps<\"button\"> & {\n\tasChild?: boolean;\n\tshowOnHover?: boolean;\n}) {\n\tconst Comp = asChild ? Slot : \"button\";\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"menu-action\"\n\t\t\tclassName={cn(\n\t\t\t\t\"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-1 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\t// Increases the hit area of the button on mobile.\n\t\t\t\t\"after:absolute after:-inset-2 md:after:hidden\",\n\t\t\t\t\"peer-data-[size=sm]/menu-button:top-1\",\n\t\t\t\t\"peer-data-[size=default]/menu-button:top-1.5\",\n\t\t\t\t\"peer-data-[size=lg]/menu-button:top-2.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tshowOnHover &&\n\t\t\t\t\"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-sidebar-accent-foreground md:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\n\nexport function SidebarMenuBadge({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"menu-badge\"\n\t\t\tclassName={cn(\n\t\t\t\t\"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-caption font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none\",\n\t\t\t\t\"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n\t\t\t\t\"peer-data-[size=sm]/menu-button:top-1\",\n\t\t\t\t\"peer-data-[size=default]/menu-button:top-1.5\",\n\t\t\t\t\"peer-data-[size=lg]/menu-button:top-2.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n\nexport function SidebarMenuSkeleton({\n\tclassName,\n\tshowIcon = false,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tshowIcon?: boolean;\n}) {\n\t// Random width between 50 to 90%.\n\tconst width = React.useMemo(() => {\n\t\treturn `${Math.floor(Math.random() * 40) + 50}%`;\n\t}, []);\n\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"menu-skeleton\"\n\t\t\tclassName={cn(\"rounded-md h-8 flex gap-2 px-2 items-center\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{showIcon && (\n\t\t\t\t<Skeleton\n\t\t\t\t\tclassName=\"size-4 rounded-md\"\n\t\t\t\t\tdata-sidebar=\"menu-skeleton-icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Skeleton\n\t\t\t\tclassName=\"h-4 flex-1 max-w-(--skeleton-width)\"\n\t\t\t\tdata-sidebar=\"menu-skeleton-text\"\n\t\t\t\tstyle={\n\t\t\t\t\t{\n\t\t\t\t\t\t\"--skeleton-width\": width,\n\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\n\nexport function SidebarMenuSub({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"ul\">) {\n\treturn (\n\t\t<ul\n\t\t\tdata-sidebar=\"menu-sub\"\n\t\t\tclassName={cn(\n\t\t\t\t\"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 px-2.5 py-0.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function SidebarMenuSubItem({ ...props }: React.ComponentProps<\"li\">) {\n\treturn (\n\t\t<li {...props} />\n\t);\n}\n\n\nexport function SidebarMenuSubButton({\n\tasChild = false,\n\tsize = \"md\",\n\tisActive,\n\tclassName,\n\t...props\n}: React.ComponentProps<\"a\"> & {\n\tasChild?: boolean;\n\tsize: \"sm\" | \"md\";\n\tisActive: boolean;\n}) {\n\tconst Comp = asChild ? Slot : \"a\";\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"menu-sub-button\"\n\t\t\tdata-size={size}\n\t\t\tdata-active={isActive}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-1 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\t\t\t\t\"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n\t\t\t\tsize === \"sm\" && \"text-caption\",\n\t\t\t\tsize === \"md\" && \"body\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n"],"names":["SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","isMobile","useIsMobile","openMobile","setOpenMobile","_open","_setOpen","open","setOpen","value","toggleSidebar","handleKeyDown","event","state","contextValue","jsx","TooltipProvider","cn","Sidebar","side","variant","collapsible","Sheet","jsxs","SheetContent","SheetHeader","SheetTitle","SheetDescription","SidebarTrigger","onClick","Button","Menu","ChevronLeft","ChevronRight","SidebarRail","SidebarInset","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","SidebarGroupLabel","SidebarGroupAction","asChild","Slot","SidebarGroupContent","SidebarMenu","SidebarMenuItem","SidebarMenuButton","isActive","tooltip","Comp","button","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton","size"],"mappings":";;;;;;;;;;;AAwBA,MAAMA,IAAgB,SAChBC,IAAuB,SACvBC,IAAqB,QAErBC,IAA4B,KAY5BC,IAAiBC,EAAM,cAAqC,IAAI;AAE/D,SAASC,IAAa;AACtB,QAAAC,IAAUF,EAAM,IAAID,CAAc;AACxC,MAAI,CAACG;AACE,UAAA,IAAI,MAAM,mDAAmD;AAG7D,SAAAA;AACR;AAEO,SAASC,GAAgB;AAAA,EAC/B,aAAAC,IAAc;AAAA,EACd,MAAMC;AAAA,EACN,cAAcC;AAAA,EACd,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACJ,GAIG;AACF,QAAMC,IAAWC,EAAY,GACvB,CAACC,GAAYC,CAAa,IAAId,EAAM,SAAS,EAAK,GAIlD,CAACe,GAAOC,CAAQ,IAAIhB,EAAM,SAASI,CAAW,GAC9Ca,IAAOZ,KAAYU,GACnBG,IAAUlB,EAAM;AAAA,IACrB,CAACmB,MAAmD;AACnD,UAAIb;AACH,eAAOA,KAAA,gBAAAA,EAAc,OAAOa,KAAU,aAAaA,EAAMF,CAAI,IAAIE;AAGlE,MAAAH,EAASG,CAAK;AAAA,IAKf;AAAA,IACA,CAACb,GAAaW,CAAI;AA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,GAAmB,EAAE,GAAGjE,KAAqC;AAE3E,SAAA,gBAAAe,EAAC,MAAI,EAAA,GAAGf,EAAO,CAAA;AAEjB;AAGO,SAASkE,GAAqB;AAAA,EACpC,SAAAtB,IAAU;AAAA,EACV,MAAAuB,IAAO;AAAA,EACP,UAAAjB;AAAA,EACA,WAAArD;AAAA,EACA,GAAGG;AACJ,GAIG;AAID,SAAA,gBAAAe;AAAA,IAHY6B,IAAUC,IAAO;AAAA,IAG5B;AAAA,MACA,gBAAa;AAAA,MACb,aAAWsB;AAAA,MACX,eAAajB;AAAA,MACb,WAAWjC;AAAA,QACV;AAAA,QACA;AAAA,QACAkD,MAAS,QAAQ;AAAA,QACjBA,MAAS,QAAQ;AAAA,QACjB;AAAA,QACAtE;AAAA,MACD;AAAA,MACC,GAAGG;AAAA,IAAA;AAAA,EACL;AAEF;"}
|
|
1
|
+
{"version":3,"file":"sidebar.es.js","sources":["../../../lib/components/ui/sidebar.tsx"],"sourcesContent":["\"use client\"\n\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { PanelLeft } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n\tSheet,\n\tSheetContent,\n\tSheetDescription,\n\tSheetHeader,\n\tSheetTitle,\n} from \"@/components/ui/sheet\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\"\nimport { useIsMobile } from \"@/hooks/use-mobile\"\nimport { cn } from \"@/utils\"\n\n// TODO use tailwind variables\nconst SIDEBAR_WIDTH = \"16rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\"\nconst SIDEBAR_WIDTH_ICON = \"3rem\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\ntype SidebarContextProps = {\n\tstate: \"expanded\" | \"collapsed\"\n\topen: boolean\n\tsetOpen: (open: boolean) => void\n\topenMobile: boolean\n\tsetOpenMobile: (open: boolean) => void\n\tisMobile: boolean\n\ttoggleSidebar: () => void\n}\n\nexport const SidebarContext = React.createContext<SidebarContextProps | null>(null)\n\nexport function useSidebar() {\n\tconst context = React.useContext(SidebarContext)\n\tif (!context) {\n\t\tthrow new Error(\"useSidebar must be used within a SidebarProvider.\")\n\t}\n\n\treturn context\n}\n\nexport function SidebarProvider(\n\t{\n\t\tdefaultOpen = true,\n\t\topen: openProp,\n\t\tonOpenChange: setOpenProp,\n\t\tclassName,\n\t\tstyle,\n\t\tchildren,\n\t\t...props\n\t}: React.ComponentProps<'div'> & {\n\t\tdefaultOpen?: boolean\n\t\topen?: boolean\n\t\tonOpenChange?: (open: boolean) => void\n\t}) {\n\tconst isMobile = useIsMobile()\n\tconst [openMobile, setOpenMobile] = React.useState(false)\n\n\t// This is the internal state of the sidebar.\n\t// We use openProp and setOpenProp for control from outside the component.\n\tconst [_open, _setOpen] = React.useState(defaultOpen)\n\tconst open = openProp ?? _open\n\tconst setOpen = React.useCallback(\n\t\t(value: boolean | ((value: boolean) => boolean)) => {\n\t\t\tconst openState = typeof value === \"function\" ? value(open) : value\n\t\t\tif (setOpenProp) {\n\t\t\t\tsetOpenProp(openState)\n\t\t\t} else {\n\t\t\t\t_setOpen(openState)\n\t\t\t}\n\n\t\t\t// TODO, use different model for persistence\n\t\t\t// This sets the cookie to keep the sidebar state.\n\t\t\t// document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n\t\t},\n\t\t[setOpenProp, open]\n\t)\n\n\t// Helper to toggle the sidebar.\n\tconst toggleSidebar = React.useCallback(() => {\n\t\treturn isMobile\n\t\t\t? setOpenMobile((open) => !open)\n\t\t\t: setOpen((open) => !open)\n\t}, [isMobile, setOpen, setOpenMobile])\n\n\t// Adds a keyboard shortcut to toggle the sidebar.\n\tReact.useEffect(() => {\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (\n\t\t\t\tevent.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n\t\t\t\t(event.metaKey || event.ctrlKey)\n\t\t\t) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\ttoggleSidebar()\n\t\t\t}\n\t\t}\n\n\t\twindow.addEventListener(\"keydown\", handleKeyDown)\n\t\treturn () => window.removeEventListener(\"keydown\", handleKeyDown)\n\t}, [toggleSidebar])\n\n\t// We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n\t// This makes it easier to style the sidebar with Tailwind classes.\n\tconst state = open ? \"expanded\" : \"collapsed\"\n\n\tconst contextValue = React.useMemo<SidebarContextProps>(\n\t\t() => ({\n\t\t\tstate,\n\t\t\topen,\n\t\t\tsetOpen,\n\t\t\tisMobile,\n\t\t\topenMobile,\n\t\t\tsetOpenMobile,\n\t\t\ttoggleSidebar,\n\t\t}),\n\t\t[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n\t)\n\n\treturn (\n\t\t<SidebarContext.Provider value={contextValue}>\n\t\t\t<TooltipProvider delayDuration={0}>\n\t\t\t\t<div\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--sidebar-width\": SIDEBAR_WIDTH,\n\t\t\t\t\t\t\t\"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar\",\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</TooltipProvider>\n\t\t</SidebarContext.Provider>\n\t)\n}\n\n\nexport function Sidebar(\n\t{\n\t\tside = \"left\",\n\t\tvariant = \"sidebar\",\n\t\tcollapsible = \"offcanvas\",\n\t\tclassName,\n\t\tchildren,\n\t\t...props\n\t}: React.ComponentProps<\"div\"> & {\n\t\tside?: \"left\" | \"right\"\n\t\tvariant?: \"sidebar\" | \"floating\" | \"inset\"\n\t\tcollapsible?: \"offcanvas\" | \"icon\" | \"none\"\n\t}\n) {\n\tconst { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n\tif (collapsible === \"none\") {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t)\n\t}\n\n\tif (isMobile) {\n\t\treturn (\n\t\t\t<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n\t\t\t\t<SheetContent\n\t\t\t\t\tdata-sidebar=\"sidebar\"\n\t\t\t\t\tdata-mobile=\"true\"\n\t\t\t\t\tclassName=\"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\tside={side}\n\t\t\t\t>\n\t\t\t\t\t<SheetHeader className=\"sr-only\">\n\t\t\t\t\t\t<SheetTitle>Sidebar</SheetTitle>\n\t\t\t\t\t\t<SheetDescription>Displays the mobile sidebar.</SheetDescription>\n\t\t\t\t\t</SheetHeader>\n\t\t\t\t\t<div className=\"flex h-full w-full flex-col\">{children}</div>\n\t\t\t\t</SheetContent>\n\t\t\t</Sheet>\n\t\t)\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"group peer hidden text-sidebar-foreground md:block\"\n\t\t\tdata-state={state}\n\t\t\tdata-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n\t\t\tdata-variant={variant}\n\t\t\tdata-side={side}\n\t\t>\n\t\t\t{/* This is what handles the sidebar gap on desktop */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"relative w-(--sidebar-width) bg-sidebar transition-[width] duration-200 ease-linear\",\n\t\t\t\t\t\"group-data-[collapsible=offcanvas]:w-0\",\n\t\t\t\t\t\"group-data-[side=right]:rotate-180\",\n\t\t\t\t\tvariant === \"floating\" || variant === \"inset\"\n\t\t\t\t\t\t? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]\"\n\t\t\t\t\t\t: \"group-data-[collapsible=icon]:w-[--sidebar-width-icon]\"\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n\t\t\t\t\tside === \"left\"\n\t\t\t\t\t\t? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n\t\t\t\t\t\t: \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n\t\t\t\t\t// Adjust the padding for floating and inset variants.\n\t\t\t\t\tvariant === \"floating\" || variant === \"inset\"\n\t\t\t\t\t\t? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]\"\n\t\t\t\t\t\t: \"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tdata-sidebar=\"sidebar\"\n\t\t\t\t\tclassName=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\n\n\nexport function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n\tconst { toggleSidebar } = useSidebar()\n\n\treturn (\n\t\t<Button\n\t\t\tdata-sidebar=\"trigger\"\n\t\t\tvariant=\"ghost\"\n\t\t\tsize=\"icon\"\n\t\t\tonClick={(event) => {\n\t\t\t\tonClick?.(event)\n\t\t\t\ttoggleSidebar()\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t<PanelLeft />\n\t\t\t<span className=\"sr-only\">Toggle Sidebar</span>\n\t\t</Button>\n\t)\n}\n\n// TODO, evaluate if we need this??\nexport const SidebarRail = React.forwardRef<\n\tHTMLButtonElement,\n\tReact.ComponentProps<\"button\">\n>(({ className, ...props }, ref) => {\n\tconst { toggleSidebar } = useSidebar()\n\n\treturn (\n\t\t<button\n\t\t\tref={ref}\n\t\t\tdata-sidebar=\"rail\"\n\t\t\taria-label=\"Toggle Sidebar\"\n\t\t\ttabIndex={-1}\n\t\t\tonClick={toggleSidebar}\n\t\t\ttitle=\"Toggle Sidebar\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex\",\n\t\t\t\t\"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize\",\n\t\t\t\t\"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n\t\t\t\t\"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar\",\n\t\t\t\t\"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n\t\t\t\t\"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n})\nSidebarRail.displayName = \"SidebarRail\"\n\nexport function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {\n\treturn (\n\t\t<main\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex w-full flex-1 flex-col bg-background\",\n\t\t\t\t\"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\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\n\nexport function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\n\t\t\tdata-sidebar=\"header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"footer\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group\"\n\t\t\tclassName={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\n\nexport function SidebarGroupLabel({ className, asChild = false, ...props }: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n\tconst Comp = asChild ? Slot : \"div\"\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"group-label\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\t\"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\nexport function SidebarGroupAction({ className, asChild = false, ...props }: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n\tconst Comp = asChild ? Slot : \"button\"\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"group-action\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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\t\t\t\t// Increases the hit area of the button on mobile.\n\t\t\t\t\"after:absolute after:-inset-2 after:md:hidden\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"group-content\"\n\t\t\tclassName={cn(\"w-full text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n\treturn (\n\t\t<ul\n\t\t\tdata-sidebar=\"menu\"\n\t\t\tclassName={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n\treturn (\n\t\t<li\n\t\t\tdata-sidebar=\"menu-item\"\n\t\t\tclassName={cn(\"group/menu-item relative\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuButton\n\t(\n\t\t{\n\t\t\tasChild = false,\n\t\t\tisActive = false,\n\t\t\ttooltip,\n\t\t\tclassName,\n\t\t\t...props\n\t\t}: React.ComponentProps<\"button\"> & {\n\t\t\tasChild?: boolean\n\t\t\tisActive?: boolean\n\t\t\ttooltip?: string | React.ComponentProps<typeof TooltipContent>\n\t\t}\n\t) {\n\tconst Comp = asChild ? Slot : \"button\"\n\tconst { isMobile, state } = useSidebar()\n\n\tconst button = (\n\t\t<Comp\n\t\t\tdata-sidebar=\"menu-button\"\n\t\t\tdata-active={isActive}\n\t\t\tclassName={cn(\"peer/menu-button btn h-input flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-sm hover:bg-sidebar-primary/20 hover:text-sidebar-primary group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 data-[active=true]:bg-sidebar-primary/20 data-[active=true]:font-medium data-[active=true]:text-sidebar-primary group-data-[collapsible=icon]:!size-icon group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n\n\tif (!tooltip) {\n\t\treturn button\n\t}\n\n\tif (typeof tooltip === \"string\") {\n\t\ttooltip = {\n\t\t\tchildren: tooltip,\n\t\t}\n\t}\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>{button}</TooltipTrigger>\n\t\t\t<TooltipContent\n\t\t\t\tside=\"right\"\n\t\t\t\talign=\"center\"\n\t\t\t\thidden={state !== \"collapsed\" || isMobile}\n\t\t\t\t{...tooltip}\n\t\t\t/>\n\t\t</Tooltip>\n\t)\n}\n\n\n/// TODO fix positioning\nexport function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }: React.ComponentProps<\"button\"> & {\n\tasChild?: boolean\n\tshowOnHover?: boolean\n}) {\n\tconst Comp = asChild ? Slot : \"button\"\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"menu-action\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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\t\t\t\t// Increases the hit area of the button on mobile.\n\t\t\t\t\"after:absolute after:-inset-2 after:md:hidden\",\n\t\t\t\t\"peer-data-[size=sm]/menu-button:top-1\",\n\t\t\t\t\"peer-data-[size=default]/menu-button:top-1.5\",\n\t\t\t\t\"peer-data-[size=lg]/menu-button:top-2.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tshowOnHover &&\n\t\t\t\t\"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-sidebar-accent-foreground md:opacity-0\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"menu-badge\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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\t\t\t\t\"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n\t\t\t\t\"peer-data-[size=sm]/menu-button:top-1\",\n\t\t\t\t\"peer-data-[size=default]/menu-button:top-1.5\",\n\t\t\t\t\"peer-data-[size=lg]/menu-button:top-2.5\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuSkeleton({ className, showIcon = false, ...props }: React.ComponentProps<\"div\"> & {\n\tshowIcon?: boolean\n}) {\n\t// Random width between 50 to 90%.\n\tconst width = React.useMemo(() => {\n\t\treturn `${Math.floor(Math.random() * 40) + 50}%`\n\t}, [])\n\n\treturn (\n\t\t<div\n\t\t\tdata-sidebar=\"menu-skeleton\"\n\t\t\tclassName={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{showIcon && (\n\t\t\t\t<Skeleton\n\t\t\t\t\tclassName=\"size-4 rounded-md\"\n\t\t\t\t\tdata-sidebar=\"menu-skeleton-icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Skeleton\n\t\t\t\tclassName=\"h-4 max-w-[--skeleton-width] flex-1\"\n\t\t\t\tdata-sidebar=\"menu-skeleton-text\"\n\t\t\t\tstyle={\n\t\t\t\t\t{\n\t\t\t\t\t\t\"--skeleton-width\": width,\n\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n\nexport function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n\treturn (\n\t\t<ul\n\t\t\tdata-sidebar=\"menu-sub\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function SidebarMenuSubItem({ ...props }: React.ComponentProps<'li'>) { return <li {...props} /> }\n\nexport function SidebarMenuSubButton({ asChild = false, size = \"md\", isActive, className, ...props }: React.ComponentProps<'a'> & {\n\tasChild?: boolean\n\tsize?: \"sm\" | \"md\"\n\tisActive?: boolean\n}) {\n\tconst Comp = asChild ? Slot : \"a\"\n\n\treturn (\n\t\t<Comp\n\t\t\tdata-sidebar=\"menu-sub-button\"\n\t\t\tdata-size={size}\n\t\t\tdata-active={isActive}\n\t\t\tclassName={cn(\n\t\t\t\t\"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\t\t\t\t\"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n\t\t\t\tsize === \"sm\" && \"text-xs\",\n\t\t\t\tsize === \"md\" && \"text-sm\",\n\t\t\t\t\"group-data-[collapsible=icon]:hidden\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n// TODO, standardize heights here"],"names":["SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","isMobile","useIsMobile","openMobile","setOpenMobile","_open","_setOpen","open","setOpen","value","openState","toggleSidebar","handleKeyDown","event","state","contextValue","jsx","TooltipProvider","cn","Sidebar","side","variant","collapsible","Sheet","jsxs","SheetContent","SheetHeader","SheetTitle","SheetDescription","SidebarTrigger","onClick","Button","PanelLeft","SidebarRail","ref","SidebarInset","SidebarHeader","SidebarFooter","SidebarContent","SidebarGroup","SidebarGroupLabel","asChild","Slot","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","SidebarMenuButton","isActive","tooltip","Comp","button","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton","size"],"mappings":";;;;;;;;;;;AAyBA,MAAMA,IAAgB,SAChBC,IAAuB,SACvBC,IAAqB,QACrBC,IAA4B,KAYrBC,IAAiBC,EAAM,cAA0C,IAAI;AAE3E,SAASC,IAAa;AACtB,QAAAC,IAAUF,EAAM,WAAWD,CAAc;AAC/C,MAAI,CAACG;AACE,UAAA,IAAI,MAAM,mDAAmD;AAG7D,SAAAA;AACR;AAEO,SAASC,EACf;AAAA,EACC,aAAAC,IAAc;AAAA,EACd,MAAMC;AAAA,EACN,cAAcC;AAAA,EACd,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACJ,GAIG;AACH,QAAMC,IAAWC,EAAY,GACvB,CAACC,GAAYC,CAAa,IAAId,EAAM,SAAS,EAAK,GAIlD,CAACe,GAAOC,CAAQ,IAAIhB,EAAM,SAASI,CAAW,GAC9Ca,IAAOZ,KAAYU,GACnBG,IAAUlB,EAAM;AAAA,IACrB,CAACmB,MAAmD;AACnD,YAAMC,IAAY,OAAOD,KAAU,aAAaA,EAAMF,CAAI,IAAIE;AAC9D,MAAIb,IACHA,EAAYc,CAAS,IAErBJ,EAASI,CAAS;AAAA,IAMpB;AAAA,IACA,CAACd,GAAaW,CAAI;AAAA,EACnB,GAGMI,IAAgBrB,EAAM,YAAY,MAChCW,IACJG,EAAc,CAACG,MAAS,CAACA,CAAI,IAC7BC,EAAQ,CAACD,MAAS,CAACA,CAAI,GACxB,CAACN,GAAUO,GAASJ,CAAa,CAAC;AAGrC,EAAAd,EAAM,UAAU,MAAM;AACf,UAAAsB,IAAgB,CAACC,MAAyB;AAC/C,MACCA,EAAM,QAAQzB,MACbyB,EAAM,WAAWA,EAAM,aAExBA,E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GG;AAAA,MAEH,UAAA;AAAA,QACA2D,KAAA,gBAAA3C;AAAA,UAAC6C;AAAA,UAAA;AAAA,YACA,WAAU;AAAA,YACV,gBAAa;AAAA,UAAA;AAAA,QACd;AAAA,QAED,gBAAA7C;AAAA,UAAC6C;AAAA,UAAA;AAAA,YACA,WAAU;AAAA,YACV,gBAAa;AAAA,YACb,OACC;AAAA,cACC,oBAAoBD;AAAA,YAAA;AAAA,UACrB;AAAA,QAAA;AAAA,MAEF;AAAA,IAAA;AAAA,EACD;AAEF;AAEO,SAASE,GAAe,EAAE,WAAAjE,GAAW,GAAGG,KAAqC;AAElF,SAAA,gBAAAgB;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,gBAAa;AAAA,MACb,WAAWE;AAAA,QACV;AAAA,QACA;AAAA,QACArB;AAAA,MACD;AAAA,MACC,GAAGG;AAAA,IAAA;AAAA,EACL;AAEF;AAEO,SAAS+D,GAAmB,EAAE,GAAG/D,KAAqC;AAAS,SAAA,gBAAAgB,EAAC,MAAK,EAAA,GAAGhB,EAAO,CAAA;AAAG;AAEzF,SAAAgE,GAAqB,EAAE,SAAAvB,IAAU,IAAO,MAAAwB,IAAO,MAAM,UAAAjB,GAAU,WAAAnD,GAAW,GAAGG,KAI1F;AAID,SAAA,gBAAAgB;AAAA,IAHYyB,IAAUC,IAAO;AAAA,IAG5B;AAAA,MACA,gBAAa;AAAA,MACb,aAAWuB;AAAA,MACX,eAAajB;AAAA,MACb,WAAW9B;AAAA,QACV;AAAA,QACA;AAAA,QACA+C,MAAS,QAAQ;AAAA,QACjBA,MAAS,QAAQ;AAAA,QACjB;AAAA,QACApE;AAAA,MACD;AAAA,MACC,GAAGG;AAAA,IAAA;AAAA,EACL;AAEF;"}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Root as o, List as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Root as o, List as r, Trigger as s, Content as a } from "../../node_modules/.pnpm/@radix-ui_react-tabs@1.1.12_@types_react-dom@19.1.0_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0/node_modules/@radix-ui/react-tabs/dist/index.es.js";
|
|
3
3
|
import { cn as n } from "../../utils/index.es.js";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
4
|
+
const g = o;
|
|
5
|
+
function b({
|
|
6
6
|
className: e,
|
|
7
|
-
...
|
|
7
|
+
...i
|
|
8
8
|
}) {
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
|
|
9
|
+
return /* @__PURE__ */ t(
|
|
10
|
+
r,
|
|
11
11
|
{
|
|
12
12
|
className: n(
|
|
13
13
|
"inline-flex h-9 items-center justify-center bg-background p-1 text-muted-foreground",
|
|
14
14
|
e
|
|
15
15
|
),
|
|
16
|
-
...
|
|
16
|
+
...i
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function d({
|
|
21
21
|
className: e,
|
|
22
|
-
...
|
|
22
|
+
...i
|
|
23
23
|
}) {
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
24
|
+
return /* @__PURE__ */ t(
|
|
25
|
+
s,
|
|
26
26
|
{
|
|
27
27
|
className: n(
|
|
28
|
-
"inline-flex items-center justify-center whitespace-nowrap px-3 py-1 body font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground
|
|
28
|
+
"inline-flex items-center justify-center whitespace-nowrap px-3 py-1 body font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground",
|
|
29
29
|
e
|
|
30
30
|
),
|
|
31
|
-
...
|
|
31
|
+
...i
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
function l({
|
|
36
36
|
className: e,
|
|
37
|
-
...
|
|
37
|
+
...i
|
|
38
38
|
}) {
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ t(
|
|
40
40
|
a,
|
|
41
41
|
{
|
|
42
42
|
className: n(
|
|
43
43
|
"mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring",
|
|
44
44
|
e
|
|
45
45
|
),
|
|
46
|
-
...
|
|
46
|
+
...i
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
export {
|
|
51
|
-
|
|
51
|
+
g as Tabs,
|
|
52
52
|
l as TabsContent,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
b as TabsList,
|
|
54
|
+
d as TabsTrigger
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=tabs.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.es.js","sources":["../../../lib/components/ui/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nexport const Tabs = TabsPrimitive.Root;\n\nexport function TabsList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex h-9 items-center justify-center bg-background p-1 text-muted-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TabsTrigger({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n\treturn (\n\t\t<TabsPrimitive.Trigger\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex items-center justify-center whitespace-nowrap px-3 py-1 body font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground
|
|
1
|
+
{"version":3,"file":"tabs.es.js","sources":["../../../lib/components/ui/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nexport const Tabs = TabsPrimitive.Root;\n\nexport function TabsList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex h-9 items-center justify-center bg-background p-1 text-muted-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function TabsTrigger({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n\treturn (\n\t\t<TabsPrimitive.Trigger\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex items-center justify-center whitespace-nowrap px-3 py-1 body font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n};\n\nexport function TabsContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n\treturn (\n\t\t<TabsPrimitive.Content\n\t\t\tclassName={cn(\n\t\t\t\t\"mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}"],"names":["Tabs","TabsPrimitive.Root","TabsList","className","props","jsx","TabsPrimitive.List","cn","TabsTrigger","TabsPrimitive.Trigger","TabsContent","TabsPrimitive.Content"],"mappings":";;;AAKO,MAAMA,IAAOC;AAEb,SAASC,EAAS;AAAA,EACxB,WAAAC;AAAA,EACA,GAAGC;AACJ,GAAoD;AAElD,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACA,WAAWC;AAAA,QACV;AAAA,QACAJ;AAAA,MACD;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EACL;AAEF;AAEO,SAASI,EAAY;AAAA,EAC3B,WAAAL;AAAA,EACA,GAAGC;AACJ,GAAuD;AAErD,SAAA,gBAAAC;AAAA,IAACI;AAAAA,IAAA;AAAA,MACA,WAAWF;AAAA,QACV;AAAA,QACAJ;AAAA,MACD;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EACL;AAEF;AAEO,SAASM,EAAY;AAAA,EAC3B,WAAAP;AAAA,EACA,GAAGC;AACJ,GAAuD;AAErD,SAAA,gBAAAC;AAAA,IAACM;AAAAA,IAAA;AAAA,MACA,WAAWJ;AAAA,QACV;AAAA,QACAJ;AAAA,MACD;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EACL;AAEF;"}
|
package/dist/index.es.d.ts
CHANGED
|
@@ -502,12 +502,14 @@ declare const sheetVariants: (props?: ({
|
|
|
502
502
|
export declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React_2.ComponentProps<"div"> & {
|
|
503
503
|
side?: "left" | "right";
|
|
504
504
|
variant?: "sidebar" | "floating" | "inset";
|
|
505
|
-
collapsible?: "offcanvas" | "none";
|
|
505
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
506
506
|
}): JSX.Element;
|
|
507
507
|
|
|
508
|
-
export declare function SidebarContent({ className, ...props }: React_2.ComponentProps<
|
|
508
|
+
export declare function SidebarContent({ className, ...props }: React_2.ComponentProps<'div'>): JSX.Element;
|
|
509
509
|
|
|
510
|
-
declare
|
|
510
|
+
export declare const SidebarContext: React_2.Context<SidebarContextProps | null>;
|
|
511
|
+
|
|
512
|
+
declare type SidebarContextProps = {
|
|
511
513
|
state: "expanded" | "collapsed";
|
|
512
514
|
open: boolean;
|
|
513
515
|
setOpen: (open: boolean) => void;
|
|
@@ -517,68 +519,68 @@ declare type SidebarContext = {
|
|
|
517
519
|
toggleSidebar: () => void;
|
|
518
520
|
};
|
|
519
521
|
|
|
520
|
-
declare
|
|
521
|
-
|
|
522
|
-
export declare function SidebarFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
522
|
+
export declare function SidebarFooter({ className, ...props }: React_2.ComponentProps<'div'>): JSX.Element;
|
|
523
523
|
|
|
524
|
-
export declare function SidebarGroup({ className, ...props }: React_2.ComponentProps<
|
|
524
|
+
export declare function SidebarGroup({ className, ...props }: React_2.ComponentProps<'div'>): JSX.Element;
|
|
525
525
|
|
|
526
526
|
export declare function SidebarGroupAction({ className, asChild, ...props }: React_2.ComponentProps<"button"> & {
|
|
527
527
|
asChild?: boolean;
|
|
528
528
|
}): JSX.Element;
|
|
529
529
|
|
|
530
|
-
export declare function SidebarGroupContent({ className, ...props }: React_2.ComponentProps<
|
|
530
|
+
export declare function SidebarGroupContent({ className, ...props }: React_2.ComponentProps<'div'>): JSX.Element;
|
|
531
531
|
|
|
532
|
-
export declare function SidebarGroupLabel({ className, ...props }: React_2.ComponentProps<"div">
|
|
532
|
+
export declare function SidebarGroupLabel({ className, asChild, ...props }: React_2.ComponentProps<"div"> & {
|
|
533
|
+
asChild?: boolean;
|
|
534
|
+
}): JSX.Element;
|
|
533
535
|
|
|
534
|
-
export declare function SidebarHeader({ className, ...props }: React_2.ComponentProps<
|
|
536
|
+
export declare function SidebarHeader({ className, ...props }: React_2.ComponentProps<'div'>): JSX.Element;
|
|
535
537
|
|
|
536
|
-
export declare function SidebarInset({ className, ...props }: React_2.ComponentProps<
|
|
538
|
+
export declare function SidebarInset({ className, ...props }: React_2.ComponentProps<'main'>): JSX.Element;
|
|
537
539
|
|
|
538
|
-
export declare function SidebarMenu({ className, ...props }: React_2.ComponentProps<
|
|
540
|
+
export declare function SidebarMenu({ className, ...props }: React_2.ComponentProps<'ul'>): JSX.Element;
|
|
539
541
|
|
|
540
542
|
export declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React_2.ComponentProps<"button"> & {
|
|
541
543
|
asChild?: boolean;
|
|
542
544
|
showOnHover?: boolean;
|
|
543
545
|
}): JSX.Element;
|
|
544
546
|
|
|
545
|
-
export declare function SidebarMenuBadge({ className, ...props }: React_2.ComponentProps<
|
|
547
|
+
export declare function SidebarMenuBadge({ className, ...props }: React_2.ComponentProps<'div'>): JSX.Element;
|
|
546
548
|
|
|
547
549
|
export declare function SidebarMenuButton({ asChild, isActive, tooltip, className, ...props }: React_2.ComponentProps<"button"> & {
|
|
548
|
-
isActive?: boolean;
|
|
549
550
|
asChild?: boolean;
|
|
551
|
+
isActive?: boolean;
|
|
550
552
|
tooltip?: string | React_2.ComponentProps<typeof TooltipContent>;
|
|
551
553
|
}): JSX.Element;
|
|
552
554
|
|
|
553
|
-
export declare function SidebarMenuItem({ className, ...props }: React_2.ComponentProps<
|
|
555
|
+
export declare function SidebarMenuItem({ className, ...props }: React_2.ComponentProps<'li'>): JSX.Element;
|
|
554
556
|
|
|
555
557
|
export declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React_2.ComponentProps<"div"> & {
|
|
556
558
|
showIcon?: boolean;
|
|
557
559
|
}): JSX.Element;
|
|
558
560
|
|
|
559
|
-
export declare function SidebarMenuSub({ className, ...props }: React_2.ComponentProps<
|
|
561
|
+
export declare function SidebarMenuSub({ className, ...props }: React_2.ComponentProps<'ul'>): JSX.Element;
|
|
560
562
|
|
|
561
|
-
export declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React_2.ComponentProps<
|
|
563
|
+
export declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React_2.ComponentProps<'a'> & {
|
|
562
564
|
asChild?: boolean;
|
|
563
|
-
size
|
|
564
|
-
isActive
|
|
565
|
+
size?: "sm" | "md";
|
|
566
|
+
isActive?: boolean;
|
|
565
567
|
}): JSX.Element;
|
|
566
568
|
|
|
567
|
-
export declare function SidebarMenuSubItem({ ...props }: React_2.ComponentProps<
|
|
569
|
+
export declare function SidebarMenuSubItem({ ...props }: React_2.ComponentProps<'li'>): JSX.Element;
|
|
568
570
|
|
|
569
|
-
export declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React_2.ComponentProps<
|
|
571
|
+
export declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React_2.ComponentProps<'div'> & {
|
|
570
572
|
defaultOpen?: boolean;
|
|
571
573
|
open?: boolean;
|
|
572
|
-
onOpenChange?: (
|
|
574
|
+
onOpenChange?: (open: boolean) => void;
|
|
573
575
|
}): JSX.Element;
|
|
574
576
|
|
|
575
|
-
export declare
|
|
576
|
-
|
|
577
|
-
export declare function SidebarSeparator({ className, ...props }: React_2.ComponentProps<typeof Separator>): JSX.Element;
|
|
577
|
+
export declare const SidebarRail: React_2.ForwardRefExoticComponent<Omit<React_2.DetailedHTMLProps<React_2.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
578
578
|
|
|
579
579
|
export declare function SidebarTrigger({ className, onClick, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
|
|
580
580
|
|
|
581
|
-
declare
|
|
581
|
+
export declare function SingleSelect({ value, setValue, options, className, buttonLabel, ...props }: SingleSelectProps): JSX.Element;
|
|
582
|
+
|
|
583
|
+
export declare interface SingleSelectProps extends SelectionProps<string> {
|
|
582
584
|
}
|
|
583
585
|
|
|
584
586
|
export declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
|
|
@@ -670,7 +672,9 @@ export declare function TfMultiSelect({ ...props }: TfMultiSelectProps): JSX.Ele
|
|
|
670
672
|
export declare interface TfMultiSelectProps extends Omit<MultiSelectProps, "value" | "setValue"> {
|
|
671
673
|
}
|
|
672
674
|
|
|
673
|
-
declare
|
|
675
|
+
export declare function TfSingleSelect({ ...props }: TfSingleSelectProps): JSX.Element;
|
|
676
|
+
|
|
677
|
+
export declare interface TfSingleSelectProps extends Omit<SingleSelectProps, "value" | "setValue"> {
|
|
674
678
|
}
|
|
675
679
|
|
|
676
680
|
export declare function TfTextarea({ disabled, ...props }: TfTextareaProps): JSX.Element;
|
|
@@ -711,7 +715,7 @@ export declare const useFieldContext: <TData>() => FieldApi<any, string, TData,
|
|
|
711
715
|
|
|
712
716
|
export declare function useIsMobile(): boolean;
|
|
713
717
|
|
|
714
|
-
export declare function useSidebar():
|
|
718
|
+
export declare function useSidebar(): SidebarContextProps;
|
|
715
719
|
|
|
716
720
|
export declare type VisibilityState<T> = {
|
|
717
721
|
[K in keyof T]?: boolean;
|