@uni-design-system/uni-core 5.2.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/concepts/animation/keyframes.constants.ts","../../src/concepts/color/color.records.ts","../../src/concepts/color/color.utils.ts","../../src/concepts/color/color.helper.ts","../../src/concepts/generation/oklch.helper.ts","../../src/concepts/generation/palette.factory.ts","../../src/concepts/color/color.factory.ts","../../src/concepts/elevation/zIndex.ts","../../src/concepts/generation/dtcg.emitter.ts","../../src/concepts/generation/shadow.generator.ts","../../src/concepts/theme/themes/base.theme.ts","../../src/concepts/generation/theme.generator.ts","../../src/concepts/generation/theme-file.emitter.ts","../../src/concepts/gradient/gradient.helper.ts","../../src/concepts/layout/layout.helper.ts","../../src/concepts/shadow/shadow.utils.ts","../../src/concepts/shadow/shadow.records.ts","../../src/concepts/style/inputs.constants.ts","../../src/concepts/theme/themes/dark.theme.ts","../../src/concepts/theme/themes/light.theme.ts","../../src/concepts/theme/theme.records.ts","../../src/concepts/typography/typography.records.ts","../../src/concepts/typography/typeface.helpers.ts","../../src/utils/getValue.ts","../../src/utils/debounce.ts"],"sourcesContent":["import type { StyleExpression } from '../style/style.types';\n\nexport type PercentageString = `${number}%`;\nexport type KeyframesExpression = Record<PercentageString, StyleExpression>;\n\nexport const fadeIn: KeyframesExpression = {\n '0%': {\n opacity: 0,\n },\n '100%': {\n opacity: 1,\n },\n};\n\nexport const fadeOut: KeyframesExpression = {\n '0%': {\n opacity: 1,\n },\n '100%': {\n opacity: 0,\n },\n};\n\nexport const expandFadeIn = {\n '0%': {\n gridTemplateRows: '0fr',\n opacity: 0,\n },\n '100%': {\n gridTemplateRows: '1fr',\n opacity: 1,\n },\n};\n\nexport const collapseFadeOut = {\n '0%': {\n gridTemplateRows: '1fr',\n opacity: 1,\n },\n '100%': {\n gridTemplateRows: '0fr',\n opacity: 0,\n },\n};\n","import { Range } from './color.model';\nimport { ColorCategory, ColorRole, UtilityColorRole } from './color.types';\n\n/**\n * @deprecated HSL saturation ranges are superseded by the perceptual OKLCH\n * chroma model inside `concepts/generation` (see `generateThemes`). Kept for\n * legacy callers of `uniColor`; removal follows the changeset major process.\n */\nexport const CategorySaturation: Record<ColorCategory, Range> = {\n jewel: { low: 73, high: 83 },\n pastel: { low: 14, high: 21 },\n earth: { low: 36, high: 41 },\n neutral: { low: 1, high: 10 },\n florescent: { low: 63, high: 100 },\n shades: { low: 0, high: 0 },\n};\n\n/**\n * @deprecated HSL lightness ranges are superseded by the perceptual OKLCH\n * tone slots inside `concepts/generation` (see `generateThemes`).\n */\nexport const CategoryLightness: Record<ColorCategory, Range> = {\n jewel: { low: 56, high: 76 },\n pastel: { low: 89, high: 96 },\n earth: { low: 36, high: 77 },\n neutral: { low: 70, high: 99 },\n florescent: { low: 82, high: 100 },\n shades: { low: 0, high: 100 },\n};\n\nexport const RoleHues: Record<ColorRole | UtilityColorRole, Range> = {\n primary: { low: 73, high: 83, default: 0 },\n secondary: { low: 14, high: 21, default: 0 },\n tertiary: { low: 36, high: 41, default: 0 },\n inverse: { low: 63, high: 100, default: 0 },\n ghost: { low: 0, high: 0, default: 0 },\n warn: { low: 320, high: 20, default: 0 }, // red\n alert: { low: 40, high: 70, default: 60 }, // yellow\n success: { low: 90, high: 150, default: 120 }, // green\n info: { low: 200, high: 260, default: 240 }, // blue\n};\n","import { Range } from './color.model';\nimport type { ColorScheme } from './color.types';\n\n/**\n * @deprecated Randomized generation is superseded by the deterministic OKLCH\n * engine in `concepts/generation` — same input, same theme. Seeded \"surprise\n * me\" behavior belongs in the consumer (playground), not the engine.\n */\nexport const randomRangeValue = ({ low, high }: Range): number => {\n low = Math.ceil(low);\n high = Math.floor(high);\n return Math.floor(Math.random() * (high - low + 1)) + low;\n};\n\nexport const cycle = (angle: number): number => {\n if (angle > 360) return angle - 360;\n if (angle < 0) return angle + 360;\n return angle;\n};\n\nexport const getAnalogousHues = (hue: number): number[] => [cycle(hue + 30), cycle(hue + 60)];\nexport const getComplimentaryHue = (hue: number): number => cycle(hue + 180);\nexport const getTriadicHues = (hue: number): number[] => [cycle(hue + 120), cycle(hue - 120)];\nexport const getSplitComplimentaryHues = (hue: number): number[] => [\n cycle(hue + 150),\n cycle(hue - 150),\n];\n\nexport interface RoleHueSet {\n primary: number;\n secondary: number;\n tertiary: number;\n}\n\n/**\n * Derive the primary/secondary/tertiary hues from a seed hue using the color\n * wheel relationships in {@link ColorScheme}. Pure angle math — works in any\n * hue space (HSL historically, OKLCH in the generation engine).\n */\nexport const schemeHues = (hue: number, scheme: ColorScheme): RoleHueSet => {\n switch (scheme) {\n case 'monochromatic':\n return { primary: hue, secondary: hue, tertiary: hue };\n case 'analogous': {\n const [a, b] = getAnalogousHues(hue);\n return { primary: hue, secondary: a, tertiary: b };\n }\n case 'complimentary': {\n const [a] = getAnalogousHues(hue);\n return { primary: hue, secondary: getComplimentaryHue(hue), tertiary: a };\n }\n case 'splitComplimentary': {\n const [a, b] = getSplitComplimentaryHues(hue);\n return { primary: hue, secondary: a, tertiary: b };\n }\n case 'triadic': {\n const [a, b] = getTriadicHues(hue);\n return { primary: hue, secondary: a, tertiary: b };\n }\n }\n};\n","import { HSL, HSLA, RGB, UniColor } from './color.model';\nimport { CategoryLightness, CategorySaturation, RoleHues } from './color.records';\nimport { randomRangeValue } from './color.utils';\n\nexport function HSLAToString({ hue, saturation, lightness, alpha = 1 }: HSLA): string {\n return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;\n}\n\nexport function RGBToString({ red, green, blue }: RGB): string {\n return `rgb(${red}, ${green}, ${blue})`;\n}\n\n/**\n * @deprecated Random HSL generation produces non-deterministic, perceptually\n * uneven colors. Use the OKLCH engine (`generateThemes` in\n * `concepts/generation`) or `generatePalette` instead.\n */\nexport function uniColor({ role, category, alpha = 1 }: UniColor): string {\n const hue = randomRangeValue(RoleHues[role]);\n const saturation = randomRangeValue(CategorySaturation[category]);\n const lightness = randomRangeValue(CategoryLightness[category]);\n\n return HSLAToString({ hue, saturation, lightness, alpha });\n}\n\nexport const RGBToHSL = ({ red, green, blue }: RGB): HSL => {\n red /= 255;\n green /= 255;\n blue /= 255;\n const l = Math.max(red, green, blue);\n const s = l - Math.min(red, green, blue);\n const h = s\n ? l === red\n ? (green - blue) / s\n : l === green\n ? 2 + (blue - red) / s\n : 4 + (red - green) / s\n : 0;\n return {\n hue: 60 * h < 0 ? 60 * h + 360 : 60 * h,\n saturation: 100 * (s ? (l <= 0.5 ? s / (2 * l - s) : s / (2 - (2 * l - s))) : 0),\n lightness: (100 * (2 * l - s)) / 2,\n };\n};\n\n// ── Conversions & contrast (used by the palette factory) ────────────────────\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\nconst toHex2 = (value: number): string => clamp(Math.round(value), 0, 255).toString(16).padStart(2, '0');\n\nexport const rgbToHex = ({ red, green, blue }: RGB): string =>\n `#${toHex2(red)}${toHex2(green)}${toHex2(blue)}`.toUpperCase();\n\nexport const hexToRgb = (hex: string): RGB => {\n let h = hex.replace('#', '').trim();\n if (h.length === 3) h = h.split('').map((c) => c + c).join('');\n const int = parseInt(h, 16);\n return { red: (int >> 16) & 255, green: (int >> 8) & 255, blue: int & 255 };\n};\n\nexport const HSLToRGB = ({ hue = 0, saturation = 0, lightness = 0 }: HSL): RGB => {\n const s = clamp(saturation, 0, 100) / 100;\n const l = clamp(lightness, 0, 100) / 100;\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const hp = (((hue % 360) + 360) % 360) / 60;\n const x = c * (1 - Math.abs((hp % 2) - 1));\n const [r1, g1, b1] =\n hp < 1\n ? [c, x, 0]\n : hp < 2\n ? [x, c, 0]\n : hp < 3\n ? [0, c, x]\n : hp < 4\n ? [0, x, c]\n : hp < 5\n ? [x, 0, c]\n : [c, 0, x];\n const m = l - c / 2;\n return {\n red: (r1 + m) * 255,\n green: (g1 + m) * 255,\n blue: (b1 + m) * 255,\n };\n};\n\n/** Build an sRGB hex string straight from HSL channel values. */\nexport const HSLToHex = (hsl: HSL): string => rgbToHex(HSLToRGB(hsl));\n\nexport const hexToHSL = (hex: string): HSL => RGBToHSL(hexToRgb(hex));\n\n/** WCAG relative luminance of an sRGB color (0 = black, 1 = white). */\nexport const relativeLuminance = ({ red, green, blue }: RGB): number => {\n const channel = (value: number): number => {\n const v = value / 255;\n return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\n };\n return 0.2126 * channel(red) + 0.7152 * channel(green) + 0.0722 * channel(blue);\n};\n\n/** WCAG contrast ratio between two colors (1:1 – 21:1). Accepts RGB or hex. */\nexport const contrastRatio = (a: RGB | string, b: RGB | string): number => {\n const la = relativeLuminance(typeof a === 'string' ? hexToRgb(a) : a);\n const lb = relativeLuminance(typeof b === 'string' ? hexToRgb(b) : b);\n const [hi, lo] = la > lb ? [la, lb] : [lb, la];\n return (hi + 0.05) / (lo + 0.05);\n};\n\n// Future Methods - https://codepen.io/jkantner/pen/VVEMRK\n","import type { RGB } from '../color/color.model';\nimport { hexToRgb, rgbToHex } from '../color/color.helper';\n\n/**\n * A color in OKLCH: perceptual lightness `l` (0–1), chroma `c` (0 = grey,\n * ~0.37 = max sRGB vividness) and hue angle `h` in degrees (0–360).\n *\n * Unlike HSL lightness, OKLCH `l` is perceptually uniform — a blue and a\n * yellow at the same `l` *look* equally light — which is what makes derived\n * tonal scales consistent across hues.\n */\nexport interface Oklch {\n l: number;\n c: number;\n h: number;\n}\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\n// sRGB transfer function and its inverse (gamma ↔ linear light).\nconst srgbToLinear = (channel: number): number =>\n channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);\n\nconst linearToSrgb = (channel: number): number =>\n channel <= 0.0031308 ? 12.92 * channel : 1.055 * Math.pow(channel, 1 / 2.4) - 0.055;\n\ninterface LinearRGB {\n r: number;\n g: number;\n b: number;\n}\n\n// OKLab ↔ linear sRGB matrices (Björn Ottosson's reference constants).\nconst linearRgbToOklab = ({ r, g, b }: LinearRGB): { l: number; a: number; b: number } => {\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return {\n l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n };\n};\n\nconst oklabToLinearRgb = (l: number, a: number, b: number): LinearRGB => {\n const l_ = Math.pow(l + 0.3963377774 * a + 0.2158037573 * b, 3);\n const m_ = Math.pow(l - 0.1055613458 * a - 0.0638541728 * b, 3);\n const s_ = Math.pow(l - 0.0894841775 * a - 1.291485548 * b, 3);\n return {\n r: 4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,\n g: -1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,\n b: -0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_,\n };\n};\n\nconst oklchToLinearRgb = ({ l, c, h }: Oklch): LinearRGB => {\n const rad = (h * Math.PI) / 180;\n return oklabToLinearRgb(l, c * Math.cos(rad), c * Math.sin(rad));\n};\n\nconst GAMUT_EPSILON = 1e-4;\n\nconst inSrgbGamut = ({ r, g, b }: LinearRGB): boolean =>\n r >= -GAMUT_EPSILON &&\n r <= 1 + GAMUT_EPSILON &&\n g >= -GAMUT_EPSILON &&\n g <= 1 + GAMUT_EPSILON &&\n b >= -GAMUT_EPSILON &&\n b <= 1 + GAMUT_EPSILON;\n\n/** Parse a hex color (`#RGB` or `#RRGGBB`) into OKLCH. */\nexport const hexToOklch = (hex: string): Oklch => {\n const { red, green, blue } = hexToRgb(hex);\n const { l, a, b } = linearRgbToOklab({\n r: srgbToLinear(red / 255),\n g: srgbToLinear(green / 255),\n b: srgbToLinear(blue / 255),\n });\n const c = Math.hypot(a, b);\n const h = c < 1e-6 ? 0 : (Math.atan2(b, a) * 180) / Math.PI;\n return { l, c, h: h < 0 ? h + 360 : h };\n};\n\n/**\n * Render OKLCH as an sRGB hex string. Out-of-gamut colors are mapped back\n * into sRGB by reducing chroma only — lightness and hue are preserved, so\n * vivid seeds desaturate gracefully instead of shifting hue or clipping.\n */\nexport const oklchToHex = (color: Oklch): string => {\n const target: Oklch = { l: clamp(color.l, 0, 1), c: Math.max(color.c, 0), h: color.h };\n let rgb = oklchToLinearRgb(target);\n if (!inSrgbGamut(rgb)) {\n let low = 0;\n let high = target.c;\n for (let i = 0; i < 24; i++) {\n const mid = (low + high) / 2;\n if (inSrgbGamut(oklchToLinearRgb({ ...target, c: mid }))) low = mid;\n else high = mid;\n }\n rgb = oklchToLinearRgb({ ...target, c: low });\n }\n // Scale *after* the transfer function: 255 × transfer(channel), rounded once\n // inside rgbToHex. Rounding before scaling collapses every channel to 0/1.\n return rgbToHex(toSrgb255(rgb));\n};\n\nconst toSrgb255 = ({ r, g, b }: LinearRGB): RGB => ({\n red: 255 * linearToSrgb(clamp(r, 0, 1)),\n green: 255 * linearToSrgb(clamp(g, 0, 1)),\n blue: 255 * linearToSrgb(clamp(b, 0, 1)),\n});\n","import type { Colors } from '../theme/theme.model';\nimport type { BrandRole, PaletteConfig } from '../color/color.factory';\nimport type { ColorCategory } from '../color/color.types';\nimport { contrastRatio, hexToRgb, relativeLuminance } from '../color/color.helper';\nimport { schemeHues } from '../color/color.utils';\nimport { hexToOklch, oklchToHex, type Oklch } from './oklch.helper';\nimport type { ContrastCheck } from './generation.types';\n\nexport interface GenerateColorsConfig extends PaletteConfig {\n /**\n * Soft brand anchors, per role: the palette starts from these exact colors\n * but the WCAG guard-rail may adjust lightness (never hue) to reach AA.\n * Contrast-safe counterpart to the hard `brand` pins, which are emitted\n * verbatim even when they fail.\n */\n targets?: Partial<Record<BrandRole, string>>;\n /** Sink for the contrast checks performed while building this palette. */\n checks?: ContrastCheck[];\n}\n\n// ── Tonal architecture ──────────────────────────────────────────────────────\n// Every token maps onto one of these OKLCH lightness slots. Because OKLCH L\n// is perceptually uniform, a slot renders equally light for every hue — the\n// property HSL lacked, and the root fix for muddy derived palettes.\nconst toneMap = (dark: boolean) =>\n dark\n ? {\n accent: 0.78,\n container: 0.42,\n roleSurface: 0.26,\n background: 0.18,\n surface: 0.21,\n surfaceVariant: 0.32,\n outline: 0.66,\n onSurface: 0.93,\n mutedText: 0.76,\n inverse: 0.93,\n onInverse: 0.25,\n onDeep: 0.2,\n onLight: 0.985,\n grey: 0.72,\n disabledContainer: 0.3,\n }\n : {\n accent: 0.55,\n container: 0.9,\n roleSurface: 0.97,\n background: 0.995,\n surface: 0.985,\n surfaceVariant: 0.94,\n outline: 0.6,\n onSurface: 0.25,\n mutedText: 0.48,\n inverse: 0.3,\n onInverse: 0.97,\n onDeep: 0.24,\n onLight: 0.985,\n grey: 0.5,\n disabledContainer: 0.96,\n };\n\n// OKLCH chroma per tonal category — the perceptual successor to the HSL\n// `CategorySaturation` table. Values are accent-level chroma; container and\n// surface chroma are derived fractions.\nexport const CategoryChroma: Record<ColorCategory, number> = {\n jewel: 0.17,\n pastel: 0.055,\n earth: 0.08,\n neutral: 0.03,\n florescent: 0.26,\n shades: 0,\n};\n\n/** Dark-mode accents cap chroma so they don't vibrate on dark surfaces. */\nconst DARK_ACCENT_CHROMA_CAP = 0.16;\n\n// Semantic feedback roles in OKLCH: hue + chroma per role. Chroma differs per\n// role because sRGB gamut room differs by hue at the AA-dark lightness light\n// mode forces on ink tokens: red holds 0.20; amber sits at 55° (not 70° —\n// dark yellow reads brown, dark orange stays lively) with 0.18; green 0.16.\nconst SemanticColors = {\n error: { hue: 27, chroma: 0.2 },\n warn: { hue: 55, chroma: 0.18 },\n success: { hue: 152, chroma: 0.16 },\n} as const;\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\n/**\n * Generate a complete {@link Colors} token set in OKLCH. Same contract as\n * `generatePalette` (which delegates here), plus soft brand targets and a\n * contrast-check sink for {@link ContrastReport} consumers.\n */\nexport const generateColors = (config: GenerateColorsConfig): Colors => {\n const {\n seed,\n scheme,\n category,\n mode = 'light',\n accentSaturationFloor = 18,\n brand = {},\n targets = {},\n checks,\n } = config;\n const dark = mode === 'dark';\n const t = toneMap(dark);\n\n // The primary anchor (hard pin > soft target > seed) sets the neutral hue.\n const anchor = hexToOklch(brand.primary ?? targets.primary ?? seed);\n const hues = schemeHues(anchor.h, scheme);\n\n // Chroma model. The floor keeps the brand hue perceptible even for the\n // near-grey `neutral` category (0–100 legacy scale → OKLCH chroma).\n const chromaFloor = (accentSaturationFloor / 100) * 0.28;\n let accentC = Math.max(CategoryChroma[category], chromaFloor);\n if (dark) accentC = Math.min(accentC, DARK_ACCENT_CHROMA_CAP);\n const containerC = Math.max(CategoryChroma[category] * 0.45, accentC * 0.35);\n const surfaceC = Math.min(CategoryChroma[category], 0.012);\n\n const tone = (hue: number, c: number, l: number): string => oklchToHex({ l, c, h: hue });\n\n /**\n * The WCAG guard-rail: walk the foreground's OKLCH lightness away from the\n * background until the pair meets `target` (≤ 50 steps). Hue is never\n * touched; chroma only shrinks as a last resort when L runs out of room.\n */\n const ensureContrast = (fg: Oklch, bg: string, target: number): Oklch => {\n const out: Oklch = { ...fg };\n let hex = oklchToHex(out);\n if (contrastRatio(hex, bg) >= target) return out;\n // Pick the direction that can actually reach the target: each side has a\n // hard ceiling — black tops out at (Ybg + 0.05) / 0.05, white at\n // 1.05 / (Ybg + 0.05) — so staying on the foreground's current side is\n // only right when that side has enough headroom.\n const bgY = relativeLuminance(hexToRgb(bg));\n const darkCeiling = (bgY + 0.05) / 0.05;\n const lightCeiling = 1.05 / (bgY + 0.05);\n let lighten = relativeLuminance(hexToRgb(hex)) >= bgY;\n if (lighten && lightCeiling < target && darkCeiling >= target) lighten = false;\n if (!lighten && darkCeiling < target && lightCeiling >= target) lighten = true;\n const step = lighten ? 0.015 : -0.015;\n for (let i = 0; i < 50 && contrastRatio(hex, bg) < target; i++) {\n if ((step > 0 && out.l < 0.995) || (step < 0 && out.l > 0.02)) {\n out.l = clamp(out.l + step, 0, 1);\n } else {\n out.c = Math.max(0, out.c - 0.02);\n }\n hex = oklchToHex(out);\n }\n return out;\n };\n\n /** Guard-railed token: adjust toward `target` contrast, then record the pair. */\n const contrasted = (fg: Oklch, bgHex: string, target: number): string =>\n oklchToHex(ensureContrast(fg, bgHex, target));\n\n const record = (\n foreground: string,\n background: string,\n foregroundColor: string,\n backgroundColor: string,\n required: number\n ): void => {\n if (!checks) return;\n const ratio = contrastRatio(foregroundColor, backgroundColor);\n checks.push({\n mode,\n foreground,\n background,\n foregroundColor,\n backgroundColor,\n ratio: Math.round(ratio * 100) / 100,\n required,\n pass: ratio >= required,\n level: ratio < required ? 'fail' : ratio >= 7 ? 'AAA' : 'AA',\n });\n };\n\n const background = tone(anchor.h, surfaceC, t.background);\n const surface = tone(anchor.h, surfaceC, t.surface);\n const surfaceVariant = tone(anchor.h, surfaceC, t.surfaceVariant);\n\n // Legible foreground for a given ground: whichever of the tonal near-black /\n // near-white starts closer to AA, then guard-railed the rest of the way.\n const onColor = (hue: number, bg: string, c: number): string => {\n const deep: Oklch = { l: t.onDeep, c: Math.min(c, 0.05), h: hue };\n const light: Oklch = { l: t.onLight, c: Math.min(c, 0.02), h: hue };\n const pick =\n contrastRatio(oklchToHex(deep), bg) >= contrastRatio(oklchToHex(light), bg) ? deep : light;\n return contrasted(pick, bg, 4.5);\n };\n\n // Dark-mode counterpart of a *hard-pinned* brand color: lift lightness only\n // (hue and chroma preserved) until it clears 3:1 on the dark ground.\n const adaptPinForDark = (hex: string): string => {\n const pin = hexToOklch(hex);\n pin.l = Math.max(pin.l, 0.6);\n return oklchToHex(ensureContrast(pin, background, 3));\n };\n\n /**\n * Resolve a role's base color: hard pins are verbatim in light mode and\n * lightness-lifted in dark; soft targets and generated tones are pulled to\n * ≥ 4.5:1 as standalone ink on `background` and `surface` (§3.6).\n */\n const baseFor = (name: BrandRole, hue: number, c: number): string => {\n const pinned = brand[name];\n if (pinned) return dark ? adaptPinForDark(pinned) : pinned;\n const target = targets[name];\n let base: Oklch;\n if (target) {\n // Soft targets keep their own chroma — brand fidelity beats category.\n // Callers that want a vibe cap applied clamp the target before passing\n // it in (see `generateThemes`). Dark mode still decouples chroma.\n base = hexToOklch(target);\n if (dark) {\n base.c = Math.min(base.c, DARK_ACCENT_CHROMA_CAP);\n base.l = Math.max(base.l, t.accent - 0.08);\n }\n } else {\n base = { l: t.accent, c, h: hue };\n }\n return oklchToHex(ensureContrast(ensureContrast(base, background, 4.5), surface, 4.5));\n };\n\n const disabled = dark ? 'rgba(255,255,255,0.12)' : 'rgba(0,0,0,0.12)';\n const onDisabled = dark ? 'rgba(255,255,255,0.38)' : 'rgba(0,0,0,0.38)';\n\n // An accent role's base drives its container/surface/on satellites. Every\n // content satellite passes through the guard-rail and is recorded.\n const role = (name: string, base: string, cC: number = containerC) => {\n const { h, c } = hexToOklch(base);\n const container = tone(h, cC, t.container);\n const roleSurface = tone(h, surfaceC, t.roleSurface);\n const onBase = onColor(h, base, c);\n const onContainer = onColor(h, container, c);\n const onContainerVariant = contrasted({ l: t.mutedText, c: Math.min(cC, 0.06), h }, container, 4.5);\n const border = ensureContrast(ensureContrast(hexToOklch(base), container, 3), surface, 3);\n const borderHex = oklchToHex(border);\n const onRoleSurface = onColor(h, roleSurface, surfaceC);\n const onRoleSurfaceVariant = contrasted(hexToOklch(base), roleSurface, 4.5);\n\n record(`on-${name}`, name, onBase, base, 4.5);\n record(`on-${name}-container`, `${name}-container`, onContainer, container, 4.5);\n record(`on-${name}-container-variant`, `${name}-container`, onContainerVariant, container, 4.5);\n record(`on-${name}-container-border`, `${name}-container`, borderHex, container, 3);\n record(`on-${name}-container-border`, 'surface', borderHex, surface, 3);\n record(`on-${name}-surface`, `${name}-surface`, onRoleSurface, roleSurface, 4.5);\n record(`on-${name}-surface-variant`, `${name}-surface`, onRoleSurfaceVariant, roleSurface, 4.5);\n record(name, 'background', base, background, 4.5);\n record(name, 'surface', base, surface, 4.5);\n\n return {\n [name]: base,\n [`on-${name}`]: onBase,\n [`${name}-container`]: container,\n [`on-${name}-container`]: onContainer,\n [`on-${name}-container-variant`]: onContainerVariant,\n [`on-${name}-container-border`]: borderHex,\n [`${name}-surface`]: roleSurface,\n [`on-${name}-surface`]: onRoleSurface,\n [`on-${name}-surface-variant`]: onRoleSurfaceVariant,\n };\n };\n\n const primaryBase = baseFor('primary', hues.primary, accentC);\n const secondaryBase = baseFor('secondary', hues.secondary, accentC);\n const tertiaryBase = baseFor('tertiary', hues.tertiary, accentC);\n\n // Quaternary is a neutral, near-grey accent tied to the brand hue.\n const quaternaryGrey = brand.quaternary\n ? dark\n ? adaptPinForDark(brand.quaternary)\n : brand.quaternary\n : oklchToHex(ensureContrast({ l: t.grey, c: surfaceC, h: anchor.h }, surface, 3));\n const quaternarySurface = tone(anchor.h, surfaceC, t.roleSurface);\n const onQuaternary = onColor(anchor.h, quaternaryGrey, surfaceC);\n const onQuaternarySurface = onColor(anchor.h, quaternarySurface, surfaceC);\n const onQuaternarySurfaceVariant = contrasted(hexToOklch(primaryBase), quaternarySurface, 4.5);\n const onQuaternaryContainerVariant = contrasted(\n { l: t.mutedText, c: Math.min(containerC, 0.06), h: anchor.h },\n quaternarySurface,\n 4.5\n );\n record('on-quaternary', 'quaternary', onQuaternary, quaternaryGrey, 4.5);\n record('on-quaternary-surface', 'quaternary-surface', onQuaternarySurface, quaternarySurface, 4.5);\n record(\n 'on-quaternary-surface-variant',\n 'quaternary-surface',\n onQuaternarySurfaceVariant,\n quaternarySurface,\n 4.5\n );\n\n // Semantic feedback roles keep colorful, recognizable hues in every category.\n const semantic = (name: 'error' | 'warn' | 'success') => {\n const { hue, chroma } = SemanticColors[name];\n const base = baseFor(name, hue, dark ? Math.min(chroma, DARK_ACCENT_CHROMA_CAP) : chroma);\n const { h } = hexToOklch(base);\n const container = tone(h, containerC + 0.04, t.container);\n const onBase = onColor(h, base, chroma);\n const onContainer = onColor(h, container, chroma);\n record(`on-${name}`, name, onBase, base, 4.5);\n record(`on-${name}-container`, `${name}-container`, onContainer, container, 4.5);\n record(name, 'background', base, background, 4.5);\n record(name, 'surface', base, surface, 4.5);\n return { base, container, onBase, onContainer, h };\n };\n\n const error = semantic('error');\n const warn = semantic('warn');\n const success = semantic('success');\n\n const semanticExtras = (name: 'warn' | 'success', s: ReturnType<typeof semantic>) => {\n const variant = contrasted({ l: t.mutedText, c: 0.06, h: s.h }, s.container, 4.5);\n const border = oklchToHex(\n ensureContrast(ensureContrast(hexToOklch(s.base), s.container, 3), surface, 3)\n );\n record(`on-${name}-container-variant`, `${name}-container`, variant, s.container, 4.5);\n record(`on-${name}-container-border`, `${name}-container`, border, s.container, 3);\n return { variant, border };\n };\n const warnExtras = semanticExtras('warn', warn);\n const successExtras = semanticExtras('success', success);\n\n // Neutral text tokens.\n const onBackground = tone(anchor.h, surfaceC, t.onSurface);\n const onBackgroundVariant = contrasted({ l: t.mutedText, c: surfaceC, h: anchor.h }, background, 4.5);\n const onSurface = tone(anchor.h, surfaceC, t.onSurface);\n const onSurfaceVariant = contrasted(\n { l: dark ? t.mutedText : t.mutedText - 0.14, c: surfaceC, h: anchor.h },\n surfaceVariant,\n 4.5\n );\n record('on-background', 'background', onBackground, background, 4.5);\n record('on-background-variant', 'background', onBackgroundVariant, background, 4.5);\n record('on-surface', 'surface', onSurface, surface, 4.5);\n record('on-surface-variant', 'surface-variant', onSurfaceVariant, surfaceVariant, 4.5);\n\n // Inverse surfaces flip the ground; their accents must stay legible there.\n const inverseSurface = tone(anchor.h, surfaceC, t.inverse);\n const onInverse = tone(anchor.h, surfaceC, t.onInverse);\n const inversePrimary = contrasted(hexToOklch(primaryBase), inverseSurface, 4.5);\n record('on-inverse-surface', 'inverse-surface', onInverse, inverseSurface, 4.5);\n record('on-inverse-surface-primary', 'inverse-surface', inversePrimary, inverseSurface, 4.5);\n record('on-inverse-container', 'inverse-container', onInverse, inverseSurface, 4.5);\n\n const outline = oklchToHex(\n ensureContrast(\n ensureContrast({ l: t.outline, c: Math.min(surfaceC, 0.02), h: hues.primary }, surface, 3),\n background,\n 3\n )\n );\n record('outline', 'surface', outline, surface, 3);\n record('outline', 'background', outline, background, 3);\n\n return {\n ...role('primary', primaryBase),\n ...role('secondary', secondaryBase),\n ...role('tertiary', tertiaryBase),\n\n quaternary: quaternaryGrey,\n 'on-quaternary': onQuaternary,\n 'quaternary-surface': quaternarySurface,\n 'on-quaternary-surface': onQuaternarySurface,\n 'on-quaternary-surface-variant': onQuaternarySurfaceVariant,\n 'on-quaternary-container-variant': onQuaternaryContainerVariant,\n 'on-quaternary-container-border': quaternaryGrey,\n\n // Semantic\n error: error.base,\n 'on-error': error.onBase,\n 'error-container': error.container,\n 'on-error-container': error.onContainer,\n\n warn: warn.base,\n 'on-warn': warn.onBase,\n 'warn-container': warn.container,\n 'on-warn-container': warn.onContainer,\n 'on-warn-container-variant': warnExtras.variant,\n 'on-warn-container-border': warnExtras.border,\n\n success: success.base,\n 'on-success': success.onBase,\n 'success-container': success.container,\n 'on-success-container': success.onContainer,\n 'on-success-container-variant': successExtras.variant,\n 'on-success-container-border': successExtras.border,\n\n // Neutral surfaces\n background,\n 'on-background': onBackground,\n 'on-background-variant': onBackgroundVariant,\n surface,\n 'on-surface': onSurface,\n 'surface-variant': surfaceVariant,\n 'on-surface-variant': onSurfaceVariant,\n\n // Inverse\n 'inverse-surface': inverseSurface,\n 'on-inverse-surface': onInverse,\n 'on-inverse-surface-primary': inversePrimary,\n 'on-inverse-surface-variant': inversePrimary,\n 'inverse-container': inverseSurface,\n 'on-inverse-container': onInverse,\n\n // Utility\n outline,\n shadow: '#000000',\n scrim: '#000000',\n 'surface-tint': primaryBase,\n transparent: 'rgba(0,0,0,0)',\n ghost: 'rgba(0,0,0,0)',\n\n // Disabled (deliberate alpha overlays — excluded from the contrast report)\n disabled,\n 'on-disabled': onDisabled,\n 'disabled-container': tone(hues.primary, surfaceC, t.disabledContainer),\n 'on-disabled-container': onDisabled,\n 'disabled-surface': disabled,\n 'on-disabled-surface': dark ? 'rgba(255,255,255,0.5)' : 'rgba(0,0,0,0.5)',\n 'on-disabled-surface-variant': dark ? 'rgba(255,255,255,0.4)' : 'rgba(0,0,0,0.4)',\n };\n};\n","import type { Colors } from '../theme';\nimport { generateColors, type GenerateColorsConfig } from '../generation/palette.factory';\nimport type { ColorCategory, ColorScheme } from './color.types';\n\n/** Roles whose base color can be pinned to an exact brand hex. */\nexport type BrandRole =\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'quaternary'\n | 'error'\n | 'warn'\n | 'success';\n\nexport interface PaletteConfig {\n /**\n * Seed brand color as a hex string, e.g. '#4F46E5'. Anchors the neutral\n * hue and every role you don't pin via `brand`. When `brand.primary` is\n * set, that color anchors instead.\n */\n seed: string;\n /** How secondary/tertiary hues relate to the anchor, for unpinned roles. */\n scheme: ColorScheme;\n /** Saturation / tonal character of the generated (unpinned) colors. */\n category: ColorCategory;\n /** Light or dark rendering of the same palette. Defaults to 'light'. */\n mode?: 'light' | 'dark';\n /**\n * Minimum accent saturation (0–100 scale) so the brand hue stays perceptible\n * even for the `neutral` category (which is otherwise near-grey). Set to 0\n * to honor the category saturation exactly.\n */\n accentSaturationFloor?: number;\n /**\n * Exact brand colors, pinned per role. A pinned color is emitted verbatim as\n * that role's base token in **light** mode (\"cannot shift\"); in **dark** mode\n * it is lifted in lightness only — hue and chroma preserved — so it stays\n * legible on a dark ground. Its on/container/surface satellites are derived\n * from it. Unpinned roles are generated from the seed + scheme as usual, so an\n * arbitrary brand pair (e.g. forest green + ochre) can be reproduced exactly.\n */\n brand?: Partial<Record<BrandRole, string>>;\n}\n\n/**\n * Generate a complete {@link Colors} token set from a single seed color, a\n * {@link ColorScheme} and a {@link ColorCategory}. Produces a light or dark\n * variant of the same palette; `on-*` colors are driven to WCAG AA contrast\n * so text stays legible for any seed.\n *\n * Delegates to the OKLCH engine in `concepts/generation` — all lightness and\n * chroma math is perceptual, and every derived pair passes through the WCAG\n * guard-rail. Accepts the engine's extended config, so callers may also pass\n * soft `targets` (brand-faithful but guard-railed) and a `checks` sink. Use\n * `generateThemes()` for the light+dark pair plus a {@link ContrastReport}.\n */\nexport const generatePalette = (config: GenerateColorsConfig): Colors => generateColors(config);\n","export type ZIndexableElements =\n | 'dropdown'\n | 'sticky'\n | 'fixed'\n | 'backdrop'\n | 'dialog'\n | 'popover'\n | 'tooltip'\n | 'overlay';\n\nexport const Z_INDEX: Record<ZIndexableElements, number> = {\n dropdown: 1000,\n sticky: 1020,\n fixed: 1030,\n backdrop: 1040,\n dialog: 1050,\n popover: 1060,\n tooltip: 1070,\n overlay: 1080,\n};\n","import type { Colors, Radii, Spacing } from '../theme/theme.model';\n\n/** A single W3C DTCG design token. */\nexport interface DtcgToken {\n $value: string;\n $type: 'color' | 'dimension';\n}\n\n/** DTCG-format token document (Style Dictionary compatible), per PRD §6. */\nexport interface DtcgTokens {\n color: Record<string, DtcgToken>;\n size: {\n radius: Record<string, DtcgToken>;\n spacing: Record<string, DtcgToken>;\n };\n}\n\nconst dimensionEntries = (record: Radii | Spacing | undefined): Record<string, DtcgToken> =>\n Object.fromEntries(\n Object.entries(record ?? {})\n .filter(([, value]) => value !== undefined && value !== 'none')\n .map(([key, value]) => [key, { $value: String(value), $type: 'dimension' as const }])\n );\n\n/**\n * Render one theme mode's tokens as W3C DTCG JSON for external pipelines\n * (Style Dictionary etc.). Token names are exactly Uni's `ColorToken` strings —\n * one vocabulary everywhere. The native `UniTheme` object remains the primary,\n * lossless output; this is the interop layer.\n */\nexport const emitDtcgTokens = (input: {\n colors: Colors;\n radii?: Radii;\n spacing?: Spacing;\n}): DtcgTokens => ({\n color: Object.fromEntries(\n Object.entries(input.colors)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => [key, { $value: value as string, $type: 'color' as const }])\n ),\n size: {\n radius: dimensionEntries(input.radii),\n spacing: dimensionEntries(input.spacing),\n },\n});\n","import type { Colors, Shadows } from '../theme/theme.model';\nimport { hexToRgb } from '../color/color.helper';\nimport { hexToOklch, oklchToHex } from './oklch.helper';\n\nconst rgba = (hex: string, alpha: number): string => {\n const { red, green, blue } = hexToRgb(hex);\n return `rgba(${red}, ${green}, ${blue}, ${alpha})`;\n};\n\n/**\n * Brand-tinted, theme-scoped elevation shadows (PRD §3.5.C).\n *\n * Light mode replaces the dead-neutral black stacks with a shadow ink pulled\n * toward the brand hue — dark and low-chroma enough to read as shadow, tinted\n * enough to kill the grey \"mud\" where shadows meet brand surfaces. Dark mode\n * goes near-zero: elevation is carried by the surface lightness steps, with\n * only a faint veil kept on floating overlays (menus/dialogs genuinely need\n * separation) and the `warn` glow tinted by the theme's own error color.\n */\nexport const generateShadows = (colors: Colors, mode: 'light' | 'dark' = 'light'): Shadows => {\n const error = colors['error'] ?? '#CC2827';\n\n if (mode === 'dark') {\n return {\n raised: 'none',\n menu: `0px 4px 12px ${rgba('#000000', 0.45)}`,\n dialog: `0px 8px 28px ${rgba('#000000', 0.55)}`,\n warn: `0 0 5px ${rgba(error, 0.55)}, inset 0 0 5px ${rgba(error, 0.35)}`,\n };\n }\n\n // Shadow ink: near-black carrying ~6–8% of the brand hue's chroma.\n const { h } = hexToOklch(colors['primary'] ?? '#000000');\n const ink = oklchToHex({ l: 0.22, c: 0.035, h });\n return {\n raised: `${rgba(ink, 0.2)} 0px 2px 1px -1px, ${rgba(ink, 0.14)} 0px 1px 1px 0px, ${rgba(ink, 0.12)} 0px 1px 3px 0px`,\n menu: `${rgba(ink, 0.2)} 0px 3px 3px -2px, ${rgba(ink, 0.14)} 0px 3px 4px 0px, ${rgba(ink, 0.12)} 0px 1px 8px 0px`,\n dialog: `${rgba(ink, 0.2)} 0px 3px 5px -1px, ${rgba(ink, 0.14)} 0px 6px 10px 0px, ${rgba(ink, 0.12)} 0px 1px 18px 0px`,\n warn: `0 0 5px ${rgba(error, 0.5)}, inset 0 0 5px ${rgba(error, 0.3)}`,\n };\n};\n","import type { ComponentThemes } from '../../component';\nimport { generatePalette, type PaletteConfig } from '../../color';\nimport type { GenerateColorsConfig } from '../../generation/palette.factory';\nimport { generateShadows } from '../../generation/shadow.generator';\nimport type { TextRole, TextStyle } from '../../typography';\nimport type {\n Borders,\n Colors,\n Icons,\n Radii,\n Shadows,\n Spacing,\n Thicknesses,\n Typography,\n UniTheme,\n} from '../theme.model';\n\n// ==========================================\n// Type scale — the single source of type truth.\n// CSS-ready `typefaces` are derived from this on read (toTypefaces).\n// ==========================================\nconst BaseTypography: Typography = {\n 'display-large': {\n fontFamily: 'Red Hat Display',\n fontSize: 57,\n lineHeight: 64,\n fontWeight: 'normal',\n letterSpacing: -0.25,\n },\n 'display-medium': { fontFamily: 'Red Hat Display', fontSize: 45, lineHeight: 52, fontWeight: 'normal' },\n 'display-small': { fontFamily: 'Red Hat Display', fontSize: 36, lineHeight: 44, fontWeight: 'normal' },\n 'headline-large': { fontFamily: 'Red Hat Display', fontSize: 32, lineHeight: 40, fontWeight: 'normal' },\n 'headline-medium': { fontFamily: 'Red Hat Display', fontSize: 28, lineHeight: 36, fontWeight: 'normal' },\n 'headline-small': { fontFamily: 'Red Hat Display', fontSize: 24, lineHeight: 32, fontWeight: 'normal' },\n 'title-large': { fontFamily: 'Red Hat Display', fontSize: 22, lineHeight: 28, fontWeight: 'normal' },\n 'title-medium': {\n fontFamily: 'Red Hat Display',\n fontSize: 16,\n lineHeight: 24,\n fontWeight: 'medium',\n letterSpacing: 0.15,\n },\n 'title-small': {\n fontFamily: 'Red Hat Display',\n fontWeight: 'medium',\n fontSize: 14,\n lineHeight: 20,\n letterSpacing: 0.1,\n },\n 'body-1-long': { fontFamily: 'Roboto', fontSize: 16, lineHeight: 22 },\n 'body-1-short': { fontFamily: 'Roboto', fontSize: 16, lineHeight: 24 },\n 'body-2-long': { fontFamily: 'Roboto', fontSize: 14, lineHeight: 18 },\n 'body-2-short': { fontFamily: 'Roboto', fontSize: 14, lineHeight: 20 },\n 'subtitle-1': { fontFamily: 'Red Hat Display', fontSize: 16, lineHeight: 24, letterSpacing: 0.15 },\n 'subtitle-2': {\n fontFamily: 'Red Hat Display',\n fontSize: 14,\n lineHeight: 20,\n fontWeight: 'medium',\n letterSpacing: 0.1,\n },\n label: { fontFamily: 'Roboto', fontSize: 14, lineHeight: 20 },\n button: {\n fontFamily: 'Red Hat Display',\n fontSize: 14,\n lineHeight: 20,\n fontWeight: 'medium',\n textTransform: 'capitalize',\n },\n caption: { fontFamily: 'Roboto', fontSize: 12, lineHeight: 18, letterSpacing: 0.4 },\n overline: {\n fontFamily: 'Red Hat Display',\n fontSize: 10,\n lineHeight: 18,\n letterSpacing: 1.5,\n textTransform: 'uppercase',\n },\n paragraph: { fontFamily: 'Roboto', fontSize: 16, lineHeight: 24 },\n quote: { fontFamily: 'Roboto', fontSize: 16, lineHeight: 24 },\n note: { fontFamily: 'Roboto', fontSize: 14, lineHeight: 22, fontStyle: 'italic' },\n // Product-specific extras (were duplicated into `typefaces` before).\n badge: { fontFamily: 'Red Hat Display', fontSize: 16, lineHeight: 24 },\n tag: { fontFamily: 'Red Hat Display', fontSize: 15, lineHeight: 20, fontWeight: 600 },\n input: { fontFamily: 'Red Hat Display', fontSize: 14, lineHeight: 24 },\n} as Record<TextRole, TextStyle> & Record<string, TextStyle>;\n\n// ==========================================\n// Shared token scales — theme-agnostic.\n// ==========================================\nconst BaseShadows: Shadows = {\n raised:\n 'rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px',\n menu: 'rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px;',\n dialog:\n 'rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px',\n warn: '0 0 5px rgba(255, 0, 0, 0.5), inset 0 0 5px rgba(255, 0, 0, 0.3)',\n};\n\nconst BaseSpacing: Spacing = {\n none: 'none',\n xxs: '2px',\n xs: '4px',\n sm: '8px',\n md: '16px',\n lg: '32px',\n xl: '64px',\n};\n\nconst BaseThicknesses: Thicknesses = { thin: 1, standard: 2, thick: 4 };\n\nconst BaseRadii: Radii = {\n none: 'none',\n xxs: '4px',\n xs: '8px',\n sm: '16px',\n md: '24px',\n lg: '32px',\n max: '999px',\n};\n\n// ==========================================\n// Color-derived token builders — the reason a custom theme\n// only has to supply `colors`.\n// ==========================================\nconst buildBorders = (c: Colors): Borders => ({\n primary: `1px solid ${c.primary}`,\n secondary: `1px solid ${c.secondary}`,\n tertiary: `1px solid ${c.tertiary}`,\n quaternary: `1px solid ${c.quaternary}`,\n warn: `1px solid ${c.warn}`,\n success: `1px solid ${c.success}`,\n light: `1px solid ${c.outline}`,\n dark: `1px solid ${c['on-background']}`,\n dotted: `1px dotted ${c['on-background']}`,\n});\n\nconst buildComponents = (c: Colors): ComponentThemes => ({\n alert: {\n options: { topPosition: 40, borderRadius: 'sm', transitionSpeed: 0.35, elevation: 'md' },\n },\n // Trail typography, link/current colors, separator symbol and spacing are\n // tokens; the current page reads in the stronger ink.\n breadcrumb: {\n options: {\n typeface: 'label',\n color: 'on-background-variant',\n currentColor: 'on-background',\n separatorSymbol: 'chevron_right',\n gap: 'xs',\n },\n },\n // App shell: bar surface, divider, title type and spacing are all tokens.\n appBar: {\n options: {\n color: 'surface',\n height: 56,\n divider: 'light',\n typeface: 'title-large',\n padding: 'md',\n gap: 'md',\n elevation: undefined,\n },\n },\n // Navigation drawer: shares the dialog's native-<dialog> machinery in\n // 'over' mode (elevation + scrim backdrop); 'side' mode is an in-flow\n // aside separated by the divider border primitive.\n drawer: {\n options: {\n color: 'surface',\n width: 280,\n divider: 'light',\n elevation: 'menu',\n padding: 'md',\n backdrop: { background: 'rgba(0, 0, 0, 0.4)' },\n },\n },\n // Initials/icon avatars color from the role's container tokens; the radius\n // token makes them circles by default and squares under a 'sharp' theme.\n avatar: {\n options: { borderRadius: 'max', typeface: 'subtitle-2', fallbackSymbol: 'person' },\n variants: {\n primary: { backgroundColor: c['primary-container'], color: c['on-primary-container'] },\n secondary: { backgroundColor: c['secondary-container'], color: c['on-secondary-container'] },\n tertiary: { backgroundColor: c['tertiary-container'], color: c['on-tertiary-container'] },\n quaternary: { backgroundColor: c['surface-variant'], color: c['on-surface-variant'] },\n warn: { backgroundColor: c['warn-container'], color: c['on-warn-container'] },\n success: { backgroundColor: c['success-container'], color: c['on-success-container'] },\n },\n sizes: {\n sm: { height: 24, width: 24, fontSize: 10 },\n md: { height: 32, width: 32, fontSize: 13 },\n lg: { height: 40, width: 40, fontSize: 16 },\n xl: { height: 56, width: 56, fontSize: 22 },\n },\n },\n // Overlap is a spacing token; the ring separates stacked avatars using the\n // surface color so groups read on any background.\n avatarGroup: { options: { overlap: 'sm', ringColor: 'surface', ringWidth: 2 } },\n checkbox: { options: { size: 20 } },\n dialog: {\n options: {\n borderRadius: 'lg',\n color: 'primary-surface',\n border: 'quaternary',\n padding: 'sm',\n elevation: 'dialog',\n backdrop: { background: 'rgba(255, 255, 255, 0.6)', backdropFilter: 'blur(2px)' },\n },\n },\n dialogHeader: {\n options: {\n borderRadius: 'max',\n color: 'primary',\n height: 48,\n textRole: 'title-large',\n textAlign: 'center',\n closeButtonIcon: 'close',\n closeButtonSize: 'md',\n },\n },\n dropdown: {\n options: { border: 'none', borderRadius: 'xxs', color: 'primary-surface', shadow: 'menu' },\n },\n footer: { options: { height: 52, color: 'primary', logoHeight: 18.6, logoPadding: 'md' } },\n input: {\n options: {\n typeFace: 'input',\n color: 'primary-surface',\n textColor: 'on-primary-surface',\n disabledColor: 'disabled-surface',\n disabledTextColor: 'on-disabled-surface',\n border: 'light',\n borderRadius: 'xs',\n errorShadow: 'warn',\n errorBorder: 'warn',\n height: 32,\n paddingLeft: 'sm',\n focusOutline: `2px solid ${c.primary}`,\n focusOutlineOffset: 2,\n },\n },\n // Field chrome (color/border/typeface/focus) comes from the shared `input`\n // options via uni-input-box; these are the textarea-specific behaviors.\n textarea: { options: { rows: 3, resize: 'vertical' } },\n // Every visual knob is a token, so a theme can turn the default underline\n // tabs into pills (borderRadius 'max' + activeColor) or restyle the\n // indicator without touching component code.\n tabs: {\n options: {\n typeface: 'title-small',\n textColor: 'on-surface-variant',\n activeTextColor: 'primary',\n indicatorColor: 'primary',\n indicatorThickness: 'standard',\n divider: 'light',\n gap: 'sm',\n borderRadius: 'none',\n padding: 'md',\n activeColor: undefined,\n },\n },\n multiSelectDropdown: {\n options: {\n textRole: 'input',\n textColor: 'on-primary-surface',\n dividerBorder: 'light',\n searchInputBorder: 'light',\n searchInputBorderRadius: 'xxs',\n focusOutline: `2px solid ${c.primary}`,\n focusOutlineOffset: 2,\n },\n },\n badge: { options: { borderRadius: 'xxs' } },\n\n // ---- Buttons: variants are structural archetypes with interaction states ----\n button: {\n // Radius and typeface are tokens, not baked values: `max` renders the\n // classic pill and the type scale's `button` role carries the label\n // typography, so shape languages, custom radii, and typography edits\n // restyle every button by re-pointing or redefining a token.\n options: { borderRadius: 'max', typeface: 'button' },\n fixed: {\n position: 'relative',\n overflow: 'hidden',\n outline: '0',\n border: '0',\n cursor: 'pointer',\n transition: 'all 0.28s ease',\n },\n variants: {\n ghost: {\n backgroundColor: 'transparent',\n color: 'currentcolor',\n '&:hover': { backgroundColor: 'rgba(0,0,0,0.06)' },\n },\n // Solid\n primary: {\n backgroundColor: c.primary,\n color: c['on-primary'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n // Hollow\n secondary: {\n backgroundColor: 'transparent',\n color: c.secondary,\n border: `1px solid ${c.secondary}`,\n '&:hover': { backgroundColor: c.secondary, color: c['on-secondary'] },\n },\n // Solid\n tertiary: {\n backgroundColor: c.tertiary,\n color: c['on-tertiary'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n warn: {\n backgroundColor: c.warn,\n color: c['on-warn'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n success: {\n backgroundColor: c.success,\n color: c['on-success'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n disabled: {\n backgroundColor: `${c.disabled} !important`,\n color: `${c['on-disabled']} !important`,\n border: '0',\n },\n },\n // Sizes are geometry only (height/padding/fontSize); families, weights and\n // transforms come from the `typeface` option's type-scale role.\n sizes: {\n sm: { height: 22, fontSize: 12, padding: '0 12px', fontWeight: 600 },\n md: { height: 26, fontSize: 16, padding: '0 16px' },\n lg: { height: 36, fontSize: 18, padding: '0 18px' },\n xl: { height: 48, fontSize: 24, padding: '0 22px' },\n },\n },\n iconButton: {\n options: { borderRadius: 'max' },\n variants: {\n ghost: { backgroundColor: 'transparent', color: 'currentcolor' },\n primary: { backgroundColor: c.primary, color: c['on-primary'] },\n secondary: { backgroundColor: c.secondary, color: c['on-secondary'] },\n tertiary: { backgroundColor: c.tertiary, color: c['on-tertiary'] },\n warn: { backgroundColor: c.warn, color: c['on-warn'] },\n success: { backgroundColor: c.success, color: c['on-success'] },\n disabled: {\n backgroundColor: 'transparent !important',\n color: `${c['on-disabled']} !important`,\n },\n },\n sizes: {\n sm: { height: 22, minHeight: 22, width: 22, minWidth: 22, fontSize: 18 },\n md: { height: 26, minHeight: 26, width: 26, minWidth: 26, fontSize: 22 },\n lg: { height: 36, minHeight: 36, width: 36, minWidth: 36, fontSize: 30 },\n xl: { height: 40, minHeight: 40, width: 40, minWidth: 40, fontSize: 34 },\n },\n },\n progressGauge: {\n fixed: { textFill: c['on-background'] },\n // Track = the role's container token (the palette's soft tint of that\n // role), arc = the role base — so gauges follow any brand palette instead\n // of the fixed pastels they used to hardcode.\n variants: {\n primary: { backgroundColor: c['primary-container'], color: c.primary },\n secondary: { backgroundColor: c['secondary-container'], color: c.secondary },\n tertiary: { backgroundColor: c['tertiary-container'], color: c.tertiary },\n warn: { backgroundColor: c['warn-container'], color: c.warn },\n success: { backgroundColor: c['success-container'], color: c.success },\n },\n sizes: {\n sm: { height: '54px' },\n md: { height: '68px' },\n lg: { height: '82px' },\n xl: { height: '104px' },\n },\n },\n card: {\n // The frame is tokens: the border primitive named by the active variant\n // (borders.primary … borders.success — override with `border` to pin all\n // cards to one primitive, e.g. a custom 'brush-stroke'), the radii scale\n // (`xs` = the classic 8px), and an optional elevation shadow.\n options: { borderRadius: 'xs' },\n fixed: { overflow: 'hidden', backgroundColor: c.background },\n },\n cardHeader: {\n fixed: { padding: '12px 24px' },\n variants: {\n primary: { backgroundColor: c.primary, color: c['on-primary'] },\n secondary: { backgroundColor: c.secondary, color: c['on-secondary'] },\n tertiary: { backgroundColor: c.tertiary, color: c['on-tertiary'] },\n warn: { backgroundColor: c.warn, color: c['on-warn'] },\n success: { backgroundColor: c.success, color: c['on-success'] },\n },\n },\n cardContent: { fixed: { padding: '12px 24px' } },\n dataSearch: {\n options: {\n border: 'light',\n borderRadius: 'xs',\n color: 'primary-surface',\n placeholderColor: 'disabled',\n },\n },\n dataTable: {\n options: {\n color: 'primary-surface',\n border: 'light',\n borderRadius: 'sm',\n elevation: undefined,\n headerPadding: 'sm',\n footerPadding: 'sm',\n thTextRole: 'headline-small',\n thColor: 'primary-container',\n thVerticalBorder: 'dotted',\n thHorizontalBorder: 'light',\n thPadding: 'sm',\n tdTextRole: 'title-small',\n tdColor: 'primary-surface',\n tdStickyColor: 'primary-container',\n tdPadding: 'sm',\n tdVerticalBorder: 'dotted',\n tdHorizontalBorder: 'light',\n rowHoverColor: 'primary-container',\n loadingOverlayColor: 'scrim',\n loadingSpinnerColor: 'primary',\n loadingSpinnerSize: 40,\n },\n },\n notificationBadge: { options: { borderRadius: 'sm', offset: -10 } },\n paginator: {\n options: {\n gap: 'xs',\n textRole: 'label',\n inputBorder: 'light',\n inputBorderRadius: 'xs',\n pageBorderRadius: 'xs',\n currentPageBorder: 'light',\n currentPageBorderRadius: 'xs',\n },\n },\n // Range input: fill/thumb in the accent, track in the muted surface, both\n // radius-tokened — geometry knobs are plain numbers.\n slider: {\n options: {\n color: 'primary',\n trackColor: 'surface-variant',\n borderRadius: 'max',\n trackHeight: 4,\n thumbSize: 16,\n },\n },\n // Loading placeholders paint with surface tokens so they sit naturally on\n // any theme; the shimmer highlight sweeps in the lighter surface color.\n skeleton: {\n options: {\n color: 'surface-variant',\n highlightColor: 'surface',\n borderRadius: 'xs',\n animation: 'shimmer',\n duration: 1.4,\n gap: 'sm',\n },\n },\n snackbar: {\n options: { bottomPosition: 40, transitionDelay: '0.35s', autoCloseDelay: 35000 },\n },\n symbol: { options: { fill: 0, weight: 400, grade: 0, opticalSize: 24 } },\n toggle: { options: { size: 20 } },\n tooltip: {\n options: {\n border: undefined,\n borderRadius: 'xs',\n shadow: 'raised',\n color: 'inverse-surface',\n typeface: 'label',\n },\n },\n});\n\n// ==========================================\n// Theme factory. A custom theme = a name + a `colors` map.\n// Everything color-dependent (borders, component variants) is derived;\n// `borders`/`components` overrides deep-merge over the derived defaults, so a\n// theme file can define its own named primitives and rewire per-component\n// options without restating anything it doesn't touch.\n// ==========================================\nexport interface ThemeConfig {\n id: string;\n name: string;\n colors: Colors;\n icons?: Icons;\n /** Override the radii scale, e.g. a generated shape-language preset. */\n radii?: Radii;\n /** Override the elevation shadows, e.g. brand-tinted generated stacks. */\n shadows?: Shadows;\n /**\n * Named border primitives, merged over the derived defaults. New tokens may\n * use any name — point component options (or `components` overrides) at\n * them and every consumer of the shared token picks up the change.\n */\n borders?: Borders;\n /**\n * Sparse per-component overrides, deep-merged over the derived component\n * themes: only the sections you provide (fixed/variants/sizes/options keys)\n * are replaced; everything else keeps tracking the library defaults.\n */\n components?: ComponentThemes;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst deepMerge = <T>(base: T, override: Partial<T> | undefined): T => {\n if (!override) return base;\n const out = { ...base } as Record<string, unknown>;\n for (const [key, value] of Object.entries(override)) {\n out[key] = isRecord(value) && isRecord(out[key]) ? deepMerge(out[key], value) : value;\n }\n return out as T;\n};\n\nexport const createTheme = ({\n id,\n name,\n colors,\n icons = {},\n radii = BaseRadii,\n shadows = BaseShadows,\n borders,\n components,\n}: ThemeConfig): UniTheme => ({\n id,\n name,\n colors,\n typography: BaseTypography,\n borders: deepMerge(buildBorders(colors), borders),\n radii,\n shadows,\n spacing: BaseSpacing,\n thicknesses: BaseThicknesses,\n icons,\n components: deepMerge(buildComponents(colors), components),\n});\n\n/**\n * Build a full {@link UniTheme} straight from a {@link PaletteConfig} — the\n * one-call path a theme builder uses to turn a brand color (or a seed +\n * scheme + category) into a complete, ready-to-apply theme.\n */\nexport const createThemeFromPalette = (\n config: GenerateColorsConfig & { id?: string; name?: string; icons?: Icons; radii?: Radii }\n): UniTheme => {\n const colors = generatePalette(config);\n return createTheme({\n id: config.id ?? 'CustomTheme',\n name: config.name ?? 'Custom Theme',\n colors,\n radii: config.radii,\n shadows: generateShadows(colors, config.mode ?? 'light'),\n icons: config.icons,\n });\n};\n\n/**\n * Seed for the shipped Light/Dark themes. Swap these three values (or call\n * `generatePalette` with your own) to reskin the entire system — every color\n * token is derived, so there is nothing else to hand-author.\n */\nexport const BASE_PALETTE_CONFIG: Pick<PaletteConfig, 'seed' | 'scheme' | 'category'> = {\n seed: '#4F46E5', // indigo\n scheme: 'triadic',\n category: 'neutral',\n};\n\nexport const lightColors: Colors = generatePalette({ ...BASE_PALETTE_CONFIG, mode: 'light' });\n\nexport const BaseTheme: UniTheme = createTheme({\n id: 'BaseTheme',\n name: 'Base Theme',\n colors: lightColors,\n});\n","import type { ColorCategory, ColorScheme } from '../color/color.types';\nimport type { Radii, UniTheme } from '../theme/theme.model';\nimport type { BrandRole } from '../color/color.factory';\nimport { createTheme } from '../theme/themes/base.theme';\nimport { hexToOklch, oklchToHex } from './oklch.helper';\nimport { CategoryChroma, generateColors } from './palette.factory';\nimport { generateShadows } from './shadow.generator';\nimport type {\n ContrastCheck,\n GeneratedThemeConfig,\n GenerationInput,\n ThemeShape,\n} from './generation.types';\n\n/** Radii presets per shape language (PRD §3.5.A). Same keys as `BaseRadii`. */\nexport const ShapeRadii: Record<ThemeShape, Radii> = {\n sharp: { none: 'none', xxs: '0px', xs: '0px', sm: '0px', md: '0px', lg: '0px', max: '0px' },\n modern: { none: 'none', xxs: '4px', xs: '8px', sm: '16px', md: '24px', lg: '32px', max: '999px' },\n playful: { none: 'none', xxs: '8px', xs: '16px', sm: '24px', md: '32px', lg: '48px', max: '9999px' },\n};\n\n/** Shortest angular distance between two hue angles, in degrees (0–180). */\nconst hueDistance = (a: number, b: number): number => {\n const d = Math.abs(a - b) % 360;\n return d > 180 ? 360 - d : d;\n};\n\n/**\n * Classify 2–3 brand hues against {@link ColorScheme} by their angular\n * distances from the primary hue. Heuristic bands, widest match wins.\n */\nexport const classifyScheme = (primaryHue: number, otherHues: number[]): ColorScheme => {\n const distances = otherHues.map((h) => hueDistance(primaryHue, h));\n if (distances.length === 0) return 'analogous';\n if (distances.every((d) => d < 15)) return 'monochromatic';\n if (distances.every((d) => d <= 65)) return 'analogous';\n if (distances.some((d) => d >= 165)) return 'complimentary';\n if (distances.length > 1 && distances.every((d) => d >= 130)) return 'splitComplimentary';\n return 'triadic';\n};\n\n/**\n * Infer a tonal category from the seed's own chroma, so an unstated \"vibe\"\n * preserves the brand's character — vivid stays vivid, muted stays muted.\n */\nexport const inferCategory = (seedHex: string): ColorCategory => {\n const { c } = hexToOklch(seedHex);\n if (c >= 0.13) return 'jewel';\n if (c >= 0.07) return 'earth';\n if (c >= 0.03) return 'pastel';\n return 'neutral';\n};\n\n/**\n * The theme generation engine (PRD §3.3): brand seed(s) in, complete WCAG-AA\n * light+dark {@link Colors} pair out, with a machine-readable contrast report.\n * Pure and deterministic — identical input yields identical output.\n */\nexport const generateThemes = (input: GenerationInput): GeneratedThemeConfig => {\n const seeds = (Array.isArray(input.seed) ? input.seed : [input.seed]).slice(0, 3);\n const [primary, secondary, tertiary] = seeds;\n const scheme =\n input.scheme ??\n (seeds.length > 1\n ? classifyScheme(hexToOklch(primary).h, seeds.slice(1).map((s) => hexToOklch(s).h))\n : 'analogous');\n const category = input.vibe ?? inferCategory(primary);\n\n // Seeds pass through as soft targets with their own chroma (brand fidelity).\n // Only an *explicit* vibe caps them to the category's chroma ceiling.\n const applyVibe = (hex: string): string => {\n if (!input.vibe) return hex;\n const color = hexToOklch(hex);\n return oklchToHex({ ...color, c: Math.min(color.c, CategoryChroma[input.vibe]) });\n };\n const targets: Partial<Record<BrandRole, string>> = { primary: applyVibe(primary) };\n if (secondary) targets.secondary = applyVibe(secondary);\n if (tertiary) targets.tertiary = applyVibe(tertiary);\n\n const checks: ContrastCheck[] = [];\n const base = { seed: primary, scheme, category, targets, checks };\n const lightColors = generateColors({ ...base, mode: 'light' });\n const darkColors = generateColors({ ...base, mode: 'dark' });\n\n const worstRatio = checks.reduce((worst, check) => Math.min(worst, check.ratio), 21);\n return {\n lightColors,\n darkColors,\n radii: input.shape ? ShapeRadii[input.shape] : undefined,\n lightShadows: generateShadows(lightColors, 'light'),\n darkShadows: generateShadows(darkColors, 'dark'),\n report: { checks, worstRatio, pass: checks.every((check) => check.pass) },\n };\n};\n\n/**\n * Convenience wrapper: {@link generateThemes} piped through `createTheme()`,\n * returning a registration-ready light/dark {@link UniTheme} pair.\n */\nexport const generateUniThemes = (input: GenerationInput): { light: UniTheme; dark: UniTheme } => {\n const { lightColors, darkColors, radii, lightShadows, darkShadows } = generateThemes(input);\n const name = input.name ?? 'Brand';\n const id = name.replace(/\\W+/g, '') || 'Brand';\n return {\n light: createTheme({\n id: `${id}Light`,\n name: `${name} Light`,\n colors: lightColors,\n radii,\n shadows: lightShadows,\n }),\n dark: createTheme({\n id: `${id}Dark`,\n name: `${name} Dark`,\n colors: darkColors,\n radii,\n shadows: darkShadows,\n }),\n };\n};\n","import type { Colors, Shadows } from '../theme/theme.model';\nimport { generateThemes } from './theme.generator';\nimport type { ContrastReport, GenerationInput } from './generation.types';\n\nexport interface ThemeFileInput extends GenerationInput {\n /** Emit the dark theme alongside the light one. Defaults to true. */\n darkMode?: boolean;\n}\n\n/** A rendered static theme file plus everything a consumer needs to wire it. */\nexport interface EmittedThemeFile {\n /** TypeScript source for a static `uni-theme.ts` — plain, reviewable data. */\n content: string;\n /** Registration snippet for the consumer's `app.config.ts`. */\n providerSnippet: string;\n report: ContrastReport;\n /** One-line human summary of the contrast report. */\n reportSummary: string;\n}\n\nconst IDENT = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\nconst asKey = (k: string): string => (IDENT.test(k) ? k : `'${k}'`);\n\nconst recordLiteral = (record: Record<string, string | undefined>, indent: string): string =>\n Object.entries(record)\n .map(([k, v]) => `${indent}${asKey(k)}: '${v}',`)\n .join('\\n');\n\n// The derived border primitives, spelled out as template literals over the\n// colors const — visible, editable, and edits to a color propagate. Access is\n// bracket-only: `Colors` carries an index signature, and consumer tsconfigs\n// with `noPropertyAccessFromIndexSignature` (ng new strict default) reject\n// dot access on it.\nconst bordersLiteral = (): string =>\n [\n '/**',\n ' * Named border primitives. These mirror the derived defaults — edit them, or',\n ' * add your own under any token name and point component options (or the',\n ' * `components` overrides below) at it. Every component deriving from a',\n ' * shared token picks up the change.',\n ' */',\n 'const borders = (colors: Colors): Borders => ({',\n \" primary: `1px solid ${colors['primary']}`,\",\n \" secondary: `1px solid ${colors['secondary']}`,\",\n \" tertiary: `1px solid ${colors['tertiary']}`,\",\n \" quaternary: `1px solid ${colors['quaternary']}`,\",\n \" warn: `1px solid ${colors['warn']}`,\",\n \" success: `1px solid ${colors['success']}`,\",\n \" light: `1px solid ${colors['outline']}`,\",\n \" dark: `1px solid ${colors['on-background']}`,\",\n \" dotted: `1px dotted ${colors['on-background']}`,\",\n '});',\n ].join('\\n');\n\nconst themeExport = (\n exportName: string,\n displayName: string,\n colorsConst: string,\n shadowsConst: string,\n radii: boolean\n): string =>\n [\n `export const ${exportName}: UniTheme = createTheme({`,\n ` id: '${exportName}',`,\n ` name: '${displayName}',`,\n ` colors: ${colorsConst},`,\n ` borders: borders(${colorsConst}),`,\n ` components: components(${colorsConst}),`,\n ` shadows: ${shadowsConst},`,\n ...(radii ? [' radii,'] : []),\n '});',\n ].join('\\n');\n\n/**\n * Render a static `uni-theme.ts` from a brand seed — the file the `ng add`\n * schematic writes and the MCP `generate_uni_theme` tool returns.\n *\n * The file is the system's **source of truth**: literal colors, the border\n * primitives spelled out, and a sparse `components` override section — so a\n * human (or an AI agent) can retheme by editing tokens in place, with no\n * runtime generation. Deterministic: same input, same file.\n */\nexport const emitThemeFile = (input: ThemeFileInput): EmittedThemeFile => {\n const { darkMode = true, name = 'Brand' } = input;\n const { lightColors, darkColors, radii, lightShadows, darkShadows, report } = generateThemes(input);\n const id = (name.replace(/\\W+/g, '') || 'Brand') as string;\n\n const seeds = Array.isArray(input.seed) ? input.seed : [input.seed];\n const regenerate = [\n `--brand=${seeds.join(',')}`,\n input.vibe && `--vibe=${input.vibe}`,\n input.scheme && `--scheme=${input.scheme}`,\n input.shape && `--shape=${input.shape}`,\n !darkMode && '--dark-mode=false',\n ]\n .filter(Boolean)\n .join(' ');\n\n const reportSummary = `${report.checks.length} contrast pairs checked · worst ${report.worstRatio}:1 · ${\n report.pass ? 'all AA' : `${report.checks.filter((c) => !c.pass).length} failing`\n }`;\n\n const modes: {\n exportName: string;\n displayName: string;\n colorsConst: string;\n colors: Colors;\n shadowsConst: string;\n shadows: Shadows;\n }[] = [\n {\n exportName: `${id}Light`,\n displayName: `${name} Light`,\n colorsConst: 'lightColors',\n colors: lightColors,\n shadowsConst: 'lightShadows',\n shadows: lightShadows,\n },\n ...(darkMode\n ? [\n {\n exportName: `${id}Dark`,\n displayName: `${name} Dark`,\n colorsConst: 'darkColors',\n colors: darkColors,\n shadowsConst: 'darkShadows',\n shadows: darkShadows,\n },\n ]\n : []),\n ];\n\n const content = [\n '/**',\n ` * ${name} theme for Uni — generated data, yours to edit.`,\n ' *',\n ` * Regenerate colors: ng add @uni-design-system/uni-angular ${regenerate}`,\n ' * (or the `generate-uni-theme` MCP tool). Edits are never overwritten silently —',\n ' * regeneration rewrites this file, so commit before regenerating.',\n ` * ${reportSummary}.`,\n ' */',\n 'import {',\n ' createTheme,',\n ' type Borders,',\n ' type Colors,',\n ' type ComponentThemes,',\n ' type Shadows,',\n ' type UniTheme,',\n \"} from '@uni-design-system/uni-core';\",\n '',\n ...modes.map(({ colorsConst, colors }) => `const ${colorsConst}: Colors = {\\n${recordLiteral(colors as Record<string, string>, ' ')}\\n};\\n`),\n '/** Brand-tinted elevation shadows — theme-scoped, edit freely. */',\n ...modes.map(({ shadowsConst, shadows }) => `const ${shadowsConst}: Shadows = {\\n${recordLiteral(shadows as Record<string, string>, ' ')}\\n};\\n`),\n bordersLiteral(),\n '',\n '/**',\n ' * Sparse component overrides, deep-merged over Uni component defaults: only',\n ' * what you write here changes. Point components at your own primitives, e.g.:',\n \" * button: { variants: { secondary: { border: `2px dashed ${colors['tertiary']}` } } },\",\n \" * input: { options: { borderRadius: 'max' } },\",\n ' */',\n 'const components = (colors: Colors): ComponentThemes => ({});',\n '',\n ...(radii\n ? [`/** Shape language: '${input.shape}'. */`, `const radii = {\\n${recordLiteral(radii as Record<string, string>, ' ')}\\n};`, '']\n : []),\n ...modes.map(\n ({ exportName, displayName, colorsConst, shadowsConst }) =>\n `${themeExport(exportName, displayName, colorsConst, shadowsConst, !!radii)}\\n`\n ),\n '/** First key wins as the default theme when registered via UNI_THEMES. */',\n `export const ${id}Themes = { ${modes.map((m) => m.exportName).join(', ')} };`,\n '',\n ].join('\\n');\n\n const providerSnippet = [\n `import { UNI_THEMES } from '@uni-design-system/uni-angular';`,\n `import { ${id}Themes } from './uni-theme';`,\n '',\n '// app.config.ts → providers:',\n `{ provide: UNI_THEMES, useValue: ${id}Themes },`,\n ].join('\\n');\n\n return { content, providerSnippet, report, reportSummary };\n};\n","import { Gradient } from './gradient.model';\n\nexport function gradient(config: Gradient): string {\n return ``;\n}\n","import { Size } from '../core.types';\nimport { DeviceOrientation } from './layout.types';\n\nexport function getDeviceSize(height: number, width: number): Size {\n if (!height || !width) return 'md';\n\n const max = Math.max(height, width);\n\n if (max <= 600)\n // Small Mobile\n return 'xs';\n\n if (max <= 960)\n // Large Mobile\n return 'sm';\n\n if (max <= 1264)\n // Tablets\n return 'md';\n\n if (max <= 1904)\n // Laptops & Monitors\n return 'lg';\n\n return 'xl'; // Large Monitors\n}\n\nexport function getDeviceOrientation(height: number, width: number): DeviceOrientation {\n if (!height || !width) return 'landscape';\n\n return height > width ? 'portrait' : 'landscape';\n}\n","import { BoxShadow, ShadowDefinition } from './shadow.model';\n\n// box-shadow: none|h-offset v-offset blur spread color\nexport const GetBoxShadow = ({ offset, blur, opacity }: BoxShadow): string => {\n return `0 ${offset}px ${blur}px rgba(0,0,0,0.${opacity})`;\n};\n\nexport const GetBoxShadows = ({ umbra, penumbra }: ShadowDefinition): string => {\n return GetBoxShadow(umbra) + ', ' + GetBoxShadow(penumbra);\n};\n","import { ShadowDefinition } from './shadow.model';\nimport { ShadowElevation } from './shadow.types';\nimport { GetBoxShadows } from './shadow.utils';\n\nexport const ShadowMap: Record<ShadowElevation, ShadowDefinition> = {\n pressed: {\n umbra: {\n offset: 1,\n blur: 2,\n opacity: 24,\n },\n penumbra: {\n offset: 1,\n blur: 3,\n opacity: 12,\n },\n },\n raised: {\n umbra: {\n offset: 3,\n blur: 6,\n opacity: 23,\n },\n penumbra: {\n offset: 3,\n blur: 6,\n opacity: 16,\n },\n },\n focussed: {\n umbra: {\n offset: 6,\n blur: 6,\n opacity: 23,\n },\n penumbra: {\n offset: 10,\n blur: 20,\n opacity: 19,\n },\n },\n navigation: {\n umbra: {\n offset: 10,\n blur: 10,\n opacity: 22,\n },\n penumbra: {\n offset: 14,\n blur: 28,\n opacity: 25,\n },\n },\n modal: {\n umbra: {\n offset: 15,\n blur: 12,\n opacity: 22,\n },\n penumbra: {\n offset: 19,\n blur: 38,\n opacity: 30,\n },\n },\n};\n\nexport const ShadowCssMap: Record<ShadowElevation, string> = {\n pressed: GetBoxShadows(ShadowMap['pressed']),\n raised: GetBoxShadows(ShadowMap['raised']),\n focussed: GetBoxShadows(ShadowMap['focussed']),\n navigation: GetBoxShadows(ShadowMap['navigation']),\n modal: GetBoxShadows(ShadowMap['modal']),\n};\n","import type { StyleExpression } from './style.types';\n\nexport const removeInputPlatformStyling: StyleExpression = {\n appearance: 'none' /* Removes default platform styling */,\n background: 'none' /* Removes default background */,\n border: 'none' /* Removes default gray border */,\n outline: 'none' /* Removes default focus ring */,\n boxShadow: 'none' /* Removes any inner shadows on iOS */,\n padding: 0 /* Resets default spacing */,\n width: '100%' /* Makes it fill the stylized div */,\n};\n","import type { Colors } from '../theme.model';\nimport { generatePalette } from '../../color';\nimport { generateShadows } from '../../generation/shadow.generator';\nimport { BASE_PALETTE_CONFIG, createTheme } from './base.theme';\n\nexport const darkColors: Colors = generatePalette({ ...BASE_PALETTE_CONFIG, mode: 'dark' });\n\nexport const DarkTheme = createTheme({\n id: 'DarkTheme',\n name: 'Dark Theme',\n colors: darkColors,\n shadows: generateShadows(darkColors, 'dark'),\n});\n","import { generateShadows } from '../../generation/shadow.generator';\nimport { createTheme, lightColors } from './base.theme';\n\nexport const LightTheme = createTheme({\n id: 'LightTheme',\n name: 'Light Theme',\n colors: lightColors,\n shadows: generateShadows(lightColors, 'light'),\n});\n","import { type UniTheme } from './theme.model';\nimport { DarkTheme } from './themes/dark.theme';\nimport { LightTheme } from './themes/light.theme';\n\nexport const UniThemes: Record<string, UniTheme> = {\n LightTheme,\n DarkTheme,\n};\n\n// First Theme is default.\nexport const DefaultThemeId = Object.keys(UniThemes)[0];\n","import { FontWeight } from './typography.types';\n\nexport const FontWeightMap: Record<FontWeight, number> = {\n thin: 100,\n 'extra-light': 200,\n light: 200,\n normal: 400,\n medium: 500,\n 'semi-bold': 600,\n bold: 700,\n 'extra-bold': 800,\n black: 900,\n 'extra-black': 950,\n};\n","import type { TextStyle, TypeFaceDefinition } from './text.model';\n\nconst px = (value: number): string => `${value}px`;\n\n/**\n * Converts a TextStyle (numeric, design-token oriented) into a\n * TypeFaceDefinition (CSS-ready) so a theme's `typefaces` map can be\n * derived from its `typography` block instead of being duplicated.\n */\nexport const toTypeface = (style: TextStyle): TypeFaceDefinition => ({\n fontFamily: style.fontFamily,\n fontSize: px(style.fontSize),\n lineHeight: px(style.lineHeight),\n ...(style.letterSpacing !== undefined && { letterSpacing: px(style.letterSpacing) }),\n ...(style.textTransform === 'uppercase' && { textTransform: 'uppercase' as const }),\n ...(style.fontWeight !== undefined && { fontWeight: style.fontWeight }),\n ...(style.fontStyle && { fontStyle: style.fontStyle }),\n});\n\nexport const toTypefaces = (\n typography: Record<string, TextStyle>\n): Record<string, TypeFaceDefinition> =>\n Object.fromEntries(Object.entries(typography).map(([role, style]) => [role, toTypeface(style)]));\n","import { GetFieldType } from './types';\n\nexport function getValue<TData, TPath extends string, TDefault = GetFieldType<TData, TPath>>(\n data: TData,\n path: TPath,\n defaultValue?: TDefault\n): GetFieldType<TData, TPath> | TDefault {\n const value = path\n .split(/[.[\\]]/)\n .filter(Boolean)\n .reduce<GetFieldType<TData, TPath>>((value, key) => (value as any)?.[key], data as any);\n\n return value !== undefined ? value : (defaultValue as TDefault);\n}\n","export const debounce = <T extends (...args: any[]) => ReturnType<T>>(\n callback: T,\n timeout: number\n): ((...args: Parameters<T>) => void) => {\n let timer: ReturnType<typeof setTimeout>;\n\n return (...args: Parameters<T>) => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n callback(...args);\n }, timeout);\n };\n};\n"],"mappings":";;AAKA,IAAa,SAA8B;CACzC,MAAM,EACJ,SAAS,EACX;CACA,QAAQ,EACN,SAAS,EACX;AACF;AAEA,IAAa,UAA+B;CAC1C,MAAM,EACJ,SAAS,E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,WAAW;CACrE,GAAI,MAAM,aAAa,EAAE,WAAW,MAAM,UAAU;AACtD;AAEA,IAAa,eACX,eAEA,OAAO,YAAY,OAAO,QAAQ,UAAU,EAAE,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,KAAK,CAAC,CAAC,CAAC;;;ACpBjG,SAAgB,SACd,MACA,MACA,cACuC;CACvC,MAAM,QAAQ,KACX,MAAM,QAAQ,EACd,OAAO,OAAO,EACd,QAAoC,OAAO,QAAS,QAAgB,MAAM,IAAW;CAExF,OAAO,UAAU,KAAA,IAAY,QAAS;AACxC;;;ACbA,IAAa,YACX,UACA,YACuC;CACvC,IAAI;CAEJ,QAAQ,GAAG,SAAwB;EACjC,aAAa,KAAK;EAClB,QAAQ,iBAAiB;GACvB,SAAS,GAAG,IAAI;EAClB,GAAG,OAAO;CACZ;AACF"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/concepts/animation/keyframes.constants.ts","../../src/concepts/color/color.records.ts","../../src/concepts/color/color.utils.ts","../../src/concepts/color/color.helper.ts","../../src/concepts/generation/oklch.helper.ts","../../src/concepts/generation/palette.factory.ts","../../src/concepts/color/color.factory.ts","../../src/concepts/elevation/zIndex.ts","../../src/concepts/generation/dtcg.emitter.ts","../../src/concepts/generation/shadow.generator.ts","../../src/concepts/iconography/icon.records.ts","../../src/concepts/theme/themes/base.theme.ts","../../src/concepts/generation/theme.generator.ts","../../src/concepts/generation/theme-file.emitter.ts","../../src/concepts/gradient/gradient.helper.ts","../../src/concepts/layout/layout.helper.ts","../../src/concepts/shadow/shadow.utils.ts","../../src/concepts/shadow/shadow.records.ts","../../src/concepts/style/inputs.constants.ts","../../src/concepts/theme/themes/dark.theme.ts","../../src/concepts/theme/themes/light.theme.ts","../../src/concepts/theme/theme.records.ts","../../src/concepts/typography/typography.records.ts","../../src/concepts/typography/typeface.helpers.ts","../../src/utils/getValue.ts","../../src/utils/debounce.ts"],"sourcesContent":["import type { StyleExpression } from '../style/style.types';\n\nexport type PercentageString = `${number}%`;\nexport type KeyframesExpression = Record<PercentageString, StyleExpression>;\n\nexport const fadeIn: KeyframesExpression = {\n '0%': {\n opacity: 0,\n },\n '100%': {\n opacity: 1,\n },\n};\n\nexport const fadeOut: KeyframesExpression = {\n '0%': {\n opacity: 1,\n },\n '100%': {\n opacity: 0,\n },\n};\n\nexport const expandFadeIn = {\n '0%': {\n gridTemplateRows: '0fr',\n opacity: 0,\n },\n '100%': {\n gridTemplateRows: '1fr',\n opacity: 1,\n },\n};\n\nexport const collapseFadeOut = {\n '0%': {\n gridTemplateRows: '1fr',\n opacity: 1,\n },\n '100%': {\n gridTemplateRows: '0fr',\n opacity: 0,\n },\n};\n","import { Range } from './color.model';\nimport { ColorCategory, ColorRole, UtilityColorRole } from './color.types';\n\n/**\n * @deprecated HSL saturation ranges are superseded by the perceptual OKLCH\n * chroma model inside `concepts/generation` (see `generateThemes`). Kept for\n * legacy callers of `uniColor`; removal follows the changeset major process.\n */\nexport const CategorySaturation: Record<ColorCategory, Range> = {\n jewel: { low: 73, high: 83 },\n pastel: { low: 14, high: 21 },\n earth: { low: 36, high: 41 },\n neutral: { low: 1, high: 10 },\n florescent: { low: 63, high: 100 },\n shades: { low: 0, high: 0 },\n};\n\n/**\n * @deprecated HSL lightness ranges are superseded by the perceptual OKLCH\n * tone slots inside `concepts/generation` (see `generateThemes`).\n */\nexport const CategoryLightness: Record<ColorCategory, Range> = {\n jewel: { low: 56, high: 76 },\n pastel: { low: 89, high: 96 },\n earth: { low: 36, high: 77 },\n neutral: { low: 70, high: 99 },\n florescent: { low: 82, high: 100 },\n shades: { low: 0, high: 100 },\n};\n\nexport const RoleHues: Record<ColorRole | UtilityColorRole, Range> = {\n primary: { low: 73, high: 83, default: 0 },\n secondary: { low: 14, high: 21, default: 0 },\n tertiary: { low: 36, high: 41, default: 0 },\n inverse: { low: 63, high: 100, default: 0 },\n ghost: { low: 0, high: 0, default: 0 },\n warn: { low: 320, high: 20, default: 0 }, // red\n alert: { low: 40, high: 70, default: 60 }, // yellow\n success: { low: 90, high: 150, default: 120 }, // green\n info: { low: 200, high: 260, default: 240 }, // blue\n};\n","import { Range } from './color.model';\nimport type { ColorScheme } from './color.types';\n\n/**\n * @deprecated Randomized generation is superseded by the deterministic OKLCH\n * engine in `concepts/generation` — same input, same theme. Seeded \"surprise\n * me\" behavior belongs in the consumer (playground), not the engine.\n */\nexport const randomRangeValue = ({ low, high }: Range): number => {\n low = Math.ceil(low);\n high = Math.floor(high);\n return Math.floor(Math.random() * (high - low + 1)) + low;\n};\n\nexport const cycle = (angle: number): number => {\n if (angle > 360) return angle - 360;\n if (angle < 0) return angle + 360;\n return angle;\n};\n\nexport const getAnalogousHues = (hue: number): number[] => [cycle(hue + 30), cycle(hue + 60)];\nexport const getComplimentaryHue = (hue: number): number => cycle(hue + 180);\nexport const getTriadicHues = (hue: number): number[] => [cycle(hue + 120), cycle(hue - 120)];\nexport const getSplitComplimentaryHues = (hue: number): number[] => [\n cycle(hue + 150),\n cycle(hue - 150),\n];\n\nexport interface RoleHueSet {\n primary: number;\n secondary: number;\n tertiary: number;\n}\n\n/**\n * Derive the primary/secondary/tertiary hues from a seed hue using the color\n * wheel relationships in {@link ColorScheme}. Pure angle math — works in any\n * hue space (HSL historically, OKLCH in the generation engine).\n */\nexport const schemeHues = (hue: number, scheme: ColorScheme): RoleHueSet => {\n switch (scheme) {\n case 'monochromatic':\n return { primary: hue, secondary: hue, tertiary: hue };\n case 'analogous': {\n const [a, b] = getAnalogousHues(hue);\n return { primary: hue, secondary: a, tertiary: b };\n }\n case 'complimentary': {\n const [a] = getAnalogousHues(hue);\n return { primary: hue, secondary: getComplimentaryHue(hue), tertiary: a };\n }\n case 'splitComplimentary': {\n const [a, b] = getSplitComplimentaryHues(hue);\n return { primary: hue, secondary: a, tertiary: b };\n }\n case 'triadic': {\n const [a, b] = getTriadicHues(hue);\n return { primary: hue, secondary: a, tertiary: b };\n }\n }\n};\n","import { HSL, HSLA, RGB, UniColor } from './color.model';\nimport { CategoryLightness, CategorySaturation, RoleHues } from './color.records';\nimport { randomRangeValue } from './color.utils';\n\nexport function HSLAToString({ hue, saturation, lightness, alpha = 1 }: HSLA): string {\n return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;\n}\n\nexport function RGBToString({ red, green, blue }: RGB): string {\n return `rgb(${red}, ${green}, ${blue})`;\n}\n\n/**\n * @deprecated Random HSL generation produces non-deterministic, perceptually\n * uneven colors. Use the OKLCH engine (`generateThemes` in\n * `concepts/generation`) or `generatePalette` instead.\n */\nexport function uniColor({ role, category, alpha = 1 }: UniColor): string {\n const hue = randomRangeValue(RoleHues[role]);\n const saturation = randomRangeValue(CategorySaturation[category]);\n const lightness = randomRangeValue(CategoryLightness[category]);\n\n return HSLAToString({ hue, saturation, lightness, alpha });\n}\n\nexport const RGBToHSL = ({ red, green, blue }: RGB): HSL => {\n red /= 255;\n green /= 255;\n blue /= 255;\n const l = Math.max(red, green, blue);\n const s = l - Math.min(red, green, blue);\n const h = s\n ? l === red\n ? (green - blue) / s\n : l === green\n ? 2 + (blue - red) / s\n : 4 + (red - green) / s\n : 0;\n return {\n hue: 60 * h < 0 ? 60 * h + 360 : 60 * h,\n saturation: 100 * (s ? (l <= 0.5 ? s / (2 * l - s) : s / (2 - (2 * l - s))) : 0),\n lightness: (100 * (2 * l - s)) / 2,\n };\n};\n\n// ── Conversions & contrast (used by the palette factory) ────────────────────\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\nconst toHex2 = (value: number): string => clamp(Math.round(value), 0, 255).toString(16).padStart(2, '0');\n\nexport const rgbToHex = ({ red, green, blue }: RGB): string =>\n `#${toHex2(red)}${toHex2(green)}${toHex2(blue)}`.toUpperCase();\n\nexport const hexToRgb = (hex: string): RGB => {\n let h = hex.replace('#', '').trim();\n if (h.length === 3) h = h.split('').map((c) => c + c).join('');\n const int = parseInt(h, 16);\n return { red: (int >> 16) & 255, green: (int >> 8) & 255, blue: int & 255 };\n};\n\nexport const HSLToRGB = ({ hue = 0, saturation = 0, lightness = 0 }: HSL): RGB => {\n const s = clamp(saturation, 0, 100) / 100;\n const l = clamp(lightness, 0, 100) / 100;\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const hp = (((hue % 360) + 360) % 360) / 60;\n const x = c * (1 - Math.abs((hp % 2) - 1));\n const [r1, g1, b1] =\n hp < 1\n ? [c, x, 0]\n : hp < 2\n ? [x, c, 0]\n : hp < 3\n ? [0, c, x]\n : hp < 4\n ? [0, x, c]\n : hp < 5\n ? [x, 0, c]\n : [c, 0, x];\n const m = l - c / 2;\n return {\n red: (r1 + m) * 255,\n green: (g1 + m) * 255,\n blue: (b1 + m) * 255,\n };\n};\n\n/** Build an sRGB hex string straight from HSL channel values. */\nexport const HSLToHex = (hsl: HSL): string => rgbToHex(HSLToRGB(hsl));\n\nexport const hexToHSL = (hex: string): HSL => RGBToHSL(hexToRgb(hex));\n\n/** WCAG relative luminance of an sRGB color (0 = black, 1 = white). */\nexport const relativeLuminance = ({ red, green, blue }: RGB): number => {\n const channel = (value: number): number => {\n const v = value / 255;\n return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\n };\n return 0.2126 * channel(red) + 0.7152 * channel(green) + 0.0722 * channel(blue);\n};\n\n/** WCAG contrast ratio between two colors (1:1 – 21:1). Accepts RGB or hex. */\nexport const contrastRatio = (a: RGB | string, b: RGB | string): number => {\n const la = relativeLuminance(typeof a === 'string' ? hexToRgb(a) : a);\n const lb = relativeLuminance(typeof b === 'string' ? hexToRgb(b) : b);\n const [hi, lo] = la > lb ? [la, lb] : [lb, la];\n return (hi + 0.05) / (lo + 0.05);\n};\n\n// Future Methods - https://codepen.io/jkantner/pen/VVEMRK\n","import type { RGB } from '../color/color.model';\nimport { hexToRgb, rgbToHex } from '../color/color.helper';\n\n/**\n * A color in OKLCH: perceptual lightness `l` (0–1), chroma `c` (0 = grey,\n * ~0.37 = max sRGB vividness) and hue angle `h` in degrees (0–360).\n *\n * Unlike HSL lightness, OKLCH `l` is perceptually uniform — a blue and a\n * yellow at the same `l` *look* equally light — which is what makes derived\n * tonal scales consistent across hues.\n */\nexport interface Oklch {\n l: number;\n c: number;\n h: number;\n}\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\n// sRGB transfer function and its inverse (gamma ↔ linear light).\nconst srgbToLinear = (channel: number): number =>\n channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);\n\nconst linearToSrgb = (channel: number): number =>\n channel <= 0.0031308 ? 12.92 * channel : 1.055 * Math.pow(channel, 1 / 2.4) - 0.055;\n\ninterface LinearRGB {\n r: number;\n g: number;\n b: number;\n}\n\n// OKLab ↔ linear sRGB matrices (Björn Ottosson's reference constants).\nconst linearRgbToOklab = ({ r, g, b }: LinearRGB): { l: number; a: number; b: number } => {\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return {\n l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n };\n};\n\nconst oklabToLinearRgb = (l: number, a: number, b: number): LinearRGB => {\n const l_ = Math.pow(l + 0.3963377774 * a + 0.2158037573 * b, 3);\n const m_ = Math.pow(l - 0.1055613458 * a - 0.0638541728 * b, 3);\n const s_ = Math.pow(l - 0.0894841775 * a - 1.291485548 * b, 3);\n return {\n r: 4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,\n g: -1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,\n b: -0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_,\n };\n};\n\nconst oklchToLinearRgb = ({ l, c, h }: Oklch): LinearRGB => {\n const rad = (h * Math.PI) / 180;\n return oklabToLinearRgb(l, c * Math.cos(rad), c * Math.sin(rad));\n};\n\nconst GAMUT_EPSILON = 1e-4;\n\nconst inSrgbGamut = ({ r, g, b }: LinearRGB): boolean =>\n r >= -GAMUT_EPSILON &&\n r <= 1 + GAMUT_EPSILON &&\n g >= -GAMUT_EPSILON &&\n g <= 1 + GAMUT_EPSILON &&\n b >= -GAMUT_EPSILON &&\n b <= 1 + GAMUT_EPSILON;\n\n/** Parse a hex color (`#RGB` or `#RRGGBB`) into OKLCH. */\nexport const hexToOklch = (hex: string): Oklch => {\n const { red, green, blue } = hexToRgb(hex);\n const { l, a, b } = linearRgbToOklab({\n r: srgbToLinear(red / 255),\n g: srgbToLinear(green / 255),\n b: srgbToLinear(blue / 255),\n });\n const c = Math.hypot(a, b);\n const h = c < 1e-6 ? 0 : (Math.atan2(b, a) * 180) / Math.PI;\n return { l, c, h: h < 0 ? h + 360 : h };\n};\n\n/**\n * Render OKLCH as an sRGB hex string. Out-of-gamut colors are mapped back\n * into sRGB by reducing chroma only — lightness and hue are preserved, so\n * vivid seeds desaturate gracefully instead of shifting hue or clipping.\n */\nexport const oklchToHex = (color: Oklch): string => {\n const target: Oklch = { l: clamp(color.l, 0, 1), c: Math.max(color.c, 0), h: color.h };\n let rgb = oklchToLinearRgb(target);\n if (!inSrgbGamut(rgb)) {\n let low = 0;\n let high = target.c;\n for (let i = 0; i < 24; i++) {\n const mid = (low + high) / 2;\n if (inSrgbGamut(oklchToLinearRgb({ ...target, c: mid }))) low = mid;\n else high = mid;\n }\n rgb = oklchToLinearRgb({ ...target, c: low });\n }\n // Scale *after* the transfer function: 255 × transfer(channel), rounded once\n // inside rgbToHex. Rounding before scaling collapses every channel to 0/1.\n return rgbToHex(toSrgb255(rgb));\n};\n\nconst toSrgb255 = ({ r, g, b }: LinearRGB): RGB => ({\n red: 255 * linearToSrgb(clamp(r, 0, 1)),\n green: 255 * linearToSrgb(clamp(g, 0, 1)),\n blue: 255 * linearToSrgb(clamp(b, 0, 1)),\n});\n","import type { Colors } from '../theme/theme.model';\nimport type { BrandRole, PaletteConfig } from '../color/color.factory';\nimport type { ColorCategory } from '../color/color.types';\nimport { contrastRatio, hexToRgb, relativeLuminance } from '../color/color.helper';\nimport { schemeHues } from '../color/color.utils';\nimport { hexToOklch, oklchToHex, type Oklch } from './oklch.helper';\nimport type { ContrastCheck } from './generation.types';\n\nexport interface GenerateColorsConfig extends PaletteConfig {\n /**\n * Soft brand anchors, per role: the palette starts from these exact colors\n * but the WCAG guard-rail may adjust lightness (never hue) to reach AA.\n * Contrast-safe counterpart to the hard `brand` pins, which are emitted\n * verbatim even when they fail.\n */\n targets?: Partial<Record<BrandRole, string>>;\n /** Sink for the contrast checks performed while building this palette. */\n checks?: ContrastCheck[];\n}\n\n// ── Tonal architecture ──────────────────────────────────────────────────────\n// Every token maps onto one of these OKLCH lightness slots. Because OKLCH L\n// is perceptually uniform, a slot renders equally light for every hue — the\n// property HSL lacked, and the root fix for muddy derived palettes.\nconst toneMap = (dark: boolean) =>\n dark\n ? {\n accent: 0.78,\n container: 0.42,\n roleSurface: 0.26,\n background: 0.18,\n surface: 0.21,\n surfaceVariant: 0.32,\n outline: 0.66,\n onSurface: 0.93,\n mutedText: 0.76,\n inverse: 0.93,\n onInverse: 0.25,\n onDeep: 0.2,\n onLight: 0.985,\n grey: 0.72,\n disabledContainer: 0.3,\n }\n : {\n accent: 0.55,\n container: 0.9,\n roleSurface: 0.97,\n background: 0.995,\n surface: 0.985,\n surfaceVariant: 0.94,\n outline: 0.6,\n onSurface: 0.25,\n mutedText: 0.48,\n inverse: 0.3,\n onInverse: 0.97,\n onDeep: 0.24,\n onLight: 0.985,\n grey: 0.5,\n disabledContainer: 0.96,\n };\n\n// OKLCH chroma per tonal category — the perceptual successor to the HSL\n// `CategorySaturation` table. Values are accent-level chroma; container and\n// surface chroma are derived fractions.\nexport const CategoryChroma: Record<ColorCategory, number> = {\n jewel: 0.17,\n pastel: 0.055,\n earth: 0.08,\n neutral: 0.03,\n florescent: 0.26,\n shades: 0,\n};\n\n/** Dark-mode accents cap chroma so they don't vibrate on dark surfaces. */\nconst DARK_ACCENT_CHROMA_CAP = 0.16;\n\n// Semantic feedback roles in OKLCH: hue + chroma per role. Chroma differs per\n// role because sRGB gamut room differs by hue at the AA-dark lightness light\n// mode forces on ink tokens: red holds 0.20; amber sits at 55° (not 70° —\n// dark yellow reads brown, dark orange stays lively) with 0.18; green 0.16.\nconst SemanticColors = {\n error: { hue: 27, chroma: 0.2 },\n warn: { hue: 55, chroma: 0.18 },\n success: { hue: 152, chroma: 0.16 },\n} as const;\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value));\n\n/**\n * Generate a complete {@link Colors} token set in OKLCH. Same contract as\n * `generatePalette` (which delegates here), plus soft brand targets and a\n * contrast-check sink for {@link ContrastReport} consumers.\n */\nexport const generateColors = (config: GenerateColorsConfig): Colors => {\n const {\n seed,\n scheme,\n category,\n mode = 'light',\n accentSaturationFloor = 18,\n brand = {},\n targets = {},\n checks,\n } = config;\n const dark = mode === 'dark';\n const t = toneMap(dark);\n\n // The primary anchor (hard pin > soft target > seed) sets the neutral hue.\n const anchor = hexToOklch(brand.primary ?? targets.primary ?? seed);\n const hues = schemeHues(anchor.h, scheme);\n\n // Chroma model. The floor keeps the brand hue perceptible even for the\n // near-grey `neutral` category (0–100 legacy scale → OKLCH chroma).\n const chromaFloor = (accentSaturationFloor / 100) * 0.28;\n let accentC = Math.max(CategoryChroma[category], chromaFloor);\n if (dark) accentC = Math.min(accentC, DARK_ACCENT_CHROMA_CAP);\n const containerC = Math.max(CategoryChroma[category] * 0.45, accentC * 0.35);\n const surfaceC = Math.min(CategoryChroma[category], 0.012);\n\n const tone = (hue: number, c: number, l: number): string => oklchToHex({ l, c, h: hue });\n\n /**\n * The WCAG guard-rail: walk the foreground's OKLCH lightness away from the\n * background until the pair meets `target` (≤ 50 steps). Hue is never\n * touched; chroma only shrinks as a last resort when L runs out of room.\n */\n const ensureContrast = (fg: Oklch, bg: string, target: number): Oklch => {\n const out: Oklch = { ...fg };\n let hex = oklchToHex(out);\n if (contrastRatio(hex, bg) >= target) return out;\n // Pick the direction that can actually reach the target: each side has a\n // hard ceiling — black tops out at (Ybg + 0.05) / 0.05, white at\n // 1.05 / (Ybg + 0.05) — so staying on the foreground's current side is\n // only right when that side has enough headroom.\n const bgY = relativeLuminance(hexToRgb(bg));\n const darkCeiling = (bgY + 0.05) / 0.05;\n const lightCeiling = 1.05 / (bgY + 0.05);\n let lighten = relativeLuminance(hexToRgb(hex)) >= bgY;\n if (lighten && lightCeiling < target && darkCeiling >= target) lighten = false;\n if (!lighten && darkCeiling < target && lightCeiling >= target) lighten = true;\n const step = lighten ? 0.015 : -0.015;\n for (let i = 0; i < 50 && contrastRatio(hex, bg) < target; i++) {\n if ((step > 0 && out.l < 0.995) || (step < 0 && out.l > 0.02)) {\n out.l = clamp(out.l + step, 0, 1);\n } else {\n out.c = Math.max(0, out.c - 0.02);\n }\n hex = oklchToHex(out);\n }\n return out;\n };\n\n /** Guard-railed token: adjust toward `target` contrast, then record the pair. */\n const contrasted = (fg: Oklch, bgHex: string, target: number): string =>\n oklchToHex(ensureContrast(fg, bgHex, target));\n\n const record = (\n foreground: string,\n background: string,\n foregroundColor: string,\n backgroundColor: string,\n required: number\n ): void => {\n if (!checks) return;\n const ratio = contrastRatio(foregroundColor, backgroundColor);\n checks.push({\n mode,\n foreground,\n background,\n foregroundColor,\n backgroundColor,\n ratio: Math.round(ratio * 100) / 100,\n required,\n pass: ratio >= required,\n level: ratio < required ? 'fail' : ratio >= 7 ? 'AAA' : 'AA',\n });\n };\n\n const background = tone(anchor.h, surfaceC, t.background);\n const surface = tone(anchor.h, surfaceC, t.surface);\n const surfaceVariant = tone(anchor.h, surfaceC, t.surfaceVariant);\n\n // Legible foreground for a given ground: whichever of the tonal near-black /\n // near-white starts closer to AA, then guard-railed the rest of the way.\n const onColor = (hue: number, bg: string, c: number): string => {\n const deep: Oklch = { l: t.onDeep, c: Math.min(c, 0.05), h: hue };\n const light: Oklch = { l: t.onLight, c: Math.min(c, 0.02), h: hue };\n const pick =\n contrastRatio(oklchToHex(deep), bg) >= contrastRatio(oklchToHex(light), bg) ? deep : light;\n return contrasted(pick, bg, 4.5);\n };\n\n // Dark-mode counterpart of a *hard-pinned* brand color: lift lightness only\n // (hue and chroma preserved) until it clears 3:1 on the dark ground.\n const adaptPinForDark = (hex: string): string => {\n const pin = hexToOklch(hex);\n pin.l = Math.max(pin.l, 0.6);\n return oklchToHex(ensureContrast(pin, background, 3));\n };\n\n /**\n * Resolve a role's base color: hard pins are verbatim in light mode and\n * lightness-lifted in dark; soft targets and generated tones are pulled to\n * ≥ 4.5:1 as standalone ink on `background` and `surface` (§3.6).\n */\n const baseFor = (name: BrandRole, hue: number, c: number): string => {\n const pinned = brand[name];\n if (pinned) return dark ? adaptPinForDark(pinned) : pinned;\n const target = targets[name];\n let base: Oklch;\n if (target) {\n // Soft targets keep their own chroma — brand fidelity beats category.\n // Callers that want a vibe cap applied clamp the target before passing\n // it in (see `generateThemes`). Dark mode still decouples chroma.\n base = hexToOklch(target);\n if (dark) {\n base.c = Math.min(base.c, DARK_ACCENT_CHROMA_CAP);\n base.l = Math.max(base.l, t.accent - 0.08);\n }\n } else {\n base = { l: t.accent, c, h: hue };\n }\n return oklchToHex(ensureContrast(ensureContrast(base, background, 4.5), surface, 4.5));\n };\n\n const disabled = dark ? 'rgba(255,255,255,0.12)' : 'rgba(0,0,0,0.12)';\n const onDisabled = dark ? 'rgba(255,255,255,0.38)' : 'rgba(0,0,0,0.38)';\n\n // An accent role's base drives its container/surface/on satellites. Every\n // content satellite passes through the guard-rail and is recorded.\n const role = (name: string, base: string, cC: number = containerC) => {\n const { h, c } = hexToOklch(base);\n const container = tone(h, cC, t.container);\n const roleSurface = tone(h, surfaceC, t.roleSurface);\n const onBase = onColor(h, base, c);\n const onContainer = onColor(h, container, c);\n const onContainerVariant = contrasted({ l: t.mutedText, c: Math.min(cC, 0.06), h }, container, 4.5);\n const border = ensureContrast(ensureContrast(hexToOklch(base), container, 3), surface, 3);\n const borderHex = oklchToHex(border);\n const onRoleSurface = onColor(h, roleSurface, surfaceC);\n const onRoleSurfaceVariant = contrasted(hexToOklch(base), roleSurface, 4.5);\n\n record(`on-${name}`, name, onBase, base, 4.5);\n record(`on-${name}-container`, `${name}-container`, onContainer, container, 4.5);\n record(`on-${name}-container-variant`, `${name}-container`, onContainerVariant, container, 4.5);\n record(`on-${name}-container-border`, `${name}-container`, borderHex, container, 3);\n record(`on-${name}-container-border`, 'surface', borderHex, surface, 3);\n record(`on-${name}-surface`, `${name}-surface`, onRoleSurface, roleSurface, 4.5);\n record(`on-${name}-surface-variant`, `${name}-surface`, onRoleSurfaceVariant, roleSurface, 4.5);\n record(name, 'background', base, background, 4.5);\n record(name, 'surface', base, surface, 4.5);\n\n return {\n [name]: base,\n [`on-${name}`]: onBase,\n [`${name}-container`]: container,\n [`on-${name}-container`]: onContainer,\n [`on-${name}-container-variant`]: onContainerVariant,\n [`on-${name}-container-border`]: borderHex,\n [`${name}-surface`]: roleSurface,\n [`on-${name}-surface`]: onRoleSurface,\n [`on-${name}-surface-variant`]: onRoleSurfaceVariant,\n };\n };\n\n const primaryBase = baseFor('primary', hues.primary, accentC);\n const secondaryBase = baseFor('secondary', hues.secondary, accentC);\n const tertiaryBase = baseFor('tertiary', hues.tertiary, accentC);\n\n // Quaternary is a neutral, near-grey accent tied to the brand hue.\n const quaternaryGrey = brand.quaternary\n ? dark\n ? adaptPinForDark(brand.quaternary)\n : brand.quaternary\n : oklchToHex(ensureContrast({ l: t.grey, c: surfaceC, h: anchor.h }, surface, 3));\n const quaternarySurface = tone(anchor.h, surfaceC, t.roleSurface);\n const onQuaternary = onColor(anchor.h, quaternaryGrey, surfaceC);\n const onQuaternarySurface = onColor(anchor.h, quaternarySurface, surfaceC);\n const onQuaternarySurfaceVariant = contrasted(hexToOklch(primaryBase), quaternarySurface, 4.5);\n const onQuaternaryContainerVariant = contrasted(\n { l: t.mutedText, c: Math.min(containerC, 0.06), h: anchor.h },\n quaternarySurface,\n 4.5\n );\n record('on-quaternary', 'quaternary', onQuaternary, quaternaryGrey, 4.5);\n record('on-quaternary-surface', 'quaternary-surface', onQuaternarySurface, quaternarySurface, 4.5);\n record(\n 'on-quaternary-surface-variant',\n 'quaternary-surface',\n onQuaternarySurfaceVariant,\n quaternarySurface,\n 4.5\n );\n\n // Semantic feedback roles keep colorful, recognizable hues in every category.\n const semantic = (name: 'error' | 'warn' | 'success') => {\n const { hue, chroma } = SemanticColors[name];\n const base = baseFor(name, hue, dark ? Math.min(chroma, DARK_ACCENT_CHROMA_CAP) : chroma);\n const { h } = hexToOklch(base);\n const container = tone(h, containerC + 0.04, t.container);\n const onBase = onColor(h, base, chroma);\n const onContainer = onColor(h, container, chroma);\n record(`on-${name}`, name, onBase, base, 4.5);\n record(`on-${name}-container`, `${name}-container`, onContainer, container, 4.5);\n record(name, 'background', base, background, 4.5);\n record(name, 'surface', base, surface, 4.5);\n return { base, container, onBase, onContainer, h };\n };\n\n const error = semantic('error');\n const warn = semantic('warn');\n const success = semantic('success');\n\n const semanticExtras = (name: 'warn' | 'success', s: ReturnType<typeof semantic>) => {\n const variant = contrasted({ l: t.mutedText, c: 0.06, h: s.h }, s.container, 4.5);\n const border = oklchToHex(\n ensureContrast(ensureContrast(hexToOklch(s.base), s.container, 3), surface, 3)\n );\n record(`on-${name}-container-variant`, `${name}-container`, variant, s.container, 4.5);\n record(`on-${name}-container-border`, `${name}-container`, border, s.container, 3);\n return { variant, border };\n };\n const warnExtras = semanticExtras('warn', warn);\n const successExtras = semanticExtras('success', success);\n\n // Neutral text tokens.\n const onBackground = tone(anchor.h, surfaceC, t.onSurface);\n const onBackgroundVariant = contrasted({ l: t.mutedText, c: surfaceC, h: anchor.h }, background, 4.5);\n const onSurface = tone(anchor.h, surfaceC, t.onSurface);\n const onSurfaceVariant = contrasted(\n { l: dark ? t.mutedText : t.mutedText - 0.14, c: surfaceC, h: anchor.h },\n surfaceVariant,\n 4.5\n );\n record('on-background', 'background', onBackground, background, 4.5);\n record('on-background-variant', 'background', onBackgroundVariant, background, 4.5);\n record('on-surface', 'surface', onSurface, surface, 4.5);\n record('on-surface-variant', 'surface-variant', onSurfaceVariant, surfaceVariant, 4.5);\n\n // Inverse surfaces flip the ground; their accents must stay legible there.\n const inverseSurface = tone(anchor.h, surfaceC, t.inverse);\n const onInverse = tone(anchor.h, surfaceC, t.onInverse);\n const inversePrimary = contrasted(hexToOklch(primaryBase), inverseSurface, 4.5);\n record('on-inverse-surface', 'inverse-surface', onInverse, inverseSurface, 4.5);\n record('on-inverse-surface-primary', 'inverse-surface', inversePrimary, inverseSurface, 4.5);\n record('on-inverse-container', 'inverse-container', onInverse, inverseSurface, 4.5);\n\n const outline = oklchToHex(\n ensureContrast(\n ensureContrast({ l: t.outline, c: Math.min(surfaceC, 0.02), h: hues.primary }, surface, 3),\n background,\n 3\n )\n );\n record('outline', 'surface', outline, surface, 3);\n record('outline', 'background', outline, background, 3);\n\n return {\n ...role('primary', primaryBase),\n ...role('secondary', secondaryBase),\n ...role('tertiary', tertiaryBase),\n\n quaternary: quaternaryGrey,\n 'on-quaternary': onQuaternary,\n 'quaternary-surface': quaternarySurface,\n 'on-quaternary-surface': onQuaternarySurface,\n 'on-quaternary-surface-variant': onQuaternarySurfaceVariant,\n 'on-quaternary-container-variant': onQuaternaryContainerVariant,\n 'on-quaternary-container-border': quaternaryGrey,\n\n // Semantic\n error: error.base,\n 'on-error': error.onBase,\n 'error-container': error.container,\n 'on-error-container': error.onContainer,\n\n warn: warn.base,\n 'on-warn': warn.onBase,\n 'warn-container': warn.container,\n 'on-warn-container': warn.onContainer,\n 'on-warn-container-variant': warnExtras.variant,\n 'on-warn-container-border': warnExtras.border,\n\n success: success.base,\n 'on-success': success.onBase,\n 'success-container': success.container,\n 'on-success-container': success.onContainer,\n 'on-success-container-variant': successExtras.variant,\n 'on-success-container-border': successExtras.border,\n\n // Neutral surfaces\n background,\n 'on-background': onBackground,\n 'on-background-variant': onBackgroundVariant,\n surface,\n 'on-surface': onSurface,\n 'surface-variant': surfaceVariant,\n 'on-surface-variant': onSurfaceVariant,\n\n // Inverse\n 'inverse-surface': inverseSurface,\n 'on-inverse-surface': onInverse,\n 'on-inverse-surface-primary': inversePrimary,\n 'on-inverse-surface-variant': inversePrimary,\n 'inverse-container': inverseSurface,\n 'on-inverse-container': onInverse,\n\n // Utility\n outline,\n shadow: '#000000',\n scrim: '#000000',\n 'surface-tint': primaryBase,\n transparent: 'rgba(0,0,0,0)',\n ghost: 'rgba(0,0,0,0)',\n\n // Disabled (deliberate alpha overlays — excluded from the contrast report)\n disabled,\n 'on-disabled': onDisabled,\n 'disabled-container': tone(hues.primary, surfaceC, t.disabledContainer),\n 'on-disabled-container': onDisabled,\n 'disabled-surface': disabled,\n 'on-disabled-surface': dark ? 'rgba(255,255,255,0.5)' : 'rgba(0,0,0,0.5)',\n 'on-disabled-surface-variant': dark ? 'rgba(255,255,255,0.4)' : 'rgba(0,0,0,0.4)',\n };\n};\n","import type { Colors } from '../theme';\nimport { generateColors, type GenerateColorsConfig } from '../generation/palette.factory';\nimport type { ColorCategory, ColorScheme } from './color.types';\n\n/** Roles whose base color can be pinned to an exact brand hex. */\nexport type BrandRole =\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'quaternary'\n | 'error'\n | 'warn'\n | 'success';\n\nexport interface PaletteConfig {\n /**\n * Seed brand color as a hex string, e.g. '#4F46E5'. Anchors the neutral\n * hue and every role you don't pin via `brand`. When `brand.primary` is\n * set, that color anchors instead.\n */\n seed: string;\n /** How secondary/tertiary hues relate to the anchor, for unpinned roles. */\n scheme: ColorScheme;\n /** Saturation / tonal character of the generated (unpinned) colors. */\n category: ColorCategory;\n /** Light or dark rendering of the same palette. Defaults to 'light'. */\n mode?: 'light' | 'dark';\n /**\n * Minimum accent saturation (0–100 scale) so the brand hue stays perceptible\n * even for the `neutral` category (which is otherwise near-grey). Set to 0\n * to honor the category saturation exactly.\n */\n accentSaturationFloor?: number;\n /**\n * Exact brand colors, pinned per role. A pinned color is emitted verbatim as\n * that role's base token in **light** mode (\"cannot shift\"); in **dark** mode\n * it is lifted in lightness only — hue and chroma preserved — so it stays\n * legible on a dark ground. Its on/container/surface satellites are derived\n * from it. Unpinned roles are generated from the seed + scheme as usual, so an\n * arbitrary brand pair (e.g. forest green + ochre) can be reproduced exactly.\n */\n brand?: Partial<Record<BrandRole, string>>;\n}\n\n/**\n * Generate a complete {@link Colors} token set from a single seed color, a\n * {@link ColorScheme} and a {@link ColorCategory}. Produces a light or dark\n * variant of the same palette; `on-*` colors are driven to WCAG AA contrast\n * so text stays legible for any seed.\n *\n * Delegates to the OKLCH engine in `concepts/generation` — all lightness and\n * chroma math is perceptual, and every derived pair passes through the WCAG\n * guard-rail. Accepts the engine's extended config, so callers may also pass\n * soft `targets` (brand-faithful but guard-railed) and a `checks` sink. Use\n * `generateThemes()` for the light+dark pair plus a {@link ContrastReport}.\n */\nexport const generatePalette = (config: GenerateColorsConfig): Colors => generateColors(config);\n","export type ZIndexableElements =\n | 'dropdown'\n | 'sticky'\n | 'fixed'\n | 'backdrop'\n | 'dialog'\n | 'popover'\n | 'tooltip'\n | 'overlay';\n\nexport const Z_INDEX: Record<ZIndexableElements, number> = {\n dropdown: 1000,\n sticky: 1020,\n fixed: 1030,\n backdrop: 1040,\n dialog: 1050,\n popover: 1060,\n tooltip: 1070,\n overlay: 1080,\n};\n","import type { Colors, Radii, Spacing } from '../theme/theme.model';\n\n/** A single W3C DTCG design token. */\nexport interface DtcgToken {\n $value: string;\n $type: 'color' | 'dimension';\n}\n\n/** DTCG-format token document (Style Dictionary compatible), per PRD §6. */\nexport interface DtcgTokens {\n color: Record<string, DtcgToken>;\n size: {\n radius: Record<string, DtcgToken>;\n spacing: Record<string, DtcgToken>;\n };\n}\n\nconst dimensionEntries = (record: Radii | Spacing | undefined): Record<string, DtcgToken> =>\n Object.fromEntries(\n Object.entries(record ?? {})\n .filter(([, value]) => value !== undefined && value !== 'none')\n .map(([key, value]) => [key, { $value: String(value), $type: 'dimension' as const }])\n );\n\n/**\n * Render one theme mode's tokens as W3C DTCG JSON for external pipelines\n * (Style Dictionary etc.). Token names are exactly Uni's `ColorToken` strings —\n * one vocabulary everywhere. The native `UniTheme` object remains the primary,\n * lossless output; this is the interop layer.\n */\nexport const emitDtcgTokens = (input: {\n colors: Colors;\n radii?: Radii;\n spacing?: Spacing;\n}): DtcgTokens => ({\n color: Object.fromEntries(\n Object.entries(input.colors)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => [key, { $value: value as string, $type: 'color' as const }])\n ),\n size: {\n radius: dimensionEntries(input.radii),\n spacing: dimensionEntries(input.spacing),\n },\n});\n","import type { Colors, Shadows } from '../theme/theme.model';\nimport { hexToRgb } from '../color/color.helper';\nimport { hexToOklch, oklchToHex } from './oklch.helper';\n\nconst rgba = (hex: string, alpha: number): string => {\n const { red, green, blue } = hexToRgb(hex);\n return `rgba(${red}, ${green}, ${blue}, ${alpha})`;\n};\n\n/**\n * Brand-tinted, theme-scoped elevation shadows (PRD §3.5.C).\n *\n * Light mode replaces the dead-neutral black stacks with a shadow ink pulled\n * toward the brand hue — dark and low-chroma enough to read as shadow, tinted\n * enough to kill the grey \"mud\" where shadows meet brand surfaces. Dark mode\n * goes near-zero: elevation is carried by the surface lightness steps, with\n * only a faint veil kept on floating overlays (menus/dialogs genuinely need\n * separation) and the `warn` glow tinted by the theme's own error color.\n */\nexport const generateShadows = (colors: Colors, mode: 'light' | 'dark' = 'light'): Shadows => {\n const error = colors['error'] ?? '#CC2827';\n\n if (mode === 'dark') {\n return {\n raised: 'none',\n menu: `0px 4px 12px ${rgba('#000000', 0.45)}`,\n dialog: `0px 8px 28px ${rgba('#000000', 0.55)}`,\n warn: `0 0 5px ${rgba(error, 0.55)}, inset 0 0 5px ${rgba(error, 0.35)}`,\n };\n }\n\n // Shadow ink: near-black carrying ~6–8% of the brand hue's chroma.\n const { h } = hexToOklch(colors['primary'] ?? '#000000');\n const ink = oklchToHex({ l: 0.22, c: 0.035, h });\n return {\n raised: `${rgba(ink, 0.2)} 0px 2px 1px -1px, ${rgba(ink, 0.14)} 0px 1px 1px 0px, ${rgba(ink, 0.12)} 0px 1px 3px 0px`,\n menu: `${rgba(ink, 0.2)} 0px 3px 3px -2px, ${rgba(ink, 0.14)} 0px 3px 4px 0px, ${rgba(ink, 0.12)} 0px 1px 8px 0px`,\n dialog: `${rgba(ink, 0.2)} 0px 3px 5px -1px, ${rgba(ink, 0.14)} 0px 6px 10px 0px, ${rgba(ink, 0.12)} 0px 1px 18px 0px`,\n warn: `0 0 5px ${rgba(error, 0.5)}, inset 0 0 5px ${rgba(error, 0.3)}`,\n };\n};\n","import type { Icons } from '../theme/theme.model';\n\n/**\n * Default icon primitives shipped with every theme. Each icon is an inline\n * SVG data URI rendered as a CSS mask over `currentColor`, so icons recolor\n * with the theme automatically. `createTheme` merges a theme's own `icons`\n * over this set — add or override under any name; components render them by\n * token via `uni-icon`, never by inlining SVG.\n */\nexport const BaseIcons: Icons = {\n alertCircle:\n \"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath d='M0 0h24v24H0V0z' fill='none'/%3e%3cpath d='M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z'/%3e%3c/svg%3e\",\n calendar:\n \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'%3E%3C/path%3E%3C/svg%3E\",\n checkCircle:\n \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg%3E%3Cpath d='M32,0A32,32,0,1,0,64,32,32,32,0,0,0,32,0Zm2.0873,41.5-5.4107,5.4106-.02.02L14.1751,32.4492l5.4306-5.4306,9.051,9.0509L46.2861,18.44l5.4305,5.4306Z'/%3E%3C/g%3E%3C/svg%3E\",\n chevronUp:\n \"data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z'/%3E%3C/svg%3E\",\n chevronDown:\n \"data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E\",\n chevronLeft:\n \"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z'/%3E%3C/svg%3E\",\n chevronRight:\n \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z'/%3E%3C/svg%3E\",\n xCircle:\n \"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3e%3cg%3e%3cpath d='M32,0A32,32,0,1,0,64,32,32,32,0,0,0,32,0ZM47.4649,42.3543l-5.4306,5.43L31.68,37.4305,21.3257,47.7848l-5.4306-5.43L26.25,32,15.8951,21.6456l5.4306-5.4305L31.68,26.5694,42.0343,16.2151l5.4306,5.4305L37.1106,32Z'/%3e%3c/g%3e%3c/svg%3e\",\n search:\n \"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3e%3cg%3e%3cpath d='M 21 3 C 11.601563 3 4 10.601563 4 20 C 4 29.398438 11.601563 37 21 37 C 24.355469 37 27.460938 36.015625 30.09375 34.34375 L 42.375 46.625 L 46.625 42.375 L 34.5 30.28125 C 36.679688 27.421875 38 23.878906 38 20 C 38 10.601563 30.398438 3 21 3 Z M 21 7 C 28.199219 7 34 12.800781 34 20 C 34 27.199219 28.199219 33 21 33 C 13.800781 33 8 27.199219 8 20 C 8 12.800781 13.800781 7 21 7 Z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e\",\n close:\n \"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cg%3e%3cpath fill='currentColor' d='M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e\",\n spinner:\n \"data:image/svg+xml;charset=UTF-8,%3csvg stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3e%3cstyle%3e .oui_spinner %7b transform-origin: center; animation: rotate_360 2s linear infinite;%7d .oui_spinner circle %7b stroke-linecap: round; animation: dash 1.5s ease-in-out infinite;%7d %40keyframes rotate_360 %7b 100%25 %7b transform: rotate(360deg);%7d %7d %40keyframes dash %7b 0%25 %7b stroke-dasharray: 0 150; stroke-dashoffset: 0;%7d 47.5%25 %7b stroke-dasharray: 42 150; stroke-dashoffset: -16;%7d 95%25, 100%25 %7b stroke-dasharray: 42 150; stroke-dashoffset: -59;%7d %7d %3c/style%3e%3cg class='oui_spinner'%3e%3ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3e%3c/circle%3e%3c/g%3e%3c/svg%3e \",\n};\n","import type { ComponentThemes } from '../../component';\nimport { generatePalette, type PaletteConfig } from '../../color';\nimport type { GenerateColorsConfig } from '../../generation/palette.factory';\nimport { generateShadows } from '../../generation/shadow.generator';\nimport { BaseIcons } from '../../iconography/icon.records';\nimport type { TextRole, TextStyle } from '../../typography';\nimport type {\n Borders,\n Colors,\n Icons,\n Radii,\n Shadows,\n Spacing,\n Thicknesses,\n Typography,\n UniTheme,\n} from '../theme.model';\n\n// ==========================================\n// Type scale — the single source of type truth.\n// CSS-ready `typefaces` are derived from this on read (toTypefaces).\n// ==========================================\nconst BaseTypography: Typography = {\n 'display-large': {\n fontFamily: 'Red Hat Display',\n fontSize: 57,\n lineHeight: 64,\n fontWeight: 'normal',\n letterSpacing: -0.25,\n },\n 'display-medium': { fontFamily: 'Red Hat Display', fontSize: 45, lineHeight: 52, fontWeight: 'normal' },\n 'display-small': { fontFamily: 'Red Hat Display', fontSize: 36, lineHeight: 44, fontWeight: 'normal' },\n 'headline-large': { fontFamily: 'Red Hat Display', fontSize: 32, lineHeight: 40, fontWeight: 'normal' },\n 'headline-medium': { fontFamily: 'Red Hat Display', fontSize: 28, lineHeight: 36, fontWeight: 'normal' },\n 'headline-small': { fontFamily: 'Red Hat Display', fontSize: 24, lineHeight: 32, fontWeight: 'normal' },\n 'title-large': { fontFamily: 'Red Hat Display', fontSize: 22, lineHeight: 28, fontWeight: 'normal' },\n 'title-medium': {\n fontFamily: 'Red Hat Display',\n fontSize: 16,\n lineHeight: 24,\n fontWeight: 'medium',\n letterSpacing: 0.15,\n },\n 'title-small': {\n fontFamily: 'Red Hat Display',\n fontWeight: 'medium',\n fontSize: 14,\n lineHeight: 20,\n letterSpacing: 0.1,\n },\n 'body-1-long': { fontFamily: 'Roboto', fontSize: 16, lineHeight: 22 },\n 'body-1-short': { fontFamily: 'Roboto', fontSize: 16, lineHeight: 24 },\n 'body-2-long': { fontFamily: 'Roboto', fontSize: 14, lineHeight: 18 },\n 'body-2-short': { fontFamily: 'Roboto', fontSize: 14, lineHeight: 20 },\n 'subtitle-1': { fontFamily: 'Red Hat Display', fontSize: 16, lineHeight: 24, letterSpacing: 0.15 },\n 'subtitle-2': {\n fontFamily: 'Red Hat Display',\n fontSize: 14,\n lineHeight: 20,\n fontWeight: 'medium',\n letterSpacing: 0.1,\n },\n label: { fontFamily: 'Roboto', fontSize: 14, lineHeight: 20 },\n button: {\n fontFamily: 'Red Hat Display',\n fontSize: 14,\n lineHeight: 20,\n fontWeight: 'medium',\n textTransform: 'capitalize',\n },\n caption: { fontFamily: 'Roboto', fontSize: 12, lineHeight: 18, letterSpacing: 0.4 },\n overline: {\n fontFamily: 'Red Hat Display',\n fontSize: 10,\n lineHeight: 18,\n letterSpacing: 1.5,\n textTransform: 'uppercase',\n },\n paragraph: { fontFamily: 'Roboto', fontSize: 16, lineHeight: 24 },\n quote: { fontFamily: 'Roboto', fontSize: 16, lineHeight: 24 },\n note: { fontFamily: 'Roboto', fontSize: 14, lineHeight: 22, fontStyle: 'italic' },\n // Product-specific extras (were duplicated into `typefaces` before).\n badge: { fontFamily: 'Red Hat Display', fontSize: 16, lineHeight: 24 },\n // Stat-tile value: large, semibold, slightly tightened. Proportional\n // figures on purpose — tabular-nums is for columns, not display numbers.\n stat: {\n fontFamily: 'Red Hat Display',\n fontSize: 32,\n lineHeight: 38,\n fontWeight: 600,\n letterSpacing: -0.32,\n },\n tag: { fontFamily: 'Red Hat Display', fontSize: 15, lineHeight: 20, fontWeight: 600 },\n input: { fontFamily: 'Red Hat Display', fontSize: 14, lineHeight: 24 },\n} as Record<TextRole, TextStyle> & Record<string, TextStyle>;\n\n// ==========================================\n// Shared token scales — theme-agnostic.\n// ==========================================\nconst BaseShadows: Shadows = {\n raised:\n 'rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px',\n menu: 'rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px;',\n dialog:\n 'rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px',\n warn: '0 0 5px rgba(255, 0, 0, 0.5), inset 0 0 5px rgba(255, 0, 0, 0.3)',\n};\n\nconst BaseSpacing: Spacing = {\n none: 'none',\n xxs: '2px',\n xs: '4px',\n sm: '8px',\n md: '16px',\n lg: '32px',\n xl: '64px',\n};\n\nconst BaseThicknesses: Thicknesses = { thin: 1, standard: 2, thick: 4 };\n\nconst BaseRadii: Radii = {\n none: 'none',\n xxs: '4px',\n xs: '8px',\n sm: '16px',\n md: '24px',\n lg: '32px',\n max: '999px',\n};\n\n// ==========================================\n// Color-derived token builders — the reason a custom theme\n// only has to supply `colors`.\n// ==========================================\nconst buildBorders = (c: Colors): Borders => ({\n primary: `1px solid ${c.primary}`,\n secondary: `1px solid ${c.secondary}`,\n tertiary: `1px solid ${c.tertiary}`,\n quaternary: `1px solid ${c.quaternary}`,\n warn: `1px solid ${c.warn}`,\n success: `1px solid ${c.success}`,\n light: `1px solid ${c.outline}`,\n dark: `1px solid ${c['on-background']}`,\n dotted: `1px dotted ${c['on-background']}`,\n});\n\nconst buildComponents = (c: Colors): ComponentThemes => ({\n alert: {\n options: { topPosition: 40, borderRadius: 'sm', transitionSpeed: 0.35, elevation: 'md' },\n },\n // Trail typography, link/current colors, separator symbol and spacing are\n // tokens; the current page reads in the stronger ink.\n breadcrumb: {\n options: {\n typeface: 'label',\n color: 'on-background-variant',\n currentColor: 'on-background',\n separatorSymbol: 'chevron_right',\n gap: 'xs',\n },\n },\n // App shell: bar surface, divider, title type and spacing are all tokens.\n appBar: {\n options: {\n color: 'surface',\n height: 56,\n divider: 'light',\n typeface: 'title-large',\n padding: 'md',\n gap: 'md',\n elevation: undefined,\n },\n },\n // Navigation drawer: shares the dialog's native-<dialog> machinery in\n // 'over' mode (elevation + scrim backdrop); 'side' mode is an in-flow\n // aside separated by the divider border primitive.\n drawer: {\n options: {\n color: 'surface',\n width: 280,\n divider: 'light',\n elevation: 'menu',\n padding: 'md',\n backdrop: { background: 'rgba(0, 0, 0, 0.4)' },\n },\n },\n // Initials/icon avatars color from the role's container tokens; the radius\n // token makes them circles by default and squares under a 'sharp' theme.\n avatar: {\n options: { borderRadius: 'max', typeface: 'subtitle-2', fallbackSymbol: 'person' },\n variants: {\n primary: { backgroundColor: c['primary-container'], color: c['on-primary-container'] },\n secondary: { backgroundColor: c['secondary-container'], color: c['on-secondary-container'] },\n tertiary: { backgroundColor: c['tertiary-container'], color: c['on-tertiary-container'] },\n quaternary: { backgroundColor: c['surface-variant'], color: c['on-surface-variant'] },\n warn: { backgroundColor: c['warn-container'], color: c['on-warn-container'] },\n success: { backgroundColor: c['success-container'], color: c['on-success-container'] },\n },\n sizes: {\n sm: { height: 24, width: 24, fontSize: 10 },\n md: { height: 32, width: 32, fontSize: 13 },\n lg: { height: 40, width: 40, fontSize: 16 },\n xl: { height: 56, width: 56, fontSize: 22 },\n },\n },\n // Overlap is a spacing token; the ring separates stacked avatars using the\n // surface color so groups read on any background.\n avatarGroup: { options: { overlap: 'sm', ringColor: 'surface', ringWidth: 2 } },\n // Search field: chrome comes from the shared `input` options via\n // uni-input-box; these tokens style the affordances and suggestion list.\n searchInput: {\n options: {\n searchSymbol: 'search',\n clearSymbol: 'close',\n listColor: 'primary-surface',\n listShadow: 'menu',\n listBorderRadius: 'xs',\n maxSuggestions: 8,\n },\n },\n // Selection controls: chrome colors are tokens (accent fill/ring follows the\n // component's variant; its on-color pairs are derived in the component).\n checkbox: { options: { size: 20, boxColor: 'surface' } },\n radio: { options: { size: 20, ringColor: 'outline', fillColor: 'surface' } },\n dialog: {\n options: {\n borderRadius: 'lg',\n color: 'primary-surface',\n border: 'quaternary',\n padding: 'sm',\n elevation: 'dialog',\n backdrop: { background: 'rgba(255, 255, 255, 0.6)', backdropFilter: 'blur(2px)' },\n },\n },\n dialogHeader: {\n options: {\n borderRadius: 'max',\n color: 'primary',\n height: 48,\n textRole: 'title-large',\n textAlign: 'center',\n closeButtonIcon: 'close',\n closeButtonSize: 'md',\n },\n },\n dropdown: {\n options: { border: 'none', borderRadius: 'xxs', color: 'primary-surface', shadow: 'menu' },\n },\n footer: { options: { height: 52, color: 'primary', logoHeight: 18.6, logoPadding: 'md' } },\n input: {\n options: {\n typeFace: 'input',\n color: 'primary-surface',\n textColor: 'on-primary-surface',\n disabledColor: 'disabled-surface',\n disabledTextColor: 'on-disabled-surface',\n border: 'light',\n borderRadius: 'xs',\n errorShadow: 'warn',\n errorBorder: 'warn',\n height: 32,\n paddingLeft: 'sm',\n focusOutline: `2px solid ${c.primary}`,\n focusOutlineOffset: 2,\n },\n },\n // Field chrome (color/border/typeface/focus) comes from the shared `input`\n // options via uni-input-box; these are the textarea-specific behaviors.\n textarea: { options: { rows: 3, resize: 'vertical' } },\n // Every visual knob is a token, so a theme can turn the default underline\n // tabs into pills (borderRadius 'max' + activeColor) or restyle the\n // indicator without touching component code.\n tabs: {\n options: {\n typeface: 'title-small',\n textColor: 'on-surface-variant',\n activeTextColor: 'primary',\n indicatorColor: 'primary',\n indicatorThickness: 'standard',\n divider: 'light',\n gap: 'sm',\n borderRadius: 'none',\n padding: 'md',\n activeColor: undefined,\n },\n },\n multiSelectDropdown: {\n options: {\n textRole: 'input',\n textColor: 'on-primary-surface',\n dividerBorder: 'light',\n searchInputBorder: 'light',\n searchInputBorderRadius: 'xxs',\n focusOutline: `2px solid ${c.primary}`,\n focusOutlineOffset: 2,\n },\n },\n badge: { options: { borderRadius: 'xxs' } },\n\n // ---- Buttons: variants are structural archetypes with interaction states ----\n button: {\n // Radius and typeface are tokens, not baked values: `max` renders the\n // classic pill and the type scale's `button` role carries the label\n // typography, so shape languages, custom radii, and typography edits\n // restyle every button by re-pointing or redefining a token.\n options: { borderRadius: 'max', typeface: 'button' },\n fixed: {\n position: 'relative',\n overflow: 'hidden',\n outline: '0',\n border: '0',\n cursor: 'pointer',\n transition: 'all 0.28s ease',\n },\n variants: {\n ghost: {\n backgroundColor: 'transparent',\n color: 'currentcolor',\n '&:hover': { backgroundColor: 'rgba(0,0,0,0.06)' },\n },\n // Solid\n primary: {\n backgroundColor: c.primary,\n color: c['on-primary'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n // Hollow\n secondary: {\n backgroundColor: 'transparent',\n color: c.secondary,\n border: `1px solid ${c.secondary}`,\n '&:hover': { backgroundColor: c.secondary, color: c['on-secondary'] },\n },\n // Solid\n tertiary: {\n backgroundColor: c.tertiary,\n color: c['on-tertiary'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n warn: {\n backgroundColor: c.warn,\n color: c['on-warn'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n success: {\n backgroundColor: c.success,\n color: c['on-success'],\n border: '0',\n '&:hover': { filter: 'brightness(0.92)' },\n },\n disabled: {\n backgroundColor: `${c.disabled} !important`,\n color: `${c['on-disabled']} !important`,\n border: '0',\n },\n },\n // Sizes are geometry only (height/padding/fontSize); families, weights and\n // transforms come from the `typeface` option's type-scale role.\n sizes: {\n sm: { height: 22, fontSize: 12, padding: '0 12px', fontWeight: 600 },\n md: { height: 26, fontSize: 16, padding: '0 16px' },\n lg: { height: 36, fontSize: 18, padding: '0 18px' },\n xl: { height: 48, fontSize: 24, padding: '0 22px' },\n },\n },\n iconButton: {\n options: { borderRadius: 'max' },\n variants: {\n ghost: { backgroundColor: 'transparent', color: 'currentcolor' },\n primary: { backgroundColor: c.primary, color: c['on-primary'] },\n secondary: { backgroundColor: c.secondary, color: c['on-secondary'] },\n tertiary: { backgroundColor: c.tertiary, color: c['on-tertiary'] },\n warn: { backgroundColor: c.warn, color: c['on-warn'] },\n success: { backgroundColor: c.success, color: c['on-success'] },\n disabled: {\n backgroundColor: 'transparent !important',\n color: `${c['on-disabled']} !important`,\n },\n },\n sizes: {\n sm: { height: 22, minHeight: 22, width: 22, minWidth: 22, fontSize: 18 },\n md: { height: 26, minHeight: 26, width: 26, minWidth: 26, fontSize: 22 },\n lg: { height: 36, minHeight: 36, width: 36, minWidth: 36, fontSize: 30 },\n xl: { height: 40, minHeight: 40, width: 40, minWidth: 40, fontSize: 34 },\n },\n },\n progressGauge: {\n fixed: { textFill: c['on-background'] },\n // Track = the role's container token (the palette's soft tint of that\n // role), arc = the role base — so gauges follow any brand palette instead\n // of the fixed pastels they used to hardcode.\n variants: {\n primary: { backgroundColor: c['primary-container'], color: c.primary },\n secondary: { backgroundColor: c['secondary-container'], color: c.secondary },\n tertiary: { backgroundColor: c['tertiary-container'], color: c.tertiary },\n warn: { backgroundColor: c['warn-container'], color: c.warn },\n success: { backgroundColor: c['success-container'], color: c.success },\n },\n sizes: {\n sm: { height: '54px' },\n md: { height: '68px' },\n lg: { height: '82px' },\n xl: { height: '104px' },\n },\n },\n card: {\n // The frame is tokens: the border primitive named by the active variant\n // (borders.primary … borders.success — override with `border` to pin all\n // cards to one primitive, e.g. a custom 'brush-stroke'), the radii scale\n // (`xs` = the classic 8px), and an optional elevation shadow.\n options: { borderRadius: 'xs' },\n fixed: { overflow: 'hidden', backgroundColor: c.background },\n },\n cardHeader: {\n fixed: { padding: '12px 24px' },\n variants: {\n primary: { backgroundColor: c.primary, color: c['on-primary'] },\n secondary: { backgroundColor: c.secondary, color: c['on-secondary'] },\n tertiary: { backgroundColor: c.tertiary, color: c['on-tertiary'] },\n warn: { backgroundColor: c.warn, color: c['on-warn'] },\n success: { backgroundColor: c.success, color: c['on-success'] },\n },\n },\n cardContent: { fixed: { padding: '12px 24px' } },\n dataSearch: {\n options: {\n border: 'light',\n borderRadius: 'xs',\n color: 'primary-surface',\n placeholderColor: 'disabled',\n },\n },\n dataTable: {\n options: {\n color: 'primary-surface',\n border: 'light',\n borderRadius: 'sm',\n elevation: undefined,\n headerPadding: 'sm',\n footerPadding: 'sm',\n thTextRole: 'headline-small',\n thColor: 'primary-container',\n thVerticalBorder: 'dotted',\n thHorizontalBorder: 'light',\n thPadding: 'sm',\n tdTextRole: 'title-small',\n tdColor: 'primary-surface',\n tdStickyColor: 'primary-container',\n tdPadding: 'sm',\n tdVerticalBorder: 'dotted',\n tdHorizontalBorder: 'light',\n rowHoverColor: 'primary-container',\n loadingOverlayColor: 'scrim',\n loadingSpinnerColor: 'primary',\n loadingSpinnerSize: 40,\n },\n },\n notificationBadge: { options: { borderRadius: 'sm', offset: -10 } },\n paginator: {\n options: {\n gap: 'xs',\n textRole: 'label',\n inputBorder: 'light',\n inputBorderRadius: 'xs',\n pageBorderRadius: 'xs',\n currentPageBorder: 'light',\n currentPageBorderRadius: 'xs',\n },\n },\n // KPI tile: card-recipe frame, muted label over a large `stat`-role value;\n // delta inks are the semantic success/error (direction × goodness decided\n // by the component); sparkline in the outline hue, endpoint in the accent.\n stat: {\n options: {\n labelTypeface: 'label',\n valueTypeface: 'stat',\n color: 'surface',\n border: 'light',\n borderRadius: 'xs',\n positiveColor: 'success',\n negativeColor: 'error',\n trendColor: 'outline',\n trendAccent: 'primary',\n padding: 'md',\n gap: 'xxs',\n },\n },\n // Range input: fill/thumb in the accent, track in the muted surface, both\n // radius-tokened — geometry knobs are plain numbers.\n slider: {\n options: {\n color: 'primary',\n trackColor: 'surface-variant',\n borderRadius: 'max',\n trackHeight: 4,\n thumbSize: 16,\n },\n },\n // Loading placeholders paint with surface tokens so they sit naturally on\n // any theme; the shimmer highlight sweeps in the lighter surface color.\n skeleton: {\n options: {\n color: 'surface-variant',\n highlightColor: 'surface',\n borderRadius: 'xs',\n animation: 'shimmer',\n duration: 1.4,\n gap: 'sm',\n },\n },\n snackbar: {\n options: { bottomPosition: 40, transitionDelay: '0.35s', autoCloseDelay: 35000 },\n },\n symbol: { options: { fill: 0, weight: 400, grade: 0, opticalSize: 24 } },\n toggle: { options: { size: 20, trackColor: 'surface-variant', knobColor: 'surface' } },\n tooltip: {\n options: {\n border: undefined,\n borderRadius: 'xs',\n shadow: 'raised',\n color: 'inverse-surface',\n typeface: 'label',\n },\n },\n});\n\n// ==========================================\n// Theme factory. A custom theme = a name + a `colors` map.\n// Everything color-dependent (borders, component variants) is derived;\n// `borders`/`components` overrides deep-merge over the derived defaults, so a\n// theme file can define its own named primitives and rewire per-component\n// options without restating anything it doesn't touch.\n// ==========================================\nexport interface ThemeConfig {\n id: string;\n name: string;\n colors: Colors;\n /**\n * Named icon primitives (inline SVG data URIs, masked with `currentColor`),\n * merged over {@link BaseIcons}. Add or override under any name; components\n * render them by token via the icon component, never by inlining SVG.\n */\n icons?: Icons;\n /** Override the radii scale, e.g. a generated shape-language preset. */\n radii?: Radii;\n /** Override the elevation shadows, e.g. brand-tinted generated stacks. */\n shadows?: Shadows;\n /**\n * Named border primitives, merged over the derived defaults. New tokens may\n * use any name — point component options (or `components` overrides) at\n * them and every consumer of the shared token picks up the change.\n */\n borders?: Borders;\n /**\n * Sparse per-component overrides, deep-merged over the derived component\n * themes: only the sections you provide (fixed/variants/sizes/options keys)\n * are replaced; everything else keeps tracking the library defaults.\n */\n components?: ComponentThemes;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst deepMerge = <T>(base: T, override: Partial<T> | undefined): T => {\n if (!override) return base;\n const out = { ...base } as Record<string, unknown>;\n for (const [key, value] of Object.entries(override)) {\n out[key] = isRecord(value) && isRecord(out[key]) ? deepMerge(out[key], value) : value;\n }\n return out as T;\n};\n\nexport const createTheme = ({\n id,\n name,\n colors,\n icons = {},\n radii = BaseRadii,\n shadows = BaseShadows,\n borders,\n components,\n}: ThemeConfig): UniTheme => ({\n id,\n name,\n colors,\n typography: BaseTypography,\n borders: deepMerge(buildBorders(colors), borders),\n radii,\n shadows,\n spacing: BaseSpacing,\n thicknesses: BaseThicknesses,\n icons: { ...BaseIcons, ...icons },\n components: deepMerge(buildComponents(colors), components),\n});\n\n/**\n * Build a full {@link UniTheme} straight from a {@link PaletteConfig} — the\n * one-call path a theme builder uses to turn a brand color (or a seed +\n * scheme + category) into a complete, ready-to-apply theme.\n */\nexport const createThemeFromPalette = (\n config: GenerateColorsConfig & { id?: string; name?: string; icons?: Icons; radii?: Radii }\n): UniTheme => {\n const colors = generatePalette(config);\n return createTheme({\n id: config.id ?? 'CustomTheme',\n name: config.name ?? 'Custom Theme',\n colors,\n radii: config.radii,\n shadows: generateShadows(colors, config.mode ?? 'light'),\n icons: config.icons,\n });\n};\n\n/**\n * Seed for the shipped Light/Dark themes. Swap these three values (or call\n * `generatePalette` with your own) to reskin the entire system — every color\n * token is derived, so there is nothing else to hand-author.\n */\nexport const BASE_PALETTE_CONFIG: Pick<PaletteConfig, 'seed' | 'scheme' | 'category'> = {\n seed: '#4F46E5', // indigo\n scheme: 'triadic',\n category: 'neutral',\n};\n\nexport const lightColors: Colors = generatePalette({ ...BASE_PALETTE_CONFIG, mode: 'light' });\n\nexport const BaseTheme: UniTheme = createTheme({\n id: 'BaseTheme',\n name: 'Base Theme',\n colors: lightColors,\n});\n","import type { ColorCategory, ColorScheme } from '../color/color.types';\nimport type { Radii, UniTheme } from '../theme/theme.model';\nimport type { BrandRole } from '../color/color.factory';\nimport { createTheme } from '../theme/themes/base.theme';\nimport { hexToOklch, oklchToHex } from './oklch.helper';\nimport { CategoryChroma, generateColors } from './palette.factory';\nimport { generateShadows } from './shadow.generator';\nimport type {\n ContrastCheck,\n GeneratedThemeConfig,\n GenerationInput,\n ThemeShape,\n} from './generation.types';\n\n/** Radii presets per shape language (PRD §3.5.A). Same keys as `BaseRadii`. */\nexport const ShapeRadii: Record<ThemeShape, Radii> = {\n sharp: { none: 'none', xxs: '0px', xs: '0px', sm: '0px', md: '0px', lg: '0px', max: '0px' },\n modern: { none: 'none', xxs: '4px', xs: '8px', sm: '16px', md: '24px', lg: '32px', max: '999px' },\n playful: { none: 'none', xxs: '8px', xs: '16px', sm: '24px', md: '32px', lg: '48px', max: '9999px' },\n};\n\n/** Shortest angular distance between two hue angles, in degrees (0–180). */\nconst hueDistance = (a: number, b: number): number => {\n const d = Math.abs(a - b) % 360;\n return d > 180 ? 360 - d : d;\n};\n\n/**\n * Classify 2–3 brand hues against {@link ColorScheme} by their angular\n * distances from the primary hue. Heuristic bands, widest match wins.\n */\nexport const classifyScheme = (primaryHue: number, otherHues: number[]): ColorScheme => {\n const distances = otherHues.map((h) => hueDistance(primaryHue, h));\n if (distances.length === 0) return 'analogous';\n if (distances.every((d) => d < 15)) return 'monochromatic';\n if (distances.every((d) => d <= 65)) return 'analogous';\n if (distances.some((d) => d >= 165)) return 'complimentary';\n if (distances.length > 1 && distances.every((d) => d >= 130)) return 'splitComplimentary';\n return 'triadic';\n};\n\n/**\n * Infer a tonal category from the seed's own chroma, so an unstated \"vibe\"\n * preserves the brand's character — vivid stays vivid, muted stays muted.\n */\nexport const inferCategory = (seedHex: string): ColorCategory => {\n const { c } = hexToOklch(seedHex);\n if (c >= 0.13) return 'jewel';\n if (c >= 0.07) return 'earth';\n if (c >= 0.03) return 'pastel';\n return 'neutral';\n};\n\n/**\n * The theme generation engine (PRD §3.3): brand seed(s) in, complete WCAG-AA\n * light+dark {@link Colors} pair out, with a machine-readable contrast report.\n * Pure and deterministic — identical input yields identical output.\n */\nexport const generateThemes = (input: GenerationInput): GeneratedThemeConfig => {\n const seeds = (Array.isArray(input.seed) ? input.seed : [input.seed]).slice(0, 3);\n const [primary, secondary, tertiary] = seeds;\n const scheme =\n input.scheme ??\n (seeds.length > 1\n ? classifyScheme(hexToOklch(primary).h, seeds.slice(1).map((s) => hexToOklch(s).h))\n : 'analogous');\n const category = input.vibe ?? inferCategory(primary);\n\n // Seeds pass through as soft targets with their own chroma (brand fidelity).\n // Only an *explicit* vibe caps them to the category's chroma ceiling.\n const applyVibe = (hex: string): string => {\n if (!input.vibe) return hex;\n const color = hexToOklch(hex);\n return oklchToHex({ ...color, c: Math.min(color.c, CategoryChroma[input.vibe]) });\n };\n const targets: Partial<Record<BrandRole, string>> = { primary: applyVibe(primary) };\n if (secondary) targets.secondary = applyVibe(secondary);\n if (tertiary) targets.tertiary = applyVibe(tertiary);\n\n const checks: ContrastCheck[] = [];\n const base = { seed: primary, scheme, category, targets, checks };\n const lightColors = generateColors({ ...base, mode: 'light' });\n const darkColors = generateColors({ ...base, mode: 'dark' });\n\n const worstRatio = checks.reduce((worst, check) => Math.min(worst, check.ratio), 21);\n return {\n lightColors,\n darkColors,\n radii: input.shape ? ShapeRadii[input.shape] : undefined,\n lightShadows: generateShadows(lightColors, 'light'),\n darkShadows: generateShadows(darkColors, 'dark'),\n report: { checks, worstRatio, pass: checks.every((check) => check.pass) },\n };\n};\n\n/**\n * Convenience wrapper: {@link generateThemes} piped through `createTheme()`,\n * returning a registration-ready light/dark {@link UniTheme} pair.\n */\nexport const generateUniThemes = (input: GenerationInput): { light: UniTheme; dark: UniTheme } => {\n const { lightColors, darkColors, radii, lightShadows, darkShadows } = generateThemes(input);\n const name = input.name ?? 'Brand';\n const id = name.replace(/\\W+/g, '') || 'Brand';\n return {\n light: createTheme({\n id: `${id}Light`,\n name: `${name} Light`,\n colors: lightColors,\n radii,\n shadows: lightShadows,\n }),\n dark: createTheme({\n id: `${id}Dark`,\n name: `${name} Dark`,\n colors: darkColors,\n radii,\n shadows: darkShadows,\n }),\n };\n};\n","import type { Colors, Shadows } from '../theme/theme.model';\nimport { generateThemes } from './theme.generator';\nimport type { ContrastReport, GenerationInput } from './generation.types';\n\nexport interface ThemeFileInput extends GenerationInput {\n /** Emit the dark theme alongside the light one. Defaults to true. */\n darkMode?: boolean;\n}\n\n/** A rendered static theme file plus everything a consumer needs to wire it. */\nexport interface EmittedThemeFile {\n /** TypeScript source for a static `uni-theme.ts` — plain, reviewable data. */\n content: string;\n /** Registration snippet for the consumer's `app.config.ts`. */\n providerSnippet: string;\n report: ContrastReport;\n /** One-line human summary of the contrast report. */\n reportSummary: string;\n}\n\nconst IDENT = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\nconst asKey = (k: string): string => (IDENT.test(k) ? k : `'${k}'`);\n\nconst recordLiteral = (record: Record<string, string | undefined>, indent: string): string =>\n Object.entries(record)\n .map(([k, v]) => `${indent}${asKey(k)}: '${v}',`)\n .join('\\n');\n\n// The derived border primitives, spelled out as template literals over the\n// colors const — visible, editable, and edits to a color propagate. Access is\n// bracket-only: `Colors` carries an index signature, and consumer tsconfigs\n// with `noPropertyAccessFromIndexSignature` (ng new strict default) reject\n// dot access on it.\nconst bordersLiteral = (): string =>\n [\n '/**',\n ' * Named border primitives. These mirror the derived defaults — edit them, or',\n ' * add your own under any token name and point component options (or the',\n ' * `components` overrides below) at it. Every component deriving from a',\n ' * shared token picks up the change.',\n ' */',\n 'const borders = (colors: Colors): Borders => ({',\n \" primary: `1px solid ${colors['primary']}`,\",\n \" secondary: `1px solid ${colors['secondary']}`,\",\n \" tertiary: `1px solid ${colors['tertiary']}`,\",\n \" quaternary: `1px solid ${colors['quaternary']}`,\",\n \" warn: `1px solid ${colors['warn']}`,\",\n \" success: `1px solid ${colors['success']}`,\",\n \" light: `1px solid ${colors['outline']}`,\",\n \" dark: `1px solid ${colors['on-background']}`,\",\n \" dotted: `1px dotted ${colors['on-background']}`,\",\n '});',\n ].join('\\n');\n\nconst themeExport = (\n exportName: string,\n displayName: string,\n colorsConst: string,\n shadowsConst: string,\n radii: boolean\n): string =>\n [\n `export const ${exportName}: UniTheme = createTheme({`,\n ` id: '${exportName}',`,\n ` name: '${displayName}',`,\n ` colors: ${colorsConst},`,\n ` borders: borders(${colorsConst}),`,\n ` components: components(${colorsConst}),`,\n ` shadows: ${shadowsConst},`,\n ' icons,',\n ...(radii ? [' radii,'] : []),\n '});',\n ].join('\\n');\n\n/**\n * Render a static `uni-theme.ts` from a brand seed — the file the `ng add`\n * schematic writes and the MCP `generate_uni_theme` tool returns.\n *\n * The file is the system's **source of truth**: literal colors, the border\n * primitives spelled out, and a sparse `components` override section — so a\n * human (or an AI agent) can retheme by editing tokens in place, with no\n * runtime generation. Deterministic: same input, same file.\n */\nexport const emitThemeFile = (input: ThemeFileInput): EmittedThemeFile => {\n const { darkMode = true, name = 'Brand' } = input;\n const { lightColors, darkColors, radii, lightShadows, darkShadows, report } = generateThemes(input);\n const id = (name.replace(/\\W+/g, '') || 'Brand') as string;\n\n const seeds = Array.isArray(input.seed) ? input.seed : [input.seed];\n const regenerate = [\n `--brand=${seeds.join(',')}`,\n input.vibe && `--vibe=${input.vibe}`,\n input.scheme && `--scheme=${input.scheme}`,\n input.shape && `--shape=${input.shape}`,\n !darkMode && '--dark-mode=false',\n ]\n .filter(Boolean)\n .join(' ');\n\n const reportSummary = `${report.checks.length} contrast pairs checked · worst ${report.worstRatio}:1 · ${\n report.pass ? 'all AA' : `${report.checks.filter((c) => !c.pass).length} failing`\n }`;\n\n const modes: {\n exportName: string;\n displayName: string;\n colorsConst: string;\n colors: Colors;\n shadowsConst: string;\n shadows: Shadows;\n }[] = [\n {\n exportName: `${id}Light`,\n displayName: `${name} Light`,\n colorsConst: 'lightColors',\n colors: lightColors,\n shadowsConst: 'lightShadows',\n shadows: lightShadows,\n },\n ...(darkMode\n ? [\n {\n exportName: `${id}Dark`,\n displayName: `${name} Dark`,\n colorsConst: 'darkColors',\n colors: darkColors,\n shadowsConst: 'darkShadows',\n shadows: darkShadows,\n },\n ]\n : []),\n ];\n\n const content = [\n '/**',\n ` * ${name} theme for Uni — generated data, yours to edit.`,\n ' *',\n ` * Regenerate colors: ng add @uni-design-system/uni-angular ${regenerate}`,\n ' * (or the `generate-uni-theme` MCP tool). Edits are never overwritten silently —',\n ' * regeneration rewrites this file, so commit before regenerating.',\n ` * ${reportSummary}.`,\n ' */',\n 'import {',\n ' createTheme,',\n ' type Borders,',\n ' type Colors,',\n ' type ComponentThemes,',\n ' type Icons,',\n ' type Shadows,',\n ' type UniTheme,',\n \"} from '@uni-design-system/uni-core';\",\n '',\n ...modes.map(({ colorsConst, colors }) => `const ${colorsConst}: Colors = {\\n${recordLiteral(colors as Record<string, string>, ' ')}\\n};\\n`),\n '/** Brand-tinted elevation shadows — theme-scoped, edit freely. */',\n ...modes.map(({ shadowsConst, shadows }) => `const ${shadowsConst}: Shadows = {\\n${recordLiteral(shadows as Record<string, string>, ' ')}\\n};\\n`),\n bordersLiteral(),\n '',\n '/**',\n ' * Sparse component overrides, deep-merged over Uni component defaults: only',\n ' * what you write here changes. Point components at your own primitives, e.g.:',\n \" * button: { variants: { secondary: { border: `2px dashed ${colors['tertiary']}` } } },\",\n \" * input: { options: { borderRadius: 'max' } },\",\n ' */',\n 'const components = (colors: Colors): ComponentThemes => ({});',\n '',\n '/**',\n ' * Icon primitives, merged over the built-in set (close, search, spinner,',\n ' * chevrons, …). Define an icon ONCE here as an inline SVG data URI — it is',\n ' * masked with currentColor, so it recolors with the theme — and render it',\n \" * anywhere via `<uni-icon name='…'/>`. Never inline SVG in components.\",\n \" * Example: logo: \\\"data:image/svg+xml,%3Csvg xmlns='…' viewBox='0 0 24 24'%3E…%3C/svg%3E\\\",\",\n ' */',\n 'const icons: Icons = {};',\n '',\n ...(radii\n ? [`/** Shape language: '${input.shape}'. */`, `const radii = {\\n${recordLiteral(radii as Record<string, string>, ' ')}\\n};`, '']\n : []),\n ...modes.map(\n ({ exportName, displayName, colorsConst, shadowsConst }) =>\n `${themeExport(exportName, displayName, colorsConst, shadowsConst, !!radii)}\\n`\n ),\n '/** First key wins as the default theme when registered via UNI_THEMES. */',\n `export const ${id}Themes = { ${modes.map((m) => m.exportName).join(', ')} };`,\n '',\n ].join('\\n');\n\n const providerSnippet = [\n `import { UNI_THEMES } from '@uni-design-system/uni-angular';`,\n `import { ${id}Themes } from './uni-theme';`,\n '',\n '// app.config.ts → providers:',\n `{ provide: UNI_THEMES, useValue: ${id}Themes },`,\n ].join('\\n');\n\n return { content, providerSnippet, report, reportSummary };\n};\n","import { Gradient } from './gradient.model';\n\nexport function gradient(config: Gradient): string {\n return ``;\n}\n","import { Size } from '../core.types';\nimport { DeviceOrientation } from './layout.types';\n\nexport function getDeviceSize(height: number, width: number): Size {\n if (!height || !width) return 'md';\n\n const max = Math.max(height, width);\n\n if (max <= 600)\n // Small Mobile\n return 'xs';\n\n if (max <= 960)\n // Large Mobile\n return 'sm';\n\n if (max <= 1264)\n // Tablets\n return 'md';\n\n if (max <= 1904)\n // Laptops & Monitors\n return 'lg';\n\n return 'xl'; // Large Monitors\n}\n\nexport function getDeviceOrientation(height: number, width: number): DeviceOrientation {\n if (!height || !width) return 'landscape';\n\n return height > width ? 'portrait' : 'landscape';\n}\n","import { BoxShadow, ShadowDefinition } from './shadow.model';\n\n// box-shadow: none|h-offset v-offset blur spread color\nexport const GetBoxShadow = ({ offset, blur, opacity }: BoxShadow): string => {\n return `0 ${offset}px ${blur}px rgba(0,0,0,0.${opacity})`;\n};\n\nexport const GetBoxShadows = ({ umbra, penumbra }: ShadowDefinition): string => {\n return GetBoxShadow(umbra) + ', ' + GetBoxShadow(penumbra);\n};\n","import { ShadowDefinition } from './shadow.model';\nimport { ShadowElevation } from './shadow.types';\nimport { GetBoxShadows } from './shadow.utils';\n\nexport const ShadowMap: Record<ShadowElevation, ShadowDefinition> = {\n pressed: {\n umbra: {\n offset: 1,\n blur: 2,\n opacity: 24,\n },\n penumbra: {\n offset: 1,\n blur: 3,\n opacity: 12,\n },\n },\n raised: {\n umbra: {\n offset: 3,\n blur: 6,\n opacity: 23,\n },\n penumbra: {\n offset: 3,\n blur: 6,\n opacity: 16,\n },\n },\n focussed: {\n umbra: {\n offset: 6,\n blur: 6,\n opacity: 23,\n },\n penumbra: {\n offset: 10,\n blur: 20,\n opacity: 19,\n },\n },\n navigation: {\n umbra: {\n offset: 10,\n blur: 10,\n opacity: 22,\n },\n penumbra: {\n offset: 14,\n blur: 28,\n opacity: 25,\n },\n },\n modal: {\n umbra: {\n offset: 15,\n blur: 12,\n opacity: 22,\n },\n penumbra: {\n offset: 19,\n blur: 38,\n opacity: 30,\n },\n },\n};\n\nexport const ShadowCssMap: Record<ShadowElevation, string> = {\n pressed: GetBoxShadows(ShadowMap['pressed']),\n raised: GetBoxShadows(ShadowMap['raised']),\n focussed: GetBoxShadows(ShadowMap['focussed']),\n navigation: GetBoxShadows(ShadowMap['navigation']),\n modal: GetBoxShadows(ShadowMap['modal']),\n};\n","import type { StyleExpression } from './style.types';\n\nexport const removeInputPlatformStyling: StyleExpression = {\n appearance: 'none' /* Removes default platform styling */,\n background: 'none' /* Removes default background */,\n border: 'none' /* Removes default gray border */,\n outline: 'none' /* Removes default focus ring */,\n boxShadow: 'none' /* Removes any inner shadows on iOS */,\n padding: 0 /* Resets default spacing */,\n width: '100%' /* Makes it fill the stylized div */,\n};\n","import type { Colors } from '../theme.model';\nimport { generatePalette } from '../../color';\nimport { generateShadows } from '../../generation/shadow.generator';\nimport { BASE_PALETTE_CONFIG, createTheme } from './base.theme';\n\nexport const darkColors: Colors = generatePalette({ ...BASE_PALETTE_CONFIG, mode: 'dark' });\n\nexport const DarkTheme = createTheme({\n id: 'DarkTheme',\n name: 'Dark Theme',\n colors: darkColors,\n shadows: generateShadows(darkColors, 'dark'),\n});\n","import { generateShadows } from '../../generation/shadow.generator';\nimport { createTheme, lightColors } from './base.theme';\n\nexport const LightTheme = createTheme({\n id: 'LightTheme',\n name: 'Light Theme',\n colors: lightColors,\n shadows: generateShadows(lightColors, 'light'),\n});\n","import { type UniTheme } from './theme.model';\nimport { DarkTheme } from './themes/dark.theme';\nimport { LightTheme } from './themes/light.theme';\n\nexport const UniThemes: Record<string, UniTheme> = {\n LightTheme,\n DarkTheme,\n};\n\n// First Theme is default.\nexport const DefaultThemeId = Object.keys(UniThemes)[0];\n","import { FontWeight } from './typography.types';\n\nexport const FontWeightMap: Record<FontWeight, number> = {\n thin: 100,\n 'extra-light': 200,\n light: 200,\n normal: 400,\n medium: 500,\n 'semi-bold': 600,\n bold: 700,\n 'extra-bold': 800,\n black: 900,\n 'extra-black': 950,\n};\n","import type { TextStyle, TypeFaceDefinition } from './text.model';\n\nconst px = (value: number): string => `${value}px`;\n\n/**\n * Converts a TextStyle (numeric, design-token oriented) into a\n * TypeFaceDefinition (CSS-ready) so a theme's `typefaces` map can be\n * derived from its `typography` block instead of being duplicated.\n */\nexport const toTypeface = (style: TextStyle): TypeFaceDefinition => ({\n fontFamily: style.fontFamily,\n fontSize: px(style.fontSize),\n lineHeight: px(style.lineHeight),\n ...(style.letterSpacing !== undefined && { letterSpacing: px(style.letterSpacing) }),\n ...(style.textTransform === 'uppercase' && { textTransform: 'uppercase' as const }),\n ...(style.fontWeight !== undefined && { fontWeight: style.fontWeight }),\n ...(style.fontStyle && { fontStyle: style.fontStyle }),\n});\n\nexport const toTypefaces = (\n typography: Record<string, TextStyle>\n): Record<string, TypeFaceDefinition> =>\n Object.fromEntries(Object.entries(typography).map(([role, style]) => [role, toTypeface(style)]));\n","import { GetFieldType } from './types';\n\nexport function getValue<TData, TPath extends string, TDefault = GetFieldType<TData, TPath>>(\n data: TData,\n path: TPath,\n defaultValue?: TDefault\n): GetFieldType<TData, TPath> | TDefault {\n const value = path\n .split(/[.[\\]]/)\n .filter(Boolean)\n .reduce<GetFieldType<TData, TPath>>((value, key) => (value as any)?.[key], data as any);\n\n return value !== undefined ? value : (defaultValue as TDefault);\n}\n","export const debounce = <T extends (...args: any[]) => ReturnType<T>>(\n callback: T,\n timeout: number\n): ((...args: Parameters<T>) => void) => {\n let timer: ReturnType<typeof setTimeout>;\n\n return (...args: Parameters<T>) => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n callback(...args);\n }, timeout);\n };\n};\n"],"mappings":";;AAKA,IAAa,SAA8B;CACzC,MAAM,EACJ,SAAS,EACX;CACA,QAAQ,EACN,SAAS,EACX;AACF;AAEA,IAAa,UAA+B;CAC1C,MAAM,EACJ,SAAS,EACX;CACA,QAAQ,EACN,SAAS,EAC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