@pega/cosmos-react-work 5.0.0-dev.4.6 → 5.0.0-dev.4.8

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 (329) hide show
  1. package/package.json +2 -2
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +0 -23
  3. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +0 -1
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js +0 -93
  5. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +0 -1
  6. package/lib/components/AppAnnouncement/index.d.ts +0 -3
  7. package/lib/components/AppAnnouncement/index.d.ts.map +0 -1
  8. package/lib/components/AppAnnouncement/index.js +0 -2
  9. package/lib/components/AppAnnouncement/index.js.map +0 -1
  10. package/lib/components/Article/Article.d.ts +0 -49
  11. package/lib/components/Article/Article.d.ts.map +0 -1
  12. package/lib/components/Article/Article.js +0 -73
  13. package/lib/components/Article/Article.js.map +0 -1
  14. package/lib/components/Article/ArticleFooter.d.ts +0 -40
  15. package/lib/components/Article/ArticleFooter.d.ts.map +0 -1
  16. package/lib/components/Article/ArticleFooter.js +0 -54
  17. package/lib/components/Article/ArticleFooter.js.map +0 -1
  18. package/lib/components/Article/ArticleMeta.d.ts +0 -13
  19. package/lib/components/Article/ArticleMeta.d.ts.map +0 -1
  20. package/lib/components/Article/ArticleMeta.js +0 -24
  21. package/lib/components/Article/ArticleMeta.js.map +0 -1
  22. package/lib/components/Article/index.d.ts +0 -5
  23. package/lib/components/Article/index.d.ts.map +0 -1
  24. package/lib/components/Article/index.js +0 -3
  25. package/lib/components/Article/index.js.map +0 -1
  26. package/lib/components/ArticleList/ArticleList.d.ts +0 -6
  27. package/lib/components/ArticleList/ArticleList.d.ts.map +0 -1
  28. package/lib/components/ArticleList/ArticleList.js +0 -132
  29. package/lib/components/ArticleList/ArticleList.js.map +0 -1
  30. package/lib/components/ArticleList/ArticleList.types.d.ts +0 -87
  31. package/lib/components/ArticleList/ArticleList.types.d.ts.map +0 -1
  32. package/lib/components/ArticleList/ArticleList.types.js +0 -2
  33. package/lib/components/ArticleList/ArticleList.types.js.map +0 -1
  34. package/lib/components/ArticleList/ArticleListFilter.d.ts +0 -6
  35. package/lib/components/ArticleList/ArticleListFilter.d.ts.map +0 -1
  36. package/lib/components/ArticleList/ArticleListFilter.js +0 -61
  37. package/lib/components/ArticleList/ArticleListFilter.js.map +0 -1
  38. package/lib/components/ArticleList/ArticleListHeader.d.ts +0 -5
  39. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +0 -1
  40. package/lib/components/ArticleList/ArticleListHeader.js +0 -20
  41. package/lib/components/ArticleList/ArticleListHeader.js.map +0 -1
  42. package/lib/components/ArticleList/ArticleSummary.d.ts +0 -7
  43. package/lib/components/ArticleList/ArticleSummary.d.ts.map +0 -1
  44. package/lib/components/ArticleList/ArticleSummary.js +0 -56
  45. package/lib/components/ArticleList/ArticleSummary.js.map +0 -1
  46. package/lib/components/ArticleList/index.d.ts +0 -6
  47. package/lib/components/ArticleList/index.d.ts.map +0 -1
  48. package/lib/components/ArticleList/index.js +0 -4
  49. package/lib/components/ArticleList/index.js.map +0 -1
  50. package/lib/components/Assignments/Assignments.d.ts +0 -21
  51. package/lib/components/Assignments/Assignments.d.ts.map +0 -1
  52. package/lib/components/Assignments/Assignments.js +0 -20
  53. package/lib/components/Assignments/Assignments.js.map +0 -1
  54. package/lib/components/Assignments/Assignments.styles.d.ts +0 -8
  55. package/lib/components/Assignments/Assignments.styles.d.ts.map +0 -1
  56. package/lib/components/Assignments/Assignments.styles.js +0 -41
  57. package/lib/components/Assignments/Assignments.styles.js.map +0 -1
  58. package/lib/components/Assignments/index.d.ts +0 -2
  59. package/lib/components/Assignments/index.d.ts.map +0 -1
  60. package/lib/components/Assignments/index.js +0 -2
  61. package/lib/components/Assignments/index.js.map +0 -1
  62. package/lib/components/CasePreview/CasePreview.d.ts +0 -27
  63. package/lib/components/CasePreview/CasePreview.d.ts.map +0 -1
  64. package/lib/components/CasePreview/CasePreview.js +0 -82
  65. package/lib/components/CasePreview/CasePreview.js.map +0 -1
  66. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +0 -2
  67. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +0 -1
  68. package/lib/components/CasePreview/CasePreview.test-ids.js +0 -3
  69. package/lib/components/CasePreview/CasePreview.test-ids.js.map +0 -1
  70. package/lib/components/CasePreview/index.d.ts +0 -3
  71. package/lib/components/CasePreview/index.d.ts.map +0 -1
  72. package/lib/components/CasePreview/index.js +0 -2
  73. package/lib/components/CasePreview/index.js.map +0 -1
  74. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts +0 -4
  75. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +0 -1
  76. package/lib/components/CaseView/CaseHeader/CaseHeader.js +0 -127
  77. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +0 -1
  78. package/lib/components/CaseView/CaseHeader/Summary.d.ts +0 -6
  79. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +0 -1
  80. package/lib/components/CaseView/CaseHeader/Summary.js +0 -182
  81. package/lib/components/CaseView/CaseHeader/Summary.js.map +0 -1
  82. package/lib/components/CaseView/CaseSummary.d.ts +0 -4
  83. package/lib/components/CaseView/CaseSummary.d.ts.map +0 -1
  84. package/lib/components/CaseView/CaseSummary.js +0 -18
  85. package/lib/components/CaseView/CaseSummary.js.map +0 -1
  86. package/lib/components/CaseView/CaseSummaryFields.d.ts +0 -6
  87. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +0 -1
  88. package/lib/components/CaseView/CaseSummaryFields.js +0 -18
  89. package/lib/components/CaseView/CaseSummaryFields.js.map +0 -1
  90. package/lib/components/CaseView/CaseView.context.d.ts +0 -5
  91. package/lib/components/CaseView/CaseView.context.d.ts.map +0 -1
  92. package/lib/components/CaseView/CaseView.context.js +0 -5
  93. package/lib/components/CaseView/CaseView.context.js.map +0 -1
  94. package/lib/components/CaseView/CaseView.d.ts +0 -8
  95. package/lib/components/CaseView/CaseView.d.ts.map +0 -1
  96. package/lib/components/CaseView/CaseView.js +0 -421
  97. package/lib/components/CaseView/CaseView.js.map +0 -1
  98. package/lib/components/CaseView/CaseView.styles.d.ts +0 -45
  99. package/lib/components/CaseView/CaseView.styles.d.ts.map +0 -1
  100. package/lib/components/CaseView/CaseView.styles.js +0 -559
  101. package/lib/components/CaseView/CaseView.styles.js.map +0 -1
  102. package/lib/components/CaseView/CaseView.test-ids.d.ts +0 -2
  103. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +0 -1
  104. package/lib/components/CaseView/CaseView.test-ids.js +0 -18
  105. package/lib/components/CaseView/CaseView.test-ids.js.map +0 -1
  106. package/lib/components/CaseView/CaseView.types.d.ts +0 -98
  107. package/lib/components/CaseView/CaseView.types.d.ts.map +0 -1
  108. package/lib/components/CaseView/CaseView.types.js +0 -2
  109. package/lib/components/CaseView/CaseView.types.js.map +0 -1
  110. package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -9
  111. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +0 -1
  112. package/lib/components/CaseView/UtilitiesSummary.js +0 -53
  113. package/lib/components/CaseView/UtilitiesSummary.js.map +0 -1
  114. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +0 -9
  115. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +0 -1
  116. package/lib/components/CaseView/UtilitySummaryItemDialog.js +0 -29
  117. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +0 -1
  118. package/lib/components/CaseView/index.d.ts +0 -5
  119. package/lib/components/CaseView/index.d.ts.map +0 -1
  120. package/lib/components/CaseView/index.js +0 -4
  121. package/lib/components/CaseView/index.js.map +0 -1
  122. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +0 -4
  123. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +0 -1
  124. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +0 -86
  125. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +0 -1
  126. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +0 -41
  127. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +0 -1
  128. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +0 -2
  129. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +0 -1
  130. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +0 -6
  131. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +0 -1
  132. package/lib/components/ConfigurableLayout/LayoutCell.js +0 -64
  133. package/lib/components/ConfigurableLayout/LayoutCell.js.map +0 -1
  134. package/lib/components/ConfigurableLayout/defaults.d.ts +0 -4
  135. package/lib/components/ConfigurableLayout/defaults.d.ts.map +0 -1
  136. package/lib/components/ConfigurableLayout/defaults.js +0 -4
  137. package/lib/components/ConfigurableLayout/defaults.js.map +0 -1
  138. package/lib/components/ConfigurableLayout/index.d.ts +0 -4
  139. package/lib/components/ConfigurableLayout/index.d.ts.map +0 -1
  140. package/lib/components/ConfigurableLayout/index.js +0 -3
  141. package/lib/components/ConfigurableLayout/index.js.map +0 -1
  142. package/lib/components/ConfigurableLayout/options.d.ts +0 -10
  143. package/lib/components/ConfigurableLayout/options.d.ts.map +0 -1
  144. package/lib/components/ConfigurableLayout/options.js +0 -10
  145. package/lib/components/ConfigurableLayout/options.js.map +0 -1
  146. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +0 -7
  147. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +0 -1
  148. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +0 -37
  149. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +0 -1
  150. package/lib/components/Confirmation/Confirmation.d.ts +0 -19
  151. package/lib/components/Confirmation/Confirmation.d.ts.map +0 -1
  152. package/lib/components/Confirmation/Confirmation.js +0 -29
  153. package/lib/components/Confirmation/Confirmation.js.map +0 -1
  154. package/lib/components/Confirmation/index.d.ts +0 -3
  155. package/lib/components/Confirmation/index.d.ts.map +0 -1
  156. package/lib/components/Confirmation/index.js +0 -2
  157. package/lib/components/Confirmation/index.js.map +0 -1
  158. package/lib/components/Details/Details.d.ts +0 -38
  159. package/lib/components/Details/Details.d.ts.map +0 -1
  160. package/lib/components/Details/Details.js +0 -92
  161. package/lib/components/Details/Details.js.map +0 -1
  162. package/lib/components/Details/Details.styles.d.ts +0 -50
  163. package/lib/components/Details/Details.styles.d.ts.map +0 -1
  164. package/lib/components/Details/Details.styles.js +0 -204
  165. package/lib/components/Details/Details.styles.js.map +0 -1
  166. package/lib/components/Details/Details.test-ids.d.ts +0 -2
  167. package/lib/components/Details/Details.test-ids.d.ts.map +0 -1
  168. package/lib/components/Details/Details.test-ids.js +0 -9
  169. package/lib/components/Details/Details.test-ids.js.map +0 -1
  170. package/lib/components/Details/DetailsContext.d.ts +0 -9
  171. package/lib/components/Details/DetailsContext.d.ts.map +0 -1
  172. package/lib/components/Details/DetailsContext.js +0 -9
  173. package/lib/components/Details/DetailsContext.js.map +0 -1
  174. package/lib/components/Details/index.d.ts +0 -4
  175. package/lib/components/Details/index.d.ts.map +0 -1
  176. package/lib/components/Details/index.js +0 -4
  177. package/lib/components/Details/index.js.map +0 -1
  178. package/lib/components/Glimpse/Glimpse.d.ts +0 -20
  179. package/lib/components/Glimpse/Glimpse.d.ts.map +0 -1
  180. package/lib/components/Glimpse/Glimpse.js +0 -12
  181. package/lib/components/Glimpse/Glimpse.js.map +0 -1
  182. package/lib/components/Glimpse/index.d.ts +0 -3
  183. package/lib/components/Glimpse/index.d.ts.map +0 -1
  184. package/lib/components/Glimpse/index.js +0 -2
  185. package/lib/components/Glimpse/index.js.map +0 -1
  186. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +0 -6
  187. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +0 -1
  188. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +0 -83
  189. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +0 -1
  190. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +0 -9
  191. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +0 -1
  192. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +0 -199
  193. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +0 -1
  194. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +0 -35
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +0 -1
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +0 -2
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +0 -1
  198. package/lib/components/IntelligentGuidance/index.d.ts +0 -3
  199. package/lib/components/IntelligentGuidance/index.d.ts.map +0 -1
  200. package/lib/components/IntelligentGuidance/index.js +0 -2
  201. package/lib/components/IntelligentGuidance/index.js.map +0 -1
  202. package/lib/components/Predictions/Predictions.d.ts +0 -6
  203. package/lib/components/Predictions/Predictions.d.ts.map +0 -1
  204. package/lib/components/Predictions/Predictions.js +0 -68
  205. package/lib/components/Predictions/Predictions.js.map +0 -1
  206. package/lib/components/Predictions/Predictions.types.d.ts +0 -23
  207. package/lib/components/Predictions/Predictions.types.d.ts.map +0 -1
  208. package/lib/components/Predictions/Predictions.types.js +0 -2
  209. package/lib/components/Predictions/Predictions.types.js.map +0 -1
  210. package/lib/components/Predictions/index.d.ts +0 -3
  211. package/lib/components/Predictions/index.d.ts.map +0 -1
  212. package/lib/components/Predictions/index.js +0 -2
  213. package/lib/components/Predictions/index.js.map +0 -1
  214. package/lib/components/SearchResults/Filter.d.ts +0 -8
  215. package/lib/components/SearchResults/Filter.d.ts.map +0 -1
  216. package/lib/components/SearchResults/Filter.js +0 -45
  217. package/lib/components/SearchResults/Filter.js.map +0 -1
  218. package/lib/components/SearchResults/SearchResult.d.ts +0 -4
  219. package/lib/components/SearchResults/SearchResult.d.ts.map +0 -1
  220. package/lib/components/SearchResults/SearchResult.js +0 -27
  221. package/lib/components/SearchResults/SearchResult.js.map +0 -1
  222. package/lib/components/SearchResults/SearchResults.d.ts +0 -6
  223. package/lib/components/SearchResults/SearchResults.d.ts.map +0 -1
  224. package/lib/components/SearchResults/SearchResults.js +0 -121
  225. package/lib/components/SearchResults/SearchResults.js.map +0 -1
  226. package/lib/components/SearchResults/SearchResults.styles.d.ts +0 -11
  227. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +0 -1
  228. package/lib/components/SearchResults/SearchResults.styles.js +0 -88
  229. package/lib/components/SearchResults/SearchResults.styles.js.map +0 -1
  230. package/lib/components/SearchResults/SearchResults.types.d.ts +0 -100
  231. package/lib/components/SearchResults/SearchResults.types.d.ts.map +0 -1
  232. package/lib/components/SearchResults/SearchResults.types.js +0 -2
  233. package/lib/components/SearchResults/SearchResults.types.js.map +0 -1
  234. package/lib/components/SearchResults/index.d.ts +0 -3
  235. package/lib/components/SearchResults/index.d.ts.map +0 -1
  236. package/lib/components/SearchResults/index.js +0 -2
  237. package/lib/components/SearchResults/index.js.map +0 -1
  238. package/lib/components/Stages/StageGlimpse.d.ts +0 -8
  239. package/lib/components/Stages/StageGlimpse.d.ts.map +0 -1
  240. package/lib/components/Stages/StageGlimpse.js +0 -11
  241. package/lib/components/Stages/StageGlimpse.js.map +0 -1
  242. package/lib/components/Stages/Stages.d.ts +0 -6
  243. package/lib/components/Stages/Stages.d.ts.map +0 -1
  244. package/lib/components/Stages/Stages.js +0 -107
  245. package/lib/components/Stages/Stages.js.map +0 -1
  246. package/lib/components/Stages/Stages.styles.d.ts +0 -14
  247. package/lib/components/Stages/Stages.styles.d.ts.map +0 -1
  248. package/lib/components/Stages/Stages.styles.js +0 -270
  249. package/lib/components/Stages/Stages.styles.js.map +0 -1
  250. package/lib/components/Stages/Stages.types.d.ts +0 -38
  251. package/lib/components/Stages/Stages.types.d.ts.map +0 -1
  252. package/lib/components/Stages/Stages.types.js +0 -2
  253. package/lib/components/Stages/Stages.types.js.map +0 -1
  254. package/lib/components/Stages/index.d.ts +0 -3
  255. package/lib/components/Stages/index.d.ts.map +0 -1
  256. package/lib/components/Stages/index.js +0 -2
  257. package/lib/components/Stages/index.js.map +0 -1
  258. package/lib/components/Stakeholders/StakeholderForm.d.ts +0 -7
  259. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +0 -1
  260. package/lib/components/Stakeholders/StakeholderForm.js +0 -49
  261. package/lib/components/Stakeholders/StakeholderForm.js.map +0 -1
  262. package/lib/components/Stakeholders/Stakeholders.d.ts +0 -6
  263. package/lib/components/Stakeholders/Stakeholders.d.ts.map +0 -1
  264. package/lib/components/Stakeholders/Stakeholders.js +0 -220
  265. package/lib/components/Stakeholders/Stakeholders.js.map +0 -1
  266. package/lib/components/Stakeholders/Stakeholders.types.d.ts +0 -75
  267. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +0 -1
  268. package/lib/components/Stakeholders/Stakeholders.types.js +0 -2
  269. package/lib/components/Stakeholders/Stakeholders.types.js.map +0 -1
  270. package/lib/components/Stakeholders/index.d.ts +0 -3
  271. package/lib/components/Stakeholders/index.d.ts.map +0 -1
  272. package/lib/components/Stakeholders/index.js +0 -2
  273. package/lib/components/Stakeholders/index.js.map +0 -1
  274. package/lib/components/Tags/Tags.d.ts +0 -34
  275. package/lib/components/Tags/Tags.d.ts.map +0 -1
  276. package/lib/components/Tags/Tags.js +0 -230
  277. package/lib/components/Tags/Tags.js.map +0 -1
  278. package/lib/components/Tags/index.d.ts +0 -3
  279. package/lib/components/Tags/index.d.ts.map +0 -1
  280. package/lib/components/Tags/index.js +0 -2
  281. package/lib/components/Tags/index.js.map +0 -1
  282. package/lib/components/Tasks/TaskList.d.ts +0 -39
  283. package/lib/components/Tasks/TaskList.d.ts.map +0 -1
  284. package/lib/components/Tasks/TaskList.js +0 -71
  285. package/lib/components/Tasks/TaskList.js.map +0 -1
  286. package/lib/components/Tasks/Tasks.d.ts +0 -29
  287. package/lib/components/Tasks/Tasks.d.ts.map +0 -1
  288. package/lib/components/Tasks/Tasks.js +0 -52
  289. package/lib/components/Tasks/Tasks.js.map +0 -1
  290. package/lib/components/Tasks/Tasks.test-ids.d.ts +0 -4
  291. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +0 -1
  292. package/lib/components/Tasks/Tasks.test-ids.js +0 -5
  293. package/lib/components/Tasks/Tasks.test-ids.js.map +0 -1
  294. package/lib/components/Tasks/index.d.ts +0 -4
  295. package/lib/components/Tasks/index.d.ts.map +0 -1
  296. package/lib/components/Tasks/index.js +0 -4
  297. package/lib/components/Tasks/index.js.map +0 -1
  298. package/lib/components/Timeline/Timeline.d.ts +0 -6
  299. package/lib/components/Timeline/Timeline.d.ts.map +0 -1
  300. package/lib/components/Timeline/Timeline.js +0 -26
  301. package/lib/components/Timeline/Timeline.js.map +0 -1
  302. package/lib/components/Timeline/Timeline.styles.d.ts +0 -21
  303. package/lib/components/Timeline/Timeline.styles.d.ts.map +0 -1
  304. package/lib/components/Timeline/Timeline.styles.js +0 -165
  305. package/lib/components/Timeline/Timeline.styles.js.map +0 -1
  306. package/lib/components/Timeline/Timeline.types.d.ts +0 -66
  307. package/lib/components/Timeline/Timeline.types.d.ts.map +0 -1
  308. package/lib/components/Timeline/Timeline.types.js +0 -2
  309. package/lib/components/Timeline/Timeline.types.js.map +0 -1
  310. package/lib/components/Timeline/TimelineItem.d.ts +0 -13
  311. package/lib/components/Timeline/TimelineItem.d.ts.map +0 -1
  312. package/lib/components/Timeline/TimelineItem.js +0 -33
  313. package/lib/components/Timeline/TimelineItem.js.map +0 -1
  314. package/lib/components/Timeline/TimelineToolbar.d.ts +0 -6
  315. package/lib/components/Timeline/TimelineToolbar.d.ts.map +0 -1
  316. package/lib/components/Timeline/TimelineToolbar.js +0 -68
  317. package/lib/components/Timeline/TimelineToolbar.js.map +0 -1
  318. package/lib/components/Timeline/index.d.ts +0 -4
  319. package/lib/components/Timeline/index.d.ts.map +0 -1
  320. package/lib/components/Timeline/index.js +0 -3
  321. package/lib/components/Timeline/index.js.map +0 -1
  322. package/lib/components/Timeline/utils.d.ts +0 -15
  323. package/lib/components/Timeline/utils.d.ts.map +0 -1
  324. package/lib/components/Timeline/utils.js +0 -75
  325. package/lib/components/Timeline/utils.js.map +0 -1
  326. package/lib/index.d.ts +0 -37
  327. package/lib/index.d.ts.map +0 -1
  328. package/lib/index.js +0 -38
  329. package/lib/index.js.map +0 -1
