@omnitron-dev/prism 0.2.0 → 0.3.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 (839) hide show
  1. package/dist/accessibility/index.d.ts +7 -151
  2. package/dist/accessibility/index.d.ts.map +1 -0
  3. package/dist/accessibility/index.js +0 -1
  4. package/dist/accessibility/index.js.map +1 -1
  5. package/dist/accessibility/vision-mode.d.ts +154 -0
  6. package/dist/accessibility/vision-mode.d.ts.map +1 -0
  7. package/dist/blocks/auth-block/auth-block.d.ts +107 -0
  8. package/dist/blocks/auth-block/auth-block.d.ts.map +1 -0
  9. package/dist/blocks/auth-block/guards.d.ts +262 -0
  10. package/dist/blocks/auth-block/guards.d.ts.map +1 -0
  11. package/dist/blocks/auth-block/index.d.ts +13 -0
  12. package/dist/blocks/auth-block/index.d.ts.map +1 -0
  13. package/dist/blocks/auth-block/types.d.ts +232 -0
  14. package/dist/blocks/auth-block/types.d.ts.map +1 -0
  15. package/dist/blocks/dashboard-block/dashboard-block.d.ts +53 -0
  16. package/dist/blocks/dashboard-block/dashboard-block.d.ts.map +1 -0
  17. package/dist/blocks/dashboard-block/index.d.ts +12 -0
  18. package/dist/blocks/dashboard-block/index.d.ts.map +1 -0
  19. package/dist/blocks/dashboard-block/types.d.ts +182 -0
  20. package/dist/blocks/dashboard-block/types.d.ts.map +1 -0
  21. package/dist/blocks/dashboard-block/use-dashboard-block.d.ts +95 -0
  22. package/dist/blocks/dashboard-block/use-dashboard-block.d.ts.map +1 -0
  23. package/dist/blocks/data-grid-block/data-grid-block.d.ts +81 -0
  24. package/dist/blocks/data-grid-block/data-grid-block.d.ts.map +1 -0
  25. package/dist/blocks/data-grid-block/index.d.ts +11 -0
  26. package/dist/blocks/data-grid-block/index.d.ts.map +1 -0
  27. package/dist/blocks/data-grid-block/types.d.ts +304 -0
  28. package/dist/blocks/data-grid-block/types.d.ts.map +1 -0
  29. package/dist/blocks/index.d.ts +10 -1235
  30. package/dist/blocks/index.d.ts.map +1 -0
  31. package/dist/blocks/index.js +139 -42
  32. package/dist/blocks/index.js.map +1 -1
  33. package/dist/{chunk-VAAIHNWQ.js → chunk-6AHI4GSV.js} +3 -3
  34. package/dist/chunk-6AHI4GSV.js.map +1 -0
  35. package/dist/{chunk-JDTC2SBY.js → chunk-AD4W7HYC.js} +2 -2
  36. package/dist/chunk-AD4W7HYC.js.map +1 -0
  37. package/dist/{chunk-SNKGGHBT.js → chunk-ADG4HZEP.js} +3 -3
  38. package/dist/chunk-ADG4HZEP.js.map +1 -0
  39. package/dist/{chunk-JNU4QHJK.js → chunk-AYYFMTMI.js} +5 -4
  40. package/dist/{chunk-JNU4QHJK.js.map → chunk-AYYFMTMI.js.map} +1 -1
  41. package/dist/{chunk-HO2GKTWJ.js → chunk-BRDWQVRT.js} +2 -2
  42. package/dist/chunk-BRDWQVRT.js.map +1 -0
  43. package/dist/{chunk-XXP3ZGU6.js → chunk-BZOL7GMU.js} +21 -13
  44. package/dist/chunk-BZOL7GMU.js.map +1 -0
  45. package/dist/{chunk-2FYNRDXR.js → chunk-DRFNMZLG.js} +2 -2
  46. package/dist/chunk-DRFNMZLG.js.map +1 -0
  47. package/dist/{chunk-BV32OJ2A.js → chunk-GUFHFEPZ.js} +2 -2
  48. package/dist/chunk-GUFHFEPZ.js.map +1 -0
  49. package/dist/{chunk-KTCWPGON.js → chunk-OBJ244BO.js} +558 -75
  50. package/dist/chunk-OBJ244BO.js.map +1 -0
  51. package/dist/{chunk-IZOIO7PA.js → chunk-S6SEGBX6.js} +31 -22
  52. package/dist/chunk-S6SEGBX6.js.map +1 -0
  53. package/dist/chunk-SNZK5X6F.js +594 -0
  54. package/dist/chunk-SNZK5X6F.js.map +1 -0
  55. package/dist/{chunk-YJMAQL3S.js → chunk-WFD54GQQ.js} +122 -69
  56. package/dist/chunk-WFD54GQQ.js.map +1 -0
  57. package/dist/{chunk-DDY7TLUI.js → chunk-XIXSSI3B.js} +28 -2
  58. package/dist/chunk-XIXSSI3B.js.map +1 -0
  59. package/dist/{chunk-A2Z7NVGL.js → chunk-YQW43BDH.js} +1274 -792
  60. package/dist/chunk-YQW43BDH.js.map +1 -0
  61. package/dist/{chunk-XWL6J6IO.js → chunk-YSIG2XYH.js} +2 -2
  62. package/dist/chunk-YSIG2XYH.js.map +1 -0
  63. package/dist/chunk-Z5OSPAOC.js +1576 -0
  64. package/dist/chunk-Z5OSPAOC.js.map +1 -0
  65. package/dist/{chunk-MEFT6XPH.js → chunk-ZTATTUH7.js} +170 -85
  66. package/dist/chunk-ZTATTUH7.js.map +1 -0
  67. package/dist/cli/commands/add.d.ts +22 -0
  68. package/dist/cli/commands/add.d.ts.map +1 -0
  69. package/dist/cli/commands/diff.d.ts +13 -0
  70. package/dist/cli/commands/diff.d.ts.map +1 -0
  71. package/dist/cli/commands/doctor.d.ts +13 -0
  72. package/dist/cli/commands/doctor.d.ts.map +1 -0
  73. package/dist/cli/commands/init.d.ts +13 -0
  74. package/dist/cli/commands/init.d.ts.map +1 -0
  75. package/dist/cli/commands/list.d.ts +13 -0
  76. package/dist/cli/commands/list.d.ts.map +1 -0
  77. package/dist/cli/commands/remove.d.ts +13 -0
  78. package/dist/cli/commands/remove.d.ts.map +1 -0
  79. package/dist/cli/commands/update.d.ts +13 -0
  80. package/dist/cli/commands/update.d.ts.map +1 -0
  81. package/dist/cli/config.d.ts +73 -0
  82. package/dist/cli/config.d.ts.map +1 -0
  83. package/dist/cli/constants.d.ts +60 -0
  84. package/dist/cli/constants.d.ts.map +1 -0
  85. package/dist/cli/index.d.ts +27 -0
  86. package/dist/cli/index.d.ts.map +1 -0
  87. package/dist/cli/index.js +31 -37
  88. package/dist/cli/index.js.map +1 -1
  89. package/dist/components/accordion/accordion.d.ts +149 -0
  90. package/dist/components/accordion/accordion.d.ts.map +1 -0
  91. package/dist/components/accordion/index.d.ts +7 -0
  92. package/dist/components/accordion/index.d.ts.map +1 -0
  93. package/dist/components/admin-filters/admin-data-table.d.ts +185 -0
  94. package/dist/components/admin-filters/admin-data-table.d.ts.map +1 -0
  95. package/dist/components/admin-filters/amount-cell.d.ts +39 -0
  96. package/dist/components/admin-filters/amount-cell.d.ts.map +1 -0
  97. package/dist/components/admin-filters/filter-toolbar.d.ts +99 -0
  98. package/dist/components/admin-filters/filter-toolbar.d.ts.map +1 -0
  99. package/dist/components/admin-filters/index.d.ts +13 -0
  100. package/dist/components/admin-filters/index.d.ts.map +1 -0
  101. package/dist/components/admin-filters/status-chip.d.ts +55 -0
  102. package/dist/components/admin-filters/status-chip.d.ts.map +1 -0
  103. package/dist/components/alert/alert.d.ts +159 -0
  104. package/dist/components/alert/alert.d.ts.map +1 -0
  105. package/dist/components/alert/index.d.ts +7 -0
  106. package/dist/components/alert/index.d.ts.map +1 -0
  107. package/dist/components/animate/animate-border.d.ts +33 -0
  108. package/dist/components/animate/animate-border.d.ts.map +1 -0
  109. package/dist/components/animate/index.d.ts +3 -0
  110. package/dist/components/animate/index.d.ts.map +1 -0
  111. package/dist/components/animate/motion-lazy.d.ts +5 -0
  112. package/dist/components/animate/motion-lazy.d.ts.map +1 -0
  113. package/dist/components/avatar/avatar.d.ts +78 -0
  114. package/dist/components/avatar/avatar.d.ts.map +1 -0
  115. package/dist/components/avatar/index.d.ts +7 -0
  116. package/dist/components/avatar/index.d.ts.map +1 -0
  117. package/dist/components/badge/badge.d.ts +102 -0
  118. package/dist/components/badge/badge.d.ts.map +1 -0
  119. package/dist/components/badge/index.d.ts +7 -0
  120. package/dist/components/badge/index.d.ts.map +1 -0
  121. package/dist/components/breadcrumbs/breadcrumbs.d.ts +100 -0
  122. package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  123. package/dist/components/breadcrumbs/index.d.ts +7 -0
  124. package/dist/components/breadcrumbs/index.d.ts.map +1 -0
  125. package/dist/components/card/card.d.ts +127 -0
  126. package/dist/components/card/card.d.ts.map +1 -0
  127. package/dist/components/card/index.d.ts +7 -0
  128. package/dist/components/card/index.d.ts.map +1 -0
  129. package/dist/components/carousel/carousel.d.ts +35 -0
  130. package/dist/components/carousel/carousel.d.ts.map +1 -0
  131. package/dist/components/carousel/classes.d.ts +35 -0
  132. package/dist/components/carousel/classes.d.ts.map +1 -0
  133. package/dist/components/carousel/index.d.ts +10 -0
  134. package/dist/components/carousel/index.d.ts.map +1 -0
  135. package/dist/components/carousel/types.d.ts +167 -0
  136. package/dist/components/carousel/types.d.ts.map +1 -0
  137. package/dist/components/carousel/use-carousel.d.ts +51 -0
  138. package/dist/components/carousel/use-carousel.d.ts.map +1 -0
  139. package/dist/components/changelog/changelog-entry.d.ts +10 -0
  140. package/dist/components/changelog/changelog-entry.d.ts.map +1 -0
  141. package/dist/components/changelog/changelog-timeline.d.ts +9 -0
  142. package/dist/components/changelog/changelog-timeline.d.ts.map +1 -0
  143. package/dist/components/changelog/index.d.ts +3 -0
  144. package/dist/components/changelog/index.d.ts.map +1 -0
  145. package/dist/components/chart/chart.d.ts +39 -0
  146. package/dist/components/chart/chart.d.ts.map +1 -0
  147. package/dist/components/chart/classes.d.ts +24 -0
  148. package/dist/components/chart/classes.d.ts.map +1 -0
  149. package/dist/components/chart/components/chart-legends.d.ts +24 -0
  150. package/dist/components/chart/components/chart-legends.d.ts.map +1 -0
  151. package/dist/components/chart/components/chart-loading.d.ts +21 -0
  152. package/dist/components/chart/components/chart-loading.d.ts.map +1 -0
  153. package/dist/components/chart/components/index.d.ts +8 -0
  154. package/dist/components/chart/components/index.d.ts.map +1 -0
  155. package/dist/components/chart/index.d.ts +14 -0
  156. package/dist/components/chart/index.d.ts.map +1 -0
  157. package/dist/components/chart/types.d.ts +264 -0
  158. package/dist/components/chart/types.d.ts.map +1 -0
  159. package/dist/components/chart/use-chart.d.ts +34 -0
  160. package/dist/components/chart/use-chart.d.ts.map +1 -0
  161. package/dist/components/command-palette/command-palette.d.ts +73 -0
  162. package/dist/components/command-palette/command-palette.d.ts.map +1 -0
  163. package/dist/components/command-palette/index.d.ts +7 -0
  164. package/dist/components/command-palette/index.d.ts.map +1 -0
  165. package/dist/components/confirm-dialog/confirm-dialog.d.ts +89 -0
  166. package/dist/components/confirm-dialog/confirm-dialog.d.ts.map +1 -0
  167. package/dist/components/confirm-dialog/index.d.ts +7 -0
  168. package/dist/components/confirm-dialog/index.d.ts.map +1 -0
  169. package/dist/components/content-renderer/classes.d.ts +33 -0
  170. package/dist/components/content-renderer/classes.d.ts.map +1 -0
  171. package/dist/components/content-renderer/content-renderer.d.ts +37 -0
  172. package/dist/components/content-renderer/content-renderer.d.ts.map +1 -0
  173. package/dist/components/content-renderer/html-tags.d.ts +6 -0
  174. package/dist/components/content-renderer/html-tags.d.ts.map +1 -0
  175. package/dist/components/content-renderer/html-to-markdown.d.ts +7 -0
  176. package/dist/components/content-renderer/html-to-markdown.d.ts.map +1 -0
  177. package/dist/components/content-renderer/index.d.ts +7 -0
  178. package/dist/components/content-renderer/index.d.ts.map +1 -0
  179. package/dist/components/content-renderer/markdown.d.ts +23 -0
  180. package/dist/components/content-renderer/markdown.d.ts.map +1 -0
  181. package/dist/components/content-renderer/remark-spoiler.d.ts +9 -0
  182. package/dist/components/content-renderer/remark-spoiler.d.ts.map +1 -0
  183. package/dist/components/content-renderer/styles.d.ts +2 -0
  184. package/dist/components/content-renderer/styles.d.ts.map +1 -0
  185. package/dist/components/country-select/country-select.d.ts +101 -0
  186. package/dist/components/country-select/country-select.d.ts.map +1 -0
  187. package/dist/components/country-select/flag-icon.d.ts +36 -0
  188. package/dist/components/country-select/flag-icon.d.ts.map +1 -0
  189. package/dist/components/country-select/index.d.ts +5 -0
  190. package/dist/components/country-select/index.d.ts.map +1 -0
  191. package/dist/components/date-range-picker/date-range-input.d.ts +48 -0
  192. package/dist/components/date-range-picker/date-range-input.d.ts.map +1 -0
  193. package/dist/components/date-range-picker/date-range-picker.d.ts +39 -0
  194. package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -0
  195. package/dist/components/date-range-picker/index.d.ts +7 -0
  196. package/dist/components/date-range-picker/index.d.ts.map +1 -0
  197. package/dist/components/date-range-picker/use-date-range-picker.d.ts +28 -0
  198. package/dist/components/date-range-picker/use-date-range-picker.d.ts.map +1 -0
  199. package/dist/components/deadline-chip/deadline-chip.d.ts +41 -0
  200. package/dist/components/deadline-chip/deadline-chip.d.ts.map +1 -0
  201. package/dist/components/deadline-chip/index.d.ts +7 -0
  202. package/dist/components/deadline-chip/index.d.ts.map +1 -0
  203. package/dist/components/doc-layout/doc-layout.d.ts +17 -0
  204. package/dist/components/doc-layout/doc-layout.d.ts.map +1 -0
  205. package/dist/components/doc-layout/doc-section-nav.d.ts +16 -0
  206. package/dist/components/doc-layout/doc-section-nav.d.ts.map +1 -0
  207. package/dist/components/doc-layout/doc-sidebar.d.ts +15 -0
  208. package/dist/components/doc-layout/doc-sidebar.d.ts.map +1 -0
  209. package/dist/components/doc-layout/index.d.ts +4 -0
  210. package/dist/components/doc-layout/index.d.ts.map +1 -0
  211. package/dist/components/drawer/drawer.d.ts +65 -0
  212. package/dist/components/drawer/drawer.d.ts.map +1 -0
  213. package/dist/components/drawer/index.d.ts +7 -0
  214. package/dist/components/drawer/index.d.ts.map +1 -0
  215. package/dist/components/duration-picker/duration-picker.d.ts +24 -0
  216. package/dist/components/duration-picker/duration-picker.d.ts.map +1 -0
  217. package/dist/components/duration-picker/index.d.ts +2 -0
  218. package/dist/components/duration-picker/index.d.ts.map +1 -0
  219. package/dist/components/editor/classes.d.ts +52 -0
  220. package/dist/components/editor/classes.d.ts.map +1 -0
  221. package/dist/components/editor/editor.d.ts +15 -0
  222. package/dist/components/editor/editor.d.ts.map +1 -0
  223. package/dist/components/editor/extensions/clear-format.d.ts +3 -0
  224. package/dist/components/editor/extensions/clear-format.d.ts.map +1 -0
  225. package/dist/components/editor/extensions/index.d.ts +3 -0
  226. package/dist/components/editor/extensions/index.d.ts.map +1 -0
  227. package/dist/components/editor/extensions/text-transform.d.ts +20 -0
  228. package/dist/components/editor/extensions/text-transform.d.ts.map +1 -0
  229. package/dist/components/editor/icons/index.d.ts +42 -0
  230. package/dist/components/editor/icons/index.d.ts.map +1 -0
  231. package/dist/components/editor/index.d.ts +41 -104
  232. package/dist/components/editor/index.d.ts.map +1 -0
  233. package/dist/components/editor/index.js +1 -2
  234. package/dist/components/editor/presets.d.ts +3 -0
  235. package/dist/components/editor/presets.d.ts.map +1 -0
  236. package/dist/components/editor/styles.d.ts +2 -0
  237. package/dist/components/editor/styles.d.ts.map +1 -0
  238. package/dist/components/editor/toolbar/bubble-toolbar.d.ts +9 -0
  239. package/dist/components/editor/toolbar/bubble-toolbar.d.ts.map +1 -0
  240. package/dist/components/editor/toolbar/code-highlight-block.d.ts +3 -0
  241. package/dist/components/editor/toolbar/code-highlight-block.d.ts.map +1 -0
  242. package/dist/components/editor/toolbar/heading-block.d.ts +11 -0
  243. package/dist/components/editor/toolbar/heading-block.d.ts.map +1 -0
  244. package/dist/components/editor/toolbar/image-block.d.ts +11 -0
  245. package/dist/components/editor/toolbar/image-block.d.ts.map +1 -0
  246. package/dist/components/editor/toolbar/link-block.d.ts +13 -0
  247. package/dist/components/editor/toolbar/link-block.d.ts.map +1 -0
  248. package/dist/components/editor/toolbar/toolbar-item.d.ts +3 -0
  249. package/dist/components/editor/toolbar/toolbar-item.d.ts.map +1 -0
  250. package/dist/components/editor/toolbar/toolbar.d.ts +3 -0
  251. package/dist/components/editor/toolbar/toolbar.d.ts.map +1 -0
  252. package/dist/components/editor/toolbar/use-toolbar-state.d.ts +24 -0
  253. package/dist/components/editor/toolbar/use-toolbar-state.d.ts.map +1 -0
  254. package/dist/components/editor/types.d.ts +130 -0
  255. package/dist/components/editor/types.d.ts.map +1 -0
  256. package/dist/components/emoji-picker/emoji-picker.d.ts +24 -0
  257. package/dist/components/emoji-picker/emoji-picker.d.ts.map +1 -0
  258. package/dist/components/emoji-picker/emoji-search.d.ts +22 -0
  259. package/dist/components/emoji-picker/emoji-search.d.ts.map +1 -0
  260. package/dist/components/emoji-picker/emoji.d.ts +19 -0
  261. package/dist/components/emoji-picker/emoji.d.ts.map +1 -0
  262. package/dist/components/emoji-picker/index.d.ts +14 -0
  263. package/dist/components/emoji-picker/index.d.ts.map +1 -0
  264. package/dist/components/emoji-picker/index.js +3 -0
  265. package/dist/components/emoji-picker/index.js.map +1 -0
  266. package/dist/components/emoji-picker/twemoji-url.d.ts +26 -0
  267. package/dist/components/emoji-picker/twemoji-url.d.ts.map +1 -0
  268. package/dist/components/emoji-picker/types.d.ts +96 -0
  269. package/dist/components/emoji-picker/types.d.ts.map +1 -0
  270. package/dist/components/emoji-picker/use-emoji-data.d.ts +26 -0
  271. package/dist/components/emoji-picker/use-emoji-data.d.ts.map +1 -0
  272. package/dist/components/emoji-picker/use-recent-emojis.d.ts +16 -0
  273. package/dist/components/emoji-picker/use-recent-emojis.d.ts.map +1 -0
  274. package/dist/components/empty-content/empty-content.d.ts +92 -0
  275. package/dist/components/empty-content/empty-content.d.ts.map +1 -0
  276. package/dist/components/empty-content/index.d.ts +7 -0
  277. package/dist/components/empty-content/index.d.ts.map +1 -0
  278. package/dist/components/error-boundary/error-boundary.d.ts +162 -0
  279. package/dist/components/error-boundary/error-boundary.d.ts.map +1 -0
  280. package/dist/components/error-boundary/index.d.ts +7 -0
  281. package/dist/components/error-boundary/index.d.ts.map +1 -0
  282. package/dist/components/field/field-autocomplete.d.ts +74 -0
  283. package/dist/components/field/field-autocomplete.d.ts.map +1 -0
  284. package/dist/components/field/field-checkbox.d.ts +42 -0
  285. package/dist/components/field/field-checkbox.d.ts.map +1 -0
  286. package/dist/components/field/field-code.d.ts +80 -0
  287. package/dist/components/field/field-code.d.ts.map +1 -0
  288. package/dist/components/field/field-country-select.d.ts +84 -0
  289. package/dist/components/field/field-country-select.d.ts.map +1 -0
  290. package/dist/components/field/field-date-picker.d.ts +58 -0
  291. package/dist/components/field/field-date-picker.d.ts.map +1 -0
  292. package/dist/components/field/field-datetime-picker.d.ts +96 -0
  293. package/dist/components/field/field-datetime-picker.d.ts.map +1 -0
  294. package/dist/components/field/field-editor.d.ts +218 -0
  295. package/dist/components/field/field-editor.d.ts.map +1 -0
  296. package/dist/components/field/field-multi-checkbox.d.ts +91 -0
  297. package/dist/components/field/field-multi-checkbox.d.ts.map +1 -0
  298. package/dist/components/field/field-multi-select.d.ts +85 -0
  299. package/dist/components/field/field-multi-select.d.ts.map +1 -0
  300. package/dist/components/field/field-multi-switch.d.ts +93 -0
  301. package/dist/components/field/field-multi-switch.d.ts.map +1 -0
  302. package/dist/components/field/field-number.d.ts +50 -0
  303. package/dist/components/field/field-number.d.ts.map +1 -0
  304. package/dist/components/field/field-phone.d.ts +82 -0
  305. package/dist/components/field/field-phone.d.ts.map +1 -0
  306. package/dist/components/field/field-radio.d.ts +64 -0
  307. package/dist/components/field/field-radio.d.ts.map +1 -0
  308. package/dist/components/field/field-rating.d.ts +43 -0
  309. package/dist/components/field/field-rating.d.ts.map +1 -0
  310. package/dist/components/field/field-select.d.ts +50 -0
  311. package/dist/components/field/field-select.d.ts.map +1 -0
  312. package/dist/components/field/field-slider.d.ts +56 -0
  313. package/dist/components/field/field-slider.d.ts.map +1 -0
  314. package/dist/components/field/field-switch.d.ts +44 -0
  315. package/dist/components/field/field-switch.d.ts.map +1 -0
  316. package/dist/components/field/field-text.d.ts +38 -0
  317. package/dist/components/field/field-text.d.ts.map +1 -0
  318. package/dist/components/field/field-time-picker.d.ts +79 -0
  319. package/dist/components/field/field-time-picker.d.ts.map +1 -0
  320. package/dist/components/field/field-upload.d.ts +120 -0
  321. package/dist/components/field/field-upload.d.ts.map +1 -0
  322. package/dist/components/field/index.d.ts +149 -0
  323. package/dist/components/field/index.d.ts.map +1 -0
  324. package/dist/components/image/image.d.ts +79 -0
  325. package/dist/components/image/image.d.ts.map +1 -0
  326. package/dist/components/image/index.d.ts +7 -0
  327. package/dist/components/image/index.d.ts.map +1 -0
  328. package/dist/components/index.d.ts +60 -7072
  329. package/dist/components/index.d.ts.map +1 -0
  330. package/dist/components/index.js +11 -11
  331. package/dist/components/label/index.d.ts +7 -0
  332. package/dist/components/label/index.d.ts.map +1 -0
  333. package/dist/components/label/label.d.ts +71 -0
  334. package/dist/components/label/label.d.ts.map +1 -0
  335. package/dist/components/lightbox/classes.d.ts +34 -0
  336. package/dist/components/lightbox/classes.d.ts.map +1 -0
  337. package/dist/components/lightbox/index.d.ts +11 -0
  338. package/dist/components/lightbox/index.d.ts.map +1 -0
  339. package/dist/components/lightbox/lightbox.d.ts +42 -0
  340. package/dist/components/lightbox/lightbox.d.ts.map +1 -0
  341. package/dist/components/lightbox/types.d.ts +233 -0
  342. package/dist/components/lightbox/types.d.ts.map +1 -0
  343. package/dist/components/lightbox/use-lightbox.d.ts +42 -0
  344. package/dist/components/lightbox/use-lightbox.d.ts.map +1 -0
  345. package/dist/components/loading-screen/index.d.ts +8 -0
  346. package/dist/components/loading-screen/index.d.ts.map +1 -0
  347. package/dist/components/loading-screen/loading-screen.d.ts +37 -0
  348. package/dist/components/loading-screen/loading-screen.d.ts.map +1 -0
  349. package/dist/components/loading-screen/splash-screen.d.ts +80 -0
  350. package/dist/components/loading-screen/splash-screen.d.ts.map +1 -0
  351. package/dist/components/map/Map.d.ts +63 -0
  352. package/dist/components/map/Map.d.ts.map +1 -0
  353. package/dist/components/map/MapCoverageLayer.d.ts +25 -0
  354. package/dist/components/map/MapCoverageLayer.d.ts.map +1 -0
  355. package/dist/components/map/MapMarker.d.ts +17 -0
  356. package/dist/components/map/MapMarker.d.ts.map +1 -0
  357. package/dist/components/map/MapPointPicker.d.ts +26 -0
  358. package/dist/components/map/MapPointPicker.d.ts.map +1 -0
  359. package/dist/components/map/index.d.ts +14 -0
  360. package/dist/components/map/index.d.ts.map +1 -0
  361. package/dist/components/mega-menu/index.d.ts +12 -0
  362. package/dist/components/mega-menu/index.d.ts.map +1 -0
  363. package/dist/components/mega-menu/mega-menu-horizontal.d.ts +41 -0
  364. package/dist/components/mega-menu/mega-menu-horizontal.d.ts.map +1 -0
  365. package/dist/components/mega-menu/mega-menu-mobile.d.ts +28 -0
  366. package/dist/components/mega-menu/mega-menu-mobile.d.ts.map +1 -0
  367. package/dist/components/mega-menu/mega-menu-vertical.d.ts +28 -0
  368. package/dist/components/mega-menu/mega-menu-vertical.d.ts.map +1 -0
  369. package/dist/components/mega-menu/styles.d.ts +18 -0
  370. package/dist/components/mega-menu/styles.d.ts.map +1 -0
  371. package/dist/components/mega-menu/types.d.ts +200 -0
  372. package/dist/components/mega-menu/types.d.ts.map +1 -0
  373. package/dist/components/menu/index.d.ts +7 -0
  374. package/dist/components/menu/index.d.ts.map +1 -0
  375. package/dist/components/menu/menu.d.ts +144 -0
  376. package/dist/components/menu/menu.d.ts.map +1 -0
  377. package/dist/components/nav-card/index.d.ts +8 -0
  378. package/dist/components/nav-card/index.d.ts.map +1 -0
  379. package/dist/components/nav-card/nav-card-grid.d.ts +57 -0
  380. package/dist/components/nav-card/nav-card-grid.d.ts.map +1 -0
  381. package/dist/components/nav-card/nav-card.d.ts +69 -0
  382. package/dist/components/nav-card/nav-card.d.ts.map +1 -0
  383. package/dist/components/nav-section/components.d.ts +143 -0
  384. package/dist/components/nav-section/components.d.ts.map +1 -0
  385. package/dist/components/nav-section/index.d.ts +15 -0
  386. package/dist/components/nav-section/index.d.ts.map +1 -0
  387. package/dist/components/nav-section/nav-context.d.ts +80 -0
  388. package/dist/components/nav-section/nav-context.d.ts.map +1 -0
  389. package/dist/components/nav-section/nav-item.d.ts +20 -0
  390. package/dist/components/nav-section/nav-item.d.ts.map +1 -0
  391. package/dist/components/nav-section/nav-list.d.ts +25 -0
  392. package/dist/components/nav-section/nav-list.d.ts.map +1 -0
  393. package/dist/components/nav-section/nav-section-horizontal.d.ts +29 -0
  394. package/dist/components/nav-section/nav-section-horizontal.d.ts.map +1 -0
  395. package/dist/components/nav-section/nav-section-mini.d.ts +30 -0
  396. package/dist/components/nav-section/nav-section-mini.d.ts.map +1 -0
  397. package/dist/components/nav-section/nav-section-vertical.d.ts +37 -0
  398. package/dist/components/nav-section/nav-section-vertical.d.ts.map +1 -0
  399. package/dist/components/nav-section/styles.d.ts +35 -0
  400. package/dist/components/nav-section/styles.d.ts.map +1 -0
  401. package/dist/components/nav-section/types.d.ts +178 -0
  402. package/dist/components/nav-section/types.d.ts.map +1 -0
  403. package/dist/components/navigation-progress/index.d.ts +7 -0
  404. package/dist/components/navigation-progress/index.d.ts.map +1 -0
  405. package/dist/components/navigation-progress/navigation-progress.d.ts +36 -0
  406. package/dist/components/navigation-progress/navigation-progress.d.ts.map +1 -0
  407. package/dist/components/page-content/index.d.ts +7 -0
  408. package/dist/components/page-content/index.d.ts.map +1 -0
  409. package/dist/components/page-content/page-content.d.ts +55 -0
  410. package/dist/components/page-content/page-content.d.ts.map +1 -0
  411. package/dist/components/popover/index.d.ts +7 -0
  412. package/dist/components/popover/index.d.ts.map +1 -0
  413. package/dist/{popover-Dmw7SJLR.d.ts → components/popover/popover.d.ts} +11 -14
  414. package/dist/components/popover/popover.d.ts.map +1 -0
  415. package/dist/components/progress/countdown-ring.d.ts +60 -0
  416. package/dist/components/progress/countdown-ring.d.ts.map +1 -0
  417. package/dist/components/progress/index.d.ts +8 -0
  418. package/dist/components/progress/index.d.ts.map +1 -0
  419. package/dist/components/progress/progress.d.ts +106 -0
  420. package/dist/components/progress/progress.d.ts.map +1 -0
  421. package/dist/components/rail/index.d.ts +7 -0
  422. package/dist/components/rail/index.d.ts.map +1 -0
  423. package/dist/components/rail/rail.d.ts +39 -0
  424. package/dist/components/rail/rail.d.ts.map +1 -0
  425. package/dist/components/scroll-spy/index.d.ts +3 -0
  426. package/dist/components/scroll-spy/index.d.ts.map +1 -0
  427. package/dist/components/scroll-spy/scroll-spy-provider.d.ts +26 -0
  428. package/dist/components/scroll-spy/scroll-spy-provider.d.ts.map +1 -0
  429. package/dist/components/scroll-spy/scroll-spy-section.d.ts +10 -0
  430. package/dist/components/scroll-spy/scroll-spy-section.d.ts.map +1 -0
  431. package/dist/components/scroll-to-top/index.d.ts +7 -0
  432. package/dist/components/scroll-to-top/index.d.ts.map +1 -0
  433. package/dist/components/scroll-to-top/scroll-to-top.d.ts +25 -0
  434. package/dist/components/scroll-to-top/scroll-to-top.d.ts.map +1 -0
  435. package/dist/components/scrollbar/index.d.ts +7 -0
  436. package/dist/components/scrollbar/index.d.ts.map +1 -0
  437. package/dist/components/scrollbar/scrollbar.d.ts +59 -0
  438. package/dist/components/scrollbar/scrollbar.d.ts.map +1 -0
  439. package/dist/components/search-input/index.d.ts +2 -0
  440. package/dist/components/search-input/index.d.ts.map +1 -0
  441. package/dist/components/search-input/search-input.d.ts +46 -0
  442. package/dist/components/search-input/search-input.d.ts.map +1 -0
  443. package/dist/components/settings/index.d.ts +10 -0
  444. package/dist/components/settings/index.d.ts.map +1 -0
  445. package/dist/components/settings/settings-drawer.d.ts +39 -0
  446. package/dist/components/settings/settings-drawer.d.ts.map +1 -0
  447. package/dist/components/settings/settings-provider.d.ts +106 -0
  448. package/dist/components/settings/settings-provider.d.ts.map +1 -0
  449. package/dist/components/skeleton/index.d.ts +7 -0
  450. package/dist/components/skeleton/index.d.ts.map +1 -0
  451. package/dist/components/skeleton/skeleton.d.ts +77 -0
  452. package/dist/components/skeleton/skeleton.d.ts.map +1 -0
  453. package/dist/components/snackbar/index.d.ts +7 -0
  454. package/dist/components/snackbar/index.d.ts.map +1 -0
  455. package/dist/components/snackbar/snackbar.d.ts +120 -0
  456. package/dist/components/snackbar/snackbar.d.ts.map +1 -0
  457. package/dist/components/sponsored-slot/index.d.ts +3 -0
  458. package/dist/components/sponsored-slot/index.d.ts.map +1 -0
  459. package/dist/components/sponsored-slot/sponsored-slot.d.ts +16 -0
  460. package/dist/components/sponsored-slot/sponsored-slot.d.ts.map +1 -0
  461. package/dist/components/sponsored-slot/types.d.ts +45 -0
  462. package/dist/components/sponsored-slot/types.d.ts.map +1 -0
  463. package/dist/components/stepper/index.d.ts +7 -0
  464. package/dist/components/stepper/index.d.ts.map +1 -0
  465. package/dist/components/stepper/stepper.d.ts +145 -0
  466. package/dist/components/stepper/stepper.d.ts.map +1 -0
  467. package/dist/components/svg-color/index.d.ts +7 -0
  468. package/dist/components/svg-color/index.d.ts.map +1 -0
  469. package/dist/components/svg-color/svg-color.d.ts +80 -0
  470. package/dist/components/svg-color/svg-color.d.ts.map +1 -0
  471. package/dist/components/table/index.d.ts +7 -0
  472. package/dist/components/table/index.d.ts.map +1 -0
  473. package/dist/components/table/table.d.ts +184 -0
  474. package/dist/components/table/table.d.ts.map +1 -0
  475. package/dist/components/tabs/index.d.ts +7 -0
  476. package/dist/components/tabs/index.d.ts.map +1 -0
  477. package/dist/components/tabs/tabs.d.ts +146 -0
  478. package/dist/components/tabs/tabs.d.ts.map +1 -0
  479. package/dist/components/tag-cloud/index.d.ts +7 -0
  480. package/dist/components/tag-cloud/index.d.ts.map +1 -0
  481. package/dist/components/tag-cloud/tag-cloud.d.ts +58 -0
  482. package/dist/components/tag-cloud/tag-cloud.d.ts.map +1 -0
  483. package/dist/components/tiptap-renderer/index.d.ts +2 -0
  484. package/dist/components/tiptap-renderer/index.d.ts.map +1 -0
  485. package/dist/components/tiptap-renderer/tiptap-renderer.d.ts +45 -0
  486. package/dist/components/tiptap-renderer/tiptap-renderer.d.ts.map +1 -0
  487. package/dist/components/tooltip/index.d.ts +7 -0
  488. package/dist/components/tooltip/index.d.ts.map +1 -0
  489. package/dist/components/tooltip/tooltip.d.ts +38 -0
  490. package/dist/components/tooltip/tooltip.d.ts.map +1 -0
  491. package/dist/components/virtual-list/index.d.ts +7 -0
  492. package/dist/components/virtual-list/index.d.ts.map +1 -0
  493. package/dist/components/virtual-list/virtual-list.d.ts +64 -0
  494. package/dist/components/virtual-list/virtual-list.d.ts.map +1 -0
  495. package/dist/core/accessibility/index.d.ts +96 -0
  496. package/dist/core/accessibility/index.d.ts.map +1 -0
  497. package/dist/core/accessibility/skip-link.d.ts +31 -0
  498. package/dist/core/accessibility/skip-link.d.ts.map +1 -0
  499. package/dist/core/context.d.ts +99 -0
  500. package/dist/core/context.d.ts.map +1 -0
  501. package/dist/core/hooks/use-boolean.d.ts +54 -0
  502. package/dist/core/hooks/use-boolean.d.ts.map +1 -0
  503. package/dist/core/hooks/use-breakpoints.d.ts +87 -0
  504. package/dist/core/hooks/use-breakpoints.d.ts.map +1 -0
  505. package/dist/core/hooks/use-click-outside.d.ts +26 -0
  506. package/dist/core/hooks/use-click-outside.d.ts.map +1 -0
  507. package/dist/core/hooks/use-copy-to-clipboard.d.ts +66 -0
  508. package/dist/core/hooks/use-copy-to-clipboard.d.ts.map +1 -0
  509. package/dist/core/hooks/use-countdown.d.ts +105 -0
  510. package/dist/core/hooks/use-countdown.d.ts.map +1 -0
  511. package/dist/core/hooks/use-debounce.d.ts +64 -0
  512. package/dist/core/hooks/use-debounce.d.ts.map +1 -0
  513. package/dist/core/hooks/use-event-listener.d.ts +37 -0
  514. package/dist/core/hooks/use-event-listener.d.ts.map +1 -0
  515. package/dist/core/hooks/use-interval.d.ts +30 -0
  516. package/dist/core/hooks/use-interval.d.ts.map +1 -0
  517. package/dist/core/hooks/use-is-client.d.ts +24 -0
  518. package/dist/core/hooks/use-is-client.d.ts.map +1 -0
  519. package/dist/core/hooks/use-local-storage.d.ts +61 -0
  520. package/dist/core/hooks/use-local-storage.d.ts.map +1 -0
  521. package/dist/core/hooks/use-media-query.d.ts +107 -0
  522. package/dist/core/hooks/use-media-query.d.ts.map +1 -0
  523. package/dist/core/hooks/use-mounted.d.ts +33 -0
  524. package/dist/core/hooks/use-mounted.d.ts.map +1 -0
  525. package/dist/core/hooks/use-multi-select.d.ts +113 -0
  526. package/dist/core/hooks/use-multi-select.d.ts.map +1 -0
  527. package/dist/core/hooks/use-previous.d.ts +23 -0
  528. package/dist/core/hooks/use-previous.d.ts.map +1 -0
  529. package/dist/core/hooks/use-set-state.d.ts +56 -0
  530. package/dist/core/hooks/use-set-state.d.ts.map +1 -0
  531. package/dist/core/hooks/use-tabs.d.ts +74 -0
  532. package/dist/core/hooks/use-tabs.d.ts.map +1 -0
  533. package/dist/core/hooks/use-timeout.d.ts +37 -0
  534. package/dist/core/hooks/use-timeout.d.ts.map +1 -0
  535. package/dist/core/index.d.ts +36 -468
  536. package/dist/core/index.d.ts.map +1 -0
  537. package/dist/core/index.js +6 -7
  538. package/dist/core/provider-stack.d.ts +181 -0
  539. package/dist/core/provider-stack.d.ts.map +1 -0
  540. package/dist/core/provider.d.ts +67 -0
  541. package/dist/core/provider.d.ts.map +1 -0
  542. package/dist/forms/index.d.ts +6 -557
  543. package/dist/forms/index.d.ts.map +1 -0
  544. package/dist/forms/index.js +0 -1
  545. package/dist/forms/index.js.map +1 -1
  546. package/dist/forms/schema-provider.d.ts +282 -0
  547. package/dist/forms/schema-provider.d.ts.map +1 -0
  548. package/dist/forms/schema-utils.d.ts +286 -0
  549. package/dist/forms/schema-utils.d.ts.map +1 -0
  550. package/dist/hooks/index.d.ts +38 -8
  551. package/dist/hooks/index.d.ts.map +1 -0
  552. package/dist/hooks/index.js +8 -9
  553. package/dist/hooks/use-array.d.ts +126 -0
  554. package/dist/hooks/use-array.d.ts.map +1 -0
  555. package/dist/hooks/use-async.d.ts +88 -0
  556. package/dist/hooks/use-async.d.ts.map +1 -0
  557. package/dist/hooks/use-back-to-top.d.ts +57 -0
  558. package/dist/hooks/use-back-to-top.d.ts.map +1 -0
  559. package/dist/hooks/use-client-rect.d.ts +67 -0
  560. package/dist/hooks/use-client-rect.d.ts.map +1 -0
  561. package/dist/hooks/use-config-from-query.d.ts +98 -0
  562. package/dist/hooks/use-config-from-query.d.ts.map +1 -0
  563. package/dist/hooks/use-cookies.d.ts +62 -0
  564. package/dist/hooks/use-cookies.d.ts.map +1 -0
  565. package/dist/hooks/use-countdown-date.d.ts +47 -0
  566. package/dist/hooks/use-countdown-date.d.ts.map +1 -0
  567. package/dist/hooks/use-countdown-seconds.d.ts +83 -0
  568. package/dist/hooks/use-countdown-seconds.d.ts.map +1 -0
  569. package/dist/hooks/use-double-click.d.ts +67 -0
  570. package/dist/hooks/use-double-click.d.ts.map +1 -0
  571. package/dist/hooks/use-focus-trap.d.ts +66 -0
  572. package/dist/hooks/use-focus-trap.d.ts.map +1 -0
  573. package/dist/hooks/use-image-dimensions.d.ts +124 -0
  574. package/dist/hooks/use-image-dimensions.d.ts.map +1 -0
  575. package/dist/hooks/use-infinite-scroll.d.ts +204 -0
  576. package/dist/hooks/use-infinite-scroll.d.ts.map +1 -0
  577. package/dist/hooks/use-intersection-observer.d.ts +93 -0
  578. package/dist/hooks/use-intersection-observer.d.ts.map +1 -0
  579. package/dist/hooks/use-isomorphic-layout-effect.d.ts +34 -0
  580. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
  581. package/dist/hooks/use-keyboard-shortcut.d.ts +112 -0
  582. package/dist/hooks/use-keyboard-shortcut.d.ts.map +1 -0
  583. package/dist/hooks/use-lazy-query.d.ts +132 -0
  584. package/dist/hooks/use-lazy-query.d.ts.map +1 -0
  585. package/dist/hooks/use-mutation.d.ts +141 -0
  586. package/dist/hooks/use-mutation.d.ts.map +1 -0
  587. package/dist/hooks/use-online-status.d.ts +56 -0
  588. package/dist/hooks/use-online-status.d.ts.map +1 -0
  589. package/dist/hooks/use-password-visibility.d.ts +83 -0
  590. package/dist/hooks/use-password-visibility.d.ts.map +1 -0
  591. package/dist/hooks/use-popover-hover.d.ts +78 -0
  592. package/dist/hooks/use-popover-hover.d.ts.map +1 -0
  593. package/dist/hooks/use-scroll-offset-top.d.ts +69 -0
  594. package/dist/hooks/use-scroll-offset-top.d.ts.map +1 -0
  595. package/dist/hooks/use-scroll-position.d.ts +96 -0
  596. package/dist/hooks/use-scroll-position.d.ts.map +1 -0
  597. package/dist/hooks/use-session-storage.d.ts +66 -0
  598. package/dist/hooks/use-session-storage.d.ts.map +1 -0
  599. package/dist/hooks/use-throttle.d.ts +67 -0
  600. package/dist/hooks/use-throttle.d.ts.map +1 -0
  601. package/dist/hooks/use-update-effect.d.ts +53 -0
  602. package/dist/hooks/use-update-effect.d.ts.map +1 -0
  603. package/dist/hooks/use-window-size.d.ts +132 -0
  604. package/dist/hooks/use-window-size.d.ts.map +1 -0
  605. package/dist/http/client.d.ts +74 -0
  606. package/dist/http/client.d.ts.map +1 -0
  607. package/dist/http/index.d.ts +6 -229
  608. package/dist/http/index.d.ts.map +1 -0
  609. package/dist/http/index.js +0 -2
  610. package/dist/http/index.js.map +1 -1
  611. package/dist/http/types.d.ts +158 -0
  612. package/dist/http/types.d.ts.map +1 -0
  613. package/dist/index.d.ts +19 -2758
  614. package/dist/index.d.ts.map +1 -0
  615. package/dist/index.js +35 -63
  616. package/dist/index.js.map +1 -1
  617. package/dist/layouts/auth/centered.d.ts +49 -0
  618. package/dist/layouts/auth/centered.d.ts.map +1 -0
  619. package/dist/layouts/auth/index.d.ts +12 -0
  620. package/dist/layouts/auth/index.d.ts.map +1 -0
  621. package/dist/layouts/auth/simple.d.ts +58 -0
  622. package/dist/layouts/auth/simple.d.ts.map +1 -0
  623. package/dist/layouts/auth/split.d.ts +81 -0
  624. package/dist/layouts/auth/split.d.ts.map +1 -0
  625. package/dist/layouts/core/context.d.ts +102 -0
  626. package/dist/layouts/core/context.d.ts.map +1 -0
  627. package/dist/layouts/core/css-vars.d.ts +43 -0
  628. package/dist/layouts/core/css-vars.d.ts.map +1 -0
  629. package/dist/layouts/core/header-section.d.ts +79 -0
  630. package/dist/layouts/core/header-section.d.ts.map +1 -0
  631. package/dist/layouts/core/index.d.ts +18 -0
  632. package/dist/layouts/core/index.d.ts.map +1 -0
  633. package/dist/layouts/core/layout-section.d.ts +64 -0
  634. package/dist/layouts/core/layout-section.d.ts.map +1 -0
  635. package/dist/layouts/core/user-menu.d.ts +88 -0
  636. package/dist/layouts/core/user-menu.d.ts.map +1 -0
  637. package/dist/layouts/dashboard/index.d.ts +10 -0
  638. package/dist/layouts/dashboard/index.d.ts.map +1 -0
  639. package/dist/layouts/dashboard/layout.d.ts +90 -0
  640. package/dist/layouts/dashboard/layout.d.ts.map +1 -0
  641. package/dist/layouts/dashboard/sidenav.d.ts +58 -0
  642. package/dist/layouts/dashboard/sidenav.d.ts.map +1 -0
  643. package/dist/layouts/dashboard/topnav.d.ts +41 -0
  644. package/dist/layouts/dashboard/topnav.d.ts.map +1 -0
  645. package/dist/layouts/index.d.ts +27 -850
  646. package/dist/layouts/index.d.ts.map +1 -0
  647. package/dist/layouts/index.js +3 -4
  648. package/dist/layouts/types.d.ts +317 -0
  649. package/dist/layouts/types.d.ts.map +1 -0
  650. package/dist/netron/context.d.ts +18 -0
  651. package/dist/netron/context.d.ts.map +1 -0
  652. package/dist/netron/hooks.d.ts +10 -0
  653. package/dist/netron/hooks.d.ts.map +1 -0
  654. package/dist/netron/index.d.ts +47 -4
  655. package/dist/netron/index.d.ts.map +1 -0
  656. package/dist/netron/index.js +1 -2
  657. package/dist/netron/types.d.ts +12 -0
  658. package/dist/netron/types.d.ts.map +1 -0
  659. package/dist/registry/index.d.ts +8 -341
  660. package/dist/registry/index.d.ts.map +1 -0
  661. package/dist/registry/index.js +1 -2
  662. package/dist/registry/installer.d.ts +137 -0
  663. package/dist/registry/installer.d.ts.map +1 -0
  664. package/dist/registry/manager.d.ts +196 -0
  665. package/dist/registry/manager.d.ts.map +1 -0
  666. package/dist/state/create-store.d.ts +164 -0
  667. package/dist/state/create-store.d.ts.map +1 -0
  668. package/dist/state/index.d.ts +12 -969
  669. package/dist/state/index.d.ts.map +1 -0
  670. package/dist/state/index.js +2 -3
  671. package/dist/state/settings-version.d.ts +255 -0
  672. package/dist/state/settings-version.d.ts.map +1 -0
  673. package/dist/state/stores/auth.d.ts +155 -0
  674. package/dist/state/stores/auth.d.ts.map +1 -0
  675. package/dist/state/stores/index.d.ts +10 -0
  676. package/dist/state/stores/index.d.ts.map +1 -0
  677. package/dist/state/stores/settings.d.ts +151 -0
  678. package/dist/state/stores/settings.d.ts.map +1 -0
  679. package/dist/state/stores/theme.d.ts +87 -0
  680. package/dist/state/stores/theme.d.ts.map +1 -0
  681. package/dist/state/stores/ui.d.ts +204 -0
  682. package/dist/state/stores/ui.d.ts.map +1 -0
  683. package/dist/theme/colors/base.d.ts +61 -0
  684. package/dist/theme/colors/base.d.ts.map +1 -0
  685. package/dist/theme/colors/index.d.ts +10 -0
  686. package/dist/theme/colors/index.d.ts.map +1 -0
  687. package/dist/theme/colors/luxury.d.ts +49 -0
  688. package/dist/theme/colors/luxury.d.ts.map +1 -0
  689. package/dist/theme/components/Autocomplete.d.ts +9 -0
  690. package/dist/theme/components/Autocomplete.d.ts.map +1 -0
  691. package/dist/theme/components/Button.d.ts +33 -0
  692. package/dist/theme/components/Button.d.ts.map +1 -0
  693. package/dist/theme/components/Card.d.ts +20 -0
  694. package/dist/theme/components/Card.d.ts.map +1 -0
  695. package/dist/theme/components/Chip.d.ts +29 -0
  696. package/dist/theme/components/Chip.d.ts.map +1 -0
  697. package/dist/theme/components/DataGrid.d.ts +15 -0
  698. package/dist/theme/components/DataGrid.d.ts.map +1 -0
  699. package/dist/theme/components/DatePicker.d.ts +19 -0
  700. package/dist/theme/components/DatePicker.d.ts.map +1 -0
  701. package/dist/theme/components/Dialog.d.ts +23 -0
  702. package/dist/theme/components/Dialog.d.ts.map +1 -0
  703. package/dist/theme/components/FormControls.d.ts +53 -0
  704. package/dist/theme/components/FormControls.d.ts.map +1 -0
  705. package/dist/theme/components/Tabs.d.ts +21 -0
  706. package/dist/theme/components/Tabs.d.ts.map +1 -0
  707. package/dist/theme/components/TextField.d.ts +87 -0
  708. package/dist/theme/components/TextField.d.ts.map +1 -0
  709. package/dist/theme/components/index.d.ts +27 -0
  710. package/dist/theme/components/index.d.ts.map +1 -0
  711. package/dist/theme/components/theme-utils.d.ts +42 -0
  712. package/dist/theme/components/theme-utils.d.ts.map +1 -0
  713. package/dist/theme/create-theme.d.ts +131 -0
  714. package/dist/theme/create-theme.d.ts.map +1 -0
  715. package/dist/theme/css-variables.d.ts +42 -0
  716. package/dist/theme/css-variables.d.ts.map +1 -0
  717. package/dist/theme/custom-shadows.d.ts +58 -0
  718. package/dist/theme/custom-shadows.d.ts.map +1 -0
  719. package/dist/theme/index.d.ts +23 -1045
  720. package/dist/theme/index.d.ts.map +1 -0
  721. package/dist/theme/index.js +2 -3
  722. package/dist/theme/mixins.d.ts +332 -0
  723. package/dist/theme/mixins.d.ts.map +1 -0
  724. package/dist/theme/opacity.d.ts +51 -0
  725. package/dist/theme/opacity.d.ts.map +1 -0
  726. package/dist/theme/palette/builder.d.ts +138 -0
  727. package/dist/theme/palette/builder.d.ts.map +1 -0
  728. package/dist/theme/palette/index.d.ts +7 -0
  729. package/dist/theme/palette/index.d.ts.map +1 -0
  730. package/dist/theme/palette.d.ts +43 -0
  731. package/dist/theme/palette.d.ts.map +1 -0
  732. package/dist/theme/presets/arctic.d.ts +13 -0
  733. package/dist/theme/presets/arctic.d.ts.map +1 -0
  734. package/dist/theme/presets/default.d.ts +13 -0
  735. package/dist/theme/presets/default.d.ts.map +1 -0
  736. package/dist/theme/presets/dracula.d.ts +27 -0
  737. package/dist/theme/presets/dracula.d.ts.map +1 -0
  738. package/dist/theme/presets/ember.d.ts +23 -0
  739. package/dist/theme/presets/ember.d.ts.map +1 -0
  740. package/dist/theme/presets/index.d.ts +39 -0
  741. package/dist/theme/presets/index.d.ts.map +1 -0
  742. package/dist/theme/presets/luxury.d.ts +13 -0
  743. package/dist/theme/presets/luxury.d.ts.map +1 -0
  744. package/dist/theme/presets/midnight.d.ts +23 -0
  745. package/dist/theme/presets/midnight.d.ts.map +1 -0
  746. package/dist/theme/presets/minimal.d.ts +23 -0
  747. package/dist/theme/presets/minimal.d.ts.map +1 -0
  748. package/dist/theme/presets/nature.d.ts +14 -0
  749. package/dist/theme/presets/nature.d.ts.map +1 -0
  750. package/dist/theme/presets/retro.d.ts +23 -0
  751. package/dist/theme/presets/retro.d.ts.map +1 -0
  752. package/dist/theme/shadows.d.ts +61 -0
  753. package/dist/theme/shadows.d.ts.map +1 -0
  754. package/dist/theme/typography.d.ts +24 -0
  755. package/dist/theme/typography.d.ts.map +1 -0
  756. package/dist/theme/utils/color.d.ts +295 -0
  757. package/dist/theme/utils/color.d.ts.map +1 -0
  758. package/dist/theme/utils/index.d.ts +7 -0
  759. package/dist/theme/utils/index.d.ts.map +1 -0
  760. package/dist/{registry-DQcIzW2s.d.ts → types/blocks.d.ts} +30 -191
  761. package/dist/types/blocks.d.ts.map +1 -0
  762. package/dist/{components-BCGZ-Rwt.d.ts → types/components.d.ts} +17 -20
  763. package/dist/types/components.d.ts.map +1 -0
  764. package/dist/{config-Pct0n_Kq.d.ts → types/config.d.ts} +14 -16
  765. package/dist/types/config.d.ts.map +1 -0
  766. package/dist/types/index.d.ts +13 -7
  767. package/dist/types/index.d.ts.map +1 -0
  768. package/dist/types/index.js +1 -2
  769. package/dist/types/registry.d.ts +158 -0
  770. package/dist/types/registry.d.ts.map +1 -0
  771. package/dist/{theme-B4Q3Bg5o.d.ts → types/theme.d.ts} +31 -34
  772. package/dist/types/theme.d.ts.map +1 -0
  773. package/dist/utils/async-lock.d.ts +169 -0
  774. package/dist/utils/async-lock.d.ts.map +1 -0
  775. package/dist/utils/cn.d.ts +80 -0
  776. package/dist/utils/cn.d.ts.map +1 -0
  777. package/dist/utils/cookies.d.ts +68 -0
  778. package/dist/utils/cookies.d.ts.map +1 -0
  779. package/dist/utils/create-classes.d.ts +90 -0
  780. package/dist/utils/create-classes.d.ts.map +1 -0
  781. package/dist/utils/errors.d.ts +201 -0
  782. package/dist/utils/errors.d.ts.map +1 -0
  783. package/dist/utils/fetch-interceptor.d.ts +230 -0
  784. package/dist/utils/fetch-interceptor.d.ts.map +1 -0
  785. package/dist/utils/font.d.ts +65 -0
  786. package/dist/utils/font.d.ts.map +1 -0
  787. package/dist/utils/format-crypto.d.ts +312 -0
  788. package/dist/utils/format-crypto.d.ts.map +1 -0
  789. package/dist/utils/format-date.d.ts +240 -0
  790. package/dist/utils/format-date.d.ts.map +1 -0
  791. package/dist/utils/format-number.d.ts +245 -0
  792. package/dist/utils/format-number.d.ts.map +1 -0
  793. package/dist/utils/i18n-text.d.ts +68 -0
  794. package/dist/utils/i18n-text.d.ts.map +1 -0
  795. package/dist/utils/index.d.ts +30 -0
  796. package/dist/utils/index.d.ts.map +1 -0
  797. package/dist/utils/jwt.d.ts +227 -0
  798. package/dist/utils/jwt.d.ts.map +1 -0
  799. package/dist/utils/object.d.ts +96 -0
  800. package/dist/utils/object.d.ts.map +1 -0
  801. package/dist/utils/refs.d.ts +60 -0
  802. package/dist/utils/refs.d.ts.map +1 -0
  803. package/dist/utils/rtl.d.ts +75 -0
  804. package/dist/utils/rtl.d.ts.map +1 -0
  805. package/dist/utils/storage.d.ts +190 -0
  806. package/dist/utils/storage.d.ts.map +1 -0
  807. package/dist/utils/string.d.ts +216 -0
  808. package/dist/utils/string.d.ts.map +1 -0
  809. package/dist/utils/template-resolver.d.ts +12 -0
  810. package/dist/utils/template-resolver.d.ts.map +1 -0
  811. package/dist/utils/toast.d.ts +25 -0
  812. package/dist/utils/toast.d.ts.map +1 -0
  813. package/dist/utils/transform-number.d.ts +108 -0
  814. package/dist/utils/transform-number.d.ts.map +1 -0
  815. package/dist/utils/url.d.ts +198 -0
  816. package/dist/utils/url.d.ts.map +1 -0
  817. package/package.json +69 -59
  818. package/dist/chunk-2FYNRDXR.js.map +0 -1
  819. package/dist/chunk-77KIJLPP.js +0 -37
  820. package/dist/chunk-77KIJLPP.js.map +0 -1
  821. package/dist/chunk-A2Z7NVGL.js.map +0 -1
  822. package/dist/chunk-BV32OJ2A.js.map +0 -1
  823. package/dist/chunk-DDY7TLUI.js.map +0 -1
  824. package/dist/chunk-HO2GKTWJ.js.map +0 -1
  825. package/dist/chunk-IZOIO7PA.js.map +0 -1
  826. package/dist/chunk-JDTC2SBY.js.map +0 -1
  827. package/dist/chunk-KTCWPGON.js.map +0 -1
  828. package/dist/chunk-MEFT6XPH.js.map +0 -1
  829. package/dist/chunk-SNKGGHBT.js.map +0 -1
  830. package/dist/chunk-VAAIHNWQ.js.map +0 -1
  831. package/dist/chunk-XQXGE2PW.js +0 -16793
  832. package/dist/chunk-XQXGE2PW.js.map +0 -1
  833. package/dist/chunk-XWL6J6IO.js.map +0 -1
  834. package/dist/chunk-XXP3ZGU6.js.map +0 -1
  835. package/dist/chunk-YJMAQL3S.js.map +0 -1
  836. package/dist/index-nmJ8Muwg.d.ts +0 -2368
  837. package/dist/settings-CAC0qFjS.d.ts +0 -455
  838. package/dist/text-transform-D6MzzF7V.d.ts +0 -165
  839. package/dist/use-timeout-D7U3EAtH.d.ts +0 -808
