{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "message-scroller",
  "title": "Message scroller",
  "description": "A conversation log on @shadcn/react's MessageScroller, as the reference: stays on the newest message, holds the reader's place when scrolled up, keeps position when older messages are prepended; role=log inside a focusable region. Keyline adds: the place also holds when content above changes size (in every engine), arrivals unfold from their top keyline while the reader follows, and a Latest cell that counts what arrived below and jumps a bounded, interruptible distance. The log scrolls inside Keyline's Scroll Area, so its bar is the shared one; the jump reveals it, and pressing it is the reader taking over.",
  "dependencies": [
    "@base-ui/react@1.9.0",
    "@shadcn/react@0.3.1"
  ],
  "registryDependencies": [
    "@keyline-ui/keyline",
    "utils",
    "@keyline-ui/keyline-render",
    "@keyline-ui/keyline-motion",
    "@keyline-ui/scroll-area"
  ],
  "files": [
    {
      "path": "src/registry/keyline/ui/message-scroller.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n  MessageScroller as Primitive,\n  useMessageScroller,\n  useMessageScrollerScrollable,\n  useMessageScrollerVisibility,\n} from \"@shadcn/react/message-scroller\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\";\n\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\n\nimport { cn } from \"@/lib/utils\";\nimport { tokenMs } from \"../lib/keyline-motion\";\nimport { resolveClassName, resolveStyle, type PartProps } from \"../lib/keyline-render\";\nimport { ScrollAreaBars, ScrollAreaRoot, ScrollAreaViewport, type ScrollbarVisibility } from \"./scroll-area\";\n\n/* A conversation log that keeps to the newest message, on @shadcn/react's MessageScroller (as the reference):\n   stick-to-end while new messages arrive, a held position when the reader has scrolled up, scroll kept\n   when older messages are prepended, an anchor to land on, and the log semantics (a focusable region\n   holding a role=\"log\" list, additions announced). Keyline draws the frame and the jump cell, and adds\n   what the primitive leaves to the browser:\n   - the reader's place holds when something above it changes size (a file's error wraps, a thumbnail loads).\n     Chrome anchors scrolling natively, WebKit does not; one rule now serves both;\n   - a message that arrives while the reader follows the conversation unfolds from its top keyline (the\n     shared edge with the message before it). Older history never animates;\n   - the jump cell counts what arrived below the reader, and a long jump is bounded: it lands one screen\n     short at once, then travels the last screen, so it takes the same time from anywhere and stays\n     interruptible by wheel, touch or keys.\n   The log scrolls inside Keyline's Scroll Area (Base UI), so its bar is the shared one: a cell on the\n   frame's edge whose thumb reveals while the reader scrolls or points at the edge, then fades. The viewport and\n   content are the primitive's own elements, rendered as the Scroll Area's parts, so neither library is re-implemented. */\n\n/* ------------------------------------------------------------------ *\n * CLASSES\n * ------------------------------------------------------------------ */\n\nconst VP = '[data-slot=\"message-scroller-viewport\"]';\n\nconst frame = \"kl-frame relative flex min-h-0 min-w-0 flex-col\";\n\n/* The log scrolls in Keyline's Scroll Area (scroll-area.tsx draws the bar, its reveal and the focus ring above it).\n   A log nearly always overflows, so the bar's room is kept from the first message: the first message that overflows\n   does not narrow the conversation. overflow-anchor: none: the reader's place is held by one rule in every engine\n   (MessageScrollerContent), not by Chrome's own anchoring on top of it. */\nconst viewport =\n  \"pe-(--kl-sb) overflow-x-hidden! overscroll-contain [overflow-anchor:none] data-pending-scroll:invisible\";\n\n/* runs sit one gutter-and-a-half apart; inside a run, bubbles share keylines. The log is a size container (kl-log),\n   so a narrow panel narrows the messages, not the window. */\nconst content = cn(\n  \"@container/kl-log flex min-h-full flex-col gap-[calc(var(--kl-gutter)+8px)]\",\n  \"px-[calc(var(--kl-inset)+4px)] pt-[calc(var(--kl-inset)+4px)] pb-[calc(var(--kl-inset)+8px)]\",\n);\n\nconst item = \"min-w-0 flex-none\";\n\nconst separator = cn(\n  \"flex items-center gap-2.5 text-kl-ink-2\",\n  \"[[data-slot=message-scroller-item]>&]:mb-[calc(var(--kl-gutter)+8px)]\",\n  \"before:flex-[1_1_0] before:border-t-(length:--kl-k1) before:border-kl-line-soft before:content-['']\",\n  \"after:flex-[1_1_0] after:border-t-(length:--kl-k1) after:border-kl-line-soft after:content-['']\",\n);\n\n/* THE JUMP CELL sits over the frame's bottom (or top) keyline, centred: the label, then a count cell that is inserted\n   (0 → its width) while messages wait below. It folds out when there is nothing that way. */\nconst jump = cn(\n  \"kl-ctl kl-key group/jump absolute start-1/2 z-2 inline-flex h-8 cursor-pointer items-stretch\",\n  \"-translate-x-1/2 bg-kl-raised text-kl-ink kl-rtl:translate-x-1/2\",\n  \"font-(family-name:--kl-font) text-[13px] font-(--kl-weight-strong)\",\n  \"[transition:opacity_var(--kl-t-unfold)_linear]\",\n  \"data-[direction=end]:bottom-3 data-[direction=start]:top-3\",\n  \"data-[active=false]:pointer-events-none data-[active=false]:invisible data-[active=false]:opacity-0\",\n  \"data-[active=false]:[transition:opacity_var(--kl-t-fold)_linear,visibility_0s_var(--kl-t-fold)]\",\n);\nconst jumpLabel = \"inline-flex items-center gap-1.5 ps-2.5 pe-3 group-hover/jump:bg-kl-tint\";\nconst jumpCount = cn(\n  \"grid place-items-center border-s-(length:--kl-k1) border-kl-seam px-2.5 whitespace-nowrap\",\n  \"bg-kl-inverse font-(family-name:--kl-font-mono) text-[11px]/none font-medium text-kl-on-inverse not-italic tabular-nums\",\n);\n\nconst UNITS = '[data-slot=\"bubble\"], [data-slot=\"message-header\"], [role=\"separator\"]';\nconst reduced = (el: Element) =>\n  matchMedia(\"(prefers-reduced-motion: reduce)\").matches || !!el.closest('[data-kl-motion=\"reduce\"]');\n\n/** State for one log. `autoScroll` (default true here) keeps the log on the newest message while the reader\n *  is at the end; scrolled up, their place is held. After the reader sends, call `useMessageScroller().scrollToEnd()`. */\nfunction MessageScrollerProvider({ autoScroll = true, ...props }: React.ComponentProps<typeof Primitive.Provider>) {\n  return <Primitive.Provider autoScroll={autoScroll} {...props} />;\n}\n\n/** The frame. Give it a height (or put it in a flex column): the viewport scrolls inside. */\nfunction MessageScroller({ className, ...props }: React.ComponentProps<typeof Primitive.Root>) {\n  return <Primitive.Root data-slot=\"message-scroller\" className={cn(frame, className)} {...props} />;\n}\n\n/** The scrolling region; `aria-label` names it (default \"Messages\"). `scrollbarVisibility` as on ScrollArea. */\nfunction MessageScrollerViewport({\n  className,\n  children,\n  tabIndex,\n  scrollbarVisibility = \"system\",\n  ...props\n}: React.ComponentProps<typeof Primitive.Viewport> & { scrollbarVisibility?: ScrollbarVisibility }) {\n  return (\n    <ScrollAreaRoot\n      data-slot=\"message-scroller-scroll\"\n      scrollbarVisibility={scrollbarVisibility}\n      className=\"flex-auto\"\n      // Pressing the bar is the reader taking over, as a wheel is: the log stops following the newest message (so a\n      // message arriving under a held thumb does not move the content beneath it), and a jump in flight stops where it\n      // is. The primitive reads intent from the viewport's wheel, so the press tells it that way, with no distance.\n      onPointerDownCapture={(e) => {\n        const vp = e.currentTarget.querySelector<HTMLElement>(VP);\n        if (e.button !== 0 || !vp || !(e.target as Element).closest?.('[data-slot=\"scroll-area-scrollbar\"]')) return;\n        if (vp.scrollHeight - vp.clientHeight - vp.scrollTop <= 2) {\n          const bubbles = vp.querySelectorAll('[data-slot=\"bubble\"]');\n          const newest = bubbles[bubbles.length - 1];\n          if (newest) seenAtPress.set(vp, newest);\n          const release = () => {\n            seenAtPress.delete(vp);\n            window.removeEventListener(\"pointerup\", release, true);\n            window.removeEventListener(\"pointercancel\", release, true);\n          };\n          window.addEventListener(\"pointerup\", release, true);\n          window.addEventListener(\"pointercancel\", release, true);\n        }\n        vp.dispatchEvent(new WheelEvent(\"wheel\", { bubbles: true, cancelable: true }));\n      }}\n    >\n      {/* the reader's props go to Base UI, which merges handlers with its own and hands everything to the primitive */}\n      <ScrollAreaViewport\n        {...(props as React.ComponentProps<typeof ScrollAreaViewport>)}\n        data-slot=\"message-scroller-viewport\"\n        className={cn(viewport, className)}\n        // the log stays a tab stop even before it overflows, as the primitive makes it\n        tabIndex={tabIndex ?? 0}\n        render={(p) => <Primitive.Viewport {...(p as React.ComponentProps<typeof Primitive.Viewport>)} />}\n      >\n        {children}\n      </ScrollAreaViewport>\n      <ScrollAreaBars />\n    </ScrollAreaRoot>\n  );\n}\n\n/** The first unit (bubble, header, separator) whose top is at or below the viewport's top: the line being read. */\nfunction readingAnchor(content: HTMLElement, vpTop: number) {\n  const items = content.children;\n  // items are in order: find the first that reaches below the top (binary search), then its first unit at or below it\n  let lo = 0;\n  let hi = items.length - 1;\n  while (lo < hi) {\n    const mid = (lo + hi) >> 1;\n    const box = items[mid]?.getBoundingClientRect();\n    if (box && box.bottom <= vpTop) lo = mid + 1;\n    else hi = mid;\n  }\n  for (let i = lo; i < Math.min(items.length, lo + 3); i++) {\n    const item = items[i] as HTMLElement;\n    if (item.hidden) continue;\n    const units = item.matches(UNITS) ? [item] : Array.from(item.querySelectorAll<HTMLElement>(UNITS));\n    for (const u of units) {\n      const top = u.getBoundingClientRect().top;\n      if (top >= vpTop - 0.5) return { el: u, top };\n    }\n  }\n  return null;\n}\n\nfunction MessageScrollerContent({ className, ref, ...props }: React.ComponentProps<typeof Primitive.Content>) {\n  const own = React.useRef<HTMLDivElement | null>(null);\n  const setRef = React.useCallback(\n    (el: HTMLDivElement | null) => {\n      own.current = el;\n      if (typeof ref === \"function\") ref(el);\n      else if (ref) ref.current = el;\n    },\n    [ref],\n  );\n\n  React.useEffect(() => {\n    const content = own.current;\n    const vp = content?.parentElement;\n    if (!content || !vp) return;\n\n    /* HOLD THE READER'S PLACE across size changes above it */\n    let anchor: { el: HTMLElement; top: number } | null = null;\n    let atEnd = true;\n    let frame = 0;\n    const record = () => {\n      frame = 0;\n      atEnd = vp.scrollHeight - vp.clientHeight - vp.scrollTop <= 2;\n      anchor = atEnd ? null : readingAnchor(content, vp.getBoundingClientRect().top);\n    };\n    /* THE READER LEAVES THE END by the scroll itself, not by the order of its events. The primitive stops following\n       the end on the reader's wheel, touch or key, and on a scroll up, except in the 180ms after it scrolled to the\n       end itself, when it takes a scroll up for its own. WebKit can scroll for a wheel before it dispatches the wheel\n       event, so a fast wheel just after a message arrived was taken for the log's own scroll: the log kept following\n       (Latest hidden), and its next follow put the reader back at the end. The primitive never scrolls up while it\n       follows, so a scroll up that leaves the end while it still follows is the reader's. This listener runs after\n       the primitive's (React's listener was added when the element was created): if the primitive still follows\n       (data-scrollable, written as it handles the scroll, says nothing waits below) though the reader is away from\n       the end, it gets the reader's intent and then the scroll again, so it shows Latest. The intent goes as a\n       touchmove, which only the primitive reads: Base UI's scroll area takes a wheel for user input and would reveal\n       the thumb for a scroll it did not see the reader make (focus moving to a control above, say). */\n    let lastTop = vp.scrollTop;\n    const leave = () => {\n      const top = vp.scrollTop;\n      const up = top < lastTop - 0.5;\n      lastTop = top;\n      // 8px: the primitive's default edge threshold; nearer the end than that, it follows on its own terms\n      if (!up || vp.scrollHeight - vp.clientHeight - top <= 8) return;\n      if ((vp.getAttribute(\"data-scrollable\") ?? \"\").split(\" \").includes(\"end\")) return;\n      vp.dispatchEvent(new Event(\"touchmove\", { bubbles: true }));\n      vp.dispatchEvent(new Event(\"scroll\"));\n    };\n    const onScroll = () => {\n      leave();\n      if (!frame) frame = requestAnimationFrame(record);\n    };\n    vp.addEventListener(\"scroll\", onScroll, { passive: true });\n    const ro = new ResizeObserver(() => {\n      // following the end belongs to the primitive. (Its data-autoscrolling flag is not a reliable \"jump in flight\"\n      // signal: it can stay set after scrolling stops. A jump records a fresh anchor every frame instead.)\n      if (atEnd || !anchor || !anchor.el.isConnected) return;\n      const delta = anchor.el.getBoundingClientRect().top - anchor.top;\n      if (Math.abs(delta) > 0.5) vp.scrollTop += delta;\n      anchor.top = anchor.el.getBoundingClientRect().top;\n    });\n    ro.observe(content);\n\n    /* ARRIVAL: messages added after the newest one unfold from their top keyline */\n    const units = () => content.querySelectorAll<HTMLElement>('[data-slot=\"bubble\"]');\n    let last: HTMLElement | null = Array.from(units()).at(-1) ?? null;\n    let ready = false;\n    const r = requestAnimationFrame(() => requestAnimationFrame(() => (ready = true)));\n    const mo = new MutationObserver(() => {\n      const all = Array.from(units());\n      const i = last ? all.indexOf(last) : -1;\n      const known = !last || i >= 0;\n      const fresh = known ? all.slice(i + 1) : [];\n      last = all.at(-1) ?? null;\n      if (!ready || !fresh.length) return;\n      const ms = tokenMs(content, \"--kl-t-unfold\", 160);\n      if (!ms || reduced(content)) return;\n      const targets = new Set<HTMLElement>();\n      for (const b of fresh) {\n        const run = b.closest<HTMLElement>('[data-slot=\"message\"]');\n        // the first bubble of a new run brings its header and avatar with it\n        targets.add(run && run.querySelector('[data-slot=\"bubble\"]') === b ? run : b);\n      }\n      const ease = getComputedStyle(content).getPropertyValue(\"--kl-ease-out\").trim() || \"ease-out\";\n      for (const t of targets) {\n        t.animate([{ clipPath: \"inset(0 -24px 100% -24px)\" }, { clipPath: \"inset(0 -24px -24px -24px)\" }], {\n          duration: ms,\n          easing: ease,\n        });\n      }\n    });\n    mo.observe(content, { childList: true, subtree: true });\n\n    return () => {\n      vp.removeEventListener(\"scroll\", onScroll);\n      cancelAnimationFrame(frame);\n      cancelAnimationFrame(r);\n      ro.disconnect();\n      mo.disconnect();\n    };\n  }, []);\n\n  // the Scroll Area's content part (it re-measures the thumb when messages arrive or change size), rendered as the log\n  return (\n    <ScrollAreaPrimitive.Content\n      {...(props as React.ComponentProps<typeof ScrollAreaPrimitive.Content>)}\n      ref={setRef}\n      data-slot=\"message-scroller-content\"\n      className={cn(content, className)}\n      // Base UI marks its wrapper presentational; the log keeps its own role (\"log\" unless the reader names another)\n      render={({ role: _presentation, ...p }) => (\n        <Primitive.Content {...(p as React.ComponentProps<typeof Primitive.Content>)} role={props.role} />\n      )}\n    />\n  );\n}\n\n/** One entry of the log: one sender's run (a Message), a separator, or a notice. `messageId` lets you scroll to\n *  it; `scrollAnchor` lands the first view on it. */\nfunction MessageScrollerItem({ className, ...props }: React.ComponentProps<typeof Primitive.Item>) {\n  return <Primitive.Item data-slot=\"message-scroller-item\" className={cn(item, className)} {...props} />;\n}\n\n/** A day or \"New messages\" divider: a seam with its words in the Code voice. */\nfunction MessageScrollerSeparator({\n  render,\n  className,\n  style,\n  children,\n  ...props\n}: PartProps<\"div\", Record<string, never>>): React.ReactElement {\n  const state = {};\n  return useRender({\n    defaultTagName: \"div\",\n    render,\n    state,\n    props: mergeProps<\"div\">(props, {\n      role: \"separator\",\n      className: resolveClassName(separator, className)(state),\n      style: resolveStyle(undefined, style)(state),\n      children: <span className=\"kl-code\">{children}</span>,\n      \"data-slot\": \"message-scroller-separator\",\n    } as React.ComponentProps<\"div\">),\n  });\n}\n\n/** The newest message when the reader pressed the bar while at the end (for the count; cleared at release). */\nconst seenAtPress = new WeakMap<Element, Element>();\n\n/** How many messages arrived below the reader since they left the end (0 while they are at the end). */\nfunction useUnseen(button: React.RefObject<HTMLElement | null>, active: boolean) {\n  const [n, setN] = React.useState(0);\n  React.useEffect(() => {\n    const vp = button.current?.closest('[data-slot=\"message-scroller\"]')?.querySelector<HTMLElement>(VP);\n    const content = vp?.querySelector<HTMLElement>('[data-slot=\"message-scroller-content\"]');\n    if (!active || !vp || !content) {\n      setN(0);\n      return;\n    }\n    const bubbles = () => content.querySelectorAll<HTMLElement>('[data-slot=\"bubble\"]');\n    // the mark is the newest message when the reader left the end: they had seen it. A reader holding the\n    // thumb at the end leaves it because a message arrived under it, so the mark is the newest at the press.\n    const held = seenAtPress.get(vp);\n    const mark = (held?.isConnected ? held : null) ?? Array.from(bubbles()).at(-1) ?? null;\n    let frame = 0;\n    const count = () => {\n      frame = 0;\n      if (!mark?.isConnected) return setN(0);\n      const bottom = vp.getBoundingClientRect().bottom;\n      let c = 0;\n      for (const b of bubbles())\n        if (\n          mark.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING &&\n          b.getBoundingClientRect().top > bottom - 8\n        )\n          c++;\n      setN(c);\n    };\n    const later = () => {\n      if (!frame) frame = requestAnimationFrame(count);\n    };\n    const mo = new MutationObserver(later);\n    mo.observe(content, { childList: true, subtree: true });\n    vp.addEventListener(\"scroll\", later, { passive: true });\n    later(); // what is already below the mark (a message that arrived as the reader left the end)\n    return () => {\n      mo.disconnect();\n      vp.removeEventListener(\"scroll\", later);\n      cancelAnimationFrame(frame);\n    };\n  }, [active, button]);\n  return n;\n}\n\n/**\n * The jump cell: appears on the frame's bottom keyline (end) or top keyline (start) when there is more that\n * way; out of the tab order and hidden while there is nothing to jump to. Toward the end it counts the messages\n * that arrived below the reader (\"Latest | 3 new\"); pass `children` to name it otherwise.\n */\nfunction MessageScrollerButton({\n  direction = \"end\",\n  className,\n  children,\n  behavior,\n  onClick,\n  onPointerDown,\n  onKeyDown,\n  ...props\n}: React.ComponentProps<typeof Primitive.Button>) {\n  // The jump smooth-scrolled under reduced motion, and a keyboard jump left focus on the page (the library\n  // blurs the button). Motion is read when the press starts (a discrete event, so the state lands before the click);\n  // after a keyboard jump focus goes to the log, which is where the reader now is.\n  const [still, setStill] = React.useState(false);\n  const read = (e: React.SyntheticEvent<HTMLElement>) => setStill(reduced(e.currentTarget));\n  const self = React.useRef<HTMLButtonElement | null>(null);\n  const scrollable = useMessageScrollerScrollable();\n  const unseen = useUnseen(self, direction === \"end\" && scrollable.end);\n  const label = children ?? (direction === \"end\" ? \"Latest\" : \"Earliest\");\n  return (\n    <Primitive.Button\n      ref={self}\n      data-slot=\"message-scroller-button\"\n      data-direction={direction}\n      direction={direction}\n      behavior={behavior ?? (still ? \"auto\" : \"smooth\")}\n      aria-label={\n        unseen\n          ? `${typeof label === \"string\" ? label : direction === \"end\" ? \"Latest\" : \"Earliest\"}, ${unseen} new ${unseen === 1 ? \"message\" : \"messages\"}`\n          : undefined\n      }\n      className={cn(jump, className)}\n      onPointerDown={(e) => {\n        read(e);\n        onPointerDown?.(e);\n      }}\n      onKeyDown={(e) => {\n        read(e);\n        onKeyDown?.(e);\n      }}\n      onClick={(e) => {\n        onClick?.(e);\n        const vp = e.currentTarget.closest('[data-slot=\"message-scroller\"]')?.querySelector<HTMLElement>(VP);\n        // The jump and the bar are one response. Base UI shows the thumb for the reader's own scrolling only,\n        // so while the jump they asked for travels, the bar shows it travelling, and fades with the usual idle after it lands.\n        const area = vp?.closest<HTMLElement>('[data-slot=\"message-scroller-scroll\"]');\n        if (vp && area && !e.defaultPrevented) {\n          area.setAttribute(\"data-kl-travel\", \"\");\n          let idle = 0;\n          const land = () => {\n            clearTimeout(idle);\n            idle = window.setTimeout(done, 500);\n          };\n          const done = () => {\n            clearTimeout(idle);\n            clearTimeout(cap);\n            vp.removeEventListener(\"scroll\", land);\n            area.removeAttribute(\"data-kl-travel\");\n          };\n          vp.addEventListener(\"scroll\", land, { passive: true });\n          land();\n          const cap = window.setTimeout(done, 1500);\n        }\n        // A bounded jump: from far away, land one screen short at once; the smooth part is always about one screen.\n        if (vp && !e.defaultPrevented && !(still || behavior === \"auto\")) {\n          const h = vp.clientHeight;\n          if (direction === \"end\") {\n            const max = vp.scrollHeight - h;\n            if (max - vp.scrollTop > 2 * h) vp.scrollTop = max - h;\n          } else if (vp.scrollTop > 2 * h) vp.scrollTop = h;\n          // Neither engine stops a scripted smooth scroll when the reader takes over (the wheel is swallowed\n          // until it lands). Their first wheel, touch or key stops it where it is, and then acts as usual.\n          const stop = () => {\n            off();\n            vp.scrollTo({ top: vp.scrollTop, behavior: \"instant\" });\n          };\n          const off = () => {\n            clearTimeout(t);\n            for (const ev of [\"wheel\", \"touchstart\", \"keydown\", \"pointerdown\"]) vp.removeEventListener(ev, stop);\n          };\n          for (const ev of [\"wheel\", \"touchstart\", \"keydown\", \"pointerdown\"])\n            vp.addEventListener(ev, stop, { passive: true, once: true });\n          const t = setTimeout(off, 1000);\n        }\n        if (e.detail !== 0) return;\n        requestAnimationFrame(() => vp?.focus({ preventScroll: true }));\n      }}\n      {...props}\n    >\n      <span data-slot=\"message-scroller-button-label\" className={jumpLabel}>\n        <svg\n          viewBox=\"0 0 16 16\"\n          width=\"16\"\n          height=\"16\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"1.75\"\n          strokeLinecap=\"square\"\n          aria-hidden\n        >\n          <path d={direction === \"end\" ? \"M8 2.5v10M3.5 8.5l4.5 4.5 4.5-4.5\" : \"M8 13.5v-10M3.5 7.5L8 3l4.5 4.5\"} />\n        </svg>\n        <span>{label}</span>\n      </span>\n      <span\n        data-slot=\"message-scroller-button-count\"\n        className=\"kl-slot\"\n        data-open={unseen ? \"\" : undefined}\n        aria-hidden\n      >\n        <span className=\"flex\">\n          <span className={jumpCount}>{unseen ? `${unseen} new` : \"\"}</span>\n        </span>\n      </span>\n    </Primitive.Button>\n  );\n}\n\nexport {\n  MessageScrollerProvider,\n  MessageScroller,\n  MessageScrollerViewport,\n  MessageScrollerContent,\n  MessageScrollerItem,\n  MessageScrollerSeparator,\n  MessageScrollerButton,\n  useMessageScroller,\n  useMessageScrollerScrollable,\n  useMessageScrollerVisibility,\n};\n",
      "type": "registry:ui",
      "target": "components/keyline/ui/message-scroller.tsx"
    }
  ],
  "type": "registry:ui"
}