@codefast/theme 0.3.16-canary.1 → 0.3.16-canary.3

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.
@@ -1,32 +1,43 @@
1
+ import { MEDIA } from "../constants.mjs";
2
+ import { colorSchemes } from "../types.mjs";
1
3
  import { jsx } from "react/jsx-runtime";
2
4
  //#region src/script/theme-script.tsx
5
+ function toScriptSafe(value) {
6
+ return JSON.stringify(value).replaceAll("<", "\\u003C").replaceAll(">", "\\u003E").replaceAll("/", "\\u002F");
7
+ }
8
+ const COLOR_SCHEME_REMOVE_ARGS = colorSchemes.map((s) => toScriptSafe(s)).join(",");
9
+ const COLOR_SCHEME_VALID_CHECK = colorSchemes.map((s) => `s===${toScriptSafe(s)}`).join("||");
3
10
  /**
4
11
  * Inline script that prevents Flash of Unstyled Content (FOUC).
5
12
  *
6
13
  * **Why this is needed:**
7
14
  * React hydration occurs after the browser has already painted the page.
8
- * Without this script, users would briefly see the wrong theme before
15
+ * Without this script, users would briefly see the wrong appearance before
9
16
  * React takes over and applies the correct one.
10
17
  *
11
18
  * **How it works:**
12
19
  * This script runs synchronously in the `<head>` before first paint:
13
- * 1. Resolves 'system' to 'light' or 'dark' using `matchMedia()`
14
- * 2. Removes prior `light` / `dark` / `system` classes on `<html>` (SSR may
15
- * have applied the wrong resolved class for `system`, e.g. default `dark`)
16
- * 3. Adds the resolved theme class and sets `color-scheme` for native controls
20
+ * 1. Resolves 'automatic' to 'light' or 'dark' using `matchMedia()`
21
+ * 2. Removes prior `light` / `dark` / `automatic` classes on `<html>` (SSR may
22
+ * have applied the wrong resolved class for `automatic`, e.g. default `dark`)
23
+ * 3. Adds the resolved color scheme class and sets `color-scheme` for native controls
17
24
  *
18
25
  * @example
19
26
  * ```tsx
20
27
  * // In __root.tsx (TanStack Start)
21
28
  * <head>
22
- * <ThemeScript theme={theme} />
29
+ * <AppearanceScript colorScheme={colorScheme} />
23
30
  * </head>
24
31
  * ```
25
32
  *
26
33
  * @since 0.3.16-canary.0
27
34
  */
28
- function ThemeScript({ theme }) {
29
- return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: `(function(){try{var theme="${theme}",resolvedTheme=theme;"system"===theme&&(resolvedTheme=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.classList.remove("light","dark","system"),document.documentElement.classList.add(resolvedTheme),document.documentElement.style.colorScheme=resolvedTheme}catch(error){}})()` } });
35
+ function AppearanceScript({ nonce, storageKey, colorScheme }) {
36
+ return /* @__PURE__ */ jsx("script", {
37
+ dangerouslySetInnerHTML: { __html: `(function(){try{var sk=${toScriptSafe(storageKey ?? null)},fbt=${toScriptSafe(colorScheme)},s=sk&&localStorage.getItem(sk),theme=(${COLOR_SCHEME_VALID_CHECK})?s:fbt,resolvedTheme=theme;"automatic"===theme&&(resolvedTheme=window.matchMedia(${toScriptSafe(MEDIA)}).matches?"dark":"light"),document.documentElement.classList.remove(${COLOR_SCHEME_REMOVE_ARGS}),document.documentElement.classList.add(resolvedTheme),document.documentElement.style.colorScheme=resolvedTheme}catch(e){}})()` },
38
+ suppressHydrationWarning: true,
39
+ ...nonce === void 0 ? {} : { nonce }
40
+ });
30
41
  }
31
42
  //#endregion
