veilkit 0.0.0-stage → 0.2.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENSE +21 -0
  3. package/README.md +801 -2
  4. package/dist/angular/index.cjs +660 -0
  5. package/dist/angular/index.cjs.map +1 -0
  6. package/dist/angular/index.d.cts +113 -0
  7. package/dist/angular/index.d.ts +113 -0
  8. package/dist/angular/index.js +660 -0
  9. package/dist/angular/index.js.map +1 -0
  10. package/dist/cli/index.cjs +25 -0
  11. package/dist/cli/index.cjs.map +1 -0
  12. package/dist/cli/index.d.cts +1 -0
  13. package/dist/cli/index.d.ts +1 -0
  14. package/dist/cli/index.js +25 -0
  15. package/dist/cli/index.js.map +1 -0
  16. package/dist/controller-B6kFsWzi.d.cts +195 -0
  17. package/dist/controller-Ceub9kLC.d.ts +195 -0
  18. package/dist/element/index.cjs +660 -0
  19. package/dist/element/index.cjs.map +1 -0
  20. package/dist/element/index.d.cts +48 -0
  21. package/dist/element/index.d.ts +48 -0
  22. package/dist/element/index.js +660 -0
  23. package/dist/element/index.js.map +1 -0
  24. package/dist/index.cjs +660 -0
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +211 -0
  27. package/dist/index.d.ts +211 -0
  28. package/dist/index.js +660 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/native/index.cjs +2 -0
  31. package/dist/native/index.cjs.map +1 -0
  32. package/dist/native/index.d.cts +54 -0
  33. package/dist/native/index.d.ts +54 -0
  34. package/dist/native/index.js +2 -0
  35. package/dist/native/index.js.map +1 -0
  36. package/dist/react/index.cjs +660 -0
  37. package/dist/react/index.cjs.map +1 -0
  38. package/dist/react/index.d.cts +121 -0
  39. package/dist/react/index.d.ts +121 -0
  40. package/dist/react/index.js +660 -0
  41. package/dist/react/index.js.map +1 -0
  42. package/dist/styles.css +509 -0
  43. package/dist/svelte/index.cjs +660 -0
  44. package/dist/svelte/index.cjs.map +1 -0
  45. package/dist/svelte/index.d.cts +48 -0
  46. package/dist/svelte/index.d.ts +48 -0
  47. package/dist/svelte/index.js +660 -0
  48. package/dist/svelte/index.js.map +1 -0
  49. package/dist/themes/index.cjs +2 -0
  50. package/dist/themes/index.cjs.map +1 -0
  51. package/dist/themes/index.d.cts +18 -0
  52. package/dist/themes/index.d.ts +18 -0
  53. package/dist/themes/index.js +2 -0
  54. package/dist/themes/index.js.map +1 -0
  55. package/dist/types-CnR-rU97.d.cts +176 -0
  56. package/dist/types-CnR-rU97.d.ts +176 -0
  57. package/dist/veilkit.min.js +659 -0
  58. package/dist/vue/index.cjs +660 -0
  59. package/dist/vue/index.cjs.map +1 -0
  60. package/dist/vue/index.d.cts +512 -0
  61. package/dist/vue/index.d.ts +512 -0
  62. package/dist/vue/index.js +660 -0
  63. package/dist/vue/index.js.map +1 -0
  64. package/package.json +254 -4
