uitheme-web 1.0.1 → 1.2.0

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.
@@ -0,0 +1,145 @@
1
+ declare enum ThemeAnimationType {
2
+ CIRCLE = "circle",
3
+ BLUR_CIRCLE = "blur-circle",
4
+ SLIDE = "slide",
5
+ CLIP_PATH = "clip-path",
6
+ POLYGON_GRADIENT = "polygon-gradient",
7
+ TRIANGLE = "triangle",
8
+ SVG_LOGO = "svg-logo"
9
+ }
10
+ /** Clockwise from the top-left corner. */
11
+ declare const TRANSITION_DIRECTIONS: readonly ["top-left", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left"];
12
+ type TransitionDirection = (typeof TRANSITION_DIRECTIONS)[number];
13
+ type AnimationPosition = TransitionDirection | 'center' | 'trigger';
14
+ interface ThemeAnimationSettings {
15
+ /** Starting edge/corner for polygon wipes. Defaults to top-left. */
16
+ clipPathDirection?: TransitionDirection;
17
+ /** Fixed circle/triangle origin; SVG_LOGO always uses the viewport center. */
18
+ animationPosition?: AnimationPosition;
19
+ /** Stationary logo width in CSS pixels or auto; default is 96 when both are omitted. */
20
+ logoWidth?: number | 'auto';
21
+ /** Logo height in CSS pixels or auto; omitted dimensions preserve the SVG aspect ratio. */
22
+ logoHeight?: number | 'auto';
23
+ /** Gradient wipe feather in CSS pixels; defaults to 80. */
24
+ gradientWidth?: number;
25
+ }
26
+ /** Choose one shared asset, or both destination-specific assets. */
27
+ type ThemeLogoOptions = {
28
+ logo?: string;
29
+ logoLight?: never;
30
+ logoDark?: never;
31
+ } | {
32
+ logo?: never;
33
+ logoLight: string;
34
+ logoDark: string;
35
+ };
36
+ type ThemeAnimationOptions = ThemeAnimationSettings & ThemeLogoOptions;
37
+ type Theme = 'light' | 'dark' | 'system';
38
+ type ColorTheme = string;
39
+ type SlideDirection = 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
40
+ interface AnimationConfig extends ThemeAnimationSettings {
41
+ /** Asset already selected for the destination theme before capture. */
42
+ logo?: string;
43
+ a?: number;
44
+ b?: number;
45
+ x: number;
46
+ y: number;
47
+ duration: number;
48
+ easing: string;
49
+ animationType: ThemeAnimationType;
50
+ blurAmount: number;
51
+ styleId: string;
52
+ }
53
+ interface ThemeConfig {
54
+ themes?: Theme[];
55
+ colorThemes?: ColorTheme[];
56
+ defaultTheme?: Theme;
57
+ defaultColorTheme?: ColorTheme;
58
+ globalClassName?: string;
59
+ colorThemePrefix?: string;
60
+ storageKey?: string;
61
+ colorStorageKey?: string;
62
+ }
63
+ interface ThemeState {
64
+ theme: Theme;
65
+ colorTheme: ColorTheme;
66
+ resolvedTheme: 'light' | 'dark';
67
+ }
68
+
69
+ /** Injects styles scoped to transitions owned by this library. */
70
+ declare const injectBaseStyles: () => void;
71
+ /**
72
+ * Creates an SVG blur circle mask for animations
73
+ * @param blur - Blur amount for the gaussian filter
74
+ * @returns Data URI string for the SVG mask
75
+ */
76
+ declare const createBlurCircleMask: (blur: number) => string;
77
+ /**
78
+ * Gets the system theme preference
79
+ * @returns 'light' or 'dark' based on system preference
80
+ */
81
+ declare const getSystemTheme: () => "light" | "dark";
82
+ /**
83
+ * Resolves a theme value to its actual light/dark value
84
+ * @param theme - Theme to resolve ('light', 'dark', or 'system')
85
+ * @returns Resolved theme ('light' or 'dark')
86
+ */
87
+ declare const resolveTheme: (theme: string) => "light" | "dark";
88
+ /**
89
+ * Resolves a stored theme to the server-side class to apply on <html>.
90
+ * CSS mode uses the 'system' class so media queries can respond before hydration.
91
+ */
92
+ declare const resolveThemeForServer: (theme: string) => "light" | "dark" | "system";
93
+ /**
94
+ * Checks if the browser supports View Transitions API
95
+ * @returns true if view transitions are supported
96
+ */
97
+ declare const supportsViewTransitions: () => boolean;
98
+ /**
99
+ * Checks if user prefers reduced motion
100
+ * @returns true if user prefers reduced motion
101
+ */
102
+ declare const prefersReducedMotion: () => boolean;
103
+ /**
104
+ * Converts a slide direction to from coordinates
105
+ * @param direction - Slide direction
106
+ * @returns Object with a (x) and b (y) coordinates
107
+ */
108
+ declare const getSlideFromCoords: (direction: SlideDirection) => {
109
+ a: number;
110
+ b: number;
111
+ };
112
+ /** Viewport CSS coordinates for fixed origins; button origins stay in the hook. */
113
+ declare const getAnimationPosition: (position: Exclude<AnimationPosition, "trigger">) => {
114
+ x: number;
115
+ y: number;
116
+ };
117
+ /** A half-plane wipe, including diagonals, with compatible four-point polygons. */
118
+ declare const createClipPathAnimation: (config: AnimationConfig) => Animation;
119
+ /** Feathered polygon/edge mask, without Gaussian filtering or scaling content. */
120
+ declare const createPolygonGradientAnimation: (config: AnimationConfig) => Animation;
121
+ /** Upright triangle; its final incircle contains all four snapshot corners. */
122
+ declare const createTriangleAnimation: (config: AnimationConfig) => Animation;
123
+ /** The fixed logo has its own snapshot; only the page reveal grows beneath it. */
124
+ declare const createSvgLogoAnimation: (config: AnimationConfig) => Animation;
125
+ /** Native circular clip; browser compositor support varies by engine. */
126
+ declare const createCircleAnimation: (config: AnimationConfig) => Animation;
127
+ /** Predetermined translation uses WAAPI rather than a timer-owned stylesheet. */
128
+ declare const createSlideAnimation: (config: AnimationConfig) => Animation;
129
+ /**
130
+ * A bounded radial gradient feathers only the reveal edge. Unlike the old SVG
131
+ * Gaussian mask, it needs no huge filtered surface or animation on the old view.
132
+ * Mask animation can still paint; this is not a compositor-only guarantee.
133
+ */
134
+ declare const createBlurCircleAnimation: (config: AnimationConfig) => Animation;
135
+
136
+ declare const STORAGE_KEY = "theme";
137
+ declare const COLOR_STORAGE_KEY = "color-theme";
138
+ declare const GLOBAL_CLASS_NAME = "dark";
139
+ declare const COLOR_THEME_PREFIX = "theme-";
140
+ declare const DEFAULT_DURATION = 400;
141
+ declare const DEFAULT_EASING = "cubic-bezier(0.32, 0.72, 0, 1)";
142
+ declare const DEFAULT_BLUR_AMOUNT = 2;
143
+ declare const DEFAULT_STYLE_ID = "ui-theme-style";
144
+
145
+ export { type AnimationConfig as A, prefersReducedMotion as B, type ColorTheme as C, DEFAULT_BLUR_AMOUNT as D, resolveTheme as E, supportsViewTransitions as F, GLOBAL_CLASS_NAME as G, resolveThemeForServer as H, STORAGE_KEY as S, type Theme as T, type AnimationPosition as a, COLOR_STORAGE_KEY as b, COLOR_THEME_PREFIX as c, DEFAULT_DURATION as d, DEFAULT_EASING as e, DEFAULT_STYLE_ID as f, type SlideDirection as g, TRANSITION_DIRECTIONS as h, type ThemeAnimationOptions as i, ThemeAnimationType as j, type ThemeConfig as k, type ThemeLogoOptions as l, type ThemeState as m, type TransitionDirection as n, createBlurCircleAnimation as o, createBlurCircleMask as p, createCircleAnimation as q, createClipPathAnimation as r, createPolygonGradientAnimation as s, createSlideAnimation as t, createSvgLogoAnimation as u, createTriangleAnimation as v, getAnimationPosition as w, getSlideFromCoords as x, getSystemTheme as y, injectBaseStyles as z };
@@ -1,270 +1 @@
1
- 'use strict';
2
-
3
- // src/core/types.ts
4
- var ThemeAnimationType = /* @__PURE__ */ ((ThemeAnimationType2) => {
5
- ThemeAnimationType2["CIRCLE"] = "circle";
6
- ThemeAnimationType2["BLUR_CIRCLE"] = "blur-circle";
7
- ThemeAnimationType2["SLIDE"] = "slide";
8
- return ThemeAnimationType2;
9
- })(ThemeAnimationType || {});
10
-
11
- // src/core/constants.ts
12
- var STORAGE_KEY = "theme";
13
- var COLOR_STORAGE_KEY = "color-theme";
14
- var GLOBAL_CLASS_NAME = "dark";
15
- var COLOR_THEME_PREFIX = "theme-";
16
- var DEFAULT_DURATION = 750;
17
- var DEFAULT_EASING = "ease-in-out";
18
- var DEFAULT_BLUR_AMOUNT = 2;
19
- var DEFAULT_STYLE_ID = "ui-theme-style";
20
-
21
- // src/core/animations.ts
22
- var isBrowser = typeof window !== "undefined";
23
- var getIsHighResolution = () => {
24
- if (!isBrowser) return false;
25
- return window.innerWidth >= 3e3 || window.innerHeight >= 2e3;
26
- };
27
- var injectBaseStyles = () => {
28
- if (!isBrowser) return;
29
- const styleId = "ui-theme-base-style";
30
- if (document.getElementById(styleId)) return;
31
- const style = document.createElement("style");
32
- style.id = styleId;
33
- const isHighResolution = getIsHighResolution();
34
- style.textContent = `
35
- ::view-transition-old(root),
36
- ::view-transition-new(root) {
37
- animation: none;
38
- mix-blend-mode: normal;
39
- ${isHighResolution ? "transform: translateZ(0);" : ""}
40
- }
41
-
42
- ${isHighResolution ? `
43
- ::view-transition-group(root),
44
- ::view-transition-image-pair(root),
45
- ::view-transition-old(root),
46
- ::view-transition-new(root) {
47
- backface-visibility: hidden;
48
- perspective: 1000px;
49
- transform: translate3d(0, 0, 0);
50
- }
51
- ` : ""}
52
- `;
53
- document.head.appendChild(style);
54
- };
55
- var createBlurCircleMask = (blur) => {
56
- const isHighResolution = getIsHighResolution();
57
- const blurFilter = `<filter id="blur"><feGaussianBlur stdDeviation="${blur}" /></filter>`;
58
- const circleRadius = isHighResolution ? 20 : 25;
59
- return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-50 -50 100 100"><defs>${blurFilter}</defs><circle cx="0" cy="0" r="${circleRadius}" fill="white" filter="url(%23blur)"/></svg>')`;
60
- };
61
- var getSystemTheme = () => {
62
- if (!isBrowser) return "light";
63
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
64
- };
65
- var resolveTheme = (theme) => {
66
- if (theme === "system") {
67
- return getSystemTheme();
68
- }
69
- return theme === "dark" ? "dark" : "light";
70
- };
71
- var supportsViewTransitions = () => {
72
- return isBrowser && "startViewTransition" in document;
73
- };
74
- var prefersReducedMotion = () => {
75
- return isBrowser && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
76
- };
77
- var getSlideFromCoords = (direction) => {
78
- switch (direction) {
79
- case "left":
80
- return { a: -100, b: 0 };
81
- case "right":
82
- return { a: 100, b: 0 };
83
- case "top":
84
- return { a: 0, b: -100 };
85
- case "bottom":
86
- return { a: 0, b: 100 };
87
- case "top-left":
88
- return { a: -100, b: -100 };
89
- case "top-right":
90
- return { a: 100, b: -100 };
91
- case "bottom-left":
92
- return { a: -100, b: 100 };
93
- case "bottom-right":
94
- return { a: 100, b: 100 };
95
- default:
96
- return { a: -100, b: 0 };
97
- }
98
- };
99
- var createCircleAnimation = (config) => {
100
- const { x, y, duration, easing } = config;
101
- const topLeft = Math.hypot(x, y);
102
- const topRight = Math.hypot(window.innerWidth - x, y);
103
- const bottomLeft = Math.hypot(x, window.innerHeight - y);
104
- const bottomRight = Math.hypot(window.innerWidth - x, window.innerHeight - y);
105
- const maxRadius = Math.max(topLeft, topRight, bottomLeft, bottomRight);
106
- document.documentElement.animate(
107
- {
108
- clipPath: [
109
- `circle(0px at ${x}px ${y}px)`,
110
- `circle(${maxRadius}px at ${x}px ${y}px)`
111
- ]
112
- },
113
- {
114
- duration,
115
- easing,
116
- pseudoElement: "::view-transition-new(root)"
117
- }
118
- );
119
- };
120
- var createSlideAnimation = (config) => {
121
- const {
122
- a = -100,
123
- b = 0,
124
- x = 0,
125
- y = 0,
126
- duration,
127
- styleId = DEFAULT_STYLE_ID
128
- } = config;
129
- const styleElement = document.createElement("style");
130
- styleElement.id = styleId;
131
- styleElement.textContent = `
132
- ::view-transition-old(root) {
133
- animation-delay: ${duration}ms;
134
- }
135
-
136
- ::view-transition-new(root) {
137
- animation: move-in ${duration}ms;
138
- animation-timing-function: cubic-bezier(0.66, 0, 0.34, 1);
139
- }
140
-
141
- @keyframes move-in {
142
- from {
143
- translate: ${a}% ${b}%;
144
- }
145
- to {
146
- translate: ${x}% ${y}%;
147
- }
148
- }
149
- `;
150
- document.head.appendChild(styleElement);
151
- setTimeout(() => {
152
- const el = document.getElementById(styleId);
153
- if (el) {
154
- el.remove();
155
- }
156
- }, duration);
157
- };
158
- var createBlurCircleAnimation = (config) => {
159
- const {
160
- x,
161
- y,
162
- duration,
163
- easing,
164
- blurAmount,
165
- styleId = DEFAULT_STYLE_ID
166
- } = config;
167
- const existingStyle = document.getElementById(styleId);
168
- if (existingStyle) {
169
- existingStyle.remove();
170
- }
171
- const isHighResolution = getIsHighResolution();
172
- const viewportSize = Math.max(window.innerWidth, window.innerHeight) + 200;
173
- const scaleFactor = isHighResolution ? 2.5 : 4;
174
- const optimalMaskSize = isHighResolution ? Math.min(viewportSize * scaleFactor, 5e3) : viewportSize * scaleFactor;
175
- const topLeft = Math.hypot(x, y);
176
- const topRight = Math.hypot(window.innerWidth - x, y);
177
- const bottomLeft = Math.hypot(x, window.innerHeight - y);
178
- const bottomRight = Math.hypot(window.innerWidth - x, window.innerHeight - y);
179
- const maxRadius = Math.max(topLeft, topRight, bottomLeft, bottomRight);
180
- const styleElement = document.createElement("style");
181
- styleElement.id = styleId;
182
- const blurFactor = isHighResolution ? 1.5 : 1.2;
183
- const finalMaskSize = Math.max(optimalMaskSize, maxRadius * 2.5);
184
- styleElement.textContent = `
185
- ::view-transition-group(root) {
186
- animation-duration: ${duration}ms;
187
- animation-timing-function: ${isHighResolution ? "cubic-bezier(0.2, 0, 0.2, 1)" : "linear(0 0%, 0.2342 12.49%, 0.4374 24.99%,0.6093 37.49%, 0.6835 43.74%,0.7499 49.99%, 0.8086 56.25%,0.8593 62.5%, 0.9023 68.75%, 0.9375 75%,0.9648 81.25%, 0.9844 87.5%,0.9961 93.75%, 1 100%)"};
188
- will-change: transform;
189
- }
190
-
191
- ::view-transition-new(root) {
192
- mask: ${createBlurCircleMask(blurAmount * blurFactor)} 0 0 / 100% 100% no-repeat;
193
- mask-position: ${x}px ${y}px;
194
- animation: ui-theme-mask-scale ${duration}ms ${easing};
195
- transform-origin: ${x}px ${y}px;
196
- will-change: mask-size, mask-position;
197
- }
198
-
199
- ::view-transition-old(root),
200
- .dark::view-transition-old(root) {
201
- animation: ui-theme-mask-scale ${duration}ms ${easing};
202
- transform-origin: ${x}px ${y}px;
203
- z-index: -1;
204
- will-change: mask-size, mask-position;
205
- }
206
-
207
- @keyframes ui-theme-mask-scale {
208
- 0% {
209
- mask-size: 0px;
210
- mask-position: ${x}px ${y}px;
211
- }
212
- 100% {
213
- mask-size: ${finalMaskSize}px;
214
- mask-position: ${x - finalMaskSize / 2}px ${y - finalMaskSize / 2}px;
215
- }
216
- }
217
- `;
218
- document.head.appendChild(styleElement);
219
- setTimeout(() => {
220
- const el = document.getElementById(styleId);
221
- if (el) {
222
- el.remove();
223
- }
224
- }, duration);
225
- };
226
-
227
- // src/core/storage.ts
228
- var isBrowser2 = typeof window !== "undefined";
229
- var getStoredTheme = (key = STORAGE_KEY, validThemes = ["light", "dark", "system"], defaultTheme = "system") => {
230
- if (!isBrowser2) return defaultTheme;
231
- const saved = localStorage.getItem(key);
232
- return saved && validThemes.includes(saved) ? saved : defaultTheme;
233
- };
234
- var setStoredTheme = (theme, key = STORAGE_KEY) => {
235
- if (!isBrowser2) return;
236
- localStorage.setItem(key, theme);
237
- };
238
- var getStoredColorTheme = (key = COLOR_STORAGE_KEY, validColorThemes = ["default"], defaultColorTheme = "default") => {
239
- if (!isBrowser2) return defaultColorTheme;
240
- const saved = localStorage.getItem(key);
241
- return saved && validColorThemes.includes(saved) ? saved : defaultColorTheme;
242
- };
243
- var setStoredColorTheme = (colorTheme, key = COLOR_STORAGE_KEY) => {
244
- if (!isBrowser2) return;
245
- localStorage.setItem(key, colorTheme);
246
- };
247
-
248
- exports.COLOR_STORAGE_KEY = COLOR_STORAGE_KEY;
249
- exports.COLOR_THEME_PREFIX = COLOR_THEME_PREFIX;
250
- exports.DEFAULT_BLUR_AMOUNT = DEFAULT_BLUR_AMOUNT;
251
- exports.DEFAULT_DURATION = DEFAULT_DURATION;
252
- exports.DEFAULT_EASING = DEFAULT_EASING;
253
- exports.DEFAULT_STYLE_ID = DEFAULT_STYLE_ID;
254
- exports.GLOBAL_CLASS_NAME = GLOBAL_CLASS_NAME;
255
- exports.STORAGE_KEY = STORAGE_KEY;
256
- exports.ThemeAnimationType = ThemeAnimationType;
257
- exports.createBlurCircleAnimation = createBlurCircleAnimation;
258
- exports.createBlurCircleMask = createBlurCircleMask;
259
- exports.createCircleAnimation = createCircleAnimation;
260
- exports.createSlideAnimation = createSlideAnimation;
261
- exports.getSlideFromCoords = getSlideFromCoords;
262
- exports.getStoredColorTheme = getStoredColorTheme;
263
- exports.getStoredTheme = getStoredTheme;
264
- exports.getSystemTheme = getSystemTheme;
265
- exports.injectBaseStyles = injectBaseStyles;
266
- exports.prefersReducedMotion = prefersReducedMotion;
267
- exports.resolveTheme = resolveTheme;
268
- exports.setStoredColorTheme = setStoredColorTheme;
269
- exports.setStoredTheme = setStoredTheme;
270
- exports.supportsViewTransitions = supportsViewTransitions;
1
+ 'use strict';var chunkV3LMT5IJ_cjs=require('../chunk-V3LMT5IJ.cjs'),chunkW4YFUPGE_cjs=require('../chunk-W4YFUPGE.cjs');Object.defineProperty(exports,"TRANSITION_DIRECTIONS",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.b}});Object.defineProperty(exports,"ThemeAnimationType",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.a}});Object.defineProperty(exports,"getStoredColorTheme",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.h}});Object.defineProperty(exports,"getStoredTheme",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.f}});Object.defineProperty(exports,"preloadThemeLogo",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.d}});Object.defineProperty(exports,"runThemeTransition",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.e}});Object.defineProperty(exports,"setStoredColorTheme",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.i}});Object.defineProperty(exports,"setStoredTheme",{enumerable:true,get:function(){return chunkV3LMT5IJ_cjs.g}});Object.defineProperty(exports,"COLOR_STORAGE_KEY",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.r}});Object.defineProperty(exports,"COLOR_THEME_PREFIX",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.t}});Object.defineProperty(exports,"DEFAULT_BLUR_AMOUNT",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.w}});Object.defineProperty(exports,"DEFAULT_DURATION",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.u}});Object.defineProperty(exports,"DEFAULT_EASING",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.v}});Object.defineProperty(exports,"DEFAULT_STYLE_ID",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.x}});Object.defineProperty(exports,"GLOBAL_CLASS_NAME",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.s}});Object.defineProperty(exports,"STORAGE_KEY",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.q}});Object.defineProperty(exports,"createBlurCircleAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.p}});Object.defineProperty(exports,"createBlurCircleMask",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.b}});Object.defineProperty(exports,"createCircleAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.n}});Object.defineProperty(exports,"createClipPathAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.j}});Object.defineProperty(exports,"createPolygonGradientAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.k}});Object.defineProperty(exports,"createSlideAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.o}});Object.defineProperty(exports,"createSvgLogoAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.m}});Object.defineProperty(exports,"createTriangleAnimation",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.l}});Object.defineProperty(exports,"getAnimationPosition",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.i}});Object.defineProperty(exports,"getSlideFromCoords",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.h}});Object.defineProperty(exports,"getSystemTheme",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.c}});Object.defineProperty(exports,"injectBaseStyles",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.a}});Object.defineProperty(exports,"prefersReducedMotion",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.g}});Object.defineProperty(exports,"resolveTheme",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.d}});Object.defineProperty(exports,"supportsViewTransitions",{enumerable:true,get:function(){return chunkW4YFUPGE_cjs.f}});
@@ -1,5 +1,9 @@
1
- import { T as Theme, C as ColorTheme } from '../constants-n21pnuRC.cjs';
2
- export { A as AnimationConfig, l as COLOR_STORAGE_KEY, m as COLOR_THEME_PREFIX, o as DEFAULT_BLUR_AMOUNT, D as DEFAULT_DURATION, n as DEFAULT_EASING, q as DEFAULT_STYLE_ID, G as GLOBAL_CLASS_NAME, k as STORAGE_KEY, S as SlideDirection, a as ThemeAnimationType, b as ThemeConfig, c as ThemeState, e as createBlurCircleAnimation, h as createBlurCircleMask, d as createCircleAnimation, f as createSlideAnimation, j as getSlideFromCoords, g as getSystemTheme, i as injectBaseStyles, p as prefersReducedMotion, r as resolveTheme, s as supportsViewTransitions } from '../constants-n21pnuRC.cjs';
1
+ import { A as AnimationConfig, C as ColorTheme, T as Theme } from '../constants-DmZ7yAIL.cjs';
2
+ export { a as AnimationPosition, b as COLOR_STORAGE_KEY, c as COLOR_THEME_PREFIX, D as DEFAULT_BLUR_AMOUNT, d as DEFAULT_DURATION, e as DEFAULT_EASING, f as DEFAULT_STYLE_ID, G as GLOBAL_CLASS_NAME, S as STORAGE_KEY, g as SlideDirection, h as TRANSITION_DIRECTIONS, i as ThemeAnimationOptions, j as ThemeAnimationType, k as ThemeConfig, l as ThemeLogoOptions, m as ThemeState, n as TransitionDirection, o as createBlurCircleAnimation, p as createBlurCircleMask, q as createCircleAnimation, r as createClipPathAnimation, s as createPolygonGradientAnimation, t as createSlideAnimation, u as createSvgLogoAnimation, v as createTriangleAnimation, w as getAnimationPosition, x as getSlideFromCoords, y as getSystemTheme, z as injectBaseStyles, B as prefersReducedMotion, E as resolveTheme, F as supportsViewTransitions } from '../constants-DmZ7yAIL.cjs';
3
+ export { p as preloadThemeLogo } from '../logo-DtwtRv4y.cjs';
4
+
5
+ /** Latest request wins visually; every requested state update still runs once. */
6
+ declare const runThemeTransition: (update: () => void, config: AnimationConfig | null) => Promise<void>;
3
7
 
