@akshar-technosoft/ui 1.0.24 → 1.1.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 (320) hide show
  1. package/README.md +466 -215
  2. package/dist/components/date-helper.cjs.map +1 -1
  3. package/dist/components/date-helper.d.cts +36 -0
  4. package/dist/components/date-helper.d.ts +36 -0
  5. package/dist/components/date-helper.js.map +1 -1
  6. package/dist/components/general.cjs +1 -1
  7. package/dist/components/general.cjs.map +1 -1
  8. package/dist/components/general.d.cts +25 -0
  9. package/dist/components/general.d.ts +25 -0
  10. package/dist/components/general.js +1 -1
  11. package/dist/components/general.js.map +1 -1
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +817 -28
  15. package/dist/index.d.ts +817 -28
  16. package/dist/index.js +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/lib/utils.cjs.map +1 -1
  19. package/dist/lib/utils.js.map +1 -1
  20. package/package.json +94 -87
  21. package/dist/components/core/error.cjs +0 -3
  22. package/dist/components/core/error.cjs.map +0 -1
  23. package/dist/components/core/error.d.cts +0 -5
  24. package/dist/components/core/error.d.ts +0 -5
  25. package/dist/components/core/error.js +0 -3
  26. package/dist/components/core/error.js.map +0 -1
  27. package/dist/components/core/event-success.cjs +0 -3
  28. package/dist/components/core/event-success.cjs.map +0 -1
  29. package/dist/components/core/event-success.d.cts +0 -5
  30. package/dist/components/core/event-success.d.ts +0 -5
  31. package/dist/components/core/event-success.js +0 -3
  32. package/dist/components/core/event-success.js.map +0 -1
  33. package/dist/components/core/index.cjs +0 -3
  34. package/dist/components/core/index.cjs.map +0 -1
  35. package/dist/components/core/index.d.cts +0 -7
  36. package/dist/components/core/index.d.ts +0 -7
  37. package/dist/components/core/index.js +0 -3
  38. package/dist/components/core/index.js.map +0 -1
  39. package/dist/components/core/loader.cjs +0 -3
  40. package/dist/components/core/loader.cjs.map +0 -1
  41. package/dist/components/core/loader.d.cts +0 -5
  42. package/dist/components/core/loader.d.ts +0 -5
  43. package/dist/components/core/loader.js +0 -3
  44. package/dist/components/core/loader.js.map +0 -1
  45. package/dist/components/core/notfound.cjs +0 -3
  46. package/dist/components/core/notfound.cjs.map +0 -1
  47. package/dist/components/core/notfound.d.cts +0 -5
  48. package/dist/components/core/notfound.d.ts +0 -5
  49. package/dist/components/core/notfound.js +0 -3
  50. package/dist/components/core/notfound.js.map +0 -1
  51. package/dist/components/core/offline-content.cjs +0 -3
  52. package/dist/components/core/offline-content.cjs.map +0 -1
  53. package/dist/components/core/offline-content.d.cts +0 -5
  54. package/dist/components/core/offline-content.d.ts +0 -5
  55. package/dist/components/core/offline-content.js +0 -3
  56. package/dist/components/core/offline-content.js.map +0 -1
  57. package/dist/components/core/unauthorized.cjs +0 -3
  58. package/dist/components/core/unauthorized.cjs.map +0 -1
  59. package/dist/components/core/unauthorized.d.cts +0 -5
  60. package/dist/components/core/unauthorized.d.ts +0 -5
  61. package/dist/components/core/unauthorized.js +0 -3
  62. package/dist/components/core/unauthorized.js.map +0 -1
  63. package/dist/components/data/data-table/data-table-action-bar.cjs +0 -3
  64. package/dist/components/data/data-table/data-table-action-bar.cjs.map +0 -1
  65. package/dist/components/data/data-table/data-table-action-bar.d.cts +0 -26
  66. package/dist/components/data/data-table/data-table-action-bar.d.ts +0 -26
  67. package/dist/components/data/data-table/data-table-action-bar.js +0 -3
  68. package/dist/components/data/data-table/data-table-action-bar.js.map +0 -1
  69. package/dist/components/data/data-table/data-table-column-header.cjs +0 -3
  70. package/dist/components/data/data-table/data-table-column-header.cjs.map +0 -1
  71. package/dist/components/data/data-table/data-table-column-header.d.cts +0 -11
  72. package/dist/components/data/data-table/data-table-column-header.d.ts +0 -11
  73. package/dist/components/data/data-table/data-table-column-header.js +0 -3
  74. package/dist/components/data/data-table/data-table-column-header.js.map +0 -1
  75. package/dist/components/data/data-table/data-table-faceted-filter.cjs +0 -3
  76. package/dist/components/data/data-table/data-table-faceted-filter.cjs.map +0 -1
  77. package/dist/components/data/data-table/data-table-faceted-filter.d.cts +0 -18
  78. package/dist/components/data/data-table/data-table-faceted-filter.d.ts +0 -18
  79. package/dist/components/data/data-table/data-table-faceted-filter.js +0 -3
  80. package/dist/components/data/data-table/data-table-faceted-filter.js.map +0 -1
  81. package/dist/components/data/data-table/data-table-pagination.cjs +0 -3
  82. package/dist/components/data/data-table/data-table-pagination.cjs.map +0 -1
  83. package/dist/components/data/data-table/data-table-pagination.d.cts +0 -12
  84. package/dist/components/data/data-table/data-table-pagination.d.ts +0 -12
  85. package/dist/components/data/data-table/data-table-pagination.js +0 -3
  86. package/dist/components/data/data-table/data-table-pagination.js.map +0 -1
  87. package/dist/components/data/data-table/data-table-toolbar.cjs +0 -3
  88. package/dist/components/data/data-table/data-table-toolbar.cjs.map +0 -1
  89. package/dist/components/data/data-table/data-table-toolbar.d.cts +0 -27
  90. package/dist/components/data/data-table/data-table-toolbar.d.ts +0 -27
  91. package/dist/components/data/data-table/data-table-toolbar.js +0 -3
  92. package/dist/components/data/data-table/data-table-toolbar.js.map +0 -1
  93. package/dist/components/data/data-table/data-table-types.cjs +0 -3
  94. package/dist/components/data/data-table/data-table-types.cjs.map +0 -1
  95. package/dist/components/data/data-table/data-table-types.d.cts +0 -117
  96. package/dist/components/data/data-table/data-table-types.d.ts +0 -117
  97. package/dist/components/data/data-table/data-table-types.js +0 -2
  98. package/dist/components/data/data-table/data-table-types.js.map +0 -1
  99. package/dist/components/data/data-table/data-table-view-options.cjs +0 -3
  100. package/dist/components/data/data-table/data-table-view-options.cjs.map +0 -1
  101. package/dist/components/data/data-table/data-table-view-options.d.cts +0 -9
  102. package/dist/components/data/data-table/data-table-view-options.d.ts +0 -9
  103. package/dist/components/data/data-table/data-table-view-options.js +0 -3
  104. package/dist/components/data/data-table/data-table-view-options.js.map +0 -1
  105. package/dist/components/data/data-table/data-table.cjs +0 -3
  106. package/dist/components/data/data-table/data-table.cjs.map +0 -1
  107. package/dist/components/data/data-table/data-table.d.cts +0 -8
  108. package/dist/components/data/data-table/data-table.d.ts +0 -8
  109. package/dist/components/data/data-table/data-table.js +0 -3
  110. package/dist/components/data/data-table/data-table.js.map +0 -1
  111. package/dist/components/data/data-table/index.cjs +0 -3
  112. package/dist/components/data/data-table/index.cjs.map +0 -1
  113. package/dist/components/data/data-table/index.d.cts +0 -16
  114. package/dist/components/data/data-table/index.d.ts +0 -16
  115. package/dist/components/data/data-table/index.js +0 -3
  116. package/dist/components/data/data-table/index.js.map +0 -1
  117. package/dist/components/data/data-template/data-template-action-bar.cjs +0 -3
  118. package/dist/components/data/data-template/data-template-action-bar.cjs.map +0 -1
  119. package/dist/components/data/data-template/data-template-action-bar.d.cts +0 -14
  120. package/dist/components/data/data-template/data-template-action-bar.d.ts +0 -14
  121. package/dist/components/data/data-template/data-template-action-bar.js +0 -3
  122. package/dist/components/data/data-template/data-template-action-bar.js.map +0 -1
  123. package/dist/components/data/data-template/data-template-pagination.cjs +0 -3
  124. package/dist/components/data/data-template/data-template-pagination.cjs.map +0 -1
  125. package/dist/components/data/data-template/data-template-pagination.d.cts +0 -17
  126. package/dist/components/data/data-template/data-template-pagination.d.ts +0 -17
  127. package/dist/components/data/data-template/data-template-pagination.js +0 -3
  128. package/dist/components/data/data-template/data-template-pagination.js.map +0 -1
  129. package/dist/components/data/data-template/data-template-toolbar.cjs +0 -3
  130. package/dist/components/data/data-template/data-template-toolbar.cjs.map +0 -1
  131. package/dist/components/data/data-template/data-template-toolbar.d.cts +0 -27
  132. package/dist/components/data/data-template/data-template-toolbar.d.ts +0 -27
  133. package/dist/components/data/data-template/data-template-toolbar.js +0 -3
  134. package/dist/components/data/data-template/data-template-toolbar.js.map +0 -1
  135. package/dist/components/data/data-template/data-template-types.cjs +0 -3
  136. package/dist/components/data/data-template/data-template-types.cjs.map +0 -1
  137. package/dist/components/data/data-template/data-template-types.d.cts +0 -107
  138. package/dist/components/data/data-template/data-template-types.d.ts +0 -107
  139. package/dist/components/data/data-template/data-template-types.js +0 -2
  140. package/dist/components/data/data-template/data-template-types.js.map +0 -1
  141. package/dist/components/data/data-template/data-template.cjs +0 -3
  142. package/dist/components/data/data-template/data-template.cjs.map +0 -1
  143. package/dist/components/data/data-template/data-template.d.cts +0 -8
  144. package/dist/components/data/data-template/data-template.d.ts +0 -8
  145. package/dist/components/data/data-template/data-template.js +0 -3
  146. package/dist/components/data/data-template/data-template.js.map +0 -1
  147. package/dist/components/data/data-template/index.cjs +0 -3
  148. package/dist/components/data/data-template/index.cjs.map +0 -1
  149. package/dist/components/data/data-template/index.d.cts +0 -8
  150. package/dist/components/data/data-template/index.d.ts +0 -8
  151. package/dist/components/data/data-template/index.js +0 -3
  152. package/dist/components/data/data-template/index.js.map +0 -1
  153. package/dist/components/helper/date-filter.cjs +0 -3
  154. package/dist/components/helper/date-filter.cjs.map +0 -1
  155. package/dist/components/helper/date-filter.d.cts +0 -14
  156. package/dist/components/helper/date-filter.d.ts +0 -14
  157. package/dist/components/helper/date-filter.js +0 -3
  158. package/dist/components/helper/date-filter.js.map +0 -1
  159. package/dist/components/layouts/app-container.cjs +0 -3
  160. package/dist/components/layouts/app-container.cjs.map +0 -1
  161. package/dist/components/layouts/app-container.d.cts +0 -13
  162. package/dist/components/layouts/app-container.d.ts +0 -13
  163. package/dist/components/layouts/app-container.js +0 -3
  164. package/dist/components/layouts/app-container.js.map +0 -1
  165. package/dist/components/layouts/app-content.cjs +0 -3
  166. package/dist/components/layouts/app-content.cjs.map +0 -1
  167. package/dist/components/layouts/app-content.d.cts +0 -45
  168. package/dist/components/layouts/app-content.d.ts +0 -45
  169. package/dist/components/layouts/app-content.js +0 -3
  170. package/dist/components/layouts/app-content.js.map +0 -1
  171. package/dist/components/layouts/app-footer.cjs +0 -3
  172. package/dist/components/layouts/app-footer.cjs.map +0 -1
  173. package/dist/components/layouts/app-footer.d.cts +0 -18
  174. package/dist/components/layouts/app-footer.d.ts +0 -18
  175. package/dist/components/layouts/app-footer.js +0 -3
  176. package/dist/components/layouts/app-footer.js.map +0 -1
  177. package/dist/components/layouts/app-header.cjs +0 -3
  178. package/dist/components/layouts/app-header.cjs.map +0 -1
  179. package/dist/components/layouts/app-header.d.cts +0 -19
  180. package/dist/components/layouts/app-header.d.ts +0 -19
  181. package/dist/components/layouts/app-header.js +0 -3
  182. package/dist/components/layouts/app-header.js.map +0 -1
  183. package/dist/components/layouts/factories.cjs +0 -3
  184. package/dist/components/layouts/factories.cjs.map +0 -1
  185. package/dist/components/layouts/factories.d.cts +0 -18
  186. package/dist/components/layouts/factories.d.ts +0 -18
  187. package/dist/components/layouts/factories.js +0 -3
  188. package/dist/components/layouts/factories.js.map +0 -1
  189. package/dist/components/layouts/index.cjs +0 -3
  190. package/dist/components/layouts/index.cjs.map +0 -1
  191. package/dist/components/layouts/index.d.cts +0 -8
  192. package/dist/components/layouts/index.d.ts +0 -8
  193. package/dist/components/layouts/index.js +0 -3
  194. package/dist/components/layouts/index.js.map +0 -1
  195. package/dist/components/ui/badge.cjs +0 -3
  196. package/dist/components/ui/badge.cjs.map +0 -1
  197. package/dist/components/ui/badge.d.cts +0 -13
  198. package/dist/components/ui/badge.d.ts +0 -13
  199. package/dist/components/ui/badge.js +0 -3
  200. package/dist/components/ui/badge.js.map +0 -1
  201. package/dist/components/ui/button.cjs +0 -3
  202. package/dist/components/ui/button.cjs.map +0 -1
  203. package/dist/components/ui/button.d.cts +0 -14
  204. package/dist/components/ui/button.d.ts +0 -14
  205. package/dist/components/ui/button.js +0 -3
  206. package/dist/components/ui/button.js.map +0 -1
  207. package/dist/components/ui/calendar.cjs +0 -3
  208. package/dist/components/ui/calendar.cjs.map +0 -1
  209. package/dist/components/ui/calendar.d.cts +0 -13
  210. package/dist/components/ui/calendar.d.ts +0 -13
  211. package/dist/components/ui/calendar.js +0 -3
  212. package/dist/components/ui/calendar.js.map +0 -1
  213. package/dist/components/ui/card.cjs +0 -3
  214. package/dist/components/ui/card.cjs.map +0 -1
  215. package/dist/components/ui/card.d.cts +0 -12
  216. package/dist/components/ui/card.d.ts +0 -12
  217. package/dist/components/ui/card.js +0 -3
  218. package/dist/components/ui/card.js.map +0 -1
  219. package/dist/components/ui/checkbox.cjs +0 -3
  220. package/dist/components/ui/checkbox.cjs.map +0 -1
  221. package/dist/components/ui/checkbox.d.cts +0 -7
  222. package/dist/components/ui/checkbox.d.ts +0 -7
  223. package/dist/components/ui/checkbox.js +0 -3
  224. package/dist/components/ui/checkbox.js.map +0 -1
  225. package/dist/components/ui/command.cjs +0 -3
  226. package/dist/components/ui/command.cjs.map +0 -1
  227. package/dist/components/ui/command.d.cts +0 -20
  228. package/dist/components/ui/command.d.ts +0 -20
  229. package/dist/components/ui/command.js +0 -3
  230. package/dist/components/ui/command.js.map +0 -1
  231. package/dist/components/ui/dialog.cjs +0 -3
  232. package/dist/components/ui/dialog.cjs.map +0 -1
  233. package/dist/components/ui/dialog.d.cts +0 -16
  234. package/dist/components/ui/dialog.d.ts +0 -16
  235. package/dist/components/ui/dialog.js +0 -3
  236. package/dist/components/ui/dialog.js.map +0 -1
  237. package/dist/components/ui/dropdown-menu.cjs +0 -3
  238. package/dist/components/ui/dropdown-menu.cjs.map +0 -1
  239. package/dist/components/ui/dropdown-menu.d.cts +0 -28
  240. package/dist/components/ui/dropdown-menu.d.ts +0 -28
  241. package/dist/components/ui/dropdown-menu.js +0 -3
  242. package/dist/components/ui/dropdown-menu.js.map +0 -1
  243. package/dist/components/ui/input.cjs +0 -3
  244. package/dist/components/ui/input.cjs.map +0 -1
  245. package/dist/components/ui/input.d.cts +0 -6
  246. package/dist/components/ui/input.d.ts +0 -6
  247. package/dist/components/ui/input.js +0 -3
  248. package/dist/components/ui/input.js.map +0 -1
  249. package/dist/components/ui/popover.cjs +0 -3
  250. package/dist/components/ui/popover.cjs.map +0 -1
  251. package/dist/components/ui/popover.d.cts +0 -10
  252. package/dist/components/ui/popover.d.ts +0 -10
  253. package/dist/components/ui/popover.js +0 -3
  254. package/dist/components/ui/popover.js.map +0 -1
  255. package/dist/components/ui/select.cjs +0 -3
  256. package/dist/components/ui/select.cjs.map +0 -1
  257. package/dist/components/ui/select.d.cts +0 -18
  258. package/dist/components/ui/select.d.ts +0 -18
  259. package/dist/components/ui/select.js +0 -3
  260. package/dist/components/ui/select.js.map +0 -1
  261. package/dist/components/ui/separator.cjs +0 -3
  262. package/dist/components/ui/separator.cjs.map +0 -1
  263. package/dist/components/ui/separator.d.cts +0 -7
  264. package/dist/components/ui/separator.d.ts +0 -7
  265. package/dist/components/ui/separator.js +0 -3
  266. package/dist/components/ui/separator.js.map +0 -1
  267. package/dist/components/ui/sheet.cjs +0 -3
  268. package/dist/components/ui/sheet.cjs.map +0 -1
  269. package/dist/components/ui/sheet.d.cts +0 -18
  270. package/dist/components/ui/sheet.d.ts +0 -18
  271. package/dist/components/ui/sheet.js +0 -3
  272. package/dist/components/ui/sheet.js.map +0 -1
  273. package/dist/components/ui/table.cjs +0 -3
  274. package/dist/components/ui/table.cjs.map +0 -1
  275. package/dist/components/ui/table.d.cts +0 -13
  276. package/dist/components/ui/table.d.ts +0 -13
  277. package/dist/components/ui/table.js +0 -3
  278. package/dist/components/ui/table.js.map +0 -1
  279. package/dist/components/ui/toggle.cjs +0 -3
  280. package/dist/components/ui/toggle.cjs.map +0 -1
  281. package/dist/components/ui/toggle.d.cts +0 -16
  282. package/dist/components/ui/toggle.d.ts +0 -16
  283. package/dist/components/ui/toggle.js +0 -3
  284. package/dist/components/ui/toggle.js.map +0 -1
  285. package/dist/components/ui/tooltip.cjs +0 -3
  286. package/dist/components/ui/tooltip.cjs.map +0 -1
  287. package/dist/components/ui/tooltip.d.cts +0 -10
  288. package/dist/components/ui/tooltip.d.ts +0 -10
  289. package/dist/components/ui/tooltip.js +0 -3
  290. package/dist/components/ui/tooltip.js.map +0 -1
  291. package/dist/context/app-meta/context.cjs +0 -3
  292. package/dist/context/app-meta/context.cjs.map +0 -1
  293. package/dist/context/app-meta/context.d.cts +0 -18
  294. package/dist/context/app-meta/context.d.ts +0 -18
  295. package/dist/context/app-meta/context.js +0 -3
  296. package/dist/context/app-meta/context.js.map +0 -1
  297. package/dist/context/app-meta/hooks.cjs +0 -3
  298. package/dist/context/app-meta/hooks.cjs.map +0 -1
  299. package/dist/context/app-meta/hooks.d.cts +0 -10
  300. package/dist/context/app-meta/hooks.d.ts +0 -10
  301. package/dist/context/app-meta/hooks.js +0 -3
  302. package/dist/context/app-meta/hooks.js.map +0 -1
  303. package/dist/context/app-meta/index.cjs +0 -3
  304. package/dist/context/app-meta/index.cjs.map +0 -1
  305. package/dist/context/app-meta/index.d.cts +0 -5
  306. package/dist/context/app-meta/index.d.ts +0 -5
  307. package/dist/context/app-meta/index.js +0 -3
  308. package/dist/context/app-meta/index.js.map +0 -1
  309. package/dist/context/app-meta/types.cjs +0 -3
  310. package/dist/context/app-meta/types.cjs.map +0 -1
  311. package/dist/context/app-meta/types.d.cts +0 -48
  312. package/dist/context/app-meta/types.d.ts +0 -48
  313. package/dist/context/app-meta/types.js +0 -2
  314. package/dist/context/app-meta/types.js.map +0 -1
  315. package/dist/context/index.cjs +0 -3
  316. package/dist/context/index.cjs.map +0 -1
  317. package/dist/context/index.d.cts +0 -5
  318. package/dist/context/index.d.ts +0 -5
  319. package/dist/context/index.js +0 -3
  320. package/dist/context/index.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,29 +1,818 @@
