{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "resizable",
  "title": "Resizable",
  "description": "Panels resized by dragging or with the keyboard, side by side or stacked.",
  "dependencies": [
    "lucide-react",
    "react-resizable-panels@^4.14.1"
  ],
  "registryDependencies": [
    "@corsair-ui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/resizable.tsx",
      "content": "\"use client\";\n\nimport { GripVerticalIcon } from \"lucide-react\";\nimport type { Ref } from \"react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\ninterface ResizablePanelGroupProps extends Omit<ResizablePrimitive.GroupProps, \"elementRef\"> {\n  /** \"horizontal\" puts the panels side by side, \"vertical\" stacks them. */\n  orientation?: \"horizontal\" | \"vertical\";\n  ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Panels whose sizes the user can change: a file tree beside an editor, a\n * preview under a form. Put `ResizablePanel`s in it with a\n * `ResizableHandle` between each pair. A handle is a focusable separator:\n * Tab reaches it, the arrow keys resize the panels on either side (Left and\n * Right side by side, Up and Down when stacked), Home and End move it to the\n * limits, Enter collapses or restores a collapsible panel, and screen readers\n * hear its position as a value between the panels' limits. Dragging with a\n * pointer works too. Sizes change instantly; nothing animates. Built on\n * `react-resizable-panels`: sizes such as `defaultSize=\"30\"` are percentages,\n * plain numbers are pixels.\n *\n * @example\n * <ResizablePanelGroup orientation=\"horizontal\" className=\"min-h-64 rounded-lg border\">\n *   <ResizablePanel defaultSize=\"30\" minSize=\"20\">\n *     Charts\n *   </ResizablePanel>\n *   <ResizableHandle withHandle aria-label=\"Resize charts\" />\n *   <ResizablePanel>Log</ResizablePanel>\n * </ResizablePanelGroup>\n */\nfunction ResizablePanelGroup({\n  className,\n  orientation = \"horizontal\",\n  style,\n  ref,\n  ...props\n}: ResizablePanelGroupProps) {\n  return (\n    <ResizablePrimitive.Group\n      data-slot=\"resizable-panel-group\"\n      data-orientation={orientation}\n      orientation={orientation}\n      elementRef={ref}\n      className={cn(\"size-full\", className)}\n      // The library sets width and height to 100% inline, which would beat a\n      // size given in className (h-64); size-full above is the same default.\n      style={{ width: undefined, height: undefined, ...style }}\n      {...props}\n    />\n  );\n}\n\ninterface ResizablePanelProps extends Omit<ResizablePrimitive.PanelProps, \"elementRef\"> {\n  ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * One resizable area. Size it with `defaultSize`, `minSize` and `maxSize`;\n * `collapsible` lets it shrink to `collapsedSize`. Control it from code with\n * `panelRef` (`usePanelRef` from `react-resizable-panels`).\n */\nfunction ResizablePanel({ ref, ...props }: ResizablePanelProps) {\n  return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" elementRef={ref} {...props} />;\n}\n\ninterface ResizableHandleProps extends Omit<ResizablePrimitive.SeparatorProps, \"elementRef\"> {\n  /** Shows a grip on the line, so the handle is easier to find and to grab. */\n  withHandle?: boolean;\n  /** Accessible name of the separator. Name it after the panel it resizes when there are several. */\n  \"aria-label\"?: string;\n  ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The line between two panels that resizes them. Its state is in\n * `data-separator` (\"inactive\", \"hover\", \"active\", \"focus\", \"disabled\") and\n * its direction in `aria-orientation`, for your own styles.\n */\nfunction ResizableHandle({\n  withHandle = false,\n  \"aria-label\": label = \"Resize\",\n  className,\n  ref,\n  ...props\n}: ResizableHandleProps) {\n  return (\n    <ResizablePrimitive.Separator\n      data-slot=\"resizable-handle\"\n      aria-label={label}\n      elementRef={ref}\n      className={cn(\n        \"bg-border relative flex w-px shrink-0 items-center justify-center\",\n        // A wider invisible hit area centred on the 1px line.\n        \"after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2\",\n        \"transition-[background-color,box-shadow] outline-none motion-reduce:transition-none\",\n        \"focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n        \"data-[separator=active]:bg-ring data-[separator=hover]:bg-ring/50\",\n        \"aria-[disabled=true]:cursor-not-allowed aria-[disabled=true]:opacity-50\",\n        // aria-orientation=\"horizontal\" is the line between stacked panels.\n        \"aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full\",\n        \"aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:inset-y-auto aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2\",\n        \"[&[aria-orientation=horizontal]>div]:rotate-90\",\n        className\n      )}\n      {...props}\n    >\n      {withHandle ? (\n        <div\n          data-slot=\"resizable-handle-grip\"\n          aria-hidden=\"true\"\n          className=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-[4px] border\"\n        >\n          <GripVerticalIcon className=\"size-2.5\" />\n        </div>\n      ) : null}\n    </ResizablePrimitive.Separator>\n  );\n}\n\nexport {\n  ResizableHandle,\n  ResizablePanel,\n  ResizablePanelGroup,\n  type ResizableHandleProps,\n  type ResizablePanelGroupProps,\n  type ResizablePanelProps,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}