loading-state-zoo 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/README.md +588 -0
- package/dist/index.cjs +291 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +90 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.js +291 -0
- package/dist/index.js.map +1 -0
- package/dist/react.cjs +291 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +276 -0
- package/dist/react.d.ts +276 -0
- package/dist/react.js +291 -0
- package/dist/react.js.map +1 -0
- package/dist/theme.css +525 -0
- package/docs/AI.md +69 -0
- package/docs/components.json +533 -0
- package/package.json +67 -0
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$comment": "loading-state-zoo v0.1.0 — machine-readable spec. Source of truth for all 17 components. Defaults match the rendered site.",
|
|
4
|
+
"package": {
|
|
5
|
+
"name": "loading-state-zoo",
|
|
6
|
+
"entrypoints": {
|
|
7
|
+
"webComponents": "loading-state-zoo",
|
|
8
|
+
"react": "loading-state-zoo/react",
|
|
9
|
+
"css": "loading-state-zoo/theme.css"
|
|
10
|
+
},
|
|
11
|
+
"autoRegistersOnImport": true,
|
|
12
|
+
"ssrSafe": true,
|
|
13
|
+
"collectsData": false,
|
|
14
|
+
"license": "MIT"
|
|
15
|
+
},
|
|
16
|
+
"commonAttributes": [
|
|
17
|
+
{
|
|
18
|
+
"name": "size",
|
|
19
|
+
"reactProp": "size",
|
|
20
|
+
"type": "number",
|
|
21
|
+
"unit": "px",
|
|
22
|
+
"meaning": "Primary dimension. For dots = dot diameter; for spinners/shapes = bounding box; for equalizer = bar height.",
|
|
23
|
+
"default": "pattern-specific"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "color",
|
|
27
|
+
"reactProp": "color",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"unit": "css color",
|
|
30
|
+
"meaning": "Main foreground color",
|
|
31
|
+
"default": "#f5f5f7"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "accent",
|
|
35
|
+
"reactProp": "accent",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"unit": "css color",
|
|
38
|
+
"meaning": "Accent/brand color",
|
|
39
|
+
"default": "#0a84ff"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "speed",
|
|
43
|
+
"reactProp": "speed",
|
|
44
|
+
"type": "number",
|
|
45
|
+
"unit": "multiplier",
|
|
46
|
+
"meaning": "Animation speed multiplier applied to durations via calc()",
|
|
47
|
+
"default": "1"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "width",
|
|
51
|
+
"reactProp": "width",
|
|
52
|
+
"type": "number",
|
|
53
|
+
"unit": "px",
|
|
54
|
+
"meaning": "Element width (bars and skeletons)",
|
|
55
|
+
"default": "pattern-specific"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "height",
|
|
59
|
+
"reactProp": "height",
|
|
60
|
+
"type": "number",
|
|
61
|
+
"unit": "px",
|
|
62
|
+
"meaning": "Element height (bars and skeletons)",
|
|
63
|
+
"default": "pattern-specific"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"sharedCssVariables": [
|
|
67
|
+
{ "name": "--lz-color", "default": "#f5f5f7", "purpose": "Foreground color on all patterns" },
|
|
68
|
+
{ "name": "--lz-accent", "default": "#0a84ff", "purpose": "Accent color on accent-using patterns" },
|
|
69
|
+
{ "name": "--lz-speed", "default": "1", "purpose": "Duration multiplier" },
|
|
70
|
+
{ "name": "--lz-surface", "default": "#1c1c1e", "purpose": "Track / skeleton background" },
|
|
71
|
+
{ "name": "--lz-stroke", "default": "4px", "purpose": "Ring stroke width" },
|
|
72
|
+
{ "name": "--lz-track", "default": "rgba(255,255,255,0.15)", "purpose": "Ring track / scan border color" }
|
|
73
|
+
],
|
|
74
|
+
"components": [
|
|
75
|
+
{
|
|
76
|
+
"id": "bouncing-dots",
|
|
77
|
+
"tag": "lz-bouncing-dots",
|
|
78
|
+
"reactComponent": "BouncingDots",
|
|
79
|
+
"category": "Dots",
|
|
80
|
+
"role": "status",
|
|
81
|
+
"description": "Three round dots that hop up and down with a stagger.",
|
|
82
|
+
"useCases": ["loading a feed", "small section refresh"],
|
|
83
|
+
"defaults": { "size": 8, "color": "#f5f5f7", "speed": 1 },
|
|
84
|
+
"attributes": [
|
|
85
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 8 },
|
|
86
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
87
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
88
|
+
],
|
|
89
|
+
"cssVars": [
|
|
90
|
+
{ "name": "--lz-size", "default": "8px", "purpose": "Dot diameter" },
|
|
91
|
+
{ "name": "--lz-color", "default": "#f5f5f7", "purpose": "Dot color" }
|
|
92
|
+
],
|
|
93
|
+
"keyframeVars": [
|
|
94
|
+
{ "name": "--lz-bounce", "default": "-10px", "purpose": "Dot hop height" }
|
|
95
|
+
],
|
|
96
|
+
"examples": {
|
|
97
|
+
"html": "<lz-bouncing-dots size=\"12\" color=\"#0a84ff\"></lz-bouncing-dots>",
|
|
98
|
+
"react": "<BouncingDots size={12} color=\"#0a84ff\" />"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "typing-dots",
|
|
103
|
+
"tag": "lz-typing-dots",
|
|
104
|
+
"reactComponent": "TypingDots",
|
|
105
|
+
"category": "Dots",
|
|
106
|
+
"role": "status",
|
|
107
|
+
"description": "Three dots pulsing in a typing rhythm.",
|
|
108
|
+
"useCases": ["chat", "messaging", "typing indicator"],
|
|
109
|
+
"defaults": { "size": 8, "color": "#f5f5f7", "speed": 1 },
|
|
110
|
+
"attributes": [
|
|
111
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 8 },
|
|
112
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
113
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
114
|
+
],
|
|
115
|
+
"cssVars": [{ "name": "--lz-size", "default": "8px", "purpose": "Dot diameter" }],
|
|
116
|
+
"keyframeVars": [
|
|
117
|
+
{ "name": "--lz-typing-min", "default": "0.35", "purpose": "Resting dot scale" },
|
|
118
|
+
{ "name": "--lz-typing-peak", "default": "1.15", "purpose": "Peak dot scale" }
|
|
119
|
+
],
|
|
120
|
+
"examples": {
|
|
121
|
+
"html": "<lz-typing-dots></lz-typing-dots>",
|
|
122
|
+
"react": "<TypingDots />"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "wave-dots",
|
|
127
|
+
"tag": "lz-wave-dots",
|
|
128
|
+
"reactComponent": "WaveDots",
|
|
129
|
+
"category": "Dots",
|
|
130
|
+
"role": "status",
|
|
131
|
+
"description": "Four dots swelling across like a wave.",
|
|
132
|
+
"useCases": ["refresh", "sync in progress"],
|
|
133
|
+
"defaults": { "size": 8, "color": "#f5f5f7", "speed": 1 },
|
|
134
|
+
"attributes": [
|
|
135
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 8 },
|
|
136
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
137
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
138
|
+
],
|
|
139
|
+
"cssVars": [{ "name": "--lz-size", "default": "8px", "purpose": "Dot diameter" }],
|
|
140
|
+
"keyframeVars": [
|
|
141
|
+
{ "name": "--lz-wave-min", "default": "0.35", "purpose": "Resting dot scale" },
|
|
142
|
+
{ "name": "--lz-wave-peak", "default": "1.1", "purpose": "Peak dot scale" }
|
|
143
|
+
],
|
|
144
|
+
"examples": {
|
|
145
|
+
"html": "<lz-wave-dots></lz-wave-dots>",
|
|
146
|
+
"react": "<WaveDots />"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "helix-dots",
|
|
151
|
+
"tag": "lz-helix-dots",
|
|
152
|
+
"reactComponent": "HelixDots",
|
|
153
|
+
"category": "Dots",
|
|
154
|
+
"role": "status",
|
|
155
|
+
"description": "A row of dots bobbing like a travelling wave (helix).",
|
|
156
|
+
"useCases": ["data processing", "playful waits"],
|
|
157
|
+
"defaults": { "size": 6, "count": 10, "color": "#f5f5f7", "speed": 1 },
|
|
158
|
+
"attributes": [
|
|
159
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 6 },
|
|
160
|
+
{ "name": "count", "reactProp": "count", "type": "number", "unit": "dots", "default": 10 },
|
|
161
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
162
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
163
|
+
],
|
|
164
|
+
"cssVars": [{ "name": "--lz-size", "default": "6px", "purpose": "Dot diameter" }],
|
|
165
|
+
"keyframeVars": [
|
|
166
|
+
{ "name": "--lz-helix", "default": "-12px", "purpose": "Dot bob distance" }
|
|
167
|
+
],
|
|
168
|
+
"examples": {
|
|
169
|
+
"html": "<lz-helix-dots count=\"14\"></lz-helix-dots>",
|
|
170
|
+
"react": "<HelixDots count={14} />"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "dot-grid-wave",
|
|
175
|
+
"tag": "lz-dot-grid-wave",
|
|
176
|
+
"reactComponent": "DotGridWave",
|
|
177
|
+
"category": "Dots",
|
|
178
|
+
"role": "status",
|
|
179
|
+
"description": "A grid of dots rippling outward from the top-left corner.",
|
|
180
|
+
"useCases": ["dashboards", "brick layouts", "empty panels"],
|
|
181
|
+
"defaults": { "size": 6, "rows": 4, "cols": 5, "gap": 12, "color": "#f5f5f7", "speed": 1 },
|
|
182
|
+
"attributes": [
|
|
183
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 6 },
|
|
184
|
+
{ "name": "rows", "reactProp": "rows", "type": "number", "unit": "rows", "default": 4 },
|
|
185
|
+
{ "name": "cols", "reactProp": "cols", "type": "number", "unit": "cols", "default": 5 },
|
|
186
|
+
{ "name": "gap", "reactProp": "gap", "type": "number", "unit": "px", "default": 12 },
|
|
187
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
188
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
189
|
+
],
|
|
190
|
+
"cssVars": [
|
|
191
|
+
{ "name": "--lz-size", "default": "6px", "purpose": "Dot diameter" },
|
|
192
|
+
{ "name": "--lz-cols", "default": "5", "purpose": "Grid column count" },
|
|
193
|
+
{ "name": "--lz-grid-gap", "default": "12px", "purpose": "Grid gap" }
|
|
194
|
+
],
|
|
195
|
+
"keyframeVars": [
|
|
196
|
+
{ "name": "--lz-grid-min", "default": "0.3", "purpose": "Resting dot scale" },
|
|
197
|
+
{ "name": "--lz-grid-fade", "default": "0.15", "purpose": "Resting dot opacity" }
|
|
198
|
+
],
|
|
199
|
+
"examples": {
|
|
200
|
+
"html": "<lz-dot-grid-wave rows=\"4\" cols=\"6\" size=\"8\" gap=\"14\"></lz-dot-grid-wave>",
|
|
201
|
+
"react": "<DotGridWave rows={4} cols={6} size={8} gap={14} />"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": "arc-spinner",
|
|
206
|
+
"tag": "lz-arc-spinner",
|
|
207
|
+
"reactComponent": "ArcSpinner",
|
|
208
|
+
"category": "Spinners",
|
|
209
|
+
"role": "status",
|
|
210
|
+
"description": "One spinning arc ring (classic circular loader).",
|
|
211
|
+
"useCases": ["any circular wait"],
|
|
212
|
+
"defaults": { "size": 44, "strokeWidth": 4, "color": "#f5f5f7", "speed": 1 },
|
|
213
|
+
"attributes": [
|
|
214
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
215
|
+
{ "name": "stroke-width", "reactProp": "strokeWidth", "type": "number", "unit": "px", "default": 4 },
|
|
216
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
217
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
218
|
+
],
|
|
219
|
+
"cssVars": [
|
|
220
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Ring box size" },
|
|
221
|
+
{ "name": "--lz-stroke", "default": "4px", "purpose": "Ring thickness" }
|
|
222
|
+
],
|
|
223
|
+
"keyframeVars": [],
|
|
224
|
+
"examples": {
|
|
225
|
+
"html": "<lz-arc-spinner size=\"64\" stroke-width=\"6\" color=\"#0a84ff\"></lz-arc-spinner>",
|
|
226
|
+
"react": "<ArcSpinner size={64} strokeWidth={6} color=\"#0a84ff\" />"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "material-double-arc",
|
|
231
|
+
"tag": "lz-material-double-arc",
|
|
232
|
+
"reactComponent": "MaterialDoubleArc",
|
|
233
|
+
"category": "Spinners",
|
|
234
|
+
"role": "status",
|
|
235
|
+
"description": "Two arcs spinning in opposite directions (Material look).",
|
|
236
|
+
"useCases": ["android-style apps", "processing"],
|
|
237
|
+
"defaults": { "size": 44, "strokeWidth": 4, "color": "#f5f5f7", "speed": 1 },
|
|
238
|
+
"attributes": [
|
|
239
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
240
|
+
{ "name": "stroke-width", "reactProp": "strokeWidth", "type": "number", "unit": "px", "default": 4 },
|
|
241
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
242
|
+
{ "name": "color-weak", "reactProp": "colorWeak", "type": "string", "default": "95% tint of color" },
|
|
243
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
244
|
+
],
|
|
245
|
+
"cssVars": [
|
|
246
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Ring box size" },
|
|
247
|
+
{ "name": "--lz-stroke", "default": "4px", "purpose": "Ring thickness" },
|
|
248
|
+
{ "name": "--lz-color-weak", "default": "color-mix(color 95%, transparent)", "purpose": "Arc tint" }
|
|
249
|
+
],
|
|
250
|
+
"keyframeVars": [],
|
|
251
|
+
"examples": {
|
|
252
|
+
"html": "<lz-material-double-arc size=\"56\" stroke-width=\"5\"></lz-material-double-arc>",
|
|
253
|
+
"react": "<MaterialDoubleArc size={56} strokeWidth={5} />"
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"id": "scan-sweep",
|
|
258
|
+
"tag": "lz-scan-sweep",
|
|
259
|
+
"reactComponent": "ScanSweep",
|
|
260
|
+
"category": "Spinners",
|
|
261
|
+
"role": "status",
|
|
262
|
+
"description": "Concentric rings with a sweeping radar beam.",
|
|
263
|
+
"useCases": ["scanning", "searching", "syncing"],
|
|
264
|
+
"defaults": { "size": 44, "color": "#f5f5f7", "speed": 1 },
|
|
265
|
+
"attributes": [
|
|
266
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
267
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
268
|
+
{ "name": "color-weak", "reactProp": "colorWeak", "type": "string", "default": "80% tint of color" },
|
|
269
|
+
{ "name": "color-sweep", "reactProp": "colorSweep", "type": "string", "default": "8% tint of color" },
|
|
270
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
271
|
+
],
|
|
272
|
+
"cssVars": [
|
|
273
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Ring box size" },
|
|
274
|
+
{ "name": "--lz-track", "default": "rgba(255,255,255,0.12)", "purpose": "Outer ring border" },
|
|
275
|
+
{ "name": "--lz-track-weak", "default": "rgba(255,255,255,0.08)", "purpose": "Inner ring border" },
|
|
276
|
+
{ "name": "--lz-color-weak", "default": "80% tint", "purpose": "Center dot color" },
|
|
277
|
+
{ "name": "--lz-color-sweep", "default": "8% tint", "purpose": "Beam tail color" }
|
|
278
|
+
],
|
|
279
|
+
"keyframeVars": [],
|
|
280
|
+
"examples": {
|
|
281
|
+
"html": "<lz-scan-sweep size=\"64\" color=\"#30d158\"></lz-scan-sweep>",
|
|
282
|
+
"react": "<ScanSweep size={64} color=\"#30d158\" />"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"id": "orbit-dots",
|
|
287
|
+
"tag": "lz-orbit-dots",
|
|
288
|
+
"reactComponent": "OrbitDots",
|
|
289
|
+
"category": "Spinners",
|
|
290
|
+
"role": "status",
|
|
291
|
+
"description": "Three dots gliding around an invisible circle.",
|
|
292
|
+
"useCases": ["light floaty waits"],
|
|
293
|
+
"defaults": { "size": 44, "color": "#f5f5f7", "speed": 1 },
|
|
294
|
+
"attributes": [
|
|
295
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
296
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
297
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
298
|
+
],
|
|
299
|
+
"cssVars": [
|
|
300
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Orbit box size" },
|
|
301
|
+
{ "name": "--lz-color-weak", "default": "90% tint", "purpose": "Dot color" }
|
|
302
|
+
],
|
|
303
|
+
"keyframeVars": [],
|
|
304
|
+
"examples": {
|
|
305
|
+
"html": "<lz-orbit-dots size=\"56\" color=\"#0a84ff\"></lz-orbit-dots>",
|
|
306
|
+
"react": "<OrbitDots size={56} color=\"#0a84ff\" />"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"id": "orbit-ring-dots",
|
|
311
|
+
"tag": "lz-orbit-ring-dots",
|
|
312
|
+
"reactComponent": "OrbitRingDots",
|
|
313
|
+
"category": "Spinners",
|
|
314
|
+
"role": "status",
|
|
315
|
+
"description": "Eight dots around a ring chasing each other with fading opacity.",
|
|
316
|
+
"useCases": ["elegant circular waits", "brand moments"],
|
|
317
|
+
"defaults": { "size": 44, "dotSize": 7.92, "color": "#f5f5f7", "speed": 1 },
|
|
318
|
+
"attributes": [
|
|
319
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
320
|
+
{ "name": "dot-size", "reactProp": "dotSize", "type": "number", "unit": "px", "default": "0.18 x size" },
|
|
321
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
322
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
323
|
+
],
|
|
324
|
+
"cssVars": [
|
|
325
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Ring box size" },
|
|
326
|
+
{ "name": "--lz-dot-size", "default": "0.18em", "purpose": "Dot size (relative or px)" }
|
|
327
|
+
],
|
|
328
|
+
"keyframeVars": [
|
|
329
|
+
{ "name": "--lz-orbit-fade", "default": "0.12", "purpose": "Resting dot opacity" }
|
|
330
|
+
],
|
|
331
|
+
"examples": {
|
|
332
|
+
"html": "<lz-orbit-ring-dots size=\"56\" dot-size=\"10\"></lz-orbit-ring-dots>",
|
|
333
|
+
"react": "<OrbitRingDots size={56} dotSize={10} />"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"id": "eyes",
|
|
338
|
+
"tag": "lz-eyes",
|
|
339
|
+
"reactComponent": "Eyes",
|
|
340
|
+
"category": "Shapes",
|
|
341
|
+
"role": "status",
|
|
342
|
+
"description": "Two cartoon eyes that look side to side and blink.",
|
|
343
|
+
"useCases": ["fun apps", "kids' stuff", "watching moments"],
|
|
344
|
+
"defaults": { "size": 44, "color": "#f5f5f7", "speed": 1 },
|
|
345
|
+
"attributes": [
|
|
346
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
347
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
348
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
349
|
+
],
|
|
350
|
+
"cssVars": [
|
|
351
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Eye group size" },
|
|
352
|
+
{ "name": "--lz-pupil", "default": "rgba(0,0,0,0.85)", "purpose": "Pupil color" }
|
|
353
|
+
],
|
|
354
|
+
"keyframeVars": [
|
|
355
|
+
{ "name": "--lz-gaze-from", "default": "-3px", "purpose": "Pupil start offset" },
|
|
356
|
+
{ "name": "--lz-gaze-to", "default": "3px", "purpose": "Pupil end offset" },
|
|
357
|
+
{ "name": "--lz-blink", "default": "0.08", "purpose": "Blink closure scale" }
|
|
358
|
+
],
|
|
359
|
+
"examples": {
|
|
360
|
+
"html": "<lz-eyes size=\"56\"></lz-eyes>",
|
|
361
|
+
"react": "<Eyes size={56} />"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"id": "morphing-square",
|
|
366
|
+
"tag": "lz-morphing-square",
|
|
367
|
+
"reactComponent": "MorphingSquare",
|
|
368
|
+
"category": "Shapes",
|
|
369
|
+
"role": "status",
|
|
370
|
+
"description": "A glowing square that swells, rounds and spins.",
|
|
371
|
+
"useCases": ["modern splash states", "brand colors"],
|
|
372
|
+
"defaults": { "size": 44, "accent": "#0a84ff", "speed": 1 },
|
|
373
|
+
"attributes": [
|
|
374
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
375
|
+
{ "name": "accent", "reactProp": "accent", "type": "string", "default": "#0a84ff" },
|
|
376
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
377
|
+
],
|
|
378
|
+
"cssVars": [
|
|
379
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Box size" },
|
|
380
|
+
{ "name": "--lz-accent", "default": "#0a84ff", "purpose": "Box color" },
|
|
381
|
+
{ "name": "--lz-glow", "default": "35% tint shadow", "purpose": "Glow shadow" }
|
|
382
|
+
],
|
|
383
|
+
"keyframeVars": [
|
|
384
|
+
{ "name": "--lz-morph", "default": "0.72", "purpose": "Smallest scale" },
|
|
385
|
+
{ "name": "--lz-morph-radius", "default": "17%", "purpose": "Corner roundness at peak" }
|
|
386
|
+
],
|
|
387
|
+
"examples": {
|
|
388
|
+
"html": "<lz-morphing-square accent=\"#bf5af2\" size=\"56\"></lz-morphing-square>",
|
|
389
|
+
"react": "<MorphingSquare accent=\"#bf5af2\" size={56} />"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"id": "breathing-pulse",
|
|
394
|
+
"tag": "lz-breathing-pulse",
|
|
395
|
+
"reactComponent": "BreathingPulse",
|
|
396
|
+
"category": "Shapes",
|
|
397
|
+
"role": "status",
|
|
398
|
+
"description": "A soft circle that gently grows and shrinks.",
|
|
399
|
+
"useCases": ["subtle alive waits", "background states"],
|
|
400
|
+
"defaults": { "size": 36, "color": "#f5f5f7", "speed": 1 },
|
|
401
|
+
"attributes": [
|
|
402
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 36 },
|
|
403
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
404
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
405
|
+
],
|
|
406
|
+
"cssVars": [{ "name": "--lz-size", "default": "36px", "purpose": "Circle size" }],
|
|
407
|
+
"keyframeVars": [
|
|
408
|
+
{ "name": "--lz-breath", "default": "1.14", "purpose": "Growth scale" }
|
|
409
|
+
],
|
|
410
|
+
"examples": {
|
|
411
|
+
"html": "<lz-breathing-pulse size=\"48\" color=\"#30d158\"></lz-breathing-pulse>",
|
|
412
|
+
"react": "<BreathingPulse size={48} color=\"#30d158\" />"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"id": "equalizer",
|
|
417
|
+
"tag": "lz-equalizer",
|
|
418
|
+
"reactComponent": "Equalizer",
|
|
419
|
+
"category": "Bars & rings",
|
|
420
|
+
"role": "status",
|
|
421
|
+
"description": "Four bars dancing like a music equalizer.",
|
|
422
|
+
"useCases": ["audio", "music", "waveform"],
|
|
423
|
+
"defaults": { "size": 22, "barWidth": 3, "gap": 3, "color": "#f5f5f7", "speed": 1 },
|
|
424
|
+
"attributes": [
|
|
425
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 22, "meaning": "Bar height" },
|
|
426
|
+
{ "name": "bar-width", "reactProp": "barWidth", "type": "number", "unit": "px", "default": 3 },
|
|
427
|
+
{ "name": "gap", "reactProp": "gap", "type": "number", "unit": "px", "default": 3 },
|
|
428
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7" },
|
|
429
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
430
|
+
],
|
|
431
|
+
"cssVars": [
|
|
432
|
+
{ "name": "--lz-size", "default": "22px", "purpose": "Bar height" },
|
|
433
|
+
{ "name": "--lz-bar-width", "default": "3px", "purpose": "Bar width" },
|
|
434
|
+
{ "name": "--lz-gap", "default": "3px", "purpose": "Gap between bars" }
|
|
435
|
+
],
|
|
436
|
+
"keyframeVars": [
|
|
437
|
+
{ "name": "--lz-eq-min", "default": "0.3", "purpose": "Shortest bar scale" }
|
|
438
|
+
],
|
|
439
|
+
"examples": {
|
|
440
|
+
"html": "<lz-equalizer size=\"24\" bar-width=\"4\" gap=\"4\" color=\"#ff375f\"></lz-equalizer>",
|
|
441
|
+
"react": "<Equalizer size={24} barWidth={4} gap={4} color=\"#ff375f\" />"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"id": "progress-ring",
|
|
446
|
+
"tag": "lz-progress-ring",
|
|
447
|
+
"reactComponent": "ProgressRing",
|
|
448
|
+
"category": "Bars & rings",
|
|
449
|
+
"role": "progressbar",
|
|
450
|
+
"description": "A ring that fills to a driven percentage. Static — set percent.",
|
|
451
|
+
"useCases": ["uploads", "downloads", "known percent tasks"],
|
|
452
|
+
"defaults": { "size": 44, "strokeWidth": 4, "percent": 0, "color": "#f5f5f7", "speed": 1 },
|
|
453
|
+
"attributes": [
|
|
454
|
+
{ "name": "size", "reactProp": "size", "type": "number", "unit": "px", "default": 44 },
|
|
455
|
+
{ "name": "stroke-width", "reactProp": "strokeWidth", "type": "number", "unit": "px", "default": 4 },
|
|
456
|
+
{ "name": "percent", "reactProp": "percent", "type": "number", "unit": "0-100", "default": 0 },
|
|
457
|
+
{ "name": "color", "reactProp": "color", "type": "string", "default": "#f5f5f7", "meaning": "Fill color" },
|
|
458
|
+
{ "name": "track-color", "reactProp": "trackColor", "type": "string", "default": "rgba(255,255,255,0.15)" },
|
|
459
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
460
|
+
],
|
|
461
|
+
"cssVars": [
|
|
462
|
+
{ "name": "--lz-size", "default": "44px", "purpose": "Ring box size" },
|
|
463
|
+
{ "name": "--lz-stroke", "default": "4px", "purpose": "Ring thickness" },
|
|
464
|
+
{ "name": "--lz-track", "default": "rgba(255,255,255,0.15)", "purpose": "Track color" },
|
|
465
|
+
{ "name": "--lz-percent", "default": "0", "purpose": "Fill percent number" }
|
|
466
|
+
],
|
|
467
|
+
"keyframeVars": [],
|
|
468
|
+
"a11y": "role=progressbar, aria-valuenow/min/max updated with percent",
|
|
469
|
+
"examples": {
|
|
470
|
+
"html": "<lz-progress-ring percent=\"65\" size=\"56\" stroke-width=\"6\" color=\"#0a84ff\"></lz-progress-ring>",
|
|
471
|
+
"react": "<ProgressRing percent={65} size={56} strokeWidth={6} color=\"#0a84ff\" />"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"id": "indeterminate-progress-bar",
|
|
476
|
+
"tag": "lz-indeterminate-progress-bar",
|
|
477
|
+
"reactComponent": "IndeterminateProgressBar",
|
|
478
|
+
"category": "Bars & rings",
|
|
479
|
+
"role": "status",
|
|
480
|
+
"description": "A bar with a slider sliding back and forth (unknown progress).",
|
|
481
|
+
"useCases": ["long unknown tasks"],
|
|
482
|
+
"defaults": { "width": 160, "height": 6, "accent": "#0a84ff", "speed": 1 },
|
|
483
|
+
"attributes": [
|
|
484
|
+
{ "name": "width", "reactProp": "width", "type": "number", "unit": "px", "default": 160 },
|
|
485
|
+
{ "name": "height", "reactProp": "height", "type": "number", "unit": "px", "default": 6 },
|
|
486
|
+
{ "name": "accent", "reactProp": "accent", "type": "string", "default": "#0a84ff" },
|
|
487
|
+
{ "name": "track-color", "reactProp": "trackColor", "type": "string", "default": "#1c1c1e" },
|
|
488
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
489
|
+
],
|
|
490
|
+
"cssVars": [
|
|
491
|
+
{ "name": "--lz-accent", "default": "#0a84ff", "purpose": "Slider color" },
|
|
492
|
+
{ "name": "--lz-surface", "default": "#1c1c1e", "purpose": "Track color" }
|
|
493
|
+
],
|
|
494
|
+
"keyframeVars": [
|
|
495
|
+
{ "name": "--lz-slide-from", "default": "-100%", "purpose": "Slider start" },
|
|
496
|
+
{ "name": "--lz-slide-to", "default": "300%", "purpose": "Slider end" }
|
|
497
|
+
],
|
|
498
|
+
"examples": {
|
|
499
|
+
"html": "<lz-indeterminate-progress-bar width=\"220\" height=\"8\" accent=\"#0a84ff\"></lz-indeterminate-progress-bar>",
|
|
500
|
+
"react": "<IndeterminateProgressBar width={220} height={8} accent=\"#0a84ff\" />"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"id": "skeleton-shimmer",
|
|
505
|
+
"tag": "lz-skeleton-shimmer",
|
|
506
|
+
"reactComponent": "SkeletonShimmer",
|
|
507
|
+
"category": "Skeletons",
|
|
508
|
+
"role": "status",
|
|
509
|
+
"description": "A rounded block with a light sweeping across it.",
|
|
510
|
+
"useCases": ["image/profile/card placeholders"],
|
|
511
|
+
"defaults": { "width": 120, "height": 28, "speed": 1 },
|
|
512
|
+
"attributes": [
|
|
513
|
+
{ "name": "width", "reactProp": "width", "type": "number", "unit": "px", "default": 120 },
|
|
514
|
+
{ "name": "height", "reactProp": "height", "type": "number", "unit": "px", "default": 28 },
|
|
515
|
+
{ "name": "track-color", "reactProp": "trackColor", "type": "string", "default": "#1c1c1e" },
|
|
516
|
+
{ "name": "speed", "reactProp": "speed", "type": "number", "default": 1 }
|
|
517
|
+
],
|
|
518
|
+
"cssVars": [
|
|
519
|
+
{ "name": "--lz-surface", "default": "#1c1c1e", "purpose": "Block background" },
|
|
520
|
+
{ "name": "--lz-sheen", "default": "rgba(255,255,255,0.1)", "purpose": "Sweep light color" },
|
|
521
|
+
{ "name": "--lz-radius", "default": "10px", "purpose": "Corner radius" }
|
|
522
|
+
],
|
|
523
|
+
"keyframeVars": [
|
|
524
|
+
{ "name": "--lz-sheen-from", "default": "-120%", "purpose": "Sheen start" },
|
|
525
|
+
{ "name": "--lz-sheen-to", "default": "220%", "purpose": "Sheen end" }
|
|
526
|
+
],
|
|
527
|
+
"examples": {
|
|
528
|
+
"html": "<lz-skeleton-shimmer width=\"240\" height=\"24\"></lz-skeleton-shimmer>",
|
|
529
|
+
"react": "<SkeletonShimmer width={240} height={24} />"
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "loading-state-zoo",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "17 smooth, transform-only loading patterns as framework-agnostic web components with a thin React wrapper. Works in React, plain web, iOS and Android WebViews.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./webcomponents": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"require": "./dist/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./react": {
|
|
21
|
+
"types": "./dist/react.d.ts",
|
|
22
|
+
"import": "./dist/react.js",
|
|
23
|
+
"require": "./dist/react.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./theme.css": "./dist/theme.css",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"docs"
|
|
31
|
+
],
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"./dist/index.js",
|
|
34
|
+
"./dist/index.cjs",
|
|
35
|
+
"./dist/react.js",
|
|
36
|
+
"./dist/react.cjs"
|
|
37
|
+
],
|
|
38
|
+
"keywords": [
|
|
39
|
+
"loading",
|
|
40
|
+
"spinner",
|
|
41
|
+
"pattern",
|
|
42
|
+
"web-components",
|
|
43
|
+
"custom-elements",
|
|
44
|
+
"react",
|
|
45
|
+
"tailwind",
|
|
46
|
+
"loading-state"
|
|
47
|
+
],
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsup",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"prepublishOnly": "npm run build"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": ">=18"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"react": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/react": "^19.0.2",
|
|
64
|
+
"tsup": "^8.3.5",
|
|
65
|
+
"typescript": "^5.7.2"
|
|
66
|
+
}
|
|
67
|
+
}
|