{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "skip-link-carousel",
  "title": "Skip Link Carousel",
  "description": "Use this when a carousel holds many links or buttons: a \"Skip carousel\" link that appears on focus before it, and a labelled landmark after it that takes focus, so keyboard users are not forced through every slide.",
  "registryDependencies": [
    "@tealmac/carousel-peek"
  ],
  "files": [
    {
      "path": "registry/patterns/skip-link-carousel/skip-link-carousel.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport type { CarouselItem } from \"@/components/ui/carousel-kit\"\nimport { CarouselPeek } from \"@/components/ui/carousel-peek\"\n\nexport interface SkipLinkCarouselProps {\n  items: CarouselItem[]\n  label: string\n  children?: React.ReactNode\n  skipLabel?: string\n  /** Name of the region that follows. @default \"After the carousel\" */\n  afterLabel?: string\n  className?: string\n}\n\nexport function SkipLinkCarousel({\n  items,\n  label,\n  children,\n  skipLabel = \"Skip carousel\",\n  afterLabel = \"After the carousel\",\n  className,\n}: SkipLinkCarouselProps) {\n  const id = React.useId()\n  const target = React.useRef<HTMLDivElement>(null)\n\n  return (\n    <div className={cn(\"grid gap-3\", className)}>\n      <a\n        href={`#${id}`}\n        onClick={(event) => {\n          event.preventDefault()\n          target.current?.focus()\n          target.current?.scrollIntoView?.({ block: \"nearest\" })\n        }}\n        className=\"focus:bg-primary focus:text-primary-foreground focus-visible:ring-ring/50 sr-only focus:not-sr-only focus:inline-flex focus:h-9 focus:items-center focus:justify-self-start focus:rounded-md focus:px-3 focus:text-sm focus:font-medium focus-visible:ring-[3px] focus-visible:outline-none\"\n      >\n        {skipLabel}\n      </a>\n      <CarouselPeek label={label} items={items} />\n      <div\n        id={id}\n        ref={target}\n        tabIndex={-1}\n        role=\"region\"\n        aria-label={afterLabel}\n        className=\"focus-visible:ring-ring/50 rounded-lg outline-none focus-visible:ring-[3px]\"\n      >\n        {children}\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}