"use client"; import { motion, useReducedMotion } from "motion/react"; import { createContext, useContext, useId, useMemo, type ReactNode } from "react"; import { SPRING_LAYOUT } from "@/lib/ease"; import { cn } from "@/lib/utils"; type DockContextValue = { size: number; pillLayoutId: string; }; const DockContext = createContext(null); export interface DockProps { children: ReactNode; className?: string; /** Size of each item in px. */ size?: number; } export function Dock({ children, size = 44, className }: DockProps) { const pillLayoutId = useId(); const ctx = useMemo( () => ({ size, pillLayoutId }), [size, pillLayoutId], ); return (
{children}
); } export interface DockItemProps { children: ReactNode; className?: string; /** When set, the item renders as a ); } // Children carry their own link or button (and its accessible name). return (
{pill} {children}
); } export function DockSeparator({ className }: { className?: string }) { return ( ); }