@customafk/lunas-ui 0.1.93 → 0.1.95

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 (483) hide show
  1. package/dist/{avatar-DjCXs3FZ.mjs → avatar-DReNH6rV.mjs} +1 -1
  2. package/dist/{avatar-DjCXs3FZ.mjs.map → avatar-DReNH6rV.mjs.map} +1 -1
  3. package/dist/{avatar-dAu1c0bC.cjs → avatar-aVxo69zP.cjs} +1 -1
  4. package/dist/{avatar-dAu1c0bC.cjs.map → avatar-aVxo69zP.cjs.map} +1 -1
  5. package/dist/badge-B4Fa7-J3.mjs +2 -0
  6. package/dist/badge-B4Fa7-J3.mjs.map +1 -0
  7. package/dist/badge-cvLJyaCA.cjs +2 -0
  8. package/dist/badge-cvLJyaCA.cjs.map +1 -0
  9. package/dist/button-8Snjc8iT.cjs +2 -0
  10. package/dist/{button-BLYTfCyl.cjs.map → button-8Snjc8iT.cjs.map} +1 -1
  11. package/dist/{button-CFDexiLY.d.cts → button-BRHW1rSO.d.cts} +6 -6
  12. package/dist/button-C_yZHudZ.mjs +2 -0
  13. package/dist/{button-BlQN92Jt.mjs.map → button-C_yZHudZ.mjs.map} +1 -1
  14. package/dist/{button-CePXFHnA.d.mts → button-DgVnlWul.d.mts} +6 -6
  15. package/dist/{button.variants-Bo2vzQp5.cjs → button.variants-8QOIR433.cjs} +1 -1
  16. package/dist/{button.variants-Bo2vzQp5.cjs.map → button.variants-8QOIR433.cjs.map} +1 -1
  17. package/dist/{button.variants-DBOg9vCn.mjs → button.variants-CL2rLGYO.mjs} +1 -1
  18. package/dist/{button.variants-DBOg9vCn.mjs.map → button.variants-CL2rLGYO.mjs.map} +1 -1
  19. package/dist/calendar-DgLMLD8R.cjs +2 -0
  20. package/dist/calendar-DgLMLD8R.cjs.map +1 -0
  21. package/dist/calendar-e9Pu8pNj.mjs +2 -0
  22. package/dist/calendar-e9Pu8pNj.mjs.map +1 -0
  23. package/dist/cards/grid-product-card.cjs +1 -1
  24. package/dist/cards/grid-product-card.cjs.map +1 -1
  25. package/dist/cards/grid-product-card.mjs +1 -1
  26. package/dist/cards/grid-product-card.mjs.map +1 -1
  27. package/dist/cards/product-card.cjs +1 -1
  28. package/dist/cards/product-card.cjs.map +1 -1
  29. package/dist/cards/product-card.mjs +1 -1
  30. package/dist/cards/product-card.mjs.map +1 -1
  31. package/dist/cards/simple-card.cjs +1 -1
  32. package/dist/cards/simple-card.cjs.map +1 -1
  33. package/dist/cards/simple-card.d.mts +2 -2
  34. package/dist/cards/simple-card.mjs +1 -1
  35. package/dist/cards/simple-card.mjs.map +1 -1
  36. package/dist/checkbox-Bg2FiuQw.mjs +2 -0
  37. package/dist/checkbox-Bg2FiuQw.mjs.map +1 -0
  38. package/dist/checkbox-C0fSWwmD.cjs +2 -0
  39. package/dist/checkbox-C0fSWwmD.cjs.map +1 -0
  40. package/dist/{close-rM-Ao1Gf.cjs → close-D_Ge7gnP.cjs} +1 -1
  41. package/dist/{close-rM-Ao1Gf.cjs.map → close-D_Ge7gnP.cjs.map} +1 -1
  42. package/dist/{close-BSZehrQx.mjs → close-DfuHB7kq.mjs} +1 -1
  43. package/dist/{close-BSZehrQx.mjs.map → close-DfuHB7kq.mjs.map} +1 -1
  44. package/dist/{command-CzE8NTMm.cjs → command-BciJADha.cjs} +2 -2
  45. package/dist/{command-CzE8NTMm.cjs.map → command-BciJADha.cjs.map} +1 -1
  46. package/dist/{command-OYUOsPvN.mjs → command-DSvEsWG8.mjs} +2 -2
  47. package/dist/{command-OYUOsPvN.mjs.map → command-DSvEsWG8.mjs.map} +1 -1
  48. package/dist/data-display/country.cjs +1 -1
  49. package/dist/data-display/country.d.cts +1 -1
  50. package/dist/data-display/country.d.mts +1 -1
  51. package/dist/data-display/country.mjs +1 -1
  52. package/dist/data-display/data-list.cjs +1 -1
  53. package/dist/data-display/data-list.mjs +1 -1
  54. package/dist/data-display/date-tooltip.cjs +1 -1
  55. package/dist/data-display/date-tooltip.mjs +1 -1
  56. package/dist/data-display/date.cjs +1 -1
  57. package/dist/data-display/date.mjs +1 -1
  58. package/dist/data-display/empty.cjs +1 -1
  59. package/dist/data-display/empty.d.mts +2 -2
  60. package/dist/data-display/empty.mjs +1 -1
  61. package/dist/data-display/name.cjs +1 -1
  62. package/dist/data-display/name.mjs +1 -1
  63. package/dist/data-display/phone-number.cjs +1 -1
  64. package/dist/data-display/phone-number.mjs +1 -1
  65. package/dist/data-display/role-badge.cjs +1 -1
  66. package/dist/data-display/role-badge.d.cts +1 -1
  67. package/dist/data-display/role-badge.d.mts +1 -1
  68. package/dist/data-display/role-badge.mjs +1 -1
  69. package/dist/data-display/statistic.cjs +1 -1
  70. package/dist/data-display/statistic.d.mts +2 -2
  71. package/dist/data-display/statistic.mjs +1 -1
  72. package/dist/data-display/user.cjs +1 -1
  73. package/dist/data-display/user.mjs +1 -1
  74. package/dist/{date-Bznq86tY.mjs → date-CK7XBqG9.mjs} +2 -2
  75. package/dist/{date-Bznq86tY.mjs.map → date-CK7XBqG9.mjs.map} +1 -1
  76. package/dist/{date-CuRT4hmU.cjs → date-CTmoK8tv.cjs} +2 -2
  77. package/dist/{date-CuRT4hmU.cjs.map → date-CTmoK8tv.cjs.map} +1 -1
  78. package/dist/{dialog-DigNrfAO.d.mts → dialog-B4h77Z-1.d.mts} +12 -12
  79. package/dist/dialog-D5TBBX99.cjs +2 -0
  80. package/dist/dialog-D5TBBX99.cjs.map +1 -0
  81. package/dist/dialog-DSvmcuYl.mjs +2 -0
  82. package/dist/dialog-DSvmcuYl.mjs.map +1 -0
  83. package/dist/{dialog-UWrYag-8.d.cts → dialog-zsQVCZzj.d.cts} +12 -12
  84. package/dist/dialogs/confirm-dialog.cjs +1 -1
  85. package/dist/dialogs/confirm-dialog.cjs.map +1 -1
  86. package/dist/dialogs/confirm-dialog.mjs +1 -1
  87. package/dist/dialogs/confirm-dialog.mjs.map +1 -1
  88. package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
  89. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +24 -24
  90. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +24 -24
  91. package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
  92. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  93. package/dist/dialogs/detail-dialog/index.mjs +1 -1
  94. package/dist/dialogs/error-dialog.cjs +1 -1
  95. package/dist/dialogs/error-dialog.cjs.map +1 -1
  96. package/dist/dialogs/error-dialog.mjs +1 -1
  97. package/dist/dialogs/error-dialog.mjs.map +1 -1
  98. package/dist/dialogs/loading-dialog.cjs +1 -1
  99. package/dist/dialogs/loading-dialog.cjs.map +1 -1
  100. package/dist/dialogs/loading-dialog.mjs +1 -1
  101. package/dist/dialogs/loading-dialog.mjs.map +1 -1
  102. package/dist/dist-BudM04oj.cjs +2 -0
  103. package/dist/{dist-BqoK5OAd.cjs.map → dist-BudM04oj.cjs.map} +1 -1
  104. package/dist/dist-CvmzZ_6C.mjs +2 -0
  105. package/dist/{dist-D2ydYRc4.mjs.map → dist-CvmzZ_6C.mjs.map} +1 -1
  106. package/dist/{dropdown-menu-BwcDzb4B.mjs → dropdown-menu-B8GUTfTp.mjs} +1 -1
  107. package/dist/{dropdown-menu-BwcDzb4B.mjs.map → dropdown-menu-B8GUTfTp.mjs.map} +1 -1
  108. package/dist/{dropdown-menu-5Zyw5t_J.cjs → dropdown-menu-BuyuU6uF.cjs} +1 -1
  109. package/dist/{dropdown-menu-5Zyw5t_J.cjs.map → dropdown-menu-BuyuU6uF.cjs.map} +1 -1
  110. package/dist/features/descriptions/index.cjs +1 -1
  111. package/dist/features/descriptions/index.d.cts +4 -4
  112. package/dist/features/descriptions/index.d.mts +4 -4
  113. package/dist/features/descriptions/index.mjs +1 -1
  114. package/dist/features/search-modal/index.cjs +1 -1
  115. package/dist/features/search-modal/index.cjs.map +1 -1
  116. package/dist/features/search-modal/index.d.cts +2 -2
  117. package/dist/features/search-modal/index.d.mts +2 -2
  118. package/dist/features/search-modal/index.mjs +1 -1
  119. package/dist/features/search-modal/index.mjs.map +1 -1
  120. package/dist/features/tables/index.cjs +1 -1
  121. package/dist/features/tables/index.cjs.map +1 -1
  122. package/dist/features/tables/index.d.cts +152 -31
  123. package/dist/features/tables/index.d.mts +152 -31
  124. package/dist/features/tables/index.mjs +1 -1
  125. package/dist/features/tables/index.mjs.map +1 -1
  126. package/dist/features/tanstack-form/index.cjs +1 -1
  127. package/dist/features/tanstack-form/index.cjs.map +1 -1
  128. package/dist/features/tanstack-form/index.d.cts +280 -280
  129. package/dist/features/tanstack-form/index.d.mts +280 -280
  130. package/dist/features/tanstack-form/index.mjs +1 -1
  131. package/dist/features/tanstack-form/index.mjs.map +1 -1
  132. package/dist/{flex-_tvOU0u1.mjs → flex-BP8sTi70.mjs} +2 -2
  133. package/dist/{flex-_tvOU0u1.mjs.map → flex-BP8sTi70.mjs.map} +1 -1
  134. package/dist/{flex-DGPQRbN6.cjs → flex-twCgWyx1.cjs} +2 -2
  135. package/dist/{flex-DGPQRbN6.cjs.map → flex-twCgWyx1.cjs.map} +1 -1
  136. package/dist/heading--VmdIi7C.mjs +2 -0
  137. package/dist/heading--VmdIi7C.mjs.map +1 -0
  138. package/dist/heading-BEm5CCSE.cjs +2 -0
  139. package/dist/heading-BEm5CCSE.cjs.map +1 -0
  140. package/dist/image-CS_Q0WA7.mjs +2 -0
  141. package/dist/{image-Dgxtk54D.mjs.map → image-CS_Q0WA7.mjs.map} +1 -1
  142. package/dist/image-DuFv8sPr.cjs +2 -0
  143. package/dist/{image-D2PTBG_7.cjs.map → image-DuFv8sPr.cjs.map} +1 -1
  144. package/dist/input-BFWWaN-v.cjs +2 -0
  145. package/dist/input-BFWWaN-v.cjs.map +1 -0
  146. package/dist/input-DBtIgQB6.mjs +2 -0
  147. package/dist/input-DBtIgQB6.mjs.map +1 -0
  148. package/dist/{input-B2Y92Ylo.d.cts → input-Dv7UKl6Z.d.mts} +8 -10
  149. package/dist/{input-B6-pu-dE.d.mts → input-VtO0d8O-.d.cts} +8 -10
  150. package/dist/{label-D6vHFlHX.cjs → label-BzfsTrVt.cjs} +1 -1
  151. package/dist/{label-D6vHFlHX.cjs.map → label-BzfsTrVt.cjs.map} +1 -1
  152. package/dist/{label-DW6shAXZ.mjs → label-Dqr8nxWi.mjs} +1 -1
  153. package/dist/{label-DW6shAXZ.mjs.map → label-Dqr8nxWi.mjs.map} +1 -1
  154. package/dist/layouts/cms-layout/index.cjs +1 -1
  155. package/dist/layouts/cms-layout/index.mjs +1 -1
  156. package/dist/layouts/flex.cjs +1 -1
  157. package/dist/layouts/flex.d.mts +3 -3
  158. package/dist/layouts/flex.mjs +1 -1
  159. package/dist/layouts/payment-layout/index.cjs +1 -1
  160. package/dist/layouts/payment-layout/index.mjs +1 -1
  161. package/dist/pages/FeatureDeveloping.cjs +1 -1
  162. package/dist/pages/FeatureDeveloping.d.mts +2 -2
  163. package/dist/pages/FeatureDeveloping.mjs +1 -1
  164. package/dist/pages/FeatureFixing.cjs +1 -1
  165. package/dist/pages/FeatureFixing.d.cts +2 -2
  166. package/dist/pages/FeatureFixing.mjs +1 -1
  167. package/dist/pages/NotAuthorized.cjs +1 -1
  168. package/dist/pages/NotAuthorized.d.cts +2 -2
  169. package/dist/pages/NotAuthorized.d.mts +2 -2
  170. package/dist/pages/NotAuthorized.mjs +1 -1
  171. package/dist/pages/NotFound.cjs +1 -1
  172. package/dist/pages/NotFound.d.cts +2 -2
  173. package/dist/pages/NotFound.d.mts +2 -2
  174. package/dist/pages/NotFound.mjs +1 -1
  175. package/dist/paragraph-4z_6Z5aj.cjs +2 -0
  176. package/dist/paragraph-4z_6Z5aj.cjs.map +1 -0
  177. package/dist/paragraph-BTJV4aeF.mjs +2 -0
  178. package/dist/paragraph-BTJV4aeF.mjs.map +1 -0
  179. package/dist/popover-BckwBuuD.mjs +2 -0
  180. package/dist/popover-BckwBuuD.mjs.map +1 -0
  181. package/dist/popover-DzDrgttC.cjs +2 -0
  182. package/dist/popover-DzDrgttC.cjs.map +1 -0
  183. package/dist/radio-group-CBhRsUjN.cjs +2 -0
  184. package/dist/radio-group-CBhRsUjN.cjs.map +1 -0
  185. package/dist/radio-group-Cem8O6BK.mjs +2 -0
  186. package/dist/radio-group-Cem8O6BK.mjs.map +1 -0
  187. package/dist/resizable-DXHfkbaz.mjs +2 -0
  188. package/dist/resizable-DXHfkbaz.mjs.map +1 -0
  189. package/dist/resizable-mlGS6Zto.cjs +2 -0
  190. package/dist/resizable-mlGS6Zto.cjs.map +1 -0
  191. package/dist/select-2CgwiefV.cjs +2 -0
  192. package/dist/select-2CgwiefV.cjs.map +1 -0
  193. package/dist/select-CivtMKTM.mjs +2 -0
  194. package/dist/select-CivtMKTM.mjs.map +1 -0
  195. package/dist/{separator-CWar33xc.mjs → separator-Bf0gymN4.mjs} +1 -1
  196. package/dist/{separator-CWar33xc.mjs.map → separator-Bf0gymN4.mjs.map} +1 -1
  197. package/dist/{separator-DSZyCT2g.cjs → separator-C3ip6sbh.cjs} +1 -1
  198. package/dist/{separator-DSZyCT2g.cjs.map → separator-C3ip6sbh.cjs.map} +1 -1
  199. package/dist/{sheet-CxHNvLcP.cjs → sheet-5MJRtrfG.cjs} +1 -1
  200. package/dist/{sheet-CxHNvLcP.cjs.map → sheet-5MJRtrfG.cjs.map} +1 -1
  201. package/dist/{sheet-CUfrx04D.mjs → sheet-oadGRiie.mjs} +1 -1
  202. package/dist/{sheet-CUfrx04D.mjs.map → sheet-oadGRiie.mjs.map} +1 -1
  203. package/dist/{skeleton-6MpPv0K3.mjs → skeleton-Ba6koCVf.mjs} +1 -1
  204. package/dist/{skeleton-6MpPv0K3.mjs.map → skeleton-Ba6koCVf.mjs.map} +1 -1
  205. package/dist/{skeleton-oQFT4xR2.cjs → skeleton-CHympz8k.cjs} +1 -1
  206. package/dist/{skeleton-oQFT4xR2.cjs.map → skeleton-CHympz8k.cjs.map} +1 -1
  207. package/dist/spinner-Chm_2fLr.cjs +2 -0
  208. package/dist/spinner-Chm_2fLr.cjs.map +1 -0
  209. package/dist/spinner-D1v3Bard.mjs +2 -0
  210. package/dist/spinner-D1v3Bard.mjs.map +1 -0
  211. package/dist/systems/google.cjs +1 -1
  212. package/dist/systems/google.mjs +1 -1
  213. package/dist/textarea-COQoSVSc.cjs +2 -0
  214. package/dist/textarea-COQoSVSc.cjs.map +1 -0
  215. package/dist/textarea-bLtmb71c.mjs +2 -0
  216. package/dist/textarea-bLtmb71c.mjs.map +1 -0
  217. package/dist/{tooltip-Dd1torAV.mjs → tooltip-B3dTcgcc.mjs} +1 -1
  218. package/dist/{tooltip-Dd1torAV.mjs.map → tooltip-B3dTcgcc.mjs.map} +1 -1
  219. package/dist/{tooltip-DMFoP_sB.cjs → tooltip-DC6i1A25.cjs} +1 -1
  220. package/dist/{tooltip-DMFoP_sB.cjs.map → tooltip-DC6i1A25.cjs.map} +1 -1
  221. package/dist/{types-DmtzpUIM.cjs → types-BD1t0Bj8.cjs} +1 -1
  222. package/dist/{types-BQMTFD_z.mjs.map → types-BD1t0Bj8.cjs.map} +1 -1
  223. package/dist/{types-Dl3D4kHZ.d.cts → types-Bd0JePtp.d.cts} +3 -2
  224. package/dist/{types-spXc_7Mh.d.mts → types-BpHcqlOI.d.mts} +3 -2
  225. package/dist/{types-BQMTFD_z.mjs → types-DBD4LOem.mjs} +1 -1
  226. package/dist/{types-DmtzpUIM.cjs.map → types-DBD4LOem.mjs.map} +1 -1
  227. package/dist/typography/paragraph.cjs +1 -1
  228. package/dist/typography/paragraph.d.cts +15 -3
  229. package/dist/typography/paragraph.d.mts +15 -3
  230. package/dist/typography/paragraph.mjs +1 -1
  231. package/dist/typography/title.cjs +1 -1
  232. package/dist/typography/title.d.cts +2 -2
  233. package/dist/typography/title.d.mts +2 -2
  234. package/dist/typography/title.mjs +1 -1
  235. package/dist/ui/alert-dialog.cjs +1 -1
  236. package/dist/ui/alert-dialog.cjs.map +1 -1
  237. package/dist/ui/alert-dialog.d.cts +12 -12
  238. package/dist/ui/alert-dialog.d.mts +12 -12
  239. package/dist/ui/alert-dialog.mjs +1 -1
  240. package/dist/ui/alert-dialog.mjs.map +1 -1
  241. package/dist/ui/alert.cjs +1 -1
  242. package/dist/ui/alert.d.cts +6 -6
  243. package/dist/ui/alert.d.mts +6 -6
  244. package/dist/ui/alert.mjs +1 -1
  245. package/dist/ui/aspect-ratio.d.cts +2 -2
  246. package/dist/ui/aspect-ratio.d.mts +2 -2
  247. package/dist/ui/avatar.cjs +1 -1
  248. package/dist/ui/avatar.d.cts +4 -4
  249. package/dist/ui/avatar.d.mts +4 -4
  250. package/dist/ui/avatar.mjs +1 -1
  251. package/dist/ui/badge.cjs +1 -1
  252. package/dist/ui/badge.d.cts +3 -3
  253. package/dist/ui/badge.d.mts +5 -5
  254. package/dist/ui/badge.mjs +1 -1
  255. package/dist/ui/breadcrumb.cjs +1 -1
  256. package/dist/ui/breadcrumb.d.cts +8 -8
  257. package/dist/ui/breadcrumb.d.mts +8 -8
  258. package/dist/ui/breadcrumb.mjs +1 -1
  259. package/dist/ui/button-group.cjs +1 -1
  260. package/dist/ui/button-group.d.cts +6 -6
  261. package/dist/ui/button-group.d.mts +6 -6
  262. package/dist/ui/button-group.mjs +1 -1
  263. package/dist/ui/button.cjs +1 -1
  264. package/dist/ui/button.d.cts +1 -1
  265. package/dist/ui/button.d.mts +1 -1
  266. package/dist/ui/button.mjs +1 -1
  267. package/dist/ui/buttons/add-new.cjs +1 -1
  268. package/dist/ui/buttons/add-new.mjs +1 -1
  269. package/dist/ui/buttons/edit.cjs +1 -1
  270. package/dist/ui/buttons/edit.mjs +1 -1
  271. package/dist/ui/buttons/refresh.cjs +1 -1
  272. package/dist/ui/buttons/refresh.mjs +1 -1
  273. package/dist/ui/buttons/trash.cjs +1 -1
  274. package/dist/ui/buttons/trash.mjs +1 -1
  275. package/dist/ui/buttons/upload-image.cjs +1 -1
  276. package/dist/ui/buttons/upload-image.mjs +1 -1
  277. package/dist/ui/calendar.cjs +1 -2
  278. package/dist/ui/calendar.d.cts +4 -4
  279. package/dist/ui/calendar.d.mts +4 -4
  280. package/dist/ui/calendar.mjs +1 -2
  281. package/dist/ui/card.cjs +1 -1
  282. package/dist/ui/card.cjs.map +1 -1
  283. package/dist/ui/card.d.cts +8 -8
  284. package/dist/ui/card.d.mts +8 -8
  285. package/dist/ui/card.mjs +1 -1
  286. package/dist/ui/card.mjs.map +1 -1
  287. package/dist/ui/carousel.cjs +1 -1
  288. package/dist/ui/carousel.d.cts +7 -7
  289. package/dist/ui/carousel.d.mts +7 -7
  290. package/dist/ui/carousel.mjs +1 -1
  291. package/dist/ui/checkbox.cjs +1 -1
  292. package/dist/ui/checkbox.d.cts +2 -2
  293. package/dist/ui/checkbox.d.mts +2 -2
  294. package/dist/ui/checkbox.mjs +1 -1
  295. package/dist/ui/collapsible.d.cts +4 -4
  296. package/dist/ui/collapsible.d.mts +4 -4
  297. package/dist/ui/command.cjs +1 -1
  298. package/dist/ui/command.d.cts +11 -11
  299. package/dist/ui/command.d.mts +11 -11
  300. package/dist/ui/command.mjs +1 -1
  301. package/dist/ui/context-menu.d.cts +16 -16
  302. package/dist/ui/context-menu.d.mts +16 -16
  303. package/dist/ui/dialog.cjs +1 -1
  304. package/dist/ui/dialog.d.cts +1 -1
  305. package/dist/ui/dialog.d.mts +1 -1
  306. package/dist/ui/dialog.mjs +1 -1
  307. package/dist/ui/drawer.d.cts +11 -11
  308. package/dist/ui/drawer.d.mts +11 -11
  309. package/dist/ui/dropdown-menu.cjs +1 -1
  310. package/dist/ui/dropdown-menu.d.cts +16 -16
  311. package/dist/ui/dropdown-menu.d.mts +16 -16
  312. package/dist/ui/dropdown-menu.mjs +1 -1
  313. package/dist/ui/empty.cjs +1 -1
  314. package/dist/ui/empty.d.cts +7 -7
  315. package/dist/ui/empty.d.mts +9 -9
  316. package/dist/ui/empty.mjs +1 -1
  317. package/dist/ui/field.cjs +1 -1
  318. package/dist/ui/field.d.cts +13 -13
  319. package/dist/ui/field.d.mts +24 -24
  320. package/dist/ui/field.mjs +1 -1
  321. package/dist/ui/file-uploader.cjs +2 -2
  322. package/dist/ui/file-uploader.d.cts +2 -2
  323. package/dist/ui/file-uploader.d.mts +2 -2
  324. package/dist/ui/file-uploader.mjs +2 -2
  325. package/dist/ui/form.cjs +1 -1
  326. package/dist/ui/form.d.cts +7 -7
  327. package/dist/ui/form.d.mts +7 -7
  328. package/dist/ui/form.mjs +1 -1
  329. package/dist/ui/hover-card.d.cts +4 -4
  330. package/dist/ui/hover-card.d.mts +4 -4
  331. package/dist/ui/image.cjs +1 -1
  332. package/dist/ui/image.mjs +1 -1
  333. package/dist/ui/input-otp.cjs +1 -1
  334. package/dist/ui/input-otp.d.cts +5 -5
  335. package/dist/ui/input-otp.d.mts +5 -5
  336. package/dist/ui/input-otp.mjs +1 -1
  337. package/dist/ui/input.cjs +1 -1
  338. package/dist/ui/input.d.cts +2 -2
  339. package/dist/ui/input.d.mts +2 -2
  340. package/dist/ui/input.mjs +1 -1
  341. package/dist/ui/inputs/search-input.cjs +1 -1
  342. package/dist/ui/inputs/search-input.d.cts +3 -3
  343. package/dist/ui/inputs/search-input.d.mts +3 -3
  344. package/dist/ui/inputs/search-input.mjs +1 -1
  345. package/dist/ui/item.cjs +1 -1
  346. package/dist/ui/item.d.cts +16 -16
  347. package/dist/ui/item.d.mts +16 -16
  348. package/dist/ui/item.mjs +1 -1
  349. package/dist/ui/label.cjs +1 -1
  350. package/dist/ui/label.d.cts +2 -2
  351. package/dist/ui/label.d.mts +2 -2
  352. package/dist/ui/label.mjs +1 -1
  353. package/dist/ui/menubar.d.cts +17 -17
  354. package/dist/ui/menubar.d.mts +17 -17
  355. package/dist/ui/multi-select.cjs +1 -1
  356. package/dist/ui/multi-select.cjs.map +1 -1
  357. package/dist/ui/multi-select.d.cts +2 -2
  358. package/dist/ui/multi-select.d.mts +3 -3
  359. package/dist/ui/multi-select.mjs +1 -1
  360. package/dist/ui/multi-select.mjs.map +1 -1
  361. package/dist/ui/navigation-menu.cjs +1 -1
  362. package/dist/ui/navigation-menu.d.cts +11 -11
  363. package/dist/ui/navigation-menu.d.mts +11 -11
  364. package/dist/ui/navigation-menu.mjs +1 -1
  365. package/dist/ui/pagination.cjs +1 -1
  366. package/dist/ui/pagination.d.cts +9 -9
  367. package/dist/ui/pagination.d.mts +9 -9
  368. package/dist/ui/pagination.mjs +1 -1
  369. package/dist/ui/popover.cjs +1 -2
  370. package/dist/ui/popover.d.cts +10 -6
  371. package/dist/ui/popover.d.mts +10 -6
  372. package/dist/ui/popover.mjs +1 -2
  373. package/dist/ui/progress.d.cts +2 -2
  374. package/dist/ui/progress.d.mts +2 -2
  375. package/dist/ui/radio-group.cjs +1 -2
  376. package/dist/ui/radio-group.d.cts +3 -3
  377. package/dist/ui/radio-group.d.mts +3 -3
  378. package/dist/ui/radio-group.mjs +1 -2
  379. package/dist/ui/resizable.cjs +1 -1
  380. package/dist/ui/resizable.d.cts +36 -14
  381. package/dist/ui/resizable.d.mts +36 -14
  382. package/dist/ui/resizable.mjs +1 -1
  383. package/dist/ui/scroll-area.cjs +1 -1
  384. package/dist/ui/scroll-area.d.cts +6 -6
  385. package/dist/ui/scroll-area.d.mts +6 -6
  386. package/dist/ui/scroll-area.mjs +1 -1
  387. package/dist/ui/select.cjs +1 -2
  388. package/dist/ui/select.d.cts +10 -18
  389. package/dist/ui/select.d.mts +10 -18
  390. package/dist/ui/select.mjs +1 -2
  391. package/dist/ui/separator.cjs +1 -1
  392. package/dist/ui/separator.d.cts +2 -2
  393. package/dist/ui/separator.d.mts +2 -2
  394. package/dist/ui/separator.mjs +1 -1
  395. package/dist/ui/sheet.cjs +1 -1
  396. package/dist/ui/sheet.d.cts +9 -9
  397. package/dist/ui/sheet.d.mts +9 -9
  398. package/dist/ui/sheet.mjs +1 -1
  399. package/dist/ui/sidebar.cjs +1 -1
  400. package/dist/ui/sidebar.d.cts +28 -28
  401. package/dist/ui/sidebar.d.mts +28 -28
  402. package/dist/ui/sidebar.mjs +1 -1
  403. package/dist/ui/skeleton.cjs +1 -1
  404. package/dist/ui/skeleton.d.cts +2 -2
  405. package/dist/ui/skeleton.d.mts +2 -2
  406. package/dist/ui/skeleton.mjs +1 -1
  407. package/dist/ui/slider.cjs +1 -1
  408. package/dist/ui/slider.d.cts +2 -2
  409. package/dist/ui/slider.d.mts +2 -2
  410. package/dist/ui/slider.mjs +1 -1
  411. package/dist/ui/sonner.d.cts +2 -2
  412. package/dist/ui/sonner.d.mts +2 -2
  413. package/dist/ui/spinner.cjs +1 -2
  414. package/dist/ui/spinner.d.cts +2 -2
  415. package/dist/ui/spinner.d.mts +2 -2
  416. package/dist/ui/spinner.mjs +1 -2
  417. package/dist/ui/switch.d.cts +2 -2
  418. package/dist/ui/switch.d.mts +2 -2
  419. package/dist/ui/table.cjs +1 -1
  420. package/dist/ui/table.d.cts +18 -18
  421. package/dist/ui/table.d.mts +18 -18
  422. package/dist/ui/table.mjs +1 -1
  423. package/dist/ui/tabs.d.cts +5 -5
  424. package/dist/ui/tabs.d.mts +5 -5
  425. package/dist/ui/textarea.cjs +1 -2
  426. package/dist/ui/textarea.d.cts +2 -2
  427. package/dist/ui/textarea.d.mts +2 -2
  428. package/dist/ui/textarea.mjs +1 -2
  429. package/dist/ui/toggle-group.cjs +1 -1
  430. package/dist/ui/toggle-group.d.cts +3 -3
  431. package/dist/ui/toggle-group.d.mts +3 -3
  432. package/dist/ui/toggle-group.mjs +1 -1
  433. package/dist/ui/toggle.cjs +1 -1
  434. package/dist/ui/toggle.d.cts +4 -4
  435. package/dist/ui/toggle.d.mts +4 -4
  436. package/dist/ui/toggle.mjs +1 -1
  437. package/dist/ui/tooltip.cjs +1 -1
  438. package/dist/ui/tooltip.d.cts +5 -5
  439. package/dist/ui/tooltip.d.mts +5 -5
  440. package/dist/ui/tooltip.mjs +1 -1
  441. package/package.json +1 -1
  442. package/dist/badge-CJ-SG_OK.mjs +0 -2
  443. package/dist/badge-CJ-SG_OK.mjs.map +0 -1
  444. package/dist/badge-CsDmp3ys.cjs +0 -2
  445. package/dist/badge-CsDmp3ys.cjs.map +0 -1
  446. package/dist/button-BLYTfCyl.cjs +0 -2
  447. package/dist/button-BlQN92Jt.mjs +0 -2
  448. package/dist/checkbox-D4K3ZATY.mjs +0 -2
  449. package/dist/checkbox-D4K3ZATY.mjs.map +0 -1
  450. package/dist/checkbox-DDuYFG0R.cjs +0 -2
  451. package/dist/checkbox-DDuYFG0R.cjs.map +0 -1
  452. package/dist/dialog-XvFmavuI.mjs +0 -2
  453. package/dist/dialog-XvFmavuI.mjs.map +0 -1
  454. package/dist/dialog-aRCyqFr-.cjs +0 -2
  455. package/dist/dialog-aRCyqFr-.cjs.map +0 -1
  456. package/dist/dist-BqoK5OAd.cjs +0 -2
  457. package/dist/dist-D2ydYRc4.mjs +0 -2
  458. package/dist/image-D2PTBG_7.cjs +0 -2
  459. package/dist/image-Dgxtk54D.mjs +0 -2
  460. package/dist/input-CqN74taK.mjs +0 -2
  461. package/dist/input-CqN74taK.mjs.map +0 -1
  462. package/dist/input-dAoEznUI.cjs +0 -2
  463. package/dist/input-dAoEznUI.cjs.map +0 -1
  464. package/dist/paragraph-B9_-MKH8.cjs +0 -2
  465. package/dist/paragraph-B9_-MKH8.cjs.map +0 -1
  466. package/dist/paragraph-C83yi9US.mjs +0 -2
  467. package/dist/paragraph-C83yi9US.mjs.map +0 -1
  468. package/dist/resizable-BS63Xwia.cjs +0 -2
  469. package/dist/resizable-BS63Xwia.cjs.map +0 -1
  470. package/dist/resizable-BfkKNflf.mjs +0 -2
  471. package/dist/resizable-BfkKNflf.mjs.map +0 -1
  472. package/dist/ui/calendar.cjs.map +0 -1
  473. package/dist/ui/calendar.mjs.map +0 -1
  474. package/dist/ui/popover.cjs.map +0 -1
  475. package/dist/ui/popover.mjs.map +0 -1
  476. package/dist/ui/radio-group.cjs.map +0 -1
  477. package/dist/ui/radio-group.mjs.map +0 -1
  478. package/dist/ui/select.cjs.map +0 -1
  479. package/dist/ui/select.mjs.map +0 -1
  480. package/dist/ui/spinner.cjs.map +0 -1
  481. package/dist/ui/spinner.mjs.map +0 -1
  482. package/dist/ui/textarea.cjs.map +0 -1
  483. package/dist/ui/textarea.mjs.map +0 -1
