@adea-ai/themes 0.11.6 → 0.11.12

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.
Files changed (103) hide show
  1. package/README.md +46 -0
  2. package/dist/accents.d.ts +19 -19
  3. package/dist/accents.d.ts.map +1 -1
  4. package/dist/accents.js +45 -93
  5. package/dist/accents.js.map +1 -1
  6. package/dist/adapters/base24.d.ts +21 -12
  7. package/dist/adapters/base24.d.ts.map +1 -1
  8. package/dist/adapters/base24.js +47 -72
  9. package/dist/adapters/base24.js.map +1 -1
  10. package/dist/adapters/css-variables.d.ts +29 -0
  11. package/dist/adapters/css-variables.d.ts.map +1 -0
  12. package/dist/adapters/css-variables.js +56 -0
  13. package/dist/adapters/css-variables.js.map +1 -0
  14. package/dist/adapters/css.d.ts +2 -4
  15. package/dist/adapters/css.d.ts.map +1 -1
  16. package/dist/adapters/css.js +7 -39
  17. package/dist/adapters/css.js.map +1 -1
  18. package/dist/adapters/shadcn.d.ts +8 -4
  19. package/dist/adapters/shadcn.d.ts.map +1 -1
  20. package/dist/adapters/shadcn.js +38 -57
  21. package/dist/adapters/shadcn.js.map +1 -1
  22. package/dist/adapters/shiki.d.ts +2 -10
  23. package/dist/adapters/shiki.d.ts.map +1 -1
  24. package/dist/adapters/shiki.js +16 -29
  25. package/dist/adapters/shiki.js.map +1 -1
  26. package/dist/adapters/tailwind.d.ts +3 -3
  27. package/dist/adapters/tailwind.d.ts.map +1 -1
  28. package/dist/adapters/tailwind.js +7 -28
  29. package/dist/adapters/tailwind.js.map +1 -1
  30. package/dist/adapters/xterm.d.ts.map +1 -1
  31. package/dist/adapters/xterm.js +9 -21
  32. package/dist/adapters/xterm.js.map +1 -1
  33. package/dist/base24-synthesis.d.ts +31 -0
  34. package/dist/base24-synthesis.d.ts.map +1 -0
  35. package/dist/base24-synthesis.js +25 -0
  36. package/dist/base24-synthesis.js.map +1 -0
  37. package/dist/derive.d.ts +1 -1
  38. package/dist/derive.d.ts.map +1 -1
  39. package/dist/derive.js +11 -26
  40. package/dist/derive.js.map +1 -1
  41. package/dist/index.d.ts +6 -5
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +6 -5
  44. package/dist/index.js.map +1 -1
  45. package/dist/normalize.d.ts +0 -8
  46. package/dist/normalize.d.ts.map +1 -1
  47. package/dist/normalize.js +105 -232
  48. package/dist/normalize.js.map +1 -1
  49. package/dist/oklch.d.ts +4 -10
  50. package/dist/oklch.d.ts.map +1 -1
  51. package/dist/oklch.js +18 -38
  52. package/dist/oklch.js.map +1 -1
  53. package/dist/policy.d.ts +14 -4
  54. package/dist/policy.d.ts.map +1 -1
  55. package/dist/policy.js +16 -4
  56. package/dist/policy.js.map +1 -1
  57. package/dist/render.d.ts +30 -0
  58. package/dist/render.d.ts.map +1 -0
  59. package/dist/render.js +74 -0
  60. package/dist/render.js.map +1 -0
  61. package/dist/schema.d.ts +2 -1
  62. package/dist/schema.d.ts.map +1 -1
  63. package/dist/schema.js +2 -1
  64. package/dist/schema.js.map +1 -1
  65. package/dist/sources.d.ts +26 -33
  66. package/dist/sources.d.ts.map +1 -1
  67. package/dist/sources.js +136 -305
  68. package/dist/sources.js.map +1 -1
  69. package/dist/step-search.d.ts +10 -0
  70. package/dist/step-search.d.ts.map +1 -0
  71. package/dist/step-search.js +21 -0
  72. package/dist/step-search.js.map +1 -0
  73. package/dist/theme-token-projection-script.d.ts +2 -0
  74. package/dist/theme-token-projection-script.js +2 -0
  75. package/dist/theme-token-projection.d.ts +35 -0
  76. package/dist/theme-token-projection.d.ts.map +1 -0
  77. package/dist/theme-token-projection.js +79 -0
  78. package/dist/theme-token-projection.js.map +1 -0
  79. package/dist/validate.d.ts +12 -17
  80. package/dist/validate.d.ts.map +1 -1
  81. package/dist/validate.js +33 -55
  82. package/dist/validate.js.map +1 -1
  83. package/package.json +14 -4
  84. package/src/accents.ts +57 -96
  85. package/src/adapters/base24.ts +53 -75
  86. package/src/adapters/css-variables.ts +67 -0
  87. package/src/adapters/css.ts +9 -54
  88. package/src/adapters/shadcn.ts +34 -60
  89. package/src/adapters/shiki.ts +17 -30
  90. package/src/adapters/tailwind.ts +7 -37
  91. package/src/adapters/xterm.ts +9 -21
  92. package/src/base24-synthesis.ts +29 -0
  93. package/src/derive.ts +12 -27
  94. package/src/index.ts +6 -5
  95. package/src/normalize.ts +140 -267
  96. package/src/oklch.ts +23 -38
  97. package/src/policy.ts +18 -4
  98. package/src/render.ts +82 -0
  99. package/src/schema.ts +2 -1
  100. package/src/sources.ts +160 -330
  101. package/src/step-search.ts +25 -0
  102. package/src/theme-token-projection.ts +126 -0
  103. package/src/validate.ts +46 -66
