@pontive/pontkit-core 1.43.0 → 1.45.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":"theme.mjs","sources":["../src/theme/fonts.ts","../src/theme/manifest.ts","../src/theme/value.ts","../src/theme/validate.ts","../src/theme/compile.ts","../src/theme/apply.ts","../src/theme/scopes.ts","../src/theme/shadcn.ts","../src/theme/vocabulary.ts"],"sourcesContent":["/**\n * The web fonts a theme may use (docs/11-tokens.md §8, \"Fonts\").\n *\n * A theme cannot carry `url()`: its values end up in a stylesheet on the\n * customer's login page. So a theme names a family (a fontFamily value such as\n * `\"Lora\", serif`), and `compileTheme` adds the `@import` for every family it\n * finds **in this catalogue**. The URL always comes from here, never from the\n * theme. A family not in the catalogue is still valid CSS: it renders if the\n * visitor has it installed, else the stack's fallback.\n *\n * The catalogue is copied into the manifest (`tokens.json` `fonts`) by\n * `npm run tokens:pont`, so a dashboard can list it, and it is part of the\n * manifest fingerprint: changing a URL changes compiled output. Every `css2`\n * spec was checked against fonts.googleapis.com (each must answer 200;\n * requesting a weight or axis a family lacks is an error there).\n *\n * `bundled` families would be imported by pont's own styles.css, so a theme\n * using them adds no import. None is today: styles.css imports no web font\n * (pont's defaults are the system stacks in tokens/typography.css), so every\n * catalogue family a theme names is imported by the compiled theme.\n */\n\nexport type FontCategory = \"sans\" | \"serif\" | \"mono\";\n\nexport interface FontEntry {\n /** The CSS family name, as a theme writes it (`\"Lora\"`). Matched case-insensitively. */\n family: string;\n category: FontCategory;\n /** A complete value for a fontFamily token: the family and its generic fallback. */\n stack: string;\n /** The Google Fonts css2 `family=` parameter: name and axes. */\n css2: string;\n /** Already imported by pont's styles.css. */\n bundled?: boolean;\n}\n\nconst GENERIC: Record<FontCategory, string> = { sans: \"sans-serif\", serif: \"serif\", mono: \"monospace\" };\n\nconst entry = (family: string, category: FontCategory, css2: string, bundled = false): FontEntry => ({\n family,\n category,\n stack: `\"${family}\", ${GENERIC[category]}`,\n css2,\n ...(bundled ? { bundled } : {}),\n});\n\nexport const FONT_CATALOG: readonly FontEntry[] = [\n entry(\"Geist\", \"sans\", \"Geist:ital,wght@0,100..900;1,100..900\"),\n entry(\"Inter\", \"sans\", \"Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900\"),\n entry(\"Roboto\", \"sans\", \"Roboto:ital,wght@0,100..900;1,100..900\"),\n entry(\"Open Sans\", \"sans\", \"Open+Sans:ital,wght@0,300..800;1,300..800\"),\n entry(\"Lato\", \"sans\", \"Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900\"),\n entry(\"Montserrat\", \"sans\", \"Montserrat:ital,wght@0,100..900;1,100..900\"),\n entry(\n \"Poppins\",\n \"sans\",\n \"Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900\",\n ),\n entry(\"Nunito\", \"sans\", \"Nunito:ital,wght@0,200..1000;1,200..1000\"),\n entry(\"Work Sans\", \"sans\", \"Work+Sans:ital,wght@0,100..900;1,100..900\"),\n entry(\"DM Sans\", \"sans\", \"DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000\"),\n entry(\"Manrope\", \"sans\", \"Manrope:wght@200..800\"),\n entry(\"IBM Plex Sans\", \"sans\", \"IBM+Plex+Sans:ital,wght@0,100..700;1,100..700\"),\n entry(\"Source Sans 3\", \"sans\", \"Source+Sans+3:ital,wght@0,200..900;1,200..900\"),\n entry(\"Figtree\", \"sans\", \"Figtree:ital,wght@0,300..900;1,300..900\"),\n entry(\"Plus Jakarta Sans\", \"sans\", \"Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800\"),\n entry(\"Outfit\", \"sans\", \"Outfit:wght@100..900\"),\n entry(\"Raleway\", \"sans\", \"Raleway:ital,wght@0,100..900;1,100..900\"),\n entry(\"Rubik\", \"sans\", \"Rubik:ital,wght@0,300..900;1,300..900\"),\n entry(\"Noto Sans\", \"sans\", \"Noto+Sans:ital,wght@0,100..900;1,100..900\"),\n entry(\"Lora\", \"serif\", \"Lora:ital,wght@0,400..700;1,400..700\"),\n entry(\"Merriweather\", \"serif\", \"Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900\"),\n entry(\"Playfair Display\", \"serif\", \"Playfair+Display:ital,wght@0,400..900;1,400..900\"),\n entry(\"Source Serif 4\", \"serif\", \"Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900\"),\n entry(\"Libre Baskerville\", \"serif\", \"Libre+Baskerville:ital,wght@0,400;0,700;1,400\"),\n entry(\"EB Garamond\", \"serif\", \"EB+Garamond:ital,wght@0,400..800;1,400..800\"),\n entry(\"Crimson Pro\", \"serif\", \"Crimson+Pro:ital,wght@0,200..900;1,200..900\"),\n entry(\"DM Serif Display\", \"serif\", \"DM+Serif+Display:ital@0;1\"),\n entry(\"Noto Serif\", \"serif\", \"Noto+Serif:ital,wght@0,100..900;1,100..900\"),\n entry(\"Geist Mono\", \"mono\", \"Geist+Mono:ital,wght@0,100..900;1,100..900\"),\n entry(\"JetBrains Mono\", \"mono\", \"JetBrains+Mono:ital,wght@0,100..800;1,100..800\"),\n entry(\"Fira Code\", \"mono\", \"Fira+Code:wght@300..700\"),\n entry(\n \"IBM Plex Mono\",\n \"mono\",\n \"IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700\",\n ),\n entry(\"Source Code Pro\", \"mono\", \"Source+Code+Pro:ital,wght@0,200..900;1,200..900\"),\n entry(\"Roboto Mono\", \"mono\", \"Roboto+Mono:ital,wght@0,100..700;1,100..700\"),\n entry(\"Space Mono\", \"mono\", \"Space+Mono:ital,wght@0,400;0,700;1,400;1,700\"),\n];\n\n/** The stylesheet URL for one catalogue entry. */\nexport const fontHref = (font: FontEntry) => `https://fonts.googleapis.com/css2?family=${font.css2}&display=swap`;\n\n/** The family names in a fontFamily value, unquoted (`\"Lora\", serif` → `[\"Lora\", \"serif\"]`). */\nexport function familyNames(value: string): string[] {\n return value\n .split(\",\")\n .map(part => part.trim().replace(/^([\"'])(.*)\\1$/, \"$2\").trim())\n .filter(Boolean);\n}\n\n/**\n * The catalogue fonts a set of fontFamily values names, in catalogue order,\n * without the bundled ones (their import is already in styles.css).\n */\nexport function fontsUsed(values: Iterable<string>, catalog: readonly FontEntry[] = FONT_CATALOG): FontEntry[] {\n const names = new Set<string>();\n for (const value of values) for (const name of familyNames(value)) names.add(name.toLowerCase());\n return catalog.filter(f => !f.bundled && names.has(f.family.toLowerCase()));\n}\n","/**\n * The token manifest shipped with this version of pont. Generated from the\n * CSS by `npm run tokens:pont` (scripts/build-tokens.ts); a guardrail fails\n * when it is stale. Also published as `@pontive/pontkit-core/tokens.json`.\n */\nimport json from \"./tokens.json\";\nimport type { TokenManifest } from \"./types\";\n\nexport const defaultManifest = json as TokenManifest;\n","/**\n * Theme value validation (docs/11-tokens.md §8).\n *\n * Branding values are customer-supplied text that ends up in a stylesheet on\n * the customer's login page, so validation is an allow-list, not a filter:\n *\n * 1. a character set with no `; { } < > @ ! \\` or quotes (quotes only inside\n * font-family names), so a value cannot end the declaration or the rule;\n * 2. an allow-list of CSS functions (colour spaces, maths, `var`), so no\n * `url()`, `image()`, `attr()`, `expression()` …;\n * 3. `var()` may only name a known ref or sem token, with no fallback;\n * 4. a per-type grammar on the whole value.\n *\n * Pure string checks: works the same in browsers and Node (no CSS.supports).\n */\nimport type { TokenType } from \"./types\";\n\nconst MAX_LENGTH = 300;\nconst SAFE = /^[a-zA-Z0-9\\s#%.,()/*+-]*$/;\nconst FUNCTIONS = new Set([\n \"rgb\", \"rgba\", \"hsl\", \"hsla\", \"hwb\", \"lab\", \"lch\", \"oklab\", \"oklch\", \"color\", \"color-mix\",\n \"calc\", \"min\", \"max\", \"clamp\", \"var\", \"cubic-bezier\", \"steps\",\n]);\nconst COLOR_FUNCTIONS = [\"rgb\", \"rgba\", \"hsl\", \"hsla\", \"hwb\", \"lab\", \"lch\", \"oklab\", \"oklch\", \"color\", \"color-mix\"];\nconst MATH_FUNCTIONS = [\"calc\", \"min\", \"max\", \"clamp\"];\n\nconst NUM = \"[+-]?(?:\\\\d+\\\\.?\\\\d*|\\\\.\\\\d+)(?:e[+-]?\\\\d+)?\";\nconst UNITS = \"px|rem|em|%|vh|vw|svh|svw|dvh|dvw|lvh|lvw|ch|ex|cap|ic|lh|rlh|vmin|vmax|cqw|cqh|cqi|cqb|cqmin|cqmax\";\nconst DIMENSION = new RegExp(`^(?:${NUM}(?:${UNITS})|[+-]?0)$`, \"i\");\nconst NUMBER = new RegExp(`^${NUM}$`, \"i\");\nconst DURATION = new RegExp(`^${NUM}(?:ms|s)$`, \"i\");\nconst CUBIC_BEZIER = new RegExp(`^cubic-bezier\\\\(\\\\s*${NUM}\\\\s*,\\\\s*${NUM}\\\\s*,\\\\s*${NUM}\\\\s*,\\\\s*${NUM}\\\\s*\\\\)$`, \"i\");\nconst RATIO = new RegExp(`^(?:auto|${NUM}(?:\\\\s*/\\\\s*${NUM})?)$`, \"i\");\nconst HEX = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst EASINGS = new Set([\"ease\", \"linear\", \"ease-in\", \"ease-out\", \"ease-in-out\", \"step-start\", \"step-end\"]);\n/** CSS border-style keywords (an outline also takes `auto`). */\nconst BORDER_STYLES = new Set([\"none\", \"hidden\", \"dotted\", \"dashed\", \"solid\", \"double\", \"groove\", \"ridge\", \"inset\", \"outset\", \"auto\"]);\n/** CSS align-items values: `normal`, `stretch`, baselines, and positions with an optional overflow position. */\nconst ALIGN_ITEMS = /^(?:normal|stretch|anchor-center|(?:(?:first|last)\\s+)?baseline|(?:(?:safe|unsafe)\\s+)?(?:center|start|end|self-start|self-end|flex-start|flex-end))$/i;\n/** CSS justify-content values: `normal`, distributions, and positions with an optional overflow position. */\nconst JUSTIFY_CONTENT = /^(?:normal|space-between|space-around|space-evenly|stretch|(?:(?:safe|unsafe)\\s+)?(?:center|start|end|flex-start|flex-end|left|right))$/i;\n\nconst CURSORS = new Set([\n \"auto\", \"default\", \"none\", \"context-menu\", \"help\", \"pointer\", \"progress\", \"wait\", \"cell\", \"crosshair\", \"text\",\n \"vertical-text\", \"alias\", \"copy\", \"move\", \"no-drop\", \"not-allowed\", \"grab\", \"grabbing\", \"all-scroll\",\n \"col-resize\", \"row-resize\", \"n-resize\", \"e-resize\", \"s-resize\", \"w-resize\", \"ne-resize\", \"nw-resize\",\n \"se-resize\", \"sw-resize\", \"ew-resize\", \"ns-resize\", \"nesw-resize\", \"nwse-resize\", \"zoom-in\", \"zoom-out\",\n]);\nconst FONT_WEIGHTS = new Set([\"normal\", \"bold\", \"lighter\", \"bolder\"]);\nconst FAMILY_NAME = /^[a-zA-Z][a-zA-Z0-9-]*(?: [a-zA-Z0-9-]+)*$/;\n\n/** CSS named colours, plus `transparent` and `currentcolor`. */\nconst NAMED_COLORS = new Set(\n (\n \"transparent currentcolor aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond \" +\n \"blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan \" +\n \"darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange \" +\n \"darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet \" +\n \"deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite \" +\n \"gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush \" +\n \"lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey \" +\n \"lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime \" +\n \"limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen \" +\n \"mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin \" +\n \"navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise \" +\n \"palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue \" +\n \"saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow \" +\n \"springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen\"\n ).split(\" \"),\n);\n\nexport interface ValueContext {\n /** Whether `var(--pont-<name>)` may be used in this value (name without the prefix). */\n canReference(name: string): boolean;\n}\n\n/** True when `v` is exactly one call to one of `names`, e.g. `oklch(…)`. */\nfunction isSingleCall(v: string, names: readonly string[]): boolean {\n const m = /^([a-z-]+)\\(/i.exec(v);\n if (!m || !names.includes(m[1].toLowerCase())) return false;\n let depth = 0;\n for (let i = m[0].length - 1; i < v.length; i++) {\n if (v[i] === \"(\") depth++;\n else if (v[i] === \")\" && --depth === 0) return i === v.length - 1;\n }\n return false;\n}\n\nconst isVar = (v: string) => /^var\\([^()]*\\)$/.test(v);\n\n/**\n * Check one theme value against its token's type. Returns an error message,\n * or null when the value is acceptable.\n */\nexport function checkValue(type: TokenType, raw: unknown, ctx: ValueContext): string | null {\n if (typeof raw !== \"string\") return \"must be a string\";\n const value = raw.trim();\n if (!value) return \"must not be empty\";\n if (value.length > MAX_LENGTH) return `must be at most ${MAX_LENGTH} characters`;\n\n // 1. Quoted strings: only as font-family names, with nothing that could escape them.\n let reduced = value;\n if (type === \"fontFamily\") {\n let bad = false;\n reduced = value.replace(/\"([^\"]*)\"|'([^']*)'/g, (_m, a: string | undefined, b: string | undefined) => {\n if (/[\\\\\\n\\r<>;{}\"']/.test(a ?? b ?? \"\")) bad = true;\n return \"Quoted\";\n });\n if (bad) return \"font names may not contain \\\\ < > ; { } or line breaks\";\n }\n\n // 2. Characters.\n if (!SAFE.test(reduced)) return \"contains characters that are not allowed in a theme value\";\n\n // 3. Functions.\n for (const [, fn] of reduced.matchAll(/([a-zA-Z-]+)\\(/g)) {\n if (!FUNCTIONS.has(fn.toLowerCase())) return `the function ${fn}() is not allowed`;\n }\n let depth = 0;\n for (const ch of reduced) {\n if (ch === \"(\") depth++;\n if (ch === \")\" && --depth < 0) return \"has unbalanced parentheses\";\n }\n if (depth !== 0) return \"has unbalanced parentheses\";\n\n // 4. Token references.\n for (const [, inner] of reduced.matchAll(/var\\(([^()]*)\\)/gi)) {\n const m = /^\\s*--pont-([a-z0-9-]+)\\s*$/.exec(inner);\n if (!m) return \"var() may only name a pont token, with no fallback\";\n if (!ctx.canReference(m[1])) return `var(--pont-${m[1]}) is not a token this value may reference`;\n }\n\n // 5. The type's grammar.\n if (isVar(value)) return null;\n const ok = ((): boolean => {\n switch (type) {\n case \"color\":\n return HEX.test(value) || NAMED_COLORS.has(value.toLowerCase()) || isSingleCall(value, COLOR_FUNCTIONS);\n case \"dimension\":\n return DIMENSION.test(value) || isSingleCall(value, MATH_FUNCTIONS);\n case \"number\":\n return NUMBER.test(value) || isSingleCall(value, MATH_FUNCTIONS);\n case \"fontWeight\": {\n if (FONT_WEIGHTS.has(value.toLowerCase()) || isSingleCall(value, MATH_FUNCTIONS)) return true;\n const n = Number(value);\n return NUMBER.test(value) && n >= 1 && n <= 1000;\n }\n case \"fontFamily\":\n return reduced.split(\",\").every(part => FAMILY_NAME.test(part.trim()) || isVar(part.trim()));\n case \"shadow\":\n return value.toLowerCase() === \"none\" || /\\d/.test(value);\n case \"duration\":\n return DURATION.test(value) || isSingleCall(value, MATH_FUNCTIONS);\n case \"cubicBezier\":\n return EASINGS.has(value.toLowerCase()) || CUBIC_BEZIER.test(value) || isSingleCall(value, [\"steps\"]);\n case \"ratio\":\n return RATIO.test(value);\n case \"cursor\":\n return CURSORS.has(value.toLowerCase());\n case \"borderStyle\":\n return BORDER_STYLES.has(value.toLowerCase());\n case \"alignItems\":\n return ALIGN_ITEMS.test(value);\n case \"justifyContent\":\n return JUSTIFY_CONTENT.test(value);\n case \"keyword\":\n case \"fixed\":\n case \"animation\":\n return false; // mode switches and animation structure are not themable (validate.ts reports why)\n }\n })();\n return ok ? null : `is not a valid ${type} value`;\n}\n","/**\n * Theme validation and migration (docs/11-tokens.md §8).\n */\nimport { defaultManifest } from \"./manifest\";\nimport type { PontTheme, ThemeIssue, ThemeScope, TokenManifest, TokenValues } from \"./types\";\nimport { checkValue } from \"./value\";\n\nconst isObject = (v: unknown): v is Record<string, unknown> => typeof v === \"object\" && v !== null && !Array.isArray(v);\n\n/** Rename tokens listed in the manifest's `aliases` (old → new). Returns a new theme. */\nexport function migrateTheme(theme: PontTheme, manifest: TokenManifest = defaultManifest): PontTheme {\n // Not a theme at all: leave it for validateTheme to report (\"a theme must be an object\").\n if (!isObject(theme as unknown)) return theme;\n const retired = manifest.retired ?? {};\n // A reference to a renamed token follows the rename; one to a retired token becomes its value.\n const references = (v: unknown): unknown =>\n typeof v !== \"string\"\n ? v\n : v.replace(/var\\(\\s*--pont-([a-z0-9-]+)\\s*\\)/g, (m: string, ref: string) =>\n manifest.aliases[ref] ? `var(--pont-${manifest.aliases[ref]})` : (retired[ref] ?? m),\n );\n const rename = (values?: TokenValues): TokenValues | undefined => {\n if (!isObject(values)) return values;\n const out: TokenValues = {};\n for (const [k, v] of Object.entries(values)) {\n const name = manifest.aliases[k] ?? k;\n if (!(name in out) || name === k) out[name] = references(v) as string;\n }\n return out;\n };\n const scope = (s?: ThemeScope): ThemeScope | undefined =>\n s && isObject(s as unknown) ? { ...s, light: rename(s.light), dark: rename(s.dark) } : s;\n return {\n ...theme,\n global: scope(theme.global),\n widgets: isObject(theme.widgets)\n ? Object.fromEntries(Object.entries(theme.widgets).map(([k, s]) => [k, scope(s) as ThemeScope]))\n : theme.widgets,\n };\n}\n\n/**\n * Every problem with a theme, or `[]`. Checks the shape, that each token\n * exists, the scope rules (widgets take component tokens only; ref tokens have\n * no mode), and each\n * value against its token's type (value.ts). Run `migrateTheme` first if the\n * theme may use renamed tokens (compileTheme does).\n */\nexport function validateTheme(theme: unknown, manifest: TokenManifest = defaultManifest): ThemeIssue[] {\n const issues: ThemeIssue[] = [];\n const add = (path: string, message: string) => issues.push({ path, message });\n\n if (!isObject(theme)) return [{ path: \"\", message: \"a theme must be an object\" }];\n if (theme.version !== 1) add(\"version\", \"must be 1\");\n for (const key of Object.keys(theme)) {\n if (![\"version\", \"global\", \"widgets\"].includes(key)) add(key, \"is not a theme field\");\n }\n\n const checkScope = (path: string, scope: unknown, where: \"global\" | \"widget\") => {\n if (scope === undefined) return;\n if (!isObject(scope)) return add(path, \"must be an object with light and/or dark\");\n for (const key of Object.keys(scope)) if (key !== \"light\" && key !== \"dark\") add(`${path}.${key}`, \"must be light or dark\");\n for (const mode of [\"light\", \"dark\"] as const) {\n const values = scope[mode];\n if (values === undefined) continue;\n if (!isObject(values)) {\n add(`${path}.${mode}`, \"must map token names to values\");\n continue;\n }\n for (const [name, value] of Object.entries(values)) {\n const at = `${path}.${mode}.${name}`;\n const def = manifest.tokens[name];\n if (!def) {\n add(at, \"is not a pont token\");\n continue;\n }\n if (def.type === \"keyword\") {\n add(at, \"follows the colour mode and cannot be themed\");\n continue;\n }\n if (def.type === \"fixed\") {\n add(at, \"is a fixed value (a CSS keyword, viewport unit or shorthand of other tokens) and cannot be themed\");\n continue;\n }\n if (def.type === \"borderStyle\" && def.tier === \"ref\") {\n add(at, \"is a fixed border-style keyword; theme sem-border-style / sem-border-outline-style instead\");\n continue;\n }\n if (def.type === \"cursor\" && def.tier === \"ref\") {\n add(at, \"is a fixed cursor keyword; theme the sem-cursor-* roles instead\");\n continue;\n }\n if (def.type === \"alignItems\" && def.tier === \"ref\") {\n add(at, \"is a fixed align-items keyword; theme sem-layout-items instead\");\n continue;\n }\n if (def.type === \"justifyContent\" && def.tier === \"ref\") {\n add(at, \"is a fixed justify-content keyword; theme sem-layout-justify instead\");\n continue;\n }\n if (def.type === \"animation\") {\n add(at, \"is animation structure and cannot be themed; theme the -duration / -easing tokens\");\n continue;\n }\n if (def.tier !== \"component\" && where === \"widget\") {\n add(at, `${def.tier} tokens are global; a widget scope takes component tokens only (docs/11-tokens.md §8)`);\n continue;\n }\n if (def.tier === \"ref\" && mode === \"dark\") {\n add(at, \"ref tokens have no mode; set it in global.light, which applies to both modes\");\n continue;\n }\n const message = checkValue(def.type, value, {\n // ref values may only point at other ref tokens (a ref → sem → ref loop would break both);\n // everything else may use any ref or sem token.\n canReference: ref => {\n const target = manifest.tokens[ref];\n if (!target || target.tier === \"component\" || ref === name) return false;\n return def.tier !== \"ref\" || target.tier === \"ref\";\n },\n });\n if (message) add(at, message);\n }\n }\n };\n\n checkScope(\"global\", theme.global, \"global\");\n if (theme.widgets !== undefined) {\n if (!isObject(theme.widgets)) add(\"widgets\", \"must map scope names to scopes\");\n else\n for (const [name, scope] of Object.entries(theme.widgets)) {\n if (!(name in manifest.scopes)) {\n add(`widgets.${name}`, `is not a theme scope (known: ${Object.keys(manifest.scopes).join(\", \")})`);\n continue;\n }\n checkScope(`widgets.${name}`, scope, \"widget\");\n }\n }\n return issues;\n}\n","/**\n * Theme compiler: a stored theme (data) → a layered stylesheet\n * (docs/11-tokens.md §7, §8).\n *\n * Output shape:\n *\n * @layer pont.reset, …, pont.theme.brand; ← the shared order (load-order safe)\n * @layer pont.theme.brand {\n * @layer global, widget; ← a widget host can also match the\n * @layer global { global dark selector (`.dark` on the\n * :root { … } host), so widget rules sit in a\n * :root.dark, …, [data-theme=\"dark\"] { … } later sub-layer and always win there\n * }\n * @layer widget {\n * pont-signin { … }\n * :where(.dark, …) pont-signin, pont-signin:where(.dark, …) { … }\n * }\n * }\n *\n * Scopes (11 §8): the global scope takes ref, sem and component tokens; a\n * widget scope takes component tokens only. So precedence is plain\n * inheritance: inside a widget, its component values beat the global\n * component values, which beat the sem roles they default to.\n *\n * Modes: a colour (sem or component) set for light only keeps its dark value\n * in dark mode (the global theme's, else pont's); other tokens apply to both\n * modes unless a dark value is given.\n */\nimport { fontHref, fontsUsed } from \"./fonts\";\nimport { defaultManifest } from \"./manifest\";\nimport type { CompileOptions, PontTheme, TokenValues } from \"./types\";\nimport { migrateTheme, validateTheme } from \"./validate\";\n\n/** Thrown by compileTheme for an invalid theme; `issues` lists every problem. */\nexport class ThemeError extends Error {\n constructor(readonly issues: { path: string; message: string }[]) {\n super(`Invalid pont theme:\\n${issues.map(i => ` ${i.path}: ${i.message}`).join(\"\\n\")}`);\n this.name = \"ThemeError\";\n }\n}\n\nconst HEADER = /^\\/\\* pont theme · tokens ([0-9a-f]+) \\*\\//;\nconst themeHeader = (fingerprint: string) => `/* pont theme · tokens ${fingerprint} */`;\n\n/**\n * The token-API fingerprint a compiled theme was built against (its first\n * line), or null for CSS that compileTheme did not produce. Compare it with\n * `defaultManifest.fingerprint` to find stored CSS that needs recompiling.\n */\nexport function themeFingerprint(css: string): string | null {\n return HEADER.exec(css)?.[1] ?? null;\n}\n\nfunction rule(selector: string, values: TokenValues, indent: string): string {\n const entries = Object.entries(values);\n if (!entries.length) return \"\";\n const body = entries.map(([k, v]) => `${indent} --pont-${k}: ${v.trim()};`).join(\"\\n\");\n return `${indent}${selector} {\\n${body}\\n${indent}}\\n`;\n}\n\n/**\n * Compile a theme to CSS. Throws ThemeError when the theme is invalid\n * (validateTheme), after migrating renamed tokens (migrateTheme).\n */\nexport function compileTheme(theme: PontTheme, options: CompileOptions = {}): string {\n const manifest = options.manifest ?? defaultManifest;\n const migrated = migrateTheme(theme, manifest);\n const issues = validateTheme(migrated, manifest);\n if (issues.length) throw new ThemeError(issues);\n\n const def = (name: string) => manifest.tokens[name];\n /** Colours (except palettes) are per mode. */\n const perMode = (name: string) => def(name).type === \"color\" && def(name).tier !== \"ref\";\n /** pont's own dark value: the declared dark default, or \"unset\" for a component token. */\n const pontDark = (name: string) => (def(name).tier === \"component\" ? \"initial\" : (def(name).dark ?? def(name).value));\n\n const globalLight: TokenValues = { ...migrated.global?.light };\n const globalDark: TokenValues = { ...migrated.global?.dark };\n\n // A colour set for light only goes back to its dark value in dark mode.\n const gD = { ...globalDark };\n for (const name of Object.keys(globalLight)) if (perMode(name) && !(name in gD)) gD[name] = pontDark(name);\n let globalCss = rule(\":root\", globalLight, \" \") + rule(manifest.dark.selector, gD, \" \");\n\n let widgetCss = \"\";\n for (const [scope, values] of Object.entries(migrated.widgets ?? {})) {\n const tag = manifest.scopes[scope];\n const S: TokenValues = { ...values.light };\n const D: TokenValues = { ...values.dark };\n // …in a widget, back to the global theme's dark value, else pont's.\n for (const name of Object.keys(S)) {\n if (perMode(name) && !(name in D)) D[name] = globalDark[name] ?? pontDark(name);\n }\n const within = manifest.dark.within;\n widgetCss += rule(tag, S, \" \") + rule(`:where(${within}) ${tag}, ${tag}:where(${within})`, D, \" \");\n }\n\n const layer = `pont.theme.${options.layer ?? \"brand\"}`;\n let out = `${themeHeader(manifest.fingerprint)}\\n${manifest.layers}\\n`;\n if (!globalCss && !widgetCss) return out;\n\n // Web fonts: every catalogue family a fontFamily value names (fonts.ts). The URL comes from the\n // manifest's catalogue, never from the theme. @import must precede every rule but @layer statements.\n const fontValues = [migrated.global, ...Object.values(migrated.widgets ?? {})]\n .flatMap(scope => [scope?.light, scope?.dark])\n .flatMap(values => Object.entries(values ?? {}))\n .filter(([name]) => def(name)?.type === \"fontFamily\")\n .map(([, value]) => value);\n for (const font of fontsUsed(fontValues, manifest.fonts ?? [])) {\n out += `@import url(\"${fontHref(font)}\") layer(pont.tokens);\\n`;\n }\n if (globalCss) globalCss = ` @layer global {\\n${globalCss} }\\n`;\n if (widgetCss) widgetCss = ` @layer widget {\\n${widgetCss} }\\n`;\n out += `@layer ${layer} {\\n @layer global, widget;\\n${globalCss}${widgetCss}}\\n`;\n return out;\n}\n","/**\n * Applying themes in a browser (docs/12-theming-integration.md).\n *\n * - `applyTheme(theme)` compiles a theme (or takes compiled CSS) and puts it\n * in one `<style data-pont-theme>` element: the dashboard's live preview.\n * - `linkTheme(href)` adds or updates one `<link rel=\"stylesheet\">`: how an\n * app loads its published theme (`…/apps/{appId}/theme.css`).\n *\n * Compiled CSS starts with the shared layer order, so either element can go\n * anywhere in the document, before or after pont's styles.css.\n * Nothing here runs on import: the module stays safe to import in Node.\n */\nimport { compileTheme } from \"./compile\";\nimport type { CompileOptions, PontTheme } from \"./types\";\n\nexport interface ApplyOptions {\n /** The document to apply to (default: the global `document`). */\n document?: Document;\n /** Distinguishes several themes in one document (default `\"brand\"`). */\n id?: string;\n /** Passed to compileTheme when a theme object is given. */\n compile?: CompileOptions;\n}\n\nexport interface AppliedTheme {\n /** The CSS now in the document. */\n css: string;\n /** Remove the element again. */\n remove(): void;\n}\n\nfunction owner(options: ApplyOptions): Document {\n const doc = options.document ?? (globalThis as { document?: Document }).document;\n if (!doc) throw new Error(\"pont theme: no document to apply to (pass options.document)\");\n return doc;\n}\n\nfunction element<K extends \"style\" | \"link\">(doc: Document, tag: K, id: string): HTMLElementTagNameMap[K] {\n if (!/^[a-z0-9-]+$/i.test(id)) throw new Error(`pont theme: id must be letters, digits or dashes (\"${id}\")`);\n const existing = doc.head.querySelector(`${tag}[data-pont-theme=\"${id}\"]`);\n if (existing) return existing as HTMLElementTagNameMap[K];\n const el = doc.createElement(tag);\n el.setAttribute(\"data-pont-theme\", id);\n doc.head.append(el);\n return el;\n}\n\n/**\n * Compile `theme` (unless it is already CSS) and apply it. Calling it again\n * with the same id replaces the previous CSS. Throws ThemeError for an\n * invalid theme, leaving the previous CSS in place.\n */\nexport function applyTheme(theme: PontTheme | string, options: ApplyOptions = {}): AppliedTheme {\n const doc = owner(options);\n const css = typeof theme === \"string\" ? theme : compileTheme(theme, options.compile);\n const style = element(doc, \"style\", options.id ?? \"brand\");\n if (style.textContent !== css) style.textContent = css;\n return { css, remove: () => style.remove() };\n}\n\n/**\n * Load a published theme stylesheet. Calling it again with the same id\n * points the same `<link>` at the new href. Only http(s) and same-origin\n * relative URLs are accepted.\n */\nexport function linkTheme(href: string, options: Omit<ApplyOptions, \"compile\"> = {}): { remove(): void } {\n const doc = owner(options);\n const url = new URL(href, doc.baseURI);\n if (url.protocol !== \"https:\" && url.protocol !== \"http:\") {\n throw new Error(`pont theme: refusing to link a ${url.protocol} stylesheet`);\n }\n const link = element(doc, \"link\", options.id ?? \"brand\");\n link.rel = \"stylesheet\";\n if (link.href !== url.href) link.href = url.href;\n return { remove: () => link.remove() };\n}\n","/**\n * Theme scopes: the elements a theme can target below `:root`\n * (docs/11-tokens.md §7, §8). Keys are what the dashboard stores; values are\n * the element the compiled CSS selects. A guardrail checks every tag here is\n * a registered pont element.\n */\nexport const THEME_SCOPES: Readonly<Record<string, string>> = {\n signin: \"pont-signin\",\n signup: \"pont-signup\",\n};\n\n/**\n * Renamed tokens, old name → new name (both without `--pont-`). The token\n * list is public API (11 §9): rename by adding an entry here, never by just\n * deleting, so stored themes keep working.\n */\nexport const TOKEN_ALIASES: Readonly<Record<string, string>> = {\n // The radius knob moved to the ref tier; sem keeps the derived scale.\n \"sem-radius\": \"ref-radius\",\n // The derived radius scale moved to the ref tier too (styles/tokens/radius.css).\n ...Object.fromEntries(\n [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"none\", \"full\"].map(s => [`sem-radius-${s}`, `ref-radius-${s}`]),\n ),\n // The spacing unit and the container scale became dimension tokens (styles/tokens/dimension.css).\n \"ref-spacing\": \"ref-dimension\",\n ...Object.fromEntries(\n [\"3xs\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"5xl\", \"6xl\", \"7xl\"].map(s => [`sem-container-${s}`, `ref-dimension-size-${s}`]),\n ),\n // The aspect ratios moved to the ref tier (styles/tokens/layout.css).\n ...Object.fromEntries([\"auto\", \"square\", \"video\"].map(s => [`sem-aspect-${s}`, `ref-layout-aspect-${s}`])),\n // Font stacks became roles (body / heading / code) over the ref font families, then the\n // typography tokens moved under `typography-` (styles/tokens/typography.css): the families and\n // roles keep their tiers; size, weight, tracking and leading moved to the ref tier.\n \"sem-font-sans\": \"sem-typography-font-body\",\n \"sem-font-mono\": \"sem-typography-font-code\",\n ...Object.fromEntries([\"body\", \"heading\", \"code\"].map(r => [`sem-font-${r}`, `sem-typography-font-${r}`])),\n ...Object.fromEntries([\"sans\", \"serif\", \"mono\"].map(f => [`ref-font-${f}`, `ref-typography-font-${f}`])),\n ...Object.fromEntries(\n [\"xs\", \"sm\", \"base\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"5xl\", \"6xl\", \"7xl\", \"8xl\", \"9xl\"].flatMap(s => [\n [`sem-text-${s}`, `ref-typography-size-${s}`],\n [`sem-text-${s}--line-height`, `ref-typography-leading-of-${s}`],\n ]),\n ),\n ...Object.fromEntries(\n [\"thin\", \"extralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"extrabold\", \"black\"].map(w => [\n `sem-font-weight-${w}`,\n `ref-typography-weight-${w}`,\n ]),\n ),\n ...Object.fromEntries([\"tighter\", \"tight\", \"normal\", \"wide\", \"wider\", \"widest\"].map(t => [`sem-tracking-${t}`, `ref-typography-tracking-${t}`])),\n ...Object.fromEntries([\"none\", \"tight\", \"snug\", \"normal\", \"relaxed\", \"loose\"].map(l => [`sem-leading-${l}`, `ref-typography-leading-${l}`])),\n // Motion moved under `motion-` (tokens/motion.css). The transition duration\n // and in-out easing every transition read became the transition roles; the\n // other easings are ref now; `animate-` became `motion-anim-`, `-function`\n // became `-easing`. The single easing of before the scale was in-out.\n \"sem-ease\": \"sem-motion-trans-easing\",\n // Colour roles: `-foreground` became `-fg`, background `bg`, card `surface`\n // and popover `overlay` (same roles, same values).\n \"sem-color-background\": \"sem-color-bg\",\n \"sem-color-foreground\": \"sem-color-fg\",\n \"sem-color-card\": \"sem-color-surface\",\n \"sem-color-card-foreground\": \"sem-color-surface-fg\",\n \"sem-color-popover\": \"sem-color-overlay\",\n \"sem-color-popover-foreground\": \"sem-color-overlay-fg\",\n \"sem-color-primary-foreground\": \"sem-color-primary-fg\",\n \"sem-color-secondary-foreground\": \"sem-color-secondary-fg\",\n \"sem-color-muted-foreground\": \"sem-color-muted-fg\",\n \"sem-color-accent-foreground\": \"sem-color-accent-fg\",\n \"sem-color-surface-hover\": \"sem-color-ghost-hover\",\n // Single-component colours became the components' own tokens, with dark\n // defaults in the component CSS (docs/11-tokens.md §6).\n \"sem-color-track\": \"switch-bg\",\n \"sem-color-thumb\": \"switch-thumb-bg\",\n \"sem-color-thumb-checked\": \"switch-thumb-bg-checked\",\n \"sem-color-segment-fg\": \"tabs-trigger-fg\",\n \"sem-color-segment-active\": \"tabs-trigger-bg-active\",\n \"sem-color-segment-active-border\": \"tabs-trigger-border-color-active\",\n \"sem-color-primary-subtle\": \"field-choice-bg-checked\",\n \"sem-color-primary-subtle-border\": \"field-choice-border-color-checked\",\n \"sem-color-inverse-subtle\": \"kbd-tooltip-bg\",\n // The focus ring width moved into the sem shadow tokens (tokens/shadow.css).\n \"sem-ring-width\": \"sem-shadow-ring-width-focus\",\n // Shadows became a ref scale (tokens/shadow.css); inset-shadow became shadow-inset.\n ...Object.fromEntries([\"none\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\"].map(s => [`sem-shadow-${s}`, `ref-shadow-${s}`])),\n ...Object.fromEntries([\"none\", \"2xs\", \"xs\", \"sm\"].map(s => [`sem-inset-shadow-${s}`, `ref-shadow-inset-${s}`])),\n \"sem-duration\": \"sem-motion-trans-duration\",\n \"sem-ease-in-out\": \"sem-motion-trans-easing\",\n \"sem-ease-linear\": \"ref-motion-easing-linear\",\n \"sem-ease-in\": \"ref-motion-easing-ease-in\",\n \"sem-ease-out\": \"ref-motion-easing-ease-out\",\n \"ref-animate-iteration-infinite\": \"ref-motion-anim-iteration-infinite\",\n ...Object.fromEntries(\n [\"spin\", \"ping\", \"pulse\", \"bounce\"].flatMap(a => [\n [`sem-animate-${a}`, `sem-motion-anim-${a}`],\n [`sem-animate-${a}-name`, `sem-motion-anim-${a}-name`],\n [`sem-animate-${a}-duration`, `sem-motion-anim-${a}-duration`],\n [`sem-animate-${a}-function`, `sem-motion-anim-${a}-easing`],\n [`sem-animate-${a}-iteration`, `sem-motion-anim-${a}-iteration`],\n ]),\n ),\n};\n\n/**\n * Removed tokens with no successor, old name → the CSS value a reference to\n * it becomes. A stored theme value `var(--pont-ref-font-geist)` keeps meaning\n * Geist: it is rewritten to the family's stack, which compileTheme then\n * imports from the font catalogue (fonts.ts). Like aliases, never just delete\n * an entry.\n */\nexport const TOKEN_RETIRED: Readonly<Record<string, string>> = {\n // The bundled web fonts were dropped (pont's defaults are system stacks now).\n \"ref-font-geist\": '\"Geist\", sans-serif',\n \"ref-font-inter\": '\"Inter\", sans-serif',\n \"ref-font-geist-mono\": '\"Geist Mono\", monospace',\n};\n","/**\n * Import a shadcn theme (ui.shadcn.com/themes, `npx shadcn create`) as a\n * pont theme scope (docs/11-tokens.md §8).\n *\n * shadcn names map to pont's roles: `--primary` → `sem-color-primary`,\n * `--primary-foreground` → `sem-color-primary-fg`, `--card` → `sem-color-surface`,\n * `--popover` → `sem-color-overlay`, `--radius` → `ref-radius`. `--ring` is\n * shadcn's focus colour: it sets `sem-color-border-focus`, and\n * `sem-color-ring-focus` as the same colour at 50% (shadcn's `ring-ring/50`). Variables pont has no role for (`--sidebar-*`, fonts …)\n * are returned in `skipped`. shadcn v3 themes, whose colours are bare HSL\n * channels (`222.2 84% 4.9%`), are wrapped in `hsl()`.\n */\nimport type { ThemeScope, TokenValues } from \"./types\";\n\n/** shadcn colour variable → pont colour role (without the `sem-color-` prefix). */\nconst SHADCN_COLORS = new Map([\n [\"background\", \"bg\"], [\"foreground\", \"fg\"],\n [\"card\", \"surface\"], [\"card-foreground\", \"surface-fg\"],\n [\"popover\", \"overlay\"], [\"popover-foreground\", \"overlay-fg\"],\n [\"primary\", \"primary\"], [\"primary-foreground\", \"primary-fg\"],\n [\"secondary\", \"secondary\"], [\"secondary-foreground\", \"secondary-fg\"],\n [\"muted\", \"muted\"], [\"muted-foreground\", \"muted-fg\"],\n [\"accent\", \"accent\"], [\"accent-foreground\", \"accent-fg\"],\n ...[\"destructive\", \"border\", \"input\", \"chart-1\", \"chart-2\", \"chart-3\", \"chart-4\", \"chart-5\"].map(n => [n, n] as const),\n]);\n\nconst HSL_CHANNELS = /^-?[\\d.]+(?:deg)?\\s+[\\d.]+%\\s+[\\d.]+%(?:\\s*\\/\\s*[\\d.]+%?)?$/;\n\nexport interface ShadcnImport {\n scope: ThemeScope;\n /** shadcn variables with no pont counterpart, by name (without `--`). */\n skipped: string[];\n}\n\nexport function importShadcnTheme(css: string): ShadcnImport {\n const scope: ThemeScope = {};\n const skipped = new Set<string>();\n const clean = css.replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\");\n for (const [, selector, body] of clean.matchAll(/(:root|\\.dark)\\s*\\{([^{}]*)\\}/g)) {\n const mode = selector === \":root\" ? \"light\" : \"dark\";\n const values: TokenValues = (scope[mode] ??= {});\n for (const [, name, raw] of body.matchAll(/--([a-z0-9-]+)\\s*:\\s*([^;]+);?/g)) {\n const value = HSL_CHANNELS.test(raw.trim()) ? `hsl(${raw.trim()})` : raw.trim();\n const role = SHADCN_COLORS.get(name);\n if (role) values[`sem-color-${role}`] = value;\n else if (name === \"ring\") {\n values[\"sem-color-border-focus\"] = value;\n values[\"sem-color-ring-focus\"] = `color-mix(in oklab, ${value} 50%, transparent)`;\n }\n // ref tokens have no mode, so a radius in `.dark` is skipped.\n else if (name === \"radius\" && mode === \"light\") values[\"ref-radius\"] = value;\n else skipped.add(name);\n }\n }\n return { scope, skipped: [...skipped] };\n}\n","/**\n * The token naming vocabulary (docs/11-tokens.md §3), shared by the manifest\n * builder (scripts/tokens-manifest.ts) and anyone generating controls.\n *\n * Only type imports here: the manifest builder runs this file directly in\n * Node, which needs explicit extensions for runtime imports.\n */\nimport type { TokenType } from \"./types\";\n\n/**\n * The property suffixes a component token may end in, and the type each\n * implies. Extend deliberately, and document the addition in 11 §3.\n */\nexport const PROPERTY_TYPES: Readonly<Record<string, TokenType>> = {\n bg: \"color\",\n fg: \"color\",\n \"border-color\": \"color\",\n \"ring-color\": \"color\",\n \"icon-color\": \"color\",\n \"border-width\": \"dimension\",\n radius: \"dimension\",\n shadow: \"shadow\",\n \"font-family\": \"fontFamily\",\n \"font-size\": \"dimension\",\n \"font-weight\": \"fontWeight\",\n \"line-height\": \"number\",\n \"letter-spacing\": \"dimension\",\n height: \"dimension\",\n width: \"dimension\",\n \"min-width\": \"dimension\",\n \"max-width\": \"dimension\",\n \"padding-x\": \"dimension\",\n \"padding-y\": \"dimension\",\n gap: \"dimension\",\n /** A shadcn-style spacing unit (`--card-spacing`) that feeds both padding and gap. */\n spacing: \"dimension\",\n opacity: \"number\",\n};\n\n/** State suffixes, placed after the property: `--pont-button-default-bg-hover`. */\nexport const STATES = [\"hover\", \"active\", \"focus\", \"disabled\", \"invalid\", \"checked\", \"open\"] as const;\n\n/**\n * The box-shadow composition helpers, registered with @property in base.css\n * (Tailwind's `--tw-shadow`, `--tw-ring-shadow` … under the pont prefix).\n * Component CSS may declare and read them; they are not tokens. Recipes use\n * `--pont-shadow` and `--pont-ring-shadow` today; the rest are registered.\n */\nexport const SHADOW_HELPERS = [\n \"shadow\", \"shadow-color\", \"inset-shadow\", \"inset-shadow-color\",\n \"ring-shadow\", \"ring-width\", \"ring-color\", \"inset-ring-shadow\", \"inset-ring-color\",\n \"ring-offset-shadow\", \"ring-offset-width\", \"ring-offset-color\",\n] as const;\n\n/**\n * `--pont-*` variables that are not tokens, so they are neither in the\n * manifest nor themable, but component CSS may read them directly:\n * - runtime inputs pont's own scripts write per element: the popup\n * positioning variables (core/popup/anchored.ts) and Gap's size attribute;\n * - author knobs whose values a theme cannot carry: mask-image URLs.\n */\nexport const NON_TOKEN_VARIABLES = [\n \"popup-x\", \"popup-y\", \"anchor-width\", \"anchor-height\", \"available-width\", \"available-height\",\n \"transform-origin\", \"arrow-x\", \"arrow-y\",\n \"gap-size\",\n \"spinner-icon\", \"native-select-icon\",\n] as const;\n\nexport interface ComponentTokenName {\n /** Everything before the property: component, then optional part and variant/size. */\n stem: string;\n property: string;\n state?: string;\n type: TokenType;\n}\n\n/**\n * Parse a component token name (without `--pont-`) into stem, property and\n * state. Returns null when it does not end in a vocabulary property.\n */\nexport function parseComponentToken(name: string): ComponentTokenName | null {\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name)) return null;\n let rest = name;\n let state: string | undefined;\n for (const s of STATES) {\n if (rest.endsWith(`-${s}`)) {\n state = s;\n rest = rest.slice(0, -(s.length + 1));\n break;\n }\n }\n const property = Object.keys(PROPERTY_TYPES)\n .sort((a, b) => b.length - a.length)\n .find(p => rest.endsWith(`-${p}`));\n if (!property) return null;\n const stem = rest.slice(0, -(property.length + 1));\n if (!stem) return null;\n return { stem, property, state, type: PROPERTY_TYPES[property] };\n}\n\n/** The type of a ref or sem token, from its name. Null when the name fits no group. */\nexport function systemTokenType(name: string): TokenType | null {\n if (/^(ref|sem)-color-/.test(name)) return \"color\";\n if (/^ref-typography-leading-/.test(name)) return \"number\";\n if (/^ref-radius$/.test(name) || /^ref-dimension(-size-([2-7]?xl|[23]?xs|sm|md|lg))?$/.test(name) || /^ref-radius-/.test(name) || /^ref-filter-blur(-|$)/.test(name) || /^sem-(ring-width|border-width|border-outline-width)$/.test(name) || /^ref-border-width(-none)?$/.test(name) || /^ref-typography-(size-|tracking)/.test(name)) return \"dimension\";\n if (/^(ref|sem)-dimension-/.test(name)) return \"fixed\";\n if (/^ref-layout-aspect-/.test(name)) return \"ratio\";\n if (/^ref-layout-box-/.test(name)) return \"fixed\";\n if (/^(ref-layout-items-|sem-layout-items$)/.test(name)) return \"alignItems\";\n if (/^(ref-layout-justify-|sem-layout-justify$)/.test(name)) return \"justifyContent\";\n if (/^ref-opacity(-|$)/.test(name) || /^sem-opacity-/.test(name)) return \"number\";\n if (/^ref-typography-weight-/.test(name)) return \"fontWeight\";\n if (/^(ref|sem)-typography-font-/.test(name)) return \"fontFamily\";\n if (/^sem-shadow-ring(-offset)?-width(-focus|-invalid)?$/.test(name)) return \"dimension\";\n if (/^ref-shadow-/.test(name) || /^sem-shadow-ring(-focus|-invalid|-offset)?$/.test(name)) return \"shadow\";\n if (/^ref-motion-duration(-s)?$/.test(name) || /^sem-motion-(trans|anim)-duration(-slow|-fast)?$/.test(name) || /^sem-motion-anim-[a-z0-9]+-duration$/.test(name)) return \"duration\";\n if (/^ref-motion-easing-/.test(name) || /^sem-motion-(trans|anim)-easing$/.test(name) || /^sem-motion-anim-[a-z0-9]+-easing$/.test(name)) return \"cubicBezier\";\n if (/^(ref|sem)-motion-(anim|trans-property)(-|$)/.test(name)) return \"animation\";\n if (/^(ref|sem)-cursor-/.test(name)) return \"cursor\";\n if (/^ref-border-style-/.test(name) || /^sem-border(-outline)?-style$/.test(name)) return \"borderStyle\";\n if (/^sem-border(-outline)?$/.test(name)) return \"fixed\";\n if (/^sem-mode-/.test(name)) return \"keyword\";\n return null;\n}\n"],"names":["GENERIC","entry","family","category","css2","bundled","FONT_CATALOG","fontHref","font","familyNames","value","part","fontsUsed","values","catalog","names","name","f","defaultManifest","json","MAX_LENGTH","SAFE","FUNCTIONS","COLOR_FUNCTIONS","MATH_FUNCTIONS","NUM","UNITS","DIMENSION","NUMBER","DURATION","CUBIC_BEZIER","RATIO","HEX","EASINGS","BORDER_STYLES","ALIGN_ITEMS","JUSTIFY_CONTENT","CURSORS","FONT_WEIGHTS","FAMILY_NAME","NAMED_COLORS","isSingleCall","v","m","depth","i","isVar","checkValue","type","raw","ctx","reduced","bad","_m","a","b","fn","ch","inner","n","isObject","migrateTheme","theme","manifest","retired","references","ref","rename","out","k","scope","s","validateTheme","issues","add","path","message","key","checkScope","where","mode","at","def","target","ThemeError","HEADER","themeHeader","fingerprint","themeFingerprint","css","_a","rule","selector","indent","entries","body","compileTheme","options","_b","migrated","perMode","pontDark","globalLight","globalDark","gD","globalCss","widgetCss","tag","S","D","within","layer","fontValues","owner","doc","element","id","existing","el","applyTheme","style","linkTheme","href","url","link","THEME_SCOPES","TOKEN_ALIASES","r","w","t","l","TOKEN_RETIRED","SHADCN_COLORS","HSL_CHANNELS","importShadcnTheme","skipped","clean","role","PROPERTY_TYPES","STATES","parseComponentToken","rest","state","property","p","stem","systemTokenType"],"mappings":"AAoCA,MAAMA,IAAwC,EAAE,MAAM,cAAc,OAAO,SAAS,MAAM,YAAA,GAEpFC,IAAQ,CAACC,GAAgBC,GAAwBC,GAAcC,IAAU,QAAsB;AAAA,EACnG,QAAAH;AAAA,EACA,UAAAC;AAAA,EACA,OAAO,IAAID,CAAM,MAAMF,EAAQG,CAAQ,CAAC;AAAA,EACxC,MAAAC;AAAA,EACA,GAAIC,IAAU,EAAE,SAAAA,MAAY,CAAA;AAC9B,IAEaC,IAAqC;AAAA,EAChDL,EAAM,SAAS,QAAQ,uCAAuC;AAAA,EAC9DA,EAAM,SAAS,QAAQ,0DAA0D;AAAA,EACjFA,EAAM,UAAU,QAAQ,wCAAwC;AAAA,EAChEA,EAAM,aAAa,QAAQ,2CAA2C;AAAA,EACtEA,EAAM,QAAQ,QAAQ,4EAA4E;AAAA,EAClGA,EAAM,cAAc,QAAQ,4CAA4C;AAAA,EACxEA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEFA,EAAM,UAAU,QAAQ,0CAA0C;AAAA,EAClEA,EAAM,aAAa,QAAQ,2CAA2C;AAAA,EACtEA,EAAM,WAAW,QAAQ,4DAA4D;AAAA,EACrFA,EAAM,WAAW,QAAQ,uBAAuB;AAAA,EAChDA,EAAM,iBAAiB,QAAQ,+CAA+C;AAAA,EAC9EA,EAAM,iBAAiB,QAAQ,+CAA+C;AAAA,EAC9EA,EAAM,WAAW,QAAQ,yCAAyC;AAAA,EAClEA,EAAM,qBAAqB,QAAQ,mDAAmD;AAAA,EACtFA,EAAM,UAAU,QAAQ,sBAAsB;AAAA,E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,IAAU,aACtK,sBAAsB,KAAKA,CAAI,KAAK,mCAAmC,KAAKA,CAAI,KAAK,qCAAqC,KAAKA,CAAI,IAAU,gBAC7I,+CAA+C,KAAKA,CAAI,IAAU,cAClE,qBAAqB,KAAKA,CAAI,IAAU,WACxC,qBAAqB,KAAKA,CAAI,KAAK,gCAAgC,KAAKA,CAAI,IAAU,gBACtF,0BAA0B,KAAKA,CAAI,IAAU,UAC7C,aAAa,KAAKA,CAAI,IAAU,YAC7B;AACT;"}
1
+ {"version":3,"file":"theme.mjs","sources":["../src/theme/fonts.ts","../src/theme/manifest.ts","../src/theme/value.ts","../src/theme/validate.ts","../src/theme/compile.ts","../src/theme/apply.ts","../src/theme/scopes.ts","../src/theme/shadcn.ts","../src/theme/vocabulary.ts"],"sourcesContent":["/**\n * The web fonts a theme may use (docs/11-tokens.md §8, \"Fonts\").\n *\n * A theme cannot carry `url()`: its values end up in a stylesheet on the\n * customer's login page. So a theme names a family (a fontFamily value such as\n * `\"Lora\", serif`), and `compileTheme` adds the `@import` for every family it\n * finds **in this catalogue**. The URL always comes from here, never from the\n * theme. A family not in the catalogue is still valid CSS: it renders if the\n * visitor has it installed, else the stack's fallback.\n *\n * The catalogue is copied into the manifest (`tokens.json` `fonts`) by\n * `npm run tokens:pont`, so a dashboard can list it, and it is part of the\n * manifest fingerprint: changing a URL changes compiled output. Every `css2`\n * spec was checked against fonts.googleapis.com (each must answer 200;\n * requesting a weight or axis a family lacks is an error there).\n *\n * `bundled` families would be imported by pont's own styles.css, so a theme\n * using them adds no import. None is today: styles.css imports no web font\n * (pont's defaults are the system stacks in tokens/typography.css), so every\n * catalogue family a theme names is imported by the compiled theme.\n */\n\nexport type FontCategory = \"sans\" | \"serif\" | \"mono\";\n\nexport interface FontEntry {\n /** The CSS family name, as a theme writes it (`\"Lora\"`). Matched case-insensitively. */\n family: string;\n category: FontCategory;\n /** A complete value for a fontFamily token: the family and its generic fallback. */\n stack: string;\n /** The Google Fonts css2 `family=` parameter: name and axes. */\n css2: string;\n /** Already imported by pont's styles.css. */\n bundled?: boolean;\n}\n\nconst GENERIC: Record<FontCategory, string> = { sans: \"sans-serif\", serif: \"serif\", mono: \"monospace\" };\n\nconst entry = (family: string, category: FontCategory, css2: string, bundled = false): FontEntry => ({\n family,\n category,\n stack: `\"${family}\", ${GENERIC[category]}`,\n css2,\n ...(bundled ? { bundled } : {}),\n});\n\nexport const FONT_CATALOG: readonly FontEntry[] = [\n entry(\"Geist\", \"sans\", \"Geist:ital,wght@0,100..900;1,100..900\"),\n entry(\"Inter\", \"sans\", \"Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900\"),\n entry(\"Roboto\", \"sans\", \"Roboto:ital,wght@0,100..900;1,100..900\"),\n entry(\"Open Sans\", \"sans\", \"Open+Sans:ital,wght@0,300..800;1,300..800\"),\n entry(\"Lato\", \"sans\", \"Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900\"),\n entry(\"Montserrat\", \"sans\", \"Montserrat:ital,wght@0,100..900;1,100..900\"),\n entry(\n \"Poppins\",\n \"sans\",\n \"Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900\",\n ),\n entry(\"Nunito\", \"sans\", \"Nunito:ital,wght@0,200..1000;1,200..1000\"),\n entry(\"Work Sans\", \"sans\", \"Work+Sans:ital,wght@0,100..900;1,100..900\"),\n entry(\"DM Sans\", \"sans\", \"DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000\"),\n entry(\"Manrope\", \"sans\", \"Manrope:wght@200..800\"),\n entry(\"IBM Plex Sans\", \"sans\", \"IBM+Plex+Sans:ital,wght@0,100..700;1,100..700\"),\n entry(\"Source Sans 3\", \"sans\", \"Source+Sans+3:ital,wght@0,200..900;1,200..900\"),\n entry(\"Figtree\", \"sans\", \"Figtree:ital,wght@0,300..900;1,300..900\"),\n entry(\"Plus Jakarta Sans\", \"sans\", \"Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800\"),\n entry(\"Outfit\", \"sans\", \"Outfit:wght@100..900\"),\n entry(\"Raleway\", \"sans\", \"Raleway:ital,wght@0,100..900;1,100..900\"),\n entry(\"Rubik\", \"sans\", \"Rubik:ital,wght@0,300..900;1,300..900\"),\n entry(\"Noto Sans\", \"sans\", \"Noto+Sans:ital,wght@0,100..900;1,100..900\"),\n entry(\"Lora\", \"serif\", \"Lora:ital,wght@0,400..700;1,400..700\"),\n entry(\"Merriweather\", \"serif\", \"Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900\"),\n entry(\"Playfair Display\", \"serif\", \"Playfair+Display:ital,wght@0,400..900;1,400..900\"),\n entry(\"Source Serif 4\", \"serif\", \"Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900\"),\n entry(\"Libre Baskerville\", \"serif\", \"Libre+Baskerville:ital,wght@0,400;0,700;1,400\"),\n entry(\"EB Garamond\", \"serif\", \"EB+Garamond:ital,wght@0,400..800;1,400..800\"),\n entry(\"Crimson Pro\", \"serif\", \"Crimson+Pro:ital,wght@0,200..900;1,200..900\"),\n entry(\"DM Serif Display\", \"serif\", \"DM+Serif+Display:ital@0;1\"),\n entry(\"Noto Serif\", \"serif\", \"Noto+Serif:ital,wght@0,100..900;1,100..900\"),\n entry(\"Geist Mono\", \"mono\", \"Geist+Mono:ital,wght@0,100..900;1,100..900\"),\n entry(\"JetBrains Mono\", \"mono\", \"JetBrains+Mono:ital,wght@0,100..800;1,100..800\"),\n entry(\"Fira Code\", \"mono\", \"Fira+Code:wght@300..700\"),\n entry(\n \"IBM Plex Mono\",\n \"mono\",\n \"IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700\",\n ),\n entry(\"Source Code Pro\", \"mono\", \"Source+Code+Pro:ital,wght@0,200..900;1,200..900\"),\n entry(\"Roboto Mono\", \"mono\", \"Roboto+Mono:ital,wght@0,100..700;1,100..700\"),\n entry(\"Space Mono\", \"mono\", \"Space+Mono:ital,wght@0,400;0,700;1,400;1,700\"),\n];\n\n/** The stylesheet URL for one catalogue entry. */\nexport const fontHref = (font: FontEntry) => `https://fonts.googleapis.com/css2?family=${font.css2}&display=swap`;\n\n/** The family names in a fontFamily value, unquoted (`\"Lora\", serif` → `[\"Lora\", \"serif\"]`). */\nexport function familyNames(value: string): string[] {\n return value\n .split(\",\")\n .map(part => part.trim().replace(/^([\"'])(.*)\\1$/, \"$2\").trim())\n .filter(Boolean);\n}\n\n/**\n * The catalogue fonts a set of fontFamily values names, in catalogue order,\n * without the bundled ones (their import is already in styles.css).\n */\nexport function fontsUsed(values: Iterable<string>, catalog: readonly FontEntry[] = FONT_CATALOG): FontEntry[] {\n const names = new Set<string>();\n for (const value of values) for (const name of familyNames(value)) names.add(name.toLowerCase());\n return catalog.filter(f => !f.bundled && names.has(f.family.toLowerCase()));\n}\n","/**\n * The token manifest shipped with this version of pont. Generated from the\n * CSS by `npm run tokens:pont` (scripts/build-tokens.ts); a guardrail fails\n * when it is stale. Also published as `@pontive/pontkit-core/tokens.json`.\n */\nimport json from \"./tokens.json\";\nimport type { TokenManifest } from \"./types\";\n\nexport const defaultManifest = json as TokenManifest;\n","/**\n * Theme value validation (docs/11-tokens.md §8).\n *\n * Branding values are customer-supplied text that ends up in a stylesheet on\n * the customer's login page, so validation is an allow-list, not a filter:\n *\n * 1. a character set with no `; { } < > @ ! \\` or quotes (quotes only inside\n * font-family names), so a value cannot end the declaration or the rule;\n * 2. an allow-list of CSS functions (colour spaces, maths, `var`), so no\n * `url()`, `image()`, `attr()`, `expression()` …;\n * 3. `var()` may only name a known ref or sem token, with no fallback;\n * 4. a per-type grammar on the whole value.\n *\n * Pure string checks: works the same in browsers and Node (no CSS.supports).\n */\nimport type { TokenType } from \"./types\";\n\nconst MAX_LENGTH = 300;\nconst SAFE = /^[a-zA-Z0-9\\s#%.,()/*+-]*$/;\nconst FUNCTIONS = new Set([\n \"rgb\", \"rgba\", \"hsl\", \"hsla\", \"hwb\", \"lab\", \"lch\", \"oklab\", \"oklch\", \"color\", \"color-mix\",\n \"calc\", \"min\", \"max\", \"clamp\", \"var\", \"cubic-bezier\", \"steps\",\n]);\nconst COLOR_FUNCTIONS = [\"rgb\", \"rgba\", \"hsl\", \"hsla\", \"hwb\", \"lab\", \"lch\", \"oklab\", \"oklch\", \"color\", \"color-mix\"];\nconst MATH_FUNCTIONS = [\"calc\", \"min\", \"max\", \"clamp\"];\n\nconst NUM = \"[+-]?(?:\\\\d+\\\\.?\\\\d*|\\\\.\\\\d+)(?:e[+-]?\\\\d+)?\";\nconst UNITS = \"px|rem|em|%|vh|vw|svh|svw|dvh|dvw|lvh|lvw|ch|ex|cap|ic|lh|rlh|vmin|vmax|cqw|cqh|cqi|cqb|cqmin|cqmax\";\nconst DIMENSION = new RegExp(`^(?:${NUM}(?:${UNITS})|[+-]?0)$`, \"i\");\nconst NUMBER = new RegExp(`^${NUM}$`, \"i\");\nconst DURATION = new RegExp(`^${NUM}(?:ms|s)$`, \"i\");\nconst CUBIC_BEZIER = new RegExp(`^cubic-bezier\\\\(\\\\s*${NUM}\\\\s*,\\\\s*${NUM}\\\\s*,\\\\s*${NUM}\\\\s*,\\\\s*${NUM}\\\\s*\\\\)$`, \"i\");\nconst RATIO = new RegExp(`^(?:auto|${NUM}(?:\\\\s*/\\\\s*${NUM})?)$`, \"i\");\nconst HEX = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst EASINGS = new Set([\"ease\", \"linear\", \"ease-in\", \"ease-out\", \"ease-in-out\", \"step-start\", \"step-end\"]);\n/** CSS border-style keywords (an outline also takes `auto`). */\nconst BORDER_STYLES = new Set([\"none\", \"hidden\", \"dotted\", \"dashed\", \"solid\", \"double\", \"groove\", \"ridge\", \"inset\", \"outset\", \"auto\"]);\n/** CSS align-items values: `normal`, `stretch`, baselines, and positions with an optional overflow position. */\nconst ALIGN_ITEMS = /^(?:normal|stretch|anchor-center|(?:(?:first|last)\\s+)?baseline|(?:(?:safe|unsafe)\\s+)?(?:center|start|end|self-start|self-end|flex-start|flex-end))$/i;\n/** CSS align-content values: `normal`, baselines, distributions, and positions with an optional overflow position. */\nconst ALIGN_CONTENT = /^(?:normal|(?:(?:first|last)\\s+)?baseline|space-between|space-around|space-evenly|stretch|(?:(?:safe|unsafe)\\s+)?(?:center|start|end|flex-start|flex-end))$/i;\n/** CSS justify-content values: `normal`, distributions, and positions with an optional overflow position. */\nconst JUSTIFY_CONTENT = /^(?:normal|space-between|space-around|space-evenly|stretch|(?:(?:safe|unsafe)\\s+)?(?:center|start|end|flex-start|flex-end|left|right))$/i;\n\nconst CURSORS = new Set([\n \"auto\", \"default\", \"none\", \"context-menu\", \"help\", \"pointer\", \"progress\", \"wait\", \"cell\", \"crosshair\", \"text\",\n \"vertical-text\", \"alias\", \"copy\", \"move\", \"no-drop\", \"not-allowed\", \"grab\", \"grabbing\", \"all-scroll\",\n \"col-resize\", \"row-resize\", \"n-resize\", \"e-resize\", \"s-resize\", \"w-resize\", \"ne-resize\", \"nw-resize\",\n \"se-resize\", \"sw-resize\", \"ew-resize\", \"ns-resize\", \"nesw-resize\", \"nwse-resize\", \"zoom-in\", \"zoom-out\",\n]);\nconst FONT_WEIGHTS = new Set([\"normal\", \"bold\", \"lighter\", \"bolder\"]);\nconst FAMILY_NAME = /^[a-zA-Z][a-zA-Z0-9-]*(?: [a-zA-Z0-9-]+)*$/;\n\n/** CSS named colours, plus `transparent` and `currentcolor`. */\nconst NAMED_COLORS = new Set(\n (\n \"transparent currentcolor aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond \" +\n \"blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan \" +\n \"darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange \" +\n \"darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet \" +\n \"deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite \" +\n \"gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush \" +\n \"lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey \" +\n \"lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime \" +\n \"limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen \" +\n \"mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin \" +\n \"navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise \" +\n \"palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue \" +\n \"saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow \" +\n \"springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen\"\n ).split(\" \"),\n);\n\nexport interface ValueContext {\n /** Whether `var(--pont-<name>)` may be used in this value (name without the prefix). */\n canReference(name: string): boolean;\n}\n\n/** True when `v` is exactly one call to one of `names`, e.g. `oklch(…)`. */\nfunction isSingleCall(v: string, names: readonly string[]): boolean {\n const m = /^([a-z-]+)\\(/i.exec(v);\n if (!m || !names.includes(m[1].toLowerCase())) return false;\n let depth = 0;\n for (let i = m[0].length - 1; i < v.length; i++) {\n if (v[i] === \"(\") depth++;\n else if (v[i] === \")\" && --depth === 0) return i === v.length - 1;\n }\n return false;\n}\n\nconst isVar = (v: string) => /^var\\([^()]*\\)$/.test(v);\n\n/**\n * Check one theme value against its token's type. Returns an error message,\n * or null when the value is acceptable.\n */\nexport function checkValue(type: TokenType, raw: unknown, ctx: ValueContext): string | null {\n if (typeof raw !== \"string\") return \"must be a string\";\n const value = raw.trim();\n if (!value) return \"must not be empty\";\n if (value.length > MAX_LENGTH) return `must be at most ${MAX_LENGTH} characters`;\n\n // 1. Quoted strings: only as font-family names, with nothing that could escape them.\n let reduced = value;\n if (type === \"fontFamily\") {\n let bad = false;\n reduced = value.replace(/\"([^\"]*)\"|'([^']*)'/g, (_m, a: string | undefined, b: string | undefined) => {\n if (/[\\\\\\n\\r<>;{}\"']/.test(a ?? b ?? \"\")) bad = true;\n return \"Quoted\";\n });\n if (bad) return \"font names may not contain \\\\ < > ; { } or line breaks\";\n }\n\n // 2. Characters.\n if (!SAFE.test(reduced)) return \"contains characters that are not allowed in a theme value\";\n\n // 3. Functions.\n for (const [, fn] of reduced.matchAll(/([a-zA-Z-]+)\\(/g)) {\n if (!FUNCTIONS.has(fn.toLowerCase())) return `the function ${fn}() is not allowed`;\n }\n let depth = 0;\n for (const ch of reduced) {\n if (ch === \"(\") depth++;\n if (ch === \")\" && --depth < 0) return \"has unbalanced parentheses\";\n }\n if (depth !== 0) return \"has unbalanced parentheses\";\n\n // 4. Token references.\n for (const [, inner] of reduced.matchAll(/var\\(([^()]*)\\)/gi)) {\n const m = /^\\s*--pont-([a-z0-9-]+)\\s*$/.exec(inner);\n if (!m) return \"var() may only name a pont token, with no fallback\";\n if (!ctx.canReference(m[1])) return `var(--pont-${m[1]}) is not a token this value may reference`;\n }\n\n // 5. The type's grammar.\n if (isVar(value)) return null;\n const ok = ((): boolean => {\n switch (type) {\n case \"color\":\n return HEX.test(value) || NAMED_COLORS.has(value.toLowerCase()) || isSingleCall(value, COLOR_FUNCTIONS);\n case \"dimension\":\n return DIMENSION.test(value) || isSingleCall(value, MATH_FUNCTIONS);\n case \"number\":\n return NUMBER.test(value) || isSingleCall(value, MATH_FUNCTIONS);\n case \"fontWeight\": {\n if (FONT_WEIGHTS.has(value.toLowerCase()) || isSingleCall(value, MATH_FUNCTIONS)) return true;\n const n = Number(value);\n return NUMBER.test(value) && n >= 1 && n <= 1000;\n }\n case \"fontFamily\":\n return reduced.split(\",\").every(part => FAMILY_NAME.test(part.trim()) || isVar(part.trim()));\n case \"shadow\":\n return value.toLowerCase() === \"none\" || /\\d/.test(value);\n case \"duration\":\n return DURATION.test(value) || isSingleCall(value, MATH_FUNCTIONS);\n case \"cubicBezier\":\n return EASINGS.has(value.toLowerCase()) || CUBIC_BEZIER.test(value) || isSingleCall(value, [\"steps\"]);\n case \"ratio\":\n return RATIO.test(value);\n case \"cursor\":\n return CURSORS.has(value.toLowerCase());\n case \"borderStyle\":\n return BORDER_STYLES.has(value.toLowerCase());\n case \"alignItems\":\n return ALIGN_ITEMS.test(value);\n case \"alignContent\":\n return ALIGN_CONTENT.test(value);\n case \"justifyContent\":\n return JUSTIFY_CONTENT.test(value);\n case \"keyword\":\n case \"fixed\":\n case \"animation\":\n return false; // mode switches and animation structure are not themable (validate.ts reports why)\n }\n })();\n return ok ? null : `is not a valid ${type} value`;\n}\n","/**\n * Theme validation and migration (docs/11-tokens.md §8).\n */\nimport { defaultManifest } from \"./manifest\";\nimport type { PontTheme, ThemeIssue, ThemeScope, TokenManifest, TokenValues } from \"./types\";\nimport { checkValue } from \"./value\";\n\nconst isObject = (v: unknown): v is Record<string, unknown> => typeof v === \"object\" && v !== null && !Array.isArray(v);\n\n/** Rename tokens listed in the manifest's `aliases` (old → new). Returns a new theme. */\nexport function migrateTheme(theme: PontTheme, manifest: TokenManifest = defaultManifest): PontTheme {\n // Not a theme at all: leave it for validateTheme to report (\"a theme must be an object\").\n if (!isObject(theme as unknown)) return theme;\n const retired = manifest.retired ?? {};\n // A reference to a renamed token follows the rename; one to a retired token becomes its value.\n const references = (v: unknown): unknown =>\n typeof v !== \"string\"\n ? v\n : v.replace(/var\\(\\s*--pont-([a-z0-9-]+)\\s*\\)/g, (m: string, ref: string) =>\n manifest.aliases[ref] ? `var(--pont-${manifest.aliases[ref]})` : (retired[ref] ?? m),\n );\n const rename = (values?: TokenValues): TokenValues | undefined => {\n if (!isObject(values)) return values;\n const out: TokenValues = {};\n for (const [k, v] of Object.entries(values)) {\n const name = manifest.aliases[k] ?? k;\n if (!(name in out) || name === k) out[name] = references(v) as string;\n }\n return out;\n };\n const scope = (s?: ThemeScope): ThemeScope | undefined =>\n s && isObject(s as unknown) ? { ...s, light: rename(s.light), dark: rename(s.dark) } : s;\n return {\n ...theme,\n global: scope(theme.global),\n widgets: isObject(theme.widgets)\n ? Object.fromEntries(Object.entries(theme.widgets).map(([k, s]) => [k, scope(s) as ThemeScope]))\n : theme.widgets,\n };\n}\n\n/**\n * Every problem with a theme, or `[]`. Checks the shape, that each token\n * exists, the scope rules (widgets take component tokens only; ref tokens have\n * no mode), and each\n * value against its token's type (value.ts). Run `migrateTheme` first if the\n * theme may use renamed tokens (compileTheme does).\n */\nexport function validateTheme(theme: unknown, manifest: TokenManifest = defaultManifest): ThemeIssue[] {\n const issues: ThemeIssue[] = [];\n const add = (path: string, message: string) => issues.push({ path, message });\n\n if (!isObject(theme)) return [{ path: \"\", message: \"a theme must be an object\" }];\n if (theme.version !== 1) add(\"version\", \"must be 1\");\n for (const key of Object.keys(theme)) {\n if (![\"version\", \"global\", \"widgets\"].includes(key)) add(key, \"is not a theme field\");\n }\n\n const checkScope = (path: string, scope: unknown, where: \"global\" | \"widget\") => {\n if (scope === undefined) return;\n if (!isObject(scope)) return add(path, \"must be an object with light and/or dark\");\n for (const key of Object.keys(scope)) if (key !== \"light\" && key !== \"dark\") add(`${path}.${key}`, \"must be light or dark\");\n for (const mode of [\"light\", \"dark\"] as const) {\n const values = scope[mode];\n if (values === undefined) continue;\n if (!isObject(values)) {\n add(`${path}.${mode}`, \"must map token names to values\");\n continue;\n }\n for (const [name, value] of Object.entries(values)) {\n const at = `${path}.${mode}.${name}`;\n const def = manifest.tokens[name];\n if (!def) {\n add(at, \"is not a pont token\");\n continue;\n }\n if (def.type === \"keyword\") {\n add(at, \"follows the colour mode and cannot be themed\");\n continue;\n }\n if (def.type === \"fixed\") {\n add(at, \"is a fixed value (a CSS keyword, viewport unit or shorthand of other tokens) and cannot be themed\");\n continue;\n }\n if (def.type === \"borderStyle\" && def.tier === \"ref\") {\n add(at, \"is a fixed border-style keyword; theme sem-border-style / sem-border-outline-style instead\");\n continue;\n }\n if (def.type === \"cursor\" && def.tier === \"ref\") {\n add(at, \"is a fixed cursor keyword; theme the sem-cursor-* roles instead\");\n continue;\n }\n if (def.type === \"alignItems\" && def.tier === \"ref\") {\n add(at, \"is a fixed align-items keyword; theme sem-layout-items instead\");\n continue;\n }\n if (def.type === \"alignContent\" && def.tier === \"ref\") {\n add(at, \"is a fixed align-content keyword; theme sem-layout-content instead\");\n continue;\n }\n if (def.type === \"justifyContent\" && def.tier === \"ref\") {\n add(at, \"is a fixed justify-content keyword; theme sem-layout-justify instead\");\n continue;\n }\n if (def.type === \"animation\") {\n add(at, \"is animation structure and cannot be themed; theme the -duration / -easing tokens\");\n continue;\n }\n if (def.tier !== \"component\" && where === \"widget\") {\n add(at, `${def.tier} tokens are global; a widget scope takes component tokens only (docs/11-tokens.md §8)`);\n continue;\n }\n if (def.tier === \"ref\" && mode === \"dark\") {\n add(at, \"ref tokens have no mode; set it in global.light, which applies to both modes\");\n continue;\n }\n const message = checkValue(def.type, value, {\n // ref values may only point at other ref tokens (a ref → sem → ref loop would break both);\n // everything else may use any ref or sem token.\n canReference: ref => {\n const target = manifest.tokens[ref];\n if (!target || target.tier === \"component\" || ref === name) return false;\n return def.tier !== \"ref\" || target.tier === \"ref\";\n },\n });\n if (message) add(at, message);\n }\n }\n };\n\n checkScope(\"global\", theme.global, \"global\");\n if (theme.widgets !== undefined) {\n if (!isObject(theme.widgets)) add(\"widgets\", \"must map scope names to scopes\");\n else\n for (const [name, scope] of Object.entries(theme.widgets)) {\n if (!(name in manifest.scopes)) {\n add(`widgets.${name}`, `is not a theme scope (known: ${Object.keys(manifest.scopes).join(\", \")})`);\n continue;\n }\n checkScope(`widgets.${name}`, scope, \"widget\");\n }\n }\n return issues;\n}\n","/**\n * Theme compiler: a stored theme (data) → a layered stylesheet\n * (docs/11-tokens.md §7, §8).\n *\n * Output shape:\n *\n * @layer pont.reset, …, pont.theme.brand; ← the shared order (load-order safe)\n * @layer pont.theme.brand {\n * @layer global, widget; ← a widget host can also match the\n * @layer global { global dark selector (`.dark` on the\n * :root { … } host), so widget rules sit in a\n * :root.dark, …, [data-theme=\"dark\"] { … } later sub-layer and always win there\n * }\n * @layer widget {\n * pont-signin { … }\n * :where(.dark, …) pont-signin, pont-signin:where(.dark, …) { … }\n * }\n * }\n *\n * Scopes (11 §8): the global scope takes ref, sem and component tokens; a\n * widget scope takes component tokens only. So precedence is plain\n * inheritance: inside a widget, its component values beat the global\n * component values, which beat the sem roles they default to.\n *\n * Modes: a colour (sem or component) set for light only keeps its dark value\n * in dark mode (the global theme's, else pont's); other tokens apply to both\n * modes unless a dark value is given.\n */\nimport { fontHref, fontsUsed } from \"./fonts\";\nimport { defaultManifest } from \"./manifest\";\nimport type { CompileOptions, PontTheme, TokenValues } from \"./types\";\nimport { migrateTheme, validateTheme } from \"./validate\";\n\n/** Thrown by compileTheme for an invalid theme; `issues` lists every problem. */\nexport class ThemeError extends Error {\n constructor(readonly issues: { path: string; message: string }[]) {\n super(`Invalid pont theme:\\n${issues.map(i => ` ${i.path}: ${i.message}`).join(\"\\n\")}`);\n this.name = \"ThemeError\";\n }\n}\n\nconst HEADER = /^\\/\\* pont theme · tokens ([0-9a-f]+) \\*\\//;\nconst themeHeader = (fingerprint: string) => `/* pont theme · tokens ${fingerprint} */`;\n\n/**\n * The token-API fingerprint a compiled theme was built against (its first\n * line), or null for CSS that compileTheme did not produce. Compare it with\n * `defaultManifest.fingerprint` to find stored CSS that needs recompiling.\n */\nexport function themeFingerprint(css: string): string | null {\n return HEADER.exec(css)?.[1] ?? null;\n}\n\nfunction rule(selector: string, values: TokenValues, indent: string): string {\n const entries = Object.entries(values);\n if (!entries.length) return \"\";\n const body = entries.map(([k, v]) => `${indent} --pont-${k}: ${v.trim()};`).join(\"\\n\");\n return `${indent}${selector} {\\n${body}\\n${indent}}\\n`;\n}\n\n/**\n * Compile a theme to CSS. Throws ThemeError when the theme is invalid\n * (validateTheme), after migrating renamed tokens (migrateTheme).\n */\nexport function compileTheme(theme: PontTheme, options: CompileOptions = {}): string {\n const manifest = options.manifest ?? defaultManifest;\n const migrated = migrateTheme(theme, manifest);\n const issues = validateTheme(migrated, manifest);\n if (issues.length) throw new ThemeError(issues);\n\n const def = (name: string) => manifest.tokens[name];\n /** Colours (except palettes) are per mode. */\n const perMode = (name: string) => def(name).type === \"color\" && def(name).tier !== \"ref\";\n /** pont's own dark value: the declared dark default, or \"unset\" for a component token. */\n const pontDark = (name: string) => (def(name).tier === \"component\" ? \"initial\" : (def(name).dark ?? def(name).value));\n\n const globalLight: TokenValues = { ...migrated.global?.light };\n const globalDark: TokenValues = { ...migrated.global?.dark };\n\n // A colour set for light only goes back to its dark value in dark mode.\n const gD = { ...globalDark };\n for (const name of Object.keys(globalLight)) if (perMode(name) && !(name in gD)) gD[name] = pontDark(name);\n let globalCss = rule(\":root\", globalLight, \" \") + rule(manifest.dark.selector, gD, \" \");\n\n let widgetCss = \"\";\n for (const [scope, values] of Object.entries(migrated.widgets ?? {})) {\n const tag = manifest.scopes[scope];\n const S: TokenValues = { ...values.light };\n const D: TokenValues = { ...values.dark };\n // …in a widget, back to the global theme's dark value, else pont's.\n for (const name of Object.keys(S)) {\n if (perMode(name) && !(name in D)) D[name] = globalDark[name] ?? pontDark(name);\n }\n const within = manifest.dark.within;\n widgetCss += rule(tag, S, \" \") + rule(`:where(${within}) ${tag}, ${tag}:where(${within})`, D, \" \");\n }\n\n const layer = `pont.theme.${options.layer ?? \"brand\"}`;\n let out = `${themeHeader(manifest.fingerprint)}\\n${manifest.layers}\\n`;\n if (!globalCss && !widgetCss) return out;\n\n // Web fonts: every catalogue family a fontFamily value names (fonts.ts). The URL comes from the\n // manifest's catalogue, never from the theme. @import must precede every rule but @layer statements.\n const fontValues = [migrated.global, ...Object.values(migrated.widgets ?? {})]\n .flatMap(scope => [scope?.light, scope?.dark])\n .flatMap(values => Object.entries(values ?? {}))\n .filter(([name]) => def(name)?.type === \"fontFamily\")\n .map(([, value]) => value);\n for (const font of fontsUsed(fontValues, manifest.fonts ?? [])) {\n out += `@import url(\"${fontHref(font)}\") layer(pont.tokens);\\n`;\n }\n if (globalCss) globalCss = ` @layer global {\\n${globalCss} }\\n`;\n if (widgetCss) widgetCss = ` @layer widget {\\n${widgetCss} }\\n`;\n out += `@layer ${layer} {\\n @layer global, widget;\\n${globalCss}${widgetCss}}\\n`;\n return out;\n}\n","/**\n * Applying themes in a browser (docs/12-theming-integration.md).\n *\n * - `applyTheme(theme)` compiles a theme (or takes compiled CSS) and puts it\n * in one `<style data-pont-theme>` element: the dashboard's live preview.\n * - `linkTheme(href)` adds or updates one `<link rel=\"stylesheet\">`: how an\n * app loads its published theme (`…/apps/{appId}/theme.css`).\n *\n * Compiled CSS starts with the shared layer order, so either element can go\n * anywhere in the document, before or after pont's styles.css.\n * Nothing here runs on import: the module stays safe to import in Node.\n */\nimport { compileTheme } from \"./compile\";\nimport type { CompileOptions, PontTheme } from \"./types\";\n\nexport interface ApplyOptions {\n /** The document to apply to (default: the global `document`). */\n document?: Document;\n /** Distinguishes several themes in one document (default `\"brand\"`). */\n id?: string;\n /** Passed to compileTheme when a theme object is given. */\n compile?: CompileOptions;\n}\n\nexport interface AppliedTheme {\n /** The CSS now in the document. */\n css: string;\n /** Remove the element again. */\n remove(): void;\n}\n\nfunction owner(options: ApplyOptions): Document {\n const doc = options.document ?? (globalThis as { document?: Document }).document;\n if (!doc) throw new Error(\"pont theme: no document to apply to (pass options.document)\");\n return doc;\n}\n\nfunction element<K extends \"style\" | \"link\">(doc: Document, tag: K, id: string): HTMLElementTagNameMap[K] {\n if (!/^[a-z0-9-]+$/i.test(id)) throw new Error(`pont theme: id must be letters, digits or dashes (\"${id}\")`);\n const existing = doc.head.querySelector(`${tag}[data-pont-theme=\"${id}\"]`);\n if (existing) return existing as HTMLElementTagNameMap[K];\n const el = doc.createElement(tag);\n el.setAttribute(\"data-pont-theme\", id);\n doc.head.append(el);\n return el;\n}\n\n/**\n * Compile `theme` (unless it is already CSS) and apply it. Calling it again\n * with the same id replaces the previous CSS. Throws ThemeError for an\n * invalid theme, leaving the previous CSS in place.\n */\nexport function applyTheme(theme: PontTheme | string, options: ApplyOptions = {}): AppliedTheme {\n const doc = owner(options);\n const css = typeof theme === \"string\" ? theme : compileTheme(theme, options.compile);\n const style = element(doc, \"style\", options.id ?? \"brand\");\n if (style.textContent !== css) style.textContent = css;\n return { css, remove: () => style.remove() };\n}\n\n/**\n * Load a published theme stylesheet. Calling it again with the same id\n * points the same `<link>` at the new href. Only http(s) and same-origin\n * relative URLs are accepted.\n */\nexport function linkTheme(href: string, options: Omit<ApplyOptions, \"compile\"> = {}): { remove(): void } {\n const doc = owner(options);\n const url = new URL(href, doc.baseURI);\n if (url.protocol !== \"https:\" && url.protocol !== \"http:\") {\n throw new Error(`pont theme: refusing to link a ${url.protocol} stylesheet`);\n }\n const link = element(doc, \"link\", options.id ?? \"brand\");\n link.rel = \"stylesheet\";\n if (link.href !== url.href) link.href = url.href;\n return { remove: () => link.remove() };\n}\n","/**\n * Theme scopes: the elements a theme can target below `:root`\n * (docs/11-tokens.md §7, §8). Keys are what the dashboard stores; values are\n * the element the compiled CSS selects. A guardrail checks every tag here is\n * a registered pont element.\n */\nexport const THEME_SCOPES: Readonly<Record<string, string>> = {\n signin: \"pont-signin\",\n signup: \"pont-signup\",\n};\n\n/**\n * Renamed tokens, old name → new name (both without `--pont-`). The token\n * list is public API (11 §9): rename by adding an entry here, never by just\n * deleting, so stored themes keep working.\n */\nexport const TOKEN_ALIASES: Readonly<Record<string, string>> = {\n // The radius knob moved to the ref tier; sem keeps the derived scale.\n \"sem-radius\": \"ref-radius\",\n // The derived radius scale moved to the ref tier too (styles/tokens/radius.css).\n ...Object.fromEntries(\n [\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"none\", \"full\"].map(s => [`sem-radius-${s}`, `ref-radius-${s}`]),\n ),\n // The spacing unit and the container scale became dimension tokens (styles/tokens/dimension.css).\n \"ref-spacing\": \"ref-dimension\",\n ...Object.fromEntries(\n [\"3xs\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"5xl\", \"6xl\", \"7xl\"].map(s => [`sem-container-${s}`, `ref-dimension-size-${s}`]),\n ),\n // The aspect ratios moved to the ref tier (styles/tokens/layout.css).\n ...Object.fromEntries([\"auto\", \"square\", \"video\"].map(s => [`sem-aspect-${s}`, `ref-layout-aspect-${s}`])),\n // Font stacks became roles (body / heading / code) over the ref font families, then the\n // typography tokens moved under `typography-` (styles/tokens/typography.css): the families and\n // roles keep their tiers; size, weight, tracking and leading moved to the ref tier.\n \"sem-font-sans\": \"sem-typography-font-body\",\n \"sem-font-mono\": \"sem-typography-font-code\",\n ...Object.fromEntries([\"body\", \"heading\", \"code\"].map(r => [`sem-font-${r}`, `sem-typography-font-${r}`])),\n ...Object.fromEntries([\"sans\", \"serif\", \"mono\"].map(f => [`ref-font-${f}`, `ref-typography-font-${f}`])),\n ...Object.fromEntries(\n [\"xs\", \"sm\", \"base\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"5xl\", \"6xl\", \"7xl\", \"8xl\", \"9xl\"].flatMap(s => [\n [`sem-text-${s}`, `ref-typography-size-${s}`],\n [`sem-text-${s}--line-height`, `ref-typography-leading-of-${s}`],\n ]),\n ),\n ...Object.fromEntries(\n [\"thin\", \"extralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"extrabold\", \"black\"].map(w => [\n `sem-font-weight-${w}`,\n `ref-typography-weight-${w}`,\n ]),\n ),\n ...Object.fromEntries([\"tighter\", \"tight\", \"normal\", \"wide\", \"wider\", \"widest\"].map(t => [`sem-tracking-${t}`, `ref-typography-tracking-${t}`])),\n ...Object.fromEntries([\"none\", \"tight\", \"snug\", \"normal\", \"relaxed\", \"loose\"].map(l => [`sem-leading-${l}`, `ref-typography-leading-${l}`])),\n // Motion moved under `motion-` (tokens/motion.css). The transition duration\n // and in-out easing every transition read became the transition roles; the\n // other easings are ref now; `animate-` became `motion-anim-`, `-function`\n // became `-easing`. The single easing of before the scale was in-out.\n \"sem-ease\": \"sem-motion-trans-easing\",\n // Colour roles: `-foreground` became `-fg`, background `bg`, card `surface`\n // and popover `overlay` (same roles, same values).\n \"sem-color-background\": \"sem-color-bg\",\n \"sem-color-foreground\": \"sem-color-fg\",\n \"sem-color-card\": \"sem-color-surface\",\n \"sem-color-card-foreground\": \"sem-color-surface-fg\",\n \"sem-color-popover\": \"sem-color-overlay\",\n \"sem-color-popover-foreground\": \"sem-color-overlay-fg\",\n \"sem-color-primary-foreground\": \"sem-color-primary-fg\",\n \"sem-color-secondary-foreground\": \"sem-color-secondary-fg\",\n \"sem-color-muted-foreground\": \"sem-color-muted-fg\",\n \"sem-color-accent-foreground\": \"sem-color-accent-fg\",\n \"sem-color-surface-hover\": \"sem-color-ghost-hover\",\n // Single-component colours became the components' own tokens, with dark\n // defaults in the component CSS (docs/11-tokens.md §6).\n \"sem-color-track\": \"switch-bg\",\n \"sem-color-thumb\": \"switch-thumb-bg\",\n \"sem-color-thumb-checked\": \"switch-thumb-bg-checked\",\n \"sem-color-segment-fg\": \"tabs-trigger-fg\",\n \"sem-color-segment-active\": \"tabs-trigger-bg-active\",\n \"sem-color-segment-active-border\": \"tabs-trigger-border-color-active\",\n \"sem-color-primary-subtle\": \"field-choice-bg-checked\",\n \"sem-color-primary-subtle-border\": \"field-choice-border-color-checked\",\n \"sem-color-inverse-subtle\": \"kbd-tooltip-bg\",\n // The focus ring width moved into the sem shadow tokens (tokens/shadow.css).\n \"sem-ring-width\": \"sem-shadow-ring-width-focus\",\n // Shadows became a ref scale (tokens/shadow.css); inset-shadow became shadow-inset.\n ...Object.fromEntries([\"none\", \"2xs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\"].map(s => [`sem-shadow-${s}`, `ref-shadow-${s}`])),\n ...Object.fromEntries([\"none\", \"2xs\", \"xs\", \"sm\"].map(s => [`sem-inset-shadow-${s}`, `ref-shadow-inset-${s}`])),\n \"sem-duration\": \"sem-motion-trans-duration\",\n \"sem-ease-in-out\": \"sem-motion-trans-easing\",\n \"sem-ease-linear\": \"ref-motion-easing-linear\",\n \"sem-ease-in\": \"ref-motion-easing-ease-in\",\n \"sem-ease-out\": \"ref-motion-easing-ease-out\",\n \"ref-animate-iteration-infinite\": \"ref-motion-anim-iteration-infinite\",\n ...Object.fromEntries(\n [\"spin\", \"ping\", \"pulse\", \"bounce\"].flatMap(a => [\n [`sem-animate-${a}`, `sem-motion-anim-${a}`],\n [`sem-animate-${a}-name`, `sem-motion-anim-${a}-name`],\n [`sem-animate-${a}-duration`, `sem-motion-anim-${a}-duration`],\n [`sem-animate-${a}-function`, `sem-motion-anim-${a}-easing`],\n [`sem-animate-${a}-iteration`, `sem-motion-anim-${a}-iteration`],\n ]),\n ),\n};\n\n/**\n * Removed tokens with no successor, old name → the CSS value a reference to\n * it becomes. A stored theme value `var(--pont-ref-font-geist)` keeps meaning\n * Geist: it is rewritten to the family's stack, which compileTheme then\n * imports from the font catalogue (fonts.ts). Like aliases, never just delete\n * an entry.\n */\nexport const TOKEN_RETIRED: Readonly<Record<string, string>> = {\n // The bundled web fonts were dropped (pont's defaults are system stacks now).\n \"ref-font-geist\": '\"Geist\", sans-serif',\n \"ref-font-inter\": '\"Inter\", sans-serif',\n \"ref-font-geist-mono\": '\"Geist Mono\", monospace',\n};\n","/**\n * Import a shadcn theme (ui.shadcn.com/themes, `npx shadcn create`) as a\n * pont theme scope (docs/11-tokens.md §8).\n *\n * shadcn names map to pont's roles: `--primary` → `sem-color-primary`,\n * `--primary-foreground` → `sem-color-primary-fg`, `--card` → `sem-color-surface`,\n * `--popover` → `sem-color-overlay`, `--radius` → `ref-radius`. `--ring` is\n * shadcn's focus colour: it sets `sem-color-border-focus`, and\n * `sem-color-ring-focus` as the same colour at 50% (shadcn's `ring-ring/50`). Variables pont has no role for (`--sidebar-*`, fonts …)\n * are returned in `skipped`. shadcn v3 themes, whose colours are bare HSL\n * channels (`222.2 84% 4.9%`), are wrapped in `hsl()`.\n */\nimport type { ThemeScope, TokenValues } from \"./types\";\n\n/** shadcn colour variable → pont colour role (without the `sem-color-` prefix). */\nconst SHADCN_COLORS = new Map([\n [\"background\", \"bg\"], [\"foreground\", \"fg\"],\n [\"card\", \"surface\"], [\"card-foreground\", \"surface-fg\"],\n [\"popover\", \"overlay\"], [\"popover-foreground\", \"overlay-fg\"],\n [\"primary\", \"primary\"], [\"primary-foreground\", \"primary-fg\"],\n [\"secondary\", \"secondary\"], [\"secondary-foreground\", \"secondary-fg\"],\n [\"muted\", \"muted\"], [\"muted-foreground\", \"muted-fg\"],\n [\"accent\", \"accent\"], [\"accent-foreground\", \"accent-fg\"],\n ...[\"destructive\", \"border\", \"input\", \"chart-1\", \"chart-2\", \"chart-3\", \"chart-4\", \"chart-5\"].map(n => [n, n] as const),\n]);\n\nconst HSL_CHANNELS = /^-?[\\d.]+(?:deg)?\\s+[\\d.]+%\\s+[\\d.]+%(?:\\s*\\/\\s*[\\d.]+%?)?$/;\n\nexport interface ShadcnImport {\n scope: ThemeScope;\n /** shadcn variables with no pont counterpart, by name (without `--`). */\n skipped: string[];\n}\n\nexport function importShadcnTheme(css: string): ShadcnImport {\n const scope: ThemeScope = {};\n const skipped = new Set<string>();\n const clean = css.replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\");\n for (const [, selector, body] of clean.matchAll(/(:root|\\.dark)\\s*\\{([^{}]*)\\}/g)) {\n const mode = selector === \":root\" ? \"light\" : \"dark\";\n const values: TokenValues = (scope[mode] ??= {});\n for (const [, name, raw] of body.matchAll(/--([a-z0-9-]+)\\s*:\\s*([^;]+);?/g)) {\n const value = HSL_CHANNELS.test(raw.trim()) ? `hsl(${raw.trim()})` : raw.trim();\n const role = SHADCN_COLORS.get(name);\n if (role) values[`sem-color-${role}`] = value;\n else if (name === \"ring\") {\n values[\"sem-color-border-focus\"] = value;\n values[\"sem-color-ring-focus\"] = `color-mix(in oklab, ${value} 50%, transparent)`;\n }\n // ref tokens have no mode, so a radius in `.dark` is skipped.\n else if (name === \"radius\" && mode === \"light\") values[\"ref-radius\"] = value;\n else skipped.add(name);\n }\n }\n return { scope, skipped: [...skipped] };\n}\n","/**\n * The token naming vocabulary (docs/11-tokens.md §3), shared by the manifest\n * builder (scripts/tokens-manifest.ts) and anyone generating controls.\n *\n * Only type imports here: the manifest builder runs this file directly in\n * Node, which needs explicit extensions for runtime imports.\n */\nimport type { TokenType } from \"./types\";\n\n/**\n * The property suffixes a component token may end in, and the type each\n * implies. Extend deliberately, and document the addition in 11 §3.\n */\nexport const PROPERTY_TYPES: Readonly<Record<string, TokenType>> = {\n bg: \"color\",\n fg: \"color\",\n \"border-color\": \"color\",\n \"ring-color\": \"color\",\n \"icon-color\": \"color\",\n \"border-width\": \"dimension\",\n radius: \"dimension\",\n shadow: \"shadow\",\n \"font-family\": \"fontFamily\",\n \"font-size\": \"dimension\",\n \"font-weight\": \"fontWeight\",\n \"line-height\": \"number\",\n \"letter-spacing\": \"dimension\",\n height: \"dimension\",\n width: \"dimension\",\n \"min-width\": \"dimension\",\n \"max-width\": \"dimension\",\n \"padding-x\": \"dimension\",\n \"padding-y\": \"dimension\",\n gap: \"dimension\",\n /** A shadcn-style spacing unit (`--card-spacing`) that feeds both padding and gap. */\n spacing: \"dimension\",\n opacity: \"number\",\n};\n\n/** State suffixes, placed after the property: `--pont-button-default-bg-hover`. */\nexport const STATES = [\"hover\", \"active\", \"focus\", \"disabled\", \"invalid\", \"checked\", \"open\"] as const;\n\n/**\n * The box-shadow composition helpers, registered with @property in base.css\n * (Tailwind's `--tw-shadow`, `--tw-ring-shadow` … under the pont prefix).\n * Component CSS may declare and read them; they are not tokens. Recipes use\n * `--pont-shadow` and `--pont-ring-shadow` today; the rest are registered.\n */\nexport const SHADOW_HELPERS = [\n \"shadow\", \"shadow-color\", \"inset-shadow\", \"inset-shadow-color\",\n \"ring-shadow\", \"ring-width\", \"ring-color\", \"inset-ring-shadow\", \"inset-ring-color\",\n \"ring-offset-shadow\", \"ring-offset-width\", \"ring-offset-color\",\n] as const;\n\n/**\n * `--pont-*` variables that are not tokens, so they are neither in the\n * manifest nor themable, but component CSS may read them directly:\n * - runtime inputs pont's own scripts write per element: the popup\n * positioning variables (core/popup/anchored.ts) and Gap's size attribute;\n * - author knobs whose values a theme cannot carry: mask-image URLs.\n */\nexport const NON_TOKEN_VARIABLES = [\n \"popup-x\", \"popup-y\", \"anchor-width\", \"anchor-height\", \"available-width\", \"available-height\",\n \"transform-origin\", \"arrow-x\", \"arrow-y\",\n \"gap-size\",\n \"spinner-icon\", \"native-select-icon\",\n] as const;\n\nexport interface ComponentTokenName {\n /** Everything before the property: component, then optional part and variant/size. */\n stem: string;\n property: string;\n state?: string;\n type: TokenType;\n}\n\n/**\n * Parse a component token name (without `--pont-`) into stem, property and\n * state. Returns null when it does not end in a vocabulary property.\n */\nexport function parseComponentToken(name: string): ComponentTokenName | null {\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name)) return null;\n let rest = name;\n let state: string | undefined;\n for (const s of STATES) {\n if (rest.endsWith(`-${s}`)) {\n state = s;\n rest = rest.slice(0, -(s.length + 1));\n break;\n }\n }\n const property = Object.keys(PROPERTY_TYPES)\n .sort((a, b) => b.length - a.length)\n .find(p => rest.endsWith(`-${p}`));\n if (!property) return null;\n const stem = rest.slice(0, -(property.length + 1));\n if (!stem) return null;\n return { stem, property, state, type: PROPERTY_TYPES[property] };\n}\n\n/** The type of a ref or sem token, from its name. Null when the name fits no group. */\nexport function systemTokenType(name: string): TokenType | null {\n if (/^(ref|sem)-color-/.test(name)) return \"color\";\n if (/^ref-typography-leading-/.test(name)) return \"number\";\n if (/^ref-radius$/.test(name) || /^ref-dimension(-size-([2-7]?xl|[23]?xs|sm|md|lg))?$/.test(name) || /^ref-radius-/.test(name) || /^ref-filter-blur(-|$)/.test(name) || /^sem-(ring-width|border-width|border-outline-width)$/.test(name) || /^ref-border-width(-none)?$/.test(name) || /^ref-typography-(size-|tracking)/.test(name)) return \"dimension\";\n if (/^(ref|sem)-dimension-/.test(name)) return \"fixed\";\n if (/^ref-layout-aspect-/.test(name)) return \"ratio\";\n if (/^ref-layout-box-/.test(name)) return \"fixed\";\n if (/^(ref-layout-items-|sem-layout-items$)/.test(name)) return \"alignItems\";\n if (/^(ref-layout-content-|sem-layout-content$)/.test(name)) return \"alignContent\";\n if (/^(ref-layout-justify-|sem-layout-justify$)/.test(name)) return \"justifyContent\";\n if (/^ref-opacity(-|$)/.test(name) || /^sem-opacity-/.test(name)) return \"number\";\n if (/^ref-typography-weight-/.test(name)) return \"fontWeight\";\n if (/^(ref|sem)-typography-font-/.test(name)) return \"fontFamily\";\n if (/^sem-shadow-ring(-offset)?-width(-focus|-invalid)?$/.test(name)) return \"dimension\";\n if (/^ref-shadow-/.test(name) || /^sem-shadow-ring(-focus|-invalid|-offset)?$/.test(name)) return \"shadow\";\n if (/^ref-motion-duration(-s)?$/.test(name) || /^sem-motion-(trans|anim)-duration(-slow|-fast)?$/.test(name) || /^sem-motion-anim-[a-z0-9]+-duration$/.test(name)) return \"duration\";\n if (/^ref-motion-easing-/.test(name) || /^sem-motion-(trans|anim)-easing$/.test(name) || /^sem-motion-anim-[a-z0-9]+-easing$/.test(name)) return \"cubicBezier\";\n if (/^(ref|sem)-motion-(anim|trans-property)(-|$)/.test(name)) return \"animation\";\n if (/^(ref|sem)-cursor-/.test(name)) return \"cursor\";\n if (/^ref-border-style-/.test(name) || /^sem-border(-outline)?-style$/.test(name)) return \"borderStyle\";\n if (/^sem-border(-outline(-none)?)?$/.test(name)) return \"fixed\";\n if (/^sem-mode-/.test(name)) return \"keyword\";\n return null;\n}\n"],"names":["GENERIC","entry","family","category","css2","bundled","FONT_CATALOG","fontHref","font","familyNames","value","part","fontsUsed","values","catalog","names","name","f","defaultManifest","json","MAX_LENGTH","SAFE","FUNCTIONS","COLOR_FUNCTIONS","MATH_FUNCTIONS","NUM","UNITS","DIMENSION","NUMBER","DURATION","CUBIC_BEZIER","RATIO","HEX","EASINGS","BORDER_STYLES","ALIGN_ITEMS","ALIGN_CONTENT","JUSTIFY_CONTENT","CURSORS","FONT_WEIGHTS","FAMILY_NAME","NAMED_COLORS","isSingleCall","v","m","depth","i","isVar","checkValue","type","raw","ctx","reduced","bad","_m","a","b","fn","ch","inner","n","isObject","migrateTheme","theme","manifest","retired","references","ref","rename","out","k","scope","s","validateTheme","issues","add","path","message","key","checkScope","where","mode","at","def","target","ThemeError","HEADER","themeHeader","fingerprint","themeFingerprint","css","_a","rule","selector","indent","entries","body","compileTheme","options","_b","migrated","perMode","pontDark","globalLight","globalDark","gD","globalCss","widgetCss","tag","S","D","within","layer","fontValues","owner","doc","element","id","existing","el","applyTheme","style","linkTheme","href","url","link","THEME_SCOPES","TOKEN_ALIASES","r","w","t","l","TOKEN_RETIRED","SHADCN_COLORS","HSL_CHANNELS","importShadcnTheme","skipped","clean","role","PROPERTY_TYPES","STATES","parseComponentToken","rest","state","property","p","stem","systemTokenType"],"mappings":"AAoCA,MAAMA,IAAwC,EAAE,MAAM,cAAc,OAAO,SAAS,MAAM,YAAA,GAEpFC,IAAQ,CAACC,GAAgBC,GAAwBC,GAAcC,IAAU,QAAsB;AAAA,EACnG,QAAAH;AAAA,EACA,UAAAC;AAAA,EACA,OAAO,IAAID,CAAM,MAAMF,EAAQG,CAAQ,CAAC;AAAA,EACxC,MAAAC;AAAA,EACA,GAAIC,IAAU,EAAE,SAAAA,MAAY,CAAA;AAC9B,IAEaC,IAAqC;AAAA,EAChDL,EAAM,SAAS,QAAQ,uCAAuC;AAAA,EAC9DA,EAAM,SAAS,QAAQ,0DAA0D;AAAA,EACjFA,EAAM,UAAU,QAAQ,wCAAwC;AAAA,EAChEA,EAAM,aA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BAA2B,KAAKA,CAAI,IAAU,WAC9C,eAAe,KAAKA,CAAI,KAAK,sDAAsD,KAAKA,CAAI,KAAK,eAAe,KAAKA,CAAI,KAAK,wBAAwB,KAAKA,CAAI,KAAK,uDAAuD,KAAKA,CAAI,KAAK,6BAA6B,KAAKA,CAAI,KAAK,mCAAmC,KAAKA,CAAI,IAAU,cAC1U,wBAAwB,KAAKA,CAAI,IAAU,UAC3C,sBAAsB,KAAKA,CAAI,IAAU,UACzC,mBAAmB,KAAKA,CAAI,IAAU,UACtC,yCAAyC,KAAKA,CAAI,IAAU,eAC5D,6CAA6C,KAAKA,CAAI,IAAU,iBAChE,6CAA6C,KAAKA,CAAI,IAAU,mBAChE,oBAAoB,KAAKA,CAAI,KAAK,gBAAgB,KAAKA,CAAI,IAAU,WACrE,0BAA0B,KAAKA,CAAI,IAAU,eAC7C,8BAA8B,KAAKA,CAAI,IAAU,eACjD,sDAAsD,KAAKA,CAAI,IAAU,cACzE,eAAe,KAAKA,CAAI,KAAK,8CAA8C,KAAKA,CAAI,IAAU,WAC9F,6BAA6B,KAAKA,CAAI,KAAK,mDAAmD,KAAKA,CAAI,KAAK,uCAAuC,KAAKA,CAAI,IAAU,aACtK,sBAAsB,KAAKA,CAAI,KAAK,mCAAmC,KAAKA,CAAI,KAAK,qCAAqC,KAAKA,CAAI,IAAU,gBAC7I,+CAA+C,KAAKA,CAAI,IAAU,cAClE,qBAAqB,KAAKA,CAAI,IAAU,WACxC,qBAAqB,KAAKA,CAAI,KAAK,gCAAgC,KAAKA,CAAI,IAAU,gBACtF,kCAAkC,KAAKA,CAAI,IAAU,UACrD,aAAa,KAAKA,CAAI,IAAU,YAC7B;AACT;"}
package/dist/tokens.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "fingerprint": "cb9e1725e87902b6",
3
+ "fingerprint": "76942ec7f621ea09",
4
4
  "layers": "@layer pont.reset, pont.tokens, pont.base, pont.primitives, pont.kit, pont.theme.preset, pont.theme.brand;",
