tempest-react-sdk 0.47.0 → 0.48.0

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 (373) hide show
  1. package/dist/components/AIChat/AIChatTurn.cjs +1 -1
  2. package/dist/components/AIChat/AIChatTurn.js +4 -4
  3. package/dist/components/AppBar/use-sticky-body-warning.cjs.map +1 -1
  4. package/dist/components/AppBar/use-sticky-body-warning.js.map +1 -1
  5. package/dist/components/DataTable/DataTable.cjs +1 -1
  6. package/dist/components/DataTable/DataTable.js +11 -11
  7. package/dist/components/DataTable/use-dev-warnings.cjs.map +1 -1
  8. package/dist/components/DataTable/use-dev-warnings.js.map +1 -1
  9. package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -1
  10. package/dist/components/NotificationCenter/NotificationCenter.js +21 -21
  11. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  12. package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
  13. package/dist/components/Sidebar/Sidebar.js +91 -38
  14. package/dist/components/Sidebar/Sidebar.js.map +1 -1
  15. package/dist/components/Sidebar/Sidebar.module.cjs +1 -1
  16. package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
  17. package/dist/components/Sidebar/Sidebar.module.js +12 -8
  18. package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
  19. package/dist/forms/masked-inputs.cjs +1 -1
  20. package/dist/forms/masked-inputs.js +12 -12
  21. package/dist/http/api-client.cjs +1 -1
  22. package/dist/http/api-client.cjs.map +1 -1
  23. package/dist/http/api-client.js +45 -31
  24. package/dist/http/api-client.js.map +1 -1
  25. package/dist/http/describe-api-error.cjs +1 -1
  26. package/dist/http/describe-api-error.cjs.map +1 -1
  27. package/dist/http/describe-api-error.js +11 -7
  28. package/dist/http/describe-api-error.js.map +1 -1
  29. package/dist/http/errors.cjs +1 -1
  30. package/dist/http/errors.cjs.map +1 -1
  31. package/dist/http/errors.js +38 -21
  32. package/dist/http/errors.js.map +1 -1
  33. package/dist/http/use-describe-api-error.cjs +1 -1
  34. package/dist/http/use-describe-api-error.cjs.map +1 -1
  35. package/dist/http/use-describe-api-error.js +14 -10
  36. package/dist/http/use-describe-api-error.js.map +1 -1
  37. package/dist/icons/Icon.cjs +1 -1
  38. package/dist/icons/Icon.cjs.map +1 -1
  39. package/dist/icons/Icon.js +15 -14
  40. package/dist/icons/Icon.js.map +1 -1
  41. package/dist/icons/IconPicker.cjs +2 -0
  42. package/dist/icons/IconPicker.cjs.map +1 -0
  43. package/dist/icons/IconPicker.js +49 -0
  44. package/dist/icons/IconPicker.js.map +1 -0
  45. package/dist/icons/IconPicker.module.cjs +2 -0
  46. package/dist/icons/IconPicker.module.cjs.map +1 -0
  47. package/dist/icons/IconPicker.module.js +10 -0
  48. package/dist/icons/IconPicker.module.js.map +1 -0
  49. package/dist/icons/alias.cjs +2 -0
  50. package/dist/icons/alias.cjs.map +1 -0
  51. package/dist/icons/alias.js +9 -0
  52. package/dist/icons/alias.js.map +1 -0
  53. package/dist/icons/generated/loaders.cjs +1 -1
  54. package/dist/icons/generated/loaders.cjs.map +1 -1
  55. package/dist/icons/generated/loaders.js +273 -28
  56. package/dist/icons/generated/loaders.js.map +1 -1
  57. package/dist/icons/generated/shard-00.cjs +2 -0
  58. package/dist/icons/generated/shard-00.cjs.map +1 -0
  59. package/dist/icons/generated/shard-00.js +48 -0
  60. package/dist/icons/generated/shard-00.js.map +1 -0
  61. package/dist/icons/generated/shard-01.cjs +2 -0
  62. package/dist/icons/generated/shard-01.cjs.map +1 -0
  63. package/dist/icons/generated/shard-01.js +48 -0
  64. package/dist/icons/generated/shard-01.js.map +1 -0
  65. package/dist/icons/generated/shard-02.cjs +2 -0
  66. package/dist/icons/generated/shard-02.cjs.map +1 -0
  67. package/dist/icons/generated/shard-02.js +48 -0
  68. package/dist/icons/generated/shard-02.js.map +1 -0
  69. package/dist/icons/generated/shard-03.cjs +2 -0
  70. package/dist/icons/generated/shard-03.cjs.map +1 -0
  71. package/dist/icons/generated/shard-03.js +48 -0
  72. package/dist/icons/generated/shard-03.js.map +1 -0
  73. package/dist/icons/generated/shard-04.cjs +2 -0
  74. package/dist/icons/generated/shard-04.cjs.map +1 -0
  75. package/dist/icons/generated/shard-04.js +48 -0
  76. package/dist/icons/generated/shard-04.js.map +1 -0
  77. package/dist/icons/generated/shard-05.cjs +2 -0
  78. package/dist/icons/generated/shard-05.cjs.map +1 -0
  79. package/dist/icons/generated/shard-05.js +48 -0
  80. package/dist/icons/generated/shard-05.js.map +1 -0
  81. package/dist/icons/generated/shard-06.cjs +2 -0
  82. package/dist/icons/generated/shard-06.cjs.map +1 -0
  83. package/dist/icons/generated/shard-06.js +48 -0
  84. package/dist/icons/generated/shard-06.js.map +1 -0
  85. package/dist/icons/generated/shard-07.cjs +2 -0
  86. package/dist/icons/generated/shard-07.cjs.map +1 -0
  87. package/dist/icons/generated/shard-07.js +48 -0
  88. package/dist/icons/generated/shard-07.js.map +1 -0
  89. package/dist/icons/generated/shard-08.cjs +2 -0
  90. package/dist/icons/generated/shard-08.cjs.map +1 -0
  91. package/dist/icons/generated/shard-08.js +48 -0
  92. package/dist/icons/generated/shard-08.js.map +1 -0
  93. package/dist/icons/generated/shard-09.cjs +2 -0
  94. package/dist/icons/generated/shard-09.cjs.map +1 -0
  95. package/dist/icons/generated/shard-09.js +48 -0
  96. package/dist/icons/generated/shard-09.js.map +1 -0
  97. package/dist/icons/generated/shard-10.cjs +2 -0
  98. package/dist/icons/generated/shard-10.cjs.map +1 -0
  99. package/dist/icons/generated/shard-10.js +48 -0
  100. package/dist/icons/generated/shard-10.js.map +1 -0
  101. package/dist/icons/generated/shard-11.cjs +2 -0
  102. package/dist/icons/generated/shard-11.cjs.map +1 -0
  103. package/dist/icons/generated/shard-11.js +48 -0
  104. package/dist/icons/generated/shard-11.js.map +1 -0
  105. package/dist/icons/generated/shard-12.cjs +2 -0
  106. package/dist/icons/generated/shard-12.cjs.map +1 -0
  107. package/dist/icons/generated/shard-12.js +48 -0
  108. package/dist/icons/generated/shard-12.js.map +1 -0
  109. package/dist/icons/generated/shard-13.cjs +2 -0
  110. package/dist/icons/generated/shard-13.cjs.map +1 -0
  111. package/dist/icons/generated/shard-13.js +48 -0
  112. package/dist/icons/generated/shard-13.js.map +1 -0
  113. package/dist/icons/generated/shard-14.cjs +2 -0
  114. package/dist/icons/generated/shard-14.cjs.map +1 -0
  115. package/dist/icons/generated/shard-14.js +48 -0
  116. package/dist/icons/generated/shard-14.js.map +1 -0
  117. package/dist/icons/generated/shard-15.cjs +2 -0
  118. package/dist/icons/generated/shard-15.cjs.map +1 -0
  119. package/dist/icons/generated/shard-15.js +48 -0
  120. package/dist/icons/generated/shard-15.js.map +1 -0
  121. package/dist/icons/generated/shard-16.cjs +2 -0
  122. package/dist/icons/generated/shard-16.cjs.map +1 -0
  123. package/dist/icons/generated/shard-16.js +48 -0
  124. package/dist/icons/generated/shard-16.js.map +1 -0
  125. package/dist/icons/generated/shard-17.cjs +2 -0
  126. package/dist/icons/generated/shard-17.cjs.map +1 -0
  127. package/dist/icons/generated/shard-17.js +48 -0
  128. package/dist/icons/generated/shard-17.js.map +1 -0
  129. package/dist/icons/generated/shard-18.cjs +2 -0
  130. package/dist/icons/generated/shard-18.cjs.map +1 -0
  131. package/dist/icons/generated/shard-18.js +48 -0
  132. package/dist/icons/generated/shard-18.js.map +1 -0
  133. package/dist/icons/generated/shard-19.cjs +2 -0
  134. package/dist/icons/generated/shard-19.cjs.map +1 -0
  135. package/dist/icons/generated/shard-19.js +48 -0
  136. package/dist/icons/generated/shard-19.js.map +1 -0
  137. package/dist/icons/generated/shard-20.cjs +2 -0
  138. package/dist/icons/generated/shard-20.cjs.map +1 -0
  139. package/dist/icons/generated/shard-20.js +48 -0
  140. package/dist/icons/generated/shard-20.js.map +1 -0
  141. package/dist/icons/generated/shard-21.cjs +2 -0
  142. package/dist/icons/generated/shard-21.cjs.map +1 -0
  143. package/dist/icons/generated/shard-21.js +48 -0
  144. package/dist/icons/generated/shard-21.js.map +1 -0
  145. package/dist/icons/generated/shard-22.cjs +2 -0
  146. package/dist/icons/generated/shard-22.cjs.map +1 -0
  147. package/dist/icons/generated/shard-22.js +48 -0
  148. package/dist/icons/generated/shard-22.js.map +1 -0
  149. package/dist/icons/generated/shard-23.cjs +2 -0
  150. package/dist/icons/generated/shard-23.cjs.map +1 -0
  151. package/dist/icons/generated/shard-23.js +48 -0
  152. package/dist/icons/generated/shard-23.js.map +1 -0
  153. package/dist/icons/generated/shard-24.cjs +2 -0
  154. package/dist/icons/generated/shard-24.cjs.map +1 -0
  155. package/dist/icons/generated/shard-24.js +48 -0
  156. package/dist/icons/generated/shard-24.js.map +1 -0
  157. package/dist/icons/generated/shard-25.cjs +2 -0
  158. package/dist/icons/generated/shard-25.cjs.map +1 -0
  159. package/dist/icons/generated/shard-25.js +48 -0
  160. package/dist/icons/generated/shard-25.js.map +1 -0
  161. package/dist/icons/generated/shard-26.cjs +2 -0
  162. package/dist/icons/generated/shard-26.cjs.map +1 -0
  163. package/dist/icons/generated/shard-26.js +48 -0
  164. package/dist/icons/generated/shard-26.js.map +1 -0
  165. package/dist/icons/generated/shard-27.cjs +2 -0
  166. package/dist/icons/generated/shard-27.cjs.map +1 -0
  167. package/dist/icons/generated/shard-27.js +48 -0
  168. package/dist/icons/generated/shard-27.js.map +1 -0
  169. package/dist/icons/generated/shard-28.cjs +2 -0
  170. package/dist/icons/generated/shard-28.cjs.map +1 -0
  171. package/dist/icons/generated/shard-28.js +48 -0
  172. package/dist/icons/generated/shard-28.js.map +1 -0
  173. package/dist/icons/generated/shard-29.cjs +2 -0
  174. package/dist/icons/generated/shard-29.cjs.map +1 -0
  175. package/dist/icons/generated/shard-29.js +48 -0
  176. package/dist/icons/generated/shard-29.js.map +1 -0
  177. package/dist/icons/generated/shard-30.cjs +2 -0
  178. package/dist/icons/generated/shard-30.cjs.map +1 -0
  179. package/dist/icons/generated/shard-30.js +48 -0
  180. package/dist/icons/generated/shard-30.js.map +1 -0
  181. package/dist/icons/generated/shard-31.cjs +2 -0
  182. package/dist/icons/generated/shard-31.cjs.map +1 -0
  183. package/dist/icons/generated/shard-31.js +48 -0
  184. package/dist/icons/generated/shard-31.js.map +1 -0
  185. package/dist/icons/generated/shard-32.cjs +2 -0
  186. package/dist/icons/generated/shard-32.cjs.map +1 -0
  187. package/dist/icons/generated/shard-32.js +48 -0
  188. package/dist/icons/generated/shard-32.js.map +1 -0
  189. package/dist/icons/generated/shard-33.cjs +2 -0
  190. package/dist/icons/generated/shard-33.cjs.map +1 -0
  191. package/dist/icons/generated/shard-33.js +48 -0
  192. package/dist/icons/generated/shard-33.js.map +1 -0
  193. package/dist/icons/generated/shard-34.cjs +2 -0
  194. package/dist/icons/generated/shard-34.cjs.map +1 -0
  195. package/dist/icons/generated/shard-34.js +48 -0
  196. package/dist/icons/generated/shard-34.js.map +1 -0
  197. package/dist/icons/generated/shard-35.cjs +2 -0
  198. package/dist/icons/generated/shard-35.cjs.map +1 -0
  199. package/dist/icons/generated/shard-35.js +48 -0
  200. package/dist/icons/generated/shard-35.js.map +1 -0
  201. package/dist/icons/generated/shard-36.cjs +2 -0
  202. package/dist/icons/generated/shard-36.cjs.map +1 -0
  203. package/dist/icons/generated/shard-36.js +48 -0
  204. package/dist/icons/generated/shard-36.js.map +1 -0
  205. package/dist/icons/generated/shard-37.cjs +2 -0
  206. package/dist/icons/generated/shard-37.cjs.map +1 -0
  207. package/dist/icons/generated/shard-37.js +48 -0
  208. package/dist/icons/generated/shard-37.js.map +1 -0
  209. package/dist/icons/generated/shard-38.cjs +2 -0
  210. package/dist/icons/generated/shard-38.cjs.map +1 -0
  211. package/dist/icons/generated/shard-38.js +48 -0
  212. package/dist/icons/generated/shard-38.js.map +1 -0
  213. package/dist/icons/generated/shard-39.cjs +2 -0
  214. package/dist/icons/generated/shard-39.cjs.map +1 -0
  215. package/dist/icons/generated/shard-39.js +48 -0
  216. package/dist/icons/generated/shard-39.js.map +1 -0
  217. package/dist/icons/generated/shard-40.cjs +2 -0
  218. package/dist/icons/generated/shard-40.cjs.map +1 -0
  219. package/dist/icons/generated/shard-40.js +48 -0
  220. package/dist/icons/generated/shard-40.js.map +1 -0
  221. package/dist/icons/generated/shard-41.cjs +2 -0
  222. package/dist/icons/generated/shard-41.cjs.map +1 -0
  223. package/dist/icons/generated/shard-41.js +48 -0
  224. package/dist/icons/generated/shard-41.js.map +1 -0
  225. package/dist/icons/generated/shard-42.cjs +2 -0
  226. package/dist/icons/generated/shard-42.cjs.map +1 -0
  227. package/dist/icons/generated/shard-42.js +48 -0
  228. package/dist/icons/generated/shard-42.js.map +1 -0
  229. package/dist/icons/generated/shard-43.cjs +2 -0
  230. package/dist/icons/generated/shard-43.cjs.map +1 -0
  231. package/dist/icons/generated/shard-43.js +48 -0
  232. package/dist/icons/generated/shard-43.js.map +1 -0
  233. package/dist/icons/generated/shard-44.cjs +2 -0
  234. package/dist/icons/generated/shard-44.cjs.map +1 -0
  235. package/dist/icons/generated/shard-44.js +15 -0
  236. package/dist/icons/generated/shard-44.js.map +1 -0
  237. package/dist/icons/material-symbols.cjs +1 -1
  238. package/dist/icons/material-symbols.cjs.map +1 -1
  239. package/dist/icons/material-symbols.js +109 -1
  240. package/dist/icons/material-symbols.js.map +1 -1
  241. package/dist/icons/normalize-icon-name.cjs +2 -0
  242. package/dist/icons/normalize-icon-name.cjs.map +1 -0
  243. package/dist/icons/normalize-icon-name.js +9 -0
  244. package/dist/icons/normalize-icon-name.js.map +1 -0
  245. package/dist/icons/shard-cache.cjs +1 -1
  246. package/dist/icons/shard-cache.cjs.map +1 -1
  247. package/dist/icons/shard-cache.js +85 -32
  248. package/dist/icons/shard-cache.js.map +1 -1
  249. package/dist/icons/validate-icon-name.cjs +2 -0
  250. package/dist/icons/validate-icon-name.cjs.map +1 -0
  251. package/dist/icons/validate-icon-name.js +11 -0
  252. package/dist/icons/validate-icon-name.js.map +1 -0
  253. package/dist/icons-virtual-id.d.ts +24 -0
  254. package/dist/icons-virtual.cjs +2 -0
  255. package/dist/icons-virtual.cjs.map +1 -0
  256. package/dist/icons-virtual.d.ts +30 -22
  257. package/dist/icons-virtual.js +6 -0
  258. package/dist/icons-virtual.js.map +1 -0
  259. package/dist/icons.cjs +1 -1
  260. package/dist/icons.d.ts +269 -32
  261. package/dist/icons.js +11 -7
  262. package/dist/styles.css +1 -1
  263. package/dist/tempest-react-sdk.cjs +1 -1
  264. package/dist/tempest-react-sdk.d.ts +95 -64
  265. package/dist/tempest-react-sdk.js +225 -226
  266. package/dist/utils/dev-mode.cjs.map +1 -1
  267. package/dist/utils/dev-mode.js.map +1 -1
  268. package/dist/vite/tempest-icons.cjs +4 -4
  269. package/dist/vite/tempest-icons.cjs.map +1 -1
  270. package/dist/vite/tempest-icons.js +26 -26
  271. package/dist/vite/tempest-icons.js.map +1 -1
  272. package/dist/vite.d.ts +1 -1
  273. package/package.json +5 -2
  274. package/dist/icons/generated/shard-a.cjs +0 -2
  275. package/dist/icons/generated/shard-a.cjs.map +0 -1
  276. package/dist/icons/generated/shard-a.js +0 -114
  277. package/dist/icons/generated/shard-a.js.map +0 -1
  278. package/dist/icons/generated/shard-b.cjs +0 -2
  279. package/dist/icons/generated/shard-b.cjs.map +0 -1
  280. package/dist/icons/generated/shard-b.js +0 -158
  281. package/dist/icons/generated/shard-b.js.map +0 -1
  282. package/dist/icons/generated/shard-c.cjs +0 -2
  283. package/dist/icons/generated/shard-c.cjs.map +0 -1
  284. package/dist/icons/generated/shard-c.js +0 -269
  285. package/dist/icons/generated/shard-c.js.map +0 -1
  286. package/dist/icons/generated/shard-d.cjs +0 -2
  287. package/dist/icons/generated/shard-d.cjs.map +0 -1
  288. package/dist/icons/generated/shard-d.js +0 -62
  289. package/dist/icons/generated/shard-d.js.map +0 -1
  290. package/dist/icons/generated/shard-e.cjs +0 -2
  291. package/dist/icons/generated/shard-e.cjs.map +0 -1
  292. package/dist/icons/generated/shard-e.js +0 -33
  293. package/dist/icons/generated/shard-e.js.map +0 -1
  294. package/dist/icons/generated/shard-f.cjs +0 -2
  295. package/dist/icons/generated/shard-f.cjs.map +0 -1
  296. package/dist/icons/generated/shard-f.js +0 -145
  297. package/dist/icons/generated/shard-f.js.map +0 -1
  298. package/dist/icons/generated/shard-g.cjs +0 -2
  299. package/dist/icons/generated/shard-g.cjs.map +0 -1
  300. package/dist/icons/generated/shard-g.js +0 -61
  301. package/dist/icons/generated/shard-g.js.map +0 -1
  302. package/dist/icons/generated/shard-h.cjs +0 -2
  303. package/dist/icons/generated/shard-h.cjs.map +0 -1
  304. package/dist/icons/generated/shard-h.js +0 -62
  305. package/dist/icons/generated/shard-h.js.map +0 -1
  306. package/dist/icons/generated/shard-i.cjs +0 -2
  307. package/dist/icons/generated/shard-i.cjs.map +0 -1
  308. package/dist/icons/generated/shard-i.js +0 -30
  309. package/dist/icons/generated/shard-i.js.map +0 -1
  310. package/dist/icons/generated/shard-j.cjs +0 -2
  311. package/dist/icons/generated/shard-j.cjs.map +0 -1
  312. package/dist/icons/generated/shard-j.js +0 -10
  313. package/dist/icons/generated/shard-j.js.map +0 -1
  314. package/dist/icons/generated/shard-k.cjs +0 -2
  315. package/dist/icons/generated/shard-k.cjs.map +0 -1
  316. package/dist/icons/generated/shard-k.js +0 -16
  317. package/dist/icons/generated/shard-k.js.map +0 -1
  318. package/dist/icons/generated/shard-l.cjs +0 -2
  319. package/dist/icons/generated/shard-l.cjs.map +0 -1
  320. package/dist/icons/generated/shard-l.js +0 -92
  321. package/dist/icons/generated/shard-l.js.map +0 -1
  322. package/dist/icons/generated/shard-m.cjs +0 -2
  323. package/dist/icons/generated/shard-m.cjs.map +0 -1
  324. package/dist/icons/generated/shard-m.js +0 -143
  325. package/dist/icons/generated/shard-m.js.map +0 -1
  326. package/dist/icons/generated/shard-n.cjs +0 -2
  327. package/dist/icons/generated/shard-n.cjs.map +0 -1
  328. package/dist/icons/generated/shard-n.js +0 -24
  329. package/dist/icons/generated/shard-n.js.map +0 -1
  330. package/dist/icons/generated/shard-o.cjs +0 -2
  331. package/dist/icons/generated/shard-o.cjs.map +0 -1
  332. package/dist/icons/generated/shard-o.js +0 -17
  333. package/dist/icons/generated/shard-o.js.map +0 -1
  334. package/dist/icons/generated/shard-p.cjs +0 -2
  335. package/dist/icons/generated/shard-p.cjs.map +0 -1
  336. package/dist/icons/generated/shard-p.js +0 -114
  337. package/dist/icons/generated/shard-p.js.map +0 -1
  338. package/dist/icons/generated/shard-q.cjs +0 -2
  339. package/dist/icons/generated/shard-q.cjs.map +0 -1
  340. package/dist/icons/generated/shard-q.js +0 -10
  341. package/dist/icons/generated/shard-q.js.map +0 -1
  342. package/dist/icons/generated/shard-r.cjs +0 -2
  343. package/dist/icons/generated/shard-r.cjs.map +0 -1
  344. package/dist/icons/generated/shard-r.js +0 -79
  345. package/dist/icons/generated/shard-r.js.map +0 -1
  346. package/dist/icons/generated/shard-s.cjs +0 -2
  347. package/dist/icons/generated/shard-s.cjs.map +0 -1
  348. package/dist/icons/generated/shard-s.js +0 -256
  349. package/dist/icons/generated/shard-s.js.map +0 -1
  350. package/dist/icons/generated/shard-t.cjs +0 -2
  351. package/dist/icons/generated/shard-t.cjs.map +0 -1
  352. package/dist/icons/generated/shard-t.js +0 -109
  353. package/dist/icons/generated/shard-t.js.map +0 -1
  354. package/dist/icons/generated/shard-u.cjs +0 -2
  355. package/dist/icons/generated/shard-u.cjs.map +0 -1
  356. package/dist/icons/generated/shard-u.js +0 -50
  357. package/dist/icons/generated/shard-u.js.map +0 -1
  358. package/dist/icons/generated/shard-v.cjs +0 -2
  359. package/dist/icons/generated/shard-v.cjs.map +0 -1
  360. package/dist/icons/generated/shard-v.js +0 -30
  361. package/dist/icons/generated/shard-v.js.map +0 -1
  362. package/dist/icons/generated/shard-w.cjs +0 -2
  363. package/dist/icons/generated/shard-w.cjs.map +0 -1
  364. package/dist/icons/generated/shard-w.js +0 -48
  365. package/dist/icons/generated/shard-w.js.map +0 -1
  366. package/dist/icons/generated/shard-x.cjs +0 -2
  367. package/dist/icons/generated/shard-x.cjs.map +0 -1
  368. package/dist/icons/generated/shard-x.js +0 -10
  369. package/dist/icons/generated/shard-x.js.map +0 -1
  370. package/dist/icons/generated/shard-z.cjs +0 -2
  371. package/dist/icons/generated/shard-z.cjs.map +0 -1
  372. package/dist/icons/generated/shard-z.js +0 -25
  373. package/dist/icons/generated/shard-z.js.map +0 -1
