@oxyhq/bloom 0.82.0 → 0.84.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/lib/commonjs/theme/color-policy.js +25 -3
- package/lib/commonjs/theme/color-policy.js.map +1 -1
- package/lib/commonjs/theme/color-presets.js +47 -16
- package/lib/commonjs/theme/color-presets.js.map +1 -1
- package/lib/commonjs/theme/index.js +12 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/module/theme/color-policy.js +25 -3
- package/lib/module/theme/color-policy.js.map +1 -1
- package/lib/module/theme/color-presets.js +46 -15
- package/lib/module/theme/color-presets.js.map +1 -1
- package/lib/module/theme/index.js +1 -1
- package/lib/module/theme/index.js.map +1 -1
- package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-presets.d.ts +37 -2
- package/lib/typescript/commonjs/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/index.d.ts +2 -2
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-policy.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-presets.d.ts +37 -2
- package/lib/typescript/module/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/module/theme/index.d.ts +2 -2
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/theme.test.ts +2 -2
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +290 -290
- package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +154 -154
- package/src/theme/__tests__/color-preset-gates.test.ts +50 -0
- package/src/theme/__tests__/policy-legibility.test.ts +24 -11
- package/src/theme/color-policy.ts +32 -3
- package/src/theme/color-presets.ts +66 -14
- package/src/theme/index.ts +3 -1
|
@@ -11,6 +11,19 @@ export type AppColorName = 'teal' | 'blue' | 'green' | 'yellow' | 'red' | 'purpl
|
|
|
11
11
|
* maps those roles onto Bloom's canonical token names. A user-picked colour
|
|
12
12
|
* flows through the identical path — a preset is just a fixed seed.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* Why a preset is not offered to every user. Absent means it is.
|
|
16
|
+
*
|
|
17
|
+
* The two are NOT interchangeable and must not collapse back into one list: a
|
|
18
|
+
* `handle` preset belongs to a specific account and cannot be bought, while a
|
|
19
|
+
* `premium` one is exactly what is bought. Conflating them is how the picker
|
|
20
|
+
* came to offer both of Oxy's reserved brand colours to everybody.
|
|
21
|
+
*/
|
|
22
|
+
export type ColorPresetGate =
|
|
23
|
+
/** Reserved for the account whose brand it is — not purchasable. */
|
|
24
|
+
'handle'
|
|
25
|
+
/** Sold with a subscription. */
|
|
26
|
+
| 'premium';
|
|
14
27
|
export interface AppColorPreset {
|
|
15
28
|
name: AppColorName;
|
|
16
29
|
/** The brand seed colour, `#rrggbb`. Also the value the colour picker matches. */
|
|
@@ -31,6 +44,24 @@ export interface AppColorPreset {
|
|
|
31
44
|
* {@link AppColorPreset.secondaryHex} for the tertiary palette.
|
|
32
45
|
*/
|
|
33
46
|
tertiaryHex?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Force the fill to a tone a WHITE label fits, in BOTH modes — overriding the
|
|
49
|
+
* budget that otherwise lets an already-light seed keep its own tone in dark
|
|
50
|
+
* and take a black label.
|
|
51
|
+
*
|
|
52
|
+
* It has to be declared, because it cannot be derived: `yellow` (seed tone 86)
|
|
53
|
+
* wants to come down to a deep gold with white on it, and `faircoin` (tone 90)
|
|
54
|
+
* wants to stay a bright lime with black on it. Two seeds four tones apart,
|
|
55
|
+
* opposite answers — nothing in the hex distinguishes them, only what the brand
|
|
56
|
+
* is for.
|
|
57
|
+
*/
|
|
58
|
+
label?: 'white';
|
|
59
|
+
/**
|
|
60
|
+
* Who may pick this preset. Absent = everyone. Bloom only DECLARES the gate;
|
|
61
|
+
* whether a given viewer satisfies it is the consuming app's question, since
|
|
62
|
+
* only the app knows who is signed in and what they pay for.
|
|
63
|
+
*/
|
|
64
|
+
gate?: ColorPresetGate;
|
|
34
65
|
}
|
|
35
66
|
/**
|
|
36
67
|
* Historically each preset carried a full light/dark map of raw HSL triples.
|
|
@@ -40,8 +71,6 @@ export interface AppColorPreset {
|
|
|
40
71
|
*/
|
|
41
72
|
export type PresetTokens = Record<string, string>;
|
|
42
73
|
export declare const APP_COLOR_NAMES: readonly AppColorName[];
|
|
43
|
-
/** Premium-exclusive presets, hidden from the standard color picker. */
|
|
44
|
-
export declare const PREMIUM_COLOR_NAMES: readonly AppColorName[];
|
|
45
74
|
export declare const HEX_TO_APP_COLOR: Record<string, AppColorName>;
|
|
46
75
|
export declare function hexToAppColorName(hex: string): AppColorName;
|
|
47
76
|
/**
|
|
@@ -51,4 +80,10 @@ export declare function hexToAppColorName(hex: string): AppColorName;
|
|
|
51
80
|
* bold `vibrant` derivation to match the prior saturated palette.
|
|
52
81
|
*/
|
|
53
82
|
export declare const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset>;
|
|
83
|
+
/** Available to every user, signed in or not. */
|
|
84
|
+
export declare const FREE_COLOR_NAMES: readonly AppColorName[];
|
|
85
|
+
/** Reserved for the account whose brand it is (`oxy`, `faircoin`) — not for sale. */
|
|
86
|
+
export declare const HANDLE_COLOR_NAMES: readonly AppColorName[];
|
|
87
|
+
/** Sold with a subscription. */
|
|
88
|
+
export declare const PREMIUM_COLOR_NAMES: readonly AppColorName[];
|
|
54
89
|
//# sourceMappingURL=color-presets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-presets.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"color-presets.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX;;;;;;;;;;GAUG;AACH;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe;AACzB,oEAAoE;AAClE,QAAQ;AACV,gCAAgC;GAC9B,SAAS,CAAC;AAEd,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAAkK,CAAC;AAEtN,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAmBzD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAE3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,cAAc,CA+BlE,CAAC;AAgBF,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EAA4B,CAAC;AAEjF,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAA2B,CAAC;AAElF,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAA4B,CAAC"}
|
|
@@ -18,8 +18,8 @@ export type { AmbientThemeState, AmbientThemeApi, AmbientAccents, UseAmbientThem
|
|
|
18
18
|
export { useNavigationTheme } from './use-navigation-theme';
|
|
19
19
|
export type { NavigationTheme, NavigationThemeFont } from './use-navigation-theme';
|
|
20
20
|
export type { Theme, ThemeColors, ThemeMode, ThemeGradient, ThemeGradients } from './types';
|
|
21
|
-
export type { AppColorName, AppColorPreset, PresetTokens } from './color-presets';
|
|
22
|
-
export { APP_COLOR_NAMES, PREMIUM_COLOR_NAMES, APP_COLOR_PRESETS, HEX_TO_APP_COLOR, hexToAppColorName, } from './color-presets';
|
|
21
|
+
export type { AppColorName, AppColorPreset, ColorPresetGate, PresetTokens } from './color-presets';
|
|
22
|
+
export { APP_COLOR_NAMES, FREE_COLOR_NAMES, HANDLE_COLOR_NAMES, PREMIUM_COLOR_NAMES, APP_COLOR_PRESETS, HEX_TO_APP_COLOR, hexToAppColorName, } from './color-presets';
|
|
23
23
|
export { parseRgb, withAlpha } from './color-utils';
|
|
24
24
|
export type { RgbChannels } from './color-utils';
|
|
25
25
|
export { getPresetVars, applyPresetVarsToDocument } from './preset-vars';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACxF,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iB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AAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-policy.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"color-policy.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM9D,sFAAsF;AACtF,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAsHlD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAuOD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,UAAU,EACjB,MAAM,GAAE,aAAkB,GACzB,YAAY,CAqJd"}
|
|
@@ -11,6 +11,19 @@ export type AppColorName = 'teal' | 'blue' | 'green' | 'yellow' | 'red' | 'purpl
|
|
|
11
11
|
* maps those roles onto Bloom's canonical token names. A user-picked colour
|
|
12
12
|
* flows through the identical path — a preset is just a fixed seed.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* Why a preset is not offered to every user. Absent means it is.
|
|
16
|
+
*
|
|
17
|
+
* The two are NOT interchangeable and must not collapse back into one list: a
|
|
18
|
+
* `handle` preset belongs to a specific account and cannot be bought, while a
|
|
19
|
+
* `premium` one is exactly what is bought. Conflating them is how the picker
|
|
20
|
+
* came to offer both of Oxy's reserved brand colours to everybody.
|
|
21
|
+
*/
|
|
22
|
+
export type ColorPresetGate =
|
|
23
|
+
/** Reserved for the account whose brand it is — not purchasable. */
|
|
24
|
+
'handle'
|
|
25
|
+
/** Sold with a subscription. */
|
|
26
|
+
| 'premium';
|
|
14
27
|
export interface AppColorPreset {
|
|
15
28
|
name: AppColorName;
|
|
16
29
|
/** The brand seed colour, `#rrggbb`. Also the value the colour picker matches. */
|
|
@@ -31,6 +44,24 @@ export interface AppColorPreset {
|
|
|
31
44
|
* {@link AppColorPreset.secondaryHex} for the tertiary palette.
|
|
32
45
|
*/
|
|
33
46
|
tertiaryHex?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Force the fill to a tone a WHITE label fits, in BOTH modes — overriding the
|
|
49
|
+
* budget that otherwise lets an already-light seed keep its own tone in dark
|
|
50
|
+
* and take a black label.
|
|
51
|
+
*
|
|
52
|
+
* It has to be declared, because it cannot be derived: `yellow` (seed tone 86)
|
|
53
|
+
* wants to come down to a deep gold with white on it, and `faircoin` (tone 90)
|
|
54
|
+
* wants to stay a bright lime with black on it. Two seeds four tones apart,
|
|
55
|
+
* opposite answers — nothing in the hex distinguishes them, only what the brand
|
|
56
|
+
* is for.
|
|
57
|
+
*/
|
|
58
|
+
label?: 'white';
|
|
59
|
+
/**
|
|
60
|
+
* Who may pick this preset. Absent = everyone. Bloom only DECLARES the gate;
|
|
61
|
+
* whether a given viewer satisfies it is the consuming app's question, since
|
|
62
|
+
* only the app knows who is signed in and what they pay for.
|
|
63
|
+
*/
|
|
64
|
+
gate?: ColorPresetGate;
|
|
34
65
|
}
|
|
35
66
|
/**
|
|
36
67
|
* Historically each preset carried a full light/dark map of raw HSL triples.
|
|
@@ -40,8 +71,6 @@ export interface AppColorPreset {
|
|
|
40
71
|
*/
|
|
41
72
|
export type PresetTokens = Record<string, string>;
|
|
42
73
|
export declare const APP_COLOR_NAMES: readonly AppColorName[];
|
|
43
|
-
/** Premium-exclusive presets, hidden from the standard color picker. */
|
|
44
|
-
export declare const PREMIUM_COLOR_NAMES: readonly AppColorName[];
|
|
45
74
|
export declare const HEX_TO_APP_COLOR: Record<string, AppColorName>;
|
|
46
75
|
export declare function hexToAppColorName(hex: string): AppColorName;
|
|
47
76
|
/**
|
|
@@ -51,4 +80,10 @@ export declare function hexToAppColorName(hex: string): AppColorName;
|
|
|
51
80
|
* bold `vibrant` derivation to match the prior saturated palette.
|
|
52
81
|
*/
|
|
53
82
|
export declare const APP_COLOR_PRESETS: Record<AppColorName, AppColorPreset>;
|
|
83
|
+
/** Available to every user, signed in or not. */
|
|
84
|
+
export declare const FREE_COLOR_NAMES: readonly AppColorName[];
|
|
85
|
+
/** Reserved for the account whose brand it is (`oxy`, `faircoin`) — not for sale. */
|
|
86
|
+
export declare const HANDLE_COLOR_NAMES: readonly AppColorName[];
|
|
87
|
+
/** Sold with a subscription. */
|
|
88
|
+
export declare const PREMIUM_COLOR_NAMES: readonly AppColorName[];
|
|
54
89
|
//# sourceMappingURL=color-presets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-presets.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"color-presets.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,QAAQ,GACR,MAAM,GACN,KAAK,GACL,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX;;;;;;;;;;GAUG;AACH;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe;AACzB,oEAAoE;AAClE,QAAQ;AACV,gCAAgC;GAC9B,SAAS,CAAC;AAEd,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAAkK,CAAC;AAEtN,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAmBzD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAE3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,cAAc,CA+BlE,CAAC;AAgBF,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EAA4B,CAAC;AAEjF,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAA2B,CAAC;AAElF,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAA4B,CAAC"}
|
|
@@ -18,8 +18,8 @@ export type { AmbientThemeState, AmbientThemeApi, AmbientAccents, UseAmbientThem
|
|
|
18
18
|
export { useNavigationTheme } from './use-navigation-theme';
|
|
19
19
|
export type { NavigationTheme, NavigationThemeFont } from './use-navigation-theme';
|
|
20
20
|
export type { Theme, ThemeColors, ThemeMode, ThemeGradient, ThemeGradients } from './types';
|
|
21
|
-
export type { AppColorName, AppColorPreset, PresetTokens } from './color-presets';
|
|
22
|
-
export { APP_COLOR_NAMES, PREMIUM_COLOR_NAMES, APP_COLOR_PRESETS, HEX_TO_APP_COLOR, hexToAppColorName, } from './color-presets';
|
|
21
|
+
export type { AppColorName, AppColorPreset, ColorPresetGate, PresetTokens } from './color-presets';
|
|
22
|
+
export { APP_COLOR_NAMES, FREE_COLOR_NAMES, HANDLE_COLOR_NAMES, PREMIUM_COLOR_NAMES, APP_COLOR_PRESETS, HEX_TO_APP_COLOR, hexToAppColorName, } from './color-presets';
|
|
23
23
|
export { parseRgb, withAlpha } from './color-utils';
|
|
24
24
|
export type { RgbChannels } from './color-utils';
|
|
25
25
|
export { getPresetVars, applyPresetVarsToDocument } from './preset-vars';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","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
@@ -78,7 +78,7 @@ describe('Theme system', () => {
|
|
|
78
78
|
describe('hexToAppColorName', () => {
|
|
79
79
|
it('maps known hex values to correct color names', () => {
|
|
80
80
|
expect(hexToAppColorName('#005c67')).toBe('teal');
|
|
81
|
-
expect(hexToAppColorName('#
|
|
81
|
+
expect(hexToAppColorName('#1d9bf0')).toBe('blue');
|
|
82
82
|
expect(hexToAppColorName('#10b981')).toBe('green');
|
|
83
83
|
expect(hexToAppColorName('#ef4444')).toBe('red');
|
|
84
84
|
expect(hexToAppColorName('#c46ede')).toBe('oxy');
|
|
@@ -86,7 +86,7 @@ describe('Theme system', () => {
|
|
|
86
86
|
|
|
87
87
|
it('is case-insensitive', () => {
|
|
88
88
|
expect(hexToAppColorName('#005C67')).toBe('teal');
|
|
89
|
-
expect(hexToAppColorName('#
|
|
89
|
+
expect(hexToAppColorName('#1D9BF0')).toBe('blue');
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
it('defaults to teal for unknown hex values', () => {
|