cortex-react-components 2.26.5 → 2.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (407) hide show
  1. package/dist/{chunk-O24GFE6Q.mjs → chunk-24R7CI5Q.mjs} +1 -1
  2. package/dist/{chunk-KBLVWXLK.mjs → chunk-27XIU7FW.mjs} +1 -1
  3. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  4. package/dist/{chunk-RR4QSUV2.mjs → chunk-2IMY4VWR.mjs} +1 -1
  5. package/dist/{chunk-HTS3KCJL.mjs → chunk-2O54GV6Q.mjs} +1 -1
  6. package/dist/{chunk-2GM2LPLB.mjs → chunk-2R3ECSWF.mjs} +1 -1
  7. package/dist/chunk-32G45Z2G.mjs +1 -0
  8. package/dist/{chunk-GAZHKHGB.mjs → chunk-43YJ2VYN.mjs} +1 -1
  9. package/dist/{chunk-GULRIPMU.mjs → chunk-4FEVXBNU.mjs} +1 -1
  10. package/dist/{chunk-FYQBRCQM.mjs → chunk-4ITG3T35.mjs} +1 -1
  11. package/dist/{chunk-LHO4WFYP.mjs → chunk-5FWH5YVM.mjs} +1 -1
  12. package/dist/{chunk-QUMUO63J.mjs → chunk-633ESSXN.mjs} +1 -1
  13. package/dist/{chunk-HDKHF3EA.mjs → chunk-6L7VJ7IH.mjs} +1 -1
  14. package/dist/chunk-6UULUGR2.mjs +1 -0
  15. package/dist/{chunk-JCWFPKF3.mjs → chunk-6VRPQKAK.mjs} +1 -1
  16. package/dist/{chunk-FMXCT6LU.mjs → chunk-75HU5Q6A.mjs} +1 -1
  17. package/dist/{chunk-BGQC6IQK.mjs → chunk-AMAB4E2X.mjs} +1 -1
  18. package/dist/{chunk-4SRUEQTP.mjs → chunk-B63FA7LF.mjs} +1 -1
  19. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  20. package/dist/{chunk-F6DMXMR4.mjs → chunk-CXHPLJDO.mjs} +1 -1
  21. package/dist/{chunk-CDVRH3MC.mjs → chunk-D44OXIPN.mjs} +1 -1
  22. package/dist/{chunk-P6OSMPUQ.mjs → chunk-D76LTQRD.mjs} +1 -1
  23. package/dist/chunk-DNMM3Q72.mjs +9 -0
  24. package/dist/{chunk-F64CA5CH.mjs → chunk-DTKZ3I6Z.mjs} +1 -1
  25. package/dist/{chunk-PNUBVBSR.mjs → chunk-FRYADWTQ.mjs} +1 -1
  26. package/dist/chunk-G3BOVXUM.mjs +4 -0
  27. package/dist/{chunk-2OOJ4ZFB.mjs → chunk-GRNOF6LY.mjs} +1 -1
  28. package/dist/{chunk-PTZT4QJW.mjs → chunk-GXVC6ETI.mjs} +1 -1
  29. package/dist/{chunk-IQQ7ZWCP.mjs → chunk-I6D5JCNY.mjs} +1 -1
  30. package/dist/{chunk-JVTCOOUV.mjs → chunk-I75OOO4H.mjs} +1 -1
  31. package/dist/{chunk-MO4HRQEL.mjs → chunk-IBC5Z55T.mjs} +1 -1
  32. package/dist/{chunk-KVLUT4U2.mjs → chunk-IFUIQ57U.mjs} +1 -1
  33. package/dist/chunk-IMRGPVFS.mjs +1 -0
  34. package/dist/{chunk-NXAQ6ESJ.mjs → chunk-JDIPWJBD.mjs} +1 -1
  35. package/dist/{chunk-R6AYIVIR.mjs → chunk-KAAHIHZK.mjs} +1 -1
  36. package/dist/{chunk-5NIEZE7A.mjs → chunk-KBEXWUKI.mjs} +1 -1
  37. package/dist/{chunk-EHSOO47V.mjs → chunk-KEOMDWUC.mjs} +1 -1
  38. package/dist/{chunk-CKU2T3AN.mjs → chunk-LBVWIF2J.mjs} +1 -1
  39. package/dist/chunk-LEZ6G4X7.mjs +4 -0
  40. package/dist/{chunk-BQQ4V4PX.mjs → chunk-LKUK55GC.mjs} +1 -1
  41. package/dist/{chunk-WLI2YTOQ.mjs → chunk-MDIJOHFV.mjs} +1 -1
  42. package/dist/{chunk-P7S6XFU4.mjs → chunk-MX3JKY3V.mjs} +1 -1
  43. package/dist/{chunk-HKMNAXLM.mjs → chunk-MX6GXHJJ.mjs} +1 -1
  44. package/dist/{chunk-FEWOSBUJ.mjs → chunk-NJ7PW5T7.mjs} +1 -1
  45. package/dist/{chunk-EFNFK7TR.mjs → chunk-O3BCESMN.mjs} +1 -1
  46. package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
  47. package/dist/{chunk-X2JWNPWT.mjs → chunk-O5QXPC23.mjs} +1 -1
  48. package/dist/{chunk-5EM6P7SU.mjs → chunk-OQBCIB4L.mjs} +1 -1
  49. package/dist/{chunk-GETYSIZV.mjs → chunk-ORODSHZN.mjs} +1 -1
  50. package/dist/{chunk-AN744MXS.mjs → chunk-OWL3KUE3.mjs} +1 -1
  51. package/dist/{chunk-RIRZRO6U.mjs → chunk-P55W6AFU.mjs} +1 -1
  52. package/dist/{chunk-HD6E7KI2.mjs → chunk-RCI3L3M5.mjs} +1 -1
  53. package/dist/{chunk-T5HJS6OF.mjs → chunk-RSDUFAIB.mjs} +1 -1
  54. package/dist/{chunk-5EKGFFJD.mjs → chunk-SADWUWLZ.mjs} +1 -1
  55. package/dist/{chunk-CMU5JFUC.mjs → chunk-SWE754OC.mjs} +1 -1
  56. package/dist/{chunk-BDDEMCAH.mjs → chunk-SZXMQMZ6.mjs} +1 -1
  57. package/dist/{chunk-7TSR2LQB.mjs → chunk-TIAA3ZN3.mjs} +1 -1
  58. package/dist/{chunk-RS4WAAGI.mjs → chunk-UBZYXZ7B.mjs} +1 -1
  59. package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
  60. package/dist/chunk-VFIMFZX5.mjs +1 -0
  61. package/dist/{chunk-IO5ZSALG.mjs → chunk-VKCDLKYH.mjs} +1 -1
  62. package/dist/{chunk-M527EJIX.mjs → chunk-WBDSOPDY.mjs} +1 -1
  63. package/dist/{chunk-7OMPPFGG.mjs → chunk-WDRL3N5V.mjs} +1 -1
  64. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  65. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  66. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  67. package/dist/{chunk-VTFO5GXK.mjs → chunk-XMYXQR5W.mjs} +1 -1
  68. package/dist/{chunk-RS4VD3ML.mjs → chunk-XQ3XV5DH.mjs} +1 -1
  69. package/dist/{chunk-3ANJOET7.mjs → chunk-XSCZQEYP.mjs} +1 -1
  70. package/dist/{chunk-AQQCH7Z2.mjs → chunk-XX4GSGRP.mjs} +1 -1
  71. package/dist/{chunk-U3FYDDE2.mjs → chunk-YG7SLO6G.mjs} +1 -1
  72. package/dist/chunk-YI6EQRWN.mjs +1 -0
  73. package/dist/{chunk-LLED3RQS.mjs → chunk-YPQUYIGO.mjs} +1 -1
  74. package/dist/{chunk-WH6JZSIA.mjs → chunk-YVXFRQPA.mjs} +1 -1
  75. package/dist/{chunk-ZG5N4C4S.mjs → chunk-ZA6MGTGM.mjs} +1 -1
  76. package/dist/chunk-ZLFZBT3K.mjs +1 -0
  77. package/dist/{chunk-HSQAHQNP.mjs → chunk-ZZFYIP6H.mjs} +1 -1
  78. package/dist/components/AdvancedComponents/AppSidebar.mjs +1 -1
  79. package/dist/components/AdvancedComponents/CommentSection.mjs +1 -1
  80. package/dist/components/AdvancedComponents/EditableField.mjs +1 -1
  81. package/dist/components/AdvancedComponents/app-header.mjs +1 -1
  82. package/dist/components/AdvancedComponents/index.d.ts +1 -0
  83. package/dist/components/AdvancedComponents/index.js +12 -1
  84. package/dist/components/AdvancedComponents/index.mjs +1 -1
  85. package/dist/components/AdvancedComponents/navigation-tabs.mjs +1 -1
  86. package/dist/components/AdvancedComponents/notifications-panel.mjs +1 -1
  87. package/dist/components/AdvancedComponents/org-chart-component/CompanyNode.d.ts +7 -0
  88. package/dist/components/AdvancedComponents/org-chart-component/CompanyNode.js +1 -0
  89. package/dist/components/AdvancedComponents/org-chart-component/CompanyNode.mjs +1 -0
  90. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.d.ts +17 -0
  91. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.js +12 -0
  92. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.mjs +1 -0
  93. package/dist/components/AdvancedComponents/org-chart-component/OrgNode.d.ts +3 -0
  94. package/dist/components/AdvancedComponents/org-chart-component/OrgNode.js +9 -0
  95. package/dist/components/AdvancedComponents/org-chart-component/OrgNode.mjs +1 -0
  96. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.d.ts +19 -0
  97. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.js +12 -0
  98. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.mjs +1 -0
  99. package/dist/components/AdvancedComponents/org-chart-component/examples/PayloadIntegration.js +233 -0
  100. package/dist/components/AdvancedComponents/org-chart-component/examples/PayloadIntegration.mjs +233 -0
  101. package/dist/components/AdvancedComponents/org-chart-component/index.d.ts +6 -0
  102. package/dist/components/AdvancedComponents/org-chart-component/index.js +12 -0
  103. package/dist/components/AdvancedComponents/org-chart-component/index.mjs +1 -0
  104. package/dist/components/AdvancedComponents/org-chart-component/mockData.d.ts +9 -0
  105. package/dist/components/AdvancedComponents/org-chart-component/mockData.js +1 -0
  106. package/dist/components/AdvancedComponents/org-chart-component/mockData.mjs +1 -0
  107. package/dist/components/AdvancedComponents/org-chart-component/types/index.d.ts +33 -0
  108. package/dist/components/AdvancedComponents/org-chart-component/types/index.js +1 -0
  109. package/dist/components/AdvancedComponents/org-chart-component/types/index.mjs +1 -0
  110. package/dist/components/AdvancedComponents/org-chart-component/types.d.ts +42 -0
  111. package/dist/components/AdvancedComponents/org-chart-component/types.js +1 -0
  112. package/dist/components/AdvancedComponents/org-chart-component/types.mjs +1 -0
  113. package/dist/components/AdvancedComponents/org-chart-component/utils.d.ts +13 -0
  114. package/dist/components/AdvancedComponents/org-chart-component/utils.js +1 -0
  115. package/dist/components/AdvancedComponents/org-chart-component/utils.mjs +1 -0
  116. package/dist/components/AdvancedComponents/switch.mjs +1 -1
  117. package/dist/components/AdvancedComponents/theme-toggle.mjs +1 -1
  118. package/dist/components/AdvancedComponents/user-selection.mjs +1 -1
  119. package/dist/components/Blocks/Banner.mjs +1 -1
  120. package/dist/components/Blocks/CallToAction.mjs +1 -1
  121. package/dist/components/Blocks/CaseStudy.mjs +1 -1
  122. package/dist/components/Blocks/Code.client.mjs +1 -1
  123. package/dist/components/Blocks/Code.mjs +1 -1
  124. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  125. package/dist/components/Blocks/ConsultantProfile.mjs +1 -1
  126. package/dist/components/Blocks/Content.mjs +1 -1
  127. package/dist/components/Blocks/CopyButton.mjs +1 -1
  128. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  129. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  130. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  131. package/dist/components/Blocks/OrgChart.mjs +3 -1
  132. package/dist/components/Blocks/ProposalSummary.mjs +1 -1
  133. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  134. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  135. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  136. package/dist/components/Blocks/index.d.ts +0 -1
  137. package/dist/components/Blocks/index.js +1 -1
  138. package/dist/components/Blocks/index.mjs +1 -1
  139. package/dist/components/CRM/CogeBoard.mjs +1 -1
  140. package/dist/components/CRM/DealCard.mjs +1 -1
  141. package/dist/components/CRM/DealDetails.mjs +1 -1
  142. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  143. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  144. package/dist/components/CRM/NewCustomerForm.mjs +1 -1
  145. package/dist/components/CRM/NewDealForm.mjs +1 -1
  146. package/dist/components/CRM/index.mjs +1 -1
  147. package/dist/components/Cards/ContentCard.mjs +1 -1
  148. package/dist/components/Cards/CustomerCard.mjs +1 -1
  149. package/dist/components/Cards/EventCard.mjs +1 -1
  150. package/dist/components/Cards/FeatureCard.mjs +1 -1
  151. package/dist/components/Cards/HeroCard.mjs +1 -1
  152. package/dist/components/Cards/Image.mjs +1 -1
  153. package/dist/components/Cards/PricingCard.mjs +1 -1
  154. package/dist/components/Cards/ServiceCard.mjs +1 -1
  155. package/dist/components/Cards/index.mjs +1 -1
  156. package/dist/components/Chat/ChatInterface.js +10 -10
  157. package/dist/components/Chat/ChatInterface.mjs +1 -1
  158. package/dist/components/Chat/Components/ChatCardArtefact.mjs +1 -1
  159. package/dist/components/Chat/Components/ChatCardTask.mjs +1 -1
  160. package/dist/components/Chat/Components/Conversation.mjs +1 -1
  161. package/dist/components/Chat/Components/Message.js +1 -1
  162. package/dist/components/Chat/Components/Message.mjs +1 -1
  163. package/dist/components/Chat/CopilotInterface.js +6 -6
  164. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  165. package/dist/components/Chat/PartTypes/CodeBlock.mjs +1 -1
  166. package/dist/components/Chat/PartTypes/ColleagueHandoff.d.ts +18 -0
  167. package/dist/components/Chat/PartTypes/ColleagueHandoff.js +5 -0
  168. package/dist/components/Chat/PartTypes/ColleagueHandoff.mjs +2 -0
  169. package/dist/components/Chat/PartTypes/MessageHandler.js +6 -6
  170. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  171. package/dist/components/Chat/PartTypes/Reasoning.mjs +1 -1
  172. package/dist/components/Chat/PartTypes/Response.mjs +1 -1
  173. package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
  174. package/dist/components/Chat/PartTypes/index.d.ts +1 -0
  175. package/dist/components/Chat/PartTypes/index.js +8 -8
  176. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  177. package/dist/components/Chat/capability-menu.mjs +1 -1
  178. package/dist/components/Chat/chat-session-sidebar.mjs +1 -1
  179. package/dist/components/Chat/demo-long-messages.js +14 -14
  180. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  181. package/dist/components/Chat/demo-tests.js +42 -42
  182. package/dist/components/Chat/demo-tests.mjs +1 -1
  183. package/dist/components/Chat/demo.js +6 -6
  184. package/dist/components/Chat/demo.mjs +1 -1
  185. package/dist/components/Chat/example-usage.js +7 -7
  186. package/dist/components/Chat/example-usage.mjs +1 -1
  187. package/dist/components/Chat/example-with-file-uploads.mjs +1 -1
  188. package/dist/components/Chat/example-with-vercel-ai.js +6 -6
  189. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  190. package/dist/components/Chat/index.d.ts +0 -2
  191. package/dist/components/Chat/index.js +11 -14
  192. package/dist/components/Chat/index.mjs +1 -1
  193. package/dist/components/DeliveryLead/DeliveryLeadSubmission.mjs +1 -1
  194. package/dist/components/DeliveryLead/DeliveryLeadSubmissionList.mjs +1 -1
  195. package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.mjs +1 -1
  196. package/dist/components/DeliveryLead/index.mjs +1 -1
  197. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  198. package/dist/components/DigitalColleagues/DashboardHeader.mjs +1 -1
  199. package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
  200. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  201. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  202. package/dist/components/DigitalColleagues/SearchableSelect.mjs +1 -1
  203. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  204. package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
  205. package/dist/components/DigitalColleagues/Views/TeamsIndexView.mjs +1 -1
  206. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  207. package/dist/components/DigitalColleagues/colleague-card.mjs +1 -1
  208. package/dist/components/DigitalColleagues/colleague-form.mjs +1 -1
  209. package/dist/components/DigitalColleagues/colleague-type-selection.mjs +1 -1
  210. package/dist/components/DigitalColleagues/digital-colleague-clone.mjs +1 -1
  211. package/dist/components/DigitalColleagues/digital-colleague-options.mjs +1 -1
  212. package/dist/components/DigitalColleagues/document-edit.mjs +1 -1
  213. package/dist/components/DigitalColleagues/document-preview-examples.mjs +1 -1
  214. package/dist/components/DigitalColleagues/document-preview.mjs +1 -1
  215. package/dist/components/DigitalColleagues/index.mjs +1 -1
  216. package/dist/components/DigitalColleagues/knowledge-browser.mjs +1 -1
  217. package/dist/components/DigitalColleagues/knowledge-search.mjs +1 -1
  218. package/dist/components/DigitalColleagues/team-form.mjs +1 -1
  219. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  220. package/dist/components/Foundary/DashboardHeader.mjs +1 -1
  221. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  222. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  223. package/dist/components/Foundary/Knowledge/manage-team-context.mjs +1 -1
  224. package/dist/components/Foundary/LandingMenu.mjs +1 -1
  225. package/dist/components/Foundary/Login.mjs +1 -1
  226. package/dist/components/Foundary/MainPage.mjs +1 -1
  227. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  228. package/dist/components/Foundary/RichText/components/RawUploadComponent/index.mjs +1 -1
  229. package/dist/components/Foundary/RichText/index.mjs +1 -1
  230. package/dist/components/Foundary/RichText/nodes/image-node.mjs +1 -1
  231. package/dist/components/Foundary/RichText/plugins/image-plugin.mjs +1 -1
  232. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  233. package/dist/components/Foundary/SearchableSelect.mjs +1 -1
  234. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  235. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  236. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  237. package/dist/components/Foundary/Views/index.mjs +1 -1
  238. package/dist/components/Foundary/colleague-card.mjs +1 -1
  239. package/dist/components/Foundary/colleague-form.mjs +1 -1
  240. package/dist/components/Foundary/colleague-type-selection.mjs +1 -1
  241. package/dist/components/Foundary/document-edit.mjs +1 -1
  242. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  243. package/dist/components/Foundary/document-preview.mjs +1 -1
  244. package/dist/components/Foundary/file-edit.mjs +1 -1
  245. package/dist/components/Foundary/foundary-clone.mjs +1 -1
  246. package/dist/components/Foundary/foundary-layout.mjs +1 -1
  247. package/dist/components/Foundary/foundary-options.mjs +1 -1
  248. package/dist/components/Foundary/index.mjs +1 -1
  249. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  250. package/dist/components/Foundary/knowledge-search.mjs +1 -1
  251. package/dist/components/Foundary/team-form.mjs +1 -1
  252. package/dist/components/HeaderFooter/Footer.mjs +1 -1
  253. package/dist/components/HeaderFooter/Header.mjs +1 -1
  254. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  255. package/dist/components/HeaderFooter/HeaderMenu.mjs +1 -1
  256. package/dist/components/HeaderFooter/RelatedPagesMenu.mjs +1 -1
  257. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  258. package/dist/components/HeaderFooter/SimpleHeader.mjs +1 -1
  259. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  260. package/dist/components/HeaderFooter/enhanced-header.mjs +1 -1
  261. package/dist/components/HeaderFooter/index.mjs +1 -1
  262. package/dist/components/Heros/DashboardHero/DashboardHero.mjs +1 -1
  263. package/dist/components/Heros/DashboardHero/index.mjs +1 -1
  264. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  265. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  266. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  267. package/dist/components/Heros/PostHero/index.mjs +1 -1
  268. package/dist/components/Heros/RenderHero.mjs +1 -1
  269. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  270. package/dist/components/Heros/index.mjs +1 -1
  271. package/dist/components/Holidays/ApproveLeave.mjs +1 -1
  272. package/dist/components/Holidays/CalendarView.mjs +1 -1
  273. package/dist/components/Holidays/HolidayGrid.mjs +1 -1
  274. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  275. package/dist/components/Holidays/RequestLeave.mjs +1 -1
  276. package/dist/components/Holidays/index.mjs +1 -1
  277. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  278. package/dist/components/Layouts/Print.mjs +1 -1
  279. package/dist/components/Layouts/SlideShow.mjs +1 -1
  280. package/dist/components/Layouts/index.mjs +1 -1
  281. package/dist/components/Menus/Categories.mjs +1 -1
  282. package/dist/components/Menus/Filter.mjs +1 -1
  283. package/dist/components/Menus/ProjectTeam.mjs +1 -1
  284. package/dist/components/Menus/RelatedContent.mjs +1 -1
  285. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  286. package/dist/components/Menus/SidebarRight.mjs +1 -1
  287. package/dist/components/Menus/index.mjs +1 -1
  288. package/dist/components/Other/Container.mjs +1 -1
  289. package/dist/components/Other/index.mjs +1 -1
  290. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  291. package/dist/components/Payload/Link/index.mjs +1 -1
  292. package/dist/components/Payload/Media/index.mjs +1 -1
  293. package/dist/components/Payload/Pagination/index.mjs +1 -1
  294. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  295. package/dist/components/Payload/RichText/index.mjs +1 -1
  296. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  297. package/dist/components/Payload/index.mjs +1 -1
  298. package/dist/components/Projects/AddEpicModal.mjs +1 -1
  299. package/dist/components/Projects/AddFileModal.mjs +1 -1
  300. package/dist/components/Projects/AddSprintModal.mjs +1 -1
  301. package/dist/components/Projects/AddTaskModal.mjs +1 -1
  302. package/dist/components/Projects/EpicFilter.mjs +1 -1
  303. package/dist/components/Projects/EpicsView.mjs +1 -1
  304. package/dist/components/Projects/FileView.mjs +1 -1
  305. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  306. package/dist/components/Projects/KanbanColumn.mjs +1 -1
  307. package/dist/components/Projects/PlanningView.mjs +1 -1
  308. package/dist/components/Projects/ProjectPage.mjs +1 -1
  309. package/dist/components/Projects/ProjectView.mjs +1 -1
  310. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  311. package/dist/components/Projects/TaskCard.mjs +1 -1
  312. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  313. package/dist/components/Projects/TaskSelect.mjs +1 -1
  314. package/dist/components/Projects/TaskSidebar.mjs +1 -1
  315. package/dist/components/Projects/TasksView.mjs +1 -1
  316. package/dist/components/Projects/TeamSwitcher.mjs +1 -1
  317. package/dist/components/Projects/business-unit-switcher.mjs +1 -1
  318. package/dist/components/Projects/file-list.mjs +1 -1
  319. package/dist/components/Projects/index.mjs +1 -1
  320. package/dist/components/Projects/project-card.mjs +1 -1
  321. package/dist/components/Projects/project-form.mjs +1 -1
  322. package/dist/components/Projects/team-card.mjs +1 -1
  323. package/dist/components/Projects/team-switcher-bar.mjs +1 -1
  324. package/dist/components/dc-temp/creative.mjs +1 -1
  325. package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
  326. package/dist/components/dc-temp/index.mjs +1 -1
  327. package/dist/components/dc-temp/markdown-renderer.mjs +1 -1
  328. package/dist/components/index.js +31 -23
  329. package/dist/components/index.mjs +1 -1
  330. package/dist/components/ui/alert.mjs +1 -1
  331. package/dist/components/ui/avatar.mjs +1 -1
  332. package/dist/components/ui/badge.mjs +1 -1
  333. package/dist/components/ui/breadcrumb.mjs +1 -1
  334. package/dist/components/ui/button.mjs +1 -1
  335. package/dist/components/ui/calendar.mjs +1 -1
  336. package/dist/components/ui/card.mjs +1 -1
  337. package/dist/components/ui/checkbox.mjs +1 -1
  338. package/dist/components/ui/command.mjs +1 -1
  339. package/dist/components/ui/dialog.mjs +1 -1
  340. package/dist/components/ui/dropdown-menu.mjs +1 -1
  341. package/dist/components/ui/hover-card.mjs +1 -1
  342. package/dist/components/ui/index.mjs +1 -1
  343. package/dist/components/ui/input.mjs +1 -1
  344. package/dist/components/ui/inputs/common/styles/index.mjs +1 -1
  345. package/dist/components/ui/inputs/text-input/index.mjs +1 -1
  346. package/dist/components/ui/inputs/textarea-input/index.mjs +1 -1
  347. package/dist/components/ui/label.mjs +1 -1
  348. package/dist/components/ui/pagination.mjs +1 -1
  349. package/dist/components/ui/popover.mjs +1 -1
  350. package/dist/components/ui/progress.mjs +1 -1
  351. package/dist/components/ui/scroll-area.mjs +1 -1
  352. package/dist/components/ui/select.mjs +1 -1
  353. package/dist/components/ui/separator.mjs +1 -1
  354. package/dist/components/ui/sheet.mjs +1 -1
  355. package/dist/components/ui/sidebar.mjs +1 -1
  356. package/dist/components/ui/skeleton.mjs +1 -1
  357. package/dist/components/ui/switch.mjs +1 -1
  358. package/dist/components/ui/tabs.mjs +1 -1
  359. package/dist/components/ui/textarea.mjs +1 -1
  360. package/dist/components/ui/toast.mjs +1 -1
  361. package/dist/components/ui/toaster.mjs +1 -1
  362. package/dist/components/ui/toggle-group.mjs +1 -1
  363. package/dist/components/ui/toggle.mjs +1 -1
  364. package/dist/components/ui/tooltip.mjs +1 -1
  365. package/dist/globals.css +1 -1
  366. package/dist/index.js +34 -26
  367. package/dist/index.mjs +1 -1
  368. package/dist/metafile-cjs.json +1 -1
  369. package/dist/metafile-esm.json +1 -1
  370. package/dist/pages/Blog.mjs +1 -1
  371. package/dist/pages/Documentation.mjs +1 -1
  372. package/dist/pages/IndexPage.mjs +1 -1
  373. package/dist/pages/Intranet.mjs +1 -1
  374. package/dist/pages/LandingPage.mjs +1 -1
  375. package/dist/pages/Page.mjs +1 -1
  376. package/dist/pages/Publish.mjs +1 -1
  377. package/dist/pages/Website.mjs +1 -1
  378. package/dist/sections/AboutSection.mjs +1 -1
  379. package/dist/sections/BlogDetail.mjs +1 -1
  380. package/dist/sections/BlogList.mjs +1 -1
  381. package/dist/sections/BlogListSection.mjs +1 -1
  382. package/dist/sections/ContactSection.mjs +1 -1
  383. package/dist/sections/ImageSection.mjs +1 -1
  384. package/dist/sections/MainPageSection.mjs +1 -1
  385. package/dist/sections/PageSections.mjs +1 -1
  386. package/dist/sections/PricingSection.mjs +1 -1
  387. package/dist/sections/ServiceDetail.mjs +1 -1
  388. package/dist/sections/ServiceDetailSection.mjs +1 -1
  389. package/dist/sections/ServiceSection.mjs +1 -1
  390. package/dist/sections/form/index.mjs +1 -1
  391. package/dist/sections/index.mjs +1 -1
  392. package/dist/styles/Colors.mjs +1 -1
  393. package/dist/utils/index.mjs +1 -1
  394. package/package.json +1 -1
  395. package/dist/chunk-53QLSQCO.mjs +0 -4
  396. package/dist/chunk-BAB3ATRB.mjs +0 -4
  397. package/dist/chunk-N7M6FTIO.mjs +0 -4
  398. package/dist/chunk-UTJZH3X5.mjs +0 -1
  399. package/dist/chunk-VATGKKXW.mjs +0 -1
  400. package/dist/components/Chat/ChatInterfaceMessages.d.ts +0 -24
  401. package/dist/components/Chat/ChatInterfaceMessages.js +0 -7
  402. package/dist/components/Chat/ChatInterfaceMessages.mjs +0 -2
  403. package/dist/components/Chat/ChatMessage.css +0 -1
  404. package/dist/components/Chat/ChatMessage.d.ts +0 -19
  405. package/dist/components/Chat/ChatMessage.js +0 -7
  406. package/dist/components/Chat/ChatMessage.mjs +0 -1
  407. /package/dist/components/Chat/{ChatInterfaceMessages.css → PartTypes/ColleagueHandoff.css} +0 -0
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-MU5WPW4N.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as NotificationsPanel};
2
+ "use strict";import{a}from"../../chunk-MU5WPW4N.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as NotificationsPanel};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { CompanyInfo } from './types';
3
+ interface CompanyNodeProps {
4
+ companyInfo: CompanyInfo;
5
+ }
6
+ export declare const CompanyNode: React.FC<CompanyNodeProps>;
7
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var c=(e,r)=>{for(var o in r)s(e,o,{get:r[o],enumerable:!0})},n=(e,r,o,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of d(r))!i.call(e,a)&&a!==o&&s(e,a,{get:()=>r[a],enumerable:!(l=m(r,a))||l.enumerable});return e};var p=e=>n(s({},"__esModule",{value:!0}),e);var u={};c(u,{CompanyNode:()=>f});module.exports=p(u);var t=require("react/jsx-runtime"),f=({companyInfo:e})=>(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center shadow-sm",children:e.logo?.url?(0,t.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,className:"w-12 h-12 rounded-full object-cover"}):(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-xs font-bold text-primary",children:e.name.split(" ").map(r=>r[0]).join("").slice(0,3).toUpperCase()})})}),(0,t.jsx)("div",{className:"mt-2 text-center",children:(0,t.jsx)("p",{className:"text-sm font-semibold text-card-foreground",children:e.name})}),(0,t.jsx)("div",{className:"w-0.5 h-1 bg-border mt-2"})]});0&&(module.exports={CompanyNode});
@@ -0,0 +1 @@
1
+ import{a}from"../../../chunk-6UULUGR2.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as CompanyNode};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { OrgChartProps } from './types';
3
+ /**
4
+ * OrgChart Component
5
+ *
6
+ * Displays an organizational hierarchy chart based on user data.
7
+ *
8
+ * @param users - Array of user objects with manager relationships
9
+ * @param onNodeClick - Optional callback when a node is clicked
10
+ * @param className - Optional additional CSS classes
11
+ * @param expandable - Whether nodes can be collapsed/expanded (default: false)
12
+ * @param initiallyExpanded - Whether nodes start expanded (default: true)
13
+ * @param companyInfo - Optional company information (name, logo) to display at the top
14
+ * @param defaultExpandedLevels - Number of levels to show expanded by default (default: 2)
15
+ */
16
+ export declare const OrgChart: React.FC<OrgChartProps>;
17
+ export default OrgChart;
@@ -0,0 +1,12 @@
1
+ "use strict";var R=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var H=(e,r)=>{for(var n in r)R(e,n,{get:r[n],enumerable:!0})},A=(e,r,n,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of z(r))!F.call(e,t)&&t!==n&&R(e,t,{get:()=>r[t],enumerable:!(d=W(r,t))||d.enumerable});return e};var D=e=>A(R({},"__esModule",{value:!0}),e);var G={};H(G,{OrgChart:()=>$,default:()=>q});module.exports=D(G);function k(e){let r=new Map,n=[];e.forEach(t=>{r.set(t.id,{...t,children:[],level:0})}),e.forEach(t=>{let a=r.get(t.id);if(!a)return;let s=typeof t.manager=="string"?t.manager:t.manager?.id;if(s){let i=r.get(s);i?(i.children.push(a),a.level=i.level+1):n.push(a)}else n.push(a)});let d=(t,a)=>{t.level=a,t.children.forEach(s=>d(s,a+1))};return n.forEach(t=>d(t,0)),n}function M(e){if(!e)return"?";let r=e.trim().split(/\s+/);return r.length===1?r[0].substring(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function T(e){return e&&{P:"bg-primary/20 text-primary border-primary/30",SM:"bg-accent/20 text-accent border-accent/30",M:"bg-accent/15 text-accent border-accent/25",SC2:"bg-card text-card-foreground border-border",SC1:"bg-card text-card-foreground border-border",C3:"bg-muted text-muted-foreground border-border",C2:"bg-muted text-muted-foreground border-border",C1:"bg-muted text-muted-foreground border-border"}[e]||"bg-muted text-muted-foreground"}var g=require("react");var j={P:"Partner",SM:"Senior Manager",M:"Manager",SC1:"Senior Consultant 1",SC2:"Senior Consultant 2",C1:"Consultant 1",C2:"Consultant 2",C3:"Consultant 3"};var o=require("react/jsx-runtime"),L=({node:e,onNodeClick:r,expandable:n=!1,isExpanded:d=!0,onToggleExpand:t})=>{let a=e.children.length>0,s=n&&a;return(0,o.jsx)("div",{className:"flex flex-col items-center",children:(0,o.jsxs)("div",{className:`
2
+ relative bg-card border border-border rounded-lg shadow-sm
3
+ transition-all duration-200 hover:shadow-md hover:border-primary/50
4
+ ${r?"cursor-pointer":""}
5
+ w-64 p-4 min-h-[180px] flex flex-col
6
+ `,onClick:()=>r?.(e),children:[(0,o.jsxs)("div",{className:"flex items-start gap-3",children:[(0,o.jsx)("div",{className:"flex-shrink-0",children:e.profilePicture?.url?(0,o.jsx)("img",{src:e.profilePicture.url,alt:e.profilePicture.alt||e.name,className:"w-12 h-12 rounded-full object-cover border-2 border-primary/20"}):(0,o.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center",children:(0,o.jsx)("span",{className:"text-sm font-semibold text-primary",children:M(e.name)})})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("h3",{className:"font-semibold text-card-foreground text-sm truncate",children:e.name}),(0,o.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email}),e.jobRole&&(0,o.jsx)("div",{className:"mt-2",children:(0,o.jsx)("span",{className:`
7
+ inline-block px-2 py-0.5 rounded text-xs font-medium border
8
+ ${T(e.jobRole)}
9
+ `,children:j[e.jobRole]})})]})]}),(0,o.jsx)("div",{className:"mt-3 pt-3 border-t border-border flex-1 flex flex-col justify-start",children:e.about?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",title:e.about.length>100?e.about:void 0,children:e.about}),e.about.length>100&&(0,o.jsx)("div",{className:"mt-1 text-xs text-muted-foreground/70 italic",children:"Hover to see full description"})]}):(0,o.jsx)("div",{className:"text-xs text-muted-foreground/50 italic",children:"No description available"})}),s&&(0,o.jsx)("button",{onClick:i=>{i.stopPropagation(),t?.()},className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-6 h-6 rounded-full bg-card border-2 border-border hover:border-primary/50 flex items-center justify-center transition-colors z-30","aria-label":d?"Collapse":"Expand",children:(0,o.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${d?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})})};var U=({companyInfo:e})=>(0,o.jsxs)("div",{className:"flex flex-col items-center",children:[(0,o.jsx)("div",{className:"w-16 h-16 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center shadow-sm",children:e.logo?.url?(0,o.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,className:"w-12 h-12 rounded-full object-cover"}):(0,o.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:(0,o.jsx)("span",{className:"text-xs font-bold text-primary",children:e.name.split(" ").map(r=>r[0]).join("").slice(0,3).toUpperCase()})})}),(0,o.jsx)("div",{className:"mt-2 text-center",children:(0,o.jsx)("p",{className:"text-sm font-semibold text-card-foreground",children:e.name})}),(0,o.jsx)("div",{className:"w-0.5 h-1 bg-border mt-2"})]});var I=(e,r)=>({...e,level:e.level+r,children:e.children.map(n=>I(n,r))}),S=({nodes:e,onNodeClick:r,expandable:n=!1,initiallyExpanded:d=!0,companyInfo:t,defaultExpandedLevels:a=2})=>{if(t&&e.length>1){let s=e.map(i=>({...i,level:i.level+1,children:i.children.map(y=>I(y,1))}));return(0,o.jsx)(E,{node:{id:"company",name:t.name,email:"",children:s,level:0},onNodeClick:r,expandable:n,initiallyExpanded:d,isCompanyNode:!0,companyInfo:t,defaultExpandedLevels:a})}return(0,o.jsx)("div",{className:"flex flex-col items-center gap-0",children:e.map((s,i)=>(0,o.jsx)(E,{node:s,onNodeClick:r,expandable:n,initiallyExpanded:d,isLast:i===e.length-1,defaultExpandedLevels:a},s.id))})},E=({node:e,onNodeClick:r,expandable:n,initiallyExpanded:d=!0,isLast:t=!1,isCompanyNode:a=!1,companyInfo:s,defaultExpandedLevels:i=2})=>{let y=a||e.level<i,[f,B]=(0,g.useState)(y),x=e.children.length>0,h=(0,g.useRef)(null),[b,O]=(0,g.useState)({childPositions:[],containerWidth:0});return(0,g.useEffect)(()=>{if(!x||!f||!h.current){O({childPositions:[],containerWidth:0});return}let u=setTimeout(()=>{let p=h.current;if(!p)return;let v=Array.from(p.children);if(v.length===0)return;let C=p.getBoundingClientRect(),w=v.map(P=>{let N=P.getBoundingClientRect();return N.left+N.width/2-C.left});O({childPositions:w,containerWidth:C.width})},0);return()=>clearTimeout(u)},[x,f,e.children.length]),(0,g.useEffect)(()=>{if(!x||!f)return;let u=new ResizeObserver(()=>{if(!h.current)return;let p=h.current,v=Array.from(p.children);if(v.length===0)return;let C=p.getBoundingClientRect(),w=v.map(P=>{let N=P.getBoundingClientRect();return N.left+N.width/2-C.left});O({childPositions:w,containerWidth:C.width})});return h.current&&u.observe(h.current),()=>u.disconnect()},[x,f]),(0,o.jsxs)("div",{className:`flex flex-col items-center ${t?"":"mb-8"}`,children:[a&&s?(0,o.jsx)(U,{companyInfo:s}):(0,o.jsx)(L,{node:e,onNodeClick:r,expandable:n,isExpanded:f,onToggleExpand:()=>B(!f)}),x&&f&&(0,o.jsxs)("div",{className:"relative",children:[e.children.length>1&&b.childPositions.length>0&&(0,o.jsxs)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 pointer-events-none z-10",children:[(0,o.jsx)("div",{className:"absolute top-0 left-0 w-0.5 h-8 bg-border -translate-x-1/2"}),(0,o.jsx)("div",{className:"absolute top-8 h-0.5 bg-border",style:{left:`${Math.min(...b.childPositions)-b.containerWidth/2}px`,width:`${Math.max(...b.childPositions)-Math.min(...b.childPositions)}px`}}),b.childPositions.map((u,p)=>(0,o.jsx)("div",{className:"absolute w-0.5 bg-border -translate-x-1/2",style:{left:`${u-b.containerWidth/2}px`,top:"32px",height:"32px"}},p))]}),e.children.length===1&&(0,o.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-0.5 h-16 bg-border pointer-events-none z-10"}),(0,o.jsx)("div",{className:"mt-16 w-full overflow-x-auto",children:(0,o.jsx)("div",{ref:h,className:`
10
+ flex gap-8 pb-4
11
+ ${e.children.length===1?"justify-center":"justify-start min-w-max px-4"}
12
+ `,children:e.children.map(u=>(0,o.jsx)("div",{className:"flex-shrink-0",children:(0,o.jsx)(E,{node:u,onNodeClick:r,expandable:n,initiallyExpanded:d,defaultExpandedLevels:i})},u.id))})})]})]})};var $=({users:e,onNodeClick:r,className:n="",expandable:d=!1,initiallyExpanded:t=!0,companyInfo:a,defaultExpandedLevels:s=2})=>{let i=k(e);return e.length===0?(0,o.jsx)("div",{className:`flex items-center justify-center p-8 ${n}`,children:(0,o.jsx)("div",{className:"text-center",children:(0,o.jsx)("p",{className:"text-muted-foreground",children:"No users to display"})})}):i.length===0?(0,o.jsx)("div",{className:`flex items-center justify-center p-8 ${n}`,children:(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)("p",{className:"text-muted-foreground",children:"Unable to build organization tree"}),(0,o.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Check that manager relationships are properly configured"})]})}):(0,o.jsx)("div",{className:`org-chart w-full overflow-x-auto ${n}`,children:(0,o.jsx)("div",{className:"inline-block min-w-full p-8",children:(0,o.jsx)(S,{nodes:i,onNodeClick:r,expandable:d,initiallyExpanded:t,companyInfo:i.length>1?a:void 0,defaultExpandedLevels:s})})})},q=$;0&&(module.exports={OrgChart});
@@ -0,0 +1 @@
1
+ import{a,b}from"../../../chunk-ZLFZBT3K.mjs";import"../../../chunk-LEZ6G4X7.mjs";import"../../../chunk-6UULUGR2.mjs";import"../../../chunk-DNMM3Q72.mjs";import"../../../chunk-VFIMFZX5.mjs";import"../../../chunk-32G45Z2G.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as OrgChart,b as default};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { OrgNodeProps } from './types';
3
+ export declare const OrgNode: React.FC<OrgNodeProps>;
@@ -0,0 +1,9 @@
1
+ "use strict";var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var f=(r,t)=>{for(var a in t)s(r,a,{get:t[a],enumerable:!0})},x=(r,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of p(t))!b.call(r,o)&&o!==a&&s(r,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return r};var h=r=>x(s({},"__esModule",{value:!0}),r);var v={};f(v,{OrgNode:()=>C});module.exports=h(v);function i(r){if(!r)return"?";let t=r.trim().split(/\s+/);return t.length===1?t[0].substring(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function l(r){return r&&{P:"bg-primary/20 text-primary border-primary/30",SM:"bg-accent/20 text-accent border-accent/30",M:"bg-accent/15 text-accent border-accent/25",SC2:"bg-card text-card-foreground border-border",SC1:"bg-card text-card-foreground border-border",C3:"bg-muted text-muted-foreground border-border",C2:"bg-muted text-muted-foreground border-border",C1:"bg-muted text-muted-foreground border-border"}[r]||"bg-muted text-muted-foreground"}var d={P:"Partner",SM:"Senior Manager",M:"Manager",SC1:"Senior Consultant 1",SC2:"Senior Consultant 2",C1:"Consultant 1",C2:"Consultant 2",C3:"Consultant 3"};var e=require("react/jsx-runtime"),C=({node:r,onNodeClick:t,expandable:a=!1,isExpanded:n=!0,onToggleExpand:o})=>{let c=r.children.length>0,g=a&&c;return(0,e.jsx)("div",{className:"flex flex-col items-center",children:(0,e.jsxs)("div",{className:`
2
+ relative bg-card border border-border rounded-lg shadow-sm
3
+ transition-all duration-200 hover:shadow-md hover:border-primary/50
4
+ ${t?"cursor-pointer":""}
5
+ w-64 p-4 min-h-[180px] flex flex-col
6
+ `,onClick:()=>t?.(r),children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("div",{className:"flex-shrink-0",children:r.profilePicture?.url?(0,e.jsx)("img",{src:r.profilePicture.url,alt:r.profilePicture.alt||r.name,className:"w-12 h-12 rounded-full object-cover border-2 border-primary/20"}):(0,e.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center",children:(0,e.jsx)("span",{className:"text-sm font-semibold text-primary",children:i(r.name)})})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("h3",{className:"font-semibold text-card-foreground text-sm truncate",children:r.name}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:r.email}),r.jobRole&&(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("span",{className:`
7
+ inline-block px-2 py-0.5 rounded text-xs font-medium border
8
+ ${l(r.jobRole)}
9
+ `,children:d[r.jobRole]})})]})]}),(0,e.jsx)("div",{className:"mt-3 pt-3 border-t border-border flex-1 flex flex-col justify-start",children:r.about?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",title:r.about.length>100?r.about:void 0,children:r.about}),r.about.length>100&&(0,e.jsx)("div",{className:"mt-1 text-xs text-muted-foreground/70 italic",children:"Hover to see full description"})]}):(0,e.jsx)("div",{className:"text-xs text-muted-foreground/50 italic",children:"No description available"})}),g&&(0,e.jsx)("button",{onClick:u=>{u.stopPropagation(),o?.()},className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-6 h-6 rounded-full bg-card border-2 border-border hover:border-primary/50 flex items-center justify-center transition-colors z-30","aria-label":n?"Collapse":"Expand",children:(0,e.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})})};0&&(module.exports={OrgNode});
@@ -0,0 +1 @@
1
+ import{a}from"../../../chunk-DNMM3Q72.mjs";import"../../../chunk-VFIMFZX5.mjs";import"../../../chunk-32G45Z2G.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as OrgNode};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { OrgChartNode, OrgChartUser } from './types';
3
+ interface CompanyInfo {
4
+ name: string;
5
+ logo?: {
6
+ url: string;
7
+ alt?: string;
8
+ };
9
+ }
10
+ interface OrgTreeProps {
11
+ nodes: OrgChartNode[];
12
+ onNodeClick?: (user: OrgChartUser) => void;
13
+ expandable?: boolean;
14
+ initiallyExpanded?: boolean;
15
+ companyInfo?: CompanyInfo;
16
+ defaultExpandedLevels?: number;
17
+ }
18
+ export declare const OrgTree: React.FC<OrgTreeProps>;
19
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";var w=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var W=(e,r)=>{for(var n in r)w(e,n,{get:r[n],enumerable:!0})},$=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of I(r))!B.call(e,a)&&a!==n&&w(e,a,{get:()=>r[a],enumerable:!(i=U(r,a))||i.enumerable});return e};var z=e=>$(w({},"__esModule",{value:!0}),e);var H={};W(H,{OrgTree:()=>F});module.exports=z(H);var u=require("react");function E(e){if(!e)return"?";let r=e.trim().split(/\s+/);return r.length===1?r[0].substring(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function k(e){return e&&{P:"bg-primary/20 text-primary border-primary/30",SM:"bg-accent/20 text-accent border-accent/30",M:"bg-accent/15 text-accent border-accent/25",SC2:"bg-card text-card-foreground border-border",SC1:"bg-card text-card-foreground border-border",C3:"bg-muted text-muted-foreground border-border",C2:"bg-muted text-muted-foreground border-border",C1:"bg-muted text-muted-foreground border-border"}[e]||"bg-muted text-muted-foreground"}var M={P:"Partner",SM:"Senior Manager",M:"Manager",SC1:"Senior Consultant 1",SC2:"Senior Consultant 2",C1:"Consultant 1",C2:"Consultant 2",C3:"Consultant 3"};var t=require("react/jsx-runtime"),j=({node:e,onNodeClick:r,expandable:n=!1,isExpanded:i=!0,onToggleExpand:a})=>{let g=e.children.length>0,d=n&&g;return(0,t.jsx)("div",{className:"flex flex-col items-center",children:(0,t.jsxs)("div",{className:`
2
+ relative bg-card border border-border rounded-lg shadow-sm
3
+ transition-all duration-200 hover:shadow-md hover:border-primary/50
4
+ ${r?"cursor-pointer":""}
5
+ w-64 p-4 min-h-[180px] flex flex-col
6
+ `,onClick:()=>r?.(e),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:e.profilePicture?.url?(0,t.jsx)("img",{src:e.profilePicture.url,alt:e.profilePicture.alt||e.name,className:"w-12 h-12 rounded-full object-cover border-2 border-primary/20"}):(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-sm font-semibold text-primary",children:E(e.name)})})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:"font-semibold text-card-foreground text-sm truncate",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email}),e.jobRole&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)("span",{className:`
7
+ inline-block px-2 py-0.5 rounded text-xs font-medium border
8
+ ${k(e.jobRole)}
9
+ `,children:M[e.jobRole]})})]})]}),(0,t.jsx)("div",{className:"mt-3 pt-3 border-t border-border flex-1 flex flex-col justify-start",children:e.about?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",title:e.about.length>100?e.about:void 0,children:e.about}),e.about.length>100&&(0,t.jsx)("div",{className:"mt-1 text-xs text-muted-foreground/70 italic",children:"Hover to see full description"})]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground/50 italic",children:"No description available"})}),d&&(0,t.jsx)("button",{onClick:s=>{s.stopPropagation(),a?.()},className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-6 h-6 rounded-full bg-card border-2 border-border hover:border-primary/50 flex items-center justify-center transition-colors z-30","aria-label":i?"Collapse":"Expand",children:(0,t.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${i?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})})};var L=({companyInfo:e})=>(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center shadow-sm",children:e.logo?.url?(0,t.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,className:"w-12 h-12 rounded-full object-cover"}):(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-xs font-bold text-primary",children:e.name.split(" ").map(r=>r[0]).join("").slice(0,3).toUpperCase()})})}),(0,t.jsx)("div",{className:"mt-2 text-center",children:(0,t.jsx)("p",{className:"text-sm font-semibold text-card-foreground",children:e.name})}),(0,t.jsx)("div",{className:"w-0.5 h-1 bg-border mt-2"})]});var T=(e,r)=>({...e,level:e.level+r,children:e.children.map(n=>T(n,r))}),F=({nodes:e,onNodeClick:r,expandable:n=!1,initiallyExpanded:i=!0,companyInfo:a,defaultExpandedLevels:g=2})=>{if(a&&e.length>1){let d=e.map(s=>({...s,level:s.level+1,children:s.children.map(N=>T(N,1))}));return(0,t.jsx)(R,{node:{id:"company",name:a.name,email:"",children:d,level:0},onNodeClick:r,expandable:n,initiallyExpanded:i,isCompanyNode:!0,companyInfo:a,defaultExpandedLevels:g})}return(0,t.jsx)("div",{className:"flex flex-col items-center gap-0",children:e.map((d,s)=>(0,t.jsx)(R,{node:d,onNodeClick:r,expandable:n,initiallyExpanded:i,isLast:s===e.length-1,defaultExpandedLevels:g},d.id))})},R=({node:e,onNodeClick:r,expandable:n,initiallyExpanded:i=!0,isLast:a=!1,isCompanyNode:g=!1,companyInfo:d,defaultExpandedLevels:s=2})=>{let N=g||e.level<s,[p,S]=(0,u.useState)(N),b=e.children.length>0,f=(0,u.useRef)(null),[h,y]=(0,u.useState)({childPositions:[],containerWidth:0});return(0,u.useEffect)(()=>{if(!b||!p||!f.current){y({childPositions:[],containerWidth:0});return}let c=setTimeout(()=>{let m=f.current;if(!m)return;let x=Array.from(m.children);if(x.length===0)return;let v=m.getBoundingClientRect(),O=x.map(P=>{let C=P.getBoundingClientRect();return C.left+C.width/2-v.left});y({childPositions:O,containerWidth:v.width})},0);return()=>clearTimeout(c)},[b,p,e.children.length]),(0,u.useEffect)(()=>{if(!b||!p)return;let c=new ResizeObserver(()=>{if(!f.current)return;let m=f.current,x=Array.from(m.children);if(x.length===0)return;let v=m.getBoundingClientRect(),O=x.map(P=>{let C=P.getBoundingClientRect();return C.left+C.width/2-v.left});y({childPositions:O,containerWidth:v.width})});return f.current&&c.observe(f.current),()=>c.disconnect()},[b,p]),(0,t.jsxs)("div",{className:`flex flex-col items-center ${a?"":"mb-8"}`,children:[g&&d?(0,t.jsx)(L,{companyInfo:d}):(0,t.jsx)(j,{node:e,onNodeClick:r,expandable:n,isExpanded:p,onToggleExpand:()=>S(!p)}),b&&p&&(0,t.jsxs)("div",{className:"relative",children:[e.children.length>1&&h.childPositions.length>0&&(0,t.jsxs)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 pointer-events-none z-10",children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 w-0.5 h-8 bg-border -translate-x-1/2"}),(0,t.jsx)("div",{className:"absolute top-8 h-0.5 bg-border",style:{left:`${Math.min(...h.childPositions)-h.containerWidth/2}px`,width:`${Math.max(...h.childPositions)-Math.min(...h.childPositions)}px`}}),h.childPositions.map((c,m)=>(0,t.jsx)("div",{className:"absolute w-0.5 bg-border -translate-x-1/2",style:{left:`${c-h.containerWidth/2}px`,top:"32px",height:"32px"}},m))]}),e.children.length===1&&(0,t.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-0.5 h-16 bg-border pointer-events-none z-10"}),(0,t.jsx)("div",{className:"mt-16 w-full overflow-x-auto",children:(0,t.jsx)("div",{ref:f,className:`
10
+ flex gap-8 pb-4
11
+ ${e.children.length===1?"justify-center":"justify-start min-w-max px-4"}
12
+ `,children:e.children.map(c=>(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(R,{node:c,onNodeClick:r,expandable:n,initiallyExpanded:i,defaultExpandedLevels:s})},c.id))})})]})]})};0&&(module.exports={OrgTree});
@@ -0,0 +1 @@
1
+ import{a}from"../../../chunk-LEZ6G4X7.mjs";import"../../../chunk-6UULUGR2.mjs";import"../../../chunk-DNMM3Q72.mjs";import"../../../chunk-VFIMFZX5.mjs";import"../../../chunk-32G45Z2G.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as OrgTree};
@@ -0,0 +1,233 @@
1
+ var a=`
2
+ \`\`\`js
3
+ /**
4
+ * Example: Integrating OrgChart with PayloadCMS3
5
+ *
6
+ * This example shows how to fetch user data from Payload using the client SDK
7
+ * and render it in the OrgChart component.
8
+ */
9
+
10
+ import React from 'react';
11
+ import { OrgChart } from '../OrgChart';
12
+ import type { User } from '../types';
13
+
14
+ /**
15
+ * Server Component Example (Next.js App Router)
16
+ *
17
+ * Use this approach in a server component to fetch data at build/request time.
18
+ */
19
+ export async function OrgChartServerComponent() {
20
+ // Import Payload config (adjust path to your project structure)
21
+ const { getPayload } = await import('payload');
22
+ const config = await import('@/payload.config').then((m) => m.default);
23
+
24
+ // Get Payload instance
25
+ const payload = await getPayload({ config });
26
+
27
+ // Fetch all users with manager relationships
28
+ const usersResponse = await payload.find({
29
+ collection: 'users',
30
+ depth: 2, // Include manager relationship data
31
+ limit: 1000, // Adjust based on your org size
32
+ });
33
+
34
+ // Transform Payload data to OrgChart format
35
+ const users: User[] = usersResponse.docs.map((doc) => ({
36
+ id: doc.id,
37
+ name: doc.name || '',
38
+ email: doc.email,
39
+ jobRole: doc.jobRole,
40
+ manager: doc.manager,
41
+ about: doc.about,
42
+ profilePicture: doc.profilePicture
43
+ ? {
44
+ url: typeof doc.profilePicture === 'object'
45
+ ? doc.profilePicture.url
46
+ : doc.profilePicture,
47
+ alt: doc.name,
48
+ }
49
+ : undefined,
50
+ }));
51
+
52
+ return (
53
+ <div className="container mx-auto py-8">
54
+ <h1 className="text-3xl font-bold mb-8">Organization Chart</h1>
55
+ <OrgChart
56
+ users={users}
57
+ expandable={true}
58
+ initiallyExpanded={true}
59
+ />
60
+ </div>
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Client Component Example (with Server Action or API Route)
66
+ *
67
+ * Use this approach when you need client-side interactivity.
68
+ */
69
+ 'use client';
70
+
71
+ interface OrgChartClientComponentProps {
72
+ initialUsers: User[];
73
+ }
74
+
75
+ export function OrgChartClientComponent({ initialUsers }: OrgChartClientComponentProps) {
76
+ const [users, setUsers] = React.useState<User[]>(initialUsers);
77
+ const [selectedUser, setSelectedUser] = React.useState<User | null>(null);
78
+
79
+ const handleNodeClick = (user: User) => {
80
+ setSelectedUser(user);
81
+ // You could also navigate to a user detail page here
82
+ // router.push(\`/team/\${user.id}\`);
83
+ };
84
+
85
+ return (
86
+ <div className="container mx-auto py-8">
87
+ <div className="mb-8">
88
+ <h1 className="text-3xl font-bold">Organization Chart</h1>
89
+ <p className="text-muted-foreground mt-2">
90
+ Click on any team member to view details
91
+ </p>
92
+ </div>
93
+
94
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
95
+ {/* Org Chart */}
96
+ <div className="lg:col-span-2">
97
+ <OrgChart
98
+ users={users}
99
+ onNodeClick={handleNodeClick}
100
+ expandable={true}
101
+ initiallyExpanded={true}
102
+ />
103
+ </div>
104
+
105
+ {/* Selected User Details */}
106
+ <div className="lg:col-span-1">
107
+ {selectedUser ? (
108
+ <div className="bg-card border border-border rounded-lg p-6 sticky top-8">
109
+ <h2 className="text-xl font-semibold mb-4">Team Member Details</h2>
110
+ <div className="space-y-4">
111
+ <div>
112
+ <label className="text-sm text-muted-foreground">Name</label>
113
+ <p className="font-medium">{selectedUser.name}</p>
114
+ </div>
115
+ <div>
116
+ <label className="text-sm text-muted-foreground">Email</label>
117
+ <p className="font-medium">{selectedUser.email}</p>
118
+ </div>
119
+ {selectedUser.jobRole && (
120
+ <div>
121
+ <label className="text-sm text-muted-foreground">Role</label>
122
+ <p className="font-medium">{selectedUser.jobRole}</p>
123
+ </div>
124
+ )}
125
+ {selectedUser.about && (
126
+ <div>
127
+ <label className="text-sm text-muted-foreground">About</label>
128
+ <p className="text-sm">{selectedUser.about}</p>
129
+ </div>
130
+ )}
131
+ </div>
132
+ </div>
133
+ ) : (
134
+ <div className="bg-muted/50 border border-border rounded-lg p-6 text-center">
135
+ <p className="text-muted-foreground">
136
+ Select a team member to view details
137
+ </p>
138
+ </div>
139
+ )}
140
+ </div>
141
+ </div>
142
+ </div>
143
+ );
144
+ }
145
+
146
+ /**
147
+ * API Route Example (Next.js App Router)
148
+ *
149
+ * Create this file at: app/api/org-chart/route.ts
150
+ */
151
+ export async function GET() {
152
+ const { getPayload } = await import('payload');
153
+ const config = await import('@/payload.config').then((m) => m.default);
154
+
155
+ const payload = await getPayload({ config });
156
+
157
+ const usersResponse = await payload.find({
158
+ collection: 'users',
159
+ depth: 2,
160
+ limit: 1000,
161
+ });
162
+
163
+ const users: User[] = usersResponse.docs.map((doc) => ({
164
+ id: doc.id,
165
+ name: doc.name || '',
166
+ email: doc.email,
167
+ jobRole: doc.jobRole,
168
+ manager: doc.manager,
169
+ about: doc.about,
170
+ profilePicture: doc.profilePicture
171
+ ? {
172
+ url: typeof doc.profilePicture === 'object'
173
+ ? doc.profilePicture.url
174
+ : doc.profilePicture,
175
+ alt: doc.name,
176
+ }
177
+ : undefined,
178
+ }));
179
+
180
+ return Response.json({ users });
181
+ }
182
+
183
+ /**
184
+ * Server Action Example (Next.js App Router)
185
+ *
186
+ * Create this file at: app/actions/getOrgChartData.ts
187
+ */
188
+ 'use server';
189
+
190
+ export async function getOrgChartData(): Promise<User[]> {
191
+ const { getPayload } = await import('payload');
192
+ const config = await import('@/payload.config').then((m) => m.default);
193
+
194
+ const payload = await getPayload({ config });
195
+
196
+ const usersResponse = await payload.find({
197
+ collection: 'users',
198
+ depth: 2,
199
+ limit: 1000,
200
+ // Optional: Add sorting
201
+ sort: 'name',
202
+ });
203
+
204
+ return usersResponse.docs.map((doc) => ({
205
+ id: doc.id,
206
+ name: doc.name || '',
207
+ email: doc.email,
208
+ jobRole: doc.jobRole,
209
+ manager: doc.manager,
210
+ about: doc.about,
211
+ profilePicture: doc.profilePicture
212
+ ? {
213
+ url: typeof doc.profilePicture === 'object'
214
+ ? doc.profilePicture.url
215
+ : doc.profilePicture,
216
+ alt: doc.name,
217
+ }
218
+ : undefined,
219
+ }));
220
+ }
221
+
222
+ /**
223
+ * Usage in a page component:
224
+ *
225
+ * import { getOrgChartData } from '@/app/actions/getOrgChartData';
226
+ * import { OrgChartClientComponent } from '@/components/OrgChartClientComponent';
227
+ *
228
+ * export default async function OrgChartPage() {
229
+ * const users = await getOrgChartData();
230
+ * return <OrgChartClientComponent initialUsers={users} />;
231
+ * }
232
+ */
233
+ \`\`\``;
@@ -0,0 +1,233 @@
1
+ import"../../../../chunk-YEKQJ4YC.mjs";var a=`
2
+ \`\`\`js
3
+ /**
4
+ * Example: Integrating OrgChart with PayloadCMS3
5
+ *
6
+ * This example shows how to fetch user data from Payload using the client SDK
7
+ * and render it in the OrgChart component.
8
+ */
9
+
10
+ import React from 'react';
11
+ import { OrgChart } from '../OrgChart';
12
+ import type { User } from '../types';
13
+
14
+ /**
15
+ * Server Component Example (Next.js App Router)
16
+ *
17
+ * Use this approach in a server component to fetch data at build/request time.
18
+ */
19
+ export async function OrgChartServerComponent() {
20
+ // Import Payload config (adjust path to your project structure)
21
+ const { getPayload } = await import('payload');
22
+ const config = await import('@/payload.config').then((m) => m.default);
23
+
24
+ // Get Payload instance
25
+ const payload = await getPayload({ config });
26
+
27
+ // Fetch all users with manager relationships
28
+ const usersResponse = await payload.find({
29
+ collection: 'users',
30
+ depth: 2, // Include manager relationship data
31
+ limit: 1000, // Adjust based on your org size
32
+ });
33
+
34
+ // Transform Payload data to OrgChart format
35
+ const users: User[] = usersResponse.docs.map((doc) => ({
36
+ id: doc.id,
37
+ name: doc.name || '',
38
+ email: doc.email,
39
+ jobRole: doc.jobRole,
40
+ manager: doc.manager,
41
+ about: doc.about,
42
+ profilePicture: doc.profilePicture
43
+ ? {
44
+ url: typeof doc.profilePicture === 'object'
45
+ ? doc.profilePicture.url
46
+ : doc.profilePicture,
47
+ alt: doc.name,
48
+ }
49
+ : undefined,
50
+ }));
51
+
52
+ return (
53
+ <div className="container mx-auto py-8">
54
+ <h1 className="text-3xl font-bold mb-8">Organization Chart</h1>
55
+ <OrgChart
56
+ users={users}
57
+ expandable={true}
58
+ initiallyExpanded={true}
59
+ />
60
+ </div>
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Client Component Example (with Server Action or API Route)
66
+ *
67
+ * Use this approach when you need client-side interactivity.
68
+ */
69
+ 'use client';
70
+
71
+ interface OrgChartClientComponentProps {
72
+ initialUsers: User[];
73
+ }
74
+
75
+ export function OrgChartClientComponent({ initialUsers }: OrgChartClientComponentProps) {
76
+ const [users, setUsers] = React.useState<User[]>(initialUsers);
77
+ const [selectedUser, setSelectedUser] = React.useState<User | null>(null);
78
+
79
+ const handleNodeClick = (user: User) => {
80
+ setSelectedUser(user);
81
+ // You could also navigate to a user detail page here
82
+ // router.push(\`/team/\${user.id}\`);
83
+ };
84
+
85
+ return (
86
+ <div className="container mx-auto py-8">
87
+ <div className="mb-8">
88
+ <h1 className="text-3xl font-bold">Organization Chart</h1>
89
+ <p className="text-muted-foreground mt-2">
90
+ Click on any team member to view details
91
+ </p>
92
+ </div>
93
+
94
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
95
+ {/* Org Chart */}
96
+ <div className="lg:col-span-2">
97
+ <OrgChart
98
+ users={users}
99
+ onNodeClick={handleNodeClick}
100
+ expandable={true}
101
+ initiallyExpanded={true}
102
+ />
103
+ </div>
104
+
105
+ {/* Selected User Details */}
106
+ <div className="lg:col-span-1">
107
+ {selectedUser ? (
108
+ <div className="bg-card border border-border rounded-lg p-6 sticky top-8">
109
+ <h2 className="text-xl font-semibold mb-4">Team Member Details</h2>
110
+ <div className="space-y-4">
111
+ <div>
112
+ <label className="text-sm text-muted-foreground">Name</label>
113
+ <p className="font-medium">{selectedUser.name}</p>
114
+ </div>
115
+ <div>
116
+ <label className="text-sm text-muted-foreground">Email</label>
117
+ <p className="font-medium">{selectedUser.email}</p>
118
+ </div>
119
+ {selectedUser.jobRole && (
120
+ <div>
121
+ <label className="text-sm text-muted-foreground">Role</label>
122
+ <p className="font-medium">{selectedUser.jobRole}</p>
123
+ </div>
124
+ )}
125
+ {selectedUser.about && (
126
+ <div>
127
+ <label className="text-sm text-muted-foreground">About</label>
128
+ <p className="text-sm">{selectedUser.about}</p>
129
+ </div>
130
+ )}
131
+ </div>
132
+ </div>
133
+ ) : (
134
+ <div className="bg-muted/50 border border-border rounded-lg p-6 text-center">
135
+ <p className="text-muted-foreground">
136
+ Select a team member to view details
137
+ </p>
138
+ </div>
139
+ )}
140
+ </div>
141
+ </div>
142
+ </div>
143
+ );
144
+ }
145
+
146
+ /**
147
+ * API Route Example (Next.js App Router)
148
+ *
149
+ * Create this file at: app/api/org-chart/route.ts
150
+ */
151
+ export async function GET() {
152
+ const { getPayload } = await import('payload');
153
+ const config = await import('@/payload.config').then((m) => m.default);
154
+
155
+ const payload = await getPayload({ config });
156
+
157
+ const usersResponse = await payload.find({
158
+ collection: 'users',
159
+ depth: 2,
160
+ limit: 1000,
161
+ });
162
+
163
+ const users: User[] = usersResponse.docs.map((doc) => ({
164
+ id: doc.id,
165
+ name: doc.name || '',
166
+ email: doc.email,
167
+ jobRole: doc.jobRole,
168
+ manager: doc.manager,
169
+ about: doc.about,
170
+ profilePicture: doc.profilePicture
171
+ ? {
172
+ url: typeof doc.profilePicture === 'object'
173
+ ? doc.profilePicture.url
174
+ : doc.profilePicture,
175
+ alt: doc.name,
176
+ }
177
+ : undefined,
178
+ }));
179
+
180
+ return Response.json({ users });
181
+ }
182
+
183
+ /**
184
+ * Server Action Example (Next.js App Router)
185
+ *
186
+ * Create this file at: app/actions/getOrgChartData.ts
187
+ */
188
+ 'use server';
189
+
190
+ export async function getOrgChartData(): Promise<User[]> {
191
+ const { getPayload } = await import('payload');
192
+ const config = await import('@/payload.config').then((m) => m.default);
193
+
194
+ const payload = await getPayload({ config });
195
+
196
+ const usersResponse = await payload.find({
197
+ collection: 'users',
198
+ depth: 2,
199
+ limit: 1000,
200
+ // Optional: Add sorting
201
+ sort: 'name',
202
+ });
203
+
204
+ return usersResponse.docs.map((doc) => ({
205
+ id: doc.id,
206
+ name: doc.name || '',
207
+ email: doc.email,
208
+ jobRole: doc.jobRole,
209
+ manager: doc.manager,
210
+ about: doc.about,
211
+ profilePicture: doc.profilePicture
212
+ ? {
213
+ url: typeof doc.profilePicture === 'object'
214
+ ? doc.profilePicture.url
215
+ : doc.profilePicture,
216
+ alt: doc.name,
217
+ }
218
+ : undefined,
219
+ }));
220
+ }
221
+
222
+ /**
223
+ * Usage in a page component:
224
+ *
225
+ * import { getOrgChartData } from '@/app/actions/getOrgChartData';
226
+ * import { OrgChartClientComponent } from '@/components/OrgChartClientComponent';
227
+ *
228
+ * export default async function OrgChartPage() {
229
+ * const users = await getOrgChartData();
230
+ * return <OrgChartClientComponent initialUsers={users} />;
231
+ * }
232
+ */
233
+ \`\`\``;export{a as default};
@@ -0,0 +1,6 @@
1
+ export { OrgChart } from './OrgChart';
2
+ export { OrgNode } from './OrgNode';
3
+ export { OrgTree } from './OrgTree';
4
+ export { CompanyNode } from './CompanyNode';
5
+ export * from './utils';
6
+ export * from './types';