@ai-composer/themes 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAInF,mGAAmG;AACnG,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,2BAA2B,KAAK,MAAM,CAAC;AAChD,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,cAAc;IACd,oBAAoB;IACpB,YAAY;IACZ,kBAAkB;IAClB,wBAAwB;IACxB,cAAc;IACd,oBAAoB;IACpB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,iBAAiB;IACjB,mBAAmB;IACnB,+BAA+B;IAC/B,yBAAyB;IACzB,+BAA+B;IAC/B,yBAAyB;IACzB,gCAAgC;IAChC,0BAA0B;IAC1B,+BAA+B;IAC/B,yBAAyB;IACzB,cAAc;IACd,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,sBAAsB;IACtB,iBAAiB;IACjB,mBAAmB;IACnB,cAAc;IACd,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;CACb,CAAC"}
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@ai-composer/themes",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "sideEffects": [
7
+ "*.css"
8
+ ],
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./css/*": "./css/*",
17
+ "./package.json": "./package.json"
18
+ },
19
+ "style": "./css/default.css",
20
+ "peerDependencies": {},
21
+ "devDependencies": {
22
+ "vitest": "^2.1.8"
23
+ },
24
+ "module": "./index.js"
25
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@ai-composer/themes",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "sideEffects": [
7
+ "*.css"
8
+ ],
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./css/*": "./css/*",
17
+ "./package.json": "./package.json"
18
+ },
19
+ "style": "./css/default.css",
20
+ "peerDependencies": {},
21
+ "devDependencies": {
22
+ "vitest": "^2.1.8"
23
+ }
24
+ }
package/project.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "themes",
3
+ "$schema": "../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "packages/themes/src",
5
+ "projectType": "library",
6
+ "tags": [
7
+ "scope:adapter",
8
+ "type:lib"
9
+ ],
10
+ "targets": {
11
+ "build": {
12
+ "executor": "@nx/js:tsc",
13
+ "outputs": [
14
+ "{options.outputPath}"
15
+ ],
16
+ "options": {
17
+ "outputPath": "packages/themes/dist",
18
+ "main": "packages/themes/src/index.ts",
19
+ "tsConfig": "packages/themes/tsconfig.lib.json",
20
+ "rootDir": "packages/themes/src",
21
+ "assets": [
22
+ {
23
+ "input": "../packages/themes",
24
+ "glob": "*.md",
25
+ "output": "."
26
+ },
27
+ {
28
+ "input": "packages/themes/css",
29
+ "glob": "**/*",
30
+ "output": "./css"
31
+ }
32
+ ],
33
+ "generateExportsIfAbsent": false
34
+ }
35
+ },
36
+ "test": {
37
+ "executor": "nx:run-commands",
38
+ "options": {
39
+ "command": "vitest run --project themes --passWithNoTests"
40
+ }
41
+ },
42
+ "lint": {
43
+ "executor": "@nx/eslint:lint",
44
+ "outputs": [
45
+ "{options.outputFile}"
46
+ ],
47
+ "options": {
48
+ "lintFilePatterns": [
49
+ "packages/themes/**/*.ts",
50
+ "packages/themes/**/*.tsx"
51
+ ]
52
+ }
53
+ },
54
+ "typecheck": {
55
+ "executor": "nx:run-commands",
56
+ "options": {
57
+ "command": "tsc -p packages/themes/tsconfig.spec.json --noEmit"
58
+ }
59
+ }
60
+ }
61
+ }
package/src/index.ts ADDED
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @ai-composer/themes — design tokens and theme presets.
3
+ *
4
+ * Import CSS by entry (package exports `./css/*`):
5
+ *
6
+ * import '@ai-composer/themes/css/tokens.css';
7
+ * import '@ai-composer/themes/css/default.css'; // structure, uses tokens
8
+ * import '@ai-composer/themes/css/dark.css'; // optional dark override
9
+ *
10
+ * Theme layers (ADR-0007):
11
+ * tokens → default → mode (compact) → app overrides → component overrides
12
+ */
13
+
14
+ export const THEME_CSS_ENTRIES = ['tokens', 'default', 'dark', 'compact'] as const;
15
+
16
+ export type ThemeCssEntry = (typeof THEME_CSS_ENTRIES)[number];
17
+
18
+ /** Programmatically resolve a CSS import specifier (e.g. for bundler-resolved dynamic imports). */
19
+ export function themeCss(entry: ThemeCssEntry): string {
20
+ return `@ai-composer/themes/css/${entry}.css`;
21
+ }
22
+
23
+ /** Token names emitted by tokens.css — useful for docs tooling and lint rules. */
24
+ export const DESIGN_TOKENS = [
25
+ '--aic-background',
26
+ '--aic-surface-raised',
27
+ '--aic-surface-hover',
28
+ '--aic-border',
29
+ '--aic-border-focus',
30
+ '--aic-text',
31
+ '--aic-text-muted',
32
+ '--aic-text-placeholder',
33
+ '--aic-accent',
34
+ '--aic-accent-hover',
35
+ '--aic-accent-contrast',
36
+ '--aic-accent-disabled',
37
+ '--aic-chip-background',
38
+ '--aic-chip-text',
39
+ '--aic-chip-radius',
40
+ '--aic-chip-mention-background',
41
+ '--aic-chip-mention-text',
42
+ '--aic-chip-command-background',
43
+ '--aic-chip-command-text',
44
+ '--aic-chip-variable-background',
45
+ '--aic-chip-variable-text',
46
+ '--aic-chip-hashtag-background',
47
+ '--aic-chip-hashtag-text',
48
+ '--aic-radius',
49
+ '--aic-radius-sm',
50
+ '--aic-border-width',
51
+ '--aic-input-padding',
52
+ '--aic-input-min-height',
53
+ '--aic-input-max-height',
54
+ '--aic-toolbar-height',
55
+ '--aic-font-size',
56
+ '--aic-font-family',
57
+ '--aic-shadow',
58
+ '--aic-shadow-raised',
59
+ '--aic-focus-ring',
60
+ '--aic-transition',
61
+ '--aic-z-suggestions',
62
+ ] as const;
63
+
64
+ export type DesignToken = (typeof DESIGN_TOKENS)[number];
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "types": []
5
+ },
6
+ "include": [
7
+ "src/**/*.ts",
8
+ "src/**/*.tsx",
9
+ "vitest.config.ts"
10
+ ],
11
+ "exclude": [
12
+ "node_modules",
13
+ "dist"
14
+ ]
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "declarationMap": true,
6
+ "stripInternal": true,
7
+ "outDir": "../../dist/packages/themes"
8
+ },
9
+ "exclude": [
10
+ "**/*.test.ts",
11
+ "**/*.test.tsx",
12
+ "vitest.config.ts",
13
+ "src/test-setup.ts"
14
+ ]
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "types": [
6
+ "vitest"
7
+ ]
8
+ },
9
+ "include": [
10
+ "src/**/*.ts",
11
+ "src/**/*.tsx"
12
+ ],
13
+ "exclude": [
14
+ "vitest.config.ts"
15
+ ]
16
+ }
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ export default defineConfig({
3
+ resolve: {
4
+ },
5
+ test: {
6
+ name: 'themes',
7
+ environment: 'node',
8
+ include: ['src/**/*.test.{ts,tsx}'],
9
+ },
10
+ });
11
+