@pega/cosmos-react-work 8.0.0-build.3.2 → 8.0.0-build.30.1

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 (291) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +8 -4
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +6 -4
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/Article/Article.d.ts +2 -6
  6. package/lib/components/Article/Article.d.ts.map +1 -1
  7. package/lib/components/Article/Article.js +2 -7
  8. package/lib/components/Article/Article.js.map +1 -1
  9. package/lib/components/Article/ArticleMeta.js.map +1 -1
  10. package/lib/components/ArticleList/AIArticleSummary.d.ts +1 -2
  11. package/lib/components/ArticleList/AIArticleSummary.d.ts.map +1 -1
  12. package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -1
  13. package/lib/components/ArticleList/ArticleBuddy.js +6 -2
  14. package/lib/components/ArticleList/ArticleBuddy.js.map +1 -1
  15. package/lib/components/ArticleList/ArticleBuddyList.d.ts +0 -1
  16. package/lib/components/ArticleList/ArticleBuddyList.d.ts.map +1 -1
  17. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts +3 -3
  18. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts.map +1 -1
  19. package/lib/components/ArticleList/ArticleBuddyResponse.js +7 -8
  20. package/lib/components/ArticleList/ArticleBuddyResponse.js.map +1 -1
  21. package/lib/components/ArticleList/ArticleFeedback.d.ts +1 -2
  22. package/lib/components/ArticleList/ArticleFeedback.d.ts.map +1 -1
  23. package/lib/components/ArticleList/ArticleFeedback.js.map +1 -1
  24. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -1
  25. package/lib/components/ArticleList/ArticleList.js +1 -1
  26. package/lib/components/ArticleList/ArticleList.js.map +1 -1
  27. package/lib/components/ArticleList/ArticleList.types.d.ts +9 -5
  28. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
  29. package/lib/components/ArticleList/ArticleList.types.js.map +1 -1
  30. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -1
  31. package/lib/components/ArticleList/ArticleListHeader.d.ts +1 -1
  32. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -1
  33. package/lib/components/ArticleList/ArticleListHeader.js +9 -6
  34. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -1
  35. package/lib/components/ArticleList/ArticleSemanticSearch.d.ts +0 -1
  36. package/lib/components/ArticleList/ArticleSemanticSearch.d.ts.map +1 -1
  37. package/lib/components/ArticleList/ArticleSemanticSearch.js +11 -4
  38. package/lib/components/ArticleList/ArticleSemanticSearch.js.map +1 -1
  39. package/lib/components/ArticleList/ArticleSummaryHeader.js +1 -1
  40. package/lib/components/ArticleList/ArticleSummaryHeader.js.map +1 -1
  41. package/lib/components/ArticleList/ArticleTag.d.ts +0 -1
  42. package/lib/components/ArticleList/ArticleTag.d.ts.map +1 -1
  43. package/lib/components/ArticleList/ArticleTag.js +3 -3
  44. package/lib/components/ArticleList/ArticleTag.js.map +1 -1
  45. package/lib/components/ArticleList/QuestionList.d.ts +1 -2
  46. package/lib/components/ArticleList/QuestionList.d.ts.map +1 -1
  47. package/lib/components/ArticleList/QuestionList.js +1 -1
  48. package/lib/components/ArticleList/QuestionList.js.map +1 -1
  49. package/lib/components/ArticleList/RelatedQuestions.d.ts +19 -0
  50. package/lib/components/ArticleList/RelatedQuestions.d.ts.map +1 -0
  51. package/lib/components/ArticleList/RelatedQuestions.js +40 -0
  52. package/lib/components/ArticleList/RelatedQuestions.js.map +1 -0
  53. package/lib/components/Assignments/Assignments.js +2 -2
  54. package/lib/components/Assignments/Assignments.js.map +1 -1
  55. package/lib/components/Assignments/Assignments.styles.d.ts +3 -4
  56. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -1
  57. package/lib/components/CasePreview/CasePreview.d.ts +4 -4
  58. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  59. package/lib/components/CasePreview/CasePreview.js +7 -6
  60. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  61. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +1 -1
  62. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -1
  63. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
  64. package/lib/components/CaseView/CaseHeader/CaseHeader.js +4 -3
  65. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
  66. package/lib/components/CaseView/CaseHeader/Summary.d.ts +1 -1
  67. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -1
  68. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -1
  69. package/lib/components/CaseView/CaseView.context.d.ts +0 -1
  70. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -1
  71. package/lib/components/CaseView/CaseView.d.ts +1 -1
  72. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  73. package/lib/components/CaseView/CaseView.js +15 -15
  74. package/lib/components/CaseView/CaseView.js.map +1 -1
  75. package/lib/components/CaseView/CaseView.styles.d.ts +14 -14
  76. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  77. package/lib/components/CaseView/CaseView.styles.js +224 -100
  78. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  79. package/lib/components/CaseView/CaseView.test-ids.d.ts +1 -1
  80. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -1
  81. package/lib/components/CaseView/CaseView.types.d.ts +8 -2
  82. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  83. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  84. package/lib/components/CaseView/UtilitiesSummary.d.ts +1 -0
  85. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  86. package/lib/components/CaseView/UtilitiesSummary.js +61 -5
  87. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  88. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +0 -1
  89. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -1
  90. package/lib/components/CaseView/UtilitySummaryItemDialog.js +1 -1
  91. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -1
  92. package/lib/components/CaseView/index.d.ts +1 -1
  93. package/lib/components/CaseView/index.d.ts.map +1 -1
  94. package/lib/components/CaseView/index.js.map +1 -1
  95. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +0 -1
  96. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  97. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  98. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +0 -1
  99. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  100. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +1 -2
  101. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -1
  102. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -1
  103. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -1
  104. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -1
  105. package/lib/components/Confirmation/Confirmation.d.ts +3 -3
  106. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  107. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  108. package/lib/components/Details/Details.d.ts +4 -4
  109. package/lib/components/Details/Details.d.ts.map +1 -1
  110. package/lib/components/Details/Details.js +2 -2
  111. package/lib/components/Details/Details.js.map +1 -1
  112. package/lib/components/Details/Details.styles.d.ts +1 -1
  113. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  114. package/lib/components/Details/Details.styles.js +17 -4
  115. package/lib/components/Details/Details.styles.js.map +1 -1
  116. package/lib/components/Details/Details.test-ids.d.ts +1 -1
  117. package/lib/components/Details/Details.test-ids.d.ts.map +1 -1
  118. package/lib/components/Details/DetailsContext.d.ts +0 -1
  119. package/lib/components/Details/DetailsContext.d.ts.map +1 -1
  120. package/lib/components/GenAICoach/GenAICoach.d.ts +1 -1
  121. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  122. package/lib/components/GenAICoach/GenAICoach.js +35 -45
  123. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  124. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +9 -14
  125. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  126. package/lib/components/GenAICoach/GenAICoach.styles.js +18 -44
  127. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  128. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts +1 -1
  129. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts.map +1 -1
  130. package/lib/components/GenAICoach/GenAICoach.test-ids.js +4 -1
  131. package/lib/components/GenAICoach/GenAICoach.test-ids.js.map +1 -1
  132. package/lib/components/GenAICoach/GenAICoach.types.d.ts +14 -6
  133. package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
  134. package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
  135. package/lib/components/GenAICoach/GenAICoach.utils.d.ts +1 -1
  136. package/lib/components/GenAICoach/GenAICoach.utils.d.ts.map +1 -1
  137. package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
  138. package/lib/components/GenAICoach/GenAIMessage.js +77 -13
  139. package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
  140. package/lib/components/GenAICoach/InitialSuggestedMessage.js +1 -1
  141. package/lib/components/GenAICoach/InitialSuggestedMessage.js.map +1 -1
  142. package/lib/components/GenAICoach/index.d.ts +1 -1
  143. package/lib/components/GenAICoach/index.d.ts.map +1 -1
  144. package/lib/components/GenAICoach/index.js.map +1 -1
  145. package/lib/components/Glimpse/Glimpse.d.ts +3 -3
  146. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  147. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  148. package/lib/components/HierarchicalAssignments/AssignmentContext.d.ts +22 -0
  149. package/lib/components/HierarchicalAssignments/AssignmentContext.d.ts.map +1 -0
  150. package/lib/components/HierarchicalAssignments/AssignmentContext.js +12 -0
  151. package/lib/components/HierarchicalAssignments/AssignmentContext.js.map +1 -0
  152. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts +4 -2
  153. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts.map +1 -1
  154. package/lib/components/HierarchicalAssignments/AssignmentDetail.js +2 -2
  155. package/lib/components/HierarchicalAssignments/AssignmentDetail.js.map +1 -1
  156. package/lib/components/HierarchicalAssignments/AssignmentNode.d.ts +15 -0
  157. package/lib/components/HierarchicalAssignments/AssignmentNode.d.ts.map +1 -0
  158. package/lib/components/HierarchicalAssignments/AssignmentNode.js +28 -0
  159. package/lib/components/HierarchicalAssignments/AssignmentNode.js.map +1 -0
  160. package/lib/components/HierarchicalAssignments/AssignmentTree.d.ts +15 -0
  161. package/lib/components/HierarchicalAssignments/AssignmentTree.d.ts.map +1 -0
  162. package/lib/components/HierarchicalAssignments/AssignmentTree.js +15 -0
  163. package/lib/components/HierarchicalAssignments/AssignmentTree.js.map +1 -0
  164. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts +32 -31
  165. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
  166. package/lib/components/HierarchicalAssignments/Assignments.styles.js +93 -69
  167. package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
  168. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts +2 -3
  169. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts.map +1 -1
  170. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js +90 -8
  171. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js.map +1 -1
  172. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts +3 -3
  173. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts.map +1 -1
  174. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.js +2 -1
  175. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.js.map +1 -1
  176. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +12 -12
  177. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
  178. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
  179. package/lib/components/HierarchicalAssignments/helpers.d.ts +20 -0
  180. package/lib/components/HierarchicalAssignments/helpers.d.ts.map +1 -0
  181. package/lib/components/HierarchicalAssignments/helpers.js +164 -0
  182. package/lib/components/HierarchicalAssignments/helpers.js.map +1 -0
  183. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +14 -0
  184. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -0
  185. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +86 -0
  186. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -0
  187. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts +23 -0
  188. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts.map +1 -0
  189. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js +108 -0
  190. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js.map +1 -0
  191. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.d.ts +24 -0
  192. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.d.ts.map +1 -0
  193. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.js +54 -0
  194. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.js.map +1 -0
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +2 -3
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +5 -2
  198. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  199. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +2 -3
  200. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  201. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +32 -21
  202. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  203. package/lib/components/InteractionNotification/CountdownButton.d.ts +3 -3
  204. package/lib/components/InteractionNotification/CountdownButton.d.ts.map +1 -1
  205. package/lib/components/InteractionNotification/CountdownButton.js +1 -1
  206. package/lib/components/InteractionNotification/CountdownButton.js.map +1 -1
  207. package/lib/components/InteractionNotification/InteractionNotification.d.ts +3 -3
  208. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
  209. package/lib/components/InteractionNotification/InteractionNotification.js +1 -1
  210. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
  211. package/lib/components/Predictions/Predictions.d.ts +2 -3
  212. package/lib/components/Predictions/Predictions.d.ts.map +1 -1
  213. package/lib/components/Predictions/Predictions.js +1 -0
  214. package/lib/components/Predictions/Predictions.js.map +1 -1
  215. package/lib/components/SearchResults/ActiveFilter.d.ts +1 -2
  216. package/lib/components/SearchResults/ActiveFilter.d.ts.map +1 -1
  217. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  218. package/lib/components/SearchResults/Filter.js.map +1 -1
  219. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  220. package/lib/components/SearchResults/SearchResults.d.ts +2 -3
  221. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  222. package/lib/components/SearchResults/SearchResults.js +1 -2
  223. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  224. package/lib/components/SearchResults/SearchResults.styles.d.ts +1 -2
  225. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  226. package/lib/components/Stages/StageGlimpse.js +1 -1
  227. package/lib/components/Stages/StageGlimpse.js.map +1 -1
  228. package/lib/components/Stages/Stages.d.ts +2 -3
  229. package/lib/components/Stages/Stages.d.ts.map +1 -1
  230. package/lib/components/Stages/Stages.js +4 -1
  231. package/lib/components/Stages/Stages.js.map +1 -1
  232. package/lib/components/Stages/Stages.styles.d.ts +7 -6
  233. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  234. package/lib/components/Stages/Stages.styles.js +7 -5
  235. package/lib/components/Stages/Stages.styles.js.map +1 -1
  236. package/lib/components/Stakeholders/StakeholderForm.d.ts +1 -2
  237. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -1
  238. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -1
  239. package/lib/components/Stakeholders/Stakeholders.d.ts +2 -3
  240. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  241. package/lib/components/Stakeholders/Stakeholders.js +37 -26
  242. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  243. package/lib/components/Tags/Tags.d.ts +5 -5
  244. package/lib/components/Tags/Tags.d.ts.map +1 -1
  245. package/lib/components/Tags/Tags.js.map +1 -1
  246. package/lib/components/Tasks/TaskList.d.ts +13 -8
  247. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  248. package/lib/components/Tasks/TaskList.js +15 -7
  249. package/lib/components/Tasks/TaskList.js.map +1 -1
  250. package/lib/components/Tasks/Tasks.d.ts +8 -3
  251. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  252. package/lib/components/Tasks/Tasks.js +14 -4
  253. package/lib/components/Tasks/Tasks.js.map +1 -1
  254. package/lib/components/Tasks/Tasks.test-ids.d.ts +3 -3
  255. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -1
  256. package/lib/components/Timeline/Timeline.d.ts +3 -3
  257. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  258. package/lib/components/Timeline/Timeline.js +9 -2
  259. package/lib/components/Timeline/Timeline.js.map +1 -1
  260. package/lib/components/Timeline/Timeline.styles.d.ts +5 -6
  261. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  262. package/lib/components/Timeline/Timeline.styles.js +8 -3
  263. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  264. package/lib/components/Timeline/Timeline.types.d.ts +11 -1
  265. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  266. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  267. package/lib/components/Timeline/TimelineItem.d.ts +1 -2
  268. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  269. package/lib/components/Timeline/TimelineItem.js +10 -9
  270. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  271. package/lib/components/Timeline/TimelineToolbar.d.ts +2 -3
  272. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -1
  273. package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
  274. package/lib/components/Timeline/utils.js.map +1 -1
  275. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts +5 -0
  276. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts.map +1 -1
  277. package/lib/components/UtilitiesLayout/UtilitiesLayout.js +3 -3
  278. package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -1
  279. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts +2 -4
  280. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -1
  281. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js +2 -5
  282. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js.map +1 -1
  283. package/package.json +10 -9
  284. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts +0 -33
  285. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts.map +0 -1
  286. package/lib/components/HierarchicalAssignments/AssignmentContainer.js +0 -46
  287. package/lib/components/HierarchicalAssignments/AssignmentContainer.js.map +0 -1
  288. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts +0 -11
  289. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts.map +0 -1
  290. package/lib/components/HierarchicalAssignments/AssignmentItem.js +0 -22
  291. package/lib/components/HierarchicalAssignments/AssignmentItem.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,KAAK,EACL,aAAa,EACb,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAG1F,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,MAAM,GAAkD,UAAU,CAAC,SAAS,MAAM,CACtF,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,SAAS,EAAgC,EACvF,GAAuB;IAEvB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAsB,EAAE,CAAC,CAAC;IAEnD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA2B,IAAI,CAAC,CAAC;IAErE,MAAM,EAAE,MAAM,EAAE,WAA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ACT,OAAO,EAAE,KAAK,CAAC,IAAI,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAC9C,SAAS,EAAE,GAAG,EAAE;oCACd,SAAS,CAAC,IAAI,CAAC,CAAC;gCAClB,CAAC,EACD,SAAS,EAAC,cAAc,YAEvB,CAAC,SAAS,IAAI,CACb,MAAC,kBAAkB,eACjB,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,EAC9B,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,SAAS,YAC3C,CAAC,CAAC,2BAA2B,CAAC,GACxB,IACU,CACtB,GACU,CACd,KArDY,KAAK,CAAC,EAAE,CAsDZ,CACZ,CAAC;gBACJ,CAAC,CAAC,GACG,EACP,KAAC,uBAAuB,IAAC,EAAE,EAAE,aAAa,YACvC,CAAC,CAAC,oBAAoB,CAAC,GACA,IACzB,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useState, useRef, useEffect, forwardRef, Fragment } from 'react';\nimport type { FunctionComponent, MouseEvent, PropsWithoutRef } from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Icon,\n registerIcon,\n Flex,\n useI18n,\n Button,\n Modal,\n useBreakpoint,\n debounce,\n useModalManager,\n useConsolidatedRef,\n useUID,\n InfoDialog,\n useArrows,\n useAfterInitialEffect,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, ModalMethods } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport type { StagesProps } from './Stages.types';\nimport StageGlimpse from './StageGlimpse';\nimport {\n StyledInnerStage,\n StyledStageCompleteIcon,\n StyledStage,\n StyledStageContainer,\n StyledStageGlimpse,\n StyledStages,\n StyledStagesDescription,\n StyledStageText\n} from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nconst Stages: FunctionComponent<StagesProps & ForwardProps> = forwardRef(function Stages(\n { current, stages, caseTitle, onLoadStage, ...restProps }: PropsWithoutRef<StagesProps>,\n ref: StagesProps['ref']\n) {\n const t = useI18n();\n\n const stagesRef = useConsolidatedRef(ref);\n const stagesRefs = useRef<HTMLButtonElement[]>([]);\n\n const [target, setTarget] = useState<HTMLButtonElement | null>(null);\n\n const { create: createModal } = useModalManager();\n const modalMethods = useRef<ModalMethods>();\n const [showModal, setShowModal] = useState(false);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const [compressedView, setCompressedView] = useState(false);\n const [minExpandedWidth, setMinExpandedWidth] = useState(0);\n\n useArrows(stagesRef, {\n selector: ':scope > li > button:not([aria-expanded])',\n dir: 'left-right',\n initialFocusElement: stagesRefs.current.find(stage => stage.ariaCurrent)\n });\n\n const dialogId = useUID();\n const descriptionId = useUID();\n\n useEffect(() => {\n if (stagesRef.current) {\n if (compressedView) {\n const resizeObserver = new ResizeObserver(\n debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minExpandedWidth) {\n setCompressedView(false);\n }\n }, 100)\n );\n resizeObserver.observe(stagesRef.current);\n return () => resizeObserver.disconnect();\n }\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (!entries[0].isIntersecting) {\n setCompressedView(true);\n if (entries[0].rootBounds) setMinExpandedWidth(entries[0].rootBounds.width);\n }\n },\n {\n root: stagesRef.current,\n rootMargin: remToPx(0.0625),\n threshold: 1\n }\n );\n\n if (stagesRef.current.lastElementChild) {\n intersectionObserver.observe(stagesRef.current.lastElementChild);\n return () => intersectionObserver.disconnect();\n }\n }\n }, [minExpandedWidth, compressedView, stages.length]);\n\n const stagesToLoad = onLoadStage\n ? stages.filter(stage => !Array.isArray(stage.steps)).map(stage => stage.id)\n : [];\n\n const openModal = () => {\n setShowModal(true);\n if (stagesToLoad.length > 0) onLoadStage?.(stagesToLoad);\n modalMethods.current = createModal(Modal, {\n heading: caseTitle\n ? t('stages_case_lifecycle', [caseTitle])\n : t('stages_default_case_lifecycle'),\n progress: stagesToLoad.length > 0,\n children: stages.map(stage => (\n <Fragment key={stage.id}>\n <Flex container={{ alignItems: 'start', gap: 0.5 }}>\n {stage.completed && <StyledStageCompleteIcon name='check' />}\n <StyledStageText variant='h2' isCurrent={stage.id === current}>\n {stage.name}\n {stage.completed && <VisuallyHiddenText>{`- ${t('completed')}`}</VisuallyHiddenText>}\n </StyledStageText>\n </Flex>\n <StageGlimpse stage={stage} />\n </Fragment>\n )),\n onBeforeClose: () => {\n setShowModal(false);\n target?.focus();\n setTarget(null);\n modalMethods.current = undefined;\n }\n });\n };\n\n useAfterInitialEffect(() => {\n modalMethods.current?.update({\n progress: stagesToLoad.length > 0,\n children: stages.map(stage => (\n <Fragment key={stage.id}>\n <Flex container={{ alignItems: 'start', gap: 0.5 }}>\n {stage.completed && <StyledStageCompleteIcon name='check' />}\n <StyledStageText variant='h2' isCurrent={stage.id === current}>\n {stage.name}\n {stage.completed && <VisuallyHiddenText>{`- ${t('completed')}`}</VisuallyHiddenText>}\n </StyledStageText>\n </Flex>\n <StageGlimpse stage={stage} />\n </Fragment>\n ))\n });\n }, [stagesToLoad.length]);\n\n return (\n <>\n <Flex\n {...restProps}\n container\n as={StyledStages}\n ref={stagesRef}\n aria-label={t('stages_label')}\n aria-describedby={descriptionId}\n >\n {stages.map((stage, index) => {\n const isCurrent = stage.id === current;\n let stageStatusText = t(stage.completed ? 'completed' : 'not_started');\n if (isCurrent) stageStatusText = t('current');\n const hasToLoad = stagesToLoad.includes(stage.id);\n return (\n <Fragment key={stage.id}>\n <Flex as={StyledStageContainer} item={{ grow: 1, shrink: 0 }}>\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledStage}\n item={{\n grow: compressedView && !isCurrent ? 0 : 1,\n shrink: compressedView && isCurrent ? 1 : 0\n }}\n aria-current={isCurrent ? 'step' : undefined}\n aria-label={t('stages_stage_label', [stage.name, stageStatusText])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n if (isSmallOrAbove) {\n if (hasToLoad) onLoadStage?.([stage.id]);\n setTarget(e.currentTarget);\n } else {\n openModal();\n }\n }}\n ref={(el: HTMLButtonElement) => {\n stagesRefs.current[index] = el;\n }}\n aria-expanded={target && isSmallOrAbove}\n aria-controls={target ? dialogId : undefined}\n aria-haspopup\n >\n {stage.completed && <Icon name='check' />}\n {(!compressedView || isCurrent || !stage.completed) && (\n <StyledInnerStage ellipsis={isCurrent && compressedView}>\n {!isCurrent && compressedView ? index + 1 : stage.name}\n </StyledInnerStage>\n )}\n </Flex>\n </Flex>\n {target && stagesRefs.current[index] === target && isSmallOrAbove && !showModal && (\n <InfoDialog\n heading={stage.name}\n target={target}\n progress={hasToLoad ? t('loading') : undefined}\n onDismiss={() => {\n setTarget(null);\n }}\n placement='bottom-start'\n >\n {!hasToLoad && (\n <StyledStageGlimpse>\n <StageGlimpse stage={stage} />\n <Button variant='secondary' onClick={openModal}>\n {t('stages_see_full_lifecycle')}\n </Button>\n </StyledStageGlimpse>\n )}\n </InfoDialog>\n )}\n </Fragment>\n );\n })}\n </Flex>\n <StyledStagesDescription id={descriptionId}>\n {t('stages_description')}\n </StyledStagesDescription>\n </>\n );\n});\n\nexport default Stages;\n"]}
