{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "side-panel", "type": "registry:ui", "description": "Sliding side panel component with customizable positioning and animations", "files": [ { "path": "registry/default/ui/side-panel.tsx", "content": "\"use client\"\n\nimport React, { forwardRef, ReactNode } from \"react\"\nimport { AnimatePresence, motion, MotionConfig } from \"motion/react\"\nimport useMeasure from \"react-use-measure\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype PanelContainerProps = {\n panelOpen: boolean\n handlePanelOpen: () => void\n className?: string\n videoUrl?: string\n renderButton?: (handleToggle: () => void) => ReactNode\n children: ReactNode\n}\n\nconst sectionVariants = {\n open: {\n width: \"97%\",\n transition: {\n duration: 0.3,\n ease: [0.42, 0, 0.58, 1] as const,\n delayChildren: 0.3,\n staggerChildren: 0.2,\n },\n },\n closed: {\n transition: { duration: 0.2, ease: [0.42, 0, 0.58, 1] as const },\n },\n}\n\nconst sharedTransition = { duration: 0.6, ease: [0.42, 0, 0.58, 1] as const }\n\nexport const SidePanel = forwardRef(\n ({ panelOpen, handlePanelOpen, className, renderButton, children }, ref) => {\n const [measureRef, bounds] = useMeasure()\n\n return (\n \n \n 0 ? bounds.height : 0.1 }}\n className=\"h-auto\"\n transition={{ type: \"spring\", bounce: 0.02, duration: 0.65 }}\n >\n
\n \n \n \n {renderButton && renderButton(handlePanelOpen)}\n
\n\n {panelOpen && (\n \n {children}\n \n )}\n \n \n \n \n \n
\n )\n }\n)\n\nSidePanel.displayName = \"SidePanel\"\n\nexport default SidePanel\n\ntype ResizablePanelProps = {\n children: React.ReactNode\n}\n\nconst ResizablePanel = React.forwardRef(\n ({ children }, ref) => {\n const transition = {\n type: \"tween\" as const,\n ease: [0.42, 0, 0.58, 1] as const,\n duration: 0.4,\n }\n\n return (\n \n
\n
\n \n {children}\n
\n
\n \n
\n )\n }\n)\n\nResizablePanel.displayName = \"ResizablePanel\"\n", "type": "registry:ui" } ] }