@pega/cosmos-react-work 5.0.0-dev.4.9 → 5.0.0-dev.6.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 (337) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +23 -0
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -0
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +93 -0
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -0
  5. package/lib/components/AppAnnouncement/index.d.ts +3 -0
  6. package/lib/components/AppAnnouncement/index.d.ts.map +1 -0
  7. package/lib/components/AppAnnouncement/index.js +2 -0
  8. package/lib/components/AppAnnouncement/index.js.map +1 -0
  9. package/lib/components/Article/Article.d.ts +60 -0
  10. package/lib/components/Article/Article.d.ts.map +1 -0
  11. package/lib/components/Article/Article.js +87 -0
  12. package/lib/components/Article/Article.js.map +1 -0
  13. package/lib/components/Article/ArticleFooter.d.ts +38 -0
  14. package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
  15. package/lib/components/Article/ArticleFooter.js +58 -0
  16. package/lib/components/Article/ArticleFooter.js.map +1 -0
  17. package/lib/components/Article/ArticleMeta.d.ts +13 -0
  18. package/lib/components/Article/ArticleMeta.d.ts.map +1 -0
  19. package/lib/components/Article/ArticleMeta.js +27 -0
  20. package/lib/components/Article/ArticleMeta.js.map +1 -0
  21. package/lib/components/Article/ArticleRating.d.ts +13 -0
  22. package/lib/components/Article/ArticleRating.d.ts.map +1 -0
  23. package/lib/components/Article/ArticleRating.js +43 -0
  24. package/lib/components/Article/ArticleRating.js.map +1 -0
  25. package/lib/components/Article/index.d.ts +7 -0
  26. package/lib/components/Article/index.d.ts.map +1 -0
  27. package/lib/components/Article/index.js +4 -0
  28. package/lib/components/Article/index.js.map +1 -0
  29. package/lib/components/ArticleList/ArticleBuddy.d.ts +9 -0
  30. package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -0
  31. package/lib/components/ArticleList/ArticleBuddy.js +57 -0
  32. package/lib/components/ArticleList/ArticleBuddy.js.map +1 -0
  33. package/lib/components/ArticleList/ArticleList.d.ts +6 -0
  34. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
  35. package/lib/components/ArticleList/ArticleList.js +146 -0
  36. package/lib/components/ArticleList/ArticleList.js.map +1 -0
  37. package/lib/components/ArticleList/ArticleList.types.d.ts +128 -0
  38. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
  39. package/lib/components/ArticleList/ArticleList.types.js +7 -0
  40. package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
  41. package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
  42. package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
  43. package/lib/components/ArticleList/ArticleListFilter.js +67 -0
  44. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
  45. package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
  46. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
  47. package/lib/components/ArticleList/ArticleListHeader.js +20 -0
  48. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
  49. package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
  50. package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
  51. package/lib/components/ArticleList/ArticleSummary.js +63 -0
  52. package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
  53. package/lib/components/ArticleList/index.d.ts +8 -0
  54. package/lib/components/ArticleList/index.d.ts.map +1 -0
  55. package/lib/components/ArticleList/index.js +5 -0
  56. package/lib/components/ArticleList/index.js.map +1 -0
  57. package/lib/components/Assignments/Assignments.d.ts +21 -0
  58. package/lib/components/Assignments/Assignments.d.ts.map +1 -0
  59. package/lib/components/Assignments/Assignments.js +20 -0
  60. package/lib/components/Assignments/Assignments.js.map +1 -0
  61. package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
  62. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
  63. package/lib/components/Assignments/Assignments.styles.js +41 -0
  64. package/lib/components/Assignments/Assignments.styles.js.map +1 -0
  65. package/lib/components/Assignments/index.d.ts +3 -0
  66. package/lib/components/Assignments/index.d.ts.map +1 -0
  67. package/lib/components/Assignments/index.js +2 -0
  68. package/lib/components/Assignments/index.js.map +1 -0
  69. package/lib/components/CasePreview/CasePreview.d.ts +27 -0
  70. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -0
  71. package/lib/components/CasePreview/CasePreview.js +82 -0
  72. package/lib/components/CasePreview/CasePreview.js.map +1 -0
  73. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  74. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  75. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  76. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  77. package/lib/components/CasePreview/index.d.ts +3 -0
  78. package/lib/components/CasePreview/index.d.ts.map +1 -0
  79. package/lib/components/CasePreview/index.js +2 -0
  80. package/lib/components/CasePreview/index.js.map +1 -0
  81. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts +4 -0
  82. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
  83. package/lib/components/CaseView/CaseHeader/CaseHeader.js +127 -0
  84. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
  85. package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
  86. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
  87. package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
  88. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
  89. package/lib/components/CaseView/CaseSummary.d.ts +4 -0
  90. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -0
  91. package/lib/components/CaseView/CaseSummary.js +18 -0
  92. package/lib/components/CaseView/CaseSummary.js.map +1 -0
  93. package/lib/components/CaseView/CaseSummaryFields.d.ts +6 -0
  94. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -0
  95. package/lib/components/CaseView/CaseSummaryFields.js +18 -0
  96. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -0
  97. package/lib/components/CaseView/CaseView.context.d.ts +5 -0
  98. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -0
  99. package/lib/components/CaseView/CaseView.context.js +5 -0
  100. package/lib/components/CaseView/CaseView.context.js.map +1 -0
  101. package/lib/components/CaseView/CaseView.d.ts +8 -0
  102. package/lib/components/CaseView/CaseView.d.ts.map +1 -0
  103. package/lib/components/CaseView/CaseView.js +421 -0
  104. package/lib/components/CaseView/CaseView.js.map +1 -0
  105. package/lib/components/CaseView/CaseView.styles.d.ts +45 -0
  106. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  107. package/lib/components/CaseView/CaseView.styles.js +559 -0
  108. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  109. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  110. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  111. package/lib/components/CaseView/CaseView.test-ids.js +18 -0
  112. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  113. package/lib/components/CaseView/CaseView.types.d.ts +98 -0
  114. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -0
  115. package/lib/components/CaseView/CaseView.types.js +2 -0
  116. package/lib/components/CaseView/CaseView.types.js.map +1 -0
  117. package/lib/components/CaseView/UtilitiesSummary.d.ts +9 -0
  118. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -0
  119. package/lib/components/CaseView/UtilitiesSummary.js +53 -0
  120. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -0
  121. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +9 -0
  122. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -0
  123. package/lib/components/CaseView/UtilitySummaryItemDialog.js +33 -0
  124. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -0
  125. package/lib/components/CaseView/index.d.ts +5 -0
  126. package/lib/components/CaseView/index.d.ts.map +1 -0
  127. package/lib/components/CaseView/index.js +4 -0
  128. package/lib/components/CaseView/index.js.map +1 -0
  129. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  130. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  131. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +86 -0
  132. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  133. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +41 -0
  134. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  135. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  136. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  137. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  138. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  139. package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
  140. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  141. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  142. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  143. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  144. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  145. package/lib/components/ConfigurableLayout/index.d.ts +4 -0
  146. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  147. package/lib/components/ConfigurableLayout/index.js +3 -0
  148. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  149. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  150. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  151. package/lib/components/ConfigurableLayout/options.js +10 -0
  152. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  153. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
  154. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
  155. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
  156. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
  157. package/lib/components/Confirmation/Confirmation.d.ts +19 -0
  158. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
  159. package/lib/components/Confirmation/Confirmation.js +29 -0
  160. package/lib/components/Confirmation/Confirmation.js.map +1 -0
  161. package/lib/components/Confirmation/index.d.ts +3 -0
  162. package/lib/components/Confirmation/index.d.ts.map +1 -0
  163. package/lib/components/Confirmation/index.js +2 -0
  164. package/lib/components/Confirmation/index.js.map +1 -0
  165. package/lib/components/Details/Details.d.ts +43 -0
  166. package/lib/components/Details/Details.d.ts.map +1 -0
  167. package/lib/components/Details/Details.js +95 -0
  168. package/lib/components/Details/Details.js.map +1 -0
  169. package/lib/components/Details/Details.styles.d.ts +50 -0
  170. package/lib/components/Details/Details.styles.d.ts.map +1 -0
  171. package/lib/components/Details/Details.styles.js +204 -0
  172. package/lib/components/Details/Details.styles.js.map +1 -0
  173. package/lib/components/Details/Details.test-ids.d.ts +2 -0
  174. package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
  175. package/lib/components/Details/Details.test-ids.js +9 -0
  176. package/lib/components/Details/Details.test-ids.js.map +1 -0
  177. package/lib/components/Details/DetailsContext.d.ts +9 -0
  178. package/lib/components/Details/DetailsContext.d.ts.map +1 -0
  179. package/lib/components/Details/DetailsContext.js +9 -0
  180. package/lib/components/Details/DetailsContext.js.map +1 -0
  181. package/lib/components/Details/index.d.ts +4 -0
  182. package/lib/components/Details/index.d.ts.map +1 -0
  183. package/lib/components/Details/index.js +4 -0
  184. package/lib/components/Details/index.js.map +1 -0
  185. package/lib/components/Glimpse/Glimpse.d.ts +20 -0
  186. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -0
  187. package/lib/components/Glimpse/Glimpse.js +12 -0
  188. package/lib/components/Glimpse/Glimpse.js.map +1 -0
  189. package/lib/components/Glimpse/index.d.ts +3 -0
  190. package/lib/components/Glimpse/index.d.ts.map +1 -0
  191. package/lib/components/Glimpse/index.js +2 -0
  192. package/lib/components/Glimpse/index.js.map +1 -0
  193. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
  194. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +83 -0
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -0
  198. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
  199. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +199 -0
  200. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
  201. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +35 -0
  202. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
  203. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
  204. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
  205. package/lib/components/IntelligentGuidance/index.d.ts +3 -0
  206. package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
  207. package/lib/components/IntelligentGuidance/index.js +2 -0
  208. package/lib/components/IntelligentGuidance/index.js.map +1 -0
  209. package/lib/components/Predictions/Predictions.d.ts +6 -0
  210. package/lib/components/Predictions/Predictions.d.ts.map +1 -0
  211. package/lib/components/Predictions/Predictions.js +68 -0
  212. package/lib/components/Predictions/Predictions.js.map +1 -0
  213. package/lib/components/Predictions/Predictions.types.d.ts +23 -0
  214. package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
  215. package/lib/components/Predictions/Predictions.types.js +2 -0
  216. package/lib/components/Predictions/Predictions.types.js.map +1 -0
  217. package/lib/components/Predictions/index.d.ts +3 -0
  218. package/lib/components/Predictions/index.d.ts.map +1 -0
  219. package/lib/components/Predictions/index.js +2 -0
  220. package/lib/components/Predictions/index.js.map +1 -0
  221. package/lib/components/SearchResults/Filter.d.ts +8 -0
  222. package/lib/components/SearchResults/Filter.d.ts.map +1 -0
  223. package/lib/components/SearchResults/Filter.js +45 -0
  224. package/lib/components/SearchResults/Filter.js.map +1 -0
  225. package/lib/components/SearchResults/SearchResult.d.ts +4 -0
  226. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -0
  227. package/lib/components/SearchResults/SearchResult.js +27 -0
  228. package/lib/components/SearchResults/SearchResult.js.map +1 -0
  229. package/lib/components/SearchResults/SearchResults.d.ts +6 -0
  230. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -0
  231. package/lib/components/SearchResults/SearchResults.js +121 -0
  232. package/lib/components/SearchResults/SearchResults.js.map +1 -0
  233. package/lib/components/SearchResults/SearchResults.styles.d.ts +11 -0
  234. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
  235. package/lib/components/SearchResults/SearchResults.styles.js +88 -0
  236. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
  237. package/lib/components/SearchResults/SearchResults.types.d.ts +100 -0
  238. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -0
  239. package/lib/components/SearchResults/SearchResults.types.js +2 -0
  240. package/lib/components/SearchResults/SearchResults.types.js.map +1 -0
  241. package/lib/components/SearchResults/index.d.ts +3 -0
  242. package/lib/components/SearchResults/index.d.ts.map +1 -0
  243. package/lib/components/SearchResults/index.js +2 -0
  244. package/lib/components/SearchResults/index.js.map +1 -0
  245. package/lib/components/Stages/StageGlimpse.d.ts +8 -0
  246. package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
  247. package/lib/components/Stages/StageGlimpse.js +11 -0
  248. package/lib/components/Stages/StageGlimpse.js.map +1 -0
  249. package/lib/components/Stages/Stages.d.ts +6 -0
  250. package/lib/components/Stages/Stages.d.ts.map +1 -0
  251. package/lib/components/Stages/Stages.js +107 -0
  252. package/lib/components/Stages/Stages.js.map +1 -0
  253. package/lib/components/Stages/Stages.styles.d.ts +14 -0
  254. package/lib/components/Stages/Stages.styles.d.ts.map +1 -0
  255. package/lib/components/Stages/Stages.styles.js +270 -0
  256. package/lib/components/Stages/Stages.styles.js.map +1 -0
  257. package/lib/components/Stages/Stages.types.d.ts +38 -0
  258. package/lib/components/Stages/Stages.types.d.ts.map +1 -0
  259. package/lib/components/Stages/Stages.types.js +2 -0
  260. package/lib/components/Stages/Stages.types.js.map +1 -0
  261. package/lib/components/Stages/index.d.ts +3 -0
  262. package/lib/components/Stages/index.d.ts.map +1 -0
  263. package/lib/components/Stages/index.js +2 -0
  264. package/lib/components/Stages/index.js.map +1 -0
  265. package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
  266. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  267. package/lib/components/Stakeholders/StakeholderForm.js +49 -0
  268. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  269. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  270. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  271. package/lib/components/Stakeholders/Stakeholders.js +220 -0
  272. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  273. package/lib/components/Stakeholders/Stakeholders.types.d.ts +75 -0
  274. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  275. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  276. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  277. package/lib/components/Stakeholders/index.d.ts +3 -0
  278. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  279. package/lib/components/Stakeholders/index.js +2 -0
  280. package/lib/components/Stakeholders/index.js.map +1 -0
  281. package/lib/components/Tags/Tags.d.ts +34 -0
  282. package/lib/components/Tags/Tags.d.ts.map +1 -0
  283. package/lib/components/Tags/Tags.js +230 -0
  284. package/lib/components/Tags/Tags.js.map +1 -0
  285. package/lib/components/Tags/index.d.ts +3 -0
  286. package/lib/components/Tags/index.d.ts.map +1 -0
  287. package/lib/components/Tags/index.js +2 -0
  288. package/lib/components/Tags/index.js.map +1 -0
  289. package/lib/components/Tasks/TaskList.d.ts +39 -0
  290. package/lib/components/Tasks/TaskList.d.ts.map +1 -0
  291. package/lib/components/Tasks/TaskList.js +71 -0
  292. package/lib/components/Tasks/TaskList.js.map +1 -0
  293. package/lib/components/Tasks/Tasks.d.ts +29 -0
  294. package/lib/components/Tasks/Tasks.d.ts.map +1 -0
  295. package/lib/components/Tasks/Tasks.js +52 -0
  296. package/lib/components/Tasks/Tasks.js.map +1 -0
  297. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  298. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  299. package/lib/components/Tasks/Tasks.test-ids.js +5 -0
  300. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  301. package/lib/components/Tasks/index.d.ts +6 -0
  302. package/lib/components/Tasks/index.d.ts.map +1 -0
  303. package/lib/components/Tasks/index.js +4 -0
  304. package/lib/components/Tasks/index.js.map +1 -0
  305. package/lib/components/Timeline/Timeline.d.ts +6 -0
  306. package/lib/components/Timeline/Timeline.d.ts.map +1 -0
  307. package/lib/components/Timeline/Timeline.js +26 -0
  308. package/lib/components/Timeline/Timeline.js.map +1 -0
  309. package/lib/components/Timeline/Timeline.styles.d.ts +21 -0
  310. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -0
  311. package/lib/components/Timeline/Timeline.styles.js +165 -0
  312. package/lib/components/Timeline/Timeline.styles.js.map +1 -0
  313. package/lib/components/Timeline/Timeline.types.d.ts +66 -0
  314. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -0
  315. package/lib/components/Timeline/Timeline.types.js +2 -0
  316. package/lib/components/Timeline/Timeline.types.js.map +1 -0
  317. package/lib/components/Timeline/TimelineItem.d.ts +13 -0
  318. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
  319. package/lib/components/Timeline/TimelineItem.js +33 -0
  320. package/lib/components/Timeline/TimelineItem.js.map +1 -0
  321. package/lib/components/Timeline/TimelineToolbar.d.ts +6 -0
  322. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -0
  323. package/lib/components/Timeline/TimelineToolbar.js +68 -0
  324. package/lib/components/Timeline/TimelineToolbar.js.map +1 -0
  325. package/lib/components/Timeline/index.d.ts +4 -0
  326. package/lib/components/Timeline/index.d.ts.map +1 -0
  327. package/lib/components/Timeline/index.js +3 -0
  328. package/lib/components/Timeline/index.js.map +1 -0
  329. package/lib/components/Timeline/utils.d.ts +15 -0
  330. package/lib/components/Timeline/utils.d.ts.map +1 -0
  331. package/lib/components/Timeline/utils.js +75 -0
  332. package/lib/components/Timeline/utils.js.map +1 -0
  333. package/lib/index.d.ts +37 -0
  334. package/lib/index.d.ts.map +1 -0
  335. package/lib/index.js +38 -0
  336. package/lib/index.js.map +1 -0
  337. package/package.json +2 -2