@@ -1,2368 +0,0 @@
1
- import { q as ThemePreset, o as ThemeMode, n as ThemeDirection, f as ComponentDensity } from './theme-B4Q3Bg5o.js';
2
- import './use-timeout-D7U3EAtH.js';
3
- import '@mui/material';
4
- import { RefObject, Dispatch, SetStateAction, SyntheticEvent, MouseEvent, EffectCallback, DependencyList, useEffect } from 'react';
5
- import './popover-Dmw7SJLR.js';
6
-
7
- /**
8
- * Cookie Utilities
9
- *
10
- * Type-safe cookie management with JSON serialization.
11
- *
12
- * @module @omnitron-dev/prism/utils
13
- */
14
- /**
15
- * Cookie options for setting cookies.
16
- */
17
- interface CookieOptions {
18
- /** Enable secure flag (HTTPS only) */
19
- secure?: boolean;
20
- /** Days until expiration */
21
- daysUntilExpiration?: number;
22
- /** SameSite policy */
23
- sameSite?: 'strict' | 'lax' | 'none';
24
- /** Cookie domain */
25
- domain?: string;
26
- /** Cookie path */
27
- path?: string;
28
- }
29
- /**
30
- * Check if cookies are available.
31
- *
32
- * @returns {boolean} True if cookies are available
33
- */
34
- declare function cookiesAvailable(): boolean;
35
- /**
36
- * Get a cookie value with JSON parsing.
37
- *
38
- * @template T - Type of the stored value
39
- * @param {string} key - Cookie name
40
- * @returns {T | null} Parsed value or null
41
- *
42
- * @example
43
- * ```ts
44
- * const user = getCookie<User>('user');
45
- * ```
46
- */
47
- declare function getCookie<T>(key: string): T | null;
48
- /**
49
- * Set a cookie with JSON serialization.
50
- *
51
- * @template T - Type of the value
52
- * @param {string} key - Cookie name
53
- * @param {T} value - Value to store
54
- * @param {CookieOptions} [options] - Cookie options
55
- *
56
- * @example
57
- * ```ts
58
- * setCookie('user', { name: 'John' }, { daysUntilExpiration: 7 });
59
- * ```
60
- */
61
- declare function setCookie<T>(key: string, value: T, options?: CookieOptions): void;
62
- /**
63
- * Remove a cookie.
64
- *
65
- * @param {string} key - Cookie name
66
- * @param {Pick<CookieOptions, 'domain' | 'path'>} [options] - Cookie options
67
- *
68
- * @example
69
- * ```ts
70
- * removeCookie('user');
71
- * ```
72
- */
73
- declare function removeCookie(key: string, options?: Pick<CookieOptions, 'domain' | 'path'>): void;
74
-
75
- /**
76
- * Async state.
77
- */
78
- interface AsyncState<T> {
79
- /** Data result */
80
- data: T | null;
81
- /** Loading state */
82
- loading: boolean;
83
- /** Error state */
84
- error: Error | null;
85
- }
86
- /**
87
- * Return type for useAsync hook.
88
- */
89
- interface UseAsyncReturn<T, Args extends unknown[]> extends AsyncState<T> {
90
- /** Execute the async function */
91
- execute: (...args: Args) => Promise<T>;
92
- /** Reset state */
93
- reset: () => void;
94
- /** Set data manually */
95
- setData: (data: T | null) => void;
96
- /** Set error manually */
97
- setError: (error: Error | null) => void;
98
- }
99
- /**
100
- * Options for useAsync hook.
101
- */
102
- interface UseAsyncOptions<T> {
103
- /** Initial data */
104
- initialData?: T | null;
105
- /** Auto-execute on mount */
106
- immediate?: boolean;
107
- /** On success callback */
108
- onSuccess?: (data: T) => void;
109
- /** On error callback */
110
- onError?: (error: Error) => void;
111
- }
112
- /**
113
- * useAsync - Hook for managing async operations.
114
- *
115
- * @example
116
- * ```tsx
117
- * // Basic usage
118
- * const { data, loading, error, execute } = useAsync(fetchUser);
119
- *
120
- * // Auto-execute on mount
121
- * const { data, loading } = useAsync(fetchUsers, { immediate: true });
122
- *
123
- * // With callbacks
124
- * const { execute } = useAsync(createUser, {
125
- * onSuccess: (user) => toast.success(`Created ${user.name}`),
126
- * onError: (err) => toast.error(err.message),
127
- * });
128
- *
129
- * // In a component
130
- * const handleSubmit = async () => {
131
- * const result = await execute(formData);
132
- * if (result) navigate('/success');
133
- * };
134
- * ```
135
- */
136
- declare function useAsync<T, Args extends unknown[] = []>(asyncFn: (...args: Args) => Promise<T>, options?: UseAsyncOptions<T>): UseAsyncReturn<T, Args>;
137
- /**
138
- * Return type for useAsyncFn hook (simpler version).
139
- */
140
- interface UseAsyncFnReturn<T, Args extends unknown[]> {
141
- /** Execute the async function */
142
- execute: (...args: Args) => Promise<T | undefined>;
143
- /** Loading state */
144
- loading: boolean;
145
- /** Error state */
146
- error: Error | null;
147
- }
148
- /**
149
- * useAsyncFn - Simpler hook for async functions without data tracking.
150
- *
151
- * @example
152
- * ```tsx
153
- * const { execute, loading, error } = useAsyncFn(deleteUser);
154
- *
155
- * const handleDelete = async (id: string) => {
156
- * await execute(id);
157
- * refetch(); // Trigger parent refresh
158
- * };
159
- * ```
160
- */
161
- declare function useAsyncFn<T, Args extends unknown[] = []>(asyncFn: (...args: Args) => Promise<T>): UseAsyncFnReturn<T, Args>;
162
-
163
- /**
164
- * Scroll position data.
165
- */
166
- interface ScrollPosition {
167
- /** Scroll position from top */
168
- x: number;
169
- /** Scroll position from left */
170
- y: number;
171
- /** Scroll direction (1 = down/right, -1 = up/left, 0 = initial) */
172
- directionX: -1 | 0 | 1;
173
- directionY: -1 | 0 | 1;
174
- /** Whether scrolled past threshold */
175
- isScrolled: boolean;
176
- /** Whether at the top */
177
- isAtTop: boolean;
178
- /** Whether at the bottom */
179
- isAtBottom: boolean;
180
- }
181
- /**
182
- * Options for useScrollPosition hook.
183
- */
184
- interface UseScrollPositionOptions {
185
- /** Element to track (default: window) */
186
- element?: HTMLElement | null;
187
- /** Throttle delay in ms (default: 100) */
188
- throttle?: number;
189
- /** Threshold to consider "scrolled" (default: 0) */
190
- threshold?: number;
191
- /** Offset from bottom to consider "at bottom" (default: 10) */
192
- bottomOffset?: number;
193
- }
194
- /**
195
- * useScrollPosition - Hook for tracking scroll position.
196
- *
197
- * @example
198
- * ```tsx
199
- * // Track window scroll
200
- * const { y, isScrolled, directionY } = useScrollPosition();
201
- *
202
- * // Show header shadow when scrolled
203
- * <Header className={isScrolled ? 'shadow' : ''} />
204
- *
205
- * // Hide header on scroll down, show on scroll up
206
- * const showHeader = directionY !== 1 || y < 50;
207
- *
208
- * // Track specific element
209
- * const containerRef = useRef<HTMLDivElement>(null);
210
- * const { isAtBottom } = useScrollPosition({ element: containerRef.current });
211
- *
212
- * // Load more when near bottom
213
- * useEffect(() => {
214
- * if (isAtBottom) loadMore();
215
- * }, [isAtBottom]);
216
- * ```
217
- */
218
- declare function useScrollPosition(options?: UseScrollPositionOptions): ScrollPosition;
219
- /**
220
- * useScrollToTop - Hook for scrolling to top functionality.
221
- *
222
- * @example
223
- * ```tsx
224
- * const { scrollToTop, showButton } = useScrollToTop({ threshold: 300 });
225
- *
226
- * {showButton && (
227
- * <Fab onClick={scrollToTop}>
228
- * <ArrowUpIcon />
229
- * </Fab>
230
- * )}
231
- * ```
232
- */
233
- declare function useScrollToTop(options?: {
234
- threshold?: number;
235
- }): {
236
- scrollToTop: () => void;
237
- showButton: boolean;
238
- };
239
- /**
240
- * useScrollLock - Hook for locking body scroll.
241
- *
242
- * @example
243
- * ```tsx
244
- * const { lock, unlock, isLocked } = useScrollLock();
245
- *
246
- * // Lock when modal opens
247
- * useEffect(() => {
248
- * if (isOpen) lock();
249
- * else unlock();
250
- * }, [isOpen]);
251
- * ```
252
- */
253
- declare function useScrollLock(): {
254
- lock: () => void;
255
- unlock: () => void;
256
- isLocked: boolean;
257
- };
258
-
259
- /**
260
- * Window size data.
261
- */
262
- interface WindowSize {
263
- /** Window width */
264
- width: number;
265
- /** Window height */
266
- height: number;
267
- /** Is mobile (< 600px) */
268
- isMobile: boolean;
269
- /** Is tablet (600px - 960px) */
270
- isTablet: boolean;
271
- /** Is desktop (>= 960px) */
272
- isDesktop: boolean;
273
- /** Is large desktop (>= 1280px) */
274
- isLargeDesktop: boolean;
275
- }
276
- /**
277
- * Breakpoint definitions (following MUI defaults).
278
- */
279
- interface Breakpoints {
280
- xs: number;
281
- sm: number;
282
- md: number;
283
- lg: number;
284
- xl: number;
285
- }
286
- /**
287
- * Options for useWindowSize hook.
288
- */
289
- interface UseWindowSizeOptions {
290
- /** Custom breakpoints */
291
- breakpoints?: Partial<Breakpoints>;
292
- /** Debounce delay in ms (default: 100) */
293
- debounce?: number;
294
- /** Initial width for SSR (default: 1200) */
295
- initialWidth?: number;
296
- /** Initial height for SSR (default: 800) */
297
- initialHeight?: number;
298
- }
299
- /**
300
- * useWindowSize - Hook for tracking window dimensions.
301
- *
302
- * @example
303
- * ```tsx
304
- * // Basic usage
305
- * const { width, height, isMobile, isDesktop } = useWindowSize();
306
- *
307
- * // Responsive rendering
308
- * if (isMobile) {
309
- * return <MobileLayout />;
310
- * }
311
- * return <DesktopLayout />;
312
- *
313
- * // Responsive columns
314
- * const columns = isMobile ? 1 : isTablet ? 2 : 4;
315
- *
316
- * // Custom breakpoints
317
- * const { isMobile } = useWindowSize({
318
- * breakpoints: { sm: 768 }
319
- * });
320
- * ```
321
- */
322
- declare function useWindowSize(options?: UseWindowSizeOptions): WindowSize;
323
- /**
324
- * Return type for useResponsiveQuery hook.
325
- */
326
- type UseResponsiveQueryReturn = boolean;
327
- /**
328
- * useResponsiveQuery - Hook for CSS media query matching.
329
- *
330
- * Note: For the simpler MUI-style useMediaQuery, see @omnitron-dev/prism/core.
331
- * This hook provides a standalone implementation without MUI dependency.
332
- *
333
- * @example
334
- * ```tsx
335
- * // Direct media query
336
- * const prefersDark = useResponsiveQuery('(prefers-color-scheme: dark)');
337
- * const isRetina = useResponsiveQuery('(min-resolution: 2dppx)');
338
- *
339
- * // Responsive
340
- * const isLargeScreen = useResponsiveQuery('(min-width: 1200px)');
341
- * ```
342
- */
343
- declare function useResponsiveQuery(query: string): UseResponsiveQueryReturn;
344
- /**
345
- * useBreakpoint - Hook for checking current breakpoint.
346
- *
347
- * @example
348
- * ```tsx
349
- * const breakpoint = useBreakpoint();
350
- *
351
- * // Current breakpoint name
352
- * console.log(breakpoint); // 'md'
353
- *
354
- * // Check specific breakpoint
355
- * const { isUp, isDown, isOnly, isBetween } = useBreakpointChecks();
356
- *
357
- * if (isUp('md')) {
358
- * // Screen is md or larger
359
- * }
360
- * ```
361
- */
362
- declare function useBreakpoint(customBreakpoints?: Partial<Breakpoints>): 'xs' | 'sm' | 'md' | 'lg' | 'xl';
363
- /**
364
- * Return type for useBreakpointChecks hook.
365
- */
366
- interface BreakpointChecks {
367
- /** Check if width is >= breakpoint */
368
- isUp: (breakpoint: keyof Breakpoints) => boolean;
369
- /** Check if width is < breakpoint */
370
- isDown: (breakpoint: keyof Breakpoints) => boolean;
371
- /** Check if width is within breakpoint range */
372
- isOnly: (breakpoint: keyof Breakpoints) => boolean;
373
- /** Check if width is between two breakpoints */
374
- isBetween: (start: keyof Breakpoints, end: keyof Breakpoints) => boolean;
375
- }
376
- /**
377
- * useBreakpointChecks - Hook for advanced breakpoint checking.
378
- *
379
- * @example
380
- * ```tsx
381
- * const { isUp, isDown, isOnly, isBetween } = useBreakpointChecks();
382
- *
383
- * isUp('md'); // true if >= 900px
384
- * isDown('lg'); // true if < 1200px
385
- * isOnly('md'); // true if 900px - 1199px
386
- * isBetween('sm', 'lg'); // true if 600px - 1199px
387
- * ```
388
- */
389
- declare function useBreakpointChecks(customBreakpoints?: Partial<Breakpoints>): BreakpointChecks;
390
-
391
- /**
392
- * useClientRect Hook
393
- *
394
- * Gets bounding client rect and scroll dimensions of a DOM element.
395
- * SSR-safe with automatic updates on resize/scroll.
396
- *
397
- * @module @omnitron-dev/prism/hooks
398
- */
399
-
400
- /**
401
- * Scroll element dimensions.
402
- */
403
- interface ScrollElValue {
404
- /** Scrollable width */
405
- scrollWidth: number;
406
- /** Scrollable height */
407
- scrollHeight: number;
408
- }
409
- /**
410
- * DOMRect values (SSR-safe).
411
- */
412
- interface DOMRectValue {
413
- top: number;
414
- right: number;
415
- bottom: number;
416
- left: number;
417
- x: number;
418
- y: number;
419
- width: number;
420
- height: number;
421
- }
422
- /**
423
- * Return type for useClientRect hook.
424
- */
425
- interface UseClientRectReturn<T extends HTMLElement = HTMLElement> extends DOMRectValue, ScrollElValue {
426
- /** Ref to attach to the target element */
427
- elementRef: RefObject<T | null>;
428
- /** Force update measurements */
429
- update: () => void;
430
- }
431
- /**
432
- * useClientRect - Hook to get bounding rect and scroll dimensions.
433
- *
434
- * @example
435
- * ```tsx
436
- * // Basic usage - auto-creates ref
437
- * const { elementRef, width, height, top, left } = useClientRect();
438
- *
439
- * return (
440
- * <div ref={elementRef}>
441
- * Width: {width}, Height: {height}
442
- * </div>
443
- * );
444
- *
445
- * // With existing ref
446
- * const myRef = useRef<HTMLDivElement>(null);
447
- * const { width, scrollWidth } = useClientRect(myRef);
448
- *
449
- * // Listen to scroll events
450
- * const { y, scrollHeight } = useClientRect(ref, 'scroll');
451
- *
452
- * // Calculate scroll progress
453
- * const progress = y / (scrollHeight - height);
454
- * ```
455
- */
456
- declare function useClientRect<T extends HTMLElement = HTMLElement>(inputRef?: RefObject<T | null>, eventType?: 'scroll' | 'resize'): UseClientRectReturn<T>;
457
-
458
- /**
459
- * usePopoverHover Hook
460
- *
461
- * Manages hover-based popover state with proper enter/leave handling.
462
- * Different from click-based popovers - opens on mouse enter, closes on leave.
463
- *
464
- * @module @omnitron-dev/prism/hooks
465
- */
466
-
467
- /**
468
- * Return type for usePopoverHover hook.
469
- */
470
- interface UsePopoverHoverReturn<T extends HTMLElement = HTMLElement> {
471
- /** Whether the popover is open */
472
- open: boolean;
473
- /** The element the popover is anchored to (for MUI Popover) */
474
- anchorEl: T | null;
475
- /** Handler for mouse enter - opens the popover */
476
- onOpen: () => void;
477
- /** Handler for mouse leave - closes the popover */
478
- onClose: () => void;
479
- /** Ref to attach to the trigger element */
480
- elementRef: RefObject<T | null>;
481
- /** Manual control of open state */
482
- setOpen: Dispatch<SetStateAction<boolean>>;
483
- }
484
- /**
485
- * usePopoverHover - Hook for hover-based popover management.
486
- *
487
- * This hook is SSR-safe. It doesn't access browser APIs directly.
488
- * During SSR, elementRef.current is null and open defaults to false,
489
- * so anchorEl will always be null on the server.
490
- *
491
- * @example
492
- * ```tsx
493
- * // Basic usage
494
- * const { open, anchorEl, onOpen, onClose, elementRef } = usePopoverHover<HTMLButtonElement>();
495
- *
496
- * return (
497
- * <>
498
- * <Button
499
- * ref={elementRef}
500
- * onMouseEnter={onOpen}
501
- * onMouseLeave={onClose}
502
- * >
503
- * Hover me
504
- * </Button>
505
- * <Popover
506
- * open={open}
507
- * anchorEl={anchorEl}
508
- * onClose={onClose}
509
- * anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
510
- * >
511
- * <Typography sx={{ p: 2 }}>Popover content</Typography>
512
- * </Popover>
513
- * </>
514
- * );
515
- *
516
- * // With existing ref
517
- * const myRef = useRef<HTMLDivElement>(null);
518
- * const { open, onOpen, onClose } = usePopoverHover(myRef);
519
- *
520
- * // With delay (using inline)
521
- * const { open, anchorEl, elementRef, setOpen } = usePopoverHover();
522
- * const timeoutRef = useRef<NodeJS.Timeout>();
523
- *
524
- * const handleOpen = () => {
525
- * clearTimeout(timeoutRef.current);
526
- * setOpen(true);
527
- * };
528
- *
529
- * const handleClose = () => {
530
- * timeoutRef.current = setTimeout(() => setOpen(false), 200);
531
- * };
532
- * ```
533
- */
534
- declare function usePopoverHover<T extends HTMLElement = HTMLElement>(inputRef?: RefObject<T | null>): UsePopoverHoverReturn<T>;
535
-
536
- /**
537
- * Options for useCookies hook.
538
- */
539
- interface UseCookiesOptions extends CookieOptions {
540
- /**
541
- * If true, initializes the cookie with the initial value if not set.
542
- * @default true
543
- */
544
- initializeWithValue?: boolean;
545
- }
546
- /**
547
- * Return type for useCookies hook.
548
- */
549
- interface UseCookiesReturn<T> {
550
- /** Current state value */
551
- state: T;
552
- /** Reset state to initial value and remove cookie */
553
- resetState: (defaultState?: T) => void;
554
- /** Update the entire state or merge partial state (for objects) */
555
- setState: (updateState: T | Partial<T>) => void;
556
- /** Update a specific field in an object state */
557
- setField: <K extends keyof T>(name: K, updateValue: T[K]) => void;
558
- }
559
- /**
560
- * Hook to manage state with cookies.
561
- *
562
- * Automatically syncs state with cookies and supports:
563
- * - Primitive values (string, number, boolean)
564
- * - Object values with partial updates
565
- * - Type-safe field updates
566
- *
567
- * @template T - Type of the state value
568
- * @param key - Cookie name
569
- * @param initialState - Initial state value
570
- * @param options - Cookie options
571
- * @returns State and update functions
572
- *
573
- * @example
574
- * ```tsx
575
- * // Primitive value
576
- * const { state, setState, resetState } = useCookies('theme', 'light');
577
- *
578
- * // Object value with partial updates
579
- * const { state, setState, setField, resetState } = useCookies('user', {
580
- * name: '',
581
- * age: 0,
582
- * preferences: { notifications: true },
583
- * });
584
- *
585
- * // Update single field
586
- * setField('name', 'John');
587
- *
588
- * // Partial update
589
- * setState({ age: 25 });
590
- *
591
- * // Reset to initial value
592
- * resetState();
593
- * ```
594
- */
595
- declare function useCookies<T>(key: string, initialState: T, options?: UseCookiesOptions): UseCookiesReturn<T>;
596
-
597
- /**
598
- * useDoubleClick Hook
599
- *
600
- * Differentiates between single and double click events.
601
- * Single click is delayed to ensure it's not a double click.
602
- *
603
- * @module @omnitron-dev/prism/hooks
604
- */
605
-
606
- /**
607
- * Props for useDoubleClick hook.
608
- */
609
- interface UseDoubleClickProps {
610
- /**
611
- * Timeout in milliseconds to differentiate between single and double clicks.
612
- * @default 250
613
- */
614
- timeout?: number;
615
- /** Handler for single click (optional) */
616
- click?: (event: SyntheticEvent) => void;
617
- /** Handler for double click (required) */
618
- doubleClick: (event: SyntheticEvent) => void;
619
- }
620
- /**
621
- * Return type - a click handler function.
622
- */
623
- type UseDoubleClickReturn = (event: MouseEvent<HTMLElement>) => void;
624
- /**
625
- * Hook to handle single and double click events on an element.
626
- *
627
- * Uses event.detail to detect click count:
628
- * - detail === 1: single click (delayed by timeout)
629
- * - detail === 2: double click (immediate)
630
- *
631
- * The single click handler is called after a timeout, but only if
632
- * no second click occurs within that time.
633
- *
634
- * @param props - Hook configuration
635
- * @returns Click handler function to attach to element
636
- *
637
- * @example
638
- * ```tsx
639
- * function FileItem({ file }) {
640
- * const handleClick = useDoubleClick({
641
- * click: () => selectFile(file),
642
- * doubleClick: () => openFile(file),
643
- * timeout: 300,
644
- * });
645
- *
646
- * return (
647
- * <div onClick={handleClick}>
648
- * {file.name}
649
- * </div>
650
- * );
651
- * }
652
- * ```
653
- *
654
- * @example
655
- * ```tsx
656
- * // Double-click only (no single click handler)
657
- * const handleClick = useDoubleClick({
658
- * doubleClick: () => console.log('Double clicked!'),
659
- * });
660
- * ```
661
- */
662
- declare function useDoubleClick({ click, doubleClick, timeout }: UseDoubleClickProps): UseDoubleClickReturn;
663
-
664
- /**
665
- * useBackToTop Hook
666
- *
667
- * Manages visibility of a "Back to Top" button based on scroll position.
668
- * Supports both percentage-based and pixel-based visibility thresholds.
669
- *
670
- * @module @omnitron-dev/prism/hooks
671
- */
672
-
673
- /**
674
- * Return type for useBackToTop hook.
675
- */
676
- interface UseBackToTopReturn {
677
- /** Whether the "Back to Top" button should be visible */
678
- isVisible: boolean;
679
- /** Function to scroll smoothly to top */
680
- onBackToTop: () => void;
681
- /** Manual visibility control */
682
- setIsVisible: Dispatch<SetStateAction<boolean>>;
683
- }
684
- /**
685
- * Hook to manage the visibility of a "Back to Top" button based on scroll position.
686
- *
687
- * Two modes are supported:
688
- * - **Percentage mode**: Button becomes visible when scrolled past N% of the page.
689
- * Pass a string like '90%' as the threshold.
690
- * - **Pixel mode**: Button becomes visible when within N pixels of the bottom.
691
- * Pass a number like 80 as the threshold.
692
- *
693
- * @param threshold - Visibility threshold
694
- * - String with '%' (e.g., '90%'): Show when scroll progress >= this percentage
695
- * - Number (e.g., 80): Show when within this many pixels from bottom
696
- * @param debounce - Whether to debounce the scroll handler (100ms)
697
- * @returns Visibility state and scroll control functions
698
- *
699
- * @example
700
- * ```tsx
701
- * // Show when scrolled 90% down the page
702
- * const { isVisible, onBackToTop } = useBackToTop('90%');
703
- *
704
- * // Show when within 80px of the bottom
705
- * const { isVisible, onBackToTop } = useBackToTop(80);
706
- *
707
- * // With debouncing for better performance
708
- * const { isVisible, onBackToTop } = useBackToTop('85%', true);
709
- *
710
- * return (
711
- * <Fade in={isVisible}>
712
- * <Fab onClick={onBackToTop} sx={{ position: 'fixed', bottom: 16, right: 16 }}>
713
- * <KeyboardArrowUpIcon />
714
- * </Fab>
715
- * </Fade>
716
- * );
717
- * ```
718
- */
719
- declare function useBackToTop(threshold?: string | number, debounce?: boolean): UseBackToTopReturn;
720
-
721
- /**
722
- * useCountdownSeconds Hook
723
- *
724
- * Simple countdown timer in seconds. Ideal for OTP resend timers,
725
- * session timeouts, and other time-limited operations.
726
- *
727
- * @module @omnitron-dev/prism/hooks
728
- */
729
-
730
- /**
731
- * Return type for useCountdownSeconds hook.
732
- */
733
- interface UseCountdownSecondsReturn {
734
- /** Current countdown value in seconds */
735
- value: number;
736
- /** Start the countdown */
737
- start: () => void;
738
- /** Reset countdown to initial value and stop */
739
- reset: () => void;
740
- /** Whether countdown is currently active */
741
- isCounting: boolean;
742
- /** Manually set the countdown value */
743
- setValue: Dispatch<SetStateAction<number>>;
744
- }
745
- /**
746
- * Hook to create a simple countdown timer in seconds.
747
- *
748
- * Perfect for:
749
- * - OTP resend timers
750
- * - Session timeout warnings
751
- * - Rate limiting UI feedback
752
- * - Game timers
753
- *
754
- * @param initialSeconds - Initial countdown value in seconds
755
- * @returns Countdown state and control functions
756
- *
757
- * @example
758
- * ```tsx
759
- * // OTP resend timer
760
- * function OTPForm() {
761
- * const { value, start, reset, isCounting } = useCountdownSeconds(60);
762
- *
763
- * const handleResend = async () => {
764
- * await resendOTP();
765
- * reset();
766
- * start();
767
- * };
768
- *
769
- * return (
770
- * <div>
771
- * <input placeholder="Enter OTP" />
772
- * <button onClick={handleResend} disabled={isCounting}>
773
- * {isCounting ? `Resend in ${value}s` : 'Resend OTP'}
774
- * </button>
775
- * </div>
776
- * );
777
- * }
778
- * ```
779
- *
780
- * @example
781
- * ```tsx
782
- * // Session timeout warning
783
- * function SessionWarning() {
784
- * const { value, start, isCounting } = useCountdownSeconds(30);
785
- *
786
- * useEffect(() => {
787
- * if (showWarning) start();
788
- * }, [showWarning]);
789
- *
790
- * useEffect(() => {
791
- * if (value === 0) logout();
792
- * }, [value]);
793
- *
794
- * return isCounting && (
795
- * <Alert severity="warning">
796
- * Session expires in {value} seconds
797
- * </Alert>
798
- * );
799
- * }
800
- * ```
801
- */
802
- declare function useCountdownSeconds(initialSeconds: number): UseCountdownSecondsReturn;
803
-
804
- /**
805
- * Return type for useCountdownDate hook.
806
- */
807
- type UseCountdownDateReturn = {
808
- /** Formatted days (with leading zero) */
809
- days: string;
810
- /** Formatted hours (with leading zero) */
811
- hours: string;
812
- /** Formatted minutes (with leading zero) */
813
- minutes: string;
814
- /** Formatted seconds (with leading zero) */
815
- seconds: string;
816
- };
817
- /**
818
- * Custom hook to create a countdown timer to a target date.
819
- *
820
- * @param targetDate - The target date to count down to
821
- * @param placeholder - The placeholder value to display before the countdown starts (default: '- -')
822
- *
823
- * @returns An object containing the current countdown values in days, hours, minutes, and seconds
824
- *
825
- * @example
826
- * ```tsx
827
- * function SaleCountdown() {
828
- * const { days, hours, minutes, seconds } = useCountdownDate(
829
- * new Date('2024-12-31T23:59:59')
830
- * );
831
- *
832
- * return (
833
- * <div>
834
- * <span>{days}d</span>
835
- * <span>{hours}h</span>
836
- * <span>{minutes}m</span>
837
- * <span>{seconds}s</span>
838
- * </div>
839
- * );
840
- * }
841
- * ```
842
- *
843
- * @example
844
- * ```tsx
845
- * // With custom placeholder
846
- * const countdown = useCountdownDate(launchDate, '--');
847
- * ```
848
- */
849
- declare function useCountdownDate(targetDate: Date, placeholder?: string): UseCountdownDateReturn;
850
-
851
- /**
852
- * useScrollOffsetTop Hook
853
- *
854
- * Manages offset top state based on scroll position.
855
- * Can track against window or a specific element's offset.
856
- *
857
- * This hook is SSR-safe - scroll tracking only runs on the client.
858
- *
859
- * Ported from minimal-shared for Prism design system.
860
- *
861
- * @module @omnitron-dev/prism/hooks/use-scroll-offset-top
862
- */
863
-
864
- /**
865
- * Return type for useScrollOffsetTop hook.
866
- */
867
- type UseScrollOffsetTopReturn<T extends HTMLElement = HTMLElement> = {
868
- /** Whether the scroll position is past the offset threshold */
869
- offsetTop: boolean;
870
- /** Ref to attach to element for tracking its offset (optional) */
871
- elementRef: RefObject<T | null>;
872
- };
873
- /**
874
- * Custom hook to manage the offset top state based on scroll position.
875
- *
876
- * Can be used in two ways:
877
- * 1. Track against a fixed pixel value (window scroll)
878
- * 2. Track against an element's offset (using returned ref)
879
- *
880
- * @param defaultValue - The offset value at which the state changes (default: 0)
881
- *
882
- * @returns An object containing offsetTop boolean and elementRef
883
- *
884
- * @example
885
- * ```tsx
886
- * // Track window scroll against fixed value
887
- * function StickyHeader() {
888
- * const { offsetTop } = useScrollOffsetTop(80);
889
- *
890
- * return (
891
- * <AppBar position={offsetTop ? 'fixed' : 'static'}>
892
- * <Toolbar>Header</Toolbar>
893
- * </AppBar>
894
- * );
895
- * }
896
- * ```
897
- *
898
- * @example
899
- * ```tsx
900
- * // Track scroll against element offset
901
- * function HeaderWithBanner() {
902
- * const { offsetTop, elementRef } = useScrollOffsetTop<HTMLDivElement>();
903
- *
904
- * return (
905
- * <>
906
- * <div ref={elementRef}>Banner Content</div>
907
- * <AppBar
908
- * position={offsetTop ? 'fixed' : 'static'}
909
- * sx={{ top: offsetTop ? 0 : 'auto' }}
910
- * >
911
- * <Toolbar>Header</Toolbar>
912
- * </AppBar>
913
- * </>
914
- * );
915
- * }
916
- * ```
917
- */
918
- declare function useScrollOffsetTop<T extends HTMLElement = HTMLElement>(defaultValue?: number): UseScrollOffsetTopReturn<T>;
919
-
920
- /**
921
- * Configuration values that can be controlled via URL params.
922
- */
923
- interface UrlConfigValues {
924
- /** Theme preset */
925
- preset?: ThemePreset;
926
- /** Light/dark/system mode */
927
- mode?: ThemeMode;
928
- /** Primary color (hex) */
929
- primary?: string;
930
- /** Text direction */
931
- direction?: ThemeDirection;
932
- /** Component density */
933
- density?: ComponentDensity;
934
- /** Contrast mode */
935
- contrast?: 'default' | 'high';
936
- }
937
- /**
938
- * Options for useConfigFromQuery hook.
939
- */
940
- interface UseConfigFromQueryOptions {
941
- /** Query parameter names mapping (default: 'preset', 'mode', 'primary', etc.) */
942
- paramNames?: {
943
- preset?: string;
944
- mode?: string;
945
- primary?: string;
946
- direction?: string;
947
- density?: string;
948
- contrast?: string;
949
- };
950
- /** Callback when config changes from URL */
951
- onConfigChange?: (config: UrlConfigValues) => void;
952
- /** Enable two-way sync (updates URL when config changes) */
953
- syncToUrl?: boolean;
954
- }
955
- /**
956
- * Return type for useConfigFromQuery hook.
957
- */
958
- interface UseConfigFromQueryReturn {
959
- /** Parsed config values from URL */
960
- configFromUrl: UrlConfigValues;
961
- /** Update URL with new config values */
962
- updateUrl: (values: Partial<UrlConfigValues>) => void;
963
- /** Clear all config from URL */
964
- clearUrl: () => void;
965
- /** Generate URL with config values */
966
- generateUrl: (values: Partial<UrlConfigValues>, baseUrl?: string) => string;
967
- /** Check if URL has any config params */
968
- hasUrlConfig: boolean;
969
- }
970
- /**
971
- * Hook to sync theme configuration with URL query parameters.
972
- *
973
- * Enables shareable configuration links for demos, previews, and design reviews.
974
- *
975
- * @param options - Hook options
976
- * @returns Object with URL config parsing and manipulation utilities
977
- *
978
- * @example
979
- * ```tsx
980
- * import { useConfigFromQuery } from '@omnitron-dev/prism/hooks';
981
- *
982
- * function ThemeSettings() {
983
- * const {
984
- * configFromUrl,
985
- * updateUrl,
986
- * generateUrl,
987
- * hasUrlConfig,
988
- * } = useConfigFromQuery({
989
- * onConfigChange: (config) => {
990
- * // Apply config to your theme context
991
- * if (config.preset) setPreset(config.preset);
992
- * if (config.mode) setMode(config.mode);
993
- * if (config.primary) setPrimaryColor(config.primary);
994
- * },
995
- * });
996
- *
997
- * // Generate shareable link
998
- * const shareUrl = generateUrl({
999
- * preset: currentPreset,
1000
- * mode: currentMode,
1001
- * primary: currentPrimary,
1002
- * });
1003
- *
1004
- * return (
1005
- * <div>
1006
- * {hasUrlConfig && <Alert>Using config from URL</Alert>}
1007
- * <Button onClick={() => navigator.clipboard.writeText(shareUrl)}>
1008
- * Copy Share Link
1009
- * </Button>
1010
- * </div>
1011
- * );
1012
- * }
1013
- * ```
1014
- */
1015
- declare function useConfigFromQuery(options?: UseConfigFromQueryOptions): UseConfigFromQueryReturn;
1016
-
1017
- /**
1018
- * Image dimensions result.
1019
- */
1020
- interface ImageDimensions {
1021
- /** Natural width of the image in pixels */
1022
- width: number;
1023
- /** Natural height of the image in pixels */
1024
- height: number;
1025
- /** Aspect ratio (width / height) */
1026
- aspectRatio: number;
1027
- }
1028
- /**
1029
- * Return type for useImageDimensions hook.
1030
- */
1031
- interface UseImageDimensionsReturn {
1032
- /** Image dimensions (null if not loaded or error) */
1033
- dimensions: ImageDimensions | null;
1034
- /** Loading state */
1035
- loading: boolean;
1036
- /** Error if image failed to load */
1037
- error: Error | null;
1038
- /** Manually retry loading the image */
1039
- retry: () => void;
1040
- }
1041
- /**
1042
- * Options for useImageDimensions hook.
1043
- */
1044
- interface UseImageDimensionsOptions {
1045
- /** Cross-origin setting for image loading */
1046
- crossOrigin?: 'anonymous' | 'use-credentials';
1047
- /** Timeout in milliseconds (default: 10000) */
1048
- timeout?: number;
1049
- /** Whether to start loading immediately (default: true) */
1050
- immediate?: boolean;
1051
- }
1052
- /**
1053
- * useImageDimensions - Detects image dimensions from a URL.
1054
- *
1055
- * Loads an image in memory to get its natural width and height.
1056
- *
1057
- * @example
1058
- * ```tsx
1059
- * function ImagePreview({ src }: { src: string }) {
1060
- * const { dimensions, loading, error } = useImageDimensions(src);
1061
- *
1062
- * if (loading) return <CircularProgress />;
1063
- * if (error) return <Alert severity="error">Failed to load image</Alert>;
1064
- * if (!dimensions) return null;
1065
- *
1066
- * return (
1067
- * <Box>
1068
- * <Typography>
1069
- * {dimensions.width} x {dimensions.height}
1070
- * </Typography>
1071
- * <Typography>
1072
- * Aspect ratio: {dimensions.aspectRatio.toFixed(2)}
1073
- * </Typography>
1074
- * <img
1075
- * src={src}
1076
- * alt="preview"
1077
- * style={{ maxWidth: '100%', aspectRatio: dimensions.aspectRatio }}
1078
- * />
1079
- * </Box>
1080
- * );
1081
- * }
1082
- * ```
1083
- *
1084
- * @example
1085
- * ```tsx
1086
- * // With manual control
1087
- * function LazyImage({ src }: { src: string }) {
1088
- * const { dimensions, loading, retry } = useImageDimensions(src, {
1089
- * immediate: false,
1090
- * });
1091
- *
1092
- * return (
1093
- * <Box>
1094
- * {!dimensions && !loading && (
1095
- * <Button onClick={retry}>Load dimensions</Button>
1096
- * )}
1097
- * {loading && <CircularProgress />}
1098
- * {dimensions && (
1099
- * <Typography>{dimensions.width} x {dimensions.height}</Typography>
1100
- * )}
1101
- * </Box>
1102
- * );
1103
- * }
1104
- * ```
1105
- *
1106
- * @param src - Image URL to load
1107
- * @param options - Hook options
1108
- * @returns Dimensions, loading state, error, and retry function
1109
- */
1110
- declare function useImageDimensions(src: string | null | undefined, options?: UseImageDimensionsOptions): UseImageDimensionsReturn;
1111
- /**
1112
- * Get dimensions of multiple images.
1113
- *
1114
- * @example
1115
- * ```tsx
1116
- * function Gallery({ urls }: { urls: string[] }) {
1117
- * const results = useMultipleImageDimensions(urls);
1118
- *
1119
- * return (
1120
- * <Grid container>
1121
- * {results.map((result, i) => (
1122
- * <Grid item key={urls[i]}>
1123
- * {result.loading && <Skeleton />}
1124
- * {result.dimensions && (
1125
- * <img
1126
- * src={urls[i]}
1127
- * style={{ aspectRatio: result.dimensions.aspectRatio }}
1128
- * />
1129
- * )}
1130
- * </Grid>
1131
- * ))}
1132
- * </Grid>
1133
- * );
1134
- * }
1135
- * ```
1136
- */
1137
- declare function useMultipleImageDimensions(urls: (string | null | undefined)[], options?: UseImageDimensionsOptions): UseImageDimensionsReturn[];
1138
-
1139
- /**
1140
- * Return type for usePasswordVisibility hook.
1141
- */
1142
- interface UsePasswordVisibilityReturn {
1143
- /** Whether password is visible (text) or hidden (password) */
1144
- visible: boolean;
1145
- /** Toggle visibility */
1146
- toggle: () => void;
1147
- /** Show password */
1148
- show: () => void;
1149
- /** Hide password */
1150
- hide: () => void;
1151
- /** Input type based on visibility ('text' | 'password') */
1152
- type: 'text' | 'password';
1153
- }
1154
- /**
1155
- * Options for usePasswordVisibility hook.
1156
- */
1157
- interface UsePasswordVisibilityOptions {
1158
- /** Initial visibility state (default: false) */
1159
- initialVisible?: boolean;
1160
- }
1161
- /**
1162
- * usePasswordVisibility - Manage password field visibility toggle.
1163
- *
1164
- * Returns state and handlers for password visibility toggle,
1165
- * commonly used with InputAdornment in MUI TextField.
1166
- *
1167
- * @example
1168
- * ```tsx
1169
- * function LoginForm() {
1170
- * const password = usePasswordVisibility();
1171
- *
1172
- * return (
1173
- * <TextField
1174
- * type={password.type}
1175
- * InputProps={{
1176
- * endAdornment: (
1177
- * <InputAdornment position="end">
1178
- * <IconButton onClick={password.toggle}>
1179
- * {password.visible ? <VisibilityOff /> : <Visibility />}
1180
- * </IconButton>
1181
- * </InputAdornment>
1182
- * ),
1183
- * }}
1184
- * />
1185
- * );
1186
- * }
1187
- * ```
1188
- *
1189
- * @example
1190
- * ```tsx
1191
- * // With confirm password field
1192
- * function RegisterForm() {
1193
- * const password = usePasswordVisibility();
1194
- * const confirmPassword = usePasswordVisibility();
1195
- *
1196
- * return (
1197
- * <Box>
1198
- * <TextField
1199
- * label="Password"
1200
- * type={password.type}
1201
- * InputProps={{ endAdornment: <PasswordToggle {...password} /> }}
1202
- * />
1203
- * <TextField
1204
- * label="Confirm Password"
1205
- * type={confirmPassword.type}
1206
- * InputProps={{ endAdornment: <PasswordToggle {...confirmPassword} /> }}
1207
- * />
1208
- * </Box>
1209
- * );
1210
- * }
1211
- * ```
1212
- *
1213
- * @param options - Hook options
1214
- * @returns Visibility state, toggle handlers, and input type
1215
- */
1216
- declare function usePasswordVisibility(options?: UsePasswordVisibilityOptions): UsePasswordVisibilityReturn;
1217
-
1218
- interface UseThrottleOptions {
1219
- /** Whether to invoke on the leading edge (default: true) */
1220
- leading?: boolean;
1221
- /** Whether to invoke on the trailing edge (default: true) */
1222
- trailing?: boolean;
1223
- }
1224
- /**
1225
- * useThrottle - Throttle a value.
1226
- *
1227
- * Returns a throttled version of the value that only updates
1228
- * at most once per specified interval.
1229
- *
1230
- * @example
1231
- * ```tsx
1232
- * function SearchComponent() {
1233
- * const [search, setSearch] = useState('');
1234
- * const throttledSearch = useThrottle(search, 300);
1235
- *
1236
- * // API call only triggers when throttledSearch changes
1237
- * useEffect(() => {
1238
- * if (throttledSearch) {
1239
- * searchApi(throttledSearch);
1240
- * }
1241
- * }, [throttledSearch]);
1242
- *
1243
- * return <input value={search} onChange={(e) => setSearch(e.target.value)} />;
1244
- * }
1245
- * ```
1246
- *
1247
- * @param value - Value to throttle
1248
- * @param delay - Throttle delay in milliseconds
1249
- * @param options - Throttle options
1250
- * @returns Throttled value
1251
- */
1252
- declare function useThrottle<T>(value: T, delay: number, options?: UseThrottleOptions): T;
1253
- /**
1254
- * useThrottleCallback - Create a throttled callback function.
1255
- *
1256
- * Returns a memoized throttled version of the callback that only
1257
- * invokes at most once per specified interval.
1258
- *
1259
- * @example
1260
- * ```tsx
1261
- * function ScrollTracker() {
1262
- * const handleScroll = useThrottleCallback(
1263
- * (e: Event) => {
1264
- * console.log('Scroll position:', window.scrollY);
1265
- * },
1266
- * 100
1267
- * );
1268
- *
1269
- * useEffect(() => {
1270
- * window.addEventListener('scroll', handleScroll);
1271
- * return () => window.removeEventListener('scroll', handleScroll);
1272
- * }, [handleScroll]);
1273
- *
1274
- * return <div>Scroll me!</div>;
1275
- * }
1276
- * ```
1277
- *
1278
- * @param callback - Callback to throttle
1279
- * @param delay - Throttle delay in milliseconds
1280
- * @param options - Throttle options
1281
- * @returns Throttled callback
1282
- */
1283
- declare function useThrottleCallback<T extends (...args: unknown[]) => unknown>(callback: T, delay: number, options?: UseThrottleOptions): T;
1284
-
1285
- interface UseOnlineStatusReturn {
1286
- /** Whether the browser is online */
1287
- isOnline: boolean;
1288
- /** Whether the browser is offline */
1289
- isOffline: boolean;
1290
- /** Time when status last changed (timestamp) */
1291
- lastChanged: number | null;
1292
- }
1293
- /**
1294
- * useOnlineStatus - Track browser online/offline status.
1295
- *
1296
- * Uses navigator.onLine and online/offline events to track network status.
1297
- * SSR-safe with server-side assumption of online status.
1298
- *
1299
- * @example
1300
- * ```tsx
1301
- * function ConnectionIndicator() {
1302
- * const { isOnline, isOffline } = useOnlineStatus();
1303
- *
1304
- * if (isOffline) {
1305
- * return (
1306
- * <Alert severity="warning">
1307
- * You are offline. Changes will sync when you reconnect.
1308
- * </Alert>
1309
- * );
1310
- * }
1311
- *
1312
- * return null;
1313
- * }
1314
- * ```
1315
- *
1316
- * @example
1317
- * ```tsx
1318
- * // With timestamp tracking
1319
- * function NetworkStatus() {
1320
- * const { isOnline, lastChanged } = useOnlineStatus();
1321
- *
1322
- * return (
1323
- * <Box>
1324
- * <Typography>
1325
- * Status: {isOnline ? 'Online' : 'Offline'}
1326
- * </Typography>
1327
- * {lastChanged && (
1328
- * <Typography variant="caption">
1329
- * Last changed: {new Date(lastChanged).toLocaleTimeString()}
1330
- * </Typography>
1331
- * )}
1332
- * </Box>
1333
- * );
1334
- * }
1335
- * ```
1336
- *
1337
- * @returns Online status and metadata
1338
- */
1339
- declare function useOnlineStatus(): UseOnlineStatusReturn;
1340
-
1341
- interface UseIntersectionObserverOptions {
1342
- /** Root element for intersection (default: viewport) */
1343
- root?: Element | Document | null;
1344
- /** Root margin (default: '0px') */
1345
- rootMargin?: string;
1346
- /** Threshold(s) at which to trigger (default: 0) */
1347
- threshold?: number | number[];
1348
- /** Whether to disconnect after first intersection (default: false) */
1349
- triggerOnce?: boolean;
1350
- /** Whether to start observing immediately (default: true) */
1351
- enabled?: boolean;
1352
- }
1353
- interface UseIntersectionObserverReturn {
1354
- /** Ref to attach to the target element */
1355
- ref: (element: Element | null) => void;
1356
- /** Current intersection entry */
1357
- entry: IntersectionObserverEntry | null;
1358
- /** Whether the element is intersecting */
1359
- isIntersecting: boolean;
1360
- /** Manually disconnect the observer */
1361
- disconnect: () => void;
1362
- }
1363
- /**
1364
- * useIntersectionObserver - Observe element visibility.
1365
- *
1366
- * Uses the Intersection Observer API to track when an element
1367
- * enters or exits the viewport (or a custom root element).
1368
- *
1369
- * @example
1370
- * ```tsx
1371
- * // Lazy loading images
1372
- * function LazyImage({ src }: { src: string }) {
1373
- * const { ref, isIntersecting } = useIntersectionObserver({
1374
- * triggerOnce: true,
1375
- * });
1376
- *
1377
- * return (
1378
- * <div ref={ref}>
1379
- * {isIntersecting ? (
1380
- * <img src={src} alt="" />
1381
- * ) : (
1382
- * <Skeleton variant="rectangular" height={200} />
1383
- * )}
1384
- * </div>
1385
- * );
1386
- * }
1387
- * ```
1388
- *
1389
- * @example
1390
- * ```tsx
1391
- * // Infinite scroll
1392
- * function InfiniteList({ items, onLoadMore }) {
1393
- * const { ref, isIntersecting } = useIntersectionObserver({
1394
- * threshold: 0.5,
1395
- * });
1396
- *
1397
- * useEffect(() => {
1398
- * if (isIntersecting) {
1399
- * onLoadMore();
1400
- * }
1401
- * }, [isIntersecting, onLoadMore]);
1402
- *
1403
- * return (
1404
- * <Box>
1405
- * {items.map((item) => <Item key={item.id} {...item} />)}
1406
- * <div ref={ref} style={{ height: 1 }} />
1407
- * </Box>
1408
- * );
1409
- * }
1410
- * ```
1411
- *
1412
- * @example
1413
- * ```tsx
1414
- * // Animate on scroll
1415
- * function AnimatedSection({ children }) {
1416
- * const { ref, isIntersecting } = useIntersectionObserver({
1417
- * threshold: 0.1,
1418
- * triggerOnce: true,
1419
- * });
1420
- *
1421
- * return (
1422
- * <Fade in={isIntersecting}>
1423
- * <Box ref={ref}>{children}</Box>
1424
- * </Fade>
1425
- * );
1426
- * }
1427
- * ```
1428
- *
1429
- * @param options - Observer options
1430
- * @returns Ref, entry, intersection state, and disconnect function
1431
- */
1432
- declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverReturn;
1433
-
1434
- interface KeyboardShortcut {
1435
- /** Main key (e.g., 'k', 'Enter', 'Escape') */
1436
- key: string;
1437
- /** Require Ctrl/Cmd key */
1438
- ctrl?: boolean;
1439
- /** Require Shift key */
1440
- shift?: boolean;
1441
- /** Require Alt key */
1442
- alt?: boolean;
1443
- /** Require Meta key (Cmd on Mac) */
1444
- meta?: boolean;
1445
- }
1446
- interface UseKeyboardShortcutOptions {
1447
- /** Whether the shortcut is enabled (default: true) */
1448
- enabled?: boolean;
1449
- /** Prevent default browser behavior (default: true) */
1450
- preventDefault?: boolean;
1451
- /** Stop event propagation (default: false) */
1452
- stopPropagation?: boolean;
1453
- /** Target element (default: document) */
1454
- target?: EventTarget | null;
1455
- /** Event type (default: 'keydown') */
1456
- event?: 'keydown' | 'keyup' | 'keypress';
1457
- /** Ignore when focus is in input/textarea/contenteditable (default: false) */
1458
- ignoreInputs?: boolean;
1459
- }
1460
- /**
1461
- * useKeyboardShortcut - Handle keyboard shortcuts.
1462
- *
1463
- * Listens for keyboard events matching the specified shortcut
1464
- * and invokes the callback when matched.
1465
- *
1466
- * @example
1467
- * ```tsx
1468
- * // Simple shortcut
1469
- * function SearchDialog() {
1470
- * const [open, setOpen] = useState(false);
1471
- *
1472
- * useKeyboardShortcut({ key: 'k', ctrl: true }, () => {
1473
- * setOpen(true);
1474
- * });
1475
- *
1476
- * return <Dialog open={open} onClose={() => setOpen(false)} />;
1477
- * }
1478
- * ```
1479
- *
1480
- * @example
1481
- * ```tsx
1482
- * // Save with Ctrl+S
1483
- * function Editor({ onSave }) {
1484
- * useKeyboardShortcut(
1485
- * { key: 's', ctrl: true },
1486
- * () => onSave(),
1487
- * { preventDefault: true }
1488
- * );
1489
- *
1490
- * return <TextField multiline />;
1491
- * }
1492
- * ```
1493
- *
1494
- * @example
1495
- * ```tsx
1496
- * // Escape to close
1497
- * function Modal({ onClose }) {
1498
- * useKeyboardShortcut({ key: 'Escape' }, onClose);
1499
- *
1500
- * return <div>Modal content</div>;
1501
- * }
1502
- * ```
1503
- *
1504
- * @example
1505
- * ```tsx
1506
- * // Multiple shortcuts
1507
- * function App() {
1508
- * useKeyboardShortcut({ key: 'k', ctrl: true }, openSearch);
1509
- * useKeyboardShortcut({ key: 'n', ctrl: true }, createNew);
1510
- * useKeyboardShortcut({ key: '/', ctrl: true }, toggleHelp);
1511
- *
1512
- * return <div>...</div>;
1513
- * }
1514
- * ```
1515
- *
1516
- * @param shortcut - Keyboard shortcut definition
1517
- * @param callback - Function to call when shortcut is triggered
1518
- * @param options - Hook options
1519
- */
1520
- declare function useKeyboardShortcut(shortcut: KeyboardShortcut, callback: (event: KeyboardEvent) => void, options?: UseKeyboardShortcutOptions): void;
1521
- /**
1522
- * useEscapeKey - Convenience hook for Escape key handling.
1523
- *
1524
- * @example
1525
- * ```tsx
1526
- * function Modal({ onClose }) {
1527
- * useEscapeKey(onClose);
1528
- * return <div>Modal content</div>;
1529
- * }
1530
- * ```
1531
- */
1532
- declare function useEscapeKey(callback: (event: KeyboardEvent) => void, options?: Omit<UseKeyboardShortcutOptions, 'ignoreInputs'>): void;
1533
- /**
1534
- * useEnterKey - Convenience hook for Enter key handling.
1535
- *
1536
- * @example
1537
- * ```tsx
1538
- * function SearchField({ onSearch }) {
1539
- * useEnterKey(onSearch, { ignoreInputs: false });
1540
- * return <TextField />;
1541
- * }
1542
- * ```
1543
- */
1544
- declare function useEnterKey(callback: (event: KeyboardEvent) => void, options?: UseKeyboardShortcutOptions): void;
1545
-
1546
- /**
1547
- * Options for useFocusTrap hook.
1548
- */
1549
- interface UseFocusTrapOptions {
1550
- /**
1551
- * Whether the focus trap is active.
1552
- * @default true
1553
- */
1554
- enabled?: boolean;
1555
- /**
1556
- * Whether to auto-focus the first focusable element when enabled.
1557
- * @default true
1558
- */
1559
- autoFocus?: boolean;
1560
- /**
1561
- * Whether to restore focus to the previously focused element when disabled.
1562
- * @default true
1563
- */
1564
- restoreFocus?: boolean;
1565
- /**
1566
- * Selector for focusable elements.
1567
- * @default FOCUSABLE_SELECTOR
1568
- */
1569
- focusableSelector?: string;
1570
- }
1571
- /**
1572
- * Return type for useFocusTrap hook.
1573
- */
1574
- interface UseFocusTrapReturn<T extends HTMLElement = HTMLElement> {
1575
- /**
1576
- * Ref to attach to the container element.
1577
- */
1578
- ref: React.RefCallback<T>;
1579
- /**
1580
- * Focus the first focusable element.
1581
- */
1582
- focusFirst: () => void;
1583
- /**
1584
- * Focus the last focusable element.
1585
- */
1586
- focusLast: () => void;
1587
- }
1588
- /**
1589
- * Trap focus within a container element.
1590
- *
1591
- * @param options - Hook options
1592
- * @returns Ref and focus control functions
1593
- *
1594
- * @example
1595
- * ```tsx
1596
- * function Modal({ open, onClose, children }) {
1597
- * const { ref } = useFocusTrap({ enabled: open });
1598
- *
1599
- * if (!open) return null;
1600
- *
1601
- * return (
1602
- * <div ref={ref} role="dialog" aria-modal="true">
1603
- * {children}
1604
- * <button onClick={onClose}>Close</button>
1605
- * </div>
1606
- * );
1607
- * }
1608
- * ```
1609
- */
1610
- declare function useFocusTrap<T extends HTMLElement = HTMLElement>(options?: UseFocusTrapOptions): UseFocusTrapReturn<T>;
1611
-
1612
- /**
1613
- * useUpdateEffect Hook
1614
- *
1615
- * Like useEffect, but skips the first render.
1616
- * Useful for running effects only on updates, not on mount.
1617
- *
1618
- * @module @omnitron-dev/prism/hooks
1619
- */
1620
-
1621
- /**
1622
- * Effect hook that only runs on updates, not on initial mount.
1623
- *
1624
- * @param effect - Effect callback function
1625
- * @param deps - Dependency array
1626
- *
1627
- * @example
1628
- * ```tsx
1629
- * function SearchInput({ value, onSearch }) {
1630
- * // Only search when value changes after initial render
1631
- * useUpdateEffect(() => {
1632
- * onSearch(value);
1633
- * }, [value]);
1634
- *
1635
- * return <input value={value} />;
1636
- * }
1637
- * ```
1638
- */
1639
- declare function useUpdateEffect(effect: EffectCallback, deps?: DependencyList): void;
1640
- /**
1641
- * Layout effect hook that only runs on updates, not on initial mount.
1642
- * Uses useLayoutEffect for synchronous DOM measurements.
1643
- *
1644
- * @param effect - Effect callback function
1645
- * @param deps - Dependency array
1646
- *
1647
- * @example
1648
- * ```tsx
1649
- * function AnimatedComponent({ size }) {
1650
- * const ref = useRef<HTMLDivElement>(null);
1651
- *
1652
- * // Animate size changes, but not initial render
1653
- * useUpdateLayoutEffect(() => {
1654
- * if (ref.current) {
1655
- * animate(ref.current, { width: size });
1656
- * }
1657
- * }, [size]);
1658
- *
1659
- * return <div ref={ref} />;
1660
- * }
1661
- * ```
1662
- */
1663
- declare function useUpdateLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
1664
-
1665
- /**
1666
- * useIsomorphicLayoutEffect Hook
1667
- *
1668
- * SSR-safe version of useLayoutEffect.
1669
- * Uses useLayoutEffect on client, useEffect on server.
1670
- *
1671
- * @module @omnitron-dev/prism/hooks
1672
- */
1673
-
1674
- /**
1675
- * Isomorphic layout effect that works in both SSR and CSR environments.
1676
- *
1677
- * - On the client: Uses useLayoutEffect for synchronous DOM operations
1678
- * - On the server: Uses useEffect to avoid SSR warnings
1679
- *
1680
- * @example
1681
- * ```tsx
1682
- * function Tooltip({ position }) {
1683
- * const ref = useRef<HTMLDivElement>(null);
1684
- *
1685
- * // Synchronously measure and position on client
1686
- * useIsomorphicLayoutEffect(() => {
1687
- * if (ref.current) {
1688
- * const rect = ref.current.getBoundingClientRect();
1689
- * // Position tooltip based on measurements
1690
- * }
1691
- * }, [position]);
1692
- *
1693
- * return <div ref={ref}>Tooltip</div>;
1694
- * }
1695
- * ```
1696
- */
1697
- declare const useIsomorphicLayoutEffect: typeof useEffect;
1698
-
1699
- /**
1700
- * Return type for useSessionStorage hook.
1701
- */
1702
- interface UseSessionStorageReturn<T> {
1703
- /** Current state value */
1704
- state: T;
1705
- /** Update state and sessionStorage */
1706
- setState: (value: T | ((prev: T) => T)) => void;
1707
- /** Remove item from sessionStorage and reset to default */
1708
- remove: () => void;
1709
- /** Check if sessionStorage has the key */
1710
- hasValue: boolean;
1711
- }
1712
- /**
1713
- * Options for useSessionStorage hook.
1714
- */
1715
- interface UseSessionStorageOptions<T> {
1716
- /** Serializer function (default: JSON.stringify) */
1717
- serializer?: (value: T) => string;
1718
- /** Deserializer function (default: JSON.parse) */
1719
- deserializer?: (value: string) => T;
1720
- }
1721
- /**
1722
- * Hook for persisting state in sessionStorage.
1723
- *
1724
- * @param key - Storage key
1725
- * @param defaultValue - Default value when key is not found
1726
- * @param options - Configuration options
1727
- * @returns State value and control methods
1728
- *
1729
- * @example
1730
- * ```tsx
1731
- * function SearchFilters() {
1732
- * const { state: filters, setState: setFilters, remove } = useSessionStorage(
1733
- * 'search-filters',
1734
- * { query: '', category: 'all' }
1735
- * );
1736
- *
1737
- * return (
1738
- * <>
1739
- * <input
1740
- * value={filters.query}
1741
- * onChange={(e) => setFilters({ ...filters, query: e.target.value })}
1742
- * />
1743
- * <button onClick={remove}>Clear Filters</button>
1744
- * </>
1745
- * );
1746
- * }
1747
- * ```
1748
- *
1749
- * @example
1750
- * ```tsx
1751
- * // With functional updates
1752
- * function Counter() {
1753
- * const { state: count, setState: setCount } = useSessionStorage('counter', 0);
1754
- *
1755
- * return (
1756
- * <button onClick={() => setCount((prev) => prev + 1)}>
1757
- * Count: {count}
1758
- * </button>
1759
- * );
1760
- * }
1761
- * ```
1762
- */
1763
- declare function useSessionStorage<T>(key: string, defaultValue: T, options?: UseSessionStorageOptions<T>): UseSessionStorageReturn<T>;
1764
-
1765
- /**
1766
- * Return type for useArray hook.
1767
- */
1768
- interface UseArrayReturn<T> {
1769
- /** Current array value */
1770
- value: T[];
1771
- /** Set array to new value */
1772
- setValue: React.Dispatch<React.SetStateAction<T[]>>;
1773
- /** Add item to end of array */
1774
- push: (item: T) => void;
1775
- /** Add items to end of array */
1776
- pushMany: (items: T[]) => void;
1777
- /** Remove first occurrence of item (by reference or predicate) */
1778
- remove: (itemOrPredicate: T | ((item: T) => boolean)) => void;
1779
- /** Remove item at index */
1780
- removeAt: (index: number) => void;
1781
- /** Remove items matching predicate */
1782
- removeWhere: (predicate: (item: T) => boolean) => void;
1783
- /** Update item at index */
1784
- updateAt: (index: number, item: T) => void;
1785
- /** Update item at index with partial data (merge) */
1786
- updateAtPartial: (index: number, partial: Partial<T>) => void;
1787
- /** Update items matching predicate */
1788
- updateWhere: (predicate: (item: T) => boolean, update: T | ((item: T) => T)) => void;
1789
- /** Insert item at index */
1790
- insertAt: (index: number, item: T) => void;
1791
- /** Move item from one index to another */
1792
- move: (fromIndex: number, toIndex: number) => void;
1793
- /** Swap items at two indices */
1794
- swap: (indexA: number, indexB: number) => void;
1795
- /** Clear all items */
1796
- clear: () => void;
1797
- /** Reset to initial value */
1798
- reset: () => void;
1799
- /** Reverse array in place */
1800
- reverse: () => void;
1801
- /** Sort array */
1802
- sort: (compareFn?: (a: T, b: T) => number) => void;
1803
- /** Filter array (returns new array, does not modify state) */
1804
- filter: (predicate: (item: T) => boolean) => T[];
1805
- /** Find item (returns item, does not modify state) */
1806
- find: (predicate: (item: T) => boolean) => T | undefined;
1807
- /** Find item index (returns index, does not modify state) */
1808
- findIndex: (predicate: (item: T) => boolean) => number;
1809
- /** Check if array includes item */
1810
- includes: (item: T) => boolean;
1811
- /** Get array length */
1812
- length: number;
1813
- /** Check if array is empty */
1814
- isEmpty: boolean;
1815
- /** Get first item */
1816
- first: T | undefined;
1817
- /** Get last item */
1818
- last: T | undefined;
1819
- }
1820
- /**
1821
- * Hook for managing array state with CRUD operations.
1822
- *
1823
- * @param initialValue - Initial array value
1824
- * @returns Array value and manipulation methods
1825
- *
1826
- * @example
1827
- * ```tsx
1828
- * function TodoList() {
1829
- * const todos = useArray<{ id: number; text: string; done: boolean }>([]);
1830
- *
1831
- * const addTodo = (text: string) => {
1832
- * todos.push({ id: Date.now(), text, done: false });
1833
- * };
1834
- *
1835
- * const toggleTodo = (id: number) => {
1836
- * todos.updateWhere(
1837
- * (todo) => todo.id === id,
1838
- * (todo) => ({ ...todo, done: !todo.done })
1839
- * );
1840
- * };
1841
- *
1842
- * return (
1843
- * <ul>
1844
- * {todos.value.map((todo) => (
1845
- * <li key={todo.id} onClick={() => toggleTodo(todo.id)}>
1846
- * {todo.text} {todo.done && '✓'}
1847
- * </li>
1848
- * ))}
1849
- * </ul>
1850
- * );
1851
- * }
1852
- * ```
1853
- *
1854
- * @example
1855
- * ```tsx
1856
- * // Drag and drop reordering
1857
- * function SortableList() {
1858
- * const items = useArray(['A', 'B', 'C', 'D']);
1859
- *
1860
- * const handleDragEnd = (fromIndex: number, toIndex: number) => {
1861
- * items.move(fromIndex, toIndex);
1862
- * };
1863
- *
1864
- * return <DraggableList items={items.value} onReorder={handleDragEnd} />;
1865
- * }
1866
- * ```
1867
- *
1868
- * @example
1869
- * ```tsx
1870
- * // With type-safe updates
1871
- * interface User {
1872
- * id: number;
1873
- * name: string;
1874
- * email: string;
1875
- * }
1876
- *
1877
- * function UserList() {
1878
- * const users = useArray<User>([
1879
- * { id: 1, name: 'Alice', email: 'alice@example.com' },
1880
- * ]);
1881
- *
1882
- * // Partial update (type-safe)
1883
- * users.updateAtPartial(0, { email: 'alice@newdomain.com' });
1884
- *
1885
- * return <div>{users.value.map(u => u.name).join(', ')}</div>;
1886
- * }
1887
- * ```
1888
- */
1889
- declare function useArray<T>(initialValue?: T[]): UseArrayReturn<T>;
1890
-
1891
- /**
1892
- * State for a mutation.
1893
- */
1894
- interface MutationState<TData, TError> {
1895
- /** Mutation result data */
1896
- data: TData | undefined;
1897
- /** Error from mutation */
1898
- error: TError | undefined;
1899
- /** Whether mutation is currently executing */
1900
- isLoading: boolean;
1901
- /** Whether mutation has succeeded at least once */
1902
- isSuccess: boolean;
1903
- /** Whether mutation has failed */
1904
- isError: boolean;
1905
- /** Whether mutation is idle (never called or reset) */
1906
- isIdle: boolean;
1907
- /** Current status */
1908
- status: 'idle' | 'loading' | 'success' | 'error';
1909
- }
1910
- /**
1911
- * Options for useMutation hook.
1912
- */
1913
- interface UseMutationOptions<TData, TError, TVariables> {
1914
- /** Called when mutation starts */
1915
- onMutate?: (variables: TVariables) => void | Promise<void>;
1916
- /** Called on successful mutation */
1917
- onSuccess?: (data: TData, variables: TVariables) => void | Promise<void>;
1918
- /** Called on mutation error */
1919
- onError?: (error: TError, variables: TVariables) => void | Promise<void>;
1920
- /** Called after mutation settles (success or error) */
1921
- onSettled?: (data: TData | undefined, error: TError | undefined, variables: TVariables) => void | Promise<void>;
1922
- /** Retry count on failure */
1923
- retry?: number | boolean;
1924
- /** Delay between retries in ms */
1925
- retryDelay?: number | ((attempt: number) => number);
1926
- }
1927
- /**
1928
- * Return type for useMutation hook.
1929
- */
1930
- interface UseMutationReturn<TData, TError, TVariables> {
1931
- /** Current mutation state */
1932
- data: TData | undefined;
1933
- error: TError | undefined;
1934
- isLoading: boolean;
1935
- isSuccess: boolean;
1936
- isError: boolean;
1937
- isIdle: boolean;
1938
- status: MutationState<TData, TError>['status'];
1939
- /** Execute the mutation */
1940
- mutate: (variables: TVariables, options?: {
1941
- onSuccess?: (data: TData) => void;
1942
- onError?: (error: TError) => void;
1943
- onSettled?: (data: TData | undefined, error: TError | undefined) => void;
1944
- }) => void;
1945
- /** Execute the mutation and return a promise */
1946
- mutateAsync: (variables: TVariables) => Promise<TData>;
1947
- /** Reset mutation state */
1948
- reset: () => void;
1949
- }
1950
- /**
1951
- * Hook for handling async mutations with loading/error states.
1952
- *
1953
- * @param mutationFn - Async function to execute
1954
- * @param options - Configuration options
1955
- * @returns Mutation state and control methods
1956
- *
1957
- * @example
1958
- * ```tsx
1959
- * function CreateUserForm() {
1960
- * const createUser = useMutation(
1961
- * async (data: { name: string; email: string }) => {
1962
- * const response = await fetch('/api/users', {
1963
- * method: 'POST',
1964
- * body: JSON.stringify(data),
1965
- * });
1966
- * if (!response.ok) throw new Error('Failed to create user');
1967
- * return response.json();
1968
- * },
1969
- * {
1970
- * onSuccess: (user) => {
1971
- * console.log('User created:', user);
1972
- * },
1973
- * onError: (error) => {
1974
- * console.error('Failed:', error);
1975
- * },
1976
- * }
1977
- * );
1978
- *
1979
- * const handleSubmit = (e: FormEvent) => {
1980
- * e.preventDefault();
1981
- * createUser.mutate({ name: 'John', email: 'john@example.com' });
1982
- * };
1983
- *
1984
- * return (
1985
- * <form onSubmit={handleSubmit}>
1986
- * <button type="submit" disabled={createUser.isLoading}>
1987
- * {createUser.isLoading ? 'Creating...' : 'Create User'}
1988
- * </button>
1989
- * {createUser.isError && <div>Error: {String(createUser.error)}</div>}
1990
- * {createUser.isSuccess && <div>User created!</div>}
1991
- * </form>
1992
- * );
1993
- * }
1994
- * ```
1995
- *
1996
- * @example
1997
- * ```tsx
1998
- * // With async/await
1999
- * async function handleCreate() {
2000
- * try {
2001
- * const user = await createUser.mutateAsync({ name: 'Jane' });
2002
- * navigate(`/users/${user.id}`);
2003
- * } catch (error) {
2004
- * // Error already captured in state
2005
- * }
2006
- * }
2007
- * ```
2008
- *
2009
- * @example
2010
- * ```tsx
2011
- * // With retry
2012
- * const uploadFile = useMutation(
2013
- * async (file: File) => {
2014
- * const formData = new FormData();
2015
- * formData.append('file', file);
2016
- * const response = await fetch('/api/upload', {
2017
- * method: 'POST',
2018
- * body: formData,
2019
- * });
2020
- * if (!response.ok) throw new Error('Upload failed');
2021
- * return response.json();
2022
- * },
2023
- * {
2024
- * retry: 3,
2025
- * retryDelay: (attempt) => attempt * 1000,
2026
- * }
2027
- * );
2028
- * ```
2029
- */
2030
- declare function useMutation<TData = unknown, TError = Error, TVariables = void>(mutationFn: (variables: TVariables) => Promise<TData>, options?: UseMutationOptions<TData, TError, TVariables>): UseMutationReturn<TData, TError, TVariables>;
2031
-
2032
- /**
2033
- * State for a lazy query.
2034
- */
2035
- interface LazyQueryState<TData, TError> {
2036
- /** Query result data */
2037
- data: TData | undefined;
2038
- /** Error from query */
2039
- error: TError | undefined;
2040
- /** Whether query is currently executing */
2041
- isLoading: boolean;
2042
- /** Whether query has succeeded at least once */
2043
- isSuccess: boolean;
2044
- /** Whether query has failed */
2045
- isError: boolean;
2046
- /** Whether query has been called at least once */
2047
- isCalled: boolean;
2048
- /** Whether query is fetching (includes refetch) */
2049
- isFetching: boolean;
2050
- /** Whether this is a refetch */
2051
- isRefetching: boolean;
2052
- }
2053
- /**
2054
- * Options for useLazyQuery hook.
2055
- */
2056
- interface UseLazyQueryOptions<TData, TError, TVariables> {
2057
- /** Called on successful query */
2058
- onSuccess?: (data: TData, variables: TVariables) => void | Promise<void>;
2059
- /** Called on query error */
2060
- onError?: (error: TError, variables: TVariables) => void | Promise<void>;
2061
- /** Called after query settles (success or error) */
2062
- onSettled?: (data: TData | undefined, error: TError | undefined, variables: TVariables) => void | Promise<void>;
2063
- /** Cache time in ms (0 = no cache) */
2064
- cacheTime?: number;
2065
- /** Stale time in ms (data considered fresh for this duration) */
2066
- staleTime?: number;
2067
- /** Retry count on failure */
2068
- retry?: number | boolean;
2069
- /** Delay between retries in ms */
2070
- retryDelay?: number | ((attempt: number) => number);
2071
- /** Initial data */
2072
- initialData?: TData;
2073
- }
2074
- /**
2075
- * Return type for useLazyQuery hook.
2076
- */
2077
- interface UseLazyQueryReturn<TData, TError, TVariables> {
2078
- /** Current query state */
2079
- data: TData | undefined;
2080
- error: TError | undefined;
2081
- isLoading: boolean;
2082
- isSuccess: boolean;
2083
- isError: boolean;
2084
- isCalled: boolean;
2085
- isFetching: boolean;
2086
- isRefetching: boolean;
2087
- /** Execute the query */
2088
- query: (variables: TVariables) => Promise<TData>;
2089
- /** Refetch with last variables */
2090
- refetch: () => Promise<TData | undefined>;
2091
- /** Reset query state */
2092
- reset: () => void;
2093
- /** Manually set data */
2094
- setData: (data: TData | ((prev: TData | undefined) => TData)) => void;
2095
- }
2096
- /**
2097
- * Hook for manual query execution with caching support.
2098
- *
2099
- * @param queryFn - Async function to execute
2100
- * @param options - Configuration options
2101
- * @returns Query state and control methods
2102
- *
2103
- * @example
2104
- * ```tsx
2105
- * function UserSearch() {
2106
- * const users = useLazyQuery(
2107
- * async (query: string) => {
2108
- * const response = await fetch(`/api/users?q=${query}`);
2109
- * if (!response.ok) throw new Error('Search failed');
2110
- * return response.json();
2111
- * },
2112
- * {
2113
- * onSuccess: (data) => console.log('Found users:', data.length),
2114
- * cacheTime: 5 * 60 * 1000, // 5 minutes
2115
- * }
2116
- * );
2117
- *
2118
- * const handleSearch = async (query: string) => {
2119
- * const results = await users.query(query);
2120
- * console.log('Results:', results);
2121
- * };
2122
- *
2123
- * return (
2124
- * <div>
2125
- * <SearchInput onSearch={handleSearch} />
2126
- * {users.isLoading && <Spinner />}
2127
- * {users.isError && <div>Error: {String(users.error)}</div>}
2128
- * {users.data?.map((user) => <UserCard key={user.id} user={user} />)}
2129
- * </div>
2130
- * );
2131
- * }
2132
- * ```
2133
- *
2134
- * @example
2135
- * ```tsx
2136
- * // With caching
2137
- * const userDetails = useLazyQuery(
2138
- * async (id: string) => fetchUser(id),
2139
- * {
2140
- * cacheTime: 10 * 60 * 1000, // Keep in cache for 10 min
2141
- * staleTime: 60 * 1000, // Consider fresh for 1 min
2142
- * }
2143
- * );
2144
- *
2145
- * // First call fetches, subsequent calls within staleTime return cache
2146
- * await userDetails.query('123');
2147
- * await userDetails.query('123'); // Returns from cache if not stale
2148
- * ```
2149
- *
2150
- * @example
2151
- * ```tsx
2152
- * // Manual data management
2153
- * const { data, setData, reset } = useLazyQuery(fetchData);
2154
- *
2155
- * // Optimistic update
2156
- * setData((prev) => prev ? { ...prev, count: prev.count + 1 } : prev);
2157
- *
2158
- * // Reset to clean state
2159
- * reset();
2160
- * ```
2161
- */
2162
- declare function useLazyQuery<TData = unknown, TError = Error, TVariables = void>(queryFn: (variables: TVariables) => Promise<TData>, options?: UseLazyQueryOptions<TData, TError, TVariables>): UseLazyQueryReturn<TData, TError, TVariables>;
2163
-
2164
- /**
2165
- * Page info returned from fetch function.
2166
- */
2167
- interface PageInfo {
2168
- /** Whether there are more pages */
2169
- hasNextPage: boolean;
2170
- /** Cursor or token for next page */
2171
- endCursor?: string | number;
2172
- /** Total count (optional) */
2173
- totalCount?: number;
2174
- }
2175
- /**
2176
- * Page data structure.
2177
- */
2178
- interface InfinitePage<TData> {
2179
- /** Items in this page */
2180
- items: TData[];
2181
- /** Page information */
2182
- pageInfo: PageInfo;
2183
- }
2184
- /**
2185
- * State for infinite scroll.
2186
- */
2187
- interface InfiniteScrollState<TData, TError> {
2188
- /** All loaded items (flattened) */
2189
- items: TData[];
2190
- /** All pages */
2191
- pages: InfinitePage<TData>[];
2192
- /** Error from last fetch */
2193
- error: TError | undefined;
2194
- /** Whether initial load is in progress */
2195
- isLoading: boolean;
2196
- /** Whether more data is being fetched */
2197
- isFetchingMore: boolean;
2198
- /** Whether there are more pages to fetch */
2199
- hasNextPage: boolean;
2200
- /** Whether any data has been loaded */
2201
- isEmpty: boolean;
2202
- /** Total count if available */
2203
- totalCount: number | undefined;
2204
- }
2205
- /**
2206
- * Options for useInfiniteScroll hook.
2207
- */
2208
- interface UseInfiniteScrollOptions<TData, TError> {
2209
- /** Called on successful fetch */
2210
- onSuccess?: (page: InfinitePage<TData>) => void | Promise<void>;
2211
- /** Called on fetch error */
2212
- onError?: (error: TError) => void | Promise<void>;
2213
- /** Initial cursor/offset */
2214
- initialCursor?: string | number;
2215
- /** Initial page size */
2216
- pageSize?: number;
2217
- /** Retry count on failure */
2218
- retry?: number | boolean;
2219
- /** Retry delay in ms */
2220
- retryDelay?: number | ((attempt: number) => number);
2221
- /** Intersection observer options for auto-loading */
2222
- observerOptions?: IntersectionObserverInit;
2223
- }
2224
- /**
2225
- * Return type for useInfiniteScroll hook.
2226
- */
2227
- interface UseInfiniteScrollReturn<TData, TError> {
2228
- /** All loaded items (flattened) */
2229
- items: TData[];
2230
- /** All pages */
2231
- pages: InfinitePage<TData>[];
2232
- /** Error from last fetch */
2233
- error: TError | undefined;
2234
- /** Whether initial load is in progress */
2235
- isLoading: boolean;
2236
- /** Whether more data is being fetched */
2237
- isFetchingMore: boolean;
2238
- /** Whether there are more pages to fetch */
2239
- hasNextPage: boolean;
2240
- /** Whether list is empty */
2241
- isEmpty: boolean;
2242
- /** Total count if available */
2243
- totalCount: number | undefined;
2244
- /** Fetch the next page */
2245
- fetchNextPage: () => Promise<void>;
2246
- /** Fetch first page (refresh) */
2247
- refresh: () => Promise<void>;
2248
- /** Reset to initial state */
2249
- reset: () => void;
2250
- /** Ref to attach to sentinel element for auto-loading */
2251
- sentinelRef: React.RefCallback<HTMLElement>;
2252
- /** Manually prepend items */
2253
- prependItems: (items: TData[]) => void;
2254
- /** Manually append items */
2255
- appendItems: (items: TData[]) => void;
2256
- /** Remove item by predicate */
2257
- removeItem: (predicate: (item: TData) => boolean) => void;
2258
- /** Update item by predicate */
2259
- updateItem: (predicate: (item: TData) => boolean, update: Partial<TData> | ((item: TData) => TData)) => void;
2260
- }
2261
- /**
2262
- * Fetch function signature.
2263
- */
2264
- type InfiniteFetchFn<TData> = (params: {
2265
- cursor?: string | number;
2266
- pageSize: number;
2267
- }) => Promise<InfinitePage<TData>>;
2268
- /**
2269
- * Hook for infinite scrolling with paginated data.
2270
- *
2271
- * @param fetchFn - Function to fetch a page of data
2272
- * @param options - Configuration options
2273
- * @returns Infinite scroll state and controls
2274
- *
2275
- * @example
2276
- * ```tsx
2277
- * function UserList() {
2278
- * const {
2279
- * items,
2280
- * isLoading,
2281
- * isFetchingMore,
2282
- * hasNextPage,
2283
- * fetchNextPage,
2284
- * sentinelRef,
2285
- * } = useInfiniteScroll<User>(
2286
- * async ({ cursor, pageSize }) => {
2287
- * const response = await fetch(
2288
- * `/api/users?cursor=${cursor ?? ''}&limit=${pageSize}`
2289
- * );
2290
- * const data = await response.json();
2291
- * return {
2292
- * items: data.users,
2293
- * pageInfo: {
2294
- * hasNextPage: data.hasMore,
2295
- * endCursor: data.nextCursor,
2296
- * totalCount: data.total,
2297
- * },
2298
- * };
2299
- * },
2300
- * { pageSize: 20 }
2301
- * );
2302
- *
2303
- * if (isLoading) return <Spinner />;
2304
- *
2305
- * return (
2306
- * <div>
2307
- * {items.map((user) => (
2308
- * <UserCard key={user.id} user={user} />
2309
- * ))}
2310
- * {hasNextPage && (
2311
- * <div ref={sentinelRef}>
2312
- * {isFetchingMore ? <Spinner /> : 'Load more'}
2313
- * </div>
2314
- * )}
2315
- * </div>
2316
- * );
2317
- * }
2318
- * ```
2319
- *
2320
- * @example
2321
- * ```tsx
2322
- * // Manual loading
2323
- * function ProductList() {
2324
- * const { items, hasNextPage, fetchNextPage, isFetchingMore } = useInfiniteScroll(
2325
- * fetchProducts,
2326
- * { pageSize: 10 }
2327
- * );
2328
- *
2329
- * return (
2330
- * <>
2331
- * <ProductGrid items={items} />
2332
- * {hasNextPage && (
2333
- * <Button onClick={fetchNextPage} loading={isFetchingMore}>
2334
- * Load More
2335
- * </Button>
2336
- * )}
2337
- * </>
2338
- * );
2339
- * }
2340
- * ```
2341
- *
2342
- * @example
2343
- * ```tsx
2344
- * // With optimistic updates
2345
- * const { items, removeItem, updateItem, prependItems } = useInfiniteScroll(
2346
- * fetchComments,
2347
- * { pageSize: 20 }
2348
- * );
2349
- *
2350
- * // Add new comment at top
2351
- * const handleNewComment = (comment: Comment) => {
2352
- * prependItems([comment]);
2353
- * };
2354
- *
2355
- * // Delete comment
2356
- * const handleDelete = (id: string) => {
2357
- * removeItem((c) => c.id === id);
2358
- * };
2359
- *
2360
- * // Update comment
2361
- * const handleEdit = (id: string, text: string) => {
2362
- * updateItem((c) => c.id === id, { text });
2363
- * };
2364
- * ```
2365
- */
2366
- declare function useInfiniteScroll<TData = unknown, TError = Error>(fetchFn: InfiniteFetchFn<TData>, options?: UseInfiniteScrollOptions<TData, TError>): UseInfiniteScrollReturn<TData, TError>;
2367
-
2368
- export { type UseWindowSizeOptions as $, type AsyncState as A, type BreakpointChecks as B, type CookieOptions as C, type DOMRectValue as D, type UseIntersectionObserverReturn as E, type UseKeyboardShortcutOptions as F, type UseLazyQueryOptions as G, type UseLazyQueryReturn as H, type ImageDimensions as I, type UseMutationOptions as J, type KeyboardShortcut as K, type LazyQueryState as L, type MutationState as M, type UseMutationReturn as N, type UseOnlineStatusReturn as O, type PageInfo as P, type UsePasswordVisibilityOptions as Q, type UsePasswordVisibilityReturn as R, type ScrollElValue as S, type UsePopoverHoverReturn as T, type UrlConfigValues as U, type UseResponsiveQueryReturn as V, type UseScrollOffsetTopReturn as W, type UseScrollPositionOptions as X, type UseSessionStorageOptions as Y, type UseSessionStorageReturn as Z, type UseThrottleOptions as _, type Breakpoints as a, type WindowSize as a0, cookiesAvailable as a1, getCookie as a2, removeCookie as a3, setCookie as a4, useArray as a5, useAsync as a6, useAsyncFn as a7, useBackToTop as a8, useBreakpoint as a9, useSessionStorage as aA, useThrottle as aB, useThrottleCallback as aC, useUpdateEffect as aD, useUpdateLayoutEffect as aE, useWindowSize as aF, useBreakpointChecks as aa, useClientRect as ab, useConfigFromQuery as ac, useCookies as ad, useCountdownDate as ae, useCountdownSeconds as af, useDoubleClick as ag, useEnterKey as ah, useEscapeKey as ai, useFocusTrap as aj, useImageDimensions as ak, useInfiniteScroll as al, useIntersectionObserver as am, useIsomorphicLayoutEffect as an, useKeyboardShortcut as ao, useLazyQuery as ap, useMultipleImageDimensions as aq, useMutation as ar, useOnlineStatus as as, usePasswordVisibility as at, usePopoverHover as au, useResponsiveQuery as av, useScrollLock as aw, useScrollOffsetTop as ax, useScrollPosition as ay, useScrollToTop as az, type InfiniteFetchFn as b, type InfinitePage as c, type InfiniteScrollState as d, type ScrollPosition as e, type UseArrayReturn as f, type UseAsyncFnReturn as g, type UseAsyncOptions as h, type UseAsyncReturn as i, type UseBackToTopReturn as j, type UseClientRectReturn as k, type UseConfigFromQueryOptions as l, type UseConfigFromQueryReturn as m, type UseCookiesOptions as n, type UseCookiesReturn as o, type UseCountdownDateReturn as p, type UseCountdownSecondsReturn as q, type UseDoubleClickProps as r, type UseDoubleClickReturn as s, type UseFocusTrapOptions as t, type UseFocusTrapReturn as u, type UseImageDimensionsOptions as v, type UseImageDimensionsReturn as w, type UseInfiniteScrollOptions as x, type UseInfiniteScrollReturn as y, type UseIntersectionObserverOptions as z };