rn-iconify 2.0.1 → 2.1.1

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 (280) hide show
  1. package/README.md +8 -2
  2. package/lib/commonjs/IconRenderer.js +56 -20
  3. package/lib/commonjs/IconRenderer.js.map +1 -1
  4. package/lib/commonjs/alias/Icon.js +35 -1
  5. package/lib/commonjs/alias/Icon.js.map +1 -1
  6. package/lib/commonjs/babel/cache-writer.js +1 -1
  7. package/lib/commonjs/babel/cache-writer.js.map +1 -1
  8. package/lib/commonjs/babel/index.js +0 -1
  9. package/lib/commonjs/babel/index.js.map +1 -1
  10. package/lib/commonjs/cache/CacheManager.js +13 -1
  11. package/lib/commonjs/cache/CacheManager.js.map +1 -1
  12. package/lib/commonjs/cache/DiskCache.js +33 -4
  13. package/lib/commonjs/cache/DiskCache.js.map +1 -1
  14. package/lib/commonjs/cli/CLAUDE.md +7 -0
  15. package/lib/commonjs/cli/commands/bundle.js +37 -6
  16. package/lib/commonjs/cli/commands/bundle.js.map +1 -1
  17. package/lib/commonjs/createIconSet.js +20 -1
  18. package/lib/commonjs/createIconSet.js.map +1 -1
  19. package/lib/commonjs/network/IconifyAPI.js +30 -2
  20. package/lib/commonjs/network/IconifyAPI.js.map +1 -1
  21. package/lib/module/IconRenderer.js +57 -19
  22. package/lib/module/IconRenderer.js.map +1 -1
  23. package/lib/module/alias/Icon.js +35 -1
  24. package/lib/module/alias/Icon.js.map +1 -1
  25. package/lib/module/babel/cache-writer.js +1 -1
  26. package/lib/module/babel/cache-writer.js.map +1 -1
  27. package/lib/module/babel/index.js +0 -1
  28. package/lib/module/babel/index.js.map +1 -1
  29. package/lib/module/cache/CacheManager.js +13 -1
  30. package/lib/module/cache/CacheManager.js.map +1 -1
  31. package/lib/module/cache/DiskCache.js +32 -4
  32. package/lib/module/cache/DiskCache.js.map +1 -1
  33. package/lib/module/cli/CLAUDE.md +7 -0
  34. package/lib/module/cli/commands/bundle.js +37 -6
  35. package/lib/module/cli/commands/bundle.js.map +1 -1
  36. package/lib/module/createIconSet.js +20 -1
  37. package/lib/module/createIconSet.js.map +1 -1
  38. package/lib/module/network/IconifyAPI.js +30 -2
  39. package/lib/module/network/IconifyAPI.js.map +1 -1
  40. package/lib/typescript/IconRenderer.d.ts +1 -1
  41. package/lib/typescript/IconRenderer.d.ts.map +1 -1
  42. package/lib/typescript/alias/Icon.d.ts +1 -1
  43. package/lib/typescript/alias/Icon.d.ts.map +1 -1
  44. package/lib/typescript/babel/index.d.ts +0 -1
  45. package/lib/typescript/babel/index.d.ts.map +1 -1
  46. package/lib/typescript/babel/types.d.ts +1 -1
  47. package/lib/typescript/cache/CacheManager.d.ts.map +1 -1
  48. package/lib/typescript/cache/DiskCache.d.ts +2 -0
  49. package/lib/typescript/cache/DiskCache.d.ts.map +1 -1
  50. package/lib/typescript/cli/commands/bundle.d.ts.map +1 -1
  51. package/lib/typescript/components/Academicons.d.ts +1 -1
  52. package/lib/typescript/components/AkarIcons.d.ts +1 -1
  53. package/lib/typescript/components/AntDesign.d.ts +1 -1
  54. package/lib/typescript/components/Arcticons.d.ts +1 -1
  55. package/lib/typescript/components/Basil.d.ts +1 -1
  56. package/lib/typescript/components/Bi.d.ts +1 -1
  57. package/lib/typescript/components/BitcoinIcons.d.ts +1 -1
  58. package/lib/typescript/components/Bpmn.d.ts +1 -1
  59. package/lib/typescript/components/Brandico.d.ts +1 -1
  60. package/lib/typescript/components/Bx.d.ts +1 -1
  61. package/lib/typescript/components/Bxl.d.ts +1 -1
  62. package/lib/typescript/components/Bxs.d.ts +1 -1
  63. package/lib/typescript/components/Bytesize.d.ts +1 -1
  64. package/lib/typescript/components/Carbon.d.ts +1 -1
  65. package/lib/typescript/components/Catppuccin.d.ts +1 -1
  66. package/lib/typescript/components/Cbi.d.ts +1 -1
  67. package/lib/typescript/components/Charm.d.ts +1 -1
  68. package/lib/typescript/components/Ci.d.ts +1 -1
  69. package/lib/typescript/components/Cib.d.ts +1 -1
  70. package/lib/typescript/components/Cif.d.ts +1 -1
  71. package/lib/typescript/components/Cil.d.ts +1 -1
  72. package/lib/typescript/components/CircleFlags.d.ts +1 -1
  73. package/lib/typescript/components/Circum.d.ts +1 -1
  74. package/lib/typescript/components/Clarity.d.ts +1 -1
  75. package/lib/typescript/components/Codex.d.ts +1 -1
  76. package/lib/typescript/components/Codicon.d.ts +1 -1
  77. package/lib/typescript/components/Covid.d.ts +1 -1
  78. package/lib/typescript/components/Cryptocurrency.d.ts +1 -1
  79. package/lib/typescript/components/CryptocurrencyColor.d.ts +1 -1
  80. package/lib/typescript/components/Cuida.d.ts +1 -1
  81. package/lib/typescript/components/Dashicons.d.ts +1 -1
  82. package/lib/typescript/components/Devicon.d.ts +1 -1
  83. package/lib/typescript/components/DeviconPlain.d.ts +1 -1
  84. package/lib/typescript/components/DinkieIcons.d.ts +1 -1
  85. package/lib/typescript/components/DuoIcons.d.ts +1 -1
  86. package/lib/typescript/components/Ei.d.ts +1 -1
  87. package/lib/typescript/components/El.d.ts +1 -1
  88. package/lib/typescript/components/EmojioneMonotone.d.ts +1 -1
  89. package/lib/typescript/components/Entypo.d.ts +1 -1
  90. package/lib/typescript/components/EntypoSocial.d.ts +1 -1
  91. package/lib/typescript/components/EosIcons.d.ts +1 -1
  92. package/lib/typescript/components/Ep.d.ts +1 -1
  93. package/lib/typescript/components/Et.d.ts +1 -1
  94. package/lib/typescript/components/Eva.d.ts +1 -1
  95. package/lib/typescript/components/F7.d.ts +1 -1
  96. package/lib/typescript/components/Fa.d.ts +1 -1
  97. package/lib/typescript/components/Fa6Brands.d.ts +1 -1
  98. package/lib/typescript/components/Fa6Regular.d.ts +1 -1
  99. package/lib/typescript/components/Fa6Solid.d.ts +1 -1
  100. package/lib/typescript/components/Fa7Brands.d.ts +1 -1
  101. package/lib/typescript/components/Fa7Regular.d.ts +1 -1
  102. package/lib/typescript/components/Fa7Solid.d.ts +1 -1
  103. package/lib/typescript/components/FaBrands.d.ts +1 -1
  104. package/lib/typescript/components/FaRegular.d.ts +1 -1
  105. package/lib/typescript/components/FaSolid.d.ts +1 -1
  106. package/lib/typescript/components/Fad.d.ts +1 -1
  107. package/lib/typescript/components/Famicons.d.ts +1 -1
  108. package/lib/typescript/components/Fe.d.ts +1 -1
  109. package/lib/typescript/components/Feather.d.ts +1 -1
  110. package/lib/typescript/components/FileIcons.d.ts +1 -1
  111. package/lib/typescript/components/Flag.d.ts +1 -1
  112. package/lib/typescript/components/Flagpack.d.ts +1 -1
  113. package/lib/typescript/components/FlatUi.d.ts +1 -1
  114. package/lib/typescript/components/Flowbite.d.ts +1 -1
  115. package/lib/typescript/components/Fluent.d.ts +1 -1
  116. package/lib/typescript/components/FluentColor.d.ts +1 -1
  117. package/lib/typescript/components/FluentEmoji.d.ts +1 -1
  118. package/lib/typescript/components/FluentEmojiFlat.d.ts +1 -1
  119. package/lib/typescript/components/FluentEmojiHighContrast.d.ts +1 -1
  120. package/lib/typescript/components/FluentMdl2.d.ts +1 -1
  121. package/lib/typescript/components/Fontelico.d.ts +1 -1
  122. package/lib/typescript/components/Fontisto.d.ts +1 -1
  123. package/lib/typescript/components/Formkit.d.ts +1 -1
  124. package/lib/typescript/components/Foundation.d.ts +1 -1
  125. package/lib/typescript/components/Gala.d.ts +1 -1
  126. package/lib/typescript/components/GameIcons.d.ts +1 -1
  127. package/lib/typescript/components/Garden.d.ts +1 -1
  128. package/lib/typescript/components/Geo.d.ts +1 -1
  129. package/lib/typescript/components/Gg.d.ts +1 -1
  130. package/lib/typescript/components/Gis.d.ts +1 -1
  131. package/lib/typescript/components/GravityUi.d.ts +1 -1
  132. package/lib/typescript/components/Gridicons.d.ts +1 -1
  133. package/lib/typescript/components/GrommetIcons.d.ts +1 -1
  134. package/lib/typescript/components/Guidance.d.ts +1 -1
  135. package/lib/typescript/components/Healthicons.d.ts +1 -1
  136. package/lib/typescript/components/Heroicons.d.ts +1 -1
  137. package/lib/typescript/components/HeroiconsOutline.d.ts +1 -1
  138. package/lib/typescript/components/HeroiconsSolid.d.ts +1 -1
  139. package/lib/typescript/components/Hugeicons.d.ts +1 -1
  140. package/lib/typescript/components/Humbleicons.d.ts +1 -1
  141. package/lib/typescript/components/Ic.d.ts +1 -1
  142. package/lib/typescript/components/IcomoonFree.d.ts +1 -1
  143. package/lib/typescript/components/IconPark.d.ts +1 -1
  144. package/lib/typescript/components/IconParkOutline.d.ts +1 -1
  145. package/lib/typescript/components/IconParkSolid.d.ts +1 -1
  146. package/lib/typescript/components/IconParkTwotone.d.ts +1 -1
  147. package/lib/typescript/components/Iconamoon.d.ts +1 -1
  148. package/lib/typescript/components/Iconoir.d.ts +1 -1
  149. package/lib/typescript/components/Icons8.d.ts +1 -1
  150. package/lib/typescript/components/Il.d.ts +1 -1
  151. package/lib/typescript/components/Ion.d.ts +1 -1
  152. package/lib/typescript/components/Iwwa.d.ts +1 -1
  153. package/lib/typescript/components/Ix.d.ts +1 -1
  154. package/lib/typescript/components/Jam.d.ts +1 -1
  155. package/lib/typescript/components/La.d.ts +1 -1
  156. package/lib/typescript/components/LetsIcons.d.ts +1 -1
  157. package/lib/typescript/components/LineMd.d.ts +1 -1
  158. package/lib/typescript/components/Lineicons.d.ts +1 -1
  159. package/lib/typescript/components/Logos.d.ts +1 -1
  160. package/lib/typescript/components/Ls.d.ts +1 -1
  161. package/lib/typescript/components/Lsicon.d.ts +1 -1
  162. package/lib/typescript/components/Lucide.d.ts +1 -1
  163. package/lib/typescript/components/LucideLab.d.ts +1 -1
  164. package/lib/typescript/components/Mage.d.ts +1 -1
  165. package/lib/typescript/components/Majesticons.d.ts +1 -1
  166. package/lib/typescript/components/Maki.d.ts +1 -1
  167. package/lib/typescript/components/Map.d.ts +1 -1
  168. package/lib/typescript/components/Marketeq.d.ts +1 -1
  169. package/lib/typescript/components/MaterialIconTheme.d.ts +1 -1
  170. package/lib/typescript/components/MaterialSymbols.d.ts +1 -1
  171. package/lib/typescript/components/MaterialSymbolsLight.d.ts +1 -1
  172. package/lib/typescript/components/Mdi.d.ts +1 -1
  173. package/lib/typescript/components/MdiLight.d.ts +1 -1
  174. package/lib/typescript/components/MedicalIcon.d.ts +1 -1
  175. package/lib/typescript/components/Memory.d.ts +1 -1
  176. package/lib/typescript/components/Meteocons.d.ts +1 -1
  177. package/lib/typescript/components/MeteorIcons.d.ts +1 -1
  178. package/lib/typescript/components/Mi.d.ts +1 -1
  179. package/lib/typescript/components/Mingcute.d.ts +1 -1
  180. package/lib/typescript/components/MonoIcons.d.ts +1 -1
  181. package/lib/typescript/components/Mynaui.d.ts +1 -1
  182. package/lib/typescript/components/Nimbus.d.ts +1 -1
  183. package/lib/typescript/components/Nonicons.d.ts +1 -1
  184. package/lib/typescript/components/Nrk.d.ts +1 -1
  185. package/lib/typescript/components/Octicon.d.ts +1 -1
  186. package/lib/typescript/components/Oi.d.ts +1 -1
  187. package/lib/typescript/components/Ooui.d.ts +1 -1
  188. package/lib/typescript/components/Oui.d.ts +1 -1
  189. package/lib/typescript/components/Pajamas.d.ts +1 -1
  190. package/lib/typescript/components/Pepicons.d.ts +1 -1
  191. package/lib/typescript/components/PepiconsPencil.d.ts +1 -1
  192. package/lib/typescript/components/PepiconsPop.d.ts +1 -1
  193. package/lib/typescript/components/PepiconsPrint.d.ts +1 -1
  194. package/lib/typescript/components/Ph.d.ts +1 -1
  195. package/lib/typescript/components/Picon.d.ts +1 -1
  196. package/lib/typescript/components/Pixel.d.ts +1 -1
  197. package/lib/typescript/components/Pixelarticons.d.ts +1 -1
  198. package/lib/typescript/components/Prime.d.ts +1 -1
  199. package/lib/typescript/components/Proicons.d.ts +1 -1
  200. package/lib/typescript/components/Ps.d.ts +1 -1
  201. package/lib/typescript/components/QlementineIcons.d.ts +1 -1
  202. package/lib/typescript/components/Quill.d.ts +1 -1
  203. package/lib/typescript/components/RadixIcons.d.ts +1 -1
  204. package/lib/typescript/components/Raphael.d.ts +1 -1
  205. package/lib/typescript/components/Ri.d.ts +1 -1
  206. package/lib/typescript/components/RivetIcons.d.ts +1 -1
  207. package/lib/typescript/components/Roentgen.d.ts +1 -1
  208. package/lib/typescript/components/Si.d.ts +1 -1
  209. package/lib/typescript/components/SiGlyph.d.ts +1 -1
  210. package/lib/typescript/components/Sidekickicons.d.ts +1 -1
  211. package/lib/typescript/components/SimpleIcons.d.ts +1 -1
  212. package/lib/typescript/components/SimpleLineIcons.d.ts +1 -1
  213. package/lib/typescript/components/SkillIcons.d.ts +1 -1
  214. package/lib/typescript/components/Solar.d.ts +1 -1
  215. package/lib/typescript/components/Stash.d.ts +1 -1
  216. package/lib/typescript/components/Streamline.d.ts +1 -1
  217. package/lib/typescript/components/StreamlineBlock.d.ts +1 -1
  218. package/lib/typescript/components/StreamlineColor.d.ts +1 -1
  219. package/lib/typescript/components/StreamlineCyber.d.ts +1 -1
  220. package/lib/typescript/components/StreamlineCyberColor.d.ts +1 -1
  221. package/lib/typescript/components/StreamlineEmojis.d.ts +1 -1
  222. package/lib/typescript/components/StreamlineFlex.d.ts +1 -1
  223. package/lib/typescript/components/StreamlineFlexColor.d.ts +1 -1
  224. package/lib/typescript/components/StreamlineFreehand.d.ts +1 -1
  225. package/lib/typescript/components/StreamlineFreehandColor.d.ts +1 -1
  226. package/lib/typescript/components/StreamlineKameleonColor.d.ts +1 -1
  227. package/lib/typescript/components/StreamlineLogos.d.ts +1 -1
  228. package/lib/typescript/components/StreamlinePixel.d.ts +1 -1
  229. package/lib/typescript/components/StreamlinePlump.d.ts +1 -1
  230. package/lib/typescript/components/StreamlinePlumpColor.d.ts +1 -1
  231. package/lib/typescript/components/StreamlineSharp.d.ts +1 -1
  232. package/lib/typescript/components/StreamlineSharpColor.d.ts +1 -1
  233. package/lib/typescript/components/StreamlineStickiesColor.d.ts +1 -1
  234. package/lib/typescript/components/StreamlineUltimate.d.ts +1 -1
  235. package/lib/typescript/components/StreamlineUltimateColor.d.ts +1 -1
  236. package/lib/typescript/components/Subway.d.ts +1 -1
  237. package/lib/typescript/components/SvgSpinners.d.ts +1 -1
  238. package/lib/typescript/components/SystemUicons.d.ts +1 -1
  239. package/lib/typescript/components/Tabler.d.ts +1 -1
  240. package/lib/typescript/components/Tdesign.d.ts +1 -1
  241. package/lib/typescript/components/Teenyicons.d.ts +1 -1
  242. package/lib/typescript/components/Temaki.d.ts +1 -1
  243. package/lib/typescript/components/Token.d.ts +1 -1
  244. package/lib/typescript/components/TokenBranded.d.ts +1 -1
  245. package/lib/typescript/components/Topcoat.d.ts +1 -1
  246. package/lib/typescript/components/Typcn.d.ts +1 -1
  247. package/lib/typescript/components/Uil.d.ts +1 -1
  248. package/lib/typescript/components/Uim.d.ts +1 -1
  249. package/lib/typescript/components/Uis.d.ts +1 -1
  250. package/lib/typescript/components/Uit.d.ts +1 -1
  251. package/lib/typescript/components/Uiw.d.ts +1 -1
  252. package/lib/typescript/components/Unjs.d.ts +1 -1
  253. package/lib/typescript/components/Vaadin.d.ts +1 -1
  254. package/lib/typescript/components/Vs.d.ts +1 -1
  255. package/lib/typescript/components/VscodeIcons.d.ts +1 -1
  256. package/lib/typescript/components/Websymbol.d.ts +1 -1
  257. package/lib/typescript/components/Weui.d.ts +1 -1
  258. package/lib/typescript/components/Whh.d.ts +1 -1
  259. package/lib/typescript/components/Wi.d.ts +1 -1
  260. package/lib/typescript/components/Wpf.d.ts +1 -1
  261. package/lib/typescript/components/Zmdi.d.ts +1 -1
  262. package/lib/typescript/components/Zondicons.d.ts +1 -1
  263. package/lib/typescript/createIconSet.d.ts +1 -1
  264. package/lib/typescript/createIconSet.d.ts.map +1 -1
  265. package/lib/typescript/network/IconifyAPI.d.ts.map +1 -1
  266. package/lib/typescript/types/index.d.ts +56 -0
  267. package/lib/typescript/types/index.d.ts.map +1 -1
  268. package/package.json +6 -3
  269. package/src/IconRenderer.tsx +51 -8
  270. package/src/alias/Icon.tsx +32 -0
  271. package/src/babel/cache-writer.ts +1 -1
  272. package/src/babel/index.ts +0 -1
  273. package/src/babel/types.ts +1 -1
  274. package/src/cache/CacheManager.ts +14 -1
  275. package/src/cache/DiskCache.ts +43 -4
  276. package/src/cli/CLAUDE.md +7 -0
  277. package/src/cli/commands/bundle.ts +52 -6
  278. package/src/createIconSet.tsx +17 -0
  279. package/src/network/IconifyAPI.ts +23 -1
  280. package/src/types/index.ts +75 -0
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "rn-iconify",
3
- "version": "2.0.1",
3
+ "version": "2.1.1",
4
4
  "description": "268,000+ Iconify icons for React Native with native MMKV caching and full TypeScript autocomplete",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