@@ -1,22 +1,30 @@
1
- /**
2
- * Types for the module the `tempestIcons()` Vite plugin generates.
3
- *
4
- * Reference it once from an app's `vite-env.d.ts` (or any ambient `.d.ts`):
5
- *
6
- * /// <reference types="tempest-react-sdk/icons/virtual" />
7
- *
8
- * Without it, `import { staticIcons } from "virtual:tempest-icons"` is an
9
- * unresolved module to `tsc`, even though Vite resolves it at build time.
10
- */
11
- declare module "virtual:tempest-icons" {
12
- import type { LucideIcon } from "lucide-react";
13
-
14
- /**
15
- * Every icon slug found as a literal in the scanned source, mapped to the
16
- * statically imported lucide component.
17
- *
18
- * Pass it to `IconProvider`'s `registry` prop. Slugs resolved from here cost
19
- * no extra request — they are ordinary imports the bundler tree-shakes.
20
- */
21
- export const staticIcons: Record<string, LucideIcon>;
22
- }
1
+ /// <reference path="./icons-virtual-id.d.ts" />
2
+ import { LucideIcon } from 'lucide-react';
3
+
4
+ /** A slug icon-component table, as produced by `createIconRegistry`. */
5
+ declare type IconRegistry = Readonly<Record<string, LucideIcon>>;
6
+
7
+ /**
8
+ * The static icon registry, empty until a build plugin fills it in.
9
+ *
10
+ * `tempestIcons()` resolves this module id to the table it generated from the
11
+ * slugs your source mentions. Every other runner — vitest without the plugin,
12
+ * `tsx`, a Storybook builder, a Node script that imports a component — gets this
13
+ * stub, so the import always resolves and `<Icon>` falls back to fetching shards.
14
+ *
15
+ * That fallback is why the stub exists: before it, an app that imported the
16
+ * registry could not be loaded outside a Vite build with the plugin installed,
17
+ * and the failure was the whole module graph refusing to resolve rather than one
18
+ * icon going missing.
19
+ *
20
+ * @example
21
+ * import { IconProvider } from "tempest-react-sdk/icons";
22
+ * import { staticIcons } from "tempest-react-sdk/icons/virtual";
23
+ *
24
+ * <IconProvider registry={staticIcons}>
25
+ * <App />
26
+ * </IconProvider>
27
+ */
28
+ export declare const staticIcons: IconRegistry;
29
+
30
+ export { }
@@ -0,0 +1,6 @@
1
+ //#region src/icons/virtual.ts
2
+ var e = {};
3
+ //#endregion
4
+ export { e as staticIcons };
5
+
6
+ //# sourceMappingURL=icons-virtual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons-virtual.js","names":[],"sources":["../src/icons/virtual.ts"],"sourcesContent":["import type { IconRegistry } from \"./icon-context\";\n\n/**\n * The static icon registry, empty until a build plugin fills it in.\n *\n * `tempestIcons()` resolves this module id to the table it generated from the\n * slugs your source mentions. Every other runner — vitest without the plugin,\n * `tsx`, a Storybook builder, a Node script that imports a component — gets this\n * stub, so the import always resolves and `<Icon>` falls back to fetching shards.\n *\n * That fallback is why the stub exists: before it, an app that imported the\n * registry could not be loaded outside a Vite build with the plugin installed,\n * and the failure was the whole module graph refusing to resolve rather than one\n * icon going missing.\n *\n * @example\n * import { IconProvider } from \"tempest-react-sdk/icons\";\n * import { staticIcons } from \"tempest-react-sdk/icons/virtual\";\n *\n * <IconProvider registry={staticIcons}>\n * <App />\n * </IconProvider>\n */\nexport const staticIcons: IconRegistry = {};\n"],"mappings":";AAuBA,IAAa,IAA4B,CAAC"}
package/dist/icons.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./icons/generated/aliases.cjs"),t=require("./icons/generated/icon-names.cjs"),n=require("./icons/icon-context.cjs"),r=require("./icons/shard-cache.cjs"),i=require("./icons/use-icon.cjs"),a=require("./icons/Icon.cjs"),o=require("./icons/IconProvider.cjs"),s=require("./icons/is-icon-name.cjs"),c=require("./icons/material-symbols.cjs");exports.Icon=a.Icon,exports.IconProvider=o.IconProvider,exports.MATERIAL_SYMBOL_FALLBACK=c.MATERIAL_SYMBOL_FALLBACK,exports.createIconRegistry=n.createIconRegistry,exports.fromMaterialSymbol=c.fromMaterialSymbol,exports.iconAliases=e.iconAliases,exports.iconNames=t.iconNames,exports.iconStatus=r.iconStatus,exports.isIconName=s.isIconName,exports.loadIcon=r.loadIcon,exports.materialToLucide=c.materialToLucide,exports.peekIcon=r.peekIcon,exports.preloadIcons=r.preloadIcons,exports.resolveIconAlias=r.resolveIconAlias,exports.useIcon=i.useIcon;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./icons/generated/aliases.cjs"),t=require("./icons/generated/icon-names.cjs"),n=require("./icons/icon-context.cjs"),r=require("./icons/alias.cjs"),i=require("./icons/normalize-icon-name.cjs"),a=require("./icons/shard-cache.cjs"),o=require("./icons/use-icon.cjs"),s=require("./icons/Icon.cjs"),c=require("./icons/is-icon-name.cjs"),l=require("./icons/validate-icon-name.cjs"),u=require("./icons/IconPicker.cjs"),d=require("./icons/IconProvider.cjs"),f=require("./icons/material-symbols.cjs");exports.DEFAULT_ICON_PICKER_MESSAGE=l.DEFAULT_ICON_PICKER_MESSAGE,exports.Icon=s.Icon,exports.IconPicker=u.IconPicker,exports.IconProvider=d.IconProvider,exports.MATERIAL_SYMBOL_FALLBACK=f.MATERIAL_SYMBOL_FALLBACK,exports.createIconRegistry=n.createIconRegistry,exports.fromMaterialSymbol=f.fromMaterialSymbol,exports.iconAliases=e.iconAliases,exports.iconNames=t.iconNames,exports.iconStatus=a.iconStatus,exports.isIconName=c.isIconName,exports.loadIcon=a.loadIcon,exports.materialToLucide=f.materialToLucide,exports.normalizeIconName=i.normalizeIconName,exports.peekIcon=a.peekIcon,exports.preloadIcons=a.preloadIcons,exports.registerIcons=a.registerIcons,exports.resolveIconAlias=r.resolveIconAlias,exports.subscribeToIconErrors=a.subscribeToIconErrors,exports.useIcon=o.useIcon,exports.validateIconName=l.validateIconName;
package/dist/icons.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference path="./icons-virtual-id.d.ts" />
2
+ import { InputHTMLAttributes } from 'react';
1
3
  import { LucideIcon } from 'lucide-react';
