@campxdev/react-blueprint 3.0.0-alpha.5 → 3.0.0-alpha.7

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 (263) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/types/src/components/Assets/ErrorPages/ComingSoon.d.ts +24 -0
  3. package/dist/cjs/types/src/components/Assets/ErrorPages/InternalServerError.d.ts +20 -0
  4. package/dist/cjs/types/src/components/Assets/ErrorPages/NoInternetConnection.d.ts +20 -0
  5. package/dist/cjs/types/src/components/Assets/ErrorPages/NoItemFound.d.ts +28 -0
  6. package/dist/cjs/types/src/components/Assets/ErrorPages/PageNotFound.d.ts +21 -0
  7. package/dist/cjs/types/src/components/Assets/ErrorPages/ResourceNotFound.d.ts +21 -0
  8. package/dist/cjs/types/src/components/Assets/ErrorPages/UnAuthorized.d.ts +31 -0
  9. package/dist/cjs/types/src/components/Assets/Icons/Icons.d.ts +54 -0
  10. package/dist/cjs/types/src/components/Charts/BarChart/BarChart.d.ts +38 -0
  11. package/dist/cjs/types/src/components/Charts/BarChart/HorizontalBarChart.d.ts +93 -0
  12. package/dist/cjs/types/src/components/Charts/BarChart/VerticalBarChart.d.ts +110 -0
  13. package/dist/cjs/types/src/components/Charts/LineChart/LineChart.d.ts +89 -0
  14. package/dist/cjs/types/src/components/Charts/PieChart/PieChart.d.ts +86 -0
  15. package/dist/cjs/types/src/components/Charts/TreeMap/TreeMap.d.ts +74 -0
  16. package/dist/cjs/types/src/components/DataDisplay/Accordion/Accordion.d.ts +54 -0
  17. package/dist/cjs/types/src/components/DataDisplay/ActivityLogView/ActivityLogFilter.d.ts +35 -0
  18. package/dist/cjs/types/src/components/DataDisplay/ActivityLogView/ActivityLogView.d.ts +78 -0
  19. package/dist/cjs/types/src/components/DataDisplay/Avatar/Avatar.d.ts +40 -0
  20. package/dist/cjs/types/src/components/DataDisplay/Chip/Chip.d.ts +28 -0
  21. package/dist/cjs/types/src/components/DataDisplay/Chips/Chips.d.ts +55 -0
  22. package/dist/cjs/types/src/components/DataDisplay/DataTable/DataTable.d.ts +96 -1
  23. package/dist/cjs/types/src/components/DataDisplay/DataTable/components/CardsView.d.ts +14 -2
  24. package/dist/cjs/types/src/components/DataDisplay/DataTable/components/TablePagination.d.ts +35 -0
  25. package/dist/cjs/types/src/components/DataDisplay/EmptyIllustration/EmptyIllustration.d.ts +30 -0
  26. package/dist/cjs/types/src/components/DataDisplay/ReactJoyride/ReactJoyride.d.ts +64 -0
  27. package/dist/cjs/types/src/components/DataDisplay/Separator/Separator.d.ts +30 -0
  28. package/dist/cjs/types/src/components/DataDisplay/Skeleton/Skeleton.d.ts +20 -0
  29. package/dist/cjs/types/src/components/DataDisplay/StatusCard/StatusCard.d.ts +36 -0
  30. package/dist/cjs/types/src/components/DataDisplay/Timeline/Timeline.d.ts +58 -0
  31. package/dist/cjs/types/src/components/DataDisplay/Typography/Typography.d.ts +25 -0
  32. package/dist/cjs/types/src/components/Feedback/Alert/Alert.d.ts +31 -0
  33. package/dist/cjs/types/src/components/Feedback/Snackbar/Snackbar.d.ts +54 -0
  34. package/dist/cjs/types/src/components/Feedback/Spinner/Spinner.d.ts +15 -0
  35. package/dist/cjs/types/src/components/Feedback/Tooltip/Tooltip.d.ts +54 -0
  36. package/dist/cjs/types/src/components/Input/Button/Button.d.ts +26 -0
  37. package/dist/cjs/types/src/components/Input/DatePicker/DatePicker.d.ts +41 -0
  38. package/dist/cjs/types/src/components/Input/DateTimePicker/DateTimePicker.d.ts +42 -0
  39. package/dist/cjs/types/src/components/Input/FileUpload/FileUpload.d.ts +41 -0
  40. package/dist/cjs/types/src/components/Input/FormActions/FormActions.d.ts +37 -0
  41. package/dist/cjs/types/src/components/Input/FormControlWrapper/FormControlWrapper.d.ts +31 -0
  42. package/dist/cjs/types/src/components/Input/FormWrapper/FormWrapper.d.ts +20 -0
  43. package/dist/cjs/types/src/components/Input/HelpButton/HelpButton.d.ts +14 -0
  44. package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/DeleteButton.d.ts +16 -0
  45. package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/EditButton.d.ts +16 -0
  46. package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/RedirectButton.d.ts +16 -0
  47. package/dist/cjs/types/src/components/Input/IconButtons/IconButtons/ViewButton.d.ts +16 -0
  48. package/dist/cjs/types/src/components/Input/IconButtons/IconButtons.d.ts +18 -0
  49. package/dist/cjs/types/src/components/Input/LabelWrapper/LabelWrapper.d.ts +26 -0
  50. package/dist/cjs/types/src/components/Input/MultiCheckBox/MultiCheckBox.d.ts +34 -0
  51. package/dist/cjs/types/src/components/Input/MultiSelect/MultiSelect.d.ts +40 -0
  52. package/dist/cjs/types/src/components/Input/OtpInput/OtpInput.d.ts +29 -0
  53. package/dist/cjs/types/src/components/Input/PasswordField/PasswordField.d.ts +34 -0
  54. package/dist/cjs/types/src/components/Input/RadioGroup/RadioGroup.d.ts +38 -0
  55. package/dist/cjs/types/src/components/Input/SearchBar/SearchBar.d.ts +26 -0
  56. package/dist/cjs/types/src/components/Input/Select/Select.d.ts +32 -0
  57. package/dist/cjs/types/src/components/Input/SingleCheckBox/SingleCheckBox.d.ts +29 -0
  58. package/dist/cjs/types/src/components/Input/SingleSelect/SingleSelect.d.ts +40 -0
  59. package/dist/cjs/types/src/components/Input/Switch/Switch.d.ts +23 -0
  60. package/dist/cjs/types/src/components/Input/Tags/Tags.d.ts +26 -0
  61. package/dist/cjs/types/src/components/Input/TextField/TextField.d.ts +35 -0
  62. package/dist/cjs/types/src/components/Input/Textarea/Textarea.d.ts +36 -0
  63. package/dist/cjs/types/src/components/Layout/AppLayout/AppLayout.d.ts +32 -0
  64. package/dist/cjs/types/src/components/Layout/AppLayout/components/MenuToggleButton.d.ts +16 -0
  65. package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/MenuBar.d.ts +26 -0
  66. package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/MenuItem.d.ts +37 -0
  67. package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/Sidebar.d.ts +30 -1
  68. package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/StyledComponents.d.ts +139 -0
  69. package/dist/cjs/types/src/components/Layout/AppLayout/components/UserProfilePopup.d.ts +34 -0
  70. package/dist/cjs/types/src/components/Layout/AppLayout/context/SidebarContext.d.ts +48 -0
  71. package/dist/cjs/types/src/components/Layout/AppLayout/types.d.ts +1 -1
  72. package/dist/cjs/types/src/components/Layout/PageContent/PageContent.d.ts +21 -1
  73. package/dist/cjs/types/src/components/Layout/PageHeader/PageHeader.d.ts +46 -0
  74. package/dist/cjs/types/src/components/Layout/PageHeader/components/SearchBar.d.ts +22 -0
  75. package/dist/cjs/types/src/components/Layout/UserBox/UserBox.d.ts +40 -0
  76. package/dist/cjs/types/src/components/Navigation/Breadcrumbs/Breadcrumbs.d.ts +33 -0
  77. package/dist/cjs/types/src/components/Navigation/Calendar/Calendar.d.ts +63 -0
  78. package/dist/cjs/types/src/components/Navigation/ConfirmDialog/ConfirmDialog.d.ts +64 -0
  79. package/dist/cjs/types/src/components/Navigation/Dialog/Dialog.d.ts +55 -0
  80. package/dist/cjs/types/src/components/Navigation/DialogButton/DialogButton.d.ts +64 -0
  81. package/dist/cjs/types/src/components/Navigation/DropDownMenu/DropDownMenu.d.ts +73 -0
  82. package/dist/cjs/types/src/components/Navigation/PreviewFiles/PreviewFiles.d.ts +54 -0
  83. package/dist/cjs/types/src/components/Navigation/Stepper/Stepper.d.ts +55 -10
  84. package/dist/cjs/types/src/components/Navigation/TabsContainer/TabsContainer.d.ts +85 -1
  85. package/dist/cjs/types/src/components/Navigation/UploadDialog/UploadDialog.d.ts +64 -0
  86. package/dist/cjs/types/src/shadcn-components/Input/Button/Button.d.ts +1 -1
  87. package/dist/esm/index.js +2 -2
  88. package/dist/esm/types/src/components/Assets/ErrorPages/ComingSoon.d.ts +24 -0
  89. package/dist/esm/types/src/components/Assets/ErrorPages/InternalServerError.d.ts +20 -0
  90. package/dist/esm/types/src/components/Assets/ErrorPages/NoInternetConnection.d.ts +20 -0
  91. package/dist/esm/types/src/components/Assets/ErrorPages/NoItemFound.d.ts +28 -0
  92. package/dist/esm/types/src/components/Assets/ErrorPages/PageNotFound.d.ts +21 -0
  93. package/dist/esm/types/src/components/Assets/ErrorPages/ResourceNotFound.d.ts +21 -0
  94. package/dist/esm/types/src/components/Assets/ErrorPages/UnAuthorized.d.ts +31 -0
  95. package/dist/esm/types/src/components/Assets/Icons/Icons.d.ts +54 -0
  96. package/dist/esm/types/src/components/Charts/BarChart/BarChart.d.ts +38 -0
  97. package/dist/esm/types/src/components/Charts/BarChart/HorizontalBarChart.d.ts +93 -0
  98. package/dist/esm/types/src/components/Charts/BarChart/VerticalBarChart.d.ts +110 -0
  99. package/dist/esm/types/src/components/Charts/LineChart/LineChart.d.ts +89 -0
  100. package/dist/esm/types/src/components/Charts/PieChart/PieChart.d.ts +86 -0
  101. package/dist/esm/types/src/components/Charts/TreeMap/TreeMap.d.ts +74 -0
  102. package/dist/esm/types/src/components/DataDisplay/Accordion/Accordion.d.ts +54 -0
  103. package/dist/esm/types/src/components/DataDisplay/ActivityLogView/ActivityLogFilter.d.ts +35 -0
  104. package/dist/esm/types/src/components/DataDisplay/ActivityLogView/ActivityLogView.d.ts +78 -0
  105. package/dist/esm/types/src/components/DataDisplay/Avatar/Avatar.d.ts +40 -0
  106. package/dist/esm/types/src/components/DataDisplay/Chip/Chip.d.ts +28 -0
  107. package/dist/esm/types/src/components/DataDisplay/Chips/Chips.d.ts +55 -0
  108. package/dist/esm/types/src/components/DataDisplay/DataTable/DataTable.d.ts +96 -1
  109. package/dist/esm/types/src/components/DataDisplay/DataTable/components/CardsView.d.ts +14 -2
  110. package/dist/esm/types/src/components/DataDisplay/DataTable/components/TablePagination.d.ts +35 -0
  111. package/dist/esm/types/src/components/DataDisplay/EmptyIllustration/EmptyIllustration.d.ts +30 -0
  112. package/dist/esm/types/src/components/DataDisplay/ReactJoyride/ReactJoyride.d.ts +64 -0
  113. package/dist/esm/types/src/components/DataDisplay/Separator/Separator.d.ts +30 -0
  114. package/dist/esm/types/src/components/DataDisplay/Skeleton/Skeleton.d.ts +20 -0
  115. package/dist/esm/types/src/components/DataDisplay/StatusCard/StatusCard.d.ts +36 -0
  116. package/dist/esm/types/src/components/DataDisplay/Timeline/Timeline.d.ts +58 -0
  117. package/dist/esm/types/src/components/DataDisplay/Typography/Typography.d.ts +25 -0
  118. package/dist/esm/types/src/components/Feedback/Alert/Alert.d.ts +31 -0
  119. package/dist/esm/types/src/components/Feedback/Snackbar/Snackbar.d.ts +54 -0
  120. package/dist/esm/types/src/components/Feedback/Spinner/Spinner.d.ts +15 -0
  121. package/dist/esm/types/src/components/Feedback/Tooltip/Tooltip.d.ts +54 -0
  122. package/dist/esm/types/src/components/Input/Button/Button.d.ts +26 -0
  123. package/dist/esm/types/src/components/Input/DatePicker/DatePicker.d.ts +41 -0
  124. package/dist/esm/types/src/components/Input/DateTimePicker/DateTimePicker.d.ts +42 -0
  125. package/dist/esm/types/src/components/Input/FileUpload/FileUpload.d.ts +41 -0
  126. package/dist/esm/types/src/components/Input/FormActions/FormActions.d.ts +37 -0
  127. package/dist/esm/types/src/components/Input/FormControlWrapper/FormControlWrapper.d.ts +31 -0
  128. package/dist/esm/types/src/components/Input/FormWrapper/FormWrapper.d.ts +20 -0
  129. package/dist/esm/types/src/components/Input/HelpButton/HelpButton.d.ts +14 -0
  130. package/dist/esm/types/src/components/Input/IconButtons/IconButtons/DeleteButton.d.ts +16 -0
  131. package/dist/esm/types/src/components/Input/IconButtons/IconButtons/EditButton.d.ts +16 -0
  132. package/dist/esm/types/src/components/Input/IconButtons/IconButtons/RedirectButton.d.ts +16 -0
  133. package/dist/esm/types/src/components/Input/IconButtons/IconButtons/ViewButton.d.ts +16 -0
  134. package/dist/esm/types/src/components/Input/IconButtons/IconButtons.d.ts +18 -0
  135. package/dist/esm/types/src/components/Input/LabelWrapper/LabelWrapper.d.ts +26 -0
  136. package/dist/esm/types/src/components/Input/MultiCheckBox/MultiCheckBox.d.ts +34 -0
  137. package/dist/esm/types/src/components/Input/MultiSelect/MultiSelect.d.ts +40 -0
  138. package/dist/esm/types/src/components/Input/OtpInput/OtpInput.d.ts +29 -0
  139. package/dist/esm/types/src/components/Input/PasswordField/PasswordField.d.ts +34 -0
  140. package/dist/esm/types/src/components/Input/RadioGroup/RadioGroup.d.ts +38 -0
  141. package/dist/esm/types/src/components/Input/SearchBar/SearchBar.d.ts +26 -0
  142. package/dist/esm/types/src/components/Input/Select/Select.d.ts +32 -0
  143. package/dist/esm/types/src/components/Input/SingleCheckBox/SingleCheckBox.d.ts +29 -0
  144. package/dist/esm/types/src/components/Input/SingleSelect/SingleSelect.d.ts +40 -0
  145. package/dist/esm/types/src/components/Input/Switch/Switch.d.ts +23 -0
  146. package/dist/esm/types/src/components/Input/Tags/Tags.d.ts +26 -0
  147. package/dist/esm/types/src/components/Input/TextField/TextField.d.ts +35 -0
  148. package/dist/esm/types/src/components/Input/Textarea/Textarea.d.ts +36 -0
  149. package/dist/esm/types/src/components/Layout/AppLayout/AppLayout.d.ts +32 -0
  150. package/dist/esm/types/src/components/Layout/AppLayout/components/MenuToggleButton.d.ts +16 -0
  151. package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/MenuBar.d.ts +26 -0
  152. package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/MenuItem.d.ts +37 -0
  153. package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/Sidebar.d.ts +30 -1
  154. package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/StyledComponents.d.ts +139 -0
  155. package/dist/esm/types/src/components/Layout/AppLayout/components/UserProfilePopup.d.ts +34 -0
  156. package/dist/esm/types/src/components/Layout/AppLayout/context/SidebarContext.d.ts +48 -0
  157. package/dist/esm/types/src/components/Layout/AppLayout/types.d.ts +1 -1
  158. package/dist/esm/types/src/components/Layout/PageContent/PageContent.d.ts +21 -1
  159. package/dist/esm/types/src/components/Layout/PageHeader/PageHeader.d.ts +46 -0
  160. package/dist/esm/types/src/components/Layout/PageHeader/components/SearchBar.d.ts +22 -0
  161. package/dist/esm/types/src/components/Layout/UserBox/UserBox.d.ts +40 -0
  162. package/dist/esm/types/src/components/Navigation/Breadcrumbs/Breadcrumbs.d.ts +33 -0
  163. package/dist/esm/types/src/components/Navigation/Calendar/Calendar.d.ts +63 -0
  164. package/dist/esm/types/src/components/Navigation/ConfirmDialog/ConfirmDialog.d.ts +64 -0
  165. package/dist/esm/types/src/components/Navigation/Dialog/Dialog.d.ts +55 -0
  166. package/dist/esm/types/src/components/Navigation/DialogButton/DialogButton.d.ts +64 -0
  167. package/dist/esm/types/src/components/Navigation/DropDownMenu/DropDownMenu.d.ts +73 -0
  168. package/dist/esm/types/src/components/Navigation/PreviewFiles/PreviewFiles.d.ts +54 -0
  169. package/dist/esm/types/src/components/Navigation/Stepper/Stepper.d.ts +55 -10
  170. package/dist/esm/types/src/components/Navigation/TabsContainer/TabsContainer.d.ts +85 -1
  171. package/dist/esm/types/src/components/Navigation/UploadDialog/UploadDialog.d.ts +64 -0
  172. package/dist/esm/types/src/shadcn-components/Input/Button/Button.d.ts +1 -1
  173. package/dist/index.d.ts +2961 -16
  174. package/dist/styles.css +30 -81
  175. package/package.json +1 -1
  176. package/src/components/Assets/ErrorPages/ComingSoon.tsx +24 -0
  177. package/src/components/Assets/ErrorPages/InternalServerError.tsx +20 -0
  178. package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +20 -0
  179. package/src/components/Assets/ErrorPages/NoItemFound.tsx +28 -0
  180. package/src/components/Assets/ErrorPages/PageNotFound.tsx +21 -0
  181. package/src/components/Assets/ErrorPages/ResourceNotFound.tsx +21 -0
  182. package/src/components/Assets/ErrorPages/UnAuthorized.tsx +31 -0
  183. package/src/components/Assets/Icons/Icons.tsx +55 -1
  184. package/src/components/Charts/BarChart/BarChart.tsx +38 -0
  185. package/src/components/Charts/BarChart/HorizontalBarChart.tsx +93 -0
  186. package/src/components/Charts/BarChart/VerticalBarChart.tsx +110 -0
  187. package/src/components/Charts/LineChart/LineChart.tsx +89 -0
  188. package/src/components/Charts/PieChart/PieChart.tsx +86 -0
  189. package/src/components/Charts/TreeMap/TreeMap.tsx +90 -0
  190. package/src/components/DataDisplay/Accordion/Accordion.tsx +54 -0
  191. package/src/components/DataDisplay/ActivityLogView/ActivityLogFilter.tsx +35 -0
  192. package/src/components/DataDisplay/ActivityLogView/ActivityLogView.tsx +84 -0
  193. package/src/components/DataDisplay/Avatar/Avatar.tsx +40 -0
  194. package/src/components/DataDisplay/Chip/Chip.tsx +28 -0
  195. package/src/components/DataDisplay/Chips/Chips.tsx +56 -0
  196. package/src/components/DataDisplay/DataTable/DataTable.tsx +109 -2
  197. package/src/components/DataDisplay/DataTable/components/CardsView.tsx +28 -13
  198. package/src/components/DataDisplay/DataTable/components/ColumnSelector/ColumnSelector.tsx +22 -4
  199. package/src/components/DataDisplay/DataTable/components/TableHeaders/TableActionHeader.tsx +9 -4
  200. package/src/components/DataDisplay/DataTable/components/TablePagination.tsx +35 -0
  201. package/src/components/DataDisplay/DataTable/components/TableView.tsx +5 -1
  202. package/src/components/DataDisplay/EmptyIllustration/EmptyIllustration.tsx +31 -0
  203. package/src/components/DataDisplay/ReactJoyride/ReactJoyride.tsx +64 -0
  204. package/src/components/DataDisplay/Separator/Separator.tsx +32 -0
  205. package/src/components/DataDisplay/Skeleton/Skeleton.tsx +20 -0
  206. package/src/components/DataDisplay/StatusCard/StatusCard.tsx +36 -0
  207. package/src/components/DataDisplay/Timeline/Timeline.tsx +58 -0
  208. package/src/components/DataDisplay/Typography/Typography.tsx +25 -0
  209. package/src/components/Feedback/Alert/Alert.tsx +38 -0
  210. package/src/components/Feedback/Snackbar/Snackbar.tsx +54 -0
  211. package/src/components/Feedback/Spinner/Spinner.tsx +15 -0
  212. package/src/components/Feedback/Tooltip/Tooltip.tsx +54 -0
  213. package/src/components/Input/Button/Button.tsx +26 -0
  214. package/src/components/Input/DatePicker/DatePicker.tsx +41 -0
  215. package/src/components/Input/DateTimePicker/DateTimePicker.tsx +42 -0
  216. package/src/components/Input/FileUpload/FileUpload.tsx +41 -0
  217. package/src/components/Input/FormActions/FormActions.tsx +37 -0
  218. package/src/components/Input/FormControlWrapper/FormControlWrapper.tsx +31 -0
  219. package/src/components/Input/FormWrapper/FormWrapper.tsx +20 -0
  220. package/src/components/Input/HelpButton/HelpButton.tsx +14 -0
  221. package/src/components/Input/IconButtons/IconButtons/DeleteButton.tsx +16 -0
  222. package/src/components/Input/IconButtons/IconButtons/EditButton.tsx +16 -0
  223. package/src/components/Input/IconButtons/IconButtons/RedirectButton.tsx +16 -0
  224. package/src/components/Input/IconButtons/IconButtons/ViewButton.tsx +16 -0
  225. package/src/components/Input/IconButtons/IconButtons.tsx +18 -0
  226. package/src/components/Input/LabelWrapper/LabelWrapper.tsx +26 -0
  227. package/src/components/Input/MultiCheckBox/MultiCheckBox.tsx +34 -0
  228. package/src/components/Input/MultiSelect/MultiSelect.tsx +40 -0
  229. package/src/components/Input/OtpInput/OtpInput.tsx +29 -0
  230. package/src/components/Input/PasswordField/PasswordField.tsx +34 -0
  231. package/src/components/Input/RadioGroup/RadioGroup.tsx +38 -0
  232. package/src/components/Input/SearchBar/SearchBar.tsx +26 -0
  233. package/src/components/Input/Select/Select.tsx +41 -0
  234. package/src/components/Input/SingleCheckBox/SingleCheckBox.tsx +29 -0
  235. package/src/components/Input/SingleSelect/SingleSelect.tsx +40 -0
  236. package/src/components/Input/Switch/Switch.tsx +23 -0
  237. package/src/components/Input/Tags/Tags.tsx +26 -0
  238. package/src/components/Input/TextField/TextField.tsx +35 -0
  239. package/src/components/Input/Textarea/Textarea.tsx +36 -0
  240. package/src/components/Layout/AppLayout/AppLayout.tsx +34 -11
  241. package/src/components/Layout/AppLayout/components/MenuToggleButton.tsx +16 -0
  242. package/src/components/Layout/AppLayout/components/Sidebar/MenuBar.tsx +26 -0
  243. package/src/components/Layout/AppLayout/components/Sidebar/MenuItem.tsx +51 -1
  244. package/src/components/Layout/AppLayout/components/Sidebar/Sidebar.tsx +173 -104
  245. package/src/components/Layout/AppLayout/components/Sidebar/StyledComponents.tsx +139 -9
  246. package/src/components/Layout/AppLayout/components/UserProfilePopup.tsx +35 -1
  247. package/src/components/Layout/AppLayout/context/SidebarContext.tsx +48 -0
  248. package/src/components/Layout/AppLayout/types.ts +1 -1
  249. package/src/components/Layout/PageContent/PageContent.tsx +23 -3
  250. package/src/components/Layout/PageHeader/PageHeader.tsx +68 -7
  251. package/src/components/Layout/PageHeader/components/SearchBar.tsx +22 -0
  252. package/src/components/Layout/UserBox/UserBox.tsx +40 -0
  253. package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +53 -4
  254. package/src/components/Navigation/Calendar/Calendar.tsx +63 -0
  255. package/src/components/Navigation/ConfirmDialog/ConfirmDialog.tsx +64 -0
  256. package/src/components/Navigation/Dialog/Dialog.tsx +62 -2
  257. package/src/components/Navigation/DialogButton/DialogButton.tsx +64 -0
  258. package/src/components/Navigation/DropDownMenu/DropDownMenu.tsx +73 -0
  259. package/src/components/Navigation/PreviewFiles/PreviewFiles.tsx +93 -0
  260. package/src/components/Navigation/Stepper/Stepper.tsx +56 -10
  261. package/src/components/Navigation/TabsContainer/TabsContainer.tsx +86 -1
  262. package/src/components/Navigation/UploadDialog/UploadDialog.tsx +64 -0
  263. package/src/shadcn-components/Layout/Sheet/Sheet.tsx +2 -2