7
7
  "types": "lib/typescript/index.d.ts",
8
8
  "react-native": "src/index.ts",
9
9
  "source": "src/index.ts",
10
+ "sideEffects": false,
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./lib/typescript/index.d.ts",
@@ -35,7 +36,6 @@
35
36
  "files": [
36
37
  "src",
37
38
  "lib",
38
- "bin",
39
39
  "babel.js",
40
40
  "README.md",
41
41
  "assets",
@@ -57,7 +57,7 @@
57
57
  "prepare": "husky",
58
58
  "prepublishOnly": "bob build",
59
59
  "generate-components": "tsx scripts/generate-components.ts",
60
- "release": "npm run build && npm publish"
60
+ "semantic-release": "semantic-release"
61
61
  },
62
62
  "keywords": [
63
63
  "react-native",
@@ -112,6 +112,8 @@
112
112
  "@commitlint/config-conventional": "^19.0.0",
113
113
  "@react-native/babel-preset": "^0.82.1",
114
114
  "@react-native/eslint-config": "^0.74.0",
115
+ "@semantic-release/changelog": "^6.0.3",
116
+ "@semantic-release/git": "^10.0.1",
115
117
  "@testing-library/react-native": "^12.0.0",
116
118
  "@types/jest": "^29.5.0",
117
119
  "@types/react": "^18.2.0",
@@ -129,6 +131,7 @@
129
131
  "react-native-mmkv": "^3.0.0",
130
132
  "react-native-svg": "^15.0.0",
131
133
  "react-test-renderer": "^18.2.0",
134
+ "semantic-release": "^25.0.2",
132
135
  "tsx": "^4.20.6",
133
136
  "typescript": "^5.4.0"
134
137
  },
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
7
- import { View, StyleSheet, Animated } from 'react-native';
7
+ import { View, StyleSheet, Animated, Pressable } from 'react-native';
8
8
  import { SvgXml } from 'react-native-svg';
