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.
Files changed (64) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +21 -0
  3. package/README.md +245 -2
  4. package/dist/angular/index.cjs +394 -0
  5. package/dist/angular/index.cjs.map +1 -0
  6. package/dist/angular/index.d.cts +78 -0
  7. package/dist/angular/index.d.ts +78 -0
  8. package/dist/angular/index.js +394 -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-5OzP0U8X.d.cts +193 -0
  17. package/dist/controller-Co5bvnaB.d.ts +193 -0
  18. package/dist/element/index.cjs +395 -0
  19. package/dist/element/index.cjs.map +1 -0
  20. package/dist/element/index.d.cts +42 -0
  21. package/dist/element/index.d.ts +42 -0
  22. package/dist/element/index.js +395 -0
  23. package/dist/element/index.js.map +1 -0
  24. package/dist/index.cjs +394 -0
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +209 -0
  27. package/dist/index.d.ts +209 -0
  28. package/dist/index.js +394 -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 +48 -0
  33. package/dist/native/index.d.ts +48 -0
  34. package/dist/native/index.js +2 -0
  35. package/dist/native/index.js.map +1 -0
  36. package/dist/react/index.cjs +394 -0
  37. package/dist/react/index.cjs.map +1 -0
  38. package/dist/react/index.d.cts +99 -0
  39. package/dist/react/index.d.ts +99 -0
  40. package/dist/react/index.js +394 -0
  41. package/dist/react/index.js.map +1 -0
  42. package/dist/styles.css +377 -0
  43. package/dist/svelte/index.cjs +394 -0
  44. package/dist/svelte/index.cjs.map +1 -0
  45. package/dist/svelte/index.d.cts +41 -0
  46. package/dist/svelte/index.d.ts +41 -0
  47. package/dist/svelte/index.js +394 -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-Ciu5e5xt.d.cts +159 -0
  56. package/dist/types-Ciu5e5xt.d.ts +159 -0
  57. package/dist/veilkit.min.js +393 -0
  58. package/dist/vue/index.cjs +394 -0
  59. package/dist/vue/index.cjs.map +1 -0
  60. package/dist/vue/index.d.cts +366 -0
  61. package/dist/vue/index.d.ts +366 -0
  62. package/dist/vue/index.js +394 -0
  63. package/dist/vue/index.js.map +1 -0
  64. package/package.json +238 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ All notable changes to `veilkit` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-11-07
