{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "timeline",
  "title": "Timeline",
  "description": "Events in order, such as an activity feed, an order’s steps or a changelog, each with a marker (an icon or an avatar, or a mark of its status) and a line to the next. New events fade in while the rest glide to make room, and a step’s line fills along its length as it completes. A split variant centres the rail, with an aside such as a date on the other side, and a track variant lays the steps across a thick bar that fills to a marker travelling between them, captioned with the latest event, and runs down the page in a narrow container.",
  "dependencies": [
    "@ui-sdk/react",
    "@ui-sdk/core"
  ],
  "registryDependencies": [
    "https://kinoui.com/r/icon-tile.json",
    "https://kinoui.com/r/flow.json",
    "https://kinoui.com/r/refs.json",
    "https://kinoui.com/r/step.json",
    "https://kinoui.com/r/swap.json",
    "https://kinoui.com/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/components/kino/timeline.tsx",
      "content": "'use client'\n\nimport { IconTile, iconTileShapeClassName } from '@/registry/components/kino/icon-tile'\nimport { flowItemClassName, useFlow } from '@/registry/lib/flow'\nimport { markMounted, mergeRefs } from '@/registry/lib/refs'\nimport {\n  type StepStatus,\n  StepMark,\n  stepLineClassName,\n  stepLineFillClassName,\n  stepStatusText,\n  stepMarkerTransition,\n  stepTileLook,\n} from '@/registry/lib/step'\nimport { Swap } from '@/registry/lib/swap'\nimport { mergeProps, type PartProps, renderElement } from '@ui-sdk/react/primitive'\nimport {\n  TimelineConnector as TimelineConnectorPrimitive,\n  TimelineDescription as TimelineDescriptionPrimitive,\n  TimelineItem as TimelineItemPrimitive,\n  TimelineMarker as TimelineMarkerPrimitive,\n  Timeline as TimelinePrimitive,\n  TimelineTime as TimelineTimePrimitive,\n  TimelineTitle as TimelineTitlePrimitive,\n} from '@ui-sdk/react/timeline'\nimport {\n  Children,\n  Fragment,\n  type ComponentProps,\n  createContext,\n  type CSSProperties,\n  isValidElement,\n  type ReactElement,\n  type ReactNode,\n  use,\n  useMemo,\n  useState,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/*\n * Events in order, each with a marker on a rail at the start edge and its\n * title, time and details beside it. A marker is an Icon tile with whatever it\n * holds, an icon or an avatar, or with no children a mark of the step's status. A line joins each marker to the next,\n * leaving a little room around both.\n *\n * `status` reads a timeline as steps, with the step lib's marks: a complete\n * step's tile takes a tick and the line out of it fills along its length on\n * `draw`; the current one turns solid once the line reaching it has filled;\n * an upcoming one is faint. A step that failed takes the destructive colour\n * and a cross in an octagon, and one skipped is faint with a dash, its title\n * struck through.\n *\n * When an event comes or goes, the others glide to their new places on\n * `layout` (`followFlow`) while the timeline follows its height: one that\n * arrives fades in on `enter` as its marker grows into place and its line\n * draws down to the next, and one that goes fades where it was on `exit`.\n * Nothing moves when the page loads.\n *\n * The `split` variant centres the rail, with what happened on one side and\n * an aside on the other (a date, a version, a quarter); in a box narrower\n * than 28rem it goes back to a rail at the start, the aside above the title.\n *\n * The `track` variant reads as where something is on its way, such as an\n * order: from 42rem the steps sit across a thick bar, each over its title,\n * and below that they run down the page on the same bar. A\n * `TimelineProgress` in it is a marker half way along the bar out of the\n * `current` step, or on the last step once that is current, with the bar\n * filled up to it; across, it carries a caption above it, and down, it is a\n * row of its own between the steps. The steps behind the marker read as\n * done, the current one included. Without one, the bar fills to the current\n * step. When the current step moves on, the bar\n * fills on to the marker's new place on `draw` while the marker travels with\n * it, and each step it passes changes as the bar reaches it.\n */\n\ntype TimelineStatus = StepStatus\n\n/** The status of the event around it, which its title reads out. */\nconst StatusContext = createContext<TimelineStatus | undefined>(undefined)\n\n/** A track's layout for its steps: how long each step's mark waits to light, by its index, where the marker is, and what it says. */\ninterface Track {\n  waitOf: (index: number) => number\n  /** The current step, which the marker follows, or -1 with no marker. */\n  current: number\n  onLast: boolean\n  label: ReactNode\n}\n\nconst TrackContext = createContext<Track | null>(null)\n\n/** Which drawing of a track's marker a `TimelineProgress` is: the row down the page, or the caption and the marker on the bar across it. */\nconst ProgressPart = createContext<'row' | 'caption' | 'marker'>('row')\n\n/** An event's place among the timeline's events, from 0, which a track reads. */\nconst IndexContext = createContext(-1)\n\n/**\n * Where a track's marker sits, in steps from the first: half way past the\n * current step `after`, on the last step when that is current, and -1 with\n * no current step.\n */\nfunction trackAt(after: number, count: number): number {\n  if (after < 0 || count < 1) return -1\n  return after >= count - 1 ? count - 1 : after + 0.5\n}\n\n/** How far the `draw` spring has carried a track's bar when it is half way, as a share of the role's duration: it covers most of its way early and settles slowly. */\nconst TRACK_ARRIVAL = 0.2\n\n/**\n * How long a track's step waits to change, as a share of the `draw` role's\n * duration, when the bar moves from `from` to `to` (in steps): until the bar\n * reaches it, or going back, leaves it. A step the bar doesn't pass waits for\n * nothing.\n */\nfunction trackWait(step: number, from: number, to: number): number {\n  const low = Math.min(from, to)\n  const high = Math.max(from, to)\n  if (from === to || step <= low || step > high) return 0\n  return (Math.abs(step - from) / (high - low)) * 2 * TRACK_ARRIVAL\n}\n\n/** A track's custom properties: its steps' count, the half step its bar is clear of at each end, and the share of the bar filled. */\nfunction trackStyle(at: number, count: number): CSSProperties {\n  return {\n    '--track-count': Math.max(1, count),\n    '--track-start': 0.5 / Math.max(1, count),\n    '--track-at': count > 1 ? Math.max(0, at) / (count - 1) : 0,\n  } as CSSProperties\n}\n\n/** The children with the fragments among them opened, each with a key that holds across renders. */\nfunction flatChildren(children: ReactNode, prefix = ''): [ReactNode, string][] {\n  return Children.toArray(children).flatMap((child, index): [ReactNode, string][] => {\n    const key = `${prefix}${isValidElement(child) && child.key !== null ? child.key : index}`\n    return isValidElement<{ children?: ReactNode }>(child) && child.type === Fragment\n      ? flatChildren(child.props.children, `${key}/`)\n      : [[child, key]]\n  })\n}\n\n/**\n * `className` is for the list itself, as `<ol>`'s; `containerClassName` for\n * the box around it, which follows the list's height as events come and go.\n * Name it with `aria-label` or `aria-labelledby`. A track reads its steps and\n * its `TimelineProgress` from its children, so they sit straight inside it or\n * in a fragment there.\n */\nfunction Timeline({\n  className,\n  containerClassName,\n  variant = 'default',\n  ref,\n  children,\n  style,\n  ...props\n}: Omit<ComponentProps<typeof TimelinePrimitive>, 'className' | 'children' | 'style'> & {\n  className?: string\n  containerClassName?: string\n  children?: ReactNode\n  style?: CSSProperties\n  /**\n   * `split` puts each event's `TimelineAside` on the other side of a centred\n   * rail, and `track` lays the steps across a bar, with a `TimelineProgress`\n   * marker if it has one. Both fill their parent's width, so they don't sit\n   * in a box that sizes to its content.\n   */\n  variant?: 'default' | 'split' | 'track'\n}) {\n  const { frame, row } = useFlow<HTMLDivElement, HTMLDivElement>(\n    '[data-slot=timeline-item], [data-slot=timeline-progress]',\n  )\n  const listRef = useMemo(() => mergeRefs(row, markMounted, ref), [row, ref])\n  const track = variant === 'track'\n\n  // A track counts its steps, and the marker's place among them, as it\n  // renders, so it is drawn where it belongs from the first paint.\n  let count = 0\n  let current = -1\n  let lastDone = -1\n  let progress: ReactElement<TimelineProgressProps> | null = null\n  const items: ReactNode[] = []\n  for (const [child, key] of flatChildren(children)) {\n    if (isValidElement<TimelineProgressProps>(child) && child.type === TimelineProgress) {\n      progress = child\n      continue\n    }\n    if (\n      !isValidElement<{ status?: TimelineStatus }>(child) ||\n      child.type !== TimelineItem\n    ) {\n      items.push(<Fragment key={key}>{child}</Fragment>)\n      continue\n    }\n    if (child.props.status === 'current') current = count\n    if (child.props.status === 'complete') lastDone = count\n    items.push(\n      <IndexContext key={key} value={count}>\n        {child}\n      </IndexContext>,\n    )\n    count += 1\n  }\n  const marked = track && progress !== null && current >= 0\n  // With no marker, the bar fills to the current step, or the last one done.\n  const at = marked ? trackAt(current, count) : current >= 0 ? current : lastDone\n  // Where the bar last moved from, so each step it passes changes as the bar reaches it.\n  const [move, setMove] = useState({ from: at, to: at })\n  if (move.to !== at) setMove({ from: move.to, to: at })\n  const label = progress?.props.label\n  const trackValue = useMemo<Track>(\n    () => ({\n      waitOf: (index) => trackWait(index, move.from, move.to),\n      current: marked ? current : -1,\n      onLast: at === count - 1,\n      label,\n    }),\n    [move, marked, current, at, count, label],\n  )\n  // Down the page, the marker is a row placed after the current step by\n  // `order`, so no step moves in the page when it moves on, which would cut\n  // the step's own change short; the empty span, put in again each time it\n  // moves, has the flow glide the row and the steps to their new places.\n  // Across, it is drawn on the bar, which is the list's last child.\n  const list = track\n    ? [\n        ...items,\n        // On the last step there is no room between steps for it, so the\n        // step's own mark says where things are, and it comes back as new.\n        marked && at < count - 1 ? (\n          <ProgressPart key='progress-row' value='row'>\n            {progress}\n          </ProgressPart>\n        ) : null,\n        <span key={`moved-${current}`} hidden />,\n        <TrackBar key='track-bar' progress={marked ? progress : null} />,\n      ]\n    : items\n  return (\n    <div\n      ref={frame}\n      data-timeline-frame=''\n      className={cn(\n        // A focused event's ring reaches past the list's edge.\n        'bg-inherit [overflow-clip-margin:0.25rem] overflow-clip transition-[height] duration-(--motion-layout-duration) ease-(--motion-layout-easing) motion-reduce:transition-none',\n        // Split reads its own width, so it fills its parent's: in a flex\n        // box, a container sized by its content would have none.\n        (variant === 'split' || track) && '@container/timeline w-full',\n        containerClassName,\n      )}\n    >\n      <TimelinePrimitive\n        ref={listRef}\n        data-variant={variant}\n        data-marked={marked ? '' : undefined}\n        style={track ? { ...trackStyle(at, count), ...style } : style}\n        className={cn(\n          'group/timeline group/flow relative isolate flex flex-col gap-(--timeline-gap) bg-inherit [--timeline-gap:var(--surface-gap)] [--timeline-marker:var(--control-height-xs)]',\n          // Across, each step takes an equal column, the marker's row above\n          // them. Down, the marker's tile sets the rail's width.\n          track &&\n            '[--timeline-marker:var(--control-height)] @2xl/timeline:grid @2xl/timeline:grid-cols-[repeat(var(--track-count),minmax(0,1fr))] @2xl/timeline:gap-0',\n          className,\n        )}\n        {...props}\n      >\n        <TrackContext value={track ? trackValue : null}>{list}</TrackContext>\n      </TimelinePrimitive>\n    </div>\n  )\n}\n\n/**\n * One event. `status` makes it a step: `complete`, `current`, `upcoming`,\n * `error` or `skipped`, which its marker shows and a screen reader reads before its title\n * (`aria-current='step'` for the current one). Left out, it is an event that\n * happened.\n */\nfunction TimelineItem({\n  className,\n  status,\n  children,\n  ...props\n}: Omit<\n  ComponentProps<typeof TimelineItemPrimitive>,\n  'className' | 'children' | 'status'\n> & {\n  className?: string\n  children?: ReactNode\n  status?: TimelineStatus\n}) {\n  const track = use(TrackContext)\n  const index = use(IndexContext)\n  return (\n    <TimelineItemPrimitive\n      // ui-sdk knows the three steps of a process; an error and a skipped step are ours.\n      status={\n        status === 'complete' || status === 'current' || status === 'upcoming'\n          ? status\n          : undefined\n      }\n      data-status={status}\n      style={\n        track\n          ? ({ '--stop-wait': track.waitOf(index), order: index * 2 } as CSSProperties)\n          : undefined\n      }\n      className={cn(\n        // ui-sdk makes the events one tab stop that the arrow keys move along.\n        'rounded-(--control-radius-sm) focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-hidden',\n        'group/timeline-item group/step relative grid grid-cols-[var(--timeline-marker)_minmax(0,1fr)] content-start gap-x-(--control-padding) bg-inherit @md/timeline:group-data-[variant=split]/timeline:grid-cols-[minmax(0,1fr)_var(--timeline-marker)_minmax(0,1fr)]',\n        // It glides to a new place on `layout` (`followFlow`), fades in on\n        // `enter` once the timeline has painted, and its copy fades on\n        // `exit` (`flowItemClassName`).\n        flowItemClassName,\n        // The last event has no line out of it, not counting the copies of\n        // events that leave.\n        // A current step after another lights once the line reaching it looks\n        // arrived, halfway through `draw` (the step lib's STEP_ARRIVAL).\n        track\n          ? // A step on a track lights as the bar reaches it.\n            'motion-safe:[--step-wait:calc(var(--motion-draw-duration)*var(--stop-wait))]'\n          : 'motion-safe:[[data-slot=timeline-item]~&[data-status=current]]:[--step-wait:calc(var(--motion-draw-duration)*0.5)]',\n        '[--timeline-line:1] [&:not(:has(~[data-slot=timeline-item]:not([data-leaving])))]:[--timeline-line:0]',\n        // Across, its mark sits over its title and time, centred in its column.\n        track &&\n          '@2xl/timeline:row-start-2 @2xl/timeline:flex @2xl/timeline:flex-col @2xl/timeline:items-center @2xl/timeline:gap-(--control-padding) @2xl/timeline:px-(--control-padding) @2xl/timeline:text-center',\n        className,\n      )}\n      {...props}\n    >\n      <StatusContext value={status}>{children}</StatusContext>\n      {/* The marker's caption is hidden from a screen reader, so the step it follows reads it. */}\n      {track && track.current === index && track.label ? (\n        <span className='sr-only'>{track.label}</span>\n      ) : null}\n      {track ? <TrackLine /> : <TimelineLine />}\n    </TimelineItemPrimitive>\n  )\n}\n\n/**\n * The line from an event's marker to the next one's, 4px clear of each. It\n * draws down on `draw` as an event arrives or one is added after it, and\n * fills the same way once its event is complete.\n */\nfunction TimelineLine() {\n  return (\n    <TimelineConnectorPrimitive\n      className={cn(\n        stepLineClassName,\n        'absolute start-[calc(var(--timeline-marker)/2-0.5px)] @md/timeline:group-data-[variant=split]/timeline:start-[calc(50%-0.5px)] top-[calc(var(--timeline-marker)+0.25rem)] -bottom-[calc(var(--timeline-gap)-0.25rem)] w-px origin-top scale-y-(--timeline-line) transition-[scale] duration-(--motion-draw-duration) ease-(--motion-draw-easing) motion-reduce:transition-none group-data-mounted/timeline:starting:scale-y-0',\n      )}\n    >\n      <span\n        className={cn(\n          stepLineFillClassName,\n          'origin-top scale-y-0 group-data-[status=complete]/timeline-item:scale-y-100',\n        )}\n      />\n    </TimelineConnectorPrimitive>\n  )\n}\n\n/** A track's bar, thick and rounded, under the step marks, which cut it with the colour of the page. */\nconst trackBarClassName =\n  'bg-foreground/8 dark:bg-foreground/12 rounded-full forced-colors:bg-[GrayText]!'\n\n/**\n * A track's bar from a step down to the next, below 42rem: from the middle of\n * its mark to the middle of the next, filled once the step is behind the\n * marker, or done when there is no marker. Across, the bar is `TrackBar`.\n */\nfunction TrackLine() {\n  return (\n    <span\n      aria-hidden\n      className={cn(\n        trackBarClassName,\n        'absolute start-[calc(var(--timeline-marker)/2)] top-[calc(var(--timeline-marker)/2)] -bottom-[calc(var(--timeline-gap)+var(--timeline-marker)/2)] w-1.5 origin-top -translate-x-1/2 scale-y-(--timeline-line) overflow-clip rounded-none transition-[scale] duration-(--motion-draw-duration) ease-(--motion-draw-easing) motion-reduce:transition-none rtl:translate-x-1/2 @2xl/timeline:hidden',\n      )}\n    >\n      <span\n        className={cn(\n          stepLineFillClassName,\n          'origin-top scale-y-0 group-data-[status=complete]/timeline-item:scale-y-100 group-data-marked/timeline:group-data-[status=current]/timeline-item:scale-y-100',\n        )}\n      />\n    </span>\n  )\n}\n\n/**\n * A track's bar across, from the first step's middle to the last's, filled up\n * to the marker, or to the current step with no marker, with the marker and\n * its caption when the track has a `TimelineProgress`. Hidden below 42rem,\n * where each step draws its own piece (`TrackLine`).\n */\nfunction TrackBar({ progress }: { progress: ReactNode }) {\n  return (\n    <div\n      aria-hidden\n      className='col-span-full row-start-1 mx-[calc(var(--track-start)*100%)] hidden @2xl/timeline:block'\n    >\n      {progress ? <ProgressPart value='caption'>{progress}</ProgressPart> : null}\n      {/* No height of its own: the bar sits behind the steps' marks in the row below. */}\n      <div className='relative'>\n        <span\n          className={cn(\n            trackBarClassName,\n            'absolute inset-x-0 top-[calc(var(--timeline-marker)/2)] -z-10 h-1.5 -translate-y-1/2',\n          )}\n        />\n        {/* Below the steps even while they glide, when each is a layer of its own. */}\n        <span className='bg-primary absolute inset-x-0 top-[calc(var(--timeline-marker)/2)] -z-10 h-1.5 -translate-y-1/2 rounded-full [clip-path:inset(0_calc((1-var(--track-at))*100%)_0_0_round_9999px)] transition-[clip-path] duration-(--motion-draw-duration) ease-(--motion-draw-easing) motion-reduce:transition-none rtl:[clip-path:inset(0_0_0_calc((1-var(--track-at))*100%)_round_9999px)] forced-colors:bg-[Highlight]' />\n        {progress ? <ProgressPart value='marker'>{progress}</ProgressPart> : null}\n      </div>\n    </div>\n  )\n}\n\n/** The marker's travel along the bar across, as a share of its width. */\nconst trackTravelClassName =\n  'translate-x-[calc(var(--track-at)*100%)] transition-[translate] duration-(--motion-draw-duration) ease-(--motion-draw-easing) motion-reduce:transition-none rtl:-translate-x-[calc(var(--track-at)*100%)]'\n\ninterface TimelineProgressProps {\n  /** What last happened: above the marker across, beside it down the page, and read with the current step. */\n  label?: ReactNode\n  /** The marker, such as a solid Icon tile. */\n  children: ReactNode\n  /** On the marker's row down the page, and on its caption across. */\n  className?: string\n}\n\n/**\n * A track's marker, anywhere among its steps: half way along the bar out of\n * the `current` step, or on it when it is the last, the bar filled up to it.\n * The steps behind it read as done, the current one included. The timeline\n * draws it twice, as a row down the page and on the bar across it, which\n * both hide from a screen reader: the current step says where things are,\n * and reads the label.\n */\nfunction TimelineProgress({ label, children, className }: TimelineProgressProps) {\n  const track = use(TrackContext)\n  const part = use(ProgressPart)\n  if (!track) return null\n  if (part === 'row')\n    return (\n      <div\n        aria-hidden\n        data-slot='timeline-progress'\n        style={{ order: track.current * 2 + 1 }}\n        className={cn(\n          'relative grid grid-cols-[var(--timeline-marker)_minmax(0,1fr)] items-center gap-x-(--control-padding) @2xl/timeline:hidden',\n          flowItemClassName,\n          className,\n        )}\n      >\n        <span\n          className={cn(\n            trackBarClassName,\n            'absolute start-[calc(var(--timeline-marker)/2)] top-1/2 -bottom-[calc(var(--timeline-gap)+var(--timeline-marker)/2)] w-1.5 -translate-x-1/2 rounded-none rtl:translate-x-1/2',\n          )}\n        />\n        <span className='relative flex justify-center'>{children}</span>\n        <span className='text-xs font-medium'>{label}</span>\n      </div>\n    )\n  if (part === 'caption')\n    return (\n      <div className={cn('flex pb-(--control-padding)', trackTravelClassName)}>\n        <span\n          className={cn(\n            'flex w-max max-w-48 -translate-x-1/2 justify-center text-center text-xs font-medium text-balance transition-opacity duration-(--motion-enter-duration) ease-(--motion-enter-fade-easing) rtl:translate-x-1/2',\n            (track.onLast || !label) &&\n              'opacity-0 duration-(--motion-exit-duration) ease-(--motion-exit-fade-easing)',\n            className,\n          )}\n        >\n          {/* A space keeps the row's height while there is nothing to say. */}\n          {label || ' '}\n        </span>\n      </div>\n    )\n  // The marker travels the bar's whole width with the fill, over the steps' marks in the row below.\n  return (\n    <span\n      className={cn(\n        'absolute inset-x-0 top-[calc(var(--timeline-marker)/2)] z-20 h-0',\n        trackTravelClassName,\n      )}\n    >\n      <span className='absolute start-0 top-0 -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2'>\n        {children}\n      </span>\n    </span>\n  )\n}\n\n/**\n * The event's mark on the rail: an icon or an avatar given as its children, in\n * an Icon tile the rail's width coloured by its status, or with no children\n * the step's own mark, a small dot until its status gives it a glyph. A new icon, such as a step's\n * spinner becoming a tick, crossfades in place (`Swap`). Decorative: the title says what\n * happened.\n */\nfunction TimelineMarker({\n  className,\n  children,\n  ...props\n}: Omit<ComponentProps<typeof TimelineMarkerPrimitive>, 'className' | 'children'> & {\n  className?: string\n  children?: ReactNode\n}) {\n  const plain = children === undefined || children === null || children === false\n  const status = use(StatusContext)\n  const track = use(TrackContext)\n  // Behind a track's marker, the current step is done too.\n  const shown = status === 'current' && track && track.current >= 0 ? 'complete' : status\n  const entrance = 'motion-safe:group-data-mounted/timeline:starting:scale-95'\n  return (\n    <TimelineMarkerPrimitive\n      className={cn(\n        'relative z-10 col-start-1 row-start-1 flex size-(--timeline-marker) items-center justify-center @md/timeline:group-data-[variant=split]/timeline:col-start-2',\n        className,\n      )}\n      {...props}\n    >\n      {track ? (\n        // On a track its tint sits on the colour of the page, over the bar.\n        <span\n          data-status={shown}\n          className={cn(\n            'group/step bg-background ring-background flex @2xl/timeline:ring-4 forced-colors:ring-[Canvas]',\n            iconTileShapeClassName,\n            '[--icon-tile-size:var(--control-height-xs)]',\n          )}\n        >\n          <StepMark status={shown} className={entrance}>\n            {plain ? (\n              <span className='size-1.5 rounded-full bg-current forced-colors:bg-[CanvasText]' />\n            ) : (\n              children\n            )}\n          </StepMark>\n        </span>\n      ) : plain ? (\n        <StepMark status={status} className={entrance}>\n          <span className='size-1.5 rounded-full bg-current forced-colors:bg-[CanvasText]' />\n        </StepMark>\n      ) : (\n        <IconTile\n          {...stepTileLook[status ?? 'none']}\n          size='xs'\n          className={cn(\n            stepMarkerTransition,\n            // An avatar, the rail's width as the tile is, keeps its round shape.\n            'has-data-[slot=avatar]:rounded-full',\n            entrance,\n          )}\n        >\n          <Swap>{children}</Swap>\n        </IconTile>\n      )}\n    </TimelineMarkerPrimitive>\n  )\n}\n\n/** What happened: the header, then any details, a quote or a card. */\nfunction TimelineContent({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'div'>, 'className'> & { className?: string }) {\n  return renderElement(\n    'div',\n    mergeProps(\n      {\n        'data-slot': 'timeline-content',\n        className: cn(\n          'col-start-2 flex min-w-0 flex-col gap-1 [[data-slot=timeline-item]:has(>[data-slot=timeline-aside])>&]:row-start-2 @md/timeline:group-data-[variant=split]/timeline:col-start-3 @md/timeline:group-data-[variant=split]/timeline:row-start-1!',\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\n/** The title and the time on one line, its first line level with the marker; the time wraps under a long title. */\nfunction TimelineHeader({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'div'>, 'className'> & { className?: string }) {\n  const track = use(TrackContext)\n  return renderElement(\n    'div',\n    mergeProps(\n      {\n        'data-slot': 'timeline-header',\n        className: cn(\n          'flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 py-[calc((var(--timeline-marker)-1.25rem)/2)]',\n          // Across a track, the time sits under the title.\n          track &&\n            '@2xl/timeline:flex-col @2xl/timeline:items-center @2xl/timeline:gap-0.5 @2xl/timeline:py-0',\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\n/** Muted while upcoming, destructive on an error, and struck through when skipped. A long unbroken word breaks rather than run out of the box. */\nfunction TimelineTitle({\n  className,\n  children,\n  ...props\n}: Omit<ComponentProps<typeof TimelineTitlePrimitive>, 'className' | 'children'> & {\n  className?: string\n  children?: ReactNode\n}) {\n  const status = use(StatusContext)\n  const said = status && stepStatusText[status]\n  return (\n    <TimelineTitlePrimitive\n      className={cn(\n        'min-w-0 text-sm leading-5 font-medium wrap-anywhere group-data-[status=error]/timeline-item:text-destructive group-data-[status=skipped]/timeline-item:text-muted-foreground group-data-[status=skipped]/timeline-item:line-through group-data-[status=upcoming]/timeline-item:text-muted-foreground',\n        className,\n      )}\n      {...props}\n    >\n      {/* ui-sdk names the event by its title, so the step's status is read in it. */}\n      {said ? <span className='sr-only'>{`${said}, `}</span> : null}\n      {children}\n    </TimelineTitlePrimitive>\n  )\n}\n\n/**\n * What sits on the rail's other side in the `split` variant, level with the\n * title and against the rail: a date, a version, a quarter. Elsewhere it\n * sits above the title, beside the marker.\n */\nfunction TimelineAside({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'div'>, 'className'> & { className?: string }) {\n  return renderElement(\n    'div',\n    mergeProps(\n      {\n        'data-slot': 'timeline-aside',\n        className: cn(\n          'text-muted-foreground col-start-2 row-start-1 flex min-w-0 flex-col *:max-w-full [&_[data-slot=timeline-time]]:whitespace-normal py-[calc((var(--timeline-marker)-1.25rem)/2)] text-sm leading-5 wrap-anywhere tabular-nums @md/timeline:group-data-[variant=split]/timeline:col-start-1 @md/timeline:group-data-[variant=split]/timeline:items-end @md/timeline:group-data-[variant=split]/timeline:text-end',\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\n/** When it happened, as a `<time>`: give `dateTime` the machine-readable date. */\nfunction TimelineTime({\n  className,\n  ...props\n}: Omit<ComponentProps<typeof TimelineTimePrimitive>, 'className'> & {\n  className?: string\n}) {\n  return (\n    <TimelineTimePrimitive\n      className={cn(\n        'text-muted-foreground shrink-0 text-xs leading-5 whitespace-nowrap tabular-nums',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TimelineDescription({\n  className,\n  ...props\n}: Omit<ComponentProps<typeof TimelineDescriptionPrimitive>, 'className'> & {\n  className?: string\n}) {\n  return (\n    <TimelineDescriptionPrimitive\n      className={cn(\n        'text-muted-foreground text-sm text-pretty wrap-anywhere *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Timeline,\n  TimelineAside,\n  TimelineContent,\n  TimelineDescription,\n  TimelineHeader,\n  TimelineItem,\n  TimelineMarker,\n  TimelineProgress,\n  TimelineTime,\n  TimelineTitle,\n}\nexport { trackAt, trackWait }\nexport type { TimelineStatus }\n",
      "type": "registry:component",
      "target": "@components/kino/timeline.tsx"
    }
  ],
  "type": "registry:component"
}