import React from "react"; import { cn } from "../lib/cn"; export interface SaveButtonProps extends React.ButtonHTMLAttributes { /** Whether the item is currently saved/pinned */ saved?: boolean; /** Size of the save button */ size?: "sm" | "md" | "lg"; /** Label text shown next to the icon (default: hidden) */ label?: string; } const sizeMap: Record = { sm: { width: "32px", height: "32px", iconSize: "16px" }, md: { width: "40px", height: "40px", iconSize: "20px" }, lg: { width: "48px", height: "48px", iconSize: "24px" }, }; /** * SaveButton — Pinterest-style save/bookmark ("pin") toggle. * * Micro-interactions: * - Hover: icon scales up slightly, brand color tint appears * - Click: icon fills with brand color, scales up then springs back * - Saved state: icon stays filled with brand color */ export const SaveButton = React.forwardRef( ( { saved = false, size = "md", label, className, style, disabled, ...props }, ref, ) => { const s = sizeMap[size] || sizeMap.md; return ( ); }, ); SaveButton.displayName = "SaveButton";