@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
@@ -10,333 +10,296 @@
10
10
  * @license MIT
11
11
  */
12
12
  const defaultSizes = {
13
- xs: '0.75rem',
14
- sm: '1rem',
15
- md: '1.5rem',
16
- lg: '2rem',
17
- xl: '3rem',
18
- '2xl': '4rem',
13
+ xs: "0.75rem",
14
+ sm: "1rem",
15
+ md: "1.5rem",
16
+ lg: "2rem",
17
+ xl: "3rem",
18
+ "2xl": "4rem"
19
19
  };
20
- /**
21
- * Tailwind CSS Plugin for NiceToDev Icons
22
- *
23
- * @example
24
- * // tailwind.config.js
25
- * import { ntdIconPlugin } from '@nice2dev/icons/tailwind';
26
- *
27
- * export default {
28
- * plugins: [
29
- * ntdIconPlugin({
30
- * prefix: 'ntd-icon',
31
- * animations: true,
32
- * }),
33
- * ],
34
- * };
35
- *
36
- * @example
37
- * // Usage in components
38
- * <NtdHome className="ntd-icon-md text-blue-500 hover:ntd-icon-bounce" />
39
- * <NtdStar className="ntd-icon-lg ntd-icon-spin text-yellow-400" />
40
- */
41
20
  const ntdIconPlugin = (options = {}) => {
42
- const { prefix = 'ntd-icon', sizes = defaultSizes, animations = true, variantUtilities = true, } = options;
43
- return function ({ addUtilities, addComponents, theme, matchUtilities }) {
44
- // ─────────────────────────────────────────────────────────────────────
45
- // SIZE UTILITIES
46
- // ─────────────────────────────────────────────────────────────────────
47
- const sizeUtilities = {};
48
- Object.entries(sizes).forEach(([key, value]) => {
49
- sizeUtilities[`.${prefix}-${key}`] = {
50
- width: value,
51
- height: value,
52
- };
53
- });
54
- addUtilities(sizeUtilities);
55
- // Dynamic sizing using Tailwind's spacing scale
56
- matchUtilities({
57
- [`${prefix}-size`]: (value) => ({
58
- width: value,
59
- height: value,
60
- }),
61
- }, { values: theme('spacing') });
62
- // ─────────────────────────────────────────────────────────────────────
63
- // COLOR UTILITIES (for SVG icons)
64
- // ─────────────────────────────────────────────────────────────────────
65
- const colorUtilities = {
66
- // Primary color (main icon color)
67
- [`.${prefix}-current`]: {
68
- color: 'currentColor',
69
- '--ntd-primary-color': 'currentColor',
70
- },
71
- // For duotone: secondary color
72
- [`.${prefix}-secondary-current`]: {
73
- '--ntd-secondary-color': 'currentColor',
74
- },
75
- // Opacity for secondary color in duotone
76
- [`.${prefix}-secondary-opacity-25`]: {
77
- '--ntd-secondary-opacity': '0.25',
78
- },
79
- [`.${prefix}-secondary-opacity-50`]: {
80
- '--ntd-secondary-opacity': '0.5',
81
- },
82
- [`.${prefix}-secondary-opacity-75`]: {
83
- '--ntd-secondary-opacity': '0.75',
84
- },
85
- };
86
- addUtilities(colorUtilities);
87
- // Dynamic color matching using Tailwind's color palette
88
- matchUtilities({
89
- [`${prefix}-primary`]: (value) => ({
90
- '--ntd-primary-color': value,
91
- }),
92
- [`${prefix}-secondary`]: (value) => ({
93
- '--ntd-secondary-color': value,
94
- }),
95
- }, { values: flattenColorPalette(theme('colors')) });
96
- // ─────────────────────────────────────────────────────────────────────
97
- // STROKE WIDTH UTILITIES
98
- // ─────────────────────────────────────────────────────────────────────
99
- const strokeUtilities = {
100
- [`.${prefix}-stroke-thin`]: {
101
- '--ntd-stroke-width': '1',
102
- },
103
- [`.${prefix}-stroke-normal`]: {
104
- '--ntd-stroke-width': '1.5',
105
- },
106
- [`.${prefix}-stroke-medium`]: {
107
- '--ntd-stroke-width': '2',
108
- },
109
- [`.${prefix}-stroke-thick`]: {
110
- '--ntd-stroke-width': '2.5',
111
- },
112
- [`.${prefix}-stroke-bold`]: {
113
- '--ntd-stroke-width': '3',
114
- },
115
- };
116
- addUtilities(strokeUtilities);
117
- matchUtilities({
118
- [`${prefix}-stroke`]: (value) => ({
119
- '--ntd-stroke-width': value,
120
- }),
121
- }, { values: { '0.5': '0.5', '1': '1', '1.5': '1.5', '2': '2', '2.5': '2.5', '3': '3' } });
122
- // ─────────────────────────────────────────────────────────────────────
123
- // VARIANT UTILITIES
124
- // ─────────────────────────────────────────────────────────────────────
125
- if (variantUtilities) {
126
- const variantClasses = {
127
- [`.${prefix}-solid`]: {
128
- '--ntd-variant': 'solid',
129
- },
130
- [`.${prefix}-outline`]: {
131
- '--ntd-variant': 'outline',
132
- },
133
- [`.${prefix}-sharp`]: {
134
- '--ntd-variant': 'sharp',
135
- },
136
- [`.${prefix}-duotone`]: {
137
- '--ntd-variant': 'duotone',
138
- },
139
- [`.${prefix}-cutout`]: {
140
- '--ntd-variant': 'cutout',
141
- },
142
- [`.${prefix}-vivid`]: {
143
- '--ntd-variant': 'vivid',
144
- },
145
- };
146
- addUtilities(variantClasses);
21
+ const {
22
+ prefix = "ntd-icon",
23
+ sizes = defaultSizes,
24
+ animations = true,
25
+ variantUtilities = true
26
+ } = options;
27
+ return function({ addUtilities, addComponents, theme, matchUtilities }) {
28
+ const sizeUtilities = {};
29
+ Object.entries(sizes).forEach(([key, value]) => {
30
+ sizeUtilities[`.${prefix}-${key}`] = {
31
+ width: value,
32
+ height: value
33
+ };
34
+ });
35
+ addUtilities(sizeUtilities);
36
+ matchUtilities(
37
+ {
38
+ [`${prefix}-size`]: (value) => ({
39
+ width: value,
40
+ height: value
41
+ })
42
+ },
43
+ { values: theme("spacing") }
44
+ );
45
+ const colorUtilities = {
46
+ // Primary color (main icon color)
47
+ [`.${prefix}-current`]: {
48
+ color: "currentColor",
49
+ "--ntd-primary-color": "currentColor"
50
+ },
51
+ // For duotone: secondary color
52
+ [`.${prefix}-secondary-current`]: {
53
+ "--ntd-secondary-color": "currentColor"
54
+ },
55
+ // Opacity for secondary color in duotone
56
+ [`.${prefix}-secondary-opacity-25`]: {
57
+ "--ntd-secondary-opacity": "0.25"
58
+ },
59
+ [`.${prefix}-secondary-opacity-50`]: {
60
+ "--ntd-secondary-opacity": "0.5"
61
+ },
62
+ [`.${prefix}-secondary-opacity-75`]: {
63
+ "--ntd-secondary-opacity": "0.75"
64
+ }
65
+ };
66
+ addUtilities(colorUtilities);
67
+ matchUtilities(
68
+ {
69
+ [`${prefix}-primary`]: (value) => ({
70
+ "--ntd-primary-color": value
71
+ }),
72
+ [`${prefix}-secondary`]: (value) => ({
73
+ "--ntd-secondary-color": value
74
+ })
75
+ },
76
+ { values: flattenColorPalette(theme("colors")) }
77
+ );
78
+ const strokeUtilities = {
79
+ [`.${prefix}-stroke-thin`]: {
80
+ "--ntd-stroke-width": "1"
81
+ },
82
+ [`.${prefix}-stroke-normal`]: {
83
+ "--ntd-stroke-width": "1.5"
84
+ },
85
+ [`.${prefix}-stroke-medium`]: {
86
+ "--ntd-stroke-width": "2"
87
+ },
88
+ [`.${prefix}-stroke-thick`]: {
89
+ "--ntd-stroke-width": "2.5"
90
+ },
91
+ [`.${prefix}-stroke-bold`]: {
92
+ "--ntd-stroke-width": "3"
93
+ }
94
+ };
95
+ addUtilities(strokeUtilities);
96
+ matchUtilities(
97
+ {
98
+ [`${prefix}-stroke`]: (value) => ({
99
+ "--ntd-stroke-width": value
100
+ })
101
+ },
102
+ { values: { "0.5": "0.5", "1": "1", "1.5": "1.5", "2": "2", "2.5": "2.5", "3": "3" } }
103
+ );
104
+ if (variantUtilities) {
105
+ const variantClasses = {
106
+ [`.${prefix}-solid`]: {
107
+ "--ntd-variant": "solid"
108
+ },
109
+ [`.${prefix}-outline`]: {
110
+ "--ntd-variant": "outline"
111
+ },
112
+ [`.${prefix}-sharp`]: {
113
+ "--ntd-variant": "sharp"
114
+ },
115
+ [`.${prefix}-duotone`]: {
116
+ "--ntd-variant": "duotone"
117
+ },
118
+ [`.${prefix}-cutout`]: {
119
+ "--ntd-variant": "cutout"
120
+ },
121
+ [`.${prefix}-vivid`]: {
122
+ "--ntd-variant": "vivid"
123
+ }
124
+ };
125
+ addUtilities(variantClasses);
126
+ }
127
+ if (animations) {
128
+ const animationUtilities = {
129
+ // Spin animation
130
+ [`.${prefix}-spin`]: {
131
+ animation: `${prefix}-spin 1s linear infinite`
132
+ },
133
+ [`.${prefix}-spin-slow`]: {
134
+ animation: `${prefix}-spin 2s linear infinite`
135
+ },
136
+ [`.${prefix}-spin-fast`]: {
137
+ animation: `${prefix}-spin 0.5s linear infinite`
138
+ },
139
+ // Pulse animation
140
+ [`.${prefix}-pulse`]: {
141
+ animation: `${prefix}-pulse 2s ease-in-out infinite`
142
+ },
143
+ // Bounce animation
144
+ [`.${prefix}-bounce`]: {
145
+ animation: `${prefix}-bounce 1s ease-in-out infinite`
146
+ },
147
+ // Shake animation (for errors/alerts)
148
+ [`.${prefix}-shake`]: {
149
+ animation: `${prefix}-shake 0.5s ease-in-out`
150
+ },
151
+ // Fade in
152
+ [`.${prefix}-fade-in`]: {
153
+ animation: `${prefix}-fade-in 0.3s ease-out`
154
+ },
155
+ // Scale up
156
+ [`.${prefix}-scale-in`]: {
157
+ animation: `${prefix}-scale-in 0.2s ease-out`
158
+ },
159
+ // Wiggle (for attention)
160
+ [`.${prefix}-wiggle`]: {
161
+ animation: `${prefix}-wiggle 0.5s ease-in-out`
162
+ },
163
+ // Float (subtle up/down)
164
+ [`.${prefix}-float`]: {
165
+ animation: `${prefix}-float 3s ease-in-out infinite`
166
+ },
167
+ // Glow effect
168
+ [`.${prefix}-glow`]: {
169
+ filter: "drop-shadow(0 0 8px currentColor)",
170
+ animation: `${prefix}-glow 2s ease-in-out infinite alternate`
171
+ }
172
+ };
173
+ addUtilities(animationUtilities);
174
+ addComponents({
175
+ [`@keyframes ${prefix}-spin`]: {
176
+ from: { transform: "rotate(0deg)" },
177
+ to: { transform: "rotate(360deg)" }
178
+ },
179
+ [`@keyframes ${prefix}-pulse`]: {
180
+ "0%, 100%": { opacity: "1" },
181
+ "50%": { opacity: "0.5" }
182
+ },
183
+ [`@keyframes ${prefix}-bounce`]: {
184
+ "0%, 100%": { transform: "translateY(0)" },
185
+ "50%": { transform: "translateY(-25%)" }
186
+ },
187
+ [`@keyframes ${prefix}-shake`]: {
188
+ "0%, 100%": { transform: "translateX(0)" },
189
+ "10%, 30%, 50%, 70%, 90%": { transform: "translateX(-4px)" },
190
+ "20%, 40%, 60%, 80%": { transform: "translateX(4px)" }
191
+ },
192
+ [`@keyframes ${prefix}-fade-in`]: {
193
+ from: { opacity: "0" },
194
+ to: { opacity: "1" }
195
+ },
196
+ [`@keyframes ${prefix}-scale-in`]: {
197
+ from: { transform: "scale(0.8)", opacity: "0" },
198
+ to: { transform: "scale(1)", opacity: "1" }
199
+ },
200
+ [`@keyframes ${prefix}-wiggle`]: {
201
+ "0%, 100%": { transform: "rotate(0deg)" },
202
+ "25%": { transform: "rotate(-5deg)" },
203
+ "75%": { transform: "rotate(5deg)" }
204
+ },
205
+ [`@keyframes ${prefix}-float`]: {
206
+ "0%, 100%": { transform: "translateY(0)" },
207
+ "50%": { transform: "translateY(-10%)" }
208
+ },
209
+ [`@keyframes ${prefix}-glow`]: {
210
+ from: { filter: "drop-shadow(0 0 4px currentColor)" },
211
+ to: { filter: "drop-shadow(0 0 12px currentColor)" }
147
212
  }
148
- // ─────────────────────────────────────────────────────────────────────
149
- // ANIMATION UTILITIES
150
- // ─────────────────────────────────────────────────────────────────────
151
- if (animations) {
152
- const animationUtilities = {
153
- // Spin animation
154
- [`.${prefix}-spin`]: {
155
- animation: `${prefix}-spin 1s linear infinite`,
156
- },
157
- [`.${prefix}-spin-slow`]: {
158
- animation: `${prefix}-spin 2s linear infinite`,
159
- },
160
- [`.${prefix}-spin-fast`]: {
161
- animation: `${prefix}-spin 0.5s linear infinite`,
162
- },
163
- // Pulse animation
164
- [`.${prefix}-pulse`]: {
165
- animation: `${prefix}-pulse 2s ease-in-out infinite`,
166
- },
167
- // Bounce animation
168
- [`.${prefix}-bounce`]: {
169
- animation: `${prefix}-bounce 1s ease-in-out infinite`,
170
- },
171
- // Shake animation (for errors/alerts)
172
- [`.${prefix}-shake`]: {
173
- animation: `${prefix}-shake 0.5s ease-in-out`,
174
- },
175
- // Fade in
176
- [`.${prefix}-fade-in`]: {
177
- animation: `${prefix}-fade-in 0.3s ease-out`,
178
- },
179
- // Scale up
180
- [`.${prefix}-scale-in`]: {
181
- animation: `${prefix}-scale-in 0.2s ease-out`,
182
- },
183
- // Wiggle (for attention)
184
- [`.${prefix}-wiggle`]: {
185
- animation: `${prefix}-wiggle 0.5s ease-in-out`,
186
- },
187
- // Float (subtle up/down)
188
- [`.${prefix}-float`]: {
189
- animation: `${prefix}-float 3s ease-in-out infinite`,
190
- },
191
- // Glow effect
192
- [`.${prefix}-glow`]: {
193
- filter: 'drop-shadow(0 0 8px currentColor)',
194
- animation: `${prefix}-glow 2s ease-in-out infinite alternate`,
195
- },
196
- };
197
- addUtilities(animationUtilities);
198
- // Keyframes for animations
199
- addComponents({
200
- [`@keyframes ${prefix}-spin`]: {
201
- from: { transform: 'rotate(0deg)' },
202
- to: { transform: 'rotate(360deg)' },
203
- },
204
- [`@keyframes ${prefix}-pulse`]: {
205
- '0%, 100%': { opacity: '1' },
206
- '50%': { opacity: '0.5' },
207
- },
208
- [`@keyframes ${prefix}-bounce`]: {
209
- '0%, 100%': { transform: 'translateY(0)' },
210
- '50%': { transform: 'translateY(-25%)' },
211
- },
212
- [`@keyframes ${prefix}-shake`]: {
213
- '0%, 100%': { transform: 'translateX(0)' },
214
- '10%, 30%, 50%, 70%, 90%': { transform: 'translateX(-4px)' },
215
- '20%, 40%, 60%, 80%': { transform: 'translateX(4px)' },
216
- },
217
- [`@keyframes ${prefix}-fade-in`]: {
218
- from: { opacity: '0' },
219
- to: { opacity: '1' },
220
- },
221
- [`@keyframes ${prefix}-scale-in`]: {
222
- from: { transform: 'scale(0.8)', opacity: '0' },
223
- to: { transform: 'scale(1)', opacity: '1' },
224
- },
225
- [`@keyframes ${prefix}-wiggle`]: {
226
- '0%, 100%': { transform: 'rotate(0deg)' },
227
- '25%': { transform: 'rotate(-5deg)' },
228
- '75%': { transform: 'rotate(5deg)' },
229
- },
230
- [`@keyframes ${prefix}-float`]: {
231
- '0%, 100%': { transform: 'translateY(0)' },
232
- '50%': { transform: 'translateY(-10%)' },
233
- },
234
- [`@keyframes ${prefix}-glow`]: {
235
- from: { filter: 'drop-shadow(0 0 4px currentColor)' },
236
- to: { filter: 'drop-shadow(0 0 12px currentColor)' },
237
- },
238
- });
239
- // Hover animations
240
- const hoverAnimations = {
241
- [`.hover\\:${prefix}-bounce:hover`]: {
242
- animation: `${prefix}-bounce 0.5s ease-in-out`,
243
- },
244
- [`.hover\\:${prefix}-shake:hover`]: {
245
- animation: `${prefix}-shake 0.5s ease-in-out`,
246
- },
247
- [`.hover\\:${prefix}-wiggle:hover`]: {
248
- animation: `${prefix}-wiggle 0.5s ease-in-out`,
249
- },
250
- [`.hover\\:${prefix}-scale:hover`]: {
251
- transform: 'scale(1.1)',
252
- transition: 'transform 0.2s ease-out',
253
- },
254
- [`.hover\\:${prefix}-glow:hover`]: {
255
- filter: 'drop-shadow(0 0 8px currentColor)',
256
- },
257
- };
258
- addUtilities(hoverAnimations);
213
+ });
214
+ const hoverAnimations = {
215
+ [`.hover\\:${prefix}-bounce:hover`]: {
216
+ animation: `${prefix}-bounce 0.5s ease-in-out`
217
+ },
218
+ [`.hover\\:${prefix}-shake:hover`]: {
219
+ animation: `${prefix}-shake 0.5s ease-in-out`
220
+ },
221
+ [`.hover\\:${prefix}-wiggle:hover`]: {
222
+ animation: `${prefix}-wiggle 0.5s ease-in-out`
223
+ },
224
+ [`.hover\\:${prefix}-scale:hover`]: {
225
+ transform: "scale(1.1)",
226
+ transition: "transform 0.2s ease-out"
227
+ },
228
+ [`.hover\\:${prefix}-glow:hover`]: {
229
+ filter: "drop-shadow(0 0 8px currentColor)"
259
230
  }
260
- // ─────────────────────────────────────────────────────────────────────
261
- // TRANSITION UTILITIES
262
- // ─────────────────────────────────────────────────────────────────────
263
- const transitionUtilities = {
264
- [`.${prefix}-transition`]: {
265
- transition: 'all 0.2s ease-out',
266
- },
267
- [`.${prefix}-transition-fast`]: {
268
- transition: 'all 0.1s ease-out',
269
- },
270
- [`.${prefix}-transition-slow`]: {
271
- transition: 'all 0.3s ease-out',
272
- },
273
- [`.${prefix}-transition-colors`]: {
274
- transition: 'color 0.2s ease-out, fill 0.2s ease-out, stroke 0.2s ease-out',
275
- },
276
- };
277
- addUtilities(transitionUtilities);
278
- // ─────────────────────────────────────────────────────────────────────
279
- // ACCESSIBILITY UTILITIES
280
- // ─────────────────────────────────────────────────────────────────────
281
- const a11yUtilities = {
282
- // Reduced motion support
283
- [`@media (prefers-reduced-motion: reduce)`]: {
284
- [`.${prefix}-spin, .${prefix}-spin-slow, .${prefix}-spin-fast, .${prefix}-pulse, .${prefix}-bounce, .${prefix}-shake, .${prefix}-wiggle, .${prefix}-float, .${prefix}-glow`]: {
285
- animation: 'none !important',
286
- },
287
- },
288
- // Focus visible outline
289
- [`.${prefix}-focus-visible:focus-visible`]: {
290
- outline: '2px solid currentColor',
291
- outlineOffset: '2px',
292
- },
293
- // High contrast mode
294
- [`@media (forced-colors: active)`]: {
295
- [`.${prefix}-high-contrast`]: {
296
- forcedColorAdjust: 'auto',
297
- },
298
- },
299
- };
300
- addComponents(a11yUtilities);
231
+ };
232
+ addUtilities(hoverAnimations);
233
+ }
234
+ const transitionUtilities = {
235
+ [`.${prefix}-transition`]: {
236
+ transition: "all 0.2s ease-out"
237
+ },
238
+ [`.${prefix}-transition-fast`]: {
239
+ transition: "all 0.1s ease-out"
240
+ },
241
+ [`.${prefix}-transition-slow`]: {
242
+ transition: "all 0.3s ease-out"
243
+ },
244
+ [`.${prefix}-transition-colors`]: {
245
+ transition: "color 0.2s ease-out, fill 0.2s ease-out, stroke 0.2s ease-out"
246
+ }
301
247
  };
248
+ addUtilities(transitionUtilities);
249
+ const a11yUtilities = {
250
+ // Reduced motion support
251
+ [`@media (prefers-reduced-motion: reduce)`]: {
252
+ [`.${prefix}-spin, .${prefix}-spin-slow, .${prefix}-spin-fast, .${prefix}-pulse, .${prefix}-bounce, .${prefix}-shake, .${prefix}-wiggle, .${prefix}-float, .${prefix}-glow`]: {
253
+ animation: "none !important"
254
+ }
255
+ },
256
+ // Focus visible outline
257
+ [`.${prefix}-focus-visible:focus-visible`]: {
258
+ outline: "2px solid currentColor",
259
+ outlineOffset: "2px"
260
+ },
261
+ // High contrast mode
262
+ [`@media (forced-colors: active)`]: {
263
+ [`.${prefix}-high-contrast`]: {
264
+ forcedColorAdjust: "auto"
265
+ }
266
+ }
267
+ };
268
+ addComponents(a11yUtilities);
269
+ };
302
270
  };
303
- /**
304
- * Helper to flatten color palette for matchUtilities
305
- */
306
271
  function flattenColorPalette(colors) {
307
- const result = {};
308
- function flatten(obj, prefix = '') {
309
- for (const [key, value] of Object.entries(obj)) {
310
- if (typeof value === 'string') {
311
- result[prefix ? `${prefix}-${key}` : key] = value;
312
- }
313
- else if (typeof value === 'object' && value !== null) {
314
- flatten(value, prefix ? `${prefix}-${key}` : key);
315
- }
316
- }
272
+ const result = {};
273
+ function flatten(obj, prefix = "") {
274
+ for (const [key, value] of Object.entries(obj)) {
275
+ if (typeof value === "string") {
276
+ result[prefix ? `${prefix}-${key}` : key] = value;
277
+ } else if (typeof value === "object" && value !== null) {
278
+ flatten(value, prefix ? `${prefix}-${key}` : key);
279
+ }
317
280
  }
318
- flatten(colors);
319
- return result;
281
+ }
282
+ flatten(colors);
283
+ return result;
320
284
  }
321
- /**
322
- * Preset for common icon configurations
323
- */
324
285
  const ntdIconPreset = {
325
- theme: {
326
- extend: {
327
- colors: {
328
- ntd: {
329
- primary: '#3B82F6',
330
- secondary: '#64748B',
331
- accent: '#8B5CF6',
332
- success: '#22C55E',
333
- warning: '#F59E0B',
334
- error: '#EF4444',
335
- info: '#06B6D4',
336
- },
337
- },
338
- },
339
- },
286
+ theme: {
287
+ extend: {
288
+ colors: {
289
+ ntd: {
290
+ primary: "#3B82F6",
291
+ secondary: "#64748B",
292
+ accent: "#8B5CF6",
293
+ success: "#22C55E",
294
+ warning: "#F59E0B",
295
+ error: "#EF4444",
296
+ info: "#06B6D4"
297
+ }
298
+ }
299
+ }
300
+ }
301
+ };
302
+ export {
303
+ ntdIconPlugin,
304
+ ntdIconPreset
340
305
  };
341
-
342
- export { ntdIconPlugin, ntdIconPreset };