weasel-icons 0.7.0 → 0.8.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 (49) hide show
  1. package/README.md +9 -1
  2. package/THIRD_PARTY_NOTICES.md +2 -0
  3. package/dist/icons/badge-percent/badge-percent-icon.d.ts +5 -0
  4. package/dist/icons/badge-percent/badge-percent-icon.js +9 -0
  5. package/dist/icons/badge-percent/badge-percent-rig.d.ts +4 -0
  6. package/dist/icons/badge-percent/badge-percent-rig.js +63 -0
  7. package/dist/icons/blocks/blocks-icon.d.ts +5 -0
  8. package/dist/icons/blocks/blocks-icon.js +9 -0
  9. package/dist/icons/blocks/blocks-rig.d.ts +4 -0
  10. package/dist/icons/blocks/blocks-rig.js +34 -0
  11. package/dist/icons/bot/bot-icon.d.ts +5 -0
  12. package/dist/icons/bot/bot-icon.js +9 -0
  13. package/dist/icons/bot/bot-rig.d.ts +4 -0
  14. package/dist/icons/bot/bot-rig.js +79 -0
  15. package/dist/icons/brick-wall/brick-wall-icon.d.ts +5 -0
  16. package/dist/icons/brick-wall/brick-wall-icon.js +9 -0
  17. package/dist/icons/brick-wall/brick-wall-rig.d.ts +4 -0
  18. package/dist/icons/brick-wall/brick-wall-rig.js +55 -0
  19. package/dist/icons/dice/dice-icon.d.ts +5 -0
  20. package/dist/icons/dice/dice-icon.js +9 -0
  21. package/dist/icons/dice/dice-rig.d.ts +158 -0
  22. package/dist/icons/dice/dice-rig.js +96 -0
  23. package/dist/icons/dog/dog-icon.js +1 -4
  24. package/dist/icons/dog/dog-rig.d.ts +1 -13
  25. package/dist/icons/dog/dog-rig.js +39 -159
  26. package/dist/icons/footprints/footprints-icon.d.ts +5 -0
  27. package/dist/icons/footprints/footprints-icon.js +9 -0
  28. package/dist/icons/footprints/footprints-rig.d.ts +4 -0
  29. package/dist/icons/footprints/footprints-rig.js +53 -0
  30. package/dist/icons/fuel/fuel-icon.d.ts +5 -0
  31. package/dist/icons/fuel/fuel-icon.js +9 -0
  32. package/dist/icons/fuel/fuel-rig.d.ts +4 -0
  33. package/dist/icons/fuel/fuel-rig.js +55 -0
  34. package/dist/icons/infinity/infinity-icon.d.ts +5 -0
  35. package/dist/icons/infinity/infinity-icon.js +17 -0
  36. package/dist/icons/infinity/infinity-rig.d.ts +3 -0
  37. package/dist/icons/infinity/infinity-rig.js +4 -0
  38. package/dist/icons/target/target-icon.d.ts +5 -0
  39. package/dist/icons/target/target-icon.js +9 -0
  40. package/dist/icons/target/target-rig.d.ts +112 -0
  41. package/dist/icons/target/target-rig.js +81 -0
  42. package/dist/icons/webhook/webhook-icon.d.ts +5 -0
  43. package/dist/icons/webhook/webhook-icon.js +74 -0
  44. package/dist/icons/webhook/webhook-rig.d.ts +10 -0
  45. package/dist/icons/webhook/webhook-rig.js +50 -0
  46. package/dist/index.d.ts +10 -0
  47. package/dist/index.js +10 -0
  48. package/dist/shared/icon-colors.d.ts +10 -0
  49. package/package.json +51 -1
