weasel-icons 0.1.0 → 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.
Files changed (104) hide show
  1. package/README.md +13 -4
  2. package/THIRD_PARTY_NOTICES.md +14 -4
  3. package/dist/icons/alert/alert-icon.d.ts +6 -0
  4. package/dist/icons/alert/alert-icon.js +22 -0
  5. package/dist/icons/alert/alert-rig.d.ts +12 -0
  6. package/dist/icons/alert/alert-rig.js +25 -0
  7. package/dist/icons/badge-check/badge-check-icon.d.ts +5 -0
  8. package/dist/icons/badge-check/badge-check-icon.js +33 -0
  9. package/dist/icons/badge-check/badge-check-rig.d.ts +14 -0
  10. package/dist/icons/badge-check/badge-check-rig.js +36 -0
  11. package/dist/icons/bell/bell-icon.js +1 -1
  12. package/dist/icons/bulb/bulb-icon.d.ts +5 -0
  13. package/dist/icons/bulb/bulb-icon.js +25 -0
  14. package/dist/icons/bulb/bulb-rig.d.ts +13 -0
  15. package/dist/icons/bulb/bulb-rig.js +37 -0
  16. package/dist/icons/check/check-icon.d.ts +5 -0
  17. package/dist/icons/check/check-icon.js +26 -0
  18. package/dist/icons/check/check-rig.d.ts +6 -0
  19. package/dist/icons/check/check-rig.js +38 -0
  20. package/dist/icons/clapperboard/clapperboard-icon.d.ts +5 -0
  21. package/dist/icons/clapperboard/clapperboard-icon.js +18 -0
  22. package/dist/icons/clapperboard/clapperboard-rig.d.ts +12 -0
  23. package/dist/icons/clapperboard/clapperboard-rig.js +25 -0
  24. package/dist/icons/close/close-icon.d.ts +5 -0
  25. package/dist/icons/close/close-icon.js +27 -0
  26. package/dist/icons/close/close-rig.d.ts +10 -0
  27. package/dist/icons/close/close-rig.js +31 -0
  28. package/dist/icons/copy/copy-icon.d.ts +5 -0
  29. package/dist/icons/copy/copy-icon.js +31 -0
  30. package/dist/icons/copy/copy-rig.d.ts +13 -0
  31. package/dist/icons/copy/copy-rig.js +44 -0
  32. package/dist/icons/cursor/cursor-icon.d.ts +5 -0
  33. package/dist/icons/cursor/cursor-icon.js +32 -0
  34. package/dist/icons/cursor/cursor-rig.d.ts +21 -0
  35. package/dist/icons/cursor/cursor-rig.js +63 -0
  36. package/dist/icons/delete/delete-icon.d.ts +5 -0
  37. package/dist/icons/delete/delete-icon.js +25 -0
  38. package/dist/icons/delete/delete-rig.d.ts +15 -0
  39. package/dist/icons/delete/delete-rig.js +33 -0
  40. package/dist/icons/dog/dog-icon.js +1 -1
  41. package/dist/icons/download/download-icon.js +1 -1
  42. package/dist/icons/eye/eye-icon.d.ts +5 -0
  43. package/dist/icons/eye/eye-icon.js +27 -0
  44. package/dist/icons/eye/eye-rig.d.ts +9 -0
  45. package/dist/icons/eye/eye-rig.js +37 -0
  46. package/dist/icons/heart/heart-icon.js +1 -1
  47. package/dist/icons/heart/heart-rig.js +1 -1
  48. package/dist/icons/link/link-icon.d.ts +5 -0
  49. package/dist/icons/link/link-icon.js +30 -0
  50. package/dist/icons/link/link-rig.d.ts +13 -0
  51. package/dist/icons/link/link-rig.js +37 -0
  52. package/dist/icons/monkey/monkey-icon.js +1 -1
  53. package/dist/icons/plug/plug-icon.d.ts +5 -0
  54. package/dist/icons/plug/plug-icon.js +21 -0
  55. package/dist/icons/plug/plug-rig.d.ts +16 -0
  56. package/dist/icons/plug/plug-rig.js +29 -0
  57. package/dist/icons/refresh/refresh-icon.d.ts +5 -0
  58. package/dist/icons/refresh/refresh-icon.js +40 -0
  59. package/dist/icons/refresh/refresh-rig.d.ts +11 -0
  60. package/dist/icons/refresh/refresh-rig.js +30 -0
  61. package/dist/icons/replace/replace-icon.d.ts +5 -0
  62. package/dist/icons/replace/replace-icon.js +25 -0
  63. package/dist/icons/replace/replace-rig.d.ts +14 -0
  64. package/dist/icons/replace/replace-rig.js +24 -0
  65. package/dist/icons/rocket/rocket-icon.js +1 -1
  66. package/dist/icons/search/search-icon.js +1 -1
  67. package/dist/icons/shield/shield-icon.d.ts +5 -0
  68. package/dist/icons/shield/shield-icon.js +25 -0
  69. package/dist/icons/shield/shield-rig.d.ts +23 -0
  70. package/dist/icons/shield/shield-rig.js +42 -0
  71. package/dist/icons/ship/ship-icon.js +1 -1
  72. package/dist/icons/sparkle/sparkle-icon.d.ts +5 -0
  73. package/dist/icons/sparkle/sparkle-icon.js +27 -0
  74. package/dist/icons/sparkle/sparkle-rig.d.ts +8 -0
  75. package/dist/icons/sparkle/sparkle-rig.js +6 -0
  76. package/dist/icons/sparkles/sparkles-icon.d.ts +5 -0
  77. package/dist/icons/sparkles/sparkles-icon.js +27 -0
  78. package/dist/icons/sparkles/sparkles-rig.d.ts +14 -0
  79. package/dist/icons/sparkles/sparkles-rig.js +24 -0
  80. package/dist/icons/star/star-icon.d.ts +5 -0
  81. package/dist/icons/star/star-icon.js +38 -0
  82. package/dist/icons/star/star-rig.d.ts +20 -0
  83. package/dist/icons/star/star-rig.js +61 -0
  84. package/dist/icons/swap/swap-icon.d.ts +5 -0
  85. package/dist/icons/swap/swap-icon.js +26 -0
  86. package/dist/icons/swap/swap-rig.d.ts +10 -0
  87. package/dist/icons/swap/swap-rig.js +24 -0
  88. package/dist/icons/wave/wave-icon.d.ts +5 -0
  89. package/dist/icons/wave/wave-icon.js +18 -0
  90. package/dist/icons/wave/wave-rig.d.ts +8 -0
  91. package/dist/icons/wave/wave-rig.js +39 -0
  92. package/dist/index.d.ts +21 -2
  93. package/dist/index.js +20 -1
  94. package/dist/shared/icon-colors.d.ts +23 -4
  95. package/dist/shared/icon-types.d.ts +1 -0
  96. package/dist/shared/sparkle-motion.d.ts +12 -0
  97. package/dist/shared/sparkle-motion.js +38 -0
  98. package/dist/shared/use-icon-motion.d.ts +4 -0
  99. package/dist/shared/use-icon-motion.js +26 -0
  100. package/package.json +104 -9
  101. package/dist/icons/leaf/leaf-icon.d.ts +0 -6
  102. package/dist/icons/leaf/leaf-icon.js +0 -29
  103. package/dist/icons/leaf/leaf-rig.d.ts +0 -25
  104. package/dist/icons/leaf/leaf-rig.js +0 -201