package/README.md CHANGED
@@ -79,6 +79,52 @@ palettes and catalogue tooling. Its 16 KiB uncompressed ceiling leaves headroom
79
79
  for one record and the terminal adapter while detecting catalogue inclusion.
80
80
  This package still has no runtime dependencies.
81
81
 
82
+ ### Projecting an existing token map
83
+
84
+ The projection API is not present in published `@adea-ai/themes` 0.11.7; use a
85
+ later release that includes this change. It provides a declarative projector for
86
+ consumers that need to derive missing custom properties from an older stored token
87
+ map. The runtime API returns a new map and never mutates or persists the input:
88
+
89
+ ```ts
90
+ import { projectThemeTokens } from '@adea-ai/themes/theme-token-projection'
91
+ import { themeTokenProjectionBundle } from '@adea-ai/themes/theme-token-projection/script'
92
+
93
+ const sidebarProjection = [
94
+ { target: '--sidebar', source: '--card' },
95
+ {
96
+ target: '--sidebar-foreground',
97
+ source: '--card-foreground',
98
+ contrast: { against: '--sidebar', minimum: 4.5 },
99
+ },
100
+ ] as const
101
+
102
+ const hydratedTokens = projectThemeTokens(storedTokens, sidebarProjection)
103
+ ```
104
+
105
+ Projection rules are plain data: each rule names a source and destination, with an
106
+ optional contrast floor for a generated value. Rules run in order, so a generated
107
+ surface can anchor a later foreground. Existing destination tokens are preserved
108
+ exactly, including explicit values that do not meet the requested floor.
109
+
110
+ The `/script` export is a self-contained JavaScript **expression string** built from
111
+ the same projector and colour routines as the runtime API. Use it in a pre-paint
112
+ script after parsing the token map; pass the map as a variable and serialize only
113
+ application-owned rule data. Escaping `<` keeps the serialized rules safe to embed in
114
+ an inline `<script>` element:
115
+
116
+ ```ts
117
+ const serializedRules = JSON.stringify(sidebarProjection).replaceAll('<', '\\u003c')
118
+ const prepaintCall = `(${themeTokenProjectionBundle})(tokens, ${serializedRules})`
119
+ // Include `prepaintCall` in the script after `tokens` has been parsed.
120
+ ```
121
+
122
+ Do not serialize callbacks or interpolate stored token values into executable
123
+ source. The expression evaluates to `(tokens, rules) => projectedTokens`; it adds
124
+ only missing tokens and does not write to storage. A malformed or translucent color
125
+ is preserved when it cannot be measured safely; use
126
+ `projectThemeTokensDetailed` to inspect unsupported colors or unreachable floors.
127
+
82
128
  ```ts
83
129
  import { getTheme, themeFamilies, resolveTheme } from '@adea-ai/themes'
84
130
  import { themeCssVariables } from '@adea-ai/themes/adapters/css'
package/dist/accents.d.ts CHANGED
@@ -11,14 +11,10 @@
11
11
  *
12
12
  * They are colour data with a light/dark pair per preset — structurally the same
13
13
  * thing as a theme's primary, and the last colour a consumer should have to author
14
- * itself. Keeping them in a consumer meant two things that must agree lived in two
15
- * places: the preset list, and the CSS blocks generated from it. They were written
16
- * by hand in both, and they drifted — the generated default moved its hover *toward*
17
- * the canvas while every hand-written accent moved *away*, so the default primary
18
- * button hovered backwards and picking any accent silently fixed it.
19
- *
20
- * Here the values and the derivation are one module, so a consumer emits both from
21
- * the same rule and cannot produce that disagreement.
14
+ * itself. With the values and the derivation in one module, a consumer emits the
15
+ * preset list and its CSS from the same rule, and the two cannot drift apart — as
16
+ * they did when a consumer hand-wrote both and its default primary hovered the
17
+ * opposite way to every other accent.
22
18
  *
23
19
  * ## The hover rule
24
20
  *
@@ -28,7 +24,7 @@
28
24
  * Two rules were tried here before this one, and both are worth recording because
29
25
  * each looks right until it is measured:
30
26
  *
31
- * - **Toward `--background`** — what the consumer used to do. Inverted in both
27
+ * - **Toward `--background`** — inverted in both
32
28
  * appearances: it moves the button toward the page it sits on, so a hovered button
33
29
  * recedes.
34
30
  * - **Toward `--foreground`** — correct in principle, since the foreground is
@@ -126,7 +122,7 @@ export declare const ACCENT_HOVER_STEP = 0.05;
126
122
  * be written as a mix — see {@link ACCENT_HOVER_STEP}. That means it does **not**
127
123
  * follow `--primary` on its own, so a consumer that applies themes at runtime has to
128
124
  * write this token too; the alternative is a hover left over from the previous
129
- * theme's primary. `themeCssVariables` includes it for that reason.
125
+ * theme's primary. `shadcnVariables` includes it for that reason.
130
126
  *
131
127
  * The direction is away from the canvas: darker on a light theme, lighter on a dark
132
128
  * one. `shiftLightness` keeps chroma and hue and damps chroma near the extremes, so a
@@ -168,16 +164,20 @@ export declare const ACCENT_SUBTLE_MINIMUM_ALPHA = 4;
168
164
  *
169
165
  * True when `text` and `foreground` both clear `CONTRAST_FLOORS.text` on the tint
170
166
  * at `alpha` percent composited over `surface`, for every primary the theme offers
171
- * and every one in `primaries`. At `alpha` 0 it is the bare surface. The
172
- * normalizer calls this to fit the hover rung, and {@link primarySubtleAlpha} to
173
- * fit the strength, so the two are measured by one rule.
167
+ * and every one in `primaries`. At `alpha` 0 it is the bare surface.
174
168
  */
175
169
  export declare function primaryTintClears(theme: TintedTheme, surface: string, alpha: number, primaries?: readonly string[]): boolean;
170
+ /**
171
+ * {@link primaryTintClears} for one theme and set of primaries, measuring the
172
+ * foregrounds and the offered primaries once for every surface and alpha it is
173
+ * asked about. The normalizer uses it to fit the interaction rungs.
174
+ */
175
+ export declare function tintCheck(theme: TintedTheme, primaries?: readonly string[]): (surface: string, alpha: number) => boolean;
176
176
  /**
177
177
  * The tint strength a theme can carry, as a whole percentage.
178
178
  *
179
- * The appearance's {@link ACCENT_SUBTLE_ALPHA} ceiling, lowered one point at a time
180
- * until body text clears `CONTRAST_FLOORS.text` on the tint over every floored
179
+ * The appearance's {@link ACCENT_SUBTLE_ALPHA} ceiling, lowered to the highest whole
180
+ * percentage at which body text clears `CONTRAST_FLOORS.text` on the tint over every floored
181
181
  * surface, hover rung included, for every primary the theme offers. One value per
182
182
  * theme rather than one per accent, so switching between offered accents at runtime
183
183
  * needs no new tint: the expression follows `--primary` and the strength already
@@ -201,10 +201,10 @@ export declare function primarySubtleAlpha(theme: TintedTheme, primaries?: reado
201
201
  * it as `primaries` to have the strength measured for it as well.
202
202
  *
203
203
  * Passing only an **appearance** gives the {@link ACCENT_SUBTLE_ALPHA} ceiling for
204
- * that appearance, unmeasured. That is the old behaviour and it is not legible on
205
- * every theme — One Dark's body text on its own primary's tint over a card measures
206
- * 4.34:1 at the dark ceiling — so it is kept for a consumer without a theme object
207
- * in hand, not as the default to reach for.
204
+ * that appearance, unmeasured. It is not legible on every theme — One Dark's body
205
+ * text on its own primary's tint over a card measures 4.34:1 at the dark ceiling —
206
+ * so it is kept for a consumer without a theme object in hand, not as the default
207
+ * to reach for.
208
208
  */
209
209
  export declare function primarySubtleCss(target: ThemeAppearance | TintedTheme, primaryVariable?: string, primaries?: readonly string[]): string;
210
210
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"accents.d.ts","sourceRoot":"","sources":["../src/accents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAW,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAU7F,OAAO,EACL,iBAAiB,EAIlB,MAAM,aAAa,CAAA;AAEpB,0DAA0D;AAC1D,MAAM,MAAM,YAAY,GAAG;IACzB,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAA;IACnB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,EAAE,SAAS,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AM,EAAO,GAChC,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,WAAW,EAClB,SAAS,GAAE,SAAS,MAAM,EAAO,GAChC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAY7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAQhG;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,eAAe,GAAG,WAAW,EACrC,eAAe,SAAc,EAC7B,SAAS,GAAE,SAAS,MAAM,EAAO,GAChC,MAAM,CAIR;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AA2ChE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,YAAY,EAAE,CAgBpF;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,YAAY;AACpB;;;;GAIG;AACH,MAAM,EAAE,eAAe,GAAG,WAAW;AACrC,qFAAqF;AACrF,eAAe,SAAc,GAC5B,WAAW,CAab"}
package/dist/accents.js CHANGED
@@ -11,14 +11,10 @@
11
11
  *
12
12
  * They are colour data with a light/dark pair per preset — structurally the same
13
13
  * thing as a theme's primary, and the last colour a consumer should have to author
14
- * itself. Keeping them in a consumer meant two things that must agree lived in two
15
- * places: the preset list, and the CSS blocks generated from it. They were written
16
- * by hand in both, and they drifted — the generated default moved its hover *toward*
17
- * the canvas while every hand-written accent moved *away*, so the default primary
18
- * button hovered backwards and picking any accent silently fixed it.
19
- *
20
- * Here the values and the derivation are one module, so a consumer emits both from
21
- * the same rule and cannot produce that disagreement.
14
+ * itself. With the values and the derivation in one module, a consumer emits the
15
+ * preset list and its CSS from the same rule, and the two cannot drift apart — as
16
+ * they did when a consumer hand-wrote both and its default primary hovered the
17
+ * opposite way to every other accent.
22
18
  *
23
19
  * ## The hover rule
24
20
  *
@@ -28,7 +24,7 @@
28
24
  * Two rules were tried here before this one, and both are worth recording because
29
25
  * each looks right until it is measured:
30
26
  *
31
- * - **Toward `--background`** — what the consumer used to do. Inverted in both
27
+ * - **Toward `--background`** — inverted in both
32
28
  * appearances: it moves the button toward the page it sits on, so a hovered button
33
29
  * recedes.
34
30
  * - **Toward `--foreground`** — correct in principle, since the foreground is
@@ -64,8 +60,10 @@
64
60
  * text sits closest to the floor get a lighter wash, and the colour, the
65
61
  * foreground and the surfaces stay exactly as their authors wrote them.
66
62
  */
67
- import { contrastRatio, formatOklch, hexToOklch, oklchToHex, parseColor, shiftLightness, } from './oklch.js';
68
- import { ACCENT_PREFERENCE, CONTRAST_FLOORS, MINIMUM_ACCENT_CHROMA, REPAIR_BUDGET, } from './policy.js';
63
+ import { canonical, contrastDirection, contrastRatio, formatOklch, parseColor, shiftLightness, } from './oklch.js';
64
+ import { ACCENT_PREFERENCE, CONTRAST_FLOORS, MINIMUM_ACCENT_CHROMA, REPAIR_BUDGET, REPAIR_STEP, } from './policy.js';
65
+ import { compositeOver, mostContrasting, renderedColor } from './render.js';
66
+ import { smallestOffset } from './step-search.js';
69
67
  /**
70
68
  * The presets.
71
69
  *
@@ -144,8 +142,7 @@ export function accentForeground(accent) {
144
142
  return 'oklch(1 0 0)';
145
143
  const black = { l: 0, c: 0, h: 0 };
146
144
  const white = { l: 1, c: 0, h: 0 };
147
- const best = contrastRatio(black, fill) >= contrastRatio(white, fill) ? black : white;
148
- return formatOklch(best);
145
+ return formatOklch(mostContrasting(fill, [black, white]));
149
146
  }
150
147
  /** The contrast the chosen label achieves, for validation and reporting. */
151
148
  export function accentForegroundContrast(accent) {
@@ -174,7 +171,7 @@ export const ACCENT_HOVER_STEP = 0.05;
174
171
  * be written as a mix — see {@link ACCENT_HOVER_STEP}. That means it does **not**
175
172
  * follow `--primary` on its own, so a consumer that applies themes at runtime has to
176
173
  * write this token too; the alternative is a hover left over from the previous
177
- * theme's primary. `themeCssVariables` includes it for that reason.
174
+ * theme's primary. `shadcnVariables` includes it for that reason.
178
175
  *
179
176
  * The direction is away from the canvas: darker on a light theme, lighter on a dark
180
177
  * one. `shiftLightness` keeps chroma and hue and damps chroma near the extremes, so a
@@ -254,60 +251,37 @@ function offeredPrimaries(theme) {
254
251
  ]),
255
252
  ];
256
253
  }
257
- /** A colour as the screen draws it: through eight-bit sRGB. */
258
- function rendered(value) {
259
- const parsed = parseColor(value);
260
- return parsed ? hexToOklch(oklchToHex(parsed)) : undefined;
261
- }
262
- /**
263
- * A translucent fill painted over an opaque one, the way a browser paints
264
- * `color-mix(in oklch, <tint> N%, transparent)`: the mix keeps the tint's colour and
265
- * takes the share as alpha, and the alpha is composited in gamma-encoded sRGB.
266
- * Rounded to the eight-bit value that reaches the screen, which is the colour an
267
- * accessibility audit samples.
268
- */
269
- function compositeTint(tint, surface, alpha) {
270
- const tintColor = parseColor(tint);
271
- const surfaceColor = parseColor(surface);
272
- if (!tintColor || !surfaceColor)
273
- return undefined;
274
- const front = oklchToHex(tintColor);
275
- const back = oklchToHex(surfaceColor);
276
- const channels = [1, 3, 5].map((offset) => {
277
- const top = Number.parseInt(front.slice(offset, offset + 2), 16);
278
- const bottom = Number.parseInt(back.slice(offset, offset + 2), 16);
279
- return Math.round(top * alpha + bottom * (1 - alpha))
280
- .toString(16)
281
- .padStart(2, '0');
282
- });
283
- return hexToOklch(`#${channels.join('')}`);
284
- }
285
254
  /**
286
255
  * Whether body text holds the floor on a surface under the primary tint.
287
256
  *
288
257
  * True when `text` and `foreground` both clear `CONTRAST_FLOORS.text` on the tint
289
258
  * at `alpha` percent composited over `surface`, for every primary the theme offers
290
- * and every one in `primaries`. At `alpha` 0 it is the bare surface. The
291
- * normalizer calls this to fit the hover rung, and {@link primarySubtleAlpha} to
292
- * fit the strength, so the two are measured by one rule.
259
+ * and every one in `primaries`. At `alpha` 0 it is the bare surface.
293
260
  */
