diff --git a/ui/src/components/ThemeSwitcher.tsx b/ui/src/components/ThemeSwitcher.tsx
index fe5c175..990d769 100644
--- a/ui/src/components/ThemeSwitcher.tsx
+++ b/ui/src/components/ThemeSwitcher.tsx
@@ -1,6 +1,5 @@
import { Button } from "@ui/components/ui/button";
import { ButtonGroup } from "@ui/components/ui/button-group";
-import { Text } from "@ui/components/ui/typography";
import { useTheme } from "@ui/contexts/ThemeContext";
import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
@@ -10,38 +9,70 @@ const translation = {
system: "Système",
};
-export function ThemeSwitcher() {
+export function ThemeSwitcher({ isCollapsed = false }: { isCollapsed?: boolean }) {
const { theme, setTheme } = useTheme();
+ const getThemeIcon = () => {
+ switch (theme) {
+ case "light":
+ return
;
+ case "dark":
+ return
;
+ case "system":
+ return
;
+ }
+ };
+
+ const cycleTheme = () => {
+ const themes: Array<"light" | "dark" | "system"> = ["light", "system", "dark"];
+ const currentIndex = themes.indexOf(theme);
+ const nextIndex = (currentIndex + 1) % themes.length;
+ setTheme(themes[nextIndex]);
+ };
+
+ if (isCollapsed) {
+ return (
+
+ );
+ }
+
return (
-
- Thème: {translation[theme]}
-
-
-
-
-
-
+
+
+
+
+
);
}
diff --git a/ui/src/components/ui/button.tsx b/ui/src/components/ui/button.tsx
index 3617848..393820b 100644
--- a/ui/src/components/ui/button.tsx
+++ b/ui/src/components/ui/button.tsx
@@ -10,7 +10,8 @@ const buttonVariants = cva(
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ outline:
+ "border bg-background text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
diff --git a/ui/src/components/ui/dialog.tsx b/ui/src/components/ui/dialog.tsx
index 4ffcfb6..5c45e1b 100644
--- a/ui/src/components/ui/dialog.tsx
+++ b/ui/src/components/ui/dialog.tsx
@@ -68,7 +68,7 @@ const DialogTitle = React.forwardRef<
>(({ className, ...props }, ref) => (
));
diff --git a/ui/src/components/ui/time-input.tsx b/ui/src/components/ui/time-input.tsx
index 833986e..2bc97cf 100644
--- a/ui/src/components/ui/time-input.tsx
+++ b/ui/src/components/ui/time-input.tsx
@@ -7,6 +7,7 @@ interface TimeInputProps {
defaultValue?: string;
onChange?: (value: string) => void;
className?: string;
+ isDisabled?: boolean;
id?: string;
}
@@ -20,6 +21,7 @@ export const TimeInputWithLabel = ({
defaultValue,
onChange,
className,
+ isDisabled,
id = "time-picker",
}: TimeInputWithLabelProps) => {
return (
@@ -32,6 +34,7 @@ export const TimeInputWithLabel = ({
defaultValue={defaultValue || "08:30:00"}
onChange={onChange}
className={className}
+ isDisabled={isDisabled}
id={id}
/>
@@ -43,6 +46,7 @@ export const TimeInput = ({
defaultValue,
onChange,
className,
+ isDisabled,
id = "time-picker",
}: TimeInputProps) => {
return (
@@ -52,6 +56,7 @@ export const TimeInput = ({
step="60"
value={value}
defaultValue={defaultValue}
+ disabled={isDisabled}
onChange={(e) => onChange?.(e.target.value)}
className={cn(
"bg-background appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
diff --git a/ui/src/contexts/ThemeContext.tsx b/ui/src/contexts/ThemeContext.tsx
index 55b3a67..486c370 100644
--- a/ui/src/contexts/ThemeContext.tsx
+++ b/ui/src/contexts/ThemeContext.tsx
@@ -1,22 +1,34 @@
-import { createContext, ReactNode, useContext, useEffect, useState } from "react";
+import { createContext, useContext, useEffect, useState } from "react";
type Theme = "dark" | "light" | "system";
-interface ThemeContextType {
+type ThemeProviderProps = {
+ children: React.ReactNode;
+ defaultTheme?: Theme;
+ storageKey?: string;
+};
+
+type ThemeProviderState = {
theme: Theme;
setTheme: (theme: Theme) => void;
-}
+};
-const ThemeContext = createContext