{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scroll-area",
  "title": "Scroll area",
  "description": "A scrolling region with a thin scrollbar and edge indicators.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/scroll-area.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  ScrollArea as SdkScrollArea,\n  ScrollAreaContent,\n  ScrollAreaScrollbar,\n  ScrollAreaThumb,\n  ScrollAreaViewport,\n} from \"@ui-sdk/react/scroll-area\"\nimport \"@/registry/cyber/ui/cyber/scroll-area.css\"\n\nconst length = (value: number | string | undefined) => (typeof value === \"number\" ? `${value}px` : value)\n\n// A region that scrolls on its own, for a log or a long list inside a\n// panel. The browser does the scrolling, so the wheel, touch, the keyboard\n// and find in page work as usual; the kit draws a thin track with a thumb\n// that has one end cut, and marks an edge with a shade and an arrow while\n// there's more past it.\n//\n// - `label` names the region (\"Signal log\"). A region with nothing\n//   focusable inside is a tab stop itself, so the arrow keys can scroll it.\n// - `height` fixes how tall it is; `maxHeight` lets it grow with its\n//   content up to a limit. A number is in pixels.\n//\n// The rest goes to ui-sdk's ScrollArea: `type` (when the scrollbar shows;\n// here it shows whenever there's something to scroll), `stickToEnd` for a\n// log that follows its newest line, `controller`.\nfunction ScrollArea({\n  label,\n  height,\n  maxHeight,\n  children,\n  style,\n  ...props\n}: Omit<React.ComponentProps<typeof SdkScrollArea>, \"children\" | \"style\"> & {\n  label: string\n  height?: number | string\n  maxHeight?: number | string\n  children?: React.ReactNode\n  style?: React.CSSProperties\n}) {\n  const size = {\n    \"--area-height\": length(height),\n    \"--area-max-height\": length(maxHeight),\n    ...style,\n  } as React.CSSProperties\n  return (\n    <SdkScrollArea data-kit=\"scroll-area\" type=\"auto\" style={size} {...props}>\n      <ScrollAreaViewport data-kit=\"scroll-area-viewport\" role=\"region\" aria-label={label}>\n        <ScrollAreaContent data-kit=\"scroll-area-content\">{children}</ScrollAreaContent>\n      </ScrollAreaViewport>\n      <span data-kit=\"scroll-area-edge\" data-edge=\"start\" aria-hidden />\n      <span data-kit=\"scroll-area-edge\" data-edge=\"end\" aria-hidden />\n      <ScrollAreaScrollbar data-kit=\"scroll-area-scrollbar\" orientation=\"vertical\">\n        <ScrollAreaThumb data-kit=\"scroll-area-thumb\" />\n      </ScrollAreaScrollbar>\n    </SdkScrollArea>\n  )\n}\n\nexport { ScrollArea }\n",
      "type": "registry:ui",
      "target": "@ui/scroll-area.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/scroll-area.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* The root only places the scrollbar and the edge marks; the viewport is\n     the scroller, and takes the height the component was given. */\n  [data-skin=\"cyber\"] [data-kit=\"scroll-area\"] {\n    --area-bar: 12px;\n    --area-shade: color-mix(in srgb, var(--cy-void) 88%, transparent);\n\n    width: 100%;\n    min-width: 0;\n    text-align: start;\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"scroll-area-viewport\"] {\n    height: var(--area-height, auto);\n    max-height: var(--area-max-height, none);\n    overscroll-behavior: contain;\n\n    /* The ring goes inside: outside, it would be cut off by whatever frame\n       the region sits in. */\n    &:focus-visible {\n      outline-offset: -2px;\n    }\n  }\n\n  /* Room for the scrollbar, kept whether or not there's anything to\n     scroll, so content doesn't rewrap as it starts to overflow, and a\n     little at the start so the focus ring doesn't touch the text. */\n  [data-skin=\"cyber\"] [data-kit=\"scroll-area-content\"] {\n    padding-inline: 4px calc(var(--area-bar) + 4px);\n  }\n\n  /* More above, or more below: a shade that deepens over the first 20px\n     scrolled past, with an arrow on the edge pointing the way. The shade\n     reads how far the content overflows from the root, which holds it. The\n     arrow is a shape, so the edge isn't told by the shade alone, and both\n     are gone at the end they mark. */\n  [data-skin=\"cyber\"] [data-kit=\"scroll-area-edge\"] {\n    --scroll-area-overflow-y-start: inherit;\n    --scroll-area-overflow-y-end: inherit;\n\n    position: absolute;\n    inset-inline: 0 var(--area-bar);\n    pointer-events: none;\n    opacity: 0;\n    transition: opacity var(--cy-t-fast) linear;\n\n    &[data-edge=\"start\"] {\n      inset-block-start: 0;\n      height: min(20px, var(--scroll-area-overflow-y-start, 0px));\n      background: linear-gradient(to bottom, var(--area-shade), transparent);\n    }\n    &[data-edge=\"end\"] {\n      inset-block-end: 0;\n      height: min(20px, var(--scroll-area-overflow-y-end, 0px));\n      background: linear-gradient(to top, var(--area-shade), transparent);\n    }\n\n    &::after {\n      content: \"\";\n      position: absolute;\n      inset-inline-start: calc(50% - 5px);\n      width: 10px;\n      height: 5px;\n      background: var(--cy-line-hot);\n    }\n    &[data-edge=\"start\"]::after {\n      inset-block-start: 0;\n      clip-path: polygon(50% 0, 100% 100%, 0 100%);\n    }\n    &[data-edge=\"end\"]::after {\n      inset-block-end: 0;\n      clip-path: polygon(0 0, 100% 0, 50% 100%);\n    }\n\n    [data-kit=\"scroll-area\"][data-overflow-y]:not([data-at-y-start]) > &[data-edge=\"start\"],\n    [data-kit=\"scroll-area\"][data-overflow-y]:not([data-at-y-end]) > &[data-edge=\"end\"] {\n      opacity: 1;\n    }\n  }\n\n  /* The scrollbar: a hairline track down the trailing edge, wide enough to\n     catch a pointer, with the thumb riding on it. */\n  [data-skin=\"cyber\"] [data-kit=\"scroll-area-scrollbar\"] {\n    width: var(--area-bar);\n    background: linear-gradient(var(--cy-line-deco), var(--cy-line-deco)) center / 1px 100% no-repeat;\n    opacity: 0;\n    transition: opacity var(--cy-t) linear;\n\n    &[data-visible] {\n      opacity: 1;\n    }\n  }\n\n  /* The thumb is sized and moved by the SDK, so the bar people see is\n     drawn inside it: 4px of the accent with its lower corner cut.\n       idle   70%\n       hover  100%, and half again as wide\n       drag   100%, twice as wide, glowing */\n  [data-skin=\"cyber\"] [data-kit=\"scroll-area-thumb\"] {\n    position: relative;\n    width: 100%;\n    min-height: 16px;\n    cursor: grab;\n\n    &::before {\n      content: \"\";\n      position: absolute;\n      inset-block: 0;\n      inset-inline-start: calc(50% - 2px);\n      width: 4px;\n      background: var(--cy-line-ctl);\n      clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4px), 0 100%);\n      transition:\n        background-color var(--cy-t-fast) linear,\n        scale var(--cy-t-fast) var(--cy-ease-snap);\n    }\n\n    @media (hover: hover) {\n      [data-kit=\"scroll-area-scrollbar\"]:hover > &::before {\n        background: var(--cy-line-hot);\n        scale: 1.5 1;\n      }\n    }\n\n    &[data-dragging] {\n      cursor: grabbing;\n      filter: drop-shadow(0 0 calc(4px * var(--cy-fx)) var(--cy-glow));\n    }\n    &[data-dragging]::before {\n      background: var(--cy-line-hot);\n      scale: 2 1;\n    }\n  }\n\n  /* Forced colors drop the gradients and fills; the system's colors stand\n     in for the track, the thumb and the arrows. */\n  @media (forced-colors: active) {\n    [data-skin=\"cyber\"] [data-kit=\"scroll-area-scrollbar\"] {\n      border-inline-start: 1px solid CanvasText;\n    }\n    [data-skin=\"cyber\"] [data-kit=\"scroll-area-thumb\"]::before,\n    [data-skin=\"cyber\"] [data-kit=\"scroll-area-edge\"]::after {\n      background: CanvasText;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/scroll-area.css"
    }
  ],
  "type": "registry:ui"
}