@@ -1,201 +0,0 @@
1
- import { behaviorBeat } from "../../shared/behavior-curves.js";
2
- /** Lucide-informed blade: one closed contour and one connected petiole/midrib. */
3
- export const leafStates = ['resting', 'growing', 'breezy', 'wilted'];
4
- // Corresponding cubic landmarks keep the same anatomy through all twelve edges.
5
- // Wilt is a bent petiole supporting a hanging blade, not a rotated healthy leaf.
6
- const REST = {
7
- blade: [
8
- [7, 17],
9
- [4.1, 14.8],
10
- [5.1, 10.2],
11
- [8.3, 8.5],
12
- [11.3, 6.9],
13
- [15.8, 7.8],
14
- [19, 3.2],
15
- [20.7, 8.7],
16
- [20.4, 13.6],
17
- [16.7, 16.9],
18
- [13.6, 19.7],
19
- [9.2, 19.1],
20
- [7, 17],
21
- ],
22
- stem: [
23
- [3, 21],
24
- [4, 19],
25
- [5.8, 18],
26
- [7, 17],
27
- [9, 15],
28
- [12, 12],
29
- [15.5, 9],
30
- ],
31
- };
32
- const GROW = {
33
- blade: [
34
- [7, 17],
35
- [3.9, 14.3],
36
- [4.6, 9.5],
37
- [7.8, 7.5],
38
- [10.8, 5.6],
39
- [14.8, 6.7],
40
- [17.5, 2.8],
41
- [20.1, 7.2],
42
- [20.7, 12.9],
43
- [16.5, 16.6],
44
- [13.5, 19.4],
45
- [9.2, 19.2],
46
- [7, 17],
47
- ],
48
- stem: [
49
- [3, 21],
50
- [4, 19],
51
- [5.8, 18],
52
- [7, 17],
53
- [9.2, 14.8],
54
- [12.3, 11.3],
55
- [14.8, 8],
56
- ],
57
- };
58
- const BREEZE = {
59
- blade: [
60
- [7, 17],
61
- [4.7, 14.7],
62
- [6.1, 10.5],
63
- [9.2, 9],
64
- [12.3, 7.5],
65
- [16.7, 8.2],
66
- [20.5, 5.5],
67
- [21, 10.2],
68
- [19.9, 14.4],
69
- [16.6, 17],
70
- [13.3, 19.6],
71
- [9.2, 19],
72
- [7, 17],
73
- ],
74
- stem: [
75
- [3, 21],
76
- [4, 19],
77
- [5.8, 18],
78
- [7, 17],
79
- [9.3, 15.3],
80
- [12.7, 12.5],
81
- [16.5, 10.2],
82
- ],
83
- };
84
- const WILT = {
85
- blade: [
86
- [9, 9],
87
- [11.8, 6.8],
88
- [16.1, 7.4],
89
- [18, 10.6],
90
- [19.6, 13.1],
91
- [18.3, 16.2],
92
- [18.7, 20],
93
- [14.9, 19],
94
- [11.8, 17.5],
95
- [10.3, 14.8],
96
- [9.1, 12.7],
97
- [8.9, 10.7],
98
- [9, 9],
99
- ],
100
- stem: [
101
- [3, 21],
102
- [3, 15.8],
103
- [4.6, 9.8],
104
- [9, 9],
105
- [12.1, 8.4],
106
- [15.5, 11.7],
107
- [16.3, 15.6],
108
- ],
109
- };
110
- const POSES = [REST, GROW, BREEZE, WILT];
111
- export const LEAF_SCENE_SECONDS = 5.2;
112
- export const leafBehaviors = {
113
- resting: ['a quiet tip nod', 'catch a little light', 'soft blade flex'],
114
- growing: ['open toward the light', 'stretch, then unfurl the tip', 'a small proud lift'],
115
- breezy: [
116
- 'lean into a passing gust',
117
- 'tip flutters after the blade',
118
- 'longer breeze, soft recovery',
119
- ],
120
- wilted: ['petiole gives a little', 'edges curl inward', 'a tired tip settles'],
121
- };
122
- const n = (v) => Number(v.toFixed(5));
123
- const path = (points, closed) => points.map((p, i) => `${i === 0 ? 'M' : i % 3 === 1 ? 'C' : ''}${n(p[0])} ${n(p[1])}`).join(' ') +
124
- (closed ? ' Z' : '');
125
- export function sampleLeaf(weights, time = 0, alive = 0) {
126
- const [resting, growing, breezy, wilted] = weights;
127
- const life = Math.max(0, Math.min(1, alive));
128
- const t = Math.max(0, time) % LEAF_SCENE_SECONDS;
129
- const scene = Math.floor(Math.max(0, time) / LEAF_SCENE_SECONDS) % 3;
130
- const beat = (start, rise = 0.6, hold = 0.15, fall = 1) => Math.max(0, behaviorBeat(t, start, rise, hold, fall));
131
- const a = beat(0.25), b = beat(1.7, 0.45, 0.12, 0.9), long = beat(0.35, 1.05, 0.35, 1.4);
132
- // A continuous low-amplitude flex supports the phrases; the root never drifts.
133
- // Delayed tip curvature makes this a flexible blade, not a rigid pendulum.
134
- let bend = (resting * 0.16 + growing * 0.18) * Math.sin(time * 1.65) +
135
- breezy * (1.05 * Math.sin(time * 2.6) + 0.2 * Math.sin(time * 4.1)) +
136
- wilted * 0.1 * Math.sin(time * 1.4);
137
- let curl = breezy * (0.38 * Math.sin(time * 2.6 - 0.55) + 0.12 * Math.sin(time * 4.1 - 0.8));
138
- let dip = wilted * 0.1 * Math.sin(time * 1.4), lift = 0, spread = 0;
139
- let glint = 0;
140
- if (scene === 0) {
141
- curl += resting * a * 0.65;
142
- lift += growing * a * 0.65;
143
- spread += growing * a * 0.075;
144
- bend += breezy * a * 0.48;
145
- curl += breezy * b * 0.26;
146
- dip += wilted * a * 0.58;
147
- }
148
- else if (scene === 1) {
149
- bend -= resting * a * 0.2;
150
- glint = (resting * 0.2 + growing * 0.58) * b;
151
- lift += growing * a * 0.4;
152
- curl -= growing * b * 0.55;
153
- curl += breezy * (a * 0.3 - b * 0.36);
154
- bend += breezy * a * 0.24;
155
- spread -= wilted * a * 0.12;
156
- curl += wilted * b * 0.35;
157
- }
158
- else {
159
- spread += resting * long * 0.018;
160
- lift += growing * long * 0.75;
161
- spread += growing * long * 0.055;
162
- bend += breezy * long * 0.6;
163
- curl += breezy * long * 0.3;
164
- dip += wilted * long * 0.35;
165
- curl += wilted * long * 0.55;
166
- }
167
- const deform = ([x, y], part, index) => {
168
- const u = (x - 3) / 18, v = (21 - y) / 18;
169
- // The blade base, its duplicate closing point and the midrib joint share
170
- // precisely one deformation. Only the blade's free edges can spread.
171
- const freeEdge = part === 'blade' && ![0, 6, 12].includes(index);
172
- const center = 3 + (21 - y) * 0.8;
173
- return [
174
- x + life * (bend * v * v + (freeEdge ? (x - center) * spread : 0)),
175
- y + life * (dip * u * u - lift * v + curl * u * u * u),
176
- ];
177
- };
178
- const blend = (part) => POSES[0][part]
179
- .map((_, j) => [
180
- POSES.reduce((v, p, i) => v + p[part][j][0] * weights[i], 0),
181
- POSES.reduce((v, p, i) => v + p[part][j][1] * weights[i], 0),
182
- ])
183
- .map((p, j) => deform(p, part, j));
184
- const blade = blend('blade'), stem = blend('stem');
185
- const wind = [0, 1].map((i) => {
186
- const phase = (((time * 0.55 + i * 0.45) % 1) + 1) % 1;
187
- return {
188
- opacity: life * breezy ** 2 * 0.42 * Math.sin(Math.PI * phase) ** 2,
189
- offset: life > 0 && breezy > 0 ? life * breezy * (3 - phase * 9) : 0,
190
- };
191
- });
192
- return {
193
- blade: path(blade, true),
194
- stem: path(stem, false),
195
- bladePoints: blade,
196
- stemPoints: stem,
197
- tint: growing * (0.09 + life * a * 0.025),
198
- wind,
199
- glint: life * glint,
200
- };
201
- }