@jameskabz/nextcraft-ui 0.6.3 → 0.6.5

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 (369) hide show
  1. package/dist/components/craft-alert.cjs +69 -0
  2. package/dist/components/craft-alert.cjs.map +1 -0
  3. package/dist/components/craft-alert.d.cts +16 -0
  4. package/dist/components/craft-alert.d.ts +16 -0
  5. package/dist/components/craft-alert.js +45 -0
  6. package/dist/components/craft-alert.js.map +1 -0
  7. package/dist/components/craft-badge.cjs +54 -0
  8. package/dist/components/craft-badge.cjs.map +1 -0
  9. package/dist/components/craft-badge.d.cts +12 -0
  10. package/dist/components/craft-badge.d.ts +12 -0
  11. package/dist/components/craft-badge.js +30 -0
  12. package/dist/components/craft-badge.js.map +1 -0
  13. package/dist/components/craft-button.cjs +66 -0
  14. package/dist/components/craft-button.cjs.map +1 -0
  15. package/dist/components/craft-button.d.cts +15 -0
  16. package/dist/components/craft-button.d.ts +15 -0
  17. package/dist/components/craft-button.js +42 -0
  18. package/dist/components/craft-button.js.map +1 -0
  19. package/dist/components/craft-card.cjs +63 -0
  20. package/dist/components/craft-card.cjs.map +1 -0
  21. package/dist/components/craft-card.d.cts +13 -0
  22. package/dist/components/craft-card.d.ts +13 -0
  23. package/dist/components/craft-card.js +39 -0
  24. package/dist/components/craft-card.js.map +1 -0
  25. package/dist/components/craft-checkbox.cjs +103 -0
  26. package/dist/components/craft-checkbox.cjs.map +1 -0
  27. package/dist/components/craft-checkbox.d.cts +16 -0
  28. package/dist/components/craft-checkbox.d.ts +16 -0
  29. package/dist/components/craft-checkbox.js +69 -0
  30. package/dist/components/craft-checkbox.js.map +1 -0
  31. package/dist/components/craft-command-palette.cjs +134 -0
  32. package/dist/components/craft-command-palette.cjs.map +1 -0
  33. package/dist/components/craft-command-palette.d.cts +28 -0
  34. package/dist/components/craft-command-palette.d.ts +28 -0
  35. package/dist/components/craft-command-palette.js +100 -0
  36. package/dist/components/craft-command-palette.js.map +1 -0
  37. package/dist/components/craft-confirm-dialog.cjs +114 -0
  38. package/dist/components/craft-confirm-dialog.cjs.map +1 -0
  39. package/dist/components/craft-confirm-dialog.d.cts +21 -0
  40. package/dist/components/craft-confirm-dialog.d.ts +21 -0
  41. package/dist/components/craft-confirm-dialog.js +80 -0
  42. package/dist/components/craft-confirm-dialog.js.map +1 -0
  43. package/dist/components/craft-create-edit-drawer.cjs +112 -0
  44. package/dist/components/craft-create-edit-drawer.cjs.map +1 -0
  45. package/dist/components/craft-create-edit-drawer.d.cts +28 -0
  46. package/dist/components/craft-create-edit-drawer.d.ts +28 -0
  47. package/dist/components/craft-create-edit-drawer.js +78 -0
  48. package/dist/components/craft-create-edit-drawer.js.map +1 -0
  49. package/dist/components/craft-currency-input.cjs +68 -0
  50. package/dist/components/craft-currency-input.cjs.map +1 -0
  51. package/dist/components/craft-currency-input.d.cts +14 -0
  52. package/dist/components/craft-currency-input.d.ts +14 -0
  53. package/dist/components/craft-currency-input.js +34 -0
  54. package/dist/components/craft-currency-input.js.map +1 -0
  55. package/dist/components/craft-data-table.cjs +407 -0
  56. package/dist/components/craft-data-table.cjs.map +1 -0
  57. package/dist/components/craft-data-table.d.cts +58 -0
  58. package/dist/components/craft-data-table.d.ts +58 -0
  59. package/dist/{chunk-ZRV4Y374.js → components/craft-data-table.js} +30 -239
  60. package/dist/components/craft-data-table.js.map +1 -0
  61. package/dist/components/craft-date-picker.cjs +226 -0
  62. package/dist/components/craft-date-picker.cjs.map +1 -0
  63. package/dist/components/craft-date-picker.d.cts +17 -0
  64. package/dist/components/craft-date-picker.d.ts +17 -0
  65. package/dist/components/craft-date-picker.js +192 -0
  66. package/dist/components/craft-date-picker.js.map +1 -0
  67. package/dist/components/craft-drawer.cjs +126 -0
  68. package/dist/components/craft-drawer.cjs.map +1 -0
  69. package/dist/components/craft-drawer.d.cts +19 -0
  70. package/dist/components/craft-drawer.d.ts +19 -0
  71. package/dist/components/craft-drawer.js +92 -0
  72. package/dist/components/craft-drawer.js.map +1 -0
  73. package/dist/components/craft-dropdown-menu.cjs +127 -0
  74. package/dist/components/craft-dropdown-menu.cjs.map +1 -0
  75. package/dist/components/craft-dropdown-menu.d.cts +28 -0
  76. package/dist/components/craft-dropdown-menu.d.ts +28 -0
  77. package/dist/components/craft-dropdown-menu.js +93 -0
  78. package/dist/components/craft-dropdown-menu.js.map +1 -0
  79. package/dist/components/craft-empty-state.cjs +58 -0
  80. package/dist/components/craft-empty-state.cjs.map +1 -0
  81. package/dist/components/craft-empty-state.d.cts +14 -0
  82. package/dist/components/craft-empty-state.d.ts +14 -0
  83. package/dist/components/craft-empty-state.js +34 -0
  84. package/dist/components/craft-empty-state.js.map +1 -0
  85. package/dist/components/craft-error-state.cjs +60 -0
  86. package/dist/components/craft-error-state.cjs.map +1 -0
  87. package/dist/components/craft-error-state.d.cts +15 -0
  88. package/dist/components/craft-error-state.d.ts +15 -0
  89. package/dist/components/craft-error-state.js +36 -0
  90. package/dist/components/craft-error-state.js.map +1 -0
  91. package/dist/components/craft-filter-bar.cjs +76 -0
  92. package/dist/components/craft-filter-bar.cjs.map +1 -0
  93. package/dist/components/craft-filter-bar.d.cts +18 -0
  94. package/dist/components/craft-filter-bar.d.ts +18 -0
  95. package/dist/components/craft-filter-bar.js +52 -0
  96. package/dist/components/craft-filter-bar.js.map +1 -0
  97. package/dist/components/craft-form-builder.cjs +330 -0
  98. package/dist/components/craft-form-builder.cjs.map +1 -0
  99. package/dist/components/craft-form-builder.d.cts +57 -0
  100. package/dist/components/craft-form-builder.d.ts +57 -0
  101. package/dist/components/craft-form-builder.js +301 -0
  102. package/dist/components/craft-form-builder.js.map +1 -0
  103. package/dist/components/craft-form-field.cjs +301 -0
  104. package/dist/components/craft-form-field.cjs.map +1 -0
  105. package/dist/components/craft-form-field.d.cts +30 -0
  106. package/dist/components/craft-form-field.d.ts +30 -0
  107. package/dist/components/craft-form-field.js +280 -0
  108. package/dist/components/craft-form-field.js.map +1 -0
  109. package/dist/components/craft-form.cjs +114 -0
  110. package/dist/components/craft-form.cjs.map +1 -0
  111. package/dist/components/craft-form.d.cts +27 -0
  112. package/dist/components/craft-form.d.ts +27 -0
  113. package/dist/components/craft-form.js +80 -0
  114. package/dist/components/craft-form.js.map +1 -0
  115. package/dist/components/craft-icon.cjs +102 -0
  116. package/dist/components/craft-icon.cjs.map +1 -0
  117. package/dist/components/craft-icon.d.cts +19 -0
  118. package/dist/components/craft-icon.d.ts +19 -0
  119. package/dist/{chunk-FEFH5O5K.js → components/craft-icon.js} +31 -13
  120. package/dist/components/craft-icon.js.map +1 -0
  121. package/dist/components/craft-input.cjs +78 -0
  122. package/dist/components/craft-input.cjs.map +1 -0
  123. package/dist/components/craft-input.d.cts +19 -0
  124. package/dist/components/craft-input.d.ts +19 -0
  125. package/dist/{chunk-7SKDTIEK.js → components/craft-input.js} +5 -10
  126. package/dist/components/craft-input.js.map +1 -0
  127. package/dist/components/craft-link.cjs +70 -0
  128. package/dist/components/craft-link.cjs.map +1 -0
  129. package/dist/components/craft-link.d.cts +14 -0
  130. package/dist/components/craft-link.d.ts +14 -0
  131. package/dist/components/craft-link.js +36 -0
  132. package/dist/components/craft-link.js.map +1 -0
  133. package/dist/components/craft-loading-state.cjs +64 -0
  134. package/dist/components/craft-loading-state.cjs.map +1 -0
  135. package/dist/components/craft-loading-state.d.cts +13 -0
  136. package/dist/components/craft-loading-state.d.ts +13 -0
  137. package/dist/components/craft-loading-state.js +40 -0
  138. package/dist/components/craft-loading-state.js.map +1 -0
  139. package/dist/components/craft-modal.cjs +174 -0
  140. package/dist/components/craft-modal.cjs.map +1 -0
  141. package/dist/components/craft-modal.d.cts +19 -0
  142. package/dist/components/craft-modal.d.ts +19 -0
  143. package/dist/components/craft-modal.js +140 -0
  144. package/dist/components/craft-modal.js.map +1 -0
  145. package/dist/components/craft-number-input.cjs +63 -0
  146. package/dist/components/craft-number-input.cjs.map +1 -0
  147. package/dist/components/craft-number-input.d.cts +12 -0
  148. package/dist/components/craft-number-input.d.ts +12 -0
  149. package/dist/components/craft-number-input.js +29 -0
  150. package/dist/components/craft-number-input.js.map +1 -0
  151. package/dist/components/craft-pagination.cjs +130 -0
  152. package/dist/components/craft-pagination.cjs.map +1 -0
  153. package/dist/components/craft-pagination.d.cts +19 -0
  154. package/dist/components/craft-pagination.d.ts +19 -0
  155. package/dist/components/craft-pagination.js +106 -0
  156. package/dist/components/craft-pagination.js.map +1 -0
  157. package/dist/components/craft-popover.cjs +123 -0
  158. package/dist/components/craft-popover.cjs.map +1 -0
  159. package/dist/components/craft-popover.d.cts +20 -0
  160. package/dist/components/craft-popover.d.ts +20 -0
  161. package/dist/components/craft-popover.js +89 -0
  162. package/dist/components/craft-popover.js.map +1 -0
  163. package/dist/components/craft-select.cjs +84 -0
  164. package/dist/components/craft-select.cjs.map +1 -0
  165. package/dist/components/craft-select.d.cts +12 -0
  166. package/dist/components/craft-select.d.ts +12 -0
  167. package/dist/components/craft-select.js +50 -0
  168. package/dist/components/craft-select.js.map +1 -0
  169. package/dist/components/craft-skeleton.cjs +45 -0
  170. package/dist/components/craft-skeleton.cjs.map +1 -0
  171. package/dist/components/craft-skeleton.d.cts +10 -0
  172. package/dist/components/craft-skeleton.d.ts +10 -0
  173. package/dist/components/craft-skeleton.js +21 -0
  174. package/dist/components/craft-skeleton.js.map +1 -0
  175. package/dist/components/craft-stat-card.cjs +67 -0
  176. package/dist/components/craft-stat-card.cjs.map +1 -0
  177. package/dist/components/craft-stat-card.d.cts +17 -0
  178. package/dist/components/craft-stat-card.d.ts +17 -0
  179. package/dist/components/craft-stat-card.js +43 -0
  180. package/dist/components/craft-stat-card.js.map +1 -0
  181. package/dist/components/craft-submit-button.cjs +71 -0
  182. package/dist/components/craft-submit-button.cjs.map +1 -0
  183. package/dist/components/craft-submit-button.d.cts +13 -0
  184. package/dist/components/craft-submit-button.d.ts +13 -0
  185. package/dist/components/craft-submit-button.js +47 -0
  186. package/dist/components/craft-submit-button.js.map +1 -0
  187. package/dist/components/craft-switch.cjs +82 -0
  188. package/dist/components/craft-switch.cjs.map +1 -0
  189. package/dist/components/craft-switch.d.cts +14 -0
  190. package/dist/components/craft-switch.d.ts +14 -0
  191. package/dist/components/craft-switch.js +48 -0
  192. package/dist/components/craft-switch.js.map +1 -0
  193. package/dist/components/craft-table-toolbar.cjs +79 -0
  194. package/dist/components/craft-table-toolbar.cjs.map +1 -0
  195. package/dist/components/craft-table-toolbar.d.cts +19 -0
  196. package/dist/components/craft-table-toolbar.d.ts +19 -0
  197. package/dist/components/craft-table-toolbar.js +55 -0
  198. package/dist/components/craft-table-toolbar.js.map +1 -0
  199. package/dist/components/craft-tabs.cjs +105 -0
  200. package/dist/components/craft-tabs.cjs.map +1 -0
  201. package/dist/components/craft-tabs.d.cts +19 -0
  202. package/dist/components/craft-tabs.d.ts +19 -0
  203. package/dist/components/craft-tabs.js +71 -0
  204. package/dist/components/craft-tabs.js.map +1 -0
  205. package/dist/components/craft-textarea.cjs +69 -0
  206. package/dist/components/craft-textarea.cjs.map +1 -0
  207. package/dist/components/craft-textarea.d.cts +12 -0
  208. package/dist/components/craft-textarea.d.ts +12 -0
  209. package/dist/components/craft-textarea.js +35 -0
  210. package/dist/components/craft-textarea.js.map +1 -0
  211. package/dist/components/craft-toast.cjs +98 -0
  212. package/dist/components/craft-toast.cjs.map +1 -0
  213. package/dist/components/craft-toast.d.cts +24 -0
  214. package/dist/components/craft-toast.d.ts +24 -0
  215. package/dist/components/craft-toast.js +63 -0
  216. package/dist/components/craft-toast.js.map +1 -0
  217. package/dist/components/craft-tooltip.cjs +75 -0
  218. package/dist/components/craft-tooltip.cjs.map +1 -0
  219. package/dist/components/craft-tooltip.d.cts +13 -0
  220. package/dist/components/craft-tooltip.d.ts +13 -0
  221. package/dist/components/craft-tooltip.js +41 -0
  222. package/dist/components/craft-tooltip.js.map +1 -0
  223. package/dist/components/forms/types.cjs +17 -0
  224. package/dist/components/forms/types.cjs.map +1 -0
  225. package/dist/components/forms/types.d.cts +7 -0
  226. package/dist/components/forms/types.d.ts +7 -0
  227. package/dist/components/forms/types.js +1 -0
  228. package/dist/components/forms/types.js.map +1 -0
  229. package/dist/components/glass-card.cjs +64 -0
  230. package/dist/components/glass-card.cjs.map +1 -0
  231. package/dist/components/glass-card.d.cts +12 -0
  232. package/dist/components/glass-card.d.ts +12 -0
  233. package/dist/components/glass-card.js +40 -0
  234. package/dist/components/glass-card.js.map +1 -0
  235. package/dist/components/layout/app-shell.cjs +49 -0
  236. package/dist/components/layout/app-shell.cjs.map +1 -0
  237. package/dist/components/layout/app-shell.d.cts +10 -0
  238. package/dist/components/layout/app-shell.d.ts +10 -0
  239. package/dist/components/layout/app-shell.js +25 -0
  240. package/dist/components/layout/app-shell.js.map +1 -0
  241. package/dist/components/layout/app-template.cjs +104 -0
  242. package/dist/components/layout/app-template.cjs.map +1 -0
  243. package/dist/components/layout/app-template.d.cts +19 -0
  244. package/dist/components/layout/app-template.d.ts +19 -0
  245. package/dist/components/layout/app-template.js +70 -0
  246. package/dist/components/layout/app-template.js.map +1 -0
  247. package/dist/components/layout/auth-layout.cjs +65 -0
  248. package/dist/components/layout/auth-layout.cjs.map +1 -0
  249. package/dist/components/layout/auth-layout.d.cts +12 -0
  250. package/dist/components/layout/auth-layout.d.ts +12 -0
  251. package/dist/components/layout/auth-layout.js +41 -0
  252. package/dist/components/layout/auth-layout.js.map +1 -0
  253. package/dist/components/layout/breadcrumbs.cjs +39 -0
  254. package/dist/components/layout/breadcrumbs.cjs.map +1 -0
  255. package/dist/components/layout/breadcrumbs.d.cts +13 -0
  256. package/dist/components/layout/breadcrumbs.d.ts +13 -0
  257. package/dist/components/layout/breadcrumbs.js +15 -0
  258. package/dist/components/layout/breadcrumbs.js.map +1 -0
  259. package/dist/components/layout/container.cjs +45 -0
  260. package/dist/components/layout/container.cjs.map +1 -0
  261. package/dist/components/layout/container.d.cts +9 -0
  262. package/dist/components/layout/container.d.ts +9 -0
  263. package/dist/components/layout/container.js +21 -0
  264. package/dist/components/layout/container.js.map +1 -0
  265. package/dist/components/layout/grid.cjs +47 -0
  266. package/dist/components/layout/grid.cjs.map +1 -0
  267. package/dist/components/layout/grid.d.cts +10 -0
  268. package/dist/components/layout/grid.d.ts +10 -0
  269. package/dist/components/layout/grid.js +23 -0
  270. package/dist/components/layout/grid.js.map +1 -0
  271. package/dist/components/layout/layout-config.cjs +78 -0
  272. package/dist/components/layout/layout-config.cjs.map +1 -0
  273. package/dist/components/layout/layout-config.d.cts +92 -0
  274. package/dist/components/layout/layout-config.d.ts +92 -0
  275. package/dist/components/layout/layout-config.js +54 -0
  276. package/dist/components/layout/layout-config.js.map +1 -0
  277. package/dist/components/layout/page-header.cjs +52 -0
  278. package/dist/components/layout/page-header.cjs.map +1 -0
  279. package/dist/components/layout/page-header.d.cts +11 -0
  280. package/dist/components/layout/page-header.d.ts +11 -0
  281. package/dist/components/layout/page-header.js +28 -0
  282. package/dist/components/layout/page-header.js.map +1 -0
  283. package/dist/components/layout/sidebar.cjs +64 -0
  284. package/dist/components/layout/sidebar.cjs.map +1 -0
  285. package/dist/components/layout/sidebar.d.cts +17 -0
  286. package/dist/components/layout/sidebar.d.ts +17 -0
  287. package/dist/components/layout/sidebar.js +40 -0
  288. package/dist/components/layout/sidebar.js.map +1 -0
  289. package/dist/components/layout/top-nav.cjs +49 -0
  290. package/dist/components/layout/top-nav.cjs.map +1 -0
  291. package/dist/components/layout/top-nav.d.cts +11 -0
  292. package/dist/components/layout/top-nav.d.ts +11 -0
  293. package/dist/components/layout/top-nav.js +25 -0
  294. package/dist/components/layout/top-nav.js.map +1 -0
  295. package/dist/components/layout/types.cjs +29 -0
  296. package/dist/components/layout/types.cjs.map +1 -0
  297. package/dist/components/layout/types.d.cts +12 -0
  298. package/dist/components/layout/types.d.ts +12 -0
  299. package/dist/components/layout/types.js +5 -0
  300. package/dist/components/layout/types.js.map +1 -0
  301. package/dist/components/table/types.cjs +17 -0
  302. package/dist/components/table/types.cjs.map +1 -0
  303. package/dist/components/table/types.d.cts +7 -0
  304. package/dist/components/table/types.d.ts +7 -0
  305. package/dist/components/table/types.js +1 -0
  306. package/dist/components/table/types.js.map +1 -0
  307. package/dist/components/theme-switcher.cjs +72 -0
  308. package/dist/components/theme-switcher.cjs.map +1 -0
  309. package/dist/components/theme-switcher.d.cts +9 -0
  310. package/dist/components/theme-switcher.d.ts +9 -0
  311. package/dist/components/theme-switcher.js +48 -0
  312. package/dist/components/theme-switcher.js.map +1 -0
  313. package/dist/craft/components.cjs +64 -1779
  314. package/dist/craft/components.cjs.map +1 -1
  315. package/dist/craft/components.d.cts +36 -369
  316. package/dist/craft/components.d.ts +36 -369
  317. package/dist/craft/components.js +31 -42
  318. package/dist/craft/components.js.map +1 -1
  319. package/dist/craft/forms.cjs +6 -1347
  320. package/dist/craft/forms.cjs.map +1 -1
  321. package/dist/craft/forms.d.cts +7 -101
  322. package/dist/craft/forms.d.ts +7 -101
  323. package/dist/craft/forms.js +3 -8
  324. package/dist/craft/forms.js.map +1 -1
  325. package/dist/craft/layout.cjs +20 -374
  326. package/dist/craft/layout.cjs.map +1 -1
  327. package/dist/craft/layout.d.cts +12 -170
  328. package/dist/craft/layout.d.ts +12 -170
  329. package/dist/craft/layout.js +10 -14
  330. package/dist/craft/layout.js.map +1 -1
  331. package/dist/craft/table.cjs +8 -632
  332. package/dist/craft/table.cjs.map +1 -1
  333. package/dist/craft/table.d.cts +7 -99
  334. package/dist/craft/table.d.ts +7 -99
  335. package/dist/craft/table.js +4 -8
  336. package/dist/craft/table.js.map +1 -1
  337. package/dist/craft/theme.cjs +5 -137
  338. package/dist/craft/theme.cjs.map +1 -1
  339. package/dist/craft/theme.d.cts +3 -9
  340. package/dist/craft/theme.d.ts +3 -9
  341. package/dist/craft/theme.js +2 -6
  342. package/dist/craft/theme.js.map +1 -1
  343. package/dist/index.cjs +103 -3426
  344. package/dist/index.cjs.map +1 -1
  345. package/dist/index.d.cts +50 -6
  346. package/dist/index.d.ts +50 -6
  347. package/dist/index.js +50 -70
  348. package/dist/index.js.map +1 -1
  349. package/dist/utils/cn.cjs +31 -0
  350. package/dist/utils/cn.cjs.map +1 -0
  351. package/dist/utils/cn.d.cts +3 -0
  352. package/dist/utils/cn.d.ts +3 -0
  353. package/dist/{chunk-VQ6T3HIX.js → utils/cn.js} +1 -3
  354. package/dist/utils/cn.js.map +1 -0
  355. package/package.json +6 -1
  356. package/dist/chunk-6F7FN2ZF.js +0 -671
  357. package/dist/chunk-6F7FN2ZF.js.map +0 -1
  358. package/dist/chunk-7Q4Z47HT.js +0 -657
  359. package/dist/chunk-7Q4Z47HT.js.map +0 -1
  360. package/dist/chunk-7SKDTIEK.js.map +0 -1
  361. package/dist/chunk-FEFH5O5K.js.map +0 -1
  362. package/dist/chunk-M2EKVXB6.js +0 -127
  363. package/dist/chunk-M2EKVXB6.js.map +0 -1
  364. package/dist/chunk-SBLIF6UU.js +0 -1029
  365. package/dist/chunk-SBLIF6UU.js.map +0 -1
  366. package/dist/chunk-VQ6T3HIX.js.map +0 -1
  367. package/dist/chunk-YVZL4GET.js +0 -328
  368. package/dist/chunk-YVZL4GET.js.map +0 -1
  369. package/dist/chunk-ZRV4Y374.js.map +0 -1
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,641 +15,19 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/craft/table.ts
31
19
  var table_exports = {};
