{"version":3,"sources":["../src/theme/index.ts","../src/theme/presets.ts","../src/theme/contrast.ts","../src/theme/create-theme.ts","../src/theme/apply-theme.ts","../src/theme/theme-file.ts","../src/theme/chart-colors.ts"],"sourcesContent":["export {\n  type ThemeTokens,\n  type ThemePreset,\n  type ThemePresetName,\n  defaultTheme,\n  neutralTheme,\n  oceanTheme,\n  forestTheme,\n  themePresets,\n} from './presets'\n\nexport { createTheme, type CreateThemeOptions } from './create-theme'\n\nexport { applyTheme, applyDarkTheme, themeToCSS } from './apply-theme'\n\nexport {\n  parseThemeFile,\n  themeFileToCSS,\n  ThemeFileError,\n  type ThemeFile,\n  type ThemeFileToCSSOptions,\n} from './theme-file'\n\nexport { chartColors, chartColorList, type ChartColorKey } from './chart-colors'\n","/**\n * Built-in theme presets for Arkite UI.\n *\n * Each preset defines CSS variable values (HSL format without the hsl() wrapper).\n * Apply by calling `applyTheme(preset)` or import the CSS directly.\n */\n\nexport interface ThemeTokens {\n  primary: string\n  'primary-foreground': string\n  secondary: string\n  'secondary-foreground': string\n  accent: string\n  'accent-foreground': string\n  success: string\n  'success-foreground': string\n  warning: string\n  'warning-foreground': string\n  destructive: string\n  'destructive-foreground': string\n  info: string\n  'info-foreground': string\n  'success-soft': string\n  'success-soft-foreground': string\n  'success-border': string\n  'warning-soft': string\n  'warning-soft-foreground': string\n  'warning-border': string\n  'destructive-soft': string\n  'destructive-soft-foreground': string\n  'destructive-border': string\n  'info-soft': string\n  'info-soft-foreground': string\n  'info-border': string\n  background: string\n  foreground: string\n  muted: string\n  'muted-foreground': string\n  card: string\n  'card-foreground': string\n  border: string\n  input: string\n  ring: string\n  radius: string\n}\n\nexport interface ThemePreset {\n  name: string\n  light: ThemeTokens\n  dark: ThemeTokens\n}\n\n// --- Default (Stripe-inspired purple) ---\nexport const defaultTheme: ThemePreset = {\n  name: 'default',\n  light: {\n    primary: '250 100% 65%',\n    'primary-foreground': '0 0% 100%',\n    secondary: '220 14% 96%',\n    'secondary-foreground': '220 9% 35%',\n    accent: '168 80% 45%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 42%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 50%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 51%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 53%',\n    'info-foreground': '0 0% 100%',\n    'success-soft': '138 76% 97%',\n    'success-soft-foreground': '143 64% 24%',\n    'success-border': '141 79% 85%',\n    'warning-soft': '55 92% 95%',\n    'warning-soft-foreground': '32 81% 29%',\n    'warning-border': '53 98% 77%',\n    'destructive-soft': '0 86% 97%',\n    'destructive-soft-foreground': '0 70% 35%',\n    'destructive-border': '0 96% 89%',\n    'info-soft': '214 100% 97%',\n    'info-soft-foreground': '226 71% 40%',\n    'info-border': '213 97% 87%',\n    background: '0 0% 100%',\n    foreground: '220 15% 20%',\n    muted: '220 14% 96%',\n    'muted-foreground': '220 9% 40%',\n    card: '0 0% 100%',\n    'card-foreground': '220 15% 20%',\n    border: '220 13% 91%',\n    input: '220 13% 91%',\n    ring: '250 100% 65%',\n    radius: '0.5rem',\n  },\n  dark: {\n    primary: '250 100% 67%',\n    'primary-foreground': '0 0% 100%',\n    secondary: '220 15% 18%',\n    'secondary-foreground': '0 0% 95%',\n    accent: '168 80% 50%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 50%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 55%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 53%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 60%',\n    'info-foreground': '0 0% 0%',\n    'success-soft': '145 80% 10%',\n    'success-soft-foreground': '141 79% 85%',\n    'success-border': '144 61% 20%',\n    'warning-soft': '26 83% 14%',\n    'warning-soft-foreground': '53 98% 77%',\n    'warning-border': '28 73% 26%',\n    'destructive-soft': '0 75% 15%',\n    'destructive-soft-foreground': '0 96% 89%',\n    'destructive-border': '0 63% 31%',\n    'info-soft': '226 57% 21%',\n    'info-soft-foreground': '213 97% 87%',\n    'info-border': '224 64% 33%',\n    background: '220 20% 10%',\n    foreground: '0 0% 95%',\n    muted: '220 15% 18%',\n    'muted-foreground': '220 9% 60%',\n    card: '220 18% 13%',\n    'card-foreground': '0 0% 95%',\n    border: '220 15% 22%',\n    input: '220 15% 22%',\n    ring: '250 100% 67%',\n    radius: '0.5rem',\n  },\n}\n\n// --- Neutral (Zinc/Slate monochrome) ---\nexport const neutralTheme: ThemePreset = {\n  name: 'neutral',\n  light: {\n    primary: '220 9% 20%',\n    'primary-foreground': '0 0% 100%',\n    secondary: '220 14% 96%',\n    'secondary-foreground': '220 9% 35%',\n    accent: '220 9% 48%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 42%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 50%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 51%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 53%',\n    'info-foreground': '0 0% 100%',\n    'success-soft': '138 76% 97%',\n    'success-soft-foreground': '143 64% 24%',\n    'success-border': '141 79% 85%',\n    'warning-soft': '55 92% 95%',\n    'warning-soft-foreground': '32 81% 29%',\n    'warning-border': '53 98% 77%',\n    'destructive-soft': '0 86% 97%',\n    'destructive-soft-foreground': '0 70% 35%',\n    'destructive-border': '0 96% 89%',\n    'info-soft': '214 100% 97%',\n    'info-soft-foreground': '226 71% 40%',\n    'info-border': '213 97% 87%',\n    background: '0 0% 100%',\n    foreground: '220 15% 15%',\n    muted: '220 14% 96%',\n    'muted-foreground': '220 9% 40%',\n    card: '0 0% 100%',\n    'card-foreground': '220 15% 15%',\n    border: '220 13% 91%',\n    input: '220 13% 91%',\n    ring: '220 9% 20%',\n    radius: '0.375rem',\n  },\n  dark: {\n    primary: '0 0% 98%',\n    'primary-foreground': '220 15% 10%',\n    secondary: '220 15% 18%',\n    'secondary-foreground': '0 0% 95%',\n    accent: '220 9% 60%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 50%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 55%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 53%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 60%',\n    'info-foreground': '0 0% 0%',\n    'success-soft': '145 80% 10%',\n    'success-soft-foreground': '141 79% 85%',\n    'success-border': '144 61% 20%',\n    'warning-soft': '26 83% 14%',\n    'warning-soft-foreground': '53 98% 77%',\n    'warning-border': '28 73% 26%',\n    'destructive-soft': '0 75% 15%',\n    'destructive-soft-foreground': '0 96% 89%',\n    'destructive-border': '0 63% 31%',\n    'info-soft': '226 57% 21%',\n    'info-soft-foreground': '213 97% 87%',\n    'info-border': '224 64% 33%',\n    background: '220 15% 8%',\n    foreground: '0 0% 95%',\n    muted: '220 15% 14%',\n    'muted-foreground': '220 9% 55%',\n    card: '220 15% 11%',\n    'card-foreground': '0 0% 95%',\n    border: '220 15% 20%',\n    input: '220 15% 20%',\n    ring: '0 0% 98%',\n    radius: '0.375rem',\n  },\n}\n\n// --- Ocean (Blue tones) ---\nexport const oceanTheme: ThemePreset = {\n  name: 'ocean',\n  light: {\n    primary: '210 100% 45%',\n    'primary-foreground': '0 0% 100%',\n    secondary: '210 20% 96%',\n    'secondary-foreground': '210 12% 35%',\n    accent: '190 90% 45%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 42%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 50%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 51%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 53%',\n    'info-foreground': '0 0% 100%',\n    'success-soft': '138 76% 97%',\n    'success-soft-foreground': '143 64% 24%',\n    'success-border': '141 79% 85%',\n    'warning-soft': '55 92% 95%',\n    'warning-soft-foreground': '32 81% 29%',\n    'warning-border': '53 98% 77%',\n    'destructive-soft': '0 86% 97%',\n    'destructive-soft-foreground': '0 70% 35%',\n    'destructive-border': '0 96% 89%',\n    'info-soft': '214 100% 97%',\n    'info-soft-foreground': '226 71% 40%',\n    'info-border': '213 97% 87%',\n    background: '210 20% 99%',\n    foreground: '210 20% 15%',\n    muted: '210 20% 96%',\n    'muted-foreground': '210 12% 40%',\n    card: '0 0% 100%',\n    'card-foreground': '210 20% 15%',\n    border: '210 18% 90%',\n    input: '210 18% 90%',\n    ring: '210 100% 45%',\n    radius: '0.5rem',\n  },\n  dark: {\n    primary: '210 100% 60%',\n    'primary-foreground': '0 0% 0%',\n    secondary: '210 20% 18%',\n    'secondary-foreground': '0 0% 95%',\n    accent: '190 90% 55%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 50%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 55%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 53%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 60%',\n    'info-foreground': '0 0% 0%',\n    'success-soft': '145 80% 10%',\n    'success-soft-foreground': '141 79% 85%',\n    'success-border': '144 61% 20%',\n    'warning-soft': '26 83% 14%',\n    'warning-soft-foreground': '53 98% 77%',\n    'warning-border': '28 73% 26%',\n    'destructive-soft': '0 75% 15%',\n    'destructive-soft-foreground': '0 96% 89%',\n    'destructive-border': '0 63% 31%',\n    'info-soft': '226 57% 21%',\n    'info-soft-foreground': '213 97% 87%',\n    'info-border': '224 64% 33%',\n    background: '210 25% 8%',\n    foreground: '0 0% 95%',\n    muted: '210 20% 14%',\n    'muted-foreground': '210 12% 55%',\n    card: '210 22% 11%',\n    'card-foreground': '0 0% 95%',\n    border: '210 18% 20%',\n    input: '210 18% 20%',\n    ring: '210 100% 60%',\n    radius: '0.5rem',\n  },\n}\n\n// --- Forest (Green tones) ---\nexport const forestTheme: ThemePreset = {\n  name: 'forest',\n  light: {\n    primary: '152 60% 33%',\n    'primary-foreground': '0 0% 100%',\n    secondary: '150 15% 96%',\n    'secondary-foreground': '150 12% 35%',\n    accent: '30 80% 55%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 42%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 50%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 51%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 53%',\n    'info-foreground': '0 0% 100%',\n    'success-soft': '138 76% 97%',\n    'success-soft-foreground': '143 64% 24%',\n    'success-border': '141 79% 85%',\n    'warning-soft': '55 92% 95%',\n    'warning-soft-foreground': '32 81% 29%',\n    'warning-border': '53 98% 77%',\n    'destructive-soft': '0 86% 97%',\n    'destructive-soft-foreground': '0 70% 35%',\n    'destructive-border': '0 96% 89%',\n    'info-soft': '214 100% 97%',\n    'info-soft-foreground': '226 71% 40%',\n    'info-border': '213 97% 87%',\n    background: '150 10% 99%',\n    foreground: '150 15% 15%',\n    muted: '150 12% 95%',\n    'muted-foreground': '150 8% 40%',\n    card: '0 0% 100%',\n    'card-foreground': '150 15% 15%',\n    border: '150 12% 90%',\n    input: '150 12% 90%',\n    ring: '152 60% 33%',\n    radius: '0.5rem',\n  },\n  dark: {\n    primary: '152 60% 48%',\n    'primary-foreground': '0 0% 0%',\n    secondary: '150 15% 18%',\n    'secondary-foreground': '0 0% 95%',\n    accent: '30 80% 60%',\n    'accent-foreground': '0 0% 0%',\n    success: '145 65% 50%',\n    'success-foreground': '0 0% 0%',\n    warning: '38 92% 55%',\n    'warning-foreground': '0 0% 0%',\n    destructive: '0 72% 53%',\n    'destructive-foreground': '0 0% 100%',\n    info: '217 91% 60%',\n    'info-foreground': '0 0% 0%',\n    'success-soft': '145 80% 10%',\n    'success-soft-foreground': '141 79% 85%',\n    'success-border': '144 61% 20%',\n    'warning-soft': '26 83% 14%',\n    'warning-soft-foreground': '53 98% 77%',\n    'warning-border': '28 73% 26%',\n    'destructive-soft': '0 75% 15%',\n    'destructive-soft-foreground': '0 96% 89%',\n    'destructive-border': '0 63% 31%',\n    'info-soft': '226 57% 21%',\n    'info-soft-foreground': '213 97% 87%',\n    'info-border': '224 64% 33%',\n    background: '150 20% 8%',\n    foreground: '0 0% 95%',\n    muted: '150 15% 15%',\n    'muted-foreground': '150 8% 55%',\n    card: '150 18% 11%',\n    'card-foreground': '0 0% 95%',\n    border: '150 15% 20%',\n    input: '150 15% 20%',\n    ring: '152 60% 48%',\n    radius: '0.5rem',\n  },\n}\n\n/** All built-in theme presets */\nexport const themePresets = {\n  default: defaultTheme,\n  neutral: neutralTheme,\n  ocean: oceanTheme,\n  forest: forestTheme,\n} as const\n\nexport type ThemePresetName = keyof typeof themePresets\n","/**\n * WCAG 2.1 relative-luminance contrast math.\n *\n * Used by createTheme() to pick guaranteed-AA foregrounds, and by the\n * token/preset contrast regression tests. Same formula as the Storybook\n * \"Foundation / Design Tokens\" audit page.\n */\n\nfunction channelToLinear(v: number): number {\n  return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4)\n}\n\nfunction luminanceFromRgb([r, g, b]: [number, number, number]): number {\n  return 0.2126 * channelToLinear(r) + 0.7152 * channelToLinear(g) + 0.0722 * channelToLinear(b)\n}\n\n/** Luminance of a `#rrggbb` hex color. */\nexport function hexLuminance(hex: string): number {\n  const h = hex.replace('#', '')\n  return luminanceFromRgb([\n    parseInt(h.slice(0, 2), 16) / 255,\n    parseInt(h.slice(2, 4), 16) / 255,\n    parseInt(h.slice(4, 6), 16) / 255,\n  ])\n}\n\n/** sRGB (0..1) of an `\"H S% L%\"` HSL triplet. */\nfunction hslToRgb(hsl: string): [number, number, number] {\n  const [h, s, l] = hsl.split(' ').map((v, i) => parseFloat(v) / (i ? 100 : 1))\n  const c = (1 - Math.abs(2 * l - 1)) * s\n  const x = c * (1 - Math.abs(((h / 60) % 2) - 1))\n  const m = l - c / 2\n  let rgb: [number, number, number]\n  if (h < 60) rgb = [c, x, 0]\n  else if (h < 120) rgb = [x, c, 0]\n  else if (h < 180) rgb = [0, c, x]\n  else if (h < 240) rgb = [0, x, c]\n  else if (h < 300) rgb = [x, 0, c]\n  else rgb = [c, 0, x]\n  return [rgb[0] + m, rgb[1] + m, rgb[2] + m]\n}\n\n/** Luminance of an `\"H S% L%\"` HSL triplet (the theme-preset format). */\nexport function hslLuminance(hsl: string): number {\n  return luminanceFromRgb(hslToRgb(hsl))\n}\n\n/**\n * Share of the base color kept by the solid-fill hover tokens — must match\n * `--color-primary-hover` / `--color-destructive-hover` in styles/index.css:\n * `color-mix(in oklab, <color> 88%, black)`. Black is the oklab origin, so the\n * mix simply scales L, a and b by this factor.\n */\nexport const HOVER_MIX = 0.88\n\n/**\n * Luminance of the hover shade of an `\"H S% L%\"` color, computed exactly like the\n * CSS `color-mix(in oklab, color 88%, black)` (#27: hover must darken, not fade).\n */\nexport function hoverLuminance(hsl: string, keep: number = HOVER_MIX): number {\n  const lin = hslToRgb(hsl).map(channelToLinear)\n  const lms = [\n    0.4122214708 * lin[0] + 0.5363325363 * lin[1] + 0.0514459929 * lin[2],\n    0.2119034982 * lin[0] + 0.6806995451 * lin[1] + 0.1073969566 * lin[2],\n    0.0883024619 * lin[0] + 0.2817188376 * lin[1] + 0.6299787005 * lin[2],\n  ].map(Math.cbrt)\n  const L = (0.2104542553 * lms[0] + 0.793617785 * lms[1] - 0.0040720468 * lms[2]) * keep\n  const A = (1.9779984951 * lms[0] - 2.428592205 * lms[1] + 0.4505937099 * lms[2]) * keep\n  const B = (0.0259040371 * lms[0] + 0.7827717662 * lms[1] - 0.808675766 * lms[2]) * keep\n  const l = (L + 0.3963377774 * A + 0.2158037573 * B) ** 3\n  const m = (L - 0.1055613458 * A - 0.0638541728 * B) ** 3\n  const s = (L - 0.0894841775 * A - 1.291485548 * B) ** 3\n  const r = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s\n  const g = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s\n  const b = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s\n  // Back in linear-light sRGB: clamp to gamut and take relative luminance directly.\n  const clamp = (v: number) => Math.min(1, Math.max(0, v))\n  return 0.2126 * clamp(r) + 0.7152 * clamp(g) + 0.0722 * clamp(b)\n}\n\n/** WCAG contrast ratio (1..21) between two luminances. */\nexport function contrastRatio(lum1: number, lum2: number): number {\n  const [lighter, darker] = lum1 > lum2 ? [lum1, lum2] : [lum2, lum1]\n  return (lighter + 0.05) / (darker + 0.05)\n}\n\n/** WCAG AA threshold for normal-size text. */\nexport const WCAG_AA = 4.5\n\n/**\n * Pick black or white foreground for an `\"H S% L%\"` background, whichever\n * contrasts more. Because contrast(white, bg) × contrast(black, bg) ≡ 21,\n * the winning side is always ≥ √21 ≈ 4.58 — WCAG AA holds for any color.\n */\nexport function pickForeground(hsl: string): string {\n  const bg = hslLuminance(hsl)\n  return contrastRatio(0, bg) >= contrastRatio(1, bg) ? '0 0% 0%' : '0 0% 100%'\n}\n","import type { ThemeTokens, ThemePreset } from './presets'\nimport { defaultTheme } from './presets'\nimport { pickForeground } from './contrast'\n\n/**\n * Parse a hex color to HSL components.\n * Returns \"H S% L%\" string for CSS variable usage.\n */\nfunction hexToHsl(hex: string): string {\n  hex = hex.replace('#', '')\n  if (hex.length === 3) {\n    hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]\n  }\n\n  const r = parseInt(hex.substring(0, 2), 16) / 255\n  const g = parseInt(hex.substring(2, 4), 16) / 255\n  const b = parseInt(hex.substring(4, 6), 16) / 255\n\n  const max = Math.max(r, g, b)\n  const min = Math.min(r, g, b)\n  const l = (max + min) / 2\n\n  if (max === min) {\n    return `0 0% ${Math.round(l * 100)}%`\n  }\n\n  const d = max - min\n  const s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\n\n  let h: number\n  switch (max) {\n    case r:\n      h = ((g - b) / d + (g < b ? 6 : 0)) / 6\n      break\n    case g:\n      h = ((b - r) / d + 2) / 6\n      break\n    default:\n      h = ((r - g) / d + 4) / 6\n      break\n  }\n\n  return `${Math.round(h * 360)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`\n}\n\n/**\n * Adjust the lightness of an HSL string.\n */\nfunction adjustLightness(hsl: string, delta: number): string {\n  const parts = hsl.match(/(\\d+)\\s+(\\d+)%\\s+(\\d+)%/)\n  if (!parts) return hsl\n  const h = parseInt(parts[1])\n  const s = parseInt(parts[2])\n  const l = Math.max(0, Math.min(100, parseInt(parts[3]) + delta))\n  return `${h} ${s}% ${l}%`\n}\n\nexport interface CreateThemeOptions {\n  /** Theme name */\n  name?: string\n  /** Primary brand color (hex) */\n  primary: string\n  /** Accent color (hex). Defaults to a complementary color. */\n  accent?: string\n  /** Border radius. Defaults to \"0.5rem\". */\n  radius?: string\n}\n\n/**\n * Create a complete theme from 1-2 input colors.\n *\n * @example\n * ```ts\n * import { createTheme, applyTheme } from '@arkite-ui/core'\n *\n * const myTheme = createTheme({\n *   primary: '#FF6B00',\n *   accent: '#00B4D8',\n * })\n *\n * applyTheme(myTheme) // applies to :root\n * ```\n */\nexport function createTheme(options: CreateThemeOptions): ThemePreset {\n  const primaryHsl = hexToHsl(options.primary)\n  const accentHsl = options.accent ? hexToHsl(options.accent) : adjustLightness(primaryHsl, 10)\n  const radius = options.radius ?? '0.5rem'\n  const darkPrimaryHsl = adjustLightness(primaryHsl, 8)\n  const darkAccentHsl = adjustLightness(accentHsl, 8)\n\n  const light: ThemeTokens = {\n    ...defaultTheme.light,\n    primary: primaryHsl,\n    'primary-foreground': pickForeground(primaryHsl),\n    accent: accentHsl,\n    'accent-foreground': pickForeground(accentHsl),\n    ring: primaryHsl,\n    radius,\n  }\n\n  const dark: ThemeTokens = {\n    ...defaultTheme.dark,\n    primary: darkPrimaryHsl,\n    'primary-foreground': pickForeground(darkPrimaryHsl),\n    accent: darkAccentHsl,\n    'accent-foreground': pickForeground(darkAccentHsl),\n    ring: darkPrimaryHsl,\n    radius,\n  }\n\n  return {\n    name: options.name ?? 'custom',\n    light,\n    dark,\n  }\n}\n","import type { ThemePreset, ThemeTokens } from './presets'\n\n/**\n * Apply a theme preset's CSS variables to a DOM element.\n * Applies light tokens to the element and dark tokens to `.dark` selector.\n *\n * @param theme - Theme preset to apply\n * @param element - Target element (defaults to document.documentElement)\n */\nexport function applyTheme(theme: ThemePreset, element?: HTMLElement): void {\n  const target = element ?? document.documentElement\n  applyTokens(target, theme.light)\n}\n\n/**\n * Apply dark mode tokens to an element.\n *\n * @param theme - Theme preset to apply\n * @param element - Target element (defaults to document.documentElement)\n */\nexport function applyDarkTheme(theme: ThemePreset, element?: HTMLElement): void {\n  const target = element ?? document.documentElement\n  applyTokens(target, theme.dark)\n}\n\nfunction applyTokens(element: HTMLElement, tokens: ThemeTokens): void {\n  for (const [key, value] of Object.entries(tokens)) {\n    element.style.setProperty(`--${key}`, value)\n  }\n}\n\n/**\n * Generate a CSS string from a theme preset.\n * Useful for SSR or injecting into a <style> tag.\n *\n * @example\n * ```ts\n * const css = themeToCSS(myTheme)\n * // Returns:\n * // :root { --primary: 250 100% 65%; ... }\n * // .dark { --primary: 250 100% 70%; ... }\n * ```\n */\nexport function themeToCSS(theme: ThemePreset, selector = ':root'): string {\n  const lightVars = Object.entries(theme.light)\n    .map(([key, value]) => `  --${key}: ${value};`)\n    .join('\\n')\n\n  const darkVars = Object.entries(theme.dark)\n    .map(([key, value]) => `  --${key}: ${value};`)\n    .join('\\n')\n\n  return `${selector} {\\n${lightVars}\\n}\\n\\n.dark {\\n${darkVars}\\n}`\n}\n","import { createTheme, type CreateThemeOptions } from './create-theme'\nimport { themeToCSS } from './apply-theme'\n\n/**\n * The contents of an `arkite.theme.json` — a project's brand as a committed\n * artifact rather than CSS variables copied between repos.\n *\n * Four values are the whole source of truth; every token in the generated\n * theme is derived from them, so a rebrand is a reviewable four-line diff.\n */\nexport type ThemeFile = CreateThemeOptions\n\n/** Thrown when a theme file is malformed. The message is written for a terminal. */\nexport class ThemeFileError extends Error {\n  override name = 'ThemeFileError'\n}\n\nconst HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i\nconst LENGTH = /^(?:0|\\d*\\.?\\d+(?:rem|em|px))$/\nconst KNOWN_KEYS = ['name', 'primary', 'accent', 'radius'] as const\n\nfunction fail(message: string): never {\n  throw new ThemeFileError(message)\n}\n\n/**\n * Validate parsed JSON as a theme file.\n *\n * `createTheme` itself is permissive — an unparseable hex flows through\n * `parseInt` and lands in the CSS as `NaN NaN% NaN%`, which fails at render\n * time in the consuming app rather than here. This is the gate that turns\n * that into a message at the point of authorship.\n *\n * Unknown keys are rejected rather than ignored: the file has four keys, so\n * an extra one is a typo (`primaryColor`) or a wrong mental model, and\n * silently dropping it would ship the default brand instead.\n */\nexport function parseThemeFile(input: unknown): ThemeFile {\n  if (input === null || typeof input !== 'object' || Array.isArray(input)) {\n    fail('Theme file must be a JSON object.')\n  }\n\n  const raw = input as Record<string, unknown>\n\n  const unknown = Object.keys(raw).filter((key) => !(KNOWN_KEYS as readonly string[]).includes(key))\n  if (unknown.length > 0) {\n    fail(`Unknown key(s): ${unknown.join(', ')}. Valid keys: ${KNOWN_KEYS.join(', ')}.`)\n  }\n\n  if (typeof raw.primary !== 'string') {\n    fail('\"primary\" is required and must be a hex string, e.g. \"#6a4dff\".')\n  }\n  if (!HEX.test(raw.primary)) {\n    fail(`\"primary\" must be a hex color like \"#6a4dff\" — got ${JSON.stringify(raw.primary)}.`)\n  }\n\n  if (raw.accent !== undefined) {\n    if (typeof raw.accent !== 'string' || !HEX.test(raw.accent)) {\n      fail(`\"accent\" must be a hex color like \"#00b4d8\" — got ${JSON.stringify(raw.accent)}.`)\n    }\n  }\n\n  if (raw.radius !== undefined) {\n    if (typeof raw.radius !== 'string' || !LENGTH.test(raw.radius)) {\n      fail(`\"radius\" must be a CSS length like \"0.5rem\" — got ${JSON.stringify(raw.radius)}.`)\n    }\n  }\n\n  if (raw.name !== undefined && (typeof raw.name !== 'string' || raw.name.trim() === '')) {\n    fail(`\"name\" must be a non-empty string — got ${JSON.stringify(raw.name)}.`)\n  }\n\n  const theme: ThemeFile = { primary: raw.primary }\n  if (typeof raw.name === 'string') theme.name = raw.name\n  if (typeof raw.accent === 'string') theme.accent = raw.accent\n  if (typeof raw.radius === 'string') theme.radius = raw.radius\n  return theme\n}\n\nexport interface ThemeFileToCSSOptions {\n  /** Path shown in the generated header, so the CSS points back at its source. */\n  source?: string\n  /** Selector the light tokens land on. Defaults to `:root`. */\n  selector?: string\n}\n\n/**\n * Render a theme file as CSS variables, with a header marking it generated.\n *\n * Server-safe: this module touches no DOM, so a build script or a Server\n * Component can emit theme CSS without pulling in the component library.\n */\nexport function themeFileToCSS(file: ThemeFile, options: ThemeFileToCSSOptions = {}): string {\n  const { source = 'arkite.theme.json', selector = ':root' } = options\n  const css = themeToCSS(createTheme(file), selector)\n  return `/* Generated from ${source} by \\`arkite-ui theme apply\\` — do not edit.\\n   Change the source file and re-run instead. */\\n\\n${css}\\n`\n}\n","/**\n * Chart color palette — CSS variable references for use with\n * Recharts, Nivo, Chart.js, or any charting library.\n *\n * Colors follow the theme system and adapt to light/dark mode.\n *\n * @example\n * ```tsx\n * import { chartColors } from '@arkite-ui/core'\n *\n * <BarChart data={data}>\n *   <Bar dataKey=\"revenue\" fill={chartColors[1]} />\n *   <Bar dataKey=\"cost\" fill={chartColors[2]} />\n * </BarChart>\n * ```\n */\nexport const chartColors = {\n  1: 'hsl(var(--chart-1))',\n  2: 'hsl(var(--chart-2))',\n  3: 'hsl(var(--chart-3))',\n  4: 'hsl(var(--chart-4))',\n  5: 'hsl(var(--chart-5))',\n} as const\n\n/** Array form for iterating (e.g. mapping over datasets) */\nexport const chartColorList = [\n  chartColors[1],\n  chartColors[2],\n  chartColors[3],\n  chartColors[4],\n  chartColors[5],\n] as const\n\nexport type ChartColorKey = keyof typeof chartColors\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqDO,IAAM,eAA4B;AAAA,EACvC,MAAM;AAAA,EACN,OAAO;AAAA,IACL,SAAS;AAAA,IACT,sBAAsB;AAA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