@nice2dev/icons 1.3.15 → 1.3.17

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 (153) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/NiceDesktopIconExporter.js +688 -599
  4. package/dist/cjs/NiceFaviconGenerator.js +603 -417
  5. package/dist/cjs/NiceIconPicker.js +788 -508
  6. package/dist/cjs/NiceIconPreview.js +246 -188
  7. package/dist/cjs/NiceIconSetCreator.js +683 -552
  8. package/dist/cjs/NiceIconStacker.js +547 -171
  9. package/dist/cjs/NiceIconValue.js +27 -35
  10. package/dist/cjs/NtdIconBadge.js +384 -360
  11. package/dist/cjs/NtdIconMorph.js +419 -354
  12. package/dist/cjs/NtdStateMorph.js +150 -147
  13. package/dist/cjs/advancedIconSearch.js +373 -510
  14. package/dist/cjs/animationControls.js +518 -642
  15. package/dist/cjs/animationSpeed.js +69 -0
  16. package/dist/cjs/client.js +12 -15
  17. package/dist/cjs/createIcon.js +374 -252
  18. package/dist/cjs/design-tokens.js +324 -390
  19. package/dist/cjs/figmaExport.js +162 -257
  20. package/dist/cjs/figmaSync.js +234 -316
  21. package/dist/cjs/headless-ui.js +240 -368
  22. package/dist/cjs/iconAnalytics.js +337 -393
  23. package/dist/cjs/iconHtml.js +64 -86
  24. package/dist/cjs/iconMetadata.js +392 -472
  25. package/dist/cjs/iconParts.js +120 -90
  26. package/dist/cjs/iconStack.js +136 -155
  27. package/dist/cjs/iconStyles.js +1670 -509
  28. package/dist/cjs/iconValue.js +359 -430
  29. package/dist/cjs/icons/accessibility.js +1119 -134
  30. package/dist/cjs/icons/actions.js +1290 -330
  31. package/dist/cjs/icons/ai.js +1424 -144
  32. package/dist/cjs/icons/brand.js +613 -184
  33. package/dist/cjs/icons/business.js +938 -192
  34. package/dist/cjs/icons/devtech.js +1656 -227
  35. package/dist/cjs/icons/ecommerce.js +802 -111
  36. package/dist/cjs/icons/education.js +1345 -199
  37. package/dist/cjs/icons/files.js +1597 -328
  38. package/dist/cjs/icons/fintech.js +793 -104
  39. package/dist/cjs/icons/food.js +1028 -156
  40. package/dist/cjs/icons/fun.js +804 -109
  41. package/dist/cjs/icons/gaming.js +916 -170
  42. package/dist/cjs/icons/health.js +623 -112
  43. package/dist/cjs/icons/index.js +32 -42
  44. package/dist/cjs/icons/input.js +282 -83
  45. package/dist/cjs/icons/legal.js +1065 -122
  46. package/dist/cjs/icons/media.js +1061 -267
  47. package/dist/cjs/icons/navigation.js +407 -123
  48. package/dist/cjs/icons/omniverk.js +523 -93
  49. package/dist/cjs/icons/realestate.js +1520 -193
  50. package/dist/cjs/icons/saas.js +867 -98
  51. package/dist/cjs/icons/science.js +1344 -202
  52. package/dist/cjs/icons/shapes.js +1316 -308
  53. package/dist/cjs/icons/smarthome.js +786 -90
  54. package/dist/cjs/icons/social.js +591 -59
  55. package/dist/cjs/icons/sports.js +1133 -133
  56. package/dist/cjs/icons/sustainability.js +1211 -139
  57. package/dist/cjs/icons/travel.js +1470 -148
  58. package/dist/cjs/icons/ui.js +1508 -315
  59. package/dist/cjs/icons/weather.js +1160 -173
  60. package/dist/cjs/index.js +559 -568
  61. package/dist/cjs/lottieIntegration.js +261 -266
  62. package/dist/cjs/nicetodev-icons.css +1 -1
  63. package/dist/cjs/particleEffects.js +270 -251
  64. package/dist/cjs/resolver.js +229 -284
  65. package/dist/cjs/rsc.js +175 -193
  66. package/dist/cjs/sharpen.js +73 -130
  67. package/dist/cjs/smilAnimations.js +380 -165
  68. package/dist/cjs/stacking.js +87 -122
  69. package/dist/cjs/tailwind-plugin.js +280 -320
  70. package/dist/cjs/types.js +46 -72
  71. package/dist/cjs/utilities.js +163 -324
  72. package/dist/cjs/variantProps.js +12 -52
  73. package/dist/esm/NiceDesktopIconExporter.js +671 -598
  74. package/dist/esm/NiceFaviconGenerator.js +583 -416
  75. package/dist/esm/NiceIconPicker.js +789 -507
  76. package/dist/esm/NiceIconPreview.js +247 -187
  77. package/dist/esm/NiceIconSetCreator.js +685 -551
  78. package/dist/esm/NiceIconStacker.js +549 -170
  79. package/dist/esm/NiceIconValue.js +29 -34
  80. package/dist/esm/NtdIconBadge.js +388 -359
  81. package/dist/esm/NtdIconMorph.js +423 -353
  82. package/dist/esm/NtdStateMorph.js +152 -146
  83. package/dist/esm/advancedIconSearch.js +391 -509
  84. package/dist/esm/animationControls.js +527 -641
  85. package/dist/esm/animationSpeed.js +69 -0
  86. package/dist/esm/client.js +48 -10
  87. package/dist/esm/createIcon.js +375 -251
  88. package/dist/esm/design-tokens.js +334 -387
  89. package/dist/esm/figmaExport.js +170 -256
  90. package/dist/esm/figmaSync.js +237 -315
  91. package/dist/esm/headless-ui.js +254 -365
  92. package/dist/esm/iconAnalytics.js +342 -392
  93. package/dist/esm/iconHtml.js +67 -85
  94. package/dist/esm/iconMetadata.js +404 -471
  95. package/dist/esm/iconParts.js +125 -89
  96. package/dist/esm/iconStack.js +145 -154
  97. package/dist/esm/iconStyles.js +1681 -508
  98. package/dist/esm/iconValue.js +361 -429
  99. package/dist/esm/icons/accessibility.js +1133 -133
  100. package/dist/esm/icons/actions.js +1320 -329
  101. package/dist/esm/icons/ai.js +1441 -143
  102. package/dist/esm/icons/brand.js +616 -179
  103. package/dist/esm/icons/business.js +957 -191
  104. package/dist/esm/icons/devtech.js +1687 -226
  105. package/dist/esm/icons/ecommerce.js +816 -110
  106. package/dist/esm/icons/education.js +1364 -198
  107. package/dist/esm/icons/files.js +1628 -327
  108. package/dist/esm/icons/fintech.js +807 -103
  109. package/dist/esm/icons/food.js +1043 -153
  110. package/dist/esm/icons/fun.js +819 -108
  111. package/dist/esm/icons/gaming.js +933 -169
  112. package/dist/esm/icons/health.js +636 -111
  113. package/dist/esm/icons/index.js +589 -32
  114. package/dist/esm/icons/input.js +326 -82
  115. package/dist/esm/icons/legal.js +1079 -121
  116. package/dist/esm/icons/media.js +1086 -266
  117. package/dist/esm/icons/navigation.js +421 -122
  118. package/dist/esm/icons/omniverk.js +534 -91
  119. package/dist/esm/icons/realestate.js +1544 -198
  120. package/dist/esm/icons/saas.js +880 -97
  121. package/dist/esm/icons/science.js +1370 -208
  122. package/dist/esm/icons/shapes.js +1343 -307
  123. package/dist/esm/icons/smarthome.js +799 -89
  124. package/dist/esm/icons/social.js +599 -58
  125. package/dist/esm/icons/sports.js +1148 -132
  126. package/dist/esm/icons/sustainability.js +1226 -138
  127. package/dist/esm/icons/travel.js +1486 -147
  128. package/dist/esm/icons/ui.js +1540 -314
  129. package/dist/esm/icons/weather.js +1181 -172
  130. package/dist/esm/index.js +749 -58
  131. package/dist/esm/lottieIntegration.js +264 -265
  132. package/dist/esm/nicetodev-icons.css +1 -1
  133. package/dist/esm/particleEffects.js +271 -250
  134. package/dist/esm/resolver.js +231 -283
  135. package/dist/esm/rsc.js +182 -192
  136. package/dist/esm/sharpen.js +78 -129
  137. package/dist/esm/smilAnimations.js +385 -164
  138. package/dist/esm/stacking.js +99 -121
  139. package/dist/esm/tailwind-plugin.js +282 -319
  140. package/dist/esm/types.js +50 -71
  141. package/dist/esm/utilities.js +177 -321
  142. package/dist/esm/variantProps.js +23 -52
  143. package/dist/types/animationSpeed.d.ts +19 -0
  144. package/dist/types/createIcon.d.ts +6 -0
  145. package/dist/types/iconStyles.d.ts +6 -1
  146. package/dist/types/icons/brand.d.ts +0 -4
  147. package/dist/types/icons/food.d.ts +0 -3
  148. package/dist/types/icons/index.d.ts +3 -3
  149. package/dist/types/icons/omniverk.d.ts +0 -3
  150. package/dist/types/icons/science.d.ts +1 -1
  151. package/dist/types/smilAnimations.d.ts +4 -2
  152. package/dist/types/types.d.ts +7 -0
  153. package/package.json +15 -22
