{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"resizable","title":"Resizable","description":"Resize panels side by side or one above the other by dragging the handle between them or with the keyboard. Search terms: resizable panels, splitter, split view, split pane, panel group, resize handle.","dependencies":["react-resizable-panels@4.15.3"],"registryDependencies":["@siteplane/base"],"files":[{"path":"packages/ui/src/components/resizable/resizable.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\n\nimport { useSiteplaneMessages } from \"../../system/locale/messages-context\";\nimport { splitterHandleClassName } from \"../../system/styles/splitter-handle\";\nimport { cn } from \"../../system/utils/cn\";\nimport { slotClass } from \"../../system/utils/slot-class\";\n\nexport type ResizablePanelGroupProps = ResizablePrimitive.GroupProps;\nexport type ResizablePanelProps = ResizablePrimitive.PanelProps;\nexport type ResizableHandleProps = ResizablePrimitive.SeparatorProps;\n\n// The grab area of a handle under a mouse or a pen: the 8 px of the\n// splitter handle's stylesheet (design-rework.css, \"The splitter handle\").\n// A finger keeps the 20 px that react-resizable-panels gives it.\nconst handleTargetSize = { coarse: 20, fine: 8 } as const;\n\n/**\n * Panels that people resize along one axis: side by side, the default\n * `orientation=\"horizontal\"`, or one above the other with `\"vertical\"`. The\n * group fills its container, which sets its height, and react-resizable-panels\n * owns the layout, the pointer and the keys.\n */\nexport function ResizablePanelGroup({\n  className,\n  orientation = \"horizontal\",\n  resizeTargetMinimumSize = handleTargetSize,\n  ...props\n}: ResizablePanelGroupProps): React.ReactElement {\n  return (\n    <ResizablePrimitive.Group\n      className={cn(slotClass(\"resizable-panel-group\", props), className)}\n      data-orientation={orientation}\n      data-slot=\"resizable-panel-group\"\n      orientation={orientation}\n      resizeTargetMinimumSize={resizeTargetMinimumSize}\n      {...props}\n    />\n  );\n}\n\n/**\n * One panel of a group. A number sets a size in pixels and a string without a\n * unit a percentage of the group, such as `defaultSize=\"30%\"`. `className`\n * and `style` reach the panel's content box, which fills the panel; its\n * content scrolls when it is taller or wider than the panel. A panel resized\n * or collapsed to nothing takes its content out of the Tab order and the\n * accessibility tree until it opens again.\n */\nexport function ResizablePanel({\n  children,\n  className,\n  onResize,\n  style,\n  ...props\n}: ResizablePanelProps): React.ReactElement {\n  const [empty, setEmpty] = React.useState(false);\n  // react-resizable-panels gives its own className to an element inside the\n  // panel and its attributes to the panel, so the slot and its class stand on\n  // a content box of the kit's own (rulebook P6).\n  return (\n    <ResizablePrimitive.Panel\n      {...props}\n      onResize={(size, id, previous) => {\n        onResize?.(size, id, previous);\n        setEmpty(size.inPixels < 1);\n      }}\n    >\n      <div\n        className={cn(slotClass(\"resizable-panel\"), \"h-full\", className)}\n        data-slot=\"resizable-panel\"\n        inert={empty || undefined}\n        style={style}\n      >\n        {children}\n      </div>\n    </ResizablePrimitive.Panel>\n  );\n}\n\n/**\n * The handle between two panels (rulebook T13): a separator in the Tab order\n * with the size of the panel before it as its value. The arrow keys move it\n * by 5% of the group, Home and End to its limits, Enter collapses and\n * restores a collapsible panel before it, and a double click resets the\n * panel before it to its `defaultSize`, or the one after it when only that one\n * has a `defaultSize`. It is named by the `resizable.handle` message\n * unless it gets an `aria-label` or `aria-labelledby` of its own.\n */\nexport function ResizableHandle({\n  className,\n  ...props\n}: ResizableHandleProps): React.ReactElement {\n  const messages = useSiteplaneMessages(\"resizable\");\n  return (\n    <ResizablePrimitive.Separator\n      aria-label={props[\"aria-labelledby\"] ? undefined : messages.handle}\n      className={cn(\n        slotClass(\"resizable-handle\", props),\n        splitterHandleClassName,\n        className,\n      )}\n      data-slot=\"resizable-handle\"\n      {...props}\n    />\n  );\n}\n","type":"registry:ui","target":"~/src/siteplane/components/resizable/resizable.tsx"},{"path":"packages/ui/src/components/resizable/index.ts","content":"export * from \"./resizable\";\n","type":"registry:ui","target":"~/src/siteplane/components/resizable/index.ts"}],"type":"registry:ui","docs":"https://ui.siteplane.io/docs-markdown/components/resizable.md","categories":["Layout & utilities"],"meta":{"avoidWhen":["Avoid for the application's navigation; Sidebar collapses it and resizes it with a resizable SidebarRail.","Avoid for a layout that people never size themselves; a grid or a flex row needs no handle."],"description":"Resize panels side by side or one above the other by dragging the handle between them or with the keyboard.","knownLimitations":["A number sets a size in pixels and a string without a unit a percentage of the group, so defaultSize={30} is 30 pixels and defaultSize=\"30%\" or \"30\" is 30 percent.","In a right-to-left page the drag and the arrow keys of a horizontal group still follow the left-to-right direction."],"providerNotes":["The group fills its container, so give the container a height, or the panels a content height of their own."],"releaseStatus":"stable","searchTerms":["resizable","resizable panels","splitter","split view","split pane","panel group","resize handle"],"useWhen":["Use for a layout whose regions people size themselves, such as a list beside the item it opens, an editor beside its preview or a console under the main view.","Use collapsible on a panel that people hide and bring back with Enter on its handle or a drag past its minimum size."]}}