@@ -5,9 +5,29 @@ import { ReactNode } from 'react';
5
5
  interface PageContentProps {
6
6
  children: ReactNode;
7
7
  className?: string;
8
+ styles?: React.CSSProperties;
8
9
  }
9
10
 
10
- const PageContent = ({ children, className }: PageContentProps) => {
11
+ /**
12
+ * PageContent Component
13
+ *
14
+ * Main content area wrapper that provides responsive padding, scrolling behavior, and custom scrollbar styling.
15
+ * Automatically adjusts height based on screen size to account for page header and other UI elements.
16
+ * Includes thin scrollbar styling using Tailwind's scrollbar utilities.
17
+ *
18
+ * @param {React.ReactNode} children - Content to render inside the page content area
19
+ * @param {string} [className=''] - Additional CSS classes to apply to the container
20
+ *
21
+ * @returns {React.ReactElement} A scrollable content container with responsive height and styling
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <PageContent className="bg-white">
26
+ * <YourPageContent />
27
+ * </PageContent>
28
+ * ```
29
+ */
30
+ const PageContent = ({ children, className, styles }: PageContentProps) => {
11
31
  const isSmallScreen = useMediaQuery('(max-width: 768px)');
12
32
 
13
33
  return (
@@ -17,9 +37,9 @@ const PageContent = ({ children, className }: PageContentProps) => {
17
37
  className,
18
38
  )}
19
39
  style={{
20
- height: isSmallScreen ? 'calc(100vh - 101px)' : `calc(100vh - 90px)`,
21
- maxHeight: isSmallScreen ? 'calc(100vh - 101px)' : `calc(100vh - 90px)`,
40
+ height: isSmallScreen ? 'calc(100vh - 101px)' : `calc(100vh - 80px)`,
22
41
  overflowY: 'auto',
42
+ ...styles,
23
43
  }}
24
44
  >
25
45
  {children}
@@ -9,7 +9,10 @@ import { cn } from '@/lib/utils';
9
9
  import { EllipsisVertical, Funnel, Plus } from 'lucide-react';
10
10
  import { cloneElement, ReactElement, ReactNode } from 'react';
11
11
  import { useDispatch } from 'react-redux';
12
- import { setFilterByNameForUniqueId } from '../../../redux/slices/pageHeaderSlice';
12
+ import {
13
+ resetStateForUniqueId,
14
+ setFilterByNameForUniqueId,
15
+ } from '../../../redux/slices/pageHeaderSlice';
13
16
  import { SearchBarProps } from '../../Input/SearchBar/SearchBar';
14
17
  import { Breadcrumbs } from '../../Navigation/Breadcrumbs/Breadcrumbs';
15
18
  import { PageHeaderSearchBar } from './components/SearchBar';
@@ -33,6 +36,52 @@ interface PageHeaderProps {
33
36
  };
34
37
  }
35
38
 
39
+ /**
40
+ * PageHeader Component
41
+ *
42
+ * Header component for page content that displays breadcrumbs and action bar with search,
43
+ * filter, add button, and custom action menus. Supports Redux integration for maintaining
44
+ * search and filter state across re-renders. Responsive design with mobile optimization.
45
+ *
46
+ * @param {string} [uniqueId] - Optional unique identifier for Redux state management of this header
47
+ * @param {number} pathTrimCount - Number of path segments to trim from breadcrumb
48
+ * @param {React.ReactElement} [breadcrumbAction] - Optional element to display next to breadcrumbs
49
+ * @param {SearchBarProps & { uniqueId?: string; searchText?: string }} [searchBarProps] - Configuration for search bar including placeholder
50
+ * @param {{
51
+ * label?: string;
52
+ * startIcon?: React.ReactNode;
53
+ * components: React.ReactElement[];
54
+ * }} [filterButtonProps] - Configuration for filter dropdown with filter components
55
+ * @param {{
56
+ * label?: string;
57
+ * onClick: () => void;
58
+ * }} [addButtonProps] - Configuration for add/create button
59
+ * @param {{
60
+ * menu: React.ReactNode[] | ((props: { close: () => void }) => React.ReactNode[]);
61
+ * }} [actionProps] - Configuration for additional action menu
62
+ *
63
+ * @returns {React.ReactElement} A responsive header with breadcrumbs and action controls
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <PageHeader
68
+ * uniqueId="users-list"
69
+ * pathTrimCount={1}
70
+ * searchBarProps={{
71
+ * placeholder: "Search users...",
72
+ * uniqueId: "users-list"
73
+ * }}
74
+ * filterButtonProps={{
75
+ * label: "Filters",
76
+ * components: [<StatusFilter />, <RoleFilter />]
77
+ * }}
78
+ * addButtonProps={{
79
+ * label: "Add User",
80
+ * onClick: handleAddUser
81
+ * }}
82
+ * />
83
+ * ```
84
+ */
36
85
  const PageHeader = ({
37
86
  uniqueId,
38
87
  pathTrimCount,
@@ -98,12 +147,24 @@ const PageHeader = ({
98
147
  useMenuSlot={true}
99
148
  menuSlot={() => (
100
149
  <div className="flex flex-col gap-2 p-1 w-80">
101
- <Typography
102
- variant={'lead'}
103
- className="flex gap-1 items-center p-1 pb-0 text-sm"
104
- >
105
- <Funnel size={16} /> Advanced Filters
106
- </Typography>
150
+ <div className="flex justify-between">
151
+ <Typography
152
+ variant={'lead'}
153
+ className="flex gap-1 items-center p-1 pb-0 text-sm"
154
+ >
155
+ <Funnel size={16} /> Advanced Filters
156
+ </Typography>
157
+ <Button
158
+ variant={'link'}
159
+ size={'sm'}
160
+ className="text-destructive hover:no-underline"
161
+ onClick={() =>
162
+ dispatch(resetStateForUniqueId({ uniqueId }))
163
+ }
164
+ >
165
+ Clear
166
+ </Button>
167
+ </div>
107
168
  <Separator />
108
169
  {filterButtonProps.components.map((component, index) => (
109
170
  <div key={index} className="w-full ">
@@ -3,6 +3,28 @@ import { setSearchForUniqueId } from '../../../../redux/slices/pageHeaderSlice';
3
3
  import { RootState } from '../../../../redux/store';
4
4
  import { SearchBar, type SearchBarProps } from '../../../export';
5
5
 
6
+ /**
7
+ * PageHeaderSearchBar Component
8
+ *
9
+ * Redux-integrated search bar component that automatically manages search state in Redux store.
10
+ * The search value is persisted and retrieved using the provided uniqueId, allowing search state
11
+ * to survive component re-renders and navigation.
12
+ *
13
+ * @param {string} [uniqueId='default'] - Unique identifier for Redux state persistence (should match PageHeader uniqueId)
14
+ * @param {string} [searchText='Search'] - Placeholder text for the search input
15
+ * @param {SearchBarProps} props - Additional SearchBar component props
16
+ *
17
+ * @returns {React.ReactElement} A controlled search bar connected to Redux store
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <PageHeaderSearchBar
22
+ * uniqueId="users-list"
23
+ * searchText="Search users..."
24
+ * onSearch={handleSearch}
25
+ * />
26
+ * ```
27
+ */
6
28
  export const PageHeaderSearchBar = ({
7
29
  uniqueId = 'default',
8
30
  searchText = 'Search',
@@ -5,6 +5,46 @@ import { Typography } from '../../DataDisplay/Typography/Typography';
5
5
  import { DropdownMenu } from '../../Navigation/DropDownMenu/DropDownMenu';
6
6
  import { DropdownMenuItem } from '../../Navigation/DropDownMenu/DropdownMenuItem';
7
7
 
8
+ /**
9
+ * UserBox Component
10
+ *
11
+ * User profile information and dropdown menu component with customizable sections.
12
+ * Displays user avatar with fallback to initials, supports optional designation,
13
+ * active devices toggle, custom actions, and logout. Avatar click can trigger
14
+ * custom handler or open the dropdown menu.
15
+ *
16
+ * @param {string} fullName - User's full name (required, used for avatar initials and display)
17
+ * @param {string} [designation=''] - User's job designation or title (optional)
18
+ * @param {any[]} [institutionsData] - Optional array of institution data (for future use)
19
+ * @param {React.ReactNode[]} actions - Array of custom menu item elements to include in dropdown
20
+ * @param {() => void} [onLogoutClick] - Callback handler when logout menu item is clicked
21
+ * @param {string} [profileUrl] - URL to user's profile image (uses initials fallback if not provided)
22
+ * @param {React.ReactNode} [changePassword] - Optional change password component/element
23
+ * @param {any} [profileSx={}] - Custom styles/className to apply to avatar element
24
+ * @param {boolean} [avatar=true] - Whether to show the avatar in the account menu section
25
+ * @param {boolean} [navigationIcon=true] - Whether to show the navigation icon next to account info
26
+ * @param {boolean} [showActiveDevices=true] - Whether to show the "Active Devices" menu item
27
+ * @param {() => void} [onAccountClick] - Callback handler when account section is clicked
28
+ * @param {() => void} [onActiveDevicesClick] - Callback handler when active devices item is clicked
29
+ * @param {() => void} [onChangeInstitutionClick] - Callback handler for changing institution (future use)
30
+ * @param {() => void} [onAvatarClick] - Callback handler when avatar is clicked (prevents menu opening if provided)
31
+ *
32
+ * @returns {React.ReactElement} A user profile dropdown menu component
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <UserBox
37
+ * fullName="John Doe"
38
+ * designation="Software Engineer"
39
+ * profileUrl="/avatars/john.jpg"
40
+ * onLogoutClick={handleLogout}
41
+ * onAccountClick={navigateToSettings}
42
+ * onActiveDevicesClick={showActiveDevices}
43
+ * actions={[<CustomMenuAction1 />, <CustomMenuAction2 />]}
44
+ * showActiveDevices={true}
45
+ * />
46
+ * ```
47
+ */
8
48
  export default function UserBox({
9
49
  fullName,
10
50
  onLogoutClick,
@@ -22,12 +22,45 @@ import { ReactElement } from 'react';
22
22
  import { getBreadcrumbsCharacter } from '../../../utils/export';
23
23
  import { MenuToggleButton } from '../../Layout/AppLayout/components/MenuToggleButton';
24
24
 
25
+ /**
26
+ * Props for the Breadcrumbs component
27
+ */
25
28
  export type BreadcrumbsProps = {
29
+ /** Number of path segments to trim from the beginning of the current URL path */
26
30
  pathTrimCount: number;
31
+ /** Optional CSS class names for the container element */
27
32
  containerClassName?: string;
33
+ /** Optional React element to render as an action button/component on the right side */
28
34
  action?: ReactElement;
29
35
  };
30
36
 
37
+ /**
38
+ * Breadcrumbs component that displays a navigation breadcrumb trail based on the current URL path.
39
+ *
40
+ * Automatically generates breadcrumb items from the URL pathname and displays them with navigation links.
41
+ * When there are more than 2 breadcrumb items, it shows the first item, a dropdown menu with middle items,
42
+ * and the last item to save space.
43
+ *
44
+ * @component
45
+ * @param {BreadcrumbsProps} props - The component props
46
+ * @param {number} props.pathTrimCount - Number of path segments to trim from the beginning of the URL path
47
+ * @param {string} [props.containerClassName] - Optional CSS class names to apply to the container div
48
+ * @param {ReactElement} [props.action] - Optional React element displayed on the right side of the breadcrumb
49
+ *
50
+ * @returns {React.ReactElement} A div containing the breadcrumb navigation component with a menu toggle button and breadcrumb list
51
+ *
52
+ * @example
53
+ * // Basic usage
54
+ * <Breadcrumbs pathTrimCount={1} />
55
+ *
56
+ * @example
57
+ * // With custom action button
58
+ * <Breadcrumbs
59
+ * pathTrimCount={2}
60
+ * action={<button>Export</button>}
61
+ * containerClassName="bg-gray-50 border-b"
62
+ * />
63
+ */
31
64
  export const Breadcrumbs = ({
32
65
  pathTrimCount,
33
66
  containerClassName,
@@ -58,11 +91,22 @@ export const Breadcrumbs = ({
58
91
  return breadcrumbItems.map((item, index) => (
59
92
  <BreadcrumbItem key={index}>
60
93
  {item.isLast ? (
61
- <BreadcrumbPage>{item.label}</BreadcrumbPage>
94
+ <BreadcrumbPage>
95
+ <Typography variant={'small'} className="text-semibold">
96
+ {item.label}
97
+ </Typography>
98
+ </BreadcrumbPage>
62
99
  ) : (
63
100
  <>
64
101
  <BreadcrumbLink asChild>
65
- <Link to={item.path}>{item.label}</Link>
102
+ <Link to={item.path}>
103
+ <Typography
104
+ variant={'small'}
105
+ className="text-semibold text-muted-foreground"
106
+ >
107
+ {item.label}
108
+ </Typography>
109
+ </Link>
66
110
  </BreadcrumbLink>
67
111
  <BreadcrumbSeparator />
68
112
  </>
@@ -80,7 +124,10 @@ export const Breadcrumbs = ({
80
124
  <BreadcrumbItem>
81
125
  <BreadcrumbLink asChild>
82
126
  <Link to={firstItem.path}>
83
- <Typography variant={'small'} className="text-muted-foreground">
127
+ <Typography
128
+ variant={'small'}
129
+ className="text-semibold text-muted-foreground"
130
+ >
84
131
  {firstItem.label}
85
132
  </Typography>
86
133
  </Link>
@@ -104,7 +151,9 @@ export const Breadcrumbs = ({
104
151
  </BreadcrumbItem>
105
152
  <BreadcrumbItem>
106
153
  <BreadcrumbPage>
107
- <Typography variant={'small'}>{lastItem.label}</Typography>
154
+ <Typography variant={'small'} className="text-semibold">
155
+ {lastItem.label}
156
+ </Typography>
108
157
  </BreadcrumbPage>
109
158
  </BreadcrumbItem>
110
159
  </>
@@ -8,6 +8,69 @@ import { cn } from '../../../lib/utils';
8
8
  import './Calendar.css';
9
9
  import { CalendarProps } from './types';
10
10
 
11
+ /**
12
+ * Calendar component that provides a fully-featured calendar interface with FullCalendar integration.
13
+ *
14
+ * This component displays an interactive calendar with support for events, drag-and-drop,
15
+ * resizing, and various view modes (month, week, day). It offers extensive customization options
16
+ * for appearance, behavior, and event handling.
17
+ *
18
+ * @component
19
+ * @param {CalendarProps} props - The component props
20
+ * @param {CalendarEvent[]} [props.events] - Array of calendar events to display. Defaults to empty array
21
+ * @param {(eventInfo: CalendarEventClickInfo) => void} [props.onEventClick] - Callback fired when an event is clicked
22
+ * @param {(dropInfo: CalendarEventDropInfo) => void} [props.onEventDrop] - Callback fired when an event is drag-dropped
23
+ * @param {(resizeInfo: CalendarEventResizeInfo) => void} [props.onEventResize] - Callback fired when an event is resized
24
+ * @param {(dateInfo: CalendarDateClickInfo) => void} [props.onDateClick] - Callback fired when a date is clicked
25
+ * @param {(selectInfo: CalendarDateSelectInfo) => void} [props.onDateSelect] - Callback fired when a date range is selected
26
+ * @param {(events: EventApi[]) => void} [props.onEventsSet] - Callback fired when the list of events changes
27
+ * @param {CalendarView} [props.initialView='dayGridMonth'] - Initial view mode to display (dayGridMonth, timeGridWeek, timeGridDay, listWeek)
28
+ * @param {CalendarView[]} [props.views] - Array of available view modes to show in view switcher
29
+ * @param {CalendarHeaderToolbar | boolean} [props.headerToolbar] - Header toolbar configuration object or false to hide it
30
+ * @param {boolean} [props.editable=false] - Whether events can be dragged/resized to modify dates
31
+ * @param {boolean} [props.selectable=false] - Whether users can select date ranges by clicking and dragging
32
+ * @param {boolean} [props.selectMirror=true] - Whether to show a visual mirror while selecting date ranges
33
+ * @param {boolean} [props.eventResizable=false] - Whether events can be resized by dragging their edges
34
+ * @param {boolean} [props.eventDraggable=false] - Whether events can be dragged to change their dates
35
+ * @param {boolean | number} [props.dayMaxEvents=true] - Maximum number of events to show per day (true for auto, false for unlimited)
36
+ * @param {string | number} [props.height='auto'] - Height of the calendar (CSS string or number in pixels)
37
+ * @param {number} [props.aspectRatio] - Aspect ratio for the calendar dimensions
38
+ * @param {React.HTMLAttributes<HTMLDivElement>} [props.containerProps] - Additional HTML attributes for the container div
39
+ * @param {string} [props.locale='en'] - Locale/language code for calendar text (e.g., 'en', 'es', 'fr')
40
+ * @param {string} [props.timezone='local'] - Timezone for displaying dates ('local' or standard timezone identifier)
41
+ * @param {0 | 1 | 2 | 3 | 4 | 5 | 6} [props.firstDayOfWeek=0] - First day of the week (0=Sunday, 1=Monday, etc.)
42
+ * @param {(eventInfo: any) => React.ReactNode} [props.eventContent] - Custom render function for event content
43
+ * @param {(dayInfo: any) => React.ReactNode} [props.dayCellContent] - Custom render function for day cell content
44
+ * @param {boolean} [props.showNavigationButtons=true] - Whether to show previous/next navigation buttons
45
+ * @param {boolean} [props.showViewSwitcher=true] - Whether to show view mode selector buttons
46
+ * @param {boolean} [props.showToday=true] - Whether to show the "today" button
47
+ * @param {boolean} [props.weekends=true] - Whether to display weekend days
48
+ * @param {any} [props.businessHours] - Business hours configuration
49
+ * @param {any} [props.eventConstraint] - Constraint rules for event dragging
50
+ * @param {any} [props.selectConstraint] - Constraint rules for date selection
51
+ *
52
+ * @returns {React.ReactElement} A div container with the FullCalendar component
53
+ *
54
+ * @example
55
+ * // Basic calendar with events
56
+ * <Calendar
57
+ * events={[
58
+ * { id: '1', title: 'Meeting', start: '2024-01-15' }
59
+ * ]}
60
+ * onEventClick={(info) => console.log(info.event.title)}
61
+ * />
62
+ *
63
+ * @example
64
+ * // Editable calendar with custom height
65
+ * <Calendar
66
+ * events={events}
67
+ * editable={true}
68
+ * eventDraggable={true}
69
+ * eventResizable={true}
70
+ * height={600}
71
+ * onEventDrop={(info) => updateEventDate(info)}
72
+ * />
73
+ */
11
74
  export const Calendar: React.FC<CalendarProps> = ({
12
75
  events = [],
13
76
 
@@ -3,22 +3,86 @@ import { Typography } from '@/shadcn-components/DataDisplay/Typography/Typograph
3
3
  import { Button } from '@/shadcn-components/Input/Button/Button';
4
4
  import { AnimatedGIFs } from '../../../assets/images/gif';
5
5
 
6
+ /**
7
+ * Type definition for the kind of confirmation dialog
8
+ */
6
9
  export type ConfirmDialogType = 'confirm' | 'delete';
7
10
 
11
+ /**
12
+ * Available max-width sizes for the dialog
13
+ */
8
14
  type MaxWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
9
15
 
16
+ /**
17
+ * Props for the ConfirmDialog component
18
+ */
10
19
  export type ConfirmDialogProps = {
20
+ /** Whether the dialog is open and visible */
11
21
  isOpen: boolean;
22
+ /** Title text displayed in the dialog header */
12
23
  title: string;
24
+ /** Message/description text displayed in the dialog */
13
25
  message: string;
26
+ /** Callback function triggered when the user confirms the action */
14
27
  onConfirm: () => void;
28
+ /** Callback function triggered when the user cancels the dialog */
15
29
  onCancel: () => void;
30
+ /** Type of confirmation dialog - 'confirm' for general confirmations, 'delete' for destructive actions */
16
31
  type: ConfirmDialogType;
32
+ /** Custom text for the confirm button. Defaults to 'Confirm Delete' for delete type, 'Confirm' otherwise */
17
33
  confirmButtonText?: string;
34
+ /** Custom text for the cancel button. Defaults to 'Cancel' */
18
35
  cancelButtonText?: string;
36
+ /** Max-width size class of the dialog. Defaults to 'xl' */
19
37
  maxWidth?: MaxWidthSize;
20
38
  };
21
39
 
40
+ /**
41
+ * ConfirmDialog component that displays a modal confirmation dialog with custom title, message, and action buttons.
42
+ *
43
+ * This component provides a user-friendly confirmation interface with support for two types:
44
+ * 'confirm' for general confirmations and 'delete' for destructive operations. The dialog
45
+ * includes an animated GIF icon that changes based on the dialog type.
46
+ *
47
+ * @component
48
+ * @param {ConfirmDialogProps} props - The component props
49
+ * @param {boolean} props.isOpen - Whether the dialog is currently open
50
+ * @param {string} props.title - Dialog title text
51
+ * @param {string} props.message - Dialog message/body text
52
+ * @param {() => void} props.onConfirm - Callback fired when the confirm button is clicked
53
+ * @param {() => void} props.onCancel - Callback fired when the cancel button is clicked or dialog is closed
54
+ * @param {ConfirmDialogType} props.type - Dialog type ('confirm' or 'delete') which affects styling and default text
55
+ * @param {string} [props.confirmButtonText] - Custom text for confirm button
56
+ * @param {string} [props.cancelButtonText] - Custom text for cancel button
57
+ * @param {MaxWidthSize} [props.maxWidth='xl'] - Maximum width of the dialog
58
+ *
59
+ * @returns {React.ReactElement} A Dialog component with header, message, and action buttons
60
+ *
61
+ * @example
62
+ * // Basic confirmation dialog
63
+ * <ConfirmDialog
64
+ * isOpen={isOpen}
65
+ * type="confirm"
66
+ * title="Confirm Action"
67
+ * message="Are you sure you want to proceed?"
68
+ * onConfirm={() => handleAction()}
69
+ * onCancel={() => setIsOpen(false)}
70
+ * />
71
+ *
72
+ * @example
73
+ * // Delete confirmation dialog with custom buttons
74
+ * <ConfirmDialog
75
+ * isOpen={deleteOpen}
76
+ * type="delete"
77
+ * title="Delete Item"
78
+ * message="This action cannot be undone. All data will be permanently deleted."
79
+ * confirmButtonText="Yes, Delete"
80
+ * cancelButtonText="Keep Item"
81
+ * onConfirm={() => deleteItem()}
82
+ * onCancel={() => setDeleteOpen(false)}
83
+ * maxWidth="md"
84
+ * />
85
+ */
22
86
  export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
23
87
  isOpen,
24
88
  title,
@@ -1,18 +1,78 @@
1
- import { DialogHeader, Dialog as ShadcnDialog, DialogContent as ShadcnDialogContent, DialogTitle as ShadcnDialogTitle } from '@/shadcn-components/DataDisplay/Dialog/Dialog';
1
+ import {
2
+ DialogHeader,
3
+ Dialog as ShadcnDialog,
4
+ DialogContent as ShadcnDialogContent,
5
+ DialogTitle as ShadcnDialogTitle,
6
+ } from '@/shadcn-components/DataDisplay/Dialog/Dialog';
2
7
  import { ReactNode } from 'react';
3
8
 
9
+ /**
10
+ * Available max-width sizes for the dialog
11
+ */
4
12
  type MaxWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
5
13
 
14
+ /**
15
+ * Props for the Dialog component
16
+ */
6
17
  type DialogProps = {
18
+ /** Function that renders the dialog content. Receives close callback to allow closing from within content */
7
19
  content: (props: { close: () => void }) => ReactNode;
20
+ /** Optional title displayed in the dialog header */
8
21
  title?: string | undefined;
22
+ /** Callback function triggered when the dialog is closed */
9
23
  onClose: () => void;
24
+ /** Whether the dialog is open and visible */
10
25
  open: boolean;
26
+ /** Optional CSS class names for the dialog content element */
11
27
  className?: string;
28
+ /** Whether to show the close button in the dialog header. Defaults to true */
12
29
  showCloseButton?: boolean;
30
+ /** Max-width size class of the dialog. Defaults to 'lg' */
13
31
  maxWidth?: MaxWidthSize;
14
32
  };
15
33
 
34
+ /**
35
+ * Dialog component that wraps shadcn/ui Dialog with additional features and sensible defaults.
36
+ *
37
+ * This component provides a controlled dialog with optional header, configurable width,
38
+ * and flexible content rendering with a close callback for self-closing from within the content.
39
+ *
40
+ * @component
41
+ * @param {DialogProps} props - The component props
42
+ * @param {(props: { close: () => void }) => ReactNode} props.content - Render function for dialog content
43
+ * @param {() => void} props.onClose - Callback fired when the dialog is closed
44
+ * @param {boolean} props.open - Whether the dialog is currently open
45
+ * @param {string} [props.title] - Optional dialog title
46
+ * @param {string} [props.className] - Optional CSS classes for the dialog content
47
+ * @param {boolean} [props.showCloseButton=true] - Whether to show the close button
48
+ * @param {MaxWidthSize} [props.maxWidth='lg'] - Maximum width of the dialog
49
+ *
50
+ * @returns {React.ReactElement} A Dialog component with optional header and flexible content
51
+ *
52
+ * @example
53
+ * // Simple dialog with title
54
+ * <Dialog
55
+ * open={isOpen}
56
+ * title="Delete Item"
57
+ * onClose={() => setIsOpen(false)}
58
+ * content={({ close }) => (
59
+ * <div>
60
+ * <p>Are you sure?</p>
61
+ * <button onClick={close}>Cancel</button>
62
+ * </div>
63
+ * )}
64
+ * />
65
+ *
66
+ * @example
67
+ * // Dialog without title and custom width
68
+ * <Dialog
69
+ * open={showDialog}
70
+ * onClose={handleClose}
71
+ * maxWidth="sm"
72
+ * showCloseButton={false}
73
+ * content={({ close }) => <FormComponent onSubmit={close} />}
74
+ * />
75
+ */
16
76
  const Dialog = ({
17
77
  onClose,
18
78
  title,
@@ -45,7 +105,7 @@ const Dialog = ({
45
105
  showCloseButton={showCloseButton}
46
106
  >
47
107
  {title && (
48
- <DialogHeader className="pl-4 pt-4">
108
+ <DialogHeader className="pl-4 py-4 border-b">
49
109
  <ShadcnDialogTitle>{title}</ShadcnDialogTitle>
50
110
  </DialogHeader>
51
111
  )}
@@ -6,19 +6,83 @@ import {
6
6
  } from '@/shadcn-components/DataDisplay/Dialog/Dialog';
7
7
  import { ReactNode, useState } from 'react';
8
8
 
9
+ /**
10
+ * Available max-width sizes for the dialog
11
+ */
9
12
  type MaxWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
10
13
 
14
+ /**
15
+ * Props for the DialogButton component
16
+ */
11
17
  export type DialogButtonProps = {
18
+ /** Function that renders the dialog trigger element. Receives open callback to open the dialog */
12
19
  anchor: (props: { open: () => void }) => ReactNode;
20
+ /** Optional callback fired when the dialog opens */
13
21
  onDialogOpen?: () => void;
22
+ /** Optional callback fired when the dialog closes */
14
23
  onDialogClose?: () => void;
24
+ /** Function that renders the dialog content. Receives close callback to close the dialog */
15
25
  content: (props: { close: () => void }) => ReactNode;
26
+ /** Optional title displayed in the dialog header */
16
27
  title?: string | undefined;
28
+ /** Optional CSS class names for the dialog content element */
17
29
  className?: string;
30
+ /** Whether to show the close button in the dialog header. Defaults to true */
18
31
  showCloseButton?: boolean;
32
+ /** Max-width size class of the dialog. Defaults to 'lg' */
19
33
  maxWidth?: MaxWidthSize;
20
34
  };
21
35
 
36
+ /**
37
+ * DialogButton component that combines a trigger element and a dialog in a single component.
38
+ *
39
+ * This is a convenient wrapper that manages its own open/close state and provides
40
+ * a clean API for rendering both the trigger (anchor) and the dialog content.
41
+ * It's useful when you want to bind a button or other trigger element with a dialog
42
+ * without managing state at the parent level.
43
+ *
44
+ * @component
45
+ * @param {DialogButtonProps} props - The component props
46
+ * @param {(props: { open: () => void }) => ReactNode} props.anchor - Render function for the trigger element
47
+ * @param {(props: { close: () => void }) => ReactNode} props.content - Render function for dialog content
48
+ * @param {string} [props.title] - Optional dialog title
49
+ * @param {() => void} [props.onDialogOpen] - Optional callback fired when the dialog opens
50
+ * @param {() => void} [props.onDialogClose] - Optional callback fired when the dialog closes
51
+ * @param {string} [props.className] - Optional CSS classes for the dialog content
52
+ * @param {boolean} [props.showCloseButton=true] - Whether to show the close button
53
+ * @param {MaxWidthSize} [props.maxWidth='lg'] - Maximum width of the dialog
54
+ *
55
+ * @returns {React.ReactElement} A fragment containing the anchor element and the Dialog
56
+ *
57
+ * @example
58
+ * // Button that opens a dialog with a form
59
+ * <DialogButton
60
+ * anchor={({ open }) => <button onClick={open}>Edit Profile</button>}
61
+ * title="Edit Profile"
62
+ * content={({ close }) => (
63
+ * <form onSubmit={(e) => { handleSubmit(e); close(); }}>
64
+ * <input type="text" placeholder="Name" />
65
+ * <button type="submit">Save</button>
66
+ * </form>
67
+ * )}
68
+ * />
69
+ *
70
+ * @example
71
+ * // With callbacks and custom styling
72
+ * <DialogButton
73
+ * anchor={({ open }) => <IconButton icon={<EditIcon />} onClick={open} />}
74
+ * title="Delete Item"
75
+ * maxWidth="sm"
76
+ * onDialogOpen={() => console.log('Dialog opened')}
77
+ * onDialogClose={() => console.log('Dialog closed')}
78
+ * content={({ close }) => (
79
+ * <div>
80
+ * <p>Are you sure?</p>
81
+ * <button onClick={close}>Cancel</button>
82
+ * </div>
83
+ * )}
84
+ * />
85
+ */
22
86
  export const DialogButton = ({
23
87
  onDialogClose,
24
88
  onDialogOpen,