294
261
  export function primaryTintClears(theme, surface, alpha, primaries = []) {
295
- const foregrounds = [...new Set([theme.colors.text, theme.colors.foreground])].map(rendered);
262
+ return tintCheck(theme, primaries)(surface, alpha);
263
+ }
264
+ /**
265
+ * {@link primaryTintClears} for one theme and set of primaries, measuring the
266
+ * foregrounds and the offered primaries once for every surface and alpha it is
267
+ * asked about. The normalizer uses it to fit the interaction rungs.
268
+ */
269
+ export function tintCheck(theme, primaries = []) {
270
+ const foregrounds = [...new Set([theme.colors.text, theme.colors.foreground])].map(renderedColor);
296
271
  if (foregrounds.some((value) => value === undefined))
297
- return false;
298
- const tints = alpha === 0 ? [surface] : [...new Set([...offeredPrimaries(theme), ...primaries])];
299
- return tints.every((tint) => {
300
- const fill = compositeTint(tint, surface, alpha / 100);
301
- return (fill !== undefined &&
302
- foregrounds.every((foreground) => contrastRatio(foreground, fill) >= CONTRAST_FLOORS.text));
303
- });
272
+ return () => false;
273
+ const tints = [...new Set([...offeredPrimaries(theme), ...primaries])];
274
+ const legibleOn = (fill) => fill !== undefined &&
275
+ foregrounds.every((foreground) => contrastRatio(foreground, fill) >= CONTRAST_FLOORS.text);
276
+ return (surface, alpha) => alpha === 0
277
+ ? legibleOn(renderedColor(surface))
278
+ : tints.every((tint) => legibleOn(compositeOver(tint, surface, alpha / 100)));
304
279
  }
