@nice2dev/icons-cursor 1.0.10

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 (58) hide show
  1. package/README.md +241 -0
  2. package/dist/createCursorIcon-CCO9eeBk.mjs +170 -0
  3. package/dist/createCursorIcon-CCO9eeBk.mjs.map +1 -0
  4. package/dist/createCursorIcon-Crwdo_Qk.js +169 -0
  5. package/dist/createCursorIcon-Crwdo_Qk.js.map +1 -0
  6. package/dist/createCursorIcon.d.ts +11 -0
  7. package/dist/createCursorIcon.d.ts.map +1 -0
  8. package/dist/cursorBuilder.d.ts +242 -0
  9. package/dist/cursorBuilder.d.ts.map +1 -0
  10. package/dist/index.cjs +288 -0
  11. package/dist/index.cjs.map +1 -0
  12. package/dist/index.d.ts +101 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.mjs +292 -0
  15. package/dist/index.mjs.map +1 -0
  16. package/dist/pointers-DW_cbtGT.mjs +90 -0
  17. package/dist/pointers-DW_cbtGT.mjs.map +1 -0
  18. package/dist/pointers-DxPqgPxN.js +89 -0
  19. package/dist/pointers-DxPqgPxN.js.map +1 -0
  20. package/dist/pointers.cjs +21 -0
  21. package/dist/pointers.cjs.map +1 -0
  22. package/dist/pointers.d.ts +36 -0
  23. package/dist/pointers.d.ts.map +1 -0
  24. package/dist/pointers.mjs +21 -0
  25. package/dist/pointers.mjs.map +1 -0
  26. package/dist/selection-CINU3bsI.js +101 -0
  27. package/dist/selection-CINU3bsI.js.map +1 -0
  28. package/dist/selection-W-1ZhqSv.mjs +102 -0
  29. package/dist/selection-W-1ZhqSv.mjs.map +1 -0
  30. package/dist/selection.cjs +21 -0
  31. package/dist/selection.cjs.map +1 -0
  32. package/dist/selection.d.ts +36 -0
  33. package/dist/selection.d.ts.map +1 -0
  34. package/dist/selection.mjs +21 -0
  35. package/dist/selection.mjs.map +1 -0
  36. package/dist/status-BBrDqBw_.mjs +111 -0
  37. package/dist/status-BBrDqBw_.mjs.map +1 -0
  38. package/dist/status-L6N47QMq.js +110 -0
  39. package/dist/status-L6N47QMq.js.map +1 -0
  40. package/dist/status.cjs +21 -0
  41. package/dist/status.cjs.map +1 -0
  42. package/dist/status.d.ts +36 -0
  43. package/dist/status.d.ts.map +1 -0
  44. package/dist/status.mjs +21 -0
  45. package/dist/status.mjs.map +1 -0
  46. package/dist/tools-DbPCbk54.mjs +108 -0
  47. package/dist/tools-DbPCbk54.mjs.map +1 -0
  48. package/dist/tools-ttgDzC_5.js +107 -0
  49. package/dist/tools-ttgDzC_5.js.map +1 -0
  50. package/dist/tools.cjs +21 -0
  51. package/dist/tools.cjs.map +1 -0
  52. package/dist/tools.d.ts +36 -0
  53. package/dist/tools.d.ts.map +1 -0
  54. package/dist/tools.mjs +21 -0
  55. package/dist/tools.mjs.map +1 -0
  56. package/dist/types.d.ts +55 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/package.json +71 -0
