{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "timeline",
  "type": "registry:ui",
  "title": "Timeline",
  "description": "Records on a week, month, or quarter timeline, with bars, dates, and row actions.",
  "categories": [
    "data-display"
  ],
  "dependencies": [
    "@hugeicons/core-free-icons@4.4.0",
    "@hugeicons/react@1.1.10",
    "recharts@3.10.1"
  ],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json",
    "https://sprout.tulipfarm.ai/r/badge.json",
    "https://sprout.tulipfarm.ai/r/button.json",
    "https://sprout.tulipfarm.ai/r/skeleton.json",
    "https://sprout.tulipfarm.ai/r/spinner.json",
    "https://sprout.tulipfarm.ai/r/toggle-group.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/timeline.tsx",
      "type": "registry:ui",
      "target": "components/ui/timeline.tsx",
      "content": "export * from '@/lib/sprout/charts/timeline-core';\nexport * from '@/lib/sprout/charts/timeline-window';\nexport {\n  shiftTimeline,\n  timelineRange,\n  timelineToday,\n  timelineZoomNames,\n  type TimelineRange,\n  type TimelineZoom,\n} from '@/lib/sprout/charts/timeline-dates';\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/check-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/check-icon.tsx",
      "content": "import { Tick02Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const CheckIcon = /* @__PURE__ */ createIcon(glyph, 'CheckIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/chevron-left-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/chevron-left-icon.tsx",
      "content": "import { ArrowLeft01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ChevronLeftIcon = /* @__PURE__ */ createIcon(glyph, 'ChevronLeftIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/chevron-right-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/chevron-right-icon.tsx",
      "content": "import { ArrowRight01Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ChevronRightIcon = /* @__PURE__ */ createIcon(glyph, 'ChevronRightIcon');\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/inbox-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/inbox-icon.tsx",
      "content": "import { InboxIcon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const InboxIcon = /* @__PURE__ */ createIcon(glyph, 'InboxIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/warning-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/warning-icon.tsx",
      "content": "import { Alert02Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const WarningIcon = /* @__PURE__ */ createIcon(glyph, 'WarningIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/chart-kit.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/chart-kit.tsx",
      "content": "'use client';\n\nimport {\n  createContext,\n  useContext,\n  useId,\n  useMemo,\n  type ComponentProps,\n  type ComponentType,\n  type CSSProperties,\n  type ReactNode,\n} from 'react';\nimport {\n  Legend,\n  Rectangle,\n  ResponsiveContainer,\n  Tooltip,\n  type BarShapeProps,\n  type DefaultLegendContentProps,\n  type DefaultTooltipContentProps,\n  type TooltipValueType,\n} from 'recharts';\nimport { cn } from '@/lib/sprout/classes';\n\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\n\nexport const chartIndicatorNames = ['dot', 'line', 'dashed'] as const;\nexport type ChartIndicator = (typeof chartIndicatorNames)[number];\n\nexport type ChartConfig = Record<\n  string,\n  {\n    label?: ReactNode;\n    icon?: ComponentType;\n  } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n>;\n\nconst cssKey = (key: string) => key.replace(/[^\\w-]/g, '_');\n\nexport function chartColor(key: string) {\n  return `var(--sprout-chart-color-${cssKey(key)})`;\n}\n\nconst ChartContext = createContext<{ config: ChartConfig } | null>(null);\n\nfunction useChart() {\n  const context = useContext(ChartContext);\n  if (!context) throw new Error('useChart must be used within a <ChartContainer />');\n  return context;\n}\n\nexport type ChartContainerProps = ComponentProps<'div'> & {\n  config: ChartConfig;\n  children: ComponentProps<typeof ResponsiveContainer>['children'];\n  initialDimension?: { width: number; height: number };\n};\n\nexport function ChartContainer({\n  id,\n  className,\n  children,\n  config,\n  initialDimension = INITIAL_DIMENSION,\n  ...props\n}: ChartContainerProps) {\n  const uniqueId = useId();\n  const chartId = `chart-${cssKey(id ?? uniqueId)}`;\n  const value = useMemo(() => ({ config }), [config]);\n  return (\n    <ChartContext.Provider value={value}>\n      <div data-slot=\"chart\" data-chart={chartId} className={cn('sprout-chart', className)} {...props}>\n        <ChartStyle id={chartId} config={config} />\n        <ResponsiveContainer initialDimension={initialDimension}>{children}</ResponsiveContainer>\n      </div>\n    </ChartContext.Provider>\n  );\n}\n\nexport function ChartStyle({ id, config }: { id: string; config: ChartConfig }) {\n  const colorConfig = Object.entries(config).filter(([, item]) => item.theme ?? item.color);\n  if (!colorConfig.length) return null;\n  const rules = (theme: keyof typeof THEMES) =>\n    colorConfig\n      .map(([key, item]) => {\n        const color = item.theme?.[theme] ?? item.color;\n        return color ? `  --sprout-chart-color-${cssKey(key)}: ${color};` : null;\n      })\n      .filter(Boolean)\n      .join('\\n');\n  const scope = `[data-chart=\"${cssKey(id)}\"]`;\n  const themed = colorConfig.some(([, item]) => item.theme);\n  const css = [\n    `${scope} {\\n${rules('light')}\\n}`,\n    themed ? `${THEMES.dark} ${scope} {\\n${rules('dark')}\\n}` : '',\n    themed\n      ? `@media (prefers-color-scheme: dark) {\\n:root:not(.light):not(.dark) ${scope} {\\n${rules('dark')}\\n}\\n}`\n      : '',\n  ]\n    .filter(Boolean)\n    .join('\\n');\n  return <style dangerouslySetInnerHTML={{ __html: css }} />;\n}\n\nexport type ChartTooltipProps = ComponentProps<typeof Tooltip>;\n\nexport function ChartTooltip(props: ChartTooltipProps) {\n  return <Tooltip animationDuration={160} {...props} />;\n}\n\ntype TooltipNameType = number | string;\n\nexport type ChartTooltipContentProps = ComponentProps<typeof Tooltip> &\n  ComponentProps<'div'> & {\n    hideLabel?: boolean;\n    hideIndicator?: boolean;\n    indicator?: ChartIndicator;\n    nameKey?: string;\n    labelKey?: string;\n    valueFormatter?: ValueFormatter;\n  } & Omit<DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>;\n\nexport function ChartTooltipContent({\n  active,\n  payload,\n  className,\n  indicator = 'dot',\n  hideLabel = false,\n  hideIndicator = false,\n  label,\n  labelFormatter,\n  labelClassName,\n  formatter,\n  color,\n  nameKey,\n  labelKey,\n  valueFormatter = formatNumber,\n}: ChartTooltipContentProps) {\n  const { config } = useChart();\n\n  const tooltipLabel = useMemo(() => {\n    if (hideLabel || !payload?.length) return null;\n    const [item] = payload;\n    const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;\n    const itemConfig = getPayloadConfigFromPayload(config, item, key);\n    const value = !labelKey && typeof label === 'string' ? (config[label]?.label ?? label) : itemConfig?.label;\n    if (labelFormatter)\n      return <div className={cn('sprout-chart-tooltip-label', labelClassName)}>{labelFormatter(value, payload)}</div>;\n    if (!value) return null;\n    return <div className={cn('sprout-chart-tooltip-label', labelClassName)}>{value}</div>;\n  }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n  if (!active || !payload?.length) return null;\n\n  const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n  return (\n    <div data-slot=\"chart-tooltip\" data-indicator={indicator} className={cn('sprout-chart-tooltip', className)}>\n      {!nestLabel ? tooltipLabel : null}\n      <div className=\"sprout-chart-tooltip-items\">\n        {payload\n          .filter(item => item.type !== 'none')\n          .map((item, index) => {\n            const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;\n            const itemConfig = getPayloadConfigFromPayload(config, item, key);\n            const indicatorColor = color ?? (item.payload as { fill?: string } | undefined)?.fill ?? item.color;\n            return (\n              <div key={index} data-slot=\"chart-tooltip-item\" className=\"sprout-chart-tooltip-item\">\n                {formatter && item?.value !== undefined && item.name ? (\n                  formatter(item.value, item.name, item, index, item.payload)\n                ) : (\n                  <>\n                    {itemConfig?.icon ? (\n                      <itemConfig.icon />\n                    ) : (\n                      !hideIndicator && (\n                        <span\n                          aria-hidden=\"true\"\n                          data-slot=\"chart-tooltip-indicator\"\n                          className=\"sprout-chart-tooltip-indicator\"\n                          style={\n                            {\n                              '--sprout-chart-indicator': indicatorColor,\n                            } as CSSProperties\n                          }\n                        />\n                      )\n                    )}\n                    <div className=\"sprout-chart-tooltip-row\" data-nested={nestLabel || undefined}>\n                      <div className=\"sprout-chart-tooltip-name\">\n                        {nestLabel ? tooltipLabel : null}\n                        <span>{itemConfig?.label ?? item.name}</span>\n                      </div>\n                      {item.value != null && (\n                        <span className=\"sprout-chart-tooltip-value\">\n                          {typeof item.value === 'number' ? valueFormatter(item.value) : String(item.value)}\n                        </span>\n                      )}\n                    </div>\n                  </>\n                )}\n              </div>\n            );\n          })}\n      </div>\n    </div>\n  );\n}\n\nexport const ChartLegend = Legend;\n\nexport type ChartLegendContentProps = ComponentProps<'div'> & {\n  hideIcon?: boolean;\n  nameKey?: string;\n} & DefaultLegendContentProps;\n\nexport function ChartLegendContent({\n  className,\n  hideIcon = false,\n  payload,\n  verticalAlign = 'bottom',\n  nameKey,\n}: ChartLegendContentProps) {\n  const { config } = useChart();\n  if (!payload?.length) return null;\n  return (\n    <div\n      data-slot=\"chart-legend\"\n      data-align={verticalAlign === 'top' ? 'top' : 'bottom'}\n      className={cn('sprout-chart-legend', className)}\n    >\n      {payload\n        .filter(item => item.type !== 'none')\n        .map((item, index) => {\n          const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n          const itemConfig = getPayloadConfigFromPayload(config, item, key);\n          return (\n            <div key={index} data-slot=\"chart-legend-item\" className=\"sprout-chart-legend-item\">\n              {itemConfig?.icon && !hideIcon ? (\n                <itemConfig.icon />\n              ) : (\n                <span\n                  aria-hidden=\"true\"\n                  className=\"sprout-chart-legend-swatch\"\n                  style={{ backgroundColor: item.color }}\n                />\n              )}\n              {itemConfig?.label}\n            </div>\n          );\n        })}\n    </div>\n  );\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n  if (typeof payload !== 'object' || payload === null) return undefined;\n  const inner =\n    'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n      ? (payload.payload as Record<string, unknown>)\n      : undefined;\n  const outer = payload as Record<string, unknown>;\n  let configLabelKey = key;\n  if (typeof outer[key] === 'string') configLabelKey = outer[key];\n  else if (inner && typeof inner[key] === 'string') configLabelKey = inner[key];\n  return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\nexport type ChartSeries = { key: string; label: string; color: string };\nexport type UsageSeries = ChartSeries;\n\nexport type ChartRow = Record<string, number | string | null | undefined>;\n\nexport type ValueFormatter = (value: number) => string;\n\nexport const formatNumber: ValueFormatter = value => value.toLocaleString();\n\nexport const chartPalette = [1, 2, 3, 4, 5].map(step => `var(--sprout-chart-${step})`);\n\nexport const chartOtherColor = 'var(--sprout-muted)';\n\nexport const partColor = (index: number) => chartPalette[index] ?? chartOtherColor;\n\nexport const chartShade = (color: string, step: number, steps = 5) =>\n  `color-mix(in oklab, ${color} ${Math.round((step / steps) * 100)}%, var(--sprout-surface))`;\n\nexport type ChartPart = { name: string; value: number; fill: string };\n\nexport function foldParts(rows: ChartRow[], category: string, value: string, limit = chartPalette.length): ChartPart[] {\n  const parts = rows\n    .map(row => ({\n      name: String(row[category] ?? ''),\n      value: Number(row[value]) || 0,\n    }))\n    .filter(part => part.value > 0)\n    .sort((a, b) => b.value - a.value);\n  const kept = parts.slice(0, limit);\n  const rest = parts.slice(kept.length);\n  const colored = kept.map((part, index) => ({\n    ...part,\n    fill: partColor(index),\n  }));\n  if (!rest.length) return colored;\n  return [\n    ...colored,\n    {\n      name: `${rest.length} more`,\n      value: rest.reduce((sum, part) => sum + part.value, 0),\n      fill: chartOtherColor,\n    },\n  ];\n}\n\nexport const partConfig = (parts: ChartPart[]): ChartConfig =>\n  Object.fromEntries(parts.map(part => [part.name, { label: part.name, color: part.fill }]));\n\nexport interface ReadyChartProps {\n  title?: string;\n  valueFormatter?: ValueFormatter;\n  className?: string;\n}\n\nexport const seriesConfig = (series: ChartSeries[]): ChartConfig =>\n  Object.fromEntries(series.map(item => [item.key, { label: item.label, color: item.color }]));\n\nexport const tooltipCursor = { fill: 'var(--sprout-hover)' };\n\nexport const quietAxis = { tickLine: false, axisLine: false } as const;\n\nexport const valueDomain = (max: number | undefined) =>\n  max === undefined ? undefined : ([(low: number) => Math.min(0, low), max] as [(low: number) => number, number]);\n\nexport const valueTicks = (max: number | undefined) => {\n  if (max === undefined) return undefined;\n  const scale = 10 ** Math.floor(Math.log10(max / 5));\n  const steps = (bases: number[]) => [scale, scale * 10].flatMap(size => bases.map(base => base * size));\n  const find = (bases: number[], most: number) =>\n    steps(bases).find(item => max / item <= most && Number.isInteger(+(max / item).toFixed(9)));\n  const round = [1, 2, 2.5, 5];\n  const other = [3, 4, 6, 8];\n  const step = find(round, 5) ?? find(other, 5) ?? find(round, 8) ?? find(other, 8);\n  return step ? Array.from({ length: Math.round(max / step) + 1 }, (_, index) => +(index * step).toFixed(9)) : [0, max];\n};\n\nexport type ChartStack = 'none' | 'stacked' | 'percent';\n\nexport const stackOffset = (stack: ChartStack) => (stack === 'percent' ? ('expand' as const) : undefined);\n\nexport const formatPercent: ValueFormatter = value => `${Math.round(value * 100)}%`;\n\nexport const dayLabel = (value: unknown, locale?: string) =>\n  new Date(\n    typeof value === 'number' || value instanceof Date ? value : `${String(value)}T00:00:00Z`,\n  ).toLocaleDateString(locale, {\n    month: 'short',\n    day: 'numeric',\n    timeZone: 'UTC',\n  });\n\nexport const configLegend = (config: ChartConfig) =>\n  function ConfigLegend() {\n    return (\n      <ChartLegendContent\n        payload={Object.keys(config).map(key => ({\n          value: key,\n          dataKey: key,\n          color: chartColor(key),\n        }))}\n      />\n    );\n  };\n\nexport const rowFillShape = (props: BarShapeProps) => (\n  <Rectangle {...props} fill={(props.payload as { fill: string }).fill} />\n);\n"
    },
    {
      "path": "registry/sprout/lib/sprout/charts/timeline-dates.ts",
      "type": "registry:lib",
      "target": "lib/sprout/charts/timeline-dates.ts",
      "content": "export const timelineZoomNames = ['week', 'month', 'quarter'] as const;\n\nexport type TimelineZoom = (typeof timelineZoomNames)[number];\n\nexport interface TimelineRange {\n  start: string;\n  end: string;\n}\n\nexport const DAY = 86_400_000;\nconst DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\nconst utc = (year: number, month: number, day: number) => {\n  const date = new Date(0);\n  date.setUTCFullYear(year, month, day);\n  return date.getTime();\n};\n\nconst parts = (date: string) => {\n  const match = DATE.exec(date);\n  const [year, month, day] = match ? [Number(match[1]), Number(match[2]) - 1, Number(match[3])] : [];\n  if (year === undefined || month === undefined || day === undefined)\n    throw new RangeError(`Not a YYYY-MM-DD date: ${date}`);\n  const time = utc(year, month, day);\n  const check = new Date(time);\n  if (check.getUTCMonth() !== month || check.getUTCDate() !== day) throw new RangeError(`Not a calendar date: ${date}`);\n  return { year, month, day, time };\n};\n\nexport const isCalendarDate = (value: unknown): value is string => {\n  if (typeof value !== 'string' || !DATE.test(value)) return false;\n  try {\n    parts(value);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\nexport const dayTime = (date: string) => parts(date).time;\n\nexport const dayString = (time: number) => {\n  const date = new Date(time);\n  const year = String(date.getUTCFullYear()).padStart(4, '0');\n  const month = String(date.getUTCMonth() + 1).padStart(2, '0');\n  const day = String(date.getUTCDate()).padStart(2, '0');\n  return `${year}-${month}-${day}`;\n};\n\nexport function timelineRange(zoom: TimelineZoom, from: string, weekStartsOn: 0 | 1 = 1): TimelineRange {\n  const { year, month, time } = parts(from);\n  if (zoom === 'week') {\n    const offset = (new Date(time).getUTCDay() - weekStartsOn + 7) % 7;\n    const start = time - offset * DAY;\n    return { start: dayString(start), end: dayString(start + 6 * DAY) };\n  }\n  const first = zoom === 'month' ? month : month - (month % 3);\n  const months = zoom === 'month' ? 1 : 3;\n  return { start: dayString(utc(year, first, 1)), end: dayString(utc(year, first + months, 0)) };\n}\n\nexport function shiftTimeline(zoom: TimelineZoom, from: string, step: -1 | 1, weekStartsOn: 0 | 1 = 1): string {\n  const { start } = timelineRange(zoom, from, weekStartsOn);\n  const { year, month, time } = parts(start);\n  if (zoom === 'week') return dayString(time + step * 7 * DAY);\n  return dayString(utc(year, month + step * (zoom === 'month' ? 1 : 3), 1));\n}\n\nexport const plainSpaces = (text: string) => text.replaceAll(/[\\u2009\\u202f]/g, ' ');\n\nexport function timelineTitle(zoom: TimelineZoom, from: string, weekStartsOn: 0 | 1 = 1, locale?: string) {\n  const range = timelineRange(zoom, from, weekStartsOn);\n  const start = parts(range.start);\n  if (zoom === 'quarter') return `Q${Math.floor(start.month / 3) + 1} ${start.year}`;\n  if (zoom === 'month')\n    return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(start.time);\n  return plainSpaces(\n    new Intl.DateTimeFormat(locale, {\n      day: 'numeric',\n      month: 'short',\n      year: 'numeric',\n      timeZone: 'UTC',\n    }).formatRange(start.time, dayTime(range.end)),\n  );\n}\n\nconst clocks = new Map<string, Intl.DateTimeFormat>();\n\nexport function wallClock(time: number, timeZone?: string) {\n  const key = timeZone ?? '';\n  let clock = clocks.get(key);\n  if (!clock) {\n    clock = new Intl.DateTimeFormat('en-US', {\n      timeZone,\n      hourCycle: 'h23',\n      year: 'numeric',\n      month: 'numeric',\n      day: 'numeric',\n      hour: 'numeric',\n      minute: 'numeric',\n      second: 'numeric',\n    });\n    clocks.set(key, clock);\n  }\n  const part = Object.fromEntries(clock.formatToParts(time).map(item => [item.type, Number(item.value)]));\n  const seconds = ((part.hour ?? 0) * 60 + (part.minute ?? 0)) * 60 + (part.second ?? 0);\n  return (\n    utc(part.year ?? 1970, (part.month ?? 1) - 1, part.day ?? 1) + seconds * 1000 + (((time % 1000) + 1000) % 1000)\n  );\n}\n\nexport const timelineToday = (timeZone?: string, now = Date.now()) =>\n  dayString(Math.floor(wallClock(now, timeZone) / DAY) * DAY);\n"
    },
    {
      "path": "registry/sprout/lib/sprout/charts/timeline-window.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/charts/timeline-window.tsx",
      "content": "'use client';\n\nimport type { ReactNode } from 'react';\nimport { ChevronLeftIcon } from '@/lib/sprout/icons/chevron-left-icon';\nimport { ChevronRightIcon } from '@/lib/sprout/icons/chevron-right-icon';\nimport { Button } from '@/components/ui/button';\nimport { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';\nimport { cn } from '@/lib/sprout/classes';\nimport { shiftTimeline, timelineTitle, timelineZoomNames, type TimelineZoom } from '@/lib/sprout/charts/timeline-dates';\n\nconst zoomLabels: Record<TimelineZoom, string> = {\n  week: 'Week',\n  month: 'Month',\n  quarter: 'Quarter',\n};\n\nexport interface TimelineWindowBarProps {\n  zoom: TimelineZoom;\n  from: string;\n  onChange: (next: { zoom: TimelineZoom; from: string }) => void;\n  today: string;\n  weekStartsOn?: 0 | 1 | undefined;\n  locale?: string | undefined;\n  actions?: ReactNode;\n  disabled?: boolean | undefined;\n  className?: string | undefined;\n}\n\nexport function TimelineWindowBar({\n  zoom,\n  from,\n  onChange,\n  today,\n  weekStartsOn = 1,\n  locale,\n  actions,\n  disabled,\n  className,\n}: TimelineWindowBarProps) {\n  return (\n    <div data-slot=\"timeline-window-bar\" className={cn('sprout-timeline-window-bar', className)}>\n      <div className=\"sprout-timeline-window-nav\">\n        <Button\n          variant=\"outline\"\n          size=\"icon-sm\"\n          aria-label={`Previous ${zoom}`}\n          disabled={disabled}\n          onClick={() => onChange({ zoom, from: shiftTimeline(zoom, from, -1, weekStartsOn) })}\n        >\n          <ChevronLeftIcon size=\"md\" aria-hidden=\"true\" />\n        </Button>\n        <Button variant=\"outline\" size=\"sm\" disabled={disabled} onClick={() => onChange({ zoom, from: today })}>\n          Today\n        </Button>\n        <Button\n          variant=\"outline\"\n          size=\"icon-sm\"\n          aria-label={`Next ${zoom}`}\n          disabled={disabled}\n          onClick={() => onChange({ zoom, from: shiftTimeline(zoom, from, 1, weekStartsOn) })}\n        >\n          <ChevronRightIcon size=\"md\" aria-hidden=\"true\" />\n        </Button>\n      </div>\n      <p className=\"sprout-timeline-window-title\" aria-live=\"polite\" aria-atomic=\"true\">\n        {timelineTitle(zoom, from, weekStartsOn, locale)}\n      </p>\n      {actions ? <div className=\"sprout-timeline-window-actions\">{actions}</div> : null}\n      <ToggleGroup<TimelineZoom>\n        aria-label=\"Window size\"\n        variant=\"outline\"\n        size=\"sm\"\n        spacing={0}\n        className=\"sprout-timeline-window-zoom\"\n        value={[zoom]}\n        disabled={disabled}\n        onValueChange={value => {\n          const next = value[0];\n          if (next && next !== zoom) onChange({ zoom: next, from });\n        }}\n      >\n        {timelineZoomNames.map(name => (\n          <ToggleGroupItem key={name} value={name}>\n            {zoomLabels[name]}\n          </ToggleGroupItem>\n        ))}\n      </ToggleGroup>\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/charts/timeline-core.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/charts/timeline-core.tsx",
      "content": "'use client';\n\nimport {\n  useEffect,\n  useId,\n  useMemo,\n  useRef,\n  useState,\n  type CSSProperties,\n  type KeyboardEvent,\n  type MouseEvent,\n  type ReactNode,\n} from 'react';\nimport { Bar, BarChart, CartesianGrid, Rectangle, ReferenceArea, ReferenceLine, XAxis, YAxis } from 'recharts';\nimport type { BarShapeProps } from 'recharts';\nimport { Badge } from '@/components/ui/badge';\nimport { Button } from '@/components/ui/button';\nimport { Skeleton } from '@/components/ui/skeleton';\nimport { StatePanel } from '@/lib/sprout/state-panel-core';\nimport { cn } from '@/lib/sprout/classes';\nimport {\n  ChartContainer,\n  ChartLegend,\n  ChartTooltip,\n  ChartTooltipContent,\n  chartColor,\n  configLegend,\n  dayLabel,\n  quietAxis,\n  seriesConfig,\n  tooltipCursor,\n  type ChartRow,\n  type ChartSeries,\n  type ReadyChartProps,\n} from '@/lib/sprout/chart-kit';\nimport { DAY, dayTime, isCalendarDate, plainSpaces, wallClock, type TimelineRange } from '@/lib/sprout/charts/timeline-dates';\n\nexport interface TimelineUndated {\n  count: number | string;\n  field: string;\n  action?: ReactNode;\n}\n\nexport type TimelineStatus = 'ready' | 'loading' | 'error';\n\nexport interface TimelineChartProps<T extends ChartRow = ChartRow> extends ReadyChartProps {\n  rows: T[];\n  category: string;\n  start: string;\n  end?: string | undefined;\n  seriesKey?: string | undefined;\n  series?: ChartSeries[] | undefined;\n  locale?: string | undefined;\n  window?: TimelineRange | undefined;\n  today?: string | undefined;\n  timeZone?: string | undefined;\n  rowKey?: string | undefined;\n  renderLabel?: ((row: T) => ReactNode) | undefined;\n  renderActions?: ((row: T) => ReactNode) | undefined;\n  onRowOpen?: ((row: T) => void) | undefined;\n  undated?: TimelineUndated | undefined;\n  notice?: ReactNode;\n  status?: TimelineStatus | undefined;\n  error?: ReactNode;\n  onRetry?: (() => void) | undefined;\n  empty?: ReactNode;\n}\n\ntype MarkKind = 'range' | 'point' | 'reversed';\ntype Clip = 'start' | 'end' | 'both';\ntype When = { time: number; date: boolean };\n\ninterface Mark<T> {\n  row: T;\n  id: string;\n  name: string;\n  key: string;\n  fill: string;\n  kind: MarkKind;\n  range: [number, number];\n  clip: Clip | undefined;\n  startsAt: number;\n  from: When;\n  to: When | null;\n}\n\nconst AXIS = 40;\n\nconst read = (value: unknown): When | null => {\n  if (typeof value === 'number') return Number.isFinite(value) ? { time: value, date: false } : null;\n  if (typeof value !== 'string' || !value) return null;\n  if (isCalendarDate(value)) return { time: dayTime(value), date: true };\n  const time = Date.parse(value);\n  return Number.isNaN(time) ? null : { time, date: false };\n};\n\nconst clipText: Record<Clip, string> = {\n  start: 'Starts before window',\n  end: 'Ends after window',\n  both: 'Runs past window',\n};\n\nconst dateFormat = (locale: string | undefined) =>\n  new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short', year: 'numeric', timeZone: 'UTC' });\n\nconst timeFormat = (locale: string | undefined, timeZone: string | undefined) =>\n  new Intl.DateTimeFormat(locale, {\n    day: 'numeric',\n    month: 'short',\n    year: 'numeric',\n    hour: 'numeric',\n    minute: '2-digit',\n    timeZone,\n  });\n\nfunction datesText<T>(mark: Mark<T>, hasEnd: boolean, locale: string | undefined, timeZone: string | undefined) {\n  return plainSpaces(rawDatesText(mark, hasEnd, locale, timeZone));\n}\n\nfunction rawDatesText<T>(mark: Mark<T>, hasEnd: boolean, locale: string | undefined, timeZone: string | undefined) {\n  const format = mark.from.date ? dateFormat(locale) : timeFormat(locale, timeZone);\n  const start = format.format(mark.from.time);\n  if (mark.kind === 'reversed' && mark.to) return `Starts ${start}, ends ${format.format(mark.to.time)}`;\n  if (!mark.to) return hasEnd ? `${start}, no end` : start;\n  if (mark.to.time === mark.from.time) return start;\n  return format.formatRange(mark.from.time, mark.to.time);\n}\n\nfunction weekends(from: number, to: number) {\n  if (to - from > 31 * DAY) return [];\n  const bands: [number, number][] = [];\n  for (let day = from; day < to; day += DAY) {\n    const weekday = new Date(day).getUTCDay();\n    if (weekday === 6 || (weekday === 0 && day === from))\n      bands.push([day, Math.min(to, day + (weekday === 6 ? 2 : 1) * DAY)]);\n  }\n  return bands;\n}\n\nconst weekLength = (from: number, to: number) => to - from <= 7 * DAY;\n\nfunction windowTicks(from: number, to: number) {\n  if (weekLength(from, to))\n    return Array.from({ length: Math.round((to - from) / DAY) }, (_, i) => from + (i + 0.5) * DAY);\n  const days = Math.round((to - from) / DAY);\n  const ticks: number[] = [];\n  for (let day = from; day <= to; day += DAY) {\n    const date = new Date(day).getUTCDate();\n    if (days <= 31 ? (date - 1) % 7 === 0 : date === 1 || date === 15) ticks.push(day);\n  }\n  return ticks;\n}\n\nfunction weekdayTick(value: number, locale: string | undefined) {\n  const parts = new Intl.DateTimeFormat(locale, { weekday: 'short', day: 'numeric', timeZone: 'UTC' }).formatToParts(\n    value,\n  );\n  const part = (type: string) => parts.find(item => item.type === type)?.value ?? '';\n  return `${part('weekday')} ${part('day')}`;\n}\n\nconst diamond = (cx: number, cy: number) => `M${cx} ${cy - 6}L${cx + 6} ${cy}L${cx} ${cy + 6}L${cx - 6} ${cy}Z`;\n\nfunction markShape(props: BarShapeProps) {\n  const mark = props.payload as Mark<ChartRow>;\n  const { x = 0, y = 0, width = 0, height = 0 } = props;\n  const cy = y + height / 2;\n  if (mark.kind !== 'range')\n    return (\n      <path\n        className=\"sprout-timeline-point\"\n        data-kind={mark.kind}\n        d={diamond(x, cy)}\n        fill={mark.kind === 'reversed' ? 'var(--sprout-surface)' : mark.fill}\n        stroke={mark.kind === 'reversed' ? 'var(--sprout-warning)' : 'var(--sprout-surface)'}\n        strokeWidth={mark.kind === 'reversed' ? 2 : 1}\n      />\n    );\n  if (!mark.clip) return <Rectangle {...props} fill={mark.fill} />;\n  const left = mark.clip !== 'end';\n  const right = mark.clip !== 'start';\n  const radius: [number, number, number, number] = [left ? 0 : 3, right ? 0 : 3, right ? 0 : 3, left ? 0 : 3];\n  const room = width >= 16;\n  return (\n    <g className=\"sprout-timeline-clipped\" data-clip={mark.clip}>\n      <Rectangle {...props} radius={radius} fill={mark.fill} />\n      {room && left ? (\n        <path className=\"sprout-timeline-chevron\" d={`M${x + 8} ${cy - 4}L${x + 4} ${cy}L${x + 8} ${cy + 4}`} />\n      ) : null}\n      {room && right ? (\n        <path\n          className=\"sprout-timeline-chevron\"\n          d={`M${x + width - 8} ${cy - 4}L${x + width - 4} ${cy}L${x + width - 8} ${cy + 4}`}\n        />\n      ) : null}\n    </g>\n  );\n}\n\nfunction TodayLabel({ viewBox }: { viewBox?: { x?: number; y?: number } }) {\n  const x = viewBox?.x ?? 0;\n  const y = viewBox?.y ?? 0;\n  return (\n    <g className=\"sprout-timeline-today\">\n      <rect x={x - 21} y={y - AXIS + 2} width={42} height={16} rx={8} />\n      <text x={x} y={y - AXIS + 10} textAnchor=\"middle\" dominantBaseline=\"central\">\n        Today\n      </text>\n    </g>\n  );\n}\n\nconst plural = (count: number | string) => (Number(String(count).replaceAll(',', '')) === 1 ? 'row' : 'rows');\n\nconst focusable = 'a[href], button, input, textarea, [tabindex]';\n\nfunction syncActions(list: HTMLElement, active: number) {\n  list.querySelectorAll<HTMLElement>('[data-slot=\"timeline-row\"]').forEach((row, index) => {\n    for (const element of row.querySelectorAll<HTMLElement>(`[data-slot=\"timeline-row-actions\"] :is(${focusable})`)) {\n      const saved = element.dataset.sproutTabindex;\n      if (index === active) {\n        if (saved === undefined) continue;\n        if (saved) element.setAttribute('tabindex', saved);\n        else element.removeAttribute('tabindex');\n        delete element.dataset.sproutTabindex;\n      } else if (saved === undefined) {\n        element.dataset.sproutTabindex = element.getAttribute('tabindex') ?? '';\n        element.tabIndex = -1;\n      }\n    }\n  });\n}\n\nexport function TimelineChart<T extends ChartRow = ChartRow>({\n  rows,\n  category,\n  start,\n  end,\n  seriesKey,\n  series = [],\n  locale,\n  window,\n  today,\n  timeZone,\n  rowKey,\n  renderLabel,\n  renderActions,\n  onRowOpen,\n  undated,\n  notice,\n  status = 'ready',\n  error,\n  onRetry,\n  empty,\n  title = 'Timeline',\n  className,\n}: TimelineChartProps<T>) {\n  const record = Boolean(window || renderLabel || renderActions || onRowOpen);\n  const zoned = record || timeZone !== undefined;\n  const config = useMemo(() => seriesConfig(series), [series]);\n  const domain = useMemo(\n    () => (window ? ([dayTime(window.start), dayTime(window.end) + DAY] as [number, number]) : undefined),\n    [window],\n  );\n  const marks = useMemo(() => {\n    const at = (when: When) => (when.date || !zoned ? when.time : wallClock(when.time, timeZone));\n    const list: Mark<T>[] = [];\n    rows.forEach((row, index) => {\n      const from = read(row[start]);\n      if (!from) return;\n      const to = end ? read(row[end]) : null;\n      const key = seriesKey ? String(row[seriesKey] ?? '') : '';\n      const a = at(from);\n      const kind: MarkKind = !to ? 'point' : at(to) < a ? 'reversed' : 'range';\n      let range: [number, number];\n      if (kind === 'range') range = [a, at(to!) + (record && to!.date ? DAY : 0)];\n      else {\n        const point = a + (record && from.date ? DAY / 2 : 0);\n        range = [point, point];\n      }\n      let clip: Clip | undefined;\n      if (domain) {\n        const [low, high] = domain;\n        if (kind === 'range' ? range[1] <= low || range[0] >= high : range[0] < low || range[0] >= high) return;\n        const cutStart = range[0] < low;\n        const cutEnd = range[1] > high;\n        clip = cutStart && cutEnd ? 'both' : cutStart ? 'start' : cutEnd ? 'end' : undefined;\n        range = [Math.max(range[0], low), Math.min(range[1], high)];\n      }\n      list.push({\n        row,\n        id: rowKey ? String(row[rowKey] ?? index) : String(index),\n        name: String(row[category] ?? ''),\n        key,\n        fill: series.some(item => item.key === key) ? chartColor(key) : 'var(--sprout-chart-1)',\n        kind,\n        range,\n        clip,\n        startsAt: a,\n        from,\n        to,\n      });\n    });\n    if (record) list.sort((x, y) => x.startsAt - y.startsAt);\n    return list;\n  }, [rows, category, start, end, seriesKey, series, rowKey, domain, record, zoned, timeZone]);\n\n  const date = (value: unknown) => dayLabel(value, locale);\n  const todayAt = today && isCalendarDate(today) ? dayTime(today) + DAY / 2 : undefined;\n\n  if (!record)\n    return (\n      <ChartContainer\n        data-variant=\"timeline\"\n        className={cn('sprout-chart-timeline', className)}\n        style={{ height: `${marks.length * 2 + (series.length ? 5 : 3)}rem` }}\n        config={config}\n      >\n        <BarChart data={marks} accessibilityLayer title={title} layout=\"vertical\" barCategoryGap=\"28%\">\n          <CartesianGrid horizontal={false} />\n          <XAxis\n            type=\"number\"\n            scale=\"time\"\n            domain={domain ?? ['dataMin', 'dataMax']}\n            tickFormatter={date}\n            {...quietAxis}\n            minTickGap={24}\n          />\n          <YAxis type=\"category\" dataKey=\"name\" width=\"auto\" {...quietAxis} interval={0} />\n          <ChartTooltip\n            cursor={tooltipCursor}\n            content={props => (\n              <ChartTooltipContent\n                active={props.active}\n                label={props.label}\n                nameKey=\"key\"\n                payload={props.payload?.map(item => {\n                  const [from, to] = (item.payload as Mark<T>).range;\n                  return {\n                    ...item,\n                    name: (item.payload as Mark<T>).key,\n                    value: from === to ? date(from) : `${date(from)} – ${date(to)}`,\n                  };\n                })}\n              />\n            )}\n          />\n          {series.length ? <ChartLegend content={configLegend(config)} /> : null}\n          {todayAt === undefined ? null : (\n            <ReferenceLine x={todayAt} stroke=\"var(--sprout-chart-1)\" strokeDasharray=\"3 3\" />\n          )}\n          <Bar dataKey=\"range\" radius={3} shape={markShape} isAnimationActive={false} />\n        </BarChart>\n      </ChartContainer>\n    );\n\n  return (\n    <RecordTimeline\n      marks={marks}\n      config={config}\n      series={series}\n      hasEnd={Boolean(end)}\n      domain={domain}\n      window={window}\n      todayAt={todayAt}\n      locale={locale}\n      timeZone={timeZone}\n      renderLabel={renderLabel}\n      renderActions={renderActions}\n      onRowOpen={onRowOpen}\n      undated={undated}\n      notice={notice}\n      status={status}\n      error={error}\n      onRetry={onRetry}\n      empty={empty}\n      title={title}\n      className={className}\n    />\n  );\n}\n\ninterface RecordTimelineProps<T extends ChartRow> {\n  marks: Mark<T>[];\n  config: ReturnType<typeof seriesConfig>;\n  series: ChartSeries[];\n  hasEnd: boolean;\n  domain: [number, number] | undefined;\n  window: TimelineRange | undefined;\n  todayAt: number | undefined;\n  locale: string | undefined;\n  timeZone: string | undefined;\n  renderLabel: ((row: T) => ReactNode) | undefined;\n  renderActions: ((row: T) => ReactNode) | undefined;\n  onRowOpen: ((row: T) => void) | undefined;\n  undated: TimelineUndated | undefined;\n  notice: ReactNode;\n  status: TimelineStatus;\n  error: ReactNode;\n  onRetry: (() => void) | undefined;\n  empty: ReactNode;\n  title: string;\n  className: string | undefined;\n}\n\nfunction RecordTimeline<T extends ChartRow>({\n  marks,\n  config,\n  series,\n  hasEnd,\n  domain,\n  window,\n  todayAt,\n  locale,\n  timeZone,\n  renderLabel,\n  renderActions,\n  onRowOpen,\n  undated,\n  notice,\n  status,\n  error,\n  onRetry,\n  empty,\n  title,\n  className,\n}: RecordTimelineProps<T>) {\n  const id = useId();\n  const listRef = useRef<HTMLOListElement>(null);\n  const [activeId, setActiveId] = useState<string | null>(null);\n  const [hot, setHot] = useState<number | null>(null);\n  const found = marks.findIndex(mark => mark.id === activeId);\n  const active = found === -1 ? 0 : found;\n\n  useEffect(() => {\n    if (listRef.current) syncActions(listRef.current, active);\n  });\n\n  const date = (value: unknown) => dayLabel(value, locale);\n  const dates = marks.map(mark => datesText(mark, hasEnd, locale, timeZone));\n  const loading = status === 'loading';\n  const style = { '--sprout-timeline-count': Math.max(marks.length, 1) } as CSSProperties;\n\n  const focusRow = (index: number) => {\n    const next = marks[index];\n    if (!next) return;\n    setActiveId(next.id);\n    listRef.current?.querySelectorAll<HTMLElement>('[data-slot=\"timeline-row\"]')[index]?.focus();\n  };\n\n  const onKeyDown = (event: KeyboardEvent<HTMLLIElement>, index: number) => {\n    if (event.target !== event.currentTarget) return;\n    const moves: Record<string, number> = {\n      ArrowDown: index + 1,\n      ArrowUp: index - 1,\n      Home: 0,\n      End: marks.length - 1,\n    };\n    const next = moves[event.key];\n    if (next !== undefined) {\n      event.preventDefault();\n      focusRow(Math.min(Math.max(next, 0), marks.length - 1));\n    } else if (event.key === 'Enter' && onRowOpen) {\n      event.preventDefault();\n      onRowOpen(marks[index]!.row);\n    }\n  };\n\n  const onRowClick = (event: MouseEvent<HTMLLIElement>, index: number) => {\n    if ((event.target as Element).closest('[data-slot=\"timeline-row-actions\"]')) return;\n    onRowOpen?.(marks[index]!.row);\n  };\n\n  const windowText = () => {\n    if (!window) return 'No rows to show.';\n    const format = dateFormat(locale);\n    return `Nothing between ${format.format(dayTime(window.start))} and ${format.format(dayTime(window.end))}.`;\n  };\n\n  let body: ReactNode;\n  if (status === 'error')\n    body = (\n      <StatePanel\n        kind=\"error\"\n        heading=\"h3\"\n        title=\"Couldn't load the timeline\"\n        description={error ?? 'Something went wrong while reading these rows.'}\n        className=\"sprout-timeline-state\"\n      >\n        {onRetry ? (\n          <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n            Try again\n          </Button>\n        ) : null}\n      </StatePanel>\n    );\n  else if (!marks.length && loading)\n    body = (\n      <div role=\"status\" aria-label=\"Loading timeline\" className=\"sprout-timeline-grid\" data-skeleton=\"\">\n        <div className=\"sprout-timeline-labels\" aria-hidden=\"true\">\n          {[0, 1, 2, 3, 4].map(index => (\n            <div key={index} className=\"sprout-timeline-row\">\n              <div className=\"sprout-timeline-label\">\n                <Skeleton style={{ width: `${70 - index * 7}%` }} />\n                <Skeleton style={{ width: '45%', height: 10 }} />\n              </div>\n            </div>\n          ))}\n        </div>\n        <div className=\"sprout-timeline-plot\" aria-hidden=\"true\">\n          {[0, 1, 2, 3, 4].map(index => (\n            <div key={index} className=\"sprout-timeline-skeleton-band\">\n              <Skeleton style={{ marginLeft: `${(index * 17) % 60}%`, width: `${20 + ((index * 23) % 30)}%` }} />\n            </div>\n          ))}\n        </div>\n      </div>\n    );\n  else if (!marks.length)\n    body = empty ?? (\n      <StatePanel\n        kind=\"empty\"\n        heading=\"h3\"\n        title=\"Nothing in this window\"\n        description={windowText()}\n        className=\"sprout-timeline-state\"\n      />\n    );\n  else\n    body = (\n      <div className=\"sprout-timeline-grid\" onMouseLeave={() => setHot(null)}>\n        <ol\n          ref={listRef}\n          aria-label={title}\n          className=\"sprout-timeline-labels\"\n          onBlur={event => {\n            if (!event.currentTarget.contains(event.relatedTarget)) setHot(null);\n          }}\n        >\n          {marks.map((mark, index) => (\n            <li\n              key={mark.id}\n              data-slot=\"timeline-row\"\n              data-active={index === active || undefined}\n              data-hot={index === hot || undefined}\n              data-openable={onRowOpen ? '' : undefined}\n              tabIndex={index === active ? 0 : -1}\n              aria-labelledby={`${id}-${index}`}\n              className=\"sprout-timeline-row\"\n              onKeyDown={event => onKeyDown(event, index)}\n              onClick={event => onRowClick(event, index)}\n              onFocus={() => {\n                setActiveId(mark.id);\n                setHot(index);\n              }}\n              onMouseEnter={() => setHot(index)}\n            >\n              <div className=\"sprout-timeline-label\" id={`${id}-${index}`}>\n                <span className=\"sprout-timeline-label-head\">\n                  <span className=\"sprout-timeline-label-title\">{renderLabel ? renderLabel(mark.row) : mark.name}</span>\n                  {mark.kind === 'reversed' ? (\n                    <Badge variant=\"warning\" size=\"chip\" className=\"sprout-timeline-label-marker\">\n                      End before start\n                    </Badge>\n                  ) : null}\n                </span>\n                <span className=\"sprout-timeline-label-dates\">\n                  {mark.kind === 'reversed' ? (\n                    <span className=\"sprout-timeline-label-warning\">End before start</span>\n                  ) : null}\n                  <span className=\"sprout-timeline-label-text\">{dates[index]}</span>\n                  {mark.clip ? <span className=\"sprout-timeline-label-clip\">{clipText[mark.clip]}</span> : null}\n                </span>\n              </div>\n              {renderActions ? (\n                <div data-slot=\"timeline-row-actions\" className=\"sprout-timeline-row-actions\">\n                  {renderActions(mark.row)}\n                </div>\n              ) : null}\n            </li>\n          ))}\n        </ol>\n        <div className=\"sprout-timeline-plot\" aria-hidden=\"true\">\n          {hot === null ? null : (\n            <div className=\"sprout-timeline-band\" style={{ '--sprout-timeline-index': hot } as CSSProperties} />\n          )}\n          <ChartContainer\n            data-variant=\"timeline\"\n            className=\"sprout-chart-timeline sprout-timeline-chart\"\n            config={config}\n            initialDimension={{ width: 640, height: AXIS + marks.length * 44 }}\n          >\n            <BarChart\n              data={marks}\n              layout=\"vertical\"\n              margin={{ top: 0, right: 16, bottom: 0, left: 16 }}\n              barSize={16}\n              accessibilityLayer={false}\n              onMouseMove={state => {\n                const index = Number(state.activeTooltipIndex);\n                setHot(Number.isInteger(index) && state.activeTooltipIndex != null ? index : null);\n              }}\n            >\n              <CartesianGrid horizontal={false} vertical={!(domain && weekLength(...domain))} />\n              {domain\n                ? weekends(...domain).map(([x1, x2]) => (\n                    <ReferenceArea\n                      key={x1}\n                      x1={x1}\n                      x2={x2}\n                      ifOverflow=\"hidden\"\n                      className=\"sprout-timeline-weekend\"\n                      fill=\"var(--sprout-hover)\"\n                      fillOpacity={0.4}\n                      stroke=\"none\"\n                    />\n                  ))\n                : null}\n              <XAxis\n                type=\"number\"\n                scale=\"time\"\n                orientation=\"top\"\n                height={AXIS}\n                domain={domain ?? ['dataMin', 'dataMax']}\n                allowDataOverflow\n                ticks={domain ? windowTicks(...domain) : undefined}\n                tickFormatter={domain && weekLength(...domain) ? (value: number) => weekdayTick(value, locale) : date}\n                interval=\"equidistantPreserveStart\"\n                {...quietAxis}\n                tickMargin={6}\n                minTickGap={32}\n              />\n              <YAxis type=\"category\" dataKey=\"id\" hide />\n              <ChartTooltip\n                cursor={false}\n                content={props => (\n                  <ChartTooltipContent\n                    active={props.active}\n                    label={(props.payload?.[0]?.payload as Mark<T> | undefined)?.name}\n                    nameKey=\"key\"\n                    hideIndicator={!series.length}\n                    payload={props.payload?.map(item => {\n                      const mark = item.payload as Mark<T>;\n                      return {\n                        ...item,\n                        name: mark.key,\n                        value: dates[marks.indexOf(mark)] ?? '',\n                      };\n                    })}\n                  />\n                )}\n              />\n              {todayAt === undefined ? null : (\n                <ReferenceLine\n                  x={todayAt}\n                  stroke=\"var(--sprout-chart-1)\"\n                  strokeWidth={1.5}\n                  ifOverflow=\"discard\"\n                  label={<TodayLabel />}\n                />\n              )}\n              <Bar\n                dataKey=\"range\"\n                radius={3}\n                shape={markShape}\n                isAnimationActive={false}\n                onClick={(_, index) => {\n                  const mark = marks[index];\n                  if (mark) onRowOpen?.(mark.row);\n                }}\n              />\n            </BarChart>\n          </ChartContainer>\n        </div>\n      </div>\n    );\n\n  return (\n    <div\n      data-slot=\"timeline\"\n      data-status={status}\n      aria-busy={loading || undefined}\n      className={cn('sprout-timeline', className)}\n      style={style}\n    >\n      {notice ? <div className=\"sprout-timeline-notice\">{notice}</div> : null}\n      {body}\n      {series.length && marks.length && status !== 'error' ? (\n        <div data-slot=\"chart-legend\" className=\"sprout-chart-legend sprout-timeline-legend\">\n          {series.map(item => (\n            <div key={item.key} className=\"sprout-chart-legend-item\">\n              <span aria-hidden=\"true\" className=\"sprout-chart-legend-swatch\" style={{ backgroundColor: item.color }} />\n              {item.label}\n            </div>\n          ))}\n        </div>\n      ) : null}\n      {undated && status !== 'error' ? (\n        <div data-slot=\"timeline-undated\" className=\"sprout-timeline-undated\">\n          <span>{`${undated.count} ${plural(undated.count)} without ${undated.field}`}</span>\n          {undated.action}\n        </div>\n      ) : null}\n    </div>\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/state-panel-core.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/state-panel-core.tsx",
      "content": "import type { ComponentType, HTMLAttributes, ReactNode } from 'react';\nimport { CheckIcon } from '@/lib/sprout/icons/check-icon';\nimport { InboxIcon } from '@/lib/sprout/icons/inbox-icon';\nimport { WarningIcon } from '@/lib/sprout/icons/warning-icon';\nimport { cn } from '@/lib/sprout/classes';\nimport { Spinner } from '@/components/ui/spinner';\n\nexport const statePanelKindNames = ['empty', 'loading', 'success', 'unavailable', 'error'] as const;\n\nexport type StatePanelKind = (typeof statePanelKindNames)[number];\nexport type StatePanelHeading = 'h1' | 'h2' | 'h3' | 'h4';\nexport type StatePanelIcon = ComponentType<{ size?: number }>;\n\ninterface StatePanelBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'children' | 'role'> {\n  title: ReactNode;\n  description: ReactNode;\n  heading?: StatePanelHeading | undefined;\n  icon?: StatePanelIcon | null | undefined;\n  children?: ReactNode;\n}\n\nexport type StatePanelProps = StatePanelBaseProps &\n  (\n    | {\n        kind: 'empty';\n        sample?: ReactNode;\n      }\n    | {\n        kind: 'loading' | 'success' | 'unavailable';\n        sample?: never;\n      }\n    | {\n        kind: 'error';\n        children: ReactNode;\n        sample?: never;\n      }\n  );\n\nconst roles: Partial<Record<StatePanelKind, 'alert' | 'status'>> = {\n  error: 'alert',\n  loading: 'status',\n  success: 'status',\n};\n\nfunction Media({ kind, Icon }: { kind: StatePanelKind; Icon: StatePanelIcon }) {\n  return (\n    <div data-slot=\"state-panel-media\" className=\"sprout-state-panel-media\" aria-hidden=\"true\">\n      {kind === 'loading' ? (\n        <Spinner aria-hidden=\"true\" />\n      ) : kind === 'success' ? (\n        <CheckIcon size=\"xl\" />\n      ) : kind === 'error' ? (\n        <WarningIcon size=\"xl\" className=\"sprout-state-panel-danger\" />\n      ) : (\n        <Icon size={20} />\n      )}\n    </div>\n  );\n}\n\nexport function StatePanel({\n  kind,\n  title,\n  description,\n  heading: Heading = 'h2',\n  icon = InboxIcon,\n  children,\n  sample,\n  className,\n  ...props\n}: StatePanelProps) {\n  const media =\n    icon === null && (kind === 'empty' || kind === 'unavailable') ? null : (\n      <Media kind={kind} Icon={icon ?? InboxIcon} />\n    );\n  const hasActions = children !== undefined && children !== null && children !== false;\n\n  if (sample)\n    return (\n      <section\n        data-slot=\"state-panel\"\n        data-kind={kind}\n        data-layout=\"sample\"\n        {...props}\n        className={cn('sprout-state-panel', className)}\n      >\n        <div className=\"sprout-state-panel-card\">\n          <div className=\"sprout-state-panel-copy\">\n            {media}\n            <div className=\"sprout-state-panel-text\">\n              <Heading className=\"sprout-state-panel-title\">{title}</Heading>\n              <p className=\"sprout-state-panel-description\">{description}</p>\n            </div>\n            {hasActions && (\n              <div data-slot=\"state-panel-actions\" className=\"sprout-state-panel-actions\">\n                {children}\n              </div>\n            )}\n          </div>\n          <div data-slot=\"state-panel-sample\" className=\"sprout-state-panel-sample\" aria-hidden=\"true\" inert>\n            <div className=\"sprout-state-panel-sample-window\">{sample}</div>\n          </div>\n        </div>\n      </section>\n    );\n\n  return (\n    <div\n      data-slot=\"state-panel\"\n      data-kind={kind}\n      data-layout=\"centered\"\n      {...props}\n      className={cn('sprout-state-panel', className)}\n    >\n      {media}\n      <div role={roles[kind]} aria-atomic=\"true\" className=\"sprout-state-panel-text\">\n        <Heading className=\"sprout-state-panel-title\">{title}</Heading>\n        <p className=\"sprout-state-panel-description\">{description}</p>\n      </div>\n      {hasActions && (\n        <div data-slot=\"state-panel-actions\" className=\"sprout-state-panel-actions\">\n          {children}\n        </div>\n      )}\n    </div>\n  );\n}\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-timeline": {
        "--sprout-timeline-row": "2.75rem",
        "--sprout-timeline-label": "15rem",
        "min-width": "0",
        "font-family": "var(--sprout-font)",
        "color": "var(--sprout-text)",
        "gap": "12px",
        "display": "grid",
        "container-type": "inline-size"
      },
      ".sprout-timeline[aria-busy=\"true\"] .sprout-timeline-grid:not([data-skeleton])": {
        "opacity": ".6"
      },
      ".sprout-timeline-notice:empty": {
        "display": "none"
      },
      ".sprout-timeline-grid": {
        "grid-template-columns": "auto minmax(0, 1fr)",
        "min-width": "0",
        "display": "grid"
      },
      ".sprout-timeline-labels": {
        "grid-auto-rows": "var(--sprout-timeline-row)",
        "border-right": "1px solid var(--sprout-line)",
        "align-content": "start",
        "min-width": "0",
        "margin": "0",
        "padding": "40px 0 0",
        "list-style": "none",
        "display": "grid"
      },
      ".sprout-timeline-row": {
        "box-sizing": "border-box",
        "min-width": "0",
        "height": "var(--sprout-timeline-row)",
        "border-radius": "var(--sprout-radius-control)",
        "outline": "none",
        "align-items": "center",
        "gap": "8px",
        "padding": "0 8px",
        "display": "flex"
      },
      ".sprout-timeline-row[data-hot]": {
        "background": "var(--sprout-hover)"
      },
      ".sprout-timeline-row[data-openable]": {
        "cursor": "pointer"
      },
      ".sprout-timeline-row:focus-visible": {
        "outline": "var(--sprout-focus-width) solid var(--sprout-focus-ring)",
        "outline-offset": "-2px"
      },
      ".sprout-timeline-label": {
        "width": "var(--sprout-timeline-label)",
        "flex": "none",
        "gap": "2px",
        "min-width": "0",
        "display": "grid"
      },
      ".sprout-timeline-label-head": {
        "align-items": "center",
        "gap": "6px",
        "min-width": "0",
        "display": "flex"
      },
      ".sprout-timeline-label-title, .sprout-timeline-label-dates": {
        "text-overflow": "ellipsis",
        "white-space": "nowrap",
        "overflow": "hidden"
      },
      ".sprout-timeline-label-title": {
        "min-width": "0",
        "font-size": "var(--sprout-text-sm)",
        "font-weight": "500",
        "line-height": "1.25rem"
      },
      ".sprout-timeline-label-dates": {
        "min-width": "0",
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)",
        "font-variant-numeric": "tabular-nums",
        "align-items": "center",
        "gap": "6px",
        "line-height": "1rem",
        "display": "flex"
      },
      ".sprout-timeline-label-text": {
        "text-overflow": "ellipsis",
        "overflow": "hidden"
      },
      ".sprout-timeline-label-clip": {
        "color": "var(--sprout-text)",
        "flex": "none"
      },
      ".sprout-timeline-label-clip:before": {
        "content": "\"· \"",
        "color": "var(--sprout-muted)"
      },
      ".sprout-timeline-label-marker": {
        "flex": "none"
      },
      ".sprout-timeline-label-warning": {
        "color": "var(--sprout-warning)",
        "flex": "none",
        "font-weight": "500",
        "display": "none"
      },
      ".sprout-timeline-label-warning:after": {
        "content": "\" ·\"",
        "color": "var(--sprout-muted)",
        "font-weight": "400"
      },
      ".sprout-timeline-row-actions": {
        "align-items": "center",
        "gap": "4px",
        "margin-left": "auto",
        "display": "flex"
      },
      ".sprout-timeline-plot": {
        "min-width": "0",
        "position": "relative"
      },
      ".sprout-timeline-band": {
        "inset-inline": "0",
        "top": "calc(40px + var(--sprout-timeline-index) * var(--sprout-timeline-row))",
        "height": "var(--sprout-timeline-row)",
        "background": "var(--sprout-hover)",
        "pointer-events": "none",
        "position": "absolute"
      },
      ".sprout-chart.sprout-timeline-chart": {
        "height": "calc(var(--sprout-timeline-count) * var(--sprout-timeline-row) + 40px)",
        "position": "relative"
      },
      ".sprout-timeline-chart .recharts-cartesian-axis-tick-value": {
        "font-variant-numeric": "tabular-nums"
      },
      ".sprout-timeline-chart .recharts-bar-rectangle, .sprout-timeline-point": {
        "cursor": "inherit"
      },
      ".sprout-timeline-chevron": {
        "fill": "none",
        "stroke": "var(--sprout-surface)",
        "stroke-width": "1.5px",
        "stroke-linecap": "round",
        "stroke-linejoin": "round"
      },
      ".sprout-timeline-today rect": {
        "fill": "var(--sprout-chart-1)"
      },
      ".sprout-timeline-today text": {
        "fill": "var(--sprout-surface)",
        "font-size": ".6875rem",
        "font-weight": "500"
      },
      ".sprout-timeline-grid[data-skeleton] .sprout-timeline-label": {
        "gap": "6px"
      },
      ".sprout-timeline-skeleton-band": {
        "height": "var(--sprout-timeline-row)",
        "align-items": "center",
        "padding-inline": "16px",
        "display": "flex"
      },
      ".sprout-timeline-grid[data-skeleton] .sprout-timeline-plot": {
        "padding-top": "40px"
      },
      ".sprout-timeline-legend": {
        "justify-content": "flex-start",
        "padding-top": "0"
      },
      ".sprout-timeline-undated": {
        "color": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-sm)",
        "flex-wrap": "wrap",
        "align-items": "center",
        "gap": "4px 12px",
        "margin": "0",
        "line-height": "1.25rem",
        "display": "flex"
      },
      ".sprout-timeline-state": {
        "min-height": "12rem"
      },
      "@container (width <= 40rem)": {
        ".sprout-timeline-grid": {
          "--sprout-timeline-label": "8rem"
        },
        ".sprout-timeline-row": {
          "gap": "4px",
          "padding": "0 4px"
        },
        ".sprout-timeline-label-clip, .sprout-timeline-label-marker": {
          "display": "none"
        },
        ".sprout-timeline-label-warning": {
          "display": "inline"
        }
      },
      ".sprout-timeline-window-bar": {
        "min-width": "0",
        "font-family": "var(--sprout-font)",
        "flex-wrap": "wrap",
        "align-items": "center",
        "gap": "8px 12px",
        "display": "flex"
      },
      ".sprout-timeline-window-nav": {
        "align-items": "center",
        "gap": "4px",
        "display": "flex"
      },
      ".sprout-timeline-window-title": {
        "min-width": "0",
        "color": "var(--sprout-text)",
        "font-size": "var(--sprout-text-base)",
        "font-variant-numeric": "tabular-nums",
        "white-space": "nowrap",
        "flex": "auto",
        "margin": "0",
        "font-weight": "600",
        "line-height": "1.5rem"
      },
      ".sprout-timeline-window-actions": {
        "flex-wrap": "wrap",
        "align-items": "center",
        "gap": "8px",
        "display": "flex"
      },
      "@media (width <= 40rem)": {
        ".sprout-timeline-window-zoom": {
          "flex-basis": "100%",
          "width": "100%"
        },
        ".sprout-timeline-window-zoom > *": {
          "flex": "1 1 0"
        }
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-timeline-row": {
          "transition": "background-color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        },
        ".sprout-timeline-grid, .sprout-timeline .sprout-timeline-state": {
          "animation": "sprout-timeline-in var(--sprout-motion-normal) var(--sprout-motion-ease)"
        },
        ".sprout-timeline-grid:not([data-skeleton])": {
          "transition": "opacity var(--sprout-motion-normal) var(--sprout-motion-ease)"
        }
      },
      "@keyframes sprout-timeline-in": {
        "from": {
          "opacity": ".4"
        }
      },
      "@media (forced-colors: active)": {
        ".sprout-timeline-row:focus-visible": {
          "outline-color": "highlight"
        },
        ".sprout-timeline-row[data-hot], .sprout-timeline-band": {
          "outline-offset": "-1px",
          "outline": "1px solid canvastext"
        },
        ".sprout-chart-tooltip": {
          "border-color": "canvastext"
        },
        ".sprout-chart-tooltip-indicator, .sprout-chart-legend-swatch, .sprout-chart-heatmap-table td, .sprout-chart-heatmap-scale > i": {
          "forced-color-adjust": "none"
        },
        ".sprout-chart .recharts-surface:focus-visible": {
          "outline-color": "highlight"
        }
      },
      ".sprout-chart": {
        "aspect-ratio": "16 / 9",
        "min-width": "0",
        "font-family": "var(--sprout-font)",
        "font-size": "var(--sprout-text-xs)",
        "color": "var(--sprout-text)",
        "justify-content": "center",
        "line-height": "1rem",
        "display": "flex",
        "container-type": "inline-size"
      },
      ".sprout-chart .recharts-responsive-container > div > :not(.recharts-wrapper)": {
        "width": "100cqi"
      },
      ".sprout-chart-usage, .sprout-chart-category, .sprout-chart-trend, .sprout-chart-area, .sprout-chart-combo, .sprout-chart-donut, .sprout-chart-funnel, .sprout-chart-waterfall, .sprout-chart-timeline, .sprout-chart-scatter, .sprout-chart-treemap, .sprout-chart-sankey, .sprout-chart-radar, .sprout-chart-sparkline": {
        "aspect-ratio": "auto",
        "width": "100%"
      },
      ".sprout-chart-usage": {
        "height": "16rem"
      },
      ".sprout-chart-category, .sprout-chart-trend, .sprout-chart-area, .sprout-chart-combo, .sprout-chart-donut, .sprout-chart-waterfall, .sprout-chart-scatter, .sprout-chart-treemap": {
        "height": "18rem"
      },
      ".sprout-chart-sankey, .sprout-chart-radar": {
        "height": "20rem"
      },
      ".sprout-chart-sparkline": {
        "height": "2.5rem"
      },
      ".sprout-chart-gauge": {
        "aspect-ratio": "2 / 1.25",
        "width": "100%",
        "max-width": "20rem",
        "margin-inline": "auto"
      },
      ".sprout-chart .recharts-polar-angle-axis-tick-value": {
        "fill": "var(--sprout-muted)"
      },
      ".sprout-chart-center-value": {
        "fill": "var(--sprout-text)",
        "font-variant-numeric": "tabular-nums",
        "font-size": "1.5rem",
        "font-weight": "600"
      },
      ".sprout-chart-center-label": {
        "fill": "var(--sprout-muted)",
        "font-size": "var(--sprout-text-xs)"
      },
      ".sprout-chart-treemap-label": {
        "fill": "var(--sprout-surface)",
        "pointer-events": "none",
        "font-weight": "500"
      },
      ".sprout-chart-treemap-value": {
        "font-variant-numeric": "tabular-nums",
        "font-weight": "400"
      },
      ".sprout-chart-sankey-label": {
        "fill": "var(--sprout-text)",
        "font-weight": "500"
      },
      ".sprout-chart-sankey-value": {
        "fill": "var(--sprout-muted)",
        "font-variant-numeric": "tabular-nums",
        "font-weight": "400"
      },
      ".sprout-chart-sankey-link:hover": {
        "stroke-opacity": ".5"
      },
      ".sprout-chart-heatmap": {
        "width": "100%",
        "font-family": "var(--sprout-font)",
        "font-size": "var(--sprout-text-xs)",
        "color": "var(--sprout-muted)",
        "gap": "12px",
        "line-height": "1rem",
        "display": "grid"
      },
      ".sprout-chart-heatmap-scroll": {
        "overflow-x": "auto"
      },
      ".sprout-chart-heatmap-table": {
        "width": "100%",
        "min-width": "calc(var(--sprout-heat-columns) * 1.25rem + 3rem)",
        "border-collapse": "separate",
        "border-spacing": "3px",
        "table-layout": "fixed"
      },
      ".sprout-chart-heatmap-table th": {
        "white-space": "nowrap",
        "font-weight": "400"
      },
      ".sprout-chart-heatmap-table thead th": {
        "text-overflow": "clip",
        "text-align": "center",
        "overflow": "hidden"
      },
      ".sprout-chart-heatmap-table tbody th": {
        "text-align": "right",
        "width": "3rem",
        "padding-right": "6px"
      },
      ".sprout-chart-heatmap-table td": {
        "border-radius": "3px",
        "height": "1.5rem",
        "position": "relative"
      },
      ".sprout-chart-heatmap-table td[data-tip]:hover": {
        "outline": "1.5px solid var(--sprout-text)",
        "outline-offset": "1px"
      },
      ".sprout-chart-heatmap-table td[data-tip]:hover:after": {
        "content": "attr(data-tip)",
        "z-index": "1",
        "border": "1px solid var(--sprout-line)",
        "border-radius": "var(--sprout-radius-control)",
        "background": "var(--sprout-surface)",
        "color": "var(--sprout-text)",
        "box-shadow": "var(--sprout-shadow-overlay)",
        "white-space": "nowrap",
        "pointer-events": "none",
        "padding": "6px 10px",
        "position": "absolute",
        "bottom": "calc(100% + 6px)",
        "left": "50%",
        "translate": "-50%"
      },
      ".sprout-chart-heatmap-scale": {
        "justify-content": "flex-end",
        "align-items": "center",
        "gap": "3px",
        "display": "flex"
      },
      ".sprout-chart-heatmap-scale > i": {
        "border-radius": "2px",
        "width": "12px",
        "height": "12px"
      },
      ".sprout-chart-heatmap-scale > span:first-child": {
        "margin-right": "4px"
      },
      ".sprout-chart-heatmap-scale > span:last-child": {
        "margin-left": "4px"
      },
      ".sprout-chart-sr-only": {
        "clip-path": "inset(50%)",
        "white-space": "nowrap",
        "width": "1px",
        "height": "1px",
        "position": "absolute",
        "overflow": "hidden"
      },
      ".sprout-chart .recharts-cartesian-axis-tick-value": {
        "fill": "var(--sprout-muted)"
      },
      ".sprout-chart .recharts-cartesian-grid line[stroke=\"oklch(0.8452 0 0)\"], .sprout-chart .recharts-polar-grid [stroke=\"oklch(0.8452 0 0)\"], .sprout-chart .recharts-reference-line [stroke=\"oklch(0.8452 0 0)\"]": {
        "stroke": "var(--sprout-line)"
      },
      ".sprout-chart .recharts-curve.recharts-tooltip-cursor": {
        "stroke": "var(--sprout-border)"
      },
      ".sprout-chart .recharts-rectangle.recharts-tooltip-cursor": {
        "fill": "var(--sprout-hover)"
      },
      ".sprout-chart .recharts-radial-bar-background-sector": {
        "fill": "var(--sprout-secondary)"
      },
      ".sprout-chart .recharts-dot[stroke=\"oklch(1 0 0)\"], .sprout-chart .recharts-sector[stroke=\"oklch(1 0 0)\"]": {
        "stroke": "#0000"
      },
      ".sprout-chart .recharts-layer, .sprout-chart .recharts-sector, .sprout-chart .recharts-wrapper, .sprout-chart .recharts-surface": {
        "outline": "none"
      },
      ".sprout-chart .recharts-surface": {
        "border-radius": "var(--sprout-radius-control)",
        "overflow": "visible"
      },
      ".sprout-chart .recharts-surface:focus-visible": {
        "outline": "var(--sprout-focus-width) solid var(--sprout-focus-ring)",
        "outline-offset": "0"
      },
      ".sprout-chart-tooltip": {
        "border": "1px solid var(--sprout-line)",
        "border-radius": "var(--sprout-radius-control)",
        "background": "var(--sprout-surface)",
        "width": "max-content",
        "min-width": "8rem",
        "max-width": "20rem",
        "color": "var(--sprout-text)",
        "box-shadow": "var(--sprout-shadow-overlay)",
        "font-family": "var(--sprout-font)",
        "font-size": "var(--sprout-text-xs)",
        "align-items": "start",
        "gap": "6px",
        "padding": "6px 10px",
        "line-height": "1rem",
        "display": "grid"
      },
      ".sprout-chart-tooltip-label": {
        "font-weight": "500"
      },
      ".sprout-chart-tooltip-items": {
        "gap": "6px",
        "display": "grid"
      },
      ".sprout-chart-tooltip-item": {
        "flex-wrap": "wrap",
        "align-items": "stretch",
        "gap": "8px",
        "width": "100%",
        "display": "flex"
      },
      ".sprout-chart-tooltip[data-indicator=\"dot\"] .sprout-chart-tooltip-item": {
        "align-items": "center"
      },
      ".sprout-chart-tooltip-item > svg": {
        "width": "10px",
        "height": "10px",
        "color": "var(--sprout-muted)"
      },
      ".sprout-chart-tooltip-indicator": {
        "border": "0 solid var(--sprout-chart-indicator)",
        "background": "var(--sprout-chart-indicator)",
        "border-radius": "2px",
        "flex-shrink": "0"
      },
      "[data-indicator=\"dot\"] .sprout-chart-tooltip-indicator": {
        "width": "10px",
        "height": "10px"
      },
      "[data-indicator=\"line\"] .sprout-chart-tooltip-indicator": {
        "width": "4px"
      },
      "[data-indicator=\"dashed\"] .sprout-chart-tooltip-indicator": {
        "background": "none",
        "border-style": "dashed",
        "border-width": "1.5px",
        "width": "0"
      },
      "[data-indicator=\"dashed\"] .sprout-chart-tooltip-item:has([data-nested]) .sprout-chart-tooltip-indicator": {
        "margin-block": "2px"
      },
      ".sprout-chart-tooltip-row": {
        "flex": "1",
        "justify-content": "space-between",
        "align-items": "center",
        "gap": "12px",
        "line-height": "1",
        "display": "flex"
      },
      ".sprout-chart-tooltip-row[data-nested]": {
        "align-items": "flex-end"
      },
      ".sprout-chart-tooltip-name": {
        "gap": "6px",
        "display": "grid"
      },
      ".sprout-chart-tooltip-name > span": {
        "color": "var(--sprout-muted)"
      },
      ".sprout-chart-tooltip-value": {
        "font-variant-numeric": "tabular-nums",
        "color": "var(--sprout-text)",
        "font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
        "font-weight": "500"
      },
      ".sprout-chart-legend": {
        "font-family": "var(--sprout-font)",
        "font-size": "var(--sprout-text-xs)",
        "color": "var(--sprout-text)",
        "flex-wrap": "wrap",
        "justify-content": "center",
        "align-items": "center",
        "gap": "4px 16px",
        "padding-top": "12px",
        "line-height": "1rem",
        "display": "flex"
      },
      ".sprout-chart-legend[data-align=\"top\"]": {
        "padding-top": "0",
        "padding-bottom": "12px"
      },
      ".sprout-chart-legend-item": {
        "align-items": "center",
        "gap": "6px",
        "display": "flex"
      },
      ".sprout-chart-legend-item > svg": {
        "width": "12px",
        "height": "12px",
        "color": "var(--sprout-muted)"
      },
      ".sprout-chart-legend-swatch": {
        "border-radius": "2px",
        "flex-shrink": "0",
        "width": "8px",
        "height": "8px"
      },
      ".sprout-state-panel": {
        "font-family": "var(--sprout-font)",
        "color": "var(--sprout-text)",
        "overflow-wrap": "anywhere",
        "animation": "sprout-state-panel-in var(--sprout-motion-normal, .18s) var(--sprout-motion-ease, ease) both"
      },
      ".sprout-state-panel[data-layout=\"centered\"]": {
        "text-align": "center",
        "flex-direction": "column",
        "align-items": "center",
        "gap": "1.5rem",
        "width": "100%",
        "max-width": "28rem",
        "margin-inline": "auto",
        "padding": "3rem 1.5rem",
        "display": "flex"
      },
      ".sprout-state-panel-media": {
        "border": "1px solid var(--sprout-line)",
        "background": "var(--sprout-surface)",
        "width": "2.5rem",
        "height": "2.5rem",
        "color": "var(--sprout-text)",
        "box-shadow": "var(--sprout-shadow-control)",
        "border-radius": ".5rem",
        "flex-shrink": "0",
        "justify-content": "center",
        "align-items": "center",
        "display": "flex"
      },
      ".sprout-state-panel-media > svg": {
        "flex-shrink": "0"
      },
      ".sprout-state-panel-danger": {
        "color": "var(--sprout-danger)"
      },
      ".sprout-state-panel-text": {
        "gap": ".5rem",
        "width": "100%",
        "display": "grid"
      },
      ".sprout-state-panel-title": {
        "font-size": "var(--sprout-text-base)",
        "letter-spacing": "normal",
        "color": "var(--sprout-text)",
        "margin": "0",
        "font-weight": "500",
        "line-height": "1.5"
      },
      ".sprout-state-panel-description": {
        "font-size": "var(--sprout-text-sm)",
        "color": "var(--sprout-muted)",
        "margin": "0",
        "line-height": "1.5"
      },
      ".sprout-state-panel-actions": {
        "width": "100%",
        "font-size": "var(--sprout-text-sm)",
        "color": "var(--sprout-muted)",
        "flex-direction": "column",
        "align-items": "center",
        "gap": ".75rem",
        "display": "flex"
      },
      ".sprout-state-panel-actions:empty": {
        "display": "none"
      },
      ".sprout-state-panel[data-layout=\"sample\"]": {
        "width": "100%",
        "container-type": "inline-size"
      },
      ".sprout-state-panel-card": {
        "border": "1px solid var(--sprout-line)",
        "border-radius": "var(--sprout-radius-panel)",
        "background": "var(--sprout-surface)",
        "box-shadow": "var(--sprout-shadow-control)",
        "display": "grid",
        "overflow": "hidden"
      },
      ".sprout-state-panel-copy": {
        "flex-direction": "column",
        "justify-content": "center",
        "align-items": "flex-start",
        "gap": "1.5rem",
        "min-width": "0",
        "padding": "1.5rem",
        "display": "flex"
      },
      "[data-layout=\"sample\"] .sprout-state-panel-text": {
        "max-width": "28rem"
      },
      "[data-layout=\"sample\"] .sprout-state-panel-title": {
        "font-size": "1.25rem",
        "line-height": "1.4"
      },
      "[data-layout=\"sample\"] .sprout-state-panel-description": {
        "font-size": "var(--sprout-text-base)"
      },
      "[data-layout=\"sample\"] .sprout-state-panel-actions": {
        "align-items": "stretch",
        "gap": ".5rem"
      },
      ".sprout-state-panel-sample": {
        "border-top": "1px solid var(--sprout-line)",
        "background": "var(--sprout-canvas)",
        "min-height": "15rem",
        "display": "none",
        "position": "relative",
        "overflow": "hidden"
      },
      ".sprout-state-panel-sample-window": {
        "border-top": "1px solid var(--sprout-line)",
        "border-left": "1px solid var(--sprout-line)",
        "border-top-left-radius": "var(--sprout-radius-panel)",
        "background": "var(--sprout-surface)",
        "box-shadow": "var(--sprout-shadow-panel)",
        "position": "absolute",
        "inset": "1.5rem 0 0 1.5rem",
        "overflow": "hidden",
        "mask-image": "linear-gradient(oklch(0% 0 0) 60%, #0000 100%)"
      },
      "@container (width >= 24rem)": {
        "[data-layout=\"sample\"] .sprout-state-panel-actions": {
          "flex-flow": "wrap",
          "align-items": "center",
          "width": "auto"
        }
      },
      "@container (width >= 28rem)": {
        ".sprout-state-panel-sample": {
          "display": "block"
        }
      },
      "@container (width >= 32rem)": {
        ".sprout-state-panel-copy": {
          "padding": "2.5rem"
        }
      },
      "@container (width >= 48rem)": {
        ".sprout-state-panel-card": {
          "grid-template-columns": "minmax(0, 5fr) minmax(0, 6fr)"
        },
        ".sprout-state-panel-copy": {
          "padding-block": "3.5rem"
        },
        ".sprout-state-panel-sample": {
          "border-top": "0",
          "border-left": "1px solid var(--sprout-line)",
          "min-height": "22rem"
        }
      },
      "@media (prefers-reduced-motion: reduce)": {
        ".sprout-state-panel": {
          "animation-name": "sprout-state-panel-fade"
        }
      },
      "@keyframes sprout-state-panel-fade": {
        "from": {
          "opacity": "0"
        }
      },
      "@keyframes sprout-state-panel-in": {
        "from": {
          "opacity": "0",
          "transform": "translateY(4px)"
        }
      }
    },
    "@layer base": {
      ":root, .light": {
        "--sprout-red": "oklch(58.58% .222 17.58)",
        "--sprout-orange": "oklch(64.61% .1943 41.12)",
        "--sprout-yellow": "oklch(65.2% .1388 73.08)",
        "--sprout-green": "oklch(62.71% .1699 149.21)",
        "--sprout-teal": "oklch(60.02% .1038 184.7)",
        "--sprout-sky": "oklch(58.76% .1389 241.97)",
        "--sprout-blue": "oklch(54.61% .2152 262.88)",
        "--sprout-indigo": "oklch(51.06% .2301 276.97)",
        "--sprout-purple": "oklch(55.75% .2525 302.32)",
        "--sprout-tan": "oklch(61.06% .0869 73.23)"
      },
      ".dark": {
        "--sprout-red": "oklch(65.79% .1955 13.34)",
        "--sprout-orange": "oklch(77.98% .1484 67.74)",
        "--sprout-yellow": "oklch(87.59% .1575 96.07)",
        "--sprout-green": "oklch(77.5% .1715 145.98)",
        "--sprout-teal": "oklch(77.28% .0993 201.91)",
        "--sprout-sky": "oklch(73.46% .111 235.16)",
        "--sprout-blue": "oklch(65.26% .1738 259.4)",
        "--sprout-indigo": "oklch(62.3% .1832 282.92)",
        "--sprout-purple": "oklch(66.45% .1843 308.71)",
        "--sprout-tan": "oklch(74.86% .0626 77.32)"
      },
      "@media (prefers-color-scheme: dark)": {
        ":root:not(.light):not(.dark)": {
          "--sprout-red": "oklch(65.79% .1955 13.34)",
          "--sprout-orange": "oklch(77.98% .1484 67.74)",
          "--sprout-yellow": "oklch(87.59% .1575 96.07)",
          "--sprout-green": "oklch(77.5% .1715 145.98)",
          "--sprout-teal": "oklch(77.28% .0993 201.91)",
          "--sprout-sky": "oklch(73.46% .111 235.16)",
          "--sprout-blue": "oklch(65.26% .1738 259.4)",
          "--sprout-indigo": "oklch(62.3% .1832 282.92)",
          "--sprout-purple": "oklch(66.45% .1843 308.71)",
          "--sprout-tan": "oklch(74.86% .0626 77.32)"
        }
      },
      ":root, .light, .dark": {
        "--sprout-chart-1": "var(--sprout-indigo)",
        "--sprout-chart-2": "var(--sprout-green)",
        "--sprout-chart-3": "var(--sprout-orange)",
        "--sprout-chart-4": "var(--sprout-red)",
        "--sprout-chart-5": "var(--sprout-sky)",
        "--sprout-chart-6": "var(--sprout-purple)",
        "--sprout-chart-7": "var(--sprout-yellow)",
        "--sprout-chart-8": "var(--sprout-teal)",
        "--sprout-chart-9": "var(--sprout-blue)",
        "--sprout-chart-10": "var(--sprout-tan)"
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/timeline/",
  "meta": {
    "source": "packages/sprout/src/components/timeline.tsx"
  }
}
