@oxyhq/bloom 0.41.0 → 0.42.1
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/lib/commonjs/theme/BloomThemeProvider.js +18 -7
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/apply-dark-class.js +2 -2
- package/lib/commonjs/theme/apply-dark-class.js.map +1 -1
- package/lib/commonjs/theme/build-theme-from-seed.js +17 -5
- package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -1
- package/lib/commonjs/theme/build-theme.js +9 -6
- package/lib/commonjs/theme/build-theme.js.map +1 -1
- package/lib/commonjs/theme/color-engine/index.js +8 -1
- package/lib/commonjs/theme/color-engine/index.js.map +1 -1
- package/lib/commonjs/theme/color-engine/scheme-variants.js +42 -18
- package/lib/commonjs/theme/color-engine/scheme-variants.js.map +1 -1
- package/lib/commonjs/theme/color-engine/seed-from-image.js +11 -1
- package/lib/commonjs/theme/color-engine/seed-from-image.js.map +1 -1
- package/lib/commonjs/theme/color-presets.js.map +1 -1
- package/lib/commonjs/theme/color-scope/seed-scope.js +3 -1
- package/lib/commonjs/theme/color-scope/seed-scope.js.map +1 -1
- package/lib/commonjs/theme/color-scope/style-builder.js +2 -2
- package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/native-root-vars.js +1 -1
- package/lib/commonjs/theme/native-root-vars.js.map +1 -1
- package/lib/commonjs/theme/native-root-vars.native.js +2 -2
- package/lib/commonjs/theme/native-root-vars.native.js.map +1 -1
- package/lib/commonjs/theme/native-root-vars.web.js +1 -1
- package/lib/commonjs/theme/native-root-vars.web.js.map +1 -1
- package/lib/commonjs/theme/preset-vars.js +16 -2
- package/lib/commonjs/theme/preset-vars.js.map +1 -1
- package/lib/commonjs/theme/seed-scope/index.js +11 -4
- package/lib/commonjs/theme/seed-scope/index.js.map +1 -1
- package/lib/commonjs/theme/seed-scope/index.web.js +11 -4
- package/lib/commonjs/theme/seed-scope/index.web.js.map +1 -1
- package/lib/commonjs/theme/token-registry.js +2 -2
- package/lib/commonjs/theme/token-registry.js.map +1 -1
- package/lib/module/theme/BloomThemeProvider.js +18 -7
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/apply-dark-class.js +2 -2
- package/lib/module/theme/apply-dark-class.js.map +1 -1
- package/lib/module/theme/build-theme-from-seed.js +18 -5
- package/lib/module/theme/build-theme-from-seed.js.map +1 -1
- package/lib/module/theme/build-theme.js +9 -6
- package/lib/module/theme/build-theme.js.map +1 -1
- package/lib/module/theme/color-engine/index.js +8 -1
- package/lib/module/theme/color-engine/index.js.map +1 -1
- package/lib/module/theme/color-engine/scheme-variants.js +43 -18
- package/lib/module/theme/color-engine/scheme-variants.js.map +1 -1
- package/lib/module/theme/color-engine/seed-from-image.js +11 -1
- package/lib/module/theme/color-engine/seed-from-image.js.map +1 -1
- package/lib/module/theme/color-presets.js.map +1 -1
- package/lib/module/theme/color-scope/seed-scope.js +3 -1
- package/lib/module/theme/color-scope/seed-scope.js.map +1 -1
- package/lib/module/theme/color-scope/style-builder.js +2 -2
- package/lib/module/theme/color-scope/style-builder.js.map +1 -1
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/native-root-vars.js +1 -1
- package/lib/module/theme/native-root-vars.js.map +1 -1
- package/lib/module/theme/native-root-vars.native.js +2 -2
- package/lib/module/theme/native-root-vars.native.js.map +1 -1
- package/lib/module/theme/native-root-vars.web.js +1 -1
- package/lib/module/theme/native-root-vars.web.js.map +1 -1
- package/lib/module/theme/preset-vars.js +17 -2
- package/lib/module/theme/preset-vars.js.map +1 -1
- package/lib/module/theme/seed-scope/index.js +11 -4
- package/lib/module/theme/seed-scope/index.js.map +1 -1
- package/lib/module/theme/seed-scope/index.web.js +11 -4
- package/lib/module/theme/seed-scope/index.web.js.map +1 -1
- package/lib/module/theme/token-registry.js +2 -2
- package/lib/module/theme/token-registry.js.map +1 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts +15 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/apply-dark-class.d.ts +2 -1
- package/lib/typescript/commonjs/theme/apply-dark-class.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts +13 -2
- package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/build-theme.d.ts +2 -1
- package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-engine/index.d.ts +17 -1
- package/lib/typescript/commonjs/theme/color-engine/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts +25 -7
- package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-engine/seed-from-image.d.ts +11 -1
- package/lib/typescript/commonjs/theme/color-engine/seed-from-image.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-presets.d.ts +14 -0
- package/lib/typescript/commonjs/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts +12 -0
- package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +2 -1
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/index.d.ts +3 -1
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/native-root-vars.d.ts +2 -1
- package/lib/typescript/commonjs/theme/native-root-vars.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/native-root-vars.native.d.ts +2 -1
- package/lib/typescript/commonjs/theme/native-root-vars.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts +2 -1
- package/lib/typescript/commonjs/theme/native-root-vars.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/preset-vars.d.ts +12 -1
- package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/seed-scope/index.d.ts +9 -1
- package/lib/typescript/commonjs/theme/seed-scope/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/seed-scope/index.web.d.ts +9 -1
- package/lib/typescript/commonjs/theme/seed-scope/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/token-registry.d.ts +2 -1
- package/lib/typescript/commonjs/theme/token-registry.d.ts.map +1 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts +15 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/theme/apply-dark-class.d.ts +2 -1
- package/lib/typescript/module/theme/apply-dark-class.d.ts.map +1 -1
- package/lib/typescript/module/theme/build-theme-from-seed.d.ts +13 -2
- package/lib/typescript/module/theme/build-theme-from-seed.d.ts.map +1 -1
- package/lib/typescript/module/theme/build-theme.d.ts +2 -1
- package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-engine/index.d.ts +17 -1
- package/lib/typescript/module/theme/color-engine/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts +25 -7
- package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-engine/seed-from-image.d.ts +11 -1
- package/lib/typescript/module/theme/color-engine/seed-from-image.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-presets.d.ts +14 -0
- package/lib/typescript/module/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/seed-scope.d.ts +12 -0
- package/lib/typescript/module/theme/color-scope/seed-scope.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts +2 -1
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
- package/lib/typescript/module/theme/index.d.ts +3 -1
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/native-root-vars.d.ts +2 -1
- package/lib/typescript/module/theme/native-root-vars.d.ts.map +1 -1
- package/lib/typescript/module/theme/native-root-vars.native.d.ts +2 -1
- package/lib/typescript/module/theme/native-root-vars.native.d.ts.map +1 -1
- package/lib/typescript/module/theme/native-root-vars.web.d.ts +2 -1
- package/lib/typescript/module/theme/native-root-vars.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/preset-vars.d.ts +12 -1
- package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
- package/lib/typescript/module/theme/seed-scope/index.d.ts +9 -1
- package/lib/typescript/module/theme/seed-scope/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/seed-scope/index.web.d.ts +9 -1
- package/lib/typescript/module/theme/seed-scope/index.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/token-registry.d.ts +2 -1
- package/lib/typescript/module/theme/token-registry.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/theme.test.ts +3 -0
- package/src/theme/BloomThemeProvider.tsx +38 -8
- package/src/theme/__tests__/explicit-accents.test.ts +129 -0
- package/src/theme/apply-dark-class.ts +7 -2
- package/src/theme/build-theme-from-seed.ts +25 -2
- package/src/theme/build-theme.ts +9 -3
- package/src/theme/color-engine/index.ts +27 -1
- package/src/theme/color-engine/scheme-variants.ts +108 -30
- package/src/theme/color-engine/seed-from-image.ts +11 -1
- package/src/theme/color-presets.ts +14 -0
- package/src/theme/color-scope/seed-scope.ts +14 -0
- package/src/theme/color-scope/style-builder.ts +3 -1
- package/src/theme/index.ts +3 -1
- package/src/theme/native-root-vars.native.ts +7 -2
- package/src/theme/native-root-vars.ts +6 -1
- package/src/theme/native-root-vars.web.ts +6 -1
- package/src/theme/preset-vars.ts +19 -0
- package/src/theme/seed-scope/index.tsx +17 -4
- package/src/theme/seed-scope/index.web.tsx +15 -3
- package/src/theme/token-registry.ts +3 -2
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { rootVariables } from 'react-native-css/native-internal';
|
|
18
18
|
|
|
19
19
|
import { type AppColorName } from './color-presets';
|
|
20
|
+
import type { ExplicitAccents } from './preset-vars';
|
|
20
21
|
import { getResolvedTokens } from './token-registry';
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -121,10 +122,14 @@ import { getResolvedTokens } from './token-registry';
|
|
|
121
122
|
* Defensive guard: if a host ships a react-native-css build that doesn't expose
|
|
122
123
|
* `rootVariables` as a callable (it always does on @3), we bail rather than throw.
|
|
123
124
|
*/
|
|
124
|
-
export function applyNativeRootVars(
|
|
125
|
+
export function applyNativeRootVars(
|
|
126
|
+
colorPreset: AppColorName,
|
|
127
|
+
mode: 'light' | 'dark',
|
|
128
|
+
accents?: ExplicitAccents,
|
|
129
|
+
): void {
|
|
125
130
|
if (typeof rootVariables !== 'function') return;
|
|
126
131
|
|
|
127
|
-
const vars = getResolvedTokens(colorPreset, mode);
|
|
132
|
+
const vars = getResolvedTokens(colorPreset, mode, accents);
|
|
128
133
|
for (const [key, value] of Object.entries(vars)) {
|
|
129
134
|
// The family is keyed by the bare name; `getResolvedTokens` keys include `--`.
|
|
130
135
|
const name = key.startsWith('--') ? key.slice(2) : key;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AppColorName } from './color-presets';
|
|
2
|
+
import type { ExplicitAccents } from './preset-vars';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Platform-neutral DEFAULT variant of `applyNativeRootVars` — a no-op.
|
|
@@ -30,7 +31,11 @@ import { type AppColorName } from './color-presets';
|
|
|
30
31
|
* The signature is intentionally identical to those variants so the import site in
|
|
31
32
|
* `BloomThemeProvider` is platform-agnostic.
|
|
32
33
|
*/
|
|
33
|
-
export function applyNativeRootVars(
|
|
34
|
+
export function applyNativeRootVars(
|
|
35
|
+
_colorPreset: AppColorName,
|
|
36
|
+
_mode: 'light' | 'dark',
|
|
37
|
+
_accents?: ExplicitAccents,
|
|
38
|
+
): void {
|
|
34
39
|
// Intentionally empty — the native variant (`native-root-vars.native.ts`) does
|
|
35
40
|
// the real work; this neutral default and the web fork are inert.
|
|
36
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AppColorName } from './color-presets';
|
|
2
|
+
import type { ExplicitAccents } from './preset-vars';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Web fork of `applyNativeRootVars` — a no-op.
|
|
@@ -17,6 +18,10 @@ import { type AppColorName } from './color-presets';
|
|
|
17
18
|
* The signature is intentionally identical to the plain variant so the import
|
|
18
19
|
* site in `BloomThemeProvider` is platform-agnostic.
|
|
19
20
|
*/
|
|
20
|
-
export function applyNativeRootVars(
|
|
21
|
+
export function applyNativeRootVars(
|
|
22
|
+
_colorPreset: AppColorName,
|
|
23
|
+
_mode: 'light' | 'dark',
|
|
24
|
+
_accents?: ExplicitAccents,
|
|
25
|
+
): void {
|
|
21
26
|
// Intentionally empty — web applies preset vars to `document.documentElement`.
|
|
22
27
|
}
|
package/src/theme/preset-vars.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { APP_COLOR_PRESETS, type AppColorName, type PresetTokens } from './color-presets';
|
|
2
2
|
import { generateRoleColors, type RoleColors } from './color-engine';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Optional explicit accent-colour overrides (`#rrggbb`) that PIN the secondary
|
|
6
|
+
* and/or tertiary palette app-wide, regardless of the active preset's own seed.
|
|
7
|
+
* Threaded from `BloomThemeProvider`'s `secondaryColor` / `tertiaryColor` props
|
|
8
|
+
* down through the whole token pipeline. When both are omitted, the preset's own
|
|
9
|
+
* (usually derived) accents are used — output is unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export interface ExplicitAccents {
|
|
12
|
+
secondaryHex?: string;
|
|
13
|
+
tertiaryHex?: string;
|
|
14
|
+
}
|
|
3
15
|
// Circular at the module graph level (`token-registry` imports `getPresetVars`
|
|
4
16
|
// from here), but safe: `getResolvedTokens` is only referenced inside the
|
|
5
17
|
// `applyPresetVarsToDocument` function body — i.e. at call time, after both
|
|
@@ -26,12 +38,19 @@ import { getResolvedTokens } from './token-registry';
|
|
|
26
38
|
export function getPresetVars(
|
|
27
39
|
colorName: AppColorName,
|
|
28
40
|
mode: 'light' | 'dark',
|
|
41
|
+
accents?: ExplicitAccents,
|
|
29
42
|
): PresetTokens {
|
|
30
43
|
const preset = APP_COLOR_PRESETS[colorName];
|
|
31
44
|
const r: RoleColors = generateRoleColors({
|
|
32
45
|
seed: preset.hex,
|
|
33
46
|
variant: preset.variant,
|
|
34
47
|
isDark: mode === 'dark',
|
|
48
|
+
// Pinned accents: an explicit app-wide override (from the provider) wins,
|
|
49
|
+
// else the preset's own declared accent, else undefined → derived rotation.
|
|
50
|
+
// The built-in presets declare none, so with no override their generated
|
|
51
|
+
// tokens stay byte-identical.
|
|
52
|
+
secondarySeed: accents?.secondaryHex ?? preset.secondaryHex,
|
|
53
|
+
tertiarySeed: accents?.tertiaryHex ?? preset.tertiaryHex,
|
|
35
54
|
});
|
|
36
55
|
|
|
37
56
|
return {
|
|
@@ -15,6 +15,14 @@ export interface BloomSeedScopeProps {
|
|
|
15
15
|
* mouse-leave/blur when restoring the default theme).
|
|
16
16
|
*/
|
|
17
17
|
seed: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Optional explicit secondary-accent seed (`#rrggbb`). Pins the secondary
|
|
20
|
+
* palette to a distinct brand/artwork colour instead of the derived rotation —
|
|
21
|
+
* e.g. pass `seedsFromImagePixels(pixels)[1]` for a richer artwork theme.
|
|
22
|
+
*/
|
|
23
|
+
secondarySeed?: string;
|
|
24
|
+
/** Optional explicit tertiary-accent seed (`#rrggbb`). Same semantics. */
|
|
25
|
+
tertiarySeed?: string;
|
|
18
26
|
/** Tonal scheme variant. Defaults to `'vibrant'` (matches Bloom presets). */
|
|
19
27
|
variant?: SchemeVariant;
|
|
20
28
|
/** −1 (low) … 0 (normal) … 1 (high). Defaults to 0. */
|
|
@@ -46,6 +54,8 @@ interface StyleableProps {
|
|
|
46
54
|
*/
|
|
47
55
|
export function BloomSeedScope({
|
|
48
56
|
seed,
|
|
57
|
+
secondarySeed,
|
|
58
|
+
tertiarySeed,
|
|
49
59
|
variant,
|
|
50
60
|
contrastLevel,
|
|
51
61
|
asChild = false,
|
|
@@ -57,15 +67,18 @@ export function BloomSeedScope({
|
|
|
57
67
|
const resolvedMode = parent?.theme.mode ?? 'light';
|
|
58
68
|
|
|
59
69
|
const nativeVars = useMemo<Record<string, string> | null>(
|
|
60
|
-
() =>
|
|
61
|
-
|
|
70
|
+
() =>
|
|
71
|
+
seed
|
|
72
|
+
? buildSeedScopeVars({ seed, mode: resolvedMode, variant, contrastLevel, secondarySeed, tertiarySeed })
|
|
73
|
+
: null,
|
|
74
|
+
[seed, resolvedMode, variant, contrastLevel, secondarySeed, tertiarySeed],
|
|
62
75
|
);
|
|
63
76
|
|
|
64
77
|
const contextValue = useMemo<BloomThemeContextValue | null>(() => {
|
|
65
78
|
if (!parent || !seed) return null;
|
|
66
|
-
const theme = buildThemeFromSeed(seed, resolvedMode, variant, contrastLevel);
|
|
79
|
+
const theme = buildThemeFromSeed(seed, resolvedMode, variant, contrastLevel, { secondarySeed, tertiarySeed });
|
|
67
80
|
return { ...parent, theme };
|
|
68
|
-
}, [parent, seed, resolvedMode, variant, contrastLevel]);
|
|
81
|
+
}, [parent, seed, resolvedMode, variant, contrastLevel, secondarySeed, tertiarySeed]);
|
|
69
82
|
|
|
70
83
|
if (!parent) {
|
|
71
84
|
throw new Error('BloomSeedScope must be used within a <BloomThemeProvider>');
|
|
@@ -13,6 +13,14 @@ export interface BloomSeedScopeProps {
|
|
|
13
13
|
* mouse-leave/blur when restoring the default theme).
|
|
14
14
|
*/
|
|
15
15
|
seed: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Optional explicit secondary-accent seed (`#rrggbb`). Pins the secondary
|
|
18
|
+
* palette to a distinct brand/artwork colour instead of the derived rotation —
|
|
19
|
+
* e.g. pass `seedsFromImagePixels(pixels)[1]` for a richer artwork theme.
|
|
20
|
+
*/
|
|
21
|
+
secondarySeed?: string;
|
|
22
|
+
/** Optional explicit tertiary-accent seed (`#rrggbb`). Same semantics. */
|
|
23
|
+
tertiarySeed?: string;
|
|
16
24
|
/** Tonal scheme variant. Defaults to `'vibrant'` (matches Bloom presets). */
|
|
17
25
|
variant?: SchemeVariant;
|
|
18
26
|
/** −1 (low) … 0 (normal) … 1 (high). Defaults to 0. */
|
|
@@ -57,6 +65,8 @@ interface StyleableProps {
|
|
|
57
65
|
*/
|
|
58
66
|
export function BloomSeedScope({
|
|
59
67
|
seed,
|
|
68
|
+
secondarySeed,
|
|
69
|
+
tertiarySeed,
|
|
60
70
|
variant,
|
|
61
71
|
contrastLevel,
|
|
62
72
|
asChild = false,
|
|
@@ -74,16 +84,18 @@ export function BloomSeedScope({
|
|
|
74
84
|
mode: resolvedMode,
|
|
75
85
|
variant,
|
|
76
86
|
contrastLevel,
|
|
87
|
+
secondarySeed,
|
|
88
|
+
tertiarySeed,
|
|
77
89
|
}) as React.CSSProperties)
|
|
78
90
|
: null,
|
|
79
|
-
[seed, resolvedMode, variant, contrastLevel],
|
|
91
|
+
[seed, resolvedMode, variant, contrastLevel, secondarySeed, tertiarySeed],
|
|
80
92
|
);
|
|
81
93
|
|
|
82
94
|
const contextValue = useMemo<BloomThemeContextValue | null>(() => {
|
|
83
95
|
if (!parent || !seed) return null;
|
|
84
|
-
const theme = buildThemeFromSeed(seed, resolvedMode, variant, contrastLevel);
|
|
96
|
+
const theme = buildThemeFromSeed(seed, resolvedMode, variant, contrastLevel, { secondarySeed, tertiarySeed });
|
|
85
97
|
return { ...parent, theme };
|
|
86
|
-
}, [parent, seed, resolvedMode, variant, contrastLevel]);
|
|
98
|
+
}, [parent, seed, resolvedMode, variant, contrastLevel, secondarySeed, tertiarySeed]);
|
|
87
99
|
|
|
88
100
|
if (!parent) {
|
|
89
101
|
throw new Error('BloomSeedScope must be used within a <BloomThemeProvider>');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APP_COLOR_NAMES, type AppColorName } from './color-presets';
|
|
2
|
-
import { getPresetVars } from './preset-vars';
|
|
2
|
+
import { getPresetVars, type ExplicitAccents } from './preset-vars';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The canonical set of Bloom theme token names — WITHOUT the leading `--`.
|
|
@@ -149,8 +149,9 @@ export function hslToSrgb(triple: string): string {
|
|
|
149
149
|
export function getResolvedTokens(
|
|
150
150
|
preset: AppColorName,
|
|
151
151
|
mode: 'light' | 'dark',
|
|
152
|
+
accents?: ExplicitAccents,
|
|
152
153
|
): Record<string, string> {
|
|
153
|
-
const raw = getPresetVars(preset, mode);
|
|
154
|
+
const raw = getPresetVars(preset, mode, accents);
|
|
154
155
|
const resolved: Record<string, string> = {};
|
|
155
156
|
for (const [key, value] of Object.entries(raw)) {
|
|
156
157
|
resolved[key] = RAW_HSL_TRIPLE.test(value) ? hslToSrgb(value) : value;
|