4
8
  /**
5
9
  * Gets the stored theme from localStorage
@@ -30,4 +34,4 @@ declare const getStoredColorTheme: (key?: string, validColorThemes?: ColorTheme[
30
34
  */
31
35
  declare const setStoredColorTheme: (colorTheme: ColorTheme, key?: string) => void;
32
36
 
33
- export { ColorTheme, Theme, getStoredColorTheme, getStoredTheme, setStoredColorTheme, setStoredTheme };
37
+ export { AnimationConfig, ColorTheme, Theme, getStoredColorTheme, getStoredTheme, runThemeTransition, setStoredColorTheme, setStoredTheme };
@@ -1,5 +1,9 @@
1
- import { T as Theme, C as ColorTheme } from '../constants-n21pnuRC.js';
2
- export { A as AnimationConfig, l as COLOR_STORAGE_KEY, m as COLOR_THEME_PREFIX, o as DEFAULT_BLUR_AMOUNT, D as DEFAULT_DURATION, n as DEFAULT_EASING, q as DEFAULT_STYLE_ID, G as GLOBAL_CLASS_NAME, k as STORAGE_KEY, S as SlideDirection, a as ThemeAnimationType, b as ThemeConfig, c as ThemeState, e as createBlurCircleAnimation, h as createBlurCircleMask, d as createCircleAnimation, f as createSlideAnimation, j as getSlideFromCoords, g as getSystemTheme, i as injectBaseStyles, p as prefersReducedMotion, r as resolveTheme, s as supportsViewTransitions } from '../constants-n21pnuRC.js';
1
+ import { A as AnimationConfig, C as ColorTheme, T as Theme } from '../constants-DmZ7yAIL.js';
2
+ export { a as AnimationPosition, b as COLOR_STORAGE_KEY, c as COLOR_THEME_PREFIX, D as DEFAULT_BLUR_AMOUNT, d as DEFAULT_DURATION, e as DEFAULT_EASING, f as DEFAULT_STYLE_ID, G as GLOBAL_CLASS_NAME, S as STORAGE_KEY, g as SlideDirection, h as TRANSITION_DIRECTIONS, i as ThemeAnimationOptions, j as ThemeAnimationType, k as ThemeConfig, l as ThemeLogoOptions, m as ThemeState, n as TransitionDirection, o as createBlurCircleAnimation, p as createBlurCircleMask, q as createCircleAnimation, r as createClipPathAnimation, s as createPolygonGradientAnimation, t as createSlideAnimation, u as createSvgLogoAnimation, v as createTriangleAnimation, w as getAnimationPosition, x as getSlideFromCoords, y as getSystemTheme, z as injectBaseStyles, B as prefersReducedMotion, E as resolveTheme, F as supportsViewTransitions } from '../constants-DmZ7yAIL.js';
3
+ export { p as preloadThemeLogo } from '../logo-DtwtRv4y.js';
4
+
5
+ /** Latest request wins visually; every requested state update still runs once. */
6
+ declare const runThemeTransition: (update: () => void, config: AnimationConfig | null) => Promise<void>;
3
7
 
4
8
  /**
5
9
  * Gets the stored theme from localStorage
@@ -30,4 +34,4 @@ declare const getStoredColorTheme: (key?: string, validColorThemes?: ColorTheme[
30
34
  */
31
35
  declare const setStoredColorTheme: (colorTheme: ColorTheme, key?: string) => void;
32
36
 
33
- export { ColorTheme, Theme, getStoredColorTheme, getStoredTheme, setStoredColorTheme, setStoredTheme };
37
+ export { AnimationConfig, ColorTheme, Theme, getStoredColorTheme, getStoredTheme, runThemeTransition, setStoredColorTheme, setStoredTheme };