305
- const subtleAlphaCache = new WeakMap();
306
280
  /**
307
281
  * The tint strength a theme can carry, as a whole percentage.
308
282
  *
309
- * The appearance's {@link ACCENT_SUBTLE_ALPHA} ceiling, lowered one point at a time
310
- * until body text clears `CONTRAST_FLOORS.text` on the tint over every floored
283
+ * The appearance's {@link ACCENT_SUBTLE_ALPHA} ceiling, lowered to the highest whole
284
+ * percentage at which body text clears `CONTRAST_FLOORS.text` on the tint over every floored
311
285
  * surface, hover rung included, for every primary the theme offers. One value per
312
286
  * theme rather than one per accent, so switching between offered accents at runtime
313
287
  * needs no new tint: the expression follows `--primary` and the strength already
@@ -319,25 +293,12 @@ const subtleAlphaCache = new WeakMap();
319
293
  * a product's own brand primary, say. The offered set is always included.
320
294
  */
321
295
  export function primarySubtleAlpha(theme, primaries = []) {
322
- // Theme records are mutable; an identity-only cache can return a strength for
323
- // colours that are no longer present on the same object.
324
- const inputs = JSON.stringify([
325
- theme.appearance,
326
- theme.colors,
327
- theme.ansi,
328
- theme.shadcn,
329
- ACCENTS,
330
- primaries,
331
- ]);
332
- const cached = subtleAlphaCache.get(theme);
333
- if (cached?.inputs === inputs)
334
- return cached.alpha;
335
296
  const surfaces = tintSurfaces(theme);
336
- const clears = (alpha) => surfaces.every((surface) => primaryTintClears(theme, surface, alpha, primaries));
297
+ const check = tintCheck(theme, primaries);
298
+ const clears = (alpha) => surfaces.every((surface) => check(surface, alpha));
337
299
  let alpha = ACCENT_SUBTLE_ALPHA[theme.appearance];
338
300
  while (alpha > 0 && !clears(alpha))
339
301
  alpha -= 1;
340
- subtleAlphaCache.set(theme, { inputs, alpha });
341
302
  return alpha;
342
303
  }