2
4
  import { ReactNode } from 'react';
3
5
  import { SVGProps } from 'react';
@@ -20,6 +22,9 @@ import { SVGProps } from 'react';
20
22
  */
21
23
  export declare function createIconRegistry(icons: Record<string, LucideIcon>): IconRegistry;
22
24
 
25
+ /** The default message for a slug lucide does not ship. */
26
+ export declare const DEFAULT_ICON_PICKER_MESSAGE = "\u00CDcone inexistente. Use um slug do lucide, em kebab-case.";
27
+
23
28
  /**
24
29
  * Translate a Material Symbols code into a lucide slug, always returning one.
25
30
  *
@@ -56,11 +61,16 @@ export declare function fromMaterialSymbol(code: string | null | undefined, fall
56
61
  * An unknown slug renders `fallback` (nothing, by default) and warns in dev only
57
62
  * — it never throws, because a bad name from an API must not take down the tree.
58
63
  *
64
+ * `name` is normalized before the lookup, so a stored `icon_code` renders whether
65
+ * it was written `shopping_cart`, `" Save"` or under a slug lucide has since
66
+ * deprecated. Pass `normalize={false}` for a strict lookup.
67
+ *
59
68
  * @example
60
69
  * <Icon name="save" size={18} />
61
70
  * <Icon name={row.iconSlug} fallback={<span className="skeleton" />} />
71
+ * <Icon icon={Wrench} size={18} />
62
72
  */
