@nice2dev/icons-cursor 1.2.1 → 1.2.2

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.cjs CHANGED
@@ -141,28 +141,27 @@ ${properties}
141
141
  }
142
142
  function useCursor(IconComponent, options = {}) {
143
143
  var _a, _b;
144
+ const { size, color, secondaryColor, fallback, variant } = options;
145
+ const hotspotX = (_a = options.hotspot) == null ? void 0 : _a.x;
146
+ const hotspotY = (_b = options.hotspot) == null ? void 0 : _b.y;
144
147
  const cursor = React.useMemo(() => {
145
148
  if (!IconComponent) {
146
149
  return "auto";
147
150
  }
148
- return buildCursor(IconComponent, options).cursor;
149
- }, [
150
- IconComponent,
151
- options.size,
152
- options.color,
153
- (_a = options.hotspot) == null ? void 0 : _a.x,
154
- (_b = options.hotspot) == null ? void 0 : _b.y,
155
- options.fallback,
156
- options.variant,
157
- options.secondaryColor
158
- ]);
151
+ const hotspot = hotspotX !== void 0 && hotspotY !== void 0 ? { x: hotspotX, y: hotspotY } : void 0;
152
+ return buildCursor(IconComponent, { size, color, secondaryColor, fallback, variant, hotspot }).cursor;
153
+ }, [IconComponent, size, color, secondaryColor, fallback, variant, hotspotX, hotspotY]);
159
154
  return { cursor };
160
155
  }
161
156
  function useCursors(cursors, options = {}) {
162
- const cursorMap = React.useMemo(
163
- () => buildCursors(cursors, options),
164
- [cursors, options.size, options.color, options.variant]
165
- );
157
+ var _a, _b;
158
+ const { size, color, secondaryColor, fallback, variant } = options;
159
+ const hotspotX = (_a = options.hotspot) == null ? void 0 : _a.x;
160
+ const hotspotY = (_b = options.hotspot) == null ? void 0 : _b.y;
161
+ const cursorMap = React.useMemo(() => {
162
+ const hotspot = hotspotX !== void 0 && hotspotY !== void 0 ? { x: hotspotX, y: hotspotY } : void 0;
163
+ return buildCursors(cursors, { size, color, secondaryColor, fallback, variant, hotspot });
164
+ }, [cursors, size, color, secondaryColor, fallback, variant, hotspotX, hotspotY]);
166
165
  const [activeCursor, setActiveCursor] = React.useState(null);
167
166
  const style = React.useMemo(
168
167
  () => ({
package/dist/index.mjs CHANGED
@@ -143,28 +143,27 @@ ${properties}
143
143
  }
144
144
  function useCursor(IconComponent, options = {}) {
145
145
  var _a, _b;
146
+ const { size, color, secondaryColor, fallback, variant } = options;
147
+ const hotspotX = (_a = options.hotspot) == null ? void 0 : _a.x;
148
+ const hotspotY = (_b = options.hotspot) == null ? void 0 : _b.y;
146
149
  const cursor = useMemo(() => {
147
150
  if (!IconComponent) {
148
151
  return "auto";
149
152
  }
150
- return buildCursor(IconComponent, options).cursor;
151
- }, [
152
- IconComponent,
153
- options.size,
154
- options.color,
155
- (_a = options.hotspot) == null ? void 0 : _a.x,
156
- (_b = options.hotspot) == null ? void 0 : _b.y,
157
- options.fallback,
158
- options.variant,
159
- options.secondaryColor
160
- ]);
153
+ const hotspot = hotspotX !== void 0 && hotspotY !== void 0 ? { x: hotspotX, y: hotspotY } : void 0;
154
+ return buildCursor(IconComponent, { size, color, secondaryColor, fallback, variant, hotspot }).cursor;
155
+ }, [IconComponent, size, color, secondaryColor, fallback, variant, hotspotX, hotspotY]);
161
156
  return { cursor };
162
157
  }
163
158
  function useCursors(cursors, options = {}) {
164
- const cursorMap = useMemo(
165
- () => buildCursors(cursors, options),
166
- [cursors, options.size, options.color, options.variant]
167
- );
159
+ var _a, _b;
160
+ const { size, color, secondaryColor, fallback, variant } = options;
161
+ const hotspotX = (_a = options.hotspot) == null ? void 0 : _a.x;
162
+ const hotspotY = (_b = options.hotspot) == null ? void 0 : _b.y;
163
+ const cursorMap = useMemo(() => {
164
+ const hotspot = hotspotX !== void 0 && hotspotY !== void 0 ? { x: hotspotX, y: hotspotY } : void 0;
165
+ return buildCursors(cursors, { size, color, secondaryColor, fallback, variant, hotspot });
166
+ }, [cursors, size, color, secondaryColor, fallback, variant, hotspotX, hotspotY]);
168
167
  const [activeCursor, setActiveCursor] = useState(null);
169
168
  const style = useMemo(
170
169
  () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/icons-cursor",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Cursor and pointer icons for NiceToDev UI - system cursors, tools, and selection indicators",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",