{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "product-grid-section",
  "title": "Product Grid Section",
  "description": "A responsive product/portfolio grid section, heading, per-card image with hover zoom and reveal overlay, category/price meta row, optional badge, and a centered CTA button below the grid.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/product-grid-section/product-grid-section.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface ProductGridItem {\n  image?: string;\n  title: string;\n  category: string;\n  price: string;\n  link?: string;\n  badgeText?: string;\n}\n\nexport type ProductGridTheme = \"light\" | \"dark\";\n\nexport interface ProductGridSectionProps {\n  theme?: ProductGridTheme;\n  headingText?: string;\n  headingColor?: string;\n  headingFontSize?: number;\n  headingFontWeight?: number;\n  headingGap?: number;\n  cards?: ProductGridItem[];\n  columns?: number;\n  tabletColumns?: number;\n  mobileColumns?: number;\n  gap?: number;\n  imageRadius?: number;\n  imageAspect?: number;\n  cardBorderColor?: string;\n  titleColor?: string;\n  titleFontSize?: number;\n  metaColor?: string;\n  metaFontSize?: number;\n  badgeBackground?: string;\n  badgeTextColor?: string;\n  showOverlay?: boolean;\n  overlayText?: string;\n  overlayBackground?: string;\n  overlayTextColor?: string;\n  showButton?: boolean;\n  buttonText?: string;\n  buttonLink?: string;\n  buttonTextColor?: string;\n  buttonBackground?: string;\n  buttonHoverBackground?: string;\n  buttonGap?: number;\n  backgroundColor?: string;\n  className?: string;\n}\n\nconst THEMES = {\n  light: {\n    backgroundColor: \"#f5f5f5\",\n    headingColor: \"#1a1a1a\",\n    titleColor: \"#1a1a1a\",\n    metaColor: \"#6b6b6b\",\n    cardBorderColor: \"rgba(0,0,0,0.08)\",\n    imageBackground: \"#ffffff\",\n    badgeBackground: \"#1a1a1a\",\n    badgeTextColor: \"#ffffff\",\n    buttonTextColor: \"#1a1a1a\",\n    buttonBackground: \"#ffffff\",\n    buttonHoverBackground: \"#ececec\",\n  },\n  dark: {\n    backgroundColor: \"#080808\",\n    headingColor: \"#f5f4f1\",\n    titleColor: \"#f5f4f1\",\n    metaColor: \"rgba(245,244,241,0.6)\",\n    cardBorderColor: \"rgba(255,255,255,0.1)\",\n    imageBackground: \"#141414\",\n    badgeBackground: \"#f5f4f1\",\n    badgeTextColor: \"#0a0a0a\",\n    buttonTextColor: \"#0a0a0a\",\n    buttonBackground: \"#f5f4f1\",\n    buttonHoverBackground: \"#dcdad6\",\n  },\n} as const;\n\nconst DEFAULT_CARDS: ProductGridItem[] = [\n  { image: \"/demo/running-shoes.webp\", title: \"Running Shoes\", category: \"Agency\", price: \"$99.00\" },\n  { image: \"/demo/wireless-earbuds.webp\", title: \"Wireless Earbuds\", category: \"Portfolio\", price: \"$129.00\", badgeText: \"New\" },\n  { image: \"/demo/notebook.webp\", title: \"Premium Notebook\", category: \"Startup\", price: \"$24.00\" },\n  { image: \"/demo/minimal-watch.webp\", title: \"Minimal Watch\", category: \"SaaS\", price: \"$59.00\" },\n  { image: \"/demo/laptop-stand.webp\", title: \"Laptop Stand\", category: \"Creative\", price: \"$49.00\" },\n  { image: \"/demo/insulated-water-bottle.webp\", title: \"Insulated Water Bottle\", category: \"Animation\", price: \"$39.00\", badgeText: \"Popular\" },\n];\n\n// \"$48.00\" as a schema.org Offer; undefined when the currency symbol isn't one we recognise.\nfunction toOffer(price: string | undefined) {\n  const currency = ({ $: \"USD\", \"€\": \"EUR\", \"£\": \"GBP\", \"₺\": \"TRY\", \"¥\": \"JPY\" } as Record<string, string>)[price?.trim()[0] ?? \"\"];\n  const amount = parseFloat(price?.replace(/[^0-9.]/g, \"\") ?? \"\");\n  return currency && !Number.isNaN(amount) ? { \"@type\": \"Offer\", price: amount.toFixed(2), priceCurrency: currency } : undefined;\n}\n\nexport function ProductGridSection({\n  theme = \"dark\",\n  headingText = \"Latest Templates\",\n  headingColor,\n  headingFontSize = 32,\n  headingFontWeight = 700,\n  headingGap = 40,\n  cards = DEFAULT_CARDS,\n  columns = 3,\n  tabletColumns = 2,\n  mobileColumns = 1,\n  gap = 32,\n  imageRadius = 16,\n  imageAspect = 1344 / 752,\n  cardBorderColor,\n  titleColor,\n  titleFontSize = 17,\n  metaColor,\n  metaFontSize = 15,\n  badgeBackground,\n  badgeTextColor,\n  showOverlay = true,\n  overlayText = \"View Template →\",\n  overlayBackground = \"rgba(0,0,0,0.45)\",\n  overlayTextColor = \"#ffffff\",\n  showButton = true,\n  buttonText = \"Explore All\",\n  buttonLink,\n  buttonTextColor,\n  buttonBackground,\n  buttonHoverBackground,\n  buttonGap = 20,\n  backgroundColor,\n  className,\n}: ProductGridSectionProps) {\n  const palette = THEMES[theme];\n  headingColor ??= palette.headingColor;\n  titleColor ??= palette.titleColor;\n  metaColor ??= palette.metaColor;\n  cardBorderColor ??= palette.cardBorderColor;\n  badgeBackground ??= palette.badgeBackground;\n  badgeTextColor ??= palette.badgeTextColor;\n  buttonTextColor ??= palette.buttonTextColor;\n  buttonBackground ??= palette.buttonBackground;\n  buttonHoverBackground ??= palette.buttonHoverBackground;\n  backgroundColor ??= palette.backgroundColor;\n  const [hoveredButton, setHoveredButton] = React.useState(false);\n  const gridId = React.useId().replace(/:/g, \"\");\n\n  // schema.org ItemList of Products (JSON-LD) for search engines, skipped while the placeholder cards show.\n  const jsonLd = cards === DEFAULT_CARDS\n    ? null\n    : JSON.stringify({\n        \"@context\": \"https://schema.org\",\n        \"@type\": \"ItemList\",\n        itemListElement: cards.map((card, i) => ({\n          \"@type\": \"ListItem\",\n          position: i + 1,\n          item: {\n            \"@type\": \"Product\",\n            name: card.title,\n            category: card.category,\n            ...(card.image ? { image: card.image } : {}),\n            ...(card.link ? { url: card.link } : {}),\n            ...(toOffer(card.price) ? { offers: toOffer(card.price) } : {}),\n          },\n        })),\n      }).replace(/</g, \"\\\\u003c\");\n\n  return (\n    // Container queries, not media queries: the column count follows this section's own width, so it\n    // still steps down when the section sits in a narrow column of a wide page (or a scaled preview).\n    <div className={cn(\"box-border flex w-full flex-col\", className)} style={{ backgroundColor, padding: \"60px 80px\", containerType: \"inline-size\" }}>\n      {jsonLd && <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: jsonLd }} />}\n      <style>{`\n        .pgs-card-image-${gridId} { transition: transform 0.35s ease; }\n        .pgs-card-${gridId}:hover .pgs-card-image-${gridId} { transform: scale(1.04); }\n        .pgs-overlay-${gridId} { opacity: 0; transition: opacity 0.3s ease; }\n        .pgs-card-${gridId}:hover .pgs-overlay-${gridId} { opacity: 1; }\n        .pgs-overlay-text-${gridId} { transform: translateY(8px); transition: transform 0.3s ease; }\n        .pgs-card-${gridId}:hover .pgs-overlay-text-${gridId} { transform: translateY(0); }\n        .pgs-grid-${gridId} { display: grid; grid-template-columns: repeat(${columns}, 1fr); gap: ${gap}px; width: 100%; }\n        @container (max-width: 900px) {\n          .pgs-grid-${gridId} { grid-template-columns: repeat(${tabletColumns}, 1fr); }\n        }\n        @container (max-width: 600px) {\n          .pgs-grid-${gridId} { grid-template-columns: repeat(${mobileColumns}, 1fr); }\n        }\n      `}</style>\n\n      <div style={{ fontWeight: headingFontWeight, fontSize: headingFontSize, color: headingColor, marginBottom: headingGap }}>\n        {headingText}\n      </div>\n\n      <div className={`pgs-grid-${gridId}`}>\n        {cards.map((card, i) => (\n          <motion.a\n            key={i}\n            href={card.link || undefined}\n            className={cn(`pgs-card-${gridId}`, \"flex flex-col gap-3 no-underline\")}\n            style={{ color: \"inherit\" }}\n            initial={{ opacity: 0, y: 28 }}\n            whileInView={{ opacity: 1, y: 0 }}\n            viewport={{ once: true, amount: 0.25 }}\n            transition={{ duration: 0.5, delay: i * 0.08, ease: \"easeOut\" }}\n          >\n            <div\n              className=\"relative w-full overflow-hidden\"\n              style={{ backgroundColor: palette.imageBackground, aspectRatio: String(imageAspect), borderRadius: imageRadius, border: `1px solid ${cardBorderColor}` }}\n            >\n              {card.image && (\n                // eslint-disable-next-line @next/next/no-img-element\n                <img\n                  src={card.image}\n                  alt={card.title}\n                  className={cn(`pgs-card-image-${gridId}`, \"block h-full w-full object-cover\")}\n                />\n              )}\n              {card.badgeText && (\n                <div\n                  className=\"absolute top-3 left-3 rounded-full px-2.5 py-1 text-xs font-semibold\"\n                  style={{ backgroundColor: badgeBackground, color: badgeTextColor }}\n                >\n                  {card.badgeText}\n                </div>\n              )}\n              {showOverlay && (\n                <div\n                  className={cn(`pgs-overlay-${gridId}`, \"absolute inset-0 flex items-end p-4\")}\n                  style={{ background: overlayBackground }}\n                >\n                  <span className={`pgs-overlay-text-${gridId}`} style={{ fontSize: 14, fontWeight: 600, color: overlayTextColor }}>\n                    {overlayText}\n                  </span>\n                </div>\n              )}\n            </div>\n            <div className=\"flex flex-col gap-1\">\n              <div style={{ fontSize: titleFontSize, fontWeight: 700, color: titleColor }}>{card.title}</div>\n              <div className=\"flex items-center gap-1.5\" style={{ fontSize: metaFontSize, color: metaColor }}>\n                <span>{card.price}</span>\n              </div>\n            </div>\n          </motion.a>\n        ))}\n      </div>\n\n      {showButton && (\n        <a\n          href={buttonLink || undefined}\n          onMouseEnter={() => setHoveredButton(true)}\n          onMouseLeave={() => setHoveredButton(false)}\n          className=\"self-center rounded-full px-8 py-4 text-base font-semibold no-underline\"\n          style={{\n            marginTop: buttonGap,\n            backgroundColor: hoveredButton ? buttonHoverBackground : buttonBackground,\n            color: buttonTextColor,\n            transition: \"background-color 0.2s ease\",\n          }}\n        >\n          {buttonText}\n        </a>\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}