343
304
  /**
@@ -352,16 +313,15 @@ export function primarySubtleAlpha(theme, primaries = []) {
352
313
  * it as `primaries` to have the strength measured for it as well.
353
314
  *
354
315
  * Passing only an **appearance** gives the {@link ACCENT_SUBTLE_ALPHA} ceiling for
355
- * that appearance, unmeasured. That is the old behaviour and it is not legible on
356
- * every theme — One Dark's body text on its own primary's tint over a card measures
357
- * 4.34:1 at the dark ceiling — so it is kept for a consumer without a theme object
358
- * in hand, not as the default to reach for.
316
+ * that appearance, unmeasured. It is not legible on every theme — One Dark's body
317
+ * text on its own primary's tint over a card measures 4.34:1 at the dark ceiling —
318
+ * so it is kept for a consumer without a theme object in hand, not as the default
319
+ * to reach for.
359
320
  */
360
321
  export function primarySubtleCss(target, primaryVariable = '--primary', primaries = []) {
361
322
  const alpha = typeof target === 'string' ? ACCENT_SUBTLE_ALPHA[target] : primarySubtleAlpha(target, primaries);
362
323
  return `color-mix(in oklch, var(${primaryVariable}) ${alpha}%, transparent)`;
363
324
  }
364
- const REPAIR_STEP = 0.002;
365
325
  /**
366
326
  * A slot's offerable value on one theme: the palette's own colour when it already
367
327
  * clears the accent floors on that theme's canvas, otherwise the catalogue's
@@ -378,27 +338,19 @@ function offeredSlotValue(theme, slot) {
378
338
  return undefined;
379
339
  if (value.c < MINIMUM_ACCENT_CHROMA)
380
340
  return undefined;
381
- // Measured in the canonical form the offer commits, so a repair cannot
382
- // converge on a value that rounding then pushes back below the floor.
383
341
  const clearsFloors = (candidate) => {
384
- const canonical = parseColor(formatOklch(candidate));
385
- if (!canonical)
386
- return false;
387
- return (contrastRatio(canonical, background) >= CONTRAST_FLOORS.accentRaised &&
388
- accentForegroundContrast(formatOklch(canonical)) >= CONTRAST_FLOORS.accentForeground);
342
+ const committed = canonical(candidate);
343
+ return (contrastRatio(committed, background) >= CONTRAST_FLOORS.accentRaised &&
344
+ accentForegroundContrast(formatOklch(committed)) >= CONTRAST_FLOORS.accentForeground);
389
345
  };
390
346
  if (clearsFloors(value))
391
347
  return original;
392
- const direction = value.l >= background.l ? 1 : -1;
393
- const maximumSteps = Math.floor(REPAIR_BUDGET.accent / REPAIR_STEP);
394
- for (let index = 1; index <= maximumSteps; index += 1) {
395
- const candidate = { ...value, l: value.l + direction * REPAIR_STEP * index };
396
- if (candidate.l <= 0 || candidate.l >= 1)
397
- break;
398
- if (clearsFloors(candidate))
399
- return formatOklch(candidate);
400
- }
401
- return undefined;
348
+ const shifted = (offset) => ({ ...value, l: value.l + offset });
349
+ const offset = smallestOffset(REPAIR_STEP, Math.floor(REPAIR_BUDGET.accent / REPAIR_STEP), [contrastDirection(value, background)], (trial) => {
350
+ const candidate = shifted(trial);
351
+ return candidate.l > 0 && candidate.l < 1 && clearsFloors(candidate);
352
+ });
353
+ return offset === undefined ? undefined : formatOklch(shifted(offset));
402
354
  }
403
355
  /**
404
356
  * The accent slots the theme pair offers, ordered by preference, floors enforced.
@@ -1 +1 @@
1
- {"version":3,"file":"accents.js","sourceRoot":"","sources":["../src/accents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAIH,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,aAAa,GACd,MAAM,aAAa,CAAA;AAepB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAA4B,MAAM,CAAC,MAAM,CAAC;IAC5D;QACE,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,2BAA2B;QACxC,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,gDAAgD;QAC7D,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,gEAAgE;QAC7E,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,+DAA+D;QAC5E,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EA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AAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,EAAE,EAAE,QAAQ,IAAI,EAAE;QAClB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,WAAW,EAAE,mBAAmB,IAAI,UAAU;QAC9C,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC,CAAC,CAAA;AACL,CAAC;AAkBD,MAAM,UAAU,WAAW,CACzB,MAAoB;AACpB;;;;GAIG;AACH,MAAqC;AACrC,qFAAqF;AACrF,eAAe,GAAG,WAAW;IAE7B,MAAM,UAAU,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAA;IAC1E,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC7C,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAEpD,OAAO;QACL,OAAO;QACP,iBAAiB,EAAE,gBAAgB,CAAC,KAAK,CAAC;QAC1C,YAAY,EAAE,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC;QAC7C,aAAa,EAAE,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,EAAE,OAAO;KACd,CAAA;AACH,CAAC"}
@@ -21,8 +21,8 @@
21
21
  * `base09` (orange) and `base0F` (brown) have no counterpart in the canonical
22
22
  * schema: Adea has no "constant" or "deprecated" role, because a UI does not. On
23
23
  * export they are re-derived from `red` and `yellow` by a fixed rotation, and
24
- * {@link AdeaThemeRecord} carries the vendored schemes separately for callers who
25
- * need the originals byte-for-byte. Round-tripping is therefore lossless for every
24
+ * `getBase24Scheme` returns the vendored schemes for callers who need the
25
+ * originals byte-for-byte. Round-tripping is therefore lossless for every
26
26
  * role Adea models, and explicitly approximate for the two it does not — rather
27
27
  * than silently lossy, which is what an unnamed slot would have been.
28
28
  */