9
+
10
+ ### Added
11
+ - Core loading and skeleton engine with zero runtime dependencies.
12
+ - Synced animation timeline for all shimmers via global clock.
13
+ - 12 animations: `shimmer`, `wave`, `pulse`, `blink`, `breathe`, `glass-shine`, `gradient-flow`, `aurora`, `scan-line`, `sparkle`, `neon-glow`, `stagger`.
14
+ - 11 built-in themes: `light`, `dark`, `auto`, `glass`, `ios`, `material`, `minimal`, `mono`, `neon`, `sunset`, `ocean`, and `createTheme` factory.
15
+ - 12 spinner types: `ring`, `dual-ring`, `dots`, `bars`, `pulse`, `orbit`, `wave`, `bounce`, `ios-activity`, `glass-orb`, `morph`, `progress-circle`.
16
+ - Route progress and linear/circular determinate/indeterminate progress loaders.
17
+ - Anti-flicker timing controller (`delay` & `minVisible`).
18
+ - Auto-measure DOM skeleton generator with `ResizeObserver` and cached layouts.
19
+ - Reveal transitions: `fade`, `blur-in`, `slide-up`, `scale`, `stagger-children`.
20
+ - Overlay with backdrop blur and container/fullscreen mounting.
21
+ - LoadingButton and LazyImage with blur-up placeholder.
22
+ - Multi-framework adapters:
23
+ - React & Next.js (`veilkit/react`) with Suspense, App Router & Pages Router support.
24
+ - Vue 3 & Nuxt (`veilkit/vue`) with composables, plugin, directive `v-veil`.
25
+ - Svelte 5 & SvelteKit (`veilkit/svelte`) with runes, action `use:veil`.
26
+ - Angular (`veilkit/angular`) standalone components, directive, and `VeilService`.
27
+ - Web Components (`veilkit/element`) custom elements.
28
+ - React Native & Expo (`veilkit/native`) with Reanimated and Animated fallbacks.
29
+ - Standalone CLI `veilkit capture` for pre-rendering static `.veil.json` layout maps.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Veilkit Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,246 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # ✦ veilkit
4
+
5
+ **Every loading state, beautifully. One package, every framework.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/veilkit?color=38bdf8&style=flat-square)](https://www.npmjs.com/package/veilkit)
8
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/veilkit?color=10b981&label=gzip%20size&style=flat-square)](https://bundlephobia.com/package/veilkit)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-blue?style=flat-square)](https://www.typescriptlang.org/)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
11
+
12
+ A production-grade, zero-dependency loading & skeleton UI toolkit for every web and mobile framework.
13
+ Pure GPU-accelerated motion (`transform` & `opacity`), synchronized timeline clocks, anti-flicker timing,
14
+ auto-measure DOM wrapping, 12 spinners, route progress, and glassmorphic design themes.
15
+
16
+ [**Documentation & Live Playground →**](https://veilkit.dev)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## ⚡️ Key Features
23
+
24
+ - **Zero Runtime Dependencies**: The core package has 0 dependencies. Frameworks are declared as optional peer dependencies.
25
+ - **Synchronized Global Timeline**: All shimmer skeletons across an entire page share a synced clock phase via negative CSS `animation-delay` offsets. No phase-jitter when elements mount at different times.
26
+ - **Zero Layout Thrashing**: Animations strictly use `transform` and `opacity` for 60fps GPU execution.
27
+ - **12 Animations**: `shimmer`, `wave`, `pulse`, `blink`, `breathe`, `glass-shine`, `gradient-flow`, `aurora`, `scan-line`, `sparkle`, `neon-glow`, `stagger`.
28
+ - **11 Built-in Themes**: `light`, `dark`, `auto`, `glass`, `ios`, `material`, `minimal`, `mono`, `neon`, `sunset`, `ocean`, plus `createTheme()` for custom tokens.
29
+ - **18 Ready-Made Presets**: Responsive layouts for `card`, `product-card`, `product-grid`, `feed-post`, `article`, `dashboard`, `profile`, `form`, `table`, `chat`, and more.
30
+ - **12 Spinner Types**: `ring`, `dual-ring`, `dots`, `bars`, `pulse`, `orbit`, `wave`, `bounce`, `ios-activity`, `glass-orb`, `morph`, `progress-circle`.
31
+ - **Auto-Measure Skeleton**: Wrap real markup with `<Veil loading>` or `v-veil="loading"` to measure layout leaf elements with zero hydration mismatches.
32
+ - **Anti-Flicker Controller**: Built-in `delay` (150ms default) and `minVisible` (300ms default) eliminates brief jarring flashes on fast network requests.
33
+ - **Universal Adapters**:
34
+ - React & Next.js (`veilkit/react`)
35
+ - Vue 3 & Nuxt (`veilkit/vue`)
36
+ - Svelte 4/5 & SvelteKit (`veilkit/svelte`)
37
+ - Angular Standalone (`veilkit/angular`)
38
+ - Web Components (`veilkit/element`) for Solid, Qwik, HTMX, Astro, Blade, HTML
39
+ - React Native & Expo (`veilkit/native`)
40
+ - Electron & Desktop
41
+
42
+ ---
43
+
44
+ ## 📦 Installation
45
+
46
+ ```bash
47
+ # npm
48
+ npm install veilkit
49
+
50
+ # pnpm
51
+ pnpm add veilkit
52
+
53
+ # yarn
54
+ yarn add veilkit
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 🚀 1-Minute Quick Start
60
+
61
+ ### 1. React & Next.js (`veilkit/react`)
62
+
63
+ ```tsx
64
+ import 'veilkit/styles.css';
65
+ import { Skeleton, SkeletonPreset, Veil, Spinner, LoadingButton } from 'veilkit/react';
66
+
67
+ export default function App() {
68
+ const [loading, setLoading] = useState(true);
69
+
70
+ return (
71
+ <>
72
+ {/* Ready-made card preset */}
73
+ <SkeletonPreset name="product-card" animation="shimmer" theme="glass" />
74
+
75
+ {/* Auto-measure wrapper around real content */}
76
+ <Veil loading={loading} reveal="fade">
77
+ <UserProfileCard user={data} />
78
+ </Veil>
79
+
80
+ {/* Inline Loading Button */}
81
+ <LoadingButton loading={loading} loadingText="Saving…">
82
+ Save Changes
83
+ </LoadingButton>
84
+ </>
85
+ );
86
+ }
87
+ ```
88
+
89
+ ### 2. Vue 3 & Nuxt (`veilkit/vue`)
90
+
91
+ ```vue
92
+ <script setup>
93
+ import 'veilkit/styles.css';
94
+ import { ref } from 'vue';
95
+ import { VSkeleton, VSpinner, vVeil } from 'veilkit/vue';
96
+
97
+ const loading = ref(true);
98
+ </script>
99
+
100
+ <template>
101
+ <!-- Auto-measure directive -->
102
+ <div v-veil="loading" class="card">
103
+ <h2>User Profile</h2>
104
+ <p>Bio details and account settings</p>
105
+ </div>
106
+
107
+ <VSkeleton circle width="48px" height="48px" animation="aurora" />
108
+ <VSpinner type="ios-activity" size="32px" />
109
+ </template>
110
+ ```
111
+
112
+ ### 3. Svelte & SvelteKit (`veilkit/svelte`)
113
+
114
+ ```svelte
115
+ <script>
116
+ import 'veilkit/styles.css';
117
+ import { veil } from 'veilkit/svelte';
118
+
119
+ export let loading = true;
120
+ </script>
121
+
122
+ <!-- Auto-measure action -->
123
+ <div use:veil={{ loading, reveal: 'fade' }}>
124
+ <article>
125
+ <h1>Blog Article</h1>
126
+ <p>Full article paragraph content…</p>
127
+ </article>
128
+ </div>
129
+ ```
130
+
131
+ ### 4. Angular Standalone (`veilkit/angular`)
132
+
133
+ ```typescript
134
+ import { Component } from '@angular/core';
135
+ import { VeilDirective, VeilSkeletonComponent, VeilSpinnerComponent } from 'veilkit/angular';
136
+ import 'veilkit/styles.css';
137
+
138
+ @Component({
139
+ standalone: true,
140
+ imports: [VeilDirective, VeilSkeletonComponent, VeilSpinnerComponent],
141
+ template: `
142
+ <div [veil]="loading">
143
+ <h2>Server Data</h2>
144
+ </div>
145
+ <veil-skeleton type="heading" width="220px" animation="wave"></veil-skeleton>
146
+ <veil-spinner type="glass-orb"></veil-spinner>
147
+ `,
148
+ })
149
+ export class AppComponent {
150
+ loading = true;
151
+ }
152
+ ```
153
+
154
+ ### 5. Web Components (Solid, Qwik, HTMX, HTML)
155
+
156
+ ```html
157
+ <link rel="stylesheet" href="https://unpkg.com/veilkit/dist/styles.css" />
158
+ <script type="module" src="https://unpkg.com/veilkit/dist/element/index.js"></script>
159
+
160
+ <!-- Custom Elements -->
161
+ <veil-skeleton type="circle" width="48px" height="48px" animation="aurora"></veil-skeleton>
162
+ <veil-skeleton type="heading" width="200px" animation="shimmer"></veil-skeleton>
163
+ <veil-spinner type="orbit" size="32px" color="#38bdf8"></veil-spinner>
164
+ ```
165
+
166
+ ### 6. React Native & Expo (`veilkit/native`)
167
+
168
+ ```tsx
169
+ import { Skeleton, SkeletonGroup, LoadingButton, ProgressBar } from 'veilkit/native';
170
+
171
+ export default function MobileCard() {
172
+ return (
173
+ <SkeletonGroup>
174
+ <Skeleton height={160} radius={10} theme="auto" />
175
+ <Skeleton height={20} width="75%" radius={4} style={{ marginTop: 12 }} />
176
+ <Skeleton height={14} width="45%" radius={4} style={{ marginTop: 8 }} />
177
+ </SkeletonGroup>
178
+ );
179
+ }
180
+ ```
181
+
182
+ ### 7. Vanilla JS & CDN
183
+
184
+ ```html
185
+ <link rel="stylesheet" href="https://unpkg.com/veilkit/dist/styles.css" />
186
+ <script src="https://unpkg.com/veilkit/dist/veilkit.min.js"></script>
187
+ <script>
188
+ // Mount skeleton controller onto any element
189
+ const controller = Veilkit.skeleton('#my-container', { animation: 'wave' });
190
+
191
+ // Route progress bar
192
+ Veilkit.progress.start();
193
+ setTimeout(() => Veilkit.progress.done(), 800);
194
+
195
+ // Auto-track async promises
196
+ Veilkit.track(fetch('/api/user'), { overlay: true });
197
+ </script>
198
+ ```
199
+
200
+ ---
201
+
202
+ ## 🎨 Theme Tokens
203
+
204
+ Customize styling seamlessly via CSS variables:
205
+
206
+ ```css
207
+ :root {
208
+ --veil-base: #e5e7eb;
209
+ --veil-highlight: rgba(255, 255, 255, 0.7);
210
+ --veil-radius: 8px;
211
+ --veil-duration: 1.5s;
212
+ --veil-easing: cubic-bezier(0.4, 0, 0.2, 1);
213
+ --veil-border: none;
214
+ --veil-blur: 12px;
215
+ }
216
+ ```
217
+
218
+ Or create custom branded themes with JavaScript/TypeScript:
219
+
220
+ ```ts
221
+ import { createTheme } from 'veilkit';
222
+
223
+ createTheme({
224
+ name: 'cyberpunk',
225
+ base: '#0c0a18',
226
+ highlight: 'rgba(0, 240, 255, 0.6)',
227
+ radius: '8px',
228
+ border: '1px solid rgba(0, 240, 255, 0.3)',
229
+ });
230
+ ```
231
+
232
+ ---
233
+
234
+ ## ♿️ Accessibility (a11y)
235
+
236
+ - All loading containers automatically set `aria-busy="true"`.
237
+ - Skeletons are hidden from assistive technology with `aria-hidden="true"`.
238
+ - Polite live regions (`role="status"`, `aria-live="polite"`) announce content loading states in multiple languages (EN, ES, FR, DE, JA, ZH, AR) with customizable overrides.
239
+ - Respects `prefers-reduced-motion: reduce` by replacing translations with a calm opacity cycle.
240
+ - Complies with `forced-colors: active` high-contrast system palettes.
241
+
242
+ ---
243
+
244
+ ## 📄 License
245
+
246
+ MIT © 2026 [Veilkit Contributors](https://github.com/veilkit/veilkit)