@@ -0,0 +1,211 @@
1
+ import { a as VeilAnimationName, n as VeilDirection, o as VeilRevealTransition, A as AutoMeasureOptions, S as SkeletonProps, f as VeilSpinnerType, c as SpinnerProps, e as ButtonLoadingStyle, L as LoadingButtonProps, B as ButtonStatus, m as LazyImageProps, T as TextLoaderProps } from './types-CnR-rU97.cjs';
2
+ export { j as ButtonPressFeedback, k as ButtonResultAnimation, C as CustomThemeInput, O as OverlayProps, P as PresetProps, b as ProgressProps, l as SkeletonController, d as VeilGlobalConfig, g as VeilPresetName, i as VeilPrimitiveType, h as VeilShapeStyle, V as VeilThemeName, p as VeilThemeTokens } from './types-CnR-rU97.cjs';
3
+ export { BUILTIN_THEMES, createTheme, getThemeTokens } from './themes/index.cjs';
4
+ export { L as LoadingManager, O as OverlayController, P as PRESET_NAMES, R as RouteProgressController, T as TrackOptions, V as VeilkitController, a as applyA11yLoading, c as createPreset, b as createPrimitive, d as createProgressElement, e as createSkeletonElement, f as createSkeletonParagraph, v as default, g as getLabel, h as getLocale, l as loadingManager, o as overlayController, p as progressController, r as removeA11yLoading, s as setLabels, i as setLocale, t as track, v as veil, w as wrapFetch } from './controller-B6kFsWzi.cjs';
5
+
6
+ /**
7
+ * Veilkit - Animation Engine
8
+ * 30 GPU-Accelerated Animation Definitions (transform & opacity only)
9
+ */
10
+
11
+ interface AnimationConfig {
12
+ name: VeilAnimationName;
13
+ duration?: number | string;
14
+ direction?: VeilDirection;
15
+ speedMultiplier?: number;
16
+ intensity?: number;
17
+ }
18
+ declare const ANIMATION_NAMES: VeilAnimationName[];
19
+ /**
20
+ * Generates the CSS keyframes and utility rules for all 30 animations.
21
+ * Strictly uses transform and opacity for 60fps GPU execution.
22
+ */
23
+ declare function getAnimationKeyframesCSS(): string;
24
+
25
+ /**
26
+ * Veilkit - Global Synchronized Timeline
27
+ * Keeps all shimmer animations in lockstep phase via negative animation-delay
28
+ */
29
+ /**
30
+ * Initializes or gets the baseline global timeline origin
31
+ */
32
+ declare function getTimelineOrigin(): number;
33
+ /**
34
+ * Computes a negative animation-delay string so that an element mounting right now
35
+ * is in exact phase synchronization with all other animations sharing this duration.
36
+ *
37
+ * @param durationMs Duration in milliseconds (default 1500)
38
+ * @returns CSS animation-delay value, e.g. "-642ms"
39
+ */
40
+ declare function getSyncDelay(durationMs?: number): string;
41
+ /**
42
+ * Parses duration string (e.g. "1.5s", "800ms") into milliseconds
43
+ */
44
+ declare function parseDurationMs(duration?: string | number): number;
45
+
46
+ /**
47
+ * Veilkit - Performance & Offscreen Observers
48
+ * Automatically pauses animations when offscreen or when document is hidden
49
+ */
50
+ /**
51
+ * Ensures tab visibility change listener is attached
52
+ */
53
+ declare function setupVisibilityObserver(): void;
54
+ /**
55
+ * Registers an element to pause CSS animations when outside the viewport
56
+ */
57
+ declare function observeOffscreen(element: HTMLElement): () => void;
58
+ /**
59
+ * Disconnects all observers
60
+ */
61
+ declare function teardownObservers(): void;
62
+
63
+ /**
64
+ * Veilkit - CSS Engine & Style Injector
65
+ * SSR-safe, adoptedStyleSheets support, CSP nonce, and zero-layout-thrash animations
66
+ */
67
+ /**
68
+ * Configure CSP nonce for injected styles
69
+ */
70
+ declare function setNonce(nonce: string): void;
71
+ /**
72
+ * Generates the full CSS stylesheet string
73
+ */
74
+ declare function getStylesCSS(): string;
75
+ /**
76
+ * Injects CSS into the document head safely (runs only once, SSR safe)
77
+ */
78
+ declare function injectStyles(nonce?: string): void;
79
+
80
+ /**
81
+ * Veilkit - Anti-Flicker Timing Controller
82
+ * Prevents UI flicker:
83
+ * 1. delay (default 150ms): suppresses loading state if task completes very quickly
84
+ * 2. minVisible (default 300ms): guarantees loader stays visible long enough to avoid rapid flashing
85
+ */
86
+ interface AntiFlickerOptions {
87
+ delay?: number;
88
+ minVisible?: number;
89
+ onShow?: () => void;
90
+ onHide?: () => void;
91
+ }
92
+ declare class AntiFlickerController {
93
+ private delay;
94
+ private minVisible;
95
+ private onShow?;
96
+ private onHide?;
97
+ private delayTimer;
98
+ private minVisibleTimer;
99
+ private shownTimestamp;
100
+ private isVisible;
101
+ private isPending;
102
+ constructor(options?: AntiFlickerOptions);
103
+ /**
104
+ * Request loader to be shown (subject to delay)
105
+ */
106
+ start(): void;
107
+ private display;
108
+ /**
109
+ * Request loader to be hidden (subject to minVisible)
110
+ */
111
+ finish(callback?: () => void): void;
112
+ private hide;
113
+ active(): boolean;
114
+ destroy(): void;
115
+ }
116
+
117
+ /**
118
+ * Veilkit - Reveal Transitions Engine
119
+ * Seamless skeleton -> content reveal transitions:
120
+ * fade, blur-in, slide-up, scale, stagger-children, none
121
+ */
122
+
123
+ interface RevealOptions {
124
+ transition?: VeilRevealTransition;
125
+ duration?: number;
126
+ easing?: string;
127
+ onComplete?: () => void;
128
+ }
129
+ declare function applyReveal(element: HTMLElement, options?: RevealOptions): void;
130
+
131
+ /**
132
+ * Veilkit - Auto-Measure Skeleton Engine
133
+ * Dynamically measures real DOM trees, generates matching skeleton overlays,
134
+ * updates on resize/mutation, and supports instant layout caching.
135
+ */
136
+
137
+ interface LeafBox {
138
+ x: number;
139
+ y: number;
140
+ width: number;
141
+ height: number;
142
+ radius: string;
143
+ shape: 'circle' | 'rect' | 'line';
144
+ }
145
+ interface CachedLayout {
146
+ width: number;
147
+ height: number;
148
+ boxes: LeafBox[];
149
+ }
150
+ /**
151
+ * Retrieve cached layout by key
152
+ */
153
+ declare function getCachedLayout(cacheKey: string): CachedLayout | null;
154
+ /**
155
+ * Store layout in cache
156
+ */
157
+ declare function setCachedLayout(cacheKey: string, layout: CachedLayout, persist?: boolean): void;
158
+ /**
159
+ * Measures the leaf elements of a container DOM tree
160
+ */
161
+ declare function measureContainer(container: HTMLElement, ignoreSelector?: string): CachedLayout;
162
+ /**
163
+ * Creates and attaches an auto-measured skeleton overlay to a container
164
+ */
165
+ declare function createAutoMeasureOverlay(container: HTMLElement, options?: AutoMeasureOptions, skeletonProps?: SkeletonProps): {
166
+ overlay: HTMLElement;
167
+ refresh: () => void;
168
+ destroy: () => void;
169
+ };
170
+
171
+ /**
172
+ * Veilkit - 30 Spinner Loaders
173
+ * Complete catalog of GPU-accelerated spinners
174
+ */
175
+
176
+ declare const SPINNER_TYPES: VeilSpinnerType[];
177
+ /**
178
+ * Creates a DOM spinner element with specified type, size, and colors
179
+ */
180
+ declare function createSpinner(props?: SpinnerProps): HTMLElement;
181
+
182
+ /**
183
+ * Veilkit - Loading Button Controller
184
+ * 16 Loading Styles, State Machine (idle -> loading -> success | error -> idle),
185
+ * Result Animations (checkmark, cross, shake, success-burst), and Press Feedback.
186
+ */
187
+
188
+ declare const BUTTON_LOADING_STYLES: ButtonLoadingStyle[];
189
+ declare function wrapLoadingButton(buttonEl: HTMLButtonElement, props?: LoadingButtonProps): {
190
+ setStatus: (status: ButtonStatus, customText?: string) => void;
191
+ setLoading: (loading: boolean, loadingText?: string) => void;
192
+ getStatus: () => ButtonStatus;
193
+ destroy: () => void;
194
+ };
195
+
196
+ /**
197
+ * Veilkit - Lazy Image & Media Placeholder
198
+ * Renders synchronized skeleton placeholder until image loads,
199
+ * then reveals with smooth blur-up transition and handles error fallback.
200
+ */
201
+
202
+ declare function createLazyImage(props: LazyImageProps): HTMLElement;
203
+
204
+ /**
205
+ * Veilkit - Text Loader
206
+ * Animated localized typing text with pulsing ellipsis dots
207
+ */
208
+
209
+ declare function createTextLoader(props?: TextLoaderProps): HTMLElement;
210
+
211
+ export { ANIMATION_NAMES, type AnimationConfig, AntiFlickerController, type AntiFlickerOptions, AutoMeasureOptions, BUTTON_LOADING_STYLES, ButtonLoadingStyle, ButtonStatus, type CachedLayout, LazyImageProps, type LeafBox, LoadingButtonProps, type RevealOptions, SPINNER_TYPES, SkeletonProps, SpinnerProps, TextLoaderProps, VeilAnimationName, VeilDirection, VeilRevealTransition, VeilSpinnerType, applyReveal, createAutoMeasureOverlay, createLazyImage, createSpinner, createTextLoader, getAnimationKeyframesCSS, getCachedLayout, getStylesCSS, getSyncDelay, getTimelineOrigin, injectStyles, measureContainer, observeOffscreen, parseDurationMs, setCachedLayout, setNonce, setupVisibilityObserver, teardownObservers, wrapLoadingButton };
@@ -0,0 +1,211 @@
1
+ import { a as VeilAnimationName, n as VeilDirection, o as VeilRevealTransition, A as AutoMeasureOptions, S as SkeletonProps, f as VeilSpinnerType, c as SpinnerProps, e as ButtonLoadingStyle, L as LoadingButtonProps, B as ButtonStatus, m as LazyImageProps, T as TextLoaderProps } from './types-CnR-rU97.js';
2
+ export { j as ButtonPressFeedback, k as ButtonResultAnimation, C as CustomThemeInput, O as OverlayProps, P as PresetProps, b as ProgressProps, l as SkeletonController, d as VeilGlobalConfig, g as VeilPresetName, i as VeilPrimitiveType, h as VeilShapeStyle, V as VeilThemeName, p as VeilThemeTokens } from './types-CnR-rU97.js';
3
+ export { BUILTIN_THEMES, createTheme, getThemeTokens } from './themes/index.js';
4
+ export { L as LoadingManager, O as OverlayController, P as PRESET_NAMES, R as RouteProgressController, T as TrackOptions, V as VeilkitController, a as applyA11yLoading, c as createPreset, b as createPrimitive, d as createProgressElement, e as createSkeletonElement, f as createSkeletonParagraph, v as default, g as getLabel, h as getLocale, l as loadingManager, o as overlayController, p as progressController, r as removeA11yLoading, s as setLabels, i as setLocale, t as track, v as veil, w as wrapFetch } from './controller-Ceub9kLC.js';
5
+
6
+ /**
7
+ * Veilkit - Animation Engine
8
+ * 30 GPU-Accelerated Animation Definitions (transform & opacity only)
9
+ */
10
+
11
+ interface AnimationConfig {
12
+ name: VeilAnimationName;
13
+ duration?: number | string;
14
+ direction?: VeilDirection;
15
+ speedMultiplier?: number;
16
+ intensity?: number;
17
+ }
18
+ declare const ANIMATION_NAMES: VeilAnimationName[];
19
+ /**
20
+ * Generates the CSS keyframes and utility rules for all 30 animations.
21
+ * Strictly uses transform and opacity for 60fps GPU execution.
22
+ */
23
+ declare function getAnimationKeyframesCSS(): string;
24
+
25
+ /**
26
+ * Veilkit - Global Synchronized Timeline
27
+ * Keeps all shimmer animations in lockstep phase via negative animation-delay
28
+ */
29
+ /**
30
+ * Initializes or gets the baseline global timeline origin
31
+ */
32
+ declare function getTimelineOrigin(): number;
33
+ /**
34
+ * Computes a negative animation-delay string so that an element mounting right now
35
+ * is in exact phase synchronization with all other animations sharing this duration.
36
+ *
37
+ * @param durationMs Duration in milliseconds (default 1500)
38
+ * @returns CSS animation-delay value, e.g. "-642ms"
39
+ */
40
+ declare function getSyncDelay(durationMs?: number): string;
41
+ /**
42
+ * Parses duration string (e.g. "1.5s", "800ms") into milliseconds
43
+ */
44
+ declare function parseDurationMs(duration?: string | number): number;
45
+
46
+ /**
47
+ * Veilkit - Performance & Offscreen Observers
48
+ * Automatically pauses animations when offscreen or when document is hidden
49
+ */
50
+ /**
51
+ * Ensures tab visibility change listener is attached
52
+ */
53
+ declare function setupVisibilityObserver(): void;
54
+ /**
55
+ * Registers an element to pause CSS animations when outside the viewport
56
+ */
57
+ declare function observeOffscreen(element: HTMLElement): () => void;
58
+ /**
59
+ * Disconnects all observers
60
+ */
61
+ declare function teardownObservers(): void;
62
+
63
+ /**
64
+ * Veilkit - CSS Engine & Style Injector
65
+ * SSR-safe, adoptedStyleSheets support, CSP nonce, and zero-layout-thrash animations
66
+ */
67
+ /**
68
+ * Configure CSP nonce for injected styles
69
+ */
70
+ declare function setNonce(nonce: string): void;
71
+ /**
72
+ * Generates the full CSS stylesheet string
73
+ */
74
+ declare function getStylesCSS(): string;
75
+ /**
76
+ * Injects CSS into the document head safely (runs only once, SSR safe)
77
+ */
78
+ declare function injectStyles(nonce?: string): void;
79
+
80
+ /**
81
+ * Veilkit - Anti-Flicker Timing Controller
82
+ * Prevents UI flicker:
83
+ * 1. delay (default 150ms): suppresses loading state if task completes very quickly
84
+ * 2. minVisible (default 300ms): guarantees loader stays visible long enough to avoid rapid flashing
85
+ */
86
+ interface AntiFlickerOptions {
87
+ delay?: number;
88
+ minVisible?: number;
89
+ onShow?: () => void;
90
+ onHide?: () => void;
91
+ }
92
+ declare class AntiFlickerController {
93
+ private delay;
94
+ private minVisible;
95
+ private onShow?;
96
+ private onHide?;
97
+ private delayTimer;
98
+ private minVisibleTimer;
99
+ private shownTimestamp;
100
+ private isVisible;
101
+ private isPending;
102
+ constructor(options?: AntiFlickerOptions);
103
+ /**
104
+ * Request loader to be shown (subject to delay)
105
+ */
106
+ start(): void;
107
+ private display;
108
+ /**
109
+ * Request loader to be hidden (subject to minVisible)
110
+ */
111
+ finish(callback?: () => void): void;
112
+ private hide;
113
+ active(): boolean;
114
+ destroy(): void;
115
+ }
116
+
117
+ /**
118
+ * Veilkit - Reveal Transitions Engine
119
+ * Seamless skeleton -> content reveal transitions:
120
+ * fade, blur-in, slide-up, scale, stagger-children, none
121
+ */
122
+
123
+ interface RevealOptions {
124
+ transition?: VeilRevealTransition;
125
+ duration?: number;
126
+ easing?: string;
127
+ onComplete?: () => void;
128
+ }
129
+ declare function applyReveal(element: HTMLElement, options?: RevealOptions): void;
130
+
131
+ /**
132
+ * Veilkit - Auto-Measure Skeleton Engine
133
+ * Dynamically measures real DOM trees, generates matching skeleton overlays,
134
+ * updates on resize/mutation, and supports instant layout caching.
135
+ */
136
+
137
+ interface LeafBox {
138
+ x: number;
139
+ y: number;
140
+ width: number;
141
+ height: number;
142
+ radius: string;
143
+ shape: 'circle' | 'rect' | 'line';
144
+ }
145
+ interface CachedLayout {
146
+ width: number;
147
+ height: number;
148
+ boxes: LeafBox[];
149
+ }
150
+ /**
151
+ * Retrieve cached layout by key
152
+ */
153
+ declare function getCachedLayout(cacheKey: string): CachedLayout | null;
154
+ /**
155
+ * Store layout in cache
156
+ */
157
+ declare function setCachedLayout(cacheKey: string, layout: CachedLayout, persist?: boolean): void;
158
+ /**
159
+ * Measures the leaf elements of a container DOM tree
160
+ */
161
+ declare function measureContainer(container: HTMLElement, ignoreSelector?: string): CachedLayout;
162
+ /**
163
+ * Creates and attaches an auto-measured skeleton overlay to a container
164
+ */
165
+ declare function createAutoMeasureOverlay(container: HTMLElement, options?: AutoMeasureOptions, skeletonProps?: SkeletonProps): {
166
+ overlay: HTMLElement;
167
+ refresh: () => void;
168
+ destroy: () => void;
169
+ };
170
+
171
+ /**
172
+ * Veilkit - 30 Spinner Loaders
173
+ * Complete catalog of GPU-accelerated spinners
174
+ */
175
+
176
+ declare const SPINNER_TYPES: VeilSpinnerType[];
177
+ /**
178
+ * Creates a DOM spinner element with specified type, size, and colors
179
+ */
180
+ declare function createSpinner(props?: SpinnerProps): HTMLElement;
181
+
182
+ /**
183
+ * Veilkit - Loading Button Controller
184
+ * 16 Loading Styles, State Machine (idle -> loading -> success | error -> idle),
185
+ * Result Animations (checkmark, cross, shake, success-burst), and Press Feedback.
186
+ */
187
+
188
+ declare const BUTTON_LOADING_STYLES: ButtonLoadingStyle[];
189
+ declare function wrapLoadingButton(buttonEl: HTMLButtonElement, props?: LoadingButtonProps): {
190
+ setStatus: (status: ButtonStatus, customText?: string) => void;
191
+ setLoading: (loading: boolean, loadingText?: string) => void;
192
+ getStatus: () => ButtonStatus;
193
+ destroy: () => void;
194
+ };
195
+
196
+ /**
197
+ * Veilkit - Lazy Image & Media Placeholder
198
+ * Renders synchronized skeleton placeholder until image loads,
199
+ * then reveals with smooth blur-up transition and handles error fallback.
200
+ */
201
+
202
+ declare function createLazyImage(props: LazyImageProps): HTMLElement;
203
+
204
+ /**
205
+ * Veilkit - Text Loader
206
+ * Animated localized typing text with pulsing ellipsis dots
207
+ */
208
+
209
+ declare function createTextLoader(props?: TextLoaderProps): HTMLElement;
210
+
211
+ export { ANIMATION_NAMES, type AnimationConfig, AntiFlickerController, type AntiFlickerOptions, AutoMeasureOptions, BUTTON_LOADING_STYLES, ButtonLoadingStyle, ButtonStatus, type CachedLayout, LazyImageProps, type LeafBox, LoadingButtonProps, type RevealOptions, SPINNER_TYPES, SkeletonProps, SpinnerProps, TextLoaderProps, VeilAnimationName, VeilDirection, VeilRevealTransition, VeilSpinnerType, applyReveal, createAutoMeasureOverlay, createLazyImage, createSpinner, createTextLoader, getAnimationKeyframesCSS, getCachedLayout, getStylesCSS, getSyncDelay, getTimelineOrigin, injectStyles, measureContainer, observeOffscreen, parseDurationMs, setCachedLayout, setNonce, setupVisibilityObserver, teardownObservers, wrapLoadingButton };