32
- export { ThemeScript };
43
+ export { AppearanceScript };
package/dist/start.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { RootThemeLoaderData, getRootThemeServerFn, getSsrSystemThemeServerFn, getThemeServerFn, persistThemeCookie, setThemeServerFn } from "./adapters/tanstack-start/server.mjs";
2
- export { type RootThemeLoaderData, getRootThemeServerFn, getSsrSystemThemeServerFn, getThemeServerFn, persistThemeCookie, setThemeServerFn };
1
+ import { RootColorSchemeLoaderData, getColorSchemeServerFn, getRootColorSchemeServerFn, getSsrColorSchemeServerFn, persistColorSchemeCookie, setColorSchemeServerFn } from "./adapters/tanstack-start/server.mjs";
2
+ export { type RootColorSchemeLoaderData, getColorSchemeServerFn, getRootColorSchemeServerFn, getSsrColorSchemeServerFn, persistColorSchemeCookie, setColorSchemeServerFn };
package/dist/start.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { getRootThemeServerFn, getSsrSystemThemeServerFn, getThemeServerFn, persistThemeCookie, setThemeServerFn } from "./adapters/tanstack-start/server.mjs";
2
- export { getRootThemeServerFn, getSsrSystemThemeServerFn, getThemeServerFn, persistThemeCookie, setThemeServerFn };
1
+ import { getColorSchemeServerFn, getRootColorSchemeServerFn, getSsrColorSchemeServerFn, persistColorSchemeCookie, setColorSchemeServerFn } from "./adapters/tanstack-start/server.mjs";
2
+ export { getColorSchemeServerFn, getRootColorSchemeServerFn, getSsrColorSchemeServerFn, persistColorSchemeCookie, setColorSchemeServerFn };
package/dist/types.d.mts CHANGED
@@ -2,59 +2,59 @@ import { z } from "zod";
2
2
 
3
3
  //#region src/types.d.ts
4
4
  /**
5
- * Zod schema for theme validation.
5
+ * Zod schema for color scheme validation.
6
6
  *
7
- * Acts as the single source of truth for all theme-related types.
8
- * Valid values: 'light', 'dark', 'system'.
7
+ * Acts as the single source of truth for all color-scheme-related types.
8
+ * Valid values: 'light', 'dark', 'automatic'.
9
9
  *
10
10
  * @since 0.3.16-canary.0
11
11
  */
