@supermousejs/labs 2.1.1 → 2.3.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/CHANGELOG.md +28 -0
- package/LICENSE.md +21 -21
- package/README.md +45 -42
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +114 -107
- package/dist/index.umd.js +9 -1
- package/meta.json +148 -59
- package/package.json +5 -5
- package/src/SmartIcon.ts +200 -239
- package/src/SmartRing.ts +105 -105
- package/src/Sparkles.ts +168 -168
- package/src/TextRing.ts +159 -156
- package/src/index.ts +4 -5
- package/tsconfig.json +4 -21
- package/vite.config.ts +24 -22
package/meta.json
CHANGED
|
@@ -1,59 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "smart-icon",
|
|
4
|
+
"name": "SmartIcon",
|
|
5
|
+
"package": "@supermousejs/labs",
|
|
6
|
+
"description": "Advanced state machine that morphs SVGs based on semantic context.",
|
|
7
|
+
"code": "import { SmartIcon } from '@supermousejs/labs';\n\napp.use(SmartIcon({ icons: { ... } }));",
|
|
8
|
+
"recipeId": "context-icon",
|
|
9
|
+
"icon": "labs",
|
|
10
|
+
"options": [
|
|
11
|
+
{
|
|
12
|
+
"name": "icons",
|
|
13
|
+
"type": "Record<string, string>",
|
|
14
|
+
"default": "{}",
|
|
15
|
+
"description": "Map of state names to SVG strings.",
|
|
16
|
+
"reactive": false
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "size",
|
|
20
|
+
"type": "number",
|
|
21
|
+
"default": "24",
|
|
22
|
+
"description": "Size of the icon container.",
|
|
23
|
+
"reactive": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "color",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"default": "'black'",
|
|
29
|
+
"description": "Icon fill color (currentColor).",
|
|
30
|
+
"reactive": true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "anchor",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"default": "'center'",
|
|
36
|
+
"description": "Alignment (center, top-left, etc).",
|
|
37
|
+
"reactive": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "offset",
|
|
41
|
+
"type": "[number, number]",
|
|
42
|
+
"default": "[0, 0]",
|
|
43
|
+
"description": "Fixed offset.",
|
|
44
|
+
"reactive": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "transitionDuration",
|
|
48
|
+
"type": "number",
|
|
49
|
+
"default": "200",
|
|
50
|
+
"description": "Morph transition time in ms.",
|
|
51
|
+
"reactive": false
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "smart-ring",
|
|
57
|
+
"name": "SmartRing",
|
|
58
|
+
"package": "@supermousejs/labs",
|
|
59
|
+
"description": "A reactive ring that distorts with velocity and adapts to stuck elements.",
|
|
60
|
+
"code": "import { SmartRing } from '@supermousejs/labs';\n\napp.use(SmartRing({ size: 24, color: '#f59e0b', enableSkew: true }));",
|
|
61
|
+
"icon": "ring",
|
|
62
|
+
"options": [
|
|
63
|
+
{
|
|
64
|
+
"name": "size",
|
|
65
|
+
"type": "number",
|
|
66
|
+
"default": "20",
|
|
67
|
+
"description": "Base diameter.",
|
|
68
|
+
"reactive": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "hoverSize",
|
|
72
|
+
"type": "number",
|
|
73
|
+
"default": "40",
|
|
74
|
+
"description": "Diameter on hover.",
|
|
75
|
+
"reactive": true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "enableSkew",
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"default": "false",
|
|
81
|
+
"description": "Distort shape based on velocity.",
|
|
82
|
+
"reactive": false
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "sparkles",
|
|
88
|
+
"name": "Sparkles",
|
|
89
|
+
"package": "@supermousejs/labs",
|
|
90
|
+
"description": "Emits particle trails based on movement velocity.",
|
|
91
|
+
"code": "import { Sparkles } from '@supermousejs/labs';\n\napp.use(Sparkles({ color: '#f59e0b', frequency: 10 }));",
|
|
92
|
+
"icon": "trail",
|
|
93
|
+
"options": [
|
|
94
|
+
{
|
|
95
|
+
"name": "color",
|
|
96
|
+
"type": "string",
|
|
97
|
+
"default": "'#ff00ff'",
|
|
98
|
+
"description": "Particle color.",
|
|
99
|
+
"reactive": true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "frequency",
|
|
103
|
+
"type": "number",
|
|
104
|
+
"default": "10",
|
|
105
|
+
"description": "Pixels per spawn.",
|
|
106
|
+
"reactive": false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "decay",
|
|
110
|
+
"type": "number",
|
|
111
|
+
"default": "0.05",
|
|
112
|
+
"description": "Fade rate.",
|
|
113
|
+
"reactive": false
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "text-ring",
|
|
119
|
+
"name": "TextRing",
|
|
120
|
+
"package": "@supermousejs/labs",
|
|
121
|
+
"description": "Rotates text around the cursor position.",
|
|
122
|
+
"code": "import { TextRing } from '@supermousejs/labs';\n\napp.use(TextRing({ text: 'LOADING • ', radius: 40 }));",
|
|
123
|
+
"icon": "text",
|
|
124
|
+
"options": [
|
|
125
|
+
{
|
|
126
|
+
"name": "text",
|
|
127
|
+
"type": "string",
|
|
128
|
+
"default": "'SUPERMOUSE • '",
|
|
129
|
+
"description": "Text content.",
|
|
130
|
+
"reactive": true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "radius",
|
|
134
|
+
"type": "number",
|
|
135
|
+
"default": "60",
|
|
136
|
+
"description": "Ring radius.",
|
|
137
|
+
"reactive": true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "speed",
|
|
141
|
+
"type": "number",
|
|
142
|
+
"default": "0.5",
|
|
143
|
+
"description": "Rotation speed deg/frame.",
|
|
144
|
+
"reactive": true
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supermousejs/labs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"main": "dist/index.umd.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"url": "https://github.com/Whitestar14/supermouse-js",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@supermousejs/utils": "2.
|
|
12
|
-
"@supermousejs/zoetrope": "2.
|
|
11
|
+
"@supermousejs/utils": "2.3.0",
|
|
12
|
+
"@supermousejs/zoetrope": "2.3.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@supermousejs/core": "2.0
|
|
15
|
+
"@supermousejs/core": "2.2.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@supermousejs/core": "2.0
|
|
18
|
+
"@supermousejs/core": "2.2.0"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|