1
- export { DataTable } from './components/data/data-table/data-table.js';
2
- export { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection } from './components/data/data-table/data-table-action-bar.js';
3
- export { DataTableProps, GroupColumnDef } from './components/data/data-table/data-table-types.js';
4
- export { DataTemplate } from './components/data/data-template/data-template.js';
5
- export { DataTemplateProps } from './components/data/data-template/data-template-types.js';
6
- export { DataTemplateActionBar, DataTemplateActionBarAction, DataTemplateActionBarSelection } from './components/data/data-template/data-template-action-bar.js';
7
- export { AppMetaProvider, createTypedAppMetaContext } from './context/app-meta/context.js';
8
- export { createPageTemplateHook } from './context/app-meta/hooks.js';
9
- export { AppMeta } from './context/app-meta/types.js';
10
- export { createLayoutComponents } from './components/layouts/factories.js';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Table, ColumnDef, Row } from '@tanstack/react-table';
3
+ import { LucideIcon } from 'lucide-react';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+ import * as React$1 from 'react';
6
+ import React__default, { ReactNode } from 'react';
7
+ import { VariantProps } from 'class-variance-authority';
8
+ import { motion } from 'framer-motion';
9
+ import { RegisteredRoutes } from '@akshar-technosoft/router';
11
10
  export { GeneralHelper } from './components/general.js';
