{
  "name": "ui-scroll-area",
  "type": "registry:ui",
  "title": "Scroll area",
  "description": "Panelo primitive: scroll area.",
  "author": "Panelo UI <https://www.paneloui.com>",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.2"
  ],
  "registryDependencies": [
    "https://www.paneloui.com/r/panelo-theme.json",
    "https://www.paneloui.com/r/lib-utils.json"
  ],
  "files": [
    {
      "path": "components/panelo-ui/ui/scroll-area.tsx",
      "type": "registry:file",
      "target": "components/panelo-ui/ui/scroll-area.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { ScrollArea as ScrollAreaPrimitive, ScrollAreaContent, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from '@ui-sdk/react/scroll-area'\n\nimport { cn } from '@/components/panelo-ui/lib/utils'\n\nconst fadeMask = '[mask-image:linear-gradient(to_bottom,black,transparent)]'\n\n/**\n * `fade` turns on the top-edge scroll fade (AGENTS.md: progressive blur + surface fade): pass the\n * enclosing surface as a gradient start, like `from-card`. Each layer ramps 0→1 over the first 24px of\n * scroll; opacity sits on the layers, never the overlay, so the backdrop blur keeps working. Under a\n * sticky header, set `--scroll-fade-top` on the root to its height so the fade starts below it.\n * `horizontal` adds the inline-axis scrollbar, letting wide content (a table) scroll sideways.\n */\nfunction ScrollArea({\n    className,\n    contentClassName,\n    children,\n    type = 'hover',\n    fade,\n    horizontal,\n    ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive> & { fade?: string; horizontal?: boolean; contentClassName?: string }) {\n    const overlay = React.useRef<HTMLDivElement>(null)\n    const onScroll = fade\n        ? (event: React.UIEvent<HTMLDivElement>) => overlay.current?.style.setProperty('--fade', String(Math.min(event.currentTarget.scrollTop / 24, 1)))\n        : undefined\n\n    return (\n        <ScrollAreaPrimitive\n            type={type}\n            className={cn('relative', className)}\n            {...props}>\n            <ScrollAreaViewport\n                onScroll={onScroll}\n                className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px]\">\n                <ScrollAreaContent className={contentClassName}>{children}</ScrollAreaContent>\n            </ScrollAreaViewport>\n            {fade ? (\n                <div ref={overlay} aria-hidden className=\"pointer-events-none absolute inset-x-0 top-[var(--scroll-fade-top,0px)] z-10 h-6 [--fade:0]\">\n                    <div className={cn('absolute inset-x-0 top-0 h-6 opacity-(--fade) backdrop-blur-[1px]', fadeMask)} />\n                    <div className={cn('absolute inset-x-0 top-0 h-4 opacity-(--fade) backdrop-blur-[4px]', fadeMask)} />\n                    <div className={cn('absolute inset-0 bg-linear-to-b to-transparent opacity-(--fade)', fade)} />\n                </div>\n            ) : null}\n            <ScrollBar />\n            {horizontal ? <ScrollBar orientation=\"horizontal\" /> : null}\n        </ScrollAreaPrimitive>\n    )\n}\n\nfunction ScrollBar({ className, orientation = 'vertical', ...props }: React.ComponentProps<typeof ScrollAreaScrollbar>) {\n    return (\n        <ScrollAreaScrollbar\n            orientation={orientation}\n            className={cn(\n                'flex touch-none select-none p-px opacity-0 transition-opacity data-visible:opacity-100',\n                orientation === 'vertical' && 'w-2.5 border-l border-l-transparent',\n                orientation === 'horizontal' && 'h-1.5 flex-col border-t border-t-transparent',\n                className\n            )}\n            {...props}>\n            <ScrollAreaThumb className=\"bg-border rounded-full\" />\n        </ScrollAreaScrollbar>\n    )\n}\n\nexport { ScrollArea, ScrollBar }\n"
    }
  ]
}