1
+ {"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,KAAK,EACL,aAAa,EACb,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,kBAAkB,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SAAS,IAAI,CACb,MAAC,kBAAkB,eACjB,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,EAC9B,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,SAAS,YAC3C,CAAC,CAAC,2BAA2B,CAAC,GACxB,IACU,CACtB,GACU,CACd,KAtDY,KAAK,CAAC,EAAE,CAuDZ,CACZ,CAAC;gBACJ,CAAC,CAAC,GACG,EACP,KAAC,uBAAuB,IAAC,EAAE,EAAE,aAAa,YACvC,CAAC,CAAC,oBAAoB,CAAC,GACA,IACzB,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useState, useRef, useEffect, forwardRef, Fragment } from 'react';\nimport type { MouseEvent, PropsWithoutRef } from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Icon,\n registerIcon,\n Flex,\n useI18n,\n Button,\n Modal,\n useBreakpoint,\n debounce,\n useModalManager,\n useConsolidatedRef,\n useUID,\n InfoDialog,\n useArrows,\n useAfterInitialEffect,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, ModalMethods } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport type { StagesProps } from './Stages.types';\nimport StageGlimpse from './StageGlimpse';\nimport {\n StyledInnerStage,\n StyledStageCompleteIcon,\n StyledStage,\n StyledStageContainer,\n StyledStageGlimpse,\n StyledStages,\n StyledStagesDescription,\n StyledStageText\n} from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nconst Stages: ForwardRefForwardPropsComponent<StagesProps> = forwardRef(function Stages(\n { current, stages, caseTitle, onLoadStage, ...restProps }: PropsWithoutRef<StagesProps>,\n ref: StagesProps['ref']\n) {\n const t = useI18n();\n\n const stagesRef = useConsolidatedRef(ref);\n const stagesRefs = useRef<HTMLButtonElement[]>([]);\n\n const [target, setTarget] = useState<HTMLButtonElement | null>(null);\n\n const { create: createModal } = useModalManager();\n const modalMethods = useRef<ModalMethods>();\n const [showModal, setShowModal] = useState(false);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const [compressedView, setCompressedView] = useState(false);\n const [minExpandedWidth, setMinExpandedWidth] = useState(0);\n\n useArrows(stagesRef, {\n selector: ':scope > li > button:not([aria-expanded])',\n dir: 'left-right',\n initialFocusElement: stagesRefs.current.find(stage => stage.ariaCurrent)\n });\n\n const dialogId = useUID();\n const descriptionId = useUID();\n\n useEffect(() => {\n if (stagesRef.current) {\n if (compressedView) {\n const resizeObserver = new ResizeObserver(\n debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minExpandedWidth) {\n setCompressedView(false);\n }\n }, 100)\n );\n resizeObserver.observe(stagesRef.current);\n return () => resizeObserver.disconnect();\n }\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (!entries[0].isIntersecting) {\n setCompressedView(true);\n if (entries[0].rootBounds) setMinExpandedWidth(entries[0].rootBounds.width);\n }\n },\n {\n root: stagesRef.current,\n rootMargin: remToPx(0.0625),\n threshold: 1\n }\n );\n\n if (stagesRef.current.lastElementChild) {\n intersectionObserver.observe(stagesRef.current.lastElementChild);\n return () => intersectionObserver.disconnect();\n }\n }\n }, [minExpandedWidth, compressedView, stages.length]);\n\n const stagesToLoad = onLoadStage\n ? stages.filter(stage => !Array.isArray(stage.steps)).map(stage => stage.id)\n : [];\n\n const openModal = () => {\n setShowModal(true);\n if (stagesToLoad.length > 0) onLoadStage?.(stagesToLoad);\n modalMethods.current = createModal(Modal, {\n heading: caseTitle\n ? t('stages_case_lifecycle', [caseTitle])\n : t('stages_default_case_lifecycle'),\n progress: stagesToLoad.length > 0,\n children: stages.map(stage => (\n <Fragment key={stage.id}>\n <Flex container={{ alignItems: 'start', gap: 0.5 }}>\n {stage.completed && <StyledStageCompleteIcon name='check' />}\n <StyledStageText variant='h2' isCurrent={stage.id === current}>\n {stage.name}\n {stage.completed && <VisuallyHiddenText>{`- ${t('completed')}`}</VisuallyHiddenText>}\n </StyledStageText>\n </Flex>\n <StageGlimpse stage={stage} />\n </Fragment>\n )),\n onBeforeClose: () => {\n setShowModal(false);\n target?.focus();\n setTarget(null);\n modalMethods.current = undefined;\n }\n });\n };\n\n useAfterInitialEffect(() => {\n modalMethods.current?.update({\n progress: stagesToLoad.length > 0,\n children: stages.map(stage => (\n <Fragment key={stage.id}>\n <Flex container={{ alignItems: 'start', gap: 0.5 }}>\n {stage.completed && <StyledStageCompleteIcon name='check' />}\n <StyledStageText variant='h2' isCurrent={stage.id === current}>\n {stage.name}\n {stage.completed && <VisuallyHiddenText>{`- ${t('completed')}`}</VisuallyHiddenText>}\n </StyledStageText>\n </Flex>\n <StageGlimpse stage={stage} />\n </Fragment>\n ))\n });\n }, [stagesToLoad.length]);\n\n return (\n <>\n <Flex\n {...restProps}\n container\n as={StyledStages}\n ref={stagesRef}\n aria-label={t('stages_label')}\n aria-describedby={descriptionId}\n >\n {stages.map((stage, index) => {\n const isCurrent = stage.id === current;\n let stageStatusText = t(stage.completed ? 'completed' : 'not_started');\n if (isCurrent) stageStatusText = t('current');\n\n const hasToLoad = stagesToLoad.includes(stage.id);\n\n let stageStatus = stage.completed ? 'completed' : 'pending';\n if (isCurrent) stageStatus = 'current';\n\n return (\n <Fragment key={stage.id}>\n <Flex as={StyledStageContainer} item={{ grow: 1, shrink: 0 }}>\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledStage}\n item={{\n grow: compressedView && !isCurrent ? 0 : 1,\n shrink: compressedView && isCurrent ? 1 : 0\n }}\n status={stageStatus}\n aria-current={isCurrent ? 'step' : undefined}\n aria-label={t('stages_stage_label', [stage.name, stageStatusText])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n if (isSmallOrAbove) {\n if (hasToLoad) onLoadStage?.([stage.id]);\n setTarget(e.currentTarget);\n } else {\n openModal();\n }\n }}\n ref={(el: HTMLButtonElement) => {\n stagesRefs.current[index] = el;\n }}\n aria-expanded={target && isSmallOrAbove}\n aria-controls={target ? dialogId : undefined}\n aria-haspopup\n >\n {stage.completed && <Icon name='check' />}\n {(!compressedView || isCurrent || !stage.completed) && (\n <StyledInnerStage ellipsis={isCurrent && compressedView}>\n {!isCurrent && compressedView ? index + 1 : stage.name}\n </StyledInnerStage>\n )}\n </Flex>\n </Flex>\n {target && stagesRefs.current[index] === target && isSmallOrAbove && !showModal && (\n <InfoDialog\n heading={stage.name}\n target={target}\n progress={hasToLoad ? t('loading') : undefined}\n onDismiss={() => {\n setTarget(null);\n }}\n placement='bottom-start'\n >\n {!hasToLoad && (\n <StyledStageGlimpse>\n <StageGlimpse stage={stage} />\n <Button variant='secondary' onClick={openModal}>\n {t('stages_see_full_lifecycle')}\n </Button>\n </StyledStageGlimpse>\n )}\n </InfoDialog>\n )}\n </Fragment>\n );\n })}\n </Flex>\n <StyledStagesDescription id={descriptionId}>\n {t('stages_description')}\n </StyledStagesDescription>\n </>\n );\n});\n\nexport default Stages;\n"]}
@@ -1,19 +1,20 @@
1
- /// <reference types="react" />
2
1
  export declare const StyledStages: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
