fix: satisfy checks

This commit is contained in:
realChriss 2025-11-27 08:27:32 +01:00
parent 97cec0b57e
commit 2218286f2e
5 changed files with 18 additions and 25 deletions

View file

@ -13,9 +13,9 @@ const THEME_ICONS: Record<string, JSX.Element> = {
system: <Monitor className="w-4 h-4" />,
default: <Sun className="w-4 h-4" />,
"default-dark": <Moon className="w-4 h-4" />,
midnight: <MoonStar className="w-4 h-4" />,
paper: <Palette className="w-4 h-4" />,
whitewall: <Wallpaper className="w-4 h-4" />,
midnight: <MoonStar className="w-4 h-4" />,
};
const ThemeSelect = ({ value, onValueChange, className }: ThemeSelectProps = {}) => {

View file

@ -22,7 +22,7 @@ import { createRequestKey } from "./store-utils";
/**
* Valid theme options
*/
const VALID_THEMES = ["system", "default", "default-dark", "paper", "whitewall", "midnight"] as const;
const VALID_THEMES = ["system", "default", "default-dark", "midnight", "paper", "whitewall"] as const;
export type Theme = (typeof VALID_THEMES)[number];
/**

View file

@ -31,26 +31,19 @@
--sidebar-accent-foreground: oklch(0.92 0.003 270);
--sidebar-border: oklch(0.25 0.005 270);
--sidebar-ring: oklch(0.7 0.08 290);
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--font-sans:
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--radius: 0.5rem;
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
0 2px 4px -1px hsl(0 0% 0% / 0.1);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
0 4px 6px -1px hsl(0 0% 0% / 0.1);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
0 8px 10px -1px hsl(0 0% 0% / 0.1);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
--tracking-normal: 0em;
--spacing: 0.25rem;

View file

@ -1 +1 @@
type Theme = "system" | "default" | "default-dark" | "paper" | "whitewall" | "midnight";
type Theme = "system" | "default" | "default-dark" | "midnight" | "paper" | "whitewall";

View file

@ -1,18 +1,18 @@
import defaultDarkThemeContent from "../themes/default-dark.css?raw";
import midnightThemeContent from "../themes/midnight.css?raw";
import paperThemeContent from "../themes/paper.css?raw";
import whitewallThemeContent from "../themes/whitewall.css?raw";
import midnightThemeContent from "../themes/midnight.css?raw";
const VALID_THEMES = ["system", "default", "default-dark", "paper", "whitewall", "midnight"] as const;
const VALID_THEMES = ["system", "default", "default-dark", "midnight", "paper", "whitewall"] as const;
type ValidTheme = (typeof VALID_THEMES)[number];
const THEME_CONTENT: Record<ValidTheme, string | null> = {
system: null, // System theme dynamically chooses between default and default-dark
default: null,
"default-dark": defaultDarkThemeContent,
midnight: midnightThemeContent,
paper: paperThemeContent,
whitewall: whitewallThemeContent,
midnight: midnightThemeContent,
};
export interface ThemeOption {
@ -24,9 +24,9 @@ export const THEME_OPTIONS: ThemeOption[] = [
{ value: "system", label: "Sync with system" },
{ value: "default", label: "Light" },
{ value: "default-dark", label: "Dark" },
{ value: "midnight", label: "Midnight" },
{ value: "paper", label: "Paper" },
{ value: "whitewall", label: "Whitewall" },
{ value: "midnight", label: "Midnight"},
];
const validateTheme = (theme: string): ValidTheme => {
@ -47,7 +47,7 @@ export const getSystemTheme = (): "default" | "default-dark" => {
* Resolves the actual theme to apply based on user preference
* If theme is "system", returns the system preference, otherwise returns the theme as-is
*/
export const resolveTheme = (theme: string): "default" | "default-dark" | "paper" | "whitewall" | "midnight" => {
export const resolveTheme = (theme: string): "default" | "default-dark" | "midnight" | "paper" | "whitewall" => {
if (theme === "system") {
return getSystemTheme();
}