63
- export declare function Icon({ name, size, strokeWidth, fallback, ...rest }: IconProps): ReactNode;
73
+ export declare function Icon({ name, icon, size, strokeWidth, fallback, normalize, ...rest }: IconProps): ReactNode;
64
74
 
65
75
  /**
66
76
  * Lucide's 257 deprecated slugs, mapped to the canonical slug that
@@ -72,6 +82,72 @@ export declare function Icon({ name, size, strokeWidth, fallback, ...rest }: Ico
72
82
  */
73
83
  export declare const iconAliases: Record<string, string>;
74
84
 
85
+ declare interface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, "ref" | "name"> {
86
+ /** Width and height in px. Defaults to the provider's value, then lucide's `24`. */
87
+ size?: number | string;
88
+ /** Stroke width. Defaults to the provider's value, then lucide's `2`. */
89
+ strokeWidth?: number;
90
+ /**
91
+ * Rendered while the icon's shard is in flight, and for a slug that does not
92
+ * exist at all. Defaults to nothing.
93
+ *
94
+ * Pass a same-sized placeholder when the surrounding layout would otherwise
95
+ * shift. Note that a slug already in the registry or the cache never renders
96
+ * this — it resolves during render.
97
+ */
98
+ fallback?: ReactNode;
99
+ /**
100
+ * Clean up `name` before looking it up. Default `true`.
101
+ *
102
+ * A stored `icon_code` arrives dirty — `shopping_cart`, `" Save"`, a slug
103
+ * lucide deprecated two releases ago — and normalizing is what makes those
104
+ * render instead of falling back. `false` asks for a strict lookup, for the
105
+ * case where you want an unexpected spelling to be visible rather than
106
+ * quietly repaired.
107
+ *
108
+ * Ignored when the icon is passed as a component.
109
+ */
110
+ normalize?: boolean;
111
+ }
112
+
113
+ /**
114
+ * Address the icon by component, for a call site that already imported it.
115
+ *
116
+ * No lookup, no registry, no shard: the component is rendered as passed. It is
117
+ * there so a screen mixing literal icons with data-driven ones can keep using one
118
+ * component instead of alternating between `<Icon name>` and `<Wrench />`, which
119
+ * is what makes the shared `size`/`strokeWidth` defaults apply to both.
120
+ */
121
+ declare interface IconByComponentProps extends IconBaseProps {
122
+ icon: LucideIcon;
123
+ name?: never;
124
+ }
125
+
126
+ /**
127
+ * Address the icon by slug — the reason this component exists.
128
+ *
129
+ * The slug is typed as the union of every name lucide ships, so a typo is a
130
+ * compile error, while still accepting a plain `string` for the case that
131
+ * motivates the whole module: a name arriving from an API, a CMS or a config
132
+ * table.
133
+ */
134
+ declare interface IconByNameProps extends IconBaseProps {
135
+ name: IconName | (string & {});
136
+ icon?: never;
137
+ }
138
+
139
+ /** What a shard failure reports to whoever subscribed. */
140
+ export declare interface IconLoadError {
141
+ /** The shard key whose chunk could not be fetched. */
142
+ shard: string;
143
+ /** The slug whose render asked for it. */
144
+ slug: string;
145
+ /** Attempts made before giving up, retries included. */
146
+ attempts: number;
147
+ /** The last rejection from the dynamic import. */
148
+ error: unknown;
149
+ }
150
+
75
151
  /**
76
152
  * Every icon slug lucide ships, as a union of string literals.
77
153
  *
@@ -89,30 +165,68 @@ export declare type IconName = "a-arrow-down" | "a-arrow-up" | "a-large-small" |
89
165
  */
