@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.
@@ -1,66 +1 @@
1
- // src/core/types/index.ts
2
- var ThemeAnimationType = /* @__PURE__ */ ((ThemeAnimationType2) => {
3
- ThemeAnimationType2["CIRCLE"] = "circle";
4
- ThemeAnimationType2["BLUR_CIRCLE"] = "blur-circle";
5
- ThemeAnimationType2["SLIDE"] = "slide";
6
- return ThemeAnimationType2;
7
- })(ThemeAnimationType || {});
8
-
9
- // src/core/utils/animations.ts
10
- var isBrowser = typeof window !== "undefined";
11
- var injectBaseStyles = () => {
12
- if (isBrowser) {
13
- const styleId = "spaceman-theme-base-style";
14
- if (!document.getElementById(styleId)) {
15
- const style = document.createElement("style");
16
- style.id = styleId;
17
- const isHighResolution = window.innerWidth >= 3e3 || window.innerHeight >= 2e3;
18
- style.textContent = `
19
- ::view-transition-old(root),
20
- ::view-transition-new(root) {
21
- animation: none;
22
- mix-blend-mode: normal;
23
- ${isHighResolution ? "transform: translateZ(0);" : ""}
24
- }
25
-
26
- ${isHighResolution ? `
27
- ::view-transition-group(root),
28
- ::view-transition-image-pair(root),
29
- ::view-transition-old(root),
30
- ::view-transition-new(root) {
31
- backface-visibility: hidden;
32
- perspective: 1000px;
33
- transform: translate3d(0, 0, 0);
34
- }
35
- ` : ""}
36
- `;
37
- document.head.appendChild(style);
38
- }
39
- }
40
- };
41
- var getSystemTheme = () => {
42
- if (!isBrowser) return "light";
43
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
44
- };
45
- var resolveTheme = (theme) => {
46
- if (theme === "system") {
47
- return getSystemTheme();
48
- }
49
- return theme === "dark" ? "dark" : "light";
50
- };
51
- var resolveThemeForServer = (theme) => {
52
- if (theme === "system") {
53
- return "system";
54
- }
55
- return theme === "dark" ? "dark" : "light";
56
- };
57
- var supportsViewTransitions = () => {
58
- return isBrowser && "startViewTransition" in document;
59
- };
60
- var prefersReducedMotion = () => {
61
- return isBrowser && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
62
- };
63
-
64
- export { ThemeAnimationType, getSystemTheme, injectBaseStyles, prefersReducedMotion, resolveTheme, resolveThemeForServer, supportsViewTransitions };
65
- //# sourceMappingURL=index.js.map
66
- //# sourceMappingURL=index.js.map
1
+ export{d as TRANSITION_DIRECTIONS,c as ThemeAnimationType,b as preloadThemeLogo,e as runThemeTransition}from'../chunk-X6UEG7WG.js';export{o as createBlurCircleAnimation,m as createCircleAnimation,i as createClipPathAnimation,j as createPolygonGradientAnimation,n as createSlideAnimation,l as createSvgLogoAnimation,k as createTriangleAnimation,h as getAnimationPosition,g as getSlideFromCoords,b as getSystemTheme,a as injectBaseStyles,f as prefersReducedMotion,c as resolveTheme,d as resolveThemeForServer,e as supportsViewTransitions}from'../chunk-I3T2QXRT.js';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export { NextThemeProvider, SpacemanThemeProvider, TanStackStartThemeScript, TanStackThemeProvider, ThemeProvider, ThemeSelector, ThemeSwitcher, ViteThemeProvider, useNextTheme, useSpacemanTheme, useTanStackTheme, useTheme, useThemeAnimation, useViteTheme } from './react/index.js';
2
- export { ColorTheme, SlideDirection, SystemThemeMode, Theme, ThemeAnimationType, ThemeSelectorProps, ThemeSwitcherProps, UseThemeAnimationProps, UseThemeAnimationReturn, getSystemTheme, injectBaseStyles, prefersReducedMotion, resolveTheme, resolveThemeForServer, supportsViewTransitions } from './core/index.js';
1
+ export { NextThemeProvider, SpacemanThemeProvider, TanStackStartThemeScript, TanStackThemeProvider, ThemeProvider, ThemeSelector, ThemeSwitcher, ViteThemeProvider, useHydrated, useNextTheme, useSpacemanTheme, useTanStackTheme, useTheme, useThemeAnimation, useViteTheme } from './react/index.js';
2
+ export { A as AnimationPosition, C as ColorTheme, a as ColorThemeToggle, S as SlideDirection, b as SystemThemeMode, T as TRANSITION_DIRECTIONS, c as Theme, d as ThemeAnimationOptions, e as ThemeAnimationType, f as ThemeLogoOptions, g as ThemeSelectorProps, h as ThemeSwitcherProps, i as ThemeTransitionInput, j as ThemeTransitionOptions, k as TransitionDirection, U as UseThemeAnimationProps, l as UseThemeAnimationReturn, m as getSystemTheme, n as injectBaseStyles, p as prefersReducedMotion, r as resolveTheme, o as resolveThemeForServer, s as supportsViewTransitions } from './animations-BrxKLW8D.js';
3
3
  export { COLOR_STORAGE_KEY, COLOR_THEME_PREFIX, GLOBAL_CLASS_NAME, STORAGE_KEY, ServerResolvedTheme, ServerThemeData, buildServerThemeData } from './tanstack/index.js';
4
+ export { p as preloadThemeLogo } from './logo-DtwtRv4y.js';
4
5
  import 'react';