@ankhorage/contracts 0.1.3 → 0.3.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/CHANGELOG.md +12 -0
- package/README.md +26 -0
- package/dist/color-theory.d.ts +58 -0
- package/dist/color-theory.d.ts.map +1 -0
- package/dist/color-theory.js +70 -0
- package/dist/color-theory.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +5 -1
- package/src/color-theory.ts +96 -0
- package/src/contracts.test.ts +32 -7
- package/src/index.ts +1 -0
- package/src/types.ts +2 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/contracts
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9e27c89: Add app category theme recommendation contracts and a partial category recommendation map for theme tooling.
|
|
8
|
+
|
|
9
|
+
## 0.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 3536f12: Adds shared color-theory contracts and renames theme mode configuration from `systemTone` / `SystemTone` to `colorTone` / `ColorTone`.
|
|
14
|
+
|
|
3
15
|
## 0.1.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -22,9 +22,35 @@ Shared public contracts for Ankhorage packages and standalone provider packages.
|
|
|
22
22
|
```ts
|
|
23
23
|
import type { AppManifest } from '@ankhorage/contracts';
|
|
24
24
|
import type { AuthAdapter } from '@ankhorage/contracts/auth';
|
|
25
|
+
import type {
|
|
26
|
+
AppCategoryThemeRecommendation,
|
|
27
|
+
AppMood,
|
|
28
|
+
ColorHarmony,
|
|
29
|
+
ColorTone,
|
|
30
|
+
} from '@ankhorage/contracts/color-theory';
|
|
31
|
+
import { APP_CATEGORY_THEME_RECOMMENDATIONS } from '@ankhorage/contracts/color-theory';
|
|
25
32
|
import type { DbAdapter } from '@ankhorage/contracts/db';
|
|
26
33
|
```
|
|
27
34
|
|
|
35
|
+
`ColorTone` describes the visual palette tone, such as `pastel`, `earth`, `jewel`, or
|
|
36
|
+
`fluorescent`.
|
|
37
|
+
|
|
38
|
+
`AppMood` describes psychological/product intent, such as `calm`, `trustworthy`, or
|
|
39
|
+
`playful`.
|
|
40
|
+
|
|
41
|
+
`ColorHarmony` describes hue relationships.
|
|
42
|
+
|
|
43
|
+
Category-aware theme recommendations can suggest an app mood, color tone,
|
|
44
|
+
harmony, and optional primary hue without moving UI color-generation logic into
|
|
45
|
+
Contracts:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
const financeThemeRecommendation = APP_CATEGORY_THEME_RECOMMENDATIONS.finance_money;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
These recommendation contracts are serializable handoff data for tooling. OKLCH,
|
|
52
|
+
chroma, and semantic-token generation stay in UI/theme packages.
|
|
53
|
+
|
|
28
54
|
Provider packages can implement the shared contracts without importing runtime,
|
|
29
55
|
CLI, ZORA, Expo Router, or app-generation logic.
|
|
30
56
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AppCategory } from './types';
|
|
2
|
+
export declare const COLOR_HARMONIES: readonly ["monochromatic", "analogous", "complementary", "triadic", "tetradic", "splitComplementary"];
|
|
3
|
+
export type ColorHarmony = (typeof COLOR_HARMONIES)[number];
|
|
4
|
+
export declare const COLOR_TONES: readonly ["neutral", "pastel", "earth", "mineral", "muted", "jewel", "fluorescent", "obsidian", "vaporwave", "monochromeAccent"];
|
|
5
|
+
export type ColorTone = (typeof COLOR_TONES)[number];
|
|
6
|
+
export declare const APP_MOODS: readonly ["trustworthy", "calm", "focused", "playful", "premium", "energetic", "serious", "creative", "friendly", "technical"];
|
|
7
|
+
export type AppMood = (typeof APP_MOODS)[number];
|
|
8
|
+
export interface ColorToneLaneRecipe {
|
|
9
|
+
backgroundTone: ColorTone;
|
|
10
|
+
foregroundTone: ColorTone;
|
|
11
|
+
}
|
|
12
|
+
export interface ColorThemeRecommendation {
|
|
13
|
+
appMood: AppMood;
|
|
14
|
+
suggestedColorTone: ColorTone;
|
|
15
|
+
suggestedHarmony: ColorHarmony;
|
|
16
|
+
suggestedPrimaryHueDegrees?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AppCategoryThemeRecommendation extends ColorThemeRecommendation {
|
|
19
|
+
appCategory: AppCategory;
|
|
20
|
+
}
|
|
21
|
+
export declare const APP_CATEGORY_THEME_RECOMMENDATIONS: {
|
|
22
|
+
readonly finance_money: {
|
|
23
|
+
readonly appCategory: "finance_money";
|
|
24
|
+
readonly appMood: "trustworthy";
|
|
25
|
+
readonly suggestedColorTone: "mineral";
|
|
26
|
+
readonly suggestedHarmony: "analogous";
|
|
27
|
+
readonly suggestedPrimaryHueDegrees: 195;
|
|
28
|
+
};
|
|
29
|
+
readonly health_fitness: {
|
|
30
|
+
readonly appCategory: "health_fitness";
|
|
31
|
+
readonly appMood: "calm";
|
|
32
|
+
readonly suggestedColorTone: "pastel";
|
|
33
|
+
readonly suggestedHarmony: "analogous";
|
|
34
|
+
readonly suggestedPrimaryHueDegrees: 155;
|
|
35
|
+
};
|
|
36
|
+
readonly developer_tools: {
|
|
37
|
+
readonly appCategory: "developer_tools";
|
|
38
|
+
readonly appMood: "focused";
|
|
39
|
+
readonly suggestedColorTone: "obsidian";
|
|
40
|
+
readonly suggestedHarmony: "analogous";
|
|
41
|
+
readonly suggestedPrimaryHueDegrees: 220;
|
|
42
|
+
};
|
|
43
|
+
readonly graphics_design: {
|
|
44
|
+
readonly appCategory: "graphics_design";
|
|
45
|
+
readonly appMood: "creative";
|
|
46
|
+
readonly suggestedColorTone: "vaporwave";
|
|
47
|
+
readonly suggestedHarmony: "splitComplementary";
|
|
48
|
+
readonly suggestedPrimaryHueDegrees: 305;
|
|
49
|
+
};
|
|
50
|
+
readonly social_community: {
|
|
51
|
+
readonly appCategory: "social_community";
|
|
52
|
+
readonly appMood: "friendly";
|
|
53
|
+
readonly suggestedColorTone: "jewel";
|
|
54
|
+
readonly suggestedHarmony: "triadic";
|
|
55
|
+
readonly suggestedPrimaryHueDegrees: 265;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=color-theory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-theory.d.ts","sourceRoot":"","sources":["../src/color-theory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,eAAe,uGAOlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,eAAO,MAAM,WAAW,kIAWd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,SAAS,gIAWZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,SAAS,CAAC;IAC1B,cAAc,EAAE,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,gBAAgB,EAAE,YAAY,CAAC;IAC/B,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,8BAA+B,SAAQ,wBAAwB;IAC9E,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCkC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const COLOR_HARMONIES = [
|
|
2
|
+
'monochromatic',
|
|
3
|
+
'analogous',
|
|
4
|
+
'complementary',
|
|
5
|
+
'triadic',
|
|
6
|
+
'tetradic',
|
|
7
|
+
'splitComplementary',
|
|
8
|
+
];
|
|
9
|
+
export const COLOR_TONES = [
|
|
10
|
+
'neutral',
|
|
11
|
+
'pastel',
|
|
12
|
+
'earth',
|
|
13
|
+
'mineral',
|
|
14
|
+
'muted',
|
|
15
|
+
'jewel',
|
|
16
|
+
'fluorescent',
|
|
17
|
+
'obsidian',
|
|
18
|
+
'vaporwave',
|
|
19
|
+
'monochromeAccent',
|
|
20
|
+
];
|
|
21
|
+
export const APP_MOODS = [
|
|
22
|
+
'trustworthy',
|
|
23
|
+
'calm',
|
|
24
|
+
'focused',
|
|
25
|
+
'playful',
|
|
26
|
+
'premium',
|
|
27
|
+
'energetic',
|
|
28
|
+
'serious',
|
|
29
|
+
'creative',
|
|
30
|
+
'friendly',
|
|
31
|
+
'technical',
|
|
32
|
+
];
|
|
33
|
+
export const APP_CATEGORY_THEME_RECOMMENDATIONS = {
|
|
34
|
+
finance_money: {
|
|
35
|
+
appCategory: 'finance_money',
|
|
36
|
+
appMood: 'trustworthy',
|
|
37
|
+
suggestedColorTone: 'mineral',
|
|
38
|
+
suggestedHarmony: 'analogous',
|
|
39
|
+
suggestedPrimaryHueDegrees: 195,
|
|
40
|
+
},
|
|
41
|
+
health_fitness: {
|
|
42
|
+
appCategory: 'health_fitness',
|
|
43
|
+
appMood: 'calm',
|
|
44
|
+
suggestedColorTone: 'pastel',
|
|
45
|
+
suggestedHarmony: 'analogous',
|
|
46
|
+
suggestedPrimaryHueDegrees: 155,
|
|
47
|
+
},
|
|
48
|
+
developer_tools: {
|
|
49
|
+
appCategory: 'developer_tools',
|
|
50
|
+
appMood: 'focused',
|
|
51
|
+
suggestedColorTone: 'obsidian',
|
|
52
|
+
suggestedHarmony: 'analogous',
|
|
53
|
+
suggestedPrimaryHueDegrees: 220,
|
|
54
|
+
},
|
|
55
|
+
graphics_design: {
|
|
56
|
+
appCategory: 'graphics_design',
|
|
57
|
+
appMood: 'creative',
|
|
58
|
+
suggestedColorTone: 'vaporwave',
|
|
59
|
+
suggestedHarmony: 'splitComplementary',
|
|
60
|
+
suggestedPrimaryHueDegrees: 305,
|
|
61
|
+
},
|
|
62
|
+
social_community: {
|
|
63
|
+
appCategory: 'social_community',
|
|
64
|
+
appMood: 'friendly',
|
|
65
|
+
suggestedColorTone: 'jewel',
|
|
66
|
+
suggestedHarmony: 'triadic',
|
|
67
|
+
suggestedPrimaryHueDegrees: 265,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=color-theory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-theory.js","sourceRoot":"","sources":["../src/color-theory.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,eAAe;IACf,WAAW;IACX,eAAe;IACf,SAAS;IACT,UAAU;IACV,oBAAoB;CACZ,CAAC;AAIX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,aAAa;IACb,UAAU;IACV,WAAW;IACX,kBAAkB;CACV,CAAC;AAIX,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,aAAa;IACb,MAAM;IACN,SAAS;IACT,SAAS;IACT,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;IACV,WAAW;CACH,CAAC;AAoBX,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,aAAa,EAAE;QACb,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,aAAa;QACtB,kBAAkB,EAAE,SAAS;QAC7B,gBAAgB,EAAE,WAAW;QAC7B,0BAA0B,EAAE,GAAG;KAChC;IACD,cAAc,EAAE;QACd,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,MAAM;QACf,kBAAkB,EAAE,QAAQ;QAC5B,gBAAgB,EAAE,WAAW;QAC7B,0BAA0B,EAAE,GAAG;KAChC;IACD,eAAe,EAAE;QACf,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,SAAS;QAClB,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB,EAAE,WAAW;QAC7B,0BAA0B,EAAE,GAAG;KAChC;IACD,eAAe,EAAE;QACf,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,UAAU;QACnB,kBAAkB,EAAE,WAAW;QAC/B,gBAAgB,EAAE,oBAAoB;QACtC,0BAA0B,EAAE,GAAG;KAChC;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,kBAAkB;QAC/B,OAAO,EAAE,UAAU;QACnB,kBAAkB,EAAE,OAAO;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,0BAA0B,EAAE,GAAG;KAChC;CAC8E,CAAC","sourcesContent":["import type { AppCategory } from './types';\n\nexport const COLOR_HARMONIES = [\n 'monochromatic',\n 'analogous',\n 'complementary',\n 'triadic',\n 'tetradic',\n 'splitComplementary',\n] as const;\n\nexport type ColorHarmony = (typeof COLOR_HARMONIES)[number];\n\nexport const COLOR_TONES = [\n 'neutral',\n 'pastel',\n 'earth',\n 'mineral',\n 'muted',\n 'jewel',\n 'fluorescent',\n 'obsidian',\n 'vaporwave',\n 'monochromeAccent',\n] as const;\n\nexport type ColorTone = (typeof COLOR_TONES)[number];\n\nexport const APP_MOODS = [\n 'trustworthy',\n 'calm',\n 'focused',\n 'playful',\n 'premium',\n 'energetic',\n 'serious',\n 'creative',\n 'friendly',\n 'technical',\n] as const;\n\nexport type AppMood = (typeof APP_MOODS)[number];\n\nexport interface ColorToneLaneRecipe {\n backgroundTone: ColorTone;\n foregroundTone: ColorTone;\n}\n\nexport interface ColorThemeRecommendation {\n appMood: AppMood;\n suggestedColorTone: ColorTone;\n suggestedHarmony: ColorHarmony;\n suggestedPrimaryHueDegrees?: number;\n}\n\nexport interface AppCategoryThemeRecommendation extends ColorThemeRecommendation {\n appCategory: AppCategory;\n}\n\nexport const APP_CATEGORY_THEME_RECOMMENDATIONS = {\n finance_money: {\n appCategory: 'finance_money',\n appMood: 'trustworthy',\n suggestedColorTone: 'mineral',\n suggestedHarmony: 'analogous',\n suggestedPrimaryHueDegrees: 195,\n },\n health_fitness: {\n appCategory: 'health_fitness',\n appMood: 'calm',\n suggestedColorTone: 'pastel',\n suggestedHarmony: 'analogous',\n suggestedPrimaryHueDegrees: 155,\n },\n developer_tools: {\n appCategory: 'developer_tools',\n appMood: 'focused',\n suggestedColorTone: 'obsidian',\n suggestedHarmony: 'analogous',\n suggestedPrimaryHueDegrees: 220,\n },\n graphics_design: {\n appCategory: 'graphics_design',\n appMood: 'creative',\n suggestedColorTone: 'vaporwave',\n suggestedHarmony: 'splitComplementary',\n suggestedPrimaryHueDegrees: 305,\n },\n social_community: {\n appCategory: 'social_community',\n appMood: 'friendly',\n suggestedColorTone: 'jewel',\n suggestedHarmony: 'triadic',\n suggestedPrimaryHueDegrees: 265,\n },\n} as const satisfies Partial<Record<AppCategory, AppCategoryThemeRecommendation>>;\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC","sourcesContent":["export * from './auth';\nexport * from './db';\nexport * from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC","sourcesContent":["export * from './auth';\nexport * from './color-theory';\nexport * from './db';\nexport * from './types';\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { AuthFlowConfig, AuthIdentifierKind, AuthSignUpField } from './auth';
|
|
2
|
-
|
|
3
|
-
export type SystemTone = 'neutral' | 'pastel' | 'earth' | 'jewel' | 'fluorescent';
|
|
2
|
+
import type { ColorHarmony, ColorTone } from './color-theory';
|
|
4
3
|
export interface ThemeModeConfig {
|
|
5
4
|
primaryColor: string;
|
|
6
5
|
harmony: ColorHarmony;
|
|
7
|
-
|
|
6
|
+
colorTone: ColorTone;
|
|
8
7
|
}
|
|
9
8
|
export interface ThemeConfig {
|
|
10
9
|
id: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW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AAC;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,QAAQ,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE;YACZ,aAAa,EAAE,MAAM,CAAC;YACtB,OAAO,EAAE,MAAM,EAAE,CAAC;SACnB,CAAC;QACF,QAAQ,EAAE,cAAc,CAAC;KAC1B,CAAC;CACH"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAkFA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGpE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,CAAU,CAAC;AAIxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,CAAU,CAAC;AAIxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU,CAAC;AAGvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAG/D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAGrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,CAAU,CAAC;AAIpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC","sourcesContent":["import type { AuthFlowConfig, AuthIdentifierKind, AuthSignUpField } from './auth';\nimport type { ColorHarmony, ColorTone } from './color-theory';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n colorTone: ColorTone;\n}\n\nexport interface ThemeConfig {\n id: string;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n}\n\nexport type ActionType =\n | 'navigate'\n | 'alert'\n | 'console'\n | 'toggleDarkMode'\n | 'setLanguage'\n | 'search'\n | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const DEPLOYMENT_TARGETS = ['minikube'] as const;\nexport type KnownDeploymentTarget = (typeof DEPLOYMENT_TARGETS)[number];\nexport type DeploymentTarget = KnownDeploymentTarget | (string & {});\n\nexport const DATABASE_PROVIDERS = ['supabase'] as const;\nexport type KnownDatabaseProvider = (typeof DATABASE_PROVIDERS)[number];\nexport type DatabaseProvider = KnownDatabaseProvider | (string & {});\n\nexport const DATABASE_TIERS = ['dev', 'prod'] as const;\nexport type DatabaseTier = (typeof DATABASE_TIERS)[number];\n\nexport const STORAGE_PROVIDERS = ['auto', 's3', 'r2'] as const;\nexport type StorageProvider = (typeof STORAGE_PROVIDERS)[number];\n\nexport const AUTHZ_KINDS = ['RBAC', 'ABAC'] as const;\nexport type AuthzKind = (typeof AUTHZ_KINDS)[number];\n\nexport const AUTHZ_ENGINES = ['cerbos', 'native'] as const;\nexport type AuthzEngine = (typeof AUTHZ_ENGINES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_PROVIDERS = ['supabase'] as const;\nexport type KnownAuthProvider = (typeof AUTH_PROVIDERS)[number];\nexport type AuthProvider = KnownAuthProvider | (string & {});\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport interface IconSpec {\n name: string;\n provider?: string;\n size?: number | string;\n color?: string;\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n}\n\nexport interface NavigatorSpec {\n type: NavigatorType;\n initialRouteName?: string;\n routes: RouteDefinition[];\n options?: Record<string, unknown>;\n}\n\nexport interface RouteDefinition {\n name: string;\n path?: string;\n label?: string;\n icon?: IconSpec;\n hideInTabBar?: boolean;\n guards?: string[];\n screenId?: string;\n navigator?: NavigatorSpec;\n}\n\nexport interface DeploymentSpec {\n target: DeploymentTarget;\n monitoring: boolean;\n}\n\nexport interface DatabaseSpec {\n provider: DatabaseProvider;\n tier: DatabaseTier;\n}\n\nexport interface StorageSpec {\n provider: StorageProvider;\n buckets: string[];\n}\n\nexport interface AuthzSpec {\n kind: AuthzKind;\n engine: AuthzEngine;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n}\n\nexport interface AuthSpec {\n scope: AuthScope;\n provider: AuthProvider;\n authorization: AuthzSpec;\n flow?: AuthFlowConfig;\n signIn?: AuthSignInSpec;\n signUp?: AuthSignUpSpec;\n profile?: AuthProfileSpec;\n}\n\nexport interface NetworkingSpec {\n domain?: string;\n cdn: boolean;\n}\n\nexport interface InfraManifest {\n deployment?: DeploymentSpec;\n auth?: AuthSpec;\n database?: DatabaseSpec;\n storage?: StorageSpec;\n networking?: NetworkingSpec;\n plugins: string[];\n pluginsConfig?: Record<string, unknown>;\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n themeId: string;\n created?: string;\n updated?: string;\n };\n themes: ThemeConfig[];\n activeThemeId: string;\n activeThemeMode?: 'dark' | 'light';\n infra: InfraManifest;\n navigator: NavigatorSpec;\n screens: Record<string, ScreenSpec>;\n settings: {\n apiBaseUrl?: string;\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n authFlow: AuthFlowConfig;\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@ankhorage/devtools": "^1.0.0",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./dist/auth.d.ts",
|
|
19
19
|
"default": "./dist/auth.js"
|
|
20
20
|
},
|
|
21
|
+
"./color-theory": {
|
|
22
|
+
"types": "./dist/color-theory.d.ts",
|
|
23
|
+
"default": "./dist/color-theory.js"
|
|
24
|
+
},
|
|
21
25
|
"./db": {
|
|
22
26
|
"types": "./dist/db.d.ts",
|
|
23
27
|
"default": "./dist/db.js"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { AppCategory } from './types';
|
|
2
|
+
|
|
3
|
+
export const COLOR_HARMONIES = [
|
|
4
|
+
'monochromatic',
|
|
5
|
+
'analogous',
|
|
6
|
+
'complementary',
|
|
7
|
+
'triadic',
|
|
8
|
+
'tetradic',
|
|
9
|
+
'splitComplementary',
|
|
10
|
+
] as const;
|
|
11
|
+
|
|
12
|
+
export type ColorHarmony = (typeof COLOR_HARMONIES)[number];
|
|
13
|
+
|
|
14
|
+
export const COLOR_TONES = [
|
|
15
|
+
'neutral',
|
|
16
|
+
'pastel',
|
|
17
|
+
'earth',
|
|
18
|
+
'mineral',
|
|
19
|
+
'muted',
|
|
20
|
+
'jewel',
|
|
21
|
+
'fluorescent',
|
|
22
|
+
'obsidian',
|
|
23
|
+
'vaporwave',
|
|
24
|
+
'monochromeAccent',
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
export type ColorTone = (typeof COLOR_TONES)[number];
|
|
28
|
+
|
|
29
|
+
export const APP_MOODS = [
|
|
30
|
+
'trustworthy',
|
|
31
|
+
'calm',
|
|
32
|
+
'focused',
|
|
33
|
+
'playful',
|
|
34
|
+
'premium',
|
|
35
|
+
'energetic',
|
|
36
|
+
'serious',
|
|
37
|
+
'creative',
|
|
38
|
+
'friendly',
|
|
39
|
+
'technical',
|
|
40
|
+
] as const;
|
|
41
|
+
|
|
42
|
+
export type AppMood = (typeof APP_MOODS)[number];
|
|
43
|
+
|
|
44
|
+
export interface ColorToneLaneRecipe {
|
|
45
|
+
backgroundTone: ColorTone;
|
|
46
|
+
foregroundTone: ColorTone;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ColorThemeRecommendation {
|
|
50
|
+
appMood: AppMood;
|
|
51
|
+
suggestedColorTone: ColorTone;
|
|
52
|
+
suggestedHarmony: ColorHarmony;
|
|
53
|
+
suggestedPrimaryHueDegrees?: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AppCategoryThemeRecommendation extends ColorThemeRecommendation {
|
|
57
|
+
appCategory: AppCategory;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const APP_CATEGORY_THEME_RECOMMENDATIONS = {
|
|
61
|
+
finance_money: {
|
|
62
|
+
appCategory: 'finance_money',
|
|
63
|
+
appMood: 'trustworthy',
|
|
64
|
+
suggestedColorTone: 'mineral',
|
|
65
|
+
suggestedHarmony: 'analogous',
|
|
66
|
+
suggestedPrimaryHueDegrees: 195,
|
|
67
|
+
},
|
|
68
|
+
health_fitness: {
|
|
69
|
+
appCategory: 'health_fitness',
|
|
70
|
+
appMood: 'calm',
|
|
71
|
+
suggestedColorTone: 'pastel',
|
|
72
|
+
suggestedHarmony: 'analogous',
|
|
73
|
+
suggestedPrimaryHueDegrees: 155,
|
|
74
|
+
},
|
|
75
|
+
developer_tools: {
|
|
76
|
+
appCategory: 'developer_tools',
|
|
77
|
+
appMood: 'focused',
|
|
78
|
+
suggestedColorTone: 'obsidian',
|
|
79
|
+
suggestedHarmony: 'analogous',
|
|
80
|
+
suggestedPrimaryHueDegrees: 220,
|
|
81
|
+
},
|
|
82
|
+
graphics_design: {
|
|
83
|
+
appCategory: 'graphics_design',
|
|
84
|
+
appMood: 'creative',
|
|
85
|
+
suggestedColorTone: 'vaporwave',
|
|
86
|
+
suggestedHarmony: 'splitComplementary',
|
|
87
|
+
suggestedPrimaryHueDegrees: 305,
|
|
88
|
+
},
|
|
89
|
+
social_community: {
|
|
90
|
+
appCategory: 'social_community',
|
|
91
|
+
appMood: 'friendly',
|
|
92
|
+
suggestedColorTone: 'jewel',
|
|
93
|
+
suggestedHarmony: 'triadic',
|
|
94
|
+
suggestedPrimaryHueDegrees: 265,
|
|
95
|
+
},
|
|
96
|
+
} as const satisfies Partial<Record<AppCategory, AppCategoryThemeRecommendation>>;
|
package/src/contracts.test.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { describe, expect, it } from 'bun:test';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
APP_CATEGORIES,
|
|
5
|
+
APP_CATEGORY_THEME_RECOMMENDATIONS,
|
|
6
|
+
APP_MOODS,
|
|
5
7
|
type AppCategory,
|
|
6
8
|
AUTH_PROVIDERS,
|
|
7
9
|
AUTH_SIGN_IN_IDENTIFIERS,
|
|
@@ -9,6 +11,8 @@ import {
|
|
|
9
11
|
type AuthAdapter,
|
|
10
12
|
type AuthFlowConfig,
|
|
11
13
|
type AuthSpec,
|
|
14
|
+
COLOR_HARMONIES,
|
|
15
|
+
COLOR_TONES,
|
|
12
16
|
type DbAdapter,
|
|
13
17
|
DEPLOYMENT_TARGETS,
|
|
14
18
|
NAVIGATOR_TYPES,
|
|
@@ -60,17 +64,38 @@ describe('contracts', () => {
|
|
|
60
64
|
light: {
|
|
61
65
|
primaryColor: '#3366ff',
|
|
62
66
|
harmony: 'analogous',
|
|
63
|
-
|
|
67
|
+
colorTone: 'neutral',
|
|
64
68
|
},
|
|
65
69
|
dark: {
|
|
66
70
|
primaryColor: '#3366ff',
|
|
67
71
|
harmony: 'analogous',
|
|
68
|
-
|
|
72
|
+
colorTone: 'neutral',
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
expect(theme.light.primaryColor).toBe('#3366ff');
|
|
73
|
-
expect(theme.dark.
|
|
77
|
+
expect(theme.dark.colorTone).toBe('neutral');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('exports app category theme recommendations with valid serialized values', () => {
|
|
81
|
+
const recommendations = Object.values(APP_CATEGORY_THEME_RECOMMENDATIONS);
|
|
82
|
+
|
|
83
|
+
expect(recommendations.length).toBeGreaterThan(0);
|
|
84
|
+
|
|
85
|
+
for (const recommendation of recommendations) {
|
|
86
|
+
expect(APP_CATEGORIES).toContain(recommendation.appCategory);
|
|
87
|
+
expect(APP_MOODS).toContain(recommendation.appMood);
|
|
88
|
+
expect(COLOR_TONES).toContain(recommendation.suggestedColorTone);
|
|
89
|
+
expect(COLOR_HARMONIES).toContain(recommendation.suggestedHarmony);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('keeps app category theme recommendation hues in range', () => {
|
|
94
|
+
for (const recommendation of Object.values(APP_CATEGORY_THEME_RECOMMENDATIONS)) {
|
|
95
|
+
expect(Number.isFinite(recommendation.suggestedPrimaryHueDegrees)).toBe(true);
|
|
96
|
+
expect(recommendation.suggestedPrimaryHueDegrees).toBeGreaterThanOrEqual(0);
|
|
97
|
+
expect(recommendation.suggestedPrimaryHueDegrees).toBeLessThan(360);
|
|
98
|
+
}
|
|
74
99
|
});
|
|
75
100
|
|
|
76
101
|
it('accepts canonical auth flow config without legacy route fields', () => {
|
|
@@ -147,20 +172,20 @@ describe('contracts', () => {
|
|
|
147
172
|
const dbAdapter: DbAdapter = {
|
|
148
173
|
async select() {
|
|
149
174
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
150
|
-
return { ok: true, data: [
|
|
175
|
+
return { ok: true, data: [] };
|
|
151
176
|
},
|
|
152
177
|
async findById() {
|
|
153
178
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
154
|
-
return { ok: true, data:
|
|
179
|
+
return { ok: true, data: null };
|
|
155
180
|
},
|
|
156
181
|
async insert(input) {
|
|
157
182
|
const values = Array.isArray(input.values) ? input.values : [input.values];
|
|
158
183
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
159
184
|
return { ok: true, data: values };
|
|
160
185
|
},
|
|
161
|
-
async update(
|
|
186
|
+
async update() {
|
|
162
187
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
163
|
-
return { ok: true, data: [
|
|
188
|
+
return { ok: true, data: [] };
|
|
164
189
|
},
|
|
165
190
|
async delete() {
|
|
166
191
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import type { AuthFlowConfig, AuthIdentifierKind, AuthSignUpField } from './auth';
|
|
2
|
-
|
|
3
|
-
export type ColorHarmony =
|
|
4
|
-
| 'monochromatic'
|
|
5
|
-
| 'analogous'
|
|
6
|
-
| 'complementary'
|
|
7
|
-
| 'triadic'
|
|
8
|
-
| 'tetradic'
|
|
9
|
-
| 'splitComplementary';
|
|
10
|
-
|
|
11
|
-
export type SystemTone = 'neutral' | 'pastel' | 'earth' | 'jewel' | 'fluorescent';
|
|
2
|
+
import type { ColorHarmony, ColorTone } from './color-theory';
|
|
12
3
|
|
|
13
4
|
export interface ThemeModeConfig {
|
|
14
5
|
primaryColor: string;
|
|
15
6
|
harmony: ColorHarmony;
|
|
16
|
-
|
|
7
|
+
colorTone: ColorTone;
|
|
17
8
|
}
|
|
18
9
|
|
|
19
10
|
export interface ThemeConfig {
|