@space-man/react-theme-animation 2.3.0 → 3.0.1
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/README.md +42 -21
- package/dist/animations-BrxKLW8D.d.ts +209 -0
- package/dist/chunk-I2OASTGS.js +44 -0
- package/dist/chunk-I3T2QXRT.js +18 -0
- package/dist/chunk-QYUMCBTQ.js +1 -0
- package/dist/chunk-X6UEG7WG.js +12 -0
- package/dist/core/index.d.ts +7 -94
- package/dist/core/index.js +1 -66
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1706
- package/dist/logo-DtwtRv4y.d.ts +4 -0
- package/dist/react/index.d.ts +161 -153
- package/dist/react/index.js +1 -1696
- package/dist/tanstack/index.d.ts +7 -7
- package/dist/tanstack/index.js +1 -27
- package/package.json +55 -65
- package/dist/core/index.cjs +0 -74
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -96
- package/dist/core/index.js.map +0 -1
- package/dist/index.cjs +0 -1756
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -4
- package/dist/index.js.map +0 -1
- package/dist/react/index.cjs +0 -1742
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.d.cts +0 -224
- package/dist/react/index.js.map +0 -1
- package/dist/tanstack/index.cjs +0 -34
- package/dist/tanstack/index.cjs.map +0 -1
- package/dist/tanstack/index.d.cts +0 -20
- package/dist/tanstack/index.js.map +0 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { UseThemeAnimationProps, UseThemeAnimationReturn, ThemeSwitcherProps, ThemeSelectorProps, Theme, ColorTheme, ThemeAnimationType, SystemThemeMode } from '../
|
|
2
|
-
export { SlideDirection, getSystemTheme, injectBaseStyles, prefersReducedMotion, resolveTheme, resolveThemeForServer, supportsViewTransitions } from '../
|
|
1
|
+
import { U as UseThemeAnimationProps, l as UseThemeAnimationReturn, h as ThemeSwitcherProps, g as ThemeSelectorProps, c as Theme, C as ColorTheme, e as ThemeAnimationType, i as ThemeTransitionInput, a as ColorThemeToggle, b as SystemThemeMode } from '../animations-BrxKLW8D.js';
|
|
2
|
+
export { A as AnimationPosition, S as SlideDirection, T as TRANSITION_DIRECTIONS, d as ThemeAnimationOptions, f as ThemeLogoOptions, j as ThemeTransitionOptions, k as TransitionDirection, m as getSystemTheme, n as injectBaseStyles, p as prefersReducedMotion, r as resolveTheme, o as resolveThemeForServer, s as supportsViewTransitions } from '../animations-BrxKLW8D.js';
|
|
3
3
|
import React, { ReactNode } from 'react';
|
|
4
|
+
export { p as preloadThemeLogo } from '../logo-DtwtRv4y.js';
|
|
4
5
|
|
|
5
|
-
declare const useThemeAnimation: (props?: UseThemeAnimationProps) => UseThemeAnimationReturn;
|
|
6
|
+
declare const useThemeAnimation: (props?: Readonly<UseThemeAnimationProps>) => UseThemeAnimationReturn;
|
|
6
7
|
|
|
7
|
-
declare
|
|
8
|
+
declare function ThemeSwitcher(props: ThemeSwitcherProps): React.JSX.Element;
|
|
8
9
|
|
|
9
|
-
declare
|
|
10
|
+
declare function ThemeSelector(props: ThemeSelectorProps): React.JSX.Element;
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Context type for the Spaceman Theme Provider
|
|
13
14
|
*/
|
|
14
15
|
interface SpacemanThemeContextType {
|
|
15
|
-
ref: React.RefObject<HTMLButtonElement | null>;
|
|
16
|
-
theme: Theme;
|
|
17
|
-
colorTheme: ColorTheme;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
readonly ref: React.RefObject<HTMLButtonElement | null>;
|
|
17
|
+
readonly theme: Theme;
|
|
18
|
+
readonly colorTheme: ColorTheme;
|
|
19
|
+
readonly colorThemes: readonly ColorTheme[];
|
|
20
|
+
readonly resolvedTheme: 'light' | 'dark';
|
|
21
|
+
readonly setTheme: (theme: Theme) => void;
|
|
22
|
+
readonly setColorTheme: (colorTheme: ColorTheme) => void;
|
|
23
|
+
readonly switchTheme: (theme: Theme, options?: ThemeTransitionInput) => Promise<void>;
|
|
24
|
+
readonly switchColorTheme: (colorTheme: string, options?: ThemeTransitionInput) => Promise<void>;
|
|
25
|
+
readonly toggleTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
26
|
+
readonly toggleLightTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
27
|
+
readonly toggleDarkTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
28
|
+
readonly toggleColorTheme: ColorThemeToggle;
|
|
29
|
+
readonly createColorThemeToggle: (targetColorTheme: string) => ColorThemeToggle;
|
|
30
|
+
readonly isColorThemeActive: (targetColorTheme: string) => boolean;
|
|
31
|
+
readonly switchThemeFromElement: (theme: Theme, element: HTMLButtonElement) => Promise<void>;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* Props for the Spaceman Theme Provider
|
|
33
35
|
*/
|
|
34
|
-
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
themes?: Theme[];
|
|
37
|
-
colorThemes?: ColorTheme[];
|
|
38
|
-
defaultTheme?: Theme;
|
|
39
|
-
defaultColorTheme?: ColorTheme;
|
|
40
|
-
animationType?: ThemeAnimationType;
|
|
41
|
-
duration?: number;
|
|
42
|
-
}
|
|
36
|
+
type SpacemanThemeProviderProps = UseThemeAnimationProps & {
|
|
37
|
+
readonly children: ReactNode;
|
|
38
|
+
readonly themes?: readonly Theme[];
|
|
39
|
+
readonly colorThemes?: readonly ColorTheme[];
|
|
40
|
+
readonly defaultTheme?: Theme;
|
|
41
|
+
readonly defaultColorTheme?: ColorTheme;
|
|
42
|
+
readonly animationType?: ThemeAnimationType;
|
|
43
|
+
readonly duration?: number;
|
|
44
|
+
};
|
|
43
45
|
/**
|
|
44
46
|
* Spaceman Theme Provider - Provides centralized theme state management
|
|
45
47
|
*
|
|
@@ -52,9 +54,9 @@ interface SpacemanThemeProviderProps {
|
|
|
52
54
|
* @param defaultTheme - Default theme to use (default: 'system')
|
|
53
55
|
* @param defaultColorTheme - Default color theme to use (default: 'default')
|
|
54
56
|
* @param animationType - Animation type for theme transitions (default: CIRCLE)
|
|
55
|
-
* @param duration - Animation duration in milliseconds (default:
|
|
57
|
+
* @param duration - Animation duration in milliseconds (default: 400)
|
|
56
58
|
*/
|
|
57
|
-
declare
|
|
59
|
+
declare function SpacemanThemeProvider({ children, themes, colorThemes, defaultTheme, defaultColorTheme, animationType, duration, ...animationOptions }: Readonly<SpacemanThemeProviderProps>): React.JSX.Element;
|
|
58
60
|
/**
|
|
59
61
|
* Hook to consume the Spaceman Theme context
|
|
60
62
|
*
|
|
@@ -64,137 +66,141 @@ declare const SpacemanThemeProvider: React.FC<SpacemanThemeProviderProps>;
|
|
|
64
66
|
declare const useSpacemanTheme: () => SpacemanThemeContextType;
|
|
65
67
|
|
|
66
68
|
interface NextThemeContextType {
|
|
67
|
-
ref: React.RefObject<HTMLButtonElement | null>;
|
|
68
|
-
theme: Theme;
|
|
69
|
-
colorTheme: ColorTheme;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
interface NextThemeProviderProps {
|
|
85
|
-
children: React.ReactNode;
|
|
86
|
-
themes?: Theme[];
|
|
87
|
-
colorThemes?: ColorTheme[];
|
|
88
|
-
defaultTheme?: Theme;
|
|
89
|
-
defaultColorTheme?: ColorTheme;
|
|
90
|
-
animationType?: ThemeAnimationType;
|
|
91
|
-
duration?: number;
|
|
92
|
-
storageKey?: string;
|
|
93
|
-
colorStorageKey?: string;
|
|
94
|
-
attribute?: 'class' | 'data-theme';
|
|
95
|
-
value?: Record<string, string>;
|
|
96
|
-
enableSystem?: boolean;
|
|
97
|
-
enableColorScheme?: boolean;
|
|
98
|
-
disableTransitionOnChange?: boolean;
|
|
99
|
-
forcedTheme?: Theme;
|
|
100
|
-
nonce?: string;
|
|
101
|
-
scriptProps?: Omit<React.ScriptHTMLAttributes<HTMLScriptElement>, 'dangerouslySetInnerHTML' | 'nonce'>;
|
|
102
|
-
colorThemePrefix?: string;
|
|
103
|
-
globalClassName?: string;
|
|
104
|
-
disableAnimationOnInit?: boolean;
|
|
105
|
-
disablePreHydrationScript?: boolean;
|
|
106
|
-
onThemeChange?: (theme: Theme) => void;
|
|
107
|
-
onColorThemeChange?: (colorTheme: ColorTheme) => void;
|
|
69
|
+
readonly ref: React.RefObject<HTMLButtonElement | null>;
|
|
70
|
+
readonly theme: Theme;
|
|
71
|
+
readonly colorTheme: ColorTheme;
|
|
72
|
+
readonly colorThemes: readonly ColorTheme[];
|
|
73
|
+
readonly resolvedTheme: 'light' | 'dark';
|
|
74
|
+
readonly systemTheme: 'light' | 'dark';
|
|
75
|
+
readonly setTheme: (theme: Theme) => void;
|
|
76
|
+
readonly setColorTheme: (colorTheme: ColorTheme) => void;
|
|
77
|
+
readonly switchTheme: (theme: Theme, options?: ThemeTransitionInput) => Promise<void>;
|
|
78
|
+
readonly switchColorTheme: (colorTheme: string, options?: ThemeTransitionInput) => Promise<void>;
|
|
79
|
+
readonly toggleTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
80
|
+
readonly toggleLightTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
81
|
+
readonly toggleDarkTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
82
|
+
readonly toggleColorTheme: ColorThemeToggle;
|
|
83
|
+
readonly createColorThemeToggle: (targetColorTheme: string) => ColorThemeToggle;
|
|
84
|
+
readonly isColorThemeActive: (targetColorTheme: string) => boolean;
|
|
85
|
+
readonly switchThemeFromElement: (theme: Theme, element: HTMLButtonElement) => Promise<void>;
|
|
108
86
|
}
|
|
109
|
-
|
|
110
|
-
|
|
87
|
+
type NextThemeProviderProps = UseThemeAnimationProps & {
|
|
88
|
+
readonly children: React.ReactNode;
|
|
89
|
+
readonly themes?: readonly Theme[];
|
|
90
|
+
readonly colorThemes?: readonly ColorTheme[];
|
|
91
|
+
readonly defaultTheme?: Theme;
|
|
92
|
+
readonly defaultColorTheme?: ColorTheme;
|
|
93
|
+
readonly animationType?: ThemeAnimationType;
|
|
94
|
+
readonly duration?: number;
|
|
95
|
+
readonly storageKey?: string;
|
|
96
|
+
readonly colorStorageKey?: string;
|
|
97
|
+
readonly attribute?: 'class' | 'data-theme';
|
|
98
|
+
readonly value?: Record<string, string>;
|
|
99
|
+
readonly enableSystem?: boolean;
|
|
100
|
+
readonly enableColorScheme?: boolean;
|
|
101
|
+
readonly disableTransitionOnChange?: boolean;
|
|
102
|
+
readonly forcedTheme?: Theme;
|
|
103
|
+
readonly nonce?: string;
|
|
104
|
+
readonly scriptProps?: Omit<React.ScriptHTMLAttributes<HTMLScriptElement>, 'dangerouslySetInnerHTML' | 'nonce'>;
|
|
105
|
+
readonly colorThemePrefix?: string;
|
|
106
|
+
readonly globalClassName?: string;
|
|
107
|
+
readonly disableAnimationOnInit?: boolean;
|
|
108
|
+
readonly disablePreHydrationScript?: boolean;
|
|
109
|
+
readonly onThemeChange?: (theme: Theme) => void;
|
|
110
|
+
readonly onColorThemeChange?: (colorTheme: ColorTheme) => void;
|
|
111
|
+
};
|
|
112
|
+
declare function NextThemeProvider({ attribute, children, colorStorageKey, colorThemePrefix, colorThemes, defaultColorTheme, defaultTheme, disableAnimationOnInit, disablePreHydrationScript, disableTransitionOnChange, duration, enableColorScheme, enableSystem, forcedTheme, globalClassName, nonce, onColorThemeChange, onThemeChange, scriptProps, storageKey, themes, value, animationType, ...animationOptions }: Readonly<NextThemeProviderProps>): React.JSX.Element;
|
|
113
|
+
declare const ThemeProvider: typeof NextThemeProvider;
|
|
111
114
|
declare const useNextTheme: () => NextThemeContextType;
|
|
112
115
|
declare const useTheme: () => NextThemeContextType;
|
|
113
116
|
|
|
114
|
-
interface TanStackThemeContextType {
|
|
115
|
-
ref: React.RefObject<HTMLButtonElement | null>;
|
|
116
|
-
theme: Theme;
|
|
117
|
-
colorTheme: ColorTheme;
|
|
118
|
-
resolvedTheme: 'light' | 'dark';
|
|
119
|
-
systemTheme: 'light' | 'dark';
|
|
120
|
-
isHydrated: boolean;
|
|
121
|
-
setTheme: (theme: Theme) => void;
|
|
122
|
-
setColorTheme: (colorTheme: ColorTheme) => void;
|
|
123
|
-
switchTheme: (theme: Theme, animationOff?: boolean) => Promise<void>;
|
|
124
|
-
switchColorTheme: (colorTheme: string) => void;
|
|
125
|
-
toggleTheme: (animationOff?: boolean) => Promise<void>;
|
|
126
|
-
toggleLightTheme: (animationOff?: boolean) => Promise<void>;
|
|
127
|
-
toggleDarkTheme: (animationOff?: boolean) => Promise<void>;
|
|
128
|
-
toggleColorTheme: () => void;
|
|
129
|
-
createColorThemeToggle: (targetColorTheme: string) => () => void;
|
|
130
|
-
isColorThemeActive: (targetColorTheme: string) => boolean;
|
|
131
|
-
switchThemeFromElement: (theme: Theme, element: HTMLButtonElement) => Promise<void>;
|
|
132
|
-
}
|
|
133
|
-
interface TanStackThemeProviderProps {
|
|
134
|
-
children: ReactNode;
|
|
135
|
-
themes?: Theme[];
|
|
136
|
-
colorThemes?: ColorTheme[];
|
|
137
|
-
defaultTheme?: Theme;
|
|
138
|
-
defaultColorTheme?: ColorTheme;
|
|
139
|
-
animationType?: ThemeAnimationType;
|
|
140
|
-
duration?: number;
|
|
141
|
-
storageKey?: string;
|
|
142
|
-
colorStorageKey?: string;
|
|
143
|
-
globalClassName?: string;
|
|
144
|
-
colorThemePrefix?: string;
|
|
145
|
-
serverTheme?: 'light' | 'dark' | 'system';
|
|
146
|
-
serverColorTheme?: ColorTheme;
|
|
147
|
-
systemThemeMode?: SystemThemeMode;
|
|
148
|
-
onServerThemeChange?: (theme: Theme) => Promise<void> | void;
|
|
149
|
-
onServerColorThemeChange?: (colorTheme: ColorTheme) => Promise<void> | void;
|
|
150
|
-
}
|
|
151
117
|
interface TanStackStartThemeScriptProps {
|
|
152
|
-
storageKey?: string;
|
|
153
|
-
colorStorageKey?: string;
|
|
154
|
-
defaultTheme?: Theme;
|
|
155
|
-
defaultColorTheme?: ColorTheme;
|
|
156
|
-
globalClassName?: string;
|
|
157
|
-
colorThemePrefix?: string;
|
|
158
|
-
nonce?: string;
|
|
159
|
-
systemThemeMode?: SystemThemeMode;
|
|
118
|
+
readonly storageKey?: string;
|
|
119
|
+
readonly colorStorageKey?: string;
|
|
120
|
+
readonly defaultTheme?: Theme;
|
|
121
|
+
readonly defaultColorTheme?: ColorTheme;
|
|
122
|
+
readonly globalClassName?: string;
|
|
123
|
+
readonly colorThemePrefix?: string;
|
|
124
|
+
readonly nonce?: string;
|
|
125
|
+
readonly systemThemeMode?: SystemThemeMode;
|
|
160
126
|
}
|
|
161
127
|
declare const TanStackStartThemeScript: React.FC<TanStackStartThemeScriptProps>;
|
|
162
|
-
|
|
128
|
+
|
|
129
|
+
interface TanStackThemeContextType {
|
|
130
|
+
readonly ref: React.RefObject<HTMLButtonElement | null>;
|
|
131
|
+
readonly theme: Theme;
|
|
132
|
+
readonly colorTheme: ColorTheme;
|
|
133
|
+
readonly colorThemes: readonly ColorTheme[];
|
|
134
|
+
readonly resolvedTheme: 'light' | 'dark';
|
|
135
|
+
readonly systemTheme: 'light' | 'dark';
|
|
136
|
+
readonly isHydrated: boolean;
|
|
137
|
+
readonly setTheme: (theme: Theme) => void;
|
|
138
|
+
readonly setColorTheme: (colorTheme: ColorTheme) => void;
|
|
139
|
+
readonly switchTheme: (theme: Theme, options?: ThemeTransitionInput) => Promise<void>;
|
|
140
|
+
readonly switchColorTheme: (colorTheme: string, options?: ThemeTransitionInput) => Promise<void>;
|
|
141
|
+
readonly toggleTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
142
|
+
readonly toggleLightTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
143
|
+
readonly toggleDarkTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
144
|
+
readonly toggleColorTheme: ColorThemeToggle;
|
|
145
|
+
readonly createColorThemeToggle: (targetColorTheme: string) => ColorThemeToggle;
|
|
146
|
+
readonly isColorThemeActive: (targetColorTheme: string) => boolean;
|
|
147
|
+
readonly switchThemeFromElement: (theme: Theme, element: HTMLButtonElement) => Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
type TanStackThemeProviderProps = UseThemeAnimationProps & {
|
|
150
|
+
readonly children: ReactNode;
|
|
151
|
+
readonly themes?: readonly Theme[];
|
|
152
|
+
readonly colorThemes?: readonly ColorTheme[];
|
|
153
|
+
readonly defaultTheme?: Theme;
|
|
154
|
+
readonly defaultColorTheme?: ColorTheme;
|
|
155
|
+
readonly animationType?: ThemeAnimationType;
|
|
156
|
+
readonly duration?: number;
|
|
157
|
+
readonly storageKey?: string;
|
|
158
|
+
readonly colorStorageKey?: string;
|
|
159
|
+
readonly globalClassName?: string;
|
|
160
|
+
readonly colorThemePrefix?: string;
|
|
161
|
+
readonly serverTheme?: 'light' | 'dark' | 'system';
|
|
162
|
+
readonly serverColorTheme?: ColorTheme;
|
|
163
|
+
readonly systemThemeMode?: SystemThemeMode;
|
|
164
|
+
readonly onServerThemeChange?: (theme: Theme) => Promise<void> | void;
|
|
165
|
+
readonly onServerColorThemeChange?: (colorTheme: ColorTheme) => Promise<void> | void;
|
|
166
|
+
};
|
|
167
|
+
declare function TanStackThemeProvider({ children, themes, colorThemes, defaultTheme, defaultColorTheme, animationType, duration, storageKey, colorStorageKey, globalClassName, colorThemePrefix, serverTheme, serverColorTheme, systemThemeMode, onServerThemeChange, onServerColorThemeChange, ...animationOptions }: Readonly<TanStackThemeProviderProps>): React.JSX.Element;
|
|
163
168
|
declare const useTanStackTheme: () => TanStackThemeContextType;
|
|
164
169
|
|
|
165
170
|
interface ViteThemeContextType {
|
|
166
|
-
ref: React.RefObject<HTMLButtonElement | null>;
|
|
167
|
-
theme: Theme;
|
|
168
|
-
colorTheme: ColorTheme;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
interface ViteThemeProviderProps {
|
|
184
|
-
children: ReactNode;
|
|
185
|
-
themes?: Theme[];
|
|
186
|
-
colorThemes?: ColorTheme[];
|
|
187
|
-
defaultTheme?: Theme;
|
|
188
|
-
defaultColorTheme?: ColorTheme;
|
|
189
|
-
animationType?: ThemeAnimationType;
|
|
190
|
-
duration?: number;
|
|
191
|
-
attribute?: 'class' | 'data-theme';
|
|
192
|
-
disableTransitionOnChange?: boolean;
|
|
193
|
-
storageKey?: string;
|
|
194
|
-
colorStorageKey?: string;
|
|
195
|
-
globalClassName?: string;
|
|
196
|
-
colorThemePrefix?: string;
|
|
171
|
+
readonly ref: React.RefObject<HTMLButtonElement | null>;
|
|
172
|
+
readonly theme: Theme;
|
|
173
|
+
readonly colorTheme: ColorTheme;
|
|
174
|
+
readonly colorThemes: readonly ColorTheme[];
|
|
175
|
+
readonly resolvedTheme: 'light' | 'dark';
|
|
176
|
+
readonly systemTheme: 'light' | 'dark';
|
|
177
|
+
readonly setTheme: (theme: Theme) => void;
|
|
178
|
+
readonly setColorTheme: (colorTheme: ColorTheme) => void;
|
|
179
|
+
readonly switchTheme: (theme: Theme, options?: ThemeTransitionInput) => Promise<void>;
|
|
180
|
+
readonly switchColorTheme: (colorTheme: string, options?: ThemeTransitionInput) => Promise<void>;
|
|
181
|
+
readonly toggleTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
182
|
+
readonly toggleLightTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
183
|
+
readonly toggleDarkTheme: (options?: ThemeTransitionInput) => Promise<void>;
|
|
184
|
+
readonly toggleColorTheme: ColorThemeToggle;
|
|
185
|
+
readonly createColorThemeToggle: (targetColorTheme: string) => ColorThemeToggle;
|
|
186
|
+
readonly isColorThemeActive: (targetColorTheme: string) => boolean;
|
|
187
|
+
readonly switchThemeFromElement: (theme: Theme, element: HTMLButtonElement) => Promise<void>;
|
|
197
188
|
}
|
|
189
|
+
type ViteThemeProviderProps = UseThemeAnimationProps & {
|
|
190
|
+
readonly children: ReactNode;
|
|
191
|
+
readonly themes?: readonly Theme[];
|
|
192
|
+
readonly colorThemes?: readonly ColorTheme[];
|
|
193
|
+
readonly defaultTheme?: Theme;
|
|
194
|
+
readonly defaultColorTheme?: ColorTheme;
|
|
195
|
+
readonly animationType?: ThemeAnimationType;
|
|
196
|
+
readonly duration?: number;
|
|
197
|
+
readonly attribute?: 'class' | 'data-theme';
|
|
198
|
+
readonly disableTransitionOnChange?: boolean;
|
|
199
|
+
readonly storageKey?: string;
|
|
200
|
+
readonly colorStorageKey?: string;
|
|
201
|
+
readonly globalClassName?: string;
|
|
202
|
+
readonly colorThemePrefix?: string;
|
|
203
|
+
};
|
|
198
204
|
/**
|
|
199
205
|
* Vite Theme Provider - Optimized for Vite SPA applications
|
|
200
206
|
*
|
|
@@ -218,7 +224,9 @@ interface ViteThemeProviderProps {
|
|
|
218
224
|
* @param globalClassName - Class name for dark theme (when using 'class' attribute)
|
|
219
225
|
* @param colorThemePrefix - Prefix for color theme classes
|
|
220
226
|
*/
|
|
221
|
-
declare
|
|
227
|
+
declare function ViteThemeProvider({ children, themes, colorThemes, defaultTheme, defaultColorTheme, animationType, duration, attribute, disableTransitionOnChange, storageKey, colorStorageKey, globalClassName, colorThemePrefix, ...animationOptions }: Readonly<ViteThemeProviderProps>): React.JSX.Element;
|
|
222
228
|
declare const useViteTheme: () => ViteThemeContextType;
|
|
223
229
|
|
|
224
|
-
|
|
230
|
+
declare function useHydrated(): boolean;
|
|
231
|
+
|
|
232
|
+
export { ColorTheme, ColorThemeToggle, NextThemeProvider, SpacemanThemeProvider, SystemThemeMode, TanStackStartThemeScript, TanStackThemeProvider, Theme, ThemeAnimationType, ThemeProvider, ThemeSelector, ThemeSelectorProps, ThemeSwitcher, ThemeSwitcherProps, ThemeTransitionInput, UseThemeAnimationProps, UseThemeAnimationReturn, ViteThemeProvider, useHydrated, useNextTheme, useSpacemanTheme, useTanStackTheme, useTheme, useThemeAnimation, useViteTheme };
|