@customafk/lunas-ui 0.0.25 → 0.0.27

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 (364) hide show
  1. package/dist/{alert-dialog-D-oR0YW3.cjs → alert-dialog-26JyobJb.cjs} +1 -1
  2. package/dist/{alert-dialog-D-oR0YW3.cjs.map → alert-dialog-26JyobJb.cjs.map} +1 -1
  3. package/dist/{alert-dialog-CNHyP_A9.js → alert-dialog-Dv0cgymS.js} +1 -1
  4. package/dist/{alert-dialog-CNHyP_A9.js.map → alert-dialog-Dv0cgymS.js.map} +1 -1
  5. package/dist/{button-BmBtMriU.d.ts → button-CPBLm_02.d.ts} +5 -5
  6. package/dist/{button-tCnJHt8O.d.cts → button-ghXW1WTr.d.cts} +5 -5
  7. package/dist/{calendar-CbuOOMpK.js → calendar-B66UT_fu.js} +1 -1
  8. package/dist/{calendar-CbuOOMpK.js.map → calendar-B66UT_fu.js.map} +1 -1
  9. package/dist/{calendar-B8IKzrdN.cjs → calendar-DXegnGRJ.cjs} +1 -1
  10. package/dist/{calendar-B8IKzrdN.cjs.map → calendar-DXegnGRJ.cjs.map} +1 -1
  11. package/dist/{command-Dr2XmKV6.d.cts → command-CE_Qcgo7.d.ts} +12 -12
  12. package/dist/{command-Dvq-HZwH.d.ts → command-CiEjoEnP.d.cts} +12 -12
  13. package/dist/{command-TFZwJmux.js → command-Dbkg10QA.js} +2 -2
  14. package/dist/{command-TFZwJmux.js.map → command-Dbkg10QA.js.map} +1 -1
  15. package/dist/{command-CoB5R5FI.cjs → command-IL3ogESu.cjs} +2 -2
  16. package/dist/{command-CoB5R5FI.cjs.map → command-IL3ogESu.cjs.map} +1 -1
  17. package/dist/data-display/empty.d.cts +2 -2
  18. package/dist/data-display/statistic.d.cts +2 -2
  19. package/dist/data-display/statistic.d.ts +2 -2
  20. package/dist/{dialog-CSDDiHKO.js → dialog-BEdMA5Lp.js} +1 -1
  21. package/dist/{dialog-CSDDiHKO.js.map → dialog-BEdMA5Lp.js.map} +1 -1
  22. package/dist/{dialog-C-DYoapJ.d.ts → dialog-Bw_T5aco.d.cts} +12 -12
  23. package/dist/{dialog-_Cgij9NP.cjs → dialog-C4oHnJNN.cjs} +1 -1
  24. package/dist/{dialog-_Cgij9NP.cjs.map → dialog-C4oHnJNN.cjs.map} +1 -1
  25. package/dist/{dialog-CA0E_tNX.d.cts → dialog-CoH1pTBH.d.ts} +12 -12
  26. package/dist/dialogs/confirm-dialog.cjs +1 -1
  27. package/dist/dialogs/confirm-dialog.js +1 -1
  28. package/dist/dialogs/detail-dialog/component/sidebar.d.cts +4 -4
  29. package/dist/dialogs/detail-dialog/component/sidebar.d.ts +28 -28
  30. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  31. package/dist/dialogs/detail-dialog/index.js +1 -1
  32. package/dist/dialogs/error-dialog.cjs +1 -1
  33. package/dist/dialogs/error-dialog.js +1 -1
  34. package/dist/dialogs/form-dialog.cjs +1 -1
  35. package/dist/dialogs/form-dialog.d.cts +2 -2
  36. package/dist/dialogs/form-dialog.d.ts +2 -2
  37. package/dist/dialogs/form-dialog.js +1 -1
  38. package/dist/dialogs/loading-dialog.cjs +1 -1
  39. package/dist/dialogs/loading-dialog.js +1 -1
  40. package/dist/{error-dialog-D5R5le-W.cjs → error-dialog-C0PDn-pj.cjs} +2 -2
  41. package/dist/{error-dialog-D5R5le-W.cjs.map → error-dialog-C0PDn-pj.cjs.map} +1 -1
  42. package/dist/{error-dialog-Q99thrSD.js → error-dialog-CCdQ8zbQ.js} +2 -2
  43. package/dist/{error-dialog-Q99thrSD.js.map → error-dialog-CCdQ8zbQ.js.map} +1 -1
  44. package/dist/{form-wrapper-CY-stRaQ.cjs → form-wrapper-Cd8c5MIL.cjs} +2 -2
  45. package/dist/{form-wrapper-CY-stRaQ.cjs.map → form-wrapper-Cd8c5MIL.cjs.map} +1 -1
  46. package/dist/{form-wrapper-C2xlvWx0.js → form-wrapper-DntbFqN1.js} +2 -2
  47. package/dist/{form-wrapper-C2xlvWx0.js.map → form-wrapper-DntbFqN1.js.map} +1 -1
  48. package/dist/forms/combobox-field.cjs +1 -1
  49. package/dist/forms/combobox-field.d.cts +2 -2
  50. package/dist/forms/combobox-field.d.ts +2 -2
  51. package/dist/forms/combobox-field.js +1 -1
  52. package/dist/forms/date-field.cjs +1 -1
  53. package/dist/forms/date-field.d.cts +2 -2
  54. package/dist/forms/date-field.d.ts +2 -2
  55. package/dist/forms/date-field.js +1 -1
  56. package/dist/forms/form-wrapper.cjs +1 -1
  57. package/dist/forms/form-wrapper.d.cts +2 -2
  58. package/dist/forms/form-wrapper.d.ts +2 -2
  59. package/dist/forms/form-wrapper.js +1 -1
  60. package/dist/forms/multi-select-field.cjs +1 -1
  61. package/dist/forms/multi-select-field.cjs.map +1 -1
  62. package/dist/forms/multi-select-field.d.cts +2 -2
  63. package/dist/forms/multi-select-field.d.ts +2 -2
  64. package/dist/forms/multi-select-field.js +1 -1
  65. package/dist/forms/number-field.d.cts +2 -2
  66. package/dist/forms/number-field.d.ts +2 -2
  67. package/dist/forms/password-field.d.cts +2 -2
  68. package/dist/forms/password-field.d.ts +2 -2
  69. package/dist/forms/select-field.d.cts +2 -2
  70. package/dist/forms/select-field.d.ts +2 -2
  71. package/dist/forms/switch-field.d.cts +2 -2
  72. package/dist/forms/switch-field.d.ts +2 -2
  73. package/dist/forms/text-field.d.cts +2 -2
  74. package/dist/forms/text-field.d.ts +2 -2
  75. package/dist/forms/textarea-field.d.cts +2 -2
  76. package/dist/forms/textarea-field.d.ts +2 -2
  77. package/dist/{input-CjNcnHb_.d.ts → input-CUDclgoU.d.ts} +3 -3
  78. package/dist/{input-BsXm0_Iq.d.cts → input-y_n-XGys.d.cts} +3 -3
  79. package/dist/layouts/app-layout/index.d.cts +5 -5
  80. package/dist/layouts/app-layout/index.d.ts +3 -3
  81. package/dist/layouts/flex.d.cts +4 -4
  82. package/dist/layouts/flex.d.ts +4 -4
  83. package/dist/layouts/main/index.d.cts +4 -4
  84. package/dist/layouts/main/index.d.ts +4 -4
  85. package/dist/{multi-select-Cjvm4tK5.cjs → multi-select-3yxD9gbY.cjs} +2 -2
  86. package/dist/{multi-select-Cjvm4tK5.cjs.map → multi-select-3yxD9gbY.cjs.map} +1 -1
  87. package/dist/{multi-select-D0bZVOnm.js → multi-select-Cb07NlA7.js} +2 -2
  88. package/dist/{multi-select-D0bZVOnm.js.map → multi-select-Cb07NlA7.js.map} +1 -1
  89. package/dist/{popover-CTFp7ZXi.js → popover-CqAD7HNo.js} +1 -1
  90. package/dist/{popover-CTFp7ZXi.js.map → popover-CqAD7HNo.js.map} +1 -1
  91. package/dist/{popover-DCcPvdz2.cjs → popover-Dd0acCEk.cjs} +1 -1
  92. package/dist/{popover-DCcPvdz2.cjs.map → popover-Dd0acCEk.cjs.map} +1 -1
  93. package/dist/{separator-5FdzRGaJ.d.ts → separator-BLYi41aC.d.ts} +3 -3
  94. package/dist/{separator-DpxrpK_H.d.cts → separator-ClGBPiYE.d.cts} +3 -3
  95. package/dist/table/index.d.cts +2 -2
  96. package/dist/table/index.d.ts +2 -2
  97. package/dist/{toggle-Cx9H5u3p.d.cts → toggle-BWQWsKMA.d.ts} +4 -4
  98. package/dist/{toggle-DH9IssyE.d.ts → toggle-DnGvFJh8.d.cts} +4 -4
  99. package/dist/{tooltip-Djh_dcy5.d.ts → tooltip-Bk8VwHdM.d.ts} +6 -6
  100. package/dist/{tooltip-BAtWdJyX.d.cts → tooltip-cisSpCHG.d.cts} +6 -6
  101. package/dist/typography/paragraph.d.cts +2 -2
  102. package/dist/typography/paragraph.d.ts +2 -2
  103. package/dist/typography/title.d.cts +2 -2
  104. package/dist/typography/title.d.ts +2 -2
  105. package/dist/ui/alert-dialog.cjs +1 -1
  106. package/dist/ui/alert-dialog.d.cts +12 -12
  107. package/dist/ui/alert-dialog.d.ts +12 -12
  108. package/dist/ui/alert-dialog.js +1 -1
  109. package/dist/ui/alert.d.cts +6 -6
  110. package/dist/ui/alert.d.ts +6 -6
  111. package/dist/ui/aspect-ratio.d.cts +2 -2
  112. package/dist/ui/aspect-ratio.d.ts +2 -2
  113. package/dist/ui/avatar.d.cts +4 -4
  114. package/dist/ui/avatar.d.ts +4 -4
  115. package/dist/ui/badge.d.cts +2 -2
  116. package/dist/ui/badge.d.ts +4 -4
  117. package/dist/ui/breadcrumb.d.cts +8 -8
  118. package/dist/ui/breadcrumb.d.ts +8 -8
  119. package/dist/ui/button.d.cts +1 -1
  120. package/dist/ui/button.d.ts +1 -1
  121. package/dist/ui/calendar.cjs +1 -1
  122. package/dist/ui/calendar.d.cts +4 -4
  123. package/dist/ui/calendar.d.ts +4 -4
  124. package/dist/ui/calendar.js +1 -1
  125. package/dist/ui/card.d.cts +8 -8
  126. package/dist/ui/card.d.ts +8 -8
  127. package/dist/ui/carousel.d.cts +7 -7
  128. package/dist/ui/carousel.d.ts +7 -7
  129. package/dist/ui/collapsible.d.cts +4 -4
  130. package/dist/ui/collapsible.d.ts +4 -4
  131. package/dist/ui/command.cjs +1 -1
  132. package/dist/ui/command.d.cts +2 -2
  133. package/dist/ui/command.d.ts +2 -2
  134. package/dist/ui/command.js +1 -1
  135. package/dist/ui/context-menu.d.cts +16 -16
  136. package/dist/ui/context-menu.d.ts +16 -16
  137. package/dist/ui/dialog.cjs +1 -1
  138. package/dist/ui/dialog.d.cts +1 -1
  139. package/dist/ui/dialog.d.ts +1 -1
  140. package/dist/ui/dialog.js +1 -1
  141. package/dist/ui/dropdown-menu.d.cts +16 -16
  142. package/dist/ui/dropdown-menu.d.ts +16 -16
  143. package/dist/ui/file-uploader.d.cts +2 -2
  144. package/dist/ui/file-uploader.d.ts +2 -2
  145. package/dist/ui/form.d.cts +7 -7
  146. package/dist/ui/form.d.ts +7 -7
  147. package/dist/ui/hover-card.d.cts +4 -4
  148. package/dist/ui/hover-card.d.ts +4 -4
  149. package/dist/ui/input-otp.d.cts +5 -5
  150. package/dist/ui/input-otp.d.ts +5 -5
  151. package/dist/ui/input.d.cts +1 -1
  152. package/dist/ui/input.d.ts +1 -1
  153. package/dist/ui/inputs/search-input.d.cts +1 -1
  154. package/dist/ui/inputs/search-input.d.ts +3 -3
  155. package/dist/ui/label.d.cts +2 -2
  156. package/dist/ui/label.d.ts +2 -2
  157. package/dist/ui/menubar.d.cts +17 -17
  158. package/dist/ui/menubar.d.ts +17 -17
  159. package/dist/ui/multi-select.cjs +1 -1
  160. package/dist/ui/multi-select.d.cts +2 -2
  161. package/dist/ui/multi-select.d.ts +2 -2
  162. package/dist/ui/multi-select.js +1 -1
  163. package/dist/ui/navigation-menu.d.cts +11 -11
  164. package/dist/ui/navigation-menu.d.ts +9 -9
  165. package/dist/ui/pagination.d.cts +9 -9
  166. package/dist/ui/pagination.d.ts +9 -9
  167. package/dist/ui/popover.cjs +1 -1
  168. package/dist/ui/popover.d.cts +5 -5
  169. package/dist/ui/popover.d.ts +5 -5
  170. package/dist/ui/popover.js +1 -1
  171. package/dist/ui/progress.d.cts +2 -2
  172. package/dist/ui/progress.d.ts +2 -2
  173. package/dist/ui/radio-group.d.cts +3 -3
  174. package/dist/ui/radio-group.d.ts +3 -3
  175. package/dist/ui/resizable.d.cts +4 -4
  176. package/dist/ui/resizable.d.ts +4 -4
  177. package/dist/ui/scroll-area.d.ts +3 -3
  178. package/dist/ui/select.d.cts +11 -11
  179. package/dist/ui/select.d.ts +11 -11
  180. package/dist/ui/separator.d.cts +1 -1
  181. package/dist/ui/separator.d.ts +1 -1
  182. package/dist/ui/sheet.d.cts +9 -9
  183. package/dist/ui/sheet.d.ts +9 -9
  184. package/dist/ui/sidebar.d.cts +30 -30
  185. package/dist/ui/sidebar.d.ts +30 -30
  186. package/dist/ui/skeleton.d.cts +2 -2
  187. package/dist/ui/skeleton.d.ts +2 -2
  188. package/dist/ui/slider.d.cts +2 -2
  189. package/dist/ui/slider.d.ts +2 -2
  190. package/dist/ui/sonner.d.cts +2 -2
  191. package/dist/ui/sonner.d.ts +2 -2
  192. package/dist/ui/switch.d.cts +2 -2
  193. package/dist/ui/switch.d.ts +2 -2
  194. package/dist/ui/table.d.cts +9 -9
  195. package/dist/ui/table.d.ts +9 -9
  196. package/dist/ui/tabs.d.cts +5 -5
  197. package/dist/ui/tabs.d.ts +5 -5
  198. package/dist/ui/textarea.d.cts +2 -2
  199. package/dist/ui/textarea.d.ts +2 -2
  200. package/dist/ui/toggle-group.d.cts +4 -4
  201. package/dist/ui/toggle-group.d.ts +4 -4
  202. package/dist/ui/toggle.d.cts +1 -1
  203. package/dist/ui/toggle.d.ts +1 -1
  204. package/dist/ui/tooltip.d.cts +1 -1
  205. package/dist/ui/tooltip.d.ts +1 -1
  206. package/package.json +2 -2
  207. package/styles/base.css +29 -0
  208. package/styles/loader.css +113 -0
  209. package/styles/theme.css +104 -0
  210. package/styles/typography.css +6 -0
  211. package/packages/components/cards/simple-card.tsx +0 -23
  212. package/packages/components/data-display/country.tsx +0 -53
  213. package/packages/components/data-display/data-list.tsx +0 -29
  214. package/packages/components/data-display/date-tooltip.tsx +0 -23
  215. package/packages/components/data-display/date.tsx +0 -157
  216. package/packages/components/data-display/empty.tsx +0 -13
  217. package/packages/components/data-display/name.tsx +0 -23
  218. package/packages/components/data-display/phone-number.tsx +0 -14
  219. package/packages/components/data-display/role-badge.tsx +0 -29
  220. package/packages/components/data-display/statistic.tsx +0 -139
  221. package/packages/components/dialogs/confirm-dialog.tsx +0 -44
  222. package/packages/components/dialogs/detail-dialog/component/header.tsx +0 -10
  223. package/packages/components/dialogs/detail-dialog/component/main.tsx +0 -35
  224. package/packages/components/dialogs/detail-dialog/component/sidebar.tsx +0 -618
  225. package/packages/components/dialogs/detail-dialog/component/wrapper.tsx +0 -15
  226. package/packages/components/dialogs/detail-dialog/index.tsx +0 -91
  227. package/packages/components/dialogs/error-dialog.tsx +0 -34
  228. package/packages/components/dialogs/form-dialog.tsx +0 -74
  229. package/packages/components/dialogs/loading-dialog.tsx +0 -20
  230. package/packages/components/forms/combobox-field.tsx +0 -104
  231. package/packages/components/forms/date-field.tsx +0 -62
  232. package/packages/components/forms/form-wrapper.tsx +0 -120
  233. package/packages/components/forms/multi-select-field.tsx +0 -56
  234. package/packages/components/forms/number-field.tsx +0 -54
  235. package/packages/components/forms/password-field.tsx +0 -38
  236. package/packages/components/forms/select-field.tsx +0 -58
  237. package/packages/components/forms/switch-field.tsx +0 -40
  238. package/packages/components/forms/text-field.tsx +0 -73
  239. package/packages/components/forms/textarea-field.tsx +0 -45
  240. package/packages/components/index.tsx +0 -0
  241. package/packages/components/layouts/app-layout/index.tsx +0 -74
  242. package/packages/components/layouts/app-layout/sidebar.tsx +0 -663
  243. package/packages/components/layouts/flex.tsx +0 -99
  244. package/packages/components/layouts/main/content.tsx +0 -11
  245. package/packages/components/layouts/main/header.tsx +0 -41
  246. package/packages/components/layouts/main/index.tsx +0 -3
  247. package/packages/components/layouts/main/wrapper.tsx +0 -5
  248. package/packages/components/table/data-table-pagination.tsx +0 -70
  249. package/packages/components/table/data-table.tsx +0 -241
  250. package/packages/components/table/index.tsx +0 -107
  251. package/packages/components/typography/paragraph.tsx +0 -29
  252. package/packages/components/typography/title.tsx +0 -31
  253. package/packages/components/ui/alert-dialog.tsx +0 -99
  254. package/packages/components/ui/alert.tsx +0 -44
  255. package/packages/components/ui/aspect-ratio.tsx +0 -11
  256. package/packages/components/ui/avatar.tsx +0 -25
  257. package/packages/components/ui/badge.tsx +0 -57
  258. package/packages/components/ui/breadcrumb.tsx +0 -74
  259. package/packages/components/ui/button.tsx +0 -205
  260. package/packages/components/ui/buttons/add-new.tsx +0 -19
  261. package/packages/components/ui/buttons/edit.tsx +0 -14
  262. package/packages/components/ui/buttons/refresh.tsx +0 -19
  263. package/packages/components/ui/buttons/trash.tsx +0 -14
  264. package/packages/components/ui/buttons/upload-image.tsx +0 -25
  265. package/packages/components/ui/calendar.tsx +0 -141
  266. package/packages/components/ui/card.tsx +0 -44
  267. package/packages/components/ui/carousel.tsx +0 -187
  268. package/packages/components/ui/checkbox.tsx +0 -34
  269. package/packages/components/ui/collapsible.tsx +0 -17
  270. package/packages/components/ui/command.tsx +0 -138
  271. package/packages/components/ui/context-menu.tsx +0 -196
  272. package/packages/components/ui/dialog.tsx +0 -119
  273. package/packages/components/ui/dropdown-menu.tsx +0 -249
  274. package/packages/components/ui/file-uploader.tsx +0 -314
  275. package/packages/components/ui/form.tsx +0 -104
  276. package/packages/components/ui/hover-card.tsx +0 -32
  277. package/packages/components/ui/input-otp.tsx +0 -67
  278. package/packages/components/ui/input.tsx +0 -59
  279. package/packages/components/ui/inputs/number-input.tsx +0 -317
  280. package/packages/components/ui/inputs/password-input.tsx +0 -29
  281. package/packages/components/ui/inputs/search-input.tsx +0 -24
  282. package/packages/components/ui/label.tsx +0 -26
  283. package/packages/components/ui/menubar.tsx +0 -212
  284. package/packages/components/ui/multi-select.tsx +0 -626
  285. package/packages/components/ui/navigation-menu.tsx +0 -124
  286. package/packages/components/ui/pagination.tsx +0 -70
  287. package/packages/components/ui/popover.tsx +0 -49
  288. package/packages/components/ui/progress.tsx +0 -19
  289. package/packages/components/ui/radio-group.tsx +0 -36
  290. package/packages/components/ui/resizable.tsx +0 -47
  291. package/packages/components/ui/scroll-area.tsx +0 -35
  292. package/packages/components/ui/select.tsx +0 -199
  293. package/packages/components/ui/separator.tsx +0 -25
  294. package/packages/components/ui/sheet.tsx +0 -119
  295. package/packages/components/ui/sidebar.tsx +0 -675
  296. package/packages/components/ui/skeleton.tsx +0 -8
  297. package/packages/components/ui/slider.tsx +0 -45
  298. package/packages/components/ui/sonner.tsx +0 -40
  299. package/packages/components/ui/switch.tsx +0 -46
  300. package/packages/components/ui/table.tsx +0 -66
  301. package/packages/components/ui/tabs.tsx +0 -53
  302. package/packages/components/ui/textarea.tsx +0 -46
  303. package/packages/components/ui/toggle-group.tsx +0 -63
  304. package/packages/components/ui/toggle.tsx +0 -34
  305. package/packages/components/ui/tooltip.tsx +0 -53
  306. package/packages/constants.tsx +0 -45
  307. package/packages/hooks/use-callback-ref.ts +0 -22
  308. package/packages/hooks/use-controllable-state.ts +0 -58
  309. package/packages/hooks/use-mobile.ts +0 -19
  310. package/packages/index.css +0 -133
  311. package/packages/lib/utils.ts +0 -24
  312. package/packages/stories/1.Guideline.mdx +0 -3
  313. package/packages/stories/2.Colors.mdx +0 -145
  314. package/packages/stories/3.Pypography.mdx +0 -51
  315. package/packages/stories/cards/simple-card.stories.tsx +0 -24
  316. package/packages/stories/data-display/data-list.stories.tsx +0 -22
  317. package/packages/stories/data-display/empty.stories.tsx +0 -13
  318. package/packages/stories/data-display/form-dialog.stories.tsx +0 -27
  319. package/packages/stories/data-display/name.stories.tsx +0 -25
  320. package/packages/stories/data-display/phone-number.stories.tsx +0 -17
  321. package/packages/stories/data-display/statistic.stories.tsx +0 -41
  322. package/packages/stories/dialogs/confirm-dialog.stories.tsx +0 -26
  323. package/packages/stories/dialogs/detail-dialog.stories.tsx +0 -34
  324. package/packages/stories/dialogs/error-dialog.stories.tsx +0 -27
  325. package/packages/stories/dialogs/loading-dialog.stories.tsx +0 -16
  326. package/packages/stories/forms/combobox-field.stories.tsx +0 -38
  327. package/packages/stories/forms/form-wrapper.stories.tsx +0 -59
  328. package/packages/stories/forms/multi-select-field.stories.tsx +0 -42
  329. package/packages/stories/forms/number-field.stories.tsx +0 -35
  330. package/packages/stories/forms/select-field.stories.tsx +0 -39
  331. package/packages/stories/forms/switch-field.stories.tsx +0 -36
  332. package/packages/stories/forms/text-field.stories.tsx +0 -41
  333. package/packages/stories/forms/textarea-field.stories.tsx +0 -34
  334. package/packages/stories/layouts/app-layout.stories.tsx +0 -49
  335. package/packages/stories/typography/paragraph.stories.tsx +0 -45
  336. package/packages/stories/typography/title.stories.tsx +0 -39
  337. package/packages/stories/ui/alert-dialog.stories.tsx +0 -49
  338. package/packages/stories/ui/alert.stories.tsx +0 -63
  339. package/packages/stories/ui/aspect-ratio.stories.tsx +0 -22
  340. package/packages/stories/ui/badge.stories.tsx +0 -170
  341. package/packages/stories/ui/breadcrumb.stories.tsx +0 -172
  342. package/packages/stories/ui/button.stories.tsx +0 -181
  343. package/packages/stories/ui/card.stories.tsx +0 -58
  344. package/packages/stories/ui/checkbox.stories.tsx +0 -48
  345. package/packages/stories/ui/command.stories.tsx +0 -58
  346. package/packages/stories/ui/dialog.stories.tsx +0 -55
  347. package/packages/stories/ui/dropdown-menu.stories.tsx +0 -89
  348. package/packages/stories/ui/file-uploader.stories.tsx +0 -18
  349. package/packages/stories/ui/input.stories.tsx +0 -38
  350. package/packages/stories/ui/label.stories.tsx +0 -17
  351. package/packages/stories/ui/multi-select.stories.tsx +0 -29
  352. package/packages/stories/ui/popover.stories.tsx +0 -52
  353. package/packages/stories/ui/progress.stories.tsx +0 -17
  354. package/packages/stories/ui/radio-group.stories.tsx +0 -31
  355. package/packages/stories/ui/select.stories.tsx +0 -31
  356. package/packages/stories/ui/separator.stories.tsx +0 -31
  357. package/packages/stories/ui/sheet.stories.tsx +0 -50
  358. package/packages/stories/ui/skeleton.stories.tsx +0 -27
  359. package/packages/stories/ui/switch.stories.tsx +0 -21
  360. package/packages/stories/ui/table.stories.tsx +0 -82
  361. package/packages/stories/ui/tabs.stories.tsx +0 -70
  362. package/packages/stories/ui/textarea.stories.tsx +0 -15
  363. package/packages/stories/ui/toaster.stories.tsx +0 -87
  364. package/packages/types.ts +0 -50