3
2
  export declare const StyledInnerStage: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
4
- ellipsis?: boolean | undefined;
3
+ ellipsis?: boolean;
4
+ }, never>;
5
+ export declare const StyledStage: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
6
+ status: "completed" | "current" | "pending";
5
7
  }, never>;
6
- export declare const StyledStage: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
7
8
  export declare const StyledStageCompleteIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {}, never>;
8
- export declare const StyledStageText: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
9
- isCurrent?: boolean | undefined;
9
+ export declare const StyledStageText: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, import("styled-components").DefaultTheme, {
10
+ isCurrent?: boolean;
10
11
  }, never>;
11
12
  export declare const StyledStageContainer: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
12
13
  export declare const StyledStepsContainer: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
13
14
  export declare const StyledStep: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {
14
15
  completed: boolean;
15
16
  }, never>;
16
- export declare const StyledDateTimeDisplay: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").DateTimeDisplayProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
17
+ export declare const StyledDateTimeDisplay: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").DateTimeDisplayProps>, import("styled-components").DefaultTheme, {}, never>;
17
18
  export declare const StyledStageGlimpse: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
18
19
  export declare const StyledStagesDescription: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
19
20
  //# sourceMappingURL=Stages.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":";AAcA,eAAO,MAAM,YAAY,wGAYvB,CAAC;AAIH,eAAO,MAAM,gBAAgB;;SAW3B,CAAC;AAEH,eAAO,MAAM,WAAW,4GAgJvB,CAAC;AAIF,eAAO,MAAM,uBAAuB,0LAQlC,CAAC;AAEH,eAAO,MAAM,eAAe;;SAI3B,CAAC;AAMF,eAAO,MAAM,oBAAoB,wGAuDhC,CAAC;AAIF,eAAO,MAAM,oBAAoB,wGAS/B,CAAC;AAIH,eAAO,MAAM,UAAU;eAA0B,OAAO;SAyBtD,CAAC;AAIH,eAAO,MAAM,qBAAqB,8OAMhC,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAI7B,CAAC;AAIH,eAAO,MAAM,uBAAuB,uGAEnC,CAAC"}
