@hex-core/tokens 1.2.1 → 1.2.2

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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Theme } from '@hex-core/registry';
1
+ import { Theme, SemanticTokenSet, TokenSet, TokenValue } from '@hex-core/registry';
2
2
 
3
3
  /**
4
4
  * Transforms a theme's token set into CSS custom properties.
@@ -117,6 +117,60 @@ declare const midnightTheme: Theme;
117
117
 
118
118
  declare const emberTheme: Theme;
119
119
 
120
+ /**
121
+ * Semantic-token map (added 0.4.0) — the **intent layer** over the raw
122
+ * `defaultTheme` tokens. Each entry references a raw token via flat
123
+ * `{token-name}` syntax (the token name matches the literal key in
124
+ * `defaultTheme.tokens.light` / `.dark`) and adds a `useWhen` sentence
125
+ * describing the UI-element class it's the right choice for.
126
+ *
127
+ * Why this exists: the raw `--color-destructive` ships a value, but an
128
+ * LLM picking a token for "delete button background" has to guess that
129
+ * `destructive` maps to "irreversible action" rather than to "validation
130
+ * error" or "system alert" — those are different design intents that
131
+ * happen to share a hue today. Naming the *intent* lets MCP, Studio, and
132
+ * future LLM workflows reach for the correct token without color-vibe
133
+ * heuristics.
134
+ *
135
+ * Naming convention: `<component>.<state-or-slot>.<role>`. Use
136
+ * `dialog.overlay.bg`, not `dialog-overlay-bg`. The leading segment is
137
+ * the API — MCP groups by it.
138
+ *
139
+ * **Theme-portable.** The map references raw token names by reference
140
+ * (`{destructive}`), so swapping the underlying theme automatically
141
+ * shifts every semantic entry without any per-theme rewrite. Themes that
142
+ * want to redefine semantic intent (e.g. a fintech theme where
143
+ * "destructive" reads more muted) can ship their own `SemanticTokenSet`
144
+ * alongside their `Theme`.
145
+ *
146
+ * **Coverage is intentionally partial.** Common high-leverage intents
147
+ * are named (button, surface, form, feedback, shape, motion); arbitrary
148
+ * combinatorial intents (`table.row.bg-hover`, `badge.intent.warning`)
149
+ * are deferred. Consumers querying an unnamed intent fall through to
150
+ * the raw `defaultTheme` layer.
151
+ */
152
+ declare const defaultSemanticTokens: SemanticTokenSet;
153
+ /**
154
+ * Resolve a `{token-name}` reference against a `TokenSet` and return
155
+ * the underlying `TokenValue`, or `null` if the reference doesn't
156
+ * match a token in the set. Single-hop lookup — no recursion, no
157
+ * fallback chains.
158
+ *
159
+ * Use this when an MCP/Studio surface needs the resolved value
160
+ * (e.g. to render a swatch next to the semantic name) rather than the
161
+ * `{ref}` placeholder string.
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * import { defaultSemanticTokens, defaultTheme, resolveSemanticToken } from "@hex-core/tokens";
166
+ *
167
+ * const entry = defaultSemanticTokens["button.destructive.bg"];
168
+ * const resolved = resolveSemanticToken(entry.value, defaultTheme.tokens.light);
169
+ * // resolved → { value: "0 84% 60%", type: "color" }
170
+ * ```
171
+ */
172
+ declare function resolveSemanticToken(reference: string, tokenSet: TokenSet): TokenValue | null;
173
+
120
174
  declare const themes: Record<string, Theme>;