@@ -1,5 +1,5 @@
1
- import { toggleVariants } from "../toggle-Cx9H5u3p.cjs";
2
- import * as react_jsx_runtime168 from "react/jsx-runtime";
1
+ import { toggleVariants } from "../toggle-DnGvFJh8.cjs";
2
+ import * as react_jsx_runtime210 from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import { ToggleGroup as ToggleGroup$1 } from "radix-ui";
@@ -11,14 +11,14 @@ declare function ToggleGroup({
11
11
  size,
12
12
  children,
13
13
  ...props
14
- }: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime168.JSX.Element;
14
+ }: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime210.JSX.Element;
15
15
  declare function ToggleGroupItem({
16
16
  className,
17
17
  children,
18
18
  variant,
19
19
  size,
20
20
  ...props
21
- }: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime168.JSX.Element;
21
+ }: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime210.JSX.Element;
22
22
  //#endregion
23
23
  export { ToggleGroup, ToggleGroupItem };
24
24
  //# sourceMappingURL=toggle-group.d.cts.map
@@ -1,6 +1,6 @@
1
- import { toggleVariants } from "../toggle-DH9IssyE.js";
1
+ import { toggleVariants } from "../toggle-BWQWsKMA.js";
2
2
  import React from "react";
3
- import * as react_jsx_runtime232 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime206 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import { ToggleGroup as ToggleGroup$1 } from "radix-ui";
6
6
 
