@chaaskit/client 0.1.0 → 0.1.1

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.
Files changed (60) hide show
  1. package/dist/lib/index.js +53 -80
  2. package/dist/lib/index.js.map +1 -1
  3. package/dist/lib/routes/AcceptInviteRoute.js +1 -1
  4. package/dist/lib/routes/AcceptInviteRoute.js.map +1 -1
  5. package/dist/lib/routes/AdminDashboardRoute.js +1 -1
  6. package/dist/lib/routes/AdminDashboardRoute.js.map +1 -1
  7. package/dist/lib/routes/AdminTeamRoute.js +1 -1
  8. package/dist/lib/routes/AdminTeamRoute.js.map +1 -1
  9. package/dist/lib/routes/AdminTeamsRoute.js +1 -1
  10. package/dist/lib/routes/AdminTeamsRoute.js.map +1 -1
  11. package/dist/lib/routes/AdminUsersRoute.js +1 -1
  12. package/dist/lib/routes/AdminUsersRoute.js.map +1 -1
  13. package/dist/lib/routes/ApiKeysRoute.js +1 -1
  14. package/dist/lib/routes/ApiKeysRoute.js.map +1 -1
  15. package/dist/lib/routes/AutomationsRoute.js +1 -1
  16. package/dist/lib/routes/AutomationsRoute.js.map +1 -1
  17. package/dist/lib/routes/ChatRoute.js +1 -1
  18. package/dist/lib/routes/ChatRoute.js.map +1 -1
  19. package/dist/lib/routes/DocumentsRoute.js +1 -1
  20. package/dist/lib/routes/DocumentsRoute.js.map +1 -1
  21. package/dist/lib/routes/OAuthConsentRoute.js +1 -1
  22. package/dist/lib/routes/OAuthConsentRoute.js.map +1 -1
  23. package/dist/lib/routes/PricingRoute.js +1 -1
  24. package/dist/lib/routes/PricingRoute.js.map +1 -1
  25. package/dist/lib/routes/PrivacyRoute.js +1 -1
  26. package/dist/lib/routes/PrivacyRoute.js.map +1 -1
  27. package/dist/lib/routes/TeamSettingsRoute.js +1 -1
  28. package/dist/lib/routes/TeamSettingsRoute.js.map +1 -1
  29. package/dist/lib/routes/TermsRoute.js +1 -1
  30. package/dist/lib/routes/TermsRoute.js.map +1 -1
  31. package/dist/lib/routes/VerifyEmailRoute.js +1 -1
  32. package/dist/lib/routes/VerifyEmailRoute.js.map +1 -1
  33. package/dist/lib/ssr-utils.js +44 -1
  34. package/dist/lib/ssr-utils.js.map +1 -1
  35. package/dist/lib/ssr.js +23 -0
  36. package/dist/lib/ssr.js.map +1 -1
  37. package/dist/lib/styles.css +21 -62
  38. package/package.json +7 -2
  39. package/src/contexts/ConfigContext.tsx +42 -4
  40. package/src/contexts/ThemeContext.tsx +39 -68
  41. package/src/index.tsx +8 -2
  42. package/src/routes/AcceptInviteRoute.tsx +1 -1
  43. package/src/routes/AdminDashboardRoute.tsx +1 -1
  44. package/src/routes/AdminTeamRoute.tsx +1 -1
  45. package/src/routes/AdminTeamsRoute.tsx +1 -1
  46. package/src/routes/AdminUsersRoute.tsx +1 -1
  47. package/src/routes/ApiKeysRoute.tsx +1 -1
  48. package/src/routes/AutomationsRoute.tsx +1 -1
  49. package/src/routes/ChatRoute.tsx +2 -1
  50. package/src/routes/DocumentsRoute.tsx +1 -1
  51. package/src/routes/OAuthConsentRoute.tsx +1 -1
  52. package/src/routes/PricingRoute.tsx +1 -1
  53. package/src/routes/PrivacyRoute.tsx +1 -1
  54. package/src/routes/TeamSettingsRoute.tsx +1 -1
  55. package/src/routes/TermsRoute.tsx +1 -1
  56. package/src/routes/VerifyEmailRoute.tsx +1 -1
  57. package/src/ssr-utils.tsx +80 -1
  58. package/src/ssr.ts +59 -0
  59. package/src/styles/index.css +16 -63
  60. package/src/tailwind-preset.js +360 -0
