@fluxus-ui/icons 0.0.0-stage → 0.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.
package/dist/index.js ADDED
@@ -0,0 +1,611 @@
1
+ // src/attach.ts
2
+ import { prefersReducedMotion, spring } from "@fluxus-ui/core/base";
3
+
4
+ // src/pose.ts
5
+ var REST = "rest";
6
+ var poseOf = (part, state, progress) => {
7
+ const p = { ...part.rest, ...state ? part.on?.[state] : void 0 };
8
+ return { d: p.d ?? part.d, x: p.x ?? 0, y: p.y ?? 0, r: p.r ?? 0, s: p.s ?? 1, draw: p.draw === "p" ? progress : p.draw ?? 1, o: p.o ?? 1 };
9
+ };
10
+ var draws = (part) => [part.rest, ...Object.values(part.on ?? {})].some((p) => p?.draw !== void 0);
11
+ var n = (v) => String(+v.toFixed(2));
12
+ var attrsOf = (part, pose) => {
13
+ const [cx, cy] = part.c ?? [8, 8];
14
+ const t = (pose.x || pose.y ? `translate(${n(pose.x)} ${n(pose.y)})` : "") + (pose.r ? `rotate(${n(pose.r)} ${cx} ${cy})` : "") + (pose.s !== 1 ? `translate(${cx} ${cy})scale(${n(pose.s)})translate(${-cx} ${-cy})` : "");
15
+ const hidden = pose.draw < 1e-3 || pose.o < 1e-3;
16
+ return {
17
+ d: pose.d,
18
+ transform: t || null,
19
+ // With round caps a dash of 0 still paints a dot: a part not drawn at all is hidden instead.
20
+ "stroke-dasharray": pose.draw > 0.999 || hidden ? null : `${n(pose.draw)} 2`,
21
+ visibility: hidden ? "hidden" : null,
22
+ opacity: pose.o > 0.999 || hidden ? null : n(pose.o)
23
+ };
24
+ };
25
+ var esc = (s) => s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
26
+ var partsMarkup = (def, state, progress = 0) => def.parts.map((part) => {
27
+ const attrs = attrsOf(part, poseOf(part, state, progress));
28
+ let out = `<path data-p="${part.id}"`;
29
+ if (draws(part)) out += ' pathLength="1"';
30
+ if (part.fill) out += ' fill="currentColor"';
31
+ for (const [k, v] of Object.entries(attrs)) if (v !== null) out += ` ${k}="${v}"`;
32
+ return `${out}/>`;
33
+ }).join("");
34
+ var iconMarkup = (def, { state, progress, label, className } = {}) => `<svg class="${esc(className ? `fx-i ${className}` : "fx-i")}" data-fx-icon="${def.name}"` + (state ? ` data-state="${esc(state)}"` : "") + (progress !== void 0 ? ` data-progress="${n(progress)}"` : "") + ' viewBox="0 0 16 16" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"' + (label ? ` role="img" aria-label="${esc(label)}"` : ' aria-hidden="true"') + `>${partsMarkup(def, state, progress)}</svg>`;
35
+ var parse = (d) => (d.match(/[A-Z]|-?[\d.]+/g) ?? []).map((t) => /[A-Z]/.test(t) ? t : Number(t));
36
+ var mix = (a, b, t) => a.map((v, i) => typeof v === "number" ? n(v + (b[i] - v) * t) : v).join(" ");
37
+ var ARGS = { M: 2, L: 2, H: 1, V: 1, C: 6, S: 4, Q: 4, T: 2, A: 7, Z: 0 };
38
+ var shape = (d) => {
39
+ const num = "-?\\d+(?:\\.\\d+)?";
40
+ const cmd = `[MLHVCSQTAZ](?:${num}(?: ${num})*)?`;
41
+ if (!new RegExp(`^${cmd}(?: ${cmd})*$`).test(d)) return "absolute commands and numbers apart by single spaces";
42
+ let cmds = "";
43
+ let flags = "";
44
+ for (const chunk of d.split(/ (?=[A-Z])/)) {
45
+ const cmd2 = chunk[0];
46
+ const args = chunk.slice(1).split(" ").filter(Boolean);
47
+ const per = ARGS[cmd2];
48
+ if (per === 0 ? args.length !== 0 : args.length === 0 || args.length % per !== 0) return `${cmd2} takes ${per} numbers`;
49
+ cmds += `${cmd2}${args.length}`;
50
+ if (cmd2 === "A") for (let i = 0; i < args.length; i += 7) flags += `${args[i + 3]}${args[i + 4]}`;
51
+ }
52
+ return { cmds, flags };
53
+ };
54
+ function validateIcon(def) {
55
+ const out = [];
56
+ const bad = (what) => void out.push(`${def.name}: ${what}`);
57
+ if (!/^[a-z][a-z0-9-]*$/.test(def.name)) bad("its name is not kebab-case");
58
+ const ids = /* @__PURE__ */ new Set();
59
+ for (const part of def.parts) {
60
+ if (!part.id || ids.has(part.id)) bad(`part id "${part.id}" is empty or repeated`);
61
+ ids.add(part.id);
62
+ const base = shape(part.d);
63
+ if (typeof base === "string") bad(`${part.id}: ${base}`);
64
+ if (part.lag !== void 0 && (part.lag < 0 || part.lag > 0.5)) bad(`${part.id}: lag is 0\u20130.5`);
65
+ for (const [state, pose] of [["rest", part.rest], ...Object.entries(part.on ?? {})]) {
66
+ if (!pose) continue;
67
+ if (pose.d !== void 0) {
68
+ const other = shape(pose.d);
69
+ if (typeof other === "string") bad(`${part.id}@${state}: ${other}`);
70
+ else if (typeof base !== "string" && other.cmds !== base.cmds) bad(`${part.id}@${state}: not the same commands as at rest`);
71
+ else if (typeof base !== "string" && other.flags !== base.flags) bad(`${part.id}@${state}: arc flags differ from the ones at rest`);
72
+ }
73
+ if (typeof pose.draw === "number" && (pose.draw < 0 || pose.draw > 1)) bad(`${part.id}@${state}: draw is 0\u20131`);
74
+ if (pose.o !== void 0 && (pose.o < 0 || pose.o > 1)) bad(`${part.id}@${state}: o is 0\u20131`);
75
+ }
76
+ }
77
+ for (const [name, kicks] of Object.entries(def.kicks ?? {})) {
78
+ for (const kick of kicks) {
79
+ if (kick.p !== "*" && !ids.has(kick.p)) bad(`kick ${name}: no part "${kick.p}"`);
80
+ if (!"xyrs".includes(kick.k) || kick.k.length !== 1) bad(`kick ${name}: "${kick.k}" is not x, y, r or s`);
81
+ }
82
+ }
83
+ return out;
84
+ }
85
+
86
+ // src/attach.ts
87
+ var NUMS = ["x", "y", "r", "s", "draw", "o"];
88
+ var CONTROL = "[aria-pressed],[aria-expanded],[aria-checked]";
89
+ var HOST = 'a,button,summary,label,[role="button"],[role="menuitem"],[role="tab"],[role="switch"],[role="checkbox"]';
90
+ var WATCHED = ["aria-pressed", "aria-expanded", "aria-checked"];
91
+ function attachIcon(svg, def, options = {}) {
92
+ const reduced = () => (options.respectReducedMotion ?? true) && prefersReducedMotion();
93
+ const control = svg.closest(CONTROL);
94
+ const target = svg.closest(HOST) ?? control ?? svg;
95
+ const stateOf = () => svg.dataset.state ?? (control && WATCHED.some((a) => control.getAttribute(a) === "true") ? "on" : REST);
96
+ const progressOf = () => Math.min(1, Math.max(0, Number(svg.dataset.progress) || 0));
97
+ let state = stateOf();
98
+ let ends = [state, state];
99
+ let aim = 1;
100
+ let g = 1;
101
+ let motion = null;
102
+ const timers = /* @__PURE__ */ new Set();
103
+ const lives = [];
104
+ for (const part of def.parts) {
105
+ const el = svg.querySelector(`[data-p="${part.id}"]`);
106
+ if (!el) continue;
107
+ const pose = poseOf(part, state, progressOf());
108
+ lives.push({ part, el, from: pose, to: pose, off: { x: 0, y: 0, r: 0, s: 0 }, pushes: {} });
109
+ }
110
+ const now = (live) => {
111
+ const lag = live.part.lag ?? 0;
112
+ const t = lag ? Math.max(0, (g - lag) / (1 - lag)) : g;
113
+ const { from, to } = live;
114
+ const pose = { ...to, d: from.d === to.d ? to.d : t >= 1 ? to.d : t <= 0 ? from.d : mix(parse(from.d), parse(to.d), t) };
115
+ for (const k of NUMS) pose[k] = from[k] + (to[k] - from[k]) * t;
116
+ pose.draw = Math.min(1, Math.max(0, pose.draw));
117
+ pose.o = Math.min(1, Math.max(0, pose.o));
118
+ return pose;
119
+ };
120
+ const paint = () => {
121
+ for (const live of lives) {
122
+ const pose = now(live);
123
+ const { off } = live;
124
+ const attrs = attrsOf(live.part, { ...pose, x: pose.x + off.x, y: pose.y + off.y, r: pose.r + off.r, s: pose.s + off.s });
125
+ for (const [k, v] of Object.entries(attrs)) {
126
+ if (v === null) live.el.removeAttribute(k);
127
+ else if (live.el.getAttribute(k) !== v) live.el.setAttribute(k, v);
128
+ }
129
+ }
130
+ };
131
+ const settle = () => {
132
+ for (const live of lives) live.from = live.to = aim ? live.to : live.from;
133
+ ends = [state, state];
134
+ aim = 1;
135
+ g = 1;
136
+ paint();
137
+ };
138
+ const go = (next, force = false) => {
139
+ if (next === state && !force) return;
140
+ const running = motion !== null && !motion.done;
141
+ if (reduced()) {
142
+ motion?.stop();
143
+ motion = null;
144
+ state = next;
145
+ aim = 1;
146
+ for (const live of lives) live.to = poseOf(live.part, next, progressOf());
147
+ settle();
148
+ return;
149
+ }
150
+ if (running && !force && next === ends[1 - aim]) {
151
+ aim = aim ? 0 : 1;
152
+ state = next;
153
+ motion.retarget(aim);
154
+ } else {
155
+ for (const live of lives) {
156
+ live.from = now(live);
157
+ live.to = poseOf(live.part, next, progressOf());
158
+ }
159
+ motion?.stop();
160
+ ends = [running || force ? null : state, next];
161
+ state = next;
162
+ aim = 1;
163
+ g = 0;
164
+ motion = spring({
165
+ from: 0,
166
+ to: 1,
167
+ stiffness: 320,
168
+ damping: 26,
169
+ restDelta: 2e-3,
170
+ onUpdate: (v) => {
171
+ g = v;
172
+ paint();
173
+ },
174
+ onRest: settle
175
+ });
176
+ }
177
+ if (!force) kick(next);
178
+ };
179
+ const kick = (name) => {
180
+ if (reduced()) return;
181
+ for (const k of def.kicks?.[name] ?? []) {
182
+ const start = () => {
183
+ for (const live of lives) {
184
+ if (k.p !== "*" && k.p !== live.part.id) continue;
185
+ const old = live.pushes[k.k];
186
+ const carried = old && !old.done ? old.velocity : 0;
187
+ old?.stop();
188
+ const to = k.to ?? 0;
189
+ live.pushes[k.k] = spring({
190
+ from: live.off[k.k],
191
+ to,
192
+ velocity: carried + (k.v ?? 0),
193
+ ...to ? { stiffness: 120, damping: 20 } : { stiffness: 180, damping: 12 },
194
+ restDelta: k.k === "s" ? 2e-3 : 0.05,
195
+ restSpeed: 0.05,
196
+ onUpdate: (v) => {
197
+ live.off[k.k] = v;
198
+ if (!motion || motion.done) paint();
199
+ },
200
+ onRest: () => {
201
+ live.off[k.k] = 0;
202
+ paint();
203
+ }
204
+ });
205
+ }
206
+ };
207
+ if (k.wait) {
208
+ const timer = window.setTimeout(() => {
209
+ timers.delete(timer);
210
+ start();
211
+ }, k.wait);
212
+ timers.add(timer);
213
+ } else start();
214
+ }
215
+ };
216
+ paint();
217
+ const watcher = new MutationObserver((records) => {
218
+ go(stateOf(), records.some((r) => r.attributeName === "data-progress"));
219
+ });
220
+ watcher.observe(svg, { attributes: true, attributeFilter: ["data-state", "data-progress"] });
221
+ if (control) watcher.observe(control, { attributes: true, attributeFilter: WATCHED });
222
+ const onEnter = (e) => {
223
+ if (e.pointerType === "mouse") kick("hover");
224
+ };
225
+ const onClick = () => kick("press");
226
+ target.addEventListener("pointerenter", onEnter);
227
+ target.addEventListener("click", onClick);
228
+ return {
229
+ kick,
230
+ destroy() {
231
+ watcher.disconnect();
232
+ target.removeEventListener("pointerenter", onEnter);
233
+ target.removeEventListener("click", onClick);
234
+ motion?.stop();
235
+ for (const timer of timers) clearTimeout(timer);
236
+ for (const live of lives) {
237
+ for (const push of Object.values(live.pushes)) push.stop();
238
+ live.off = { x: 0, y: 0, r: 0, s: 0 };
239
+ }
240
+ settle();
241
+ }
242
+ };
243
+ }
244
+
245
+ // src/icons/arrow-down.ts
246
+ var arrowDown = {
247
+ name: "arrow-down",
248
+ parts: [{ id: "a", d: "M8 3 L8 13 M4 9 L8 13 L12 9" }],
249
+ kicks: { hover: [{ p: "*", k: "y", v: 28 }] }
250
+ };
251
+
252
+ // src/icons/arrow-left.ts
253
+ var arrowLeft = {
254
+ name: "arrow-left",
255
+ parts: [{ id: "a", d: "M13 8 L3 8 M7 4 L3 8 L7 12" }],
256
+ kicks: { hover: [{ p: "*", k: "x", v: -28 }] }
257
+ };
258
+
259
+ // src/icons/arrow-right.ts
260
+ var arrowRight = {
261
+ name: "arrow-right",
262
+ parts: [{ id: "a", d: "M3 8 L13 8 M9 4 L13 8 L9 12" }],
263
+ kicks: { hover: [{ p: "*", k: "x", v: 28 }] }
264
+ };
265
+
266
+ // src/icons/arrow-up.ts
267
+ var arrowUp = {
268
+ name: "arrow-up",
269
+ parts: [{ id: "a", d: "M8 13 L8 3 M4 7 L8 3 L12 7" }],
270
+ kicks: { hover: [{ p: "*", k: "y", v: -28 }] }
271
+ };
272
+
273
+ // src/icons/bell.ts
274
+ var bell = {
275
+ name: "bell",
276
+ parts: [
277
+ { id: "body", d: "M3.5 11.5 L4.5 10.5 V7 A3.5 3.5 0 0 1 11.5 7 V10.5 L12.5 11.5 Z", c: [8, 3] },
278
+ { id: "clapper", d: "M6.75 13.5 A1.3 1.3 0 0 0 9.25 13.5", c: [8, 3] },
279
+ { id: "dot", d: "M12 3.5 V3.51", c: [12, 3.5], rest: { o: 0, s: 0 }, on: { on: { o: 1, s: 1 } } }
280
+ ],
281
+ kicks: {
282
+ hover: [
283
+ { p: "body", k: "r", v: 210 },
284
+ { p: "clapper", k: "r", v: 330, wait: 40 }
285
+ ],
286
+ on: [
287
+ { p: "body", k: "r", v: 300 },
288
+ { p: "clapper", k: "r", v: 460, wait: 40 }
289
+ ]
290
+ }
291
+ };
292
+
293
+ // src/icons/calendar.ts
294
+ var calendar = {
295
+ name: "calendar",
296
+ parts: [
297
+ { id: "p1", d: "M4 3.5 H12 A1.5 1.5 0 0 1 13.5 5 V12 A1.5 1.5 0 0 1 12 13.5 H4 A1.5 1.5 0 0 1 2.5 12 V5 A1.5 1.5 0 0 1 4 3.5 Z" },
298
+ { id: "p2", d: "M2.5 6.5 H13.5 M5.5 2 V5 M10.5 2 V5" }
299
+ ]
300
+ };
301
+
302
+ // src/icons/check.ts
303
+ var check = {
304
+ name: "check",
305
+ parts: [
306
+ { id: "ring", d: "M8 2.5 A5.5 5.5 0 1 1 8 13.5 A5.5 5.5 0 1 1 8 2.5 Z", on: { off: { draw: 0 } } },
307
+ { id: "tick", d: "M5.4 8.2 L7.2 10 L10.6 6.2", lag: 0.35, on: { off: { draw: 0 } } }
308
+ ],
309
+ kicks: { rest: [{ p: "*", k: "s", v: 1.2, wait: 160 }] }
310
+ };
311
+
312
+ // src/icons/chevron.ts
313
+ var chevron = {
314
+ name: "chevron",
315
+ parts: [{ id: "v", d: "M4.5 6.25 L8 9.75 L11.5 6.25", on: { on: { r: -180 } } }]
316
+ };
317
+
318
+ // src/icons/close.ts
319
+ var close = {
320
+ name: "close",
321
+ parts: [{ id: "x", d: "M4 4 L12 12 M12 4 L4 12" }],
322
+ kicks: {
323
+ hover: [{ p: "*", k: "r", v: 240 }],
324
+ press: [{ p: "*", k: "s", v: -2.5 }]
325
+ }
326
+ };
327
+
328
+ // src/icons/copy.ts
329
+ var copy = {
330
+ name: "copy",
331
+ parts: [
332
+ { id: "back", d: "M5.5 5.5 V3.5 A1 1 0 0 1 6.5 2.5 H12.5 A1 1 0 0 1 13.5 3.5 V9.5 A1 1 0 0 1 12.5 10.5 H10.5", on: { done: { draw: 0 } } },
333
+ { id: "front", d: "M3.5 5.5 H9.5 A1 1 0 0 1 10.5 6.5 V12.5 A1 1 0 0 1 9.5 13.5 H3.5 A1 1 0 0 1 2.5 12.5 V6.5 A1 1 0 0 1 3.5 5.5 Z" },
334
+ { id: "tick", d: "M4.5 9.6 L6 11.1 L8.6 8", lag: 0.3, rest: { draw: 0 }, on: { done: { draw: 1 } } }
335
+ ],
336
+ kicks: { done: [{ p: "front", k: "s", v: 1.6 }] }
337
+ };
338
+
339
+ // src/icons/error.ts
340
+ var error = {
341
+ name: "error",
342
+ parts: [
343
+ { id: "ring", d: "M8 2.5 A5.5 5.5 0 1 1 8 13.5 A5.5 5.5 0 1 1 8 2.5 Z", on: { off: { draw: 0 } } },
344
+ { id: "bar", d: "M8 5 V8.5", lag: 0.3, on: { off: { draw: 0 } } },
345
+ { id: "dot", d: "M8 11 V11.01", lag: 0.4, on: { off: { o: 0 } } }
346
+ ],
347
+ kicks: { rest: [{ p: "*", k: "x", v: 36, wait: 120 }] }
348
+ };
349
+
350
+ // src/icons/image.ts
351
+ var image = {
352
+ name: "image",
353
+ parts: [
354
+ { id: "p1", d: "M4 2.5 H12 A1.5 1.5 0 0 1 13.5 4 V12 A1.5 1.5 0 0 1 12 13.5 H4 A1.5 1.5 0 0 1 2.5 12 V4 A1.5 1.5 0 0 1 4 2.5 Z" },
355
+ { id: "p2", d: "M6 4.8 A1.2 1.2 0 1 1 6 7.2 A1.2 1.2 0 1 1 6 4.8 Z" },
356
+ { id: "p3", d: "M3 12 L6.5 8.5 L8.5 10.5 L11 8 L13.5 10.5" }
357
+ ]
358
+ };
359
+
360
+ // src/icons/inbox.ts
361
+ var inbox = {
362
+ name: "inbox",
363
+ parts: [
364
+ { id: "p1", d: "M2.5 9 H5.5 L6.5 11 H9.5 L10.5 9 H13.5" },
365
+ { id: "p2", d: "M4 3.5 H12 L13.5 9 V12.5 A1 1 0 0 1 12.5 13.5 H3.5 A1 1 0 0 1 2.5 12.5 V9 Z" }
366
+ ]
367
+ };
368
+
369
+ // src/icons/list.ts
370
+ var list = {
371
+ name: "list",
372
+ parts: [
373
+ { id: "p1", d: "M3 4 H13 M3 8 H13 M3 12 H9" }
374
+ ]
375
+ };
376
+
377
+ // src/icons/lock.ts
378
+ var lock = {
379
+ name: "lock",
380
+ parts: [
381
+ { id: "body", d: "M4.5 7.5 H11.5 A1 1 0 0 1 12.5 8.5 V12.5 A1 1 0 0 1 11.5 13.5 H4.5 A1 1 0 0 1 3.5 12.5 V8.5 A1 1 0 0 1 4.5 7.5 Z" },
382
+ { id: "shackle", d: "M5.5 7.5 V5.5 A2.5 2.5 0 0 1 10.5 5.5 V7.5", on: { open: { y: -1.25, d: "M5.5 8.75 V5.5 A2.5 2.5 0 0 1 10.5 5.5 V6.5" } } }
383
+ ],
384
+ kicks: { hover: [{ p: "shackle", k: "y", v: -16 }] }
385
+ };
386
+
387
+ // src/icons/login.ts
388
+ var login = {
389
+ name: "login",
390
+ parts: [
391
+ { id: "door", d: "M9.5 2.5 H12.5 A1 1 0 0 1 13.5 3.5 V12.5 A1 1 0 0 1 12.5 13.5 H9.5" },
392
+ { id: "arrow", d: "M6.5 5 L9.5 8 L6.5 11 M9.5 8 L2.5 8" }
393
+ ],
394
+ kicks: { hover: [{ p: "arrow", k: "x", v: 24 }] }
395
+ };
396
+
397
+ // src/icons/logout.ts
398
+ var logout = {
399
+ name: "logout",
400
+ parts: [
401
+ { id: "p1", d: "M6.5 13.5 H3.5 A1 1 0 0 1 2.5 12.5 V3.5 A1 1 0 0 1 3.5 2.5 H6.5" },
402
+ { id: "p2", d: "M10.5 11 L13.5 8 L10.5 5 M13.5 8 H6" }
403
+ ]
404
+ };
405
+
406
+ // src/icons/menu.ts
407
+ var menu = {
408
+ name: "menu",
409
+ parts: [
410
+ { id: "top", d: "M3 4.5 L13 4.5", on: { on: { d: "M4 4 L12 12" } } },
411
+ { id: "mid", d: "M3 8 L13 8", on: { on: { s: 0.2, o: 0 } } },
412
+ { id: "low", d: "M3 11.5 L13 11.5", on: { on: { d: "M4 12 L12 4" } } }
413
+ ]
414
+ };
415
+
416
+ // src/icons/mic.ts
417
+ var CAPSULE = "M8 2.5 A2 2 0 0 1 10 4.5 V7.5 A2 2 0 0 1 6 7.5 V4.5 A2 2 0 0 1 8 2.5 Z";
418
+ var mic = {
419
+ name: "mic",
420
+ parts: [
421
+ { id: "capsule", d: CAPSULE },
422
+ { id: "level", d: CAPSULE, fill: true, c: [8, 9.5], rest: { o: 0, s: 0.6 }, on: { on: { o: 1, s: 1 } } },
423
+ { id: "cradle", d: "M4 7.5 A4 4 0 0 0 12 7.5", c: [8, 7.5] },
424
+ { id: "stem", d: "M8 11.5 V13.5" }
425
+ ],
426
+ kicks: { on: [{ p: "cradle", k: "s", v: 1.4 }] }
427
+ };
428
+
429
+ // src/icons/pencil.ts
430
+ var pencil = {
431
+ name: "pencil",
432
+ parts: [
433
+ { id: "body", d: "M10.75 3.25 L12.75 5.25 L5.75 12.25 L3 13 L3.75 10.25 Z", c: [3, 13] },
434
+ { id: "band", d: "M9.25 4.75 L11.25 6.75", c: [3, 13] }
435
+ ],
436
+ kicks: { hover: [{ p: "*", k: "r", v: 150 }] }
437
+ };
438
+
439
+ // src/icons/play.ts
440
+ var play = {
441
+ name: "play",
442
+ parts: [
443
+ { id: "left", fill: true, d: "M5 3.5 L8.75 5.75 L8.75 10.25 L5 12.5 Z", on: { on: { d: "M4.5 3.5 L6.5 3.5 L6.5 12.5 L4.5 12.5 Z" } } },
444
+ { id: "right", fill: true, d: "M8.75 5.75 L12.5 8 L12.5 8 L8.75 10.25 Z", on: { on: { d: "M9.5 3.5 L11.5 3.5 L11.5 12.5 L9.5 12.5 Z" } } }
445
+ ]
446
+ };
447
+
448
+ // src/icons/plus.ts
449
+ var plus = {
450
+ name: "plus",
451
+ parts: [{ id: "cross", d: "M8 3 L8 13 M3 8 L13 8" }],
452
+ kicks: {
453
+ hover: [{ p: "*", k: "r", v: 200 }],
454
+ press: [{ p: "*", k: "r", to: 90 }]
455
+ }
456
+ };
457
+
458
+ // src/icons/refresh.ts
459
+ var refresh = {
460
+ name: "refresh",
461
+ parts: [
462
+ { id: "arc", d: "M13.5 8 A5.5 5.5 0 1 1 8 2.5 C9.5 2.5 10.9 3.1 11.9 4.1 L13.5 5.5" },
463
+ { id: "head", d: "M13.5 2.5 V5.5 H10.5" }
464
+ ],
465
+ kicks: {
466
+ hover: [{ p: "*", k: "r", v: 240 }],
467
+ press: [{ p: "*", k: "r", to: 360 }]
468
+ }
469
+ };
470
+
471
+ // src/icons/shield.ts
472
+ var shield = {
473
+ name: "shield",
474
+ parts: [
475
+ { id: "shell", d: "M8 2.5 L12.5 4.25 L12.5 8 C12.5 10.75 10.5 12.75 8 13.5 C5.5 12.75 3.5 10.75 3.5 8 L3.5 4.25 Z" },
476
+ { id: "tick", d: "M6 8 L7.5 9.5 L10 6.5" }
477
+ ],
478
+ kicks: { hover: [{ p: "*", k: "s", v: 1.2 }] }
479
+ };
480
+
481
+ // src/icons/sidebar.ts
482
+ var sidebar = {
483
+ name: "sidebar",
484
+ parts: [
485
+ { id: "frame", d: "M3.5 2.5 H12.5 A1 1 0 0 1 13.5 3.5 V12.5 A1 1 0 0 1 12.5 13.5 H3.5 A1 1 0 0 1 2.5 12.5 V3.5 A1 1 0 0 1 3.5 2.5 Z" },
486
+ { id: "bar", d: "M5 2.5 V13.5", on: { on: { x: 1.5 } } },
487
+ { id: "arrow", d: "M8.5 6.25 L10.25 8 L8.5 9.75", lag: 0.15, on: { on: { d: "M10.75 6.25 L9 8 L10.75 9.75" } } }
488
+ ]
489
+ };
490
+
491
+ // src/icons/stack.ts
492
+ var stack = {
493
+ name: "stack",
494
+ parts: [
495
+ { id: "p1", d: "M3.5 2.5 H12.5 A1 1 0 0 1 13.5 3.5 V5.5 A1 1 0 0 1 12.5 6.5 H3.5 A1 1 0 0 1 2.5 5.5 V3.5 A1 1 0 0 1 3.5 2.5 Z" },
496
+ { id: "p2", d: "M3.5 9.5 H12.5 A1 1 0 0 1 13.5 10.5 V12.5 A1 1 0 0 1 12.5 13.5 H3.5 A1 1 0 0 1 2.5 12.5 V10.5 A1 1 0 0 1 3.5 9.5 Z" }
497
+ ]
498
+ };
499
+
500
+ // src/icons/tick.ts
501
+ var tick = {
502
+ name: "tick",
503
+ parts: [{ id: "v", d: "M3.5 8.5 L6.5 11.5 L12.5 4.5", on: { off: { draw: 0 }, mixed: { d: "M4 8 L8 8 L12 8" } } }],
504
+ kicks: {
505
+ hover: [{ p: "*", k: "s", v: 1.5 }],
506
+ press: [{ p: "*", k: "s", v: 2.5 }]
507
+ }
508
+ };
509
+
510
+ // src/icons/trash.ts
511
+ var trash = {
512
+ name: "trash",
513
+ parts: [
514
+ { id: "lid", d: "M2.5 4.5 H13.5 M6 4.5 V3.5 A1 1 0 0 1 7 2.5 H9 A1 1 0 0 1 10 3.5 V4.5", c: [13.5, 4.5] },
515
+ { id: "body", d: "M4 4.5 L4.6 12.6 A1 1 0 0 0 5.6 13.5 H10.4 A1 1 0 0 0 11.4 12.6 L12 4.5" },
516
+ { id: "ribs", d: "M6.75 7.25 V10.75 M9.25 7.25 V10.75" }
517
+ ],
518
+ kicks: {
519
+ hover: [{ p: "lid", k: "r", v: 190 }],
520
+ press: [
521
+ { p: "lid", k: "r", v: 380 },
522
+ { p: "lid", k: "y", v: -14 }
523
+ ]
524
+ }
525
+ };
526
+
527
+ // src/icons/upload.ts
528
+ var TRAY = "M2.5 10.5 V12.5 A1 1 0 0 0 3.5 13.5 H12.5 A1 1 0 0 0 13.5 12.5 V10.5";
529
+ var upload = {
530
+ name: "upload",
531
+ parts: [
532
+ { id: "tray", d: TRAY, on: { busy: { o: 0.35 } } },
533
+ { id: "fill", d: TRAY, rest: { draw: 0 }, on: { busy: { draw: "p" }, done: { draw: 0 } } },
534
+ { id: "stem", d: "M8 10.5 V3", on: { done: { draw: 0 } } },
535
+ { id: "head", d: "M5 6 L8 3 L11 6", on: { done: { draw: 0, y: -2 } } },
536
+ { id: "tick", d: "M5 6 L7.3 8.3 L11 4", lag: 0.3, rest: { draw: 0 }, on: { done: { draw: 1 } } }
537
+ ],
538
+ kicks: { busy: [{ p: "head", k: "y", v: -22 }, { p: "stem", k: "y", v: -22 }] }
539
+ };
540
+
541
+ // src/icons/user.ts
542
+ var user = {
543
+ name: "user",
544
+ parts: [
545
+ { id: "p1", d: "M8 3 A2.5 2.5 0 1 1 8 8 A2.5 2.5 0 1 1 8 3 Z" },
546
+ { id: "p2", d: "M3 13.5 C3.6 11.1 5.6 9.5 8 9.5 C10.4 9.5 12.4 11.1 13 13.5" }
547
+ ]
548
+ };
549
+
550
+ // src/icons/wand.ts
551
+ var wand = {
552
+ name: "wand",
553
+ parts: [
554
+ { id: "stick", d: "M3 13 L9.25 6.75" },
555
+ { id: "spark", d: "M11.5 2.5 V5.5 M10 4 H13", c: [11.5, 4] },
556
+ { id: "small", d: "M13 8.25 V9.75 M12.25 9 H13.75", c: [13, 9] },
557
+ { id: "tiny", d: "M6 2.75 V4.25 M5.25 3.5 H6.75", c: [6, 3.5] }
558
+ ],
559
+ kicks: {
560
+ hover: [
561
+ { p: "spark", k: "s", v: 5 },
562
+ { p: "spark", k: "r", v: 420 },
563
+ { p: "small", k: "s", v: 6, wait: 70 },
564
+ { p: "tiny", k: "s", v: 6, wait: 140 }
565
+ ],
566
+ press: [
567
+ { p: "stick", k: "r", v: -160 },
568
+ { p: "spark", k: "s", v: 8, wait: 60 },
569
+ { p: "small", k: "s", v: 8, wait: 120 },
570
+ { p: "tiny", k: "s", v: 8, wait: 180 }
571
+ ]
572
+ }
573
+ };
574
+ export {
575
+ REST,
576
+ arrowDown,
577
+ arrowLeft,
578
+ arrowRight,
579
+ arrowUp,
580
+ attachIcon,
581
+ bell,
582
+ calendar,
583
+ check,
584
+ chevron,
585
+ close,
586
+ copy,
587
+ error,
588
+ iconMarkup,
589
+ image,
590
+ inbox,
591
+ list,
592
+ lock,
593
+ login,
594
+ logout,
595
+ menu,
596
+ mic,
597
+ partsMarkup,
598
+ pencil,
599
+ play,
600
+ plus,
601
+ refresh,
602
+ shield,
603
+ sidebar,
604
+ stack,
605
+ tick,
606
+ trash,
607
+ upload,
608
+ user,
609
+ validateIcon,
610
+ wand
611
+ };