@@ -0,0 +1,38 @@
1
+ import type { ReactNode, Ref } from 'react';
2
+ import type { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ export interface StepProps {
4
+ /** Step name - either text or link. */
5
+ name: ReactNode;
6
+ /** Flag determining whether step has been completed. */
7
+ completed: boolean;
8
+ /** Unique step identifier. */
9
+ id: string;
10
+ }
11
+ export interface StageProps {
12
+ /** Stage name. */
13
+ name: string;
14
+ /** Unique identifier. */
15
+ id: string;
16
+ /** Date of completion. Accepts date object, ISO string or timestamp. */
17
+ date?: Date | string | number;
18
+ /** Flag determining whether the stage is completed. */
19
+ completed: boolean;
20
+ /** Steps data defined in this stage. The stage is treated as not loaded if undefined. */
21
+ steps?: StepProps[];
22
+ }
23
+ export interface StagesProps extends BaseProps, NoChildrenProp {
24
+ /** List of objects describing each stage and their state. */
25
+ stages: StageProps[];
26
+ /** Current stage id. */
27
+ current: string;
28
+ /** Case title (label) */
29
+ caseTitle?: string;
30
+ /**
31
+ * Callback invoked when stage details are requested to show.
32
+ * @param stages stages' ids requested to load details for.
33
+ */
34
+ onLoadStage?: (stages: StageProps['id'][]) => void;
35
+ /** Ref to the stages container. */
36
+ ref?: Ref<HTMLDivElement>;
37
+ }
38
+ //# sourceMappingURL=Stages.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stages.types.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzE,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,uDAAuD;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D,6DAA6D;IAC7D,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;IACnD,mCAAmC;IACnC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Stages.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stages.types.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, Ref } from 'react';\n\nimport type { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface StepProps {\n /** Step name - either text or link. */\n name: ReactNode;\n /** Flag determining whether step has been completed. */\n completed: boolean;\n /** Unique step identifier. */\n id: string;\n}\n\nexport interface StageProps {\n /** Stage name. */\n name: string;\n /** Unique identifier. */\n id: string;\n /** Date of completion. Accepts date object, ISO string or timestamp. */\n date?: Date | string | number;\n /** Flag determining whether the stage is completed. */\n completed: boolean;\n /** Steps data defined in this stage. The stage is treated as not loaded if undefined. */\n steps?: StepProps[];\n}\n\nexport interface StagesProps extends BaseProps, NoChildrenProp {\n /** List of objects describing each stage and their state. */\n stages: StageProps[];\n /** Current stage id. */\n current: string;\n /** Case title (label) */\n caseTitle?: string;\n /**\n * Callback invoked when stage details are requested to show.\n * @param stages stages' ids requested to load details for.\n */\n onLoadStage?: (stages: StageProps['id'][]) => void;\n /** Ref to the stages container. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Stages';
2
+ export type { StagesProps } from './Stages.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Stages';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Stages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default } from './Stages';\nexport type { StagesProps } from './Stages.types';\n"]}
@@ -0,0 +1,7 @@
1
+ import type { StakeholdersProps } from './Stakeholders.types';
2
+ interface FormProps extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer' | 'rendererProps'> {
3
+ setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;
4
+ }
5
+ declare const _default: ({ roles, currentRole, renderer: Renderer, rendererProps, setSelectedRoleNameRef }: FormProps) => JSX.Element;
6
+ export default _default;
7
+ //# sourceMappingURL=StakeholderForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StakeholderForm.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/StakeholderForm.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,UAAU,SACR,SAAQ,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,eAAe,CAAC;IAC/F,sBAAsB,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACzE;4GAQE,SAAS;AANZ,wBA0FE"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import { ComboBox, RadioButtonGroup, RadioButton, Flex, useI18n, Input, getFocusables } from '@pega/cosmos-react-core';
4
+ export default ({ roles, currentRole, renderer: Renderer, rendererProps, setSelectedRoleNameRef }) => {
5
+ const contentRef = useRef(null);
6
+ const t = useI18n();
7
+ const [selectedRoleName, setSelectedRoleName] = useState(() => {
8
+ if (roles) {
9
+ return (currentRole ? roles.find(role => role.name === currentRole.name) : roles[0])?.name;
10
+ }
11
+ });
12
+ let control = null;
13
+ if (roles) {
14
+ const label = t('stakeholders_role');
15
+ if (roles.length > 3) {
16
+ const items = roles.map(role => {
17
+ return {
18
+ id: role.name,
19
+ primary: role.name,
20
+ selected: role.name === selectedRoleName
21
+ };
22
+ });
23
+ const selected = items.find(item => item.selected);
24
+ control = (_jsx(ComboBox, { label: label, selected: selected ? { items: { id: selected.id, text: selected.primary } } : undefined, menu: {
25
+ mode: 'single-select',
26
+ items,
27
+ onItemClick: setSelectedRoleName
28
+ } }));
29
+ }
30
+ else {
31
+ control = (_jsx(RadioButtonGroup, { label: label, name: 'role', inline: true, onChange: e => {
32
+ setSelectedRoleName(e.target.value);
33
+ }, children: roles.map(role => (_jsx(RadioButton, { label: role.name, value: role.name, checked: role.name === selectedRoleName }, role.name))) }));
34
+ }
35
+ }
36
+ else if (currentRole) {
37
+ control = (_jsx(Input, { readOnly: true, label: t('stakeholders_role'), value: currentRole.name, info: currentRole.description }));
38
+ }
39
+ useEffect(() => {
40
+ getFocusables(contentRef)[0]?.focus();
41
+ }, []);
42
+ useEffect(() => {
43
+ if (!roles)
44
+ return;
45
+ setSelectedRoleNameRef(selectedRoleName);
46
+ }, [selectedRoleName]);
47
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, ref: contentRef, children: [control, _jsx(Renderer, { ...rendererProps, selectedRoleName: selectedRoleName })] }));
48
+ };
49
+ //# sourceMappingURL=StakeholderForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StakeholderForm.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/StakeholderForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAa,EACd,MAAM,yBAAyB,CAAC;AASjC,eAAe,CAAC,EACd,KAAK,EACL,WAAW,EACX,QAAQ,EAAE,QAAQ,EAClB,aAAa,EACb,sBAAsB,EACZ,EAAE,EAAE;IACd,MAAM,UAAU,G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9D,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport {\n ComboBox,\n RadioButtonGroup,\n RadioButton,\n Flex,\n useI18n,\n Input,\n getFocusables\n} from '@pega/cosmos-react-core';\n\nimport type { Role, StakeholdersProps } from './Stakeholders.types';\n\ninterface FormProps\n extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer' | 'rendererProps'> {\n setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;\n}\n\nexport default ({\n roles,\n currentRole,\n renderer: Renderer,\n rendererProps,\n setSelectedRoleNameRef\n}: FormProps) => {\n const contentRef = useRef<HTMLElement>(null);\n const t = useI18n();\n\n const [selectedRoleName, setSelectedRoleName] = useState<Role['name'] | undefined>(() => {\n if (roles) {\n return (currentRole ? roles.find(role => role.name === currentRole.name) : roles[0])?.name;\n }\n });\n\n let control: JSX.Element | null = null;\n\n if (roles) {\n const label = t('stakeholders_role');\n\n if (roles.length > 3) {\n const items = roles.map(role => {\n return {\n id: role.name,\n primary: role.name,\n selected: role.name === selectedRoleName\n };\n });\n\n const selected = items.find(item => item.selected);\n\n control = (\n <ComboBox\n label={label}\n selected={selected ? { items: { id: selected.id, text: selected.primary } } : undefined}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: setSelectedRoleName\n }}\n />\n );\n } else {\n control = (\n <RadioButtonGroup\n label={label}\n name='role'\n inline\n onChange={e => {\n setSelectedRoleName(e.target.value);\n }}\n >\n {roles.map(role => (\n <RadioButton\n key={role.name}\n label={role.name}\n value={role.name}\n checked={role.name === selectedRoleName}\n />\n ))}\n </RadioButtonGroup>\n );\n }\n } else if (currentRole) {\n control = (\n <Input\n readOnly\n label={t('stakeholders_role')}\n value={currentRole.name}\n info={currentRole.description}\n />\n );\n }\n\n useEffect(() => {\n getFocusables(contentRef)[0]?.focus();\n }, []);\n\n useEffect(() => {\n if (!roles) return;\n setSelectedRoleNameRef(selectedRoleName);\n }, [selectedRoleName]);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }} ref={contentRef}>\n {control}\n <Renderer {...rendererProps} selectedRoleName={selectedRoleName} />\n </Flex>\n );\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { StakeholdersProps } from './Stakeholders.types';
4
+ declare const Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps>;
5
+ export default Stakeholders;
6
+ //# sourceMappingURL=Stakeholders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA8B,MAAM,OAAO,CAAC;AAiB3E,OAAO,KAAK,EAEV,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmBpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CA0UrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,220 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useRef, useEffect, useMemo, useState, useCallback } from 'react';
3
+ import styled from 'styled-components';
4
+ import { SummaryList, useI18n, Button, ViewAll, Modal, Popover, Flex, Text, useModalManager, useOuterEvent, Progress, useAfterInitialEffect } from '@pega/cosmos-react-core';
5
+ import StakeholderForm from './StakeholderForm';
6
+ const StyledStakeholders = styled(SummaryList) ``;
7
+ const StyledEditFormWrap = styled.div `
8
+ position: relative;
9
+ min-height: 8rem;
10
+
11
+ &[aria-busy='true'] > :nth-child(2) {
12
+ visibility: hidden;
13
+ }
14
+ `;
15
+ const StyledPopover = styled(Popover) `
16
+ width: 40ch;
17
+ min-height: 12rem;
18
+ `;
19
+ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count, loading, onAddNew, form, onViewAll, viewAll, error, ...restProps }, ref) {
20
+ const { create: createModal } = useModalManager();
21
+ const t = useI18n();
22
+ const modalMethods = useRef();
23
+ const [mode, setMode] = useState();
24
+ const [editing, setEditing] = useState(false);
25
+ const [viewAllSearchValue, setViewAllSearchValue] = useState('');
26
+ const popoverRef = useRef(null);
27
+ const progressMsgRef = useRef(t('loading'));
28
+ // Why? Don't think this should trigger a re-render. We just need the value when we invoke callback props.
29
+ const selectedRoleNameRef = useRef();
30
+ // Setter for the ref. Avoids a re-render.
31
+ const setSelectedRoleNameRef = useCallback((selectedRoleName) => {
32
+ selectedRoleNameRef.current = selectedRoleName;
33
+ }, []);
34
+ const [popoverTarget, setPopoverTarget] = useState(null);
35
+ const itemElsRef = useRef({
36
+ itemEls: [],
37
+ viewAllItemEls: []
38
+ });
39
+ // This function merges the pre-defined actions(add & edit) to the item object.
40
+ const mergeItemActions = (items) => {
41
+ return items.map(({ onEdit, onRemove, ...rest }, i) => {
42
+ let itemActions = [];
43
+ const elArray = itemElsRef.current[mode === 'viewAll' ? 'viewAllItemEls' : 'itemEls'];
44
+ if (onEdit) {
45
+ itemActions = [
46
+ {
47
+ id: 'edit',
48
+ text: t('edit'),
49
+ icon: 'pencil',
50
+ onClick: () => {
51
+ setEditing(true);
52
+ setPopoverTarget({
53
+ portal: elArray[i],
54
+ button: elArray[i].querySelector('button[aria-haspopup="menu"]')
55
+ });
56
+ onEdit?.();
57
+ }
58
+ }
59
+ ];
60
+ }
61
+ if (onRemove) {
62
+ itemActions = [
63
+ ...itemActions,
64
+ {
65
+ id: 'remove',
66
+ text: t('remove'),
67
+ icon: 'trash',
68
+ onClick: () => {
69
+ onRemove?.();
70
+ }
71
+ }
72
+ ];
73
+ }
74
+ return {
75
+ ...rest,
76
+ ref: (el) => {
77
+ elArray[i] = el;
78
+ },
79
+ actions: itemActions
80
+ };
81
+ });
82
+ };
83
+ const closePopover = () => {
84
+ if (!popoverTarget || (form.loading && progressMsgRef.current === t('submitting')))
85
+ return;
86
+ popoverTarget.button?.focus();
87
+ setPopoverTarget(null);
88
+ setEditing(false);
89
+ progressMsgRef.current = t('loading');
90
+ };
91
+ let formContent = null;
92
+ if ((mode === 'add' || editing) &&
93
+ (!form.loading || progressMsgRef.current === t('submitting'))) {
94
+ formContent = (_jsx(StakeholderForm, { roles: form.roles, currentRole: form.currentRole, renderer: form.renderer, rendererProps: form.rendererProps, setSelectedRoleNameRef: setSelectedRoleNameRef }));
95
+ }
96
+ // Actions used for add and edit both in the modal and the popover.
97
+ let formActions = null;
98
+ if ((mode === 'add' || editing) &&
99
+ (!form.loading || progressMsgRef.current === t('submitting'))) {
100
+ const closeForm = () => {
101
+ if (mode === 'add') {
102
+ modalMethods.current?.dismiss();
103
+ }
104
+ else {
105
+ closePopover();
106
+ }
107
+ };
108
+ formActions = (_jsxs(_Fragment, { children: [_jsx(Button, { disabled: form.loading, onClick: () => {
109
+ form.onDismiss({ closeForm });
110
+ }, children: t('cancel') }), _jsx(Button, { disabled: form.loading, type: 'submit', variant: 'primary', onClick: () => {
111
+ progressMsgRef.current = t('submitting');
112
+ form.onSubmit({
113
+ selectedRoleName: selectedRoleNameRef.current,
114
+ closeForm
115
+ });
116
+ }, children: t('submit') })] }));
117
+ }
118
+ let editPopover = null;
119
+ if (popoverTarget) {
120
+ editPopover = (_jsx(StyledPopover, { ref: popoverRef, target: popoverTarget.button, placement: 'auto', role: 'dialog', children: _jsxs(Flex, { container: { direction: 'column', gap: 2, pad: 2 }, children: [_jsx(Text, { variant: 'h3', children: t('edit_stakeholder') }), _jsxs(StyledEditFormWrap, { "aria-busy": form.loading ? 'true' : 'false', children: [_jsx(Progress, { placement: 'local', visible: form.loading, message: progressMsgRef.current }), (!form.loading || progressMsgRef.current === t('submitting')) && (_jsx(StakeholderForm, { roles: form.roles, currentRole: form.currentRole, renderer: form.renderer, rendererProps: form.rendererProps, setSelectedRoleNameRef: setSelectedRoleNameRef }))] }), formActions && _jsx(Flex, { container: { justify: 'between' }, children: formActions })] }) }));
121
+ }
122
+ // Content for the modal either for adding new or viewing all.
123
+ let modalContent = null;
124
+ if (mode === 'add')
125
+ modalContent = formContent;
126
+ if (!viewAll.loading && (mode === 'viewAll' || (editing && modalMethods.current))) {
127
+ modalContent = (_jsxs(_Fragment, { children: [_jsx(ViewAll, { items: mergeItemActions(viewAll.items), actions: [
128
+ {
129
+ id: 'addStakeHolder',
130
+ text: 'Add new',
131
+ onClick: () => {
132
+ setMode('add');
133
+ onAddNew?.();
134
+ }
135
+ }
136
+ ], searchInputProps: viewAll.onSearch
137
+ ? {
138
+ value: viewAllSearchValue,
139
+ onSearchChange: (value) => {
140
+ setViewAllSearchValue(value);
141
+ viewAll?.onSearch?.(value);
142
+ }
143
+ }
144
+ : undefined }), editPopover] }));
145
+ }
146
+ useEffect(() => {
147
+ if (!mode) {
148
+ modalMethods.current = undefined;
149
+ return;
150
+ }
151
+ const modalProps = {
152
+ progress: (mode === 'add' && form.loading) || viewAll.loading
153
+ ? { message: progressMsgRef.current }
154
+ : undefined,
155
+ count: mode === 'viewAll' ? count : undefined,
156
+ children: modalContent,
157
+ actions: mode === 'add' ? formActions : undefined,
158
+ onRequestDismiss: form.loading && progressMsgRef.current === t('submitting') ? () => false : undefined
159
+ };
160
+ if (modalMethods.current) {
161
+ modalMethods.current.update(modalProps);
162
+ }
163
+ else if (mode === 'add' || mode === 'viewAll') {
164
+ modalMethods.current = createModal(Modal, {
165
+ ...modalProps,
166
+ heading: mode === 'add' ? t('add_stakeholders') : t('view_stakeholders'),
167
+ onAfterClose: () => {
168
+ if (mode === 'add') {
169
+ form.onAfterClose?.();
170
+ }
171
+ else {
172
+ setViewAllSearchValue('');
173
+ viewAll.onAfterClose?.();
174
+ }
175
+ progressMsgRef.current = t('loading');
176
+ setMode(undefined);
177
+ }
178
+ });
179
+ }
180
+ }, [mode, modalContent, form.loading, formActions, count, viewAll.loading]);
181
+ // Using mousedown instead of click since drag selecting an input's value within the popover, then releasing outside the popover triggers outer click.
182
+ useOuterEvent('mousedown', [popoverRef], closePopover);
183
+ const onKeydown = (e) => {
184
+ if (e.key === 'Escape') {
185
+ closePopover();
186
+ }
187
+ };
188
+ useEffect(() => {
189
+ if (!popoverTarget)
190
+ return;
191
+ document.addEventListener('keydown', onKeydown);
192
+ return () => {
193
+ document.removeEventListener('keydown', onKeydown);
194
+ };
195
+ }, [popoverTarget]);
196
+ useAfterInitialEffect(() => {
197
+ if (!popoverTarget)
198
+ form.onAfterClose?.();
199
+ }, [popoverTarget]);
200
+ return (_jsxs(_Fragment, { children: [_jsx(StyledStakeholders, { ...restProps, ref: ref, icon: 'person', name: t('view_stakeholders'), headingTag: 'h3', loading: loading, count: count, error: error, items: useMemo(() => mergeItemActions(itemsProp.slice(0, 3)), [mergeItemActions, itemsProp]), actions: onAddNew
201
+ ? [
202
+ {
203
+ text: t('add'),
204
+ id: 'add_new',
205
+ icon: 'plus',
206
+ onClick() {
207
+ setMode('add');
208
+ onAddNew?.();
209
+ }
210
+ }
211
+ ]
212
+ : undefined, onViewAll: onViewAll && count && count > 3
213
+ ? () => {
214
+ setMode('viewAll');
215
+ onViewAll?.();
216
+ }
217
+ : undefined }), editPopover && mode !== 'viewAll' ? editPopover : null] }));
218
+ });
219
+ export default Stakeholders;
220
+ //# sourceMappingURL=Stakeholders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stakeholders.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,WAAW,EACX,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,eAAe,EACf,aAAa,EACb,QA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AAC,QAAQ,EACb,IAAI,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC5B,UAAU,EAAC,IAAI,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,OAAO,CACZ,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC7C,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAC9B,EACD,OAAO,EACL,QAAQ;oBACN,CAAC,CAAC;wBACE;4BACE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;4BACd,EAAE,EAAE,SAAS;4BACb,IAAI,EAAE,MAAM;4BACZ,OAAO;gCACL,OAAO,CAAC,KAAK,CAAC,CAAC;gCACf,QAAQ,EAAE,EAAE,CAAC;4BACf,CAAC;yBACF;qBACF;oBACH,CAAC,CAAC,SAAS,EAEf,SAAS,EACP,SAAS,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC;oBAC7B,CAAC,CAAC,GAAG,EAAE;wBACH,OAAO,CAAC,SAAS,CAAC,CAAC;wBACnB,SAAS,EAAE,EAAE,CAAC;oBAChB,CAAC;oBACH,CAAC,CAAC,SAAS,GAEf,EAED,WAAW,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IACtD,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useMemo, useState, useCallback } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport {\n SummaryList,\n useI18n,\n Button,\n ViewAll,\n Modal,\n Popover,\n Flex,\n Text,\n useModalManager,\n useOuterEvent,\n Progress,\n useAfterInitialEffect\n} from '@pega/cosmos-react-core';\nimport type {\n Action,\n ForwardProps,\n ModalMethods,\n ModalProps,\n OmitStrict\n} from '@pega/cosmos-react-core';\n\nimport type { Role, StakeholdersProps } from './Stakeholders.types';\nimport StakeholderForm from './StakeholderForm';\n\nconst StyledStakeholders = styled(SummaryList)``;\n\nconst StyledEditFormWrap = styled.div`\n position: relative;\n min-height: 8rem;\n\n &[aria-busy='true'] > :nth-child(2) {\n visibility: hidden;\n }\n`;\n\nconst StyledPopover = styled(Popover)`\n width: 40ch;\n min-height: 12rem;\n`;\n\nconst Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps> = forwardRef(\n function Stakeholders(\n {\n items: itemsProp,\n count,\n loading,\n onAddNew,\n form,\n onViewAll,\n viewAll,\n error,\n ...restProps\n }: PropsWithoutRef<StakeholdersProps>,\n ref: StakeholdersProps['ref']\n ) {\n const { create: createModal } = useModalManager();\n const t = useI18n();\n const modalMethods = useRef<ModalMethods>();\n const [mode, setMode] = useState<undefined | 'add' | 'viewAll'>();\n const [editing, setEditing] = useState(false);\n const [viewAllSearchValue, setViewAllSearchValue] = useState('');\n const popoverRef = useRef<HTMLDivElement>(null);\n const progressMsgRef = useRef(t('loading'));\n\n // Why? Don't think this should trigger a re-render. We just need the value when we invoke callback props.\n const selectedRoleNameRef = useRef<Role['name'] | undefined>();\n // Setter for the ref. Avoids a re-render.\n const setSelectedRoleNameRef = useCallback((selectedRoleName?: Role['name']) => {\n selectedRoleNameRef.current = selectedRoleName;\n }, []);\n\n const [popoverTarget, setPopoverTarget] = useState<{\n portal: HTMLLIElement;\n button: HTMLButtonElement | null;\n } | null>(null);\n\n const itemElsRef = useRef<{ itemEls: HTMLLIElement[]; viewAllItemEls: HTMLLIElement[] }>({\n itemEls: [],\n viewAllItemEls: []\n });\n\n // This function merges the pre-defined actions(add & edit) to the item object.\n const mergeItemActions = (\n items: StakeholdersProps['items'] | NonNullable<StakeholdersProps['viewAll']>['items']\n ) => {\n return items.map(({ onEdit, onRemove, ...rest }, i) => {\n let itemActions: Action[] = [];\n const elArray = itemElsRef.current[mode === 'viewAll' ? 'viewAllItemEls' : 'itemEls'];\n\n if (onEdit) {\n itemActions = [\n {\n id: 'edit',\n text: t('edit'),\n icon: 'pencil',\n onClick: () => {\n setEditing(true);\n setPopoverTarget({\n portal: elArray[i],\n button: elArray[i].querySelector<HTMLButtonElement>(\n 'button[aria-haspopup=\"menu\"]'\n )\n });\n\n onEdit?.();\n }\n }\n ];\n }\n\n if (onRemove) {\n itemActions = [\n ...itemActions,\n {\n id: 'remove',\n text: t('remove'),\n icon: 'trash',\n onClick: () => {\n onRemove?.();\n }\n }\n ];\n }\n\n return {\n ...rest,\n ref: (el: HTMLLIElement) => {\n elArray[i] = el;\n },\n actions: itemActions\n };\n });\n };\n\n const closePopover = () => {\n if (!popoverTarget || (form.loading && progressMsgRef.current === t('submitting'))) return;\n popoverTarget.button?.focus();\n setPopoverTarget(null);\n setEditing(false);\n progressMsgRef.current = t('loading');\n };\n\n let formContent: ReactNode = null;\n if (\n (mode === 'add' || editing) &&\n (!form.loading || progressMsgRef.current === t('submitting'))\n ) {\n formContent = (\n <StakeholderForm\n roles={form.roles}\n currentRole={form.currentRole}\n renderer={form.renderer}\n rendererProps={form.rendererProps}\n setSelectedRoleNameRef={setSelectedRoleNameRef}\n />\n );\n }\n\n // Actions used for add and edit both in the modal and the popover.\n let formActions: ReactNode = null;\n if (\n (mode === 'add' || editing) &&\n (!form.loading || progressMsgRef.current === t('submitting'))\n ) {\n const closeForm = () => {\n if (mode === 'add') {\n modalMethods.current?.dismiss();\n } else {\n closePopover();\n }\n };\n\n formActions = (\n <>\n <Button\n disabled={form.loading}\n onClick={() => {\n form.onDismiss({ closeForm });\n }}\n >\n {t('cancel')}\n </Button>\n <Button\n disabled={form.loading}\n type='submit'\n variant='primary'\n onClick={() => {\n progressMsgRef.current = t('submitting');\n form.onSubmit({\n selectedRoleName: selectedRoleNameRef.current,\n closeForm\n });\n }}\n >\n {t('submit')}\n </Button>\n </>\n );\n }\n\n let editPopover: ReactNode = null;\n if (popoverTarget) {\n editPopover = (\n <StyledPopover\n ref={popoverRef}\n target={popoverTarget.button}\n placement='auto'\n role='dialog'\n >\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }}>\n <Text variant='h3'>{t('edit_stakeholder')}</Text>\n <StyledEditFormWrap aria-busy={form.loading ? 'true' : 'false'}>\n <Progress placement='local' visible={form.loading} message={progressMsgRef.current} />\n {(!form.loading || progressMsgRef.current === t('submitting')) && (\n <StakeholderForm\n roles={form.roles}\n currentRole={form.currentRole}\n renderer={form.renderer}\n rendererProps={form.rendererProps}\n setSelectedRoleNameRef={setSelectedRoleNameRef}\n />\n )}\n </StyledEditFormWrap>\n {formActions && <Flex container={{ justify: 'between' }}>{formActions}</Flex>}\n </Flex>\n </StyledPopover>\n );\n }\n\n // Content for the modal either for adding new or viewing all.\n let modalContent: ReactNode = null;\n if (mode === 'add') modalContent = formContent;\n\n if (!viewAll.loading && (mode === 'viewAll' || (editing && modalMethods.current))) {\n modalContent = (\n <>\n <ViewAll\n items={mergeItemActions(viewAll.items)}\n actions={[\n {\n id: 'addStakeHolder',\n text: 'Add new',\n onClick: () => {\n setMode('add');\n onAddNew?.();\n }\n }\n ]}\n searchInputProps={\n viewAll.onSearch\n ? {\n value: viewAllSearchValue,\n onSearchChange: (value: string) => {\n setViewAllSearchValue(value);\n viewAll?.onSearch?.(value);\n }\n }\n : undefined\n }\n />\n {/* Edit popover triggered from a modal must be rendered within modal content to render in correct DOM position. */}\n {editPopover}\n </>\n );\n }\n\n useEffect(() => {\n if (!mode) {\n modalMethods.current = undefined;\n return;\n }\n\n const modalProps: OmitStrict<ModalProps, 'heading'> = {\n progress:\n (mode === 'add' && form.loading) || viewAll.loading\n ? { message: progressMsgRef.current }\n : undefined,\n count: mode === 'viewAll' ? count : undefined,\n children: modalContent,\n actions: mode === 'add' ? formActions : undefined,\n onRequestDismiss:\n form.loading && progressMsgRef.current === t('submitting') ? () => false : undefined\n };\n\n if (modalMethods.current) {\n modalMethods.current.update(modalProps);\n } else if (mode === 'add' || mode === 'viewAll') {\n modalMethods.current = createModal(Modal, {\n ...modalProps,\n heading: mode === 'add' ? t('add_stakeholders') : t('view_stakeholders'),\n onAfterClose: () => {\n if (mode === 'add') {\n form.onAfterClose?.();\n } else {\n setViewAllSearchValue('');\n viewAll.onAfterClose?.();\n }\n\n progressMsgRef.current = t('loading');\n setMode(undefined);\n }\n });\n }\n }, [mode, modalContent, form.loading, formActions, count, viewAll.loading]);\n\n // Using mousedown instead of click since drag selecting an input's value within the popover, then releasing outside the popover triggers outer click.\n useOuterEvent('mousedown', [popoverRef], closePopover);\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closePopover();\n }\n };\n\n useEffect(() => {\n if (!popoverTarget) return;\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, [popoverTarget]);\n\n useAfterInitialEffect(() => {\n if (!popoverTarget) form.onAfterClose?.();\n }, [popoverTarget]);\n\n return (\n <>\n <StyledStakeholders\n {...restProps}\n ref={ref}\n icon='person'\n name={t('view_stakeholders')}\n headingTag='h3'\n loading={loading}\n count={count}\n error={error}\n items={useMemo(\n () => mergeItemActions(itemsProp.slice(0, 3)),\n [mergeItemActions, itemsProp]\n )}\n actions={\n onAddNew\n ? [\n {\n text: t('add'),\n id: 'add_new',\n icon: 'plus',\n onClick() {\n setMode('add');\n onAddNew?.();\n }\n }\n ]\n : undefined\n }\n onViewAll={\n onViewAll && count && count > 3\n ? () => {\n setMode('viewAll');\n onViewAll?.();\n }\n : undefined\n }\n />\n {/* When edit is opened outside of the view all modal. */}\n {editPopover && mode !== 'viewAll' ? editPopover : null}\n </>\n );\n }\n);\n\nexport default Stakeholders;\n"]}
@@ -0,0 +1,75 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { SummaryListProps, ForwardProps, NoChildrenProp, SummaryListItem } from '@pega/cosmos-react-core';
3
+ export type Role = {
4
+ name: string;
5
+ description: string;
6
+ };
7
+ /** A simple extension of a SummaryListItem. Pass onEdit and or onRemove to render either action for a stakeholder. */
8
+ export interface Stakeholder extends SummaryListItem, ForwardProps {
9
+ onEdit?: () => void;
10
+ onRemove?: () => void;
11
+ }
12
+ export interface StakeholdersProps extends NoChildrenProp, Pick<SummaryListProps, 'count' | 'loading' | 'error' | 'ref'> {
13
+ /**
14
+ * The initial array of stakeholders presented in the default state of the widget.
15
+ * This array will be sliced internally to the first three items but recommend only passing up to that length as a best practice.
16
+ */
17
+ items: Stakeholder[];
18
+ /** Called when a user opens the add form. */
19
+ onAddNew?: () => void;
20
+ /**
21
+ * Data and a component required to render a form for both add and edit.
22
+ * If there are roles, the renderer is passed the currently selected role.
23
+ */
24
+ form: {
25
+ /** Indicates the form is in a loading state either initially or after add/edit is submitted. */
26
+ loading?: boolean;
27
+ /** An array of available roles a stakeholder may be assigned. */
28
+ roles?: Role[];
29
+ /** Use this when onAdd or onEdit is invoked to indicate to the component which role option to select. */
30
+ currentRole?: Role;
31
+ /**
32
+ * A component to render the main portion of the add/edit stakeholder form.
33
+ * This may be a simple function and will be pass a prop when the selected role changes.
34
+ */
35
+ renderer: ComponentType<{
36
+ selectedRoleName?: Role['name'];
37
+ }>;
38
+ /** A props object that will be passed to the form renderer. */
39
+ rendererProps?: {
40
+ [key: string]: unknown;
41
+ };
42
+ /**
43
+ * Called when a user submits the form.
44
+ * The name of the currently selected role will be passed along with a function to close the form on an arg object.
45
+ * closeForm will close the modal or popover the form is preseneted in.
46
+ * closeForm can be call once validations and requests have resolved.
47
+ */
48
+ onSubmit: ({ selectedRoleName, closeForm }: {
49
+ selectedRoleName: Role['name'] | undefined;
50
+ closeForm: () => void;
51
+ }) => void;
52
+ /**
53
+ * Called when a user cancels a form.
54
+ * A function to close the form will be passed on an arg object.
55
+ */
56
+ onDismiss: ({ closeForm }: {
57
+ closeForm: () => void;
58
+ }) => void;
59
+ /** Called after the modal or popover transitions and un-mounts as a result of a closeForm call or user dismissal. */
60
+ onAfterClose?: () => void;
61
+ };
62
+ /** Called when a user opens the view all modal. */
63
+ onViewAll?: () => void;
64
+ viewAll: {
65
+ /** Indicates the view all list is in a loading state while data is fetched. */
66
+ loading?: boolean;
67
+ /** Pass a full or filtered list of stakeholder items. Filter based on search input. */
68
+ items: StakeholdersProps['items'];
69
+ /** Called when a user enters a view all search. Return a filtered array to viewAll['items'] with matching stakeholders. */
70
+ onSearch?: (value: string) => void;
71
+ /** Called after the modal or popover transitions and un-mounts as a result of a closeForm call or user dismissal. */
72
+ onAfterClose?: () => void;
73
+ };
74
+ }
75
+ //# sourceMappingURL=Stakeholders.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stakeholders.types.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,sHAAsH;AACtH,MAAM,WAAW,WAAY,SAAQ,eAAe,EAAE,YAAY;IAChE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,iBACf,SAAQ,cAAc,EACpB,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;IAC/D;;;OAGG;IACH,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,IAAI,EAAE;QACJ,gGAAgG;QAChG,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,iEAAiE;QACjE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;QACf,yGAAyG;QACzG,WAAW,CAAC,EAAE,IAAI,CAAC;QACnB;;;WAGG;QACH,QAAQ,EAAE,aAAa,CAAC;YAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;SAAE,CAAC,CAAC;QAC7D,+DAA+D;QAC/D,aAAa,CAAC,EAAE;YACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;QACF;;;;;WAKG;QACH,QAAQ,EAAE,CAAC,EACT,gBAAgB,EAChB,SAAS,EACV,EAAE;YACD,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;YAC3C,SAAS,EAAE,MAAM,IAAI,CAAC;SACvB,KAAK,IAAI,CAAC;QACX;;;WAGG;QACH,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE;YAAE,SAAS,EAAE,MAAM,IAAI,CAAA;SAAE,KAAK,IAAI,CAAC;QAC9D,qHAAqH;QACrH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3B,CAAC;IACF,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE;QACP,+EAA+E;QAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,uFAAuF;QACvF,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAClC,2HAA2H;QAC3H,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACnC,qHAAqH;QACrH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3B,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Stakeholders.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stakeholders.types.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentType } from 'react';\n\nimport type {\n SummaryListProps,\n ForwardProps,\n NoChildrenProp,\n SummaryListItem\n} from '@pega/cosmos-react-core';\n\nexport type Role = {\n name: string;\n description: string;\n};\n\n/** A simple extension of a SummaryListItem. Pass onEdit and or onRemove to render either action for a stakeholder. */\nexport interface Stakeholder extends SummaryListItem, ForwardProps {\n onEdit?: () => void;\n onRemove?: () => void;\n}\n\nexport interface StakeholdersProps\n extends NoChildrenProp,\n Pick<SummaryListProps, 'count' | 'loading' | 'error' | 'ref'> {\n /**\n * The initial array of stakeholders presented in the default state of the widget.\n * This array will be sliced internally to the first three items but recommend only passing up to that length as a best practice.\n */\n items: Stakeholder[];\n /** Called when a user opens the add form. */\n onAddNew?: () => void;\n /**\n * Data and a component required to render a form for both add and edit.\n * If there are roles, the renderer is passed the currently selected role.\n */\n form: {\n /** Indicates the form is in a loading state either initially or after add/edit is submitted. */\n loading?: boolean;\n /** An array of available roles a stakeholder may be assigned. */\n roles?: Role[];\n /** Use this when onAdd or onEdit is invoked to indicate to the component which role option to select. */\n currentRole?: Role;\n /**\n * A component to render the main portion of the add/edit stakeholder form.\n * This may be a simple function and will be pass a prop when the selected role changes.\n */\n renderer: ComponentType<{ selectedRoleName?: Role['name'] }>;\n /** A props object that will be passed to the form renderer. */\n rendererProps?: {\n [key: string]: unknown;\n };\n /**\n * Called when a user submits the form.\n * The name of the currently selected role will be passed along with a function to close the form on an arg object.\n * closeForm will close the modal or popover the form is preseneted in.\n * closeForm can be call once validations and requests have resolved.\n */\n onSubmit: ({\n selectedRoleName,\n closeForm\n }: {\n selectedRoleName: Role['name'] | undefined;\n closeForm: () => void;\n }) => void;\n /**\n * Called when a user cancels a form.\n * A function to close the form will be passed on an arg object.\n */\n onDismiss: ({ closeForm }: { closeForm: () => void }) => void;\n /** Called after the modal or popover transitions and un-mounts as a result of a closeForm call or user dismissal. */\n onAfterClose?: () => void;\n };\n /** Called when a user opens the view all modal. */\n onViewAll?: () => void;\n viewAll: {\n /** Indicates the view all list is in a loading state while data is fetched. */\n loading?: boolean;\n /** Pass a full or filtered list of stakeholder items. Filter based on search input. */\n items: StakeholdersProps['items'];\n /** Called when a user enters a view all search. Return a filtered array to viewAll['items'] with matching stakeholders. */\n onSearch?: (value: string) => void;\n /** Called after the modal or popover transitions and un-mounts as a result of a closeForm call or user dismissal. */\n onAfterClose?: () => void;\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Stakeholders';
2
+ export type { StakeholdersProps, Role, Stakeholder } from './Stakeholders.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Stakeholders';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default } from './Stakeholders';\nexport type { StakeholdersProps, Role, Stakeholder } from './Stakeholders.types';\n"]}
@@ -0,0 +1,34 @@
1
+ import type { FunctionComponent, Ref } from 'react';
2
+ import type { BaseProps, ForwardProps, ErrorStateProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ export interface SelectedTag {
4
+ text: string;
5
+ newTag?: boolean;
6
+ }
7
+ export interface TagsProps extends BaseProps, NoChildrenProp {
8
+ /** A list of tags. */
9
+ tags: string[];
10
+ /**
11
+ * A list of available tags to add from.
12
+ * @default []
13
+ */
14
+ availableTags?: string[];
15
+ /** If true, a loading indicator will render in place of the tags list. */
16
+ loading?: boolean;
17
+ /** If defined, an error message will render in the component and actions will be disabled. */
18
+ error?: boolean | string | ErrorStateProps;
19
+ /** Callback triggered when a search query is changed in the Edit tags modal. */
20
+ onSearch?: (filterValue: string) => void;
21
+ /** Callback triggered when a tag is clicked. */
22
+ onTagClick?: (tag: string) => void;
23
+ /** Callback triggered when modified tags are submitted from the modal. */
24
+ onEditTags?: (tags: SelectedTag[]) => Promise<void>;
25
+ /** Ref for the Tags card. */
26
+ ref?: Ref<HTMLElement>;
27
+ }
28
+ export declare const StyledTags: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, {
29
+ isLoading?: boolean | undefined;
30
+ viewAll?: boolean | undefined;
31
+ }, never>;
32
+ declare const Tags: FunctionComponent<TagsProps & ForwardProps>;
33
+ export default Tags;
34
+ //# sourceMappingURL=Tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/components/Tags/Tags.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,iBAAiB,EAEjB,GAAG,EACJ,MAAM,OAAO,CAAC;AA6Bf,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAGZ,eAAe,EACf,cAAc,EACf,MAAM,yBAAyB,CAAC;AASjC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,cAAc;IAC1D,sBAAsB;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,eAAe,CAAC;IAC3C,gFAAgF;IAChF,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gDAAgD;IAChD,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,6BAA6B;IAC7B,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AASD,eAAO,MAAM,UAAU;;;SA4BtB,CAAC;AAoMF,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CA8HpD,CAAC;AAEH,eAAe,IAAI,CAAC"}