32
20
  __export(table_exports, {
33
- CraftDataTable: () => CraftDataTable,
34
- CraftFilterBar: () => CraftFilterBar,
35
- CraftPagination: () => CraftPagination,
36
- CraftTableToolbar: () => CraftTableToolbar
21
+ CraftDataTable: () => import_craft_data_table.CraftDataTable,
22
+ CraftFilterBar: () => import_craft_filter_bar.CraftFilterBar,
23
+ CraftPagination: () => import_craft_pagination.CraftPagination,
24
+ CraftTableToolbar: () => import_craft_table_toolbar.CraftTableToolbar
37
25
  });
38
26
  module.exports = __toCommonJS(table_exports);
39
-
40
- // src/components/craft-data-table.tsx
41
- var React = __toESM(require("react"), 1);
42
-
43
- // src/utils/cn.ts
44
- function cn(...values) {
45
- return values.filter(Boolean).join(" ");
46
- }
47
-
48
- // src/components/craft-pagination.tsx
49
- var import_jsx_runtime = require("react/jsx-runtime");
50
- function getPageNumbers(pageIndex, pageCount, maxButtons = 5) {
51
- if (pageCount <= maxButtons) {
52
- return Array.from({ length: pageCount }, (_, i) => i);
53
- }
54
- const pages = [];
55
- const start = Math.max(0, pageIndex - 1);
56
- const end = Math.min(pageCount - 1, pageIndex + 1);
57
- pages.push(0);
58
- if (start > 1) pages.push("ellipsis");
59
- for (let i = start; i <= end; i += 1) {
60
- if (i !== 0 && i !== pageCount - 1) pages.push(i);
61
- }
62
- if (end < pageCount - 2) pages.push("ellipsis");
63
- pages.push(pageCount - 1);
64
- return pages;
65
- }
66
- function CraftPagination({
67
- pageIndex,
68
- pageCount,
69
- onPageChange,
70
- canPrevious = pageIndex > 0,
71
- canNext = pageIndex < pageCount - 1,
72
- pageSize,
73
- pageSizeOptions = [10, 20, 50],
74
- onPageSizeChange,
75
- tone,
76
- className
77
- }) {
78
- const pages = getPageNumbers(pageIndex, pageCount);
79
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
80
- "div",
81
- {
82
- className: cn(
83
- "flex flex-wrap items-center justify-between gap-4",
84
- className
85
- ),
86
- "data-nc-theme": tone,
87
- children: [
88
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- "button",
91
- {
92
- type: "button",
93
- className: cn(
94
- "rounded-xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] px-3 py-2 text-xs text-[rgb(var(--nc-fg))] transition",
95
- "hover:bg-[rgb(var(--nc-surface)/0.2)]",
96
- !canPrevious && "opacity-50 cursor-not-allowed"
97
- ),
98
- onClick: () => onPageChange(Math.max(pageIndex - 1, 0)),
99
- disabled: !canPrevious,
100
- children: "Prev"
101
- }
102
- ),
103
- pages.map(
104
- (page, index) => page === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "px-2 text-[rgb(var(--nc-fg-muted))]", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
- "button",
106
- {
107
- type: "button",
108
- className: cn(
109
- "rounded-xl border px-3 py-2 text-xs transition",
110
- page === pageIndex ? "border-[rgb(var(--nc-accent-1)/0.6)] bg-[rgb(var(--nc-accent-1)/0.2)] text-[rgb(var(--nc-fg))]" : "border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] text-[rgb(var(--nc-fg-muted))] hover:text-[rgb(var(--nc-fg))] hover:bg-[rgb(var(--nc-surface)/0.2)]"
111
- ),
112
- onClick: () => onPageChange(page),
113
- children: page + 1
114
- },
115
- page
116
- )
117
- ),
118
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
- "button",
120
- {
121
- type: "button",
122
- className: cn(
123
- "rounded-xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] px-3 py-2 text-xs text-[rgb(var(--nc-fg))] transition",
124
- "hover:bg-[rgb(var(--nc-surface)/0.2)]",
125
- !canNext && "opacity-50 cursor-not-allowed"
126
- ),
127
- onClick: () => onPageChange(Math.min(pageIndex + 1, pageCount - 1)),
128
- disabled: !canNext,
129
- children: "Next"
130
- }
131
- )
132
- ] }),
133
- onPageSizeChange && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-xs text-[rgb(var(--nc-fg-muted))]", children: [
134
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Rows" }),
135
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
136
- "select",
137
- {
138
- className: "rounded-xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] px-2 py-1 text-xs text-[rgb(var(--nc-fg))]",
139
- value: pageSize,
140
- onChange: (event) => onPageSizeChange(Number(event.target.value)),
141
- children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: size, children: size }, size))
142
- }
143
- )
144
- ] })
145
- ]
146
- }
147
- );
148
- }
149
-
150
- // src/components/craft-data-table.tsx
151
- var import_jsx_runtime2 = require("react/jsx-runtime");
152
- function getColumnValue(column, row) {
153
- if (typeof column.accessor === "function") return column.accessor(row);
154
- const record = row;
155
- if (typeof column.accessor === "string") return record[column.accessor];
156
- return record[column.id];
157
- }
158
- function normalizeValue(value) {
159
- if (value === null || value === void 0) return "";
160
- if (typeof value === "number") return value;
161
- if (typeof value === "string") return value.toLowerCase();
162
- if (value instanceof Date) return value.getTime();
163
- return String(value).toLowerCase();
164
- }
165
- function CraftDataTable({
166
- data,
167
- columns,
168
- tone,
169
- className,
170
- loading = false,
171
- emptyState,
172
- toolbar,
173
- enableSorting = true,
174
- enableFiltering = true,
175
- enableColumnVisibility = true,
176
- enableRowSelection = true,
177
- enablePagination = true,
178
- showGlobalFilter,
179
- manualSorting = false,
180
- manualFiltering = false,
181
- manualPagination = false,
182
- sortBy,
183
- onSortChange,
184
- filters,
185
- onFiltersChange,
186
- globalFilter,
187
- onGlobalFilterChange,
188
- columnVisibility,
189
- onColumnVisibilityChange,
190
- selectedRowIds,
191
- onRowSelectionChange,
192
- getRowId,
193
- pageIndex,
194
- pageSize = 10,
195
- pageCount,
196
- onPageChange,
197
- onPageSizeChange
198
- }) {
199
- const [internalSort, setInternalSort] = React.useState(null);
200
- const [internalFilters, setInternalFilters] = React.useState({});
201
- const [internalGlobalFilter, setInternalGlobalFilter] = React.useState("");
202
- const [internalVisibility, setInternalVisibility] = React.useState(
203
- () => columns.reduce((acc, column) => {
204
- acc[column.id] = !column.hidden;
205
- return acc;
206
- }, {})
207
- );
208
- const [internalSelection, setInternalSelection] = React.useState({});
209
- const [internalPageIndex, setInternalPageIndex] = React.useState(0);
210
- const [showColumns, setShowColumns] = React.useState(false);
211
- const resolvedSort = sortBy != null ? sortBy : internalSort;
212
- const resolvedFilters = filters != null ? filters : internalFilters;
213
- const resolvedGlobalFilter = globalFilter != null ? globalFilter : internalGlobalFilter;
214
- const resolvedVisibility = columnVisibility != null ? columnVisibility : internalVisibility;
215
- const resolvedSelection = selectedRowIds != null ? selectedRowIds : internalSelection;
216
- const resolvedPageIndex = pageIndex != null ? pageIndex : internalPageIndex;
217
- const setSort = (next) => {
218
- if (sortBy === void 0) setInternalSort(next);
219
- onSortChange == null ? void 0 : onSortChange(next);
220
- };
221
- const setFilters = (next) => {
222
- if (filters === void 0) setInternalFilters(next);
223
- onFiltersChange == null ? void 0 : onFiltersChange(next);
224
- };
225
- const setVisibility = (next) => {
226
- if (columnVisibility === void 0) setInternalVisibility(next);
227
- onColumnVisibilityChange == null ? void 0 : onColumnVisibilityChange(next);
228
- };
229
- const setSelection = (next) => {
230
- if (selectedRowIds === void 0) setInternalSelection(next);
231
- onRowSelectionChange == null ? void 0 : onRowSelectionChange(next);
232
- };
233
- const setPageIndex = React.useCallback(
234
- (next) => {
235
- if (pageIndex === void 0) setInternalPageIndex(next);
236
- onPageChange == null ? void 0 : onPageChange(next);
237
- },
238
- [pageIndex, onPageChange]
239
- );
240
- const visibleColumns = columns.filter(
241
- (column) => resolvedVisibility[column.id] !== false
242
- );
243
- const filteredData = React.useMemo(() => {
244
- if (manualFiltering) return data;
245
- const globalValue = resolvedGlobalFilter.trim();
246
- return data.filter((row) => {
247
- if (globalValue) {
248
- const matchesGlobal = columns.some((column) => {
249
- const value = normalizeValue(getColumnValue(column, row));
250
- return String(value).includes(globalValue.toLowerCase());
251
- });
252
- if (!matchesGlobal) return false;
253
- }
254
- return Object.entries(resolvedFilters).every(([columnId, value]) => {
255
- if (!value) return true;
256
- const column = columns.find((col) => col.id === columnId);
257
- if (!column) return true;
258
- const cellValue = normalizeValue(getColumnValue(column, row));
259
- return String(cellValue).includes(value.toLowerCase());
260
- });
261
- });
262
- }, [columns, data, manualFiltering, resolvedFilters, resolvedGlobalFilter]);
263
- const sortedData = React.useMemo(() => {
264
- if (manualSorting || !resolvedSort) return filteredData;
265
- const column = columns.find((col) => col.id === resolvedSort.id);
266
- if (!column) return filteredData;
267
- const sorted = [...filteredData].sort((a, b) => {
268
- const valueA = normalizeValue(getColumnValue(column, a));
269
- const valueB = normalizeValue(getColumnValue(column, b));
270
- if (typeof valueA === "number" && typeof valueB === "number") {
271
- return valueA - valueB;
272
- }
273
- return String(valueA).localeCompare(String(valueB));
274
- });
275
- return resolvedSort.desc ? sorted.reverse() : sorted;
276
- }, [columns, filteredData, manualSorting, resolvedSort]);
277
- const resolvedPageCount = manualPagination ? Math.max(pageCount != null ? pageCount : 1, 1) : Math.max(Math.ceil(sortedData.length / pageSize), 1);
278
- React.useEffect(() => {
279
- if (resolvedPageIndex > resolvedPageCount - 1) {
280
- setPageIndex(Math.max(resolvedPageCount - 1, 0));
281
- }
282
- }, [resolvedPageCount, resolvedPageIndex, setPageIndex]);
283
- const pagedData = React.useMemo(() => {
284
- if (!enablePagination || manualPagination) return sortedData;
285
- const start = resolvedPageIndex * pageSize;
286
- return sortedData.slice(start, start + pageSize);
287
- }, [enablePagination, manualPagination, pageSize, resolvedPageIndex, sortedData]);
288
- const rowIdFor = React.useCallback(
289
- (row, index) => {
290
- var _a;
291
- return (_a = getRowId == null ? void 0 : getRowId(row, index)) != null ? _a : String(index);
292
- },
293
- [getRowId]
294
- );
295
- const pageStartIndex = enablePagination && !manualPagination ? resolvedPageIndex * pageSize : 0;
296
- const pageRowIds = pagedData.map(
297
- (row, index) => rowIdFor(row, pageStartIndex + index)
298
- );
299
- const allSelected = pageRowIds.length > 0 && pageRowIds.every((id) => resolvedSelection[id]);
300
- const someSelected = pageRowIds.some((id) => resolvedSelection[id]);
301
- const headerCheckboxRef = React.useRef(null);
302
- React.useEffect(() => {
303
- if (headerCheckboxRef.current) {
304
- headerCheckboxRef.current.indeterminate = someSelected && !allSelected;
305
- }
306
- }, [someSelected, allSelected]);
307
- const toggleSort = (column) => {
308
- if (!enableSorting || column.sortable === false) return;
309
- const current = resolvedSort;
310
- if (!current || current.id !== column.id) {
311
- setSort({ id: column.id, desc: false });
312
- return;
313
- }
314
- if (!current.desc) {
315
- setSort({ id: column.id, desc: true });
316
- return;
317
- }
318
- setSort(null);
319
- };
320
- const emptyContent = emptyState != null ? emptyState : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "text-center text-sm text-[rgb(var(--nc-fg-muted))]", children: "No results found." });
321
- const resolvedShowGlobalFilter = showGlobalFilter != null ? showGlobalFilter : enableFiltering && !toolbar;
322
- const setGlobalFilter = (next) => {
323
- if (globalFilter === void 0) setInternalGlobalFilter(next);
324
- onGlobalFilterChange == null ? void 0 : onGlobalFilterChange(next);
325
- };
326
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn("space-y-4", className), "data-nc-theme": tone, children: [
327
- toolbar,
328
- resolvedShowGlobalFilter && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-2xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] px-3 py-2 text-sm text-[rgb(var(--nc-fg))]", children: [
329
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-xs text-[rgb(var(--nc-fg-muted))]", children: "Global filter" }),
330
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
331
- "input",
332
- {
333
- type: "search",
334
- value: resolvedGlobalFilter,
335
- onChange: (event) => setGlobalFilter(event.target.value),
336
- placeholder: "Search all columns...",
337
- className: "w-full max-w-xs rounded-xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.18)] px-3 py-2 text-xs text-[rgb(var(--nc-fg))]"
338
- }
339
- )
340
- ] }),
341
- enableColumnVisibility && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative flex justify-end", children: [
342
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
343
- "button",
344
- {
345
- type: "button",
346
- className: "rounded-xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] px-3 py-2 text-xs text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.2)]",
347
- onClick: () => setShowColumns((prev) => !prev),
348
- children: "Columns"
349
- }
350
- ),
351
- showColumns && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute right-0 top-10 z-20 w-48 rounded-2xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.2)] p-3 shadow-[0_12px_30px_rgba(0,0,0,0.35)] backdrop-blur-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "grid gap-2", children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
352
- "label",
353
- {
354
- className: "flex items-center gap-2 text-xs text-[rgb(var(--nc-fg))]",
355
- children: [
356
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
357
- "input",
358
- {
359
- type: "checkbox",
360
- className: "h-4 w-4 accent-[rgb(var(--nc-accent-1))]",
361
- checked: resolvedVisibility[column.id] !== false,
362
- onChange: (event) => setVisibility({
363
- ...resolvedVisibility,
364
- [column.id]: event.target.checked
365
- })
366
- }
367
- ),
368
- column.header
369
- ]
370
- },
371
- column.id
372
- )) }) })
373
- ] }),
374
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "overflow-hidden rounded-3xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.08)] shadow-[0_18px_50px_rgba(0,0,0,0.35)] backdrop-blur-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { className: "w-full border-collapse text-left text-sm", children: [
375
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { className: "bg-[rgb(var(--nc-surface)/0.12)] text-[rgb(var(--nc-fg-muted))]", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tr", { children: [
376
- enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
377
- "input",
378
- {
379
- ref: headerCheckboxRef,
380
- type: "checkbox",
381
- className: "h-4 w-4 accent-[rgb(var(--nc-accent-1))]",
382
- checked: allSelected,
383
- onChange: (event) => {
384
- const next = { ...resolvedSelection };
385
- pageRowIds.forEach((id) => {
386
- next[id] = event.target.checked;
387
- });
388
- setSelection(next);
389
- }
390
- }
391
- ) }),
392
- visibleColumns.map((column) => {
393
- var _a;
394
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
395
- "th",
396
- {
397
- className: cn(
398
- "px-4 py-3 text-xs font-semibold uppercase tracking-[0.2em]",
399
- column.headerClassName
400
- ),
401
- style: { width: column.width },
402
- children: [
403
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
404
- "button",
405
- {
406
- type: "button",
407
- className: cn(
408
- "flex items-center gap-2",
409
- enableSorting && column.sortable !== false ? "cursor-pointer" : "cursor-default"
410
- ),
411
- onClick: () => toggleSort(column),
412
- children: [
413
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: column.header }),
414
- (resolvedSort == null ? void 0 : resolvedSort.id) === column.id && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-[rgb(var(--nc-accent-1))]", children: resolvedSort.desc ? "\u2193" : "\u2191" })
415
- ]
416
- }
417
- ),
418
- enableFiltering && column.filterable !== false && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
419
- "input",
420
- {
421
- type: "text",
422
- value: (_a = resolvedFilters[column.id]) != null ? _a : "",
423
- onChange: (event) => setFilters({
424
- ...resolvedFilters,
425
- [column.id]: event.target.value
426
- }),
427
- placeholder: "Filter",
428
- className: "mt-2 w-full rounded-xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.18)] px-2 py-1 text-xs text-[rgb(var(--nc-fg))]"
429
- }
430
- )
431
- ]
432
- },
433
- column.id
434
- );
435
- })
436
- ] }) }),
437
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tbody", { className: "text-[rgb(var(--nc-fg))]", children: [
438
- loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
439
- "td",
440
- {
441
- colSpan: visibleColumns.length + (enableRowSelection ? 1 : 0),
442
- className: "px-4 py-10 text-center text-sm text-[rgb(var(--nc-fg-muted))]",
443
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
444
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-[rgb(var(--nc-fg-muted))] border-t-transparent" }),
445
- "Loading data..."
446
- ] })
447
- }
448
- ) }),
449
- !loading && pagedData.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
450
- "td",
451
- {
452
- colSpan: visibleColumns.length + (enableRowSelection ? 1 : 0),
453
- className: "px-4 py-10",
454
- children: emptyContent
455
- }
456
- ) }),
457
- !loading && pagedData.map((row, rowIndex) => {
458
- const rowId = rowIdFor(row, pageStartIndex + rowIndex);
459
- const isSelected = resolvedSelection[rowId];
460
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
461
- "tr",
462
- {
463
- className: cn(
464
- "border-t border-[rgb(var(--nc-border)/0.15)]",
465
- isSelected && "bg-[rgb(var(--nc-accent-1)/0.08)]"
466
- ),
467
- children: [
468
- enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: "px-4 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
469
- "input",
470
- {
471
- type: "checkbox",
472
- className: "h-4 w-4 accent-[rgb(var(--nc-accent-1))]",
473
- checked: isSelected,
474
- onChange: (event) => setSelection({
475
- ...resolvedSelection,
476
- [rowId]: event.target.checked
477
- })
478
- }
479
- ) }),
480
- visibleColumns.map((column) => {
481
- var _a;
482
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
483
- "td",
484
- {
485
- className: cn(
486
- "px-4 py-4",
487
- column.align === "center" && "text-center",
488
- column.align === "right" && "text-right",
489
- column.cellClassName
490
- ),
491
- children: column.cell ? column.cell(row) : String((_a = getColumnValue(column, row)) != null ? _a : "")
492
- },
493
- column.id
494
- );
495
- })
496
- ]
497
- },
498
- rowId
499
- );
500
- })
501
- ] })
502
- ] }) }),
503
- enablePagination && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
504
- CraftPagination,
505
- {
506
- pageIndex: resolvedPageIndex,
507
- pageCount: resolvedPageCount,
508
- onPageChange: setPageIndex,
509
- pageSize,
510
- onPageSizeChange,
511
- tone
512
- }
513
- )
514
- ] });
515
- }
516
-
517
- // src/components/craft-input.tsx
518
- var React2 = __toESM(require("react"), 1);
519
- var import_jsx_runtime3 = require("react/jsx-runtime");
520
- var inputSizeClasses = {
521
- sm: "h-10 px-4 text-sm",
522
- md: "h-12 px-5 text-base",
523
- lg: "h-14 px-6 text-lg"
524
- };
525
- var CraftInput = React2.forwardRef(
526
- ({ className, tone, inputSize = "md", glow = true, icon, ...props }, ref) => {
527
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative w-full", "data-nc-theme": tone, children: [
528
- icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute left-4 top-1/2 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]", children: icon }),
529
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
530
- "input",
531
- {
532
- ref,
533
- className: cn(
534
- "w-full rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl",
535
- "shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]",
536
- "focus:outline-none focus:ring-4",
537
- "transition-all duration-300",
538
- "disabled:opacity-50 disabled:cursor-not-allowed",
539
- inputSizeClasses[inputSize],
540
- "border-[rgb(var(--nc-border)/0.35)]",
541
- "focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]",
542
- "placeholder:text-[rgb(var(--nc-fg-soft))]",
543
- glow ? "focus:shadow-[0_0_30px_-5px_var(--glow-color)]" : "",
544
- icon ? "pl-12" : "",
545
- className
546
- ),
547
- style: {
548
- "--glow-color": "rgb(var(--nc-accent-1) / 0.5)"
549
- },
550
- ...props
551
- }
552
- )
553
- ] });
554
- }
555
- );
556
- CraftInput.displayName = "CraftInput";
557
-
558
- // src/components/craft-filter-bar.tsx
559
- var import_jsx_runtime4 = require("react/jsx-runtime");
560
- function CraftFilterBar({
561
- title,
562
- description,
563
- searchValue,
564
- onSearchChange,
565
- searchPlaceholder = "Search...",
566
- actions,
567
- filters,
568
- tone,
569
- className
570
- }) {
571
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
572
- "div",
573
- {
574
- className: cn(
575
- "rounded-3xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] p-4 text-[rgb(var(--nc-fg))] shadow-[0_12px_36px_rgba(0,0,0,0.2)] backdrop-blur-2xl",
576
- className
577
- ),
578
- "data-nc-theme": tone,
579
- children: [
580
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
581
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
582
- title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { className: "text-lg font-semibold", children: title }),
583
- description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm text-[rgb(var(--nc-fg-muted))]", children: description })
584
- ] }),
585
- actions && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex items-center gap-3", children: actions })
586
- ] }),
587
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "mt-4 grid gap-4 md:grid-cols-[minmax(0,1fr)_auto]", children: [
588
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
589
- CraftInput,
590
- {
591
- type: "search",
592
- placeholder: searchPlaceholder,
593
- value: searchValue != null ? searchValue : "",
594
- onChange: (event) => onSearchChange == null ? void 0 : onSearchChange(event.target.value),
595
- tone
596
- }
597
- ),
598
- filters && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex flex-wrap items-center gap-3", children: filters })
599
- ] })
600
- ]
601
- }
602
- );
603
- }
604
-
605
- // src/components/craft-table-toolbar.tsx
606
- var import_jsx_runtime5 = require("react/jsx-runtime");
607
- function CraftTableToolbar({
608
- title,
609
- description,
610
- searchValue,
611
- onSearchChange,
612
- searchPlaceholder = "Search table...",
613
- actions,
614
- filters,
615
- bulkActions,
616
- tone,
617
- className
618
- }) {
619
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
620
- "div",
621
- {
622
- className: cn(
623
- "rounded-3xl border border-[rgb(var(--nc-border)/0.3)] bg-[rgb(var(--nc-surface)/0.12)] p-4 text-[rgb(var(--nc-fg))] shadow-[0_12px_36px_rgba(0,0,0,0.2)] backdrop-blur-2xl",
624
- className
625
- ),
626
- "data-nc-theme": tone,
627
- children: [
628
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
629
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
630
- title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { className: "text-lg font-semibold", children: title }),
631
- description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-[rgb(var(--nc-fg-muted))]", children: description })
632
- ] }),
633
- actions && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex items-center gap-3", children: actions })
634
- ] }),
635
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "mt-4 grid gap-4 lg:grid-cols-[minmax(0,1fr)_auto]", children: [
636
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
637
- CraftInput,
638
- {
639
- type: "search",
640
- placeholder: searchPlaceholder,
641
- value: searchValue != null ? searchValue : "",
642
- onChange: (event) => onSearchChange == null ? void 0 : onSearchChange(event.target.value),
643
- tone
644
- }
645
- ),
646
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
647
- filters,
648
- bulkActions
649
- ] })
650
- ] })
651
- ]
652
- }
653
- );
654
- }
27
+ var import_craft_data_table = require("@/components/craft-data-table");
28
+ var import_craft_pagination = require("@/components/craft-pagination");
29
+ var import_craft_filter_bar = require("@/components/craft-filter-bar");
30
+ var import_craft_table_toolbar = require("@/components/craft-table-toolbar");
655
31
  // Annotate the CommonJS export names for ESM import in node:
656
32
  0 && (module.exports = {
657
33
  CraftDataTable,