@@ -1,181 +1,396 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
-
5
- /**
6
- * Default animation configurations.
7
- */
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const animationSpeed = require("./animationSpeed.js");
8
5
  const DEFAULT_CONFIG = {
9
- duration: 1,
10
- repeatCount: 'indefinite',
11
- easing: 'ease-in-out',
12
- delay: 0,
13
- fill: 'freeze',
6
+ duration: 1,
7
+ repeatCount: "indefinite",
8
+ easing: "ease-in-out",
9
+ delay: 0,
10
+ fill: "freeze"
14
11
  };
15
- /**
16
- * Maps easing names to SMIL calcMode and keySplines.
17
- */
18
12
  const EASING_MAP = {
19
- linear: { calcMode: 'linear' },
20
- ease: { calcMode: 'spline', keySplines: '0.25 0.1 0.25 1' },
21
- 'ease-in': { calcMode: 'spline', keySplines: '0.42 0 1 1' },
22
- 'ease-out': { calcMode: 'spline', keySplines: '0 0 0.58 1' },
23
- 'ease-in-out': { calcMode: 'spline', keySplines: '0.42 0 0.58 1' },
13
+ linear: { calcMode: "linear" },
14
+ ease: { calcMode: "spline", keySplines: "0.25 0.1 0.25 1" },
15
+ "ease-in": { calcMode: "spline", keySplines: "0.42 0 1 1" },
16
+ "ease-out": { calcMode: "spline", keySplines: "0 0 0.58 1" },
17
+ "ease-in-out": { calcMode: "spline", keySplines: "0.42 0 0.58 1" }
24
18
  };