@@ -1,6 +1,25 @@
1
1
  import { createContext, useContext, useState, useEffect, type ReactNode } from 'react';
2
2
  import type { AppConfig } from '@chaaskit/shared';
3
3
 
4
+ // Declare global window property for SSR-injected config
5
+ declare global {
6
+ interface Window {
7
+ __CHAASKIT_CONFIG__?: AppConfig;
8
+ }
9
+ }
10
+
11
+ /**
12
+ * Get config injected via ConfigScript in the HTML head.
13
+ * This allows the config to be available immediately on page load,
14
+ * avoiding flash of default values.
15
+ */
16
+ function getInjectedConfig(): AppConfig | undefined {
17
+ if (typeof window !== 'undefined' && window.__CHAASKIT_CONFIG__) {
18
+ return window.__CHAASKIT_CONFIG__;
19
+ }
20
+ return undefined;
21
+ }
22
+
4
23
  // Default config - used as fallback while loading
5
24
  const defaultConfig: AppConfig = {
6
25
  app: {
@@ -173,11 +192,30 @@ const ConfigContext = createContext<ConfigContextValue>({
173
192
  configLoaded: false,
174
193
  });
175
194
 
176
- export function ConfigProvider({ children }: { children: ReactNode }) {
177
- const [config, setConfig] = useState<AppConfig>(defaultConfig);
178
- const [configLoaded, setConfigLoaded] = useState(false);
195
+ interface ConfigProviderProps {
196
+ children: ReactNode;
197
+ /**
198
+ * Initial config to use immediately, avoiding a flash of default values.
199
+ * If provided, the config will not be fetched from /api/config.
200
+ * Useful when config is available from SSR loaders.
201
+ */
202
+ initialConfig?: AppConfig;
203
+ }
204
+
205
+ export function ConfigProvider({ children, initialConfig }: ConfigProviderProps) {
206
+ // Priority: 1. initialConfig prop, 2. injected window config, 3. defaults + fetch
207
+ const injectedConfig = getInjectedConfig();
208
+ const preloadedConfig = initialConfig || injectedConfig;
209
+
210
+ const [config, setConfig] = useState<AppConfig>(
211
+ preloadedConfig ? { ...defaultConfig, ...preloadedConfig } : defaultConfig
212
+ );
213
+ const [configLoaded, setConfigLoaded] = useState(!!preloadedConfig);
179
214
 
180
215
  useEffect(() => {
216
+ // Skip fetching if we have preloaded config
217
+ if (preloadedConfig) return;
218
+
181
219
  async function loadConfig() {
182
220
  try {
183
221
  const response = await fetch('/api/config');
@@ -196,7 +234,7 @@ export function ConfigProvider({ children }: { children: ReactNode }) {
196
234
  }
197
235
  }
198
236
  loadConfig();
199
- }, []);
237
+ }, [preloadedConfig]);
200
238
 
201
239
  return (
202
240
  <ConfigContext.Provider value={{ config, configLoaded }}>
@@ -5,7 +5,6 @@ import {
5
5
  useEffect,
6
6
  type ReactNode,
7
7
  } from 'react';
8
- import { useConfig } from './ConfigContext';
9
8
 
10
9
  interface ThemeContextType {
11
10
  theme: string;
@@ -15,73 +14,56 @@ interface ThemeContextType {
15
14
 
16
15
  const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
17
16
 
18
- export function ThemeProvider({ children }: { children: ReactNode }) {
19
- const config = useConfig();
17
+ /**
18
+ * Default available themes.
19
+ * Apps can override this via the ThemeProvider's availableThemes prop.
20
+ */
21
+ const DEFAULT_THEMES = ['light', 'dark'];
22
+ const DEFAULT_THEME = 'dark';
23
+
24
+ interface ThemeProviderProps {
25
+ children: ReactNode;
26
+ /** Available theme names. Defaults to ['light', 'dark'] */
27
+ availableThemes?: string[];
28
+ /** Default theme if none stored. Defaults to 'dark' */
29
+ defaultTheme?: string;
30
+ }
31
+
32
+ /**
33
+ * ThemeProvider manages the current theme via data-theme attribute.
34
+ *
35
+ * Theme CSS variables should be defined in your Tailwind config using
36
+ * html[data-theme="themeName"] selectors. This provider only manages:
37
+ * - The data-theme attribute on <html>
38
+ * - localStorage persistence
39
+ * - Cookie sync for SSR
40
+ */
41
+ export function ThemeProvider({
42
+ children,
43
+ availableThemes = DEFAULT_THEMES,
44
+ defaultTheme = DEFAULT_THEME,
45
+ }: ThemeProviderProps) {
20
46
  const [theme, setThemeState] = useState(() => {
21
- // Check localStorage first, then config default
22
- const stored = localStorage.getItem('theme');
23
- if (stored && config.theming.themes[stored]) {
24
- return stored;
47
+ // Check localStorage first, then use default
48
+ if (typeof window !== 'undefined') {
49
+ const stored = localStorage.getItem('theme');
50
+ if (stored && availableThemes.includes(stored)) {
51
+ return stored;
52
+ }
25
53
  }
26
- return config.theming.defaultTheme;
54
+ return defaultTheme;
27
55
  });
28
56
 
29
- const availableThemes = Object.keys(config.theming.themes);
30
-
31
57
  useEffect(() => {
32
- // Apply theme to document
58
+ // Set data-theme attribute - CSS selectors handle the actual styling
33
59
  document.documentElement.setAttribute('data-theme', theme);
34
60
  localStorage.setItem('theme', theme);
35
61
  // Set cookie for SSR to read
36
62
  document.cookie = `theme=${theme};path=/;max-age=31536000;SameSite=Lax`;
37
-
38
- // Apply theme colors as CSS variables
39
- const themeConfig = config.theming.themes[theme];
40
- if (themeConfig) {
41
- const root = document.documentElement;
42
- const colors = themeConfig.colors;
43
-
44
- // Convert hex colors to RGB values
45
- Object.entries(colors).forEach(([key, value]) => {
46
- const cssKey = `--color-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;
47
- const rgb = hexToRgb(value);
48
- if (rgb) {
49
- root.style.setProperty(cssKey, `${rgb.r} ${rgb.g} ${rgb.b}`);
50
- }
51
- });
52
- }
53
-
54
- // Apply fonts
55
- document.documentElement.style.setProperty(
56
- '--font-sans',
57
- config.theming.fonts.sans
58
- );
59
- document.documentElement.style.setProperty(
60
- '--font-mono',
61
- config.theming.fonts.mono
62
- );
63
-
64
- // Apply border radius
65
- document.documentElement.style.setProperty(
66
- '--radius-sm',
67
- config.theming.borderRadius.sm
68
- );
69
- document.documentElement.style.setProperty(
70
- '--radius-md',
71
- config.theming.borderRadius.md
72
- );
73
- document.documentElement.style.setProperty(
74
- '--radius-lg',
75
- config.theming.borderRadius.lg
76
- );
77
- document.documentElement.style.setProperty(
78
- '--radius-full',
79
- config.theming.borderRadius.full
80
- );
81
- }, [theme, config.theming]);
63
+ }, [theme]);
82
64
 
83
65
  function setTheme(newTheme: string) {
84
- if (config.theming.themes[newTheme]) {
66
+ if (availableThemes.includes(newTheme)) {
85
67
  setThemeState(newTheme);
86
68
  }
87
69
  }
@@ -100,14 +82,3 @@ export function useTheme() {
100
82
  }
101
83
  return context;
102
84
  }
103
-
104
- function hexToRgb(hex: string): { r: number; g: number; b: number } | null {
105
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
106
- return result
107
- ? {
108
- r: parseInt(result[1]!, 16),
109
- g: parseInt(result[2]!, 16),
110
- b: parseInt(result[3]!, 16),
111
- }
112
- : null;
113
- }
package/src/index.tsx CHANGED
@@ -71,6 +71,7 @@ export { default as AdminTeamPage } from './pages/AdminTeamPage';
71
71
  // Use in React Router routes that render the chat interface
72
72
  // ============================================
73
73
  import React from 'react';
74
+ import type { AppConfig } from '@chaaskit/shared';
74
75
  import { AuthProvider as Auth } from './contexts/AuthContext';
75
76
  import { ThemeProvider as Theme } from './contexts/ThemeContext';
76
77
  import { ConfigProvider as Config } from './contexts/ConfigContext';
@@ -79,6 +80,11 @@ import { ProjectProvider as Project } from './contexts/ProjectContext';
79
80
 
80
81
  export interface ChatProvidersProps {
81
82
  children: React.ReactNode;
83
+ /**
84
+ * Initial config to use immediately, avoiding a flash of default values.
85
+ * Pass the config from SSR loaders to prevent "Welcome to AI Chat" flash.
86
+ */
87
+ initialConfig?: AppConfig;
82
88
  }
83
89
 
84
90
  /**
@@ -99,9 +105,9 @@ export interface ChatProvidersProps {
99
105
  * }
100
106
  * ```
101
107
  */
102
- export function ChatProviders({ children }: ChatProvidersProps) {
108
+ export function ChatProviders({ children, initialConfig }: ChatProvidersProps) {
103
109
  return (
104
- <Config>
110
+ <Config initialConfig={initialConfig}>
105
111
  <Theme>
106
112
  <Auth>
107
113
  <Team>
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function AcceptInviteRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function AdminDashboardRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function AdminTeamRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function AdminTeamsRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function AdminUsersRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function ApiKeysRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function AutomationsRoute() {
@@ -12,7 +12,8 @@ export function meta() {
12
12
  }
13
13
 
14
14
  export function links() {
15
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
15
+ // CSS is bundled via app's Tailwind preset - no separate stylesheet needed
16
+ return [];
16
17
  }
17
18
 
18
19
  export default function ChatRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function DocumentsRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function OAuthConsentRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function PricingRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function PrivacyRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function TeamSettingsRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function TermsRoute() {
@@ -10,7 +10,7 @@ export function meta() {
10
10
  }
11
11
 
12
12
  export function links() {
13
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
13
+ return [];
14
14
  }
15
15
 
16
16
  export default function VerifyEmailRoute() {
package/src/ssr-utils.tsx CHANGED
@@ -19,11 +19,89 @@
19
19
  */
20
20
 
21
21
  import { lazy, Suspense, type ComponentType, type LazyExoticComponent } from 'react';
22
+ import type { AppConfig } from '@chaaskit/shared';
22
23
  import { ClientOnly } from './components/ClientOnly';
23
24
  import { ChatLoadingSkeleton, SimpleLoadingSkeleton } from './components/LoadingSkeletons';
24
25
 
25
26
  export { ClientOnly, ChatLoadingSkeleton, SimpleLoadingSkeleton };
26
27
 
28
+ /**
29
+ * Props for ConfigScript component.
30
+ */
31
+ interface ConfigScriptProps {
32
+ /**
33
+ * The app config to inject into the page.
34
+ * This should come from the SSR loader.
35
+ */
36
+ config: AppConfig;
37
+ }
38
+
39
+ /**
40
+ * Injects the app config into the page as a script tag.
41
+ * Place this in the <head> of your root layout to make the config
42
+ * available immediately on page load, avoiding flash of default values.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * // app/root.tsx
47
+ * import { ConfigScript } from '@chaaskit/client/ssr-utils';
48
+ * import { config } from '../config/app.config';
49
+ *
50
+ * export default function Root() {
51
+ * return (
52
+ * <html>
53
+ * <head>
54
+ * <ConfigScript config={config} />
55
+ * </head>
56
+ * <body>...</body>
57
+ * </html>
58
+ * );
59
+ * }
60
+ * ```
61
+ */
62
+ export function ConfigScript({ config }: ConfigScriptProps) {
63
+ // Only include the UI-related config to avoid exposing sensitive data
64
+ const safeConfig = {
65
+ app: config.app,
66
+ ui: config.ui,
67
+ theming: config.theming,
68
+ auth: {
69
+ methods: config.auth?.methods,
70
+ allowUnauthenticated: config.auth?.allowUnauthenticated,
71
+ },
72
+ payments: {
73
+ enabled: config.payments?.enabled,
74
+ plans: config.payments?.plans?.map(plan => ({
75
+ id: plan.id,
76
+ name: plan.name,
77
+ type: plan.type,
78
+ })),
79
+ },
80
+ legal: config.legal,
81
+ sharing: config.sharing,
82
+ teams: config.teams,
83
+ projects: config.projects,
84
+ documents: {
85
+ enabled: config.documents?.enabled,
86
+ },
87
+ api: {
88
+ enabled: config.api?.enabled,
89
+ },
90
+ promptTemplates: {
91
+ enabled: config.promptTemplates?.enabled,
92
+ allowUserTemplates: config.promptTemplates?.allowUserTemplates,
93
+ },
94
+ };
95
+
96
+ return (
97
+ <script
98
+ dangerouslySetInnerHTML={{
99
+ __html: `window.__CHAASKIT_CONFIG__=${JSON.stringify(safeConfig)};`,
100
+ }}
101
+ />
102
+ );
103
+ }
104
+
27
105
  /**
28
106
  * Route configuration options
29
107
  */
@@ -61,7 +139,8 @@ export function createRoute(config: RouteConfig) {
61
139
  }
62
140
 
63
141
  function links() {
64
- return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
142
+ // CSS is bundled via app's Tailwind preset - no separate stylesheet needed
143
+ return [];
65
144
  }
66
145
 
67
146
  function RouteComponent() {
package/src/ssr.ts CHANGED
@@ -109,6 +109,65 @@ export function getThemeVariables(config: AppConfig, theme: string): Record<stri
109
109
  return vars;
110
110
  }
111
111
 
112
+ /**
113
+ * Generates CSS for ALL themes using html[data-theme] selectors.
114
+ * This is the recommended way to include theme styles - it allows instant
115
+ * theme switching by just changing the data-theme attribute on <html>.
116
+ *
117
+ * @example
118
+ * ```tsx
119
+ * // app/root.tsx
120
+ * import { generateAllThemesCSS, baseStyles } from '@chaaskit/client/ssr';
121
+ *
122
+ * // Cache on server - only generate once
123
+ * let cachedCSS: string | null = null;
124
+ *
125
+ * export async function loader() {
126
+ * if (!cachedCSS) cachedCSS = generateAllThemesCSS(config);
127
+ * return { themeCSS: cachedCSS };
128
+ * }
129
+ *
130
+ * export default function Root() {
131
+ * const { themeCSS } = useLoaderData();
132
+ * return (
133
+ * <html data-theme="dark">
134
+ * <head>
135
+ * <style dangerouslySetInnerHTML={{ __html: themeCSS + baseStyles }} />
136
+ * </head>
137
+ * ...
138
+ * </html>
139
+ * );
140
+ * }
141
+ * ```
142
+ */
143
+ export function generateAllThemesCSS(config: AppConfig): string {
144
+ const themes = config.theming.themes;
145
+ let css = '';
146
+
147
+ for (const [themeName, themeConfig] of Object.entries(themes)) {
148
+ const cssVars = Object.entries(themeConfig.colors)
149
+ .map(([key, value]) => {
150
+ const cssKey = `--color-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;
151
+ return `${cssKey}: ${hexToRgb(value)};`;
152
+ })
153
+ .join('\n ');
154
+
155
+ css += `
156
+ html[data-theme="${themeName}"] {
157
+ ${cssVars}
158
+ --font-sans: ${config.theming.fonts.sans};
159
+ --font-mono: ${config.theming.fonts.mono};
160
+ --radius-sm: ${config.theming.borderRadius.sm};
161
+ --radius-md: ${config.theming.borderRadius.md};
162
+ --radius-lg: ${config.theming.borderRadius.lg};
163
+ --radius-full: ${config.theming.borderRadius.full};
164
+ }
165
+ `;
166
+ }
167
+
168
+ return css;
169
+ }
170
+
112
171
  /**
113
172
  * Base CSS styles for SSR pages.
114
173
  * Include this in your HTML template for consistent styling.
@@ -2,69 +2,22 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
- /* Default theme variables (Light) */
6
- :root {
7
- --color-primary: 99 102 241;
8
- --color-primary-hover: 79 70 229;
9
- --color-secondary: 139 92 246;
10
-
11
- --color-background: 255 255 255;
12
- --color-background-secondary: 249 250 251;
13
- --color-sidebar: 243 244 246;
14
-
15
- --color-text-primary: 17 24 39;
16
- --color-text-secondary: 107 114 128;
17
- --color-text-muted: 156 163 175;
18
-
19
- --color-border: 229 231 235;
20
- --color-input-background: 255 255 255;
21
- --color-input-border: 209 213 219;
22
-
23
- --color-user-message-bg: 99 102 241;
24
- --color-user-message-text: 255 255 255;
25
- --color-assistant-message-bg: 243 244 246;
26
- --color-assistant-message-text: 17 24 39;
27
-
28
- --color-success: 16 185 129;
29
- --color-warning: 245 158 11;
30
- --color-error: 239 68 68;
31
-
32
- --font-sans: 'Inter', system-ui, sans-serif;
33
- --font-mono: 'JetBrains Mono', Menlo, monospace;
34
-
35
- --radius-sm: 0.25rem;
36
- --radius-md: 0.5rem;
37
- --radius-lg: 0.75rem;
38
- --radius-full: 9999px;
39
- }
40
-
41
- /* Dark theme */
42
- [data-theme="dark"] {
43
- --color-primary: 129 140 248;
44
- --color-primary-hover: 165 180 252;
45
- --color-secondary: 167 139 250;
46
-
47
- --color-background: 17 24 39;
48
- --color-background-secondary: 31 41 55;
49
- --color-sidebar: 15 23 42;
50
-
51
- --color-text-primary: 249 250 251;
52
- --color-text-secondary: 209 213 219;
53
- --color-text-muted: 107 114 128;
54
-
55
- --color-border: 55 65 81;
56
- --color-input-background: 31 41 55;
57
- --color-input-border: 75 85 99;
58
-
59
- --color-user-message-bg: 79 70 229;
60
- --color-user-message-text: 255 255 255;
61
- --color-assistant-message-bg: 31 41 55;
62
- --color-assistant-message-text: 249 250 251;
63
-
64
- --color-success: 52 211 153;
65
- --color-warning: 251 191 36;
66
- --color-error: 248 113 113;
67
- }
5
+ /*
6
+ * Theme CSS variables are NOT defined here.
7
+ * The consuming app (chaaskit-app) is responsible for providing CSS variable values
8
+ * via inline styles on <html> from config/app.config.ts.
9
+ *
10
+ * Required variables:
11
+ * --color-primary, --color-primary-hover, --color-secondary
12
+ * --color-background, --color-background-secondary, --color-sidebar
13
+ * --color-text-primary, --color-text-secondary, --color-text-muted
14
+ * --color-border, --color-input-background, --color-input-border
15
+ * --color-user-message-bg, --color-user-message-text
16
+ * --color-assistant-message-bg, --color-assistant-message-text
17
+ * --color-success, --color-warning, --color-error
18
+ * --font-sans, --font-mono
19
+ * --radius-sm, --radius-md, --radius-lg, --radius-full
20
+ */
68
21
 
69
22
  /* Base styles */
70
23
  html {