{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chart-theme",
  "title": "Chart theme",
  "description": "Chart colour tokens as CSS variable references, so TanStack Charts follow light and dark.",
  "registryDependencies": [
    "https://sproutboat.com/ikada/r/theme.json",
    "https://sproutboat.com/ikada/r/tokens.json"
  ],
  "files": [
    {
      "path": "registry/ikada/ui/chart-theme.ts",
      "content": "/** Chart colour tokens as CSS variable references, so TanStack Charts follow light and dark. */\nimport type { ColorToken } from \"@/components/ikada/lib/tokens\";\nimport { colorVar } from \"@/components/ikada/lib/tokens\";\n\n/** The chart color tokens, by the name a chart uses for them. */\nexport const chartTokens = {\n  requests: \"chart-requests\",\n  errors: \"chart-errors\",\n  deploy: \"chart-deploy\",\n  grid: \"chart-grid\",\n  \"2xx\": \"chart-2xx\",\n  \"3xx\": \"chart-3xx\",\n  \"4xx\": \"chart-4xx\",\n  \"5xx\": \"chart-5xx\",\n  other: \"chart-other\",\n  series: \"chart-series\",\n} as const satisfies Record<string, ColorToken>;\n\nexport type ChartColorName = keyof typeof chartTokens;\n\n/**\n * `var(--sb-chart-*)` references. Marks take these strings, so a chart follows the\n * theme (light, dark) with no rebuild of its definition.\n */\nexport const chartColors = {\n  requests: colorVar(chartTokens.requests),\n  errors: colorVar(chartTokens.errors),\n  deploy: colorVar(chartTokens.deploy),\n  grid: colorVar(chartTokens.grid),\n  \"2xx\": colorVar(chartTokens[\"2xx\"]),\n  \"3xx\": colorVar(chartTokens[\"3xx\"]),\n  \"4xx\": colorVar(chartTokens[\"4xx\"]),\n  \"5xx\": colorVar(chartTokens[\"5xx\"]),\n  other: colorVar(chartTokens.other),\n  series: colorVar(chartTokens.series),\n} satisfies Record<ChartColorName, string>;\n\n/** HTTP status class to its chart color; unknown classes fall back to `other`. */\nexport const statusClassColor = (cls: string): string =>\n  chartColors[cls === \"2xx\" || cls === \"3xx\" || cls === \"4xx\" || cls === \"5xx\" ? cls : \"other\"];\n\n/** Class that scopes the tooltip surface and palette variables defined in theme.css. */\nexport const chartClassName = \"sb-chart\";\n",
      "type": "registry:ui",
      "target": "@components/ikada/chart-theme.ts"
    }
  ],
  "categories": [
    "charts",
    "utilities"
  ],
  "type": "registry:ui"
}