5
5
  "dark": {
6
6
  "selector": ":root.dark, :root[data-theme=\"dark\"], .dark, [data-theme=\"dark\"]",
@@ -479,6 +479,15 @@
479
479
  ],
480
480
  "source": "styles/tokens/border.css"
481
481
  },
482
+ "sem-border-outline-none": {
483
+ "tier": "sem",
484
+ "type": "fixed",
485
+ "value": "var(--pont-ref-border-style-none)",
486
+ "refs": [
487
+ "ref-border-style-none"
488
+ ],
489
+ "source": "styles/tokens/border.css"
490
+ },
482
491
  "ref-color-red-50": {
483
492
  "tier": "ref",
484
493
  "type": "color",
@@ -4411,9 +4420,72 @@
4411
4420
  "sem-layout-items": {
4412
4421
  "tier": "sem",
4413
4422
  "type": "alignItems",
4414
- "value": "var(--pont-ref-layout-items-start)",
4423
+ "value": "var(--pont-ref-layout-items-stretch)",
4424
+ "refs": [
4425
+ "ref-layout-items-stretch"
4426
+ ],
4427
+ "source": "styles/tokens/layout.css"
4428
+ },
4429
+ "ref-layout-content-normal": {
4430
+ "tier": "ref",
4431
+ "type": "alignContent",
4432
+ "value": "normal",
4433
+ "source": "styles/tokens/layout.css"
4434
+ },
4435
+ "ref-layout-content-center": {
4436
+ "tier": "ref",
4437
+ "type": "alignContent",
4438
+ "value": "center",
4439
+ "source": "styles/tokens/layout.css"
4440
+ },
4441
+ "ref-layout-content-start": {
4442
+ "tier": "ref",
4443
+ "type": "alignContent",
4444
+ "value": "flex-start",
4445
+ "source": "styles/tokens/layout.css"
4446
+ },
4447
+ "ref-layout-content-end": {
4448
+ "tier": "ref",
4449
+ "type": "alignContent",
4450
+ "value": "flex-end",
4451
+ "source": "styles/tokens/layout.css"
4452
+ },
4453
+ "ref-layout-content-between": {
4454
+ "tier": "ref",
4455
+ "type": "alignContent",
4456
+ "value": "space-between",
4457
+ "source": "styles/tokens/layout.css"
4458
+ },
4459
+ "ref-layout-content-around": {
4460
+ "tier": "ref",
4461
+ "type": "alignContent",
4462
+ "value": "space-around",
4463
+ "source": "styles/tokens/layout.css"
4464
+ },
4465
+ "ref-layout-content-evenly": {
4466
+ "tier": "ref",
4467
+ "type": "alignContent",
4468
+ "value": "space-evenly",
4469
+ "source": "styles/tokens/layout.css"
4470
+ },
4471
+ "ref-layout-content-baseline": {
4472
+ "tier": "ref",
4473
+ "type": "alignContent",
4474
+ "value": "baseline",
4475
+ "source": "styles/tokens/layout.css"
4476
+ },
4477
+ "ref-layout-content-stretch": {
4478
+ "tier": "ref",
4479
+ "type": "alignContent",
4480
+ "value": "stretch",
4481
+ "source": "styles/tokens/layout.css"
4482
+ },
4483
+ "sem-layout-content": {
4484
+ "tier": "sem",
4485
+ "type": "alignContent",
4486
+ "value": "var(--pont-ref-layout-content-normal)",
4415
4487
  "refs": [
4416
- "ref-layout-items-start"
4488
+ "ref-layout-content-normal"
4417
4489
  ],
4418
4490
  "source": "styles/tokens/layout.css"
4419
4491
  },
@@ -4480,9 +4552,9 @@
4480
4552
  "sem-layout-justify": {
4481
4553
  "tier": "sem",
4482
4554
  "type": "justifyContent",
4483
- "value": "var(--pont-ref-layout-justify-start)",
4555
+ "value": "var(--pont-ref-layout-justify-normal)",
4484
4556
  "refs": [
4485
- "ref-layout-justify-start"
4557
+ "ref-layout-justify-normal"
4486
4558
  ],
4487
4559
  "source": "styles/tokens/layout.css"
4488
4560
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pontive/pontkit-core",
3
- "version": "1.43.0",
3
+ "version": "1.45.0",
4
4
  "license": "MIT",
5
5
  "description": "A collection of core components for Pontive",
6
6
  "module": "dist/index.mjs",