{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "marquee",
  "type": "registry:component",
  "title": "Marquee",
  "description": "A row that scrolls sideways without end. It pauses on hover and on keyboard focus, and under reduced motion it is an ordinary wrapped row.",
  "categories": [
    "layout"
  ],
  "dependencies": [],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/layout/marquee.tsx",
      "type": "registry:component",
      "target": "components/layout/marquee.tsx",
      "content": "/**\n * @name marquee\n * @category layout\n * @description A row that scrolls sideways without end. It pauses on hover and on keyboard focus, and under reduced motion it is an ordinary wrapped row.\n * @when A strip of logos, short quotes or tags where no single item must be read. Not for content the reader needs: everything is also in the markup once, but it moves. For a few items that fit, use stack or grid.\n * @example\n * <Marquee aria-label=\"Clients\" speed=\"slow\">\n *   <img src=\"/logos/atlas.svg\" alt=\"Atlas\" className=\"h-8 w-auto\" />\n *   <img src=\"/logos/north.svg\" alt=\"North\" className=\"h-8 w-auto\" />\n *   <img src=\"/logos/field.svg\" alt=\"Field\" className=\"h-8 w-auto\" />\n * </Marquee>\n * <Marquee direction=\"right\" speed={25} gap=\"1rem\" fade={false}>\n *   <Badge variant=\"outline\">Design</Badge>\n *   <Badge variant=\"outline\">Build</Badge>\n *   <Badge variant=\"outline\">Launch</Badge>\n * </Marquee>\n */\nimport type { ComponentProps, CSSProperties } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nconst SPEED = { slow: 60, normal: 40, fast: 20 } as const;\n\nexport type MarqueeProps = ComponentProps<\"div\"> & {\n  /** Which way the row travels. Defaults to \"left\". */\n  direction?: \"left\" | \"right\";\n  /** \"slow\", \"normal\" or \"fast\", or the number of seconds one full loop takes. Defaults to \"normal\" (40 seconds). */\n  speed?: keyof typeof SPEED | number;\n  /** Space between items, as a CSS length. Defaults to \"3rem\". */\n  gap?: string;\n  /** Fade the two ends out with a mask. Defaults to true. */\n  fade?: boolean;\n  /** Stop while the pointer is over the row. It always stops while something inside has keyboard focus. Defaults to true. */\n  pauseOnHover?: boolean;\n};\n\n/*\n * Two tracks side by side, each sliding by its own width plus the gap, so the second lands exactly where the\n * first began. The second track is a copy for the loop only: aria-hidden and inert, so it is not read and\n * cannot be focused. The animation moves `transform` and nothing else. Needs the `rui-marquee` keyframe from\n * the theme; `--rui-marquee-end` is where a track finishes, flipped for right-to-left pages.\n */\nconst TRACK =\n  \"flex min-w-full shrink-0 items-center justify-around gap-(--marquee-gap) group-focus-within/marquee:[animation-play-state:paused] motion-reduce:w-full motion-reduce:min-w-0 motion-reduce:shrink motion-reduce:animate-none motion-reduce:flex-wrap motion-reduce:justify-center\";\n\nconst FADE =\n  \"[mask-image:linear-gradient(to_right,transparent,black_var(--marquee-fade),black_calc(100%_-_var(--marquee-fade)),transparent)] motion-reduce:[mask-image:none]\";\n\nexport function Marquee({ className, direction = \"left\", speed = \"normal\", gap = \"3rem\", fade = true, pauseOnHover = true, style, children, ...props }: MarqueeProps) {\n  const seconds = typeof speed === \"number\" ? Math.max(1, speed) : SPEED[speed];\n  const track = cn(\n    TRACK,\n    direction === \"right\"\n      ? \"animate-[rui-marquee_var(--marquee-duration)_linear_infinite_reverse]\"\n      : \"animate-[rui-marquee_var(--marquee-duration)_linear_infinite]\",\n    pauseOnHover && \"group-hover/marquee:[animation-play-state:paused]\",\n  );\n  return (\n    <div\n      data-slot=\"marquee\"\n      className={cn(\n        \"group/marquee flex w-full gap-(--marquee-gap) overflow-hidden [--marquee-fade:min(3rem,10%)] [--rui-marquee-end:calc(-100%_-_var(--marquee-gap))] motion-reduce:overflow-visible rtl:[--rui-marquee-end:calc(100%_+_var(--marquee-gap))]\",\n        fade && FADE,\n        className,\n      )}\n      style={{ \"--marquee-duration\": `${seconds}s`, \"--marquee-gap\": gap, ...style } as CSSProperties}\n      {...props}\n    >\n      <div data-slot=\"marquee-track\" className={track}>\n        {children}\n      </div>\n      <div data-slot=\"marquee-track\" aria-hidden=\"true\" inert className={cn(track, \"motion-reduce:hidden\")}>\n        {children}\n      </div>\n    </div>\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "layout",
    "when": "A strip of logos, short quotes or tags where no single item must be read. Not for content the reader needs: everything is also in the markup once, but it moves. For a few items that fit, use stack or grid.",
    "example": "<Marquee aria-label=\"Clients\" speed=\"slow\">\n  <img src=\"/logos/atlas.svg\" alt=\"Atlas\" className=\"h-8 w-auto\" />\n  <img src=\"/logos/north.svg\" alt=\"North\" className=\"h-8 w-auto\" />\n  <img src=\"/logos/field.svg\" alt=\"Field\" className=\"h-8 w-auto\" />\n</Marquee>\n<Marquee direction=\"right\" speed={25} gap=\"1rem\" fade={false}>\n  <Badge variant=\"outline\">Design</Badge>\n  <Badge variant=\"outline\">Build</Badge>\n  <Badge variant=\"outline\">Launch</Badge>\n</Marquee>",
    "client": false
  }
}
