-
-
-
+
diff --git a/frontend/libs/i18n/chat/de.json b/frontend/libs/i18n/chat/de.json
index 74a135a..188278e 100644
--- a/frontend/libs/i18n/chat/de.json
+++ b/frontend/libs/i18n/chat/de.json
@@ -1,6 +1,6 @@
{
"chat": {
- "initialMessage": "Hi 👋, ich bin dein KI-Assistent und und hier, um dich bei allen Fragen zu den bereitgestellten Dokumenten zu unterstützen!",
+ "initialMessage": "Hi 👋, ich bin dein KI-Assistent {bot_name} und hier, um dich bei allen Fragen zu den bereitgestellten Dokumenten zu unterstützen!",
"send": "Senden",
"justAsk": "Frag mich einfach...",
"sources": "Quellen",
@@ -11,4 +11,4 @@
},
"disclaimer": "Der Assistent kann Fehler machen. Bitte überprüfe wichtige Informationen. Die Antworten sind nicht rechtsverbindlich."
}
-}
\ No newline at end of file
+}
diff --git a/frontend/libs/i18n/chat/en.json b/frontend/libs/i18n/chat/en.json
index 07b1d1b..d879834 100644
--- a/frontend/libs/i18n/chat/en.json
+++ b/frontend/libs/i18n/chat/en.json
@@ -1,6 +1,6 @@
{
"chat": {
- "initialMessage": "Hi 👋, I’m the AI Docs Chatbot, here to support you with any questions regarding the provided documents!",
+ "initialMessage": "Hi 👋, I’m your AI Assistant {bot_name}, here to support you with any questions regarding the provided documents!",
"send": "Send",
"justAsk": "How can i help you?",
"sources": "Sources",
@@ -11,4 +11,4 @@
},
"disclaimer": "The AI powered chatbot can be wrong. Check important information. The answers are not legally binding."
}
-}
\ No newline at end of file
+}
diff --git a/frontend/libs/shared/README.md b/frontend/libs/shared/README.md
new file mode 100644
index 0000000..cd0a173
--- /dev/null
+++ b/frontend/libs/shared/README.md
@@ -0,0 +1,53 @@
+# Shared Libraries
+
+This directory contains reusable components, utilities, and configurations used across the frontend application.
+
+## Contents
+
+### Configuration & Theming
+- **settings.ts** - Application settings with environment variable support
+- **theme.store.ts** - Pinia store for theme management
+- **global.css** - Global styles and Tailwind configuration
+
+### UI Components
+- **NavigationContainer** - Top navigation bar with theme toggle
+- **LogoContainer** - Container for displaying logos
+- **SideBarContainer** - Sidebar layout component with header and scrollable content
+- **ThemeToggle** - Dark/light mode toggle button
+
+### Utilities
+- Date formatting
+- UUID generation
+- File size formatting
+- Markdown rendering
+- Empty checks
+
+## Environment Configuration
+
+Settings can be customized using environment variables in a `.env` file:
+
+```
+VITE_BOT_NAME=My Custom Bot
+VITE_UI_LOGO_PATH=/assets/custom-logo.svg
+VITE_UI_THEME_DEFAULT=dark
+VITE_UI_THEME_OPTIONS=light,dark
+```
+
+## Usage Example
+
+```vue
+
+
+
+
+
+
+
+
+
+
+
+```
diff --git a/frontend/libs/shared/global.css b/frontend/libs/shared/global.css
index 89c1c8c..4bd50d9 100644
--- a/frontend/libs/shared/global.css
+++ b/frontend/libs/shared/global.css
@@ -2,7 +2,6 @@
@tailwind components;
@tailwind utilities;
-
html,
body,
#app {
@@ -36,3 +35,21 @@ main {
.base-200-highlight {
background-color: var(--base-200-highlight);
}
+
+/* Chat text styles */
+.chat-text {
+ color: var(--tw-prose-body);
+}
+
+[data-theme="light"] .chat-text {
+ color: #333333;
+}
+
+[data-theme="dark"] .chat-text {
+ color: #f5f5f5;
+}
+
+.avatar img {
+ background-color: white;
+ height: 42px;
+}
diff --git a/frontend/libs/shared/settings.ts b/frontend/libs/shared/settings.ts
new file mode 100644
index 0000000..86c2fe9
--- /dev/null
+++ b/frontend/libs/shared/settings.ts
@@ -0,0 +1,45 @@
+export interface AppSettings {
+ bot: {
+ name: string;
+ };
+ ui: {
+ logoPath: string;
+ theme: {
+ default: string;
+ options: string[];
+ };
+ };
+ // Add other configuration sections as needed
+}
+
+// Default settings to use as fallbacks
+const defaultSettings: AppSettings = {
+ bot: {
+ name: "Knowledge Agent",
+ },
+ ui: {
+ logoPath: "/assets/navigation-logo.svg",
+ theme: {
+ default: "light",
+ options: ["light", "dark"],
+ },
+ },
+};
+
+// Load settings from environment variables with fallbacks to defaults
+export const settings: AppSettings = {
+ bot: {
+ name: import.meta.env.VITE_BOT_NAME || defaultSettings.bot.name,
+ },
+ ui: {
+ logoPath: import.meta.env.VITE_UI_LOGO_PATH || defaultSettings.ui.logoPath,
+ theme: {
+ default:
+ import.meta.env.VITE_UI_THEME_DEFAULT ||
+ defaultSettings.ui.theme.default,
+ options: import.meta.env.VITE_UI_THEME_OPTIONS
+ ? (import.meta.env.VITE_UI_THEME_OPTIONS as string).split(",")
+ : defaultSettings.ui.theme.options,
+ },
+ },
+};
diff --git a/frontend/libs/shared/store/theme.store.ts b/frontend/libs/shared/store/theme.store.ts
new file mode 100644
index 0000000..67550f6
--- /dev/null
+++ b/frontend/libs/shared/store/theme.store.ts
@@ -0,0 +1,34 @@
+import { defineStore } from "pinia";
+import { ref, watch } from "vue";
+import { settings } from "../settings";
+
+export const useThemeStore = defineStore("theme", () => {
+ const THEME_STORAGE_KEY = "app-theme";
+ const availableThemes = settings.ui.theme.options;
+ const currentTheme = ref(loadSavedTheme());
+
+ function loadSavedTheme() {
+ const savedTheme = localStorage.getItem(THEME_STORAGE_KEY);
+ return savedTheme && availableThemes.includes(savedTheme)
+ ? savedTheme
+ : settings.ui.theme.default;
+ }
+
+ function setTheme(theme: string) {
+ if (!availableThemes.includes(theme)) return;
+ currentTheme.value = theme;
+ localStorage.setItem(THEME_STORAGE_KEY, theme);
+ applyTheme(theme);
+ }
+
+ function applyTheme(theme: string) {
+ document.documentElement.setAttribute("data-theme", theme);
+ document.documentElement.classList.remove(...availableThemes);
+ document.documentElement.classList.add(theme);
+ }
+
+ // Initialize theme
+ applyTheme(currentTheme.value);
+
+ return { currentTheme, setTheme, availableThemes };
+});
diff --git a/frontend/libs/shared/ui/NavigationContainer.vue b/frontend/libs/shared/ui/NavigationContainer.vue
index b267c78..6d81cd5 100644
--- a/frontend/libs/shared/ui/NavigationContainer.vue
+++ b/frontend/libs/shared/ui/NavigationContainer.vue
@@ -1,14 +1,23 @@
-
-
-
-
![]()
-
-
-
+
+
+
![]()
+
+
+
+
+
+
diff --git a/frontend/libs/shared/ui/ThemeToggle.vue b/frontend/libs/shared/ui/ThemeToggle.vue
new file mode 100644
index 0000000..ea27f1b
--- /dev/null
+++ b/frontend/libs/shared/ui/ThemeToggle.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index 8da51d4..2f55940 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -3,72 +3,125 @@ module.exports = {
content: [
"apps/**/index.html",
"apps/**/src/**/*.{vue,js,ts}",
- "libs/**/*.{vue,js,ts}"
+ "libs/**/*.{vue,js,ts}",
],
theme: {
extend: {
typography: (theme) => ({
dark: {
css: {
- color: theme('colors.white'),
- 'h1, h2, h3, h4': {
- color: theme('colors.white'),
+ color: theme("colors.white"),
+ "h1, h2, h3, h4": {
+ color: theme("colors.white"),
},
a: {
- color: theme('colors.white'),
+ color: theme("colors.white"),
},
strong: {
- color: theme('colors.white'),
+ color: theme("colors.white"),
},
- 'ol > li::marker': {
- color: theme('colors.white'),
+ "ol > li::marker": {
+ color: theme("colors.white"),
},
- 'ul > li::marker': {
- color: theme('colors.white'),
+ "ul > li::marker": {
+ color: theme("colors.white"),
},
li: {
- color: theme('colors.white'), // For list items themselves
+ color: theme("colors.white"),
},
blockquote: {
- color: theme('colors.white'),
+ color: theme("colors.white"),
},
code: {
- color: theme('colors.white'),
+ color: theme("colors.white"),
},
},
},
}),
},
},
- plugins: [require('@tailwindcss/typography'), require("daisyui")],
+ plugins: [require("@tailwindcss/typography"), require("daisyui")],
daisyui: {
themes: [
{
- appTheme: {
- "secondary": "#f6d860",
- "primary": "#045462",
- "primary-content": "#ffff",
+ light: {
+ // Light color for primary (navigation) in light mode
+ primary: "#f8f9fa",
+ "primary-content": "#0a1e2d", // Dark text on light background
- "accent": "#F8EC17",
- "accent-content": "#045462",
+ // Secondary color
+ secondary: "#575756", // Gray-80
+ "secondary-content": "#ffffff",
- "neutral": "#334155",
- "neutral-content": "#F1F5F9",
+ // Spacemint for accent buttons (btn-accent)
+ accent: "#00c3cd", // Spacemint
+ "accent-content": "#fff",
- "base-100": "#ffffff",
- "base-200": "#F9FAFB",
- "base-300": "#D1D5DB",
+ // Neutral colors
+ neutral: "#B2B2B2",
+ "neutral-content": "#0a1e2d",
- "info": "#41AEF5",
+ // Base colors - WHITE BACKGROUND
+ "base-100": "#ffffff", // White background
+ "base-200": "#EDEDED", // Gray-10
+ "base-300": "#DADADA", // Gray-20
+ "base-content": "#333333", // Dark text for light theme
- '--scrollbar-track': '#ffff',
- '--scrollbar-thumb': 'rgba(0, 0, 0, .3)',
- "--base-200-highlight": "#E5EDEF",
- }
- }
+ // Info, success, warning, error
+ info: "#00c3cd", // Spacemint
+ success: "#00c387", // Fresh Green
+ warning: "#fafc00", // Sunshine
+ error: "#ff0555", // Coral
+
+ // Scrollbar and highlights
+ "--scrollbar-track": "#ffffff",
+ "--scrollbar-thumb": "rgba(10, 30, 45, 0.3)",
+ "--base-200-highlight": "#C6C6C6",
+
+ // Fix for chat text color
+ ".chat-text": "#333333", // Dark text color for chat in light mode
+ },
+ dark: {
+ // Keep Navy Blue for primary (navigation) in dark mode
+ primary: "#0a1e2d",
+ "primary-content": "#ffffff",
+
+ // Secondary color
+ secondary: "#575756", // Gray-80
+ "secondary-content": "#ffffff",
+
+ // Spacemint for accent buttons (btn-accent)
+ accent: "#00c3cd", // Spacemint
+ "accent-content": "#fff",
+
+ // Neutral colors
+ neutral: "#B2B2B2",
+ "neutral-content": "#ffffff",
+
+ // Base colors - DARK BACKGROUND
+ "base-100": "#1e1e1e", // Dark background
+ "base-200": "#2d2d2d", // Dark Gray
+ "base-300": "#3d3d3d", // Medium Gray
+ "base-content": "#f5f5f5", // Light text for dark theme
+
+ // Info, success, warning, error
+ info: "#00c3cd", // Spacemint
+ success: "#00c387", // Fresh Green
+ warning: "#fafc00", // Sunshine
+ error: "#ff0555", // Coral
+
+ // Scrollbar and highlights
+ "--scrollbar-track": "#2d2d2d",
+ "--scrollbar-thumb": "rgba(255, 255, 255, 0.3)",
+ "--base-200-highlight": "#4d4d4d",
+
+ // Fix for chat text color
+ ".chat-text": "#f5f5f5", // Light text color for chat in dark mode
+ },
+ },
],
utils: true,
logs: false,
- themeRoot: "#app",
- }
-}
+ themeRoot: ":root",
+ },
+};
diff --git a/frontend/tsconfig.base.json b/frontend/tsconfig.base.json
index 4d843bf..8683dd8 100644
--- a/frontend/tsconfig.base.json
+++ b/frontend/tsconfig.base.json
@@ -1,36 +1,38 @@
{
- "compileOnSave": false,
- "compilerOptions": {
- "rootDir": ".",
- "sourceMap": true,
- "declaration": false,
- "moduleResolution": "node",
- "emitDecoratorMetadata": true,
- "experimentalDecorators": true,
- "useDefineForClassFields": true,
- "importHelpers": true,
- "target": "esnext",
- "jsx": "preserve",
- "isolatedModules": true,
- "resolveJsonModule": true,
- "allowImportingTsExtensions": true,
- "jsxImportSource": "vue",
- "module": "esnext",
- "lib": ["es2020", "dom", "DOM.Iterable"],
- "skipLibCheck": true,
- "skipDefaultLibCheck": true,
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "baseUrl": ".",
- "paths": {
- "@chat": ["libs/chat-app/index"],
- "@admin": ["libs/admin-app/index"],
- "@i18n/chat": ["libs/i18n/chat/index"],
- "@i18n/admin": ["libs/i18n/admin/index"],
- "@shared/ui": ["libs/shared/ui/index"],
- "@shared/utils": ["libs/shared/utils/src/index"],
- "@shared/style": ["libs/shared/global.css"]
- }
- },
- "exclude": ["node_modules", "tmp"]
+ "compileOnSave": false,
+ "compilerOptions": {
+ "rootDir": ".",
+ "sourceMap": true,
+ "declaration": false,
+ "moduleResolution": "node",
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "useDefineForClassFields": true,
+ "importHelpers": true,
+ "target": "esnext",
+ "jsx": "preserve",
+ "isolatedModules": true,
+ "resolveJsonModule": true,
+ "allowImportingTsExtensions": true,
+ "jsxImportSource": "vue",
+ "module": "esnext",
+ "lib": ["es2020", "dom", "DOM.Iterable"],
+ "skipLibCheck": true,
+ "skipDefaultLibCheck": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "baseUrl": ".",
+ "paths": {
+ "@chat": ["libs/chat-app/index"],
+ "@admin": ["libs/admin-app/index"],
+ "@i18n/chat": ["libs/i18n/chat/index"],
+ "@i18n/admin": ["libs/i18n/admin/index"],
+ "@shared/ui": ["libs/shared/ui/index"],
+ "@shared/utils": ["libs/shared/utils/src/index"],
+ "@shared/style": ["libs/shared/global.css"],
+ "@shared/settings": ["./libs/shared/settings.ts"],
+ "@shared/store/theme.store": ["./libs/shared/store/theme.store.ts"]
+ }
+ },
+ "exclude": ["node_modules", "tmp"]
}