121
175
  /**
122
176
  * Retrieve a theme by name.
@@ -134,4 +188,4 @@ declare function listThemes(): Array<{
134
188
  description: string;
135
189
  }>;
136
190
 
137
- export { type ScopedRuntimeCssOptions, defaultTheme, emberTheme, generateGlobalsCss, getTheme, listThemes, midnightTheme, themeToCss, themeToFlatJson, themeToScopedRuntimeCss, themeToTailwindConfig, themes };
191
+ export { type ScopedRuntimeCssOptions, defaultSemanticTokens, defaultTheme, emberTheme, generateGlobalsCss, getTheme, listThemes, midnightTheme, resolveSemanticToken, themeToCss, themeToFlatJson, themeToScopedRuntimeCss, themeToTailwindConfig, themes };
package/dist/index.js CHANGED
@@ -376,6 +376,123 @@ var emberTheme = {
376
376
  }
377
377
  };
378
378
 
379
+ // src/semantic.ts
380
+ var defaultSemanticTokens = {
381
+ // ─── Button intents ─────────────────────────────────────────────
382
+ "button.primary.bg": {
383
+ value: "{primary}",
384
+ useWhen: "the single most important action on the screen (one per view)",
385
+ type: "color"
386
+ },
387
+ "button.primary.fg": {
388
+ value: "{primary-foreground}",
389
+ useWhen: "text on a primary button",
390
+ type: "color"
391
+ },
392
+ "button.destructive.bg": {
393
+ value: "{destructive}",
394
+ useWhen: "irreversible actions: delete, archive, deactivate, leave, force-quit",
395
+ type: "color"
396
+ },
397
+ "button.destructive.fg": {
398
+ value: "{destructive-foreground}",
399
+ useWhen: "text on a destructive button",
400
+ type: "color"
401
+ },
402
+ "button.secondary.bg": {
403
+ value: "{secondary}",
404
+ useWhen: "the second-tier action next to a primary button (Cancel, Save Draft)",
405
+ type: "color"
406
+ },
407
+ "button.outline.border": {
408
+ value: "{input}",
409
+ useWhen: "tertiary actions on flat surfaces; signals 'optional'",
410
+ type: "color"
411
+ },
412
+ "button.ghost.bg-hover": {
413
+ value: "{accent}",
414
+ useWhen: "lowest-emphasis action; lives inside a list/toolbar where chrome should disappear",
415
+ type: "color"
416
+ },
417
+ // ─── Surface intents ────────────────────────────────────────────
418
+ "surface.card.bg": {
419
+ value: "{card}",
420
+ useWhen: "a content container raised one level above the page background",
421
+ type: "color"
422
+ },
423
+ "surface.popover.bg": {
424
+ value: "{popover}",
425
+ useWhen: "a transient floating layer (dropdown, tooltip body, hover-card) above all content",
426
+ type: "color"
427
+ },
428
+ "surface.muted.bg": {
429
+ value: "{muted}",
430
+ useWhen: "background of a section that should recede (footer, disabled state, code block)",
431
+ type: "color"
432
+ },
433
+ // ─── Form intents ───────────────────────────────────────────────
434
+ "form.field.border": {
435
+ value: "{input}",
436
+ useWhen: "the resting border of a form input, textarea, or select trigger",
437
+ type: "color"
438
+ },
439
+ "form.field.border-error": {
440
+ value: "{destructive}",
441
+ useWhen: "input validation has failed and the field needs visual correction",
442
+ type: "color"
443
+ },
444
+ "form.field.ring-focus": {
445
+ value: "{ring}",
446
+ useWhen: "the keyboard-focus ring on any focusable form control",
447
+ type: "color"
448
+ },
449
+ "form.message.error-fg": {
450
+ value: "{destructive}",
451
+ useWhen: "inline error text below a failed field",
452
+ type: "color"
453
+ },
454
+ // ─── Feedback intents ───────────────────────────────────────────
455
+ "feedback.success.bg": {
456
+ value: "{primary}",
457
+ useWhen: "success toast / banner background. Note: default theme reuses primary; opinionated themes should split this from primary",
458
+ type: "color"
459
+ },
460
+ "feedback.error.bg": {
461
+ value: "{destructive}",
462
+ useWhen: "error toast / banner background",
463
+ type: "color"
464
+ },
465
+ "feedback.muted.fg": {
466
+ value: "{muted-foreground}",
467
+ useWhen: "secondary copy: helper text, captions, timestamps, empty-state body",
468
+ type: "color"
469
+ },
470
+ // ─── Shape + motion intents ─────────────────────────────────────
471
+ "shape.radius.control": {
472
+ value: "{radius}",
473
+ useWhen: "the corner radius of any interactive control (button, input, badge, chip)",
474
+ type: "radius"
475
+ },
476
+ "motion.duration.control": {
477
+ value: "{duration-normal}",
478
+ useWhen: "hover, press, and focus transitions on interactive controls",
479
+ type: "duration"
480
+ },
481
+ "motion.duration.overlay": {
482
+ value: "{duration-slow}",
483
+ useWhen: "dialog/sheet/drawer enter+exit; longer to telegraph the surface change",
484
+ type: "duration"
485
+ }
486
+ };
487
+ function resolveSemanticToken(reference, tokenSet) {
488
+ const match = /^\{([a-z][a-z0-9-]*)\}$/.exec(reference);
489
+ if (!match) return null;
490
+ const slug = match[1];
491
+ if (!slug) return null;
492
+ const value = tokenSet[slug];
493
+ return value ?? null;
494
+ }
495
+
379
496
  // src/index.ts
380
497
  var themes = {
381
498
  default: defaultTheme,
@@ -393,12 +510,14 @@ function listThemes() {
393
510
  }));
394
511
  }
395
512
  export {
513
+ defaultSemanticTokens,
396
514
  defaultTheme,
397
515
  emberTheme,
398
516
  generateGlobalsCss,
399
517
  getTheme,
400
518
  listThemes,
401
519
  midnightTheme,
520
+ resolveSemanticToken,
402
521
  themeToCss,
403
522
  themeToFlatJson,
404
523
  themeToScopedRuntimeCss,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/transformer.ts","../src/themes/shared.ts","../src/themes/default.ts","../src/themes/midnight.ts","../src/themes/ember.ts","../src/index.ts"],"sourcesContent":["import type { Theme } from \"@hex-core/registry\";\n\ninterface TokenLike {\n\tvalue: string;\n\ttype?: string;\n}\n\n/**\n * Extract the value string from a token-like object or primitive.\n * @param token - A token object with a `value` property, or a primitive\n * @returns The token's value as a string\n */\nfunction extractValue(token: unknown): string {\n\tif (typeof token === \"object\" && token !== null && \"value\" in token) {\n\t\treturn String((token as TokenLike).value);\n\t}\n\treturn String(token);\n}\n\n/**\n * Extract the type annotation from a token-like object.\n * @param token - A token object potentially containing a `type` property\n * @returns The token type string, or undefined if not present\n */\nfunction extractType(token: unknown): string | undefined {\n\tif (typeof token === \"object\" && token !== null && \"type\" in token) {\n\t\treturn (token as TokenLike).type;\n\t}\n\treturn undefined;\n}\n\n/**\n * Transforms a theme's token set into CSS custom properties.\n *\n * Output uses the **raw `--<key>` namespace** — value verbatim, no `hsl()`\n * wrapper, no `--color-` prefix. Colors land as triplets (e.g. `0 0% 100%`)\n * to enable alpha composition like `hsl(var(--background) / 0.5)`. Consumers\n * on Tailwind v4 also need a `@theme` block in the `--color-<key>` namespace;\n * see the \"CSS variable namespaces\" section in ./README.md for the bridge.\n *\n * @param theme - The theme to transform\n * @returns A CSS string with `:root` and `.dark` custom property declarations inside a `@layer base` block\n */\nexport function themeToCss(theme: Theme): string {\n\tconst lines: string[] = [];\n\n\tlines.push(\"@layer base {\");\n\tlines.push(\" :root {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\" }\");\n\tlines.push(\"\");\n\tlines.push(\" .dark {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.dark)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\" }\");\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Transforms a theme into a flat JSON map for AI consumption.\n * This is the most token-efficient format for LLMs.\n * @param theme - The theme to transform\n * @param mode - Color mode to extract tokens for (defaults to \"light\")\n * @returns A flat record mapping CSS variable names to their values\n */\nexport function themeToFlatJson(\n\ttheme: Theme,\n\tmode: \"light\" | \"dark\" = \"light\",\n): Record<string, string> {\n\tconst flat: Record<string, string> = {};\n\tconst tokens = mode === \"light\" ? theme.tokens.light : theme.tokens.dark;\n\n\tfor (const [key, token] of Object.entries(tokens)) {\n\t\tflat[`--${key}`] = extractValue(token);\n\t}\n\n\treturn flat;\n}\n\n/**\n * Transforms a theme into Tailwind CSS config extension.\n * @param theme - The theme to transform\n * @returns An object with maps for colors, borderRadius, spacing, fontSize,\n * transitionDuration, and height — suitable for Tailwind's `theme.extend`.\n */\nexport function themeToTailwindConfig(theme: Theme): Record<string, Record<string, string>> {\n\tconst colors: Record<string, string> = {};\n\tconst borderRadius: Record<string, string> = {};\n\tconst spacing: Record<string, string> = {};\n\tconst fontSize: Record<string, string> = {};\n\tconst transitionDuration: Record<string, string> = {};\n\tconst height: Record<string, string> = {};\n\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tconst type = extractType(token);\n\t\tif (!type) continue;\n\n\t\tif (type === \"color\") {\n\t\t\tcolors[key] = `hsl(var(--${key}))`;\n\t\t} else if (type === \"radius\") {\n\t\t\tborderRadius[key] = `var(--${key})`;\n\t\t} else if (type === \"spacing\") {\n\t\t\t// Strip \"space-\" / \"gap-\" prefix for cleaner Tailwind usage (e.g. `p-4` vs `p-space-4`).\n\t\t\tconst stripped = key.replace(/^(space-|gap-)/, \"\");\n\t\t\tspacing[stripped] = `var(--${key})`;\n\t\t} else if (type === \"dimension\") {\n\t\t\t// control-height-md → height.control-md\n\t\t\theight[key.replace(/^control-/, \"\")] = `var(--${key})`;\n\t\t} else if (type === \"font\") {\n\t\t\tfontSize[key.replace(/^text-/, \"\")] = `var(--${key})`;\n\t\t} else if (type === \"duration\") {\n\t\t\ttransitionDuration[key.replace(/^duration-/, \"\")] = `var(--${key})`;\n\t\t}\n\t}\n\n\treturn { colors, borderRadius, spacing, fontSize, transitionDuration, height };\n}\n\n/**\n * Options for {@link themeToScopedRuntimeCss}.\n */\nexport interface ScopedRuntimeCssOptions {\n\t/**\n\t * CSS selector that the generated rule targets. Defaults to `\":root\"`.\n\t *\n\t * Pass a class selector (e.g. `\".studio-canvas-active\"` or `\".theme-vivid\"`)\n\t * to scope the override to a subtree — useful when an app needs to flip\n\t * themes at runtime without round-tripping through `globals.css`. The vars\n\t * cascade to every descendant of an element matching the selector, so the\n\t * subtree's Tailwind utilities resolve against the new values automatically.\n\t */\n\tscope?: string;\n\t/**\n\t * Which palette to render. Defaults to `\"light\"`. Pass `\"dark\"` to emit the\n\t * theme's dark token set (typically used in combination with a `.dark` scope\n\t * applied by the consumer's theme provider).\n\t */\n\tmode?: \"light\" | \"dark\";\n}\n\n/**\n * Render a theme as scoped runtime CSS for the Tailwind v4 `--color-*` namespace.\n *\n * Unlike {@link themeToCss} (which emits at `:root` for static `globals.css`),\n * this targets a configurable selector so the override applies only to that\n * subtree. The output emits **both** namespaces so the result drops in cleanly\n * regardless of how the consumer's `globals.css` is wired:\n *\n * - `--<key>: <value>;` (raw triplet) — preserves alpha-composition utilities\n * like `bg-background/50` that read the variable as bare `H S% L%`.\n * - `--color-<key>: hsl(<value>);` (full `hsl()` string) — feeds Tailwind v4's\n * `@theme` block so generated utilities like `bg-background` / `text-primary`\n * resolve against the override.\n *\n * Non-color tokens (radii, durations, spacing, font sizes) only emit the raw\n * `--<key>` form since they don't go through `@theme`'s color machinery.\n *\n * @param theme - The theme to render\n * @param options - Scope selector + light/dark mode (see {@link ScopedRuntimeCssOptions}).\n * @returns A CSS string with one rule wrapping all the token declarations.\n *\n * @example\n * ```ts\n * import { defaultTheme, themeToScopedRuntimeCss } from \"@hex-core/tokens\";\n *\n * // Default: emits at :root for the light palette.\n * const css = themeToScopedRuntimeCss(defaultTheme);\n *\n * // Subtree-scoped runtime override (e.g. a theme studio's canvas):\n * const scoped = themeToScopedRuntimeCss(defaultTheme, {\n * scope: \".studio-canvas-active\",\n * mode: \"light\",\n * });\n *\n * // Inject via a <style> tag:\n * // <style dangerouslySetInnerHTML={{ __html: scoped }} />\n * ```\n */\nexport function themeToScopedRuntimeCss(\n\ttheme: Theme,\n\toptions: ScopedRuntimeCssOptions = {},\n): string {\n\tconst { scope = \":root\", mode = \"light\" } = options;\n\tconst tokens = mode === \"light\" ? theme.tokens.light : theme.tokens.dark;\n\n\tconst lines: string[] = [];\n\tlines.push(`${scope} {`);\n\tfor (const [key, token] of Object.entries(tokens)) {\n\t\tconst value = extractValue(token);\n\t\tconst type = extractType(token);\n\t\t// Always emit the raw `--<key>` form. For colors, also emit the\n\t\t// Tailwind v4 `--color-<key>` bridge wrapped in hsl() so `@theme`\n\t\t// blocks resolve correctly without the consumer hand-authoring the\n\t\t// bridge layer.\n\t\tlines.push(` --${key}: ${value};`);\n\t\tif (type === \"color\") {\n\t\t\tlines.push(` --color-${key}: hsl(${value});`);\n\t\t}\n\t}\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Options for {@link generateGlobalsCss}.\n */\nexport interface GenerateGlobalsCssOptions {\n\t/**\n\t * Tailwind major to target.\n\t * - `\"v3\"` (default, backward compatible): emits `@tailwind base/components/utilities`\n\t * plus `@layer base { :root {} .dark {} }` blocks. Pair with a `tailwind.config.ts`\n\t * that maps the raw `--<key>` CSS variables to color/radius utilities.\n\t * - `\"v4\"`: emits `@import \"tailwindcss\"` + `@theme { --color-<key>: hsl(...) }` so\n\t * utilities like `bg-background` resolve directly. No `tailwind.config.ts` needed.\n\t */\n\ttarget?: \"v3\" | \"v4\";\n}\n\n/**\n * Generates a complete globals.css content with theme tokens and Tailwind directives.\n *\n * @param theme - The theme to generate CSS for\n * @param options - Output target (Tailwind v3 vs v4). Defaults to v3 for backward compatibility.\n * @returns A full globals.css string ready to drop into `app/globals.css`.\n */\nexport function generateGlobalsCss(theme: Theme, options: GenerateGlobalsCssOptions = {}): string {\n\tconst { target = \"v3\" } = options;\n\tif (target === \"v4\") return generateGlobalsCssV4(theme);\n\treturn generateGlobalsCssV3(theme);\n}\n\nfunction generateGlobalsCssV3(theme: Theme): string {\n\tconst lines: string[] = [];\n\n\tlines.push(\"@tailwind base;\");\n\tlines.push(\"@tailwind components;\");\n\tlines.push(\"@tailwind utilities;\");\n\tlines.push(\"\");\n\tlines.push(themeToCss(theme));\n\tlines.push(\"\");\n\tlines.push(\"@layer base {\");\n\tlines.push(\" * {\");\n\tlines.push(\" @apply border-border;\");\n\tlines.push(\" }\");\n\tlines.push(\" body {\");\n\tlines.push(\" @apply bg-background text-foreground;\");\n\tlines.push(\" }\");\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction generateGlobalsCssV4(theme: Theme): string {\n\tconst lines: string[] = [];\n\n\tlines.push(`@import \"tailwindcss\";`);\n\t// tw-animate-css ports tailwindcss-animate's animate-in/out, fade-*, slide-*,\n\t// zoom-* utilities to v4 as a pure CSS import. Every Hex component that\n\t// transitions (dialog, dropdown-menu, popover, accordion, ...) depends on\n\t// these classes, so it's not optional.\n\tlines.push(`@import \"tw-animate-css\";`);\n\tlines.push(\"\");\n\tlines.push(\"/* Class-based dark mode — set `.dark` on <html> via next-themes or your own provider. */\");\n\tlines.push(\"@custom-variant dark (&:is(.dark *));\");\n\tlines.push(\"\");\n\t// Bridge pattern: raw `H S% L%` triplets live in :root / .dark, and the\n\t// @theme inline block aliases each `--color-<key>` to `hsl(var(--<key>))`.\n\t// This shape is deliberate:\n\t// 1. Keeps the raw `--<key>` triplet that `hex theme edit` searches for —\n\t// direct values inside @theme would silently break that command.\n\t// 2. Keeps alpha-modifier utilities (bg-primary/50) cheap because the\n\t// `<H S% L%>` triplet composes via Tailwind v4's color-mix() machinery\n\t// with no per-utility re-derivation.\n\tlines.push(\"/*\");\n\tlines.push(\" * Raw token triplets (H S% L%) — the source of truth that `hex theme edit`\");\n\tlines.push(\" * mutates, and that the @theme inline block below aliases into Tailwind's\");\n\tlines.push(\" * --color-<key> namespace.\");\n\tlines.push(\" */\");\n\tlines.push(\":root {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\".dark {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.dark)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\"/*\");\n\tlines.push(\" * Tailwind v4 namespace bridge — generated utilities like bg-background\");\n\tlines.push(\" * resolve var(--color-background) here, which in turn reads var(--background)\");\n\tlines.push(\" * from the blocks above.\");\n\tlines.push(\" */\");\n\tlines.push(\"@theme inline {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tif (extractType(token) !== \"color\") continue;\n\t\tlines.push(` --color-${key}: hsl(var(--${key}));`);\n\t}\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\"body {\");\n\tlines.push(\" background: var(--color-background);\");\n\tlines.push(\" color: var(--color-foreground);\");\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\"* {\");\n\tlines.push(\" border-color: var(--color-border);\");\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n","import type { TokenValue } from \"@hex-core/registry\";\n\n/**\n * Layout + typography tokens shared across all themes. Colors/radius vary per\n * theme; these do not (yet). Spread into both light and dark dicts of every\n * Theme so consumers can read any token regardless of color mode.\n */\nexport const sharedTokens: Record<string, TokenValue> = {\n\t// ─── Spacing scale (rem) ───\n\t\"space-1\": { value: \"0.25rem\", type: \"spacing\" },\n\t\"space-2\": { value: \"0.5rem\", type: \"spacing\" },\n\t\"space-3\": { value: \"0.75rem\", type: \"spacing\" },\n\t\"space-4\": { value: \"1rem\", type: \"spacing\" },\n\t\"space-6\": { value: \"1.5rem\", type: \"spacing\" },\n\t\"space-8\": { value: \"2rem\", type: \"spacing\" },\n\t\"space-12\": { value: \"3rem\", type: \"spacing\" },\n\t\"space-16\": { value: \"4rem\", type: \"spacing\" },\n\n\t// ─── Gap presets (for layout primitives) ───\n\t\"gap-xs\": { value: \"0.25rem\", type: \"spacing\" },\n\t\"gap-sm\": { value: \"0.5rem\", type: \"spacing\" },\n\t\"gap-md\": { value: \"1rem\", type: \"spacing\" },\n\t\"gap-lg\": { value: \"1.5rem\", type: \"spacing\" },\n\t\"gap-xl\": { value: \"2rem\", type: \"spacing\" },\n\n\t// ─── Container max-widths (for prose / layout primitives) ───\n\t\"container-sm\": { value: \"33rem\", type: \"dimension\" },\n\t\"container-md\": { value: \"40rem\", type: \"dimension\" },\n\t\"container-lg\": { value: \"50rem\", type: \"dimension\" },\n\t\"container-xl\": { value: \"66rem\", type: \"dimension\" },\n\n\t// ─── Control heights (interactive elements) ───\n\t\"control-height-sm\": { value: \"2.25rem\", type: \"dimension\" },\n\t\"control-height-md\": { value: \"2.5rem\", type: \"dimension\" },\n\t\"control-height-lg\": { value: \"2.75rem\", type: \"dimension\" },\n\n\t// ─── Typography scale ───\n\t\"text-xs\": { value: \"0.75rem\", type: \"font\" },\n\t\"text-sm\": { value: \"0.875rem\", type: \"font\" },\n\t\"text-base\": { value: \"1rem\", type: \"font\" },\n\t\"text-lg\": { value: \"1.125rem\", type: \"font\" },\n\t\"text-xl\": { value: \"1.25rem\", type: \"font\" },\n\t\"text-2xl\": { value: \"1.5rem\", type: \"font\" },\n\t\"text-3xl\": { value: \"1.875rem\", type: \"font\" },\n\n\t// ─── Motion ───\n\t\"duration-fast\": { value: \"150ms\", type: \"duration\" },\n\t\"duration-normal\": { value: \"200ms\", type: \"duration\" },\n\t\"duration-slow\": { value: \"300ms\", type: \"duration\" },\n};\n","import type { Theme } from \"@hex-core/registry\";\nimport { sharedTokens } from \"./shared.js\";\n\nexport const defaultTheme: Theme = {\n\tname: \"default\",\n\tdisplayName: \"Default\",\n\tdescription:\n\t\t\"A refined, neutral theme with subtle depth. Professional and versatile with clean lines and balanced contrast.\",\n\ttokens: {\n\t\tlight: {\n\t\t\tbackground: { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tforeground: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tcard: { value: \"0 0% 100%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tpopover: { value: \"0 0% 100%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tprimary: { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\t// Default zinc neutral palette. --secondary, --border, and --input all\n\t\t\t// sit at near-white values that fail strict WCAG 2.1 SC 1.4.11 (3:1)\n\t\t\t// against --card (white) — the L=58% strict-3:1 fix shipped in v1.0.2\n\t\t\t// produced a visually heavy layout (mid-gray borders + dark Secondary\n\t\t\t// fills) and was reverted in v1.1.x. The fill/border isn't the only\n\t\t\t// perceivable cue: high-contrast foreground text on filled controls\n\t\t\t// (~16:1) and shadow elevation on framed surfaces (Card, Popover,\n\t\t\t// Dialog) carry the boundary identification.\n\t\t\tsecondary: { value: \"240 4.8% 95.9%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tmuted: { value: \"240 4.8% 95.9%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"240 4% 38%\", type: \"color\" },\n\t\t\taccent: { value: \"240 4.8% 95.9%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 72% 45%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tborder: { value: \"240 5.9% 90%\", type: \"color\" },\n\t\t\tinput: { value: \"240 5.9% 90%\", type: \"color\" },\n\t\t\tring: { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tradius: { value: \"0.625rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t\tdark: {\n\t\t\tbackground: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tforeground: { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tcard: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tpopover: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tprimary: { value: \"0 0% 98%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tsecondary: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tmuted: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"240 5% 70%\", type: \"color\" },\n\t\t\taccent: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 75% 65%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 75% 15%\", type: \"color\" },\n\t\t\tborder: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\tinput: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\tring: { value: \"240 4.9% 83.9%\", type: \"color\" },\n\t\t\tradius: { value: \"0.625rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t},\n};\n","import type { Theme } from \"@hex-core/registry\";\nimport { sharedTokens } from \"./shared.js\";\n\nexport const midnightTheme: Theme = {\n\tname: \"midnight\",\n\tdisplayName: \"Midnight\",\n\tdescription:\n\t\t\"A dark-first theme with deep blues and electric accents. Built for focus-heavy interfaces and developer tools.\",\n\ttokens: {\n\t\tlight: {\n\t\t\tbackground: { value: \"220 23% 97%\", type: \"color\" },\n\t\t\tforeground: { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tcard: { value: \"220 23% 99%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tpopover: { value: \"220 23% 99%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tprimary: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"220 14% 92%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tmuted: { value: \"220 14% 94%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"220 9% 38%\", type: \"color\" },\n\t\t\taccent: { value: \"220 14% 92%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 72% 45%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tborder: { value: \"220 13% 88%\", type: \"color\" },\n\t\t\tinput: { value: \"220 13% 88%\", type: \"color\" },\n\t\t\tring: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\tradius: { value: \"0.5rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t\tdark: {\n\t\t\tbackground: { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tforeground: { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tcard: { value: \"224 50% 7%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tpopover: { value: \"224 50% 7%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tprimary: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"224 30% 13%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tmuted: { value: \"224 30% 13%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"220 9% 70%\", type: \"color\" },\n\t\t\taccent: { value: \"224 30% 15%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\t/*\n\t\t\t * Destructive in dark mode doubles as text on near-black surfaces\n\t\t\t * (alerts, error helper text). A lighter coral-red gives ~7:1 on\n\t\t\t * background and ~5:1 on the same color when paired with the dark\n\t\t\t * destructive-foreground for button bg + label combos. Same tuning\n\t\t\t * as default.ts; intentional shadcn-divergence in service of WCAG AA.\n\t\t\t */\n\t\t\tdestructive: { value: \"0 75% 65%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 75% 15%\", type: \"color\" },\n\t\t\tborder: { value: \"224 20% 14%\", type: \"color\" },\n\t\t\tinput: { value: \"224 20% 14%\", type: \"color\" },\n\t\t\tring: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\tradius: { value: \"0.5rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t},\n};\n","import type { Theme } from \"@hex-core/registry\";\nimport { sharedTokens } from \"./shared.js\";\n\nexport const emberTheme: Theme = {\n\tname: \"ember\",\n\tdisplayName: \"Ember\",\n\tdescription:\n\t\t\"A warm theme with terracotta and amber tones. Inviting and distinctive, ideal for creative and lifestyle applications.\",\n\ttokens: {\n\t\tlight: {\n\t\t\tbackground: { value: \"30 33% 98%\", type: \"color\" },\n\t\t\tforeground: { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tcard: { value: \"30 33% 99%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tpopover: { value: \"30 33% 99%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tprimary: { value: \"16 65% 48%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"30 20% 92%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tmuted: { value: \"30 20% 94%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"20 6% 38%\", type: \"color\" },\n\t\t\taccent: { value: \"36 60% 90%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 72% 45%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tborder: { value: \"30 15% 87%\", type: \"color\" },\n\t\t\tinput: { value: \"30 15% 87%\", type: \"color\" },\n\t\t\tring: { value: \"16 65% 48%\", type: \"color\" },\n\t\t\tradius: { value: \"0.75rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t\tdark: {\n\t\t\tbackground: { value: \"20 14% 6%\", type: \"color\" },\n\t\t\tforeground: { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tcard: { value: \"20 14% 8%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tpopover: { value: \"20 14% 8%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tprimary: { value: \"16 65% 52%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"20 12% 14%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tmuted: { value: \"20 12% 14%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"20 6% 70%\", type: \"color\" },\n\t\t\taccent: { value: \"20 20% 16%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\t/*\n\t\t\t * Destructive in dark mode doubles as text on near-black surfaces\n\t\t\t * (alerts, error helper text). A lighter coral-red gives ~7:1 on\n\t\t\t * background and ~5:1 on the same color when paired with the dark\n\t\t\t * destructive-foreground. Same tuning as default.ts.\n\t\t\t */\n\t\t\tdestructive: { value: \"0 75% 65%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 75% 15%\", type: \"color\" },\n\t\t\tborder: { value: \"20 10% 16%\", type: \"color\" },\n\t\t\tinput: { value: \"20 10% 16%\", type: \"color\" },\n\t\t\tring: { value: \"16 65% 52%\", type: \"color\" },\n\t\t\tradius: { value: \"0.75rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t},\n};\n","export {\n\tgenerateGlobalsCss,\n\ttype ScopedRuntimeCssOptions,\n\tthemeToCss,\n\tthemeToFlatJson,\n\tthemeToScopedRuntimeCss,\n\tthemeToTailwindConfig,\n} from \"./transformer.js\";\nexport { defaultTheme } from \"./themes/default.js\";\nexport { midnightTheme } from \"./themes/midnight.js\";\nexport { emberTheme } from \"./themes/ember.js\";\n\nimport type { Theme } from \"@hex-core/registry\";\nimport { defaultTheme } from \"./themes/default.js\";\nimport { emberTheme } from \"./themes/ember.js\";\nimport { midnightTheme } from \"./themes/midnight.js\";\n\nexport const themes: Record<string, Theme> = {\n\tdefault: defaultTheme,\n\tmidnight: midnightTheme,\n\tember: emberTheme,\n};\n\n/**\n * Retrieve a theme by name.\n * @param name - The theme identifier (e.g. \"default\", \"midnight\", \"ember\")\n * @returns The matching Theme object, or undefined if not found\n */\nexport function getTheme(name: string): Theme | undefined {\n\treturn themes[name];\n}\n\n/**\n * List all available themes with their display metadata.\n * @returns An array of theme summaries containing name, displayName, and description\n */\nexport function listThemes(): Array<{ name: string; displayName: string; description: string }> {\n\treturn Object.values(themes).map((t) => ({\n\t\tname: t.name,\n\t\tdisplayName: t.displayName,\n\t\tdescription: t.description,\n\t}));\n}\n"],"mappings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M,QAAQ;AAAA,MAC1D,WAAW,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAChD,wBAAwB,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAC7D,OAAO,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAC5C,oBAAoB,EAAE,OAAO,aAAa,MAAM,QAAQ;AAAA,MACxD,QAAQ,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAC7C,qBAAqB,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAO1D,aAAa,EAAE,OAAO,aAAa,MAAM,QAAQ;AAAA,MACjD,0BAA0B,EAAE,OAAO,aAAa,MAAM,QAAQ;AAAA,MAC9D,QAAQ,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAC7C,OAAO,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAC5C,MAAM,EAAE,OAAO,cAAc,MAAM,QAAQ;AAAA,MAC3C,QAAQ,EAAE,OAAO,WAAW,MAAM,SAAS;AAAA,MAC3C,GAAG;AAAA,IACJ;AAAA,EACD;AACD;;;AC7CO,IAAM,SAAgC;AAAA,EAC5C,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AACR;AAOO,SAAS,SAAS,MAAiC;AACzD,SAAO,OAAO,IAAI;AACnB;AAMO,SAAS,aAAgF;AAC/F,SAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAC,OAAO;AAAA,IACxC,MAAM,EAAE;AAAA,IACR,aAAa,EAAE;AAAA,IACf,aAAa,EAAE;AAAA,EAChB,EAAE;AACH;","names":[]}
1
+ {"version":3,"sources":["../src/transformer.ts","../src/themes/shared.ts","../src/themes/default.ts","../src/themes/midnight.ts","../src/themes/ember.ts","../src/semantic.ts","../src/index.ts"],"sourcesContent":["import type { Theme } from \"@hex-core/registry\";\n\ninterface TokenLike {\n\tvalue: string;\n\ttype?: string;\n}\n\n/**\n * Extract the value string from a token-like object or primitive.\n * @param token - A token object with a `value` property, or a primitive\n * @returns The token's value as a string\n */\nfunction extractValue(token: unknown): string {\n\tif (typeof token === \"object\" && token !== null && \"value\" in token) {\n\t\treturn String((token as TokenLike).value);\n\t}\n\treturn String(token);\n}\n\n/**\n * Extract the type annotation from a token-like object.\n * @param token - A token object potentially containing a `type` property\n * @returns The token type string, or undefined if not present\n */\nfunction extractType(token: unknown): string | undefined {\n\tif (typeof token === \"object\" && token !== null && \"type\" in token) {\n\t\treturn (token as TokenLike).type;\n\t}\n\treturn undefined;\n}\n\n/**\n * Transforms a theme's token set into CSS custom properties.\n *\n * Output uses the **raw `--<key>` namespace** — value verbatim, no `hsl()`\n * wrapper, no `--color-` prefix. Colors land as triplets (e.g. `0 0% 100%`)\n * to enable alpha composition like `hsl(var(--background) / 0.5)`. Consumers\n * on Tailwind v4 also need a `@theme` block in the `--color-<key>` namespace;\n * see the \"CSS variable namespaces\" section in ./README.md for the bridge.\n *\n * @param theme - The theme to transform\n * @returns A CSS string with `:root` and `.dark` custom property declarations inside a `@layer base` block\n */\nexport function themeToCss(theme: Theme): string {\n\tconst lines: string[] = [];\n\n\tlines.push(\"@layer base {\");\n\tlines.push(\" :root {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\" }\");\n\tlines.push(\"\");\n\tlines.push(\" .dark {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.dark)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\" }\");\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Transforms a theme into a flat JSON map for AI consumption.\n * This is the most token-efficient format for LLMs.\n * @param theme - The theme to transform\n * @param mode - Color mode to extract tokens for (defaults to \"light\")\n * @returns A flat record mapping CSS variable names to their values\n */\nexport function themeToFlatJson(\n\ttheme: Theme,\n\tmode: \"light\" | \"dark\" = \"light\",\n): Record<string, string> {\n\tconst flat: Record<string, string> = {};\n\tconst tokens = mode === \"light\" ? theme.tokens.light : theme.tokens.dark;\n\n\tfor (const [key, token] of Object.entries(tokens)) {\n\t\tflat[`--${key}`] = extractValue(token);\n\t}\n\n\treturn flat;\n}\n\n/**\n * Transforms a theme into Tailwind CSS config extension.\n * @param theme - The theme to transform\n * @returns An object with maps for colors, borderRadius, spacing, fontSize,\n * transitionDuration, and height — suitable for Tailwind's `theme.extend`.\n */\nexport function themeToTailwindConfig(theme: Theme): Record<string, Record<string, string>> {\n\tconst colors: Record<string, string> = {};\n\tconst borderRadius: Record<string, string> = {};\n\tconst spacing: Record<string, string> = {};\n\tconst fontSize: Record<string, string> = {};\n\tconst transitionDuration: Record<string, string> = {};\n\tconst height: Record<string, string> = {};\n\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tconst type = extractType(token);\n\t\tif (!type) continue;\n\n\t\tif (type === \"color\") {\n\t\t\tcolors[key] = `hsl(var(--${key}))`;\n\t\t} else if (type === \"radius\") {\n\t\t\tborderRadius[key] = `var(--${key})`;\n\t\t} else if (type === \"spacing\") {\n\t\t\t// Strip \"space-\" / \"gap-\" prefix for cleaner Tailwind usage (e.g. `p-4` vs `p-space-4`).\n\t\t\tconst stripped = key.replace(/^(space-|gap-)/, \"\");\n\t\t\tspacing[stripped] = `var(--${key})`;\n\t\t} else if (type === \"dimension\") {\n\t\t\t// control-height-md → height.control-md\n\t\t\theight[key.replace(/^control-/, \"\")] = `var(--${key})`;\n\t\t} else if (type === \"font\") {\n\t\t\tfontSize[key.replace(/^text-/, \"\")] = `var(--${key})`;\n\t\t} else if (type === \"duration\") {\n\t\t\ttransitionDuration[key.replace(/^duration-/, \"\")] = `var(--${key})`;\n\t\t}\n\t}\n\n\treturn { colors, borderRadius, spacing, fontSize, transitionDuration, height };\n}\n\n/**\n * Options for {@link themeToScopedRuntimeCss}.\n */\nexport interface ScopedRuntimeCssOptions {\n\t/**\n\t * CSS selector that the generated rule targets. Defaults to `\":root\"`.\n\t *\n\t * Pass a class selector (e.g. `\".studio-canvas-active\"` or `\".theme-vivid\"`)\n\t * to scope the override to a subtree — useful when an app needs to flip\n\t * themes at runtime without round-tripping through `globals.css`. The vars\n\t * cascade to every descendant of an element matching the selector, so the\n\t * subtree's Tailwind utilities resolve against the new values automatically.\n\t */\n\tscope?: string;\n\t/**\n\t * Which palette to render. Defaults to `\"light\"`. Pass `\"dark\"` to emit the\n\t * theme's dark token set (typically used in combination with a `.dark` scope\n\t * applied by the consumer's theme provider).\n\t */\n\tmode?: \"light\" | \"dark\";\n}\n\n/**\n * Render a theme as scoped runtime CSS for the Tailwind v4 `--color-*` namespace.\n *\n * Unlike {@link themeToCss} (which emits at `:root` for static `globals.css`),\n * this targets a configurable selector so the override applies only to that\n * subtree. The output emits **both** namespaces so the result drops in cleanly\n * regardless of how the consumer's `globals.css` is wired:\n *\n * - `--<key>: <value>;` (raw triplet) — preserves alpha-composition utilities\n * like `bg-background/50` that read the variable as bare `H S% L%`.\n * - `--color-<key>: hsl(<value>);` (full `hsl()` string) — feeds Tailwind v4's\n * `@theme` block so generated utilities like `bg-background` / `text-primary`\n * resolve against the override.\n *\n * Non-color tokens (radii, durations, spacing, font sizes) only emit the raw\n * `--<key>` form since they don't go through `@theme`'s color machinery.\n *\n * @param theme - The theme to render\n * @param options - Scope selector + light/dark mode (see {@link ScopedRuntimeCssOptions}).\n * @returns A CSS string with one rule wrapping all the token declarations.\n *\n * @example\n * ```ts\n * import { defaultTheme, themeToScopedRuntimeCss } from \"@hex-core/tokens\";\n *\n * // Default: emits at :root for the light palette.\n * const css = themeToScopedRuntimeCss(defaultTheme);\n *\n * // Subtree-scoped runtime override (e.g. a theme studio's canvas):\n * const scoped = themeToScopedRuntimeCss(defaultTheme, {\n * scope: \".studio-canvas-active\",\n * mode: \"light\",\n * });\n *\n * // Inject via a <style> tag:\n * // <style dangerouslySetInnerHTML={{ __html: scoped }} />\n * ```\n */\nexport function themeToScopedRuntimeCss(\n\ttheme: Theme,\n\toptions: ScopedRuntimeCssOptions = {},\n): string {\n\tconst { scope = \":root\", mode = \"light\" } = options;\n\tconst tokens = mode === \"light\" ? theme.tokens.light : theme.tokens.dark;\n\n\tconst lines: string[] = [];\n\tlines.push(`${scope} {`);\n\tfor (const [key, token] of Object.entries(tokens)) {\n\t\tconst value = extractValue(token);\n\t\tconst type = extractType(token);\n\t\t// Always emit the raw `--<key>` form. For colors, also emit the\n\t\t// Tailwind v4 `--color-<key>` bridge wrapped in hsl() so `@theme`\n\t\t// blocks resolve correctly without the consumer hand-authoring the\n\t\t// bridge layer.\n\t\tlines.push(` --${key}: ${value};`);\n\t\tif (type === \"color\") {\n\t\t\tlines.push(` --color-${key}: hsl(${value});`);\n\t\t}\n\t}\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Options for {@link generateGlobalsCss}.\n */\nexport interface GenerateGlobalsCssOptions {\n\t/**\n\t * Tailwind major to target.\n\t * - `\"v3\"` (default, backward compatible): emits `@tailwind base/components/utilities`\n\t * plus `@layer base { :root {} .dark {} }` blocks. Pair with a `tailwind.config.ts`\n\t * that maps the raw `--<key>` CSS variables to color/radius utilities.\n\t * - `\"v4\"`: emits `@import \"tailwindcss\"` + `@theme { --color-<key>: hsl(...) }` so\n\t * utilities like `bg-background` resolve directly. No `tailwind.config.ts` needed.\n\t */\n\ttarget?: \"v3\" | \"v4\";\n}\n\n/**\n * Generates a complete globals.css content with theme tokens and Tailwind directives.\n *\n * @param theme - The theme to generate CSS for\n * @param options - Output target (Tailwind v3 vs v4). Defaults to v3 for backward compatibility.\n * @returns A full globals.css string ready to drop into `app/globals.css`.\n */\nexport function generateGlobalsCss(theme: Theme, options: GenerateGlobalsCssOptions = {}): string {\n\tconst { target = \"v3\" } = options;\n\tif (target === \"v4\") return generateGlobalsCssV4(theme);\n\treturn generateGlobalsCssV3(theme);\n}\n\nfunction generateGlobalsCssV3(theme: Theme): string {\n\tconst lines: string[] = [];\n\n\tlines.push(\"@tailwind base;\");\n\tlines.push(\"@tailwind components;\");\n\tlines.push(\"@tailwind utilities;\");\n\tlines.push(\"\");\n\tlines.push(themeToCss(theme));\n\tlines.push(\"\");\n\tlines.push(\"@layer base {\");\n\tlines.push(\" * {\");\n\tlines.push(\" @apply border-border;\");\n\tlines.push(\" }\");\n\tlines.push(\" body {\");\n\tlines.push(\" @apply bg-background text-foreground;\");\n\tlines.push(\" }\");\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction generateGlobalsCssV4(theme: Theme): string {\n\tconst lines: string[] = [];\n\n\tlines.push(`@import \"tailwindcss\";`);\n\t// tw-animate-css ports tailwindcss-animate's animate-in/out, fade-*, slide-*,\n\t// zoom-* utilities to v4 as a pure CSS import. Every Hex component that\n\t// transitions (dialog, dropdown-menu, popover, accordion, ...) depends on\n\t// these classes, so it's not optional.\n\tlines.push(`@import \"tw-animate-css\";`);\n\tlines.push(\"\");\n\tlines.push(\"/* Class-based dark mode — set `.dark` on <html> via next-themes or your own provider. */\");\n\tlines.push(\"@custom-variant dark (&:is(.dark *));\");\n\tlines.push(\"\");\n\t// Bridge pattern: raw `H S% L%` triplets live in :root / .dark, and the\n\t// @theme inline block aliases each `--color-<key>` to `hsl(var(--<key>))`.\n\t// This shape is deliberate:\n\t// 1. Keeps the raw `--<key>` triplet that `hex theme edit` searches for —\n\t// direct values inside @theme would silently break that command.\n\t// 2. Keeps alpha-modifier utilities (bg-primary/50) cheap because the\n\t// `<H S% L%>` triplet composes via Tailwind v4's color-mix() machinery\n\t// with no per-utility re-derivation.\n\tlines.push(\"/*\");\n\tlines.push(\" * Raw token triplets (H S% L%) — the source of truth that `hex theme edit`\");\n\tlines.push(\" * mutates, and that the @theme inline block below aliases into Tailwind's\");\n\tlines.push(\" * --color-<key> namespace.\");\n\tlines.push(\" */\");\n\tlines.push(\":root {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\".dark {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.dark)) {\n\t\tlines.push(` --${key}: ${extractValue(token)};`);\n\t}\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\"/*\");\n\tlines.push(\" * Tailwind v4 namespace bridge — generated utilities like bg-background\");\n\tlines.push(\" * resolve var(--color-background) here, which in turn reads var(--background)\");\n\tlines.push(\" * from the blocks above.\");\n\tlines.push(\" */\");\n\tlines.push(\"@theme inline {\");\n\tfor (const [key, token] of Object.entries(theme.tokens.light)) {\n\t\tif (extractType(token) !== \"color\") continue;\n\t\tlines.push(` --color-${key}: hsl(var(--${key}));`);\n\t}\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\"body {\");\n\tlines.push(\" background: var(--color-background);\");\n\tlines.push(\" color: var(--color-foreground);\");\n\tlines.push(\"}\");\n\tlines.push(\"\");\n\tlines.push(\"* {\");\n\tlines.push(\" border-color: var(--color-border);\");\n\tlines.push(\"}\");\n\n\treturn lines.join(\"\\n\");\n}\n","import type { TokenValue } from \"@hex-core/registry\";\n\n/**\n * Layout + typography tokens shared across all themes. Colors/radius vary per\n * theme; these do not (yet). Spread into both light and dark dicts of every\n * Theme so consumers can read any token regardless of color mode.\n */\nexport const sharedTokens: Record<string, TokenValue> = {\n\t// ─── Spacing scale (rem) ───\n\t\"space-1\": { value: \"0.25rem\", type: \"spacing\" },\n\t\"space-2\": { value: \"0.5rem\", type: \"spacing\" },\n\t\"space-3\": { value: \"0.75rem\", type: \"spacing\" },\n\t\"space-4\": { value: \"1rem\", type: \"spacing\" },\n\t\"space-6\": { value: \"1.5rem\", type: \"spacing\" },\n\t\"space-8\": { value: \"2rem\", type: \"spacing\" },\n\t\"space-12\": { value: \"3rem\", type: \"spacing\" },\n\t\"space-16\": { value: \"4rem\", type: \"spacing\" },\n\n\t// ─── Gap presets (for layout primitives) ───\n\t\"gap-xs\": { value: \"0.25rem\", type: \"spacing\" },\n\t\"gap-sm\": { value: \"0.5rem\", type: \"spacing\" },\n\t\"gap-md\": { value: \"1rem\", type: \"spacing\" },\n\t\"gap-lg\": { value: \"1.5rem\", type: \"spacing\" },\n\t\"gap-xl\": { value: \"2rem\", type: \"spacing\" },\n\n\t// ─── Container max-widths (for prose / layout primitives) ───\n\t\"container-sm\": { value: \"33rem\", type: \"dimension\" },\n\t\"container-md\": { value: \"40rem\", type: \"dimension\" },\n\t\"container-lg\": { value: \"50rem\", type: \"dimension\" },\n\t\"container-xl\": { value: \"66rem\", type: \"dimension\" },\n\n\t// ─── Control heights (interactive elements) ───\n\t\"control-height-sm\": { value: \"2.25rem\", type: \"dimension\" },\n\t\"control-height-md\": { value: \"2.5rem\", type: \"dimension\" },\n\t\"control-height-lg\": { value: \"2.75rem\", type: \"dimension\" },\n\n\t// ─── Typography scale ───\n\t\"text-xs\": { value: \"0.75rem\", type: \"font\" },\n\t\"text-sm\": { value: \"0.875rem\", type: \"font\" },\n\t\"text-base\": { value: \"1rem\", type: \"font\" },\n\t\"text-lg\": { value: \"1.125rem\", type: \"font\" },\n\t\"text-xl\": { value: \"1.25rem\", type: \"font\" },\n\t\"text-2xl\": { value: \"1.5rem\", type: \"font\" },\n\t\"text-3xl\": { value: \"1.875rem\", type: \"font\" },\n\n\t// ─── Motion ───\n\t\"duration-fast\": { value: \"150ms\", type: \"duration\" },\n\t\"duration-normal\": { value: \"200ms\", type: \"duration\" },\n\t\"duration-slow\": { value: \"300ms\", type: \"duration\" },\n};\n","import type { Theme } from \"@hex-core/registry\";\nimport { sharedTokens } from \"./shared.js\";\n\nexport const defaultTheme: Theme = {\n\tname: \"default\",\n\tdisplayName: \"Default\",\n\tdescription:\n\t\t\"A refined, neutral theme with subtle depth. Professional and versatile with clean lines and balanced contrast.\",\n\ttokens: {\n\t\tlight: {\n\t\t\tbackground: { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tforeground: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tcard: { value: \"0 0% 100%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tpopover: { value: \"0 0% 100%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tprimary: { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\t// Default zinc neutral palette. --secondary, --border, and --input all\n\t\t\t// sit at near-white values that fail strict WCAG 2.1 SC 1.4.11 (3:1)\n\t\t\t// against --card (white) — the L=58% strict-3:1 fix shipped in v1.0.2\n\t\t\t// produced a visually heavy layout (mid-gray borders + dark Secondary\n\t\t\t// fills) and was reverted in v1.1.x. The fill/border isn't the only\n\t\t\t// perceivable cue: high-contrast foreground text on filled controls\n\t\t\t// (~16:1) and shadow elevation on framed surfaces (Card, Popover,\n\t\t\t// Dialog) carry the boundary identification.\n\t\t\tsecondary: { value: \"240 4.8% 95.9%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tmuted: { value: \"240 4.8% 95.9%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"240 4% 38%\", type: \"color\" },\n\t\t\taccent: { value: \"240 4.8% 95.9%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 72% 45%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tborder: { value: \"240 5.9% 90%\", type: \"color\" },\n\t\t\tinput: { value: \"240 5.9% 90%\", type: \"color\" },\n\t\t\tring: { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tradius: { value: \"0.625rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t\tdark: {\n\t\t\tbackground: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\tforeground: { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tcard: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tpopover: { value: \"240 10% 3.9%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tprimary: { value: \"0 0% 98%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"240 5.9% 10%\", type: \"color\" },\n\t\t\tsecondary: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tmuted: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"240 5% 70%\", type: \"color\" },\n\t\t\taccent: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"0 0% 98%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 75% 65%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 75% 15%\", type: \"color\" },\n\t\t\tborder: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\tinput: { value: \"240 3.7% 15.9%\", type: \"color\" },\n\t\t\tring: { value: \"240 4.9% 83.9%\", type: \"color\" },\n\t\t\tradius: { value: \"0.625rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t},\n};\n","import type { Theme } from \"@hex-core/registry\";\nimport { sharedTokens } from \"./shared.js\";\n\nexport const midnightTheme: Theme = {\n\tname: \"midnight\",\n\tdisplayName: \"Midnight\",\n\tdescription:\n\t\t\"A dark-first theme with deep blues and electric accents. Built for focus-heavy interfaces and developer tools.\",\n\ttokens: {\n\t\tlight: {\n\t\t\tbackground: { value: \"220 23% 97%\", type: \"color\" },\n\t\t\tforeground: { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tcard: { value: \"220 23% 99%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tpopover: { value: \"220 23% 99%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tprimary: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"220 14% 92%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tmuted: { value: \"220 14% 94%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"220 9% 38%\", type: \"color\" },\n\t\t\taccent: { value: \"220 14% 92%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 72% 45%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tborder: { value: \"220 13% 88%\", type: \"color\" },\n\t\t\tinput: { value: \"220 13% 88%\", type: \"color\" },\n\t\t\tring: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\tradius: { value: \"0.5rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t\tdark: {\n\t\t\tbackground: { value: \"224 71% 4%\", type: \"color\" },\n\t\t\tforeground: { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tcard: { value: \"224 50% 7%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tpopover: { value: \"224 50% 7%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tprimary: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"224 30% 13%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\tmuted: { value: \"224 30% 13%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"220 9% 70%\", type: \"color\" },\n\t\t\taccent: { value: \"224 30% 15%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"220 23% 95%\", type: \"color\" },\n\t\t\t/*\n\t\t\t * Destructive in dark mode doubles as text on near-black surfaces\n\t\t\t * (alerts, error helper text). A lighter coral-red gives ~7:1 on\n\t\t\t * background and ~5:1 on the same color when paired with the dark\n\t\t\t * destructive-foreground for button bg + label combos. Same tuning\n\t\t\t * as default.ts; intentional shadcn-divergence in service of WCAG AA.\n\t\t\t */\n\t\t\tdestructive: { value: \"0 75% 65%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 75% 15%\", type: \"color\" },\n\t\t\tborder: { value: \"224 20% 14%\", type: \"color\" },\n\t\t\tinput: { value: \"224 20% 14%\", type: \"color\" },\n\t\t\tring: { value: \"226 70% 55%\", type: \"color\" },\n\t\t\tradius: { value: \"0.5rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t},\n};\n","import type { Theme } from \"@hex-core/registry\";\nimport { sharedTokens } from \"./shared.js\";\n\nexport const emberTheme: Theme = {\n\tname: \"ember\",\n\tdisplayName: \"Ember\",\n\tdescription:\n\t\t\"A warm theme with terracotta and amber tones. Inviting and distinctive, ideal for creative and lifestyle applications.\",\n\ttokens: {\n\t\tlight: {\n\t\t\tbackground: { value: \"30 33% 98%\", type: \"color\" },\n\t\t\tforeground: { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tcard: { value: \"30 33% 99%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tpopover: { value: \"30 33% 99%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tprimary: { value: \"16 65% 48%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"30 20% 92%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tmuted: { value: \"30 20% 94%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"20 6% 38%\", type: \"color\" },\n\t\t\taccent: { value: \"36 60% 90%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"20 14% 10%\", type: \"color\" },\n\t\t\tdestructive: { value: \"0 72% 45%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tborder: { value: \"30 15% 87%\", type: \"color\" },\n\t\t\tinput: { value: \"30 15% 87%\", type: \"color\" },\n\t\t\tring: { value: \"16 65% 48%\", type: \"color\" },\n\t\t\tradius: { value: \"0.75rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t\tdark: {\n\t\t\tbackground: { value: \"20 14% 6%\", type: \"color\" },\n\t\t\tforeground: { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tcard: { value: \"20 14% 8%\", type: \"color\" },\n\t\t\t\"card-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tpopover: { value: \"20 14% 8%\", type: \"color\" },\n\t\t\t\"popover-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tprimary: { value: \"16 65% 52%\", type: \"color\" },\n\t\t\t\"primary-foreground\": { value: \"0 0% 100%\", type: \"color\" },\n\t\t\tsecondary: { value: \"20 12% 14%\", type: \"color\" },\n\t\t\t\"secondary-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\tmuted: { value: \"20 12% 14%\", type: \"color\" },\n\t\t\t\"muted-foreground\": { value: \"20 6% 70%\", type: \"color\" },\n\t\t\taccent: { value: \"20 20% 16%\", type: \"color\" },\n\t\t\t\"accent-foreground\": { value: \"30 20% 94%\", type: \"color\" },\n\t\t\t/*\n\t\t\t * Destructive in dark mode doubles as text on near-black surfaces\n\t\t\t * (alerts, error helper text). A lighter coral-red gives ~7:1 on\n\t\t\t * background and ~5:1 on the same color when paired with the dark\n\t\t\t * destructive-foreground. Same tuning as default.ts.\n\t\t\t */\n\t\t\tdestructive: { value: \"0 75% 65%\", type: \"color\" },\n\t\t\t\"destructive-foreground\": { value: \"0 75% 15%\", type: \"color\" },\n\t\t\tborder: { value: \"20 10% 16%\", type: \"color\" },\n\t\t\tinput: { value: \"20 10% 16%\", type: \"color\" },\n\t\t\tring: { value: \"16 65% 52%\", type: \"color\" },\n\t\t\tradius: { value: \"0.75rem\", type: \"radius\" },\n\t\t\t...sharedTokens,\n\t\t},\n\t},\n};\n","import type { SemanticTokenSet, TokenSet, TokenValue } from \"@hex-core/registry\";\n\n/**\n * Semantic-token map (added 0.4.0) — the **intent layer** over the raw\n * `defaultTheme` tokens. Each entry references a raw token via flat\n * `{token-name}` syntax (the token name matches the literal key in\n * `defaultTheme.tokens.light` / `.dark`) and adds a `useWhen` sentence\n * describing the UI-element class it's the right choice for.\n *\n * Why this exists: the raw `--color-destructive` ships a value, but an\n * LLM picking a token for \"delete button background\" has to guess that\n * `destructive` maps to \"irreversible action\" rather than to \"validation\n * error\" or \"system alert\" — those are different design intents that\n * happen to share a hue today. Naming the *intent* lets MCP, Studio, and\n * future LLM workflows reach for the correct token without color-vibe\n * heuristics.\n *\n * Naming convention: `<component>.<state-or-slot>.<role>`. Use\n * `dialog.overlay.bg`, not `dialog-overlay-bg`. The leading segment is\n * the API — MCP groups by it.\n *\n * **Theme-portable.** The map references raw token names by reference\n * (`{destructive}`), so swapping the underlying theme automatically\n * shifts every semantic entry without any per-theme rewrite. Themes that\n * want to redefine semantic intent (e.g. a fintech theme where\n * \"destructive\" reads more muted) can ship their own `SemanticTokenSet`\n * alongside their `Theme`.\n *\n * **Coverage is intentionally partial.** Common high-leverage intents\n * are named (button, surface, form, feedback, shape, motion); arbitrary\n * combinatorial intents (`table.row.bg-hover`, `badge.intent.warning`)\n * are deferred. Consumers querying an unnamed intent fall through to\n * the raw `defaultTheme` layer.\n */\nexport const defaultSemanticTokens: SemanticTokenSet = {\n\t// ─── Button intents ─────────────────────────────────────────────\n\t\"button.primary.bg\": {\n\t\tvalue: \"{primary}\",\n\t\tuseWhen: \"the single most important action on the screen (one per view)\",\n\t\ttype: \"color\",\n\t},\n\t\"button.primary.fg\": {\n\t\tvalue: \"{primary-foreground}\",\n\t\tuseWhen: \"text on a primary button\",\n\t\ttype: \"color\",\n\t},\n\t\"button.destructive.bg\": {\n\t\tvalue: \"{destructive}\",\n\t\tuseWhen: \"irreversible actions: delete, archive, deactivate, leave, force-quit\",\n\t\ttype: \"color\",\n\t},\n\t\"button.destructive.fg\": {\n\t\tvalue: \"{destructive-foreground}\",\n\t\tuseWhen: \"text on a destructive button\",\n\t\ttype: \"color\",\n\t},\n\t\"button.secondary.bg\": {\n\t\tvalue: \"{secondary}\",\n\t\tuseWhen: \"the second-tier action next to a primary button (Cancel, Save Draft)\",\n\t\ttype: \"color\",\n\t},\n\t\"button.outline.border\": {\n\t\tvalue: \"{input}\",\n\t\tuseWhen: \"tertiary actions on flat surfaces; signals 'optional'\",\n\t\ttype: \"color\",\n\t},\n\t\"button.ghost.bg-hover\": {\n\t\tvalue: \"{accent}\",\n\t\tuseWhen: \"lowest-emphasis action; lives inside a list/toolbar where chrome should disappear\",\n\t\ttype: \"color\",\n\t},\n\n\t// ─── Surface intents ────────────────────────────────────────────\n\t\"surface.card.bg\": {\n\t\tvalue: \"{card}\",\n\t\tuseWhen: \"a content container raised one level above the page background\",\n\t\ttype: \"color\",\n\t},\n\t\"surface.popover.bg\": {\n\t\tvalue: \"{popover}\",\n\t\tuseWhen: \"a transient floating layer (dropdown, tooltip body, hover-card) above all content\",\n\t\ttype: \"color\",\n\t},\n\t\"surface.muted.bg\": {\n\t\tvalue: \"{muted}\",\n\t\tuseWhen: \"background of a section that should recede (footer, disabled state, code block)\",\n\t\ttype: \"color\",\n\t},\n\n\t// ─── Form intents ───────────────────────────────────────────────\n\t\"form.field.border\": {\n\t\tvalue: \"{input}\",\n\t\tuseWhen: \"the resting border of a form input, textarea, or select trigger\",\n\t\ttype: \"color\",\n\t},\n\t\"form.field.border-error\": {\n\t\tvalue: \"{destructive}\",\n\t\tuseWhen: \"input validation has failed and the field needs visual correction\",\n\t\ttype: \"color\",\n\t},\n\t\"form.field.ring-focus\": {\n\t\tvalue: \"{ring}\",\n\t\tuseWhen: \"the keyboard-focus ring on any focusable form control\",\n\t\ttype: \"color\",\n\t},\n\t\"form.message.error-fg\": {\n\t\tvalue: \"{destructive}\",\n\t\tuseWhen: \"inline error text below a failed field\",\n\t\ttype: \"color\",\n\t},\n\n\t// ─── Feedback intents ───────────────────────────────────────────\n\t\"feedback.success.bg\": {\n\t\tvalue: \"{primary}\",\n\t\tuseWhen: \"success toast / banner background. Note: default theme reuses primary; opinionated themes should split this from primary\",\n\t\ttype: \"color\",\n\t},\n\t\"feedback.error.bg\": {\n\t\tvalue: \"{destructive}\",\n\t\tuseWhen: \"error toast / banner background\",\n\t\ttype: \"color\",\n\t},\n\t\"feedback.muted.fg\": {\n\t\tvalue: \"{muted-foreground}\",\n\t\tuseWhen: \"secondary copy: helper text, captions, timestamps, empty-state body\",\n\t\ttype: \"color\",\n\t},\n\n\t// ─── Shape + motion intents ─────────────────────────────────────\n\t\"shape.radius.control\": {\n\t\tvalue: \"{radius}\",\n\t\tuseWhen: \"the corner radius of any interactive control (button, input, badge, chip)\",\n\t\ttype: \"radius\",\n\t},\n\t\"motion.duration.control\": {\n\t\tvalue: \"{duration-normal}\",\n\t\tuseWhen: \"hover, press, and focus transitions on interactive controls\",\n\t\ttype: \"duration\",\n\t},\n\t\"motion.duration.overlay\": {\n\t\tvalue: \"{duration-slow}\",\n\t\tuseWhen: \"dialog/sheet/drawer enter+exit; longer to telegraph the surface change\",\n\t\ttype: \"duration\",\n\t},\n};\n\n/**\n * Resolve a `{token-name}` reference against a `TokenSet` and return\n * the underlying `TokenValue`, or `null` if the reference doesn't\n * match a token in the set. Single-hop lookup — no recursion, no\n * fallback chains.\n *\n * Use this when an MCP/Studio surface needs the resolved value\n * (e.g. to render a swatch next to the semantic name) rather than the\n * `{ref}` placeholder string.\n *\n * @example\n * ```ts\n * import { defaultSemanticTokens, defaultTheme, resolveSemanticToken } from \"@hex-core/tokens\";\n *\n * const entry = defaultSemanticTokens[\"button.destructive.bg\"];\n * const resolved = resolveSemanticToken(entry.value, defaultTheme.tokens.light);\n * // resolved → { value: \"0 84% 60%\", type: \"color\" }\n * ```\n */\nexport function resolveSemanticToken(\n\treference: string,\n\ttokenSet: TokenSet,\n): TokenValue | null {\n\tconst match = /^\\{([a-z][a-z0-9-]*)\\}$/.exec(reference);\n\tif (!match) return null;\n\tconst slug = match[1];\n\tif (!slug) return null;\n\tconst value = tokenSet[slug];\n\treturn value ?? null;\n}\n\n","export {\n\tgenerateGlobalsCss,\n\ttype ScopedRuntimeCssOptions,\n\tthemeToCss,\n\tthemeToFlatJson,\n\tthemeToScopedRuntimeCss,\n\tthemeToTailwindConfig,\n} from \"./transformer.js\";\nexport { defaultTheme } from \"./themes/default.js\";\nexport { midnightTheme } from \"./themes/midnight.js\";\nexport { emberTheme } from \"./themes/ember.js\";\nexport { defaultSemanticTokens, resolveSemanticToken } from \"./semantic.js\";\n\nimport type { Theme } from \"@hex-core/registry\";\nimport { defaultTheme } from \"./themes/default.js\";\nimport { emberTheme } from \"./themes/ember.js\";\nimport { midnightTheme } from \"./themes/midnight.js\";\n\nexport const themes: Record<string, Theme> = {\n\tdefault: defaultTheme,\n\tmidnight: midnightTheme,\n\tember: emberTheme,\n};\n\n/**\n * Retrieve a theme by name.\n * @param name - The theme identifier (e.g. \"default\", \"midnight\", \"ember\")\n * @returns The matching Theme object, or undefined if not found\n */\nexport function getTheme(name: string): Theme | undefined {\n\treturn themes[name];\n}\n\n/**\n * List all available themes with their display metadata.\n * @returns An array of theme summaries containing name, displayName, and description\n */\nexport function listThemes(): Array<{ name: string; displayName: string; description: string }> {\n\treturn Object.values(themes).map((t) => ({\n\t\tname: t.name,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ACP;AACD;AAqBO,SAAS,qBACf,WACA,UACoB;AACpB,QAAM,QAAQ,0BAA0B,KAAK,SAAS;AACtD,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,OAAO,MAAM,CAAC;AACpB,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,SAAS,IAAI;AAC3B,SAAO,SAAS;AACjB;;;AC7JO,IAAM,SAAgC;AAAA,EAC5C,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AACR;AAOO,SAAS,SAAS,MAAiC;AACzD,SAAO,OAAO,IAAI;AACnB;AAMO,SAAS,aAAgF;AAC/F,SAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAC,OAAO;AAAA,IACxC,MAAM,EAAE;AAAA,IACR,aAAa,EAAE;AAAA,IACf,aAAa,EAAE;AAAA,EAChB,EAAE;AACH;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hex-core/tokens",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Design token engine for Hex UI — HSL tokens + typography scale shared between components and themes.",
5
5
  "keywords": [
6
6
  "hex-ui",
@@ -40,9 +40,10 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "zod": "^4.3.6",
43
- "@hex-core/registry": "^0.3.0"
43
+ "@hex-core/registry": "^0.3.1"
44
44
  },
45
45
  "devDependencies": {
46
+ "postcss": "^8.5.0",
46
47
  "tsup": "^8.3.0",
47
48
  "typescript": "^6.0.3"
48
49
  },