{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "floating-panel",
  "type": "registry:ui",
  "title": "Floating Panel",
  "dependencies": [
    "@base-ui-next/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/button.json"
  ],
  "files": [
    {
      "path": "react/floating-panel.tsx",
      "content": "'use client'\n\nimport type * as React from 'react' // base-ui-next/ui floating-panel@0.1.1\nimport { FloatingPanel as FloatingPanelPrimitive } from '@base-ui-next/react/floating-panel'\nimport type { VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\n\nconst floatingPanelPopupClassName =\n  'z-[calc(50_+_var(--panel-index,0))] flex w-88 flex-col overflow-hidden rounded-xl bg-popover text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-none duration-100 focus-visible:ring-3 focus-visible:ring-ring/50 data-topmost:shadow-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none'\n\nconst floatingPanelDragHandleClassName =\n  'flex h-10 shrink-0 cursor-grab items-center gap-1 ps-3 pe-2 data-disabled:cursor-default data-dragging:cursor-grabbing'\n\nconst floatingPanelTitleClassName = 'min-w-0 flex-1 truncate leading-none font-medium'\n\nconst floatingPanelDescriptionClassName = 'text-sm text-muted-foreground'\n\nconst floatingPanelBodyClassName = 'min-h-0 flex-1 overflow-auto border-t p-4'\n\n/** Maximize, Minimize and Close over `buttonVariants`' ghost `icon-xs`, 24 by 24 CSS pixels. */\nconst floatingPanelButtonClassName = 'data-pressed:bg-muted data-pressed:text-foreground'\n\n/** Maximize's square while not pressed, and the two squares that restore while pressed. */\nconst floatingPanelMaximizeClassName = 'group/floating-panel-maximize'\n\nconst floatingPanelMaximizeIconClassName =\n  'group-data-pressed/floating-panel-maximize:hidden'\n\nconst floatingPanelRestoreIconClassName =\n  'hidden group-data-pressed/floating-panel-maximize:block'\n\n/** The visually hidden name of Close, which has no default name of its own. */\nconst floatingPanelCloseLabelClassName = 'sr-only'\n\n/** An 8px edge or a 16px corner inside the Popup, hidden in the stages it cannot resize. */\nconst floatingPanelResizeHandleClassName =\n  'group/floating-panel-resize-handle absolute z-10 data-disabled:hidden data-[position=bottom]:inset-x-4 data-[position=bottom]:bottom-0 data-[position=bottom]:h-2 data-[position=bottom]:cursor-ns-resize data-[position=bottom-left]:bottom-0 data-[position=bottom-left]:left-0 data-[position=bottom-left]:size-4 data-[position=bottom-left]:cursor-nesw-resize data-[position=bottom-right]:right-0 data-[position=bottom-right]:bottom-0 data-[position=bottom-right]:size-4 data-[position=bottom-right]:cursor-nwse-resize data-[position=left]:inset-y-4 data-[position=left]:left-0 data-[position=left]:w-2 data-[position=left]:cursor-ew-resize data-[position=right]:inset-y-4 data-[position=right]:right-0 data-[position=right]:w-2 data-[position=right]:cursor-ew-resize data-[position=top]:inset-x-4 data-[position=top]:top-0 data-[position=top]:h-2 data-[position=top]:cursor-ns-resize data-[position=top-left]:top-0 data-[position=top-left]:left-0 data-[position=top-left]:size-4 data-[position=top-left]:cursor-nwse-resize data-[position=top-right]:top-0 data-[position=top-right]:right-0 data-[position=top-right]:size-4 data-[position=top-right]:cursor-nesw-resize'\n\n/** The grip drawn in the bottom-right corner only. */\nconst floatingPanelResizeHandleGripClassName =\n  'pointer-events-none absolute right-0.5 bottom-0.5 hidden size-3 text-muted-foreground group-data-[position=bottom-right]/floating-panel-resize-handle:block'\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>\n\nfunction SvgIcon({ children, ...props }: React.ComponentProps<'svg'>) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      {children}\n    </svg>\n  )\n}\n\n// No shadcn item: one name per Base UI part (docs/design/log/floating-panel.md, decision 60).\nfunction FloatingPanel<Payload = unknown>({\n  ...props\n}: FloatingPanelPrimitive.Root.Props<Payload>) {\n  return <FloatingPanelPrimitive.Root {...props} />\n}\n\nfunction FloatingPanelTrigger({ ...props }: FloatingPanelPrimitive.Trigger.Props) {\n  return <FloatingPanelPrimitive.Trigger data-slot=\"floating-panel-trigger\" {...props} />\n}\n\nfunction FloatingPanelPortal({ ...props }: FloatingPanelPrimitive.Portal.Props) {\n  return <FloatingPanelPrimitive.Portal data-slot=\"floating-panel-portal\" {...props} />\n}\n\nfunction FloatingPanelPopup({ className, ...props }: FloatingPanelPrimitive.Popup.Props) {\n  return (\n    <FloatingPanelPrimitive.Popup\n      data-slot=\"floating-panel-popup\"\n      className={cn(floatingPanelPopupClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction FloatingPanelDragHandle({ className, ...props }: FloatingPanelPrimitive.DragHandle.Props) {\n  return (\n    <FloatingPanelPrimitive.DragHandle\n      data-slot=\"floating-panel-drag-handle\"\n      className={cn(floatingPanelDragHandleClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction FloatingPanelTitle({ className, ...props }: FloatingPanelPrimitive.Title.Props) {\n  return (\n    <FloatingPanelPrimitive.Title\n      data-slot=\"floating-panel-title\"\n      className={cn(floatingPanelTitleClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction FloatingPanelDescription({\n  className,\n  ...props\n}: FloatingPanelPrimitive.Description.Props) {\n  return (\n    <FloatingPanelPrimitive.Description\n      data-slot=\"floating-panel-description\"\n      className={cn(floatingPanelDescriptionClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction FloatingPanelBody({ className, ...props }: FloatingPanelPrimitive.Body.Props) {\n  return (\n    <FloatingPanelPrimitive.Body\n      data-slot=\"floating-panel-body\"\n      className={cn(floatingPanelBodyClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction FloatingPanelMinimize({\n  className,\n  variant = 'ghost',\n  size = 'icon-xs',\n  children,\n  ...props\n}: FloatingPanelPrimitive.Minimize.Props & ButtonVariants) {\n  return (\n    <FloatingPanelPrimitive.Minimize\n      data-slot=\"floating-panel-minimize\"\n      className={cn(buttonVariants({ variant, size }), floatingPanelButtonClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon>\n          <path d=\"M5 12h14\" />\n        </SvgIcon>\n      )}\n    </FloatingPanelPrimitive.Minimize>\n  )\n}\n\nfunction FloatingPanelMaximize({\n  className,\n  variant = 'ghost',\n  size = 'icon-xs',\n  children,\n  ...props\n}: FloatingPanelPrimitive.Maximize.Props & ButtonVariants) {\n  return (\n    <FloatingPanelPrimitive.Maximize\n      data-slot=\"floating-panel-maximize\"\n      className={cn(\n        buttonVariants({ variant, size }),\n        floatingPanelButtonClassName,\n        floatingPanelMaximizeClassName,\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <>\n          <SvgIcon className={floatingPanelMaximizeIconClassName}>\n            <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n          </SvgIcon>\n          <SvgIcon className={floatingPanelRestoreIconClassName}>\n            <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n            <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n          </SvgIcon>\n        </>\n      )}\n    </FloatingPanelPrimitive.Maximize>\n  )\n}\n\nfunction FloatingPanelClose({\n  className,\n  variant = 'ghost',\n  size = 'icon-xs',\n  children,\n  ...props\n}: FloatingPanelPrimitive.Close.Props & ButtonVariants) {\n  return (\n    <FloatingPanelPrimitive.Close\n      data-slot=\"floating-panel-close\"\n      className={cn(buttonVariants({ variant, size }), floatingPanelButtonClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <>\n          <SvgIcon>\n            <path d=\"M18 6 6 18\" />\n            <path d=\"m6 6 12 12\" />\n          </SvgIcon>\n          <span className={floatingPanelCloseLabelClassName}>Close</span>\n        </>\n      )}\n    </FloatingPanelPrimitive.Close>\n  )\n}\n\nfunction FloatingPanelResizeHandle({\n  className,\n  children,\n  ...props\n}: FloatingPanelPrimitive.ResizeHandle.Props) {\n  return (\n    <FloatingPanelPrimitive.ResizeHandle\n      data-slot=\"floating-panel-resize-handle\"\n      className={cn(floatingPanelResizeHandleClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon className={floatingPanelResizeHandleGripClassName}>\n          <path d=\"M21 13 13 21\" />\n          <path d=\"M21 19 19 21\" />\n        </SvgIcon>\n      )}\n    </FloatingPanelPrimitive.ResizeHandle>\n  )\n}\n\nexport {\n  FloatingPanel,\n  FloatingPanelBody,\n  FloatingPanelClose,\n  FloatingPanelDescription,\n  FloatingPanelDragHandle,\n  FloatingPanelMaximize,\n  FloatingPanelMinimize,\n  FloatingPanelPopup,\n  FloatingPanelPortal,\n  FloatingPanelResizeHandle,\n  FloatingPanelTitle,\n  FloatingPanelTrigger,\n}\n",
      "type": "registry:ui",
      "target": "@ui/floating-panel.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.1",
      "hash": "88fd84431d5b06db2ae66dac4908ec98a22ed9abe4cc3e069aa39c51db1bf696",
      "files": {
        "@ui/floating-panel.tsx": "c02be1c53828a21acf11d5747ff56d999cab3a3bc92fba70247210ce2734fbed"
      }
    }
  }
}
