{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "task-tree",
  "type": "registry:ui",
  "title": "Task Tree",
  "description": "A live list of tasks drawn as a tree, with a status mark on each.",
  "categories": [
    "ai-&-chat"
  ],
  "dependencies": [
    "@hugeicons/core-free-icons@4.4.0",
    "@hugeicons/react@1.1.10",
    "@xyflow/react@13.0.3"
  ],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json",
    "https://sprout.tulipfarm.ai/r/button.json",
    "https://sprout.tulipfarm.ai/r/status.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/task-tree.tsx",
      "type": "registry:ui",
      "target": "components/ui/task-tree.tsx",
      "content": "'use client';\n\nimport {\n  Handle,\n  Position,\n  ReactFlow,\n  useNodesInitialized,\n  type Edge,\n  type EdgeProps,\n  type Node,\n  type NodeProps,\n} from '@xyflow/react';\nimport {\n  useCallback,\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useRef,\n  useState,\n  type ComponentProps,\n  type ReactNode,\n  type RefObject,\n} from 'react';\nimport { cn } from '@/lib/sprout/classes';\nimport { motion } from '@/lib/sprout/flow';\nimport { Status, type StatusState } from '@/components/ui/status';\n\nexport interface TaskTreeTask {\n  id: string;\n  title: ReactNode;\n  state?: StatusState | undefined;\n  value?: number | null | undefined;\n  detail?: ReactNode;\n  children?: readonly TaskTreeTask[] | undefined;\n}\n\nexport interface TaskTreeProps extends Omit<ComponentProps<'section'>, 'title' | 'children'> {\n  tasks: readonly TaskTreeTask[];\n  title?: ReactNode;\n  summary?: ReactNode;\n  empty?: ReactNode;\n}\n\ninterface Mark {\n  state: StatusState;\n  value: number | null | undefined;\n  done: number;\n  leaves: number;\n}\n\nconst finished = new Set<StatusState>(['success', 'warning', 'skipped']);\n\nfunction rollUp(parts: Mark[]): StatusState {\n  const has = (state: StatusState) => parts.some(part => part.state === state);\n  if (has('error')) return 'error';\n  if (has('running')) return 'running';\n  if (has('paused')) return 'paused';\n  if (parts.every(part => part.state === 'pending')) return 'pending';\n  if (parts.every(part => finished.has(part.state)))\n    return parts.every(part => part.state === 'skipped') ? 'skipped' : has('warning') ? 'warning' : 'success';\n  if (has('stopped')) return 'stopped';\n  return 'running';\n}\n\nfunction measure(tasks: readonly TaskTreeTask[], marks = new Map<string, Mark>()) {\n  for (const task of tasks) {\n    const children = task.children ?? [];\n    if (children.length === 0) {\n      const state = task.state ?? 'pending';\n      marks.set(task.id, { state, value: task.value, done: finished.has(state) ? 1 : 0, leaves: 1 });\n      continue;\n    }\n    measure(children, marks);\n    const parts = children.map(child => marks.get(child.id)!);\n    const done = parts.reduce((sum, part) => sum + part.done, 0);\n    const leaves = parts.reduce((sum, part) => sum + part.leaves, 0);\n    const state = task.state ?? rollUp(parts);\n    const value = task.state ? task.value : state === 'running' ? (done / leaves) * 100 : undefined;\n    marks.set(task.id, { state, value, done, leaves });\n  }\n  return marks;\n}\n\nconst rowHeight = 32;\nconst indent = 24;\nconst markCenter = 8;\nconst markTop = 8;\nconst markBottom = 24;\nconst gap = 2;\nconst radius = 6;\n\ntype TaskNodeData = {\n  task: TaskTreeTask;\n  mark: Mark;\n  width: number;\n  entering: boolean;\n  hops: number;\n};\ntype TaskNode = Node<TaskNodeData, 'task'>;\ntype TaskEdge = Edge<{ path: string; hops: number; doneAt: number | null }, 'task'>;\n\nfunction chainPath(from: TaskNode, to: TaskNode) {\n  const x = from.position.x + markCenter;\n  return `M ${x} ${from.position.y + markBottom + gap} V ${to.position.y + markTop - gap}`;\n}\n\nfunction branchPath(from: TaskNode, to: TaskNode) {\n  const x = from.position.x + markCenter;\n  const y = to.position.y + markTop + markCenter;\n  return `M ${x} ${from.position.y + markBottom + gap} V ${y - radius} Q ${x} ${y} ${x + radius} ${y} H ${to.position.x - gap - 1}`;\n}\n\nconst lineTravel = 280;\nconst rowEnter = 220;\n\nfunction hopsOf(task: TaskTreeTask): number {\n  const children = task.children ?? [];\n  if (task.state || children.length === 0) return 0;\n  return 1 + Math.max(...children.map(hopsOf));\n}\n\ninterface History {\n  primed: boolean;\n  doneAt: Map<string, number>;\n  addedAt: Map<string, number>;\n}\n\nfunction place(tasks: readonly TaskTreeTask[], marks: Map<string, Mark>, width: number, history: History) {\n  const { primed, doneAt, addedAt } = history;\n  const now = typeof performance === 'undefined' ? 0 : performance.now();\n  const nodes: TaskNode[] = [];\n  const edges: TaskEdge[] = [];\n  const visit = (task: TaskTreeTask, column: number, parent?: TaskNode, chain?: boolean) => {\n    const children = task.children ?? [];\n    const mark = marks.get(task.id)!;\n    const x = column * indent;\n    if (!addedAt.has(task.id)) addedAt.set(task.id, primed ? now : -Infinity);\n    const node: TaskNode = {\n      id: task.id,\n      type: 'task',\n      position: { x, y: nodes.length * rowHeight },\n      width: Math.max(0, width - x),\n      height: rowHeight,\n      data: {\n        task,\n        mark,\n        width: Math.max(0, width - x),\n        entering: now - addedAt.get(task.id)! < rowEnter,\n        hops: hopsOf(task),\n      },\n    };\n    nodes.push(node);\n    if (parent) {\n      const id = `${parent.id}->${task.id}`;\n      if (mark.state !== 'success') doneAt.delete(id);\n      else if (!doneAt.has(id)) doneAt.set(id, primed ? now : -Infinity);\n      edges.push({\n        id,\n        type: 'task',\n        source: parent.id,\n        target: task.id,\n        zIndex: doneAt.has(id) ? 1 : 0,\n        data: {\n          path: chain ? chainPath(parent, node) : branchPath(parent, node),\n          hops: node.data.hops,\n          doneAt: doneAt.get(id) ?? null,\n        },\n      });\n    }\n    if (children.length === 1) visit(children[0]!, column, node, true);\n    else for (const child of children) visit(child, column + 1, node, false);\n  };\n  for (const task of tasks) visit(task, 0);\n  return { nodes, edges };\n}\n\nfunction useArrival(mark: Mark, hops: number) {\n  const [shown, setShown] = useState(mark);\n  const timers = useRef(new Set<ReturnType<typeof setTimeout>>());\n  const lastDone = useRef(mark.done);\n  const key = `${mark.state}:${mark.value ?? ''}:${mark.done}`;\n  useEffect(() => {\n    const arrived = mark.done > lastDone.current;\n    lastDone.current = mark.done;\n    const delay = arrived ? motion(hops * lineTravel) : 0;\n    if (delay === 0) {\n      timers.current.forEach(clearTimeout);\n      timers.current.clear();\n      setShown(mark);\n      return;\n    }\n    const timer = setTimeout(() => {\n      timers.current.delete(timer);\n      setShown(mark);\n    }, delay);\n    timers.current.add(timer);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [key, hops]);\n  useEffect(() => {\n    const pending = timers.current;\n    return () => pending.forEach(clearTimeout);\n  }, []);\n  return hops === 0 ? mark : shown;\n}\n\nfunction RowBody({ task, mark }: { task: TaskTreeTask; mark: Mark }) {\n  return (\n    <>\n      <Status state={mark.state} value={mark.value} aria-hidden=\"true\" className=\"sprout-task-tree-status\" />\n      <span className=\"sprout-task-tree-title\">{task.title}</span>\n      {task.detail != null && <span className=\"sprout-task-tree-detail\">{task.detail}</span>}\n    </>\n  );\n}\n\nfunction TaskRow({ data }: NodeProps<TaskNode>) {\n  const { task, width, hops, entering } = data;\n  const mark = useArrival(data.mark, hops);\n  return (\n    <div\n      className=\"sprout-task-tree-row\"\n      data-state={mark.state}\n      {...(entering ? { 'data-entering': '' } : {})}\n      style={{ width }}\n    >\n      <Handle type=\"target\" position={Position.Top} isConnectable={false} className=\"sprout-task-tree-handle\" />\n      <RowBody task={task} mark={mark} />\n      <Handle type=\"source\" position={Position.Bottom} isConnectable={false} className=\"sprout-task-tree-handle\" />\n    </div>\n  );\n}\n\nfunction TaskLink({ data }: EdgeProps<TaskEdge>) {\n  const { path, hops, doneAt } = data!;\n  const done = useRef<SVGPathElement>(null);\n  useLayoutEffect(() => {\n    const element = done.current;\n    if (!element || doneAt === null || typeof element.animate !== 'function') return;\n    const duration = motion(lineTravel);\n    const delay = hops * lineTravel - (performance.now() - doneAt);\n    if (duration === 0 || delay + duration <= 0) return;\n    const animation = element.animate([{ strokeDashoffset: -1 }, { strokeDashoffset: 0 }], {\n      duration,\n      delay,\n      easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n      fill: 'backwards',\n    });\n    return () => animation.cancel();\n  }, [doneAt, hops]);\n  return (\n    <g className=\"sprout-task-tree-link\">\n      <path className=\"sprout-task-tree-path\" d={path} />\n      {doneAt !== null && <path ref={done} className=\"sprout-task-tree-path-done\" d={path} pathLength={1} />}\n    </g>\n  );\n}\n\nfunction Sketch({ nodes, edges }: { nodes: TaskNode[]; edges: TaskEdge[] }) {\n  return (\n    <div className=\"sprout-task-tree-sketch\">\n      <svg className=\"sprout-task-tree-sketch-lines\" focusable=\"false\">\n        {edges.map(edge => (\n          <g key={edge.id}>\n            <path className=\"sprout-task-tree-path\" d={edge.data!.path} />\n            {edge.data!.doneAt !== null && <path className=\"sprout-task-tree-path-done\" d={edge.data!.path} />}\n          </g>\n        ))}\n      </svg>\n      {nodes.map(node => (\n        <div\n          key={node.id}\n          className=\"sprout-task-tree-row\"\n          data-state={node.data.mark.state}\n          style={{ left: node.position.x, top: node.position.y }}\n        >\n          <RowBody task={node.data.task} mark={node.data.mark} />\n        </div>\n      ))}\n    </div>\n  );\n}\n\nfunction OnDrawn({\n  root,\n  lines,\n  onDrawn,\n}: {\n  root: RefObject<HTMLDivElement | null>;\n  lines: number;\n  onDrawn: () => void;\n}) {\n  const initialized = useNodesInitialized({ includeHiddenNodes: true });\n  useEffect(() => {\n    if (!initialized) return;\n    let frame = 0;\n    const check = () => {\n      frame = requestAnimationFrame(() =>\n        (root.current?.querySelectorAll('.sprout-task-tree-link').length ?? 0) >= lines ? onDrawn() : check(),\n      );\n    };\n    check();\n    return () => cancelAnimationFrame(frame);\n  }, [initialized, root, lines, onDrawn]);\n  return null;\n}\n\nconst nodeTypes = { task: TaskRow };\nconst edgeTypes = { task: TaskLink };\n\nfunction Outline({ tasks, marks }: { tasks: readonly TaskTreeTask[]; marks: Map<string, Mark> }) {\n  return (\n    <ul className=\"sprout-task-tree-list\">\n      {tasks.map(task => {\n        const mark = marks.get(task.id)!;\n        return (\n          <li key={task.id} data-slot=\"task-tree-item\" data-state={mark.state} className=\"sprout-task-tree-item\">\n            <span className=\"sprout-task-tree-item-row\">\n              <Status state={mark.state} value={mark.value} size=\"sm\" />\n              <span className=\"sprout-task-tree-item-title\">{task.title}</span>\n              {task.detail != null && <span className=\"sprout-task-tree-detail\">{task.detail}</span>}\n            </span>\n            {task.children && task.children.length > 0 && <Outline tasks={task.children} marks={marks} />}\n          </li>\n        );\n      })}\n    </ul>\n  );\n}\n\nexport function TaskTree({ tasks, title = 'Tasks', summary, empty, className, ...rest }: TaskTreeProps) {\n  const headingId = useId();\n  const history = useRef<History>({ primed: false, doneAt: new Map(), addedAt: new Map() });\n  const root = useRef<HTMLElement>(null);\n  const flow = useRef<HTMLDivElement>(null);\n  const [width, setWidth] = useState(0);\n  const [drawn, setDrawn] = useState(false);\n  const marks = measure(tasks);\n  const total = tasks.reduce((sum, task) => sum + marks.get(task.id)!.leaves, 0);\n  const done = tasks.reduce((sum, task) => sum + marks.get(task.id)!.done, 0);\n  const count = summary === undefined ? `${done} of ${total} done` : summary;\n  const { nodes, edges } = place(tasks, marks, width, history.current);\n\n  useEffect(() => {\n    history.current.primed = true;\n  }, []);\n\n  useLayoutEffect(() => {\n    const element = root.current;\n    if (!element) return;\n    setWidth(Math.floor(element.getBoundingClientRect().width));\n    const observer = new ResizeObserver(([entry]) => setWidth(Math.floor(entry!.contentRect.width)));\n    observer.observe(element);\n    return () => observer.disconnect();\n  }, []);\n\n  const showFlow = useCallback(() => {\n    for (const animation of flow.current?.getAnimations({ subtree: true }) ?? [])\n      if (animation.effect?.getTiming().iterations !== Infinity) animation.finish();\n    setDrawn(true);\n  }, []);\n  return (\n    <section\n      data-slot=\"task-tree\"\n      aria-labelledby={headingId}\n      className={cn('sprout-task-tree', className)}\n      {...rest}\n      ref={root}\n    >\n      <header className=\"sprout-task-tree-header\">\n        <h3 id={headingId} className=\"sprout-task-tree-heading\">\n          {title}\n        </h3>\n        {count != null && total > 0 && (\n          <span className=\"sprout-task-tree-summary\" aria-live=\"polite\">\n            {count}\n          </span>\n        )}\n      </header>\n      {total > 0 ? (\n        <>\n          <div className=\"sprout-task-tree-outline\">\n            <Outline tasks={tasks} marks={marks} />\n          </div>\n          <div className=\"sprout-task-tree-stage\" aria-hidden=\"true\" style={{ height: nodes.length * rowHeight }}>\n            {!drawn && <Sketch nodes={nodes} edges={edges} />}\n            {width > 0 && (\n              <div ref={flow} className=\"sprout-task-tree-flow\" {...(drawn ? { 'data-drawn': '' } : {})}>\n                <ReactFlow\n                  className=\"sprout-task-tree-canvas\"\n                  nodes={nodes}\n                  edges={edges}\n                  nodeTypes={nodeTypes}\n                  edgeTypes={edgeTypes}\n                  defaultViewport={{ x: 0, y: 0, zoom: 1 }}\n                  minZoom={1}\n                  maxZoom={1}\n                  panOnDrag={false}\n                  panOnScroll={false}\n                  zoomOnScroll={false}\n                  zoomOnPinch={false}\n                  zoomOnDoubleClick={false}\n                  preventScrolling={false}\n                  nodesDraggable={false}\n                  nodesConnectable={false}\n                  nodesFocusable={false}\n                  edgesFocusable={false}\n                  elementsSelectable={false}\n                  proOptions={{ hideAttribution: true }}\n                >\n                  {!drawn && <OnDrawn root={flow} lines={edges.length} onDrawn={showFlow} />}\n                </ReactFlow>\n              </div>\n            )}\n          </div>\n        </>\n      ) : (\n        <p className=\"sprout-task-tree-empty\">{empty ?? 'No tasks yet.'}</p>\n      )}\n    </section>\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/add-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/add-icon.tsx",
      "content": "import { Add01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const AddIcon = /* @__PURE__ */ createIcon(glyph, 'AddIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/create-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/create-icon.tsx",
      "content": "import { HugeiconsIcon, type IconSvgElement } from '@hugeicons/react';\nimport type { ReactElement, Ref, SVGProps } from 'react';\n\nexport const iconSizes = {\n  xs: 12,\n  sm: 14,\n  md: 16,\n  lg: 18,\n  xl: 20,\n  '2xl': 24,\n} as const;\n\nexport type IconSize = keyof typeof iconSizes;\n\nexport const iconStrokeWidth = 1.5;\n\nexport type IconProps = Omit<SVGProps<SVGSVGElement>, 'ref'> & {\n  size?: IconSize | number;\n  ref?: Ref<SVGSVGElement>;\n};\n\nexport type IconComponent = (props: IconProps) => ReactElement;\n\nexport function createIcon(glyph: IconSvgElement, name: string): IconComponent {\n  const Icon = ({ size = '2xl', strokeWidth = iconStrokeWidth, ...props }: IconProps) => (\n    <HugeiconsIcon\n      icon={glyph}\n      size={typeof size === 'number' ? size : iconSizes[size]}\n      strokeWidth={Number(strokeWidth)}\n      {...props}\n    />\n  );\n  Icon.displayName = name;\n  return Icon;\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/minus-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/minus-icon.tsx",
      "content": "import { MinusSignIcon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const MinusIcon = /* @__PURE__ */ createIcon(glyph, 'MinusIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/scan-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/scan-icon.tsx",
      "content": "import { ScanIcon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ScanIcon = /* @__PURE__ */ createIcon(glyph, 'ScanIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/flow.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/flow.tsx",
      "content": "'use client';\n\nimport {\n  Panel,\n  useNodesStore,\n  useReactFlow,\n  useViewportStore,\n  type FitViewOptions,\n  type Node,\n  type NodesStore,\n} from '@xyflow/react';\nimport { useEffect, useSyncExternalStore, type KeyboardEvent } from 'react';\nimport { AddIcon } from '@/lib/sprout/icons/add-icon';\nimport { MinusIcon } from '@/lib/sprout/icons/minus-icon';\nimport { ScanIcon } from '@/lib/sprout/icons/scan-icon';\nimport { Button } from '@/components/ui/button';\n\nexport const flowMinZoom = 0.2;\nexport const flowMaxZoom = 1.5;\nconst panStep = 48;\n\nconst mobileQuery = '(max-width: 767px)';\nconst motionQuery = '(prefers-reduced-motion: reduce)';\n\nfunction subscribeMobile(callback: () => void) {\n  const media = window.matchMedia(mobileQuery);\n  media.addEventListener('change', callback);\n  return () => media.removeEventListener('change', callback);\n}\n\nexport function useViewportMobile() {\n  return useSyncExternalStore(\n    subscribeMobile,\n    () => window.matchMedia(mobileQuery).matches,\n    () => false,\n  );\n}\n\nexport const motion = (ms: number) =>\n  typeof window !== 'undefined' && window.matchMedia(motionQuery).matches ? 0 : ms;\n\nfunction nodesMeasured(state: NodesStore) {\n  if (state.nodeLookup.size === 0) return false;\n  for (const node of state.nodeLookup.values()) {\n    if (node.hidden) continue;\n    if (!node.measured.width || !node.measured.height || !node.internals.handleBounds) return false;\n  }\n  return true;\n}\n\nexport function FitOnResize({ nodes, fit }: { nodes: readonly Node[]; fit: FitViewOptions }) {\n  const { fitView } = useReactFlow();\n  const width = useViewportStore(state => state.width);\n  const height = useViewportStore(state => state.height);\n  const measured = useNodesStore(nodesMeasured);\n  useEffect(() => {\n    if (!measured) return;\n    const frame = requestAnimationFrame(() => void fitView(fit));\n    return () => cancelAnimationFrame(frame);\n  }, [fitView, fit, width, height, measured, nodes]);\n  return null;\n}\n\nexport function ZoomControls({\n  position,\n  fit,\n  className,\n  slot,\n}: {\n  position: 'top-right' | 'bottom-right';\n  fit: FitViewOptions;\n  className: string;\n  slot: string;\n}) {\n  const { zoomIn, zoomOut, fitView } = useReactFlow();\n  const zoom = useViewportStore(state => state.transform[2]);\n  return (\n    <Panel\n      position={position}\n      className={className}\n      data-slot={slot}\n      role=\"toolbar\"\n      aria-label=\"Diagram view\"\n      aria-orientation=\"vertical\"\n    >\n      <Button\n        variant=\"ghost\"\n        size=\"icon-sm\"\n        aria-label=\"Zoom in\"\n        title=\"Zoom in\"\n        disabled={zoom >= flowMaxZoom}\n        onClick={() => void zoomIn({ duration: motion(160) })}\n      >\n        <AddIcon size=\"md\" aria-hidden=\"true\" />\n      </Button>\n      <Button\n        variant=\"ghost\"\n        size=\"icon-sm\"\n        aria-label=\"Zoom out\"\n        title=\"Zoom out\"\n        disabled={zoom <= flowMinZoom}\n        onClick={() => void zoomOut({ duration: motion(160) })}\n      >\n        <MinusIcon size=\"md\" aria-hidden=\"true\" />\n      </Button>\n      <Button\n        variant=\"ghost\"\n        size=\"icon-sm\"\n        aria-label=\"Fit to view\"\n        title=\"Fit to view\"\n        onClick={() => void fitView({ ...fit, duration: motion(180) })}\n      >\n        <ScanIcon size=\"md\" aria-hidden=\"true\" />\n      </Button>\n    </Panel>\n  );\n}\n\nexport function useKeyboardView(fit: FitViewOptions) {\n  const { getViewport, setViewport, zoomIn, zoomOut, fitView } = useReactFlow();\n  return (event: KeyboardEvent<HTMLDivElement>) => {\n    const target = event.target as HTMLElement;\n    if (event.altKey || event.ctrlKey || event.metaKey) return;\n    if (target !== event.currentTarget && !target.classList.contains('react-flow__node')) return;\n    const step = panStep * (event.shiftKey ? 4 : 1);\n    const pan: Record<string, [number, number]> = {\n      ArrowLeft: [step, 0],\n      ArrowRight: [-step, 0],\n      ArrowUp: [0, step],\n      ArrowDown: [0, -step],\n    };\n    const move = pan[event.key];\n    if (move) {\n      const { x, y, zoom } = getViewport();\n      void setViewport({ x: x + move[0], y: y + move[1], zoom }, { duration: motion(120) });\n    } else if (event.key === '+' || event.key === '=') {\n      void zoomIn({ duration: motion(160) });\n    } else if (event.key === '-' || event.key === '_') {\n      void zoomOut({ duration: motion(160) });\n    } else if (event.key === '0') {\n      void fitView({ ...fit, duration: motion(180) });\n    } else return;\n    event.preventDefault();\n  };\n}\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-task-tree": {
        "min-width": "0",
        "color": "var(--sprout-text)",
        "font-family": "var(--sprout-font)",
        "flex-direction": "column",
        "gap": "8px",
        "display": "flex"
      },
      ".sprout-task-tree-header": {
        "justify-content": "space-between",
        "align-items": "baseline",
        "gap": "12px",
        "min-width": "0",
        "display": "flex"
      },
      ".sprout-task-tree-heading": {
        "min-width": "0",
        "font-size": "var(--sprout-text-sm)",
        "overflow-wrap": "anywhere",
        "margin": "0",
        "font-weight": "500",
        "line-height": "1.25rem"
      },
      ".sprout-task-tree-summary, .sprout-task-tree-detail": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-sm)",
        "font-variant-numeric": "tabular-nums",
        "white-space": "nowrap",
        "flex-shrink": "0",
        "line-height": "1.25rem"
      },
      ".sprout-task-tree-empty": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-sm)",
        "margin": "0",
        "line-height": "1.25rem"
      },
      ".sprout-task-tree-outline": {
        "clip-path": "inset(50%)",
        "white-space": "nowrap",
        "width": "1px",
        "height": "1px",
        "position": "absolute",
        "overflow": "hidden"
      },
      ".sprout-task-tree-list": {
        "margin": "0",
        "padding": "0",
        "list-style": "none"
      },
      ".sprout-task-tree-stage": {
        "--sprout-task-tree-line": "color-mix(in oklab, var(--sprout-muted) 40%, var(--sprout-surface))",
        "--sprout-task-tree-line-done": "var(--sprout-success)",
        "width": "100%",
        "position": "relative",
        "overflow": "hidden"
      },
      ".sprout-task-tree-sketch, .sprout-task-tree-flow": {
        "direction": "ltr",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-task-tree-sketch-lines": {
        "width": "100%",
        "height": "100%",
        "position": "absolute",
        "inset": "0",
        "overflow": "visible"
      },
      ".sprout-task-tree-sketch .sprout-task-tree-row": {
        "position": "absolute",
        "right": "0"
      },
      ".sprout-task-tree-flow:not([data-drawn])": {
        "opacity": "0"
      },
      ".sprout-task-tree-flow": {
        "--sprout-task-tree-page-canvas": "var(--sprout-canvas)",
        "--sprout-task-tree-page-surface": "var(--sprout-surface)",
        "--sprout-task-tree-page-hover": "var(--sprout-hover)",
        "--sprout-task-tree-page-active": "var(--sprout-active)",
        "--sprout-task-tree-page-text": "var(--sprout-text)",
        "--sprout-task-tree-page-muted": "var(--sprout-muted)",
        "--sprout-task-tree-page-line": "var(--sprout-line)",
        "--sprout-task-tree-page-border": "var(--sprout-border)",
        "--sprout-task-tree-page-border-strong": "var(--sprout-border-strong)",
        "--sprout-task-tree-page-input": "var(--sprout-input)",
        "--sprout-task-tree-page-primary": "var(--sprout-primary)",
        "--sprout-task-tree-page-primary-hover": "var(--sprout-primary-hover)",
        "--sprout-task-tree-page-primary-active": "var(--sprout-primary-active)",
        "--sprout-task-tree-page-primary-subtle": "var(--sprout-primary-subtle)",
        "--sprout-task-tree-page-on-primary": "var(--sprout-on-primary)",
        "--sprout-task-tree-page-focus": "var(--sprout-focus)",
        "--sprout-task-tree-page-danger": "var(--sprout-danger)",
        "--sprout-task-tree-page-danger-hover": "var(--sprout-danger-hover)",
        "--sprout-task-tree-page-danger-subtle": "var(--sprout-danger-subtle)",
        "--sprout-task-tree-page-on-danger": "var(--sprout-on-danger)",
        "--sprout-task-tree-page-info": "var(--sprout-info)",
        "--sprout-task-tree-page-info-subtle": "var(--sprout-info-subtle)",
        "--sprout-task-tree-page-secondary": "var(--sprout-secondary)",
        "--sprout-task-tree-page-success": "var(--sprout-success)",
        "--sprout-task-tree-page-success-subtle": "var(--sprout-success-subtle)",
        "--sprout-task-tree-page-warning": "var(--sprout-warning)",
        "--sprout-task-tree-page-warning-subtle": "var(--sprout-warning-subtle)",
        "--sprout-task-tree-page-overlay": "var(--sprout-overlay)"
      },
      ".sprout-task-tree-canvas > .react-flow__renderer": {
        "--sprout-canvas": "var(--sprout-task-tree-page-canvas)",
        "--sprout-surface": "var(--sprout-task-tree-page-surface)",
        "--sprout-hover": "var(--sprout-task-tree-page-hover)",
        "--sprout-active": "var(--sprout-task-tree-page-active)",
        "--sprout-text": "var(--sprout-task-tree-page-text)",
        "--sprout-muted": "var(--sprout-task-tree-page-muted)",
        "--sprout-line": "var(--sprout-task-tree-page-line)",
        "--sprout-border": "var(--sprout-task-tree-page-border)",
        "--sprout-border-strong": "var(--sprout-task-tree-page-border-strong)",
        "--sprout-input": "var(--sprout-task-tree-page-input)",
        "--sprout-primary": "var(--sprout-task-tree-page-primary)",
        "--sprout-primary-hover": "var(--sprout-task-tree-page-primary-hover)",
        "--sprout-primary-active": "var(--sprout-task-tree-page-primary-active)",
        "--sprout-primary-subtle": "var(--sprout-task-tree-page-primary-subtle)",
        "--sprout-on-primary": "var(--sprout-task-tree-page-on-primary)",
        "--sprout-focus": "var(--sprout-task-tree-page-focus)",
        "--sprout-danger": "var(--sprout-task-tree-page-danger)",
        "--sprout-danger-hover": "var(--sprout-task-tree-page-danger-hover)",
        "--sprout-danger-subtle": "var(--sprout-task-tree-page-danger-subtle)",
        "--sprout-on-danger": "var(--sprout-task-tree-page-on-danger)",
        "--sprout-info": "var(--sprout-task-tree-page-info)",
        "--sprout-info-subtle": "var(--sprout-task-tree-page-info-subtle)",
        "--sprout-secondary": "var(--sprout-task-tree-page-secondary)",
        "--sprout-success": "var(--sprout-task-tree-page-success)",
        "--sprout-success-subtle": "var(--sprout-task-tree-page-success-subtle)",
        "--sprout-warning": "var(--sprout-task-tree-page-warning)",
        "--sprout-warning-subtle": "var(--sprout-task-tree-page-warning-subtle)",
        "--sprout-overlay": "var(--sprout-task-tree-page-overlay)"
      },
      ".sprout-task-tree-flow .react-flow__container, .sprout-task-tree-flow .react-flow__viewport, .sprout-task-tree-flow .react-flow__edges, .sprout-task-tree-flow .react-flow__nodes": {
        "transform-origin": "0 0",
        "pointer-events": "none",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-task-tree-flow .react-flow__pane": {
        "z-index": "1",
        "pointer-events": "none",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-task-tree-flow .react-flow__viewport": {
        "z-index": "2"
      },
      ".sprout-task-tree-flow .react-flow__edges svg": {
        "pointer-events": "none",
        "position": "absolute",
        "overflow": "visible"
      },
      ".sprout-task-tree-flow .react-flow__node": {
        "box-sizing": "border-box",
        "transform-origin": "0 0",
        "user-select": "text",
        "pointer-events": "none",
        "position": "absolute"
      },
      ".sprout-task-tree-handle": {
        "opacity": "0",
        "pointer-events": "none",
        "border": "0",
        "width": "0",
        "min-width": "0",
        "height": "0",
        "min-height": "0",
        "position": "absolute"
      },
      ".sprout-task-tree-row": {
        "box-sizing": "border-box",
        "align-items": "flex-start",
        "gap": "12px",
        "height": "32px",
        "padding-block": "6px",
        "display": "flex"
      },
      ".sprout-task-tree-status": {
        "margin-top": "2px"
      },
      ".sprout-task-tree-title": {
        "min-width": "0",
        "font-size": "var(--sprout-text-sm)",
        "text-overflow": "ellipsis",
        "white-space": "nowrap",
        "flex": "1",
        "line-height": "1.25rem",
        "overflow": "hidden"
      },
      ".sprout-task-tree-row[data-state=\"pending\"] .sprout-task-tree-title, .sprout-task-tree-row[data-state=\"skipped\"] .sprout-task-tree-title": {
        "color": "var(--sprout-muted)"
      },
      ".sprout-task-tree-row[data-state=\"running\"] .sprout-task-tree-title": {
        "font-weight": "500"
      },
      ".sprout-task-tree-path, .sprout-task-tree-path-done": {
        "fill": "none",
        "stroke-width": "2px",
        "stroke-linecap": "round",
        "stroke-linejoin": "round"
      },
      ".sprout-task-tree-path": {
        "stroke": "var(--sprout-task-tree-line)"
      },
      ".sprout-task-tree-path-done": {
        "stroke": "var(--sprout-task-tree-line-done)",
        "stroke-dasharray": "1 1",
        "stroke-dashoffset": "0"
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-task-tree-row[data-entering]": {
          "animation": "sprout-task-tree-enter .22s var(--sprout-motion-ease) backwards"
        }
      },
      "@media (prefers-reduced-motion: reduce)": {
        ".sprout-task-tree-row[data-entering]": {
          "animation": ".16s ease-out backwards sprout-task-tree-fade"
        }
      },
      "@media (forced-colors: active)": {
        ".sprout-task-tree-stage": {
          "--sprout-task-tree-line": "GrayText",
          "--sprout-task-tree-line-done": "CanvasText",
          "forced-color-adjust": "none"
        }
      },
      "@keyframes sprout-task-tree-enter": {
        "from": {
          "opacity": "0",
          "transform": "translateY(-4px)"
        }
      },
      "@keyframes sprout-task-tree-fade": {
        "from": {
          "opacity": "0"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/task-tree/",
  "meta": {
    "source": "packages/sprout/src/components/task-tree.tsx"
  }
}