package/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # @nice2dev/icons-cursor
2
+
3
+ Cursor and pointer icons for NiceToDev UI - system cursors, tools, and selection indicators.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @nice2dev/icons-cursor
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { Pointer, Crosshair, ZoomIn, Wait } from '@nice2dev/icons-cursor';
15
+
16
+ function App() {
17
+ return (
18
+ <div>
19
+ <Pointer size={24} />
20
+ <Crosshair size={24} color="#3b82f6" />
21
+ <ZoomIn variant="outlined" />
22
+ <Wait animation="spin" />
23
+ </div>
24
+ );
25
+ }
26
+ ```
27
+
28
+ ## Categories
29
+
30
+ ### Pointer Icons (15)
31
+
32
+ Basic cursor shapes and resize handles.
33
+
34
+ ```tsx
35
+ import {
36
+ Pointer,
37
+ PointerFinger,
38
+ Crosshair,
39
+ Move,
40
+ ResizeN,
41
+ ResizeS,
42
+ ResizeE,
43
+ ResizeW,
44
+ ResizeNE,
45
+ ResizeNW,
46
+ ResizeSE,
47
+ ResizeSW,
48
+ ResizeHorizontal,
49
+ ResizeVertical,
50
+ ResizeAll,
51
+ } from '@nice2dev/icons-cursor';
52
+ ```
53
+
54
+ ### Selection Icons (15)
55
+
56
+ Text/cell selection and drag cursors.
57
+
58
+ ```tsx
59
+ import {
60
+ TextCursor,
61
+ TextSelect,
62
+ CellSelection,
63
+ ColumnSelect,
64
+ RowSelect,
65
+ RangeSelect,
66
+ Grab,
67
+ Grabbing,
68
+ Drag,
69
+ DragHandle,
70
+ Lasso,
71
+ MagicWand,
72
+ SelectAll,
73
+ Deselect,
74
+ InvertSelection,
75
+ } from '@nice2dev/icons-cursor';
76
+ ```
77
+
78
+ ### Tool Icons (15)
79
+
80
+ Drawing and editing tool cursors.
81
+
82
+ ```tsx
83
+ import {
84
+ ZoomIn,
85
+ ZoomOut,
86
+ Rotate,
87
+ Pan,
88
+ Draw,
89
+ Brush,
90
+ Eraser,
91
+ Eyedropper,
92
+ Bucket,
93
+ Pen,
94
+ Line,
95
+ Rectangle,
96
+ Ellipse,
97
+ Polygon,
98
+ Crop,
99
+ } from '@nice2dev/icons-cursor';
100
+ ```
101
+
102
+ ### Status Icons (15)
103
+
104
+ System state indicators.
105
+
106
+ ```tsx
107
+ import {
108
+ Wait,
109
+ Progress,
110
+ Forbidden,
111
+ NotAllowed,
112
+ Help,
113
+ ContextMenu,
114
+ Alias,
115
+ Copy,
116
+ NoDrop,
117
+ Loading,
118
+ Busy,
119
+ Default,
120
+ Auto,
121
+ None,
122
+ Inherit,
123
+ } from '@nice2dev/icons-cursor';
124
+ ```
125
+
126
+ ## Tree-Shakable Imports
127
+
128
+ Import only what you need:
129
+
130
+ ```tsx
131
+ import { Pointer, Crosshair } from '@nice2dev/icons-cursor/pointers';
132
+ import { TextCursor, Grab } from '@nice2dev/icons-cursor/selection';
133
+ import { ZoomIn, Brush } from '@nice2dev/icons-cursor/tools';
134
+ import { Wait, Help } from '@nice2dev/icons-cursor/status';
135
+ ```
136
+
137
+ ## Props
138
+
139
+ | Prop | Type | Default | Description |
140
+ | ------------------- | ------------------------------------- | ---------------- | --------------------------- |
141
+ | `size` | `number \| string` | `24` | Icon size in pixels |
142
+ | `color` | `string` | `'currentColor'` | Icon color |
143
+ | `secondaryColor` | `string` | - | Secondary color for duotone |
144
+ | `variant` | `'filled' \| 'outlined' \| 'duotone'` | `'filled'` | Rendering variant |
145
+ | `animation` | `CursorIconAnimation` | - | Animation effect |
146
+ | `animationDuration` | `number` | `1000` | Animation duration (ms) |
147
+ | `title` | `string` | - | Accessibility title |
148
+ | `desc` | `string` | - | Accessibility description |
149
+
150
+ ## Animations
151
+
152
+ Available SMIL-based animations:
153
+
154
+ - `pulse` - Opacity pulsing
155
+ - `grow` - Scale up and down
156
+ - `shake` - Horizontal shaking
157
+ - `spin` - Continuous rotation
158
+ - `bounce` - Vertical bouncing
159
+ - `fade` - Fade in and out
160
+ - `flip` - 180° rotation
161
+ - `slide` - Horizontal sliding
162
+ - `glow` - Drop shadow glow
163
+
164
+ ```tsx
165
+ <Wait animation="spin" animationDuration={500} />
166
+ <Progress animation="pulse" />
167
+ <Loading animation="spin" />
168
+ ```
169
+
170
+ ## Variants
171
+
172
+ ```tsx
173
+ // Solid fill (default)
174
+ <Pointer variant="filled" />
175
+
176
+ // Stroke outline only
177
+ <Pointer variant="outlined" />
178
+
179
+ // Background fill + stroke outline
180
+ <Pointer variant="duotone" secondaryColor="#e5e7eb" />
181
+ ```
182
+
183
+ ## Custom Icons
184
+
185
+ Create custom cursor icons:
186
+
187
+ ```tsx
188
+ import { createCursorIcon } from '@nice2dev/icons-cursor';
189
+
190
+ const MyCustomCursor = createCursorIcon(
191
+ 'MyCustomCursor',
192
+ 'M5.5 3.21V20.8l5.25-5.25h6.56L5.5 3.21z',
193
+ '#3b82f6', // optional default color
194
+ );
195
+
196
+ <MyCustomCursor size={24} />;
197
+ ```
198
+
199
+ ## CSS Cursor Integration
200
+
201
+ Use icons as actual CSS cursors:
202
+
203
+ ```tsx
204
+ import { Pointer } from '@nice2dev/icons-cursor';
205
+ import { renderToStaticMarkup } from 'react-dom/server';
206
+
207
+ // Convert to data URL
208
+ const svgString = renderToStaticMarkup(<Pointer size={24} color="#000" />);
209
+ const dataUrl = `data:image/svg+xml,${encodeURIComponent(svgString)}`;
210
+
211
+ // Use as CSS cursor
212
+ element.style.cursor = `url("${dataUrl}"), auto`;
213
+ ```
214
+
215
+ ## Use Cases
216
+
217
+ - **Image editors**: Drawing tools, selection tools
218
+ - **Spreadsheet apps**: Cell/row/column selection
219
+ - **Design tools**: Transform handles, zoom controls
220
+ - **Loading states**: Wait, progress, busy indicators
221
+ - **Accessibility**: Help, context menu indicators
222
+
223
+ ## TypeScript
224
+
225
+ Full TypeScript support:
226
+
227
+ ```tsx
228
+ import type {
229
+ CursorIconProps,
230
+ CursorIconAnimation,
231
+ CursorIconVariant,
232
+ PointerIconName,
233
+ SelectionIconName,
234
+ ToolIconName,
235
+ StatusIconName,
236
+ } from '@nice2dev/icons-cursor';
237
+ ```
238
+
239
+ ## License
240
+
241
+ MIT © NiceToDev
@@ -0,0 +1,170 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import React from "react";
3
+ function getCursorAnimation(animation, duration = 1e3) {
4
+ if (!animation) {
5
+ return {};
6
+ }
7
+ const durationSec = duration / 1e3;
8
+ const animations = {
9
+ pulse: {
10
+ children: React.createElement("animate", {
11
+ attributeName: "opacity",
12
+ values: "1;0.5;1",
13
+ dur: `${durationSec}s`,
14
+ repeatCount: "indefinite"
15
+ })
16
+ },
17
+ grow: {
18
+ children: React.createElement("animateTransform", {
19
+ attributeName: "transform",
20
+ type: "scale",
21
+ values: "1;1.2;1",
22
+ dur: `${durationSec}s`,
23
+ repeatCount: "indefinite"
24
+ })
25
+ },
26
+ shake: {
27
+ children: React.createElement("animateTransform", {
28
+ attributeName: "transform",
29
+ type: "translate",
30
+ values: "0,0;-2,0;2,0;0,0",
31
+ dur: `${durationSec * 0.5}s`,
32
+ repeatCount: "indefinite"
33
+ })
34
+ },
35
+ spin: {
36
+ children: React.createElement("animateTransform", {
37
+ attributeName: "transform",
38
+ type: "rotate",
39
+ from: "0 12 12",
40
+ to: "360 12 12",
41
+ dur: `${durationSec}s`,
42
+ repeatCount: "indefinite"
43
+ })
44
+ },
45
+ bounce: {
46
+ children: React.createElement("animateTransform", {
47
+ attributeName: "transform",
48
+ type: "translate",
49
+ values: "0,0;0,-3;0,0",
50
+ dur: `${durationSec * 0.5}s`,
51
+ repeatCount: "indefinite"
52
+ })
53
+ },
54
+ fade: {
55
+ children: React.createElement("animate", {
56
+ attributeName: "opacity",
57
+ values: "1;0;1",
58
+ dur: `${durationSec * 2}s`,
59
+ repeatCount: "indefinite"
60
+ })
61
+ },
62
+ flip: {
63
+ children: React.createElement("animateTransform", {
64
+ attributeName: "transform",
65
+ type: "rotate",
66
+ values: "0 12 12;180 12 12;360 12 12",
67
+ dur: `${durationSec}s`,
68
+ repeatCount: "indefinite"
69
+ })
70
+ },
71
+ slide: {
72
+ children: React.createElement("animateTransform", {
73
+ attributeName: "transform",
74
+ type: "translate",
75
+ values: "-5,0;5,0;-5,0",
76
+ dur: `${durationSec}s`,
77
+ repeatCount: "indefinite"
78
+ })
79
+ },
80
+ glow: {
81
+ style: {
82
+ filter: "drop-shadow(0 0 3px currentColor)",
83
+ animation: `glow ${durationSec}s ease-in-out infinite`
84
+ }
85
+ }
86
+ };
87
+ return animations[animation] || {};
88
+ }
89
+ function createCursorIcon(name, path, defaultColor) {
90
+ const IconComponent = ({
91
+ size = 24,
92
+ color = defaultColor || "currentColor",
93
+ secondaryColor,
94
+ variant = "filled",
95
+ animation,
96
+ animationDuration = 1e3,
97
+ title,
98
+ desc,
99
+ className,
100
+ style,
101
+ ...props
102
+ }) => {
103
+ const animationAttrs = getCursorAnimation(animation, animationDuration);
104
+ const titleId = title ? `${name}-title` : void 0;
105
+ const descId = desc ? `${name}-desc` : void 0;
106
+ let pathElement;
107
+ switch (variant) {
108
+ case "outlined":
109
+ pathElement = /* @__PURE__ */ jsx(
110
+ "path",
111
+ {
112
+ d: path,
113
+ fill: "none",
114
+ stroke: color,
115
+ strokeWidth: 1.5,
116
+ strokeLinecap: "round",
117
+ strokeLinejoin: "round"
118
+ }
119
+ );
120
+ break;
121
+ case "duotone":
122
+ pathElement = /* @__PURE__ */ jsxs(Fragment, { children: [
123
+ /* @__PURE__ */ jsx("path", { d: path, fill: secondaryColor || `${color}33` }),
124
+ /* @__PURE__ */ jsx(
125
+ "path",
126
+ {
127
+ d: path,
128
+ fill: "none",
129
+ stroke: color,
130
+ strokeWidth: 1.5,
131
+ strokeLinecap: "round",
132
+ strokeLinejoin: "round"
133
+ }
134
+ )
135
+ ] });
136
+ break;
137
+ case "filled":
138
+ default:
139
+ pathElement = /* @__PURE__ */ jsx("path", { d: path, fill: color });
140
+ break;
141
+ }
142
+ return /* @__PURE__ */ jsxs(
143
+ "svg",
144
+ {
145
+ xmlns: "http://www.w3.org/2000/svg",
146
+ width: size,
147
+ height: size,
148
+ viewBox: "0 0 24 24",
149
+ className,
150
+ style,
151
+ role: "img",
152
+ "aria-labelledby": titleId || descId ? `${titleId || ""} ${descId || ""}`.trim() : void 0,
153
+ ...animationAttrs,
154
+ ...props,
155
+ children: [
156
+ title && /* @__PURE__ */ jsx("title", { id: titleId, children: title }),
157
+ desc && /* @__PURE__ */ jsx("desc", { id: descId, children: desc }),
158
+ pathElement
159
+ ]
160
+ }
161
+ );
162
+ };
163
+ IconComponent.displayName = name;
164
+ return IconComponent;
165
+ }
166
+ export {
167
+ createCursorIcon as c,
168
+ getCursorAnimation as g
169
+ };
170
+ //# sourceMappingURL=createCursorIcon-CCO9eeBk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCursorIcon-CCO9eeBk.mjs","sources":["../src/createCursorIcon.tsx"],"sourcesContent":["import React from 'react';\r\n\r\nimport type { CursorIconProps, CursorIconAnimation, CursorIcon } from './types';\r\n\r\n/**\r\n * Get SMIL animation attributes for cursor icons\r\n */\r\nexport function getCursorAnimation(\r\n animation: CursorIconAnimation | undefined,\r\n duration = 1000,\r\n): React.SVGAttributes<SVGSVGElement> {\r\n if (!animation) {\r\n return {};\r\n }\r\n\r\n const durationSec = duration / 1000;\r\n\r\n const animations: Record<CursorIconAnimation, React.SVGAttributes<SVGSVGElement>> = {\r\n pulse: {\r\n children: React.createElement('animate', {\r\n attributeName: 'opacity',\r\n values: '1;0.5;1',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n grow: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'scale',\r\n values: '1;1.2;1',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n shake: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'translate',\r\n values: '0,0;-2,0;2,0;0,0',\r\n dur: `${durationSec * 0.5}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n spin: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'rotate',\r\n from: '0 12 12',\r\n to: '360 12 12',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n bounce: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'translate',\r\n values: '0,0;0,-3;0,0',\r\n dur: `${durationSec * 0.5}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n fade: {\r\n children: React.createElement('animate', {\r\n attributeName: 'opacity',\r\n values: '1;0;1',\r\n dur: `${durationSec * 2}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n flip: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'rotate',\r\n values: '0 12 12;180 12 12;360 12 12',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n slide: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'translate',\r\n values: '-5,0;5,0;-5,0',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n glow: {\r\n style: {\r\n filter: 'drop-shadow(0 0 3px currentColor)',\r\n animation: `glow ${durationSec}s ease-in-out infinite`,\r\n },\r\n },\r\n };\r\n\r\n return animations[animation] || {};\r\n}\r\n\r\n/**\r\n * Factory function to create cursor icons\r\n */\r\nexport function createCursorIcon(name: string, path: string, defaultColor?: string): CursorIcon {\r\n const IconComponent = ({\r\n size = 24,\r\n color = defaultColor || 'currentColor',\r\n secondaryColor,\r\n variant = 'filled',\r\n animation,\r\n animationDuration = 1000,\r\n title,\r\n desc,\r\n className,\r\n style,\r\n ...props\r\n }: CursorIconProps) => {\r\n const animationAttrs = getCursorAnimation(animation, animationDuration);\r\n const titleId = title ? `${name}-title` : undefined;\r\n const descId = desc ? `${name}-desc` : undefined;\r\n\r\n let pathElement: React.ReactNode;\r\n\r\n switch (variant) {\r\n case 'outlined':\r\n pathElement = (\r\n <path\r\n d={path}\r\n fill=\"none\"\r\n stroke={color}\r\n strokeWidth={1.5}\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n );\r\n break;\r\n case 'duotone':\r\n pathElement = (\r\n <>\r\n <path d={path} fill={secondaryColor || `${color}33`} />\r\n <path\r\n d={path}\r\n fill=\"none\"\r\n stroke={color}\r\n strokeWidth={1.5}\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n </>\r\n );\r\n break;\r\n case 'filled':\r\n default:\r\n pathElement = <path d={path} fill={color} />;\r\n break;\r\n }\r\n\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 24 24\"\r\n className={className}\r\n style={style}\r\n role=\"img\"\r\n aria-labelledby={titleId || descId ? `${titleId || ''} ${descId || ''}`.trim() : undefined}\r\n {...animationAttrs}\r\n {...props}\r\n >\r\n {title && <title id={titleId}>{title}</title>}\r\n {desc && <desc id={descId}>{desc}</desc>}\r\n {pathElement}\r\n </svg>\r\n );\r\n };\r\n\r\n IconComponent.displayName = name;\r\n return IconComponent as CursorIcon;\r\n}\r\n"],"names":[],"mappings":";;AAOO,SAAS,mBACd,WACA,WAAW,KACyB;AACpC,MAAI,CAAC,WAAW;AACd,WAAO,CAAA;AAAA,EACT;AAEA,QAAM,cAAc,WAAW;AAE/B,QAAM,aAA8E;AAAA,IAClF,OAAO;AAAA,MACL,UAAU,MAAM,cAAc,WAAW;AAAA,QACvC,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,KAAK,GAAG,WAAW;AAAA,QACnB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAEH,MAAM;AAAA,MACJ,UAAU,MAAM,cAAc,oBAAoB;AAAA,QAChD,eAAe;AAAA,QACf,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,KAAK,GAAG,WAAW;AAAA,QACnB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAEH,OAAO;AAAA,MACL,UAAU,MAAM,cAAc,oBAAoB;AAAA,QAChD,eAAe;AAAA,QACf,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,KAAK,GAAG,cAAc,GAAG;AAAA,QACzB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAEH,MAAM;AAAA,MACJ,UAAU,MAAM,cAAc,oBAAoB;AAAA,QAChD,eAAe;AAAA,QACf,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,KAAK,GAAG,WAAW;AAAA,QACnB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAEH,QAAQ;AAAA,MACN,UAAU,MAAM,cAAc,oBAAoB;AAAA,QAChD,eAAe;AAAA,QACf,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,KAAK,GAAG,cAAc,GAAG;AAAA,QACzB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA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aAAa;AAAA,YACb,eAAc;AAAA,YACd,gBAAe;AAAA,UAAA;AAAA,QAAA;AAGnB;AAAA,MACF,KAAK;AACH,sBACE,qBAAA,UAAA,EACE,UAAA;AAAA,UAAA,oBAAC,UAAK,GAAG,MAAM,MAAM,kBAAkB,GAAG,KAAK,MAAM;AAAA,UACrD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,GAAG;AAAA,cACH,MAAK;AAAA,cACL,QAAQ;AAAA,cACR,aAAa;AAAA,cACb,eAAc;AAAA,cACd,gBAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACjB,GACF;AAEF;AAAA,MACF,KAAK;AAAA,MACL;AACE,sBAAc,oBAAC,QAAA,EAAK,GAAG,MAAM,MAAM,OAAO;AAC1C;AAAA,IAAA;AAGJ,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,SAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QACL,mBAAiB,WAAW,SAAS,GAAG,WAAW,EAAE,IAAI,UAAU,EAAE,GAAG,KAAA,IAAS;AAAA,QAChF,GAAG;AAAA,QACH,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,SAAS,oBAAC,SAAA,EAAM,IAAI,SAAU,UAAA,OAAM;AAAA,UACpC,QAAQ,oBAAC,QAAA,EAAK,IAAI,QAAS,UAAA,MAAK;AAAA,UAChC;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AAEA,gBAAc,cAAc;AAC5B,SAAO;AACT;"}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ function getCursorAnimation(animation, duration = 1e3) {
5
+ if (!animation) {
6
+ return {};
7
+ }
8
+ const durationSec = duration / 1e3;
9
+ const animations = {
10
+ pulse: {
11
+ children: React.createElement("animate", {
12
+ attributeName: "opacity",
13
+ values: "1;0.5;1",
14
+ dur: `${durationSec}s`,
15
+ repeatCount: "indefinite"
16
+ })
17
+ },
18
+ grow: {
19
+ children: React.createElement("animateTransform", {
20
+ attributeName: "transform",
21
+ type: "scale",
22
+ values: "1;1.2;1",
23
+ dur: `${durationSec}s`,
24
+ repeatCount: "indefinite"
25
+ })
26
+ },
27
+ shake: {
28
+ children: React.createElement("animateTransform", {
29
+ attributeName: "transform",
30
+ type: "translate",
31
+ values: "0,0;-2,0;2,0;0,0",
32
+ dur: `${durationSec * 0.5}s`,
33
+ repeatCount: "indefinite"
34
+ })
35
+ },
36
+ spin: {
37
+ children: React.createElement("animateTransform", {
38
+ attributeName: "transform",
39
+ type: "rotate",
40
+ from: "0 12 12",
41
+ to: "360 12 12",
42
+ dur: `${durationSec}s`,
43
+ repeatCount: "indefinite"
44
+ })
45
+ },
46
+ bounce: {
47
+ children: React.createElement("animateTransform", {
48
+ attributeName: "transform",
49
+ type: "translate",
50
+ values: "0,0;0,-3;0,0",
51
+ dur: `${durationSec * 0.5}s`,
52
+ repeatCount: "indefinite"
53
+ })
54
+ },
55
+ fade: {
56
+ children: React.createElement("animate", {
57
+ attributeName: "opacity",
58
+ values: "1;0;1",
59
+ dur: `${durationSec * 2}s`,
60
+ repeatCount: "indefinite"
61
+ })
62
+ },
63
+ flip: {
64
+ children: React.createElement("animateTransform", {
65
+ attributeName: "transform",
66
+ type: "rotate",
67
+ values: "0 12 12;180 12 12;360 12 12",
68
+ dur: `${durationSec}s`,
69
+ repeatCount: "indefinite"
70
+ })
71
+ },
72
+ slide: {
73
+ children: React.createElement("animateTransform", {
74
+ attributeName: "transform",
75
+ type: "translate",
76
+ values: "-5,0;5,0;-5,0",
77
+ dur: `${durationSec}s`,
78
+ repeatCount: "indefinite"
79
+ })
80
+ },
81
+ glow: {
82
+ style: {
83
+ filter: "drop-shadow(0 0 3px currentColor)",
84
+ animation: `glow ${durationSec}s ease-in-out infinite`
85
+ }
86
+ }
87
+ };
88
+ return animations[animation] || {};
89
+ }
90
+ function createCursorIcon(name, path, defaultColor) {
91
+ const IconComponent = ({
92
+ size = 24,
93
+ color = defaultColor || "currentColor",
94
+ secondaryColor,
95
+ variant = "filled",
96
+ animation,
97
+ animationDuration = 1e3,
98
+ title,
99
+ desc,
100
+ className,
101
+ style,
102
+ ...props
103
+ }) => {
104
+ const animationAttrs = getCursorAnimation(animation, animationDuration);
105
+ const titleId = title ? `${name}-title` : void 0;
106
+ const descId = desc ? `${name}-desc` : void 0;
107
+ let pathElement;
108
+ switch (variant) {
109
+ case "outlined":
110
+ pathElement = /* @__PURE__ */ jsxRuntime.jsx(
111
+ "path",
112
+ {
113
+ d: path,
114
+ fill: "none",
115
+ stroke: color,
116
+ strokeWidth: 1.5,
117
+ strokeLinecap: "round",
118
+ strokeLinejoin: "round"
119
+ }
120
+ );
121
+ break;
122
+ case "duotone":
123
+ pathElement = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
124
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: path, fill: secondaryColor || `${color}33` }),
125
+ /* @__PURE__ */ jsxRuntime.jsx(
126
+ "path",
127
+ {
128
+ d: path,
129
+ fill: "none",
130
+ stroke: color,
131
+ strokeWidth: 1.5,
132
+ strokeLinecap: "round",
133
+ strokeLinejoin: "round"
134
+ }
135
+ )
136
+ ] });
137
+ break;
138
+ case "filled":
139
+ default:
140
+ pathElement = /* @__PURE__ */ jsxRuntime.jsx("path", { d: path, fill: color });
141
+ break;
142
+ }
143
+ return /* @__PURE__ */ jsxRuntime.jsxs(
144
+ "svg",
145
+ {
146
+ xmlns: "http://www.w3.org/2000/svg",
147
+ width: size,
148
+ height: size,
149
+ viewBox: "0 0 24 24",
150
+ className,
151
+ style,
152
+ role: "img",
153
+ "aria-labelledby": titleId || descId ? `${titleId || ""} ${descId || ""}`.trim() : void 0,
154
+ ...animationAttrs,
155
+ ...props,
156
+ children: [
157
+ title && /* @__PURE__ */ jsxRuntime.jsx("title", { id: titleId, children: title }),
158
+ desc && /* @__PURE__ */ jsxRuntime.jsx("desc", { id: descId, children: desc }),
159
+ pathElement
160
+ ]
161
+ }
162
+ );
163
+ };
164
+ IconComponent.displayName = name;
165
+ return IconComponent;
166
+ }
167
+ exports.createCursorIcon = createCursorIcon;
168
+ exports.getCursorAnimation = getCursorAnimation;
169
+ //# sourceMappingURL=createCursorIcon-Crwdo_Qk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCursorIcon-Crwdo_Qk.js","sources":["../src/createCursorIcon.tsx"],"sourcesContent":["import React from 'react';\r\n\r\nimport type { CursorIconProps, CursorIconAnimation, CursorIcon } from './types';\r\n\r\n/**\r\n * Get SMIL animation attributes for cursor icons\r\n */\r\nexport function getCursorAnimation(\r\n animation: CursorIconAnimation | undefined,\r\n duration = 1000,\r\n): React.SVGAttributes<SVGSVGElement> {\r\n if (!animation) {\r\n return {};\r\n }\r\n\r\n const durationSec = duration / 1000;\r\n\r\n const animations: Record<CursorIconAnimation, React.SVGAttributes<SVGSVGElement>> = {\r\n pulse: {\r\n children: React.createElement('animate', {\r\n attributeName: 'opacity',\r\n values: '1;0.5;1',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n grow: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'scale',\r\n values: '1;1.2;1',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n shake: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'translate',\r\n values: '0,0;-2,0;2,0;0,0',\r\n dur: `${durationSec * 0.5}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n spin: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'rotate',\r\n from: '0 12 12',\r\n to: '360 12 12',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n bounce: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'translate',\r\n values: '0,0;0,-3;0,0',\r\n dur: `${durationSec * 0.5}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n fade: {\r\n children: React.createElement('animate', {\r\n attributeName: 'opacity',\r\n values: '1;0;1',\r\n dur: `${durationSec * 2}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n flip: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'rotate',\r\n values: '0 12 12;180 12 12;360 12 12',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n slide: {\r\n children: React.createElement('animateTransform', {\r\n attributeName: 'transform',\r\n type: 'translate',\r\n values: '-5,0;5,0;-5,0',\r\n dur: `${durationSec}s`,\r\n repeatCount: 'indefinite',\r\n }),\r\n },\r\n glow: {\r\n style: {\r\n filter: 'drop-shadow(0 0 3px currentColor)',\r\n animation: `glow ${durationSec}s ease-in-out infinite`,\r\n },\r\n },\r\n };\r\n\r\n return animations[animation] || {};\r\n}\r\n\r\n/**\r\n * Factory function to create cursor icons\r\n */\r\nexport function createCursorIcon(name: string, path: string, defaultColor?: string): CursorIcon {\r\n const IconComponent = ({\r\n size = 24,\r\n color = defaultColor || 'currentColor',\r\n secondaryColor,\r\n variant = 'filled',\r\n animation,\r\n animationDuration = 1000,\r\n title,\r\n desc,\r\n className,\r\n style,\r\n ...props\r\n }: CursorIconProps) => {\r\n const animationAttrs = getCursorAnimation(animation, animationDuration);\r\n const titleId = title ? `${name}-title` : undefined;\r\n const descId = desc ? `${name}-desc` : undefined;\r\n\r\n let pathElement: React.ReactNode;\r\n\r\n switch (variant) {\r\n case 'outlined':\r\n pathElement = (\r\n <path\r\n d={path}\r\n fill=\"none\"\r\n stroke={color}\r\n strokeWidth={1.5}\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n );\r\n break;\r\n case 'duotone':\r\n pathElement = (\r\n <>\r\n <path d={path} fill={secondaryColor || `${color}33`} />\r\n <path\r\n d={path}\r\n fill=\"none\"\r\n stroke={color}\r\n strokeWidth={1.5}\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n </>\r\n );\r\n break;\r\n case 'filled':\r\n default:\r\n pathElement = <path d={path} fill={color} />;\r\n break;\r\n }\r\n\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 24 24\"\r\n className={className}\r\n style={style}\r\n role=\"img\"\r\n aria-labelledby={titleId || descId ? `${titleId || ''} ${descId || ''}`.trim() : undefined}\r\n {...animationAttrs}\r\n {...props}\r\n >\r\n {title && <title id={titleId}>{title}</title>}\r\n {desc && <desc id={descId}>{desc}</desc>}\r\n {pathElement}\r\n </svg>\r\n );\r\n };\r\n\r\n IconComponent.displayName = name;\r\n return IconComponent as CursorIcon;\r\n}\r\n"],"names":["jsx","jsxs","Fragment"],"mappings":";;;AAOO,SAAS,mBACd,WACA,WAAW,KACyB;AACpC,MAAI,CAAC,WAAW;AACd,WAAO,CAAA;AAAA,EACT;AAEA,QAAM,cAAc,WAAW;AAE/B,QAAM,aAA8E;AAAA,IAClF,OAAO;AAAA,MACL,UAAU,MAAM,cAAc,WAAW;AAAA,QACvC,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,KAAK,GAAG,WAAW;AAAA,QACnB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAEH,MAAM;AAAA,MACJ,UAAU,MAAM,cAAc,oBAAoB;AAAA,QAChD,eAAe;AAAA,QACf,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,KAAK,GAAG,WAAW;AAAA,QACnB,aAAa;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAEH,OAAO;AAAA,MACL,UAAU,MAAM,cAAc,oBAAoB;AAAA,QAChD,eAAe;AAAA,QACf,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,KAAK,GAAG,cAAc,GAAG;AAAA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ACH,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,SAASD,2BAAAA,IAAC,SAAA,EAAM,IAAI,SAAU,UAAA,OAAM;AAAA,UACpC,QAAQA,2BAAAA,IAAC,QAAA,EAAK,IAAI,QAAS,UAAA,MAAK;AAAA,UAChC;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AAEA,gBAAc,cAAc;AAC5B,SAAO;AACT;;;"}
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { CursorIconAnimation, CursorIcon } from './types';
3
+ /**
4
+ * Get SMIL animation attributes for cursor icons
5
+ */
6
+ export declare function getCursorAnimation(animation: CursorIconAnimation | undefined, duration?: number): React.SVGAttributes<SVGSVGElement>;
7
+ /**
8
+ * Factory function to create cursor icons
9
+ */
10
+ export declare function createCursorIcon(name: string, path: string, defaultColor?: string): CursorIcon;
11
+ //# sourceMappingURL=createCursorIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCursorIcon.d.ts","sourceRoot":"","sources":["../src/createCursorIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAmB,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhF;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAC1C,QAAQ,SAAO,GACd,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAwFpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,CA4E9F"}