@adea-ai/ui 0.122.2 → 0.123.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.
- package/dist/lib/themes.d.ts +8 -7
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/themes.js +53 -55
- package/dist/lib/themes.js.map +1 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/lib.json +1 -1
- package/dist/r/registry.json +3 -3
- package/dist/r/src/lib/themes.ts +56 -73
- package/dist/r/theming.json +1 -1
- package/package.json +2 -2
- package/registry.json +3 -3
- package/src/lib/themes.ts +56 -73
package/dist/lib/themes.d.ts
CHANGED
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
*
|
|
25
25
|
* ## The mapping, and the entry that is not a rename
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
* entry will trip a reader: the catalogue's `accent`
|
|
29
|
-
* `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
-
* fill of a primary button, the thing a focus ring is drawn
|
|
31
|
-
* a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
-
* `--primary`, and `--accent` is filled from
|
|
33
|
-
* components actually use it for.
|
|
27
|
+
* The package-owned `shadcnVariables` adapter maps canonical roles onto this
|
|
28
|
+
* system's vocabulary. One entry will trip a reader: the catalogue's `accent`
|
|
29
|
+
* becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
+
* the action colour — the fill of a primary button, the thing a focus ring is drawn
|
|
31
|
+
* in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
+
* the former, so it goes to `--primary`, and `--accent` is filled from
|
|
33
|
+
* `surfaceHover`, which is what shadcn components actually use it for.
|
|
34
34
|
*/
|
|
35
35
|
import { type AccentPreset, type AdeaTheme, type AdeaThemeRecord } from '@adea-ai/themes';
|
|
36
36
|
export { isThemeAccentId } from './theme-accents';
|
|
@@ -79,6 +79,7 @@ export type ThemeColors = {
|
|
|
79
79
|
sidebarForeground: string;
|
|
80
80
|
sidebarAccent: string;
|
|
81
81
|
sidebarBorder: string;
|
|
82
|
+
sidebarMutedForeground: string;
|
|
82
83
|
};
|
|
83
84
|
/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */
|
|
84
85
|
export type ThemeTerminalPalette = {
|
package/dist/lib/themes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAA;AAIxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAA;AAE9C;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CA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BAAgB,uBAAuB,CAAC,SAAS,EAAE;IACjD,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACf,GAAG;IAAE,UAAU,EAAE,eAAe,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,CAI9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,IAAI,GAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAGhD,GACA,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAmBpC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6G7E;AAUD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAMD,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE,CAMjE;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,SAAS,YAAY,EAAkB,GAC9C,YAAY,EAAE,CAchB;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAA;AAC/C,eAAO,MAAM,kBAAkB,cAAc,CAAA;AAE7C,kFAAkF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/lib/themes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isThemeAccentId } from "./theme-accents.js";
|
|
2
2
|
import { accentForeground, accentRoles, chartSeries, contrastRatio, getAccent, getTheme, hasTheme, primaryHover, primarySubtleCss, shadcnDestructiveProjection, statusForeground, syntaxRoles, themeAccentPresets, themes, themesByAppearance, tint, validateCatalogue } from "@adea-ai/themes";
|
|
3
|
+
import { shadcnVariables } from "@adea-ai/themes/adapters/shadcn";
|
|
3
4
|
//#region src/lib/themes.ts
|
|
4
5
|
/**
|
|
5
6
|
* The theme registry, now a bridge.
|
|
@@ -27,64 +28,61 @@ import { accentForeground, accentRoles, chartSeries, contrastRatio, getAccent, g
|
|
|
27
28
|
*
|
|
28
29
|
* ## The mapping, and the entry that is not a rename
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
-
* entry will trip a reader: the catalogue's `accent`
|
|
32
|
-
* `primary`, because in the shadcn vocabulary `--primary` is
|
|
33
|
-
* fill of a primary button, the thing a focus ring is drawn
|
|
34
|
-
* a low-contrast hover wash. The catalogue's `accent` is
|
|
35
|
-
* `--primary`, and `--accent` is filled from
|
|
36
|
-
* components actually use it for.
|
|
31
|
+
* The package-owned `shadcnVariables` adapter maps canonical roles onto this
|
|
32
|
+
* system's vocabulary. One entry will trip a reader: the catalogue's `accent`
|
|
33
|
+
* becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
|
|
34
|
+
* the action colour — the fill of a primary button, the thing a focus ring is drawn
|
|
35
|
+
* in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
|
|
36
|
+
* the former, so it goes to `--primary`, and `--accent` is filled from
|
|
37
|
+
* `surfaceHover`, which is what shadcn components actually use it for.
|
|
37
38
|
*/
|
|
38
|
-
var ROLE_FOR = {
|
|
39
|
-
background: "background",
|
|
40
|
-
foreground: "text",
|
|
41
|
-
card: "surface",
|
|
42
|
-
cardForeground: "text",
|
|
43
|
-
popover: "surfaceElevated",
|
|
44
|
-
popoverForeground: "text",
|
|
45
|
-
primary: "accent",
|
|
46
|
-
primaryForeground: "accentForeground",
|
|
47
|
-
secondary: "surface",
|
|
48
|
-
secondaryForeground: "text",
|
|
49
|
-
muted: "surface",
|
|
50
|
-
mutedForeground: "textMuted",
|
|
51
|
-
accent: "surfaceHover",
|
|
52
|
-
accentForeground: "text",
|
|
53
|
-
destructive: "error",
|
|
54
|
-
destructiveForeground: "error",
|
|
55
|
-
destructiveSubtle: "error",
|
|
56
|
-
success: "success",
|
|
57
|
-
successForeground: "success",
|
|
58
|
-
successSubtle: "success",
|
|
59
|
-
warning: "warning",
|
|
60
|
-
warningForeground: "warning",
|
|
61
|
-
warningSubtle: "warning",
|
|
62
|
-
info: "info",
|
|
63
|
-
infoForeground: "info",
|
|
64
|
-
infoSubtle: "info",
|
|
65
|
-
border: "border",
|
|
66
|
-
input: "border",
|
|
67
|
-
ring: "accent",
|
|
68
|
-
sidebar: "surface",
|
|
69
|
-
sidebarForeground: "text",
|
|
70
|
-
sidebarAccent: "surfaceHover",
|
|
71
|
-
sidebarBorder: "border"
|
|
72
|
-
};
|
|
73
39
|
/** Builds the design system's view of one catalogue entry. */
|
|
74
40
|
function toVariant(theme) {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
41
|
+
const projected = shadcnVariables(theme);
|
|
42
|
+
const token = (name) => {
|
|
43
|
+
const value = projected[`--${name}`];
|
|
44
|
+
if (!value) throw new Error(`${theme.id} has no shared shadcn projection for --${name}`);
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
79
47
|
const destructiveAction = shadcnDestructiveProjection(theme);
|
|
80
|
-
colors
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
48
|
+
const colors = {
|
|
49
|
+
background: token("background"),
|
|
50
|
+
foreground: token("foreground"),
|
|
51
|
+
card: token("card"),
|
|
52
|
+
cardForeground: token("card-foreground"),
|
|
53
|
+
popover: token("popover"),
|
|
54
|
+
popoverForeground: token("popover-foreground"),
|
|
55
|
+
primary: token("primary"),
|
|
56
|
+
primaryForeground: token("primary-foreground"),
|
|
57
|
+
secondary: token("secondary"),
|
|
58
|
+
secondaryForeground: token("secondary-foreground"),
|
|
59
|
+
muted: token("muted"),
|
|
60
|
+
mutedForeground: token("muted-foreground"),
|
|
61
|
+
accent: token("accent"),
|
|
62
|
+
accentForeground: token("accent-foreground"),
|
|
63
|
+
destructive: theme.colors.error,
|
|
64
|
+
destructiveForeground: statusForeground(theme, "error"),
|
|
65
|
+
destructiveSubtle: tint(theme.colors.error, theme.colors.background),
|
|
66
|
+
destructiveAction: destructiveAction.fill,
|
|
67
|
+
destructiveActionForeground: destructiveAction.foreground,
|
|
68
|
+
success: token("success"),
|
|
69
|
+
successForeground: statusForeground(theme, "success"),
|
|
70
|
+
successSubtle: tint(theme.colors.success, theme.colors.background),
|
|
71
|
+
warning: token("warning"),
|
|
72
|
+
warningForeground: statusForeground(theme, "warning"),
|
|
73
|
+
warningSubtle: tint(theme.colors.warning, theme.colors.background),
|
|
74
|
+
info: token("info"),
|
|
75
|
+
infoForeground: statusForeground(theme, "info"),
|
|
76
|
+
infoSubtle: tint(theme.colors.info, theme.colors.background),
|
|
77
|
+
border: token("border"),
|
|
78
|
+
input: token("input"),
|
|
79
|
+
ring: token("ring"),
|
|
80
|
+
sidebar: token("sidebar"),
|
|
81
|
+
sidebarForeground: token("sidebar-foreground"),
|
|
82
|
+
sidebarAccent: token("sidebar-accent"),
|
|
83
|
+
sidebarBorder: token("sidebar-border"),
|
|
84
|
+
sidebarMutedForeground: token("sidebar-muted-foreground")
|
|
85
|
+
};
|
|
88
86
|
const syntax = syntaxRoles(theme);
|
|
89
87
|
return {
|
|
90
88
|
id: theme.id,
|
|
@@ -341,7 +339,7 @@ function themeCssVariables(theme) {
|
|
|
341
339
|
"--sidebar-primary": c.primary,
|
|
342
340
|
"--sidebar-primary-foreground": c.primaryForeground,
|
|
343
341
|
"--sidebar-ring": c.ring,
|
|
344
|
-
"--sidebar-muted-foreground": c.
|
|
342
|
+
"--sidebar-muted-foreground": c.sidebarMutedForeground,
|
|
345
343
|
"--surface-sunken": c.muted,
|
|
346
344
|
"--surface-hover": c.accent,
|
|
347
345
|
"--surface-active": c.border,
|
package/dist/lib/themes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","names":["catalogue","themes"],"sources":["../../src/lib/themes.ts"],"sourcesContent":["/**\n * The theme registry, now a bridge.\n *\n * The catalogue itself lives in `@adea-ai/themes`. This module is what is left in\n * the design system: the translation between the catalogue's **canonical** role\n * names and the **shadcn** vocabulary every component here is written against, plus\n * the handful of custom properties this system declares that are presentations of\n * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,\n * and `--chrome`.\n *\n * ## Why it is a bridge and not a copy\n *\n * This file used to hold thirteen themes as hand-written hex literal tables, with its\n * own contrast validator, its own terminal and editor palettes, and its own\n * provenance records. That is a lot of surface to maintain for one consumer of a\n * palette, and it meant every product that wanted the same themes — Adea, Cortana —\n * either imported this package or wrote its own. The catalogue moved out so that\n * there is one answer to \"what is Catppuccin Mocha\", and this file is the part that\n * genuinely belongs to the design system.\n *\n * It is deliberately thin. If you are looking for a colour, it is not here: see\n * `@adea-ai/themes`, whose README explains how the values are produced and whose\n * `NOTICE` records where every palette came from.\n *\n * ## The mapping, and the entry that is not a rename\n *\n * {@link ROLE_FOR} maps canonical roles onto this system's variable vocabulary. One\n * entry will trip a reader: the catalogue's `accent` becomes this system's\n * `primary`, because in the shadcn vocabulary `--primary` is the action colour — the\n * fill of a primary button, the thing a focus ring is drawn in — while `--accent` is\n * a low-contrast hover wash. The catalogue's `accent` is the former, so it goes to\n * `--primary`, and `--accent` is filled from `surfaceHover`, which is what shadcn\n * components actually use it for.\n */\n\nimport {\n ACCENTS,\n accentForeground,\n accentRoles,\n chartSeries,\n getAccent,\n getTheme,\n hasTheme,\n shadcnDestructiveProjection,\n statusForeground,\n tint,\n primaryHover,\n primarySubtleCss,\n syntaxRoles,\n themes as catalogue,\n themesByAppearance,\n themeAccentPresets,\n validateCatalogue,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n type ContrastFinding,\n} from '@adea-ai/themes'\nimport { isThemeAccentId } from './theme-accents'\n\nexport { isThemeAccentId } from './theme-accents'\n\nexport type ThemeAppearance = 'light' | 'dark'\n\n/**\n * The surface and text roles, in shadcn's vocabulary.\n *\n * Named to match the components below, which is why they differ from the\n * catalogue's: these are this system's variable names, and renaming them would mean\n * touching every component in the library for no gain.\n */\nexport type ThemeColors = {\n background: string\n foreground: string\n card: string\n cardForeground: string\n popover: string\n popoverForeground: string\n primary: string\n primaryForeground: string\n secondary: string\n secondaryForeground: string\n muted: string\n mutedForeground: string\n accent: string\n accentForeground: string\n destructive: string\n destructiveForeground: string\n destructiveSubtle: string\n /** Contrast-safe solid-action presentation, derived from the canonical error role. */\n destructiveAction: string\n destructiveActionForeground: string\n success: string\n successForeground: string\n successSubtle: string\n warning: string\n warningForeground: string\n warningSubtle: string\n info: string\n infoForeground: string\n infoSubtle: string\n border: string\n input: string\n ring: string\n sidebar: string\n sidebarForeground: string\n sidebarAccent: string\n sidebarBorder: string\n}\n\n/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */\nexport type ThemeTerminalPalette = {\n background: string\n foreground: string\n cursor: string\n selection: string\n black: string\n red: string\n green: string\n yellow: string\n blue: string\n magenta: string\n cyan: string\n white: string\n brightBlack: string\n brightRed: string\n brightGreen: string\n brightYellow: string\n brightBlue: string\n brightMagenta: string\n brightCyan: string\n brightWhite: string\n}\n\n/** The syntax roles a code view needs. */\nexport type ThemeEditorPalette = {\n keyword: string\n string: string\n number: string\n comment: string\n function: string\n variable: string\n type: string\n tag: string\n attribute: string\n operator: string\n heading: string\n link: string\n diffAdd: string\n diffDelete: string\n diffHunk: string\n searchMatch: string\n}\n\n/** Where a palette came from, and the terms it is used under. */\nexport type ThemeProvenance = {\n /** The project or person the palette belongs to. */\n source: string\n url: string\n /** An SPDX identifier. Every palette in this catalogue is permissive. */\n license: string\n}\n\nexport type ThemeVariant = {\n /** The `data-theme` value and the id a preference stores. */\n id: string\n /** Groups the variants that came from one project. */\n family: string\n familyLabel: string\n label: string\n appearance: ThemeAppearance\n /** One line, shown in a picker. */\n description: string\n colors: ThemeColors\n terminal: ThemeTerminalPalette\n editor: ThemeEditorPalette\n /** The categorical series, in order. */\n chart: readonly string[]\n provenance: ThemeProvenance\n}\n\n/**\n * Canonical role → this system's `ThemeColors` key.\n *\n * Read by {@link toVariant}. The two derived destructive-action presentation values\n * are intentionally excluded; the shared Themes adapter owns their color math.\n */\ntype ThemeRole = Exclude<keyof ThemeColors, 'destructiveAction' | 'destructiveActionForeground'>\n\nconst ROLE_FOR: Readonly<Record<ThemeRole, keyof AdeaThemeRecord['colors']>> = {\n background: 'background',\n foreground: 'text',\n card: 'surface',\n cardForeground: 'text',\n popover: 'surfaceElevated',\n popoverForeground: 'text',\n // Not a rename — see this module's header.\n primary: 'accent',\n primaryForeground: 'accentForeground',\n // shadcn's `secondary` and `muted` are both the first surface rung used as a fill.\n secondary: 'surface',\n secondaryForeground: 'text',\n muted: 'surface',\n mutedForeground: 'textMuted',\n // shadcn's `accent` is a hover wash, which is exactly `surfaceHover`.\n accent: 'surfaceHover',\n accentForeground: 'text',\n destructive: 'error',\n // Overwritten below from the measured pairing; nominal here so the table is total.\n destructiveForeground: 'error',\n destructiveSubtle: 'error',\n success: 'success',\n successForeground: 'success',\n successSubtle: 'success',\n warning: 'warning',\n warningForeground: 'warning',\n warningSubtle: 'warning',\n info: 'info',\n infoForeground: 'info',\n infoSubtle: 'info',\n border: 'border',\n input: 'border',\n ring: 'accent',\n sidebar: 'surface',\n sidebarForeground: 'text',\n sidebarAccent: 'surfaceHover',\n sidebarBorder: 'border',\n}\n\n/** Builds the design system's view of one catalogue entry. */\nfunction toVariant(theme: AdeaThemeRecord): ThemeVariant {\n const colors = {} as ThemeColors\n for (const key of Object.keys(ROLE_FOR) as ThemeRole[]) {\n colors[key] = theme.colors[ROLE_FOR[key]]\n }\n // Keep the semantic foreground paired with the canonical error role. Filled\n // destructive actions use the distinct projection below so their /90 hover state\n // remains readable without changing icons, borders, or tinted status surfaces.\n colors.destructiveForeground = statusForeground(theme, 'error')\n colors.destructiveSubtle = tint(theme.colors.error, theme.colors.background)\n const destructiveAction = shadcnDestructiveProjection(theme)\n colors.destructiveAction = destructiveAction.fill\n colors.destructiveActionForeground = destructiveAction.foreground\n colors.successForeground = statusForeground(theme, 'success')\n colors.successSubtle = tint(theme.colors.success, theme.colors.background)\n colors.warningForeground = statusForeground(theme, 'warning')\n colors.warningSubtle = tint(theme.colors.warning, theme.colors.background)\n colors.infoForeground = statusForeground(theme, 'info')\n colors.infoSubtle = tint(theme.colors.info, theme.colors.background)\n\n const syntax = syntaxRoles(theme)\n\n return {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n colors,\n terminal: {\n // The embedded terminal uses the theme's own canvas rather than a palette of its\n // own. The ANSI colours came from the palette that produced the canvas, so they\n // were chosen against it; a terminal on a different background would be the one\n // surface in the application not lit by the active theme.\n background: theme.colors.background,\n foreground: theme.colors.foreground,\n cursor: theme.cursor,\n selection: theme.selection,\n ...theme.ansi,\n },\n editor: {\n keyword: syntax.keyword,\n string: syntax.string,\n number: syntax.number,\n comment: syntax.comment,\n function: syntax.function,\n variable: syntax.variable,\n type: syntax.type,\n tag: syntax.tag,\n attribute: syntax.attribute,\n operator: syntax.operator,\n heading: syntax.heading,\n link: syntax.link,\n diffAdd: syntax.diffAdd,\n diffDelete: syntax.diffDelete,\n diffHunk: syntax.diffHunk,\n searchMatch: syntax.searchMatch,\n },\n chart: chartSeries(theme),\n provenance: {\n source: theme.provenance.project,\n url: theme.provenance.url,\n license: theme.provenance.license,\n },\n }\n}\n\n/**\n * A variant's `--primary-subtle`: the tint over `var(--primary)` at the strength its\n * catalogue record measures (`primarySubtleAlpha`). A variant that is not in the\n * catalogue has nothing to measure, and gets its appearance's ceiling.\n */\nexport function primarySubtleFor(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const record = getTheme(theme.id)\n return record ? primarySubtleCss(record) : primarySubtleCss(theme.appearance)\n}\n\n/** The catalogue, in catalogue order. */\nexport const builtinThemes: readonly ThemeVariant[] = Object.freeze(catalogue.map(toVariant))\n\nexport function themeById(id: string): ThemeVariant | undefined {\n if (!hasTheme(id)) return undefined\n return builtinThemes.find((theme) => theme.id === id)\n}\n\n/** The variants of one appearance, which is what a picker for that mode shows. */\nexport function themesForAppearance(appearance: ThemeAppearance): readonly ThemeVariant[] {\n const ids = new Set(themesByAppearance(appearance).map((theme) => theme.id))\n return builtinThemes.filter((theme) => ids.has(theme.id))\n}\n\n/** The families in the catalogue, in catalogue order. */\nexport function themeFamilies(): { family: string; label: string; themes: ThemeVariant[] }[] {\n const families = new Map<string, { family: string; label: string; themes: ThemeVariant[] }>()\n for (const theme of builtinThemes) {\n const entry = families.get(theme.family) ?? {\n family: theme.family,\n label: theme.familyLabel,\n themes: [],\n }\n entry.themes.push(theme)\n families.set(theme.family, entry)\n }\n return [...families.values()]\n}\n\n/** The accent presets, in the order a picker should show them. */\nexport const accents = ACCENTS\n\n/**\n * The canonical catalogue records, in catalogue order.\n *\n * {@link builtinThemes} is this system's projection of the catalogue onto the\n * shadcn vocabulary, which is what a document is painted with. A *preview* of a\n * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the\n * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),\n * several of which the projection folds together. These are those records, so a\n * consumer hands the editor exactly what it takes rather than reconstructing it\n * from the projection.\n */\nexport const themeRecords: readonly AdeaThemeRecord[] = catalogue\n\nexport function themeRecordById(id: string): AdeaThemeRecord | undefined {\n return getTheme(id)\n}\n\n/** A light/dark theme pair by id, with the defaults standing in for an unknown id. */\nfunction recordPair(lightThemeId: string, darkThemeId: string) {\n const light = getTheme(lightThemeId) ?? getTheme(defaultLightThemeId)!\n const dark = getTheme(darkThemeId) ?? getTheme(defaultDarkThemeId)!\n return { light, dark }\n}\n\n/**\n * The accents the selected light/dark pair carries — offered beside the presets.\n *\n * Computed per pair rather than per theme because a theme accent is a *pair* of\n * values, like a preset: a slot is offered only when both themes can offer it.\n */\nexport function themeAccentsFor(\n lightThemeId: string,\n darkThemeId: string\n): readonly AccentPreset[] {\n const { light, dark } = recordPair(lightThemeId, darkThemeId)\n return themeAccentPresets(light, dark)\n}\n\n/**\n * An accent id resolved against a theme pair: a preset, a theme accent the pair\n * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot\n * offer — each of which means \"use the theme's own primary\".\n *\n * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme\n * switch and resolves to the new theme's blue; when the new pair cannot offer the\n * slot it resolves to nothing, the same fallback a stale preset id gets.\n */\nexport function resolveAccentPreset(\n accentId: string,\n light: AdeaTheme,\n dark: AdeaTheme\n): AccentPreset | undefined {\n if (accentId === 'theme') return undefined\n const preset = getAccent(accentId)\n if (preset) return preset\n if (!isThemeAccentId(accentId)) return undefined\n return themeAccentPresets(light, dark).find((option) => option.id === accentId)\n}\n\n/**\n * A theme with an accent laid over it, in the catalogue's own shape.\n *\n * The accent replaces `accent` and its measured label, which is all an accent\n * changes about a theme; `undefined` returns the theme untouched. This is the\n * overlay a host needs for `AppearanceEditor`'s `lightTheme`/`darkTheme`.\n */\nexport function withAccent<T extends AdeaTheme>(theme: T, accent: AccentPreset | undefined): T {\n if (!accent) return theme\n const value = theme.appearance === 'dark' ? accent.dark : accent.light\n return {\n ...theme,\n colors: { ...theme.colors, accent: value, accentForeground: accentForeground(value) },\n }\n}\n\n/**\n * The two preview themes an appearance selection resolves to, accent applied.\n *\n * The adapter between a stored selection and `AppearanceEditor`: it takes ids —\n * what a preference holds — and returns the canonical records the editor's\n * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.\n * Unknown ids fall back to the defaults and an accent the pair cannot offer falls\n * back to the theme's own, exactly as `ThemeProvider` resolves them.\n */\nexport function appearancePreviewThemes(selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n}): { lightTheme: AdeaThemeRecord; darkTheme: AdeaThemeRecord } {\n const { light, dark } = recordPair(selection.lightThemeId, selection.darkThemeId)\n const accent = resolveAccentPreset(selection.accent, light, dark)\n return { lightTheme: withAccent(light, accent), darkTheme: withAccent(dark, accent) }\n}\n\n/**\n * The properties an accent selection overrides, as CSS custom properties.\n *\n * ## Why this exists rather than relying on the `[data-accent]` blocks\n *\n * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are\n * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's\n * whole role set onto `<html>` as *inline* custom properties, and an inline\n * declaration outranks any stylesheet selector regardless of specificity. The\n * attribute was set, the rules existed, the values were right, and every one of the\n * seven accents rendered as the same blue.\n *\n * The blocks are kept, because they are what styles the window between the document\n * arriving and the provider mounting — which is the whole reason `themeScript`\n * exists. But the authoritative value has to be applied by the same code that\n * applies the theme, from the same source, or the two can drift again. So both the\n * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and\n * `tests/appearance-axes.test.ts` asserts the two agree value for value.\n *\n * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,\n * so it is resolved against `pair` — the selection's light and dark theme ids —\n * and only ever applied here. Without a pair it resolves against the defaults.\n *\n * Returns `undefined` for `theme` — the variant's own primary — for an id the\n * catalogue does not have, and for a theme accent the pair does not offer, so a\n * stale stored preference falls back to the theme rather than blanking the primary.\n */\nexport function accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string } = {\n lightThemeId: defaultLightThemeId,\n darkThemeId: defaultDarkThemeId,\n }\n): Record<string, string> | undefined {\n if (accentId === 'theme') return undefined\n const { light, dark } = recordPair(pair.lightThemeId, pair.darkThemeId)\n const preset = resolveAccentPreset(accentId, light, dark)\n if (!preset) return undefined\n\n // `--primary-subtle` is deliberately not here. It is a `color-mix()` over\n // `var(--primary)`, so the theme's own declaration (`themeCssVariables`, or the\n // default block in `theme.css`) already follows the accent; and its strength is the\n // *theme's*, measured by `primarySubtleAlpha` to hold body text at 4.5:1 for every\n // accent the theme offers. Writing one here would replace that measured strength\n // with whatever this function was given, which is how an accent used to undo it.\n const roles = accentRoles(preset, appearance)\n return {\n '--primary': roles.primary,\n '--primary-foreground': roles.primaryForeground,\n '--primary-hover': roles.primaryHover,\n '--ring': roles.ring,\n }\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n */\nexport function themeCssVariables(theme: ThemeVariant): Record<string, string> {\n const c = theme.colors\n const t = theme.terminal\n const e = theme.editor\n return {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': primarySubtleFor(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.mutedForeground,\n '--surface-sunken': c.muted,\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n '--terminal-background': t.background,\n '--terminal-foreground': t.foreground,\n '--terminal-cursor': t.cursor,\n '--terminal-selection': t.selection,\n '--terminal-ansi-black': t.black,\n '--terminal-ansi-red': t.red,\n '--terminal-ansi-green': t.green,\n '--terminal-ansi-yellow': t.yellow,\n '--terminal-ansi-blue': t.blue,\n '--terminal-ansi-magenta': t.magenta,\n '--terminal-ansi-cyan': t.cyan,\n '--terminal-ansi-white': t.white,\n '--terminal-ansi-bright-black': t.brightBlack,\n '--terminal-ansi-bright-red': t.brightRed,\n '--terminal-ansi-bright-green': t.brightGreen,\n '--terminal-ansi-bright-yellow': t.brightYellow,\n '--terminal-ansi-bright-blue': t.brightBlue,\n '--terminal-ansi-bright-magenta': t.brightMagenta,\n '--terminal-ansi-bright-cyan': t.brightCyan,\n '--terminal-ansi-bright-white': t.brightWhite,\n '--editor-keyword': e.keyword,\n '--editor-string': e.string,\n '--editor-number': e.number,\n '--editor-comment': e.comment,\n '--editor-function': e.function,\n '--editor-variable': e.variable,\n '--editor-type': e.type,\n '--editor-tag': e.tag,\n '--editor-attribute': e.attribute,\n '--editor-operator': e.operator,\n '--editor-heading': e.heading,\n '--editor-link': e.link,\n '--editor-diff-add': e.diffAdd,\n '--editor-diff-delete': e.diffDelete,\n '--editor-diff-hunk': e.diffHunk,\n '--editor-search-match': e.searchMatch,\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n}\n\n/* ---------------------------------------------------------------------------\n * Validation\n *\n * Delegated. The floors are the catalogue's, because they are what makes the\n * catalogue able to hold other people's palettes at all, and a second set of floors\n * here would be a second answer to the same question — and the one that drifts.\n * ------------------------------------------------------------------------- */\n\nexport type ThemeFinding = {\n themeId: string\n role: string\n message: string\n}\n\nfunction toFinding(finding: ContrastFinding): ThemeFinding {\n return { themeId: finding.themeId, role: finding.role, message: finding.message }\n}\n\n/** Validates one variant. The floors, and the reasoning behind them, live in the catalogue. */\nexport function validateTheme(theme: ThemeVariant): ThemeFinding[] {\n const record = catalogue.find((entry) => entry.id === theme.id)\n if (!record) {\n return [{ themeId: theme.id, role: 'id', message: `${theme.id} is not in the catalogue` }]\n }\n return validateCatalogue([record]).map(toFinding)\n}\n\n/** Validates the whole registry, including the catalogue-level invariants. */\nexport function validateThemeRegistry(\n themes: readonly ThemeVariant[] = builtinThemes\n): ThemeFinding[] {\n const records = themes\n .map((theme) => catalogue.find((entry) => entry.id === theme.id))\n .filter((record): record is AdeaThemeRecord => !!record)\n\n const orphaned = themes\n .filter((theme) => !hasTheme(theme.id))\n .map((theme) => ({\n themeId: theme.id,\n role: 'id',\n message: `${theme.id} is in the registry but not in the catalogue`,\n }))\n\n return [...orphaned, ...validateCatalogue(records).map(toFinding)]\n}\n\nexport const defaultLightThemeId = 'adea-light'\nexport const defaultDarkThemeId = 'adea-dark'\n\n/** Re-exported so a consumer measuring a colour does not need a second import. */\nexport { contrastRatio } from '@adea-ai/themes'\n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,MAAM,MAAM,MAAM,EAAE;EACjC,aAAa,MAAM,MAAM,MAAM,EAAE;CACnC;AACF;AAgBA,SAAS,UAAU,SAAwC;CACzD,OAAO;EAAE,SAAS,QAAQ;EAAS,MAAM,QAAQ;EAAM,SAAS,QAAQ;CAAQ;AAClF;;AAGA,SAAgB,cAAc,OAAqC;CACjE,MAAM,SAASA,OAAU,MAAM,UAAU,MAAM,OAAO,MAAM,EAAE;CAC9D,IAAI,CAAC,QACH,OAAO,CAAC;EAAE,SAAS,MAAM;EAAI,MAAM;EAAM,SAAS,GAAG,MAAM,GAAG;CAA0B,CAAC;CAE3F,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS;AAClD;;AAGA,SAAgB,sBACd,WAAkC,eAClB;CAChB,MAAM,UAAUC,SACb,KAAK,UAAUD,OAAU,MAAM,UAAU,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC,CAChE,QAAQ,WAAsC,CAAC,CAAC,MAAM;CAUzD,OAAO,CAAC,GARSC,SACd,QAAQ,UAAU,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC,CACtC,KAAK,WAAW;EACf,SAAS,MAAM;EACf,MAAM;EACN,SAAS,GAAG,MAAM,GAAG;CACvB,EAES,GAAU,GAAG,kBAAkB,OAAO,CAAC,CAAC,IAAI,SAAS,CAAC;AACnE;AAEA,IAAa,sBAAsB;AACnC,IAAa,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"themes.js","names":["catalogue","themes"],"sources":["../../src/lib/themes.ts"],"sourcesContent":["/**\n * The theme registry, now a bridge.\n *\n * The catalogue itself lives in `@adea-ai/themes`. This module is what is left in\n * the design system: the translation between the catalogue's **canonical** role\n * names and the **shadcn** vocabulary every component here is written against, plus\n * the handful of custom properties this system declares that are presentations of\n * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,\n * and `--chrome`.\n *\n * ## Why it is a bridge and not a copy\n *\n * This file used to hold thirteen themes as hand-written hex literal tables, with its\n * own contrast validator, its own terminal and editor palettes, and its own\n * provenance records. That is a lot of surface to maintain for one consumer of a\n * palette, and it meant every product that wanted the same themes — Adea, Cortana —\n * either imported this package or wrote its own. The catalogue moved out so that\n * there is one answer to \"what is Catppuccin Mocha\", and this file is the part that\n * genuinely belongs to the design system.\n *\n * It is deliberately thin. If you are looking for a colour, it is not here: see\n * `@adea-ai/themes`, whose README explains how the values are produced and whose\n * `NOTICE` records where every palette came from.\n *\n * ## The mapping, and the entry that is not a rename\n *\n * The package-owned `shadcnVariables` adapter maps canonical roles onto this\n * system's vocabulary. One entry will trip a reader: the catalogue's `accent`\n * becomes this system's `primary`, because in the shadcn vocabulary `--primary` is\n * the action colour — the fill of a primary button, the thing a focus ring is drawn\n * in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is\n * the former, so it goes to `--primary`, and `--accent` is filled from\n * `surfaceHover`, which is what shadcn components actually use it for.\n */\n\nimport {\n ACCENTS,\n accentForeground,\n accentRoles,\n chartSeries,\n getAccent,\n getTheme,\n hasTheme,\n shadcnDestructiveProjection,\n statusForeground,\n tint,\n primaryHover,\n primarySubtleCss,\n syntaxRoles,\n themes as catalogue,\n themesByAppearance,\n themeAccentPresets,\n validateCatalogue,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n type ContrastFinding,\n} from '@adea-ai/themes'\nimport { shadcnVariables } from '@adea-ai/themes/adapters/shadcn'\nimport { isThemeAccentId } from './theme-accents'\n\nexport { isThemeAccentId } from './theme-accents'\n\nexport type ThemeAppearance = 'light' | 'dark'\n\n/**\n * The surface and text roles, in shadcn's vocabulary.\n *\n * Named to match the components below, which is why they differ from the\n * catalogue's: these are this system's variable names, and renaming them would mean\n * touching every component in the library for no gain.\n */\nexport type ThemeColors = {\n background: string\n foreground: string\n card: string\n cardForeground: string\n popover: string\n popoverForeground: string\n primary: string\n primaryForeground: string\n secondary: string\n secondaryForeground: string\n muted: string\n mutedForeground: string\n accent: string\n accentForeground: string\n destructive: string\n destructiveForeground: string\n destructiveSubtle: string\n /** Contrast-safe solid-action presentation, derived from the canonical error role. */\n destructiveAction: string\n destructiveActionForeground: string\n success: string\n successForeground: string\n successSubtle: string\n warning: string\n warningForeground: string\n warningSubtle: string\n info: string\n infoForeground: string\n infoSubtle: string\n border: string\n input: string\n ring: string\n sidebar: string\n sidebarForeground: string\n sidebarAccent: string\n sidebarBorder: string\n sidebarMutedForeground: string\n}\n\n/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */\nexport type ThemeTerminalPalette = {\n background: string\n foreground: string\n cursor: string\n selection: string\n black: string\n red: string\n green: string\n yellow: string\n blue: string\n magenta: string\n cyan: string\n white: string\n brightBlack: string\n brightRed: string\n brightGreen: string\n brightYellow: string\n brightBlue: string\n brightMagenta: string\n brightCyan: string\n brightWhite: string\n}\n\n/** The syntax roles a code view needs. */\nexport type ThemeEditorPalette = {\n keyword: string\n string: string\n number: string\n comment: string\n function: string\n variable: string\n type: string\n tag: string\n attribute: string\n operator: string\n heading: string\n link: string\n diffAdd: string\n diffDelete: string\n diffHunk: string\n searchMatch: string\n}\n\n/** Where a palette came from, and the terms it is used under. */\nexport type ThemeProvenance = {\n /** The project or person the palette belongs to. */\n source: string\n url: string\n /** An SPDX identifier. Every palette in this catalogue is permissive. */\n license: string\n}\n\nexport type ThemeVariant = {\n /** The `data-theme` value and the id a preference stores. */\n id: string\n /** Groups the variants that came from one project. */\n family: string\n familyLabel: string\n label: string\n appearance: ThemeAppearance\n /** One line, shown in a picker. */\n description: string\n colors: ThemeColors\n terminal: ThemeTerminalPalette\n editor: ThemeEditorPalette\n /** The categorical series, in order. */\n chart: readonly string[]\n provenance: ThemeProvenance\n}\n\n/** Builds the design system's view of one catalogue entry. */\nfunction toVariant(theme: AdeaThemeRecord): ThemeVariant {\n const projected = shadcnVariables(theme)\n const token = (name: string): string => {\n const value = projected[`--${name}`]\n if (!value) throw new Error(`${theme.id} has no shared shadcn projection for --${name}`)\n return value\n }\n const destructiveAction = shadcnDestructiveProjection(theme)\n const colors: ThemeColors = {\n background: token('background'),\n foreground: token('foreground'),\n card: token('card'),\n cardForeground: token('card-foreground'),\n popover: token('popover'),\n popoverForeground: token('popover-foreground'),\n primary: token('primary'),\n primaryForeground: token('primary-foreground'),\n secondary: token('secondary'),\n secondaryForeground: token('secondary-foreground'),\n muted: token('muted'),\n mutedForeground: token('muted-foreground'),\n accent: token('accent'),\n accentForeground: token('accent-foreground'),\n // Preserve the UI's semantic error token. The Themes projection uses its\n // contrast-safe solid-action fill for --destructive; UI keeps that fill in\n // the separate destructiveAction pair below.\n destructive: theme.colors.error,\n destructiveForeground: statusForeground(theme, 'error'),\n destructiveSubtle: tint(theme.colors.error, theme.colors.background),\n destructiveAction: destructiveAction.fill,\n destructiveActionForeground: destructiveAction.foreground,\n success: token('success'),\n successForeground: statusForeground(theme, 'success'),\n successSubtle: tint(theme.colors.success, theme.colors.background),\n warning: token('warning'),\n warningForeground: statusForeground(theme, 'warning'),\n warningSubtle: tint(theme.colors.warning, theme.colors.background),\n info: token('info'),\n infoForeground: statusForeground(theme, 'info'),\n infoSubtle: tint(theme.colors.info, theme.colors.background),\n border: token('border'),\n input: token('input'),\n ring: token('ring'),\n sidebar: token('sidebar'),\n sidebarForeground: token('sidebar-foreground'),\n sidebarAccent: token('sidebar-accent'),\n sidebarBorder: token('sidebar-border'),\n sidebarMutedForeground: token('sidebar-muted-foreground'),\n }\n const syntax = syntaxRoles(theme)\n\n return {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n colors,\n terminal: {\n // The embedded terminal uses the theme's own canvas rather than a palette of its\n // own. The ANSI colours came from the palette that produced the canvas, so they\n // were chosen against it; a terminal on a different background would be the one\n // surface in the application not lit by the active theme.\n background: theme.colors.background,\n foreground: theme.colors.foreground,\n cursor: theme.cursor,\n selection: theme.selection,\n ...theme.ansi,\n },\n editor: {\n keyword: syntax.keyword,\n string: syntax.string,\n number: syntax.number,\n comment: syntax.comment,\n function: syntax.function,\n variable: syntax.variable,\n type: syntax.type,\n tag: syntax.tag,\n attribute: syntax.attribute,\n operator: syntax.operator,\n heading: syntax.heading,\n link: syntax.link,\n diffAdd: syntax.diffAdd,\n diffDelete: syntax.diffDelete,\n diffHunk: syntax.diffHunk,\n searchMatch: syntax.searchMatch,\n },\n chart: chartSeries(theme),\n provenance: {\n source: theme.provenance.project,\n url: theme.provenance.url,\n license: theme.provenance.license,\n },\n }\n}\n\n/**\n * A variant's `--primary-subtle`: the tint over `var(--primary)` at the strength its\n * catalogue record measures (`primarySubtleAlpha`). A variant that is not in the\n * catalogue has nothing to measure, and gets its appearance's ceiling.\n */\nexport function primarySubtleFor(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const record = getTheme(theme.id)\n return record ? primarySubtleCss(record) : primarySubtleCss(theme.appearance)\n}\n\n/** The catalogue, in catalogue order. */\nexport const builtinThemes: readonly ThemeVariant[] = Object.freeze(catalogue.map(toVariant))\n\nexport function themeById(id: string): ThemeVariant | undefined {\n if (!hasTheme(id)) return undefined\n return builtinThemes.find((theme) => theme.id === id)\n}\n\n/** The variants of one appearance, which is what a picker for that mode shows. */\nexport function themesForAppearance(appearance: ThemeAppearance): readonly ThemeVariant[] {\n const ids = new Set(themesByAppearance(appearance).map((theme) => theme.id))\n return builtinThemes.filter((theme) => ids.has(theme.id))\n}\n\n/** The families in the catalogue, in catalogue order. */\nexport function themeFamilies(): { family: string; label: string; themes: ThemeVariant[] }[] {\n const families = new Map<string, { family: string; label: string; themes: ThemeVariant[] }>()\n for (const theme of builtinThemes) {\n const entry = families.get(theme.family) ?? {\n family: theme.family,\n label: theme.familyLabel,\n themes: [],\n }\n entry.themes.push(theme)\n families.set(theme.family, entry)\n }\n return [...families.values()]\n}\n\n/** The accent presets, in the order a picker should show them. */\nexport const accents = ACCENTS\n\n/**\n * The canonical catalogue records, in catalogue order.\n *\n * {@link builtinThemes} is this system's projection of the catalogue onto the\n * shadcn vocabulary, which is what a document is painted with. A *preview* of a\n * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the\n * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),\n * several of which the projection folds together. These are those records, so a\n * consumer hands the editor exactly what it takes rather than reconstructing it\n * from the projection.\n */\nexport const themeRecords: readonly AdeaThemeRecord[] = catalogue\n\nexport function themeRecordById(id: string): AdeaThemeRecord | undefined {\n return getTheme(id)\n}\n\n/** A light/dark theme pair by id, with the defaults standing in for an unknown id. */\nfunction recordPair(lightThemeId: string, darkThemeId: string) {\n const light = getTheme(lightThemeId) ?? getTheme(defaultLightThemeId)!\n const dark = getTheme(darkThemeId) ?? getTheme(defaultDarkThemeId)!\n return { light, dark }\n}\n\n/**\n * The accents the selected light/dark pair carries — offered beside the presets.\n *\n * Computed per pair rather than per theme because a theme accent is a *pair* of\n * values, like a preset: a slot is offered only when both themes can offer it.\n */\nexport function themeAccentsFor(\n lightThemeId: string,\n darkThemeId: string\n): readonly AccentPreset[] {\n const { light, dark } = recordPair(lightThemeId, darkThemeId)\n return themeAccentPresets(light, dark)\n}\n\n/**\n * An accent id resolved against a theme pair: a preset, a theme accent the pair\n * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot\n * offer — each of which means \"use the theme's own primary\".\n *\n * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme\n * switch and resolves to the new theme's blue; when the new pair cannot offer the\n * slot it resolves to nothing, the same fallback a stale preset id gets.\n */\nexport function resolveAccentPreset(\n accentId: string,\n light: AdeaTheme,\n dark: AdeaTheme\n): AccentPreset | undefined {\n if (accentId === 'theme') return undefined\n const preset = getAccent(accentId)\n if (preset) return preset\n if (!isThemeAccentId(accentId)) return undefined\n return themeAccentPresets(light, dark).find((option) => option.id === accentId)\n}\n\n/**\n * A theme with an accent laid over it, in the catalogue's own shape.\n *\n * The accent replaces `accent` and its measured label, which is all an accent\n * changes about a theme; `undefined` returns the theme untouched. This is the\n * overlay a host needs for `AppearanceEditor`'s `lightTheme`/`darkTheme`.\n */\nexport function withAccent<T extends AdeaTheme>(theme: T, accent: AccentPreset | undefined): T {\n if (!accent) return theme\n const value = theme.appearance === 'dark' ? accent.dark : accent.light\n return {\n ...theme,\n colors: { ...theme.colors, accent: value, accentForeground: accentForeground(value) },\n }\n}\n\n/**\n * The two preview themes an appearance selection resolves to, accent applied.\n *\n * The adapter between a stored selection and `AppearanceEditor`: it takes ids —\n * what a preference holds — and returns the canonical records the editor's\n * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.\n * Unknown ids fall back to the defaults and an accent the pair cannot offer falls\n * back to the theme's own, exactly as `ThemeProvider` resolves them.\n */\nexport function appearancePreviewThemes(selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n}): { lightTheme: AdeaThemeRecord; darkTheme: AdeaThemeRecord } {\n const { light, dark } = recordPair(selection.lightThemeId, selection.darkThemeId)\n const accent = resolveAccentPreset(selection.accent, light, dark)\n return { lightTheme: withAccent(light, accent), darkTheme: withAccent(dark, accent) }\n}\n\n/**\n * The properties an accent selection overrides, as CSS custom properties.\n *\n * ## Why this exists rather than relying on the `[data-accent]` blocks\n *\n * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are\n * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's\n * whole role set onto `<html>` as *inline* custom properties, and an inline\n * declaration outranks any stylesheet selector regardless of specificity. The\n * attribute was set, the rules existed, the values were right, and every one of the\n * seven accents rendered as the same blue.\n *\n * The blocks are kept, because they are what styles the window between the document\n * arriving and the provider mounting — which is the whole reason `themeScript`\n * exists. But the authoritative value has to be applied by the same code that\n * applies the theme, from the same source, or the two can drift again. So both the\n * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and\n * `tests/appearance-axes.test.ts` asserts the two agree value for value.\n *\n * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,\n * so it is resolved against `pair` — the selection's light and dark theme ids —\n * and only ever applied here. Without a pair it resolves against the defaults.\n *\n * Returns `undefined` for `theme` — the variant's own primary — for an id the\n * catalogue does not have, and for a theme accent the pair does not offer, so a\n * stale stored preference falls back to the theme rather than blanking the primary.\n */\nexport function accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string } = {\n lightThemeId: defaultLightThemeId,\n darkThemeId: defaultDarkThemeId,\n }\n): Record<string, string> | undefined {\n if (accentId === 'theme') return undefined\n const { light, dark } = recordPair(pair.lightThemeId, pair.darkThemeId)\n const preset = resolveAccentPreset(accentId, light, dark)\n if (!preset) return undefined\n\n // `--primary-subtle` is deliberately not here. It is a `color-mix()` over\n // `var(--primary)`, so the theme's own declaration (`themeCssVariables`, or the\n // default block in `theme.css`) already follows the accent; and its strength is the\n // *theme's*, measured by `primarySubtleAlpha` to hold body text at 4.5:1 for every\n // accent the theme offers. Writing one here would replace that measured strength\n // with whatever this function was given, which is how an accent used to undo it.\n const roles = accentRoles(preset, appearance)\n return {\n '--primary': roles.primary,\n '--primary-foreground': roles.primaryForeground,\n '--primary-hover': roles.primaryHover,\n '--ring': roles.ring,\n }\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The one place that knows the mapping from a theme's roles to this system's variable\n * names. A provider applies this; nothing else repeats it. The `--terminal-*` and\n * `--editor-*` ramps are presentations of the catalogue's ANSI and syntax data rather\n * than separate roles, which is why they are built here and not in the catalogue.\n */\nexport function themeCssVariables(theme: ThemeVariant): Record<string, string> {\n const c = theme.colors\n const t = theme.terminal\n const e = theme.editor\n return {\n '--background': c.background,\n '--foreground': c.foreground,\n '--card': c.card,\n '--card-foreground': c.cardForeground,\n '--popover': c.popover,\n '--popover-foreground': c.popoverForeground,\n '--primary': c.primary,\n '--primary-foreground': c.primaryForeground,\n /*\n * The two tokens derived from the primary, and they are here rather than left to\n * `theme.css` because they must follow `--primary` — which this function writes\n * for *any* theme in the catalogue, not just the two defaults `theme.css` carries.\n *\n * `--primary-hover` is a resolved colour, not a `color-mix()`: a uniform hover\n * step cannot be expressed as a mix (see `primaryHover`). Left out, a theme switch\n * would keep the previous theme's hover on the new theme's primary.\n *\n * `--primary-subtle` is a mix over `--primary`, so it follows an accent on its\n * own, but its *strength* is per theme: `primarySubtleCss(record)` lowers the\n * appearance ceiling only as far as this theme needs for body text to clear 4.5:1\n * on the tint, over every surface, for every accent it offers. It has to be\n * written per theme for that reason — the appearance-wide value is not legible on\n * every palette.\n */\n '--primary-hover': primaryHover(c.primary, theme.appearance),\n '--primary-subtle': primarySubtleFor(theme),\n '--secondary': c.secondary,\n '--secondary-foreground': c.secondaryForeground,\n '--muted': c.muted,\n '--muted-foreground': c.mutedForeground,\n '--accent': c.accent,\n '--accent-foreground': c.accentForeground,\n '--destructive': c.destructive,\n '--destructive-foreground': c.destructiveForeground,\n '--destructive-subtle': c.destructiveSubtle,\n '--destructive-action': c.destructiveAction,\n '--destructive-action-foreground': c.destructiveActionForeground,\n '--success': c.success,\n '--success-foreground': c.successForeground,\n '--success-subtle': c.successSubtle,\n '--warning': c.warning,\n '--warning-foreground': c.warningForeground,\n '--warning-subtle': c.warningSubtle,\n '--info': c.info,\n '--info-foreground': c.infoForeground,\n '--info-subtle': c.infoSubtle,\n '--border': c.border,\n '--input': c.input,\n '--ring': c.ring,\n '--sidebar': c.sidebar,\n '--sidebar-foreground': c.sidebarForeground,\n '--sidebar-accent': c.sidebarAccent,\n '--sidebar-border': c.sidebarBorder,\n '--sidebar-primary': c.primary,\n '--sidebar-primary-foreground': c.primaryForeground,\n '--sidebar-ring': c.ring,\n '--sidebar-muted-foreground': c.sidebarMutedForeground,\n '--surface-sunken': c.muted,\n '--surface-hover': c.accent,\n '--surface-active': c.border,\n '--chrome': c.background,\n '--terminal-background': t.background,\n '--terminal-foreground': t.foreground,\n '--terminal-cursor': t.cursor,\n '--terminal-selection': t.selection,\n '--terminal-ansi-black': t.black,\n '--terminal-ansi-red': t.red,\n '--terminal-ansi-green': t.green,\n '--terminal-ansi-yellow': t.yellow,\n '--terminal-ansi-blue': t.blue,\n '--terminal-ansi-magenta': t.magenta,\n '--terminal-ansi-cyan': t.cyan,\n '--terminal-ansi-white': t.white,\n '--terminal-ansi-bright-black': t.brightBlack,\n '--terminal-ansi-bright-red': t.brightRed,\n '--terminal-ansi-bright-green': t.brightGreen,\n '--terminal-ansi-bright-yellow': t.brightYellow,\n '--terminal-ansi-bright-blue': t.brightBlue,\n '--terminal-ansi-bright-magenta': t.brightMagenta,\n '--terminal-ansi-bright-cyan': t.brightCyan,\n '--terminal-ansi-bright-white': t.brightWhite,\n '--editor-keyword': e.keyword,\n '--editor-string': e.string,\n '--editor-number': e.number,\n '--editor-comment': e.comment,\n '--editor-function': e.function,\n '--editor-variable': e.variable,\n '--editor-type': e.type,\n '--editor-tag': e.tag,\n '--editor-attribute': e.attribute,\n '--editor-operator': e.operator,\n '--editor-heading': e.heading,\n '--editor-link': e.link,\n '--editor-diff-add': e.diffAdd,\n '--editor-diff-delete': e.diffDelete,\n '--editor-diff-hunk': e.diffHunk,\n '--editor-search-match': e.searchMatch,\n '--chart-1': theme.chart[0] ?? c.primary,\n '--chart-2': theme.chart[1] ?? c.info,\n '--chart-3': theme.chart[2] ?? c.success,\n '--chart-4': theme.chart[3] ?? c.warning,\n '--chart-5': theme.chart[4] ?? c.destructive,\n '--chart-6': theme.chart[5] ?? c.mutedForeground,\n }\n}\n\n/* ---------------------------------------------------------------------------\n * Validation\n *\n * Delegated. The floors are the catalogue's, because they are what makes the\n * catalogue able to hold other people's palettes at all, and a second set of floors\n * here would be a second answer to the same question — and the one that drifts.\n * ------------------------------------------------------------------------- */\n\nexport type ThemeFinding = {\n themeId: string\n role: string\n message: string\n}\n\nfunction toFinding(finding: ContrastFinding): ThemeFinding {\n return { themeId: finding.themeId, role: finding.role, message: finding.message }\n}\n\n/** Validates one variant. The floors, and the reasoning behind them, live in the catalogue. */\nexport function validateTheme(theme: ThemeVariant): ThemeFinding[] {\n const record = catalogue.find((entry) => entry.id === theme.id)\n if (!record) {\n return [{ themeId: theme.id, role: 'id', message: `${theme.id} is not in the catalogue` }]\n }\n return validateCatalogue([record]).map(toFinding)\n}\n\n/** Validates the whole registry, including the catalogue-level invariants. */\nexport function validateThemeRegistry(\n themes: readonly ThemeVariant[] = builtinThemes\n): ThemeFinding[] {\n const records = themes\n .map((theme) => catalogue.find((entry) => entry.id === theme.id))\n .filter((record): record is AdeaThemeRecord => !!record)\n\n const orphaned = themes\n .filter((theme) => !hasTheme(theme.id))\n .map((theme) => ({\n themeId: theme.id,\n role: 'id',\n message: `${theme.id} is in the registry but not in the catalogue`,\n }))\n\n return [...orphaned, ...validateCatalogue(records).map(toFinding)]\n}\n\nexport const defaultLightThemeId = 'adea-light'\nexport const defaultDarkThemeId = 'adea-dark'\n\n/** Re-exported so a consumer measuring a colour does not need a second import. */\nexport { contrastRatio } from '@adea-ai/themes'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwLA,SAAS,UAAU,OAAsC;CACvD,MAAM,YAAY,gBAAgB,KAAK;CACvC,MAAM,SAAS,SAAyB;EACtC,MAAM,QAAQ,UAAU,KAAK;EAC7B,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG,yCAAyC,MAAM;EACvF,OAAO;CACT;CACA,MAAM,oBAAoB,4BAA4B,KAAK;CAC3D,MAAM,SAAsB;EAC1B,YAAY,MAAM,YAAY;EAC9B,YAAY,MAAM,YAAY;EAC9B,MAAM,MAAM,MAAM;EAClB,gBAAgB,MAAM,iBAAiB;EACvC,SAAS,MAAM,SAAS;EACxB,mBAAmB,MAAM,oBAAoB;EAC7C,SAAS,MAAM,SAAS;EACxB,mBAAmB,MAAM,oBAAoB;EAC7C,WAAW,MAAM,WAAW;EAC5B,qBAAqB,MAAM,sBAAsB;EACjD,OAAO,MAAM,OAAO;EACpB,iBAAiB,MAAM,kBAAkB;EACzC,QAAQ,MAAM,QAAQ;EACtB,kBAAkB,MAAM,mBAAmB;EAI3C,aAAa,MAAM,OAAO;EA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;AAClD;;AAGA,SAAgB,sBACd,WAAkC,eAClB;CAChB,MAAM,UAAUC,SACb,KAAK,UAAUD,OAAU,MAAM,UAAU,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC,CAChE,QAAQ,WAAsC,CAAC,CAAC,MAAM;CAUzD,OAAO,CAAC,GARSC,SACd,QAAQ,UAAU,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC,CACtC,KAAK,WAAW;EACf,SAAS,MAAM;EACf,MAAM;EACN,SAAS,GAAG,MAAM,GAAG;CACvB,EAES,GAAU,GAAG,kBAAkB,OAAO,CAAC,CAAC,IAAI,SAAS,CAAC;AACnE;AAEA,IAAa,sBAAsB;AACnC,IAAa,qBAAqB"}
|
package/dist/r/lib.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Class-name and token helpers",
|
|
5
5
|
"description": "The private helpers the components import: the class-name merge, the variant recipes, the token manifest and the theme bridge. Installed automatically as a peer of any component that needs it.",
|
|
6
6
|
"dependencies": [
|
|
7
|
-
"@adea-ai/themes@^0.
|
|
7
|
+
"@adea-ai/themes@^0.10.4",
|
|
8
8
|
"class-variance-authority@^0.7.1",
|
|
9
9
|
"cn@^0.4.0"
|
|
10
10
|
],
|
package/dist/r/registry.json
CHANGED
|
@@ -1998,7 +1998,7 @@
|
|
|
1998
1998
|
"title": "Appearance Editor",
|
|
1999
1999
|
"description": "",
|
|
2000
2000
|
"dependencies": [
|
|
2001
|
-
"@adea-ai/themes@^0.
|
|
2001
|
+
"@adea-ai/themes@^0.10.4",
|
|
2002
2002
|
"@kobalte/core@^0.13.14",
|
|
2003
2003
|
"lucide-solid@^1.51.0"
|
|
2004
2004
|
],
|
|
@@ -2477,7 +2477,7 @@
|
|
|
2477
2477
|
"title": "Theming",
|
|
2478
2478
|
"description": "",
|
|
2479
2479
|
"dependencies": [
|
|
2480
|
-
"@adea-ai/themes@^0.
|
|
2480
|
+
"@adea-ai/themes@^0.10.4",
|
|
2481
2481
|
"@kobalte/core@^0.13.14",
|
|
2482
2482
|
"lucide-solid@^1.51.0"
|
|
2483
2483
|
],
|
|
@@ -2592,7 +2592,7 @@
|
|
|
2592
2592
|
"title": "Class-name and token helpers",
|
|
2593
2593
|
"description": "The private helpers the components import: the class-name merge, the variant recipes, the token manifest and the theme bridge. Installed automatically as a peer of any component that needs it.",
|
|
2594
2594
|
"dependencies": [
|
|
2595
|
-
"@adea-ai/themes@^0.
|
|
2595
|
+
"@adea-ai/themes@^0.10.4",
|
|
2596
2596
|
"class-variance-authority@^0.7.1",
|
|
2597
2597
|
"cn@^0.4.0"
|
|
2598
2598
|
],
|
package/dist/r/src/lib/themes.ts
CHANGED
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
*
|
|
25
25
|
* ## The mapping, and the entry that is not a rename
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
* entry will trip a reader: the catalogue's `accent`
|
|
29
|
-
* `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
-
* fill of a primary button, the thing a focus ring is drawn
|
|
31
|
-
* a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
-
* `--primary`, and `--accent` is filled from
|
|
33
|
-
* components actually use it for.
|
|
27
|
+
* The package-owned `shadcnVariables` adapter maps canonical roles onto this
|
|
28
|
+
* system's vocabulary. One entry will trip a reader: the catalogue's `accent`
|
|
29
|
+
* becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
+
* the action colour — the fill of a primary button, the thing a focus ring is drawn
|
|
31
|
+
* in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
+
* the former, so it goes to `--primary`, and `--accent` is filled from
|
|
33
|
+
* `surfaceHover`, which is what shadcn components actually use it for.
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
import {
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
type AdeaThemeRecord,
|
|
57
57
|
type ContrastFinding,
|
|
58
58
|
} from '@adea-ai/themes'
|
|
59
|
+
import { shadcnVariables } from '@adea-ai/themes/adapters/shadcn'
|
|
59
60
|
import { isThemeAccentId } from './theme-accents'
|
|
60
61
|
|
|
61
62
|
export { isThemeAccentId } from './theme-accents'
|
|
@@ -106,6 +107,7 @@ export type ThemeColors = {
|
|
|
106
107
|
sidebarForeground: string
|
|
107
108
|
sidebarAccent: string
|
|
108
109
|
sidebarBorder: string
|
|
110
|
+
sidebarMutedForeground: string
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */
|
|
@@ -179,75 +181,56 @@ export type ThemeVariant = {
|
|
|
179
181
|
provenance: ThemeProvenance
|
|
180
182
|
}
|
|
181
183
|
|
|
182
|
-
/**
|
|
183
|
-
* Canonical role → this system's `ThemeColors` key.
|
|
184
|
-
*
|
|
185
|
-
* Read by {@link toVariant}. The two derived destructive-action presentation values
|
|
186
|
-
* are intentionally excluded; the shared Themes adapter owns their color math.
|
|
187
|
-
*/
|
|
188
|
-
type ThemeRole = Exclude<keyof ThemeColors, 'destructiveAction' | 'destructiveActionForeground'>
|
|
189
|
-
|
|
190
|
-
const ROLE_FOR: Readonly<Record<ThemeRole, keyof AdeaThemeRecord['colors']>> = {
|
|
191
|
-
background: 'background',
|
|
192
|
-
foreground: 'text',
|
|
193
|
-
card: 'surface',
|
|
194
|
-
cardForeground: 'text',
|
|
195
|
-
popover: 'surfaceElevated',
|
|
196
|
-
popoverForeground: 'text',
|
|
197
|
-
// Not a rename — see this module's header.
|
|
198
|
-
primary: 'accent',
|
|
199
|
-
primaryForeground: 'accentForeground',
|
|
200
|
-
// shadcn's `secondary` and `muted` are both the first surface rung used as a fill.
|
|
201
|
-
secondary: 'surface',
|
|
202
|
-
secondaryForeground: 'text',
|
|
203
|
-
muted: 'surface',
|
|
204
|
-
mutedForeground: 'textMuted',
|
|
205
|
-
// shadcn's `accent` is a hover wash, which is exactly `surfaceHover`.
|
|
206
|
-
accent: 'surfaceHover',
|
|
207
|
-
accentForeground: 'text',
|
|
208
|
-
destructive: 'error',
|
|
209
|
-
// Overwritten below from the measured pairing; nominal here so the table is total.
|
|
210
|
-
destructiveForeground: 'error',
|
|
211
|
-
destructiveSubtle: 'error',
|
|
212
|
-
success: 'success',
|
|
213
|
-
successForeground: 'success',
|
|
214
|
-
successSubtle: 'success',
|
|
215
|
-
warning: 'warning',
|
|
216
|
-
warningForeground: 'warning',
|
|
217
|
-
warningSubtle: 'warning',
|
|
218
|
-
info: 'info',
|
|
219
|
-
infoForeground: 'info',
|
|
220
|
-
infoSubtle: 'info',
|
|
221
|
-
border: 'border',
|
|
222
|
-
input: 'border',
|
|
223
|
-
ring: 'accent',
|
|
224
|
-
sidebar: 'surface',
|
|
225
|
-
sidebarForeground: 'text',
|
|
226
|
-
sidebarAccent: 'surfaceHover',
|
|
227
|
-
sidebarBorder: 'border',
|
|
228
|
-
}
|
|
229
|
-
|
|
230
184
|
/** Builds the design system's view of one catalogue entry. */
|
|
231
185
|
function toVariant(theme: AdeaThemeRecord): ThemeVariant {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
186
|
+
const projected = shadcnVariables(theme)
|
|
187
|
+
const token = (name: string): string => {
|
|
188
|
+
const value = projected[`--${name}`]
|
|
189
|
+
if (!value) throw new Error(`${theme.id} has no shared shadcn projection for --${name}`)
|
|
190
|
+
return value
|
|
235
191
|
}
|
|
236
|
-
// Keep the semantic foreground paired with the canonical error role. Filled
|
|
237
|
-
// destructive actions use the distinct projection below so their /90 hover state
|
|
238
|
-
// remains readable without changing icons, borders, or tinted status surfaces.
|
|
239
|
-
colors.destructiveForeground = statusForeground(theme, 'error')
|
|
240
|
-
colors.destructiveSubtle = tint(theme.colors.error, theme.colors.background)
|
|
241
192
|
const destructiveAction = shadcnDestructiveProjection(theme)
|
|
242
|
-
colors
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
193
|
+
const colors: ThemeColors = {
|
|
194
|
+
background: token('background'),
|
|
195
|
+
foreground: token('foreground'),
|
|
196
|
+
card: token('card'),
|
|
197
|
+
cardForeground: token('card-foreground'),
|
|
198
|
+
popover: token('popover'),
|
|
199
|
+
popoverForeground: token('popover-foreground'),
|
|
200
|
+
primary: token('primary'),
|
|
201
|
+
primaryForeground: token('primary-foreground'),
|
|
202
|
+
secondary: token('secondary'),
|
|
203
|
+
secondaryForeground: token('secondary-foreground'),
|
|
204
|
+
muted: token('muted'),
|
|
205
|
+
mutedForeground: token('muted-foreground'),
|
|
206
|
+
accent: token('accent'),
|
|
207
|
+
accentForeground: token('accent-foreground'),
|
|
208
|
+
// Preserve the UI's semantic error token. The Themes projection uses its
|
|
209
|
+
// contrast-safe solid-action fill for --destructive; UI keeps that fill in
|
|
210
|
+
// the separate destructiveAction pair below.
|
|
211
|
+
destructive: theme.colors.error,
|
|
212
|
+
destructiveForeground: statusForeground(theme, 'error'),
|
|
213
|
+
destructiveSubtle: tint(theme.colors.error, theme.colors.background),
|
|
214
|
+
destructiveAction: destructiveAction.fill,
|
|
215
|
+
destructiveActionForeground: destructiveAction.foreground,
|
|
216
|
+
success: token('success'),
|
|
217
|
+
successForeground: statusForeground(theme, 'success'),
|
|
218
|
+
successSubtle: tint(theme.colors.success, theme.colors.background),
|
|
219
|
+
warning: token('warning'),
|
|
220
|
+
warningForeground: statusForeground(theme, 'warning'),
|
|
221
|
+
warningSubtle: tint(theme.colors.warning, theme.colors.background),
|
|
222
|
+
info: token('info'),
|
|
223
|
+
infoForeground: statusForeground(theme, 'info'),
|
|
224
|
+
infoSubtle: tint(theme.colors.info, theme.colors.background),
|
|
225
|
+
border: token('border'),
|
|
226
|
+
input: token('input'),
|
|
227
|
+
ring: token('ring'),
|
|
228
|
+
sidebar: token('sidebar'),
|
|
229
|
+
sidebarForeground: token('sidebar-foreground'),
|
|
230
|
+
sidebarAccent: token('sidebar-accent'),
|
|
231
|
+
sidebarBorder: token('sidebar-border'),
|
|
232
|
+
sidebarMutedForeground: token('sidebar-muted-foreground'),
|
|
233
|
+
}
|
|
251
234
|
const syntax = syntaxRoles(theme)
|
|
252
235
|
|
|
253
236
|
return {
|
|
@@ -556,7 +539,7 @@ export function themeCssVariables(theme: ThemeVariant): Record<string, string> {
|
|
|
556
539
|
'--sidebar-primary': c.primary,
|
|
557
540
|
'--sidebar-primary-foreground': c.primaryForeground,
|
|
558
541
|
'--sidebar-ring': c.ring,
|
|
559
|
-
'--sidebar-muted-foreground': c.
|
|
542
|
+
'--sidebar-muted-foreground': c.sidebarMutedForeground,
|
|
560
543
|
'--surface-sunken': c.muted,
|
|
561
544
|
'--surface-hover': c.accent,
|
|
562
545
|
'--surface-active': c.border,
|
package/dist/r/theming.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.0",
|
|
4
4
|
"description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adea",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"check:packed-paste-model": "node scripts/check-packed-paste-model.mjs"
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"@adea-ai/themes": "^0.
|
|
132
|
+
"@adea-ai/themes": "^0.10.4",
|
|
133
133
|
"@corvu/calendar": "^0.1.2",
|
|
134
134
|
"@corvu/drawer": "^0.2.4",
|
|
135
135
|
"@corvu/otp-field": "^0.1.4",
|
package/registry.json
CHANGED
|
@@ -1998,7 +1998,7 @@
|
|
|
1998
1998
|
"title": "Appearance Editor",
|
|
1999
1999
|
"description": "",
|
|
2000
2000
|
"dependencies": [
|
|
2001
|
-
"@adea-ai/themes@^0.
|
|
2001
|
+
"@adea-ai/themes@^0.10.4",
|
|
2002
2002
|
"@kobalte/core@^0.13.14",
|
|
2003
2003
|
"lucide-solid@^1.51.0"
|
|
2004
2004
|
],
|
|
@@ -2477,7 +2477,7 @@
|
|
|
2477
2477
|
"title": "Theming",
|
|
2478
2478
|
"description": "",
|
|
2479
2479
|
"dependencies": [
|
|
2480
|
-
"@adea-ai/themes@^0.
|
|
2480
|
+
"@adea-ai/themes@^0.10.4",
|
|
2481
2481
|
"@kobalte/core@^0.13.14",
|
|
2482
2482
|
"lucide-solid@^1.51.0"
|
|
2483
2483
|
],
|
|
@@ -2592,7 +2592,7 @@
|
|
|
2592
2592
|
"title": "Class-name and token helpers",
|
|
2593
2593
|
"description": "The private helpers the components import: the class-name merge, the variant recipes, the token manifest and the theme bridge. Installed automatically as a peer of any component that needs it.",
|
|
2594
2594
|
"dependencies": [
|
|
2595
|
-
"@adea-ai/themes@^0.
|
|
2595
|
+
"@adea-ai/themes@^0.10.4",
|
|
2596
2596
|
"class-variance-authority@^0.7.1",
|
|
2597
2597
|
"cn@^0.4.0"
|
|
2598
2598
|
],
|
package/src/lib/themes.ts
CHANGED
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
*
|
|
25
25
|
* ## The mapping, and the entry that is not a rename
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
* entry will trip a reader: the catalogue's `accent`
|
|
29
|
-
* `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
-
* fill of a primary button, the thing a focus ring is drawn
|
|
31
|
-
* a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
-
* `--primary`, and `--accent` is filled from
|
|
33
|
-
* components actually use it for.
|
|
27
|
+
* The package-owned `shadcnVariables` adapter maps canonical roles onto this
|
|
28
|
+
* system's vocabulary. One entry will trip a reader: the catalogue's `accent`
|
|
29
|
+
* becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
|
|
30
|
+
* the action colour — the fill of a primary button, the thing a focus ring is drawn
|
|
31
|
+
* in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
|
|
32
|
+
* the former, so it goes to `--primary`, and `--accent` is filled from
|
|
33
|
+
* `surfaceHover`, which is what shadcn components actually use it for.
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
import {
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
type AdeaThemeRecord,
|
|
57
57
|
type ContrastFinding,
|
|
58
58
|
} from '@adea-ai/themes'
|
|
59
|
+
import { shadcnVariables } from '@adea-ai/themes/adapters/shadcn'
|
|
59
60
|
import { isThemeAccentId } from './theme-accents'
|
|
60
61
|
|
|
61
62
|
export { isThemeAccentId } from './theme-accents'
|
|
@@ -106,6 +107,7 @@ export type ThemeColors = {
|
|
|
106
107
|
sidebarForeground: string
|
|
107
108
|
sidebarAccent: string
|
|
108
109
|
sidebarBorder: string
|
|
110
|
+
sidebarMutedForeground: string
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */
|
|
@@ -179,75 +181,56 @@ export type ThemeVariant = {
|
|
|
179
181
|
provenance: ThemeProvenance
|
|
180
182
|
}
|
|
181
183
|
|
|
182
|
-
/**
|
|
183
|
-
* Canonical role → this system's `ThemeColors` key.
|
|
184
|
-
*
|
|
185
|
-
* Read by {@link toVariant}. The two derived destructive-action presentation values
|
|
186
|
-
* are intentionally excluded; the shared Themes adapter owns their color math.
|
|
187
|
-
*/
|
|
188
|
-
type ThemeRole = Exclude<keyof ThemeColors, 'destructiveAction' | 'destructiveActionForeground'>
|
|
189
|
-
|
|
190
|
-
const ROLE_FOR: Readonly<Record<ThemeRole, keyof AdeaThemeRecord['colors']>> = {
|
|
191
|
-
background: 'background',
|
|
192
|
-
foreground: 'text',
|
|
193
|
-
card: 'surface',
|
|
194
|
-
cardForeground: 'text',
|
|
195
|
-
popover: 'surfaceElevated',
|
|
196
|
-
popoverForeground: 'text',
|
|
197
|
-
// Not a rename — see this module's header.
|
|
198
|
-
primary: 'accent',
|
|
199
|
-
primaryForeground: 'accentForeground',
|
|
200
|
-
// shadcn's `secondary` and `muted` are both the first surface rung used as a fill.
|
|
201
|
-
secondary: 'surface',
|
|
202
|
-
secondaryForeground: 'text',
|
|
203
|
-
muted: 'surface',
|
|
204
|
-
mutedForeground: 'textMuted',
|
|
205
|
-
// shadcn's `accent` is a hover wash, which is exactly `surfaceHover`.
|
|
206
|
-
accent: 'surfaceHover',
|
|
207
|
-
accentForeground: 'text',
|
|
208
|
-
destructive: 'error',
|
|
209
|
-
// Overwritten below from the measured pairing; nominal here so the table is total.
|
|
210
|
-
destructiveForeground: 'error',
|
|
211
|
-
destructiveSubtle: 'error',
|
|
212
|
-
success: 'success',
|
|
213
|
-
successForeground: 'success',
|
|
214
|
-
successSubtle: 'success',
|
|
215
|
-
warning: 'warning',
|
|
216
|
-
warningForeground: 'warning',
|
|
217
|
-
warningSubtle: 'warning',
|
|
218
|
-
info: 'info',
|
|
219
|
-
infoForeground: 'info',
|
|
220
|
-
infoSubtle: 'info',
|
|
221
|
-
border: 'border',
|
|
222
|
-
input: 'border',
|
|
223
|
-
ring: 'accent',
|
|
224
|
-
sidebar: 'surface',
|
|
225
|
-
sidebarForeground: 'text',
|
|
226
|
-
sidebarAccent: 'surfaceHover',
|
|
227
|
-
sidebarBorder: 'border',
|
|
228
|
-
}
|
|
229
|
-
|
|
230
184
|
/** Builds the design system's view of one catalogue entry. */
|
|
231
185
|
function toVariant(theme: AdeaThemeRecord): ThemeVariant {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
186
|
+
const projected = shadcnVariables(theme)
|
|
187
|
+
const token = (name: string): string => {
|
|
188
|
+
const value = projected[`--${name}`]
|
|
189
|
+
if (!value) throw new Error(`${theme.id} has no shared shadcn projection for --${name}`)
|
|
190
|
+
return value
|
|
235
191
|
}
|
|
236
|
-
// Keep the semantic foreground paired with the canonical error role. Filled
|
|
237
|
-
// destructive actions use the distinct projection below so their /90 hover state
|
|
238
|
-
// remains readable without changing icons, borders, or tinted status surfaces.
|
|
239
|
-
colors.destructiveForeground = statusForeground(theme, 'error')
|
|
240
|
-
colors.destructiveSubtle = tint(theme.colors.error, theme.colors.background)
|
|
241
192
|
const destructiveAction = shadcnDestructiveProjection(theme)
|
|
242
|
-
colors
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
193
|
+
const colors: ThemeColors = {
|
|
194
|
+
background: token('background'),
|
|
195
|
+
foreground: token('foreground'),
|
|
196
|
+
card: token('card'),
|
|
197
|
+
cardForeground: token('card-foreground'),
|
|
198
|
+
popover: token('popover'),
|
|
199
|
+
popoverForeground: token('popover-foreground'),
|
|
200
|
+
primary: token('primary'),
|
|
201
|
+
primaryForeground: token('primary-foreground'),
|
|
202
|
+
secondary: token('secondary'),
|
|
203
|
+
secondaryForeground: token('secondary-foreground'),
|
|
204
|
+
muted: token('muted'),
|
|
205
|
+
mutedForeground: token('muted-foreground'),
|
|
206
|
+
accent: token('accent'),
|
|
207
|
+
accentForeground: token('accent-foreground'),
|
|
208
|
+
// Preserve the UI's semantic error token. The Themes projection uses its
|
|
209
|
+
// contrast-safe solid-action fill for --destructive; UI keeps that fill in
|
|
210
|
+
// the separate destructiveAction pair below.
|
|
211
|
+
destructive: theme.colors.error,
|
|
212
|
+
destructiveForeground: statusForeground(theme, 'error'),
|
|
213
|
+
destructiveSubtle: tint(theme.colors.error, theme.colors.background),
|
|
214
|
+
destructiveAction: destructiveAction.fill,
|
|
215
|
+
destructiveActionForeground: destructiveAction.foreground,
|
|
216
|
+
success: token('success'),
|
|
217
|
+
successForeground: statusForeground(theme, 'success'),
|
|
218
|
+
successSubtle: tint(theme.colors.success, theme.colors.background),
|
|
219
|
+
warning: token('warning'),
|
|
220
|
+
warningForeground: statusForeground(theme, 'warning'),
|
|
221
|
+
warningSubtle: tint(theme.colors.warning, theme.colors.background),
|
|
222
|
+
info: token('info'),
|
|
223
|
+
infoForeground: statusForeground(theme, 'info'),
|
|
224
|
+
infoSubtle: tint(theme.colors.info, theme.colors.background),
|
|
225
|
+
border: token('border'),
|
|
226
|
+
input: token('input'),
|
|
227
|
+
ring: token('ring'),
|
|
228
|
+
sidebar: token('sidebar'),
|
|
229
|
+
sidebarForeground: token('sidebar-foreground'),
|
|
230
|
+
sidebarAccent: token('sidebar-accent'),
|
|
231
|
+
sidebarBorder: token('sidebar-border'),
|
|
232
|
+
sidebarMutedForeground: token('sidebar-muted-foreground'),
|
|
233
|
+
}
|
|
251
234
|
const syntax = syntaxRoles(theme)
|
|
252
235
|
|
|
253
236
|
return {
|
|
@@ -556,7 +539,7 @@ export function themeCssVariables(theme: ThemeVariant): Record<string, string> {
|
|
|
556
539
|
'--sidebar-primary': c.primary,
|
|
557
540
|
'--sidebar-primary-foreground': c.primaryForeground,
|
|
558
541
|
'--sidebar-ring': c.ring,
|
|
559
|
-
'--sidebar-muted-foreground': c.
|
|
542
|
+
'--sidebar-muted-foreground': c.sidebarMutedForeground,
|
|
560
543
|
'--surface-sunken': c.muted,
|
|
561
544
|
'--surface-hover': c.accent,
|
|
562
545
|
'--surface-active': c.border,
|