25
- /**
26
- * Generates SMIL animation elements for a given animation type.
27
- *
28
- * @param config - Animation configuration
29
- * @param center - Center point for transforms (default: 12, 12 for 24x24 viewBox)
30
- * @returns React elements to be placed inside an SVG `<g>` or at root level
31
- */
32
19
  function generateSmilAnimation(config, center = { x: 12, y: 12 }) {
33
- const { type, duration = DEFAULT_CONFIG.duration, repeatCount = DEFAULT_CONFIG.repeatCount, easing = DEFAULT_CONFIG.easing, delay = DEFAULT_CONFIG.delay, fill = DEFAULT_CONFIG.fill, targetColor, } = config;
34
- const dur = `${duration}s`;
35
- const begin = delay > 0 ? `${delay}s` : '0s';
36
- const rep = repeatCount === 'indefinite' ? 'indefinite' : String(repeatCount);
37
- const { calcMode, keySplines } = EASING_MAP[easing] || EASING_MAP.linear;
38
- const baseProps = {
39
- dur,
40
- begin,
41
- repeatCount: rep,
42
- fill,
43
- calcMode,
44
- ...(keySplines && calcMode === 'spline' ? { keySplines, keyTimes: '0;1' } : {}),
45
- };
46
- switch (type) {
47
- case 'spin':
48
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "rotate", from: `0 ${center.x} ${center.y}`, to: `360 ${center.x} ${center.y}`, ...baseProps, calcMode: "linear" }));
49
- case 'spin-reverse':
50
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "rotate", from: `360 ${center.x} ${center.y}`, to: `0 ${center.x} ${center.y}`, ...baseProps, calcMode: "linear" }));
51
- case 'pulse':
52
- return jsxRuntime.jsx("animate", { attributeName: "opacity", values: "1;0.4;1", keyTimes: "0;0.5;1", ...baseProps });
53
- case 'bounce':
54
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "translate", values: "0,0;0,-4;0,0", keyTimes: "0;0.5;1", ...baseProps }));
55
- case 'shake':
56
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "translate", values: "0,0;-2,0;2,0;-2,0;2,0;0,0", keyTimes: "0;0.1;0.3;0.5;0.7;1", ...baseProps, keySplines: undefined, calcMode: "linear" }));
57
- case 'float':
58
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "translate", values: "0,0;0,-3;0,0", keyTimes: "0;0.5;1", dur: `${duration * 2}s`, begin: begin, repeatCount: rep, fill: fill, calcMode: "spline", keySplines: "0.42 0 0.58 1;0.42 0 0.58 1" }));
59
- case 'flip':
60
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "rotate", values: `0 ${center.x} ${center.y};180 ${center.x} ${center.y};360 ${center.x} ${center.y}`, keyTimes: "0;0.5;1", ...baseProps }));
61
- case 'wiggle':
62
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "rotate", values: `0 ${center.x} ${center.y};-10 ${center.x} ${center.y};10 ${center.x} ${center.y};0 ${center.x} ${center.y}`, keyTimes: "0;0.25;0.75;1", ...baseProps }));
63
- case 'swing':
64
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "rotate", values: `0 ${center.x} 0;15 ${center.x} 0;-10 ${center.x} 0;5 ${center.x} 0;0 ${center.x} 0`, keyTimes: "0;0.2;0.4;0.6;1", ...baseProps }));
65
- case 'heartbeat':
66
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "scale", values: "1;1.15;1;1.15;1", keyTimes: "0;0.14;0.28;0.42;1", ...baseProps, additive: "sum" }));
67
- case 'scale-pulse':
68
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "scale", values: "1;1.1;1", keyTimes: "0;0.5;1", ...baseProps, additive: "sum" }));
69
- case 'grow':
70
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "scale", from: "0", to: "1", ...baseProps, repeatCount: "1" }));
71
- case 'shrink':
72
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "scale", from: "1", to: "0", ...baseProps, repeatCount: "1" }));
73
- case 'rubber':
74
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "scale", values: "1,1;1.25,0.75;0.75,1.25;1.15,0.85;1,1", keyTimes: "0;0.3;0.5;0.7;1", ...baseProps, additive: "sum" }) }));
75
- case 'pop':
76
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "scale", values: "0;1.2;1", keyTimes: "0;0.6;1", ...baseProps, repeatCount: "1", additive: "sum" }));
77
- case 'fade':
78
- return jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0;1;0", keyTimes: "0;0.5;1", ...baseProps });
79
- case 'blink':
80
- return (jsxRuntime.jsx("animate", { attributeName: "opacity", values: "1;0;1", keyTimes: "0;0.5;1", dur: `${duration * 0.5}s`, begin: begin, repeatCount: rep, fill: fill, calcMode: "discrete" }));
81
- case 'glow':
82
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0.6;1;0.6", keyTimes: "0;0.5;1", ...baseProps }), jsxRuntime.jsx("animate", { attributeName: "filter", values: "drop-shadow(0 0 2px currentColor);drop-shadow(0 0 8px currentColor);drop-shadow(0 0 2px currentColor)", keyTimes: "0;0.5;1", ...baseProps })] }));
83
- case 'slide-x':
84
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "translate", values: "-24,0;0,0;24,0", keyTimes: "0;0.5;1", ...baseProps }));
85
- case 'slide-y':
86
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "translate", values: "0,-24;0,0;0,24", keyTimes: "0;0.5;1", ...baseProps }));
87
- case 'orbit':
88
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "rotate", from: `0 ${center.x} ${center.y}`, to: `360 ${center.x} ${center.y}`, ...baseProps, calcMode: "linear" }));
89
- case 'wave':
90
- return (jsxRuntime.jsx("animateTransform", { attributeName: "transform", type: "translate", values: "0,0;0,-2;0,2;0,-2;0,0", keyTimes: "0;0.25;0.5;0.75;1", dur: `${duration * 0.5}s`, begin: begin, repeatCount: rep, fill: fill, calcMode: "spline", keySplines: "0.42 0 0.58 1;0.42 0 0.58 1;0.42 0 0.58 1;0.42 0 0.58 1" }));
91
- case 'draw':
92
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("animate", { attributeName: "stroke-dashoffset", from: "100", to: "0", ...baseProps }), jsxRuntime.jsx("set", { attributeName: "stroke-dasharray", to: "100" })] }));
93
- case 'draw-reverse':
94
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("animate", { attributeName: "stroke-dashoffset", from: "0", to: "100", ...baseProps }), jsxRuntime.jsx("set", { attributeName: "stroke-dasharray", to: "100" })] }));
95
- case 'color-shift':
96
- return (jsxRuntime.jsx("animate", { attributeName: "fill", values: `currentColor;${targetColor || '#ff6b6b'};currentColor`, keyTimes: "0;0.5;1", ...baseProps }));
97
- default:
98
- return null;
99
- }
20
+ const {
21
+ type,
22
+ duration = DEFAULT_CONFIG.duration,
23
+ repeatCount = DEFAULT_CONFIG.repeatCount,
24
+ easing = DEFAULT_CONFIG.easing,
25
+ delay = DEFAULT_CONFIG.delay,
26
+ fill = DEFAULT_CONFIG.fill,
27
+ targetColor
28
+ } = config;
29
+ const dur = `${duration}s`;
30
+ const begin = delay > 0 ? `${delay}s` : "0s";
31
+ const rep = repeatCount === "indefinite" ? "indefinite" : String(repeatCount);
32
+ const { calcMode, keySplines } = EASING_MAP[easing] || EASING_MAP.linear;
33
+ const baseProps = {
34
+ dur,
35
+ begin,
36
+ repeatCount: rep,
37
+ fill,
38
+ calcMode,
39
+ ...keySplines && calcMode === "spline" ? { keySplines, keyTimes: "0;1" } : {}
40
+ };
41
+ switch (type) {
42
+ case "spin":
43
+ return /* @__PURE__ */ jsxRuntime.jsx(
44
+ "animateTransform",
45
+ {
46
+ attributeName: "transform",
47
+ type: "rotate",
48
+ from: `0 ${center.x} ${center.y}`,
49
+ to: `360 ${center.x} ${center.y}`,
50
+ ...baseProps,
51
+ calcMode: "linear"
52
+ }
53
+ );
54
+ case "spin-reverse":
55
+ return /* @__PURE__ */ jsxRuntime.jsx(
56
+ "animateTransform",
57
+ {
58
+ attributeName: "transform",
59
+ type: "rotate",
60
+ from: `360 ${center.x} ${center.y}`,
61
+ to: `0 ${center.x} ${center.y}`,
62
+ ...baseProps,
63
+ calcMode: "linear"
64
+ }
65
+ );
66
+ case "pulse":
67
+ return /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "1;0.4;1", keyTimes: "0;0.5;1", ...baseProps });
68
+ case "bounce":
69
+ return /* @__PURE__ */ jsxRuntime.jsx(
70
+ "animateTransform",
71
+ {
72
+ attributeName: "transform",
73
+ type: "translate",
74
+ values: "0,0;0,-4;0,0",
75
+ keyTimes: "0;0.5;1",
76
+ ...baseProps
77
+ }
78
+ );
79
+ case "shake":
80
+ return /* @__PURE__ */ jsxRuntime.jsx(
81
+ "animateTransform",
82
+ {
83
+ attributeName: "transform",
84
+ type: "translate",
85
+ values: "0,0;-2,0;2,0;-2,0;2,0;0,0",
86
+ keyTimes: "0;0.1;0.3;0.5;0.7;1",
87
+ ...baseProps,
88
+ keySplines: void 0,
89
+ calcMode: "linear"
90
+ }
91
+ );
92
+ case "float":
93
+ return /* @__PURE__ */ jsxRuntime.jsx(
94
+ "animateTransform",
95
+ {
96
+ attributeName: "transform",
97
+ type: "translate",
98
+ values: "0,0;0,-3;0,0",
99
+ keyTimes: "0;0.5;1",
100
+ dur: `${duration * 2}s`,
101
+ begin,
102
+ repeatCount: rep,
103
+ fill,
104
+ calcMode: "spline",
105
+ keySplines: "0.42 0 0.58 1;0.42 0 0.58 1"
106
+ }
107
+ );
108
+ case "flip":
109
+ return /* @__PURE__ */ jsxRuntime.jsx(
110
+ "animateTransform",
111
+ {
112
+ attributeName: "transform",
113
+ type: "rotate",
114
+ values: `0 ${center.x} ${center.y};180 ${center.x} ${center.y};360 ${center.x} ${center.y}`,
115
+ keyTimes: "0;0.5;1",
116
+ ...baseProps
117
+ }
118
+ );
119
+ case "wiggle":
120
+ return /* @__PURE__ */ jsxRuntime.jsx(
121
+ "animateTransform",
122
+ {
123
+ attributeName: "transform",
124
+ type: "rotate",
125
+ values: `0 ${center.x} ${center.y};-10 ${center.x} ${center.y};10 ${center.x} ${center.y};0 ${center.x} ${center.y}`,
126
+ keyTimes: "0;0.25;0.75;1",
127
+ ...baseProps
128
+ }
129
+ );
130
+ case "swing":
131
+ return /* @__PURE__ */ jsxRuntime.jsx(
132
+ "animateTransform",
133
+ {
134
+ attributeName: "transform",
135
+ type: "rotate",
136
+ values: `0 ${center.x} 0;15 ${center.x} 0;-10 ${center.x} 0;5 ${center.x} 0;0 ${center.x} 0`,
137
+ keyTimes: "0;0.2;0.4;0.6;1",
138
+ ...baseProps
139
+ }
140
+ );
141
+ case "heartbeat":
142
+ return /* @__PURE__ */ jsxRuntime.jsx(
143
+ "animateTransform",
144
+ {
145
+ attributeName: "transform",
146
+ type: "scale",
147
+ values: "1;1.15;1;1.15;1",
148
+ keyTimes: "0;0.14;0.28;0.42;1",
149
+ ...baseProps,
150
+ additive: "sum"
151
+ }
152
+ );
153
+ case "scale-pulse":
154
+ return /* @__PURE__ */ jsxRuntime.jsx(
155
+ "animateTransform",
156
+ {
157
+ attributeName: "transform",
158
+ type: "scale",
159
+ values: "1;1.1;1",
160
+ keyTimes: "0;0.5;1",
161
+ ...baseProps,
162
+ additive: "sum"
163
+ }
164
+ );
165
+ case "grow":
166
+ return /* @__PURE__ */ jsxRuntime.jsx(
167
+ "animateTransform",
168
+ {
169
+ attributeName: "transform",
170
+ type: "scale",
171
+ from: "0",
172
+ to: "1",
173
+ ...baseProps,
174
+ repeatCount: "1"
175
+ }
176
+ );
177
+ case "shrink":
178
+ return /* @__PURE__ */ jsxRuntime.jsx(
179
+ "animateTransform",
180
+ {
181
+ attributeName: "transform",
182
+ type: "scale",
183
+ from: "1",
184
+ to: "0",
185
+ ...baseProps,
186
+ repeatCount: "1"
187
+ }
188
+ );
189
+ case "rubber":
190
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
191
+ "animateTransform",
192
+ {
193
+ attributeName: "transform",
194
+ type: "scale",
195
+ values: "1,1;1.25,0.75;0.75,1.25;1.15,0.85;1,1",
196
+ keyTimes: "0;0.3;0.5;0.7;1",
197
+ ...baseProps,
198
+ additive: "sum"
199
+ }
200
+ ) });
201
+ case "pop":
202
+ return /* @__PURE__ */ jsxRuntime.jsx(
203
+ "animateTransform",
204
+ {
205
+ attributeName: "transform",
206
+ type: "scale",
207
+ values: "0;1.2;1",
208
+ keyTimes: "0;0.6;1",
209
+ ...baseProps,
210
+ repeatCount: "1",
211
+ additive: "sum"
212
+ }
213
+ );
214
+ case "fade":
215
+ return /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0;1;0", keyTimes: "0;0.5;1", ...baseProps });
216
+ case "blink":
217
+ return /* @__PURE__ */ jsxRuntime.jsx(
218
+ "animate",
219
+ {
220
+ attributeName: "opacity",
221
+ values: "1;0;1",
222
+ keyTimes: "0;0.5;1",
223
+ dur: `${duration * 0.5}s`,
224
+ begin,
225
+ repeatCount: rep,
226
+ fill,
227
+ calcMode: "discrete"
228
+ }
229
+ );
230
+ case "glow":
231
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
232
+ /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0.6;1;0.6", keyTimes: "0;0.5;1", ...baseProps }),
233
+ /* @__PURE__ */ jsxRuntime.jsx(
234
+ "animate",
235
+ {
236
+ attributeName: "filter",
237
+ values: "drop-shadow(0 0 2px currentColor);drop-shadow(0 0 8px currentColor);drop-shadow(0 0 2px currentColor)",
238
+ keyTimes: "0;0.5;1",
239
+ ...baseProps
240
+ }
241
+ )
242
+ ] });
243
+ case "slide-x":
244
+ return /* @__PURE__ */ jsxRuntime.jsx(
245
+ "animateTransform",
246
+ {
247
+ attributeName: "transform",
248
+ type: "translate",
249
+ values: "-24,0;0,0;24,0",
250
+ keyTimes: "0;0.5;1",
251
+ ...baseProps
252
+ }
253
+ );
254
+ case "slide-y":
255
+ return /* @__PURE__ */ jsxRuntime.jsx(
256
+ "animateTransform",
257
+ {
258
+ attributeName: "transform",
259
+ type: "translate",
260
+ values: "0,-24;0,0;0,24",
261
+ keyTimes: "0;0.5;1",
262
+ ...baseProps
263
+ }
264
+ );
265
+ case "orbit":
266
+ return /* @__PURE__ */ jsxRuntime.jsx(
267
+ "animateTransform",
268
+ {
269
+ attributeName: "transform",
270
+ type: "rotate",
271
+ from: `0 ${center.x} ${center.y}`,
272
+ to: `360 ${center.x} ${center.y}`,
273
+ ...baseProps,
274
+ calcMode: "linear"
275
+ }
276
+ );
277
+ case "wave":
278
+ return /* @__PURE__ */ jsxRuntime.jsx(
279
+ "animateTransform",
280
+ {
281
+ attributeName: "transform",
282
+ type: "translate",
283
+ values: "0,0;0,-2;0,2;0,-2;0,0",
284
+ keyTimes: "0;0.25;0.5;0.75;1",
285
+ dur: `${duration * 0.5}s`,
286
+ begin,
287
+ repeatCount: rep,
288
+ fill,
289
+ calcMode: "spline",
290
+ keySplines: "0.42 0 0.58 1;0.42 0 0.58 1;0.42 0 0.58 1;0.42 0 0.58 1"
291
+ }
292
+ );
293
+ case "draw":
294
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
295
+ /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "stroke-dashoffset", from: "100", to: "0", ...baseProps }),
296
+ /* @__PURE__ */ jsxRuntime.jsx("set", { attributeName: "stroke-dasharray", to: "100" })
297
+ ] });
298
+ case "draw-reverse":
299
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
300
+ /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "stroke-dashoffset", from: "0", to: "100", ...baseProps }),
301
+ /* @__PURE__ */ jsxRuntime.jsx("set", { attributeName: "stroke-dasharray", to: "100" })
302
+ ] });
303
+ case "color-shift":
304
+ return /* @__PURE__ */ jsxRuntime.jsx(
305
+ "animate",
306
+ {
307
+ attributeName: "fill",
308
+ values: `currentColor;${targetColor || "#ff6b6b"};currentColor`,
309
+ keyTimes: "0;0.5;1",
310
+ ...baseProps
311
+ }
312
+ );
313
+ default:
314
+ return null;
315
+ }
100
316
  }