12
- export { ErrorComponent } from './components/core/error.js';
13
- export { CurrencyTransfer } from './components/core/event-success.js';
14
- export { Loader } from './components/core/loader.js';
15
- export { NotFound } from './components/core/notfound.js';
16
- export { OfflineUI } from './components/core/offline-content.js';
17
- export { Unauthorized } from './components/core/unauthorized.js';
18
- import 'react/jsx-runtime';
19
- import './components/ui/button.js';
20
- import 'class-variance-authority/types';
21
- import 'react';
22
- import 'class-variance-authority';
23
- import '@tanstack/react-table';
24
- import 'framer-motion';
25
- import 'lucide-react';
26
- import './components/layouts/app-container.js';
27
- import './components/layouts/app-header.js';
28
- import './components/layouts/app-content.js';
29
- import './components/layouts/app-footer.js';
11
+
12
+ /**
13
+ * Storage for the DataTable `persist` feature: filter values, global search text, external
14
+ * (server) filter values and pagination survive unmount/back-navigation — in-memory by default,
15
+ * optionally localStorage (`local: true`).
16
+ *
17
+ * Values are stored per FILTER IDENTITY (`key`/`id`), not as raw TanStack state — that's what
18
+ * lets a `shared` slot apply across pages even when the pages use different filter keys or one
19
+ * side is an `externalSearch` filter.
20
+ */
21
+ /**
22
+ * Augment this interface ONCE in the app to get autocomplete + typo checking for `group` and
23
+ * `shared` (without it both are plain strings):
24
+ * ```ts
25
+ * // src/types/table-persist.d.ts
26
+ * declare module "@akshar-technosoft/ui" {
27
+ * interface PersistGroupRegistry { inhouse: "party" | "material"; sales: "party" }
28
+ * }
29
+ * ```
30
+ */
31
+ interface PersistGroupRegistry {
32
+ }
33
+ type PersistGroupId = keyof PersistGroupRegistry extends never ? string : keyof PersistGroupRegistry & string;
34
+ type PersistSlotId = keyof PersistGroupRegistry extends never ? string : PersistGroupRegistry[keyof PersistGroupRegistry] & string;
35
+ type PersistConfig = {
36
+ /**
37
+ * Unique id for this table ACROSS THE WHOLE APP (it's the storage map key, and the
38
+ * localStorage key when `local: true`). Two tables with the same key share one saved state —
39
+ * that's a bug unless you meant it. One page with two tables needs two keys.
40
+ */
41
+ key: string;
42
+ /**
43
+ * Namespace for `shared` filter slots — ONLY tables with the same group exchange those values
44
+ * (a "party" slot in group "inhouse" never leaks into group "sales"). Required for `shared`
45
+ * to do anything; a `shared` filter on a table without a group is inert (dev warning).
46
+ */
47
+ group?: PersistGroupId;
48
+ /**
49
+ * Also write to localStorage so state survives refresh/re-login.
50
+ * NOTE: unlike zustand's `persist` middleware, the default here is IN-MEMORY (back-navigation
51
+ * only); localStorage is the opt-in. Multi-client caveat: localStorage is per-browser, not
52
+ * per-login — a client switch on the same machine sees the previous client's saved filters.
53
+ * @default false
54
+ */
55
+ local?: boolean;
56
+ /** Set false to persist filters only, not page index/size. @default true */
57
+ pagination?: boolean;
58
+ };
59
+ /**
60
+ * Persisted external (server) filter values for a table key — use in the PAGE's query-params
61
+ * initializer so the very first request already carries the restored filters (otherwise the
62
+ * default request fires once and is immediately superseded by the replayed one):
63
+ * ```ts
64
+ * const [params, setParams] = useState(() => ({ Status: "Completed", ...mapToParams(readPersistedExternal("qc-completed")) }))
65
+ * ```
66
+ */
67
+ declare function readPersistedExternal(key: string): Record<string, unknown>;
68
+
69
+ type TableExportColumn = {
70
+ /** The column's id (accessorKey for accessor columns). */
71
+ id: string;
72
+ /** Header text: `exportHeader` if given, else the string `header`, else the id. */
73
+ header: string;
74
+ };
75
+ /**
76
+ * A plain, file-format-agnostic snapshot of what the table is currently showing: the visible
77
+ * columns in display order and every row that survives the active filters and sorting (all pages,
78
+ * not just the one on screen). Hand it to an app-side writer (Excel, CSV, print) — the table never
79
+ * touches file generation itself, so the component stays free of heavy spreadsheet dependencies.
80
+ */
81
+ type TableExportView<TData = unknown> = {
82
+ columns: TableExportColumn[];
83
+ /** One array per row, cell values in `columns` order. Values keep their native type (number,
84
+ * Date, boolean…) so the writer can apply proper cell formatting instead of dumping strings. */
85
+ rows: unknown[][];
86
+ /** The filtered + sorted row originals, same order as `rows`, for writers that want raw data. */
87
+ originals: TData[];
88
+ };
89
+ /**
90
+ * Build a {@link TableExportView} from the table's CURRENT state, exactly as the user shaped it:
91
+ * hidden columns are skipped, column order (including pinning) is respected, and rows come from the
92
+ * pre-pagination model, so they are filtered and sorted but not cut to the visible page.
93
+ *
94
+ * Which columns make it in: a visible column is exported when it has an accessor (accessorKey or
95
+ * accessorFn) or a `exportValue` on its def. Display-only columns (actions, JSX-composed cells
96
+ * without an accessor) are skipped unless they provide `exportValue`. A JSX `header` falls back to
97
+ * the column id unless `exportHeader` names it.
98
+ *
99
+ * Call it anywhere you hold the table instance (from `onTableReady` or the `children` render prop);
100
+ * the toolbar's Export button calls it for you and passes the result to `onExport`.
101
+ */
102
+ declare function getTableExportView<TData>(table: Table<TData>): TableExportView<TData>;
103
+
104
+ type Paths<T, Prefix extends string = ''> = T extends object ? {
105
+ [K in keyof T]: K extends string ? T[K] extends object ? Paths<T[K], `${Prefix}${K}.`> | `${Prefix}${K}` : `${Prefix}${K}` : never;
106
+ }[keyof T] : never;
107
+ type NumericKeys<T> = {
108
+ [K in keyof T]: T[K] extends number ? K : never;
109
+ }[keyof T];
110
+ type AggregationConfigMap<TData> = {
111
+ [K in NumericKeys<TData>]?: AggregationConfig<TData>;
112
+ } & {
113
+ [key: string]: AggregationConfig<TData> | undefined;
114
+ };
115
+ type AggregationFunction = 'sum' | 'average' | 'min' | 'max' | 'count' | 'unique' | 'median';
116
+ type AggregationConfig<TData> = {
117
+ enabled: boolean;
118
+ functions?: AggregationFunction[];
119
+ format?: (value: any, func: AggregationFunction) => string;
120
+ accessor?: (row: TData) => number | null;
121
+ };
122
+ /** Fields shared by every filter control, independent of how it locates its value. */
123
+ type FilterControlConfig = {
124
+ /** Input placeholder and the filter's display label (also used on chips and the grouped picker). */
125
+ placeholder: string;
126
+ /**
127
+ * Which control to render and how the value is entered. Set it to match the field's shape so the
128
+ * user gets the right input:
129
+ * `'text'` (the default) is a free text box, matched as a case insensitive contains.
130
+ * `'select'` is a dropdown of fixed choices; it requires `options`, and the picked value is
131
+ * matched as given (use it for status, yes/no, category style fields).
132
+ * `'date'` is a single date picker; `'daterange'` is a from/to range picker. Both accept `dateFormat`.
133
+ * `'number'` is a numeric input.
134
+ * @default "text"
135
+ */
136
+ type?: "text" | "select" | "date" | "daterange" | "number";
137
+ /** Choices for `type: "select"`. Each `value` is what the filter matches; `label` is what the
138
+ * user sees. Required when `type` is `"select"`; ignored otherwise. */
139
+ options?: {
140
+ label: string;
141
+ value: string;
142
+ }[];
143
+ /** Tailwind width class for the control wrapper (e.g. `"max-w-[150px]"`). */
144
+ width?: string;
145
+ /** Leading icon inside the control. */
146
+ icon?: LucideIcon;
147
+ /**
148
+ * Run this filter on the server instead of the local data. When set, the filter's value is NOT
149
+ * applied to the in-memory rows; instead it is collected and handed to `onExternalSearch(values)`
150
+ * so the parent can re-query the API. The call fires automatically at the control's natural commit
151
+ * point: a `select` on pick, a `date`/`daterange` on Apply, and a `text` box after a short debounce.
152
+ */
153
+ externalSearch?: boolean;
154
+ /** date-fns format string for displaying the selected date(s), e.g. "dd MMM yyyy". */
155
+ dateFormat?: string;
156
+ /**
157
+ * Where this filter's control is placed inside the toolbar. Both variants require
158
+ * `settings.showToolbar: true`, because every filter lives in the toolbar; with the toolbar off no
159
+ * filter renders at all, whatever its placement.
160
+ *
161
+ * `'bar'` (the default) sits inline on the toolbar's left row and is always visible. Use it for the
162
+ * few primary filters you combine constantly (for example product and category), so they stay side
163
+ * by side.
164
+ *
165
+ * `'menu'` keeps the control off the bar: it becomes an option in the global search's field
166
+ * picker (which appears automatically when `enableGlobalFilter` is on and any `'menu'` filter
167
+ * exists), and while it holds a value it shows as a removable chip on the bar. Use it so many
168
+ * filters don't fill the toolbar with boxes.
169
+ *
170
+ * @default 'bar'
171
+ */
172
+ placement?: "bar" | "menu";
173
+ /**
174
+ * Share this filter's VALUE across every page whose table has the same `persist.group`, under
175
+ * this slot name (e.g. `shared: "party"` — search a party on one page, the next page in the
176
+ * group opens already filtered to it). The slot stores only the value, so pages can bind it to
177
+ * different filter keys, or even to an `externalSearch` filter. Requires `persist.group`.
178
+ */
179
+ shared?: PersistSlotId;
180
+ /**
181
+ * Set false to exclude this one filter from persistence (scan boxes, one-shot searches) while
182
+ * the rest of the table persists. Inert without the table-level `persist` prop. @default true
183
+ */
184
+ persist?: boolean;
185
+ };
186
+ /**
187
+ * A filter bound to a real data field by its path. Use this form (the common one) whenever the value
188
+ * you filter on is a plain field on the row, flat or nested.
189
+ *
190
+ * `key` is a dot path into the row, validated against `T`, and doubles as the filter's identity. How
191
+ * it filters depends on whether a column already owns that path:
192
+ * If a visible column has the same `accessorKey`, the filter drives that column with TanStack's
193
+ * built in case insensitive contains match. This is the normal, zero setup case.
194
+ * If no column owns the path (the field is only shown inside another cell, for example a "SKU and
195
+ * Category" cell that prints three fields), the table auto generates a hidden, filter only column
196
+ * for it so the same contains match still works. You do not touch the `columns` array.
197
+ *
198
+ * Reach for {@link CustomFilterConfig} instead only when the match is not a plain contains on one
199
+ * field, for example matching inside an array of objects or across several fields at once.
200
+ */
201
+ type PathFilterConfig<T> = FilterControlConfig & {
202
+ /** Dot path into the row (validated against `T`). Serves as both the value source and the id. */
203
+ key: Paths<T>;
204
+ id?: never;
205
+ filterFn?: never;
206
+ };
207
+ /**
208
+ * A filter that owns its matching logic. Use this form when the value is not a plain field, for
209
+ * example a cell holding an array of objects, or when one control should match across several fields.
210
+ *
211
+ * You provide `filterFn(row, value)`, which receives the whole row (so it can read any field or
212
+ * array) and returns whether the row passes. The table wires it to an auto generated hidden, filter
213
+ * only column, so it runs inside TanStack's normal filtering and AND combines with every other
214
+ * filter; you never touch the `columns` array. `id` is any unique string that identifies this filter
215
+ * (it does not need to be a real field, because `filterFn` reads the row itself).
216
+ *
217
+ * @example
218
+ * // Match if ANY lot in the row's array has a matching number, and (separately) if any is urgent.
219
+ * const filters = [
220
+ * { id: "lotNo", type: "text", placeholder: "Lot No",
221
+ * filterFn: (row, v) => row.lots.some(l => String(l.lotNo).toLowerCase().includes(String(v).toLowerCase())) },
222
+ * { id: "urgentOnly", type: "select", placeholder: "Urgent", options: [{ label: "Urgent", value: "1" }],
223
+ * filterFn: (row, v) => !v || row.lots.some(l => l.isUrgent) },
224
+ * ];
225
+ */
226
+ type CustomFilterConfig<T> = FilterControlConfig & {
227
+ /** Any unique string identifying this filter. Not required to be a real field, since `filterFn`
228
+ * reads the row directly. */
229
+ id: string;
230
+ /** Predicate deciding whether a row passes. Receives the full row and the current filter value. */
231
+ filterFn: (row: T, value: any) => boolean;
232
+ key?: never;
233
+ };
234
+ /**
235
+ * One toolbar filter control. Pick the form by how the value is located:
236
+ * {@link PathFilterConfig} — pass `key` (a real dot path). The common case: flat or nested fields.
237
+ * {@link CustomFilterConfig} — pass `id` + `filterFn`. For arrays of objects or multi field matches.
238
+ * Either way the filtering runs through TanStack's model and AND combines; you never edit `columns`.
239
+ */
240
+ type FilterConfig<T> = PathFilterConfig<T> | CustomFilterConfig<T>;
241
+ type PaginationConfig = {
242
+ /** Rows per page initially. @default 10 */
243
+ pageSize?: number;
244
+ /** Options in the "Rows" selector. `-1` renders "All". Pass `[]` to hide the selector.
245
+ * @default [10, 25, 50, 100, -1] */
246
+ pageSizeOptions?: number[];
247
+ /** Show the "Showing X to Y of Z" range text. @default true */
248
+ showInfo?: boolean;
249
+ /** Show numbered page buttons (with ellipsis window); otherwise just prev/next. @default false */
250
+ showPageNumbers?: boolean;
251
+ };
252
+ /**
253
+ * Feature and presentation toggles for the table. Every field is optional and its default is noted.
254
+ * Many flags are inert unless a "master" flag is also on, and that coupling is the usual reason a
255
+ * setting appears to do nothing. The master relationships:
256
+ *
257
+ * `showToolbar` owns everything drawn in the toolbar row (global search, the whole `filters` UI, the
258
+ * Columns menu, the Aggregations menu, Export, Refresh, the bulk pin actions). The per column sort
259
+ * and pin menus are drawn in the header instead, so they keep working when `showToolbar` is off.
260
+ *
261
+ * `enableFiltering` owns the filter engine. `enableGlobalFilter` can still render its box but will
262
+ * not remove any rows while `enableFiltering` is off.
263
+ *
264
+ * `enableRowSelection` owns the select column. `selectionMode`, `showCheckbox`,
265
+ * `enableHeaderCheckbox` and `fixedCheckboxColumn` are all inert without it.
266
+ *
267
+ * `enableColumnPinning` owns pinning, which `fixedCheckboxColumn` depends on.
268
+ *
269
+ * The global search's field picker appears automatically when `enableGlobalFilter` is on and
270
+ * any filter has `placement: 'menu'` — there is no separate flag for it.
271
+ */
272
+ type TableSettings = {
273
+ /**
274
+ * Render the column header row. Turning it off also removes sorting, the pin menu and resize
275
+ * handles (they live in the header) even when their flags are on. Suited to compact read-only
276
+ * lists.
277
+ * @default true
278
+ */
279
+ showHeader?: boolean;
280
+ /**
281
+ * Allow sorting. Clicking a sortable header cycles asc → desc → clear, and each header cell's "⋯"
282
+ * menu offers the same actions explicitly; an arrow at the header's right edge shows the active
283
+ * direction. Clicks on interactive elements inside custom JSX headers do not sort. The serial
284
+ * "No." column sorts on its display index, so sorting it is rarely meaningful.
285
+ * @default true
286
+ */
287
+ enableSorting?: boolean;
288
+ /**
289
+ * Render the toolbar row above the table. This is the largest master switch: with it off you lose
290
+ * the global search, the entire `filters` UI (both bar filters and the "Filters" menu), the Columns
291
+ * menu, the Aggregations menu, Export, Refresh and the bulk pin actions, because all of them are
292
+ * hosted here. The header's own per column menus are unaffected. Enable it for data heavy screens; leave it off for display-only tables.
293
+ * @default false
294
+ */
295
+ showToolbar?: boolean;
296
+ /**
297
+ * Placement of the toolbar relative to the card. `'default'` renders it outside and above the card.
298
+ * `'above-header'` and `'below-header'` render it inside the card as a sticky band that stacks with
299
+ * the optional `header` prop; the component measures these bands at runtime to compute the header's
300
+ * sticky offset. Only relevant while `toolbar` is on.
301
+ * @default 'default'
302
+ */
303
+ toolbarPosition?: 'above-header' | 'below-header' | 'default';
304
+ /**
305
+ * Install the filter row model. This is the engine both column filters and the global search run
306
+ * on, so it is the real on and off for filtering: with it off a search box can render but no rows
307
+ * are removed. Aggregations compute over the filtered rows, so they see the full data set when this
308
+ * is off.
309
+ * @default true
310
+ */
311
+ enableFiltering?: boolean;
312
+ /**
313
+ * Show the global search box. It matches a row's accessor columns only, with a case insensitive
314
+ * contains test, so a column rendered purely through `cell` with no `accessorKey` or `accessorFn`
315
+ * is invisible to it; give such a column an `accessorFn` to make it searchable. Needs `showToolbar` to
316
+ * appear and `enableFiltering` to actually narrow rows.
317
+ * @default true
318
+ */
319
+ enableGlobalFilter?: boolean;
320
+ /**
321
+ * Show the "Columns" menu that toggles column visibility. Columns marked `enableHiding: false` (the
322
+ * serial and select helpers) never appear in it, and grouped columns are listed under their group
323
+ * heading. It is part of the toolbar, so it needs `showToolbar` to be visible.
324
+ * @default true
325
+ */
326
+ enableColumnVisibility?: boolean;
327
+ /**
328
+ * Add the leading selection column and turn on row selection. Selection is enforced at the table
329
+ * level against `isRowSelectable`, so those rows cannot be caught even by select all, and
330
+ * `onRowSelectionChange` reports only genuinely selectable rows. Master for the whole
331
+ * selection group below.
332
+ * @default true
333
+ */
334
+ enableRowSelection?: boolean;
335
+ /**
336
+ * Allow the user to drag column widths. Resizing runs live and the handles sit on the right edge of
337
+ * each header cell, so `showHeader: false` removes the ability to resize. A pinned column is locked
338
+ * to its size, so if you also pin, resize the column first and pin afterwards.
339
+ * @default false
340
+ */
341
+ enableColumnResizing?: boolean;
342
+ /**
343
+ * Master switch for sticky pinned columns. The serial and select columns are always pinned left and
344
+ * re-pinned on every change so they cannot drift. Users pin one column from the header's "⋯" menu
345
+ * (works without the toolbar) or in bulk from the toolbar's settings menu. A pinned column is
346
+ * clamped to its rendered width so its content cannot push it wider and break the sticky offsets.
347
+ * @default true
348
+ */
349
+ enableColumnPinning?: boolean;
350
+ /**
351
+ * The header's select-all checkbox. Set false to grey it out while keeping per-row checkboxes
352
+ * usable (select-all too costly/dangerous, manual multi-select still wanted). Only meaningful
353
+ * in `'multiple'` mode.
354
+ * @default true
355
+ */
356
+ enableHeaderCheckbox?: boolean;
357
+ /**
358
+ * Lock the select column in place by hiding its pin menu so users cannot move or unpin it. Needs
359
+ * `enableRowSelection` and `enableColumnPinning`.
360
+ * @remarks Half wired today: `onColumnPinningChange` re-pins the select column to the left on every
361
+ * change regardless of this flag, so setting it `false` only exposes a pin menu whose Unpin has no
362
+ * effect.
363
+ * @default true
364
+ */
365
+ fixedCheckboxColumn?: boolean;
366
+ /**
367
+ * Show the leading "No." column. It prints the row's position in the current view (`index + 1`), so
368
+ * it renumbers as you sort, filter or page and is not a stable record id. When any aggregation is
369
+ * enabled its footer cell shows the total row count.
370
+ * @default true
371
+ */
372
+ showSerialNumbers?: boolean;
373
+ /**
374
+ * Zebra stripe alternate rows for readability. The stripe follows a row's position on the current
375
+ * page, so the pattern stays consistent as you page through the data.
376
+ * @default true
377
+ */
378
+ striped?: boolean;
379
+ /**
380
+ * Highlight the row under the cursor. Selected rows keep a stronger background of their own, so the
381
+ * hover and selected states stay distinguishable.
382
+ * @default true
383
+ */
384
+ hoverable?: boolean;
385
+ /**
386
+ * Compact density. Tightens the vertical padding across header, body and footer cells so more rows
387
+ * fit on screen. Turn it off for a roomier, more touch friendly layout.
388
+ * @default true
389
+ */
390
+ compact?: boolean;
391
+ /**
392
+ * Draw cell separators. Interior columns get a right border, while the last column and the last
393
+ * unpinned column before a right pinned group intentionally drop theirs, so the border never doubles
394
+ * against a pinned column's sticky separator.
395
+ * @default true
396
+ */
397
+ bordered?: boolean;
398
+ /**
399
+ * Let the table card flex to fill its parent's height, which only takes effect inside a parent that
400
+ * has a bounded height. Pair it with `maxHeight` so the body scrolls while the header and footer
401
+ * stay sticky. Use it for full page tables.
402
+ * @default false
403
+ */
404
+ fullHeight?: boolean;
405
+ /**
406
+ * Selection style. `'multiple'` shows checkboxes plus a select all header checkbox. `'single'` shows
407
+ * a radio, makes the whole row clickable, and selecting a row clears any previous selection. Needs
408
+ * `enableRowSelection`.
409
+ * @default "multiple"
410
+ */
411
+ selectionMode?: "single" | "multiple";
412
+ /**
413
+ * In `'single'` mode, whether to draw the radio control at all. With it `false` the radio is hidden
414
+ * but the row stays clickable, which suits designs that select by clicking the row itself. No effect
415
+ * in `'multiple'` mode.
416
+ * @default true
417
+ */
418
+ showCheckbox?: boolean;
419
+ /**
420
+ * Show removable chips on the toolbar for applied `placement: 'menu'` filters, so collapsed
421
+ * filters stay visible while active. Turn off if the bar gets cluttered — active menu filters
422
+ * are then only visible through their control in the search field picker.
423
+ * @default true
424
+ */
425
+ showFilterChips?: boolean;
426
+ /**
427
+ * Label on the global search's field picker while "all fields" is selected. The picker itself
428
+ * appears automatically when `enableGlobalFilter` is on and at least one filter has
429
+ * `placement: 'menu'`. @default "Global"
430
+ */
431
+ groupedFilterLabel?: string;
432
+ };
433
+ type ColumnFooter<TData> = {
434
+ content?: React.ReactNode | ((table: Table<TData>) => React.ReactNode);
435
+ align?: 'left' | 'center' | 'right';
436
+ className?: string;
437
+ };
438
+ type TableHeaderProps = {
439
+ content: React.ReactNode;
440
+ align?: 'left' | 'center' | 'right';
441
+ className?: string;
442
+ showOnEmpty?: boolean;
443
+ };
444
+ type GroupColumnDef<TData> = ColumnDef<TData> & {
445
+ columns?: GroupColumnDef<TData>[];
446
+ enablePinning?: boolean;
447
+ headerAlign?: 'left' | 'center' | 'right';
448
+ customFooter?: ColumnFooter<TData>;
449
+ /**
450
+ * Value this column contributes to an export (see `getTableExportView`). Without it the export
451
+ * uses the column's accessor value, which covers plain columns; provide it when the cell renders
452
+ * a JSX composite (several fields in one cell) so the export gets a flat printable value instead
453
+ * of losing the column, and on display-only columns (no accessor) that should still export.
454
+ * Return native types (number, Date…) so the writer can format cells properly.
455
+ * @example exportValue: (row) => `${row.RefNo} (${row.RefDate})`
456
+ */
457
+ exportValue?: (row: TData) => unknown;
458
+ /**
459
+ * Header text used in exports when `header` is JSX and therefore unprintable. A plain string
460
+ * `header` is used as-is and does not need this.
461
+ */
462
+ exportHeader?: string;
463
+ };
464
+ type DataTableProps<TData> = {
465
+ /** Row data. Rendered client-side (filter/sort/paginate all in-memory unless server-driven). */
466
+ data: TData[];
467
+ /** Column definitions. TanStack `ColumnDef` plus a few extras; see {@link GroupColumnDef}. */
468
+ columns: GroupColumnDef<TData>[];
469
+ /** Toolbar filter controls (see {@link FilterConfig}); place each on the bar or behind the global
470
+ * search's field picker via `FilterConfig.placement`. Debug: filters live in the toolbar, so none
471
+ * render unless `settings.showToolbar: true`. */
472
+ filters?: FilterConfig<TData>[];
473
+ /** Pagination config — its presence enables pagination. Omit to render all rows. */
474
+ pagination?: PaginationConfig;
475
+ /** Feature and presentation toggles; see {@link TableSettings} for the full dependency map. */
476
+ settings?: TableSettings;
477
+ /** Title/header area above the table. Plain node, or {@link TableHeaderProps} for alignment control. */
478
+ header?: React.ReactNode | TableHeaderProps;
479
+ /** Sticky footer content (spans full width). */
480
+ footer?: React.ReactNode;
481
+ /** Extra class on the outer wrapper. */
482
+ className?: string;
483
+ /** Max height of the scroll container (enables sticky header/footer). @default "100%" */
484
+ maxHeight?: string;
485
+ /** Show the loading overlay. @default false */
486
+ loading?: boolean;
487
+ /** Error message. When set it replaces the table with an error card, which also offers Try Again
488
+ * when `onRefresh` is given. */
489
+ error?: string;
490
+ /** Text shown when there are no rows. @default "No data available" */
491
+ emptyMessage?: string;
492
+ /** Fires with the selected row originals whenever selection changes. Requires `enableRowSelection`.
493
+ * @remarks Unselectable rows (see `isRowSelectable`) are filtered out. */
494
+ onRowSelectionChange?: (selectedRows: TData[]) => void;
495
+ /**
496
+ * Called by the toolbar Export button. `data` is the filtered + sorted row originals (all pages,
497
+ * not just the visible one) and `view` is the ready-to-write snapshot of the visible columns and
498
+ * cell values (see `getTableExportView` — call it yourself via `onTableReady` for export buttons
499
+ * that live outside the toolbar). Feed `view` to the app's Excel/CSV writer.
500
+ */
501
+ onExport?: (data: TData[], view: TableExportView<TData>) => void;
502
+ /** Called by the toolbar Refresh button (and the error card's Try Again). */
503
+ onRefresh?: () => void;
504
+ /** Escape hatch that hands you the TanStack `table` instance for imperative control. */
505
+ onTableReady?: (table: Table<TData>) => void;
506
+ /** Render-prop for an action bar etc.; receives the `table` instance. */
507
+ children?: (table: Table<TData>) => React.ReactNode;
508
+ /** Return false to make a row unselectable: its checkbox greys out, select-all skips it and
509
+ * `onRowSelectionChange` never reports it. The row itself stays fully visible and interactive. */
510
+ isRowSelectable?: (row: TData) => boolean;
511
+ /**
512
+ * Returns a **stable, unique id for a row**, derived from your own data. Forwarded straight to
513
+ * TanStack's `getRowId`. You are not assigning an id — you point at the field(s) that already
514
+ * uniquely identify the record, and TanStack calls this to read it.
515
+ *
516
+ * **Why it matters:** without it, selection (and expansion/pinning) is keyed by the row's *index in
517
+ * the `data` array*. That is fine as long as the array never changes, but the moment `data` is
518
+ * replaced or reordered — a refetch, a tab switch to a different list, an insert/delete that shifts
519
+ * everything after it — index `2` now points at a different record, so the wrong rows appear
520
+ * selected. With `getRowId`, selection is keyed by the record itself and survives all of that.
521
+ *
522
+ * (Client-side sort / filter / pagination alone do **not** need this — they don't mutate the `data`
523
+ * array, so index-based ids stay correct. It's specifically array replacement/reordering that breaks.)
524
+ *
525
+ * **When to pass it:** any table that has row selection *and* whose `data` can be refetched,
526
+ * reordered, or have rows added/removed. Also **required** for `defaultSelectedRows` to target rows
527
+ * reliably. Display-only or never-refetched tables can omit it.
528
+ *
529
+ * Pick field(s) guaranteed unique per row; combine with `-` when no single field is unique.
530
+ * @example getRowId={(row) => String(row.id)}
531
+ * @example getRowId={(row) => `${row.Code}-${row.Type}`} // unique only as a pair
532
+ */
533
+ getRowId?: (row: TData, index: number) => string;
534
+ /**
535
+ * **Uncontrolled prefill.** Return `true` for rows that should start already selected. The table
536
+ * keeps owning selection state afterwards — this only seeds the initial value (same idea as
537
+ * `<input defaultChecked>`), so you do not have to manage a controlled selection yourself.
538
+ *
539
+ * **Timing:** seeded exactly once, after the first non-empty `data` load (so it works even when data
540
+ * arrives async). It is *not* re-run on later data changes — that would wipe the user's own
541
+ * selections on every refetch. To deliberately re-seed for a new dataset (e.g. switching tabs),
542
+ * remount the table with a React `key`.
543
+ *
544
+ * **Safety:** only rows the table considers selectable are seeded — a row failing `isRowSelectable`
545
+ * is skipped, so prefill can never select an unselectable row. Setting selection here
546
+ * flows through the normal path, so `onRowSelectionChange`, the action bar, and any
547
+ * "disable others once one is selected" logic react exactly as they do for a real user click.
548
+ *
549
+ * **Pair with `getRowId`** so the seeded rows are matched by record, not by array position.
550
+ * @example defaultSelectedRows={(row) => row.WasPreviouslyPicked}
551
+ */
552
+ defaultSelectedRows?: (row: TData) => boolean;
553
+ /** Server side search callback. Receives the staged external filter values when the Search button
554
+ * is pressed; run your query here. */
555
+ onExternalSearch?: (filters: Record<string, any>) => void;
556
+ /** Column aggregations (footer sums / averages / counts …), parent-controlled. The footer row
557
+ * appears whenever any column's config is `enabled`. Debug: the toolbar's Aggregations menu (to
558
+ * toggle them from the UI) additionally needs `onAggregationChange` + `settings.showToolbar` + at
559
+ * least one numeric column. @see AggregationConfigMap */
560
+ aggregations?: AggregationConfigMap<TData>;
561
+ /** Fires when the user toggles an aggregation in the toolbar menu; persist it into your
562
+ * `aggregations` state (the component does not own it). Without this the toggle menu is hidden. */
563
+ onAggregationChange?: (columnId: string, config: AggregationConfig<TData>) => void;
564
+ /** Per-row className (e.g. status-based row colouring). */
565
+ rowClassName?: (row: Row<TData>) => string;
566
+ /**
567
+ * Persist this table's filters, global search, external filter values and pagination across
568
+ * unmount/back-navigation. In-memory by default (refresh = fresh); `local: true` adds
569
+ * localStorage. String shorthand = `{ key }`. Absent = no persistence (today's behaviour).
570
+ * Restore is synchronous (seeded before first render — no unfiltered flash); external filters
571
+ * are replayed through `onExternalSearch` on mount (see `readPersistedExternal` to seed the
572
+ * page's own query instead). Selection is never persisted. See {@link PersistConfig}.
573
+ * @example persist="qc-completed"
574
+ * @example persist={{ key: "qc-completed", group: "inhouse", local: true }}
575
+ */
576
+ persist?: string | PersistConfig;
577
+ };
578
+
579
+ declare function DataTable<T>({ data, columns: initialColumns, filters, pagination, settings, header, footer, className, maxHeight, loading, error, emptyMessage, onRowSelectionChange, onExport, onRefresh, onTableReady, children, isRowSelectable, getRowId, defaultSelectedRows, onExternalSearch, aggregations, onAggregationChange, rowClassName, persist: persistProp, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
580
+
581
+ declare const buttonVariants: (props?: ({
582
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
583
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
584
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
585
+ declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
586
+ asChild?: boolean;
587
+ }): react_jsx_runtime.JSX.Element;
588
+
589
+ interface DataTableActionBarProps<TData> extends React$1.ComponentProps<typeof motion.div> {
590
+ table: Table<TData> | null;
591
+ visible?: boolean;
592
+ container?: Element | DocumentFragment | null;
593
+ children: React$1.ReactNode;
594
+ }
595
+ declare function DataTableActionBar<TData>({ table, visible: visibleProp, container: containerProp, children, className, ...props }: DataTableActionBarProps<TData>): React$1.ReactPortal | null;
596
+ interface DataTableActionBarActionProps extends React$1.ComponentProps<typeof Button> {
597
+ tooltip?: string;
598
+ isPending?: boolean;
599
+ }
600
+ declare function DataTableActionBarAction({ size, tooltip, isPending, disabled, className, children, ...props }: DataTableActionBarActionProps): react_jsx_runtime.JSX.Element;
601
+ interface DataTableActionBarSelectionProps<TData> {
602
+ table: Table<TData> | null;
603
+ }
604
+ declare function DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>): react_jsx_runtime.JSX.Element | null;
605
+
606
+ type DataTemplateField<T> = {
607
+ key: keyof T;
608
+ label: string;
609
+ type?: "text" | "number" | "date" | "boolean";
610
+ sortable?: boolean;
611
+ filterable?: boolean;
612
+ searchable?: boolean;
613
+ };
614
+ type DataTemplateFilter<T> = {
615
+ key: keyof T;
616
+ label: string;
617
+ type: "text" | "select" | "date" | "number" | "boolean";
618
+ options?: {
619
+ label: string;
620
+ value: string;
621
+ }[];
622
+ placeholder?: string;
623
+ icon?: LucideIcon;
624
+ };
625
+ type DataTemplatePagination = {
626
+ pageSize?: number;
627
+ pageSizeOptions?: number[];
628
+ showInfo?: boolean;
629
+ showPageNumbers?: boolean;
630
+ };
631
+ type DataTemplateSettings = {
632
+ enableSorting?: boolean;
633
+ enableFiltering?: boolean;
634
+ enableGlobalSearch?: boolean;
635
+ enableSelection?: boolean;
636
+ enableExport?: boolean;
637
+ showToolbar?: boolean;
638
+ selectionMode?: "single" | "multiple";
639
+ gridCols?: {
640
+ default: number;
641
+ sm?: number;
642
+ md?: number;
643
+ lg?: number;
644
+ xl?: number;
645
+ "2xl"?: number;
646
+ };
647
+ gap?: number;
648
+ aspectRatio?: "square" | "video" | "auto" | string;
649
+ minCardWidth?: number;
650
+ maxCardWidth?: number;
651
+ };
652
+ type DataTemplateType<T> = (item: T, index: number, isSelected: boolean, onToggleSelect: () => void) => ReactNode;
653
+ type DataTemplateProps<T> = {
654
+ data: T[];
655
+ template: DataTemplateType<T>;
656
+ fields: DataTemplateField<T>[];
657
+ filters?: DataTemplateFilter<T>[];
658
+ pagination?: DataTemplatePagination;
659
+ settings?: DataTemplateSettings;
660
+ header?: ReactNode;
661
+ footer?: ReactNode;
662
+ className?: string;
663
+ loading?: boolean;
664
+ error?: string;
665
+ emptyMessage?: string;
666
+ emptyIcon?: ReactNode;
667
+ onSelectionChange?: (selectedItems: T[]) => void;
668
+ onExport?: (data: T[]) => void;
669
+ onRefresh?: () => void;
670
+ onTemplateReady?: (controller: DataTemplateController<T>) => void;
671
+ children?: (controller: DataTemplateController<T>) => ReactNode;
672
+ };
673
+ type DataTemplateController<T> = {
674
+ getSelectedItems: () => T[];
675
+ clearSelection: () => void;
676
+ selectAll: () => void;
677
+ getFilteredData: () => T[];
678
+ getTotalCount: () => number;
679
+ getVisibleCount: () => number;
680
+ refresh: () => void;
681
+ exportData: () => void;
682
+ };
683
+ type DataTemplateActionBarProps<T> = {
684
+ controller: DataTemplateController<T>;
685
+ visible?: boolean;
686
+ container?: Element | DocumentFragment | null;
687
+ children: React__default.ReactNode;
688
+ className?: string;
689
+ };
690
+ type DataTemplateActionBarActionProps = {
691
+ tooltip?: string;
692
+ isPending?: boolean;
693
+ size?: "sm" | "icon";
694
+ variant?: "default" | "secondary" | "outline" | "ghost";
695
+ disabled?: boolean;
696
+ className?: string;
697
+ children: React__default.ReactNode;
698
+ onClick?: () => void;
699
+ };
700
+
701
+ declare function DataTemplate<T extends Record<string, any>>({ data, template, fields, filters, pagination, settings, header, footer, className, loading, error, emptyMessage, emptyIcon, onSelectionChange, onExport, onRefresh, onTemplateReady, children, }: DataTemplateProps<T>): react_jsx_runtime.JSX.Element;
702
+
703
+ declare function DataTemplateActionBar<T>({ controller, visible: visibleProp, container: containerProp, children, className, ...props }: DataTemplateActionBarProps<T> & React$1.ComponentProps<typeof motion.div>): React$1.ReactPortal | null;
704
+ declare function DataTemplateActionBarAction({ size, variant, tooltip, isPending, disabled, className, children, onClick, ...props }: DataTemplateActionBarActionProps): react_jsx_runtime.JSX.Element;
705
+ interface DataTemplateActionBarSelectionProps<T> {
706
+ controller: DataTemplateController<T>;
707
+ }
708
+ declare function DataTemplateActionBarSelection<T>({ controller }: DataTemplateActionBarSelectionProps<T>): react_jsx_runtime.JSX.Element | null;
709
+
710
+ type AppContainerProps = {
711
+ children: ReactNode;
712
+ className?: string;
713
+ };
714
+ /** Page shell: full-height column, small gap between header/content/footer. */
715
+ declare const AppContainer: ({ children, className }: AppContainerProps) => react_jsx_runtime.JSX.Element;
716
+
717
+ type AppHeaderProps = {
718
+ className?: string;
719
+ title?: ReactNode;
720
+ description?: string;
721
+ /** Back arrow button left of the title: navigate via `href` (typed route) or `onClick`. */
722
+ backAction?: {
723
+ onClick?: () => void;
724
+ href?: RegisteredRoutes;
725
+ };
726
+ /** Small label/value pairs rendered under the title. */
727
+ metadata?: {
728
+ label: string;
729
+ value: ReactNode;
730
+ }[];
731
+ /**
732
+ * Everything right of the title block. Rendered inside a `flex flex-1
733
+ * items-center justify-end h-full` row, so content lands at the right edge
734
+ * vertically centered — no wrapper needed. For a different layout add your
735
+ * own flex utilities via `childrenClassName` (twMerge, later wins) or a
736
+ * `<div className="flex-1" />` spacer / `mr-auto` on a child.
737
+ */
738
+ children?: ReactNode;
739
+ /** Extra classes for the children row (e.g. `justify-between gap-2`). */
740
+ childrenClassName?: string;
741
+ };
742
+ declare const AppHeader: ({ className, title, description, backAction, metadata, children, childrenClassName, }: AppHeaderProps) => react_jsx_runtime.JSX.Element;
743
+
744
+ type BandProps = {
745
+ children: React__default.ReactNode;
746
+ className?: string;
747
+ };
748
+ /**
749
+ * Pinned band above AppContent's scroll region (border-b, shares the parent's
750
+ * padding). Must be a DIRECT child of AppContent — it is a marker: AppContent
751
+ * extracts it and renders the band itself; anything else inside scrolls as body.
752
+ */
753
+ declare const AppContentHeader: (_props: BandProps) => null;
754
+ /** Pinned band below the scroll region. Same contract as AppContentHeader. */
755
+ declare const AppContentFooter: (_props: BandProps) => null;
756
+ type AppSheetProps = {
757
+ open: boolean;
758
+ onOpenChange: (open: boolean) => void;
759
+ /** Sheet edge. Default right. */
760
+ side?: "left" | "right";
761
+ /** Default true: sheet slides OVER the dimmed body (click outside closes).
762
+ * `overlay={false}` = push mode: sheet takes its width, body shrinks.
763
+ * Below 1024px push falls back to overlay automatically — a fixed-width
764
+ * panel would leave the main content unusably cramped. */
765
+ overlay?: boolean;
766
+ /** Merged onto the panel's default `w-[420px] max-w-full` (fixed width, clamps to
767
+ * full width on small screens) — override the width (`w-1/3`, `w-[600px]`) or
768
+ * add styling (`p-0`). Panel content has an intrinsic comfortable width; the
769
+ * MAIN content is the responsive part, not the sheet. */
770
+ className?: string;
771
+ children: React__default.ReactNode;
772
+ };
773
+ /**
774
+ * Side panel of an AppContent. Must be a DIRECT child of AppContent (marker,
775
+ * same contract as the bands) — one sheet per AppContent. Controlled only.
776
+ */
777
+ declare const AppSheet: (_props: AppSheetProps) => null;
778
+ type AppContentProps = {
779
+ children: React__default.ReactNode;
780
+ className?: string;
781
+ /** Extra classes for the inner content wrapper (default has `p-2` — pass `p-0` to drop it). */
782
+ contentClassName?: string;
783
+ };
784
+ /**
785
+ * Page content region. Fills the remaining space of its flex parent
786
+ * (`flex-auto min-h-0`) — the standard slot under AppContainer/AppHeader.
787
+ * For a content-sized block override via className (`flex-none`) or pair with
788
+ * an explicit height (`h-full`). Children scroll; AppContentHeader/Footer and
789
+ * AppSheet direct children are extracted and rendered as pinned band / side panel.
790
+ */
791
+ declare const AppContent: ({ children: rawChildren, className, contentClassName, }: AppContentProps) => react_jsx_runtime.JSX.Element;
792
+
793
+ type AppFooterProps = {
794
+ className?: string;
795
+ /**
796
+ * Footer content, rendered into a padded flex row. The LAST child is pushed
797
+ * to the right edge (`[&>*:last-child]:ml-auto`) — actions go last, any
798
+ * leading children (status text, form fields) sit left with a `gap-4`.
799
+ * Override per page via className (twMerge, later wins). Renders nothing
800
+ * without children.
801
+ */
802
+ children?: ReactNode;
803
+ };
804
+ declare const AppFooter: ({ className, children }: AppFooterProps) => react_jsx_runtime.JSX.Element | null;
805
+
806
+ declare const ErrorComponent: () => react_jsx_runtime.JSX.Element;
807
+
808
+ declare function CurrencyTransfer(): react_jsx_runtime.JSX.Element;
809
+
810
+ declare const Loader: () => react_jsx_runtime.JSX.Element;
811
+
812
+ declare const NotFound: () => react_jsx_runtime.JSX.Element;
813
+
814
+ declare const OfflineUI: () => react_jsx_runtime.JSX.Element;
815
+
816
+ declare const Unauthorized: () => react_jsx_runtime.JSX.Element;
817
+
818
+ export { AppContainer, type AppContainerProps, AppContent, AppContentFooter, AppContentHeader, type AppContentProps, AppFooter, type AppFooterProps, AppHeader, type AppHeaderProps, AppSheet, type AppSheetProps, CurrencyTransfer, DataTable, DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection, type DataTableProps, DataTemplate, DataTemplateActionBar, DataTemplateActionBarAction, DataTemplateActionBarSelection, type DataTemplateProps, ErrorComponent, type GroupColumnDef, Loader, NotFound, OfflineUI, type PersistConfig, type PersistGroupRegistry, type TableExportColumn, type TableExportView, Unauthorized, getTableExportView, readPersistedExternal };