1
+ {"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,wGAYvB,CAAC;AAIH,eAAO,MAAM,gBAAgB;eAA4B,OAAO;SAW9D,CAAC;AAEH,eAAO,MAAM,WAAW;YAA2B,WAAW,GAAG,SAAS,GAAG,SAAS;SAyJrF,CAAC;AAIF,eAAO,MAAM,uBAAuB,0LAQlC,CAAC;AAEH,eAAO,MAAM,eAAe;gBAA8B,OAAO;SAIhE,CAAC;AAMF,eAAO,MAAM,oBAAoB,wGAuDhC,CAAC;AAIF,eAAO,MAAM,oBAAoB,wGAS/B,CAAC;AAIH,eAAO,MAAM,UAAU;eAA0B,OAAO;SAyBtD,CAAC;AAIH,eAAO,MAAM,qBAAqB,6NAMhC,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAI7B,CAAC;AAIH,eAAO,MAAM,uBAAuB,uGAEnC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { rgba } from 'polished';
3
- import { calculateFontSize, DateTimeDisplay, defaultThemeProp, Icon, Text, StyledIcon, tryCatch, useDirection } from '@pega/cosmos-react-core';
3
+ import { calculateFontSize, DateTimeDisplay, defaultThemeProp, Icon, Text, StyledIcon, tryCatch, useDirection, calculateForegroundColor } from '@pega/cosmos-react-core';
4
4
  export const StyledStages = styled.ol(({ theme }) => {
5
5
  return css `
6
6
  background-color: ${theme.base.palette['primary-background']};
@@ -27,14 +27,15 @@ export const StyledInnerStage = styled.span(props => {
27
27
  `}
28
28
  `;
29
29
  });
30
- export const StyledStage = styled.button(({ theme: { base: { spacing, palette, 'hit-area': hitArea, transparency, 'font-weight': fontWeight } } }) => {
30
+ export const StyledStage = styled.button(({ theme: { base: { spacing, palette, 'hit-area': hitArea, transparency, 'font-weight': fontWeight }, components: { 'case-view': { stages } } }, status }) => {
31
31
  const thinBorderWidth = '0.0625rem';
32
32
  const thickBorderWidth = '0.125rem';
33
33
  const { rtl } = useDirection();
34
- const borderShadow = tryCatch(() => rgba(palette['border-line'], 1));
34
+ const borderShadow = tryCatch(() => rgba(stages.status[status].background, 0.5));
35
+ const stageForeground = calculateForegroundColor(stages.status[status].background, stages.status[status]['foreground-color']);
35
36
  return css `
36
- background-color: inherit;
37
- color: ${palette['foreground-color']};
37
+ background: ${stages.status[status].background};
38
+ color: ${stageForeground};
38
39
  outline: none;
39
40
  border-color: transparent;
40
41
  border-width: ${thinBorderWidth} 0;
@@ -78,6 +79,7 @@ export const StyledStage = styled.button(({ theme: { base: { spacing, palette, '
78
79
  ::after {
79
80
  inset-inline-end: calc(-1.125 * ${spacing});
80
81
  z-index: 1;
82
+ background-color: ${stages.status[status].background};
81
83
 
82
84
  @media (pointer: coarse) {
83
85
  inset-inline-end: calc(-1.375 * ${spacing});
@@ -1 +1 @@
1
- {"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CA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GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,CAAC,CAAA;;CAE9C,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport {\n calculateFontSize,\n DateTimeDisplay,\n defaultThemeProp,\n Icon,\n Text,\n StyledIcon,\n tryCatch,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.ol(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n border-radius: ${theme.components.card['border-radius']};\n width: 100%;\n overflow: hidden;\n list-style: none;\n\n &:has(:focus-visible) {\n box-shadow: ${theme.base.shadow['focus-group']};\n }\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button(\n ({\n theme: {\n base: { spacing, palette, 'hit-area': hitArea, transparency, 'font-weight': fontWeight }\n }\n }) => {\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const { rtl } = useDirection();\n const borderShadow = tryCatch(() => rgba(palette['border-line'], 1));\n\n return css`\n background-color: inherit;\n color: ${palette['foreground-color']};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n width: 100%;\n\n ::before,\n ::after {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n border-style: solid;\n border-color: ${palette['border-line']};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n ::before {\n inset-inline-start: calc(-1.125 * ${spacing});\n\n @media (pointer: coarse) {\n inset-inline-start: calc(-1.375 * ${spacing});\n }\n }\n\n ::after {\n inset-inline-end: calc(-1.125 * ${spacing});\n z-index: 1;\n\n @media (pointer: coarse) {\n inset-inline-end: calc(-1.375 * ${spacing});\n }\n }\n\n &:hover,\n &:hover::before,\n &:hover::after {\n border-color: ${palette['border-line']};\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus::after,\n &:active::after {\n border-color: ${palette.interactive};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus::after {\n z-index: 1;\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${rtl ? 0 : thickBorderWidth};\n border-bottom-width: ${rtl ? thickBorderWidth : 0};\n }\n\n &:focus::before {\n pointer-events: none;\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active::after {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n }\n\n &[aria-current] {\n ${StyledInnerStage} {\n font-weight: ${fontWeight.bold};\n opacity: 1;\n }\n\n :hover {\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-2']};\n }\n }\n\n ::after {\n filter: drop-shadow(0.0625rem -0.0625rem 0.125rem ${borderShadow});\n }\n }\n\n @media (pointer: coarse) {\n height: ${hitArea['finger-min']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n color: ${palette.success};\n\n & ~ ${StyledInnerStage} {\n margin-inline-start: 0.25rem;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-2']};\n }\n `;\n }\n);\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStageCompleteIcon = styled(Icon)(({\n theme: {\n base: { palette }\n }\n}) => {\n return css`\n color: ${palette.success};\n `;\n});\n\nexport const StyledStageText = styled(Text)<{ isCurrent?: boolean }>(\n ({ theme, isCurrent }) => css`\n font-weight: ${isCurrent ? theme.base['font-weight'].bold : theme.base['font-weight'].normal};\n `\n);\n\nStyledStageText.defaultProps = defaultThemeProp;\n\nStyledStageCompleteIcon.defaultProps = defaultThemeProp;\n\nexport const StyledStageContainer = styled.li(\n ({\n theme: {\n base: { spacing },\n components: {\n card: { 'border-radius': borderRadius }\n }\n }\n }) => {\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n\n return css`\n &:first-of-type > ${StyledStage} {\n border-start-start-radius: ${borderRadius};\n border-end-start-radius: ${borderRadius};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: ${spacing};\n\n &:active {\n padding-inline-start: ${spacing};\n }\n\n &:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n\n ::before {\n display: none;\n }\n }\n\n &:last-of-type > ${StyledStage} {\n border-start-end-radius: ${borderRadius};\n border-end-end-radius: ${borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: ${spacing};\n\n &:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: ${spacing};\n }\n\n &:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n\n ::after {\n display: none;\n }\n }\n `;\n }\n);\n\nStyledStageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin: calc(2 * ${theme.base.spacing}) 0 calc(3 * ${theme.base.spacing});\n\n &:empty {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ completed: boolean }>(({ completed, theme }) => {\n const textOpacity = completed ? theme.base.transparency['transparent-2'] : 1;\n\n return css`\n border-radius: 0;\n margin-block-end: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-block-end: 0;\n }\n\n & > ${StyledIcon} {\n text-align: center;\n\n ${completed &&\n css`\n color: ${theme.base.palette.success};\n `}\n }\n\n div {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled(DateTimeDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledStageGlimpse = styled.div(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].sm};\n `;\n});\n\nStyledStageGlimpse.defaultProps = defaultThemeProp;\n\nexport const StyledStagesDescription = styled.p`\n display: none;\n`;\n"]}
1
+ {"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC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C;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,OAAO,GAAG,CAAA;iBACK,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;GAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,CAAC,CAAA;;CAE9C,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport {\n calculateFontSize,\n DateTimeDisplay,\n defaultThemeProp,\n Icon,\n Text,\n StyledIcon,\n tryCatch,\n useDirection,\n calculateForegroundColor\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.ol(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n border-radius: ${theme.components.card['border-radius']};\n width: 100%;\n overflow: hidden;\n list-style: none;\n\n &:has(:focus-visible) {\n box-shadow: ${theme.base.shadow['focus-group']};\n }\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button<{ status: 'completed' | 'current' | 'pending' }>(\n ({\n theme: {\n base: { spacing, palette, 'hit-area': hitArea, transparency, 'font-weight': fontWeight },\n components: {\n 'case-view': { stages }\n }\n },\n status\n }) => {\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const { rtl } = useDirection();\n const borderShadow = tryCatch(() => rgba(stages.status[status].background, 0.5));\n const stageForeground = calculateForegroundColor(\n stages.status[status].background,\n stages.status[status]['foreground-color']\n );\n\n return css`\n background: ${stages.status[status].background};\n color: ${stageForeground};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n width: 100%;\n\n ::before,\n ::after {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n border-style: solid;\n border-color: ${palette['border-line']};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n ::before {\n inset-inline-start: calc(-1.125 * ${spacing});\n\n @media (pointer: coarse) {\n inset-inline-start: calc(-1.375 * ${spacing});\n }\n }\n\n ::after {\n inset-inline-end: calc(-1.125 * ${spacing});\n z-index: 1;\n background-color: ${stages.status[status].background};\n\n @media (pointer: coarse) {\n inset-inline-end: calc(-1.375 * ${spacing});\n }\n }\n\n &:hover,\n &:hover::before,\n &:hover::after {\n border-color: ${palette['border-line']};\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus::after,\n &:active::after {\n border-color: ${palette.interactive};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus::after {\n z-index: 1;\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${rtl ? 0 : thickBorderWidth};\n border-bottom-width: ${rtl ? thickBorderWidth : 0};\n }\n\n &:focus::before {\n pointer-events: none;\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active::after {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n }\n\n &[aria-current] {\n ${StyledInnerStage} {\n font-weight: ${fontWeight.bold};\n opacity: 1;\n }\n\n :hover {\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-2']};\n }\n }\n\n ::after {\n filter: drop-shadow(0.0625rem -0.0625rem 0.125rem ${borderShadow});\n }\n }\n\n @media (pointer: coarse) {\n height: ${hitArea['finger-min']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n color: ${palette.success};\n\n & ~ ${StyledInnerStage} {\n margin-inline-start: 0.25rem;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-2']};\n }\n `;\n }\n);\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStageCompleteIcon = styled(Icon)(({\n theme: {\n base: { palette }\n }\n}) => {\n return css`\n color: ${palette.success};\n `;\n});\n\nexport const StyledStageText = styled(Text)<{ isCurrent?: boolean }>(\n ({ theme, isCurrent }) => css`\n font-weight: ${isCurrent ? theme.base['font-weight'].bold : theme.base['font-weight'].normal};\n `\n);\n\nStyledStageText.defaultProps = defaultThemeProp;\n\nStyledStageCompleteIcon.defaultProps = defaultThemeProp;\n\nexport const StyledStageContainer = styled.li(\n ({\n theme: {\n base: { spacing },\n components: {\n card: { 'border-radius': borderRadius }\n }\n }\n }) => {\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n\n return css`\n &:first-of-type > ${StyledStage} {\n border-start-start-radius: ${borderRadius};\n border-end-start-radius: ${borderRadius};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: ${spacing};\n\n &:active {\n padding-inline-start: ${spacing};\n }\n\n &:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n\n ::before {\n display: none;\n }\n }\n\n &:last-of-type > ${StyledStage} {\n border-start-end-radius: ${borderRadius};\n border-end-end-radius: ${borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: ${spacing};\n\n &:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: ${spacing};\n }\n\n &:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n\n ::after {\n display: none;\n }\n }\n `;\n }\n);\n\nStyledStageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin: calc(2 * ${theme.base.spacing}) 0 calc(3 * ${theme.base.spacing});\n\n &:empty {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ completed: boolean }>(({ completed, theme }) => {\n const textOpacity = completed ? theme.base.transparency['transparent-2'] : 1;\n\n return css`\n border-radius: 0;\n margin-block-end: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-block-end: 0;\n }\n\n & > ${StyledIcon} {\n text-align: center;\n\n ${completed &&\n css`\n color: ${theme.base.palette.success};\n `}\n }\n\n div {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled(DateTimeDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledStageGlimpse = styled.div(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].sm};\n `;\n});\n\nStyledStageGlimpse.defaultProps = defaultThemeProp;\n\nexport const StyledStagesDescription = styled.p`\n display: none;\n`;\n"]}
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import type { StakeholdersProps } from './Stakeholders.types';
3
2
  interface FormProps extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer' | 'rendererProps'> {
4
3
  setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;
5
4
  }
6
- declare const _default: ({ roles, currentRole, renderer: Renderer, rendererProps, setSelectedRoleNameRef }: FormProps) => JSX.Element;
5
+ declare const _default: ({ roles, currentRole, renderer: Renderer, rendererProps, setSelectedRoleNameRef }: FormProps) => import("react/jsx-runtime").JSX.Element;
7
6
  export default _default;
8
7
  //# sourceMappingURL=StakeholderForm.d.ts.map
@@ -1 +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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"StakeholderForm.js","sourceRoot":"","sources":["../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EP,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
+ {"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,CAAC;YACV,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,K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,CACjB,KAAC,WAAW,IAEV,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAHlC,IAAI,CAAC,IAAI,CAId,CACH,CAAC,GACe,CACpB,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,WAAW,EAAE,CAAC;QACvB,OAAO,GAAG,CACR,KAAC,KAAK,IACJ,QAAQ,QACR,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC7B,KAAK,EAAE,WAAW,CAAC,IAAI,EACvB,IAAI,EAAE,WAAW,CAAC,WAAW,GAC7B,CACH,CAAC;IACJ,CAAC;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 +1,5 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '@pega/cosmos-react-core';
1
+ import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
3
2
  import type { StakeholdersProps } from './Stakeholders.types';
4
- declare const Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps>;
3
+ declare const Stakeholders: ForwardRefForwardPropsComponent<StakeholdersProps>;
5
4
  export default Stakeholders;
6
5
  //# sourceMappingURL=Stakeholders.d.ts.map
@@ -1 +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;AAkB3E,OAAO,KAAK,EAEV,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAsCpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CA4UrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,+BAA+B,EAIhC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiCpE,QAAA,MAAM,YAAY,EAAE,+BAA+B,CAAC,iBAAiB,CA2VpE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useRef, useEffect, useMemo, useState, useCallback } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { SummaryList, useI18n, Button, ViewAll, Modal, Popover, Flex, Text, useModalManager, useOuterEvent, Progress, useAfterInitialEffect, defaultThemeProp } from '@pega/cosmos-react-core';
4
+ import { SummaryList, useI18n, Button, ViewAll, Modal, Flex, useModalManager, useOuterEvent, Progress, useAfterInitialEffect, defaultThemeProp, FormDialog } from '@pega/cosmos-react-core';
5
5
  import StakeholderForm from './StakeholderForm';
6
6
  const StyledStakeholders = styled(SummaryList) ``;
7
7
  const StyledEditFormWrap = styled.div(({ theme }) => {
@@ -18,10 +18,6 @@ const StyledEditFormWrap = styled.div(({ theme }) => {
18
18
  `;
19
19
  });
20
20
  StyledEditFormWrap.defaultProps = defaultThemeProp;
21
- const StyledPopover = styled(Popover) `
22
- width: 40ch;
23
- min-height: 12rem;
24
- `;
25
21
  const StyledContainer = styled(Flex)(({ theme }) => {
26
22
  return css `
27
23
  max-height: inherit;
@@ -39,7 +35,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
39
35
  const [mode, setMode] = useState();
40
36
  const [editing, setEditing] = useState(false);
41
37
  const [viewAllSearchValue, setViewAllSearchValue] = useState('');
42
- const popoverRef = useRef(null);
38
+ const dialogRef = useRef(null);
43
39
  const progressMsgRef = useRef(t('loading'));
44
40
  // Why? Don't think this should trigger a re-render. We just need the value when we invoke callback props.
45
41
  const selectedRoleNameRef = useRef();
@@ -47,7 +43,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
47
43
  const setSelectedRoleNameRef = useCallback((selectedRoleName) => {
48
44
  selectedRoleNameRef.current = selectedRoleName;
49
45
  }, []);
50
- const [popoverTarget, setPopoverTarget] = useState(null);
46
+ const [dialogTarget, setDialogTarget] = useState(null);
51
47
  const itemElsRef = useRef({
52
48
  itemEls: [],
53
49
  viewAllItemEls: []
@@ -65,7 +61,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
65
61
  icon: 'pencil',
66
62
  onClick: () => {
67
63
  setEditing(true);
68
- setPopoverTarget({
64
+ setDialogTarget({
69
65
  portal: elArray[i],
70
66
  button: elArray[i].querySelector('button[aria-haspopup="menu"]')
71
67
  });
@@ -96,11 +92,11 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
96
92
  };
97
93
  });
98
94
  };
99
- const closePopover = () => {
100
- if (!popoverTarget || (form.loading && progressMsgRef.current === t('submitting')))
95
+ const closeFormDialog = () => {
96
+ if (!dialogTarget || (form.loading && progressMsgRef.current === t('submitting')))
101
97
  return;
102
- popoverTarget.button?.focus();
103
- setPopoverTarget(null);
98
+ dialogTarget.button?.focus();
99
+ setDialogTarget(null);
104
100
  setEditing(false);
105
101
  progressMsgRef.current = t('loading');
106
102
  };
@@ -109,7 +105,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
109
105
  (!form.loading || progressMsgRef.current === t('submitting'))) {
110
106
  formContent = (_jsx(StakeholderForm, { roles: form.roles, currentRole: form.currentRole, renderer: form.renderer, rendererProps: form.rendererProps, setSelectedRoleNameRef: setSelectedRoleNameRef }));
111
107
  }
112
- // Actions used for add and edit both in the modal and the popover.
108
+ // Actions used for add and edit both in the modal and the dialog.
113
109
  let formActions = null;
114
110
  if ((mode === 'add' || editing) &&
115
111
  (!form.loading || progressMsgRef.current === t('submitting'))) {
@@ -118,7 +114,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
118
114
  modalMethods.current?.dismiss();
119
115
  }
120
116
  else {
121
- closePopover();
117
+ closeFormDialog();
122
118
  }
123
119
  };
124
120
  formActions = (_jsxs(_Fragment, { children: [_jsx(Button, { disabled: form.loading, onClick: () => {
@@ -131,9 +127,24 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
131
127
  });
132
128
  }, children: t('submit') })] }));
133
129
  }
134
- let editPopover = null;
135
- if (popoverTarget) {
136
- editPopover = (_jsx(StyledPopover, { ref: popoverRef, target: popoverTarget.button, placement: 'auto', role: 'dialog', children: _jsxs(StyledContainer, { container: { direction: 'column', gap: 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', pad: [undefined, 2, 2] }, children: formActions }))] }) }));
130
+ const closeForm = () => {
131
+ if (mode === 'add') {
132
+ modalMethods.current?.dismiss();
133
+ }
134
+ else {
135
+ closeFormDialog();
136
+ }
137
+ };
138
+ const stakeholderFormDialog = (_jsx(StyledContainer, { container: { direction: 'column', gap: 2 }, children: _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 }))] }) }));
139
+ let editFormDialog = null;
140
+ if (dialogTarget?.button) {
141
+ editFormDialog = (_jsx(FormDialog, { ref: dialogRef, target: dialogTarget.button, heading: t('edit_stakeholder'), onSubmit: () => {
142
+ progressMsgRef.current = t('submitting');
143
+ form.onSubmit({
144
+ selectedRoleName: selectedRoleNameRef.current,
145
+ closeForm
146
+ });
147
+ }, onCancel: closeFormDialog, children: stakeholderFormDialog }));
137
148
  }
138
149
  // Content for the modal either for adding new or viewing all.
139
150
  let modalContent = null;
@@ -157,7 +168,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
157
168
  viewAll?.onSearch?.(value);
158
169
  }
159
170
  }
160
- : undefined }), editPopover] }));
171
+ : undefined }), editFormDialog] }));
161
172
  }