@@ -44,17 +44,16 @@ export interface Base24Scheme {
44
44
  /**
45
45
  * What each slot means, in the specification's own terms.
46
46
  *
47
- * Kept as data because the normalizer reads it rather than hard-coding slot names
48
- * in its logic, and because it is the documentation a reader needs to check that
49
- * the mapping is right.
47
+ * The documentation a reader needs to check the mappings below against the
48
+ * specification.
50
49
  */
51
50
  export declare const BASE24_SLOT_MEANING: Readonly<Record<Base24Slot, string>>;
52
51
  /**
53
- * Base24 slot → ANSI role.
52
+ * ANSI role → Base24 slot.
54
53
  *
55
- * `black`, `white` and `brightBlack` are absent because Base24 does not name them:
56
- * the background and foreground slots do double duty. The normalizer decides those
57
- * three; see its `ANSI_FROM_BASE24` note for why the choice is the one it is.
54
+ * `black`, `brightBlack`, `white` and `brightWhite` are absent because Base24 does
55
+ * not name them: the background and foreground slots do double duty. The
56
+ * normalizer decides those four; see its `buildAnsiRamp` note for why.
58
57
  */
59
58
  export declare const BASE24_TO_ANSI: Readonly<{
60
59
  readonly red: 'base08';
@@ -88,9 +87,11 @@ export declare const ANSI_TO_BASE24: Readonly<{
88
87
  /**
89
88
  * How each semantic role is written back to a Base24 slot on export.
90
89
  *
91
- * The choices are not arbitrary. `base01` receives `black` rather than the
92
- * background because an ANSI black that equals the background is invisible as
93
- * foreground text — which is precisely the defect the import side documents. The
90
+ * The accent and status roles are absent because their slots belong to the ANSI
91
+ * hues: `base08`–`base0E` are written from `BASE24_TO_ANSI`, the colours a terminal
92
+ * reads, not from the repaired UI roles. `base01` receives `black` rather than a
93
+ * role because an ANSI black that equals the background is invisible as foreground
94
+ * text — the defect the import side documents. The
94
95
  * surface ladder has no Base24 slot at all, so it is deliberately absent here:
95
96
  * Base24 cannot express it, and pretending otherwise by packing four rungs into
96
97
  * `base01`/`base02` would make the export lie about what it preserves.
@@ -117,5 +118,13 @@ export declare function toBase24(theme: AdeaTheme, options?: {
117
118
  }): Base24Scheme;
118
119
  /** Serialises a scheme to the YAML dialect Base24 schemes are published in. */
119
120
  export declare function formatBase24Scheme(scheme: Base24Scheme): string;
121
+ /**
122
+ * Reads the YAML dialect Base24 schemes are published in.
123
+ *
124
+ * Hand-written rather than pulled from a YAML library: the format is a fixed set
125
+ * of scalar keys, the package has no runtime dependencies, and a general parser would accept
126
+ * documents this bridge cannot actually honour. Anything outside the specification
127
+ * is rejected loudly instead of being parsed into a half-scheme.
128
+ */
120
129
  export declare function parseBase24Scheme(source: string): Base24Scheme;
121
130
  //# sourceMappingURL=base24.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base24.d.ts","sourceRoot":"","sources":["../../src/adapters/base24.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAY,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAGxC,+EAA+E;AAC/E,eAAO,MAAM,YAAY,YACvB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CACA,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtD,uFAAuF;AACvF,MAAM,MAAM,aAA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