diff --git a/frontend/src/app.css b/frontend/src/app.css index 1ea8497..ef98546 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -1,127 +1,127 @@ -@import 'tailwindcss'; -@import 'tw-animate-css'; - -/* - * Semantic color tokens, one block per theme. Components should only ever - * use the Tailwind utilities mapped below (bg-bg, text-fg, bg-surface, etc.), - * never the raw values, so switching theme/data-attribute is all it takes. - */ -:root, -[data-theme='dark'] { - --color-bg: var(--sc-bg); - --color-surface: var(--sc-surface); - --color-surface-hover: var(--sc-surface-hover); - --color-border: var(--sc-border); - --color-fg: var(--sc-fg); - --color-muted-fg: var(--sc-muted-fg); - --color-primary: #3b82f6; - --color-primary-fg: #04122e; - --color-secondary: var(--sc-secondary); - --color-secondary-fg: var(--sc-secondary-fg); - --color-accent: #3b82f6; - --color-accent-fg: #04122e; - --color-danger: var(--sc-danger); - --color-danger-fg: var(--sc-danger-fg); - --color-success: var(--sc-success); - --color-success-fg: var(--sc-success-fg); - --color-warning: var(--sc-warning); - --color-warning-fg: var(--sc-warning-fg); - --color-ring: #60a5fa; - color-scheme: dark; -} - -/* Bridge onto the shared component library's own --sc-* tokens so parts of the app built from - @gabriel20xx/web-ui components outside AppShell's .collabtable-shell scope (AuthPage, the - Settings/Profile dialogs) carry this project's brand color too, instead of falling back to the - shared library's generic default blue. `html` raises specificity above shared-styles.css's - plain `:root`/`[data-theme]` rules so this wins regardless of stylesheet import order. */ -html:root, -html[data-theme='dark'] { - --sc-primary: var(--color-primary); - --sc-primary-hover: var(--color-secondary); - --sc-primary-fg: var(--color-primary-fg); - --sc-accent: var(--color-accent); - --sc-accent-fg: var(--color-accent-fg); - --sc-ring: var(--color-ring); -} - -[data-theme='light'] { - --color-bg: var(--sc-bg); - --color-surface: var(--sc-surface); - --color-surface-hover: var(--sc-surface-hover); - --color-border: var(--sc-border); - --color-fg: var(--sc-fg); - --color-muted-fg: var(--sc-muted-fg); - --color-primary: #2563eb; - --color-primary-fg: #ffffff; - --color-secondary: var(--sc-secondary); - --color-secondary-fg: var(--sc-secondary-fg); - --color-accent: #2563eb; - --color-accent-fg: #ffffff; - --color-danger: var(--sc-danger); - --color-danger-fg: var(--sc-danger-fg); - --color-success: var(--sc-success); - --color-success-fg: var(--sc-success-fg); - --color-warning: var(--sc-warning); - --color-warning-fg: var(--sc-warning-fg); - --color-ring: #2563eb; - color-scheme: light; -} - -/* See the dark-theme bridge above for why this exists and why `html` is needed. */ -html[data-theme='light'] { - --sc-primary: var(--color-primary); - --sc-primary-hover: var(--color-secondary); - --sc-primary-fg: var(--color-primary-fg); - --sc-accent: var(--color-accent); - --sc-accent-fg: var(--color-accent-fg); - --sc-ring: var(--color-ring); -} - -@theme inline { - --color-bg: var(--color-bg); - --color-surface: var(--color-surface); - --color-surface-hover: var(--color-surface-hover); - --color-border: var(--color-border); - --color-fg: var(--color-fg); - --color-muted-fg: var(--color-muted-fg); - --color-primary: var(--color-primary); - --color-primary-fg: var(--color-primary-fg); - --color-secondary: var(--color-secondary); - --color-secondary-fg: var(--color-secondary-fg); - --color-accent: var(--color-accent); - --color-accent-fg: var(--color-accent-fg); - --color-danger: var(--color-danger); - --color-danger-fg: var(--color-danger-fg); - --color-success: var(--color-success); - --color-success-fg: var(--color-success-fg); - --color-warning: var(--color-warning); - --color-warning-fg: var(--color-warning-fg); - --color-ring: var(--color-ring); - --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; -} - -html, -body { - height: 100%; -} - -body { - margin: 0; - background-color: var(--color-bg); - color: var(--color-fg); - font-family: var(--font-sans); - transition: - background-color 150ms ease, - color 150ms ease; -} - -::selection { - background-color: var(--color-primary); - color: var(--color-primary-fg); -} - -/* Wide-page setting: lifts the shared shell's default max-width cap on the main content area. */ +@import 'tailwindcss'; +@import 'tw-animate-css'; + +/* + * Semantic color tokens, one block per theme. Components should only ever + * use the Tailwind utilities mapped below (bg-bg, text-fg, bg-surface, etc.), + * never the raw values, so switching theme/data-attribute is all it takes. + */ +:root, +[data-theme='dark'] { + --color-bg: var(--sc-bg); + --color-surface: var(--sc-surface); + --color-surface-hover: var(--sc-surface-hover); + --color-border: var(--sc-border); + --color-fg: var(--sc-fg); + --color-muted-fg: var(--sc-muted-fg); + --color-primary: #3b82f6; + --color-primary-fg: #04122e; + --color-secondary: var(--sc-secondary); + --color-secondary-fg: var(--sc-secondary-fg); + --color-accent: #3b82f6; + --color-accent-fg: #04122e; + --color-danger: var(--sc-danger); + --color-danger-fg: var(--sc-danger-fg); + --color-success: var(--sc-success); + --color-success-fg: var(--sc-success-fg); + --color-warning: var(--sc-warning); + --color-warning-fg: var(--sc-warning-fg); + --color-ring: #60a5fa; + color-scheme: dark; +} + +/* Bridge onto the shared component library's own --sc-* tokens so parts of the app built from + @gabriel20xx/web-ui components outside AppShell's .collabtable-shell scope (AuthPage, the + Settings/Profile dialogs) carry this project's brand color too, instead of falling back to the + shared library's generic default blue. `html` raises specificity above shared-styles.css's + plain `:root`/`[data-theme]` rules so this wins regardless of stylesheet import order. */ +html:root, +html[data-theme='dark'] { + --sc-primary: var(--color-primary); + --sc-primary-hover: var(--color-secondary); + --sc-primary-fg: var(--color-primary-fg); + --sc-accent: var(--color-accent); + --sc-accent-fg: var(--color-accent-fg); + --sc-ring: var(--color-ring); +} + +[data-theme='light'] { + --color-bg: var(--sc-bg); + --color-surface: var(--sc-surface); + --color-surface-hover: var(--sc-surface-hover); + --color-border: var(--sc-border); + --color-fg: var(--sc-fg); + --color-muted-fg: var(--sc-muted-fg); + --color-primary: #2563eb; + --color-primary-fg: #ffffff; + --color-secondary: var(--sc-secondary); + --color-secondary-fg: var(--sc-secondary-fg); + --color-accent: #2563eb; + --color-accent-fg: #ffffff; + --color-danger: var(--sc-danger); + --color-danger-fg: var(--sc-danger-fg); + --color-success: var(--sc-success); + --color-success-fg: var(--sc-success-fg); + --color-warning: var(--sc-warning); + --color-warning-fg: var(--sc-warning-fg); + --color-ring: #2563eb; + color-scheme: light; +} + +/* See the dark-theme bridge above for why this exists and why `html` is needed. */ +html[data-theme='light'] { + --sc-primary: var(--color-primary); + --sc-primary-hover: var(--color-secondary); + --sc-primary-fg: var(--color-primary-fg); + --sc-accent: var(--color-accent); + --sc-accent-fg: var(--color-accent-fg); + --sc-ring: var(--color-ring); +} + +@theme inline { + --color-bg: var(--color-bg); + --color-surface: var(--color-surface); + --color-surface-hover: var(--color-surface-hover); + --color-border: var(--color-border); + --color-fg: var(--color-fg); + --color-muted-fg: var(--color-muted-fg); + --color-primary: var(--color-primary); + --color-primary-fg: var(--color-primary-fg); + --color-secondary: var(--color-secondary); + --color-secondary-fg: var(--color-secondary-fg); + --color-accent: var(--color-accent); + --color-accent-fg: var(--color-accent-fg); + --color-danger: var(--color-danger); + --color-danger-fg: var(--color-danger-fg); + --color-success: var(--color-success); + --color-success-fg: var(--color-success-fg); + --color-warning: var(--color-warning); + --color-warning-fg: var(--color-warning-fg); + --color-ring: var(--color-ring); + --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; +} + +html, +body { + height: 100%; +} + +body { + margin: 0; + background-color: var(--color-bg); + color: var(--color-fg); + font-family: var(--font-sans); + transition: + background-color 150ms ease, + color 150ms ease; +} + +::selection { + background-color: var(--color-primary); + color: var(--color-primary-fg); +} + +/* Wide-page setting: lifts the shared shell's default max-width cap on the main content area. */ [data-wide-layout='true'] .sc-main { width: calc(100% - 2rem); } diff --git a/frontend/src/lib/components/ui/dropdown-menu/content.svelte b/frontend/src/lib/components/ui/dropdown-menu/content.svelte index 3e3d635..cc96a9a 100644 --- a/frontend/src/lib/components/ui/dropdown-menu/content.svelte +++ b/frontend/src/lib/components/ui/dropdown-menu/content.svelte @@ -2,14 +2,7 @@ import { DropdownMenu } from 'bits-ui'; import { cn } from '$lib/utils/cn.js'; - let { - ref = $bindable(null), - class: className, - sideOffset = 6, - align = 'end', - children, - ...restProps - } = $props(); + let { ref = $bindable(null), class: className, sideOffset = 6, align = 'end', children, ...restProps } = $props(); diff --git a/frontend/src/lib/features/layout/SettingsDialog.svelte b/frontend/src/lib/features/layout/SettingsDialog.svelte index 19aebab..8b44607 100644 --- a/frontend/src/lib/features/layout/SettingsDialog.svelte +++ b/frontend/src/lib/features/layout/SettingsDialog.svelte @@ -68,7 +68,6 @@ type="checkbox" checked={layoutState.wide} onchange={(event) => layoutState.setWide(event.currentTarget.checked)} - />
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index 6ca2cd9..25680d8 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -1,16 +1,16 @@ - - - - - {@render children()} - - + import '$lib/theme.svelte.js'; + import { QueryClientProvider } from '@tanstack/svelte-query'; + import { queryClient } from '$lib/query/queryClient.js'; + import AppShell from '$lib/features/layout/AppShell.svelte'; + + let { children } = $props(); + + + + + {@render children()} + + diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 81dd23d..4992a02 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -1,35 +1,35 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import tailwindcss from '@tailwindcss/vite'; -import { sveltekit } from '@sveltejs/kit/vite'; -import { defineConfig } from 'vite'; +import fs from 'node:fs'; +import path from 'node:path'; +import tailwindcss from '@tailwindcss/vite'; +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vite'; import adapter from '@sveltejs/adapter-static'; - -// Real installed frontend dependency versions for the About page, resolved from -// node_modules (not the package.json semver range) so it can't drift from what's bundled. -const FRONTEND_TECH_STACK_PACKAGES = [ - { name: 'Svelte', pkg: 'svelte' }, - { name: 'SvelteKit', pkg: '@sveltejs/kit' }, - { name: 'TanStack Query', pkg: '@tanstack/svelte-query' }, - { name: 'Tailwind CSS', pkg: 'tailwindcss' }, - { name: 'Vite', pkg: 'vite' }, -]; - -function readInstalledVersion(pkg) { - try { - const pkgJsonPath = path.resolve(import.meta.dirname, 'node_modules', pkg, 'package.json'); - return JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8')).version ?? null; - } catch { - return null; - } -} - -const frontendTechStack = FRONTEND_TECH_STACK_PACKAGES.flatMap(({ name, pkg }) => { - const version = readInstalledVersion(pkg); - return version ? [{ name, version }] : []; -}); - -export default defineConfig({ + +// Real installed frontend dependency versions for the About page, resolved from +// node_modules (not the package.json semver range) so it can't drift from what's bundled. +const FRONTEND_TECH_STACK_PACKAGES = [ + { name: 'Svelte', pkg: 'svelte' }, + { name: 'SvelteKit', pkg: '@sveltejs/kit' }, + { name: 'TanStack Query', pkg: '@tanstack/svelte-query' }, + { name: 'Tailwind CSS', pkg: 'tailwindcss' }, + { name: 'Vite', pkg: 'vite' }, +]; + +function readInstalledVersion(pkg) { + try { + const pkgJsonPath = path.resolve(import.meta.dirname, 'node_modules', pkg, 'package.json'); + return JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8')).version ?? null; + } catch { + return null; + } +} + +const frontendTechStack = FRONTEND_TECH_STACK_PACKAGES.flatMap(({ name, pkg }) => { + const version = readInstalledVersion(pkg); + return version ? [{ name, version }] : []; +}); + +export default defineConfig({ plugins: [ tailwindcss(), sveltekit({ @@ -41,19 +41,19 @@ export default defineConfig({ fallback: 'index.html', }), }), - ], - resolve: { - preserveSymlinks: true, - }, - define: { - __FRONTEND_TECH_STACK__: JSON.stringify(frontendTechStack), - }, - server: { - port: 5173, - proxy: { - '/web': 'http://localhost:8080', - '/health': 'http://localhost:8080', - '/api': 'http://localhost:8080', - }, - }, -}); + ], + resolve: { + preserveSymlinks: true, + }, + define: { + __FRONTEND_TECH_STACK__: JSON.stringify(frontendTechStack), + }, + server: { + port: 5173, + proxy: { + '/web': 'http://localhost:8080', + '/health': 'http://localhost:8080', + '/api': 'http://localhost:8080', + }, + }, +});