veilkit 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +29 -0
- package/LICENSE +21 -0
- package/README.md +245 -2
- package/dist/angular/index.cjs +394 -0
- package/dist/angular/index.cjs.map +1 -0
- package/dist/angular/index.d.cts +78 -0
- package/dist/angular/index.d.ts +78 -0
- package/dist/angular/index.js +394 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/cli/index.cjs +25 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +25 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/controller-5OzP0U8X.d.cts +193 -0
- package/dist/controller-Co5bvnaB.d.ts +193 -0
- package/dist/element/index.cjs +395 -0
- package/dist/element/index.cjs.map +1 -0
- package/dist/element/index.d.cts +42 -0
- package/dist/element/index.d.ts +42 -0
- package/dist/element/index.js +395 -0
- package/dist/element/index.js.map +1 -0
- package/dist/index.cjs +394 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +209 -0
- package/dist/index.d.ts +209 -0
- package/dist/index.js +394 -0
- package/dist/index.js.map +1 -0
- package/dist/native/index.cjs +2 -0
- package/dist/native/index.cjs.map +1 -0
- package/dist/native/index.d.cts +48 -0
- package/dist/native/index.d.ts +48 -0
- package/dist/native/index.js +2 -0
- package/dist/native/index.js.map +1 -0
- package/dist/react/index.cjs +394 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +99 -0
- package/dist/react/index.d.ts +99 -0
- package/dist/react/index.js +394 -0
- package/dist/react/index.js.map +1 -0
- package/dist/styles.css +377 -0
- package/dist/svelte/index.cjs +394 -0
- package/dist/svelte/index.cjs.map +1 -0
- package/dist/svelte/index.d.cts +41 -0
- package/dist/svelte/index.d.ts +41 -0
- package/dist/svelte/index.js +394 -0
- package/dist/svelte/index.js.map +1 -0
- package/dist/themes/index.cjs +2 -0
- package/dist/themes/index.cjs.map +1 -0
- package/dist/themes/index.d.cts +18 -0
- package/dist/themes/index.d.ts +18 -0
- package/dist/themes/index.js +2 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/types-Ciu5e5xt.d.cts +159 -0
- package/dist/types-Ciu5e5xt.d.ts +159 -0
- package/dist/veilkit.min.js +393 -0
- package/dist/vue/index.cjs +394 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.cts +366 -0
- package/dist/vue/index.d.ts +366 -0
- package/dist/vue/index.js +394 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +238 -4
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { P as ProgressProps, O as OverlayProps, S as SkeletonProps, d as VeilPrimitiveType, f as PresetProps, c as VeilGlobalConfig, A as AutoMeasureOptions, g as SkeletonController, b as SpinnerProps } from './types-Ciu5e5xt.cjs';
|
|
2
|
+
import { createTheme, getThemeTokens } from './themes/index.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Veilkit - Global Loading Manager
|
|
6
|
+
* Manages concurrent requests using request IDs and counter.
|
|
7
|
+
* Ensures loader remains active until all pending operations finish.
|
|
8
|
+
*/
|
|
9
|
+
type Listener = (isLoading: boolean, count: number) => void;
|
|
10
|
+
declare class LoadingManager {
|
|
11
|
+
private activeIds;
|
|
12
|
+
private counter;
|
|
13
|
+
private listeners;
|
|
14
|
+
/**
|
|
15
|
+
* Start a loading operation. Optionally associate with a unique ID.
|
|
16
|
+
*/
|
|
17
|
+
start(id?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Complete a loading operation by ID or decrement counter.
|
|
20
|
+
*/
|
|
21
|
+
stop(id?: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* True if there is at least one active operation
|
|
24
|
+
*/
|
|
25
|
+
isLoading(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Current number of concurrent operations
|
|
28
|
+
*/
|
|
29
|
+
getCount(): number;
|
|
30
|
+
/**
|
|
31
|
+
* Subscribe to state changes
|
|
32
|
+
*/
|
|
33
|
+
subscribe(listener: Listener): () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Reset all active requests
|
|
36
|
+
*/
|
|
37
|
+
reset(): void;
|
|
38
|
+
private notify;
|
|
39
|
+
}
|
|
40
|
+
declare const loadingManager: LoadingManager;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Veilkit - Progress System
|
|
44
|
+
* Route Progress Bar (NProgress-style with auto-trickle) +
|
|
45
|
+
* Determinate & Indeterminate Linear and Circular Progress components
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
declare class RouteProgressController {
|
|
49
|
+
private el;
|
|
50
|
+
private innerEl;
|
|
51
|
+
private currentProgress;
|
|
52
|
+
private trickleTimer;
|
|
53
|
+
private status;
|
|
54
|
+
private ensureDOM;
|
|
55
|
+
start(): void;
|
|
56
|
+
set(n: number): void;
|
|
57
|
+
inc(amount?: number): void;
|
|
58
|
+
private trickle;
|
|
59
|
+
private stopTrickle;
|
|
60
|
+
done(): void;
|
|
61
|
+
fail(): void;
|
|
62
|
+
}
|
|
63
|
+
declare const progressController: RouteProgressController;
|
|
64
|
+
/**
|
|
65
|
+
* Creates an inline determinate or indeterminate Linear/Circular Progress element
|
|
66
|
+
*/
|
|
67
|
+
declare function createProgressElement(props?: ProgressProps): HTMLElement;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Veilkit - Loading Overlay System
|
|
71
|
+
* Container-level and fullscreen blurred frosted overlays with spinner and message.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
declare class OverlayController {
|
|
75
|
+
/**
|
|
76
|
+
* Shows a loading overlay over a container element or fullscreen
|
|
77
|
+
*/
|
|
78
|
+
show(target?: HTMLElement | string, props?: OverlayProps): HTMLElement;
|
|
79
|
+
/**
|
|
80
|
+
* Hides and removes the overlay
|
|
81
|
+
*/
|
|
82
|
+
hide(target?: HTMLElement | string): void;
|
|
83
|
+
}
|
|
84
|
+
declare const overlayController: OverlayController;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Veilkit - Skeleton Primitives
|
|
88
|
+
* Primitives: line, paragraph, heading, circle, rect, image, button, badge, icon, input, table-row, divider
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Creates a DOM skeleton element with applied styles, classes, and synced timing
|
|
93
|
+
*/
|
|
94
|
+
declare function createSkeletonElement(props?: SkeletonProps): HTMLElement;
|
|
95
|
+
/**
|
|
96
|
+
* Creates multiple lines of text with natural varied widths
|
|
97
|
+
*/
|
|
98
|
+
declare function createSkeletonParagraph(lines?: number, props?: SkeletonProps): HTMLElement;
|
|
99
|
+
/**
|
|
100
|
+
* Creates any primitive by type
|
|
101
|
+
*/
|
|
102
|
+
declare function createPrimitive(type: VeilPrimitiveType, props?: SkeletonProps): HTMLElement;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Veilkit - Presets Engine
|
|
106
|
+
* 18 Ready-Made, Customizable, Responsive Skeleton Layout Presets
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
declare function createPreset(props: PresetProps): HTMLElement;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Veilkit - Request Tracker & Fetch Wrapper
|
|
113
|
+
* Automatic loading state tracking with anti-flicker and error resilience
|
|
114
|
+
*/
|
|
115
|
+
interface TrackOptions {
|
|
116
|
+
id?: string;
|
|
117
|
+
delay?: number;
|
|
118
|
+
minVisible?: number;
|
|
119
|
+
overlay?: boolean;
|
|
120
|
+
target?: HTMLElement | string;
|
|
121
|
+
progress?: boolean;
|
|
122
|
+
onStart?: () => void;
|
|
123
|
+
onFinish?: () => void;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Tracks a Promise or async function, updating loading states automatically
|
|
127
|
+
*/
|
|
128
|
+
declare function track<T>(task: Promise<T> | (() => Promise<T>), options?: TrackOptions): Promise<T>;
|
|
129
|
+
/**
|
|
130
|
+
* Opt-in fetch wrapper that tracks HTTP requests automatically
|
|
131
|
+
* (Never patches global fetch by default)
|
|
132
|
+
*/
|
|
133
|
+
declare function wrapFetch(fetchFn?: typeof fetch, options?: TrackOptions): typeof fetch;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Veilkit - Accessibility & Localization Engine
|
|
137
|
+
* Screen-reader announcements, polite live regions, and WCAG AA compliance
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* Configure active localization language
|
|
141
|
+
*/
|
|
142
|
+
declare function setLocale(locale: string): void;
|
|
143
|
+
/**
|
|
144
|
+
* Get current active locale
|
|
145
|
+
*/
|
|
146
|
+
declare function getLocale(): string;
|
|
147
|
+
/**
|
|
148
|
+
* Register or override accessibility label strings
|
|
149
|
+
*/
|
|
150
|
+
declare function setLabels(labels: Record<string, string>): void;
|
|
151
|
+
/**
|
|
152
|
+
* Resolves a localized label for screen readers
|
|
153
|
+
*/
|
|
154
|
+
declare function getLabel(key: 'loading' | 'loaded' | 'progress' | 'busy' | string): string;
|
|
155
|
+
/**
|
|
156
|
+
* Marks a container element with accessible loading attributes
|
|
157
|
+
*/
|
|
158
|
+
declare function applyA11yLoading(container: HTMLElement, label?: string): HTMLElement;
|
|
159
|
+
/**
|
|
160
|
+
* Clears accessible loading state from container
|
|
161
|
+
*/
|
|
162
|
+
declare function removeA11yLoading(container: HTMLElement): void;
|
|
163
|
+
|
|
164
|
+
declare class VeilkitController {
|
|
165
|
+
private config;
|
|
166
|
+
/**
|
|
167
|
+
* Configure global defaults for themes, animations, anti-flicker, CSP nonce, and a11y
|
|
168
|
+
*/
|
|
169
|
+
configure(config: VeilGlobalConfig): void;
|
|
170
|
+
/**
|
|
171
|
+
* Mounts a skeleton controller onto an element with show/hide/update/destroy methods
|
|
172
|
+
*/
|
|
173
|
+
skeleton(target: HTMLElement | string, options?: SkeletonProps & AutoMeasureOptions): SkeletonController;
|
|
174
|
+
/**
|
|
175
|
+
* Injects a spinner into a target element
|
|
176
|
+
*/
|
|
177
|
+
spinner(target: HTMLElement | string, props?: SpinnerProps): HTMLElement;
|
|
178
|
+
overlay: OverlayController;
|
|
179
|
+
progress: RouteProgressController;
|
|
180
|
+
manager: LoadingManager;
|
|
181
|
+
track: typeof track;
|
|
182
|
+
wrapFetch: typeof wrapFetch;
|
|
183
|
+
setLocale: typeof setLocale;
|
|
184
|
+
setLabels: typeof setLabels;
|
|
185
|
+
createTheme: typeof createTheme;
|
|
186
|
+
getThemeTokens: typeof getThemeTokens;
|
|
187
|
+
createSkeleton: typeof createSkeletonElement;
|
|
188
|
+
createPrimitive: typeof createPrimitive;
|
|
189
|
+
createPreset: typeof createPreset;
|
|
190
|
+
}
|
|
191
|
+
declare const veil: VeilkitController;
|
|
192
|
+
|
|
193
|
+
export { LoadingManager as L, OverlayController as O, RouteProgressController as R, type TrackOptions as T, VeilkitController as V, applyA11yLoading as a, createPrimitive as b, createPreset as c, createProgressElement as d, createSkeletonElement as e, createSkeletonParagraph as f, getLabel as g, getLocale as h, setLocale as i, loadingManager as l, overlayController as o, progressController as p, removeA11yLoading as r, setLabels as s, track as t, veil as v, wrapFetch as w };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { P as ProgressProps, O as OverlayProps, S as SkeletonProps, d as VeilPrimitiveType, f as PresetProps, c as VeilGlobalConfig, A as AutoMeasureOptions, g as SkeletonController, b as SpinnerProps } from './types-Ciu5e5xt.js';
|
|
2
|
+
import { createTheme, getThemeTokens } from './themes/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Veilkit - Global Loading Manager
|
|
6
|
+
* Manages concurrent requests using request IDs and counter.
|
|
7
|
+
* Ensures loader remains active until all pending operations finish.
|
|
8
|
+
*/
|
|
9
|
+
type Listener = (isLoading: boolean, count: number) => void;
|
|
10
|
+
declare class LoadingManager {
|
|
11
|
+
private activeIds;
|
|
12
|
+
private counter;
|
|
13
|
+
private listeners;
|
|
14
|
+
/**
|
|
15
|
+
* Start a loading operation. Optionally associate with a unique ID.
|
|
16
|
+
*/
|
|
17
|
+
start(id?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Complete a loading operation by ID or decrement counter.
|
|
20
|
+
*/
|
|
21
|
+
stop(id?: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* True if there is at least one active operation
|
|
24
|
+
*/
|
|
25
|
+
isLoading(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Current number of concurrent operations
|
|
28
|
+
*/
|
|
29
|
+
getCount(): number;
|
|
30
|
+
/**
|
|
31
|
+
* Subscribe to state changes
|
|
32
|
+
*/
|
|
33
|
+
subscribe(listener: Listener): () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Reset all active requests
|
|
36
|
+
*/
|
|
37
|
+
reset(): void;
|
|
38
|
+
private notify;
|
|
39
|
+
}
|
|
40
|
+
declare const loadingManager: LoadingManager;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Veilkit - Progress System
|
|
44
|
+
* Route Progress Bar (NProgress-style with auto-trickle) +
|
|
45
|
+
* Determinate & Indeterminate Linear and Circular Progress components
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
declare class RouteProgressController {
|
|
49
|
+
private el;
|
|
50
|
+
private innerEl;
|
|
51
|
+
private currentProgress;
|
|
52
|
+
private trickleTimer;
|
|
53
|
+
private status;
|
|
54
|
+
private ensureDOM;
|
|
55
|
+
start(): void;
|
|
56
|
+
set(n: number): void;
|
|
57
|
+
inc(amount?: number): void;
|
|
58
|
+
private trickle;
|
|
59
|
+
private stopTrickle;
|
|
60
|
+
done(): void;
|
|
61
|
+
fail(): void;
|
|
62
|
+
}
|
|
63
|
+
declare const progressController: RouteProgressController;
|
|
64
|
+
/**
|
|
65
|
+
* Creates an inline determinate or indeterminate Linear/Circular Progress element
|
|
66
|
+
*/
|
|
67
|
+
declare function createProgressElement(props?: ProgressProps): HTMLElement;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Veilkit - Loading Overlay System
|
|
71
|
+
* Container-level and fullscreen blurred frosted overlays with spinner and message.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
declare class OverlayController {
|
|
75
|
+
/**
|
|
76
|
+
* Shows a loading overlay over a container element or fullscreen
|
|
77
|
+
*/
|
|
78
|
+
show(target?: HTMLElement | string, props?: OverlayProps): HTMLElement;
|
|
79
|
+
/**
|
|
80
|
+
* Hides and removes the overlay
|
|
81
|
+
*/
|
|
82
|
+
hide(target?: HTMLElement | string): void;
|
|
83
|
+
}
|
|
84
|
+
declare const overlayController: OverlayController;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Veilkit - Skeleton Primitives
|
|
88
|
+
* Primitives: line, paragraph, heading, circle, rect, image, button, badge, icon, input, table-row, divider
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Creates a DOM skeleton element with applied styles, classes, and synced timing
|
|
93
|
+
*/
|
|
94
|
+
declare function createSkeletonElement(props?: SkeletonProps): HTMLElement;
|
|
95
|
+
/**
|
|
96
|
+
* Creates multiple lines of text with natural varied widths
|
|
97
|
+
*/
|
|
98
|
+
declare function createSkeletonParagraph(lines?: number, props?: SkeletonProps): HTMLElement;
|
|
99
|
+
/**
|
|
100
|
+
* Creates any primitive by type
|
|
101
|
+
*/
|
|
102
|
+
declare function createPrimitive(type: VeilPrimitiveType, props?: SkeletonProps): HTMLElement;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Veilkit - Presets Engine
|
|
106
|
+
* 18 Ready-Made, Customizable, Responsive Skeleton Layout Presets
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
declare function createPreset(props: PresetProps): HTMLElement;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Veilkit - Request Tracker & Fetch Wrapper
|
|
113
|
+
* Automatic loading state tracking with anti-flicker and error resilience
|
|
114
|
+
*/
|
|
115
|
+
interface TrackOptions {
|
|
116
|
+
id?: string;
|
|
117
|
+
delay?: number;
|
|
118
|
+
minVisible?: number;
|
|
119
|
+
overlay?: boolean;
|
|
120
|
+
target?: HTMLElement | string;
|
|
121
|
+
progress?: boolean;
|
|
122
|
+
onStart?: () => void;
|
|
123
|
+
onFinish?: () => void;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Tracks a Promise or async function, updating loading states automatically
|
|
127
|
+
*/
|
|
128
|
+
declare function track<T>(task: Promise<T> | (() => Promise<T>), options?: TrackOptions): Promise<T>;
|
|
129
|
+
/**
|
|
130
|
+
* Opt-in fetch wrapper that tracks HTTP requests automatically
|
|
131
|
+
* (Never patches global fetch by default)
|
|
132
|
+
*/
|
|
133
|
+
declare function wrapFetch(fetchFn?: typeof fetch, options?: TrackOptions): typeof fetch;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Veilkit - Accessibility & Localization Engine
|
|
137
|
+
* Screen-reader announcements, polite live regions, and WCAG AA compliance
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* Configure active localization language
|
|
141
|
+
*/
|
|
142
|
+
declare function setLocale(locale: string): void;
|
|
143
|
+
/**
|
|
144
|
+
* Get current active locale
|
|
145
|
+
*/
|
|
146
|
+
declare function getLocale(): string;
|
|
147
|
+
/**
|
|
148
|
+
* Register or override accessibility label strings
|
|
149
|
+
*/
|
|
150
|
+
declare function setLabels(labels: Record<string, string>): void;
|
|
151
|
+
/**
|
|
152
|
+
* Resolves a localized label for screen readers
|
|
153
|
+
*/
|
|
154
|
+
declare function getLabel(key: 'loading' | 'loaded' | 'progress' | 'busy' | string): string;
|
|
155
|
+
/**
|
|
156
|
+
* Marks a container element with accessible loading attributes
|
|
157
|
+
*/
|
|
158
|
+
declare function applyA11yLoading(container: HTMLElement, label?: string): HTMLElement;
|
|
159
|
+
/**
|
|
160
|
+
* Clears accessible loading state from container
|
|
161
|
+
*/
|
|
162
|
+
declare function removeA11yLoading(container: HTMLElement): void;
|
|
163
|
+
|
|
164
|
+
declare class VeilkitController {
|
|
165
|
+
private config;
|
|
166
|
+
/**
|
|
167
|
+
* Configure global defaults for themes, animations, anti-flicker, CSP nonce, and a11y
|
|
168
|
+
*/
|
|
169
|
+
configure(config: VeilGlobalConfig): void;
|
|
170
|
+
/**
|
|
171
|
+
* Mounts a skeleton controller onto an element with show/hide/update/destroy methods
|
|
172
|
+
*/
|
|
173
|
+
skeleton(target: HTMLElement | string, options?: SkeletonProps & AutoMeasureOptions): SkeletonController;
|
|
174
|
+
/**
|
|
175
|
+
* Injects a spinner into a target element
|
|
176
|
+
*/
|
|
177
|
+
spinner(target: HTMLElement | string, props?: SpinnerProps): HTMLElement;
|
|
178
|
+
overlay: OverlayController;
|
|
179
|
+
progress: RouteProgressController;
|
|
180
|
+
manager: LoadingManager;
|
|
181
|
+
track: typeof track;
|
|
182
|
+
wrapFetch: typeof wrapFetch;
|
|
183
|
+
setLocale: typeof setLocale;
|
|
184
|
+
setLabels: typeof setLabels;
|
|
185
|
+
createTheme: typeof createTheme;
|
|
186
|
+
getThemeTokens: typeof getThemeTokens;
|
|
187
|
+
createSkeleton: typeof createSkeletonElement;
|
|
188
|
+
createPrimitive: typeof createPrimitive;
|
|
189
|
+
createPreset: typeof createPreset;
|
|
190
|
+
}
|
|
191
|
+
declare const veil: VeilkitController;
|
|
192
|
+
|
|
193
|
+
export { LoadingManager as L, OverlayController as O, RouteProgressController as R, type TrackOptions as T, VeilkitController as V, applyA11yLoading as a, createPrimitive as b, createPreset as c, createProgressElement as d, createSkeletonElement as e, createSkeletonParagraph as f, getLabel as g, getLocale as h, setLocale as i, loadingManager as l, overlayController as o, progressController as p, removeA11yLoading as r, setLabels as s, track as t, veil as v, wrapFetch as w };
|