@@ -11,14 +11,14 @@ declare function ToggleGroup({
11
11
  size,
12
12
  children,
13
13
  ...props
14
- }: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime232.JSX.Element;
14
+ }: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime206.JSX.Element;
15
15
  declare function ToggleGroupItem({
16
16
  className,
17
17
  children,
18
18
  variant,
19
19
  size,
20
20
  ...props
21
- }: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime232.JSX.Element;
21
+ }: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime206.JSX.Element;
22
22
  //#endregion
23
23
  export { ToggleGroup, ToggleGroupItem };
24
24
  //# sourceMappingURL=toggle-group.d.ts.map
@@ -1,2 +1,2 @@
1
- import { Toggle, toggleVariants } from "../toggle-Cx9H5u3p.cjs";
1
+ import { Toggle, toggleVariants } from "../toggle-DnGvFJh8.cjs";
2
2
  export { Toggle, toggleVariants };
@@ -1,2 +1,2 @@
1
- import { Toggle, toggleVariants } from "../toggle-DH9IssyE.js";
1
+ import { Toggle, toggleVariants } from "../toggle-BWQWsKMA.js";
2
2
  export { Toggle, toggleVariants };
@@ -1,2 +1,2 @@
1
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../tooltip-BAtWdJyX.cjs";
1
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../tooltip-cisSpCHG.cjs";
2
2
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -1,2 +1,2 @@
1
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../tooltip-Djh_dcy5.js";
1
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../tooltip-Bk8VwHdM.js";
2
2
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@customafk/lunas-ui",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "UI library for Lunas Enterprise",
5
5
  "type": "module",
