@iamsaroj/smart-ui 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (853) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +21 -0
  3. package/README.md +49 -0
  4. package/dist/calendar-engine/agenda-view.d.ts +8 -0
  5. package/dist/calendar-engine/agenda-view.d.ts.map +1 -0
  6. package/dist/calendar-engine/agenda-view.js +26 -0
  7. package/dist/calendar-engine/agenda-view.js.map +1 -0
  8. package/dist/calendar-engine/booking.d.ts +13 -0
  9. package/dist/calendar-engine/booking.d.ts.map +1 -0
  10. package/dist/calendar-engine/booking.js +45 -0
  11. package/dist/calendar-engine/booking.js.map +1 -0
  12. package/dist/calendar-engine/calendar-utils.d.ts +74 -0
  13. package/dist/calendar-engine/calendar-utils.d.ts.map +1 -0
  14. package/dist/calendar-engine/calendar-utils.js +221 -0
  15. package/dist/calendar-engine/calendar-utils.js.map +1 -0
  16. package/dist/calendar-engine/calendar.d.ts +62 -0
  17. package/dist/calendar-engine/calendar.d.ts.map +1 -0
  18. package/dist/calendar-engine/calendar.js +81 -0
  19. package/dist/calendar-engine/calendar.js.map +1 -0
  20. package/dist/calendar-engine/event-color.d.ts +20 -0
  21. package/dist/calendar-engine/event-color.d.ts.map +1 -0
  22. package/dist/calendar-engine/event-color.js +59 -0
  23. package/dist/calendar-engine/event-color.js.map +1 -0
  24. package/dist/calendar-engine/index.d.ts +11 -0
  25. package/dist/calendar-engine/index.d.ts.map +1 -0
  26. package/dist/calendar-engine/index.js +6 -0
  27. package/dist/calendar-engine/index.js.map +1 -0
  28. package/dist/calendar-engine/month-view.d.ts +10 -0
  29. package/dist/calendar-engine/month-view.d.ts.map +1 -0
  30. package/dist/calendar-engine/month-view.js +72 -0
  31. package/dist/calendar-engine/month-view.js.map +1 -0
  32. package/dist/calendar-engine/recurrence.d.ts +47 -0
  33. package/dist/calendar-engine/recurrence.d.ts.map +1 -0
  34. package/dist/calendar-engine/recurrence.js +209 -0
  35. package/dist/calendar-engine/recurrence.js.map +1 -0
  36. package/dist/calendar-engine/shared.d.ts +72 -0
  37. package/dist/calendar-engine/shared.d.ts.map +1 -0
  38. package/dist/calendar-engine/shared.js +34 -0
  39. package/dist/calendar-engine/shared.js.map +1 -0
  40. package/dist/calendar-engine/time-grid-view.d.ts +13 -0
  41. package/dist/calendar-engine/time-grid-view.d.ts.map +1 -0
  42. package/dist/calendar-engine/time-grid-view.js +203 -0
  43. package/dist/calendar-engine/time-grid-view.js.map +1 -0
  44. package/dist/calendar-engine/types.d.ts +138 -0
  45. package/dist/calendar-engine/types.d.ts.map +1 -0
  46. package/dist/calendar-engine/types.js +2 -0
  47. package/dist/calendar-engine/types.js.map +1 -0
  48. package/dist/calendar-engine/use-calendar.d.ts +7 -0
  49. package/dist/calendar-engine/use-calendar.d.ts.map +1 -0
  50. package/dist/calendar-engine/use-calendar.js +25 -0
  51. package/dist/calendar-engine/use-calendar.js.map +1 -0
  52. package/dist/components/accordion.d.ts +7 -0
  53. package/dist/components/accordion.d.ts.map +1 -0
  54. package/dist/components/accordion.js +10 -0
  55. package/dist/components/accordion.js.map +1 -0
  56. package/dist/components/alert-dialog.d.ts +19 -0
  57. package/dist/components/alert-dialog.d.ts.map +1 -0
  58. package/dist/components/alert-dialog.js +18 -0
  59. package/dist/components/alert-dialog.js.map +1 -0
  60. package/dist/components/alert.d.ts +11 -0
  61. package/dist/components/alert.d.ts.map +1 -0
  62. package/dist/components/alert.js +20 -0
  63. package/dist/components/alert.js.map +1 -0
  64. package/dist/components/aspect-ratio.d.ts +5 -0
  65. package/dist/components/aspect-ratio.d.ts.map +1 -0
  66. package/dist/components/aspect-ratio.js +7 -0
  67. package/dist/components/aspect-ratio.js.map +1 -0
  68. package/dist/components/avatar.d.ts +12 -0
  69. package/dist/components/avatar.d.ts.map +1 -0
  70. package/dist/components/avatar.js +11 -0
  71. package/dist/components/avatar.js.map +1 -0
  72. package/dist/components/badge.d.ts +8 -0
  73. package/dist/components/badge.d.ts.map +1 -0
  74. package/dist/components/badge.js +33 -0
  75. package/dist/components/badge.js.map +1 -0
  76. package/dist/components/breadcrumb.d.ts +11 -0
  77. package/dist/components/breadcrumb.d.ts.map +1 -0
  78. package/dist/components/breadcrumb.js +23 -0
  79. package/dist/components/breadcrumb.js.map +1 -0
  80. package/dist/components/button.d.ts +9 -0
  81. package/dist/components/button.d.ts.map +1 -0
  82. package/dist/components/button.js +34 -0
  83. package/dist/components/button.js.map +1 -0
  84. package/dist/components/calendar.d.ts +11 -0
  85. package/dist/components/calendar.d.ts.map +1 -0
  86. package/dist/components/calendar.js +77 -0
  87. package/dist/components/calendar.js.map +1 -0
  88. package/dist/components/card.d.ts +12 -0
  89. package/dist/components/card.d.ts.map +1 -0
  90. package/dist/components/card.js +11 -0
  91. package/dist/components/card.js.map +1 -0
  92. package/dist/components/carousel.d.ts +29 -0
  93. package/dist/components/carousel.d.ts.map +1 -0
  94. package/dist/components/carousel.js +94 -0
  95. package/dist/components/carousel.js.map +1 -0
  96. package/dist/components/chart.d.ts +45 -0
  97. package/dist/components/chart.d.ts.map +1 -0
  98. package/dist/components/chart.js +133 -0
  99. package/dist/components/chart.js.map +1 -0
  100. package/dist/components/checkbox.d.ts +4 -0
  101. package/dist/components/checkbox.d.ts.map +1 -0
  102. package/dist/components/checkbox.js +8 -0
  103. package/dist/components/checkbox.js.map +1 -0
  104. package/dist/components/collapsible.d.ts +6 -0
  105. package/dist/components/collapsible.d.ts.map +1 -0
  106. package/dist/components/collapsible.js +7 -0
  107. package/dist/components/collapsible.js.map +1 -0
  108. package/dist/components/combobox.d.ts +35 -0
  109. package/dist/components/combobox.d.ts.map +1 -0
  110. package/dist/components/combobox.js +45 -0
  111. package/dist/components/combobox.js.map +1 -0
  112. package/dist/components/command.d.ts +20 -0
  113. package/dist/components/command.d.ts.map +1 -0
  114. package/dist/components/command.js +18 -0
  115. package/dist/components/command.js.map +1 -0
  116. package/dist/components/context-menu.d.ts +30 -0
  117. package/dist/components/context-menu.d.ts.map +1 -0
  118. package/dist/components/context-menu.js +22 -0
  119. package/dist/components/context-menu.js.map +1 -0
  120. package/dist/components/data-table.d.ts +12 -0
  121. package/dist/components/data-table.d.ts.map +1 -0
  122. package/dist/components/data-table.js +44 -0
  123. package/dist/components/data-table.js.map +1 -0
  124. package/dist/components/date-picker.d.ts +33 -0
  125. package/dist/components/date-picker.d.ts.map +1 -0
  126. package/dist/components/date-picker.js +29 -0
  127. package/dist/components/date-picker.js.map +1 -0
  128. package/dist/components/dialog.d.ts +18 -0
  129. package/dist/components/dialog.d.ts.map +1 -0
  130. package/dist/components/dialog.js +18 -0
  131. package/dist/components/dialog.js.map +1 -0
  132. package/dist/components/drawer.d.ts +14 -0
  133. package/dist/components/drawer.d.ts.map +1 -0
  134. package/dist/components/drawer.js +15 -0
  135. package/dist/components/drawer.js.map +1 -0
  136. package/dist/components/dropdown-menu.d.ts +30 -0
  137. package/dist/components/dropdown-menu.d.ts.map +1 -0
  138. package/dist/components/dropdown-menu.js +22 -0
  139. package/dist/components/dropdown-menu.js.map +1 -0
  140. package/dist/components/hover-card.d.ts +6 -0
  141. package/dist/components/hover-card.d.ts.map +1 -0
  142. package/dist/components/hover-card.js +8 -0
  143. package/dist/components/hover-card.js.map +1 -0
  144. package/dist/components/input-group.d.ts +19 -0
  145. package/dist/components/input-group.d.ts.map +1 -0
  146. package/dist/components/input-group.js +46 -0
  147. package/dist/components/input-group.js.map +1 -0
  148. package/dist/components/input-otp.d.ts +12 -0
  149. package/dist/components/input-otp.d.ts.map +1 -0
  150. package/dist/components/input-otp.js +16 -0
  151. package/dist/components/input-otp.js.map +1 -0
  152. package/dist/components/input.d.ts +4 -0
  153. package/dist/components/input.d.ts.map +1 -0
  154. package/dist/components/input.js +6 -0
  155. package/dist/components/input.js.map +1 -0
  156. package/dist/components/kbd.d.ts +5 -0
  157. package/dist/components/kbd.d.ts.map +1 -0
  158. package/dist/components/kbd.js +6 -0
  159. package/dist/components/kbd.js.map +1 -0
  160. package/dist/components/label.d.ts +4 -0
  161. package/dist/components/label.d.ts.map +1 -0
  162. package/dist/components/label.js +5 -0
  163. package/dist/components/label.js.map +1 -0
  164. package/dist/components/menubar.d.ts +30 -0
  165. package/dist/components/menubar.d.ts.map +1 -0
  166. package/dist/components/menubar.js +24 -0
  167. package/dist/components/menubar.js.map +1 -0
  168. package/dist/components/navigation-menu.d.ts +12 -0
  169. package/dist/components/navigation-menu.d.ts.map +1 -0
  170. package/dist/components/navigation-menu.js +18 -0
  171. package/dist/components/navigation-menu.js.map +1 -0
  172. package/dist/components/pagination.d.ts +18 -0
  173. package/dist/components/pagination.d.ts.map +1 -0
  174. package/dist/components/pagination.js +13 -0
  175. package/dist/components/pagination.js.map +1 -0
  176. package/dist/components/popover.d.ts +10 -0
  177. package/dist/components/popover.d.ts.map +1 -0
  178. package/dist/components/popover.js +12 -0
  179. package/dist/components/popover.js.map +1 -0
  180. package/dist/components/progress.d.ts +8 -0
  181. package/dist/components/progress.d.ts.map +1 -0
  182. package/dist/components/progress.js +10 -0
  183. package/dist/components/progress.js.map +1 -0
  184. package/dist/components/radio-group.d.ts +6 -0
  185. package/dist/components/radio-group.d.ts.map +1 -0
  186. package/dist/components/radio-group.js +9 -0
  187. package/dist/components/radio-group.js.map +1 -0
  188. package/dist/components/scroll-area.d.ts +5 -0
  189. package/dist/components/scroll-area.d.ts.map +1 -0
  190. package/dist/components/scroll-area.js +8 -0
  191. package/dist/components/scroll-area.js.map +1 -0
  192. package/dist/components/select.d.ts +16 -0
  193. package/dist/components/select.d.ts.map +1 -0
  194. package/dist/components/select.js +16 -0
  195. package/dist/components/select.js.map +1 -0
  196. package/dist/components/separator.d.ts +4 -0
  197. package/dist/components/separator.d.ts.map +1 -0
  198. package/dist/components/separator.js +6 -0
  199. package/dist/components/separator.js.map +1 -0
  200. package/dist/components/sheet.d.ts +15 -0
  201. package/dist/components/sheet.d.ts.map +1 -0
  202. package/dist/components/sheet.js +18 -0
  203. package/dist/components/sheet.js.map +1 -0
  204. package/dist/components/sidebar.d.ts +64 -0
  205. package/dist/components/sidebar.d.ts.map +1 -0
  206. package/dist/components/sidebar.js +224 -0
  207. package/dist/components/sidebar.js.map +1 -0
  208. package/dist/components/skeleton.d.ts +3 -0
  209. package/dist/components/skeleton.d.ts.map +1 -0
  210. package/dist/components/skeleton.js +5 -0
  211. package/dist/components/skeleton.js.map +1 -0
  212. package/dist/components/slider.d.ts +4 -0
  213. package/dist/components/slider.d.ts.map +1 -0
  214. package/dist/components/slider.js +13 -0
  215. package/dist/components/slider.js.map +1 -0
  216. package/dist/components/sonner.d.ts +4 -0
  217. package/dist/components/sonner.d.ts.map +1 -0
  218. package/dist/components/sonner.js +25 -0
  219. package/dist/components/sonner.js.map +1 -0
  220. package/dist/components/switch.d.ts +6 -0
  221. package/dist/components/switch.d.ts.map +1 -0
  222. package/dist/components/switch.js +7 -0
  223. package/dist/components/switch.js.map +1 -0
  224. package/dist/components/table.d.ts +11 -0
  225. package/dist/components/table.d.ts.map +1 -0
  226. package/dist/components/table.js +12 -0
  227. package/dist/components/table.js.map +1 -0
  228. package/dist/components/tabs.d.ts +11 -0
  229. package/dist/components/tabs.d.ts.map +1 -0
  230. package/dist/components/tabs.js +23 -0
  231. package/dist/components/tabs.js.map +1 -0
  232. package/dist/components/textarea.d.ts +4 -0
  233. package/dist/components/textarea.d.ts.map +1 -0
  234. package/dist/components/textarea.js +5 -0
  235. package/dist/components/textarea.js.map +1 -0
  236. package/dist/components/toggle-group.d.ts +11 -0
  237. package/dist/components/toggle-group.d.ts.map +1 -0
  238. package/dist/components/toggle-group.js +22 -0
  239. package/dist/components/toggle-group.js.map +1 -0
  240. package/dist/components/toggle.d.ts +9 -0
  241. package/dist/components/toggle.d.ts.map +1 -0
  242. package/dist/components/toggle.js +25 -0
  243. package/dist/components/toggle.js.map +1 -0
  244. package/dist/components/tooltip.d.ts +7 -0
  245. package/dist/components/tooltip.d.ts.map +1 -0
  246. package/dist/components/tooltip.js +10 -0
  247. package/dist/components/tooltip.js.map +1 -0
  248. package/dist/data-grid/action-column-cell.d.ts +41 -0
  249. package/dist/data-grid/action-column-cell.d.ts.map +1 -0
  250. package/dist/data-grid/action-column-cell.js +114 -0
  251. package/dist/data-grid/action-column-cell.js.map +1 -0
  252. package/dist/data-grid/action-column.d.ts +144 -0
  253. package/dist/data-grid/action-column.d.ts.map +1 -0
  254. package/dist/data-grid/action-column.js +156 -0
  255. package/dist/data-grid/action-column.js.map +1 -0
  256. package/dist/data-grid/create-page-fetcher.d.ts +57 -0
  257. package/dist/data-grid/create-page-fetcher.d.ts.map +1 -0
  258. package/dist/data-grid/create-page-fetcher.js +41 -0
  259. package/dist/data-grid/create-page-fetcher.js.map +1 -0
  260. package/dist/data-grid/data-grid.d.ts +65 -0
  261. package/dist/data-grid/data-grid.d.ts.map +1 -0
  262. package/dist/data-grid/data-grid.js +95 -0
  263. package/dist/data-grid/data-grid.js.map +1 -0
  264. package/dist/data-grid/empty-state.d.ts +13 -0
  265. package/dist/data-grid/empty-state.d.ts.map +1 -0
  266. package/dist/data-grid/empty-state.js +6 -0
  267. package/dist/data-grid/empty-state.js.map +1 -0
  268. package/dist/data-grid/formula-guard.d.ts +22 -0
  269. package/dist/data-grid/formula-guard.d.ts.map +1 -0
  270. package/dist/data-grid/formula-guard.js +28 -0
  271. package/dist/data-grid/formula-guard.js.map +1 -0
  272. package/dist/data-grid/grid-internals.d.ts +16 -0
  273. package/dist/data-grid/grid-internals.d.ts.map +1 -0
  274. package/dist/data-grid/grid-internals.js +73 -0
  275. package/dist/data-grid/grid-internals.js.map +1 -0
  276. package/dist/data-grid/grid-theme.d.ts +8 -0
  277. package/dist/data-grid/grid-theme.d.ts.map +1 -0
  278. package/dist/data-grid/grid-theme.js +23 -0
  279. package/dist/data-grid/grid-theme.js.map +1 -0
  280. package/dist/data-grid/grid-toolbar.d.ts +40 -0
  281. package/dist/data-grid/grid-toolbar.d.ts.map +1 -0
  282. package/dist/data-grid/grid-toolbar.js +13 -0
  283. package/dist/data-grid/grid-toolbar.js.map +1 -0
  284. package/dist/data-grid/index.d.ts +10 -0
  285. package/dist/data-grid/index.d.ts.map +1 -0
  286. package/dist/data-grid/index.js +9 -0
  287. package/dist/data-grid/index.js.map +1 -0
  288. package/dist/data-grid/pagination.d.ts +146 -0
  289. package/dist/data-grid/pagination.d.ts.map +1 -0
  290. package/dist/data-grid/pagination.js +128 -0
  291. package/dist/data-grid/pagination.js.map +1 -0
  292. package/dist/data-grid/server-data-grid.d.ts +109 -0
  293. package/dist/data-grid/server-data-grid.d.ts.map +1 -0
  294. package/dist/data-grid/server-data-grid.js +240 -0
  295. package/dist/data-grid/server-data-grid.js.map +1 -0
  296. package/dist/data-grid/server-grid-internals.d.ts +79 -0
  297. package/dist/data-grid/server-grid-internals.d.ts.map +1 -0
  298. package/dist/data-grid/server-grid-internals.js +137 -0
  299. package/dist/data-grid/server-grid-internals.js.map +1 -0
  300. package/dist/data-grid/use-action-column.d.ts +22 -0
  301. package/dist/data-grid/use-action-column.d.ts.map +1 -0
  302. package/dist/data-grid/use-action-column.js +63 -0
  303. package/dist/data-grid/use-action-column.js.map +1 -0
  304. package/dist/data-grid/use-server-grid-selection.d.ts +35 -0
  305. package/dist/data-grid/use-server-grid-selection.d.ts.map +1 -0
  306. package/dist/data-grid/use-server-grid-selection.js +81 -0
  307. package/dist/data-grid/use-server-grid-selection.js.map +1 -0
  308. package/dist/form-engine/base.d.ts +19 -0
  309. package/dist/form-engine/base.d.ts.map +1 -0
  310. package/dist/form-engine/base.js +2 -0
  311. package/dist/form-engine/base.js.map +1 -0
  312. package/dist/form-engine/field-registry.d.ts +285 -0
  313. package/dist/form-engine/field-registry.d.ts.map +1 -0
  314. package/dist/form-engine/field-registry.js +306 -0
  315. package/dist/form-engine/field-registry.js.map +1 -0
  316. package/dist/form-engine/field-types.d.ts +201 -0
  317. package/dist/form-engine/field-types.d.ts.map +1 -0
  318. package/dist/form-engine/field-types.js +14 -0
  319. package/dist/form-engine/field-types.js.map +1 -0
  320. package/dist/form-engine/index.d.ts +20 -0
  321. package/dist/form-engine/index.d.ts.map +1 -0
  322. package/dist/form-engine/index.js +21 -0
  323. package/dist/form-engine/index.js.map +1 -0
  324. package/dist/form-engine/smart-checkbox-field.d.ts +5 -0
  325. package/dist/form-engine/smart-checkbox-field.d.ts.map +1 -0
  326. package/dist/form-engine/smart-checkbox-field.js +9 -0
  327. package/dist/form-engine/smart-checkbox-field.js.map +1 -0
  328. package/dist/form-engine/smart-checkbox-group-field.d.ts +10 -0
  329. package/dist/form-engine/smart-checkbox-group-field.d.ts.map +1 -0
  330. package/dist/form-engine/smart-checkbox-group-field.js +5 -0
  331. package/dist/form-engine/smart-checkbox-group-field.js.map +1 -0
  332. package/dist/form-engine/smart-combobox-field.d.ts +11 -0
  333. package/dist/form-engine/smart-combobox-field.d.ts.map +1 -0
  334. package/dist/form-engine/smart-combobox-field.js +5 -0
  335. package/dist/form-engine/smart-combobox-field.js.map +1 -0
  336. package/dist/form-engine/smart-date-field.d.ts +8 -0
  337. package/dist/form-engine/smart-date-field.d.ts.map +1 -0
  338. package/dist/form-engine/smart-date-field.js +17 -0
  339. package/dist/form-engine/smart-date-field.js.map +1 -0
  340. package/dist/form-engine/smart-date-range-field.d.ts +15 -0
  341. package/dist/form-engine/smart-date-range-field.d.ts.map +1 -0
  342. package/dist/form-engine/smart-date-range-field.js +25 -0
  343. package/dist/form-engine/smart-date-range-field.js.map +1 -0
  344. package/dist/form-engine/smart-datetime-field.d.ts +12 -0
  345. package/dist/form-engine/smart-datetime-field.d.ts.map +1 -0
  346. package/dist/form-engine/smart-datetime-field.js +12 -0
  347. package/dist/form-engine/smart-datetime-field.js.map +1 -0
  348. package/dist/form-engine/smart-form-internals.d.ts +14 -0
  349. package/dist/form-engine/smart-form-internals.d.ts.map +1 -0
  350. package/dist/form-engine/smart-form-internals.js +64 -0
  351. package/dist/form-engine/smart-form-internals.js.map +1 -0
  352. package/dist/form-engine/smart-form.d.ts +55 -0
  353. package/dist/form-engine/smart-form.d.ts.map +1 -0
  354. package/dist/form-engine/smart-form.js +229 -0
  355. package/dist/form-engine/smart-form.js.map +1 -0
  356. package/dist/form-engine/smart-input-field.d.ts +9 -0
  357. package/dist/form-engine/smart-input-field.d.ts.map +1 -0
  358. package/dist/form-engine/smart-input-field.js +5 -0
  359. package/dist/form-engine/smart-input-field.js.map +1 -0
  360. package/dist/form-engine/smart-month-field.d.ts +8 -0
  361. package/dist/form-engine/smart-month-field.d.ts.map +1 -0
  362. package/dist/form-engine/smart-month-field.js +12 -0
  363. package/dist/form-engine/smart-month-field.js.map +1 -0
  364. package/dist/form-engine/smart-multi-select-field.d.ts +11 -0
  365. package/dist/form-engine/smart-multi-select-field.d.ts.map +1 -0
  366. package/dist/form-engine/smart-multi-select-field.js +5 -0
  367. package/dist/form-engine/smart-multi-select-field.js.map +1 -0
  368. package/dist/form-engine/smart-number-field.d.ts +22 -0
  369. package/dist/form-engine/smart-number-field.d.ts.map +1 -0
  370. package/dist/form-engine/smart-number-field.js +115 -0
  371. package/dist/form-engine/smart-number-field.js.map +1 -0
  372. package/dist/form-engine/smart-password-field.d.ts +7 -0
  373. package/dist/form-engine/smart-password-field.d.ts.map +1 -0
  374. package/dist/form-engine/smart-password-field.js +5 -0
  375. package/dist/form-engine/smart-password-field.js.map +1 -0
  376. package/dist/form-engine/smart-radio-group-field.d.ts +10 -0
  377. package/dist/form-engine/smart-radio-group-field.d.ts.map +1 -0
  378. package/dist/form-engine/smart-radio-group-field.js +5 -0
  379. package/dist/form-engine/smart-radio-group-field.js.map +1 -0
  380. package/dist/form-engine/smart-segmented-field.d.ts +9 -0
  381. package/dist/form-engine/smart-segmented-field.d.ts.map +1 -0
  382. package/dist/form-engine/smart-segmented-field.js +5 -0
  383. package/dist/form-engine/smart-segmented-field.js.map +1 -0
  384. package/dist/form-engine/smart-select-field.d.ts +10 -0
  385. package/dist/form-engine/smart-select-field.d.ts.map +1 -0
  386. package/dist/form-engine/smart-select-field.js +5 -0
  387. package/dist/form-engine/smart-select-field.js.map +1 -0
  388. package/dist/form-engine/smart-slug-field.d.ts +12 -0
  389. package/dist/form-engine/smart-slug-field.d.ts.map +1 -0
  390. package/dist/form-engine/smart-slug-field.js +14 -0
  391. package/dist/form-engine/smart-slug-field.js.map +1 -0
  392. package/dist/form-engine/smart-switch-field.d.ts +5 -0
  393. package/dist/form-engine/smart-switch-field.d.ts.map +1 -0
  394. package/dist/form-engine/smart-switch-field.js +9 -0
  395. package/dist/form-engine/smart-switch-field.js.map +1 -0
  396. package/dist/form-engine/smart-tel-field.d.ts +7 -0
  397. package/dist/form-engine/smart-tel-field.d.ts.map +1 -0
  398. package/dist/form-engine/smart-tel-field.js +6 -0
  399. package/dist/form-engine/smart-tel-field.js.map +1 -0
  400. package/dist/form-engine/smart-text-editor-field.d.ts +15 -0
  401. package/dist/form-engine/smart-text-editor-field.d.ts.map +1 -0
  402. package/dist/form-engine/smart-text-editor-field.js +5 -0
  403. package/dist/form-engine/smart-text-editor-field.js.map +1 -0
  404. package/dist/form-engine/smart-textarea-field.d.ts +8 -0
  405. package/dist/form-engine/smart-textarea-field.d.ts.map +1 -0
  406. package/dist/form-engine/smart-textarea-field.js +5 -0
  407. package/dist/form-engine/smart-textarea-field.js.map +1 -0
  408. package/dist/form-engine/smart-time-field.d.ts +10 -0
  409. package/dist/form-engine/smart-time-field.d.ts.map +1 -0
  410. package/dist/form-engine/smart-time-field.js +5 -0
  411. package/dist/form-engine/smart-time-field.js.map +1 -0
  412. package/dist/form-engine/smart-time-range-field.d.ts +13 -0
  413. package/dist/form-engine/smart-time-range-field.d.ts.map +1 -0
  414. package/dist/form-engine/smart-time-range-field.js +5 -0
  415. package/dist/form-engine/smart-time-range-field.js.map +1 -0
  416. package/dist/form-engine/smart-year-field.d.ts +8 -0
  417. package/dist/form-engine/smart-year-field.d.ts.map +1 -0
  418. package/dist/form-engine/smart-year-field.js +5 -0
  419. package/dist/form-engine/smart-year-field.js.map +1 -0
  420. package/dist/form-engine/smart-yesno-field.d.ts +12 -0
  421. package/dist/form-engine/smart-yesno-field.d.ts.map +1 -0
  422. package/dist/form-engine/smart-yesno-field.js +14 -0
  423. package/dist/form-engine/smart-yesno-field.js.map +1 -0
  424. package/dist/hooks/use-mobile.d.ts +2 -0
  425. package/dist/hooks/use-mobile.d.ts.map +1 -0
  426. package/dist/hooks/use-mobile.js +17 -0
  427. package/dist/hooks/use-mobile.js.map +1 -0
  428. package/dist/lexical-text-editor/SmartTextEditor.d.ts +61 -0
  429. package/dist/lexical-text-editor/SmartTextEditor.d.ts.map +1 -0
  430. package/dist/lexical-text-editor/SmartTextEditor.js +145 -0
  431. package/dist/lexical-text-editor/SmartTextEditor.js.map +1 -0
  432. package/dist/lexical-text-editor/editor-nodes.d.ts +3 -0
  433. package/dist/lexical-text-editor/editor-nodes.d.ts.map +1 -0
  434. package/dist/lexical-text-editor/editor-nodes.js +25 -0
  435. package/dist/lexical-text-editor/editor-nodes.js.map +1 -0
  436. package/dist/lexical-text-editor/editor-theme.d.ts +3 -0
  437. package/dist/lexical-text-editor/editor-theme.d.ts.map +1 -0
  438. package/dist/lexical-text-editor/editor-theme.js +78 -0
  439. package/dist/lexical-text-editor/editor-theme.js.map +1 -0
  440. package/dist/lexical-text-editor/index.d.ts +8 -0
  441. package/dist/lexical-text-editor/index.d.ts.map +1 -0
  442. package/dist/lexical-text-editor/index.js +6 -0
  443. package/dist/lexical-text-editor/index.js.map +1 -0
  444. package/dist/lexical-text-editor/nodes/image-node.d.ts +41 -0
  445. package/dist/lexical-text-editor/nodes/image-node.d.ts.map +1 -0
  446. package/dist/lexical-text-editor/nodes/image-node.js +89 -0
  447. package/dist/lexical-text-editor/nodes/image-node.js.map +1 -0
  448. package/dist/lexical-text-editor/nodes/page-break-node.d.ts +25 -0
  449. package/dist/lexical-text-editor/nodes/page-break-node.d.ts.map +1 -0
  450. package/dist/lexical-text-editor/nodes/page-break-node.js +84 -0
  451. package/dist/lexical-text-editor/nodes/page-break-node.js.map +1 -0
  452. package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts +3 -0
  453. package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts.map +1 -0
  454. package/dist/lexical-text-editor/plugins/auto-link-plugin.js +12 -0
  455. package/dist/lexical-text-editor/plugins/auto-link-plugin.js.map +1 -0
  456. package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts +6 -0
  457. package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts.map +1 -0
  458. package/dist/lexical-text-editor/plugins/code-highlight-plugin.js +14 -0
  459. package/dist/lexical-text-editor/plugins/code-highlight-plugin.js.map +1 -0
  460. package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts +7 -0
  461. package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts.map +1 -0
  462. package/dist/lexical-text-editor/plugins/toolbar/align-menu.js +8 -0
  463. package/dist/lexical-text-editor/plugins/toolbar/align-menu.js.map +1 -0
  464. package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts +20 -0
  465. package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts.map +1 -0
  466. package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js +78 -0
  467. package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js.map +1 -0
  468. package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts +36 -0
  469. package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts.map +1 -0
  470. package/dist/lexical-text-editor/plugins/toolbar/constants.js +67 -0
  471. package/dist/lexical-text-editor/plugins/toolbar/constants.js.map +1 -0
  472. package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts +14 -0
  473. package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts.map +1 -0
  474. package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js +129 -0
  475. package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js.map +1 -0
  476. package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts +8 -0
  477. package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts.map +1 -0
  478. package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js +87 -0
  479. package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js.map +1 -0
  480. package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts +11 -0
  481. package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts.map +1 -0
  482. package/dist/lexical-text-editor/plugins/toolbar/link-editor.js +51 -0
  483. package/dist/lexical-text-editor/plugins/toolbar/link-editor.js.map +1 -0
  484. package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts +39 -0
  485. package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts.map +1 -0
  486. package/dist/lexical-text-editor/plugins/toolbar/primitives.js +47 -0
  487. package/dist/lexical-text-editor/plugins/toolbar/primitives.js.map +1 -0
  488. package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts +9 -0
  489. package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts.map +1 -0
  490. package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js +29 -0
  491. package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js.map +1 -0
  492. package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts +30 -0
  493. package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts.map +1 -0
  494. package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js +128 -0
  495. package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js.map +1 -0
  496. package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts +8 -0
  497. package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts.map +1 -0
  498. package/dist/lexical-text-editor/plugins/toolbar-plugin.js +51 -0
  499. package/dist/lexical-text-editor/plugins/toolbar-plugin.js.map +1 -0
  500. package/dist/lexical-text-editor/sanitize.d.ts +24 -0
  501. package/dist/lexical-text-editor/sanitize.d.ts.map +1 -0
  502. package/dist/lexical-text-editor/sanitize.js +140 -0
  503. package/dist/lexical-text-editor/sanitize.js.map +1 -0
  504. package/dist/lib/format.d.ts +17 -0
  505. package/dist/lib/format.d.ts.map +1 -0
  506. package/dist/lib/format.js +40 -0
  507. package/dist/lib/format.js.map +1 -0
  508. package/dist/lib/leading-space.d.ts +28 -0
  509. package/dist/lib/leading-space.d.ts.map +1 -0
  510. package/dist/lib/leading-space.js +34 -0
  511. package/dist/lib/leading-space.js.map +1 -0
  512. package/dist/lib/utils.d.ts +3 -0
  513. package/dist/lib/utils.d.ts.map +1 -0
  514. package/dist/lib/utils.js +4 -0
  515. package/dist/lib/utils.js.map +1 -0
  516. package/dist/lib/xlsx.d.ts +80 -0
  517. package/dist/lib/xlsx.d.ts.map +1 -0
  518. package/dist/lib/xlsx.js +377 -0
  519. package/dist/lib/xlsx.js.map +1 -0
  520. package/dist/search-engine/build-query.d.ts +29 -0
  521. package/dist/search-engine/build-query.d.ts.map +1 -0
  522. package/dist/search-engine/build-query.js +51 -0
  523. package/dist/search-engine/build-query.js.map +1 -0
  524. package/dist/search-engine/index.d.ts +15 -0
  525. package/dist/search-engine/index.d.ts.map +1 -0
  526. package/dist/search-engine/index.js +13 -0
  527. package/dist/search-engine/index.js.map +1 -0
  528. package/dist/search-engine/smart-search-form.d.ts +92 -0
  529. package/dist/search-engine/smart-search-form.d.ts.map +1 -0
  530. package/dist/search-engine/smart-search-form.js +136 -0
  531. package/dist/search-engine/smart-search-form.js.map +1 -0
  532. package/dist/search-engine/types.d.ts +40 -0
  533. package/dist/search-engine/types.d.ts.map +1 -0
  534. package/dist/search-engine/types.js +11 -0
  535. package/dist/search-engine/types.js.map +1 -0
  536. package/dist/smart-components/buttons/action-button.d.ts +66 -0
  537. package/dist/smart-components/buttons/action-button.d.ts.map +1 -0
  538. package/dist/smart-components/buttons/action-button.js +79 -0
  539. package/dist/smart-components/buttons/action-button.js.map +1 -0
  540. package/dist/smart-components/buttons/action-buttons.d.ts +122 -0
  541. package/dist/smart-components/buttons/action-buttons.d.ts.map +1 -0
  542. package/dist/smart-components/buttons/action-buttons.js +42 -0
  543. package/dist/smart-components/buttons/action-buttons.js.map +1 -0
  544. package/dist/smart-components/buttons/action-config.d.ts +181 -0
  545. package/dist/smart-components/buttons/action-config.d.ts.map +1 -0
  546. package/dist/smart-components/buttons/action-config.js +128 -0
  547. package/dist/smart-components/buttons/action-config.js.map +1 -0
  548. package/dist/smart-components/buttons/index.d.ts +4 -0
  549. package/dist/smart-components/buttons/index.d.ts.map +1 -0
  550. package/dist/smart-components/buttons/index.js +7 -0
  551. package/dist/smart-components/buttons/index.js.map +1 -0
  552. package/dist/smart-components/loading-overlay.d.ts +16 -0
  553. package/dist/smart-components/loading-overlay.d.ts.map +1 -0
  554. package/dist/smart-components/loading-overlay.js +13 -0
  555. package/dist/smart-components/loading-overlay.js.map +1 -0
  556. package/dist/smart-components/page/index.d.ts +19 -0
  557. package/dist/smart-components/page/index.d.ts.map +1 -0
  558. package/dist/smart-components/page/index.js +33 -0
  559. package/dist/smart-components/page/index.js.map +1 -0
  560. package/dist/smart-components/page/layouts/page-states.d.ts +17 -0
  561. package/dist/smart-components/page/layouts/page-states.d.ts.map +1 -0
  562. package/dist/smart-components/page/layouts/page-states.js +12 -0
  563. package/dist/smart-components/page/layouts/page-states.js.map +1 -0
  564. package/dist/smart-components/page/layouts/slot-buckets.d.ts +21 -0
  565. package/dist/smart-components/page/layouts/slot-buckets.d.ts.map +1 -0
  566. package/dist/smart-components/page/layouts/slot-buckets.js +2 -0
  567. package/dist/smart-components/page/layouts/slot-buckets.js.map +1 -0
  568. package/dist/smart-components/page/layouts/split-layout.d.ts +13 -0
  569. package/dist/smart-components/page/layouts/split-layout.d.ts.map +1 -0
  570. package/dist/smart-components/page/layouts/split-layout.js +14 -0
  571. package/dist/smart-components/page/layouts/split-layout.js.map +1 -0
  572. package/dist/smart-components/page/layouts/standard-layout.d.ts +18 -0
  573. package/dist/smart-components/page/layouts/standard-layout.d.ts.map +1 -0
  574. package/dist/smart-components/page/layouts/standard-layout.js +61 -0
  575. package/dist/smart-components/page/layouts/standard-layout.js.map +1 -0
  576. package/dist/smart-components/page/page-context.d.ts +51 -0
  577. package/dist/smart-components/page/page-context.d.ts.map +1 -0
  578. package/dist/smart-components/page/page-context.js +21 -0
  579. package/dist/smart-components/page/page-context.js.map +1 -0
  580. package/dist/smart-components/page/slot.d.ts +19 -0
  581. package/dist/smart-components/page/slot.d.ts.map +1 -0
  582. package/dist/smart-components/page/slot.js +18 -0
  583. package/dist/smart-components/page/slot.js.map +1 -0
  584. package/dist/smart-components/page/smart-grid-area.d.ts +75 -0
  585. package/dist/smart-components/page/smart-grid-area.d.ts.map +1 -0
  586. package/dist/smart-components/page/smart-grid-area.js +61 -0
  587. package/dist/smart-components/page/smart-grid-area.js.map +1 -0
  588. package/dist/smart-components/page/smart-page-container.d.ts +66 -0
  589. package/dist/smart-components/page/smart-page-container.d.ts.map +1 -0
  590. package/dist/smart-components/page/smart-page-container.js +93 -0
  591. package/dist/smart-components/page/smart-page-container.js.map +1 -0
  592. package/dist/smart-components/page/smart-page-content.d.ts +70 -0
  593. package/dist/smart-components/page/smart-page-content.d.ts.map +1 -0
  594. package/dist/smart-components/page/smart-page-content.js +78 -0
  595. package/dist/smart-components/page/smart-page-content.js.map +1 -0
  596. package/dist/smart-components/page/smart-page-empty.d.ts +47 -0
  597. package/dist/smart-components/page/smart-page-empty.d.ts.map +1 -0
  598. package/dist/smart-components/page/smart-page-empty.js +37 -0
  599. package/dist/smart-components/page/smart-page-empty.js.map +1 -0
  600. package/dist/smart-components/page/smart-page-error.d.ts +59 -0
  601. package/dist/smart-components/page/smart-page-error.d.ts.map +1 -0
  602. package/dist/smart-components/page/smart-page-error.js +45 -0
  603. package/dist/smart-components/page/smart-page-error.js.map +1 -0
  604. package/dist/smart-components/page/smart-page-filters.d.ts +38 -0
  605. package/dist/smart-components/page/smart-page-filters.d.ts.map +1 -0
  606. package/dist/smart-components/page/smart-page-filters.js +33 -0
  607. package/dist/smart-components/page/smart-page-filters.js.map +1 -0
  608. package/dist/smart-components/page/smart-page-footer.d.ts +49 -0
  609. package/dist/smart-components/page/smart-page-footer.d.ts.map +1 -0
  610. package/dist/smart-components/page/smart-page-footer.js +49 -0
  611. package/dist/smart-components/page/smart-page-footer.js.map +1 -0
  612. package/dist/smart-components/page/smart-page-header.d.ts +145 -0
  613. package/dist/smart-components/page/smart-page-header.d.ts.map +1 -0
  614. package/dist/smart-components/page/smart-page-header.js +129 -0
  615. package/dist/smart-components/page/smart-page-header.js.map +1 -0
  616. package/dist/smart-components/page/smart-page-hero.d.ts +43 -0
  617. package/dist/smart-components/page/smart-page-hero.d.ts.map +1 -0
  618. package/dist/smart-components/page/smart-page-hero.js +42 -0
  619. package/dist/smart-components/page/smart-page-hero.js.map +1 -0
  620. package/dist/smart-components/page/smart-page-loading.d.ts +31 -0
  621. package/dist/smart-components/page/smart-page-loading.d.ts.map +1 -0
  622. package/dist/smart-components/page/smart-page-loading.js +29 -0
  623. package/dist/smart-components/page/smart-page-loading.js.map +1 -0
  624. package/dist/smart-components/page/smart-page-search.d.ts +39 -0
  625. package/dist/smart-components/page/smart-page-search.d.ts.map +1 -0
  626. package/dist/smart-components/page/smart-page-search.js +38 -0
  627. package/dist/smart-components/page/smart-page-search.js.map +1 -0
  628. package/dist/smart-components/page/smart-page-section.d.ts +55 -0
  629. package/dist/smart-components/page/smart-page-section.d.ts.map +1 -0
  630. package/dist/smart-components/page/smart-page-section.js +41 -0
  631. package/dist/smart-components/page/smart-page-section.js.map +1 -0
  632. package/dist/smart-components/page/smart-page-status-bar.d.ts +34 -0
  633. package/dist/smart-components/page/smart-page-status-bar.d.ts.map +1 -0
  634. package/dist/smart-components/page/smart-page-status-bar.js +33 -0
  635. package/dist/smart-components/page/smart-page-status-bar.js.map +1 -0
  636. package/dist/smart-components/page/smart-page-tabs.d.ts +93 -0
  637. package/dist/smart-components/page/smart-page-tabs.d.ts.map +1 -0
  638. package/dist/smart-components/page/smart-page-tabs.js +87 -0
  639. package/dist/smart-components/page/smart-page-tabs.js.map +1 -0
  640. package/dist/smart-components/page/smart-page.d.ts +141 -0
  641. package/dist/smart-components/page/smart-page.d.ts.map +1 -0
  642. package/dist/smart-components/page/smart-page.js +295 -0
  643. package/dist/smart-components/page/smart-page.js.map +1 -0
  644. package/dist/smart-components/page/smart-sidebar.d.ts +70 -0
  645. package/dist/smart-components/page/smart-sidebar.d.ts.map +1 -0
  646. package/dist/smart-components/page/smart-sidebar.js +54 -0
  647. package/dist/smart-components/page/smart-sidebar.js.map +1 -0
  648. package/dist/smart-components/page/smart-toolbar.d.ts +40 -0
  649. package/dist/smart-components/page/smart-toolbar.d.ts.map +1 -0
  650. package/dist/smart-components/page/smart-toolbar.js +39 -0
  651. package/dist/smart-components/page/smart-toolbar.js.map +1 -0
  652. package/dist/smart-components/search-input.d.ts +20 -0
  653. package/dist/smart-components/search-input.d.ts.map +1 -0
  654. package/dist/smart-components/search-input.js +12 -0
  655. package/dist/smart-components/search-input.js.map +1 -0
  656. package/dist/smart-components/smart-accordion.d.ts +53 -0
  657. package/dist/smart-components/smart-accordion.d.ts.map +1 -0
  658. package/dist/smart-components/smart-accordion.js +33 -0
  659. package/dist/smart-components/smart-accordion.js.map +1 -0
  660. package/dist/smart-components/smart-alert.d.ts +44 -0
  661. package/dist/smart-components/smart-alert.d.ts.map +1 -0
  662. package/dist/smart-components/smart-alert.js +27 -0
  663. package/dist/smart-components/smart-alert.js.map +1 -0
  664. package/dist/smart-components/smart-avatar.d.ts +3 -0
  665. package/dist/smart-components/smart-avatar.d.ts.map +1 -0
  666. package/dist/smart-components/smart-avatar.js +4 -0
  667. package/dist/smart-components/smart-avatar.js.map +1 -0
  668. package/dist/smart-components/smart-badge.d.ts +28 -0
  669. package/dist/smart-components/smart-badge.d.ts.map +1 -0
  670. package/dist/smart-components/smart-badge.js +24 -0
  671. package/dist/smart-components/smart-badge.js.map +1 -0
  672. package/dist/smart-components/smart-breadcrumb.d.ts +43 -0
  673. package/dist/smart-components/smart-breadcrumb.d.ts.map +1 -0
  674. package/dist/smart-components/smart-breadcrumb.js +37 -0
  675. package/dist/smart-components/smart-breadcrumb.js.map +1 -0
  676. package/dist/smart-components/smart-button.d.ts +22 -0
  677. package/dist/smart-components/smart-button.d.ts.map +1 -0
  678. package/dist/smart-components/smart-button.js +15 -0
  679. package/dist/smart-components/smart-button.js.map +1 -0
  680. package/dist/smart-components/smart-calendar.d.ts +78 -0
  681. package/dist/smart-components/smart-calendar.d.ts.map +1 -0
  682. package/dist/smart-components/smart-calendar.js +45 -0
  683. package/dist/smart-components/smart-calendar.js.map +1 -0
  684. package/dist/smart-components/smart-card.d.ts +55 -0
  685. package/dist/smart-components/smart-card.d.ts.map +1 -0
  686. package/dist/smart-components/smart-card.js +37 -0
  687. package/dist/smart-components/smart-card.js.map +1 -0
  688. package/dist/smart-components/smart-checkbox-group.d.ts +48 -0
  689. package/dist/smart-components/smart-checkbox-group.d.ts.map +1 -0
  690. package/dist/smart-components/smart-checkbox-group.js +48 -0
  691. package/dist/smart-components/smart-checkbox-group.js.map +1 -0
  692. package/dist/smart-components/smart-checkbox.d.ts +34 -0
  693. package/dist/smart-components/smart-checkbox.d.ts.map +1 -0
  694. package/dist/smart-components/smart-checkbox.js +34 -0
  695. package/dist/smart-components/smart-checkbox.js.map +1 -0
  696. package/dist/smart-components/smart-combobox.d.ts +36 -0
  697. package/dist/smart-components/smart-combobox.d.ts.map +1 -0
  698. package/dist/smart-components/smart-combobox.js +32 -0
  699. package/dist/smart-components/smart-combobox.js.map +1 -0
  700. package/dist/smart-components/smart-confirm-dialog.d.ts +63 -0
  701. package/dist/smart-components/smart-confirm-dialog.d.ts.map +1 -0
  702. package/dist/smart-components/smart-confirm-dialog.js +45 -0
  703. package/dist/smart-components/smart-confirm-dialog.js.map +1 -0
  704. package/dist/smart-components/smart-context-menu.d.ts +58 -0
  705. package/dist/smart-components/smart-context-menu.d.ts.map +1 -0
  706. package/dist/smart-components/smart-context-menu.js +38 -0
  707. package/dist/smart-components/smart-context-menu.js.map +1 -0
  708. package/dist/smart-components/smart-date-picker.d.ts +99 -0
  709. package/dist/smart-components/smart-date-picker.d.ts.map +1 -0
  710. package/dist/smart-components/smart-date-picker.js +78 -0
  711. package/dist/smart-components/smart-date-picker.js.map +1 -0
  712. package/dist/smart-components/smart-date-range-picker.d.ts +37 -0
  713. package/dist/smart-components/smart-date-range-picker.d.ts.map +1 -0
  714. package/dist/smart-components/smart-date-range-picker.js +38 -0
  715. package/dist/smart-components/smart-date-range-picker.js.map +1 -0
  716. package/dist/smart-components/smart-dialog.d.ts +75 -0
  717. package/dist/smart-components/smart-dialog.d.ts.map +1 -0
  718. package/dist/smart-components/smart-dialog.js +61 -0
  719. package/dist/smart-components/smart-dialog.js.map +1 -0
  720. package/dist/smart-components/smart-drawer.d.ts +48 -0
  721. package/dist/smart-components/smart-drawer.d.ts.map +1 -0
  722. package/dist/smart-components/smart-drawer.js +32 -0
  723. package/dist/smart-components/smart-drawer.js.map +1 -0
  724. package/dist/smart-components/smart-field.d.ts +47 -0
  725. package/dist/smart-components/smart-field.d.ts.map +1 -0
  726. package/dist/smart-components/smart-field.js +44 -0
  727. package/dist/smart-components/smart-field.js.map +1 -0
  728. package/dist/smart-components/smart-input-group.d.ts +60 -0
  729. package/dist/smart-components/smart-input-group.d.ts.map +1 -0
  730. package/dist/smart-components/smart-input-group.js +40 -0
  731. package/dist/smart-components/smart-input-group.js.map +1 -0
  732. package/dist/smart-components/smart-input.d.ts +46 -0
  733. package/dist/smart-components/smart-input.d.ts.map +1 -0
  734. package/dist/smart-components/smart-input.js +36 -0
  735. package/dist/smart-components/smart-input.js.map +1 -0
  736. package/dist/smart-components/smart-label.d.ts +22 -0
  737. package/dist/smart-components/smart-label.d.ts.map +1 -0
  738. package/dist/smart-components/smart-label.js +17 -0
  739. package/dist/smart-components/smart-label.js.map +1 -0
  740. package/dist/smart-components/smart-month-picker.d.ts +30 -0
  741. package/dist/smart-components/smart-month-picker.d.ts.map +1 -0
  742. package/dist/smart-components/smart-month-picker.js +53 -0
  743. package/dist/smart-components/smart-month-picker.js.map +1 -0
  744. package/dist/smart-components/smart-multi-select.d.ts +38 -0
  745. package/dist/smart-components/smart-multi-select.d.ts.map +1 -0
  746. package/dist/smart-components/smart-multi-select.js +56 -0
  747. package/dist/smart-components/smart-multi-select.js.map +1 -0
  748. package/dist/smart-components/smart-native-select.d.ts +45 -0
  749. package/dist/smart-components/smart-native-select.d.ts.map +1 -0
  750. package/dist/smart-components/smart-native-select.js +33 -0
  751. package/dist/smart-components/smart-native-select.js.map +1 -0
  752. package/dist/smart-components/smart-nav-sidebar.d.ts +47 -0
  753. package/dist/smart-components/smart-nav-sidebar.d.ts.map +1 -0
  754. package/dist/smart-components/smart-nav-sidebar.js +37 -0
  755. package/dist/smart-components/smart-nav-sidebar.js.map +1 -0
  756. package/dist/smart-components/smart-password-input.d.ts +31 -0
  757. package/dist/smart-components/smart-password-input.d.ts.map +1 -0
  758. package/dist/smart-components/smart-password-input.js +30 -0
  759. package/dist/smart-components/smart-password-input.js.map +1 -0
  760. package/dist/smart-components/smart-radio-group.d.ts +58 -0
  761. package/dist/smart-components/smart-radio-group.d.ts.map +1 -0
  762. package/dist/smart-components/smart-radio-group.js +49 -0
  763. package/dist/smart-components/smart-radio-group.js.map +1 -0
  764. package/dist/smart-components/smart-segmented.d.ts +33 -0
  765. package/dist/smart-components/smart-segmented.d.ts.map +1 -0
  766. package/dist/smart-components/smart-segmented.js +25 -0
  767. package/dist/smart-components/smart-segmented.js.map +1 -0
  768. package/dist/smart-components/smart-select.d.ts +71 -0
  769. package/dist/smart-components/smart-select.d.ts.map +1 -0
  770. package/dist/smart-components/smart-select.js +44 -0
  771. package/dist/smart-components/smart-select.js.map +1 -0
  772. package/dist/smart-components/smart-separator.d.ts +3 -0
  773. package/dist/smart-components/smart-separator.d.ts.map +1 -0
  774. package/dist/smart-components/smart-separator.js +4 -0
  775. package/dist/smart-components/smart-separator.js.map +1 -0
  776. package/dist/smart-components/smart-sheet.d.ts +79 -0
  777. package/dist/smart-components/smart-sheet.d.ts.map +1 -0
  778. package/dist/smart-components/smart-sheet.js +47 -0
  779. package/dist/smart-components/smart-sheet.js.map +1 -0
  780. package/dist/smart-components/smart-stat-card.d.ts +47 -0
  781. package/dist/smart-components/smart-stat-card.d.ts.map +1 -0
  782. package/dist/smart-components/smart-stat-card.js +35 -0
  783. package/dist/smart-components/smart-stat-card.js.map +1 -0
  784. package/dist/smart-components/smart-stepper.d.ts +24 -0
  785. package/dist/smart-components/smart-stepper.d.ts.map +1 -0
  786. package/dist/smart-components/smart-stepper.js +24 -0
  787. package/dist/smart-components/smart-stepper.js.map +1 -0
  788. package/dist/smart-components/smart-switch.d.ts +34 -0
  789. package/dist/smart-components/smart-switch.d.ts.map +1 -0
  790. package/dist/smart-components/smart-switch.js +34 -0
  791. package/dist/smart-components/smart-switch.js.map +1 -0
  792. package/dist/smart-components/smart-textarea.d.ts +38 -0
  793. package/dist/smart-components/smart-textarea.d.ts.map +1 -0
  794. package/dist/smart-components/smart-textarea.js +28 -0
  795. package/dist/smart-components/smart-textarea.js.map +1 -0
  796. package/dist/smart-components/smart-time-picker.d.ts +59 -0
  797. package/dist/smart-components/smart-time-picker.d.ts.map +1 -0
  798. package/dist/smart-components/smart-time-picker.js +129 -0
  799. package/dist/smart-components/smart-time-picker.js.map +1 -0
  800. package/dist/smart-components/smart-time-range-picker.d.ts +39 -0
  801. package/dist/smart-components/smart-time-range-picker.d.ts.map +1 -0
  802. package/dist/smart-components/smart-time-range-picker.js +26 -0
  803. package/dist/smart-components/smart-time-range-picker.js.map +1 -0
  804. package/dist/smart-components/smart-toaster.d.ts +10 -0
  805. package/dist/smart-components/smart-toaster.d.ts.map +1 -0
  806. package/dist/smart-components/smart-toaster.js +21 -0
  807. package/dist/smart-components/smart-toaster.js.map +1 -0
  808. package/dist/smart-components/smart-year-picker.d.ts +29 -0
  809. package/dist/smart-components/smart-year-picker.d.ts.map +1 -0
  810. package/dist/smart-components/smart-year-picker.js +43 -0
  811. package/dist/smart-components/smart-year-picker.js.map +1 -0
  812. package/dist/smart-components/spinner.d.ts +10 -0
  813. package/dist/smart-components/spinner.d.ts.map +1 -0
  814. package/dist/smart-components/spinner.js +5 -0
  815. package/dist/smart-components/spinner.js.map +1 -0
  816. package/dist/transfer-list-engine/index.d.ts +5 -0
  817. package/dist/transfer-list-engine/index.d.ts.map +1 -0
  818. package/dist/transfer-list-engine/index.js +3 -0
  819. package/dist/transfer-list-engine/index.js.map +1 -0
  820. package/dist/transfer-list-engine/transfer-list.d.ts +53 -0
  821. package/dist/transfer-list-engine/transfer-list.d.ts.map +1 -0
  822. package/dist/transfer-list-engine/transfer-list.js +190 -0
  823. package/dist/transfer-list-engine/transfer-list.js.map +1 -0
  824. package/dist/transfer-list-engine/transfer-utils.d.ts +30 -0
  825. package/dist/transfer-list-engine/transfer-utils.d.ts.map +1 -0
  826. package/dist/transfer-list-engine/transfer-utils.js +69 -0
  827. package/dist/transfer-list-engine/transfer-utils.js.map +1 -0
  828. package/dist/transfer-list-engine/types.d.ts +51 -0
  829. package/dist/transfer-list-engine/types.d.ts.map +1 -0
  830. package/dist/transfer-list-engine/types.js +2 -0
  831. package/dist/transfer-list-engine/types.js.map +1 -0
  832. package/dist/tree-engine/index.d.ts +6 -0
  833. package/dist/tree-engine/index.d.ts.map +1 -0
  834. package/dist/tree-engine/index.js +3 -0
  835. package/dist/tree-engine/index.js.map +1 -0
  836. package/dist/tree-engine/tree-utils.d.ts +84 -0
  837. package/dist/tree-engine/tree-utils.d.ts.map +1 -0
  838. package/dist/tree-engine/tree-utils.js +271 -0
  839. package/dist/tree-engine/tree-utils.js.map +1 -0
  840. package/dist/tree-engine/tree.d.ts +98 -0
  841. package/dist/tree-engine/tree.d.ts.map +1 -0
  842. package/dist/tree-engine/tree.js +430 -0
  843. package/dist/tree-engine/tree.js.map +1 -0
  844. package/dist/tree-engine/types.d.ts +85 -0
  845. package/dist/tree-engine/types.d.ts.map +1 -0
  846. package/dist/tree-engine/types.js +2 -0
  847. package/dist/tree-engine/types.js.map +1 -0
  848. package/dist/tree-engine/use-tree.d.ts +12 -0
  849. package/dist/tree-engine/use-tree.d.ts.map +1 -0
  850. package/dist/tree-engine/use-tree.js +34 -0
  851. package/dist/tree-engine/use-tree.js.map +1 -0
  852. package/package.json +158 -0
  853. package/src/styles/globals.css +161 -0
