@g9tm/aiassistant-react 0.0.0-stage → 1.8.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,10 @@
1
+ /**
2
+ * Design tokens in three levels (layer 2): base (colours, sizes), semantic (surface, accent, danger) and per
3
+ * component (approval-card-border, user-bubble). Every value is a CSS variable the host can set; none is global.
4
+ */
5
+ import type { CSSProperties } from "react";
6
+ import type { AssistantTheme } from "@g9tm/aiassistant";
7
+ export declare const LIGHT: Readonly<Record<string, string>>;
8
+ export declare const DARK: Readonly<Record<string, string>>;
9
+ /** The CSS variables of a theme (the host's tokens over the defaults of its mode), as a React style. */
10
+ export declare function themeVars(theme: AssistantTheme): CSSProperties;
package/dist/theme.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Design tokens in three levels (layer 2): base (colours, sizes), semantic (surface, accent, danger) and per
3
+ * component (approval-card-border, user-bubble). Every value is a CSS variable the host can set; none is global.
4
+ */
5
+ export const LIGHT = {
6
+ "surface": "#ffffff", "surface-2": "#f6f4f1", "ink": "#22201d", "muted": "#6b6660", "line": "#e4ded6",
7
+ "accent": "#8a4b2a", "accent-ink": "#ffffff", "danger": "#b42318", "ok": "#1f7a3d", "warn": "#a35a00",
8
+ "radius": "10px", "radius-s": "6px", "gap": "8px", "pad": "12px", "font": "inherit", "font-size": "14px",
9
+ "shadow": "0 6px 24px rgba(0,0,0,.12)", "motion": "180ms",
10
+ "approval-card-border": "var(--g9a-accent)", "chart-bar": "var(--g9a-accent)", "chart-grid": "var(--g9a-line)",
11
+ };
12
+ export const DARK = {
13
+ ...LIGHT,
14
+ "surface": "#1d1b19", "surface-2": "#272421", "ink": "#efeae4", "muted": "#a39c94", "line": "#3a3632",
15
+ "accent": "#e0a074", "accent-ink": "#1d1b19", "shadow": "0 6px 24px rgba(0,0,0,.5)",
16
+ };
17
+ /** The CSS variables of a theme (the host's tokens over the defaults of its mode), as a React style. */
18
+ export function themeVars(theme) {
19
+ const base = theme.mode === "dark" ? DARK : LIGHT;
20
+ const all = new Map([...Object.entries(base), ...Object.entries(theme.tokens)]);
21
+ return Object.fromEntries([...all].map(([k, v]) => ["--g9a-" + k.replace(/[^a-z0-9-]/giu, "-"), v.replace(/[;{}]/gu, "")]));
22
+ }
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@g9tm/aiassistant-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.8.0",
4
+ "description": "React DOM components for the G9 AI assistant, fully customisable (layouts, tokens, per-part classes, overrides, parts).",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Iman Kari",
8
+ "url": "G9TM"
9
+ },
10
+ "type": "module",
11
+ "sideEffects": false,
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./admin": {
20
+ "types": "./dist/admin.d.ts",
21
+ "import": "./dist/admin.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "README.md"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "dependencies": {
32
+ "@g9tm/aiassistant": "1.8.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/react": "19.3.0",
36
+ "react": "19.3.1"
37
+ },
38
+ "peerDependencies": {
39
+ "react": ">=18.0.0"
40
+ },
41
+ "scripts": {
42
+ "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json",
43
+ "typecheck": "tsc -p tsconfig.json --noEmit"
44
+ }
6
45
  }