12
- declare const themeSchema: z.ZodEnum<{
12
+ declare const colorSchemeSchema: z.ZodEnum<{
13
13
  light: "light";
14
14
  dark: "dark";
15
- system: "system";
15
+ automatic: "automatic";
16
16
  }>;
17
17
  /**
18
- * User's theme preference.
18
+ * User's color scheme preference.
19
19
  *
20
- * - `'light'` - Force light mode
21
- * - `'dark'` - Force dark mode
22
- * - `'system'` - Follow OS preference
20
+ * - `'light'` - Force light appearance
21
+ * - `'dark'` - Force dark appearance
22
+ * - `'automatic'` - Follow OS preference
23
23
  *
24
24
  * @since 0.3.16-canary.0
25
25
  */
26
- type Theme = z.infer<typeof themeSchema>;
26
+ type ColorScheme = z.infer<typeof colorSchemeSchema>;
27
27
  /**
28
- * Actual theme applied to the UI after resolving 'system'.
28
+ * Actual color scheme applied to the UI after resolving 'automatic'.
29
29
  *
30
- * When theme is 'system', this reflects the OS preference (light/dark).
30
+ * When color scheme is 'automatic', this reflects the OS preference (light/dark).
31
31
  *
32
32
  * @since 0.3.16-canary.0
33
33
  */
34
- type ResolvedTheme = Exclude<Theme, "system">;
34
+ type ResolvedColorScheme = Exclude<ColorScheme, "automatic">;
35
35
  /**
36
- * Array of all available theme options: `['light', 'dark', 'system']`.
36
+ * Array of all available color scheme options: `['light', 'dark', 'automatic']`.
37
37
  *
38
- * Useful for rendering theme selectors in UI components.
38
+ * Useful for rendering appearance selectors in UI components.
39
39
  *
40
40
  * @since 0.3.16-canary.0
41
41
  */
42
- declare const themes: ("light" | "dark" | "system")[];
42
+ declare const colorSchemes: ("light" | "dark" | "automatic")[];
43
43
  /**
44
- * Shape of the theme context value provided by ThemeProvider.
44
+ * Shape of the color scheme context value provided by AppearanceProvider.
45
45
  *
46
- * - `theme` - Current theme preference
47
- * - `resolvedTheme` - Actual theme applied (system resolved to light/dark)
48
- * - `setTheme` - Async function to update theme (triggers optimistic update)
49
- * - `isPending` - True while theme change is being persisted
46
+ * - `colorScheme` - Current color scheme preference
47
+ * - `resolvedColorScheme` - Actual color scheme applied (automatic resolved to light/dark)
48
+ * - `setPreferredColorScheme` - Async function to update color scheme (triggers optimistic update)
49
+ * - `isPending` - True while color scheme change is being persisted
50
50
  *
51
51
  * @since 0.3.16-canary.0
52
52
  */
53
- interface ThemeContextType {
54
- isPending: boolean;
55
- resolvedTheme: ResolvedTheme;
56
- setTheme: (value: Theme) => Promise<void>;
57
- theme: Theme;
58
- }
53
+ type ColorSchemeContextType = {
54
+ readonly isPending: boolean;
55
+ readonly resolvedColorScheme: ResolvedColorScheme;
56
+ readonly setColorScheme: (value: ColorScheme) => Promise<void>;
57
+ readonly colorScheme: ColorScheme;
58
+ };
59
59
  //#endregion
60
- export { ResolvedTheme, Theme, ThemeContextType, themeSchema, themes };
60
+ export { ColorScheme, ColorSchemeContextType, ResolvedColorScheme, colorSchemeSchema, colorSchemes };
package/dist/types.mjs CHANGED
@@ -1,25 +1,25 @@
1
1
  import { z } from "zod";
2
2
  //#region src/types.ts
3
3
  /**
4
- * Zod schema for theme validation.
4
+ * Zod schema for color scheme validation.
5
5
  *
6
- * Acts as the single source of truth for all theme-related types.
7
- * Valid values: 'light', 'dark', 'system'.
6
+ * Acts as the single source of truth for all color-scheme-related types.
7
+ * Valid values: 'light', 'dark', 'automatic'.
8
8
  *
9
9
  * @since 0.3.16-canary.0
10
10
  */
11
- const themeSchema = z.enum([
11
+ const colorSchemeSchema = z.enum([
12
12
  "light",
13
13
  "dark",
14
- "system"
14
+ "automatic"
15
15
  ]);
16
16
  /**
17
- * Array of all available theme options: `['light', 'dark', 'system']`.
17
+ * Array of all available color scheme options: `['light', 'dark', 'automatic']`.
18
18
  *
19
- * Useful for rendering theme selectors in UI components.
19
+ * Useful for rendering appearance selectors in UI components.
20
20
  *
21
21
  * @since 0.3.16-canary.0
22
22
  */
23
- const themes = themeSchema.options;
23
+ const colorSchemes = colorSchemeSchema.options;
24
24
  //#endregion
25
- export { themeSchema, themes };
25
+ export { colorSchemeSchema, colorSchemes };
@@ -1,36 +1,36 @@
1
- import { ResolvedTheme } from "../types.mjs";
1
+ import { ResolvedColorScheme } from "../types.mjs";
2
2
 
3
3
  //#region src/utils/dom.d.ts
4
4
  /**
5
- * Apply theme to the DOM by updating `<html>` element.
5
+ * Apply color scheme to the DOM by updating `<html>` element.
6
6
  *
7
7
  * Updates both:
8
8
  * - CSS class (for Tailwind's `dark:` variants)
9
9
  * - `color-scheme` style (for native form controls and scrollbars)
10
10
  *
11
- * @param resolved - The resolved theme to apply ('light' or 'dark')
11
+ * @param resolved - The resolved color scheme to apply ('light' or 'dark')
12
12
  *
13
13
  * @since 0.3.16-canary.0
14
14
  */
15
- declare function applyTheme(resolved: ResolvedTheme): void;
15
+ declare function applyColorScheme(resolved: ResolvedColorScheme): void;
16
16
  /**
17
- * Temporarily disable all CSS transitions during theme changes.
17
+ * Temporarily suppress all CSS transitions during color scheme changes.
18
18
  *
19
- * Prevents jarring color animations when switching between light/dark themes.
19
+ * Prevents jarring color animations when switching between light/dark appearances.
20
20
  * Respects user's `prefers-reduced-motion` preference (does nothing if enabled).
21
21
  *
22
22
  * @param nonce - Optional CSP nonce for the injected style element
23
- * @returns Cleanup function to re-enable transitions. Call after theme is applied.
23
+ * @returns Cleanup function to re-enable transitions. Call after color scheme is applied.
24
24
  *
25
25
  * @example
26
26
  * ```tsx
27
- * const enableTransitions = disableAnimation();
28
- * applyTheme('dark');
27
+ * const enableTransitions = suppressTransitions();
28
+ * applyColorScheme('dark');
29
29
  * enableTransitions(); // Re-enables CSS transitions
30
30
  * ```
31
31
  *
32
32
  * @since 0.3.16-canary.0
33
33
  */
34
- declare function disableAnimation(nonce?: string): () => void;
34
+ declare function suppressTransitions(nonce?: string): () => void;
35
35
  //#endregion
36
- export { applyTheme, disableAnimation };
36
+ export { applyColorScheme, suppressTransitions };
@@ -1,45 +1,45 @@
1
1
  //#region src/utils/dom.ts
2
2
  /**
3
- * Apply theme to the DOM by updating `<html>` element.
3
+ * Apply color scheme to the DOM by updating `<html>` element.
4
4
  *
5
5
  * Updates both:
6
6
  * - CSS class (for Tailwind's `dark:` variants)
7
7
  * - `color-scheme` style (for native form controls and scrollbars)
8
8
  *
9
- * @param resolved - The resolved theme to apply ('light' or 'dark')
9
+ * @param resolved - The resolved color scheme to apply ('light' or 'dark')
10
10
  *
11
11
  * @since 0.3.16-canary.0
12
12
  */
13
- function applyTheme(resolved) {
13
+ function applyColorScheme(resolved) {
14
14
  const root = window.document.documentElement;
15
- root.classList.remove("light", "dark", "system");
15
+ root.classList.remove("light", "dark", "automatic");
16
16
  root.classList.add(resolved);
17
17
  root.style.colorScheme = resolved;
18
18
  }
19
19
  /**
20
- * Temporarily disable all CSS transitions during theme changes.
20
+ * Temporarily suppress all CSS transitions during color scheme changes.
21
21
  *
22
- * Prevents jarring color animations when switching between light/dark themes.
22
+ * Prevents jarring color animations when switching between light/dark appearances.
23
23
  * Respects user's `prefers-reduced-motion` preference (does nothing if enabled).
24
24
  *
25
25
  * @param nonce - Optional CSP nonce for the injected style element
26
- * @returns Cleanup function to re-enable transitions. Call after theme is applied.
26
+ * @returns Cleanup function to re-enable transitions. Call after color scheme is applied.
27
27
  *
28
28
  * @example
29
29
  * ```tsx
30
- * const enableTransitions = disableAnimation();
31
- * applyTheme('dark');
30
+ * const enableTransitions = suppressTransitions();
31
+ * applyColorScheme('dark');
32
32
  * enableTransitions(); // Re-enables CSS transitions
33
33
  * ```
34
34
  *
35
35
  * @since 0.3.16-canary.0
36
36
  */
37
- function disableAnimation(nonce) {
37
+ function suppressTransitions(nonce) {
38
38
  if (typeof globalThis.window === "undefined") return () => {};
39
39
  if (globalThis.window.matchMedia("(prefers-reduced-motion: reduce)").matches) return () => {};
40
40
  const css = document.createElement("style");
41
41
  if (nonce) css.setAttribute("nonce", nonce);
42
- css.append(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`));
42
+ css.append(document.createTextNode(`*,*::before,*::after{transition:none!important}`));
43
43
  document.head.append(css);
44
44
  return () => {
45
45
  window.getComputedStyle(document.body);
@@ -51,4 +51,4 @@ function disableAnimation(nonce) {
51
51
  };
52
52
  }
53
53
  //#endregion
54
- export { applyTheme, disableAnimation };
54
+ export { applyColorScheme, suppressTransitions };
@@ -1,34 +1,34 @@
1
- import { ResolvedTheme, Theme } from "../types.mjs";
1
+ import { ColorScheme, ResolvedColorScheme } from "../types.mjs";
2
2
 
3
3
  //#region src/utils/system.d.ts
4
4
  /**
5
- * Detect the user's OS theme preference.
5
+ * Detect the user's OS color scheme preference.
6
6
  *
7
7
  * Uses `matchMedia()` to query the `prefers-color-scheme` media feature.
8
- * Returns {@link DEFAULT_RESOLVED_THEME} during SSR since `window` is unavailable.
8
+ * Returns {@link DEFAULT_RESOLVED_COLOR_SCHEME} during SSR since `window` is unavailable.
9
9
  *
10
10
  * @returns 'light' or 'dark' based on OS preference
11
11
  *
12
12
  * @since 0.3.16-canary.0
13
13
  */
14
- declare function getSystemTheme(): ResolvedTheme;
14
+ declare function getSystemColorScheme(): ResolvedColorScheme;
15
15
  /**
16
- * Resolve theme preference to actual light/dark value.
16
+ * Resolve color scheme preference to actual light/dark value.
17
17
  *
18
18
  * - 'light' → 'light'
19
19
  * - 'dark' → 'dark'
20
- * - 'system' → on the client, result of {@link getSystemTheme}; on the server,
21
- * `ssrSystemTheme` when provided, otherwise {@link DEFAULT_RESOLVED_THEME}
20
+ * - 'automatic' → on the client, result of {@link getSystemColorScheme}; on the server,
21
+ * `ssrColorScheme` when provided, otherwise {@link DEFAULT_RESOLVED_COLOR_SCHEME}
22
22
  *
23
- * @param theme - User's theme preference (`light`, `dark`, or `system`)
24
- * @param ssrSystemTheme - When `theme` is `system` and this runs during SSR (no `window`),
23
+ * @param colorScheme - User's color scheme preference (`light`, `dark`, or `automatic`)
24
+ * @param ssrColorScheme - When `colorScheme` is `automatic` and this runs during SSR (no `window`),
25
25
  * uses this as the resolved appearance—typically from Client Hints
26
26
  * (`Sec-CH-Prefers-Color-Scheme`) so `<html class>` matches the real OS preference.
27
- * Ignored for non-`system` themes and on the client (where {@link getSystemTheme} wins).
28
- * @returns The resolved theme to apply (`light` or `dark`)
27
+ * Ignored for non-`automatic` schemes and on the client (where {@link getSystemColorScheme} wins).
28
+ * @returns The resolved color scheme to apply (`light` or `dark`)
29
29
  *
30
30
  * @since 0.3.16-canary.0
31
31
  */
32
- declare function resolveTheme(theme: Theme, ssrSystemTheme?: ResolvedTheme): ResolvedTheme;
32
+ declare function resolveColorScheme(colorScheme: ColorScheme, ssrColorScheme?: ResolvedColorScheme): ResolvedColorScheme;
33
33
  //#endregion
34
- export { getSystemTheme, resolveTheme };
34
+ export { getSystemColorScheme, resolveColorScheme };
@@ -1,40 +1,40 @@
1
- import { DEFAULT_RESOLVED_THEME } from "../constants.mjs";
1
+ import { DEFAULT_RESOLVED_COLOR_SCHEME } from "../constants.mjs";
2
2
  //#region src/utils/system.ts
3
3
  /**
4
- * Detect the user's OS theme preference.
4
+ * Detect the user's OS color scheme preference.
5
5
  *
6
6
  * Uses `matchMedia()` to query the `prefers-color-scheme` media feature.
7
- * Returns {@link DEFAULT_RESOLVED_THEME} during SSR since `window` is unavailable.
7
+ * Returns {@link DEFAULT_RESOLVED_COLOR_SCHEME} during SSR since `window` is unavailable.
8
8
  *
9
9
  * @returns 'light' or 'dark' based on OS preference
10
10
  *
11
11
  * @since 0.3.16-canary.0
12
12
  */
13
- function getSystemTheme() {
14
- if (typeof globalThis.window === "undefined") return DEFAULT_RESOLVED_THEME;
13
+ function getSystemColorScheme() {
14
+ if (typeof globalThis.window === "undefined") return DEFAULT_RESOLVED_COLOR_SCHEME;
15
15
  return globalThis.window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
16
16
  }
17
17
  /**
18
- * Resolve theme preference to actual light/dark value.
18
+ * Resolve color scheme preference to actual light/dark value.
19
19
  *
20
20
  * - 'light' → 'light'
21
21
  * - 'dark' → 'dark'
22
- * - 'system' → on the client, result of {@link getSystemTheme}; on the server,
23
- * `ssrSystemTheme` when provided, otherwise {@link DEFAULT_RESOLVED_THEME}
22
+ * - 'automatic' → on the client, result of {@link getSystemColorScheme}; on the server,
23
+ * `ssrColorScheme` when provided, otherwise {@link DEFAULT_RESOLVED_COLOR_SCHEME}
24
24
  *
25
- * @param theme - User's theme preference (`light`, `dark`, or `system`)
26
- * @param ssrSystemTheme - When `theme` is `system` and this runs during SSR (no `window`),
25
+ * @param colorScheme - User's color scheme preference (`light`, `dark`, or `automatic`)
26
+ * @param ssrColorScheme - When `colorScheme` is `automatic` and this runs during SSR (no `window`),
27
27
  * uses this as the resolved appearance—typically from Client Hints
28
28
  * (`Sec-CH-Prefers-Color-Scheme`) so `<html class>` matches the real OS preference.
29
- * Ignored for non-`system` themes and on the client (where {@link getSystemTheme} wins).
30
- * @returns The resolved theme to apply (`light` or `dark`)
29
+ * Ignored for non-`automatic` schemes and on the client (where {@link getSystemColorScheme} wins).
30
+ * @returns The resolved color scheme to apply (`light` or `dark`)
31
31
  *
32
32
  * @since 0.3.16-canary.0
33
33
  */
34
- function resolveTheme(theme, ssrSystemTheme) {
35
- if (theme !== "system") return theme;
36
- if (typeof globalThis.window === "undefined") return ssrSystemTheme ?? "dark";
37
- return getSystemTheme();
34
+ function resolveColorScheme(colorScheme, ssrColorScheme) {
35
+ if (colorScheme !== "automatic") return colorScheme;
36
+ if (typeof globalThis.window === "undefined") return ssrColorScheme ?? "dark";
37
+ return getSystemColorScheme();
38
38
  }
39
39
  //#endregion
40
- export { getSystemTheme, resolveTheme };
40
+ export { getSystemColorScheme, resolveColorScheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefast/theme",
3
- "version": "0.3.16-canary.1",
3
+ "version": "0.3.16-canary.3",
4
4
  "description": "Theme management with React 19 features - optimistic updates, cross-tab sync, and SSR support",
5
5
  "keywords": [
6
6
  "dark-mode",
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "files": [
26
26
  "dist",
27
+ "src",
27
28
  "CHANGELOG.md",
28
29
  "README.md",
29
30
  "LICENSE"
@@ -51,46 +52,57 @@
51
52
  },
52
53
  "exports": {
53
54
  ".": {
55
+ "source": "./src/index.ts",
54
56
  "types": "./dist/index.d.mts",
55
57
  "import": "./dist/index.mjs"
56
58
  },
57
59
  "./adapters/tanstack-start/server": {
60
+ "source": "./src/adapters/tanstack-start/server.ts",
58
61
  "types": "./dist/adapters/tanstack-start/server.d.mts",
59
62
  "import": "./dist/adapters/tanstack-start/server.mjs"
60
63
  },
61
64
  "./constants": {
65
+ "source": "./src/constants.ts",
62
66
  "types": "./dist/constants.d.mts",
63
67
  "import": "./dist/constants.mjs"
64
68
  },
65
69
  "./core/context": {
70
+ "source": "./src/core/context.tsx",
66
71
  "types": "./dist/core/context.d.mts",
67
72
  "import": "./dist/core/context.mjs"
68
73
  },
69
74
  "./core/provider": {
75
+ "source": "./src/core/provider.tsx",
70
76
  "types": "./dist/core/provider.d.mts",
71
77
  "import": "./dist/core/provider.mjs"
72
78
  },
73
79
  "./core/use-theme": {
80
+ "source": "./src/core/use-theme.ts",
74
81
  "types": "./dist/core/use-theme.d.mts",
75
82
  "import": "./dist/core/use-theme.mjs"
76
83
  },
77
84
  "./script/theme-script": {
85
+ "source": "./src/script/theme-script.tsx",
78
86
  "types": "./dist/script/theme-script.d.mts",
79
87
  "import": "./dist/script/theme-script.mjs"
80
88
  },
81
89
  "./start": {
90
+ "source": "./src/start.ts",
82
91
  "types": "./dist/start.d.mts",
83
92
  "import": "./dist/start.mjs"
84
93
  },
85
94
  "./types": {
95
+ "source": "./src/types.ts",
86
96
  "types": "./dist/types.d.mts",
87
97
  "import": "./dist/types.mjs"
88
98
  },
89
99
  "./utils/dom": {
100
+ "source": "./src/utils/dom.ts",
90
101
  "types": "./dist/utils/dom.d.mts",
91
102
  "import": "./dist/utils/dom.mjs"
92
103
  },
93
104
  "./utils/system": {
105
+ "source": "./src/utils/system.ts",
94
106
  "types": "./dist/utils/system.d.mts",
95
107
  "import": "./dist/utils/system.mjs"
96
108
  },
@@ -103,32 +115,28 @@
103
115
  "zod": "^4.4.3"
104
116
  },
105
117
  "devDependencies": {
106
- "@tanstack/react-start": "^1.167.65",
118
+ "@tanstack/react-start": "^1.168.14",
107
119
  "@testing-library/dom": "^10.4.1",
108
120
  "@testing-library/jest-dom": "^6.9.1",
109
121
  "@testing-library/react": "^16.3.2",
110
122
  "@testing-library/user-event": "^14.6.1",
111
- "@types/node": "^25.6.2",
112
- "@typescript/native-preview": "7.0.0-dev.20260509.2",
113
- "@vitejs/plugin-react": "^6.0.1",
114
- "@vitest/coverage-v8": "^4.1.5",
123
+ "@types/node": "^25.9.1",
124
+ "@typescript/native-preview": "7.0.0-dev.20260526.1",
125
+ "@vitejs/plugin-react": "^6.0.2",
126
+ "@vitest/coverage-v8": "^4.1.7",
115
127
  "jsdom": "^29.1.1",
116
128
  "tsdown": "^0.22.0",
117
129
  "typescript": "^6.0.3",
118
- "vitest": "^4.1.5",
119
- "@codefast/typescript-config": "0.3.16-canary.1"
130
+ "vitest": "^4.1.7",
131
+ "@codefast/typescript-config": "0.3.16-canary.3"
120
132
  },
121
133
  "peerDependencies": {
122
- "@tanstack/react-start": "^1.167.65",
123
- "@types/react": "^19.0",
124
- "@types/react-dom": "^19.0",
125
- "react": "^19.0",
126
- "react-dom": "^19.0"
134
+ "@types/react": ">=19.0.0",
135
+ "@types/react-dom": ">=19.0.0",
136
+ "react": ">=19.0.0",
137
+ "react-dom": ">=19.0.0"
127
138
  },
128
139
  "peerDependenciesMeta": {
129
- "@tanstack/react-start": {
130
- "optional": true
131
- },
132
140
  "@types/react": {
133
141
  "optional": true
134
142
  },
@@ -137,13 +145,12 @@
137
145
  }
138
146
  },
139
147
  "engines": {
140
- "node": ">=22.0.0"
148
+ "node": ">=24.0.0"
141
149
  },
142
150
  "scripts": {
143
151
  "build": "tsdown",
144
152
  "check-types": "tsgo --noEmit",
145
153
  "clean": "rm -rf dist",
146
- "dev": "tsdown --watch",
147
154
  "test": "vitest run",
148
155
  "test:coverage": "vitest run --coverage",
149
156
  "test:e2e": "vitest run tests/e2e",