pixelize-design-library 2.3.1-beta.1 → 2.3.1-beta.10

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 (324) hide show
  1. package/.claude/settings.local.json +21 -1
  2. package/dist/Components/Accordion/Accordion.js +26 -5
  3. package/dist/Components/KanbanBoard/AccountCard.js +17 -14
  4. package/dist/Components/KanbanBoard/KanbanBoard.js +93 -78
  5. package/dist/Components/NavigationBar/NavigationBar.js +4 -4
  6. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +1 -1
  7. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +42 -24
  8. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +2 -0
  9. package/dist/Components/SearchSelect/SearchSelect.js +53 -21
  10. package/dist/Components/Table/Table.d.ts +1 -1
  11. package/dist/Components/Table/Table.js +143 -28
  12. package/dist/Components/Table/TableProps.d.ts +9 -1
  13. package/dist/Components/Table/{Components → components}/TableActions.d.ts +2 -2
  14. package/dist/Components/Table/{Components → components}/TableActions.js +5 -4
  15. package/dist/Components/Table/{Components → components}/TableBody.js +84 -18
  16. package/dist/Components/Table/{Components → components}/TableHeader.js +5 -9
  17. package/dist/Components/Table/hooks/useTable.d.ts +1 -1
  18. package/dist/Components/Table/hooks/useTable.js +8 -7
  19. package/dist/Components/Table/settings/TableSettings.d.ts +3 -2
  20. package/dist/Components/Table/settings/TableSettings.js +30 -6
  21. package/dist/Components/Timeline/Timeline.d.ts +1 -1
  22. package/dist/Components/Timeline/Timeline.js +145 -78
  23. package/dist/Components/Toaster/Toaster.js +40 -20
  24. package/dist/Utils/table.d.ts +6 -1
  25. package/dist/Utils/table.js +47 -27
  26. package/package.json +1 -1
  27. package/dist/App.d.ts +0 -4
  28. package/dist/App.js +0 -131
  29. package/dist/Components/Table/CompactSelect.d.ts +0 -15
  30. package/dist/Components/Table/CompactSelect.js +0 -69
  31. package/dist/Components/Table/Components/ActiveFilters.d.ts +0 -9
  32. package/dist/Components/Table/Components/ActiveFilters.js +0 -132
  33. package/dist/Components/Table/Components/TableFilters.d.ts +0 -7
  34. package/dist/Components/Table/Components/TableFilters.js +0 -89
  35. package/dist/Components/Table/Components/useDebounce.d.ts +0 -2
  36. package/dist/Components/Table/Components/useDebounce.js +0 -28
  37. package/dist/Components/Table/Components/useTable.d.ts +0 -47
  38. package/dist/Components/Table/Components/useTable.js +0 -219
  39. package/dist/Components/Table/LeftFilterPane.d.ts +0 -36
  40. package/dist/Components/Table/LeftFilterPane.js +0 -273
  41. package/dist/Components/Table/SelectOperationControls.d.ts +0 -8
  42. package/dist/Components/Table/SelectOperationControls.js +0 -15
  43. package/dist/Components/Table/TableSettings/ManageColumns.d.ts +0 -12
  44. package/dist/Components/Table/TableSettings/ManageColumns.js +0 -166
  45. package/dist/Components/Table/TableSettings/ManageColumns.test.d.ts +0 -1
  46. package/dist/Components/Table/TableSettings/ManageColumns.test.js +0 -146
  47. package/dist/Components/Table/TableSettings/TableFilters.d.ts +0 -10
  48. package/dist/Components/Table/TableSettings/TableFilters.js +0 -69
  49. package/dist/Components/Table/TableSettings/TableFilters.test.d.ts +0 -1
  50. package/dist/Components/Table/TableSettings/TableFilters.test.js +0 -109
  51. package/dist/Components/Table/TableSettings/TableSettings.d.ts +0 -8
  52. package/dist/Components/Table/TableSettings/TableSettings.js +0 -141
  53. package/dist/Components/Table/TableToDo.d.ts +0 -2
  54. package/dist/Components/Table/TableToDo.js +0 -291
  55. package/dist/Components/Table/TextOperationControls.d.ts +0 -12
  56. package/dist/Components/Table/TextOperationControls.js +0 -29
  57. package/dist/Layout.d.ts +0 -3
  58. package/dist/Layout.js +0 -292
  59. package/dist/Pages/TInput.d.ts +0 -3
  60. package/dist/Pages/TInput.js +0 -56
  61. package/dist/Pages/accordion.d.ts +0 -3
  62. package/dist/Pages/accordion.js +0 -42
  63. package/dist/Pages/alertdialog.d.ts +0 -3
  64. package/dist/Pages/alertdialog.js +0 -54
  65. package/dist/Pages/button.d.ts +0 -3
  66. package/dist/Pages/button.js +0 -46
  67. package/dist/Pages/card.d.ts +0 -3
  68. package/dist/Pages/card.js +0 -117
  69. package/dist/Pages/chart.d.ts +0 -4
  70. package/dist/Pages/chart.js +0 -40
  71. package/dist/Pages/checkbox.d.ts +0 -3
  72. package/dist/Pages/checkbox.js +0 -12
  73. package/dist/Pages/contactForm.d.ts +0 -3
  74. package/dist/Pages/contactForm.js +0 -16
  75. package/dist/Pages/datePick.d.ts +0 -3
  76. package/dist/Pages/datePick.js +0 -88
  77. package/dist/Pages/drawer.d.ts +0 -3
  78. package/dist/Pages/drawer.js +0 -58
  79. package/dist/Pages/dropdown.d.ts +0 -3
  80. package/dist/Pages/dropdown.js +0 -24
  81. package/dist/Pages/editor.d.ts +0 -3
  82. package/dist/Pages/editor.js +0 -14
  83. package/dist/Pages/feedback.d.ts +0 -2
  84. package/dist/Pages/feedback.js +0 -15
  85. package/dist/Pages/fileUpload.d.ts +0 -2
  86. package/dist/Pages/fileUpload.js +0 -82
  87. package/dist/Pages/input.d.ts +0 -3
  88. package/dist/Pages/input.js +0 -92
  89. package/dist/Pages/kanbanboard.d.ts +0 -3
  90. package/dist/Pages/kanbanboard.js +0 -224
  91. package/dist/Pages/modal.d.ts +0 -3
  92. package/dist/Pages/modal.js +0 -65
  93. package/dist/Pages/multiSelect.d.ts +0 -3
  94. package/dist/Pages/multiSelect.js +0 -55
  95. package/dist/Pages/noteArea.d.ts +0 -3
  96. package/dist/Pages/noteArea.js +0 -59
  97. package/dist/Pages/notification.d.ts +0 -3
  98. package/dist/Pages/notification.js +0 -25
  99. package/dist/Pages/numberInput.d.ts +0 -3
  100. package/dist/Pages/numberInput.js +0 -49
  101. package/dist/Pages/photoViewer.d.ts +0 -3
  102. package/dist/Pages/photoViewer.js +0 -12
  103. package/dist/Pages/pinInputs.d.ts +0 -3
  104. package/dist/Pages/pinInputs.js +0 -12
  105. package/dist/Pages/productCaard.d.ts +0 -3
  106. package/dist/Pages/productCaard.js +0 -311
  107. package/dist/Pages/productDetailCard.d.ts +0 -3
  108. package/dist/Pages/productDetailCard.js +0 -78
  109. package/dist/Pages/productFilter.d.ts +0 -3
  110. package/dist/Pages/productFilter.js +0 -202
  111. package/dist/Pages/progressbar.d.ts +0 -3
  112. package/dist/Pages/progressbar.js +0 -12
  113. package/dist/Pages/radioButton.d.ts +0 -3
  114. package/dist/Pages/radioButton.js +0 -54
  115. package/dist/Pages/search.d.ts +0 -3
  116. package/dist/Pages/search.js +0 -54
  117. package/dist/Pages/searchSelect.d.ts +0 -3
  118. package/dist/Pages/searchSelect.js +0 -133
  119. package/dist/Pages/select.d.ts +0 -3
  120. package/dist/Pages/select.js +0 -53
  121. package/dist/Pages/selectSearch.d.ts +0 -3
  122. package/dist/Pages/selectSearch.js +0 -103
  123. package/dist/Pages/skeleton.d.ts +0 -3
  124. package/dist/Pages/skeleton.js +0 -22
  125. package/dist/Pages/switch.d.ts +0 -3
  126. package/dist/Pages/switch.js +0 -50
  127. package/dist/Pages/table.d.ts +0 -3
  128. package/dist/Pages/table.js +0 -174
  129. package/dist/Pages/textArea.d.ts +0 -3
  130. package/dist/Pages/textArea.js +0 -15
  131. package/dist/Pages/timeline.d.ts +0 -3
  132. package/dist/Pages/timeline.js +0 -74
  133. package/dist/Pages/tooltip.d.ts +0 -3
  134. package/dist/Pages/tooltip.js +0 -12
  135. package/dist/Pages/toster.d.ts +0 -3
  136. package/dist/Pages/toster.js +0 -68
  137. package/dist/Pages/verifyEmail.d.ts +0 -3
  138. package/dist/Pages/verifyEmail.js +0 -18
  139. package/dist/Theme/Dark/palette.d.ts +0 -370
  140. package/dist/Theme/Dark/palette.js +0 -372
  141. package/dist/bootstrap.d.ts +0 -1
  142. package/dist/bootstrap.js +0 -14
  143. package/dist/components-v2/AlertDialog/AlertDialog.d.ts +0 -23
  144. package/dist/components-v2/AlertDialog/AlertDialog.js +0 -98
  145. package/dist/components-v2/Breadcrumbs/Breadcrumbs.d.ts +0 -14
  146. package/dist/components-v2/Breadcrumbs/Breadcrumbs.js +0 -66
  147. package/dist/components-v2/Charts/AreaChart.d.ts +0 -23
  148. package/dist/components-v2/Charts/AreaChart.js +0 -63
  149. package/dist/components-v2/Charts/BarChart.d.ts +0 -25
  150. package/dist/components-v2/Charts/BarChart.js +0 -57
  151. package/dist/components-v2/Charts/LineChart.d.ts +0 -23
  152. package/dist/components-v2/Charts/LineChart.js +0 -55
  153. package/dist/components-v2/Charts/PieChart.d.ts +0 -15
  154. package/dist/components-v2/Charts/PieChart.js +0 -54
  155. package/dist/components-v2/Charts/PolarChart.d.ts +0 -14
  156. package/dist/components-v2/Charts/PolarChart.js +0 -54
  157. package/dist/components-v2/Charts/chartOptions.d.ts +0 -7
  158. package/dist/components-v2/Charts/chartOptions.js +0 -41
  159. package/dist/components-v2/Charts/useChartTheme.d.ts +0 -22
  160. package/dist/components-v2/Charts/useChartTheme.js +0 -106
  161. package/dist/components-v2/ContactForm/ContactForm.d.ts +0 -25
  162. package/dist/components-v2/ContactForm/ContactForm.js +0 -116
  163. package/dist/components-v2/DatePicker/Calendar.d.ts +0 -19
  164. package/dist/components-v2/DatePicker/Calendar.js +0 -212
  165. package/dist/components-v2/DatePicker/DatePicker.d.ts +0 -46
  166. package/dist/components-v2/DatePicker/DatePicker.js +0 -189
  167. package/dist/components-v2/DatePicker/TimePicker.d.ts +0 -12
  168. package/dist/components-v2/DatePicker/TimePicker.js +0 -105
  169. package/dist/components-v2/DatePicker/utils.d.ts +0 -31
  170. package/dist/components-v2/DatePicker/utils.js +0 -109
  171. package/dist/components-v2/Drawer/Drawer.d.ts +0 -27
  172. package/dist/components-v2/Drawer/Drawer.js +0 -132
  173. package/dist/components-v2/FeedbackForm/FeedbackForm.d.ts +0 -26
  174. package/dist/components-v2/FeedbackForm/FeedbackForm.js +0 -112
  175. package/dist/components-v2/FileUploader/FileUploader.d.ts +0 -28
  176. package/dist/components-v2/FileUploader/FileUploader.js +0 -127
  177. package/dist/components-v2/Input/TextInput.d.ts +0 -41
  178. package/dist/components-v2/Input/TextInput.js +0 -169
  179. package/dist/components-v2/KanbanBoard/KanbanBoard.d.ts +0 -39
  180. package/dist/components-v2/KanbanBoard/KanbanBoard.js +0 -101
  181. package/dist/components-v2/Layout/AppLayout.d.ts +0 -22
  182. package/dist/components-v2/Layout/AppLayout.js +0 -53
  183. package/dist/components-v2/Loading/Loading.d.ts +0 -19
  184. package/dist/components-v2/Loading/Loading.js +0 -55
  185. package/dist/components-v2/Modal/Modal.d.ts +0 -30
  186. package/dist/components-v2/Modal/Modal.js +0 -82
  187. package/dist/components-v2/NavigationBar/NavigationBar.d.ts +0 -47
  188. package/dist/components-v2/NavigationBar/NavigationBar.js +0 -148
  189. package/dist/components-v2/Notification/Notification.d.ts +0 -22
  190. package/dist/components-v2/Notification/Notification.js +0 -113
  191. package/dist/components-v2/NumberInput/NumberInput.d.ts +0 -37
  192. package/dist/components-v2/NumberInput/NumberInput.js +0 -210
  193. package/dist/components-v2/PinInput/PinInput.d.ts +0 -26
  194. package/dist/components-v2/PinInput/PinInput.js +0 -138
  195. package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +0 -18
  196. package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.js +0 -91
  197. package/dist/components-v2/Select/Select.d.ts +0 -41
  198. package/dist/components-v2/Select/Select.js +0 -284
  199. package/dist/components-v2/Sidebar/Sidebar.d.ts +0 -41
  200. package/dist/components-v2/Sidebar/Sidebar.js +0 -182
  201. package/dist/components-v2/Slider/Slider.d.ts +0 -18
  202. package/dist/components-v2/Slider/Slider.js +0 -101
  203. package/dist/components-v2/Table/Table.d.ts +0 -7
  204. package/dist/components-v2/Table/Table.js +0 -172
  205. package/dist/components-v2/Table/TableProps.d.ts +0 -139
  206. package/dist/components-v2/Table/TableProps.js +0 -9
  207. package/dist/components-v2/Table/components/ActiveFilters.d.ts +0 -10
  208. package/dist/components-v2/Table/components/ActiveFilters.js +0 -70
  209. package/dist/components-v2/Table/components/BulkActionBar.d.ts +0 -11
  210. package/dist/components-v2/Table/components/BulkActionBar.js +0 -92
  211. package/dist/components-v2/Table/components/ColumnResizeHandle.d.ts +0 -7
  212. package/dist/components-v2/Table/components/ColumnResizeHandle.js +0 -41
  213. package/dist/components-v2/Table/components/Pagination.d.ts +0 -11
  214. package/dist/components-v2/Table/components/Pagination.js +0 -92
  215. package/dist/components-v2/Table/components/TableBody.d.ts +0 -23
  216. package/dist/components-v2/Table/components/TableBody.js +0 -69
  217. package/dist/components-v2/Table/components/TableCell.d.ts +0 -14
  218. package/dist/components-v2/Table/components/TableCell.js +0 -63
  219. package/dist/components-v2/Table/components/TableEmptyState.d.ts +0 -12
  220. package/dist/components-v2/Table/components/TableEmptyState.js +0 -55
  221. package/dist/components-v2/Table/components/TableErrorState.d.ts +0 -6
  222. package/dist/components-v2/Table/components/TableErrorState.js +0 -52
  223. package/dist/components-v2/Table/components/TableHeader.d.ts +0 -21
  224. package/dist/components-v2/Table/components/TableHeader.js +0 -94
  225. package/dist/components-v2/Table/components/TableRow.d.ts +0 -20
  226. package/dist/components-v2/Table/components/TableRow.js +0 -64
  227. package/dist/components-v2/Table/components/TableSearch.d.ts +0 -8
  228. package/dist/components-v2/Table/components/TableSearch.js +0 -47
  229. package/dist/components-v2/Table/filters/FilterChips.d.ts +0 -6
  230. package/dist/components-v2/Table/filters/FilterChips.js +0 -9
  231. package/dist/components-v2/Table/filters/LeftFilterPane.d.ts +0 -17
  232. package/dist/components-v2/Table/filters/LeftFilterPane.js +0 -105
  233. package/dist/components-v2/Table/filters/TableFilters.d.ts +0 -12
  234. package/dist/components-v2/Table/filters/TableFilters.js +0 -127
  235. package/dist/components-v2/Table/hooks/useColumnResize.d.ts +0 -15
  236. package/dist/components-v2/Table/hooks/useColumnResize.js +0 -104
  237. package/dist/components-v2/Table/hooks/useTable.d.ts +0 -58
  238. package/dist/components-v2/Table/hooks/useTable.js +0 -254
  239. package/dist/components-v2/Table/hooks/useTableKeyboard.d.ts +0 -25
  240. package/dist/components-v2/Table/hooks/useTableKeyboard.js +0 -112
  241. package/dist/components-v2/Table/hooks/useVirtualScroll.d.ts +0 -29
  242. package/dist/components-v2/Table/hooks/useVirtualScroll.js +0 -83
  243. package/dist/components-v2/Table/settings/ManageColumns.d.ts +0 -12
  244. package/dist/components-v2/Table/settings/ManageColumns.js +0 -59
  245. package/dist/components-v2/Table/settings/TableSettings.d.ts +0 -12
  246. package/dist/components-v2/Table/settings/TableSettings.js +0 -57
  247. package/dist/components-v2/Table/utils/filterUtils.d.ts +0 -7
  248. package/dist/components-v2/Table/utils/filterUtils.js +0 -149
  249. package/dist/components-v2/Table/utils/sortUtils.d.ts +0 -6
  250. package/dist/components-v2/Table/utils/sortUtils.js +0 -65
  251. package/dist/components-v2/Tag/Tag.d.ts +0 -15
  252. package/dist/components-v2/Tag/Tag.js +0 -87
  253. package/dist/components-v2/Timeline/Timeline.d.ts +0 -18
  254. package/dist/components-v2/Timeline/Timeline.js +0 -76
  255. package/dist/components-v2/Toaster/Toaster.d.ts +0 -61
  256. package/dist/components-v2/Toaster/Toaster.js +0 -63
  257. package/dist/components-v2/Toggle/Toggle.d.ts +0 -28
  258. package/dist/components-v2/Toggle/Toggle.js +0 -90
  259. package/dist/components-v2/ui/accordion.d.ts +0 -12
  260. package/dist/components-v2/ui/accordion.js +0 -104
  261. package/dist/components-v2/ui/alert.d.ts +0 -18
  262. package/dist/components-v2/ui/alert.js +0 -99
  263. package/dist/components-v2/ui/avatar.d.ts +0 -12
  264. package/dist/components-v2/ui/avatar.js +0 -80
  265. package/dist/components-v2/ui/badge.d.ts +0 -10
  266. package/dist/components-v2/ui/badge.js +0 -76
  267. package/dist/components-v2/ui/button.d.ts +0 -18
  268. package/dist/components-v2/ui/button.js +0 -97
  269. package/dist/components-v2/ui/checkbox.d.ts +0 -15
  270. package/dist/components-v2/ui/checkbox.js +0 -86
  271. package/dist/components-v2/ui/dialog.d.ts +0 -30
  272. package/dist/components-v2/ui/dialog.js +0 -115
  273. package/dist/components-v2/ui/dropdown-menu.d.ts +0 -26
  274. package/dist/components-v2/ui/dropdown-menu.js +0 -121
  275. package/dist/components-v2/ui/field.d.ts +0 -32
  276. package/dist/components-v2/ui/field.js +0 -62
  277. package/dist/components-v2/ui/form-field.d.ts +0 -25
  278. package/dist/components-v2/ui/form-field.js +0 -96
  279. package/dist/components-v2/ui/input.d.ts +0 -9
  280. package/dist/components-v2/ui/input.js +0 -73
  281. package/dist/components-v2/ui/label.d.ts +0 -10
  282. package/dist/components-v2/ui/label.js +0 -70
  283. package/dist/components-v2/ui/popover.d.ts +0 -9
  284. package/dist/components-v2/ui/popover.js +0 -60
  285. package/dist/components-v2/ui/progress.d.ts +0 -12
  286. package/dist/components-v2/ui/progress.js +0 -75
  287. package/dist/components-v2/ui/radio-group.d.ts +0 -17
  288. package/dist/components-v2/ui/radio-group.js +0 -91
  289. package/dist/components-v2/ui/select.d.ts +0 -24
  290. package/dist/components-v2/ui/select.js +0 -122
  291. package/dist/components-v2/ui/separator.d.ts +0 -5
  292. package/dist/components-v2/ui/separator.js +0 -55
  293. package/dist/components-v2/ui/skeleton.d.ts +0 -9
  294. package/dist/components-v2/ui/skeleton.js +0 -68
  295. package/dist/components-v2/ui/spinner.d.ts +0 -16
  296. package/dist/components-v2/ui/spinner.js +0 -64
  297. package/dist/components-v2/ui/switch.d.ts +0 -10
  298. package/dist/components-v2/ui/switch.js +0 -81
  299. package/dist/components-v2/ui/tabs.d.ts +0 -13
  300. package/dist/components-v2/ui/tabs.js +0 -95
  301. package/dist/components-v2/ui/textarea.d.ts +0 -10
  302. package/dist/components-v2/ui/textarea.js +0 -96
  303. package/dist/components-v2/ui/tooltip.d.ts +0 -17
  304. package/dist/components-v2/ui/tooltip.js +0 -75
  305. package/dist/lib/utils.d.ts +0 -2
  306. package/dist/lib/utils.js +0 -8
  307. package/dist/theme-v2/ThemeProvider.d.ts +0 -19
  308. package/dist/theme-v2/ThemeProvider.js +0 -149
  309. package/dist/theme-v2/dark.css +0 -47
  310. package/dist/theme-v2/tokens.css +0 -72
  311. /package/dist/Components/Table/{Components → components}/HeaderActions.d.ts +0 -0
  312. /package/dist/Components/Table/{Components → components}/HeaderActions.js +0 -0
  313. /package/dist/Components/Table/{Components → components}/Pagination.d.ts +0 -0
  314. /package/dist/Components/Table/{Components → components}/Pagination.js +0 -0
  315. /package/dist/Components/Table/{Components → components}/TableBody.d.ts +0 -0
  316. /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.d.ts +0 -0
  317. /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.js +0 -0
  318. /package/dist/Components/Table/{Components → components}/TableGroupRow.d.ts +0 -0
  319. /package/dist/Components/Table/{Components → components}/TableGroupRow.js +0 -0
  320. /package/dist/Components/Table/{Components → components}/TableHeader.d.ts +0 -0
  321. /package/dist/Components/Table/{Components → components}/TableLoading.d.ts +0 -0
  322. /package/dist/Components/Table/{Components → components}/TableLoading.js +0 -0
  323. /package/dist/Components/Table/{Components → components}/TableSearch.d.ts +0 -0
  324. /package/dist/Components/Table/{Components → components}/TableSearch.js +0 -0
