{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "integration-marquee",
  "title": "Integration Marquee",
  "description": "Three auto-scrolling rows of integration logos around a featured brand mark.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "payload-components/source/blocks/shared/integrationFields.ts",
      "content": "import type { Field } from 'payload'\n\n/**\n * Shared field core for the Integration block family.\n *\n * Every integration variant (integration-grid, integration-cluster,\n * integration-split, integration-connect, integration-orbit, integration-list,\n * integration-marquee, integration-testimonial, …) spreads these fields first\n * and then appends its own variant-specific shape (for example the cluster\n * variants add a featured center mark, and the testimonial variant adds a\n * quote). Editing the shared heading/integrations shape here updates every\n * installed integration block at once, so the family never drifts\n * field-by-field across a repo.\n *\n * Each integration is an editable Media upload plus an accessible name, an\n * optional supporting description, and an optional link, so editors manage the\n * wall of partner/tool logos from the admin instead of shipping hardcoded\n * brand SVGs. Logo-only variants simply ignore the per-item description/href.\n *\n * Installed once per repo at `src/blocks/shared/integrationFields.ts`; re-running\n * `payload-components add integration-*` never overwrites a copy you have already edited.\n */\nexport const integrationFields: Field[] = [\n  {\n    name: 'heading',\n    type: 'text',\n    required: true,\n  },\n  {\n    name: 'subtext',\n    type: 'textarea',\n  },\n  {\n    name: 'integrations',\n    type: 'array',\n    required: true,\n    minRows: 2,\n    maxRows: 12,\n    admin: {\n      initCollapsed: true,\n    },\n    fields: [\n      {\n        name: 'logo',\n        type: 'upload',\n        relationTo: 'media',\n        required: true,\n      },\n      {\n        name: 'name',\n        type: 'text',\n        required: true,\n      },\n      {\n        name: 'description',\n        type: 'textarea',\n      },\n      {\n        name: 'href',\n        type: 'text',\n      },\n    ],\n  },\n]\n\n/**\n * Optional center brand mark, spread by the variants that arrange the\n * integration logos around a focal point (cluster, split, connect, orbit,\n * marquee). Left empty, the variant renders without a center mark.\n */\nexport const integrationFeaturedMark: Field = {\n  name: 'featuredLogo',\n  type: 'upload',\n  relationTo: 'media',\n  admin: {\n    description: 'Optional center brand mark shown at the focal point of the integration layout.',\n  },\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/shared/integrationFields.ts"
    },
    {
      "path": "payload-components/source/components/ui/infinite-slider.tsx",
      "content": "'use client'\n\nimport type { ReactNode } from 'react'\n\nimport { animate, motion, useMotionValue, useReducedMotion } from 'motion/react'\nimport { useEffect, useRef, useState } from 'react'\n\nimport { cn } from '@/utilities/ui'\n\n/**\n * Continuously scrolling row, ported from the motion-primitives InfiniteSlider\n * (MIT) into the payload-components family. Self-contained: the only runtime\n * dependency is `motion`; element width is measured with a local\n * ResizeObserver instead of an extra package.\n *\n * Used by the Logo Cloud Marquee block to scroll an editable wall of logos.\n */\n\nfunction useElementWidth() {\n  const ref = useRef<HTMLDivElement | null>(null)\n  const [width, setWidth] = useState(0)\n\n  useEffect(() => {\n    const element = ref.current\n    if (!element) return\n\n    const observer = new ResizeObserver((entries) => {\n      const entry = entries[0]\n      if (entry) setWidth(entry.contentRect.width)\n    })\n    observer.observe(element)\n\n    return () => observer.disconnect()\n  }, [])\n\n  return [ref, width] as const\n}\n\nexport type InfiniteSliderProps = {\n  children: ReactNode\n  className?: string\n  gap?: number\n  reverse?: boolean\n  speed?: number\n  speedOnHover?: number\n}\n\nexport function InfiniteSlider({\n  children,\n  className,\n  gap = 16,\n  reverse = false,\n  speed = 100,\n  speedOnHover,\n}: InfiniteSliderProps) {\n  const [currentSpeed, setCurrentSpeed] = useState(speed)\n  const [ref, width] = useElementWidth()\n  const translation = useMotionValue(0)\n  const [isTransitioning, setIsTransitioning] = useState(false)\n  const [key, setKey] = useState(0)\n  const shouldReduceMotion = useReducedMotion()\n\n  useEffect(() => {\n    // Respect the user's reduced-motion preference: skip the infinite scroll\n    // and leave the row static (WCAG 2.2.2 Pause/Stop/Hide, 2.3.3).\n    if (shouldReduceMotion) return\n\n    const contentSize = width + gap\n    const from = reverse ? -contentSize / 2 : 0\n    const to = reverse ? 0 : -contentSize / 2\n\n    const controls = isTransitioning\n      ? animate(translation, [translation.get(), to], {\n          duration: Math.abs((translation.get() - to) / currentSpeed),\n          ease: 'linear',\n          onComplete: () => {\n            setIsTransitioning(false)\n            setKey((prev) => prev + 1)\n          },\n        })\n      : animate(translation, [from, to], {\n          duration: contentSize / currentSpeed,\n          ease: 'linear',\n          onRepeat: () => {\n            translation.set(from)\n          },\n          repeat: Infinity,\n          repeatDelay: 0,\n          repeatType: 'loop',\n        })\n\n    return controls?.stop\n  }, [key, translation, currentSpeed, width, gap, isTransitioning, reverse, shouldReduceMotion])\n\n  const hoverProps =\n    speedOnHover && !shouldReduceMotion\n      ? {\n          onHoverEnd: () => {\n            setIsTransitioning(true)\n            setCurrentSpeed(speed)\n          },\n          onHoverStart: () => {\n            setIsTransitioning(true)\n            setCurrentSpeed(speedOnHover)\n          },\n        }\n      : {}\n\n  return (\n    <div className={cn('overflow-hidden', className)}>\n      <motion.div\n        className=\"flex w-max\"\n        ref={ref}\n        style={{ gap: `${gap}px`, x: translation }}\n        {...hoverProps}\n      >\n        {children}\n        {children}\n      </motion.div>\n    </div>\n  )\n}\n",
      "type": "registry:file",
      "target": "~/src/components/ui/infinite-slider.tsx"
    },
    {
      "path": "payload-components/source/blocks/IntegrationMarquee/config.ts",
      "content": "import type { Block } from 'payload'\n\nimport { integrationFeaturedMark, integrationFields } from '@/blocks/shared/integrationFields'\n\nexport const IntegrationMarquee: Block = {\n  slug: 'integrationMarquee',\n  // Existing apps must migrate stored data before adopting this identifier:\n  // https://www.payload-components.xyz/docs/registry#installed-source-and-migrations\n  dbName: 'pc_int_mar',\n  interfaceName: 'IntegrationMarqueeBlock',\n  fields: [\n    // Shared integration core (heading + subtext + integrations). Edit the shared\n    // shape in @/blocks/shared/integrationFields to update every integration variant.\n    ...integrationFields,\n    // Variant-specific: a featured center brand mark over the scrolling rows.\n    integrationFeaturedMark,\n  ],\n  labels: {\n    plural: 'Integration Marquee Blocks',\n    singular: 'Integration Marquee',\n  },\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/IntegrationMarquee/config.ts"
    },
    {
      "path": "payload-components/source/blocks/IntegrationMarquee/Component.tsx",
      "content": "import React from 'react'\n\nimport type { IntegrationMarqueeBlock as IntegrationMarqueeBlockData } from '@/payload-types'\n\nimport { InfiniteSlider } from '@/components/ui/infinite-slider'\nimport { Media } from '@/components/Media'\nimport { cn } from '@/utilities/ui'\n\ntype Props = IntegrationMarqueeBlockData & {\n  id?: string\n  className?: string\n  disableInnerContainer?: boolean\n}\n\nexport const IntegrationMarqueeBlock: React.FC<Props> = ({\n  className,\n  disableInnerContainer,\n  featuredLogo,\n  heading,\n  id,\n  integrations,\n  subtext,\n}) => {\n  const logos = integrations ?? []\n\n  const chip = (item: NonNullable<typeof integrations>[number], index: number) => (\n    <div\n      className=\"flex size-14 items-center justify-center rounded-2xl border border-border/70 bg-background shadow-sm\"\n      key={item.id ?? `${item.name}-${index}`}\n    >\n      <Media resource={item.logo} imgClassName=\"size-7 w-auto object-contain\" />\n    </div>\n  )\n\n  return (\n    <section className={cn('container', className)} id={id ? `block-${id}` : undefined}>\n      <div className=\"overflow-hidden rounded-frame border border-border/70 bg-card/35 px-6 py-12 sm:px-8 lg:px-12 lg:py-16\">\n        <div\n          className={cn('flex flex-col items-center gap-10', {\n            'mx-auto max-w-3xl': !disableInnerContainer,\n          })}\n        >\n          <div className=\"relative w-full max-w-2xl space-y-4 [mask-image:radial-gradient(ellipse_70%_80%_at_50%_50%,#000_55%,transparent_100%)]\">\n            <InfiniteSlider gap={20} speed={26} speedOnHover={12}>\n              {logos.map((item, index) => chip(item, index))}\n            </InfiniteSlider>\n            <InfiniteSlider gap={20} reverse speed={26} speedOnHover={12}>\n              {logos.map((item, index) => chip(item, index))}\n            </InfiniteSlider>\n            <InfiniteSlider gap={20} speed={26} speedOnHover={12}>\n              {logos.map((item, index) => chip(item, index))}\n            </InfiniteSlider>\n\n            {featuredLogo ? (\n              <div className=\"pointer-events-none absolute inset-0 z-10 m-auto flex size-16 items-center justify-center rounded-2xl border border-foreground/25 bg-card shadow-lg\">\n                <Media resource={featuredLogo} imgClassName=\"size-9 w-auto object-contain\" />\n              </div>\n            ) : null}\n          </div>\n\n          <div className=\"flex max-w-lg flex-col items-center gap-5 text-center\">\n            <h2 className=\"text-balance text-2xl font-semibold tracking-heading text-foreground sm:text-3xl\">\n              {heading}\n            </h2>\n            {subtext ? (\n              <p className=\"text-pretty text-sm text-muted-foreground sm:text-base\">{subtext}</p>\n            ) : null}\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/IntegrationMarquee/Component.tsx"
    }
  ],
  "meta": {
    "payloadComponent": {
      "installCommand": "payload-components add integration-marquee",
      "postInstall": [
        "generate:types",
        "generate:importmap"
      ],
      "requiresPayloadComponentWrapper": true,
      "supportedTargets": [
        "payload-website-starter",
        "payload-blocks-app"
      ]
    }
  },
  "docs": "Payload Components installs this as a Payload CMS block for the Payload website starter shape.\n\nRecommended install:\n\n```bash\npnpm payload-components add integration-marquee\n```\n\nDirect shadcn install URL:\n\n```bash\npnpm dlx shadcn@latest add https://www.payload-components.xyz/r/integration-marquee.json\n```\n\nDirect shadcn installs only copy the block source files and shadcn UI dependencies. Use `payload-components add integration-marquee` when you also want Payload layout registration, `RenderBlocks` wiring, `generate:types`, and `generate:importmap` handled for you.",
  "type": "registry:block"
}