6
6
  "author": {
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
- "packages",
18
+ "styles",
19
19
  "README.md"
20
20
  ],
21
21
  "workspaces": [
@@ -0,0 +1,29 @@
1
+ :root {
2
+ body {
3
+ margin: 0;
4
+ min-width: 320px;
5
+ min-height: 100vh;
6
+
7
+ font-synthesis: none;
8
+ font-synthesis-weight: none;
9
+ text-rendering: optimizeLegibility;
10
+
11
+ letter-spacing: -0.015625rem;
12
+ overflow-wrap: break-word;
13
+ hyphens: auto;
14
+
15
+ -webkit-font-smoothing: antialiased;
16
+ -moz-osx-font-smoothing: grayscale;
17
+ }
18
+ /* Custom scrollbar styling. Thanks @pranathiperii. */
19
+ ::-webkit-scrollbar {
20
+ width: 0.375rem;
21
+ }
22
+ ::-webkit-scrollbar-track {
23
+ background: transparent;
24
+ }
25
+ ::-webkit-scrollbar-thumb {
26
+ background: var(--border);
27
+ border-radius: 0.375rem;
28
+ }
29
+ }
@@ -0,0 +1,113 @@
1
+ :root {
2
+ /* Loader styles */
3
+ /* HTML: <div class="loader"></div> */
4
+ .loader {
5
+ width: 50px;
6
+ aspect-ratio: 1;
7
+ display: grid;
8
+ border: var(--border) solid;
9
+ border-radius: 50%;
10
+ border-right-color: var(--primary);
11
+ animation: l15 1s infinite linear;
12
+ }
13
+ .loader::before,
14
+ .loader::after {
15
+ content: '';
16
+ grid-area: 1/1;
17
+ margin: 2px;
18
+ border: inherit;
19
+ border-radius: 50%;
20
+ animation: l15 2s infinite;
21
+ }
22
+ .loader::after {
23
+ margin: 8px;
24
+ animation-duration: 3s;
25
+ }
26
+ @keyframes l15 {
27
+ 100% {
28
+ transform: rotate(1turn);
29
+ }
30
+ }
31
+
32
+ /* HTML: <div class="loader-dots"></div> */
33
+ .loader-dots {
34
+ width: 8px;
35
+ aspect-ratio: 1;
36
+ border-radius: 50%;
37
+ animation: l5 1s infinite linear alternate;
38
+ }
39
+ @keyframes l5 {
40
+ 0% {
41
+ box-shadow:
42
+ 10px 0 var(--primary-foreground),
43
+ -10px 0 #0002;
44
+ background: var(--primary-foreground);
45
+ }
46
+ 33% {
47
+ box-shadow:
48
+ 10px 0 var(--primary-foreground),
49
+ -10px 0 #0002;
50
+ background: #0002;
51
+ }
52
+ 66% {
53
+ box-shadow:
54
+ 10px 0 #0002,
55
+ -10px 0 var(--primary-foreground);
56
+ background: #0002;
57
+ }
58
+ 100% {
59
+ box-shadow:
60
+ 10px 0 #0002,
61
+ -10px 0 var(--primary-foreground);
62
+ background: var(--primary-foreground);
63
+ }
64
+ }
65
+
66
+ /* HTML: <div class="loader-spinner"></div> */
67
+ .loader-spinner {
68
+ width: 16px;
69
+ aspect-ratio: 1;
70
+ border-radius: 50%;
71
+ border: 2.5px solid var(--primary-foreground);
72
+ animation:
73
+ l20-1 0.8s infinite linear alternate,
74
+ l20-2 1.6s infinite linear;
75
+ }
76
+ @keyframes l20-1 {
77
+ 0% {
78
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
79
+ }
80
+ 12.5% {
81
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
82
+ }
83
+ 25% {
84
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%);
85
+ }
86
+ 50% {
87
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
88
+ }
89
+ 62.5% {
90
+ clip-path: polygon(50% 50%, 100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
91
+ }
92
+ 75% {
93
+ clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0% 100%);
94
+ }
95
+ 100% {
96
+ clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100%);
97
+ }
98
+ }
99
+ @keyframes l20-2 {
100
+ 0% {
101
+ transform: scaleY(1) rotate(0deg);
102
+ }
103
+ 49.99% {
104
+ transform: scaleY(1) rotate(135deg);
105
+ }
106
+ 50% {
107
+ transform: scaleY(-1) rotate(0deg);
108
+ }
109
+ 100% {
110
+ transform: scaleY(-1) rotate(-135deg);
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,104 @@
1
+ :root {
2
+ /* Color Palette */
3
+ --background: #ffffff; /* --color-zinc-50 */
4
+ --foreground: oklch(14% 0 0); /* --color-zinc-950 */
5
+
6
+ --card: #ffffff; /* --color-zinc-50 */
7
+ --card-foreground: oklch(14% 0 286); /* --color-zinc-950 */
8
+
9
+ --popover: #ffffff; /* --color-zinc-50 */
10
+ --popover-foreground: oklch(14% 0 286); /* --color-zinc-950 */
11
+
12
+ --primary: oklch(0.61 0.22 293); /* --color-violet-500 */
13
+ --primary-muted: oklch(0.94 0.03 295); /* --color-violte-100 */
14
+ --primary-weak: oklch(0.81 0.1 294); /* --color-violet-300 */
15
+ --primary-strong: oklch(0.49 0.24 293); /* --color-violet-700 */
16
+ --primary-intense: oklch(0.38 0.18 294); /* --color-violet-900 */
17
+
18
+ --secondary: oklch(0.55 0.02 264); /* --color-gray-500 */
19
+ --secondary-muted: oklch(0.97 0 265); /* --color-gray-100 */
20
+ --secondary-weak: oklch(0.87 0.01 258); /* --color-gray-300 */
21
+ --secondary-strong: oklch(0.28 0.03 257); /* --color-gray-800 */
22
+ --secondary-intense: oklch(0.13 0.03 262); /* --color-gray-950 */
23
+
24
+ --muted: oklch(0.55 0.01 286); /* --color-zinc-500 */
25
+ --muted-muted: oklch(0.97 0 286); /* --color-zinc-100 */
26
+ --muted-weak: oklch(0.87 0.01 286); /* --color-zinc-300 */
27
+ --muted-strong: oklch(0.37 0.01 286); /* --color-zinc-700 */
28
+ --muted-intense: oklch(0.21 0.01 286); /* --color-zinc-900 */
29
+
30
+ --accent: oklch(0.55 0.04 257); /* --color-slate-500 */
31
+ --accent-muted: oklch(0.97 0.01 248); /* --color-slate-100 */
32
+ --accent-weak: oklch(0.87 0.02 253); /* --color-slate-300 */
33
+ --accent-strong: oklch(0.37 0.04 257); /* --color-slate-700 */
34
+ --accent-intense: oklch(0.21 0.04 266); /* --color-slate-900 */
35
+
36
+ --info: oklch(0.62 0.19 260); /* --color-blue-500 */
37
+ --info-muted: oklch(0.93 0.03 256); /* --color-blue-100 */
38
+ --info-weak: oklch(0.81 0.1 252); /* --color-blue-300 */
39
+ --info-strong: oklch(0.49 0.22 264); /* --color-blue-700 */
40
+ --info-intense: oklch(0.38 0.14 266); /* --color-blue-900 */
41
+
42
+ --success: oklch(0.72 0.19 150); /* --color-green-500 */
43
+ --success-muted: oklch(0.96 0.04 157); /* --color-green-100 */
44
+ --success-weak: oklch(0.8 0.18 152); /* --color-green-400 */
45
+ --success-strong: oklch(0.63 0.17 149); /* --color-green-600 */
46
+ --success-intense: oklch(0.53 0.14 150); /* --color-green-750 */
47
+
48
+ --warning: oklch(0.77 0.16 70); /* --color-amber-500 */
49
+ --warning-muted: oklch(0.96 0.06 96); /* --color-amber-100 */
50
+ --warning-weak: oklch(0.84 0.16 84); /* --color-amber-400 */
51
+ --warning-strong: oklch(0.67 0.16 58); /* --color-amber-600 */
52
+ --warning-intense: oklch(0.56 0.15 49); /* --color-amber-700 */
53
+
54
+ --danger: oklch(0.64 0.21 25); /* --color-red-500 */
55
+ --danger-muted: oklch(0.94 0.03 18); /* --color-red-100 */
56
+ --danger-weak: oklch(0.71 0.17 22); /* --color-red-400 */
57
+ --danger-strong: oklch(0.58 0.22 27); /* --color-red-600 */
58
+ --danger-intense: oklch(0.51 0.19 28); /* --color-red-700 */
59
+
60
+ --text-positive: oklch(0.37 0.01 286); /* --color-zinc-700 */
61
+ --text-positive-muted: oklch(0.87 0.01 286); /* --color-zinc-300 */
62
+ --text-positive-weak: oklch(0.55 0.01 286); /* --color-zinc-500 */
63
+ --text-positive-strong: oklch(0.21 0.01 286); /* --color-zinc-900 */
64
+ --text-positive-intense: oklch(0 0 0); /* --color-black */
65
+
66
+ --text-negative: oklch(0.99 0 0); /* --color-zinc-50 */
67
+ --text-negative-muted: oklch(0.55 0.01 286); /* --color-zinc-500 */
68
+ --text-negative-weak: oklch(0.87 0.01 286); /* --color-zinc-300 */
69
+ --text-negative-strong: oklch(0.99 0 0); /* --color-zinc-50 */
70
+ --text-negative-intense: oklch(1 0 0); /* --color-black */
71
+
72
+ --border: oklch(0.72 0 0); /* --color-neutral-400 */
73
+ --border-muted: oklch(0.99 0 0); /* --color-neutral-50 */
74
+ --border-weak: oklch(0.92 0 0); /* --color-neutral-200 */
75
+ --border-strong: oklch(0.37 0 0); /* --color-neutral-700 */
76
+ --border-intense: oklch(0.14 0 0); /* --color-neutral-900 */
77
+
78
+ --input: oklch(0.871 0.006 286.286); /* --color-zinc-300 */
79
+ --ring: oklch(0.81 0.1 294); /* --color-violet-300 */
80
+
81
+ --chart-1: oklch(0.646 0.222 41.116);
82
+ --chart-2: oklch(0.6 0.118 184.704);
83
+ --chart-3: oklch(0.398 0.07 227.392);
84
+ --chart-4: oklch(0.828 0.189 84.429);
85
+ --chart-5: oklch(0.769 0.188 70.08);
86
+
87
+ --sidebar: oklch(0.97 0 286); /* --color-zinc-100 */
88
+ --sidebar-foreground: oklch(0.28 0.04 260.03);
89
+ --sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
90
+ --sidebar-ring: oklch(0.871 0.006 286.286); /* --color-zinc-300 */
91
+
92
+ --sidebar-primary: oklch(0.59 0.2 277.12);
93
+ --sidebar-primary-foreground: oklch(1 0 0);
94
+
95
+ --sidebar-accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
96
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
97
+
98
+ --shadow-btn: 0px 1px 2px 0 rgb(0 0 0 / 0.05);
99
+ --shadow-input: 0px 1px 2px 0 rgb(0 0 0 / 0.05);
100
+ --shadow-nav: 0 0 0 1px rgba(61, 70, 82, 0.04), 0 0 0.25rem rgba(61, 70, 82, 0.1), 0 0 1rem rgba(0, 0, 0, 0.06);
101
+ --shadow-card: 0 0 0 1px rgba(61, 70, 82, 0.04), 0 0 0.25rem rgba(61, 70, 82, 0.1), 0 0.25rem 1.5rem rgba(0, 0, 0, 0.06);
102
+ --shadow-dropdown: 0 0.25rem 1.5rem 0 rgba(0, 0, 0, 0.1), 0 0 0.25rem 0 rgba(61, 70, 82, 0.15);
103
+ --shadow-dialog: 0 0.25rem 1.5rem 0 rgba(0, 0, 0, 0.1), 0 0 0.25rem 0 rgba(61, 70, 82, 0.15);
104
+ }
@@ -0,0 +1,6 @@
1
+ :root {
2
+ font-family:
3
+ Inter, ui-sans-serif, system-ui, Avenir, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
4
+ line-height: 1.5;
5
+ font-weight: 400;
6
+ }
@@ -1,23 +0,0 @@
1
- 'use client'
2
- import React from 'react'
3
- import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../ui/card'
4
-
5
- type Props = {
6
- title: string
7
- description?: string
8
- action?: React.ReactNode
9
- footer?: React.ReactNode
10
- }
11
- export const SimpleCard = ({ title, description, action, footer, children }: React.PropsWithChildren<Props>) => {
12
- return (
13
- <Card>
14
- <CardHeader>
15
- <CardTitle>{title}</CardTitle>
16
- <CardDescription>{description}</CardDescription>
17
- {action && <CardAction>{action}</CardAction>}
18
- </CardHeader>
19
- <CardContent>{children}</CardContent>
20
- {footer && <CardFooter>{footer}</CardFooter>}
21
- </Card>
22
- )
23
- }
@@ -1,53 +0,0 @@
1
- import React from 'react'
2
- import ReactCountryFlag from 'react-country-flag'
3
-
4
- import { ECountry } from '@/types'
5
-
6
- import { Flex } from '../layouts/flex'
7
- import { Paragraph } from '../typography/paragraph'
8
-
9
- type Props = {
10
- country?: ECountry | null
11
- }
12
- export const CountryDisplay: React.FC<React.PropsWithChildren<Props>> = ({ country }) => {
13
- const code = React.useMemo(() => {
14
- return {
15
- [ECountry.VIETNAM]: 'VN',
16
- [ECountry.USA]: 'US',
17
- [ECountry.JAPAN]: 'JP',
18
- [ECountry.CHINA]: 'CN',
19
- [ECountry.KOREA]: 'KR',
20
- [ECountry.SINGAPORE]: 'SG',
21
- [ECountry.MALAYSIA]: 'MY',
22
- [ECountry.INDONESIA]: 'ID',
23
- [ECountry.TAIWAN]: 'TW',
24
- [ECountry.THAILAND]: 'TH',
25
- }
26
- }, [])
27
- if (!country) {
28
- return (
29
- <Flex padding="none" className="h-4 px-1">
30
- <Paragraph variant="muted" className="line-clamp-1 text-xs">
31
- No country
32
- </Paragraph>
33
- </Flex>
34
- )
35
- }
36
- return (
37
- <Flex padding="none" className="h-4 px-1">
38
- <ReactCountryFlag svg countryCode={country ? code[country] : 'VN'} className="emojiFlag border" />
39
- <Paragraph variant="sm">
40
- {country === ECountry.VIETNAM && 'Vietnam'}
41
- {country === ECountry.USA && 'America'}
42
- {country === ECountry.JAPAN && 'Japan'}
43
- {country === ECountry.CHINA && 'China'}
44
- {country === ECountry.KOREA && 'Korea'}
45
- {country === ECountry.SINGAPORE && 'Singapore'}
46
- {country === ECountry.MALAYSIA && 'Malaysia'}
47
- {country === ECountry.INDONESIA && 'Indonesia'}
48
- {country === ECountry.TAIWAN && 'Taiwan'}
49
- {country === ECountry.THAILAND && 'Thailand'}
50
- </Paragraph>
51
- </Flex>
52
- )
53
- }
@@ -1,29 +0,0 @@
1
- import { Flex } from '@/components/layouts/flex'
2
-
3
- type DataListProps = {
4
- title?: string
5
- }
6
- export const DataList: React.FC<React.PropsWithChildren<DataListProps>> = ({ children }) => {
7
- return (
8
- <Flex vertical padding="none" gap="md" width="full">
9
- {children}
10
- </Flex>
11
- )
12
- }
13
-
14
- type DataListItemProps = {
15
- label: string
16
- value: string | number | React.ReactNode
17
- minLabelWidth?: string
18
- }
19
-
20
- export const DataListItem: React.FC<React.PropsWithChildren<DataListItemProps>> = ({ label, value, minLabelWidth = '120px' }) => {
21
- return (
22
- <Flex align="center" justify="start" width="full" padding="none" gap="md">
23
- <div style={{ minWidth: minLabelWidth }} className="text-text-positive-weak text-sm">
24
- {label}
25
- </div>
26
- <div className="text-text-positive text-sm">{value}</div>
27
- </Flex>
28
- )
29
- }
@@ -1,23 +0,0 @@
1
- import { DateDisplay } from './date'
2
- import { Badge } from '../ui/badge'
3
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip'
4
-
5
- type Props = {
6
- date: Date | string | number
7
- }
8
- export const DateTooltip: React.FC<Props> = ({ date }) => {
9
- return (
10
- <TooltipProvider>
11
- <Tooltip>
12
- <TooltipTrigger asChild>
13
- <Badge>
14
- <DateDisplay date={date} format="medium" className="font-normal text-white" />
15
- </Badge>
16
- </TooltipTrigger>
17
- <TooltipContent>
18
- <DateDisplay date={date} format="full" showTime className="text-secondary !font-[Inter] font-medium" />
19
- </TooltipContent>
20
- </Tooltip>
21
- </TooltipProvider>
22
- )
23
- }
@@ -1,157 +0,0 @@
1
- import React from 'react'
2
- import { format, isThisMonth, isThisWeek, isThisYear, isToday, isTomorrow, isValid, isYesterday, parseISO } from 'date-fns'
3
-
4
- import { TIME_IN_SECONDS, vietnameseHolidays, vietnameseLocale } from '@/constants'
5
- import { cn } from '@/lib/utils'
6
-
7
- interface Props {
8
- date: Date | string | number
9
- format?:
10
- | 'short' // 15/03/24
11
- | 'medium' // 15/03/2024
12
- | 'long' // 15 tháng 3, 2024
13
- | 'full' // Thứ Sáu, ngày 15 tháng 3 năm 2024
14
- | 'relative' // 2 giờ trước
15
- | 'datetime' // 15/03/2024 14:30
16
- | 'time' // 14:30
17
- | 'smart' // Tự động chọn format phù hợp
18
- showHoliday?: boolean
19
- showTime?: boolean
20
- className?: string
21
- title?: string // Tooltip khi hover
22
- }
23
-
24
- export const DateDisplay: React.FC<Props> = ({ date, format: formatType = 'medium', showHoliday = false, showTime = false, className = '', title }) => {
25
- const parsedDate = React.useMemo(() => {
26
- try {
27
- if (date instanceof Date) {
28
- return isValid(date) ? date : null
29
- }
30
- if (typeof date === 'string') {
31
- const parsed = parseISO(date)
32
- return isValid(parsed) ? parsed : new Date(date)
33
- }
34
- if (typeof date === 'number') {
35
- const parsed = new Date(date)
36
- return isValid(parsed) ? parsed : null
37
- }
38
- return null
39
- } catch {
40
- return null
41
- }
42
- }, [date])
43
-
44
- // Format relative time in Vietnamese
45
- const formatRelativeTime = React.useCallback((date: Date): string => {
46
- const now = new Date()
47
- const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000)
48
-
49
- if (diffInSeconds < 60) return 'Vừa xong'
50
- if (diffInSeconds < 3600) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.MINUTE)} phút trước`
51
- if (diffInSeconds < 86400) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.HOUR)} giờ trước`
52
- if (diffInSeconds < 604800) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.DAY)} ngày trước`
53
- if (diffInSeconds < 2592000) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.WEEK)} tuần trước`
54
- if (diffInSeconds < 31536000) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.MONTH)} tháng trước`
55
- return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.YEAR)} năm trước`
56
- }, [])
57
-
58
- // Vietnamese weekday
59
- const getVietnameseWeekday = React.useCallback((date: Date, short: boolean = false): string => {
60
- const dayIndex = date.getDay()
61
- return short ? vietnameseLocale.weekdaysShort[dayIndex] : vietnameseLocale.weekdays[dayIndex]
62
- }, [])
63
-
64
- // Vietnamese month
65
- const getVietnameseMonth = React.useCallback((date: Date, short: boolean = false): string => {
66
- const monthIndex = date.getMonth()
67
- return short ? vietnameseLocale.monthsShort[monthIndex] : vietnameseLocale.months[monthIndex]
68
- }, [])
69
-
70
- // Check holiday
71
- const getHoliday = React.useCallback((date: Date): string | null => {
72
- const monthDay = format(date, 'MM-dd') as keyof typeof vietnameseHolidays
73
- return vietnameseHolidays[monthDay] || null
74
- }, [])
75
-
76
- // Smart format - choose appropriate format based on date
77
- const getSmartFormat = React.useCallback(
78
- (date: Date): string => {
79
- if (isToday(date)) {
80
- return showTime ? `Hôm nay ${format(date, 'HH:mm')}` : 'Hôm nay'
81
- }
82
- if (isYesterday(date)) {
83
- return showTime ? `Hôm qua ${format(date, 'HH:mm')}` : 'Hôm qua'
84
- }
85
- if (isTomorrow(date)) {
86
- return showTime ? `Ngày mai ${format(date, 'HH:mm')}` : 'Ngày mai'
87
- }
88
- if (isThisWeek(date)) {
89
- const weekday = getVietnameseWeekday(date)
90
- return showTime ? `${weekday} ${format(date, 'HH:mm')}` : weekday
91
- }
92
- if (isThisMonth(date)) {
93
- const day = format(date, 'd')
94
- return showTime ? `${day}/${format(date, 'M')} ${format(date, 'HH:mm')}` : `${day}/${format(date, 'M')}`
95
- }
96
- if (isThisYear(date)) {
97
- return showTime ? format(date, 'd/M HH:mm') : format(date, 'd/M')
98
- }
99
- return showTime ? format(date, 'd/M/yyyy HH:mm') : format(date, 'd/M/yyyy')
100
- },
101
- [getVietnameseWeekday, showTime],
102
- )
103
-
104
- // Main formatting function
105
- const formatDate = React.useCallback(
106
- (date: Date, type: string): string => {
107
- const timeStr = showTime ? format(date, ', HH:mm') : ''
108
-
109
- switch (type) {
110
- case 'short':
111
- return format(date, 'd/M/yy') + timeStr
112
-
113
- case 'medium':
114
- return format(date, 'dd/MM/yyyy') + timeStr
115
-
116
- case 'long':
117
- return `${format(date, 'd')} ${getVietnameseMonth(date)} ${format(date, 'yyyy')}` + timeStr
118
-
119
- case 'full': {
120
- const data = `${getVietnameseWeekday(date)}, ngày ${format(date, 'd')} ${getVietnameseMonth(date)} năm ${format(date, 'yyyy')}`
121
- return data + timeStr
122
- }
123
-
124
- case 'relative':
125
- return formatRelativeTime(date)
126
-
127
- case 'datetime':
128
- return format(date, 'd/M/yyyy HH:mm')
129
-
130
- case 'time':
131
- return format(date, 'HH:mm')
132
-
133
- case 'smart':
134
- return getSmartFormat(date)
135
-
136
- default:
137
- return format(date, 'd/M/yyyy') + timeStr
138
- }
139
- },
140
- [getSmartFormat, getVietnameseMonth, getVietnameseWeekday, formatRelativeTime, showTime],
141
- )
142
-
143
- if (!parsedDate) {
144
- return <span className={cn('text-muted-foreground text-sm', className)}>--/--/----</span>
145
- }
146
-
147
- const formattedDate = formatDate(parsedDate, formatType)
148
- const holiday = showHoliday ? getHoliday(parsedDate) : null
149
- const displayText = holiday ? `${formattedDate} (${holiday})` : formattedDate
150
- const tooltipTitle = title || format(parsedDate, 'EEEE, d MMMM yyyy HH:mm:ss')
151
-
152
- return (
153
- <time dateTime={parsedDate.toISOString()} className={cn('text-accent-foreground font-number text-sm', className)} title={tooltipTitle}>
154
- {displayText}
155
- </time>
156
- )
157
- }
@@ -1,13 +0,0 @@
1
- 'use client'
2
- import { PackageOpenIcon } from 'lucide-react'
3
-
4
- import { Flex } from '../layouts/flex'
5
-
6
- export const EmptyDisplay = () => {
7
- return (
8
- <Flex vertical justify="center" align="center" gap="sm" className="text-text-positive-muted size-full">
9
- <PackageOpenIcon size={52} strokeWidth={1} />
10
- <p className="text-sm">Không có dữ liệu nào để hiển thị.</p>
11
- </Flex>
12
- )
13
- }
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
-
3
- import { Paragraph } from '../typography/paragraph'
4
- import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'
5
-
6
- type NameDisplayProps = {
7
- name: string
8
- }
9
-
10
- export const NameDisplay: React.FC<React.PropsWithChildren<NameDisplayProps>> = ({ name }) => {
11
- return (
12
- <Tooltip>
13
- <TooltipTrigger>
14
- <Paragraph variant="sm" className="line-clamp-2 cursor-help">
15
- {name}
16
- </Paragraph>
17
- </TooltipTrigger>
18
- <TooltipContent align="start" className="max-w-80 text-wrap break-keep whitespace-pre-line">
19
- {name}
20
- </TooltipContent>
21
- </Tooltip>
22
- )
23
- }