101
- /**
102
- * Wraps icon content in a `<g>` element with SMIL animations applied.
103
- *
104
- * @example
105
- * ```tsx
106
- * <svg viewBox="0 0 24 24">
107
- * <SmilAnimationWrapper animation="spin" duration={2}>
108
- * <path d="M12 2l3 7h7l-5.5 4 2 7L12 16l-6.5 4 2-7L2 9h7z" />
109
- * </SmilAnimationWrapper>
110
- * </svg>
111
- * ```
112
- */
113
- function SmilAnimationWrapper({ animation, duration = 1, repeatCount = 'indefinite', easing = 'ease-in-out', delay = 0, center = { x: 12, y: 12 }, children, }) {
114
- const animationElements = generateSmilAnimation({ type: animation, duration, repeatCount, easing, delay }, center);
115
- // For scale animations, we need to translate to origin, scale, then translate back
116
- const needsOriginTransform = [
117
- 'heartbeat',
118
- 'scale-pulse',
119
- 'grow',
120
- 'shrink',
121
- 'rubber',
122
- 'pop',
123
- ].includes(animation);
124
- if (needsOriginTransform) {
125
- return (jsxRuntime.jsxs("g", { transform: `translate(${center.x}, ${center.y})`, children: [jsxRuntime.jsx("g", { transform: `translate(-${center.x}, -${center.y})`, children: children }), animationElements] }));
126
- }
127
- return (jsxRuntime.jsxs("g", { children: [children, animationElements] }));
317
+ function SmilAnimationWrapper({
318
+ animation,
319
+ duration,
320
+ animationSpeed: animationSpeed$1,
321
+ repeatCount = "indefinite",
322
+ easing = "ease-in-out",
323
+ delay = 0,
324
+ center = { x: 12, y: 12 },
325
+ children
326
+ }) {
327
+ const animationElements = generateSmilAnimation(
328
+ {
329
+ type: animation,
330
+ // 1 s before 1.3.17; a given duration keeps its length
331
+ duration: (duration ?? 1) * animationSpeed.durationScale(duration !== void 0, animationSpeed$1),
332
+ repeatCount,
333
+ easing,
334
+ delay
335
+ },
336
+ center
337
+ );
338
+ const needsOriginTransform = [
339
+ "heartbeat",
340
+ "scale-pulse",
341
+ "grow",
342
+ "shrink",
343
+ "rubber",
344
+ "pop"
345
+ ].includes(animation);
346
+ if (needsOriginTransform) {
347
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${center.x}, ${center.y})`, children: [
348
+ /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(-${center.x}, -${center.y})`, children }),
349
+ animationElements
350
+ ] });
351
+ }
352
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
353
+ children,
354
+ animationElements
355
+ ] });
128
356
  }
