UNPKG

@arolariu/components

Version:

A collection of reusable components for React applications, built as ESM & CJS modules with tree shake, minify and bundler optimizations enabled, for the lowest bundle size (import cost)! 😍

1 lines 3.08 kB
{"version":3,"file":"components\\ui\\resizable.cjs","sources":["webpack://@arolariu/components/./src/components/ui/resizable.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport { GripVerticalIcon } from \"lucide-react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction ResizablePanelGroup({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn(\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction ResizablePanel({\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\n}\n\nfunction ResizableHandle({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) {\n return (\n <ResizablePrimitive.PanelResizeHandle\n data-slot=\"resizable-handle\"\n className={cn(\n \"bg-neutral-200 focus-visible:ring-neutral-950 relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 dark:bg-neutral-800 dark:focus-visible:ring-neutral-300\",\n className\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"bg-neutral-200 z-10 flex h-4 w-3 items-center justify-center rounded-xs border dark:bg-neutral-800\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n );\n}\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n"],"names":["ResizablePanelGroup","className","props","ResizablePrimitive","cn","ResizablePanel","ResizableHandle","withHandle","GripVerticalIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAASA,oBAAoB,EAC3BC,SAAS,EACT,GAAGC,OACwD;IAC3D,OACE,WADF,GACE,qCAACC,gDAAAA,UAA6B;QAC5B,aAAU;QACV,WAAWC,IAAAA,0BAAAA,EAAAA,EACT,qEACAH;QAED,GAAGC,KAAK;;AAGf;AAEA,SAASG,eAAe,EACtB,GAAGH,OACmD;IACtD,OAAO,WAAP,GAAO,qCAACC,gDAAAA,KAAwB;QAAC,aAAU;QAAmB,GAAGD,KAAK;;AACxE;AAEA,SAASI,gBAAgB,EACvBC,UAAU,EACVN,SAAS,EACT,GAAGC,OAGJ;IACC,OACE,WADF,GACE,qCAACC,gDAAAA,iBAAoC;QACnC,aAAU;QACV,WAAWC,IAAAA,0BAAAA,EAAAA,EACT,itBACAH;QAED,GAAGC,KAAK;kBAERK,cACC,WADDA,GACC,qCAAC;YAAI,WAAU;sBACb,mDAACC,sCAAAA,gBAAgBA,EAAAA;gBAAC,WAAU;;;;AAKtC"}