feat: add theme palettes (#1326)

Add Neutral, Indigo, Forest, and Sand palettes independently of Light, Dark, and System. Persist and hydrate the selection, add the accessible settings picker, and include the validated review fixes for keyboard navigation and Swedish copy.
This commit is contained in:
Mattsson
2026-08-01 16:02:12 +02:00
committed by GitHub
parent f24e1076cf
commit d684e3c440
10 changed files with 422 additions and 8 deletions
@@ -25,11 +25,15 @@ import { useSettings } from '@/components/settings/useSettings'
import { resetAnalyticsIdentity } from '@/lib/analytics/reset'
import { useToast } from '@/components/ui/use-toast'
import { SUPPORTED_LOCALES, type Locale } from '@/i18n/config'
import { PalettePicker } from '@/components/settings/PalettePicker'
import { usePalette } from '@/components/providers/PaletteProvider'
import type { Palette } from '@/lib/theme/palettes'
export function AccountSettingsContent() {
const router = useRouter()
const supabase = createClient()
const { theme, setTheme } = useTheme()
const { palette, setPalette } = usePalette()
const [mounted, setMounted] = useState(false)
const hasCalendarExtension = ENABLED_EXTENSION_IDS.has('calendar')
const { settings } = useSettings()
@@ -123,6 +127,13 @@ export function AccountSettingsContent() {
en: tCommon('language_english'),
}
const paletteLabels: Record<Palette, string> = {
neutral: tSettings('palette_neutral'),
indigo: tSettings('palette_indigo'),
forest: tSettings('palette_forest'),
sand: tSettings('palette_sand'),
}
const nameUnchanged = !fullName.trim() || fullName.trim() === initialName
return (
@@ -195,6 +206,21 @@ export function AccountSettingsContent() {
)}
</SettingsRow>
<SettingsRow
label={tSettings('palette_label')}
help={tSettings('palette_description')}
align="baseline"
>
{mounted && (
<PalettePicker
value={palette}
onChange={setPalette}
labels={paletteLabels}
aria-label={tSettings('palette_label')}
/>
)}
</SettingsRow>
<SettingsRow
label={tSettings('section_language')}
help={tSettings('language_description')}