@@ -9,13 +9,14 @@ var lucide_react_1 = require("lucide-react");
9
9
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
10
10
  var functions_1 = require("../../Utils/functions");
11
11
  var Timeline = function (_a) {
12
- var _b, _c, _d, _e;
13
- var timelineEvents = _a.timelineEvents;
12
+ var _b, _c, _d, _e, _f, _g, _h;
13
+ var timelineEvents = _a.timelineEvents, onEventClick = _a.onEventClick;
14
14
  var theme = (0, useCustomTheme_1.useCustomTheme)();
15
+ var colors = (_b = theme.colors) !== null && _b !== void 0 ? _b : {};
15
16
  var isMobile = (0, react_2.useBreakpointValue)({ base: true, md: false });
16
17
  var formatTimestamp = function (timestamp, type) {
17
18
  var parsedTimestamp;
18
- if (typeof timestamp === 'string' && !timestamp.match(/^\d+$/)) {
19
+ if (typeof timestamp === "string" && !timestamp.match(/^\d+$/)) {
19
20
  var date_1 = new Date(timestamp);
20
21
  if (!isNaN(date_1.getTime())) {
21
22
  if (type === "date") {
@@ -57,16 +58,47 @@ var Timeline = function (_a) {
57
58
  }
58
59
  return date.toLocaleString();
59
60
  };
60
- var getIcon = function (event) {
61
+ // A semantic color scale chosen by the action title (created / updated / delete).
62
+ var getEventScale = function (title) {
63
+ var _a, _b, _c, _d, _e, _f;
64
+ switch ((title || "").toLowerCase()) {
65
+ case "created":
66
+ return (_b = (_a = colors.semantic) === null || _a === void 0 ? void 0 : _a.success) !== null && _b !== void 0 ? _b : colors.green;
67
+ case "updated":
68
+ return (_d = (_c = colors.semantic) === null || _c === void 0 ? void 0 : _c.warning) !== null && _d !== void 0 ? _d : colors.orange;
69
+ case "delete":
70
+ case "deleted":
71
+ return (_f = (_e = colors.semantic) === null || _e === void 0 ? void 0 : _e.error) !== null && _f !== void 0 ? _f : colors.red;
72
+ default:
73
+ return colors.primary;
74
+ }
75
+ };
76
+ // Action-title icon (what happened); falls back to the source icon below.
77
+ var getActionIcon = function (title, size) {
78
+ switch ((title || "").toLowerCase()) {
79
+ case "created":
80
+ return react_1.default.createElement(lucide_react_1.Plus, { size: size });
81
+ case "updated":
82
+ return react_1.default.createElement(lucide_react_1.PencilLine, { size: size });
83
+ case "delete":
84
+ case "deleted":
85
+ return react_1.default.createElement(lucide_react_1.Trash2, { size: size });
86
+ default:
87
+ return null;
88
+ }
89
+ };
90
+ // Source icon (where it came from) — preserves the original mapping.
91
+ var getSourceIcon = function (event, size) {
61
92
  switch (event.action_from) {
62
93
  case "Accounts":
63
- return react_1.default.createElement(lucide_react_1.IndianRupee, { size: isMobile ? 14 : 17 });
94
+ return react_1.default.createElement(lucide_react_1.IndianRupee, { size: size });
64
95
  case "Notes":
65
- return react_1.default.createElement(lucide_react_1.FileText, { size: isMobile ? 14 : 17 });
96
+ return react_1.default.createElement(lucide_react_1.FileText, { size: size });
66
97
  default:
67
- return react_1.default.createElement(lucide_react_1.Volleyball, { size: isMobile ? 14 : 17 });
98
+ return react_1.default.createElement(lucide_react_1.Volleyball, { size: size });
68
99
  }
69
100
  };
101
+ var getIcon = function (event, size) { var _a; return (_a = getActionIcon(event.title, size)) !== null && _a !== void 0 ? _a : getSourceIcon(event, size); };
70
102
  var groupEventsByDate = function (events) {
71
103
  return events.reduce(function (groups, event) {
72
104
  var date = formatTimestamp(event.created_at, "date");
@@ -79,91 +111,126 @@ var Timeline = function (_a) {
79
111
  }, {});
80
112
  };
81
113
  var groupedEvents = groupEventsByDate(timelineEvents);
82
- var formatChanges = function (changes) {
114
+ var parseChanges = function (changes) {
83
115
  if (!changes || changes === "null")
84
- return "No Changes";
116
+ return [];
85
117
  try {
86
- var parsedChanges = JSON.parse(changes);
87
- if (typeof parsedChanges !== 'object' || parsedChanges === null) {
88
- return "No Changes";
89
- }
90
- return Object.entries(parsedChanges)
91
- .map(function (_a) {
118
+ var parsed = typeof changes === "string" ? JSON.parse(changes) : changes;
119
+ if (typeof parsed !== "object" || parsed === null)
120
+ return [];
121
+ return Object.entries(parsed).map(function (_a) {
122
+ var _b;
92
123
  var key = _a[0], value = _a[1];
93
- var changeRecord = value;
94
- if (changeRecord.original === null || changeRecord.original === undefined) {
95
- return "".concat(key, " changed from null to ").concat(changeRecord.updated);
96
- }
97
- else {
98
- return "".concat(key, " updated from ").concat(changeRecord.original, " to ").concat(changeRecord.updated);
99
- }
100
- })
101
- .join("\n");
124
+ var record = value;
125
+ return {
126
+ field: key,
127
+ from: (_b = record === null || record === void 0 ? void 0 : record.original) !== null && _b !== void 0 ? _b : null,
128
+ to: record === null || record === void 0 ? void 0 : record.updated,
129
+ };
130
+ });
102
131
  }
103
132
  catch (error) {
104
133
  console.error("Error parsing changes:", error);
105
- return "Error parsing changes";
134
+ return [];
106
135
  }
107
136
  };
108
- var getEventBgColor = function (title) {
109
- var _a, _b, _c, _d, _e, _f, _g;
110
- switch (title.toLowerCase()) {
111
- case "created":
112
- return (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.green) === null || _b === void 0 ? void 0 : _b[50];
113
- case "updated":
114
- return (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.yellow) === null || _d === void 0 ? void 0 : _d[50];
115
- case "delete":
116
- return (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.red) === null || _f === void 0 ? void 0 : _f[50];
117
- default:
118
- return (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.white;
119
- }
137
+ var initials = function (name) {
138
+ return (name || "")
139
+ .trim()
140
+ .split(/\s+/)
141
+ .map(function (p) { return p[0]; })
142
+ .slice(0, 2)
143
+ .join("")
144
+ .toUpperCase() || "?";
120
145
  };
121
146
  if (!timelineEvents || timelineEvents.length === 0) {
122
- return (react_1.default.createElement(react_2.Box, { textAlign: "center", py: 8, color: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray) === null || _c === void 0 ? void 0 : _c[500] },
123
- react_1.default.createElement(react_2.Text, null, "No timeline events to display")));
147
+ return (react_1.default.createElement(react_2.Flex, { direction: "column", align: "center", justify: "center", py: 12, gap: 2, color: (_c = colors.gray) === null || _c === void 0 ? void 0 : _c[500] },
148
+ react_1.default.createElement(react_2.Box, { boxSize: "2.75rem", borderRadius: "full", bg: (_d = colors.gray) === null || _d === void 0 ? void 0 : _d[100], display: "flex", alignItems: "center", justifyContent: "center", color: (_e = colors.gray) === null || _e === void 0 ? void 0 : _e[400] },
149
+ react_1.default.createElement(lucide_react_1.Volleyball, { size: 20 })),
150
+ react_1.default.createElement(react_2.Text, { fontSize: "0.875rem", fontWeight: 500 }, "No timeline events to display")));
151
+ }
152
+ // The colored event card (shared by both the desktop "tree" and mobile rail).
153
+ // `accent` decides which edge carries the colored bar (pointing toward the spine).
154
+ var EventCard = function (_a) {
155
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
156
+ var event = _a.event, index = _a.index, accent = _a.accent;
157
+ var scale = getEventScale(event.title);
158
+ var changes = parseChanges(event.changes);
159
+ var clickable = typeof onEventClick === "function";
160
+ return (react_1.default.createElement(react_2.Box, { position: "relative", zIndex: 1, bg: (_b = colors.white) !== null && _b !== void 0 ? _b : "#fff", border: "0.063rem solid ".concat((_d = (_c = colors.boxborder) === null || _c === void 0 ? void 0 : _c[300]) !== null && _d !== void 0 ? _d : (_e = colors.gray) === null || _e === void 0 ? void 0 : _e[200]), borderInlineStartWidth: accent === "left" ? "0.1875rem" : undefined, borderInlineEndWidth: accent === "right" ? "0.1875rem" : undefined, borderInlineStartColor: accent === "left" ? scale === null || scale === void 0 ? void 0 : scale[400] : undefined, borderInlineEndColor: accent === "right" ? scale === null || scale === void 0 ? void 0 : scale[400] : undefined, borderRadius: "0.625rem", px: 3.5, py: 2.5, transition: "all 0.15s ease", cursor: clickable ? "pointer" : "default", onClick: clickable ? function () { return onEventClick(event, index); } : undefined, _hover: {
161
+ borderColor: (_f = scale === null || scale === void 0 ? void 0 : scale[300]) !== null && _f !== void 0 ? _f : (_g = colors.gray) === null || _g === void 0 ? void 0 : _g[300],
162
+ boxShadow: (_h = theme.shadows) === null || _h === void 0 ? void 0 : _h.md,
163
+ transform: clickable ? "translateY(-1px)" : undefined,
164
+ } },
165
+ react_1.default.createElement(react_2.Flex, { align: "center", justify: "space-between", gap: 2, flexWrap: "wrap" },
166
+ react_1.default.createElement(react_2.Flex, { align: "center", gap: 2, minW: 0 },
167
+ react_1.default.createElement(react_2.Text, { fontSize: "0.8125rem", fontWeight: 600, color: (_k = (_j = colors.text) === null || _j === void 0 ? void 0 : _j[800]) !== null && _k !== void 0 ? _k : (_l = colors.gray) === null || _l === void 0 ? void 0 : _l[800], noOfLines: 1 }, event.action_from),
168
+ react_1.default.createElement(react_2.Box, { as: "span", fontSize: "0.6875rem", fontWeight: 600, lineHeight: "1", textTransform: "capitalize", color: (_m = scale === null || scale === void 0 ? void 0 : scale[700]) !== null && _m !== void 0 ? _m : scale === null || scale === void 0 ? void 0 : scale[600], bg: scale === null || scale === void 0 ? void 0 : scale[50], border: "0.063rem solid ".concat((_o = scale === null || scale === void 0 ? void 0 : scale[200]) !== null && _o !== void 0 ? _o : (_p = colors.gray) === null || _p === void 0 ? void 0 : _p[200]), borderRadius: "full", px: 2, py: 1 }, event.title)),
169
+ react_1.default.createElement(react_2.Text, { fontSize: "0.6875rem", color: (_q = colors.gray) === null || _q === void 0 ? void 0 : _q[500], whiteSpace: "nowrap" }, formatTimestamp(event.created_at, "time"))),
170
+ changes.length > 0 && (react_1.default.createElement(react_2.Flex, { direction: "column", gap: 1, mt: 2 }, changes.map(function (c, i) {
171
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
172
+ return (react_1.default.createElement(react_2.Flex, { key: "".concat(c.field, "-").concat(i), align: "center", gap: 1.5, fontSize: "0.6875rem", lineHeight: "1.4", flexWrap: "wrap" },
173
+ react_1.default.createElement(react_2.Text, { fontWeight: 600, color: (_b = (_a = colors.text) === null || _a === void 0 ? void 0 : _a[700]) !== null && _b !== void 0 ? _b : (_c = colors.gray) === null || _c === void 0 ? void 0 : _c[700] }, (0, functions_1.toWords)(c.field)),
174
+ c.from !== null && c.from !== undefined && (react_1.default.createElement(react_1.default.Fragment, null,
175
+ react_1.default.createElement(react_2.Box, { as: "span", color: (_d = colors.gray) === null || _d === void 0 ? void 0 : _d[500], bg: (_e = colors.gray) === null || _e === void 0 ? void 0 : _e[50], borderRadius: "0.25rem", px: 1.5, textDecoration: "line-through", maxW: "10rem", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, String(c.from)),
176
+ react_1.default.createElement(react_2.Box, { as: "span", color: (_f = colors.gray) === null || _f === void 0 ? void 0 : _f[400], display: "inline-flex" },
177
+ react_1.default.createElement(lucide_react_1.ArrowRight, { size: 11 })))),
178
+ react_1.default.createElement(react_2.Box, { as: "span", color: (_j = (_h = (_g = colors.semantic) === null || _g === void 0 ? void 0 : _g.success) === null || _h === void 0 ? void 0 : _h[700]) !== null && _j !== void 0 ? _j : (_k = colors.green) === null || _k === void 0 ? void 0 : _k[700], bg: (_o = (_m = (_l = colors.semantic) === null || _l === void 0 ? void 0 : _l.success) === null || _m === void 0 ? void 0 : _m[50]) !== null && _o !== void 0 ? _o : (_p = colors.green) === null || _p === void 0 ? void 0 : _p[50], borderRadius: "0.25rem", px: 1.5, maxW: "12rem", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, String(c.to))));
179
+ }))),
180
+ react_1.default.createElement(react_2.Flex, { align: "center", gap: 2, mt: 2 },
181
+ react_1.default.createElement(react_2.Tooltip, { label: (0, functions_1.toWords)(event.action_by), placement: "top", hasArrow: true },
182
+ react_1.default.createElement(react_2.Flex, { align: "center", justify: "center", boxSize: "1.25rem", minW: "1.25rem", borderRadius: "full", bg: (_t = (_s = (_r = colors.primary) === null || _r === void 0 ? void 0 : _r.opacity) === null || _s === void 0 ? void 0 : _s[16]) !== null && _t !== void 0 ? _t : (_u = colors.primary) === null || _u === void 0 ? void 0 : _u[50], color: (_v = colors.primary) === null || _v === void 0 ? void 0 : _v[600], fontSize: "0.5625rem", fontWeight: 700 }, initials((0, functions_1.toWords)(event.action_by)))),
183
+ react_1.default.createElement(react_2.Text, { fontSize: "0.6875rem", color: (_w = colors.gray) === null || _w === void 0 ? void 0 : _w[500] },
184
+ "by",
185
+ " ",
186
+ react_1.default.createElement(react_2.Box, { as: "span", color: (_y = (_x = colors.text) === null || _x === void 0 ? void 0 : _x[700]) !== null && _y !== void 0 ? _y : (_z = colors.gray) === null || _z === void 0 ? void 0 : _z[700], fontWeight: 500 }, (0, functions_1.toWords)(event.action_by))))));
187
+ };
188
+ var NODE = "1.875rem"; // 30px node, centered on the spine
189
+ var NODE_RADIUS = "0.9375rem";
190
+ var SPINE_GAP = "1.75rem"; // gap between spine and card edge
191
+ // -------------------------------------------------------------------------
192
+ // Mobile: single left rail (alternating doesn't read well on narrow widths)
193
+ // -------------------------------------------------------------------------
194
+ if (isMobile) {
195
+ return (react_1.default.createElement(react_2.Box, { maxW: "100%", px: 2, py: 2 }, Object.keys(groupedEvents).map(function (date) {
196
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
197
+ return (react_1.default.createElement(react_2.Box, { key: date, mb: 2 },
198
+ react_1.default.createElement(react_2.Flex, { align: "center", gap: 3, mb: 4, mt: 2 },
199
+ react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.02em", color: (_a = colors.gray) === null || _a === void 0 ? void 0 : _a[500], bg: (_b = colors.gray) === null || _b === void 0 ? void 0 : _b[50], border: "0.063rem solid ".concat((_d = (_c = colors.boxborder) === null || _c === void 0 ? void 0 : _c[200]) !== null && _d !== void 0 ? _d : (_e = colors.gray) === null || _e === void 0 ? void 0 : _e[200]), borderRadius: "full", px: 3, py: 1, whiteSpace: "nowrap" }, date),
200
+ react_1.default.createElement(react_2.Box, { flex: "1", h: "0.063rem", bg: (_g = (_f = colors.boxborder) === null || _f === void 0 ? void 0 : _f[200]) !== null && _g !== void 0 ? _g : (_h = colors.gray) === null || _h === void 0 ? void 0 : _h[200] })),
201
+ react_1.default.createElement(react_2.Box, { position: "relative" },
202
+ react_1.default.createElement(react_2.Box, { position: "absolute", left: NODE_RADIUS, top: "0.5rem", bottom: "0.5rem", w: "0.1875rem", borderRadius: "full", bg: (_k = (_j = colors.gray) === null || _j === void 0 ? void 0 : _j[300]) !== null && _k !== void 0 ? _k : (_l = colors.boxborder) === null || _l === void 0 ? void 0 : _l[400], transform: "translateX(-50%)" }),
203
+ groupedEvents[date].map(function (event, index) {
204
+ var _a, _b, _c, _d;
205
+ var scale = getEventScale(event.title);
206
+ return (react_1.default.createElement(react_2.Flex, { key: "".concat((_a = event.logs_id) !== null && _a !== void 0 ? _a : date, "-").concat(index), align: "flex-start", gap: 3, mb: index === groupedEvents[date].length - 1 ? 0 : 3 },
207
+ react_1.default.createElement(react_2.Flex, { align: "center", justify: "center", boxSize: NODE, minW: NODE, borderRadius: "full", bg: scale === null || scale === void 0 ? void 0 : scale[50], color: scale === null || scale === void 0 ? void 0 : scale[600], border: "0.125rem solid ".concat((_b = colors.white) !== null && _b !== void 0 ? _b : "#fff"), boxShadow: "0 0 0 0.063rem ".concat((_c = scale === null || scale === void 0 ? void 0 : scale[200]) !== null && _c !== void 0 ? _c : (_d = colors.gray) === null || _d === void 0 ? void 0 : _d[200]), zIndex: 1 }, getIcon(event, 14)),
208
+ react_1.default.createElement(react_2.Box, { flex: "1", minW: 0 },
209
+ react_1.default.createElement(EventCard, { event: event, index: index, accent: "left" }))));
210
+ }))));
211
+ })));
124
212
  }
125
- return (react_1.default.createElement(react_2.Box, { position: "relative", px: { base: 3, md: 6 }, maxW: { base: "100%", md: "50rem" }, mx: "auto" },
126
- react_1.default.createElement(react_2.Box, { position: "absolute", left: { base: "1.5rem", md: "50%" }, top: 0, bottom: 0, w: "0.125rem", bg: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray) === null || _e === void 0 ? void 0 : _e[300], transform: { md: "translateX(-50%)" } }),
213
+ // -------------------------------------------------------------------------
214
+ // Desktop: center spine with cards alternating left / right (the "tree")
215
+ // -------------------------------------------------------------------------
216
+ return (react_1.default.createElement(react_2.Box, { position: "relative", maxW: "60rem", mx: "auto", px: 4, py: 2 },
217
+ react_1.default.createElement(react_2.Box, { position: "absolute", left: "50%", top: "0.5rem", bottom: "0.5rem", w: "0.015rem", borderRadius: "full", bg: (_g = (_f = colors.gray) === null || _f === void 0 ? void 0 : _f[300]) !== null && _g !== void 0 ? _g : (_h = colors.boxborder) === null || _h === void 0 ? void 0 : _h[400], transform: "translateX(-50%)" }),
127
218
  Object.keys(groupedEvents).map(function (date) {
128
- var _a, _b, _c, _d, _e;
129
- return (react_1.default.createElement(react_2.Box, { key: date, mb: 4 },
130
- react_1.default.createElement(react_2.Flex, { justify: "center", mb: 4 },
131
- react_1.default.createElement(react_2.Box, { fontSize: { base: "0.875rem", md: "1rem" }, fontWeight: "400", color: (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.black, bg: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray) === null || _c === void 0 ? void 0 : _c[50], border: "0.063rem solid ".concat((_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray) === null || _e === void 0 ? void 0 : _e[300]), borderRadius: "0.313rem", px: { base: 2, md: 6 }, py: 1, textAlign: "center", zIndex: 1 }, date)),
219
+ var _a, _b, _c, _d, _e, _f;
220
+ return (react_1.default.createElement(react_2.Box, { key: date, mb: 2 },
221
+ react_1.default.createElement(react_2.Flex, { justify: "center", mb: 5, mt: 3, position: "relative", zIndex: 2 },
222
+ react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.02em", color: (_a = colors.gray) === null || _a === void 0 ? void 0 : _a[600], bg: (_b = colors.white) !== null && _b !== void 0 ? _b : "#fff", border: "0.063rem solid ".concat((_d = (_c = colors.boxborder) === null || _c === void 0 ? void 0 : _c[300]) !== null && _d !== void 0 ? _d : (_e = colors.gray) === null || _e === void 0 ? void 0 : _e[200]), boxShadow: (_f = theme.shadows) === null || _f === void 0 ? void 0 : _f.xs, borderRadius: "full", px: 4, py: 1.5, whiteSpace: "nowrap" }, date)),
132
223
  groupedEvents[date].map(function (event, index) {
133
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
224
+ var _a, _b, _c, _d, _e, _f;
134
225
  var isLeft = index % 2 === 0;
135
- return (react_1.default.createElement(react_2.Box, { key: "".concat(date, "-").concat(index), mb: 4, position: "relative" }, isMobile ? (react_1.default.createElement(react_2.Flex, { align: "flex-start", gap: 3 },
136
- react_1.default.createElement(react_2.Box, { w: "1.5rem", h: "1.5rem", bg: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.gray) === null || _b === void 0 ? void 0 : _b[50], borderRadius: "full", border: "0.063rem solid ".concat((_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray) === null || _d === void 0 ? void 0 : _d[300]), display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, mt: 0.5 }, getIcon(event)),
137
- react_1.default.createElement(react_2.Box, { flex: "1" },
138
- react_1.default.createElement(react_2.Flex, { align: "center", gap: 2, mb: 1 },
139
- react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", color: (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.gray) === null || _f === void 0 ? void 0 : _f[500], minW: "3.5rem" }, formatTimestamp(event.created_at, "time")),
140
- react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", fontWeight: "medium", color: (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.gray) === null || _h === void 0 ? void 0 : _h[700] },
141
- event.action_from,
142
- " ",
143
- event.title),
144
- react_1.default.createElement(react_2.Tooltip, { label: formatChanges(event.changes), placement: "top", hasArrow: true },
145
- react_1.default.createElement(react_2.Box, { cursor: "pointer" },
146
- react_1.default.createElement(lucide_react_1.Info, { size: 12 })))),
147
- react_1.default.createElement(react_2.Text, { fontSize: "0.7rem", color: (_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.gray) === null || _k === void 0 ? void 0 : _k[500] },
148
- "by ",
149
- (0, functions_1.toWords)(event.action_by))))) : (
150
- // Desktop Layout
151
- react_1.default.createElement(react_2.Flex, { justify: isLeft ? "flex-start" : "flex-end", align: "flex-start", position: "relative" },
152
- react_1.default.createElement(react_2.Box, { position: "absolute", left: isLeft ? "auto" : "calc(50% + 0.938rem)", right: isLeft ? "calc(50% + 0.938rem)" : "auto", top: "0.938rem", width: isLeft ? "calc(50% - 4rem)" : "calc(50% - 4rem)", height: "0.125rem", bg: (_m = (_l = theme.colors) === null || _l === void 0 ? void 0 : _l.gray) === null || _m === void 0 ? void 0 : _m[300], zIndex: 0 }),
153
- react_1.default.createElement(react_2.Box, { position: "absolute", left: "50%", transform: "translateX(-50%)", w: "1.875rem", h: "1.875rem", bg: (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.gray) === null || _p === void 0 ? void 0 : _p[50], borderRadius: "full", border: "0.063rem solid ".concat((_r = (_q = theme.colors) === null || _q === void 0 ? void 0 : _q.gray) === null || _r === void 0 ? void 0 : _r[300]), display: "flex", alignItems: "center", justifyContent: "center", zIndex: 2 }, getIcon(event)),
154
- react_1.default.createElement(react_2.Box, { bg: getEventBgColor(event.title), border: "0.063rem solid ".concat((_t = (_s = theme.colors) === null || _s === void 0 ? void 0 : _s.gray) === null || _t === void 0 ? void 0 : _t[300]), borderRadius: "0.5rem", px: 4, py: 2, maxW: "16rem", boxShadow: "sm", zIndex: 1, ml: isLeft ? 0 : "50%", mr: isLeft ? "50%" : 0, width: "calc(50% - 2rem)", position: "relative" },
155
- react_1.default.createElement(react_2.Flex, { align: "center", justify: "space-between", mb: 1 },
156
- react_1.default.createElement(react_2.Text, { fontSize: "0.875rem", fontWeight: "medium" },
157
- event.action_from,
158
- " ",
159
- event.title),
160
- react_1.default.createElement(react_2.Tooltip, { label: formatChanges(event.changes), placement: "top", hasArrow: true },
161
- react_1.default.createElement(react_2.Box, { ml: 1, cursor: "pointer" },
162
- react_1.default.createElement(lucide_react_1.Info, { size: 14 })))),
163
- react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", color: (_v = (_u = theme.colors) === null || _u === void 0 ? void 0 : _u.gray) === null || _v === void 0 ? void 0 : _v[500] },
164
- "by ",
165
- (0, functions_1.toWords)(event.action_by)),
166
- react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", color: (_x = (_w = theme.colors) === null || _w === void 0 ? void 0 : _w.gray) === null || _x === void 0 ? void 0 : _x[500] }, formatTimestamp(event.created_at, "time")))))));
226
+ var scale = getEventScale(event.title);
227
+ return (react_1.default.createElement(react_2.Box, { key: "".concat((_a = event.logs_id) !== null && _a !== void 0 ? _a : date, "-").concat(index), position: "relative", mb: index === groupedEvents[date].length - 1 ? 0 : 5, minH: NODE },
228
+ react_1.default.createElement(react_2.Box, { position: "absolute", top: "1.375rem", h: "0.125rem", w: "0.8125rem", bg: (_b = scale === null || scale === void 0 ? void 0 : scale[300]) !== null && _b !== void 0 ? _b : (_c = colors.gray) === null || _c === void 0 ? void 0 : _c[300], left: isLeft
229
+ ? "calc(50% - ".concat(SPINE_GAP, ")")
230
+ : "calc(50% + ".concat(NODE_RADIUS, ")"), zIndex: 0 }),
231
+ react_1.default.createElement(react_2.Flex, { position: "absolute", left: "50%", top: "0.5rem", transform: "translateX(-50%)", align: "center", justify: "center", boxSize: NODE, borderRadius: "full", bg: scale === null || scale === void 0 ? void 0 : scale[50], color: scale === null || scale === void 0 ? void 0 : scale[600], border: "0.125rem solid ".concat((_d = colors.white) !== null && _d !== void 0 ? _d : "#fff"), boxShadow: "0 0 0 0.063rem ".concat((_e = scale === null || scale === void 0 ? void 0 : scale[200]) !== null && _e !== void 0 ? _e : (_f = colors.gray) === null || _f === void 0 ? void 0 : _f[200]), zIndex: 2 }, getIcon(event, 15)),
232
+ react_1.default.createElement(react_2.Box, { position: "relative", zIndex: 1, w: "calc(50% - ".concat(SPINE_GAP, ")"), ml: isLeft ? 0 : "calc(50% + ".concat(SPINE_GAP, ")") },
233
+ react_1.default.createElement(EventCard, { event: event, index: index, accent: isLeft ? "right" : "left" }))));
167
234
  })));
168
235
  })));
169
236
  };
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
2
6
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
7
  if (k2 === undefined) k2 = k;
4
8
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -37,50 +41,65 @@ exports.useToaster = void 0;
37
41
  exports.default = ToasterProvider;
38
42
  var react_1 = __importStar(require("react"));
39
43
  var react_2 = require("@chakra-ui/react");
44
+ var react_3 = require("@emotion/react");
45
+ var lucide_react_1 = require("lucide-react");
40
46
  var ToasterContext = (0, react_1.createContext)(undefined);
47
+ var shrink = (0, react_3.keyframes)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from { transform: scaleX(1); }\n to { transform: scaleX(0); }\n"], ["\n from { transform: scaleX(1); }\n to { transform: scaleX(0); }\n"])));
41
48
  function ToasterProvider(_a) {
49
+ var _b;
42
50
  var children = _a.children;
43
51
  var toast = (0, react_2.useToast)();
44
52
  var theme = (0, react_2.useTheme)();
53
+ var c = (_b = theme.colors) !== null && _b !== void 0 ? _b : {};
45
54
  var showToast = function (_a) {
46
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
47
- var title = _a.title, description = _a.description, _m = _a.status, status = _m === void 0 ? "info" : _m, _o = _a.duration, duration = _o === void 0 ? 5000 : _o, _p = _a.isClosable, isClosable = _p === void 0 ? true : _p, _q = _a.position, position = _q === void 0 ? "top-right" : _q, onClose = _a.onClose;
48
- var statusColors = {
55
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
56
+ var title = _a.title, description = _a.description, _t = _a.status, status = _t === void 0 ? "info" : _t, _u = _a.duration, duration = _u === void 0 ? 5000 : _u, _v = _a.isClosable, isClosable = _v === void 0 ? true : _v, _w = _a.position, position = _w === void 0 ? "top-right" : _w, onClose = _a.onClose;
57
+ // Status semantic color scale + icon (falls back to legacy palettes).
58
+ var statusConfig = {
49
59
  success: {
50
- bg: (_b = theme.colors.green) === null || _b === void 0 ? void 0 : _b[50],
51
- border: (_c = theme.colors.green) === null || _c === void 0 ? void 0 : _c[300],
60
+ scale: (_c = (_b = c.semantic) === null || _b === void 0 ? void 0 : _b.success) !== null && _c !== void 0 ? _c : c.green,
61
+ icon: react_1.default.createElement(lucide_react_1.CheckCircle2, { size: 18 }),
52
62
  },
53
63
  error: {
54
- bg: (_d = theme.colors.red) === null || _d === void 0 ? void 0 : _d[50],
55
- border: (_e = theme.colors.red) === null || _e === void 0 ? void 0 : _e[300],
64
+ scale: (_e = (_d = c.semantic) === null || _d === void 0 ? void 0 : _d.error) !== null && _e !== void 0 ? _e : c.red,
65
+ icon: react_1.default.createElement(lucide_react_1.XCircle, { size: 18 }),
56
66
  },
57
67
  warning: {
58
- bg: (_f = theme.colors.yellow) === null || _f === void 0 ? void 0 : _f[50],
59
- border: (_g = theme.colors.yellow) === null || _g === void 0 ? void 0 : _g[300],
68
+ scale: (_h = (_g = (_f = c.semantic) === null || _f === void 0 ? void 0 : _f.warning) !== null && _g !== void 0 ? _g : c.yellow) !== null && _h !== void 0 ? _h : c.orange,
69
+ icon: react_1.default.createElement(lucide_react_1.AlertTriangle, { size: 18 }),
60
70
  },
61
71
  info: {
62
- bg: (_h = theme.colors.blue) === null || _h === void 0 ? void 0 : _h[50],
63
- border: (_j = theme.colors.blue) === null || _j === void 0 ? void 0 : _j[300],
72
+ scale: (_k = (_j = c.semantic) === null || _j === void 0 ? void 0 : _j.info) !== null && _k !== void 0 ? _k : c.blue,
73
+ icon: react_1.default.createElement(lucide_react_1.Info, { size: 18 }),
64
74
  },
65
75
  loading: {
66
- bg: (_k = theme.colors.gray) === null || _k === void 0 ? void 0 : _k[50],
67
- border: (_l = theme.colors.gray) === null || _l === void 0 ? void 0 : _l[300],
76
+ scale: (_l = c.primary) !== null && _l !== void 0 ? _l : c.gray,
77
+ icon: react_1.default.createElement(react_2.Spinner, { size: "sm", thickness: "0.125rem", speed: "0.7s" }),
68
78
  },
69
79
  };
70
- var colors = statusColors[status];
80
+ var _x = (_m = statusConfig[status]) !== null && _m !== void 0 ? _m : statusConfig.info, scale = _x.scale, icon = _x.icon;
81
+ var solid = (_o = scale === null || scale === void 0 ? void 0 : scale[500]) !== null && _o !== void 0 ? _o : (_p = c.gray) === null || _p === void 0 ? void 0 : _p[500];
82
+ var soft = (_q = scale === null || scale === void 0 ? void 0 : scale[50]) !== null && _q !== void 0 ? _q : (_r = c.gray) === null || _r === void 0 ? void 0 : _r[50];
83
+ var accent = (_s = scale === null || scale === void 0 ? void 0 : scale[600]) !== null && _s !== void 0 ? _s : solid;
84
+ var showProgress = typeof duration === "number" && duration > 0;
71
85
  toast({
72
86
  duration: duration,
73
87
  isClosable: isClosable,
74
88
  position: position,
75
89
  onCloseComplete: onClose,
76
90
  render: function (_a) {
91
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
77
92
  var onClose = _a.onClose;
78
- return (react_1.default.createElement(react_2.Box, { bg: colors.bg, border: "0.063rem solid", borderColor: colors.border, boxShadow: "md", borderRadius: "md", p: 4, minW: "22.5rem" },
79
- react_1.default.createElement(react_2.Flex, { justify: "space-between", align: "flex-start" },
80
- react_1.default.createElement(react_2.Box, null,
81
- react_1.default.createElement(react_2.Text, { fontWeight: "semibold", mb: "0.25rem" }, title),
82
- react_1.default.createElement(react_2.Text, { fontSize: "sm" }, description)),
83
- isClosable && (react_1.default.createElement(react_2.CloseButton, { onClick: onClose, size: "sm", mt: 1, ml: 4 })))));
93
+ return (react_1.default.createElement(react_2.Box, { position: "relative", bg: (_b = c.white) !== null && _b !== void 0 ? _b : "#fff", border: "0.063rem solid ".concat((_d = (_c = c.boxborder) === null || _c === void 0 ? void 0 : _c[300]) !== null && _d !== void 0 ? _d : (_e = c.gray) === null || _e === void 0 ? void 0 : _e[200]), boxShadow: (_g = (_f = theme.shadows) === null || _f === void 0 ? void 0 : _f.lg) !== null && _g !== void 0 ? _g : "lg", borderRadius: "0.75rem", overflow: "hidden", minW: "22.5rem", maxW: "26rem" },
94
+ react_1.default.createElement(react_2.Flex, { p: 3.5, gap: 3, align: "center" },
95
+ react_1.default.createElement(react_2.Flex, { align: "center", justify: "center", boxSize: "2rem", minW: "2rem", borderRadius: "full", bg: soft, color: accent }, icon),
96
+ react_1.default.createElement(react_2.Box, { flex: "1", minW: 0 },
97
+ title && (react_1.default.createElement(react_2.Text, { fontWeight: 600, fontSize: "0.875rem", lineHeight: "1.3", color: (_j = (_h = c.text) === null || _h === void 0 ? void 0 : _h[800]) !== null && _j !== void 0 ? _j : (_k = c.gray) === null || _k === void 0 ? void 0 : _k[800] }, title)),
98
+ description && (react_1.default.createElement(react_2.Text, { fontSize: "0.8125rem", lineHeight: "1.45", color: (_m = (_l = c.gray) === null || _l === void 0 ? void 0 : _l[600]) !== null && _m !== void 0 ? _m : (_o = c.text) === null || _o === void 0 ? void 0 : _o[600], mt: title ? "0.125rem" : 0 }, description))),
99
+ isClosable && (react_1.default.createElement(react_2.CloseButton, { onClick: onClose, size: "sm", color: (_p = c.gray) === null || _p === void 0 ? void 0 : _p[500], borderRadius: "md", _hover: { bg: (_q = c.gray) === null || _q === void 0 ? void 0 : _q[100], color: (_r = c.gray) === null || _r === void 0 ? void 0 : _r[700] } }))),
100
+ showProgress && (react_1.default.createElement(react_2.Box, { position: "absolute", bottom: 0, left: 0, right: 0, h: "0.1875rem", bg: solid, transformOrigin: "left", sx: {
101
+ animation: "".concat(shrink, " ").concat(duration, "ms linear forwards"),
102
+ } }))));
84
103
  },
85
104
  });
86
105
  };
@@ -94,3 +113,4 @@ var useToaster = function () {
94
113
  return context;
95
114
  };
96
115
  exports.useToaster = useToaster;
116
+ var templateObject_1;
@@ -23,7 +23,12 @@ export type TableGroup = {
23
23
  label: string;
24
24
  rows: DataObject[];
25
25
  };
26
- /** Partition rows by a column key, preserving first-seen group order. */
26
+ /**
27
+ * Partition rows by a column, preserving first-seen group order. The group key is
28
+ * a normalized string so object/array values (e.g. a `user` field that is an object
29
+ * or an array of users) group together by their readable text instead of by object
30
+ * identity.
31
+ */
27
32
  export declare function groupRows(data: DataObject[], groupBy: string | number): TableGroup[];
28
33
  export declare const calculateLeftOffset: (columns: number[], index: number) => number;
29
34
  /**
@@ -137,14 +137,19 @@ function pickTableColor(value, palette, override) {
137
137
  return { solid: "#8B3FC8", soft: "#8B3FC822", text: "#8B3FC8" };
138
138
  return palette[hashKey(value) % palette.length];
139
139
  }
140
- /** Partition rows by a column key, preserving first-seen group order. */
140
+ /**
141
+ * Partition rows by a column, preserving first-seen group order. The group key is
142
+ * a normalized string so object/array values (e.g. a `user` field that is an object
143
+ * or an array of users) group together by their readable text instead of by object
144
+ * identity.
145
+ */
141
146
  function groupRows(data, groupBy) {
142
147
  var order = [];
143
148
  var map = new Map();
144
149
  for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
145
150
  var row = data_1[_i];
146
- var raw = row[groupBy];
147
- var key = raw === undefined || raw === null || raw === "" ? "—" : raw;
151
+ var text = getStringValue(row[groupBy]);
152
+ var key = text === "" ? "—" : text;
148
153
  if (!map.has(key)) {
149
154
  map.set(key, []);
150
155
  order.push(key);
@@ -170,21 +175,49 @@ var extractTextFromReactNode = function (node) {
170
175
  }
171
176
  return "";
172
177
  };
178
+ /** Best-effort readable text for an entity object (user/relation/option/etc.). */
179
+ var objectToText = function (o) {
180
+ var _a, _b;
181
+ if (typeof o.label === "string" || typeof o.label === "number")
182
+ return String(o.label);
183
+ if (typeof o.name === "string" || typeof o.name === "number")
184
+ return String(o.name);
185
+ var first = (_a = o.first_name) !== null && _a !== void 0 ? _a : o.firstName;
186
+ var last = (_b = o.last_name) !== null && _b !== void 0 ? _b : o.lastName;
187
+ if (typeof first === "string" || typeof last === "string") {
188
+ return "".concat(first !== null && first !== void 0 ? first : "", " ").concat(last !== null && last !== void 0 ? last : "").trim();
189
+ }
190
+ if (typeof o.full_name === "string")
191
+ return o.full_name;
192
+ if (typeof o.title === "string")
193
+ return o.title;
194
+ if (typeof o.company_name === "string")
195
+ return o.company_name;
196
+ if (typeof o.email === "string")
197
+ return o.email;
198
+ if (typeof o.value === "string" || typeof o.value === "number")
199
+ return String(o.value);
200
+ return "";
201
+ };
202
+ /**
203
+ * Readable string for any cell value. Handles primitives, React elements, entity
204
+ * objects (e.g. `user`: `{ name }` / `{ first_name, last_name }`), and arrays of
205
+ * any of those (e.g. a multi-user field) by joining their texts.
206
+ */
173
207
  var getStringValue = function (value) {
174
- if (typeof value === "string" || typeof value === "number") {
208
+ if (value === null || value === undefined)
209
+ return "";
210
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
175
211
  return String(value);
176
212
  }
177
213
  if (react_1.default.isValidElement(value)) {
178
214
  return extractTextFromReactNode(value);
179
215
  }
180
- if (value && typeof value === "object") {
181
- var o = value;
182
- if (typeof o.label === "string" || typeof o.label === "number") {
183
- return String(o.label);
184
- }
185
- if (typeof o.name === "string" || typeof o.name === "number") {
186
- return String(o.name);
187
- }
216
+ if (Array.isArray(value)) {
217
+ return value.map(getStringValue).filter(function (s) { return s !== ""; }).join(", ");
218
+ }
219
+ if (typeof value === "object") {
220
+ return objectToText(value);
188
221
  }
189
222
  return "";
190
223
  };
@@ -203,21 +236,8 @@ function normalizeTableCellValue(value) {
203
236
  if (react_1.default.isValidElement(value)) {
204
237
  return value;
205
238
  }
206
- if (typeof value === "object") {
207
- var o = value;
208
- if (typeof o.label === "string" || typeof o.label === "number") {
209
- return String(o.label);
210
- }
211
- if (typeof o.name === "string" || typeof o.name === "number") {
212
- return String(o.name);
213
- }
214
- if (typeof o.title === "string")
215
- return o.title;
216
- if (typeof o.company_name === "string")
217
- return o.company_name;
218
- return "";
219
- }
220
- return String(value);
239
+ // Objects (relation/user) and arrays (multi-user / multi-select) → readable text.
240
+ return getStringValue(value);
221
241
  }
222
242
  var searchAndSortData = function (data, searchValues) {
223
243
  var filteredData = data.filter(function (item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.3.1-beta.1",
3
+ "version": "2.3.1-beta.10",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/dist/App.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import "./global.css";
3
- declare function App(): React.JSX.Element;
4
- export default App;