@@ -1,49 +0,0 @@
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
@@ -1 +0,0 @@
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,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAA2B,GAAG,EAAE;QACtF,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;SAC5F;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,OAAO,GAAuB,IAAI,CAAC;IAEvC,IAAI,KAAK,EAAE;QACT,MAAM,KAAK,GAAG,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAErC,IAAI,KAAK,CAAC,MAAM,GAAG,C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AAK,IACJ,QAAQ,QACR,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC7B,KAAK,EAAE,WAAW,CAAC,IAAI,EACvB,IAAI,EAAE,WAAW,CAAC,WAAW,GAC7B,CACH,CAAC;KACH;IAED,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,aAC9D,OAAO,EACR,KAAC,QAAQ,OAAK,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,IAC9D,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"]}
@@ -1,6 +0,0 @@
1
- import { 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAkBf,OAAO,KAAK,EAAU,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmBpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CA0UrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,220 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Stakeholders.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EAER,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,WAAW,EACX,OAAO,EAEP,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,eAAe,EACf,aAAa,EACb,QAAQ,EACR,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA,EAAE,CAAC;AAEjD,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOpC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;;CAGpC,CAAC;AAEF,MAAM,YAAY,GAAwD,UAAU,CAClF,SAAS,YAAY,CACnB,EACE,KAAK,EAAE,SAAS,EAChB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,EACL,GAAG,SAAS,EACuB,EACrC,GAA6B;IAE7B,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;IAClD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,YAAY,GAAG,MAAM,EAAgB,CAAC;IAC5C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAiC,CAAC;IAClE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC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C,IAAI,IACtD,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useRef,\n useEffect,\n useMemo,\n useState,\n ReactNode,\n useCallback\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n SummaryList,\n useI18n,\n ModalMethods,\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 { Action, ForwardProps, ModalProps, OmitStrict } 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"]}
@@ -1,75 +0,0 @@
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
@@ -1 +0,0 @@
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,G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,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3B,CAAC;CACH"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Stakeholders.types.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,3 +0,0 @@
1
- export { default } from './Stakeholders';
2
- export type { StakeholdersProps, Role, Stakeholder } from './Stakeholders.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export { default } from './Stakeholders';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,34 +0,0 @@
1
- import { FunctionComponent, Ref } from 'react';
2
- import { 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/components/Tags/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EAEjB,GAAG,EAKJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,SAAS,EACT,YAAY,EA0BZ,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"}