@adea-ai/themes 0.9.8 → 0.9.10
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/accents.d.ts +95 -11
- package/dist/accents.d.ts.map +1 -1
- package/dist/accents.js +179 -9
- package/dist/accents.js.map +1 -1
- package/dist/adapters/shadcn.d.ts.map +1 -1
- package/dist/adapters/shadcn.js +3 -2
- package/dist/adapters/shadcn.js.map +1 -1
- package/dist/generated/themes/ayu-light.js +2 -2
- package/dist/generated/themes/one-dark.js +2 -2
- package/dist/generated/themes/rosepine-dawn.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/normalize.d.ts +2 -65
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.js +73 -74
- package/dist/normalize.js.map +1 -1
- package/dist/policy.d.ts +76 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +81 -0
- package/dist/policy.js.map +1 -0
- package/dist/validate.d.ts +5 -4
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +9 -4
- package/dist/validate.js.map +1 -1
- package/package.json +5 -5
- package/src/accents.ts +220 -16
- package/src/adapters/shadcn.ts +3 -2
- package/src/generated/themes/ayu-light.ts +2 -2
- package/src/generated/themes/one-dark.ts +2 -2
- package/src/generated/themes/rosepine-dawn.ts +1 -1
- package/src/index.ts +3 -0
- package/src/normalize.ts +103 -77
- package/src/policy.ts +86 -0
- package/src/validate.ts +9 -4
package/dist/accents.d.ts
CHANGED
|
@@ -42,9 +42,30 @@
|
|
|
42
42
|
* A uniform step needs a resolved value, which is why {@link primaryHover} returns
|
|
43
43
|
* one and why the tint below can stay an expression. `shiftLightness` is what keeps
|
|
44
44
|
* the step uniform *and* the hue intact — a mix toward a neutral cannot do both.
|
|
45
|
+
*
|
|
46
|
+
* ## The tint rule
|
|
47
|
+
*
|
|
48
|
+
* The tint is the selected state across the component library — `bg-primary-subtle
|
|
49
|
+
* text-foreground` on an active nav row, a pressed toggle, the highlighted command
|
|
50
|
+
* row, a selected tab — so body text on it is held to the body floor, on every
|
|
51
|
+
* surface body text is held to it on, for every accent the theme offers.
|
|
52
|
+
*
|
|
53
|
+
* It stays a translucent `color-mix()` rather than becoming an opaque value, and
|
|
54
|
+
* that is a measured choice rather than a habit. An opaque tint mixed into the
|
|
55
|
+
* canvas is legible everywhere by construction — the status `-subtle` fills work
|
|
56
|
+
* that way — but it is a wash *of the canvas*: on a dark theme's popover, which is
|
|
57
|
+
* already lighter than the canvas, a selected command row resolved that way lands
|
|
58
|
+
* within ΔE 0.01 of the popover and disappears. A translucent tint is a wash of
|
|
59
|
+
* whatever it sits on, so it reads as selected on every rung.
|
|
60
|
+
*
|
|
61
|
+
* What moves instead is the **strength**, per theme. {@link ACCENT_SUBTLE_ALPHA} is
|
|
62
|
+
* the ceiling, and {@link primarySubtleAlpha} lowers it — only as far as a theme
|
|
63
|
+
* needs — until the composite clears the floor everywhere. The palettes whose body
|
|
64
|
+
* text sits closest to the floor get a lighter wash, and the colour, the
|
|
65
|
+
* foreground and the surfaces stay exactly as their authors wrote them.
|
|
45
66
|
*/
|
|
46
|
-
import type { AdeaTheme, ThemeAppearance } from './schema.js';
|
|
47
|
-
import { ACCENT_PREFERENCE } from './
|
|
67
|
+
import type { AdeaTheme, ShadcnThemeProjection, ThemeAppearance } from './schema.js';
|
|
68
|
+
import { ACCENT_PREFERENCE } from './policy.js';
|
|
48
69
|
/** One accent preset: a named primary, per appearance. */
|
|
49
70
|
export type AccentPreset = {
|
|
50
71
|
/** The `data-accent` value. */
|
|
@@ -113,23 +134,79 @@ export declare const ACCENT_HOVER_STEP = 0.05;
|
|
|
113
134
|
*/
|
|
114
135
|
export declare function primaryHover(primary: string, appearance: ThemeAppearance): string;
|
|
115
136
|
/**
|
|
116
|
-
* How much of the primary a tint carries, per appearance.
|
|
137
|
+
* How much of the primary a tint carries at most, per appearance.
|
|
117
138
|
*
|
|
118
139
|
* Not one value, because a tint's visibility depends on what it is tinted onto: the
|
|
119
140
|
* same alpha over a near-black surface reads as nothing, and over a near-white one
|
|
120
141
|
* reads as a wash. The dark value is the larger for exactly that reason.
|
|
121
142
|
*
|
|
143
|
+
* A **ceiling**, not the value every theme gets: {@link primarySubtleAlpha} lowers
|
|
144
|
+
* it for a theme whose body text cannot hold the floor on a tint this strong. Most
|
|
145
|
+
* themes keep it.
|
|
146
|
+
*
|
|
122
147
|
* This one *is* a `color-mix()`, because a tint is a share of the primary by nature
|
|
123
148
|
* and follows `--primary` correctly at runtime.
|
|
124
149
|
*/
|
|
125
150
|
export declare const ACCENT_SUBTLE_ALPHA: Readonly<Record<ThemeAppearance, number>>;
|
|
151
|
+
/** A theme, with the presentation surfaces the shadcn bridge may substitute. */
|
|
152
|
+
type TintedTheme = Pick<AdeaTheme, 'appearance' | 'colors' | 'ansi'> & {
|
|
153
|
+
shadcn?: ShadcnThemeProjection;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* The weakest tint the catalogue will ship, as a whole percentage.
|
|
157
|
+
*
|
|
158
|
+
* {@link primarySubtleAlpha} lowers a theme's strength for legibility, and this is
|
|
159
|
+
* how far it may go: below it the selected state stops reading as a state at all.
|
|
160
|
+
* The normalizer reserves it — it fits a theme's hover rung so body text still
|
|
161
|
+
* clears the floor under a tint this strong — so every theme in the catalogue can
|
|
162
|
+
* carry at least this much. At 4% the tint over One Dark's popover measures ΔE 0.018
|
|
163
|
+
* against the popover, about the same as its hover rung's feedback there.
|
|
164
|
+
*/
|
|
165
|
+
export declare const ACCENT_SUBTLE_MINIMUM_ALPHA = 4;
|
|
166
|
+
/**
|
|
167
|
+
* Whether body text holds the floor on a surface under the primary tint.
|
|
168
|
+
*
|
|
169
|
+
* True when `text` and `foreground` both clear `CONTRAST_FLOORS.text` on the tint
|
|
170
|
+
* 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.
|
|
174
|
+
*/
|
|
175
|
+
export declare function primaryTintClears(theme: TintedTheme, surface: string, alpha: number, primaries?: readonly string[]): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* The tint strength a theme can carry, as a whole percentage.
|
|
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
|
|
181
|
+
* surface, hover rung included, for every primary the theme offers. One value per
|
|
182
|
+
* theme rather than one per accent, so switching between offered accents at runtime
|
|
183
|
+
* needs no new tint: the expression follows `--primary` and the strength already
|
|
184
|
+
* holds for all of them. Every catalogue theme lands at or above
|
|
185
|
+
* {@link ACCENT_SUBTLE_MINIMUM_ALPHA}, because the normalizer fits its hover rung to
|
|
186
|
+
* leave room for it.
|
|
187
|
+
*
|
|
188
|
+
* Pass `primaries` to hold the strength for colours outside the offered set too —
|
|
189
|
+
* a product's own brand primary, say. The offered set is always included.
|
|
190
|
+
*/
|
|
191
|
+
export declare function primarySubtleAlpha(theme: TintedTheme, primaries?: readonly string[]): number;
|
|
126
192
|
/**
|
|
127
193
|
* The tint expression, for any primary.
|
|
128
194
|
*
|
|
129
|
-
*
|
|
130
|
-
* {@link
|
|
195
|
+
* Pass the **theme**: the expression then carries that theme's measured strength
|
|
196
|
+
* ({@link primarySubtleAlpha}) and body text on it is held to the floor for every
|
|
197
|
+
* accent the theme offers. It still reads `var(--primary)`, so it follows a runtime
|
|
198
|
+
* accent switch — but the strength is the theme's, so a consumer that applies
|
|
199
|
+
* themes at runtime has to write this token per theme, as it already does for
|
|
200
|
+
* {@link primaryHover}. A consumer whose primary is not one the theme offers passes
|
|
201
|
+
* it as `primaries` to have the strength measured for it as well.
|
|
202
|
+
*
|
|
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.
|
|
131
208
|
*/
|
|
132
|
-
export declare function primarySubtleCss(
|
|
209
|
+
export declare function primarySubtleCss(target: ThemeAppearance | TintedTheme, primaryVariable?: string, primaries?: readonly string[]): string;
|
|
133
210
|
/**
|
|
134
211
|
* ## The accents a theme offers
|
|
135
212
|
*
|
|
@@ -161,10 +238,10 @@ export declare function themeAccentPresets(light: AdeaTheme, dark: AdeaTheme): A
|
|
|
161
238
|
/**
|
|
162
239
|
* The five declarations an accent sets, as CSS values.
|
|
163
240
|
*
|
|
164
|
-
* `primary`, `primaryForeground` and `ring` are resolved colours;
|
|
165
|
-
* `primarySubtle`
|
|
166
|
-
* writes them as custom properties and the rules hold for every theme and
|
|
167
|
-
* accent at once.
|
|
241
|
+
* `primary`, `primaryForeground`, `primaryHover` and `ring` are resolved colours;
|
|
242
|
+
* `primarySubtle` is an expression, for the reason in the module comment. A
|
|
243
|
+
* consumer writes them as custom properties and the rules hold for every theme and
|
|
244
|
+
* every accent at once.
|
|
168
245
|
*/
|
|
169
246
|
export type AccentRoles = {
|
|
170
247
|
primary: string;
|
|
@@ -173,7 +250,14 @@ export type AccentRoles = {
|
|
|
173
250
|
primarySubtle: string;
|
|
174
251
|
ring: string;
|
|
175
252
|
};
|
|
176
|
-
export declare function accentRoles(preset: AccentPreset,
|
|
253
|
+
export declare function accentRoles(preset: AccentPreset,
|
|
254
|
+
/**
|
|
255
|
+
* The theme the accent is applied to, or only its appearance. A theme gives the
|
|
256
|
+
* tint that theme's measured strength — see {@link primarySubtleCss}; an
|
|
257
|
+
* appearance gives the unmeasured ceiling.
|
|
258
|
+
*/
|
|
259
|
+
target: ThemeAppearance | TintedTheme,
|
|
177
260
|
/** The property the subtle tint is built from. A consumer may pass its own alias. */
|
|
178
261
|
primaryVariable?: string): AccentRoles;
|
|
262
|
+
export {};
|
|
179
263
|
//# sourceMappingURL=accents.d.ts.map
|
package/dist/accents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accents.d.ts","sourceRoot":"","sources":["../src/accents.ts"],"names":[],"mappings":"AAAA
|
|
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,YAAY,EA2CzC,CAAA;AAEF,mFAAmF;AACnF,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAsD,CAAA;AAE9F,8BAA8B;AAC9B,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE9D;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAErF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG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AAS,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
|
@@ -42,9 +42,30 @@
|
|
|
42
42
|
* A uniform step needs a resolved value, which is why {@link primaryHover} returns
|
|
43
43
|
* one and why the tint below can stay an expression. `shiftLightness` is what keeps
|
|
44
44
|
* the step uniform *and* the hue intact — a mix toward a neutral cannot do both.
|
|
45
|
+
*
|
|
46
|
+
* ## The tint rule
|
|
47
|
+
*
|
|
48
|
+
* The tint is the selected state across the component library — `bg-primary-subtle
|
|
49
|
+
* text-foreground` on an active nav row, a pressed toggle, the highlighted command
|
|
50
|
+
* row, a selected tab — so body text on it is held to the body floor, on every
|
|
51
|
+
* surface body text is held to it on, for every accent the theme offers.
|
|
52
|
+
*
|
|
53
|
+
* It stays a translucent `color-mix()` rather than becoming an opaque value, and
|
|
54
|
+
* that is a measured choice rather than a habit. An opaque tint mixed into the
|
|
55
|
+
* canvas is legible everywhere by construction — the status `-subtle` fills work
|
|
56
|
+
* that way — but it is a wash *of the canvas*: on a dark theme's popover, which is
|
|
57
|
+
* already lighter than the canvas, a selected command row resolved that way lands
|
|
58
|
+
* within ΔE 0.01 of the popover and disappears. A translucent tint is a wash of
|
|
59
|
+
* whatever it sits on, so it reads as selected on every rung.
|
|
60
|
+
*
|
|
61
|
+
* What moves instead is the **strength**, per theme. {@link ACCENT_SUBTLE_ALPHA} is
|
|
62
|
+
* the ceiling, and {@link primarySubtleAlpha} lowers it — only as far as a theme
|
|
63
|
+
* needs — until the composite clears the floor everywhere. The palettes whose body
|
|
64
|
+
* text sits closest to the floor get a lighter wash, and the colour, the
|
|
65
|
+
* foreground and the surfaces stay exactly as their authors wrote them.
|
|
45
66
|
*/
|
|
46
|
-
import { contrastRatio, formatOklch, parseColor, shiftLightness } from './oklch.js';
|
|
47
|
-
import { ACCENT_PREFERENCE, CONTRAST_FLOORS, MINIMUM_ACCENT_CHROMA, REPAIR_BUDGET, } from './
|
|
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';
|
|
48
69
|
/**
|
|
49
70
|
* The presets.
|
|
50
71
|
*
|
|
@@ -167,12 +188,16 @@ export function primaryHover(primary, appearance) {
|
|
|
167
188
|
return formatOklch(shiftLightness(parsed, delta));
|
|
168
189
|
}
|
|
169
190
|
/**
|
|
170
|
-
* How much of the primary a tint carries, per appearance.
|
|
191
|
+
* How much of the primary a tint carries at most, per appearance.
|
|
171
192
|
*
|
|
172
193
|
* Not one value, because a tint's visibility depends on what it is tinted onto: the
|
|
173
194
|
* same alpha over a near-black surface reads as nothing, and over a near-white one
|
|
174
195
|
* reads as a wash. The dark value is the larger for exactly that reason.
|
|
175
196
|
*
|
|
197
|
+
* A **ceiling**, not the value every theme gets: {@link primarySubtleAlpha} lowers
|
|
198
|
+
* it for a theme whose body text cannot hold the floor on a tint this strong. Most
|
|
199
|
+
* themes keep it.
|
|
200
|
+
*
|
|
176
201
|
* This one *is* a `color-mix()`, because a tint is a share of the primary by nature
|
|
177
202
|
* and follows `--primary` correctly at runtime.
|
|
178
203
|
*/
|
|
@@ -180,14 +205,152 @@ export const ACCENT_SUBTLE_ALPHA = Object.freeze({
|
|
|
180
205
|
light: 10,
|
|
181
206
|
dark: 16,
|
|
182
207
|
});
|
|
208
|
+
/**
|
|
209
|
+
* The weakest tint the catalogue will ship, as a whole percentage.
|
|
210
|
+
*
|
|
211
|
+
* {@link primarySubtleAlpha} lowers a theme's strength for legibility, and this is
|
|
212
|
+
* how far it may go: below it the selected state stops reading as a state at all.
|
|
213
|
+
* The normalizer reserves it — it fits a theme's hover rung so body text still
|
|
214
|
+
* clears the floor under a tint this strong — so every theme in the catalogue can
|
|
215
|
+
* carry at least this much. At 4% the tint over One Dark's popover measures ΔE 0.018
|
|
216
|
+
* against the popover, about the same as its hover rung's feedback there.
|
|
217
|
+
*/
|
|
218
|
+
export const ACCENT_SUBTLE_MINIMUM_ALPHA = 4;
|
|
219
|
+
/**
|
|
220
|
+
* Every surface the tint is guaranteed on: every surface body text is guaranteed
|
|
221
|
+
* on.
|
|
222
|
+
*
|
|
223
|
+
* The canvas, the two raised rungs and the hover rung, plus whatever a source
|
|
224
|
+
* substitutes for them in the shadcn bridge — `--card`, `--popover`, `--muted` and
|
|
225
|
+
* `--secondary`; `--sidebar` is the first rung and `--accent` the hover rung. The
|
|
226
|
+
* hover rung is here because a selected item that is also hovered paints the tint
|
|
227
|
+
* over it in some components. The active rung is not: it is the pressed state of an
|
|
228
|
+
* item, not a surface an item sits on.
|
|
229
|
+
*/
|
|
230
|
+
function tintSurfaces(theme) {
|
|
231
|
+
const shadcn = theme.shadcn ?? {};
|
|
232
|
+
return [
|
|
233
|
+
...new Set([
|
|
234
|
+
theme.colors.background,
|
|
235
|
+
theme.colors.surface,
|
|
236
|
+
theme.colors.surfaceElevated,
|
|
237
|
+
theme.colors.surfaceHover,
|
|
238
|
+
...[shadcn.card, shadcn.popover, shadcn.muted, shadcn.secondary].filter((value) => value !== undefined),
|
|
239
|
+
]),
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The primaries a theme offers: its own accent, the {@link ACCENTS} presets in its
|
|
244
|
+
* appearance, and every palette slot {@link themeAccentPresets} could offer from it
|
|
245
|
+
* whatever theme it is paired with.
|
|
246
|
+
*/
|
|
247
|
+
function offeredPrimaries(theme) {
|
|
248
|
+
const slots = ACCENT_PREFERENCE.map((slot) => offeredSlotValue(theme, slot)).filter((value) => value !== undefined);
|
|
249
|
+
return [
|
|
250
|
+
...new Set([
|
|
251
|
+
theme.colors.accent,
|
|
252
|
+
...ACCENTS.map((preset) => accentValue(preset, theme.appearance)),
|
|
253
|
+
...slots,
|
|
254
|
+
]),
|
|
255
|
+
];
|
|
256
|
+
}
|
|
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
|
+
/**
|
|
286
|
+
* Whether body text holds the floor on a surface under the primary tint.
|
|
287
|
+
*
|
|
288
|
+
* True when `text` and `foreground` both clear `CONTRAST_FLOORS.text` on the tint
|
|
289
|
+
* 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.
|
|
293
|
+
*/
|
|
294
|
+
export function primaryTintClears(theme, surface, alpha, primaries = []) {
|
|
295
|
+
const foregrounds = [...new Set([theme.colors.text, theme.colors.foreground])].map(rendered);
|
|
296
|
+
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
|
+
});
|
|
304
|
+
}
|
|
305
|
+
const subtleAlphaCache = new WeakMap();
|
|
306
|
+
/**
|
|
307
|
+
* The tint strength a theme can carry, as a whole percentage.
|
|
308
|
+
*
|
|
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
|
|
311
|
+
* surface, hover rung included, for every primary the theme offers. One value per
|
|
312
|
+
* theme rather than one per accent, so switching between offered accents at runtime
|
|
313
|
+
* needs no new tint: the expression follows `--primary` and the strength already
|
|
314
|
+
* holds for all of them. Every catalogue theme lands at or above
|
|
315
|
+
* {@link ACCENT_SUBTLE_MINIMUM_ALPHA}, because the normalizer fits its hover rung to
|
|
316
|
+
* leave room for it.
|
|
317
|
+
*
|
|
318
|
+
* Pass `primaries` to hold the strength for colours outside the offered set too —
|
|
319
|
+
* a product's own brand primary, say. The offered set is always included.
|
|
320
|
+
*/
|
|
321
|
+
export function primarySubtleAlpha(theme, primaries = []) {
|
|
322
|
+
const cached = primaries.length === 0 ? subtleAlphaCache.get(theme) : undefined;
|
|
323
|
+
if (cached !== undefined)
|
|
324
|
+
return cached;
|
|
325
|
+
const surfaces = tintSurfaces(theme);
|
|
326
|
+
const clears = (alpha) => surfaces.every((surface) => primaryTintClears(theme, surface, alpha, primaries));
|
|
327
|
+
let alpha = ACCENT_SUBTLE_ALPHA[theme.appearance];
|
|
328
|
+
while (alpha > 0 && !clears(alpha))
|
|
329
|
+
alpha -= 1;
|
|
330
|
+
if (primaries.length === 0)
|
|
331
|
+
subtleAlphaCache.set(theme, alpha);
|
|
332
|
+
return alpha;
|
|
333
|
+
}
|
|
183
334
|
/**
|
|
184
335
|
* The tint expression, for any primary.
|
|
185
336
|
*
|
|
186
|
-
*
|
|
187
|
-
* {@link
|
|
337
|
+
* Pass the **theme**: the expression then carries that theme's measured strength
|
|
338
|
+
* ({@link primarySubtleAlpha}) and body text on it is held to the floor for every
|
|
339
|
+
* accent the theme offers. It still reads `var(--primary)`, so it follows a runtime
|
|
340
|
+
* accent switch — but the strength is the theme's, so a consumer that applies
|
|
341
|
+
* themes at runtime has to write this token per theme, as it already does for
|
|
342
|
+
* {@link primaryHover}. A consumer whose primary is not one the theme offers passes
|
|
343
|
+
* it as `primaries` to have the strength measured for it as well.
|
|
344
|
+
*
|
|
345
|
+
* Passing only an **appearance** gives the {@link ACCENT_SUBTLE_ALPHA} ceiling for
|
|
346
|
+
* that appearance, unmeasured. That is the old behaviour and it is not legible on
|
|
347
|
+
* every theme — One Dark's body text on its own primary's tint over a card measures
|
|
348
|
+
* 4.34:1 at the dark ceiling — so it is kept for a consumer without a theme object
|
|
349
|
+
* in hand, not as the default to reach for.
|
|
188
350
|
*/
|
|
189
|
-
export function primarySubtleCss(
|
|
190
|
-
|
|
351
|
+
export function primarySubtleCss(target, primaryVariable = '--primary', primaries = []) {
|
|
352
|
+
const alpha = typeof target === 'string' ? ACCENT_SUBTLE_ALPHA[target] : primarySubtleAlpha(target, primaries);
|
|
353
|
+
return `color-mix(in oklch, var(${primaryVariable}) ${alpha}%, transparent)`;
|
|
191
354
|
}
|
|
192
355
|
const REPAIR_STEP = 0.002;
|
|
193
356
|
/**
|
|
@@ -251,9 +414,16 @@ export function themeAccentPresets(light, dark) {
|
|
|
251
414
|
dark: value.dark,
|
|
252
415
|
}));
|
|
253
416
|
}
|
|
254
|
-
export function accentRoles(preset,
|
|
417
|
+
export function accentRoles(preset,
|
|
418
|
+
/**
|
|
419
|
+
* The theme the accent is applied to, or only its appearance. A theme gives the
|
|
420
|
+
* tint that theme's measured strength — see {@link primarySubtleCss}; an
|
|
421
|
+
* appearance gives the unmeasured ceiling.
|
|
422
|
+
*/
|
|
423
|
+
target,
|
|
255
424
|
/** The property the subtle tint is built from. A consumer may pass its own alias. */
|
|
256
425
|
primaryVariable = '--primary') {
|
|
426
|
+
const appearance = typeof target === 'string' ? target : target.appearance;
|
|
257
427
|
const value = accentValue(preset, appearance);
|
|
258
428
|
const parsed = parseColor(value);
|
|
259
429
|
const primary = parsed ? formatOklch(parsed) : value;
|
|
@@ -261,7 +431,7 @@ primaryVariable = '--primary') {
|
|
|
261
431
|
primary,
|
|
262
432
|
primaryForeground: accentForeground(value),
|
|
263
433
|
primaryHover: primaryHover(value, appearance),
|
|
264
|
-
primarySubtle: primarySubtleCss(
|
|
434
|
+
primarySubtle: primarySubtleCss(target, primaryVariable),
|
|
265
435
|
ring: primary,
|
|
266
436
|
};
|
|
267
437
|
}
|
package/dist/accents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accents.js","sourceRoot":"","sources":["../src/accents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"accents.js","sourceRoot":"","sources":["../src/accents.ts"],"names":[],"mappings":"AAA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;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,MAAM,CAAC,CAsBzE,CAAA;AAEF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAItE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoE1E;AAED,0CAA0C;AAC1C,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,SAAU,GAAG,MAAM,CAKxE"}
|
package/dist/adapters/shadcn.js
CHANGED
|
@@ -162,9 +162,10 @@ export function shadcnVariables(theme) {
|
|
|
162
162
|
}
|
|
163
163
|
// Keep primary states on the shared appearance-aware accent derivation. Hover is
|
|
164
164
|
// resolved because its uniform lightness step cannot be expressed as a mix; the
|
|
165
|
-
// subtle tint stays tied to --primary so it follows runtime primary overrides
|
|
165
|
+
// subtle tint stays tied to --primary so it follows runtime primary overrides, at
|
|
166
|
+
// the strength measured for this theme so body text stays legible on it.
|
|
166
167
|
variables['--primary-hover'] = primaryHover(theme.colors.accent, theme.appearance);
|
|
167
|
-
variables['--primary-subtle'] = primarySubtleCss(theme
|
|
168
|
+
variables['--primary-subtle'] = primarySubtleCss(theme);
|
|
168
169
|
variables['--accent'] = theme.colors.surfaceHover;
|
|
169
170
|
variables['--accent-foreground'] = theme.colors.text;
|
|
170
171
|
variables['--ring'] = theme.shadcn?.ring ?? theme.colors.accent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadcn.js","sourceRoot":"","sources":["../../src/adapters/shadcn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,YA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AG,KAAK,CAAC,MAAM,CAAC,eAAe,CAAA;IAE7D,2EAA2E;IAC3E,6EAA6E;IAC7E,iDAAiD;IACjD,IAAI,KAAK,CAAC,MAAM,EAAE,MAAM;QAAE,SAAS,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAA;IAErE,SAAS,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAA;IACpC,SAAS,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;IAE1C,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,SAAS,CAAC,KAAkB,EAAE,QAAQ,GAAG,OAAO;IAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;SAChD,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC;SAC9C,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,OAAO,GAAG,QAAQ,OAAO,IAAI,KAAK,CAAA;AACpC,CAAC"}
|
|
@@ -14,8 +14,8 @@ const theme = {
|
|
|
14
14
|
"foreground": "oklch(0.4899 0.0102 248.04)",
|
|
15
15
|
"surface": "oklch(0.9466 0.0008 247.84)",
|
|
16
16
|
"surfaceElevated": "oklch(0.9166 0.0011 247.84)",
|
|
17
|
-
"surfaceHover": "oklch(0.
|
|
18
|
-
"surfaceActive": "oklch(0.
|
|
17
|
+
"surfaceHover": "oklch(0.9086 0.0017 247.84)",
|
|
18
|
+
"surfaceActive": "oklch(0.8896 0.0021 247.84)",
|
|
19
19
|
"border": "oklch(0.8316 0.0015 247.84)",
|
|
20
20
|
"borderMuted": "oklch(0.8866 0.001 247.84)",
|
|
21
21
|
"text": "oklch(0.4899 0.0102 248.04)",
|
|
@@ -14,8 +14,8 @@ const theme = {
|
|
|
14
14
|
"foreground": "oklch(0.7621 0.0202 262.99)",
|
|
15
15
|
"surface": "oklch(0.3275 0.019 264.3)",
|
|
16
16
|
"surfaceElevated": "oklch(0.3575 0.0218 264.3)",
|
|
17
|
-
"surfaceHover": "oklch(0.
|
|
18
|
-
"surfaceActive": "oklch(0.
|
|
17
|
+
"surfaceHover": "oklch(0.3725 0.0251 264.3)",
|
|
18
|
+
"surfaceActive": "oklch(0.3915 0.0251 264.3)",
|
|
19
19
|
"border": "oklch(0.4425 0.0141 264.3)",
|
|
20
20
|
"borderMuted": "oklch(0.3875 0.0094 264.3)",
|
|
21
21
|
"text": "oklch(0.7621 0.0202 262.99)",
|
|
@@ -15,7 +15,7 @@ const theme = {
|
|
|
15
15
|
"surface": "oklch(0.9349 0.0056 71.9)",
|
|
16
16
|
"surfaceElevated": "oklch(0.9049 0.0083 71.9)",
|
|
17
17
|
"surfaceHover": "oklch(0.8699 0.0121 71.9)",
|
|
18
|
-
"surfaceActive": "oklch(0.
|
|
18
|
+
"surfaceActive": "oklch(0.8449 0.0147 71.9)",
|
|
19
19
|
"border": "oklch(0.8199 0.0102 71.9)",
|
|
20
20
|
"borderMuted": "oklch(0.8749 0.0068 71.9)",
|
|
21
21
|
"text": "oklch(0.4597 0.0629 289.56)",
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
export type { AdeaAnsi, AdeaTheme, AdeaThemeColors, AdeaThemeRecord, AnsiKey, ThemeAppearance, ThemeColorKey, ThemeFamily, ThemeMetadata, ThemeProvenance, ShadcnThemeProjection, } from './schema.js';
|
|
46
46
|
export { ANSI_KEYS, THEME_COLOR_KEYS } from './schema.js';
|
|
47
47
|
export type { AccentPreset, AccentRoles } from './accents.js';
|
|
48
|
-
export { ACCENTS, ACCENT_HOVER_STEP, ACCENT_IDS, ACCENT_SUBTLE_ALPHA, accentForeground, accentForegroundContrast, accentRoles, accentValue, getAccent, primaryHover, primarySubtleCss, themeAccentPresets, } from './accents.js';
|
|
48
|
+
export { ACCENTS, ACCENT_HOVER_STEP, ACCENT_IDS, ACCENT_SUBTLE_ALPHA, ACCENT_SUBTLE_MINIMUM_ALPHA, accentForeground, accentForegroundContrast, accentRoles, accentValue, getAccent, primaryHover, primarySubtleAlpha, primarySubtleCss, primaryTintClears, themeAccentPresets, } from './accents.js';
|
|
49
49
|
export { DEFAULT_THEME_IDS, getBase24Scheme, getTheme, hasTheme, resolveTheme, themeCount, themeFamilies, themeIds, themes, themesByAppearance, toTheme, } from './catalogue.js';
|
|
50
50
|
export type { ContrastRepair, Oklch } from './oklch.js';
|
|
51
51
|
export { contrastRatio, deltaEok, formatOklch, gamutMap, hexToOklch, inGamut, mix, oklchToHex, parseColor, parseOklch, relativeLuminance, repairContrast, shiftLightness, } from './oklch.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,YAAY,EACV,QAAQ,EACR,SAAS,EACT,eAAe,EACf,eAAe,EACf,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,qBAAqB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEzD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,aAAa,EACb,QAAQ,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AAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE9F,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEjE,YAAY,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,EACL,cAAc,EACd,SAAS,EACT,2BAA2B,EAC3B,WAAW,EACX,eAAe,GAChB,MAAM,sBAAsB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
45
|
export { ANSI_KEYS, THEME_COLOR_KEYS } from './schema.js';
|
|
46
|
-
export { ACCENTS, ACCENT_HOVER_STEP, ACCENT_IDS, ACCENT_SUBTLE_ALPHA, accentForeground, accentForegroundContrast, accentRoles, accentValue, getAccent, primaryHover, primarySubtleCss, themeAccentPresets, } from './accents.js';
|
|
46
|
+
export { ACCENTS, ACCENT_HOVER_STEP, ACCENT_IDS, ACCENT_SUBTLE_ALPHA, ACCENT_SUBTLE_MINIMUM_ALPHA, accentForeground, accentForegroundContrast, accentRoles, accentValue, getAccent, primaryHover, primarySubtleAlpha, primarySubtleCss, primaryTintClears, themeAccentPresets, } from './accents.js';
|
|
47
47
|
/* --- The catalogue ------------------------------------------------------ */
|
|
48
48
|
export { DEFAULT_THEME_IDS, getBase24Scheme, getTheme, hasTheme, resolveTheme, themeCount, themeFamilies, themeIds, themes, themesByAppearance, toTheme, } from './catalogue.js';
|
|
49
49
|
export { contrastRatio, deltaEok, formatOklch, gamutMap, hexToOklch, inGamut, mix, oklchToHex, parseColor, parseOklch, relativeLuminance, repairContrast, shiftLightness, } from './oklch.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAgBH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGzD,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAErB,8EAA8E;AAC9E,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,aAAa,EACb,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,OAAO,GACR,MAAM,gBAAgB,CAAA;AAIvB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,UAAU,EACV,OAAO,EACP,GAAG,EACH,UAAU,EACV,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAA;AAInB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,eAAe,CAAA;AAItB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIhE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,IAAI,GACL,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,GACT,MAAM,sBA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