129
- /**
130
- * Creates a SMIL animation definition that can be referenced by id.
131
- * Useful for applying the same animation to multiple elements.
132
- */
133
357
  function createSmilAnimationDef(id, config) {
134
- return (jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("g", { id: id, children: generateSmilAnimation(config) }) }));
358
+ return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("g", { id, children: generateSmilAnimation(config) }) });
135
359
  }
136
- /**
137
- * Utility to check if SMIL animations are supported in the current environment.
138
- */
139
360
  function isSmilSupported() {
140
- if (typeof document === 'undefined') {
141
- return false;
142
- }
143
- const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
144
- return (typeof svg.animate === 'function' ||
145
- 'animateTransform' in document.createElementNS('http://www.w3.org/2000/svg', 'animateTransform'));
361
+ if (typeof document === "undefined") {
362
+ return false;
363
+ }
364
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
365
+ return typeof svg.animate === "function" || "animateTransform" in document.createElementNS("http://www.w3.org/2000/svg", "animateTransform");
146
366
  }
147
- /**
148
- * All available SMIL animation types as an array.
149
- * Useful for documentation and UI components like NiceIconPicker.
150
- */
151
367
  const SMIL_ANIMATION_TYPES = [
152
- 'spin',
153
- 'spin-reverse',
154
- 'pulse',
155
- 'bounce',
156
- 'shake',
157
- 'float',
158
- 'flip',
159
- 'wiggle',
160
- 'swing',
161
- 'heartbeat',
162
- 'scale-pulse',
163
- 'grow',
164
- 'shrink',
165
- 'rubber',
166
- 'pop',
167
- 'fade',
168
- 'blink',
169
- 'glow',
170
- 'slide-x',
171
- 'slide-y',
172
- 'orbit',
173
- 'wave',
174
- 'draw',
175
- 'draw-reverse',
176
- 'color-shift',
368
+ "spin",
369
+ "spin-reverse",
370
+ "pulse",
371
+ "bounce",
372
+ "shake",
373
+ "float",
374
+ "flip",
375
+ "wiggle",
376
+ "swing",
377
+ "heartbeat",
378
+ "scale-pulse",
379
+ "grow",
380
+ "shrink",
381
+ "rubber",
382
+ "pop",
383
+ "fade",
384
+ "blink",
385
+ "glow",
386
+ "slide-x",
387
+ "slide-y",
388
+ "orbit",
389
+ "wave",
390
+ "draw",
391
+ "draw-reverse",
392
+ "color-shift"
177
393
  ];
178
-
179
394
  exports.SMIL_ANIMATION_TYPES = SMIL_ANIMATION_TYPES;
180
395
  exports.SmilAnimationWrapper = SmilAnimationWrapper;
181
396
  exports.createSmilAnimationDef = createSmilAnimationDef;