90
166
  export declare const iconNames: readonly IconName[];
91
167
 
92
- export declare interface IconProps extends Omit<SVGProps<SVGSVGElement>, "ref"> {
168
+ /**
169
+ * An icon field: native autocomplete over every lucide slug, plus a preview.
170
+ *
171
+ * Every panel that lets someone choose an icon was rewriting this — filter the
172
+ * list, cap the suggestions, build the `<datalist>`, and block submit when the
173
+ * typed name does not exist. That last step is the one that matters: without it
174
+ * an invalid value reaches the database and only shows up later as a missing icon
175
+ * on every screen that renders the record.
176
+ *
177
+ * Validation is wired to the **native** form: the input carries a custom validity
178
+ * message, so a plain `<form>` refuses to submit and the browser points at the
179
+ * field. `validateIconName` is exported for react-hook-form and zod.
180
+ *
181
+ * Built on `<datalist>` rather than a custom listbox on purpose: keyboard,
182
+ * screen-reader and mobile behaviour come from the platform, and the component
183
+ * stays small enough that its cost is the slug list it has to import — ~7 KB
184
+ * brotli, which only a picker pays.
185
+ *
186
+ * @example
187
+ * const [icon, setIcon] = useState("");
188
+ *
189
+ * <form onSubmit={save}>
190
+ * <IconPicker value={icon} onChange={setIcon} required />
191
+ * <button type="submit">Salvar</button>
192
+ * </form>
193
+ */
194
+ export declare function IconPicker({ value, onChange, limit, previewSize, invalidMessage, emptyPreview, className, ...rest }: IconPickerProps): ReactNode;
195
+
196
+ /**
197
+ * @tempest-limits props-count — value/onChange are the field, limit/placeholder
198
+ * the suggestion list, and previewSize/invalidMessage the two things a form
199
+ * around it needs to restyle or translate.
200
+ */
201
+ export declare interface IconPickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "list" | "type"> {
202
+ /** The chosen slug. Always canonical — see `onChange`. */
203
+ value: string;
93
204
  /**
94
- * The lucide slug, kebab-case: `"save"`, `"trash-2"`, `"circle-alert"`.
205
+ * Fires with the **canonical** slug on every keystroke.
95
206
  *
96
- * Typed as the union of every slug lucide ships, so a typo is a compile
97
- * error while still accepting a plain `string` for the case this component
98
- * exists for: a name that arrives from an API, a CMS or a config table.
207
+ * Legacy spellings are normalized on the way out (`Shopping_Cart`
208
+ * `shopping-cart`, `alert-circle` `circle-alert`), so what a form stores is
209
+ * what `<Icon>` resolves without further cleanup.
99
210
  */
100
- name: IconName | (string & {});
101
- /** Width and height in px. Defaults to the provider's value, then lucide's `24`. */
102
- size?: number | string;
103
- /** Stroke width. Defaults to the provider's value, then lucide's `2`. */
104
- strokeWidth?: number;
211
+ onChange: (slug: string) => void;
105
212
  /**
106
- * Rendered while the icon's shard is in flight, and for a slug that does not
107
- * exist at all. Defaults to nothing.
213
+ * How many suggestions to render. Default `40`.
108
214
  *
109
- * Pass a same-sized placeholder when the surrounding layout would otherwise
110
- * shift. Note that a slug already in the registry or the cache never renders
111
- * this it resolves during render.
215
+ * There are 2024 slugs, and building every one as an `<option>` on each
216
+ * keystroke freezes the datalist which is the reason this prop exists rather
217
+ * than a "show everything" default.
112
218
  */
113
- fallback?: ReactNode;
219
+ limit?: number;
220
+ /** Size of the preview glyph, in px. Default `20`. */
221
+ previewSize?: number;
222
+ /** Overrides the message shown for a slug that does not exist. */
223
+ invalidMessage?: string;
224
+ /** Rendered in the preview box while nothing valid is chosen. */
225
+ emptyPreview?: ReactNode;
114
226
  }
115
227
 
228
+ export declare type IconProps = IconByNameProps | IconByComponentProps;
229
+
116
230
  /**
117
231
  * Provide a static icon registry and shared `<Icon>` defaults to a subtree.
118
232
  *
@@ -151,16 +265,18 @@ export declare interface IconProviderProps {
151
265
  export declare type IconRegistry = Readonly<Record<string, LucideIcon>>;
152
266
 
153
267
  /**
154
- * Whether a slug is ready, still loading, or not an icon at all.
268
+ * Whether a slug is ready, loading, unknown, or unreachable.
155
269
  *
156
270
  * `"missing"` is only reported once that is actually knowable: either lucide has
157
- * no icons under that initial letter, or the letter's shard already settled
158
- * without the slug in it.
271
+ * no icons under that initial letter, or the letter's shard **arrived** without
272
+ * the slug in it. A shard that failed to load reports `"error"` instead — the two
273
+ * used to collapse into `"missing"`, which turned a stale deploy into what looked
274
+ * like a typo and made `Icon` warn about a name that is perfectly valid.
159
275
  *
160
276
  * @param slug - Any icon slug, canonical or deprecated.
161
277
  * @returns The slug's resolution state.
162
278
  */
163
- export declare function iconStatus(slug: string): "ready" | "loading" | "missing";
279
+ export declare function iconStatus(slug: string): "ready" | "loading" | "missing" | "error";
164
280
 
165
281
  /**
166
282
  * Narrow an arbitrary string to a known icon slug.
@@ -216,28 +332,65 @@ export declare const MATERIAL_SYMBOL_FALLBACK: IconName;
216
332
  * empty screen: a handful of codes collide by accident, so roughly one row in
217
333
  * ten draws the right icon and the bug reads as "some icons went missing".
218
334
  *
219
- * **This is a seed table, not the full vocabulary.** Material Symbols ships
220
- * ~3600 names and almost none of them will ever appear in an `icon_code` of
221
- * ours. It grows on demand, one hand-written pair at a time — a map generated by
222
- * name heuristics gets it badly wrong, starting with `build`, which is a wrench
223
- * in Material Symbols and not anything to do with construction.
335
+ * **Still not the full vocabulary.** Material Symbols ships ~3600 names and
336
+ * almost none of them will ever appear in an `icon_code` of ours, so this grows
337
+ * on demand, one hand-written pair at a time — a map generated by name
338
+ * heuristics gets it badly wrong, starting with `build`, which is a wrench in
339
+ * Material Symbols and nothing to do with construction. What is here covers the
340
+ * trades lot it started as plus the vocabulary an administrative panel actually
341
+ * uses: navigation, money, dates, media, and the service categories a seed
342
+ * tends to carry.
343
+ *
344
+ * Every target is checked mechanically against the slug list by
345
+ * `material-symbols.test.ts`, so a pair pointing at a name lucide does not ship
346
+ * — or at one it has since deprecated — fails the suite instead of reaching a
347
+ * grid. What no test can check is whether the *chosen* icon is the right
348
+ * metaphor, which is why pairs go in by hand.
224
349
  *
225
- * **Approximations, deliberate and not one-to-one:**
350
+ * **Approximations, deliberate and not one-to-one** (the full list lives in
351
+ * `docs/icons.md`):
226
352
  *
227
353
  * - `plumbing` → `shower-head`, because lucide has no pipe.
228
354
  * - `build`, `handyman` and `hardware` all land on `wrench` — Material Symbols
229
355
  * distinguishes the tools, lucide does not.
230
356
  * - `pedal_bike`, `two_wheeler` and `delivery_dining` all land on `bike`.
357
+ * - `dentistry` → `face-slightly-smiling`, since lucide ships no tooth.
358
+ * - `iron` → `shirt` and `cleaning_services` → `spray-can`: the activity, not
359
+ * the implement.
360
+ * - `roofing` → `house`, the same glyph as `home`, because lucide has no roof.
231
361
  *
232
- * The thirteen identity pairs are here on purpose. Their names happen to match
233
- * in both vocabularies, so they already render today — leaving them out would
234
- * send them to {@link MATERIAL_SYMBOL_FALLBACK} and make this bridge a
235
- * regression for exactly the codes that used to work.
362
+ * The identity pairs are here on purpose. Their names happen to match in both
363
+ * vocabularies, so they already render today — leaving them out would send them
364
+ * to {@link MATERIAL_SYMBOL_FALLBACK} and make this bridge a regression for
365
+ * exactly the codes that used to work.
236
366
  *
237
367
  * @see fromMaterialSymbol — the lookup you normally call.
238
368
  */
239
369
  export declare const materialToLucide: Readonly<Record<string, IconName>>;
240
370
 
371
+ /**
372
+ * Clean up an icon code and resolve it to the slug lucide actually ships.
373
+ *
374
+ * Every backend that stores an `icon_code` stores it dirty: `snake_case` left over
375
+ * from an old form, a capital or a stray space from a hand-typed value, and slugs
376
+ * lucide has since deprecated. Each app was writing the same three-step cleanup
377
+ * before rendering — trim, lower-case, `_` → `-`, then `resolveIconAlias` — which
378
+ * is code that should not exist outside the SDK.
379
+ *
380
+ * Note that this does **not** check whether the result is a real icon: the point is
381
+ * to produce the canonical spelling, and deciding what to do with an unknown name
382
+ * belongs to the caller. Pair it with `isIconName` when you need that answer, or
383
+ * let `<Icon>` render its `fallback`.
384
+ *
385
+ * @example
386
+ * normalizeIconName(" Alert_Circle "); // "circle-alert"
387
+ * normalizeIconName("shopping_cart"); // "shopping-cart"
388
+ *
389
+ * @param code - Any stored icon code.
390
+ * @returns The canonical, lucide-spelled slug.
391
+ */
392
+ export declare function normalizeIconName(code: string): string;
393
+
241
394
  /**
242
395
  * Read an icon out of the cache without triggering a fetch.
243
396
  *
@@ -257,18 +410,73 @@ export declare function peekIcon(slug: string): LucideIcon | undefined;
257
410
  */
258
411
  export declare function preloadIcons(slugs: readonly string[]): Promise<void>;
259
412
 
413
+ /**
414
+ * Make icon components resolvable by slug, with no provider and no plugin.
415
+ *
416
+ * Call it once from an entrypoint. The icons land in the same table a fetched
417
+ * shard fills, so every `<Icon>` below — including one that renders before the
418
+ * call, since registering notifies subscribers — resolves them synchronously and
419
+ * never issues a request.
420
+ *
421
+ * This is the whole setup for a closed catalog: an admin panel with twenty known
422
+ * icons pays two lines instead of a build plugin plus a provider. `IconProvider`
423
+ * stays for what is genuinely tree-scoped — the `size`/`strokeWidth` defaults and
424
+ * a registry that must override the global one for one subtree.
425
+ *
426
+ * A slug lucide does not ship is registered as-is, which is how an app adds its
427
+ * own artwork to the same `<Icon name>` call site.
428
+ *
429
+ * @example
430
+ * import { registerIcons } from "tempest-react-sdk/icons";
431
+ * import { Save, Trash2 } from "lucide-react";
432
+ *
433
+ * registerIcons({ save: Save, "trash-2": Trash2 });
434
+ *
435
+ * @param icons - Slug → icon component. Deprecated slugs are stored under the
436
+ * canonical name, so both spellings resolve.
437
+ */
438
+ export declare function registerIcons(icons: Readonly<Record<string, LucideIcon>>): void;
439
+
260
440
  /**
261
441
  * Map a slug to the canonical slug that owns the icon.
262
442
  *
263
443
  * Lucide keeps 257 deprecated aliases (`alert-circle` → `circle-alert`), and a
264
444
  * slug persisted in a database years ago is exactly the case this feature exists
265
- * for, so an alias must keep resolving after a lucide bump renames it.
445
+ * for, so an alias must keep resolving after a lucide bump renames it. Resolution
446
+ * happens before the shard lookup, since only canonical slugs are sharded.
447
+ *
448
+ * Its own module, not part of `shard-cache`: everything that merely *names* an
449
+ * icon needs this — `normalizeIconName`, `validateIconName`, a form checking a
450
+ * value before submit — and none of that needs the shard loader index. Sharing a
451
+ * module made a validator that never renders anything drag in all 45 shard
452
+ * modules.
266
453
  *
267
454
  * @param slug - Any icon slug, canonical or deprecated.
268
455
  * @returns The canonical slug.
269
456
  */
270
457
  export declare function resolveIconAlias(slug: string): string;
271
458
 
459
+ /**
460
+ * Subscribe to shard fetches that gave up.
461
+ *
462
+ * The failure is routine in a long-lived tab: a deploy rotates hashed chunk
463
+ * names, the old asset leaves the CDN, and the next icon that needs it 404s. That
464
+ * used to end in a permanent fallback with no signal — nothing for the user,
465
+ * nothing for observability. Subscribing is what turns it into both.
466
+ *
467
+ * @example
468
+ * import { subscribeToIconErrors } from "tempest-react-sdk/icons";
469
+ *
470
+ * subscribeToIconErrors(({ shard, error }) => {
471
+ * Sentry.captureException(error, { tags: { iconShard: shard } });
472
+ * promptReloadForStaleChunks();
473
+ * });
474
+ *
475
+ * @param listener - Called once per shard that gave up.
476
+ * @returns An unsubscribe function.
477
+ */
478
+ export declare function subscribeToIconErrors(listener: (detail: IconLoadError) => void): () => void;
479
+
272
480
  /**
273
481
  * Resolve an icon slug to its component.
274
482
  *
@@ -286,4 +494,33 @@ export declare function resolveIconAlias(slug: string): string;
286
494
  */
287
495
  export declare function useIcon(slug: string | undefined): LucideIcon | undefined;
288
496
 
497
+ /**
498
+ * Validate an icon slug the way `IconPicker` does.
499
+ *
500
+ * Its own module rather than living next to the component: a file that exports
501
+ * both a component and other values breaks Fast Refresh in a consuming dev
502
+ * server, which is what `react-refresh/only-export-components` guards and why
503
+ * `icon-context.ts` is split off from `IconProvider` too.
504
+ *
505
+ * Exported because the picker is not the only place a slug is checked: a form
506
+ * built on react-hook-form or zod validates before submitting, and duplicating
507
+ * the rule there is how the two drift apart.
508
+ *
509
+ * Empty passes — "no icon chosen" is a `required` question, not a spelling one,
510
+ * and conflating them would make the field impossible to clear.
511
+ *
512
+ * @example
513
+ * // react-hook-form
514
+ * register("icon", { validate: (value) => validateIconName(value) ?? true });
515
+ *
516
+ * @example
517
+ * // zod
518
+ * z.string().refine((value) => !validateIconName(value), { message: "Ícone inexistente" });
519
+ *
520
+ * @param value - The slug to check, in any spelling the picker accepts.
521
+ * @param message - Overrides the default message.
522
+ * @returns The message when the slug does not exist, `undefined` when it is fine.
523
+ */
524
+ export declare function validateIconName(value: string, message?: string): string | undefined;
525
+
289
526
  export { }
package/dist/icons.js CHANGED
@@ -1,10 +1,14 @@
1
1
  import { iconAliases as e } from "./icons/generated/aliases.js";
2
2
  import { iconNames as t } from "./icons/generated/icon-names.js";
3
3
  import { createIconRegistry as n } from "./icons/icon-context.js";
4
- import { iconStatus as r, loadIcon as i, peekIcon as a, preloadIcons as o, resolveIconAlias as s } from "./icons/shard-cache.js";
5
- import { useIcon as c } from "./icons/use-icon.js";
6
- import { Icon as l } from "./icons/Icon.js";
7
- import { IconProvider as u } from "./icons/IconProvider.js";
8
- import { isIconName as d } from "./icons/is-icon-name.js";
9
- import { MATERIAL_SYMBOL_FALLBACK as f, fromMaterialSymbol as p, materialToLucide as m } from "./icons/material-symbols.js";
10
- export { l as Icon, u as IconProvider, f as MATERIAL_SYMBOL_FALLBACK, n as createIconRegistry, p as fromMaterialSymbol, e as iconAliases, t as iconNames, r as iconStatus, d as isIconName, i as loadIcon, m as materialToLucide, a as peekIcon, o as preloadIcons, s as resolveIconAlias, c as useIcon };
4
+ import { resolveIconAlias as r } from "./icons/alias.js";
5
+ import { normalizeIconName as i } from "./icons/normalize-icon-name.js";
6
+ import { iconStatus as a, loadIcon as o, peekIcon as s, preloadIcons as c, registerIcons as l, subscribeToIconErrors as u } from "./icons/shard-cache.js";
7
+ import { useIcon as d } from "./icons/use-icon.js";
8
+ import { Icon as f } from "./icons/Icon.js";
9
+ import { isIconName as p } from "./icons/is-icon-name.js";
10
+ import { DEFAULT_ICON_PICKER_MESSAGE as m, validateIconName as h } from "./icons/validate-icon-name.js";
11
+ import { IconPicker as g } from "./icons/IconPicker.js";
12
+ import { IconProvider as _ } from "./icons/IconProvider.js";
13
+ import { MATERIAL_SYMBOL_FALLBACK as v, fromMaterialSymbol as y, materialToLucide as b } from "./icons/material-symbols.js";
14
+ export { m as DEFAULT_ICON_PICKER_MESSAGE, f as Icon, g as IconPicker, _ as IconProvider, v as MATERIAL_SYMBOL_FALLBACK, n as createIconRegistry, y as fromMaterialSymbol, e as iconAliases, t as iconNames, a as iconStatus, p as isIconName, o as loadIcon, b as materialToLucide, i as normalizeIconName, s as peekIcon, c as preloadIcons, l as registerIcons, r as resolveIconAlias, u as subscribeToIconErrors, d as useIcon, h as validateIconName };