@ankhorage/contracts 0.3.1 → 1.0.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 +20 -0
- package/README.md +15 -26
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -6
- package/src/contracts.test.ts +48 -101
- package/src/index.ts +0 -1
- package/src/types.ts +1 -3
- package/dist/color-theory.d.ts +0 -58
- package/dist/color-theory.d.ts.map +0 -1
- package/dist/color-theory.js +0 -70
- package/dist/color-theory.js.map +0 -1
- package/src/color-theory.ts +0 -96
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @ankhorage/contracts
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- b0632c9: Remove the old tone/mood/theme-recommendation contracts and keep theme config serialized-only:
|
|
8
|
+
- Removed `COLOR_TONES`, `ColorTone`, `APP_MOODS`, `AppMood`, recommendation
|
|
9
|
+
types/constants, and `suggestedColorTone`.
|
|
10
|
+
- Removed `ThemeModeConfig.colorTone`; `ThemeModeConfig` is now
|
|
11
|
+
`{ primaryColor: string; harmony: string }`.
|
|
12
|
+
- Removed the legacy `@ankhorage/contracts/color-theory` export.
|
|
13
|
+
- Removed color generation, swatch, contrast, neutral, and semantic color APIs from
|
|
14
|
+
Contracts; color generation now belongs in `@ankhorage/color-theory`.
|
|
15
|
+
- Removed the Contracts dependency on `culori`.
|
|
16
|
+
|
|
17
|
+
## 0.3.2
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- bb775a6: Standardize package metadata and workflow files.
|
|
22
|
+
|
|
3
23
|
## 0.3.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -22,37 +22,26 @@ 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';
|
|
32
25
|
import type { DbAdapter } from '@ankhorage/contracts/db';
|
|
33
26
|
```
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
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:
|
|
28
|
+
Contracts keeps theme configuration serializable. Color validation, harmony,
|
|
29
|
+
swatch generation, contrast helpers, and semantic color references live in
|
|
30
|
+
`@ankhorage/color-theory`.
|
|
46
31
|
|
|
47
32
|
```ts
|
|
48
|
-
|
|
33
|
+
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
34
|
+
|
|
35
|
+
const theme: ThemeConfig = {
|
|
36
|
+
id: 'theme-default',
|
|
37
|
+
name: 'Default',
|
|
38
|
+
light: { primaryColor: '#3366ff', harmony: 'analogous' },
|
|
39
|
+
dark: { primaryColor: '#3366ff', harmony: 'analogous' },
|
|
40
|
+
};
|
|
49
41
|
```
|
|
50
42
|
|
|
51
|
-
These recommendation contracts are serializable handoff data for tooling. OKLCH,
|
|
52
|
-
chroma, and semantic-token generation stay in UI/theme packages.
|
|
53
|
-
|
|
54
43
|
Provider packages can implement the shared contracts without importing runtime,
|
|
55
|
-
CLI, ZORA, Expo Router, or app-generation logic.
|
|
44
|
+
CLI, ZORA, Expo Router, color generation, or app-generation logic.
|
|
56
45
|
|
|
57
46
|
```ts
|
|
58
47
|
import type { AuthAdapter } from '@ankhorage/contracts/auth';
|
|
@@ -84,6 +73,6 @@ export function createSupabaseAuthAdapter(): AuthAdapter {
|
|
|
84
73
|
## 🧠 Why this exists
|
|
85
74
|
|
|
86
75
|
Contracts separates shared data and runtime contracts from implementation details.
|
|
87
|
-
Standalone packages such as Supabase, Clerk,
|
|
88
|
-
these contracts while staying independent from Ankhorage
|
|
89
|
-
runtime, CLI, and UI packages.
|
|
76
|
+
Standalone packages such as Supabase, Clerk, database providers, or UI/color
|
|
77
|
+
packages can depend on these contracts while staying independent from Ankhorage
|
|
78
|
+
app generation, runtime, CLI, and UI packages.
|
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,
|
|
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"}
|
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,
|
|
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"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { AuthFlowConfig, AuthIdentifierKind, AuthSignUpField } from './auth';
|
|
2
|
-
import type { ColorHarmony, ColorTone } from './color-theory';
|
|
3
2
|
export interface ThemeModeConfig {
|
|
4
3
|
primaryColor: string;
|
|
5
|
-
harmony:
|
|
6
|
-
colorTone: ColorTone;
|
|
4
|
+
harmony: string;
|
|
7
5
|
}
|
|
8
6
|
export interface ThemeConfig {
|
|
9
7
|
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;AAElF,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,OAAO,GACP,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM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,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;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":["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AmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC","sourcesContent":["import type { AuthFlowConfig, AuthIdentifierKind, AuthSignUpField } from './auth';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: string;\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": "1.0.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@ankhorage/devtools": "^1.0.0",
|
|
@@ -18,10 +18,6 @@
|
|
|
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
|
-
},
|
|
25
21
|
"./db": {
|
|
26
22
|
"types": "./dist/db.d.ts",
|
|
27
23
|
"default": "./dist/db.js"
|
|
@@ -39,7 +35,7 @@
|
|
|
39
35
|
"packageManager": "bun@1.3.13",
|
|
40
36
|
"repository": {
|
|
41
37
|
"type": "git",
|
|
42
|
-
"url": "https://github.com/ankhorage/contracts"
|
|
38
|
+
"url": "git+https://github.com/ankhorage/contracts.git"
|
|
43
39
|
},
|
|
44
40
|
"homepage": "https://github.com/ankhorage/contracts#readme",
|
|
45
41
|
"bugs": {
|
package/src/contracts.test.ts
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
|
|
1
4
|
import { describe, expect, it } from 'bun:test';
|
|
2
5
|
|
|
3
6
|
import {
|
|
4
7
|
APP_CATEGORIES,
|
|
5
|
-
APP_CATEGORY_THEME_RECOMMENDATIONS,
|
|
6
|
-
APP_MOODS,
|
|
7
8
|
type AppCategory,
|
|
8
9
|
AUTH_PROVIDERS,
|
|
9
10
|
AUTH_SIGN_IN_IDENTIFIERS,
|
|
10
11
|
AUTH_SIGN_UP_POLICIES,
|
|
11
|
-
type AuthAdapter,
|
|
12
12
|
type AuthFlowConfig,
|
|
13
13
|
type AuthSpec,
|
|
14
|
-
COLOR_HARMONIES,
|
|
15
|
-
COLOR_TONES,
|
|
16
|
-
type DbAdapter,
|
|
17
14
|
DEPLOYMENT_TARGETS,
|
|
18
15
|
NAVIGATOR_TYPES,
|
|
19
|
-
type SignInInput,
|
|
20
16
|
type ThemeConfig,
|
|
21
17
|
} from './index';
|
|
22
18
|
|
|
19
|
+
async function collectTypeScriptFiles(directory: string): Promise<string[]> {
|
|
20
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
21
|
+
const files: string[] = [];
|
|
22
|
+
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
const path = join(directory, entry.name);
|
|
25
|
+
if (entry.isDirectory()) {
|
|
26
|
+
files.push(...(await collectTypeScriptFiles(path)));
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (entry.isFile() && entry.name.endsWith('.ts')) {
|
|
31
|
+
files.push(path);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return files;
|
|
36
|
+
}
|
|
37
|
+
|
|
23
38
|
describe('contracts', () => {
|
|
24
39
|
it('exports stable platform constants', () => {
|
|
25
40
|
expect(NAVIGATOR_TYPES).toEqual(['stack', 'tabs', 'drawer']);
|
|
@@ -64,37 +79,45 @@ describe('contracts', () => {
|
|
|
64
79
|
light: {
|
|
65
80
|
primaryColor: '#3366ff',
|
|
66
81
|
harmony: 'analogous',
|
|
67
|
-
colorTone: 'neutral',
|
|
68
82
|
},
|
|
69
83
|
dark: {
|
|
70
84
|
primaryColor: '#3366ff',
|
|
71
85
|
harmony: 'analogous',
|
|
72
|
-
colorTone: 'neutral',
|
|
73
86
|
},
|
|
74
87
|
};
|
|
75
88
|
|
|
76
89
|
expect(theme.light.primaryColor).toBe('#3366ff');
|
|
77
|
-
expect(theme.
|
|
90
|
+
expect(theme.light.harmony).toBe('analogous');
|
|
78
91
|
});
|
|
79
92
|
|
|
80
|
-
it('
|
|
81
|
-
const
|
|
93
|
+
it('does not ship color generation files from contracts', async () => {
|
|
94
|
+
const srcEntries = await readdir(join(process.cwd(), 'src'), { withFileTypes: true });
|
|
95
|
+
const names = srcEntries.map((entry) => entry.name);
|
|
82
96
|
|
|
83
|
-
expect(
|
|
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
|
-
}
|
|
97
|
+
expect(names.includes('colors')).toBe(false);
|
|
98
|
+
expect(names.includes('color-theory.ts')).toBe(false);
|
|
91
99
|
});
|
|
92
100
|
|
|
93
|
-
it('
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
it('removes all old tone/mood/recommendation symbols from src recursively', async () => {
|
|
102
|
+
const banned = [
|
|
103
|
+
'Color' + 'Tone',
|
|
104
|
+
'color' + 'Tone',
|
|
105
|
+
'COLOR_' + 'TONES',
|
|
106
|
+
'Color' + 'Mood',
|
|
107
|
+
'App' + 'Mood',
|
|
108
|
+
'APP_' + 'MOODS',
|
|
109
|
+
'suggested' + 'Color' + 'Tone',
|
|
110
|
+
'APP_CATEGORY_' + 'THEME_RECOMMENDATIONS',
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
const srcFiles = await collectTypeScriptFiles(join(process.cwd(), 'src'));
|
|
114
|
+
|
|
115
|
+
for (const file of srcFiles) {
|
|
116
|
+
if (basename(file) === 'contracts.test.ts') continue;
|
|
117
|
+
const content = await readFile(file, 'utf8');
|
|
118
|
+
for (const symbol of banned) {
|
|
119
|
+
expect(content.includes(symbol)).toBe(false);
|
|
120
|
+
}
|
|
98
121
|
}
|
|
99
122
|
});
|
|
100
123
|
|
|
@@ -126,80 +149,4 @@ describe('contracts', () => {
|
|
|
126
149
|
expect(auth.flow?.signInRoute).toBe('/sign-in');
|
|
127
150
|
expect(auth.signUp?.signUpPolicy).toBe('requireVerification');
|
|
128
151
|
});
|
|
129
|
-
|
|
130
|
-
it('accepts provider-neutral auth and db adapter implementations', async () => {
|
|
131
|
-
const authAdapter: AuthAdapter = {
|
|
132
|
-
capabilities: {
|
|
133
|
-
signInIdentifiers: ['email'],
|
|
134
|
-
supportsSignUp: true,
|
|
135
|
-
supportsPasswordReset: true,
|
|
136
|
-
supportsOtp: false,
|
|
137
|
-
supportsSessionRefresh: true,
|
|
138
|
-
},
|
|
139
|
-
async signIn(input: SignInInput) {
|
|
140
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
141
|
-
return {
|
|
142
|
-
ok: true,
|
|
143
|
-
data: {
|
|
144
|
-
accessToken: `token:${input.identifier.value}`,
|
|
145
|
-
user: {
|
|
146
|
-
id: 'user-1',
|
|
147
|
-
email: input.identifier.value,
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
},
|
|
152
|
-
async signUp(input) {
|
|
153
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
154
|
-
return {
|
|
155
|
-
ok: true,
|
|
156
|
-
data: {
|
|
157
|
-
id: 'user-1',
|
|
158
|
-
email: input.identifier.value,
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
},
|
|
162
|
-
async signOut() {
|
|
163
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
164
|
-
return { ok: true };
|
|
165
|
-
},
|
|
166
|
-
async getSession() {
|
|
167
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
168
|
-
return { ok: true, data: null };
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const dbAdapter: DbAdapter = {
|
|
173
|
-
async select() {
|
|
174
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
175
|
-
return { ok: true, data: [] };
|
|
176
|
-
},
|
|
177
|
-
async findById() {
|
|
178
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
179
|
-
return { ok: true, data: null };
|
|
180
|
-
},
|
|
181
|
-
async insert(input) {
|
|
182
|
-
const values = Array.isArray(input.values) ? input.values : [input.values];
|
|
183
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
184
|
-
return { ok: true, data: values };
|
|
185
|
-
},
|
|
186
|
-
async update() {
|
|
187
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
188
|
-
return { ok: true, data: [] };
|
|
189
|
-
},
|
|
190
|
-
async delete() {
|
|
191
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
192
|
-
return { ok: true, data: [] };
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const signInResult = await authAdapter.signIn({
|
|
197
|
-
identifier: { kind: 'email', value: 'hello@example.com' },
|
|
198
|
-
password: 'secret',
|
|
199
|
-
});
|
|
200
|
-
const selectResult = await dbAdapter.select({ table: 'profiles' });
|
|
201
|
-
|
|
202
|
-
expect(signInResult.ok).toBe(true);
|
|
203
|
-
expect(selectResult.ok).toBe(true);
|
|
204
|
-
});
|
|
205
152
|
});
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { AuthFlowConfig, AuthIdentifierKind, AuthSignUpField } from './auth';
|
|
2
|
-
import type { ColorHarmony, ColorTone } from './color-theory';
|
|
3
2
|
|
|
4
3
|
export interface ThemeModeConfig {
|
|
5
4
|
primaryColor: string;
|
|
6
|
-
harmony:
|
|
7
|
-
colorTone: ColorTone;
|
|
5
|
+
harmony: string;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
export interface ThemeConfig {
|
package/dist/color-theory.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/color-theory.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
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
|
package/dist/color-theory.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/src/color-theory.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
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>>;
|