162
173
  useEffect(() => {
163
174
  if (!mode) {
@@ -194,25 +205,25 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
194
205
  });
195
206
  }
196
207
  }, [mode, modalContent, form.loading, formActions, count, viewAll.loading]);
197
- // Using mousedown instead of click since drag selecting an input's value within the popover, then releasing outside the popover triggers outer click.
198
- useOuterEvent('mousedown', [popoverRef], closePopover);
208
+ // Using mousedown instead of click since drag selecting an input's value within the dialog, then releasing outside the dialog triggers outer click.
209
+ useOuterEvent('mousedown', [dialogRef], closeFormDialog);
199
210
  const onKeydown = (e) => {
200
211
  if (e.key === 'Escape') {
201
- closePopover();
212
+ closeFormDialog();
202
213
  }
203
214
  };
204
215
  useEffect(() => {
205
- if (!popoverTarget)
216
+ if (!dialogTarget)
206
217
  return;
207
218
  document.addEventListener('keydown', onKeydown);
208
219
  return () => {
209
220
  document.removeEventListener('keydown', onKeydown);
210
221
  };
211
- }, [popoverTarget]);
222
+ }, [dialogTarget]);
212
223
  useAfterInitialEffect(() => {
213
- if (!popoverTarget)
224
+ if (!dialogTarget)
214
225
  form.onAfterClose?.();
215
- }, [popoverTarget]);
226
+ }, [dialogTarget]);
216
227
  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
