{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "feed",
  "title": "Feed",
  "description": "Dated events in order on a vertical rule: who did what, and when.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/feed.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Timeline, TimelineConnector, TimelineDescription, TimelineItem, TimelineMarker, TimelineTime, TimelineTitle } from \"@ui-sdk/react/timeline\"\nimport \"@/registry/cyber/ui/cyber/feed.css\"\n\ntype Tone = \"default\" | \"signal\" | \"flag\"\n\ntype FeedItem = {\n  id: string\n  // The time as it's printed (\"21:04\"), and optionally in a form a machine\n  // can read (\"2077-03-14T21:04\").\n  time: string\n  dateTime?: string\n  actor: string\n  text: React.ReactNode\n  tone?: Tone\n}\n\n// What a tone says to a screen reader, since a marker's shape and color\n// say it only to the eye.\nconst toneWords: Record<Tone, string | undefined> = { default: undefined, signal: \"Agent\", flag: \"Alert\" }\n\n// An activity log: events in the order they happened, each with its time in\n// the margin, a marker on a rule running down the page, who did it and what\n// they did. It's one tab stop; the arrow keys, Home and End move between\n// entries.\n//\n// - `label` names the log (\"Job activity\").\n// - `items`: `{ id, time, actor, text, tone? }`, oldest first. A tone changes\n//   the marker's shape as well as its color: \"default\" is a hollow square,\n//   \"signal\" a solid cyan diamond for something an agent did, \"flag\" a\n//   yellow warning triangle for an alert.\n// - `live`: the log is still being written. The rule runs on past the last\n//   entry as a dashed line, and that entry's marker breathes.\nfunction Feed({\n  label,\n  items,\n  live,\n  ...props\n}: Omit<React.ComponentProps<typeof Timeline>, \"children\" | \"aria-label\"> & {\n  label: string\n  items: FeedItem[]\n  live?: boolean\n}) {\n  return (\n    <Timeline data-kit=\"feed\" data-live={live ? \"\" : undefined} aria-label={label} {...props}>\n      {items.map((item) => {\n        const tone = item.tone ?? \"default\"\n        const word = toneWords[tone]\n        return (\n          <TimelineItem key={item.id} value={item.id} data-kit=\"feed-item\" data-tone={tone}>\n            <TimelineTime data-kit=\"feed-time\" dateTime={item.dateTime}>\n              {item.time}\n            </TimelineTime>\n            <TimelineMarker data-kit=\"feed-marker\" />\n            <TimelineConnector data-kit=\"feed-connector\" />\n            <TimelineTitle data-kit=\"feed-actor\">\n              {item.actor}\n              {word && <span data-sr-only>, {word}</span>}\n            </TimelineTitle>\n            <TimelineDescription data-kit=\"feed-text\">{item.text}</TimelineDescription>\n          </TimelineItem>\n        )\n      })}\n    </Timeline>\n  )\n}\n\nexport { Feed }\nexport type { FeedItem, Tone as FeedTone }\n",
      "type": "registry:ui",
      "target": "@ui/feed.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/feed.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* Three columns shared by every entry through a subgrid, so the times\n     line up whatever their length: the time, the rule with its markers, and\n     who did what. */\n  [data-skin=\"cyber\"] [data-kit=\"feed\"] {\n    display: grid;\n    grid-template-columns: max-content 18px minmax(0, 1fr);\n    column-gap: 6px;\n    width: 100%;\n    min-width: 0;\n    text-align: start;\n  }\n\n  /* An entry isn't a control: it has no hover and no press. It does take\n     focus, one entry at a time, and the kit's ring shows which. */\n  [data-skin=\"cyber\"] [data-kit=\"feed-item\"] {\n    --tone: var(--cy-ink);\n\n    grid-column: 1 / -1;\n    display: grid;\n    grid-template-columns: subgrid;\n    grid-template-rows: auto auto;\n    align-items: baseline;\n    /* Room inside the row, so the focus ring doesn't sit on the text. */\n    padding: 6px 4px;\n\n    &[data-tone=\"signal\"] {\n      --tone: var(--cy-signal);\n    }\n    &[data-tone=\"flag\"] {\n      --tone: var(--cy-flag);\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"feed-time\"] {\n    grid-area: 1 / 1;\n    font-family: var(--cy-mono);\n    font-size: var(--cy-text-xs);\n    font-variant-numeric: tabular-nums;\n    line-height: 18px;\n    white-space: nowrap;\n    color: var(--cy-ink-mute);\n  }\n\n  /* The marker says what kind of entry it is by its shape, not only its\n     color: a hollow square for the ordinary, a solid diamond for an agent,\n     a warning triangle for an alert. */\n  [data-skin=\"cyber\"] [data-kit=\"feed-marker\"] {\n    grid-area: 1 / 2;\n    place-self: center;\n    width: 7px;\n    height: 7px;\n    border: 1px solid var(--tone);\n\n    [data-tone=\"signal\"] > & {\n      background: var(--tone);\n      rotate: 45deg;\n    }\n\n    [data-tone=\"flag\"] > & {\n      width: 10px;\n      height: 9px;\n      border: 0;\n      background: var(--tone);\n      clip-path: polygon(50% 0, 100% 100%, 0 100%);\n    }\n\n    /* A log still being written: its newest entry breathes. */\n    [data-live] > :last-child > & {\n      animation: var(--cy-fx-pulse) 1.8s var(--cy-ease-snap) infinite;\n    }\n  }\n\n  /* The rule from one marker to the next. It starts under this entry's\n     marker and runs on through the padding of both rows, to stop just short\n     of the next one. */\n  [data-skin=\"cyber\"] [data-kit=\"feed-connector\"] {\n    grid-area: 1 / 2 / 3 / 3;\n    place-self: stretch center;\n    width: 1px;\n    margin-block: 17px -11px;\n    background: var(--cy-line-ctl);\n\n    /* Nothing follows the last entry, unless the log is live: then the rule\n       runs on, dashed, toward whatever comes next. */\n    :is([data-last], :last-child) > & {\n      display: none;\n    }\n    [data-live] > :is([data-last], :last-child) > & {\n      display: block;\n      margin-block-end: -6px;\n      background: repeating-linear-gradient(to bottom, var(--cy-line-ctl) 0 3px, transparent 3px 6px);\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"feed-actor\"] {\n    grid-area: 1 / 3;\n    min-width: 0;\n    font-size: var(--cy-text-sm);\n    font-weight: 600;\n    line-height: 18px;\n    letter-spacing: var(--cy-track);\n    text-transform: uppercase;\n    color: var(--tone);\n    overflow-wrap: anywhere;\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"feed-text\"] {\n    grid-area: 2 / 3;\n    min-width: 0;\n    font-size: var(--cy-text-sm);\n    line-height: 1.35;\n    color: var(--cy-ink-hi);\n    text-wrap: pretty;\n    overflow-wrap: anywhere;\n\n    /* Room for the dashed tail of a live log. */\n    [data-live] > :is([data-last], :last-child) > & {\n      padding-block-end: 8px;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/feed.css"
    }
  ],
  "type": "registry:ui"
}