9
9
  import { CacheManager } from './cache/CacheManager';
10
10
  import { fetchIcon } from './network/IconifyAPI';
@@ -32,6 +32,7 @@ export function IconRenderer({
32
32
  width: propWidth,
33
33
  height: propHeight,
34
34
  style,
35
+ className,
35
36
  rotate = 0,
36
37
  flip,
37
38
  fallback,
@@ -43,6 +44,13 @@ export function IconRenderer({
43
44
  onError,
44
45
  accessibilityLabel,
45
46
  testID,
47
+ // Press props
48
+ onPress,
49
+ onLongPress,
50
+ onPressIn,
51
+ onPressOut,
52
+ disabled,
53
+ pressedStyle,
46
54
  // Animation props
47
55
  animate,
48
56
  animationDuration,
@@ -186,15 +194,44 @@ export function IconRenderer({
186
194
  // Determine if we should show placeholder/fallback
187
195
  const shouldShowPlaceholder = (state === 'loading' && showFallback) || state === 'error';
188
196
 
197
+ // Check if icon should be pressable
198
+ const isPressable = !!(onPress || onLongPress);
199
+
200
+ // NativeWind className support - conditional spread to avoid TS errors
201
+ const nativeWindProps = className ? { className } : {};
202
+
203
+ /**
204
+ * Wraps content with Pressable if onPress/onLongPress is provided
205
+ */
206
+ const wrapWithPressable = (content: React.ReactNode) => {
207
+ if (!isPressable) return content;
208
+
209
+ return (
210
+ <Pressable
211
+ onPress={onPress}
212
+ onLongPress={onLongPress}
213
+ onPressIn={onPressIn}
214
+ onPressOut={onPressOut}
215
+ disabled={disabled}
216
+ accessibilityRole="button"
217
+ accessibilityState={{ disabled }}
218
+ style={({ pressed }) => [pressed && pressedStyle]}
219
+ >
220
+ {content}
221
+ </Pressable>
222
+ );
223
+ };
224
+
189
225
  // Render placeholder or fallback during loading/error
190
226
  if (shouldShowPlaceholder) {
191
227
  // Priority: placeholder > fallback
192
228
  if (placeholder !== undefined) {
193
- return (
229
+ return wrapWithPressable(
194
230
  <View
195
231
  style={[{ width: iconWidth, height: iconHeight }, style]}
196
232
  accessibilityLabel={accessibilityLabel}
197
233
  testID={testID}
234
+ {...nativeWindProps}
198
235
  >
199
236
  <PlaceholderFactory
200
237
  type={placeholder}
@@ -209,11 +246,12 @@ export function IconRenderer({
209
246
 
210
247
  // Fallback for backwards compatibility (deprecated)
211
248
  if (fallback) {
212
- return (
249
+ return wrapWithPressable(
213
250
  <View
214
251
  style={[{ width: iconWidth, height: iconHeight }, style]}
215
252
  accessibilityLabel={accessibilityLabel}
216
253
  testID={testID}
254
+ {...nativeWindProps}
217
255
  >
218
256
  {fallback}
219
257
  </View>
@@ -221,11 +259,12 @@ export function IconRenderer({
221
259
  }
222
260
 
223
261
  // Return empty view if no placeholder/fallback
224
- return (
262
+ return wrapWithPressable(
225
263
  <View
226
264
  style={[{ width: iconWidth, height: iconHeight }, style]}
227
265
  accessibilityLabel={accessibilityLabel}
228
266
  testID={testID}
267
+ {...nativeWindProps}
229
268
  />
230
269
  );
231
270
  }
@@ -234,7 +273,7 @@ export function IconRenderer({
234
273
  if (colorizedSvg) {
235
274
  // Render with animation wrapper if animation is enabled
236
275
  if (hasAnimation) {
237
- return (
276
+ return wrapWithPressable(
238
277
  <Animated.View
239
278
  style={[
240
279
  styles.container,
@@ -245,6 +284,7 @@ export function IconRenderer({
245
284
  accessibilityLabel={accessibilityLabel}
246
285
  accessibilityRole="image"
247
286
  testID={testID}
287
+ {...nativeWindProps}
248
288
  >
249
289
  <SvgXml xml={colorizedSvg} width={iconWidth} height={iconHeight} />
250
290
  </Animated.View>
@@ -252,7 +292,7 @@ export function IconRenderer({
252
292
  }
253
293
 
254
294
  // Render without animation
255
- return (
295
+ return wrapWithPressable(
256
296
  <View
257
297
  style={[
258
298
  styles.container,
@@ -262,6 +302,7 @@ export function IconRenderer({
262
302
  accessibilityLabel={accessibilityLabel}
263
303
  accessibilityRole="image"
264
304
  testID={testID}
305
+ {...nativeWindProps}
265
306
  >
266
307
  <SvgXml xml={colorizedSvg} width={iconWidth} height={iconHeight} />
267
308
  </View>
@@ -270,11 +311,12 @@ export function IconRenderer({
270
311
 
271
312
  // Show placeholder immediately if set (no delay), otherwise empty view
272
313
  if (placeholder !== undefined && state === 'loading') {
273
- return (
314
+ return wrapWithPressable(
274
315
  <View
275
316
  style={[{ width: iconWidth, height: iconHeight }, style]}
276
317
  accessibilityLabel={accessibilityLabel}
277
318
  testID={testID}
319
+ {...nativeWindProps}
278
320
  >
279
321
  <PlaceholderFactory
280
322
  type={placeholder}
@@ -288,11 +330,12 @@ export function IconRenderer({
288
330
  }
289
331
 
290
332
  // Return empty view while loading (before fallback delay)
291
- return (
333
+ return wrapWithPressable(
292
334
  <View
293
335
  style={[{ width: iconWidth, height: iconHeight }, style]}
294
336
  accessibilityLabel={accessibilityLabel}
295
337
  testID={testID}
338
+ {...nativeWindProps}
296
339
  />
297
340
  );
298
341
  }
@@ -43,6 +43,7 @@ export function Icon({
43
43
  width,
44
44
  height,
45
45
  style,
46
+ className,
46
47
  rotate,
47
48
  flip,
48
49
  fallback,
@@ -54,6 +55,21 @@ export function Icon({
54
55
  onError,
55
56
  accessibilityLabel,
56
57
  testID,
58
+ // Press props
59
+ onPress,
60
+ onLongPress,
61
+ onPressIn,
62
+ onPressOut,
63
+ disabled,
64
+ pressedStyle,
65
+ // Animation props
66
+ animate,
67
+ animationDuration,
68
+ animationLoop,
69
+ animationEasing,
70
+ animationDelay,
71
+ autoPlay,
72
+ onAnimationComplete,
57
73
  }: GenericIconProps) {
58
74
  // Get theme defaults
59
75
  const { theme } = useIconTheme();
@@ -93,6 +109,7 @@ export function Icon({
93
109
  width={width}
94
110
  height={height}
95
111
  style={style}
112
+ className={className}
96
113
  rotate={mergedRotate}
97
114
  flip={mergedFlip}
98
115
  fallback={fallback}
@@ -104,6 +121,21 @@ export function Icon({
104
121
  onError={onError}
105
122
  accessibilityLabel={accessibilityLabel ?? name}
106
123
  testID={testID}
124
+ // Press props
125
+ onPress={onPress}
126
+ onLongPress={onLongPress}
127
+ onPressIn={onPressIn}
128
+ onPressOut={onPressOut}
129
+ disabled={disabled}
130
+ pressedStyle={pressedStyle}
131
+ // Animation props
132
+ animate={animate}
133
+ animationDuration={animationDuration}
134
+ animationLoop={animationLoop}
135
+ animationEasing={animationEasing}
136
+ animationDelay={animationDelay}
137
+ autoPlay={autoPlay}
138
+ onAnimationComplete={onAnimationComplete}
107
139
  />
108
140
  );
109
141
  }
@@ -260,7 +260,7 @@ export async function generateBundle(
260
260
  options: BabelPluginOptions,
261
261
  projectRoot: string
262
262
  ): Promise<void> {
263
- const { outputPath = '.rn-iconify-cache', verbose = false } = options;
263
+ const { outputPath = 'node_modules/.cache/rn-iconify', verbose = false } = options;
264
264
 
265
265
  if (iconNames.length === 0) {
266
266
  if (verbose) {
@@ -21,7 +21,6 @@
21
21
  * ['rn-iconify/babel', {
22
22
  * include: ['mdi:*', 'heroicons:*'],
23
23
  * exclude: ['mdi:test-*'],
24
- * outputPath: '.rn-iconify-cache',
25
24
  * verbose: true,
26
25
  * }]
27
26
  * ],
@@ -24,7 +24,7 @@ export interface BabelPluginOptions {
24
24
 
25
25
  /**
26
26
  * Output directory for the generated cache
27
- * @default '.rn-iconify-cache'
27
+ * @default 'node_modules/.cache/rn-iconify'
28
28
  */
29
29
  outputPath?: string;
30
30
 
@@ -74,9 +74,22 @@ class CacheManagerImpl {
74
74
  }
75
75
 
76
76
  this.bundledIcons = new Map();
77
+ let skippedCount = 0;
77
78
 
78
79
  for (const [iconName, data] of Object.entries(bundle.icons)) {
79
- this.bundledIcons.set(iconName, data.svg);
80
+ // Validate icon data has a valid SVG string
81
+ if (data && typeof data.svg === 'string' && data.svg.length > 0) {
82
+ this.bundledIcons.set(iconName, data.svg);
83
+ } else {
84
+ skippedCount++;
85
+ if (__DEV__) {
86
+ console.warn(`[rn-iconify] Skipping invalid icon in bundle: ${iconName}`);
87
+ }
88
+ }
89
+ }
90
+
91
+ if (__DEV__ && skippedCount > 0) {
92
+ console.warn(`[rn-iconify] Skipped ${skippedCount} invalid icons in bundle`);
80
93
  }
81
94
 
82
95
  this.bundledIconsInitialized = true;
@@ -1,14 +1,53 @@
1
1
  /**
2
2
  * Disk cache using MMKV for persistent icon storage
3
3
  * Provides fast synchronous access via JSI
4
+ *
5
+ * Supports both react-native-mmkv v3.x and v4.x
4
6
  */
5
7
 
6
- import { MMKV } from 'react-native-mmkv';
8
+ import * as MMKVModule from 'react-native-mmkv';
9
+
10
+ /**
11
+ * MMKV storage interface (compatible with both v3 and v4)
12
+ */
13
+ interface MMKVStorage {
14
+ getString(key: string): string | undefined;
15
+ set(key: string, value: string | number | boolean): void;
16
+ getNumber(key: string): number | undefined;
17
+ contains(key: string): boolean;
18
+ delete(key: string): void;
19
+ clearAll(): void;
20
+ getAllKeys(): string[];
21
+ }
22
+
23
+ /**
24
+ * Create MMKV instance compatible with both v3.x and v4.x
25
+ *
26
+ * v3.x: import { MMKV } from 'react-native-mmkv' → new MMKV({ id: '...' })
27
+ * v4.x: import { createMMKV } from 'react-native-mmkv' → createMMKV({ id: '...' })
28
+ */
29
+ function createStorage(id: string): MMKVStorage {
30
+ const config = { id };
31
+
32
+ // v4.x: createMMKV function exists
33
+ if ('createMMKV' in MMKVModule && typeof MMKVModule.createMMKV === 'function') {
34
+ return MMKVModule.createMMKV(config) as MMKVStorage;
35
+ }
36
+
37
+ // v3.x: MMKV is a constructor
38
+ if ('MMKV' in MMKVModule && typeof MMKVModule.MMKV === 'function') {
39
+ const MMKVClass = MMKVModule.MMKV as new (config: { id: string }) => MMKVStorage;
40
+ return new MMKVClass(config);
41
+ }
42
+
43
+ throw new Error(
44
+ '[rn-iconify] Could not initialize MMKV storage. ' +
45
+ 'Please ensure react-native-mmkv (v3.x or v4.x) is properly installed.'
46
+ );
47
+ }
7
48
 
8
49
  // MMKV instance for icon cache
9
- const storage = new MMKV({
10
- id: 'rn-iconify-cache',
11
- });
50
+ const storage = createStorage('rn-iconify-cache');
12
51
 
13
52
  // Cache metadata storage
14
53
  const META_KEY_PREFIX = '__meta:';
@@ -0,0 +1,7 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ _No recent activity_
7
+ </claude-mem-context>
@@ -19,6 +19,52 @@ const ICONIFY_API = 'https://api.iconify.design';
19
19
  */
20
20
  const FETCH_TIMEOUT = 30000;
21
21
 
22
+ /**
23
+ * Icon data from Iconify API
24
+ */
25
+ interface IconData {
26
+ body: string;
27
+ width?: number;
28
+ height?: number;
29
+ left?: number;
30
+ top?: number;
31
+ rotate?: number;
32
+ hFlip?: boolean;
33
+ vFlip?: boolean;
34
+ }
35
+
36
+ /**
37
+ * Build SVG string from Iconify icon data with transformation support
38
+ */
39
+ function buildSvgFromIconData(data: IconData, width: number, height: number): string {
40
+ const left = data.left ?? 0;
41
+ const top = data.top ?? 0;
42
+ const viewBox = `${left} ${top} ${width} ${height}`;
43
+
44
+ // Apply transformations (rotate, hFlip, vFlip)
45
+ let body = data.body;
46
+ const transforms: string[] = [];
47
+
48
+ if (data.rotate) {
49
+ const rotation = data.rotate * 90;
50
+ transforms.push(`rotate(${rotation} ${width / 2} ${height / 2})`);
51
+ }
52
+
53
+ if (data.hFlip || data.vFlip) {
54
+ const scaleX = data.hFlip ? -1 : 1;
55
+ const scaleY = data.vFlip ? -1 : 1;
56
+ const translateX = data.hFlip ? width : 0;
57
+ const translateY = data.vFlip ? height : 0;
58
+ transforms.push(`translate(${translateX} ${translateY}) scale(${scaleX} ${scaleY})`);
59
+ }
60
+
61
+ if (transforms.length > 0) {
62
+ body = `<g transform="${transforms.join(' ')}">${body}</g>`;
63
+ }
64
+
65
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}">${body}</svg>`;
66
+ }
67
+
22
68
  /**
23
69
  * Fetch multiple icons with batching
24
70
  */
@@ -45,10 +91,10 @@ async function fetchIcons(
45
91
 
46
92
  // Fetch each prefix batch
47
93
  for (const [prefix, names] of byPrefix) {
48
- try {
49
- const controller = new AbortController();
50
- const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT);
94
+ const controller = new AbortController();
95
+ const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT);
51
96
 
97
+ try {
52
98
  // Sort names alphabetically (Iconify best practice)
53
99
  const sortedNames = [...names].sort();
54
100
  const url = `${ICONIFY_API}/${prefix}.json?icons=${sortedNames.join(',')}`;
@@ -58,7 +104,6 @@ async function fetchIcons(
58
104
  }
59
105
 
60
106
  const response = await fetch(url, { signal: controller.signal });
61
- clearTimeout(timeout);
62
107
 
63
108
  if (!response.ok) {
64
109
  console.error(` Failed to fetch ${prefix}: ${response.status}`);
@@ -76,8 +121,7 @@ async function fetchIcons(
76
121
  if (iconData) {
77
122
  const width = iconData.width ?? defaultWidth;
78
123
  const height = iconData.height ?? defaultHeight;
79
- const body = iconData.body;
80
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">${body}</svg>`;
124
+ const svg = buildSvgFromIconData(iconData, width, height);
81
125
 
82
126
  results[`${prefix}:${name}`] = { svg, width, height };
83
127
  } else if (verbose) {
@@ -92,6 +136,8 @@ async function fetchIcons(
92
136
  console.error(` Error fetching ${prefix}:`, error);
93
137
  }
94
138
  processed += names.length;
139
+ } finally {
140
+ clearTimeout(timeout);
95
141
  }
96
142
  }
97
143
 
@@ -61,6 +61,7 @@ export function createIconSet<T extends string>(
61
61
  width,
62
62
  height,
63
63
  style,
64
+ className,
64
65
  rotate,
65
66
  flip,
66
67
  fallback,
@@ -72,6 +73,13 @@ export function createIconSet<T extends string>(
72
73
  onError,
73
74
  accessibilityLabel,
74
75
  testID,
76
+ // Press props
77
+ onPress,
78
+ onLongPress,
79
+ onPressIn,
80
+ onPressOut,
81
+ disabled,
82
+ pressedStyle,
75
83
  // Animation props
76
84
  animate,
77
85
  animationDuration,
@@ -117,6 +125,7 @@ export function createIconSet<T extends string>(
117
125
  width={width}
118
126
  height={height}
119
127
  style={style}
128
+ className={className}
120
129
  rotate={mergedRotate}
121
130
  flip={mergedFlip}
122
131
  fallback={fallback}
@@ -128,6 +137,14 @@ export function createIconSet<T extends string>(
128
137
  onError={onError}
129
138
  accessibilityLabel={accessibilityLabel ?? name}
130
139
  testID={testID}
140
+ // Press props
141
+ onPress={onPress}
142
+ onLongPress={onLongPress}
143
+ onPressIn={onPressIn}
144
+ onPressOut={onPressOut}
145
+ disabled={disabled}
146
+ pressedStyle={pressedStyle}
147
+ // Animation props
131
148
  animate={animate}
132
149
  animationDuration={animationDuration}
133
150
  animationLoop={animationLoop}
@@ -62,19 +62,41 @@ async function fetchWithTimeout(
62
62
 
63
63
  /**
64
64
  * Combine multiple AbortSignals into one
65
+ * Properly cleans up event listeners to prevent memory leaks
65
66
  */
66
67
  function anySignal(signals: AbortSignal[]): AbortSignal {
67
68
  const controller = new AbortController();
68
69
 
70
+ // Check if any signal is already aborted
69
71
  for (const signal of signals) {
70
72
  if (signal.aborted) {
71
73
  controller.abort();
72
74
  return controller.signal;
73
75
  }
76
+ }
77
+
78
+ // Create abort handlers that we can clean up
79
+ const abortHandlers: Array<{ signal: AbortSignal; handler: () => void }> = [];
80
+
81
+ const cleanup = () => {
82
+ for (const { signal, handler } of abortHandlers) {
83
+ signal.removeEventListener('abort', handler);
84
+ }
85
+ abortHandlers.length = 0;
86
+ };
74
87
 
75
- signal.addEventListener('abort', () => controller.abort(), { once: true });
88
+ for (const signal of signals) {
89
+ const handler = () => {
90
+ cleanup();
91
+ controller.abort();
92
+ };
93
+ abortHandlers.push({ signal, handler });
94
+ signal.addEventListener('abort', handler);
76
95
  }
77
96
 
97
+ // Also cleanup when our controller aborts (from timeout)
98
+ controller.signal.addEventListener('abort', cleanup, { once: true });
99
+
78
100
  return controller.signal;
79
101
  }
80
102
 
@@ -113,6 +113,81 @@ export interface IconProps<T extends string = string> {
113
113
  */
114
114
  testID?: string;
115
115
 
116
+ // ─────────────────────────────────────────────────────────────────
117
+ // Press/Touch Props
118
+ // ─────────────────────────────────────────────────────────────────
119
+
120
+ /**
121
+ * Called when the icon is pressed.
122
+ * When provided, the icon is automatically wrapped in a Pressable component.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * <Mdi name="close" onPress={() => console.log('pressed')} />
127
+ * ```
128
+ */
129
+ onPress?: () => void;
130
+
131
+ /**
132
+ * Called when the icon is long pressed.
133
+ * When provided (along with or without onPress), the icon is wrapped in Pressable.
134
+ */
135
+ onLongPress?: () => void;
136
+
137
+ /**
138
+ * Called when press starts (finger down).
139
+ */
140
+ onPressIn?: () => void;
141
+
142
+ /**
143
+ * Called when press ends (finger up).
144
+ */
145
+ onPressOut?: () => void;
146
+
147
+ /**
148
+ * Whether the icon press is disabled.
149
+ * Only applicable when onPress or onLongPress is provided.
150
+ * @default false
151
+ */
152
+ disabled?: boolean;
153
+
154
+ /**
155
+ * Style applied to the icon when pressed.
156
+ * Only applicable when onPress or onLongPress is provided.
157
+ * If not provided, no visual feedback is shown on press.
158
+ *
159
+ * @example
160
+ * ```tsx
161
+ * <Mdi
162
+ * name="settings"
163
+ * onPress={() => {}}
164
+ * pressedStyle={{ opacity: 0.5, transform: [{ scale: 0.95 }] }}
165
+ * />
166
+ * ```
167
+ */
168
+ pressedStyle?: StyleProp<ViewStyle>;
169
+
170
+ // ─────────────────────────────────────────────────────────────────
171
+ // NativeWind Support
172
+ // ─────────────────────────────────────────────────────────────────
173
+
174
+ /**
175
+ * NativeWind/Tailwind CSS class names for styling.
176
+ * Only works in projects with NativeWind configured.
177
+ *
178
+ * @example
179
+ * ```tsx
180
+ * <Mdi name="home" className="w-6 h-6 text-blue-500" />
181
+ * ```
182
+ *
183
+ * @see https://www.nativewind.dev/
184
+ */
185
+ className?: string;
186
+
187
+ // ─────────────────────────────────────────────────────────────────
188
+ // Animation Props
189
+ // ─────────────────────────────────────────────────────────────────
190
+
116
191
  /**
117
192
  * Animation to apply to the icon
118
193
  * Can be a preset ('spin', 'pulse', 'bounce', 'shake', 'ping', 'wiggle')