@@ -0,0 +1,92 @@
1
+ import * as React from "react";
2
+ import { z } from "zod";
3
+ import { type FieldRegistry } from "@iamsaroj/smart-ui/form-engine";
4
+ import type { SearchFieldDefinition } from "./types";
5
+ export interface SmartSearchFormProps<T extends Record<string, unknown>> {
6
+ /** Search fields — same shape as form-engine fields, narrowed to search controls. */
7
+ fields: SearchFieldDefinition<T>[];
8
+ /**
9
+ * Zod schema — validated before a search fires. Optional: with no schema every
10
+ * value is accepted. When present, required-ness / the asterisk derive from it.
11
+ */
12
+ schema?: z.ZodType<T>;
13
+ /** Controlled search state. Own it in the parent to wire URL-sync or presets. */
14
+ data?: T;
15
+ /** Kept in sync with every field edit. */
16
+ setData?: (data: T) => void;
17
+ /**
18
+ * The empty state Reset returns to. Defaults to each field type's blank value
19
+ * (from the registry), so you rarely need to pass it.
20
+ */
21
+ defaultValues?: T;
22
+ /** Grid columns on desktop. Collapses responsively (2 on tablet, 1 on mobile). Default `1`. */
23
+ columns?: 1 | 2 | 3 | 4;
24
+ /**
25
+ * Manual search: show the Search button and only emit on submit / Enter.
26
+ * Default `true`. Pass `search={false}` (or {@link autoSearch}) for auto mode.
27
+ */
28
+ search?: boolean;
29
+ /**
30
+ * Auto search: emit automatically (debounced) whenever a filter changes, with
31
+ * no Search button. Takes precedence over {@link search}.
32
+ */
33
+ autoSearch?: boolean;
34
+ /** Debounce for auto search, in ms. Default `400`. */
35
+ debounce?: number;
36
+ /** Show the Reset button. Default `true`. */
37
+ reset?: boolean;
38
+ /** In manual mode, also run the search after a reset. Default `false`. */
39
+ searchOnReset?: boolean;
40
+ /** Called with the pruned, validated query — only meaningful values. */
41
+ onSearch?: (query: Partial<T>) => void;
42
+ /** Alias of {@link onSearch} to match the `<SForm onSubmit>` convention. */
43
+ onSubmit?: (query: Partial<T>) => void;
44
+ /** Called after fields are cleared to their defaults. */
45
+ onReset?: () => void;
46
+ /** Show a spinner + disable actions while a search is in flight. */
47
+ loading?: boolean;
48
+ /** Show a badge with the active-filter count on the Search button. */
49
+ showCount?: boolean;
50
+ searchLabel?: React.ReactNode;
51
+ resetLabel?: React.ReactNode;
52
+ /** Extra controls rendered at the start of the action bar (before Reset). */
53
+ actions?: React.ReactNode;
54
+ /** Custom field registry, merged over the built-in one (e.g. async selects). */
55
+ registry?: FieldRegistry;
56
+ className?: string;
57
+ }
58
+ /**
59
+ * A declarative, reusable **search / filter bar** built on {@link SmartForm}.
60
+ * Supply the fields (and optionally a Zod schema) and it renders the right
61
+ * control per filter, validates, prunes empty values into a clean query, and
62
+ * emits it — either on demand (manual) or automatically as filters change.
63
+ *
64
+ * ```tsx
65
+ * // Manual — search on click / Enter
66
+ * <SmartSearchForm
67
+ * data={search}
68
+ * setData={setSearch}
69
+ * fields={searchFields}
70
+ * schema={searchSchema}
71
+ * columns={4}
72
+ * reset
73
+ * onSearch={(query) => setFilters(toFilters(query))}
74
+ * />
75
+ *
76
+ * // Auto — debounced search as you type
77
+ * <SmartSearchForm data={search} setData={setSearch} fields={searchFields} autoSearch />
78
+ * ```
79
+ *
80
+ * @remarks
81
+ * Composes `SmartForm` rather than reimplementing it, so validation, required
82
+ * derivation, layout, and error display are shared. Keep `data`/`setData` in the
83
+ * parent to layer URL synchronization, saved searches, or filter presets on top
84
+ * without changes here.
85
+ */
86
+ export declare const SmartSearchForm: <T extends Record<string, unknown>>({ fields, schema, data, setData, defaultValues, columns, search, autoSearch, debounce, reset, searchOnReset, onSearch, onSubmit, onReset, loading, showCount, searchLabel, resetLabel, actions, registry, className, }: SmartSearchFormProps<T>) => import("react/jsx-runtime").JSX.Element;
87
+ /**
88
+ * Alias of {@link SmartSearchForm}. Provided so `<SearchEngine … />` reads
89
+ * naturally at call sites that think in terms of a "search engine" block.
90
+ */
91
+ export declare const SearchEngine: <T extends Record<string, unknown>>({ fields, schema, data, setData, defaultValues, columns, search, autoSearch, debounce, reset, searchOnReset, onSearch, onSubmit, onReset, loading, showCount, searchLabel, resetLabel, actions, registry, className, }: SmartSearchFormProps<T>) => import("react/jsx-runtime").JSX.Element;
92
+ //# sourceMappingURL=smart-search-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-search-form.d.ts","sourceRoot":"","sources":["../../src/search-engine/smart-search-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAmBpD,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,qFAAqF;IACrF,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAA;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,iFAAiF;IACjF,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,0CAA0C;IAC1C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,CAAA;IACjB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IACtC,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IACtC,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,sEAAsE;IACtE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,6EAA6E;IAC7E,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,wNAsBhE,oBAAoB,CAAC,CAAC,CAAC,4CAgIzB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,GA5JO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,0NAsB9D,oBAAoB,CAAC,CAAC,CAAC,4CAsIiB,CAAA"}
@@ -0,0 +1,136 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { z } from "zod";
5
+ import { Loader2, RotateCcw, Search } from "lucide-react";
6
+ import { cn } from "@iamsaroj/smart-ui/lib/utils";
7
+ import { Button } from "@iamsaroj/smart-ui/components/button";
8
+ import { Badge } from "@iamsaroj/smart-ui/components/badge";
9
+ import { SmartForm, defaultFieldRegistry, } from "@iamsaroj/smart-ui/form-engine";
10
+ import { buildSearchQuery, countActiveFilters } from "./build-query";
11
+ /** Loose fallback schema when the consumer supplies none — validates nothing. */
12
+ const PASSTHROUGH_SCHEMA = z.looseObject({});
13
+ /**
14
+ * Responsive column classes per `columns` setting. Unlike SmartForm's fixed
15
+ * grid, a search bar should collapse on smaller screens: one column on mobile,
16
+ * two on tablet, the requested count on desktop. Passed as SmartForm's
17
+ * `className`, where tailwind-merge lets it override the fixed `grid-cols-*`.
18
+ */
19
+ const RESPONSIVE_COLS = {
20
+ 1: "grid-cols-1",
21
+ 2: "grid-cols-1 sm:grid-cols-2",
22
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
23
+ 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
24
+ };
25
+ /**
26
+ * A declarative, reusable **search / filter bar** built on {@link SmartForm}.
27
+ * Supply the fields (and optionally a Zod schema) and it renders the right
28
+ * control per filter, validates, prunes empty values into a clean query, and
29
+ * emits it — either on demand (manual) or automatically as filters change.
30
+ *
31
+ * ```tsx
32
+ * // Manual — search on click / Enter
33
+ * <SmartSearchForm
34
+ * data={search}
35
+ * setData={setSearch}
36
+ * fields={searchFields}
37
+ * schema={searchSchema}
38
+ * columns={4}
39
+ * reset
40
+ * onSearch={(query) => setFilters(toFilters(query))}
41
+ * />
42
+ *
43
+ * // Auto — debounced search as you type
44
+ * <SmartSearchForm data={search} setData={setSearch} fields={searchFields} autoSearch />
45
+ * ```
46
+ *
47
+ * @remarks
48
+ * Composes `SmartForm` rather than reimplementing it, so validation, required
49
+ * derivation, layout, and error display are shared. Keep `data`/`setData` in the
50
+ * parent to layer URL synchronization, saved searches, or filter presets on top
51
+ * without changes here.
52
+ */
53
+ export const SmartSearchForm = ({ fields, schema, data, setData, defaultValues, columns = 1, search = true, autoSearch, debounce = 400, reset = true, searchOnReset = false, onSearch, onSubmit, onReset, loading = false, showCount = false, searchLabel = "Search", resetLabel = "Reset", actions, registry, className, }) => {
54
+ const auto = autoSearch === true || !search;
55
+ const emitFn = onSearch ?? onSubmit;
56
+ // The blank state a Reset returns to: each field type's registry default,
57
+ // overlaid with any explicit `defaultValues`.
58
+ const defaults = React.useMemo(() => {
59
+ const reg = registry ?? defaultFieldRegistry;
60
+ const base = {};
61
+ for (const field of fields)
62
+ base[field.name] = reg[field.type]?.defaultValue;
63
+ return { ...base, ...defaultValues };
64
+ // eslint-disable-next-line react-hooks/exhaustive-deps
65
+ }, [fields, registry]);
66
+ // Live values: the controlled `data` is the source of truth when provided;
67
+ // otherwise fall back to internal state so an uncontrolled bar still works and
68
+ // auto-search has something to observe. Deriving (rather than mirroring in an
69
+ // effect) keeps external `data` changes — async load, URL restore — in sync
70
+ // with no extra render.
71
+ const isControlled = data !== undefined;
72
+ const [internal, setInternal] = React.useState(() => ({
73
+ ...defaults,
74
+ ...data,
75
+ }));
76
+ const values = isControlled ? data : internal;
77
+ const handleSetData = React.useCallback((next) => {
78
+ if (!isControlled)
79
+ setInternal(next);
80
+ setData?.(next);
81
+ }, [isControlled, setData]);
82
+ // Serialized last-emitted query — dedupes auto-search so identical filter
83
+ // states don't refire. Seeded on mount so the initial render doesn't search.
84
+ const lastEmittedRef = React.useRef(undefined);
85
+ const emit = React.useCallback((raw, { dedupe }) => {
86
+ const query = buildSearchQuery(raw);
87
+ const serialized = JSON.stringify(query);
88
+ if (dedupe && serialized === lastEmittedRef.current)
89
+ return;
90
+ lastEmittedRef.current = serialized;
91
+ emitFn?.(query);
92
+ }, [emitFn]);
93
+ // Auto search: debounce on value changes, gated by schema validation so an
94
+ // invalid filter (bad email, reversed range) never fires a request. Seed the
95
+ // dedupe ref on the first run so mount doesn't trigger an unwanted search.
96
+ const mountedRef = React.useRef(false);
97
+ React.useEffect(() => {
98
+ if (!auto)
99
+ return;
100
+ if (!mountedRef.current) {
101
+ mountedRef.current = true;
102
+ lastEmittedRef.current = JSON.stringify(buildSearchQuery(values));
103
+ return;
104
+ }
105
+ const id = setTimeout(() => {
106
+ if (schema && !schema.safeParse(values).success)
107
+ return;
108
+ emit(values, { dedupe: true });
109
+ }, debounce);
110
+ return () => clearTimeout(id);
111
+ }, [auto, values, debounce, schema, emit]);
112
+ const handleReset = React.useCallback(() => {
113
+ handleSetData(defaults);
114
+ lastEmittedRef.current = undefined;
115
+ onReset?.();
116
+ // Auto mode re-searches via the debounced effect once `values` updates; in
117
+ // manual mode only re-run when explicitly asked.
118
+ if (!auto && searchOnReset)
119
+ emit(defaults, { dedupe: false });
120
+ }, [handleSetData, defaults, onReset, auto, searchOnReset, emit]);
121
+ const activeCount = React.useMemo(() => countActiveFilters(values), [values]);
122
+ const showSearchButton = !auto;
123
+ const showResetButton = reset;
124
+ const hasActions = showSearchButton || showResetButton || actions != null;
125
+ const actionBar = hasActions ? (_jsxs("div", { className: "flex items-center justify-end gap-2 pt-1", children: [actions, showResetButton && (_jsxs(Button, { type: "button", variant: "ghost", disabled: loading, onClick: handleReset, children: [_jsx(RotateCcw, {}), resetLabel] })), showSearchButton && (_jsxs(Button, { type: "submit", disabled: loading, children: [loading ? _jsx(Loader2, { className: "animate-spin" }) : _jsx(Search, {}), searchLabel, showCount && activeCount > 0 && (_jsx(Badge, { variant: "secondary", className: "ml-1", children: activeCount }))] }))] })) : null;
126
+ return (_jsx(SmartForm, { schema: schema ?? PASSTHROUGH_SCHEMA, data: values, setData: handleSetData, fields: fields, columns: columns, registry: registry, className: cn(RESPONSIVE_COLS[columns], className),
127
+ // Manual submit path: SmartForm validates, then hands over the valid
128
+ // values — prune and emit (no dedupe: an explicit Search should always run).
129
+ onSubmit: (valid) => emit(valid, { dedupe: false }), submitLabel: null, children: actionBar ?? undefined }));
130
+ };
131
+ /**
132
+ * Alias of {@link SmartSearchForm}. Provided so `<SearchEngine … />` reads
133
+ * naturally at call sites that think in terms of a "search engine" block.
134
+ */
135
+ export const SearchEngine = SmartSearchForm;
136
+ //# sourceMappingURL=smart-search-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-search-form.js","sourceRoot":"","sources":["../../src/search-engine/smart-search-form.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Search-engine field typing. Rather than fork the form engine, the search
3
+ * field definition is **derived** from {@link FieldDefinition}: intersecting the
4
+ * full discriminated union with a narrowed `type` distributes over the union, so
5
+ * every member keeps its own per-type extras (options, decimalScale, …) while
6
+ * the set of allowed `type`s is constrained to search-relevant controls. The
7
+ * result is still assignable to `FieldDefinition<T>[]`, so it flows straight into
8
+ * {@link SmartForm} and reuses the entire field registry unchanged.
9
+ */
10
+ import type { FieldDefinition } from "@iamsaroj/smart-ui/form-engine";
11
+ /**
12
+ * The subset of {@link FieldType} that makes sense as a search/filter control.
13
+ * Excludes authoring-only inputs (password, textarea, slug, rich text) that have
14
+ * no place in a filter bar.
15
+ *
16
+ * `combobox` / `autocomplete` are the searchable single-selects — use them for
17
+ * "async select" style fields; supply their `options` from your own loaded data,
18
+ * or register a custom async field type via the `registry` prop for true
19
+ * server-side option loading.
20
+ */
21
+ export type SearchFieldType = "text" | "email" | "url" | "number" | "integer" | "decimal" | "currency" | "percentage" | "select" | "combobox" | "autocomplete" | "multiselect" | "radio" | "segmented" | "checkbox" | "checkbox-group" | "switch" | "yesno" | "date" | "daterange" | "month" | "year" | "time" | "datetime";
22
+ /**
23
+ * A single search field's configuration — the same discriminated union as
24
+ * {@link FieldDefinition}, but with `type` constrained to {@link SearchFieldType}.
25
+ * Authoring keeps full per-type autocomplete and rejects non-search field types
26
+ * at compile time.
27
+ *
28
+ * ```tsx
29
+ * const fields: SearchFieldDefinition<UserSearch>[] = [
30
+ * { name: "name", label: "Name", type: "text", placeholder: "Search name…" },
31
+ * { name: "role", type: "select", options: roleOptions },
32
+ * { name: "status", type: "multiselect", options: statusOptions },
33
+ * { name: "createdAt", type: "daterange" },
34
+ * ]
35
+ * ```
36
+ */
37
+ export type SearchFieldDefinition<T extends Record<string, unknown> = Record<string, unknown>> = FieldDefinition<T> & {
38
+ type: SearchFieldType;
39
+ };
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/search-engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAErE;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAEvB,MAAM,GACN,OAAO,GACP,KAAK,GAEL,QAAQ,GACR,SAAS,GACT,SAAS,GACT,UAAU,GACV,YAAY,GAEZ,QAAQ,GACR,UAAU,GACV,cAAc,GACd,aAAa,GACb,OAAO,GACP,WAAW,GAEX,UAAU,GACV,gBAAgB,GAChB,QAAQ,GACR,OAAO,GAEP,MAAM,GACN,WAAW,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,CAAA;AAEd;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACzD,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Search-engine field typing. Rather than fork the form engine, the search
3
+ * field definition is **derived** from {@link FieldDefinition}: intersecting the
4
+ * full discriminated union with a narrowed `type` distributes over the union, so
5
+ * every member keeps its own per-type extras (options, decimalScale, …) while
6
+ * the set of allowed `type`s is constrained to search-relevant controls. The
7
+ * result is still assignable to `FieldDefinition<T>[]`, so it flows straight into
8
+ * {@link SmartForm} and reuses the entire field registry unchanged.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/search-engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,66 @@
1
+ import * as React from "react";
2
+ import { TooltipContent } from "@iamsaroj/smart-ui/components/tooltip";
3
+ import { type SmartButtonProps } from "@iamsaroj/smart-ui/smart-components/smart-button";
4
+ import { type ActionKind } from "./action-config";
5
+ export type ActionPermissionChecker = (action: ActionKind) => boolean;
6
+ /**
7
+ * Optional role/permission gate for all `ActionButton`s underneath. Buttons
8
+ * whose action `can(action)` rejects are hidden (or disabled, per their
9
+ * `deniedBehavior`). A per-button `permission` prop overrides the checker.
10
+ *
11
+ * ```tsx
12
+ * <ActionPermissionProvider can={(action) => role === "admin" || action !== "delete"}>
13
+ * <EditButton onClick={edit} />
14
+ * <DeleteButton onClick={remove} />
15
+ * </ActionPermissionProvider>
16
+ * ```
17
+ */
18
+ export declare const ActionPermissionProvider: ({ can, children, }: {
19
+ can: ActionPermissionChecker;
20
+ children: React.ReactNode;
21
+ }) => import("react/jsx-runtime").JSX.Element;
22
+ export interface ActionButtonProps extends SmartButtonProps {
23
+ /** Which entry of `ACTION_BUTTON_CONFIG` supplies the defaults. */
24
+ action: ActionKind;
25
+ /** Override the default icon; pass `null` to render without an icon. */
26
+ icon?: React.ReactNode;
27
+ /**
28
+ * Render only the icon (switches to the matching `icon-*` size). The default
29
+ * label is kept as `aria-label` and shown as a tooltip.
30
+ */
31
+ iconOnly?: boolean;
32
+ /**
33
+ * Tooltip content. `true` uses the default label, `false` disables the
34
+ * automatic icon-only tooltip. Defaults to the label when `iconOnly`.
35
+ */
36
+ tooltip?: React.ReactNode | boolean;
37
+ tooltipSide?: React.ComponentProps<typeof TooltipContent>["side"];
38
+ /** Explicit permission override; wins over `ActionPermissionProvider`. */
39
+ permission?: boolean;
40
+ /** What to do when the action is not permitted. @default "hide" */
41
+ deniedBehavior?: "hide" | "disable";
42
+ }
43
+ /**
44
+ * `SmartButton` pre-configured for a named action: default icon, label,
45
+ * variant, loading text, and button type all come from
46
+ * `ACTION_BUTTON_CONFIG[action]`; every prop stays overridable. Prefer the
47
+ * named presets (`<AddButton />`, `<DeleteButton />`, …) — this component is
48
+ * the escape hatch for choosing the action dynamically.
49
+ *
50
+ * ```tsx
51
+ * <ActionButton action="save" loading={isSaving} onClick={save} />
52
+ * <ActionButton action="delete" iconOnly onClick={remove} />
53
+ * ```
54
+ */
55
+ export declare const ActionButton: ({ action, icon, iconOnly, tooltip, tooltipSide, permission, deniedBehavior, variant, size, type, loadingText, disabled, children, "aria-label": ariaLabel, ...props }: ActionButtonProps) => import("react/jsx-runtime").JSX.Element | null;
56
+ export type ActionButtonPresetProps = Omit<ActionButtonProps, "action">;
57
+ /**
58
+ * Builds a named preset bound to one action. Used for all built-in buttons in
59
+ * `action-buttons.tsx`; call it yourself after extending
60
+ * `ACTION_BUTTON_CONFIG` with a new action.
61
+ */
62
+ export declare const createActionButton: (action: ActionKind, displayName: string) => {
63
+ (props: ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
64
+ displayName: string;
65
+ };
66
+ //# sourceMappingURL=action-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-button.d.ts","sourceRoot":"","sources":["../../../src/smart-components/buttons/action-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAEL,cAAc,EAGf,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,kDAAkD,CAAA;AAEzD,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAA;AAExB,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAA;AAKrE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GAAI,oBAGtC;IACD,GAAG,EAAE,uBAAuB,CAAA;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAIA,CAAA;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,mEAAmE;IACnE,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,OAAO,CAAA;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;IACjE,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAqBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,uKAgB1B,iBAAiB,mDA4CnB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;AAEvE;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,UAAU,EAAE,aAAa,MAAM;YACrC,uBAAuB;;CAK3D,CAAA"}
@@ -0,0 +1,79 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@iamsaroj/smart-ui/components/tooltip";
4
+ import { SmartButton, } from "@iamsaroj/smart-ui/smart-components/smart-button";
5
+ import { ACTION_BUTTON_CONFIG, } from "./action-config";
6
+ const ActionPermissionContext = React.createContext(null);
7
+ /**
8
+ * Optional role/permission gate for all `ActionButton`s underneath. Buttons
9
+ * whose action `can(action)` rejects are hidden (or disabled, per their
10
+ * `deniedBehavior`). A per-button `permission` prop overrides the checker.
11
+ *
12
+ * ```tsx
13
+ * <ActionPermissionProvider can={(action) => role === "admin" || action !== "delete"}>
14
+ * <EditButton onClick={edit} />
15
+ * <DeleteButton onClick={remove} />
16
+ * </ActionPermissionProvider>
17
+ * ```
18
+ */
19
+ export const ActionPermissionProvider = ({ can, children, }) => (_jsx(ActionPermissionContext.Provider, { value: can, children: children }));
20
+ const toIconOnlySize = (size) => {
21
+ switch (size) {
22
+ case undefined:
23
+ case null:
24
+ case "default":
25
+ return "icon";
26
+ case "xs":
27
+ return "icon-xs";
28
+ case "sm":
29
+ return "icon-sm";
30
+ case "lg":
31
+ return "icon-lg";
32
+ default:
33
+ return size;
34
+ }
35
+ };
36
+ /**
37
+ * `SmartButton` pre-configured for a named action: default icon, label,
38
+ * variant, loading text, and button type all come from
39
+ * `ACTION_BUTTON_CONFIG[action]`; every prop stays overridable. Prefer the
40
+ * named presets (`<AddButton />`, `<DeleteButton />`, …) — this component is
41
+ * the escape hatch for choosing the action dynamically.
42
+ *
43
+ * ```tsx
44
+ * <ActionButton action="save" loading={isSaving} onClick={save} />
45
+ * <ActionButton action="delete" iconOnly onClick={remove} />
46
+ * ```
47
+ */
48
+ export const ActionButton = ({ action, icon, iconOnly = false, tooltip, tooltipSide, permission, deniedBehavior = "hide", variant, size, type, loadingText, disabled, children, "aria-label": ariaLabel, ...props }) => {
49
+ const can = React.useContext(ActionPermissionContext);
50
+ const allowed = permission ?? can?.(action) ?? true;
51
+ if (!allowed && deniedBehavior === "hide")
52
+ return null;
53
+ const config = ACTION_BUTTON_CONFIG[action];
54
+ const DefaultIcon = config.icon;
55
+ const resolvedIcon = icon === undefined ? _jsx(DefaultIcon, { "aria-hidden": true }) : icon;
56
+ const label = children ?? config.label;
57
+ const iconSide = config.iconSide ?? "start";
58
+ const button = (_jsxs(SmartButton, { variant: variant ?? config.variant, size: iconOnly ? toIconOnlySize(size) : size, type: type ?? config.type ?? "button", loadingText: loadingText ?? (iconOnly ? "" : config.loadingText), disabled: disabled || !allowed, "aria-label": ariaLabel ?? (iconOnly ? config.label : undefined), ...props, children: [iconSide === "start" && resolvedIcon, !iconOnly && label, iconSide === "end" && resolvedIcon] }));
59
+ const tooltipContent = tooltip === true
60
+ ? config.label
61
+ : tooltip === false
62
+ ? null
63
+ : (tooltip ?? (iconOnly ? config.label : null));
64
+ if (tooltipContent == null)
65
+ return button;
66
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: button }), _jsx(TooltipContent, { side: tooltipSide, children: tooltipContent })] }) }));
67
+ };
68
+ /**
69
+ * Builds a named preset bound to one action. Used for all built-in buttons in
70
+ * `action-buttons.tsx`; call it yourself after extending
71
+ * `ACTION_BUTTON_CONFIG` with a new action.
72
+ */
73
+ // eslint-disable-next-line react-refresh/only-export-components
74
+ export const createActionButton = (action, displayName) => {
75
+ const ActionButtonPreset = (props) => (_jsx(ActionButton, { action: action, ...props }));
76
+ ActionButtonPreset.displayName = displayName;
77
+ return ActionButtonPreset;
78
+ };
79
+ //# sourceMappingURL=action-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-button.js","sourceRoot":"","sources":["../../../src/smart-components/buttons/action-button.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Named presets — one per `ACTION_BUTTON_CONFIG` entry. Each is a
3
+ * `SmartButton` with the action's icon, label, variant, loading text, and
4
+ * accessibility defaults baked in; all props remain overridable.
5
+ *
6
+ * ```tsx
7
+ * <AddButton onClick={openCreate} /> // "+ Add", primary
8
+ * <DeleteButton iconOnly onClick={remove} /> // trash icon, destructive, tooltip
9
+ * <SaveButton loading={isSaving} onClick={save} /> // spinner + "Saving…"
10
+ * <ExportButton permission={canExport} onClick={run} /> // hidden unless permitted
11
+ * <AddButton>New user</AddButton> // custom label
12
+ * ```
13
+ */
14
+ export declare const AddButton: {
15
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ export declare const EditButton: {
19
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ export declare const DeleteButton: {
23
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
24
+ displayName: string;
25
+ };
26
+ export declare const SaveButton: {
27
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
28
+ displayName: string;
29
+ };
30
+ export declare const CancelButton: {
31
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
32
+ displayName: string;
33
+ };
34
+ export declare const SearchButton: {
35
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
36
+ displayName: string;
37
+ };
38
+ export declare const RefreshButton: {
39
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
40
+ displayName: string;
41
+ };
42
+ export declare const SyncButton: {
43
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
44
+ displayName: string;
45
+ };
46
+ export declare const DownloadButton: {
47
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
48
+ displayName: string;
49
+ };
50
+ export declare const UploadButton: {
51
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
52
+ displayName: string;
53
+ };
54
+ export declare const ImportButton: {
55
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
56
+ displayName: string;
57
+ };
58
+ export declare const ExportButton: {
59
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
60
+ displayName: string;
61
+ };
62
+ export declare const CopyButton: {
63
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
64
+ displayName: string;
65
+ };
66
+ export declare const PrintButton: {
67
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
68
+ displayName: string;
69
+ };
70
+ export declare const FilterButton: {
71
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
72
+ displayName: string;
73
+ };
74
+ export declare const ResetButton: {
75
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
76
+ displayName: string;
77
+ };
78
+ export declare const SubmitButton: {
79
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
80
+ displayName: string;
81
+ };
82
+ export declare const ApproveButton: {
83
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
84
+ displayName: string;
85
+ };
86
+ export declare const RejectButton: {
87
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
88
+ displayName: string;
89
+ };
90
+ export declare const ViewButton: {
91
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
92
+ displayName: string;
93
+ };
94
+ export declare const CloseButton: {
95
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
96
+ displayName: string;
97
+ };
98
+ export declare const BackButton: {
99
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
100
+ displayName: string;
101
+ };
102
+ export declare const NextButton: {
103
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
104
+ displayName: string;
105
+ };
106
+ export declare const PreviousButton: {
107
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
108
+ displayName: string;
109
+ };
110
+ export declare const DuplicateButton: {
111
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
112
+ displayName: string;
113
+ };
114
+ export declare const ArchiveButton: {
115
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
116
+ displayName: string;
117
+ };
118
+ export declare const RestoreButton: {
119
+ (props: import("./action-button").ActionButtonPresetProps): import("react/jsx-runtime").JSX.Element;
120
+ displayName: string;
121
+ };
122
+ //# sourceMappingURL=action-buttons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-buttons.d.ts","sourceRoot":"","sources":["../../../src/smart-components/buttons/action-buttons.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS;;;CAAyC,CAAA;AAC/D,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,aAAa;;;CAAiD,CAAA;AAC3E,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,cAAc;;;CAAmD,CAAA;AAC9E,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,WAAW;;;CAA6C,CAAA;AACrE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,WAAW;;;CAA6C,CAAA;AACrE,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,aAAa;;;CAAiD,CAAA;AAC3E,eAAO,MAAM,YAAY;;;CAA+C,CAAA;AACxE,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,WAAW;;;CAA6C,CAAA;AACrE,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,UAAU;;;CAA2C,CAAA;AAClE,eAAO,MAAM,cAAc;;;CAAmD,CAAA;AAC9E,eAAO,MAAM,eAAe;;;CAG3B,CAAA;AACD,eAAO,MAAM,aAAa;;;CAAiD,CAAA;AAC3E,eAAO,MAAM,aAAa;;;CAAiD,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { createActionButton } from "./action-button";
2
+ /**
3
+ * Named presets — one per `ACTION_BUTTON_CONFIG` entry. Each is a
4
+ * `SmartButton` with the action's icon, label, variant, loading text, and
5
+ * accessibility defaults baked in; all props remain overridable.
6
+ *
7
+ * ```tsx
8
+ * <AddButton onClick={openCreate} /> // "+ Add", primary
9
+ * <DeleteButton iconOnly onClick={remove} /> // trash icon, destructive, tooltip
10
+ * <SaveButton loading={isSaving} onClick={save} /> // spinner + "Saving…"
11
+ * <ExportButton permission={canExport} onClick={run} /> // hidden unless permitted
12
+ * <AddButton>New user</AddButton> // custom label
13
+ * ```
14
+ */
15
+ export const AddButton = createActionButton("add", "AddButton");
16
+ export const EditButton = createActionButton("edit", "EditButton");
17
+ export const DeleteButton = createActionButton("delete", "DeleteButton");
18
+ export const SaveButton = createActionButton("save", "SaveButton");
19
+ export const CancelButton = createActionButton("cancel", "CancelButton");
20
+ export const SearchButton = createActionButton("search", "SearchButton");
21
+ export const RefreshButton = createActionButton("refresh", "RefreshButton");
22
+ export const SyncButton = createActionButton("sync", "SyncButton");
23
+ export const DownloadButton = createActionButton("download", "DownloadButton");
24
+ export const UploadButton = createActionButton("upload", "UploadButton");
25
+ export const ImportButton = createActionButton("import", "ImportButton");
26
+ export const ExportButton = createActionButton("export", "ExportButton");
27
+ export const CopyButton = createActionButton("copy", "CopyButton");
28
+ export const PrintButton = createActionButton("print", "PrintButton");
29
+ export const FilterButton = createActionButton("filter", "FilterButton");
30
+ export const ResetButton = createActionButton("reset", "ResetButton");
31
+ export const SubmitButton = createActionButton("submit", "SubmitButton");
32
+ export const ApproveButton = createActionButton("approve", "ApproveButton");
33
+ export const RejectButton = createActionButton("reject", "RejectButton");
34
+ export const ViewButton = createActionButton("view", "ViewButton");
35
+ export const CloseButton = createActionButton("close", "CloseButton");
36
+ export const BackButton = createActionButton("back", "BackButton");
37
+ export const NextButton = createActionButton("next", "NextButton");
38
+ export const PreviousButton = createActionButton("previous", "PreviousButton");
39
+ export const DuplicateButton = createActionButton("duplicate", "DuplicateButton");
40
+ export const ArchiveButton = createActionButton("archive", "ArchiveButton");
41
+ export const RestoreButton = createActionButton("restore", "RestoreButton");
42
+ //# sourceMappingURL=action-buttons.js.map