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.19 kB
{"version":3,"file":"components\\ui\\resizable.cjs","sources":["webpack://@arolariu/components/./src/components/ui/resizable.tsx"],"sourcesContent":["\r\n\r\nimport * as React from \"react\";\r\nimport { GripVerticalIcon } from \"lucide-react\";\r\nimport * as ResizablePrimitive from \"react-resizable-panels\";\r\nimport { cn } from \"./../../lib/utils\";\r\n\r\nfunction ResizablePanelGroup({\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {\r\n return (\r\n <ResizablePrimitive.PanelGroup\r\n data-slot=\"resizable-panel-group\"\r\n className={cn(\r\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction ResizablePanel({\r\n ...props\r\n}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {\r\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />;\r\n}\r\n\r\nfunction ResizableHandle({\r\n withHandle,\r\n className,\r\n ...props\r\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\r\n withHandle?: boolean;\r\n}) {\r\n return (\r\n <ResizablePrimitive.PanelResizeHandle\r\n data-slot=\"resizable-handle\"\r\n className={cn(\r\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\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {withHandle && (\r\n <div className=\"bg-neutral-200 z-10 flex h-4 w-3 items-center justify-center rounded-xs border dark:bg-neutral-800\">\r\n <GripVerticalIcon className=\"size-2.5\" />\r\n </div>\r\n )}\r\n </ResizablePrimitive.PanelResizeHandle>\r\n );\r\n}\r\n\r\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\r\n"],"names":["ResizablePanelGroup","className","props","ResizablePrimitive","cn","ResizablePanel","ResizableHandle","withHandle","GripVerticalIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,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"}