217
228
  ? [
218
229
  {
@@ -230,7 +241,7 @@ const Stakeholders = forwardRef(function Stakeholders({ items: itemsProp, count,
230
241
  setMode('viewAll');
231
242
  onViewAll?.();
232
243
  }
233
- : undefined }), editPopover && mode !== 'viewAll' ? editPopover : null] }));
244
+ : undefined }), editFormDialog && mode !== 'viewAll' ? editFormDialog : null] }));
234
245
  });
235
246
  export default Stakeholders;
236
247
  //# sourceMappingURL=Stakeholders.js.map
@@ -1 +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,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD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,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, { css } 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 defaultThemeProp\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(({ theme }) => {\n return css`\n position: relative;\n min-height: 8rem;\n overflow: auto;\n padding-block: calc(${theme.base.spacing} / 2);\n padding-inline: calc(2 * ${theme.base.spacing});\n\n &[aria-busy='true'] > :nth-child(2) {\n visibility: hidden;\n }\n `;\n});\n\nStyledEditFormWrap.defaultProps = defaultThemeProp;\n\nconst StyledPopover = styled(Popover)`\n width: 40ch;\n min-height: 12rem;\n`;\n\nconst StyledContainer = styled(Flex)(({ theme }) => {\n return css`\n max-height: inherit;\n > h3 {\n padding-block-start: calc(2 * ${theme.base.spacing});\n padding-inline: calc(2 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledContainer.defaultProps = defaultThemeProp;\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 <StyledContainer container={{ direction: 'column', gap: 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 && (\n <Flex container={{ justify: 'between', pad: [undefined, 2, 2] }}>{formActions}</Flex>\n )}\n </StyledContainer>\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
+ {"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,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,WAAW,EACX,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,eAAe,EACf,aAAa,EACb,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACX,M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C,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,cAAc,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,IAC5D,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useMemo, useState, useCallback } from 'react';\nimport type { PropsWithoutRef, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n SummaryList,\n useI18n,\n Button,\n ViewAll,\n Modal,\n Flex,\n useModalManager,\n useOuterEvent,\n Progress,\n useAfterInitialEffect,\n defaultThemeProp,\n FormDialog\n} from '@pega/cosmos-react-core';\nimport type {\n Action,\n ForwardRefForwardPropsComponent,\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(({ theme }) => {\n return css`\n position: relative;\n min-height: 8rem;\n overflow: auto;\n padding-block: calc(${theme.base.spacing} / 2);\n padding-inline: calc(2 * ${theme.base.spacing});\n\n &[aria-busy='true'] > :nth-child(2) {\n visibility: hidden;\n }\n `;\n});\n\nStyledEditFormWrap.defaultProps = defaultThemeProp;\n\nconst StyledContainer = styled(Flex)(({ theme }) => {\n return css`\n max-height: inherit;\n > h3 {\n padding-block-start: calc(2 * ${theme.base.spacing});\n padding-inline: calc(2 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledContainer.defaultProps = defaultThemeProp;\n\nconst Stakeholders: ForwardRefForwardPropsComponent<StakeholdersProps> = 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 dialogRef = 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 [dialogTarget, setDialogTarget] = 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 setDialogTarget({\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 closeFormDialog = () => {\n if (!dialogTarget || (form.loading && progressMsgRef.current === t('submitting'))) return;\n dialogTarget.button?.focus();\n setDialogTarget(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 dialog.\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 closeFormDialog();\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 const closeForm = () => {\n if (mode === 'add') {\n modalMethods.current?.dismiss();\n } else {\n closeFormDialog();\n }\n };\n\n const stakeholderFormDialog = (\n <StyledContainer container={{ direction: 'column', gap: 2 }}>\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 </StyledContainer>\n );\n\n let editFormDialog: ReactNode = null;\n if (dialogTarget?.button) {\n editFormDialog = (\n <FormDialog\n ref={dialogRef}\n target={dialogTarget.button as HTMLElement}\n heading={t('edit_stakeholder')}\n onSubmit={() => {\n progressMsgRef.current = t('submitting');\n form.onSubmit({\n selectedRoleName: selectedRoleNameRef.current,\n closeForm\n });\n }}\n onCancel={closeFormDialog}\n >\n {stakeholderFormDialog}\n </FormDialog>\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 dialog triggered from a modal must be rendered within modal content to render in correct DOM position. */}\n {editFormDialog}\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 dialog, then releasing outside the dialog triggers outer click.\n useOuterEvent('mousedown', [dialogRef], closeFormDialog);\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closeFormDialog();\n }\n };\n\n useEffect(() => {\n if (!dialogTarget) return;\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, [dialogTarget]);\n\n useAfterInitialEffect(() => {\n if (!dialogTarget) form.onAfterClose?.();\n }, [dialogTarget]);\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 {editFormDialog && mode !== 'viewAll' ? editFormDialog : null}\n </>\n );\n }\n);\n\nexport default Stakeholders;\n"]}
@@ -1,5 +1,5 @@
1
- import type { FunctionComponent, Ref } from 'react';
2
- import type { BaseProps, ForwardProps, ErrorStateProps, NoChildrenProp } from '@pega/cosmos-react-core';
1
+ import type { Ref } from 'react';
2
+ import type { BaseProps, ForwardRefForwardPropsComponent, ErrorStateProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
3
  export interface SelectedTag {
4
4
  text: string;
5
5
  newTag?: boolean;
@@ -26,9 +26,9 @@ export interface TagsProps extends BaseProps, NoChildrenProp {
26
26
  ref?: Ref<HTMLElement>;
27
27
  }
28
28
  export declare const StyledTags: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, {
29
- isLoading?: boolean | undefined;
30
- viewAll?: boolean | undefined;
29
+ isLoading?: boolean;
30
+ viewAll?: boolean;
31
31
  }, never>;
32
- declare const Tags: FunctionComponent<TagsProps & ForwardProps>;
32
+ declare const Tags: ForwardRefForwardPropsComponent<TagsProps>;
33
33
  export default Tags;
34
34
  //# sourceMappingURL=Tags.d.ts.map
@@ -1 +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,CAA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