@@ -0,0 +1,81 @@
1
+ export const targetStates = ['set', 'tracking', 'hit'];
2
+ // Lucide `target` rings; attribution and pinned source: THIRD_PARTY_NOTICES.md.
3
+ // Host: a goal, objective or KPI target (OKR page, sales quota, campaign goal).
4
+ // set (condition): the two rings with the centre ghosted — a target exists, nothing has reached it.
5
+ // tracking (work): the middle ring breathes inward while the centre brightens and dims, until the host
6
+ // reports the goal is met. At rest the middle ring sits drawn in and the centre is half there.
7
+ // hit (result): the centre lands at full strength with one pop and the outer ring rings once outward.
8
+ // Nearest confusion: a location/locate pin — there is no crosshair and nothing moves off centre.
9
+ const CENTRE = [12, 12];
10
+ const breathe = { duration: 1.5, repeatAfter: 2.2, loop: true };
11
+ const landing = { duration: 0.7, repeatAfter: 2, loop: false };
12
+ const ring = (r) => `M${12 - r} 12a${r} ${r} 0 1 0 ${2 * r} 0a${r} ${r} 0 1 0-${2 * r} 0`;
13
+ export const targetArt = {
14
+ name: 'target',
15
+ parts: [
16
+ {
17
+ name: 'outer',
18
+ paths: [ring(10)],
19
+ poses: [{}, {}, {}],
20
+ pivot: CENTRE,
21
+ gestures: [
22
+ null,
23
+ null,
24
+ {
25
+ ...landing,
26
+ frames: [
27
+ { at: 0 },
28
+ { at: 0.35, scaleX: 0.04, scaleY: 0.04 },
29
+ { at: 0.65, scaleX: -0.01, scaleY: -0.01 },
30
+ { at: 1 },
31
+ ],
32
+ },
33
+ ],
34
+ },
35
+ {
36
+ name: 'middle',
37
+ paths: [ring(6)],
38
+ poses: [{}, { scaleX: 0.82, scaleY: 0.82 }, {}],
39
+ pivot: CENTRE,
40
+ gestures: [
41
+ null,
42
+ {
43
+ ...breathe,
44
+ frames: [{ at: 0 }, { at: 0.5, scaleX: 0.2, scaleY: 0.2 }, { at: 1 }],
45
+ },
46
+ {
47
+ ...landing,
48
+ frames: [
49
+ { at: 0 },
50
+ { at: 0.3, scaleX: -0.06, scaleY: -0.06 },
51
+ { at: 0.6, scaleX: 0.03, scaleY: 0.03 },
52
+ { at: 1 },
53
+ ],
54
+ },
55
+ ],
56
+ },
57
+ {
58
+ name: 'centre',
59
+ accent: true,
60
+ paths: [ring(2)],
61
+ poses: [{ opacity: 0.35 }, { opacity: 0.6, scaleX: 0.8, scaleY: 0.8 }, {}],
62
+ pivot: CENTRE,
63
+ gestures: [
64
+ null,
65
+ {
66
+ ...breathe,
67
+ frames: [{ at: 0 }, { at: 0.5, opacity: 0.4, scaleX: 0.2, scaleY: 0.2 }, { at: 1 }],
68
+ },
69
+ {
70
+ ...landing,
71
+ frames: [
72
+ { at: 0 },
73
+ { at: 0.3, scaleX: 0.35, scaleY: 0.35 },
74
+ { at: 0.6, scaleX: -0.06, scaleY: -0.06 },
75
+ { at: 1 },
76
+ ],
77
+ },
78
+ ],
79
+ },
80
+ ],
81
+ };
@@ -0,0 +1,5 @@
1
+ import type { StatefulIconProps } from "../../shared/icon-types.js";
2
+ import { type WebhookState } from "./webhook-rig.js";
3
+ export { webhookStates, type WebhookState } from "./webhook-rig.js";
4
+ export type WebhookIconProps = StatefulIconProps<WebhookState>;
5
+ export declare const WebhookIcon: import("react").NamedExoticComponent<WebhookIconProps>;
@@ -0,0 +1,74 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { memo, useEffect, useRef } from 'react';
4
+ import { animate, motion, useMotionValue, useTransform } from 'motion/react';
5
+ import { useBehaviorClock, usePoseWeight } from "../../shared/use-icon-motion.js";
6
+ import { useMotionPreference } from "../../shared/use-motion-preference.js";
7
+ import { hookPaths, payloadPaths, routePoint, packetAt, REST, } from "./webhook-rig.js";
8
+ export { webhookStates } from "./webhook-rig.js";
9
+ const ORIGIN = {
10
+ originX: '0px',
11
+ originY: '0px',
12
+ transformBox: 'view-box',
13
+ };
14
+ export const WebhookIcon = memo(function WebhookIcon({ state = 'idle', size = 24, color = 'currentColor', accentColor = 'currentColor', strokeWidth = 1.65, speed = 1, alive = false, className, }) {
15
+ const element = useRef(null), previous = useRef(state);
16
+ const reduced = useMotionPreference(), pace = Number.isFinite(speed) ? Math.min(4, Math.max(0.1, speed)) : 1;
17
+ const progress = useMotionValue(state === 'delivered' ? 1 : state === 'firing' ? REST : 0);
18
+ const opacity = useMotionValue(state === 'idle' ? 0 : 1), scale = useMotionValue(1);
19
+ const working = state === 'firing' && alive && !reduced;
20
+ const life = usePoseWeight(working, pace, reduced);
21
+ const clock = useBehaviorClock(element, working, pace, life);
22
+ useEffect(() => {
23
+ const entered = previous.current !== state;
24
+ previous.current = state;
25
+ const target = state === 'delivered' ? 1 : state === 'firing' ? REST : 0;
26
+ if (reduced) {
27
+ progress.jump(target);
28
+ opacity.jump(state === 'idle' ? 0 : 1);
29
+ scale.jump(1);
30
+ return;
31
+ }
32
+ if (working) {
33
+ const start = progress.get(), origin = clock.get();
34
+ const update = (time) => {
35
+ const v = packetAt(time - origin, start);
36
+ progress.set(v.p);
37
+ opacity.set(v.opacity);
38
+ };
39
+ const pop = animate(scale, 1, { duration: 0.15 / pace });
40
+ // The subscription is removed at handoff, preserving the visible playhead exactly.
41
+ const stop = clock.on('change', update);
42
+ return () => {
43
+ stop();
44
+ pop.stop();
45
+ };
46
+ }
47
+ const duration = (state === 'delivered' ? 0.22 + 0.7 * (1 - progress.get()) : 0.5) / pace;
48
+ // Pausing pending work holds the visible packet; it must not rewind to a nominal rest pose.
49
+ const travel = animate(progress, state === 'firing' && !entered ? progress.get() : target, {
50
+ duration,
51
+ ease: [0.22, 0.65, 0.2, 1],
52
+ });
53
+ const fade = animate(opacity, state === 'idle' ? 0 : 1, {
54
+ duration: 0.14 / pace,
55
+ });
56
+ const land = state === 'delivered' && entered
57
+ ? animate(scale, [scale.get(), 1.18, 1], {
58
+ delay: duration,
59
+ duration: 0.26 / pace,
60
+ ease: 'easeOut',
61
+ })
62
+ : animate(scale, 1, { duration: 0.15 / pace });
63
+ return () => {
64
+ travel.stop();
65
+ fade.stop();
66
+ land.stop();
67
+ };
68
+ }, [state, working, reduced, pace, clock, progress, opacity, scale]);
69
+ const transform = useTransform(() => {
70
+ const [x, y] = routePoint(progress.get());
71
+ return `translate(${x}px, ${y}px) scale(${scale.get()})`;
72
+ });
73
+ return (_jsx("svg", { ref: element, className: className, width: size, height: size, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "none", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", pointerEvents: "none", style: { display: 'block' }, children: _jsxs("g", { "data-layer": "webhook-body", transform: "translate(12 12) scale(.84) translate(-12 -12)", children: [_jsx("g", { "data-part": "hook", children: hookPaths.map((d) => (_jsx("path", { d: d }, d))) }), _jsx(motion.g, { "data-part": "payload", transform: transform, opacity: opacity, stroke: accentColor, style: ORIGIN, children: payloadPaths.map((d) => (_jsx("path", { d: d }, d))) })] }) }));
74
+ });
@@ -0,0 +1,10 @@
1
+ export declare const webhookStates: readonly ["idle", "firing", "delivered"];
2
+ export type WebhookState = (typeof webhookStates)[number];
3
+ export declare const hookPaths: readonly ["M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2", "m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06", "m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"];
4
+ export declare const payloadPaths: readonly ["M-0.8 0a.8 .8 0 1 0 1.6 0a.8 .8 0 1 0-1.6 0"];
5
+ export declare function routePoint(p: number): [number, number];
6
+ export declare const REST = 0.37;
7
+ export declare function packetAt(seconds: number, start: number): {
8
+ p: number;
9
+ opacity: number;
10
+ };
@@ -0,0 +1,50 @@
1
+ // Lucide `webhook` outline; original payload. Attribution: THIRD_PARTY_NOTICES.md.
2
+ export const webhookStates = ['idle', 'firing', 'delivered'];
3
+ export const hookPaths = [
4
+ 'M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2',
5
+ 'm6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06',
6
+ 'm12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8',
7
+ ];
8
+ export const payloadPaths = ['M-0.8 0a.8 .8 0 1 0 1.6 0a.8 .8 0 1 0-1.6 0'];
9
+ // A retained scalar playhead follows the exact line, cubic and semicircle. Delivery travels
10
+ // from the visible position to the end; pending loops reset only while the packet is invisible.
11
+ const smooth = (v) => {
12
+ const t = Math.max(0, Math.min(1, v));
13
+ return t * t * t * (10 + t * (-15 + 6 * t));
14
+ };
15
+ export function routePoint(p) {
16
+ const q = Math.max(0, Math.min(1, p));
17
+ if (q <= 0.29) {
18
+ const t = q / 0.29;
19
+ return [12 + 3.13 * t, 6 + 5.73 * t];
20
+ }
21
+ if (q < 0.44) {
22
+ const t = (q - 0.29) / 0.15, u = 1 - t;
23
+ return [
24
+ u ** 3 * 15.13 + 3 * u * u * t * 15.66 + 3 * u * t * t * 16.9 + t ** 3 * 18,
25
+ u ** 3 * 11.73 + 3 * u * u * t * 12.7 + 3 * u * t * t * 13 + t ** 3 * 13,
26
+ ];
27
+ }
28
+ const a = -Math.PI / 2 + ((q - 0.44) / 0.56) * Math.PI;
29
+ return [18 + 4 * Math.cos(a), 17 + 4 * Math.sin(a)];
30
+ }
31
+ export const REST = 0.37;
32
+ // An outbound packet completes its route before an invisible reset. No visible reverse travel.
33
+ export function packetAt(seconds, start) {
34
+ const first = 0.18 + 0.68 * (1 - start), end = first + 0.12 + 0.04 + 0.1 + 0.48 + 0.12;
35
+ if (seconds >= end)
36
+ return packetAt((seconds - end) % (0.18 + 0.68 * (1 - REST) + 0.12 + 0.04 + 0.1 + 0.48 + 0.12), REST);
37
+ if (seconds < first)
38
+ return { p: start + (1 - start) * smooth(seconds / first), opacity: 1 };
39
+ let t = seconds - first;
40
+ if (t < 0.12)
41
+ return { p: 1, opacity: 1 - smooth(t / 0.12) };
42
+ t -= 0.12;
43
+ if (t < 0.04)
44
+ return { p: 0, opacity: 0 };
45
+ t -= 0.04;
46
+ if (t < 0.1)
47
+ return { p: 0, opacity: smooth(t / 0.1) };
48
+ t -= 0.1;
49
+ return { p: REST * smooth(t / 0.48), opacity: 1 };
50
+ }
package/dist/index.d.ts CHANGED
@@ -469,3 +469,13 @@ export { VaultIcon, vaultStates, type VaultState, type VaultIconProps, } from ".
469
469
  export { ScaleIcon, scaleStates, type ScaleState, type ScaleIconProps, } from "./icons/scale/scale-icon.js";
470
470
  export { LighthouseIcon, lighthouseStates, type LighthouseState, type LighthouseIconProps, } from "./icons/lighthouse/lighthouse-icon.js";
471
471
  export { MailboxIcon, mailboxStates, type MailboxState, type MailboxIconProps, } from "./icons/mailbox/mailbox-icon.js";
472
+ export { BlocksIcon, blocksStates, type BlocksState, type BlocksIconProps, } from "./icons/blocks/blocks-icon.js";
473
+ export { BrickWallIcon, brickWallStates, type BrickWallState, type BrickWallIconProps, } from "./icons/brick-wall/brick-wall-icon.js";
474
+ export { WebhookIcon, webhookStates, type WebhookState, type WebhookIconProps, } from "./icons/webhook/webhook-icon.js";
475
+ export { BotIcon, botStates, type BotState, type BotIconProps } from "./icons/bot/bot-icon.js";
476
+ export { TargetIcon, targetStates, type TargetState, type TargetIconProps, } from "./icons/target/target-icon.js";
477
+ export { DiceIcon, diceStates, type DiceState, type DiceIconProps } from "./icons/dice/dice-icon.js";
478
+ export { BadgePercentIcon, badgePercentStates, type BadgePercentState, type BadgePercentIconProps, } from "./icons/badge-percent/badge-percent-icon.js";
479
+ export { InfinityIcon, infinityStates, type InfinityState, type InfinityIconProps, } from "./icons/infinity/infinity-icon.js";
480
+ export { FuelIcon, fuelStates, type FuelState, type FuelIconProps } from "./icons/fuel/fuel-icon.js";
481
+ export { FootprintsIcon, footprintsStates, type FootprintsState, type FootprintsIconProps, } from "./icons/footprints/footprints-icon.js";
package/dist/index.js CHANGED
@@ -468,3 +468,13 @@ export { VaultIcon, vaultStates, } from "./icons/vault/vault-icon.js";
468
468
  export { ScaleIcon, scaleStates, } from "./icons/scale/scale-icon.js";
469
469
  export { LighthouseIcon, lighthouseStates, } from "./icons/lighthouse/lighthouse-icon.js";
470
470
  export { MailboxIcon, mailboxStates, } from "./icons/mailbox/mailbox-icon.js";
471
+ export { BlocksIcon, blocksStates, } from "./icons/blocks/blocks-icon.js";
472
+ export { BrickWallIcon, brickWallStates, } from "./icons/brick-wall/brick-wall-icon.js";
473
+ export { WebhookIcon, webhookStates, } from "./icons/webhook/webhook-icon.js";
474
+ export { BotIcon, botStates } from "./icons/bot/bot-icon.js";
475
+ export { TargetIcon, targetStates, } from "./icons/target/target-icon.js";
476
+ export { DiceIcon, diceStates } from "./icons/dice/dice-icon.js";
477
+ export { BadgePercentIcon, badgePercentStates, } from "./icons/badge-percent/badge-percent-icon.js";
478
+ export { InfinityIcon, infinityStates, } from "./icons/infinity/infinity-icon.js";
479
+ export { FuelIcon, fuelStates } from "./icons/fuel/fuel-icon.js";
480
+ export { FootprintsIcon, footprintsStates, } from "./icons/footprints/footprints-icon.js";
@@ -328,6 +328,16 @@ export interface IconColors {
328
328
  tag: never;
329
329
  gift: never;
330
330
  ticket: never;
331
+ footprints: never;
332
+ fuel: never;
333
+ infinity: never;
334
+ 'badge-percent': never;
335
+ dice: never;
336
+ target: never;
337
+ bot: never;
338
+ webhook: never;
339
+ 'brick-wall': never;
340
+ blocks: never;
331
341
  mailbox: never;
332
342
  lighthouse: never;
333
343
  scale: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weasel-icons",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Stateful animated React SVG icons. Icons that overreact beautifully.",
5
5
  "license": "MIT",
6
6
  "author": "Vinod Murugan",
@@ -2359,6 +2359,56 @@
2359
2359
  "types": "./dist/icons/mailbox/mailbox-icon.d.ts",
2360
2360
  "import": "./dist/icons/mailbox/mailbox-icon.js",
2361
2361
  "default": "./dist/icons/mailbox/mailbox-icon.js"
2362
+ },
2363
+ "./blocks": {
2364
+ "types": "./dist/icons/blocks/blocks-icon.d.ts",
2365
+ "import": "./dist/icons/blocks/blocks-icon.js",
2366
+ "default": "./dist/icons/blocks/blocks-icon.js"
2367
+ },
2368
+ "./brick-wall": {
2369
+ "types": "./dist/icons/brick-wall/brick-wall-icon.d.ts",
2370
+ "import": "./dist/icons/brick-wall/brick-wall-icon.js",
2371
+ "default": "./dist/icons/brick-wall/brick-wall-icon.js"
2372
+ },
2373
+ "./webhook": {
2374
+ "types": "./dist/icons/webhook/webhook-icon.d.ts",
2375
+ "import": "./dist/icons/webhook/webhook-icon.js",
2376
+ "default": "./dist/icons/webhook/webhook-icon.js"
2377
+ },
2378
+ "./bot": {
2379
+ "types": "./dist/icons/bot/bot-icon.d.ts",
2380
+ "import": "./dist/icons/bot/bot-icon.js",
2381
+ "default": "./dist/icons/bot/bot-icon.js"
2382
+ },
2383
+ "./target": {
2384
+ "types": "./dist/icons/target/target-icon.d.ts",
2385
+ "import": "./dist/icons/target/target-icon.js",
2386
+ "default": "./dist/icons/target/target-icon.js"
2387
+ },
2388
+ "./dice": {
2389
+ "types": "./dist/icons/dice/dice-icon.d.ts",
2390
+ "import": "./dist/icons/dice/dice-icon.js",
2391
+ "default": "./dist/icons/dice/dice-icon.js"
2392
+ },
2393
+ "./badge-percent": {
2394
+ "types": "./dist/icons/badge-percent/badge-percent-icon.d.ts",
2395
+ "import": "./dist/icons/badge-percent/badge-percent-icon.js",
2396
+ "default": "./dist/icons/badge-percent/badge-percent-icon.js"
2397
+ },
2398
+ "./infinity": {
2399
+ "types": "./dist/icons/infinity/infinity-icon.d.ts",
2400
+ "import": "./dist/icons/infinity/infinity-icon.js",
2401
+ "default": "./dist/icons/infinity/infinity-icon.js"
2402
+ },
2403
+ "./fuel": {
2404
+ "types": "./dist/icons/fuel/fuel-icon.d.ts",
2405
+ "import": "./dist/icons/fuel/fuel-icon.js",
2406
+ "default": "./dist/icons/fuel/fuel-icon.js"
2407
+ },
2408
+ "./footprints": {
2409
+ "types": "./dist/icons/footprints/footprints-icon.d.ts",
2410
+ "import": "./dist/icons/footprints/footprints-icon.js",
2411
+ "default": "./dist/icons/footprints/footprints-icon.js"
2362
2412
  }
2363
2413
  },
2364
2414
  "files": [