@limetry/ui 1.2.83 → 1.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetry/ui",
3
- "version": "1.2.83",
3
+ "version": "1.2.85",
4
4
  "description": "Shared design system for Limetry — components, icons, and design tokens.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,10 +2,16 @@
2
2
 
3
3
  /**
4
4
  * Controlled sun/moon toggle used by every Limetry web header.
5
+ *
6
+ * Icon and chrome follow {@link ThemeToggleProps.resolvedTheme} directly so Expo
7
+ * web (where `bg-card` is a light-only token and `dark:` icon swaps look inverted)
8
+ * matches the native toggle: sun in dark mode, moon in light mode.
5
9
  */
6
10
 
7
11
  import type { JSX } from "react"
8
12
 
13
+ import { cn } from "../lib/cn"
14
+
9
15
  export type ThemeToggleProps = {
10
16
  /** Current resolved theme. */
11
17
  resolvedTheme: "light" | "dark"
@@ -33,10 +39,19 @@ export function ThemeToggle({
33
39
  type="button"
34
40
  aria-label={isDark ? "Switch to light mode" : "Switch to dark mode"}
35
41
  onClick={onToggle}
36
- className={`flex h-9 w-9 items-center justify-center rounded-xl border border-border bg-card text-muted-foreground transition-colors hover:bg-muted hover:text-foreground ${className}`}
42
+ className={cn(
43
+ "flex h-9 w-9 items-center justify-center rounded-xl border transition-colors",
44
+ isDark
45
+ ? "border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 hover:text-slate-100"
46
+ : "border-slate-200 bg-white text-slate-500 hover:bg-slate-100 hover:text-slate-900",
47
+ className,
48
+ )}
37
49
  >
38
- <SunIcon className="h-[1.1rem] w-[1.1rem] dark:hidden" />
39
- <MoonIcon className="hidden h-[1.1rem] w-[1.1rem] dark:block" />
50
+ {isDark ? (
51
+ <SunIcon className="h-[1.1rem] w-[1.1rem]" />
52
+ ) : (
53
+ <MoonIcon className="h-[1.1rem] w-[1.1rem]" />
54
+ )}
40
55
  </button>
41
56
  )
42
57
  }