@@ -1,7 +1,8 @@
1
- import { t as Input } from "../../input-B2Y92Ylo.cjs";
2
- import * as react_jsx_runtime350 from "react/jsx-runtime";
3
- import * as react241 from "react";
4
- import { AccessorKeyColumnDef, ColumnPinningState, RowData, RowSelectionState, Table } from "@tanstack/react-table";
1
+ import { t as AnyEntity } from "../../types-Bd0JePtp.cjs";
2
+ import { t as Input } from "../../input-VtO0d8O-.cjs";
3
+ import * as react_jsx_runtime333 from "react/jsx-runtime";
4
+ import * as react255 from "react";
5
+ import { AccessorKeyColumnDef, CellContext, Column, ColumnPinningPosition, ColumnPinningState, Header, HeaderGroup, Row, RowSelectionState, Table } from "@tanstack/react-table";
5
6
  import { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
6
7
 
7
8
  //#region packages/components/features/tables/components/atoms/badge-display.d.ts
@@ -72,7 +73,7 @@ type Props$1 = {
72
73
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
73
74
  value: number | string | null | undefined;
74
75
  };
75
- declare const UITableStatisticDisplay: react241.MemoExoticComponent<({
76
+ declare const UITableStatisticDisplay: react255.MemoExoticComponent<({
76
77
  decimalSeparator,
77
78
  groupSeparator,
78
79
  prefix: Prefix,
@@ -82,7 +83,7 @@ declare const UITableStatisticDisplay: react241.MemoExoticComponent<({
82
83
  showTrailingZeros,
83
84
  size,
84
85
  value
85
- }: Props$1) => react_jsx_runtime350.JSX.Element>;
86
+ }: Props$1) => react_jsx_runtime333.JSX.Element>;
86
87
  //#endregion
87
88
  //#region packages/components/features/tables/components/atoms/user.d.ts
88
89
  type Props = {
@@ -92,56 +93,174 @@ type Props = {
92
93
  };
93
94
  declare const UITableUserDataDisplay: React.FC<Props>;
94
95
  //#endregion
95
- //#region packages/components/features/tables/components/table.d.ts
96
- declare const UITableWrapper: React.FC<React.PropsWithChildren<React.ComponentProps<'div'>>>;
97
- declare const UITableFooter: React.FC<React.PropsWithChildren>;
98
- declare const UITableContainer: React.FC<React.PropsWithChildren>;
99
- //#endregion
100
- //#region packages/components/features/tables/components/table/filter.d.ts
101
- declare const UITableFilter: () => react_jsx_runtime350.JSX.Element;
102
- //#endregion
103
96
  //#region packages/components/features/tables/types.d.ts
104
- type TUITableColumn<TData extends RowData> = Pick<AccessorKeyColumnDef<TData, unknown>, 'id' | 'accessorKey' | 'size' | 'maxSize' | 'minSize' | 'header' | 'cell' | 'meta'> & {
97
+ type RowData<TData extends RowData<AnyEntity>> = {
98
+ [x: string | number | symbol]: AnyEntity;
99
+ subRows?: TData[] | undefined;
100
+ };
101
+ type TUITableEmptyDisplay = {
102
+ isFetching?: boolean;
103
+ isEmpty?: boolean;
104
+ };
105
+ type TUITableWrapper = React.PropsWithChildren<React.ComponentProps<'div'>>;
106
+ type TUITableInnerWrapper = React.PropsWithChildren<React.ComponentProps<'div'>>;
107
+ type TUITableInnerTable = React.PropsWithChildren<React.ComponentProps<'table'>>;
108
+ type TUITableHead = React.PropsWithChildren<React.ComponentProps<'thead'>>;
109
+ type TUITableHeadCellOption = {
110
+ isPinned?: ColumnPinningPosition;
111
+ isVisible?: boolean;
112
+ className?: string;
113
+ onLeftPin?: (pos: ColumnPinningPosition) => void;
114
+ onRightPin?: (pos: ColumnPinningPosition) => void;
115
+ onUnpin?: (pos: ColumnPinningPosition) => void;
116
+ onToggleVisibility?: (props: AnyEntity) => void;
117
+ };
118
+ type TUITableHeadCellSelect = React.ComponentProps<'th'> & {
119
+ isPinned?: ColumnPinningPosition;
120
+ isAllRowsSelected?: boolean;
121
+ onToggleAllRowsSelected?: (value?: boolean) => void;
122
+ };
123
+ type TUITableHeadRow = React.PropsWithChildren<React.ComponentProps<'tr'> & {
124
+ headerGroup: HeaderGroup<unknown>;
125
+ onToggleAllRowsSelected?: (value?: boolean) => void;
126
+ }>;
127
+ type TUITableHeadCell = React.PropsWithChildren<React.ComponentProps<'th'> & {
128
+ isVisible?: boolean;
129
+ isPinned?: ColumnPinningPosition;
130
+ isFirstCell?: boolean;
131
+ isLastCell?: boolean;
132
+ isOptionsVisible?: boolean;
133
+ headerId?: string;
134
+ headerColumn?: Column<unknown, unknown>;
135
+ onColumnPin?: (pos: ColumnPinningPosition) => void;
136
+ onToggleVisibility?: (value?: boolean) => void;
137
+ }>;
138
+ type TUITableBody = React.PropsWithChildren<React.ComponentProps<'tbody'> & {
139
+ isFetching?: boolean;
140
+ isEmpty?: boolean;
141
+ height: string;
142
+ }>;
143
+ type TUITableRow = React.ComponentProps<'tr'> & {
144
+ row: Row<AnyEntity>;
145
+ isSelected?: boolean;
146
+ virtualRowIndex: number;
147
+ virtualRowStart: number;
148
+ };
149
+ type TUITableCellSelect = React.ComponentProps<'td'> & {
150
+ isPinned?: ColumnPinningPosition;
151
+ isSelected?: boolean;
152
+ onToggleRowSelected?: (value?: boolean) => void;
153
+ };
154
+ type TUITableCellActions = React.ComponentProps<'td'> & {
155
+ virtualRowIndex: number;
156
+ column?: Column<unknown, unknown>;
157
+ getContext: () => CellContext<unknown, unknown>;
158
+ };
159
+ type TUITableCell = React.ComponentProps<'td'> & {
160
+ isPinned?: ColumnPinningPosition;
161
+ isFirstCell?: boolean;
162
+ isLastCell?: boolean;
163
+ colId?: string;
164
+ cellId?: string;
165
+ position?: 'start' | 'center' | 'end';
166
+ column?: Column<unknown, unknown>;
167
+ getContext: () => CellContext<unknown, unknown>;
168
+ };
169
+ type TUITableFooter = React.PropsWithChildren<React.ComponentProps<'tfoot'>>;
170
+ type TUITableLoadMore = React.PropsWithChildren<React.ComponentProps<'tr'> & {
171
+ virtualRowIndex: number;
172
+ virtualRowStart: number;
173
+ fetchMoreData?: () => void | Promise<void>;
174
+ }>;
175
+ type TUITableColumn<TData extends RowData<TData>> = Pick<AccessorKeyColumnDef<TData, AnyEntity>, 'id' | 'accessorKey' | 'size' | 'maxSize' | 'minSize' | 'header' | 'cell' | 'meta'> & {
105
176
  meta?: {
106
- position: 'start' | 'center' | 'end';
177
+ position?: 'start' | 'center' | 'end';
178
+ fitContent?: boolean;
107
179
  };
108
180
  };
109
- type TTableContext<TData extends RowData> = {
181
+ type TTableContext<TData extends RowData<TData>> = {
110
182
  title: string;
111
183
  table: Table<TData>;
112
- data: TData[];
113
184
  isEmpty: boolean;
114
185
  isFetching?: boolean;
115
186
  isRefetching?: boolean;
116
187
  totalRows?: number;
117
- rowSelection: RowSelectionState;
118
- columnPinning: ColumnPinningState;
119
188
  fetchMoreData?: () => void | Promise<void>;
120
189
  };
121
- type TTableClickRow<TData extends RowData, TKey extends keyof TData = keyof TData> = {
190
+ type TTableInnerWrapperContext = {
191
+ innerWrapperId: string;
192
+ };
193
+ type TTableInnerTableContext = {
194
+ table: Table<AnyEntity>;
195
+ innerTableId: string;
196
+ totalSize: number;
197
+ };
198
+ type TTableHeadRowContext = {
199
+ isAllRowsSelected: boolean;
200
+ columnPinningState: ColumnPinningState;
201
+ leftPinnedHeaders: Header<AnyEntity, unknown>[];
202
+ rightPinnedHeaders: Header<AnyEntity, unknown>[];
203
+ onToggleAllRowsSelected?: (value?: boolean) => void;
204
+ };
205
+ type TTableBodyContext = {
206
+ isFetching: boolean;
207
+ isEmpty: boolean;
208
+ rowSelectionState: RowSelectionState;
209
+ };
210
+ type TTableRowContext<TData extends RowData<TData> = RowData<AnyEntity>, TKey extends keyof TData = keyof TData> = {
122
211
  keyOfClickRow?: TKey;
123
- onClickRow?: (rowIndex: number, rowId?: TData[TKey]) => void;
212
+ isAllRowsSelected?: boolean;
213
+ columnPinningState: ColumnPinningState;
214
+ onClickRow?: (rowIndex: number, rowId?: AnyEntity) => void;
215
+ leftPinnedHeaders?: Header<TData, unknown>[];
216
+ rightPinnedHeaders?: Header<TData, unknown>[];
124
217
  };
125
218
  type TTableVirtualizerContext = {
126
219
  rowVirtualizer: Virtualizer<HTMLDivElement, HTMLTableRowElement>;
127
220
  virtualItems: VirtualItem[];
128
221
  };
129
- type TableProviderProps<TData extends RowData, TKey extends keyof TData> = {
222
+ type TableProviderProps<TData extends RowData<TData>, TKey extends keyof TData = keyof TData, TColumns extends ReadonlyArray<TUITableColumn<TData>> = TUITableColumn<TData>[]> = {
130
223
  title: string;
131
224
  isFetching?: boolean;
132
225
  isRefetching?: boolean;
133
226
  data: TData[];
134
- columns: TUITableColumn<TData>[];
227
+ columns: TColumns;
135
228
  totalRows?: number;
136
229
  fetchMoreData?: () => void | Promise<void>;
137
- leftPinnedColumns?: string[];
138
- rightPinnedColumns?: string[];
139
- keyOfClickRow?: TTableClickRow<TData, TKey>['keyOfClickRow'];
140
- onClickRow?: TTableClickRow<TData, TKey>['onClickRow'];
230
+ leftPinnedColumns?: Array<TColumns[number]['accessorKey']>;
231
+ rightPinnedColumns?: Array<TColumns[number]['accessorKey']> | string[];
232
+ keyOfClickRow?: TTableRowContext<TData, TKey>['keyOfClickRow'];
233
+ onClickRow?: TTableRowContext<TData, TKey>['onClickRow'];
234
+ onRowSelection?: (rowSelection: RowSelectionState) => void;
235
+ onColumnPinning?: (columnPinning: ColumnPinningState) => void;
141
236
  };
142
237
  //#endregion
238
+ //#region packages/components/features/tables/components/common.d.ts
239
+ declare const UITableHeadCellOption: react255.NamedExoticComponent<TUITableHeadCellOption>;
240
+ declare const UITableHeadCellSelect: react255.NamedExoticComponent<TUITableHeadCellSelect>;
241
+ declare const UITableEmptyDisplay: react255.NamedExoticComponent<TUITableEmptyDisplay>;
242
+ declare const UITableWrapper: react255.NamedExoticComponent<TUITableWrapper>;
243
+ declare const UITableInnerWrapper: react255.NamedExoticComponent<TUITableInnerWrapper>;
244
+ declare const UITableInnerTable: react255.NamedExoticComponent<TUITableInnerTable>;
245
+ declare const UITableHead: react255.NamedExoticComponent<TUITableHead>;
246
+ declare const UITableHeadRow: react255.NamedExoticComponent<TUITableHeadRow>;
247
+ declare const UITableHeadCell: react255.NamedExoticComponent<TUITableHeadCell>;
248
+ declare const UITableBody: react255.NamedExoticComponent<TUITableBody>;
249
+ declare const UITableRow: react255.NamedExoticComponent<TUITableRow>;
250
+ declare const UITableCellSelect: react255.NamedExoticComponent<TUITableCellSelect>;
251
+ declare const UITableCellActions: react255.NamedExoticComponent<TUITableCellActions>;
252
+ declare const UITableCell: react255.NamedExoticComponent<TUITableCell>;
253
+ declare const UITableFooter: react255.NamedExoticComponent<TUITableFooter>;
254
+ declare const UITableLoadMore: react255.NamedExoticComponent<TUITableLoadMore>;
255
+ //#endregion
256
+ //#region packages/components/features/tables/components/table.d.ts
257
+ declare const UITableContainer: React.FC<React.PropsWithChildren>;
258
+ //#endregion
259
+ //#region packages/components/features/tables/components/table/filter.d.ts
260
+ declare const UITableFilter: () => react_jsx_runtime333.JSX.Element;
261
+ //#endregion
143
262
  //#region packages/components/features/tables/components/table/provider.d.ts
144
- declare const UITableProvider: <TData extends RowData, TKey extends keyof TData>({
263
+ declare const UITableProvider: <TData extends RowData<TData> = RowData<AnyEntity>, TKey extends keyof TData = keyof TData, TColumns extends ReadonlyArray<TUITableColumn<TData>> = TUITableColumn<TData>[]>({
145
264
  title,
146
265
  isFetching,
147
266
  isRefetching,
@@ -152,9 +271,11 @@ declare const UITableProvider: <TData extends RowData, TKey extends keyof TData>
152
271
  rightPinnedColumns,
153
272
  keyOfClickRow,
154
273
  onClickRow,
274
+ onRowSelection,
275
+ onColumnPinning,
155
276
  fetchMoreData,
156
277
  children
157
- }: React.PropsWithChildren<TableProviderProps<TData, TKey>>) => react_jsx_runtime350.JSX.Element;
278
+ }: React.PropsWithChildren<TableProviderProps<TData, TKey, TColumns>>) => react_jsx_runtime333.JSX.Element;
158
279
  //#endregion
159
280
  //#region packages/components/features/tables/components/table/tooltip.d.ts
160
281
  declare const UITableTooltipFilter: React.FC<Omit<React.ComponentProps<typeof Input>, 'className'> & {
@@ -167,5 +288,5 @@ declare const UITableTooltipActions: React.FC<{
167
288
  }>;
168
289
  declare const UITableTooltip: React.FC<React.PropsWithChildren>;
169
290
  //#endregion
170
- export { TTableClickRow, TTableContext, TTableVirtualizerContext, TUITableColumn, TableProviderProps, UITableBadgeDisplay, UITableBooleanDisplay, UITableContainer, UITableDateDisplay, UITableDescriptionDisplay, UITableFilter, UITableFooter, UITableMoreButton, UITableNameDisplay, UITablePermalink, UITablePhoneNumberDisplay, UITableProvider, UITableRemoveButton, UITableStatisticDisplay, UITableTooltip, UITableTooltipActions, UITableTooltipFilter, UITableUserDataDisplay, UITableWrapper };
291
+ export { RowData, TTableBodyContext, TTableContext, TTableHeadRowContext, TTableInnerTableContext, TTableInnerWrapperContext, TTableRowContext, TTableVirtualizerContext, TUITableBody, TUITableCell, TUITableCellActions, TUITableCellSelect, TUITableColumn, TUITableEmptyDisplay, TUITableFooter, TUITableHead, TUITableHeadCell, TUITableHeadCellOption, TUITableHeadCellSelect, TUITableHeadRow, TUITableInnerTable, TUITableInnerWrapper, TUITableLoadMore, TUITableRow, TUITableWrapper, TableProviderProps, UITableBadgeDisplay, UITableBody, UITableBooleanDisplay, UITableCell, UITableCellActions, UITableCellSelect, UITableContainer, UITableDateDisplay, UITableDescriptionDisplay, UITableEmptyDisplay, UITableFilter, UITableFooter, UITableHead, UITableHeadCell, UITableHeadCellOption, UITableHeadCellSelect, UITableHeadRow, UITableInnerTable, UITableInnerWrapper, UITableLoadMore, UITableMoreButton, UITableNameDisplay, UITablePermalink, UITablePhoneNumberDisplay, UITableProvider, UITableRemoveButton, UITableRow, UITableStatisticDisplay, UITableTooltip, UITableTooltipActions, UITableTooltipFilter, UITableUserDataDisplay, UITableWrapper };
171
292
  //# sourceMappingURL=index.d.cts.map
@@ -1,7 +1,8 @@
1
- import { t as Input } from "../../input-B6-pu-dE.mjs";
2
- import * as react_jsx_runtime350 from "react/jsx-runtime";
3
- import * as react241 from "react";
4
- import { AccessorKeyColumnDef, ColumnPinningState, RowData, RowSelectionState, Table } from "@tanstack/react-table";
1
+ import { t as AnyEntity } from "../../types-BpHcqlOI.mjs";
2
+ import { t as Input } from "../../input-Dv7UKl6Z.mjs";
3
+ import * as react267 from "react";
4
+ import * as react_jsx_runtime346 from "react/jsx-runtime";
5
+ import { AccessorKeyColumnDef, CellContext, Column, ColumnPinningPosition, ColumnPinningState, Header, HeaderGroup, Row, RowSelectionState, Table } from "@tanstack/react-table";
5
6
  import { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
6
7
 
7
8
  //#region packages/components/features/tables/components/atoms/badge-display.d.ts
@@ -72,7 +73,7 @@ type Props$1 = {
72
73
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
73
74
  value: number | string | null | undefined;
74
75
  };
75
- declare const UITableStatisticDisplay: react241.MemoExoticComponent<({
76
+ declare const UITableStatisticDisplay: react267.MemoExoticComponent<({
76
77
  decimalSeparator,
77
78
  groupSeparator,
78
79
  prefix: Prefix,
@@ -82,7 +83,7 @@ declare const UITableStatisticDisplay: react241.MemoExoticComponent<({
82
83
  showTrailingZeros,
83
84
  size,
84
85
  value
85
- }: Props$1) => react_jsx_runtime350.JSX.Element>;
86
+ }: Props$1) => react_jsx_runtime346.JSX.Element>;
86
87
  //#endregion
87
88
  //#region packages/components/features/tables/components/atoms/user.d.ts
88
89
  type Props = {
@@ -92,56 +93,174 @@ type Props = {
92
93
  };
93
94
  declare const UITableUserDataDisplay: React.FC<Props>;
94
95
  //#endregion
95
- //#region packages/components/features/tables/components/table.d.ts
96
- declare const UITableWrapper: React.FC<React.PropsWithChildren<React.ComponentProps<'div'>>>;
97
- declare const UITableFooter: React.FC<React.PropsWithChildren>;
98
- declare const UITableContainer: React.FC<React.PropsWithChildren>;
99
- //#endregion
100
- //#region packages/components/features/tables/components/table/filter.d.ts
101
- declare const UITableFilter: () => react_jsx_runtime350.JSX.Element;
102
- //#endregion
103
96
  //#region packages/components/features/tables/types.d.ts
104
- type TUITableColumn<TData extends RowData> = Pick<AccessorKeyColumnDef<TData, unknown>, 'id' | 'accessorKey' | 'size' | 'maxSize' | 'minSize' | 'header' | 'cell' | 'meta'> & {
97
+ type RowData<TData extends RowData<AnyEntity>> = {
98
+ [x: string | number | symbol]: AnyEntity;
99
+ subRows?: TData[] | undefined;
100
+ };
101
+ type TUITableEmptyDisplay = {
102
+ isFetching?: boolean;
103
+ isEmpty?: boolean;
104
+ };
105
+ type TUITableWrapper = React.PropsWithChildren<React.ComponentProps<'div'>>;
106
+ type TUITableInnerWrapper = React.PropsWithChildren<React.ComponentProps<'div'>>;
107
+ type TUITableInnerTable = React.PropsWithChildren<React.ComponentProps<'table'>>;
108
+ type TUITableHead = React.PropsWithChildren<React.ComponentProps<'thead'>>;
109
+ type TUITableHeadCellOption = {
110
+ isPinned?: ColumnPinningPosition;
111
+ isVisible?: boolean;
112
+ className?: string;
113
+ onLeftPin?: (pos: ColumnPinningPosition) => void;
114
+ onRightPin?: (pos: ColumnPinningPosition) => void;
115
+ onUnpin?: (pos: ColumnPinningPosition) => void;
116
+ onToggleVisibility?: (props: AnyEntity) => void;
117
+ };
118
+ type TUITableHeadCellSelect = React.ComponentProps<'th'> & {
119
+ isPinned?: ColumnPinningPosition;
120
+ isAllRowsSelected?: boolean;
121
+ onToggleAllRowsSelected?: (value?: boolean) => void;
122
+ };
123
+ type TUITableHeadRow = React.PropsWithChildren<React.ComponentProps<'tr'> & {
124
+ headerGroup: HeaderGroup<unknown>;
125
+ onToggleAllRowsSelected?: (value?: boolean) => void;
126
+ }>;
127
+ type TUITableHeadCell = React.PropsWithChildren<React.ComponentProps<'th'> & {
128
+ isVisible?: boolean;
129
+ isPinned?: ColumnPinningPosition;
130
+ isFirstCell?: boolean;
131
+ isLastCell?: boolean;
132
+ isOptionsVisible?: boolean;
133
+ headerId?: string;
134
+ headerColumn?: Column<unknown, unknown>;
135
+ onColumnPin?: (pos: ColumnPinningPosition) => void;
136
+ onToggleVisibility?: (value?: boolean) => void;
137
+ }>;
138
+ type TUITableBody = React.PropsWithChildren<React.ComponentProps<'tbody'> & {
139
+ isFetching?: boolean;
140
+ isEmpty?: boolean;
141
+ height: string;
142
+ }>;
143
+ type TUITableRow = React.ComponentProps<'tr'> & {
144
+ row: Row<AnyEntity>;
145
+ isSelected?: boolean;
146
+ virtualRowIndex: number;
147
+ virtualRowStart: number;
148
+ };
149
+ type TUITableCellSelect = React.ComponentProps<'td'> & {
150
+ isPinned?: ColumnPinningPosition;
151
+ isSelected?: boolean;
152
+ onToggleRowSelected?: (value?: boolean) => void;
153
+ };
154
+ type TUITableCellActions = React.ComponentProps<'td'> & {
155
+ virtualRowIndex: number;
156
+ column?: Column<unknown, unknown>;
157
+ getContext: () => CellContext<unknown, unknown>;
158
+ };
159
+ type TUITableCell = React.ComponentProps<'td'> & {
160
+ isPinned?: ColumnPinningPosition;
161
+ isFirstCell?: boolean;
162
+ isLastCell?: boolean;
163
+ colId?: string;
164
+ cellId?: string;
165
+ position?: 'start' | 'center' | 'end';
166
+ column?: Column<unknown, unknown>;
167
+ getContext: () => CellContext<unknown, unknown>;
168
+ };
169
+ type TUITableFooter = React.PropsWithChildren<React.ComponentProps<'tfoot'>>;
170
+ type TUITableLoadMore = React.PropsWithChildren<React.ComponentProps<'tr'> & {
171
+ virtualRowIndex: number;
172
+ virtualRowStart: number;
173
+ fetchMoreData?: () => void | Promise<void>;
174
+ }>;
175
+ type TUITableColumn<TData extends RowData<TData>> = Pick<AccessorKeyColumnDef<TData, AnyEntity>, 'id' | 'accessorKey' | 'size' | 'maxSize' | 'minSize' | 'header' | 'cell' | 'meta'> & {
105
176
  meta?: {
106
- position: 'start' | 'center' | 'end';
177
+ position?: 'start' | 'center' | 'end';
178
+ fitContent?: boolean;
107
179
  };
108
180
  };
109
- type TTableContext<TData extends RowData> = {
181
+ type TTableContext<TData extends RowData<TData>> = {
110
182
  title: string;
111
183
  table: Table<TData>;
112
- data: TData[];
113
184
  isEmpty: boolean;
114
185
  isFetching?: boolean;
115
186
  isRefetching?: boolean;
116
187
  totalRows?: number;
117
- rowSelection: RowSelectionState;
118
- columnPinning: ColumnPinningState;
119
188
  fetchMoreData?: () => void | Promise<void>;
120
189
  };
121
- type TTableClickRow<TData extends RowData, TKey extends keyof TData = keyof TData> = {
190
+ type TTableInnerWrapperContext = {
191
+ innerWrapperId: string;
192
+ };
193
+ type TTableInnerTableContext = {
194
+ table: Table<AnyEntity>;
195
+ innerTableId: string;
196
+ totalSize: number;
197
+ };
198
+ type TTableHeadRowContext = {
199
+ isAllRowsSelected: boolean;
200
+ columnPinningState: ColumnPinningState;
201
+ leftPinnedHeaders: Header<AnyEntity, unknown>[];
202
+ rightPinnedHeaders: Header<AnyEntity, unknown>[];
203
+ onToggleAllRowsSelected?: (value?: boolean) => void;
204
+ };
205
+ type TTableBodyContext = {
206
+ isFetching: boolean;
207
+ isEmpty: boolean;
208
+ rowSelectionState: RowSelectionState;
209
+ };
210
+ type TTableRowContext<TData extends RowData<TData> = RowData<AnyEntity>, TKey extends keyof TData = keyof TData> = {
122
211
  keyOfClickRow?: TKey;
123
- onClickRow?: (rowIndex: number, rowId?: TData[TKey]) => void;
212
+ isAllRowsSelected?: boolean;
213
+ columnPinningState: ColumnPinningState;
214
+ onClickRow?: (rowIndex: number, rowId?: AnyEntity) => void;
215
+ leftPinnedHeaders?: Header<TData, unknown>[];
216
+ rightPinnedHeaders?: Header<TData, unknown>[];
124
217
  };
125
218
  type TTableVirtualizerContext = {
126
219
  rowVirtualizer: Virtualizer<HTMLDivElement, HTMLTableRowElement>;
127
220
  virtualItems: VirtualItem[];
128
221
  };
129
- type TableProviderProps<TData extends RowData, TKey extends keyof TData> = {
222
+ type TableProviderProps<TData extends RowData<TData>, TKey extends keyof TData = keyof TData, TColumns extends ReadonlyArray<TUITableColumn<TData>> = TUITableColumn<TData>[]> = {
130
223
  title: string;
131
224
  isFetching?: boolean;
132
225
  isRefetching?: boolean;
133
226
  data: TData[];
134
- columns: TUITableColumn<TData>[];
227
+ columns: TColumns;
135
228
  totalRows?: number;
136
229
  fetchMoreData?: () => void | Promise<void>;
137
- leftPinnedColumns?: string[];
138
- rightPinnedColumns?: string[];
139
- keyOfClickRow?: TTableClickRow<TData, TKey>['keyOfClickRow'];
140
- onClickRow?: TTableClickRow<TData, TKey>['onClickRow'];
230
+ leftPinnedColumns?: Array<TColumns[number]['accessorKey']>;
231
+ rightPinnedColumns?: Array<TColumns[number]['accessorKey']> | string[];
232
+ keyOfClickRow?: TTableRowContext<TData, TKey>['keyOfClickRow'];
233
+ onClickRow?: TTableRowContext<TData, TKey>['onClickRow'];
234
+ onRowSelection?: (rowSelection: RowSelectionState) => void;
235
+ onColumnPinning?: (columnPinning: ColumnPinningState) => void;
141
236
  };
142
237
  //#endregion
238
+ //#region packages/components/features/tables/components/common.d.ts
239
+ declare const UITableHeadCellOption: react267.NamedExoticComponent<TUITableHeadCellOption>;
240
+ declare const UITableHeadCellSelect: react267.NamedExoticComponent<TUITableHeadCellSelect>;
241
+ declare const UITableEmptyDisplay: react267.NamedExoticComponent<TUITableEmptyDisplay>;
242
+ declare const UITableWrapper: react267.NamedExoticComponent<TUITableWrapper>;
243
+ declare const UITableInnerWrapper: react267.NamedExoticComponent<TUITableInnerWrapper>;
244
+ declare const UITableInnerTable: react267.NamedExoticComponent<TUITableInnerTable>;
245
+ declare const UITableHead: react267.NamedExoticComponent<TUITableHead>;
246
+ declare const UITableHeadRow: react267.NamedExoticComponent<TUITableHeadRow>;
247
+ declare const UITableHeadCell: react267.NamedExoticComponent<TUITableHeadCell>;
248
+ declare const UITableBody: react267.NamedExoticComponent<TUITableBody>;
249
+ declare const UITableRow: react267.NamedExoticComponent<TUITableRow>;
250
+ declare const UITableCellSelect: react267.NamedExoticComponent<TUITableCellSelect>;
251
+ declare const UITableCellActions: react267.NamedExoticComponent<TUITableCellActions>;
252
+ declare const UITableCell: react267.NamedExoticComponent<TUITableCell>;
253
+ declare const UITableFooter: react267.NamedExoticComponent<TUITableFooter>;
254
+ declare const UITableLoadMore: react267.NamedExoticComponent<TUITableLoadMore>;
255
+ //#endregion
256
+ //#region packages/components/features/tables/components/table.d.ts
257
+ declare const UITableContainer: React.FC<React.PropsWithChildren>;
258
+ //#endregion
259
+ //#region packages/components/features/tables/components/table/filter.d.ts
260
+ declare const UITableFilter: () => react_jsx_runtime346.JSX.Element;
261
+ //#endregion
143
262
  //#region packages/components/features/tables/components/table/provider.d.ts
144
- declare const UITableProvider: <TData extends RowData, TKey extends keyof TData>({
263
+ declare const UITableProvider: <TData extends RowData<TData> = RowData<AnyEntity>, TKey extends keyof TData = keyof TData, TColumns extends ReadonlyArray<TUITableColumn<TData>> = TUITableColumn<TData>[]>({
145
264
  title,
146
265
  isFetching,
147
266
  isRefetching,
@@ -152,9 +271,11 @@ declare const UITableProvider: <TData extends RowData, TKey extends keyof TData>
152
271
  rightPinnedColumns,
153
272
  keyOfClickRow,
154
273
  onClickRow,
274
+ onRowSelection,
275
+ onColumnPinning,
155
276
  fetchMoreData,
156
277
  children
157
- }: React.PropsWithChildren<TableProviderProps<TData, TKey>>) => react_jsx_runtime350.JSX.Element;
278
+ }: React.PropsWithChildren<TableProviderProps<TData, TKey, TColumns>>) => react_jsx_runtime346.JSX.Element;
158
279
  //#endregion
159
280
  //#region packages/components/features/tables/components/table/tooltip.d.ts
160
281
  declare const UITableTooltipFilter: React.FC<Omit<React.ComponentProps<typeof Input>, 'className'> & {
@@ -167,5 +288,5 @@ declare const UITableTooltipActions: React.FC<{
167
288
  }>;
168
289
  declare const UITableTooltip: React.FC<React.PropsWithChildren>;
169
290
  //#endregion
170
- export { TTableClickRow, TTableContext, TTableVirtualizerContext, TUITableColumn, TableProviderProps, UITableBadgeDisplay, UITableBooleanDisplay, UITableContainer, UITableDateDisplay, UITableDescriptionDisplay, UITableFilter, UITableFooter, UITableMoreButton, UITableNameDisplay, UITablePermalink, UITablePhoneNumberDisplay, UITableProvider, UITableRemoveButton, UITableStatisticDisplay, UITableTooltip, UITableTooltipActions, UITableTooltipFilter, UITableUserDataDisplay, UITableWrapper };
291
+ export { RowData, TTableBodyContext, TTableContext, TTableHeadRowContext, TTableInnerTableContext, TTableInnerWrapperContext, TTableRowContext, TTableVirtualizerContext, TUITableBody, TUITableCell, TUITableCellActions, TUITableCellSelect, TUITableColumn, TUITableEmptyDisplay, TUITableFooter, TUITableHead, TUITableHeadCell, TUITableHeadCellOption, TUITableHeadCellSelect, TUITableHeadRow, TUITableInnerTable, TUITableInnerWrapper, TUITableLoadMore, TUITableRow, TUITableWrapper, TableProviderProps, UITableBadgeDisplay, UITableBody, UITableBooleanDisplay, UITableCell, UITableCellActions, UITableCellSelect, UITableContainer, UITableDateDisplay, UITableDescriptionDisplay, UITableEmptyDisplay, UITableFilter, UITableFooter, UITableHead, UITableHeadCell, UITableHeadCellOption, UITableHeadCellSelect, UITableHeadRow, UITableInnerTable, UITableInnerWrapper, UITableLoadMore, UITableMoreButton, UITableNameDisplay, UITablePermalink, UITablePhoneNumberDisplay, UITableProvider, UITableRemoveButton, UITableRow, UITableStatisticDisplay, UITableTooltip, UITableTooltipActions, UITableTooltipFilter, UITableUserDataDisplay, UITableWrapper };
171
292
  //# sourceMappingURL=index.d.mts.map
@@ -1,2 +1,2 @@
1
- import"../../button.variants-DBOg9vCn.mjs";import{t as e}from"../../button-BlQN92Jt.mjs";import{t}from"../../flex-_tvOU0u1.mjs";import{t as n}from"../../paragraph-C83yi9US.mjs";import{t as r}from"../../date-Bznq86tY.mjs";import{t as i}from"../../badge-CJ-SG_OK.mjs";import{i as a,n as o,r as s,t as c}from"../../tooltip-Dd1torAV.mjs";import{n as l,t as u}from"../../avatar-DjCXs3FZ.mjs";import{t as d}from"../../separator-CWar33xc.mjs";import{a as f,d as p,h as m,i as h,r as g,t as _,u as v}from"../../dropdown-menu-BwcDzb4B.mjs";import{t as y}from"../../checkbox-D4K3ZATY.mjs";import{n as b,r as x,t as S}from"../../resizable-BfkKNflf.mjs";import{t as ee}from"../../input-CqN74taK.mjs";import{cn as C}from"@customafk/react-toolkit/utils";import{Fragment as te,jsx as w,jsxs as T}from"react/jsx-runtime";import{ArrowRightIcon as ne,BoxIcon as re,CheckIcon as ie,CirclePlus as ae,Columns4Icon as oe,DownloadIcon as se,EllipsisVerticalIcon as ce,ExternalLinkIcon as E,EyeOffIcon as le,ListFilterIcon as ue,ListFilterPlus as de,LoaderIcon as D,MinusIcon as O,MoreVerticalIcon as fe,MoveLeftIcon as pe,MoveRightIcon as me,PinOffIcon as he,RefreshCwIcon as ge,SearchIcon as _e,Trash2Icon as ve,UserRoundIcon as k,XIcon as A}from"lucide-react";import{Activity as j,createContext as M,memo as N,use as P,useCallback as F,useEffect as ye,useMemo as I,useRef as be,useState as L}from"react";import{colorHashLight as xe}from"@customafk/react-toolkit/color-hash";import{flexRender as R,getCoreRowModel as Se,getExpandedRowModel as Ce,getGroupedRowModel as we,useReactTable as Te}from"@tanstack/react-table";import{useVirtualizer as Ee}from"@tanstack/react-virtual";import{useDebounceCallback as De}from"@customafk/react-toolkit/hooks/useDebounceCallback";const z=()=>T(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[w(O,{size:16}),w(O,{size:16})]}),Oe=({label:e,onClick:t,onRemove:n})=>e?n?T(`div`,{className:`flex w-fit gap-x-0.5 rounded-full border border-border py-1 pr-2 pl-3 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:[e,w(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:w(A,{size:12})})]}):w(`button`,{className:`w-fit rounded-full border border-border px-3 py-1 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:e}):w(z,{}),ke=({value:e})=>e==null?w(z,{}):e===!1?w(`div`,{className:`text-danger-strong`,children:w(A,{})}):w(`div`,{className:`text-success-strong`,children:w(ie,{})}),Ae=({date:e})=>e==null?w(z,{}):w(s,{children:T(c,{children:[w(a,{asChild:!0,children:w(i,{className:`h-fit`,children:w(r,{date:e,format:`medium`,className:`font-normal text-white`})})}),w(o,{className:`rounded`,children:w(r,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),je=({content:e})=>e==null?w(z,{}):T(c,{children:[w(a,{asChild:!0,children:w(`div`,{className:`line-clamp-2 whitespace-pre-line break-all text-start text-[13px] text-text-positive-weak`,children:e})}),w(o,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:T(`div`,{className:`flex flex-col gap-y-2`,children:[w(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),T(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),Me=({items:t=[]})=>T(_,{children:[w(m,{asChild:!0,children:w(e,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:w(fe,{})})}),w(g,{children:w(h,{children:t.map(e=>w(f,{className:`px-3`,onSelect:t=>{e.onClick(e.id),t.stopPropagation()},children:e.label},e.id))})})]}),Ne=({name:e})=>e?T(c,{children:[w(a,{children:w(n,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start text-sm`,children:e})}),w(o,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:T(`div`,{className:`flex flex-col gap-y-2`,children:[w(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),T(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):w(z,{}),Pe=({href:e,label:t})=>T(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[w(`span`,{children:t||e}),w(E,{size:14})]}),Fe=({value:e})=>T(c,{children:[w(a,{asChild:!0,children:w(`p`,{className:`font-number text-secondary-foreground text-sm tabular-nums`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),w(o,{align:`start`,children:w(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),Ie=({title:t,onClick:n})=>T(c,{children:[w(a,{children:w(e,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:F(async e=>{e.preventDefault(),e.stopPropagation(),await n?.()},[n]),children:w(ve,{})})}),w(o,{children:w(`p`,{children:t||`Remove item from list table`})})]}),Le=(e,t,n)=>{let r=10**t;switch(n){case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:return Math.round(e*r)/r}},B=N(({decimalSeparator:e=`.`,groupSeparator:n=`,`,prefix:r,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=I(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=F(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=Le(e,a,o)),t.toLocaleString(`en-US`,u)},[o,u,a]),f=I(()=>{if(typeof l==`number`)return Number.isNaN(l)||!Number.isFinite(l)?`N/A`:d(l);if(typeof l==`string`){let e=l.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:d(t)}return`N/A`},[l,d]),p=I(()=>e===`.`&&n===`,`?f:f.replace(/,/g,n).replace(/\./g,e),[f,e,n]);return p===`0`||p===`N/A`||!p?w(z,{}):T(t,{padding:`none`,className:C(`font-number text-lg text-secondary-foreground tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[r,w(`p`,{children:p}),i]})});B.displayName=`UITableStatisticDisplay`;const Re=({uuid:e,username:r,email:i})=>T(t,{wrap:!1,gap:`sm`,padding:`none`,children:[!e&&w(u,{className:`size-10 shadow-card`,children:w(l,{className:`bg-muted-weak`,children:w(k,{size:28,className:`text-text-negative`})})}),e&&w(u,{className:`size-10 shadow-card`,children:w(l,{style:{backgroundColor:xe.hex(e)},children:w(k,{size:28,className:`text-white`})})}),T(t,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[w(n,{className:`font-medium text-sm text-text-positive-weak`,children:r??`Unknown User`}),w(n,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),V=M(null),ze=()=>{let e=P(V);if(!e)throw Error(`useUITableClickRowContext must be used within a TableClickRowProvider`);return e},H=M(null),U=()=>{let e=P(H);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},W=e=>{let t=e.getIsPinned();return{zIndex:t?20:void 0,left:t===`left`?`${e.getStart(`left`)}px`:void 0,right:t===`right`?`${e.getAfter(`right`)}px`:void 0}},Be=({className:e,children:t,...n})=>w(`div`,{"data-slot":`table-wrapper`,className:`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2 py-2.5 text-sm`,...n,children:t}),G=N(({children:e})=>w(`thead`,{"data-slot":`table-header`,style:{zIndex:20},className:C(`sticky top-0 grid bg-muted-bg-subtle text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:flex`,`[&_th]:h-9`,`[&_th]:select-none`,`[&_th]:items-center`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:font-medium`,`[&_th]:text-left`,`[&_th]:align-middle`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`),children:e}));G.displayName=`TableHeader`;const K=N(({children:e})=>w(`tr`,{"data-slot":`table-header-row`,className:`flex w-full border-border border-b shadow`,children:e}));K.displayName=`TableHeaderRow`;const Ve=({header:e,isPinned:t,isResizing:n,isAllRowsSelected:r,children:i,...a})=>{let o=e.getContext().table.getLeftHeaderGroups()[0].headers,s=e.getContext().table.getRightHeaderGroups()[0].headers,c=o[o.length-1]?.id,l=s[0]?.id,u=W(e.column),d=`calc(var(--header-${e.id}-size) * 1px)`;return e.id===`select`?w(`th`,{"data-slot":`table-header-cell`,style:{...u,width:60},className:C(t?`sticky`:`relative`),...a,children:w(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:w(y,{"aria-label":`Select All Rows`,checked:r,onCheckedChange:t=>{e.getContext().table.toggleAllRowsSelected(!!t)}})})}):T(`th`,{"data-slot":`table-header-cell`,"data-pinned":t,style:{...u,width:d},colSpan:e.colSpan,className:C(`group relative`,t?`sticky`:`relative`,t===`left`&&e.id===c&&`border-r border-r-border`,t===`right`&&e.id===l&&`border-l border-l-border`),...a,children:[w(`div`,{className:`absolute inset-0 gap-1 truncate`,children:w(`div`,{className:`flex h-full flex-1 cursor-pointer select-none items-center justify-between`,children:w(`div`,{className:`flex size-full flex-1 items-center truncate pl-4`,children:R(e.column.columnDef.header,e.getContext())})})}),![`select`,`actions`].includes(e.id)&&w(He,{isPinned:t,isVisible:e.column.getIsVisible(),className:`invisible absolute right-2 z-10 group-hover:visible`,onLeftPin:e.column.pin,onRightPin:e.column.pin,onUnpin:e.column.pin,onToggleVisibilityHandler:e.column.toggleVisibility}),w(j,{mode:t?`hidden`:`visible`,children:w(`div`,{onDoubleClick:e.column.resetSize,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:C(`absolute inset-y-0 -right-0.5 w-1 cursor-e-resize bg-transparent hover:bg-border`,n&&`bg-border`)})})]})},He=({isPinned:e,className:t,onLeftPin:n,onRightPin:r,onUnpin:i,onToggleVisibilityHandler:a})=>{let o=F(()=>{n(`left`)},[n]),s=F(()=>{r(`right`)},[r]),c=F(()=>{i(!1)},[i]);return T(_,{children:[w(m,{asChild:!0,children:w(`button`,{className:C(`cursor-pointer rounded-full p-0.5 text-text-positive-weak hover:bg-muted-muted hover:text-text-positive [&>svg]:size-4`,t),children:w(ce,{})})}),T(g,{align:`end`,className:`w-64 p-4`,children:[T(h,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[w(j,{mode:e?`visible`:`hidden`,children:T(f,{onClick:c,children:[!!e&&`Unpin`,w(p,{children:w(he,{className:`size-4`})})]})}),T(j,{mode:e?`hidden`:`visible`,children:[T(f,{onClick:o,children:[e?`Unpin`:`Pin to Left`,w(p,{children:w(pe,{className:`size-4`})})]}),T(f,{onClick:s,children:[e?`Unpin`:`Pin to Right`,w(p,{children:w(me,{className:`size-4`})})]})]})]}),w(v,{}),w(h,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:T(f,{onClick:()=>a(!1),children:[`Hide Field`,w(p,{children:w(le,{className:`size-4`})})]})})]})]})},Ue=({height:e,children:t,...n})=>w(`tbody`,{"data-slot":`table-body`,style:{height:`${e}px`},className:C(`relative grid w-full bg-card`,`[&_tr]:absolute [&_tr]:flex [&_tr]:w-full [&_tr]:cursor-pointer [&_tr]:border-b [&_tr]:border-b-border [&_tr]:focus:outline-none`,`[&_td]:z-10`,`[&_td]:flex`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td:not([data-pinned=false])]:bg-card`),...n,children:t}),q=N(({children:e,keyOfClickRow:t,row:n,virtualRow:r,rowVirtualizer:i,onClickRow:a,className:o,...s})=>{let{columnPinning:c}=U(),l=F(e=>{let i=t?n.original?.[t]:void 0;typeof i==`string`||typeof i==`number`?a?.(r.index,i):a?.(r.index),e.preventDefault(),e.stopPropagation()},[t,a,n.original,r.index]);return w(`tr`,{"data-slot":`table-row`,"data-index":r.index,ref:e=>i.measureElement(e),style:{transform:`translateY(${r.start}px)`},className:C(`group`,o),onClick:l,...s,children:n.getVisibleCells().map(e=>w(J,{cell:e,className:`group-hover:bg-muted-bg-subtle!`},e.id))})});q.displayName=`TableRow`;const J=N(({cell:e,children:t,className:n,...r})=>{let{rowSelection:i}=U(),a=e.column.getIsPinned(),o=e.getContext().table.getLeftHeaderGroups()[0].headers,s=e.getContext().table.getRightHeaderGroups()[0].headers,c=o[o.length-1]?.id,l=s[0]?.id,u=W(e.column),d=`calc(var(--col-${e.column.id}-size) * 1px)`,f=e.column.columnDef.meta?.position??`start`;return e.column.id===`select`?w(`td`,{"data-slot":`table-cell`,style:{...u,width:60},className:C(`border-none! bg-transparent! shadow-none!`,a?`sticky`:`relative`,n),...r,children:w(`div`,{"data-slot":`table-cell-inner`,className:`inline-flex w-full items-center justify-center bg-transparent text-center align-middle`,children:w(y,{"aria-label":`Select Row`,checked:e.row.getIsSelected(),onCheckedChange:t=>{e.row.toggleSelected(!!t)}})})}):w(`td`,{"data-slot":`table-cell`,"data-pinned":a,style:{...u,width:d},className:C(a&&`sticky`,!a&&`relative`,a===`left`&&e.column.id===c&&`border-r border-r-border`,a===`right`&&e.column.id===l&&`border-l border-l-border`,n),...r,children:w(`div`,{"data-slot":`table-cell-inner`,className:C(`inline-flex w-full items-center bg-transparent text-center align-middle`,f===`start`&&`justify-start`,f===`center`&&`justify-center`,f===`end`&&`justify-end`),children:R(e.column.columnDef.cell,e.getContext())})})});J.displayName=`TableCell`;const Y=N(()=>w(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:T(`div`,{className:`flex flex-col items-center gap-1`,children:[w(re,{strokeWidth:1,size:48}),w(`p`,{children:`No data available`})]})}));Y.displayName=`EmptyDisplay`;const X=N(()=>w(`div`,{className:`absolute top-0 z-30 flex size-full items-center justify-center bg-black/10`,children:w(D,{className:`animate-spin text-text-positive`})}));X.displayName=`RefetchingDisplay`;const We=({children:e})=>w(`tfoot`,{"data-slot":`table-footer`,className:`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,children:e}),Z=({children:e})=>{let{table:t,isEmpty:n,isRefetching:r,isFetching:i,data:a,totalRows:o,fetchMoreData:s}=U(),{keyOfClickRow:c,onClickRow:l}=ze(),u=be(null),d=I(()=>{let e=t.getFlatHeaders(),n={};return e.forEach(e=>{n[`--header-${e.id}-size`]=e.getSize()||0,n[`--col-${e.column.id}-size`]=e.column.getSize()||0}),n},[t.getState().columnSizingInfo,t.getState().columnSizing]),f=F(async e=>{if(!e)return null;let{scrollHeight:t,scrollTop:n,clientHeight:r}=e;t-n-r<500&&!i&&o&&a.length<o&&s?.()},[i,a.length,o,s]);ye(()=>{f(u.current)},[f]);let{rows:p}=t.getRowModel(),m=Ee({count:p.length,estimateSize:()=>40,getScrollElement:()=>u.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2});return T(x,{direction:`horizontal`,style:{direction:t.options.columnResizeDirection},className:C(`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border bg-slate-50 p-0 text-sm`,!e&&`border-r border-r-border`),children:[T(b,{className:`relative overflow-auto`,children:[T(`div`,{ref:u,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border`,onScroll:e=>f(e.currentTarget),children:[T(`table`,{"data-slot":`table`,style:{...d,width:t.getTotalSize()},className:`grid w-full max-w-full caption-bottom border-collapse border-spacing-0 flex-col content-start bg-card text-sm tabular-nums [&_tfoot_td]:border-t`,children:[w(G,{children:t.getHeaderGroups().map(e=>w(K,{children:e.headers.map(e=>w(Ve,{header:e,isPinned:e.column.getIsPinned(),isResizing:e.column.getIsResizing(),isAllRowsSelected:t.getIsAllRowsSelected()},e.id))},e.id))}),w(Ue,{"data-slot":`table-body`,height:m.getTotalSize(),children:m.getVirtualItems().map(e=>{let t=p[e.index];return w(q,{"data-index":e.index,keyOfClickRow:c,row:t,virtualRow:e,rowVirtualizer:m,onClickRow:l},t.id)})})]}),n&&w(Y,{})]}),r&&w(X,{})]}),!!e&&T(te,{children:[w(S,{}),e]})]})},Ge=({checked:e,title:t,onCheckedChange:n})=>T(`div`,{className:`flex h-fit items-center gap-2`,children:[w(y,{checked:e,onCheckedChange:n}),w(`p`,{className:`text-sm`,children:t})]}),Ke=()=>{let{table:t}=U(),[n,r]=L(null);return w(b,{defaultSize:25,className:C(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:T(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[T(`div`,{className:`flex-1`,children:[w(j,{mode:n===`columns`?`visible`:`hidden`,children:T(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[w(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),w(d,{}),w(`div`,{className:`flex flex-col gap-4 pt-4`,children:t.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:w(Ge,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),w(j,{mode:n===`filters`?`visible`:`hidden`,children:w(`div`,{className:`flex size-full flex-col p-2`,children:T(e,{variant:`outline`,color:`muted`,children:[w(de,{}),`Add Filter`]})})})]}),T(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[T(`button`,{className:C(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`columns`&&`bg-card`),onClick:()=>r(n===`columns`?null:`columns`),children:[w(oe,{size:18}),w(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),w(d,{}),T(`button`,{className:C(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`filters`&&`bg-card`),onClick:()=>r(n===`filters`?null:`filters`),children:[w(ue,{size:18}),w(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),w(d,{})]})]})})},qe=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o,rightPinnedColumns:s,keyOfClickRow:c,onClickRow:l,fetchMoreData:u,children:d})=>{let[f,p]=L({}),[m,h]=L({right:s,left:o}),[g,_]=L({}),v=Te({data:r,columns:i,state:{rowSelection:f,columnPinning:m,columnVisibility:g},defaultColumn:{minSize:40,size:150,maxSize:800},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,getCoreRowModel:Se(),getGroupedRowModel:we(),getExpandedRowModel:Ce(),onRowSelectionChange:p,onColumnPinningChange:h,onColumnVisibilityChange:_}),y=I(()=>{let{rows:e}=v.getRowModel();return e},[v.getRowModel().rows,v.getState().columnPinning]),b=I(()=>!t&&y.length===0,[y,t]),x=I(()=>({title:e,table:v,data:r,isEmpty:b,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:u,rowSelection:v.getState().rowSelection,columnPinning:v.getState().columnPinning}),[e,v,r,b,n,t,a,u,v.getState().columnVisibility,v.getState().rowSelection,v.getState().columnPinning]),S=I(()=>({keyOfClickRow:c,onClickRow:l}),[c,l]);return w(H.Provider,{value:x,children:w(V.Provider,{value:S,children:d})})},Je=({onSearch:e,onChange:t,...n})=>{let r=De(t=>{e?.(t)},500);return T(`div`,{className:`relative w-full max-w-80 flex-1`,children:[w(ee,{...n,size:`lg`,type:`search`,placeholder:`Search records...`,className:`flex-1 ps-9 pe-9`,onChange:e=>{t?.(e),r(e.target.value??``)}}),w(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:w(_e,{size:16})}),w(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:w(ne,{size:16,"aria-hidden":`true`})})]})},Q=({children:e,disabled:t,onClick:n})=>w(`button`,{type:`button`,disabled:t,className:`flex cursor-pointer items-center gap-x-1 rounded-sm border border-border bg-background p-2.5 text-sm text-text-positive-weak outline-none transition-all hover:shadow-card focus:border-border-emphasis focus:bg-muted-muted active:border-border-emphasis active:bg-muted-muted active:text-text-positive disabled:pointer-events-none disabled:cursor-default disabled:opacity-60 [&_svg]:size-3.5`,onClick:n,children:e}),Ye=({onCreate:e,onDownload:t,onRefresh:n})=>T(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[w(Q,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:w(ae,{})}),w(Q,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:w(ge,{})}),w(Q,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:w(se,{})})]}),$=({children:e})=>{let{title:t}=U();return T(`div`,{"data-slot":`table-tooltip`,className:`relative m-0 flex w-full flex-0 flex-col flex-wrap items-start space-y-2 p-0 px-2 text-sm`,children:[w(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),w(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};$.displayName=`TableTooltip`;export{Oe as UITableBadgeDisplay,ke as UITableBooleanDisplay,Z as UITableContainer,Ae as UITableDateDisplay,je as UITableDescriptionDisplay,Ke as UITableFilter,We as UITableFooter,Me as UITableMoreButton,Ne as UITableNameDisplay,Pe as UITablePermalink,Fe as UITablePhoneNumberDisplay,qe as UITableProvider,Ie as UITableRemoveButton,B as UITableStatisticDisplay,$ as UITableTooltip,Ye as UITableTooltipActions,Je as UITableTooltipFilter,Re as UITableUserDataDisplay,Be as UITableWrapper};
1
+ import{t as e}from"../../paragraph-BTJV4aeF.mjs";import"../../button.variants-CL2rLGYO.mjs";import{t}from"../../button-C_yZHudZ.mjs";import{t as n}from"../../flex-BP8sTi70.mjs";import{t as r}from"../../date-CK7XBqG9.mjs";import{t as i}from"../../badge-B4Fa7-J3.mjs";import{i as a,n as o,r as s,t as c}from"../../tooltip-B3dTcgcc.mjs";import{n as l,t as u}from"../../avatar-DReNH6rV.mjs";import{t as d}from"../../separator-Bf0gymN4.mjs";import{a as f,d as p,h as m,i as h,r as g,t as _}from"../../dropdown-menu-B8GUTfTp.mjs";import{t as v}from"../../checkbox-Bg2FiuQw.mjs";import{t as y}from"../../spinner-D1v3Bard.mjs";import{n as b,r as ee}from"../../resizable-DXHfkbaz.mjs";import{t as te}from"../../input-DBtIgQB6.mjs";import{cn as x}from"@customafk/react-toolkit/utils";import{Activity as S,createContext as C,memo as w,use as T,useCallback as E,useEffect as D,useId as ne,useMemo as O,useRef as k,useState as A}from"react";import{jsx as j,jsxs as M}from"react/jsx-runtime";import{AlertTriangle as N,ArrowRightIcon as P,BoxIcon as F,CheckIcon as re,ChevronDown as ie,CirclePlus as ae,Columns4Icon as oe,DownloadIcon as se,EllipsisVerticalIcon as ce,ExternalLinkIcon as le,ListFilterIcon as ue,ListFilterPlus as de,MinusIcon as fe,MoreVerticalIcon as pe,MoveLeftIcon as me,MoveRightIcon as he,PinOffIcon as ge,RefreshCwIcon as _e,SearchIcon as ve,Trash2Icon as ye,UserRoundIcon as be,XIcon as xe}from"lucide-react";import{colorHashLight as Se}from"@customafk/react-toolkit/color-hash";import{flexRender as I,getCoreRowModel as Ce,getExpandedRowModel as we,getGroupedRowModel as Te,useReactTable as Ee}from"@tanstack/react-table";import{useVirtualizer as De}from"@tanstack/react-virtual";import{useDebounceCallback as Oe}from"@customafk/react-toolkit/hooks/useDebounceCallback";const L=()=>M(`div`,{className:`flex gap-0 text-text-positive-weak`,children:[j(fe,{size:16}),j(fe,{size:16})]}),ke=({label:e,onClick:t,onRemove:n})=>e?n?M(`div`,{className:`flex w-fit gap-x-0.5 rounded-full border border-border py-1 pr-2 pl-3 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:[e,j(`button`,{className:`cursor-pointer text-text-positive-weak hover:text-text-positive-strong`,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:j(xe,{size:12})})]}):j(`button`,{className:`w-fit rounded-full border border-border px-3 py-1 text-text-positive text-xs shadow-xs`,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:e}):j(L,{}),Ae=({value:e})=>e==null?j(L,{}):e===!1?j(`div`,{className:`text-danger-strong`,children:j(xe,{})}):j(`div`,{className:`text-success-strong`,children:j(re,{})}),je=({date:e})=>e==null?j(L,{}):j(s,{children:M(c,{children:[j(a,{asChild:!0,children:j(i,{className:`h-fit`,children:j(r,{date:e,format:`medium`,className:`font-normal text-white`})})}),j(o,{className:`rounded`,children:j(r,{date:e,format:`full`,showTime:!0,className:`font-medium text-text-negative text-xs`})})]})}),Me=({content:e})=>e==null?j(L,{}):M(c,{children:[j(a,{asChild:!0,children:j(`div`,{className:`line-clamp-2 whitespace-pre-line break-all text-start text-[13px] text-text-positive-weak`,children:e})}),j(o,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:M(`div`,{className:`flex flex-col gap-y-2`,children:[j(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),M(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),Ne=({items:e=[]})=>M(_,{children:[j(m,{asChild:!0,children:j(t,{size:`sm`,variant:`ghost`,color:`secondary`,className:`size-9 rounded-full`,children:j(pe,{})})}),j(g,{children:j(h,{children:e.map(e=>j(f,{className:`px-3`,onSelect:t=>{e.onClick(e.id),t.stopPropagation()},children:e.label},e.id))})})]}),Pe=({name:t})=>t?M(c,{children:[j(a,{children:j(e,{variant:`sm`,className:`line-clamp-2 w-full truncate text-wrap pb-px text-start text-sm`,children:t})}),j(o,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:M(`div`,{className:`flex flex-col gap-y-2`,children:[j(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:t}),M(`p`,{className:`w-full text-end`,children:[t.length,` chars`]})]})})]}):j(L,{}),Fe=({href:e,label:t})=>M(`a`,{href:e,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[j(`span`,{children:t||e}),j(le,{size:14})]}),Ie=({value:e})=>M(c,{children:[j(a,{asChild:!0,children:j(`p`,{className:`font-number text-secondary-foreground text-sm tabular-nums`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),j(o,{align:`start`,children:j(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),Le=({title:e,onClick:n})=>M(c,{children:[j(a,{children:j(t,{type:`button`,variant:`ghost`,color:`danger`,size:`icon`,onClick:E(async e=>{e.preventDefault(),e.stopPropagation(),await n?.()},[n]),children:j(ye,{})})}),j(o,{children:j(`p`,{children:e||`Remove item from list table`})})]}),Re=(e,t,n)=>{let r=10**t;switch(n){case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:return Math.round(e*r)/r}},ze=w(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:c=`lg`,value:l=0})=>{let u=O(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),d=E(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=Re(e,a,o)),t.toLocaleString(`en-US`,u)},[o,u,a]),f=O(()=>{if(typeof l==`number`)return Number.isNaN(l)||!Number.isFinite(l)?`N/A`:d(l);if(typeof l==`string`){let e=l.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:d(t)}return`N/A`},[l,d]),p=O(()=>e===`.`&&t===`,`?f:f.replace(/,/g,t).replace(/\./g,e),[f,e,t]);return p===`0`||p===`N/A`||!p?j(L,{}):M(n,{padding:`none`,className:x(`font-number text-lg text-secondary-foreground tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`),children:[r,j(`p`,{children:p}),i]})});ze.displayName=`UITableStatisticDisplay`;const Be=({uuid:t,username:r,email:i})=>M(n,{wrap:!1,gap:`sm`,padding:`none`,children:[!t&&j(u,{className:`size-10 shadow-card`,children:j(l,{className:`bg-muted-weak`,children:j(be,{size:28,className:`text-text-negative`})})}),t&&j(u,{className:`size-10 shadow-card`,children:j(l,{style:{backgroundColor:Se.hex(t)},children:j(be,{size:28,className:`text-white`})})}),M(n,{vertical:!0,padding:`none`,gap:`none`,align:`start`,children:[j(e,{className:`font-medium text-sm text-text-positive-weak`,children:r??`Unknown User`}),j(e,{variant:`sm`,className:`mt-0! text-text-positive-weak text-xs`,children:i})]})]}),Ve=C(null),He=()=>{let e=T(Ve);if(!e)throw Error(`useTableInnerWrapperContext must be used within a TableInnerWrapperProvider`);return e},Ue=C(null),We=()=>{let e=T(Ue);if(!e)throw Error(`useTableInnerTableContext must be used within a TableInnerTableProvider`);return e},Ge=C(null),Ke=()=>{let e=T(Ge);if(!e)throw Error(`useTableHeaderRowContext must be used within a TableHeaderRowProvider`);return e},qe=C(null),Je=()=>{let e=T(qe);if(!e)throw Error(`useTableBodyContext must be used within a TableBodyProvider`);return e},Ye=C(null),Xe=()=>{let e=T(Ye);if(!e)throw Error(`useTableRowContext must be used within a TableRowProvider`);return e},Ze=C(null),R=()=>{let e=T(Ze);if(!e)throw Error(`useTableContext must be used within a TableProvider`);return e},z=w(({isPinned:e,onLeftPin:t,onRightPin:n,onUnpin:r,className:i})=>{let a=E(()=>{t?.(`left`)},[t]),o=E(()=>{n?.(`right`)},[n]),s=E(()=>{r?.(!1)},[r]);return M(_,{children:[j(m,{asChild:!0,children:j(`button`,{className:x(`absolute right-2 z-10 p-0.5 opacity-0`,`cursor-pointer rounded-full transition-all`,`text-text-positive-weak`,`[&>svg]:size-4`,`group-hover:opacity-100`,`hover:bg-muted-muted hover:text-text-positive`,i),children:j(ce,{})})}),j(g,{align:`end`,className:`w-64 p-4`,children:M(h,{className:`*:data-[slot=dropdown-menu-item]:rounded-xs *:data-[slot=dropdown-menu-item]:p-2`,children:[j(S,{mode:e?`visible`:`hidden`,children:M(f,{onClick:s,children:[!!e&&`Unpin`,j(p,{children:j(ge,{className:`size-4`})})]})}),M(S,{mode:e?`hidden`:`visible`,children:[M(f,{onClick:a,children:[e?`Unpin`:`Pin to Left`,j(p,{children:j(me,{className:`size-4`})})]}),M(f,{onClick:o,children:[e?`Unpin`:`Pin to Right`,j(p,{children:j(he,{className:`size-4`})})]})]})]})})]})});z.displayName=`UITableHeadCellOption`;const B=w(({isPinned:e,isAllRowsSelected:t,style:n,onToggleAllRowsSelected:r,...i})=>{let a=E(e=>{r?.(!!e)},[r]);return j(`th`,{slot:`table-header-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:x(e?`sticky`:`relative`),...i,children:j(`div`,{className:`absolute inset-0 flex items-center justify-center`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:j(v,{"aria-label":`Select All Rows`,checked:t,onCheckedChange:a})})})});B.displayName=`UITableHeadCellSelect`;const V=w(({isEmpty:e,isFetching:t})=>!e&&!t?null:M(`div`,{className:`sticky left-0 flex min-h-96 flex-1 items-center justify-center bg-transparent text-text-positive-weak opacity-100`,children:[t&&M(`div`,{className:`flex flex-col items-center gap-1`,children:[j(y,{className:`size-12`}),j(`p`,{children:`Loading data...`})]}),e&&!t&&M(`div`,{className:`flex flex-col items-center gap-1`,children:[j(F,{strokeWidth:1,size:48}),j(`p`,{children:`No data available`})]})]}));V.displayName=`UITableEmptyDisplay`;const Qe=w(({className:e,children:t,...n})=>j(`div`,{slot:`table-wrapper`,className:x(`relative m-0 flex size-full flex-col flex-nowrap items-start justify-start gap-2`,e),...n,children:t}));Qe.displayName=`UITableWrapper`;const H=w(({children:e,...t})=>{let{innerWrapperId:n}=He();return j(`div`,{id:n,slot:`table-inner-wrapper`,className:`relative size-full overflow-auto border-b border-b-border border-l border-l-border bg-card`,...t,children:e})});H.displayName=`UITableInnerWrapper`;const U=w(({children:e,...t})=>{let{table:n,innerTableId:r,totalSize:i}=We(),a=k(null);return D(()=>{if(!a.current)return;let e=n.getFlatHeaders(),t=new ResizeObserver(t=>{requestAnimationFrame(()=>{let r=t[0].target;if(r instanceof HTMLTableElement){let i=t[0];if(!i)return;let a=i.contentRect.width,{left:o=[],right:s=[]}=n.getState().columnPinning,c=0,l=0,u=0,d=e.map(e=>{let{id:t}=e,n=t===`select`||t===`actions`,r=o.includes(t)||s.includes(t),i=e.getSize(),a=e.column.columnDef.maxSize;return n?(c+=60,{id:t,isFlex:!1,width:60}):r?(c+=i,{id:t,isFlex:!1,width:i}):e.column.columnDef.size||i!==150?(u+=i,{id:t,isFlex:!1,width:i}):(l++,{id:t,isFlex:!0,maxSize:a})}),f=a-c-u,p=l>0?Math.max(0,Math.floor(f/l)):0;d.forEach(e=>{if(e.isFlex){let t=e.maxSize?Math.min(p,e.maxSize):p;r.style.setProperty(`--header-${e.id}-size`,`${t}`),r.style.setProperty(`--col-${e.id}-size`,`${t}`),e.maxSize&&r.style.setProperty(`--col-${e.id}-maxSize`,`${e.maxSize}`)}else r.style.setProperty(`--header-${e.id}-size`,`${e.width}`),r.style.setProperty(`--col-${e.id}-size`,`${e.width}`)})}})});return t.observe(a.current),()=>t.disconnect()},[n.getState().columnSizingInfo,n.getState().columnSizing,n.getState().columnPinning]),j(`table`,{id:r,ref:a,slot:`table-inner-table`,className:`grid w-full table-fixed caption-bottom border-collapse border-spacing-0 flex-col content-start [&_tfoot_td]:border-t`,style:{minWidth:i},...t,children:e})});U.displayName=`UITableInnerTable`;const W=w(({className:e,children:t,...n})=>j(`thead`,{slot:`table-head`,className:x(`sticky top-0 z-20 h-9 w-full`,`grid select-none bg-muted-bg-subtle`,`border-b border-b-border shadow`,`font-medium text-[13px] text-text-positive-weak`,`[&_tr:not(:last-child)_td]:border-b`,`[&_th]:inline-flex`,`[&_th]:items-center`,`[&_th]:transition-all`,`[&_th]:duration-300`,`[&_th]:whitespace-nowrap`,`[&_th]:border-border`,`[&_th]:last:border-r-0`,`[&_th]:first:border-l-0`,`[&_tr_th:not([data-pinned=false])]:bg-muted-bg-subtle`,e),...n,children:t}));W.displayName=`UITableHead`;const G=w(({headerGroup:e,className:t,...n})=>{let{isAllRowsSelected:r,columnPinningState:i,leftPinnedHeaders:a,rightPinnedHeaders:o,onToggleAllRowsSelected:s}=Ke(),c=o[0]?.id,l=a[a.length-1]?.id;return j(`tr`,{slot:`table-head-row`,className:x(`flex`,t),...n,children:e.headers.map((e,t)=>{let n=e.column.getIsVisible(),a=i.left?.includes(e.id)?`left`:i.right?.includes(e.id)?`right`:!1;return e.id===`select`?j(B,{isPinned:a,isAllRowsSelected:r,onToggleAllRowsSelected:s},e.id):j(K,{isVisible:n,isPinned:a,isFirstCell:e.id===c,isLastCell:e.id===l,isOptionsVisible:![`select`,`actions`].includes(e.id),headerId:e.id,headerColumn:e.column,colSpan:e.colSpan,onColumnPin:e.column.pin,onToggleVisibility:e.column.toggleVisibility,children:I(e.column.columnDef.header,e.getContext())},`${e.id}-${t}`)})})});G.displayName=`UITableHeadRow`;const K=w(({isVisible:e=!0,isPinned:t=!1,isFirstCell:n=!1,isLastCell:r=!1,isOptionsVisible:i=!0,headerId:a,headerColumn:o,className:s,children:c,onColumnPin:l,onToggleVisibility:u,...d})=>{let f=O(()=>t?20:void 0,[t]),p=O(()=>{let e=o?.getStart?.(`left`);return t===`left`&&typeof e==`number`?`${e}px`:void 0},[t,o]),m=O(()=>{let e=o?.getAfter?.(`right`);return t===`right`&&typeof e==`number`?`${e}px`:void 0},[t,o]),h=O(()=>`calc(var(--header-${a}-size) * 1px)`,[a]),g=O(()=>o?.columnDef.minSize?`calc(var(--col-${a}-minSize) * 1px)`:void 0,[a,o]),_=O(()=>o?.columnDef.maxSize?`calc(var(--col-${a}-maxSize) * 1px)`:void 0,[a,o]);return M(`th`,{slot:`table-head-cell`,"data-pinned":t,"data-header":a,style:{zIndex:f,left:p,right:m,width:h,minWidth:g,maxWidth:_},className:x(`group flex`,t?`sticky`:`relative`,t===`left`&&r&&`border-r border-r-border`,t===`right`&&n&&`border-l border-l-border`,o?.columnDef.meta?.position===`center`&&`justify-center`,o?.columnDef.meta?.position===`end`&&`justify-end`,o?.columnDef.meta?.position===`start`&&`justify-start`,s),...d,children:[j(`div`,{className:`truncate pl-4`,children:c}),i&&j(z,{isPinned:t,isVisible:e,onLeftPin:l,onRightPin:l,onUnpin:l})]})});K.displayName=`UITableHeadCell`;const q=w(({height:e,className:t,children:n,...r})=>{let{isFetching:i,isEmpty:a}=Je();return a||i?null:j(`tbody`,{slot:`table-body`,style:{height:e},className:x(`relative w-full`,`grid`,`[&_tr]:absolute`,`[&_tr]:flex`,`[&_tr]:flex-none`,`[&_tr]:w-full`,`[&_tr]:cursor-pointer [&_tr]:focus:outline-none`,`[&_tr]:border-b [&_tr]:border-b-border`,`[&_td]:z-10`,`[&_td]:transition-all`,`[&_td]:duration-300`,`[&_td]:flex`,`[&_td]:flex-none`,`[&_td]:overflow-hidden`,`[&_td]:whitespace-nowrap`,`[&_td]:px-4`,`[&_td]:py-2.5`,`[&_td]:align-middle`,`[&_td]:border-border`,`[&_td]:data-[selected=true]:bg-muted-muted!`,`[&_td]:data-[selected=true]:hover:bg-muted-muted!`,`[&_td>div]:inline-flex`,`[&_td>div]:items-center`,`[&_td>div]:w-full`,`[&_td:not([data-pinned=false])]:z-20`,`[&_td:not([data-pinned=false])]:sticky`,`[&_td:not([data-pinned=false])]:bg-card`,`**:data-lastcell:border-r`,`**:data-firstcell:border-l`,t),...r,children:n})});q.displayName=`UITableBody`;const J=w(({row:e,isSelected:t,virtualRowIndex:n,virtualRowStart:r,children:i,...a})=>{let{keyOfClickRow:o,isAllRowsSelected:s,columnPinningState:c,leftPinnedHeaders:l,rightPinnedHeaders:u,onClickRow:d}=Xe(),f=O(()=>c.left??[],[c]),p=O(()=>c.right??[],[c]),m=O(()=>u?.[0]?.id,[u]),h=O(()=>l?.[l.length-1]?.id,[l]),g=E(t=>{let r=o?e.original?.[o]:void 0;d?.(n,typeof r==`string`||typeof r==`number`?r:void 0),t.preventDefault(),t.stopPropagation()},[o,d,e,n]);return j(`tr`,{slot:`table-row`,"data-index":n,style:{transform:`translateY(${r}px)`},className:`group`,onClick:g,...a,children:e.getVisibleCells().map((e,r)=>{let i=f.includes(e.column.id),a=p.includes(e.column.id),o=i?`left`:a?`right`:!1;return e.column.id===`actions`?j(X,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,virtualRowIndex:n,column:e.column,getContext:e.getContext},`${e.id}-${r}`):e.column.id===`select`?j(Y,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isSelected:s||t,onToggleRowSelected:e.row.toggleSelected},`${e.id}-${r}`):j(Z,{"data-col":e.column.id,"data-cell":n,"data-selected":t||void 0,isPinned:o,isFirstCell:e.column.id===m,isLastCell:e.column.id===h,colId:e.column.id,position:e.column.columnDef.meta?.position??`start`,column:e.column,getContext:e.getContext},`${e.id}-${r}`)})})});J.displayName=`UITableRow`;const Y=w(({isPinned:e,isSelected:t=!1,className:n,onToggleRowSelected:r,...i})=>{let a=E(e=>{r?.(!!e)},[r]);return j(`td`,{slot:`table-body-cell`,"data-pinned":!0,style:{left:0,zIndex:20,width:60,maxWidth:60},className:x(`group-hover:bg-muted-bg-subtle!`,e?`sticky`:`relative`,n),...i,children:j(`div`,{"data-slot":`table-cell-inner`,className:`flex! w-full! items-center justify-center bg-transparent text-center align-middle`,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:j(v,{"aria-label":`Select Row`,checked:t,onCheckedChange:a})})})});Y.displayName=`UITableCellSelect`;const X=w(({virtualRowIndex:e,column:t,getContext:n,className:r,...i})=>{let a=O(()=>I(t?.columnDef.cell,n()),[t,n]);return j(`td`,{"data-col":`actions`,"data-cell":e,className:`sticky inset-y-0 right-0 z-50 flex items-center pr-4 group-hover:bg-muted-bg-subtle!`,...i,children:a})});X.displayName=`UITableCellActions`;const Z=w(({isPinned:e=!1,isFirstCell:t=!1,isLastCell:n=!1,colId:r,position:i=`start`,column:a,getContext:o,...s})=>{let{innerTableId:c,table:l}=We(),u=k(document.querySelector(`table[id="${c}"]`)),d=k(null),f=O(()=>{let t=a?.getStart(`left`);return e===`left`&&typeof t==`number`?`${t}px`:void 0},[e,a]),p=O(()=>{let t=a?.getAfter(`right`);return e===`right`&&typeof t==`number`?`${t}px`:void 0},[e,a]),m=O(()=>`calc(var(--col-${r}-size) * 1px)`,[r]),h=O(()=>a?.columnDef.minSize?`calc(var(--col-${r}-minSize) * 1px)`:void 0,[r,a]),g=O(()=>a?.columnDef.maxSize?`calc(var(--col-${r}-maxSize) * 1px)`:void 0,[r,a]),_=O(()=>I(a?.columnDef.cell,o()),[a,o]);return D(()=>{if(!d.current)return;let e=d.current.scrollWidth,t=a?.getSize();t&&e>t&&u.current instanceof HTMLTableElement&&typeof r==`string`&&a?.columnDef.meta?.fitContent&&l.setColumnSizing(t=>({...t,[r]:e+32}))},[r,a,l]),j(`td`,{slot:`table-body-cell`,"data-pinned":e,"data-lastcell":n||void 0,"data-firstcell":t||void 0,style:{left:f,right:p,width:m,minWidth:h,maxWidth:g},className:`group-hover:bg-muted-bg-subtle!`,...s,children:j(`div`,{ref:d,slot:`table-body-cell-inner`,className:x(i===`start`&&`justify-start`,i===`center`&&`justify-center`,i===`end`&&`justify-end`),children:_})})});Z.displayName=`UITableCell`;const $e=w(({className:e,children:t,...n})=>j(`tfoot`,{slot:`table-footer`,className:x(`flex w-full justify-center border-border-weak border-t py-2 font-medium [&>tr]:last:border-b-0`,e),...n,children:t}));$e.displayName=`UITableFooter`;const Q=w(({virtualRowIndex:e,virtualRowStart:t,fetchMoreData:n})=>{let{innerWrapperId:r}=He(),i=k(document.querySelector(`div[id="${r}"]`)),a=k(null),[o,s]=A(`idle`),[c,l]=A(0),u=E(async()=>{try{s(`fetching`),await n?.(),s(`idle`)}catch(e){console.error(`Error fetching more data:`,e),s(`error`)}},[n]);return D(()=>{if(!i.current)return;let e=new ResizeObserver(e=>{l(e[0].contentRect.width)});return e.observe(i.current),()=>e.disconnect()},[]),j(`tr`,{ref:a,"data-index":e,style:{transform:`translateY(${t}px)`,width:c},className:`sticky! left-0 h-10`,children:j(`td`,{className:`absolute left-0 flex w-full items-center justify-center text-xs`,children:M(`button`,{type:`button`,disabled:o===`fetching`,className:x(`flex cursor-pointer gap-x-0.5`,o===`fetching`&&`cursor-not-allowed`,o===`idle`&&`text-text-positive-weak hover:text-text-positive`,o===`error`&&`text-danger hover:text-danger-strong`),onClick:u,children:[o===`idle`&&j(ie,{className:`size-4`}),o===`fetching`&&j(y,{className:`size-4 animate-spin`}),o===`error`&&j(N,{className:`size-4 text-danger`}),o===`idle`&&`Load More`,o===`fetching`&&`Loading...`,o===`error`&&`Error! Retry?`]})})})});Q.displayName=`UITableLoadMore`;const et=()=>{let{table:e,isEmpty:t,isFetching:n,fetchMoreData:r}=R(),{rowSelectionState:i}=Je(),a=k(null),{rows:o}=e.getRowModel(),s=De({count:o.length+1,estimateSize:()=>40,getScrollElement:()=>a.current,measureElement:typeof window<`u`&&navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:2}),c=O(()=>{let e=s.getTotalSize(),t=a.current?.clientHeight||0;return e<t?`${t}px`:`${e}px`},[s.getTotalSize()]);return j(ee,{direction:`horizontal`,style:{direction:e.options.columnResizeDirection},className:`relative flex w-full max-w-full flex-1 gap-1 overflow-auto border-t border-t-border border-r border-r-border bg-slate-50 p-0 text-sm`,children:j(b,{className:`relative`,children:M(H,{ref:a,children:[M(U,{children:[j(W,{children:e.getHeaderGroups().map(e=>j(G,{headerGroup:e},e.id))}),j(q,{height:c,children:s.getVirtualItems().map(e=>{let t=o[e.index],n=Object.entries(i).some(([e,n])=>e===`${t?.id}`&&n);return t?j(J,{ref:s.measureElement,row:t,isSelected:n,virtualRowIndex:e.index,virtualRowStart:e.start},e.index):j(Q,{virtualRowIndex:e.index,virtualRowStart:e.start,fetchMoreData:r},e.index)})})]}),j(V,{isEmpty:t,isFetching:n})]})})})},tt=({checked:e,title:t,onCheckedChange:n})=>M(`div`,{className:`flex h-fit items-center gap-2`,children:[j(v,{checked:e,onCheckedChange:n}),j(`p`,{className:`text-sm`,children:t})]}),nt=()=>{let{table:e}=R(),[n,r]=A(null);return j(b,{defaultSize:25,className:x(`bg-card`,n===null?`max-w-8!`:`min-w-64`),children:M(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[M(`div`,{className:`flex-1`,children:[j(S,{mode:n===`columns`?`visible`:`hidden`,children:M(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[j(`p`,{className:`px-2 font-medium`,children:`Columns Visibility`}),j(d,{}),j(`div`,{className:`flex flex-col gap-4 pt-4`,children:e.getAllColumns().map(e=>[`select`,`actions`].includes(e.id)?null:j(tt,{checked:e.getIsVisible(),title:String(e.columnDef.header),onCheckedChange:t=>e.toggleVisibility(!!t)},e.id))})]})}),j(S,{mode:n===`filters`?`visible`:`hidden`,children:j(`div`,{className:`flex size-full flex-col p-2`,children:M(t,{variant:`outline`,color:`muted`,children:[j(de,{}),`Add Filter`]})})})]}),M(`div`,{className:`flex h-full flex-col border-border border-l bg-muted-bg-subtle text-sm`,children:[M(`button`,{className:x(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`columns`&&`bg-card`),onClick:()=>r(n===`columns`?null:`columns`),children:[j(oe,{size:18}),j(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Columns`})]}),j(d,{}),M(`button`,{className:x(`flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,n===`filters`&&`bg-card`),onClick:()=>r(n===`filters`?null:`filters`),children:[j(ue,{size:18}),j(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Filters`})]}),j(d,{})]})]})})},rt=w(({innerWrapperId:e,children:t})=>{let n=O(()=>({innerWrapperId:e}),[e]);return j(Ve.Provider,{value:n,children:t})});rt.displayName=`UITableInnerWrapperProvider`;const it=w(({table:e,innerTableId:t,totalSize:n,children:r})=>{let i=O(()=>({table:e,innerTableId:t,totalSize:n}),[e,t,n]);return j(Ue.Provider,{value:i,children:r})});it.displayName=`UITableInnerTableProvider`;const at=w(({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i,children:a})=>{let o=O(()=>({isAllRowsSelected:e,columnPinningState:t,leftPinnedHeaders:n,rightPinnedHeaders:r,onToggleAllRowsSelected:i}),[e,t,n,r,i]);return j(Ge.Provider,{value:o,children:a})});at.displayName=`UITableHeadRowProvider`;const ot=w(({isFetching:e,isEmpty:t,rowSelectionState:n,children:r})=>{let i=O(()=>({isFetching:e,isEmpty:t,rowSelectionState:n}),[e,t,n]);return j(qe.Provider,{value:i,children:r})});ot.displayName=`UITableBodyProvider`;const st=w(({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a,children:o})=>{let s=O(()=>({keyOfClickRow:e,isAllRowsSelected:t,columnPinningState:n,leftPinnedHeaders:r,rightPinnedHeaders:i,onClickRow:a}),[e,t,n,r,i,a]);return j(Ye.Provider,{value:s,children:o})});st.displayName=`UITableRowProvider`;const ct=({title:e,isFetching:t=!1,isRefetching:n=!1,data:r,columns:i,totalRows:a,leftPinnedColumns:o=[],rightPinnedColumns:s=[],keyOfClickRow:c,onClickRow:l,onRowSelection:u,onColumnPinning:d,fetchMoreData:f,children:p})=>{let m=ne(),h=ne(),[g,_]=A({}),[v,y]=A({right:s,left:[`select`,...o]}),[b,ee]=A({}),te=E(e=>(_(e),u?.(e instanceof Function?e(g):e),e),[g,u]),x=E(e=>{y(e),d?.(e instanceof Function?e(v):e)},[v,d]),S=Ee({data:r,columns:i,state:{rowSelection:g,columnPinning:v,expanded:b},defaultColumn:{enableResizing:!1,size:void 0,minSize:void 0,maxSize:void 0},columnResizeMode:`onChange`,columnResizeDirection:`ltr`,enableColumnPinning:!0,enableRowSelection:!0,enableColumnResizing:!0,enableMultiRowSelection:!0,autoResetAll:!1,autoResetExpanded:!1,autoResetPageIndex:!1,getSubRows:e=>e.subRows,getCoreRowModel:Ce(),getGroupedRowModel:Te(),getExpandedRowModel:we(),onRowSelectionChange:te,onColumnPinningChange:x,onExpandedChange:ee}),C=O(()=>{let{rows:e}=S.getRowModel();return e},[S.getRowModel().rows,S.getState().columnPinning]),w=O(()=>!t&&C.length===0,[C,t]),T=O(()=>({title:e,table:S,isEmpty:w,isFetching:t,isRefetching:n,totalRows:a,fetchMoreData:f}),[e,S,w,n,t,a,f,S.getState().columnPinning,S.getState().expanded]),D=O(()=>S.getState(),[S.getState()]),k=O(()=>S.getIsAllRowsSelected(),[S.getIsAllRowsSelected()]),M=O(()=>D.rowSelection,[D.rowSelection]),N=O(()=>D.columnPinning,[D.columnPinning]),P=O(()=>S.getLeftHeaderGroups()[0]?.headers||[],[S.getState().columnPinning]),F=O(()=>S.getRightHeaderGroups()[0]?.headers||[],[S.getState().columnPinning]),re=O(()=>S.getTotalSize(),[S.getTotalSize()]);return j(Ze.Provider,{value:T,children:j(rt,{innerWrapperId:m,children:j(it,{table:S,innerTableId:h,totalSize:re,children:j(at,{isAllRowsSelected:k,columnPinningState:N,leftPinnedHeaders:P,rightPinnedHeaders:F,onToggleAllRowsSelected:S.toggleAllRowsSelected,children:j(ot,{isFetching:t,isEmpty:w,rowSelectionState:M,children:j(st,{keyOfClickRow:c,isAllRowsSelected:k,columnPinningState:N,leftPinnedHeaders:P,rightPinnedHeaders:F,onClickRow:l,children:p})})})})})})},lt=({onSearch:e,onChange:t,...n})=>{let r=Oe(t=>{e?.(t)},500);return M(`div`,{className:`relative w-full max-w-80 flex-1`,children:[j(te,{...n,size:`lg`,type:`search`,placeholder:`Search records...`,className:`flex-1 ps-9 pe-9`,onChange:e=>{t?.(e),r(e.target.value??``)}}),j(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:j(ve,{size:16})}),j(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:j(P,{size:16,"aria-hidden":`true`})})]})},$=({children:e,disabled:t,onClick:n})=>j(`button`,{type:`button`,disabled:t,className:`flex cursor-pointer items-center gap-x-1 rounded-sm border border-border bg-background p-2.5 text-sm text-text-positive-weak outline-none transition-all hover:shadow-card focus:border-border-emphasis focus:bg-muted-muted active:border-border-emphasis active:bg-muted-muted active:text-text-positive disabled:pointer-events-none disabled:cursor-default disabled:opacity-60 [&_svg]:size-3.5`,onClick:n,children:e}),ut=({onCreate:e,onDownload:t,onRefresh:n})=>M(`div`,{className:`flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,children:[j($,{disabled:!e,onClick:t=>{e?.(),t.stopPropagation(),t.preventDefault()},children:j(ae,{})}),j($,{disabled:!n,onClick:e=>{n?.(),e.stopPropagation(),e.preventDefault()},children:j(_e,{})}),j($,{disabled:!t,onClick:e=>{t?.(),e.stopPropagation(),e.preventDefault()},children:j(se,{})})]}),dt=({children:e})=>{let{title:t}=R();return M(`div`,{"data-slot":`table-tooltip`,className:`relative m-0 flex w-full flex-0 flex-col flex-wrap items-start space-y-2 p-0 px-2 text-sm`,children:[j(`h3`,{className:`font-semibold text-base text-text-positive`,children:t}),j(`div`,{className:`flex w-full flex-1 justify-between gap-x-2`,children:e})]})};dt.displayName=`TableTooltip`;export{ke as UITableBadgeDisplay,q as UITableBody,Ae as UITableBooleanDisplay,Z as UITableCell,X as UITableCellActions,Y as UITableCellSelect,et as UITableContainer,je as UITableDateDisplay,Me as UITableDescriptionDisplay,V as UITableEmptyDisplay,nt as UITableFilter,$e as UITableFooter,W as UITableHead,K as UITableHeadCell,z as UITableHeadCellOption,B as UITableHeadCellSelect,G as UITableHeadRow,U as UITableInnerTable,H as UITableInnerWrapper,Q as UITableLoadMore,Ne as UITableMoreButton,Pe as UITableNameDisplay,Fe as UITablePermalink,Ie as UITablePhoneNumberDisplay,ct as UITableProvider,Le as UITableRemoveButton,J as UITableRow,ze as UITableStatisticDisplay,dt as UITableTooltip,ut as UITableTooltipActions,lt as UITableTooltipFilter,Be as UITableUserDataDisplay,Qe as UITableWrapper};
2
2
  //# sourceMappingURL=index.mjs.map