@pega/cosmos-react-work 5.0.0-dev.4.9 → 5.0.0-dev.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +23 -0
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -0
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +93 -0
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -0
  5. package/lib/components/AppAnnouncement/index.d.ts +3 -0
  6. package/lib/components/AppAnnouncement/index.d.ts.map +1 -0
  7. package/lib/components/AppAnnouncement/index.js +2 -0
  8. package/lib/components/AppAnnouncement/index.js.map +1 -0
  9. package/lib/components/Article/Article.d.ts +60 -0
  10. package/lib/components/Article/Article.d.ts.map +1 -0
  11. package/lib/components/Article/Article.js +87 -0
  12. package/lib/components/Article/Article.js.map +1 -0
  13. package/lib/components/Article/ArticleFooter.d.ts +38 -0
  14. package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
  15. package/lib/components/Article/ArticleFooter.js +58 -0
  16. package/lib/components/Article/ArticleFooter.js.map +1 -0
  17. package/lib/components/Article/ArticleMeta.d.ts +13 -0
  18. package/lib/components/Article/ArticleMeta.d.ts.map +1 -0
  19. package/lib/components/Article/ArticleMeta.js +27 -0
  20. package/lib/components/Article/ArticleMeta.js.map +1 -0
  21. package/lib/components/Article/ArticleRating.d.ts +13 -0
  22. package/lib/components/Article/ArticleRating.d.ts.map +1 -0
  23. package/lib/components/Article/ArticleRating.js +43 -0
  24. package/lib/components/Article/ArticleRating.js.map +1 -0
  25. package/lib/components/Article/index.d.ts +7 -0
  26. package/lib/components/Article/index.d.ts.map +1 -0
  27. package/lib/components/Article/index.js +4 -0
  28. package/lib/components/Article/index.js.map +1 -0
  29. package/lib/components/ArticleList/ArticleBuddy.d.ts +9 -0
  30. package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -0
  31. package/lib/components/ArticleList/ArticleBuddy.js +57 -0
  32. package/lib/components/ArticleList/ArticleBuddy.js.map +1 -0
  33. package/lib/components/ArticleList/ArticleList.d.ts +6 -0
  34. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
  35. package/lib/components/ArticleList/ArticleList.js +146 -0
  36. package/lib/components/ArticleList/ArticleList.js.map +1 -0
  37. package/lib/components/ArticleList/ArticleList.types.d.ts +128 -0
  38. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
  39. package/lib/components/ArticleList/ArticleList.types.js +7 -0
  40. package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
  41. package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
  42. package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
  43. package/lib/components/ArticleList/ArticleListFilter.js +67 -0
  44. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
  45. package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
  46. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
  47. package/lib/components/ArticleList/ArticleListHeader.js +20 -0
  48. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
  49. package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
  50. package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
  51. package/lib/components/ArticleList/ArticleSummary.js +63 -0
  52. package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
  53. package/lib/components/ArticleList/index.d.ts +8 -0
  54. package/lib/components/ArticleList/index.d.ts.map +1 -0
  55. package/lib/components/ArticleList/index.js +5 -0
  56. package/lib/components/ArticleList/index.js.map +1 -0
  57. package/lib/components/Assignments/Assignments.d.ts +21 -0
  58. package/lib/components/Assignments/Assignments.d.ts.map +1 -0
  59. package/lib/components/Assignments/Assignments.js +20 -0
  60. package/lib/components/Assignments/Assignments.js.map +1 -0
  61. package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
  62. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
  63. package/lib/components/Assignments/Assignments.styles.js +41 -0
  64. package/lib/components/Assignments/Assignments.styles.js.map +1 -0
  65. package/lib/components/Assignments/index.d.ts +3 -0
  66. package/lib/components/Assignments/index.d.ts.map +1 -0
  67. package/lib/components/Assignments/index.js +2 -0
  68. package/lib/components/Assignments/index.js.map +1 -0
  69. package/lib/components/CasePreview/CasePreview.d.ts +27 -0
  70. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -0
  71. package/lib/components/CasePreview/CasePreview.js +82 -0
  72. package/lib/components/CasePreview/CasePreview.js.map +1 -0
  73. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  74. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  75. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  76. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  77. package/lib/components/CasePreview/index.d.ts +3 -0
  78. package/lib/components/CasePreview/index.d.ts.map +1 -0
  79. package/lib/components/CasePreview/index.js +2 -0
  80. package/lib/components/CasePreview/index.js.map +1 -0
  81. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts +4 -0
  82. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
  83. package/lib/components/CaseView/CaseHeader/CaseHeader.js +127 -0
  84. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
  85. package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
  86. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
  87. package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
  88. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
  89. package/lib/components/CaseView/CaseSummary.d.ts +4 -0
  90. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -0
  91. package/lib/components/CaseView/CaseSummary.js +18 -0
  92. package/lib/components/CaseView/CaseSummary.js.map +1 -0
  93. package/lib/components/CaseView/CaseSummaryFields.d.ts +6 -0
  94. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -0
  95. package/lib/components/CaseView/CaseSummaryFields.js +18 -0
  96. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -0
  97. package/lib/components/CaseView/CaseView.context.d.ts +5 -0
  98. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -0
  99. package/lib/components/CaseView/CaseView.context.js +5 -0
  100. package/lib/components/CaseView/CaseView.context.js.map +1 -0
  101. package/lib/components/CaseView/CaseView.d.ts +8 -0
  102. package/lib/components/CaseView/CaseView.d.ts.map +1 -0
  103. package/lib/components/CaseView/CaseView.js +421 -0
  104. package/lib/components/CaseView/CaseView.js.map +1 -0
  105. package/lib/components/CaseView/CaseView.styles.d.ts +45 -0
  106. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  107. package/lib/components/CaseView/CaseView.styles.js +559 -0
  108. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  109. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  110. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  111. package/lib/components/CaseView/CaseView.test-ids.js +18 -0
  112. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  113. package/lib/components/CaseView/CaseView.types.d.ts +98 -0
  114. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -0
  115. package/lib/components/CaseView/CaseView.types.js +2 -0
  116. package/lib/components/CaseView/CaseView.types.js.map +1 -0
  117. package/lib/components/CaseView/UtilitiesSummary.d.ts +9 -0
  118. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -0
  119. package/lib/components/CaseView/UtilitiesSummary.js +53 -0
  120. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -0
  121. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +9 -0
  122. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -0
  123. package/lib/components/CaseView/UtilitySummaryItemDialog.js +33 -0
  124. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -0
  125. package/lib/components/CaseView/index.d.ts +5 -0
  126. package/lib/components/CaseView/index.d.ts.map +1 -0
  127. package/lib/components/CaseView/index.js +4 -0
  128. package/lib/components/CaseView/index.js.map +1 -0
  129. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  130. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  131. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +86 -0
  132. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  133. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +41 -0
  134. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  135. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  136. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  137. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  138. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  139. package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
  140. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  141. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  142. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  143. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  144. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  145. package/lib/components/ConfigurableLayout/index.d.ts +4 -0
  146. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  147. package/lib/components/ConfigurableLayout/index.js +3 -0
  148. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  149. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  150. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  151. package/lib/components/ConfigurableLayout/options.js +10 -0
  152. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  153. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
  154. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
  155. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
  156. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
  157. package/lib/components/Confirmation/Confirmation.d.ts +19 -0
  158. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
  159. package/lib/components/Confirmation/Confirmation.js +29 -0
  160. package/lib/components/Confirmation/Confirmation.js.map +1 -0
  161. package/lib/components/Confirmation/index.d.ts +3 -0
  162. package/lib/components/Confirmation/index.d.ts.map +1 -0
  163. package/lib/components/Confirmation/index.js +2 -0
  164. package/lib/components/Confirmation/index.js.map +1 -0
  165. package/lib/components/Details/Details.d.ts +43 -0
  166. package/lib/components/Details/Details.d.ts.map +1 -0
  167. package/lib/components/Details/Details.js +95 -0
  168. package/lib/components/Details/Details.js.map +1 -0
  169. package/lib/components/Details/Details.styles.d.ts +50 -0
  170. package/lib/components/Details/Details.styles.d.ts.map +1 -0
  171. package/lib/components/Details/Details.styles.js +204 -0
  172. package/lib/components/Details/Details.styles.js.map +1 -0
  173. package/lib/components/Details/Details.test-ids.d.ts +2 -0
  174. package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
  175. package/lib/components/Details/Details.test-ids.js +9 -0
  176. package/lib/components/Details/Details.test-ids.js.map +1 -0
  177. package/lib/components/Details/DetailsContext.d.ts +9 -0
  178. package/lib/components/Details/DetailsContext.d.ts.map +1 -0
  179. package/lib/components/Details/DetailsContext.js +9 -0
  180. package/lib/components/Details/DetailsContext.js.map +1 -0
  181. package/lib/components/Details/index.d.ts +4 -0
  182. package/lib/components/Details/index.d.ts.map +1 -0
  183. package/lib/components/Details/index.js +4 -0
  184. package/lib/components/Details/index.js.map +1 -0
  185. package/lib/components/Glimpse/Glimpse.d.ts +20 -0
  186. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -0
  187. package/lib/components/Glimpse/Glimpse.js +12 -0
  188. package/lib/components/Glimpse/Glimpse.js.map +1 -0
  189. package/lib/components/Glimpse/index.d.ts +3 -0
  190. package/lib/components/Glimpse/index.d.ts.map +1 -0
  191. package/lib/components/Glimpse/index.js +2 -0
  192. package/lib/components/Glimpse/index.js.map +1 -0
  193. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
  194. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +83 -0
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -0
  198. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
  199. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +199 -0
  200. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
  201. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +35 -0
  202. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
  203. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
  204. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
  205. package/lib/components/IntelligentGuidance/index.d.ts +3 -0
  206. package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
  207. package/lib/components/IntelligentGuidance/index.js +2 -0
  208. package/lib/components/IntelligentGuidance/index.js.map +1 -0
  209. package/lib/components/Predictions/Predictions.d.ts +6 -0
  210. package/lib/components/Predictions/Predictions.d.ts.map +1 -0
  211. package/lib/components/Predictions/Predictions.js +68 -0
  212. package/lib/components/Predictions/Predictions.js.map +1 -0
  213. package/lib/components/Predictions/Predictions.types.d.ts +23 -0
  214. package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
  215. package/lib/components/Predictions/Predictions.types.js +2 -0
  216. package/lib/components/Predictions/Predictions.types.js.map +1 -0
  217. package/lib/components/Predictions/index.d.ts +3 -0
  218. package/lib/components/Predictions/index.d.ts.map +1 -0
  219. package/lib/components/Predictions/index.js +2 -0
  220. package/lib/components/Predictions/index.js.map +1 -0
  221. package/lib/components/SearchResults/Filter.d.ts +8 -0
  222. package/lib/components/SearchResults/Filter.d.ts.map +1 -0
  223. package/lib/components/SearchResults/Filter.js +45 -0
  224. package/lib/components/SearchResults/Filter.js.map +1 -0
  225. package/lib/components/SearchResults/SearchResult.d.ts +4 -0
  226. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -0
  227. package/lib/components/SearchResults/SearchResult.js +27 -0
  228. package/lib/components/SearchResults/SearchResult.js.map +1 -0
  229. package/lib/components/SearchResults/SearchResults.d.ts +6 -0
  230. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -0
  231. package/lib/components/SearchResults/SearchResults.js +121 -0
  232. package/lib/components/SearchResults/SearchResults.js.map +1 -0
  233. package/lib/components/SearchResults/SearchResults.styles.d.ts +11 -0
  234. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
  235. package/lib/components/SearchResults/SearchResults.styles.js +88 -0
  236. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
  237. package/lib/components/SearchResults/SearchResults.types.d.ts +100 -0
  238. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -0
  239. package/lib/components/SearchResults/SearchResults.types.js +2 -0
  240. package/lib/components/SearchResults/SearchResults.types.js.map +1 -0
  241. package/lib/components/SearchResults/index.d.ts +3 -0
  242. package/lib/components/SearchResults/index.d.ts.map +1 -0
  243. package/lib/components/SearchResults/index.js +2 -0
  244. package/lib/components/SearchResults/index.js.map +1 -0
  245. package/lib/components/Stages/StageGlimpse.d.ts +8 -0
  246. package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
  247. package/lib/components/Stages/StageGlimpse.js +11 -0
  248. package/lib/components/Stages/StageGlimpse.js.map +1 -0
  249. package/lib/components/Stages/Stages.d.ts +6 -0
  250. package/lib/components/Stages/Stages.d.ts.map +1 -0
  251. package/lib/components/Stages/Stages.js +107 -0
  252. package/lib/components/Stages/Stages.js.map +1 -0
  253. package/lib/components/Stages/Stages.styles.d.ts +14 -0
  254. package/lib/components/Stages/Stages.styles.d.ts.map +1 -0
  255. package/lib/components/Stages/Stages.styles.js +270 -0
  256. package/lib/components/Stages/Stages.styles.js.map +1 -0
  257. package/lib/components/Stages/Stages.types.d.ts +38 -0
  258. package/lib/components/Stages/Stages.types.d.ts.map +1 -0
  259. package/lib/components/Stages/Stages.types.js +2 -0
  260. package/lib/components/Stages/Stages.types.js.map +1 -0
  261. package/lib/components/Stages/index.d.ts +3 -0
  262. package/lib/components/Stages/index.d.ts.map +1 -0
  263. package/lib/components/Stages/index.js +2 -0
  264. package/lib/components/Stages/index.js.map +1 -0
  265. package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
  266. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  267. package/lib/components/Stakeholders/StakeholderForm.js +49 -0
  268. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  269. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  270. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  271. package/lib/components/Stakeholders/Stakeholders.js +220 -0
  272. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  273. package/lib/components/Stakeholders/Stakeholders.types.d.ts +75 -0
  274. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  275. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  276. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  277. package/lib/components/Stakeholders/index.d.ts +3 -0
  278. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  279. package/lib/components/Stakeholders/index.js +2 -0
  280. package/lib/components/Stakeholders/index.js.map +1 -0
  281. package/lib/components/Tags/Tags.d.ts +34 -0
  282. package/lib/components/Tags/Tags.d.ts.map +1 -0
  283. package/lib/components/Tags/Tags.js +230 -0
  284. package/lib/components/Tags/Tags.js.map +1 -0
  285. package/lib/components/Tags/index.d.ts +3 -0
  286. package/lib/components/Tags/index.d.ts.map +1 -0
  287. package/lib/components/Tags/index.js +2 -0
  288. package/lib/components/Tags/index.js.map +1 -0
  289. package/lib/components/Tasks/TaskList.d.ts +39 -0
  290. package/lib/components/Tasks/TaskList.d.ts.map +1 -0
  291. package/lib/components/Tasks/TaskList.js +71 -0
  292. package/lib/components/Tasks/TaskList.js.map +1 -0
  293. package/lib/components/Tasks/Tasks.d.ts +29 -0
  294. package/lib/components/Tasks/Tasks.d.ts.map +1 -0
  295. package/lib/components/Tasks/Tasks.js +52 -0
  296. package/lib/components/Tasks/Tasks.js.map +1 -0
  297. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  298. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  299. package/lib/components/Tasks/Tasks.test-ids.js +5 -0
  300. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  301. package/lib/components/Tasks/index.d.ts +6 -0
  302. package/lib/components/Tasks/index.d.ts.map +1 -0
  303. package/lib/components/Tasks/index.js +4 -0
  304. package/lib/components/Tasks/index.js.map +1 -0
  305. package/lib/components/Timeline/Timeline.d.ts +6 -0
  306. package/lib/components/Timeline/Timeline.d.ts.map +1 -0
  307. package/lib/components/Timeline/Timeline.js +26 -0
  308. package/lib/components/Timeline/Timeline.js.map +1 -0
  309. package/lib/components/Timeline/Timeline.styles.d.ts +21 -0
  310. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -0
  311. package/lib/components/Timeline/Timeline.styles.js +165 -0
  312. package/lib/components/Timeline/Timeline.styles.js.map +1 -0
  313. package/lib/components/Timeline/Timeline.types.d.ts +66 -0
  314. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -0
  315. package/lib/components/Timeline/Timeline.types.js +2 -0
  316. package/lib/components/Timeline/Timeline.types.js.map +1 -0
  317. package/lib/components/Timeline/TimelineItem.d.ts +13 -0
  318. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
  319. package/lib/components/Timeline/TimelineItem.js +33 -0
  320. package/lib/components/Timeline/TimelineItem.js.map +1 -0
  321. package/lib/components/Timeline/TimelineToolbar.d.ts +6 -0
  322. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -0
  323. package/lib/components/Timeline/TimelineToolbar.js +68 -0
  324. package/lib/components/Timeline/TimelineToolbar.js.map +1 -0
  325. package/lib/components/Timeline/index.d.ts +4 -0
  326. package/lib/components/Timeline/index.d.ts.map +1 -0
  327. package/lib/components/Timeline/index.js +3 -0
  328. package/lib/components/Timeline/index.js.map +1 -0
  329. package/lib/components/Timeline/utils.d.ts +15 -0
  330. package/lib/components/Timeline/utils.d.ts.map +1 -0
  331. package/lib/components/Timeline/utils.js +75 -0
  332. package/lib/components/Timeline/utils.js.map +1 -0
  333. package/lib/index.d.ts +37 -0
  334. package/lib/index.d.ts.map +1 -0
  335. package/lib/index.js +38 -0
  336. package/lib/index.js.map +1 -0
  337. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArticleListHeader.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListHeader.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAItF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAKpC,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAC7B,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;4BACc,OAAO;KAC9B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,iBAAiB,GAA8C,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IAChG,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,aAC7D,IAAI,IAAI,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,GAAI,EACnC,KAAC,gBAAgB,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAoB,EACxD,OAAO,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,OAAO,GAAI,IAClC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, Icon, Actions, Text, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport type { ArticleListHeaderProps } from './ArticleList.types';\n\nconst StyledHeaderText = styled(Text)`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n flex-grow: 1;\n`;\n\nconst StyledIcon = styled(Icon)(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n min-width: calc(3 * ${spacing});\n `;\n }\n);\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nconst ArticleListHeader: FunctionComponent<ArticleListHeaderProps> = ({ icon, title, actions }) => {\n return (\n <Flex container={{ alignItems: 'center', gap: 1, pad: [1.5, 2] }}>\n {icon && <StyledIcon name={icon} />}\n <StyledHeaderText variant='h2'>{title}</StyledHeaderText>\n {actions && <Actions items={actions} />}\n </Flex>\n );\n};\n\nexport default ArticleListHeader;\n"]}
@@ -0,0 +1,7 @@
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { ArticleSummaryProps } from './ArticleList.types';
4
+ export declare const StyledQuickFilters: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ declare const ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps>;
6
+ export default ArticleSummary;
7
+ //# sourceMappingURL=ArticleSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArticleSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAe/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAqC/D,eAAO,MAAM,kBAAkB,yGAW7B,CAAC;AAGH,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAsEzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { CardHeader, CardContent, CardFooter, Link, Text, StyledText, Actions, Flex, Tag, defaultThemeProp } from '@pega/cosmos-react-core';
4
+ import { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';
5
+ import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
6
+ import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
7
+ import { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';
8
+ import { StyledBareButton } from '@pega/cosmos-react-core/lib/components/Button/BareButton';
9
+ import ArticleRating from '../Article/ArticleRating';
10
+ import ArticleMeta from '../Article/ArticleMeta';
11
+ const ArticleCard = styled(StyledCard)(({ theme: { base: { spacing, palette } } }) => {
12
+ return css `
13
+ &:not(:last-child) {
14
+ border-block-end: 0.0625rem solid ${palette['border-line']};
15
+ border-radius: 0;
16
+ padding-block-end: ${spacing};
17
+ }
18
+ &&& {
19
+ border-radius: 0;
20
+ > ${StyledCardHeader} {
21
+ padding-block-start: 0;
22
+ padding-inline: 0;
23
+ }
24
+ > ${StyledCardContent}, > ${StyledCardFooter} {
25
+ padding-inline: 0;
26
+ }
27
+ > ${StyledCardContent} {
28
+ padding-block-end: ${spacing};
29
+ }
30
+ > ${StyledCardContent} > ${StyledText} {
31
+ display: -webkit-box;
32
+ -webkit-line-clamp: 3;
33
+ -webkit-box-orient: vertical;
34
+ overflow: hidden;
35
+ }
36
+ }
37
+ `;
38
+ });
39
+ export const StyledQuickFilters = styled.div(({ theme }) => {
40
+ const { base: { spacing } } = theme;
41
+ return css `
42
+ ${StyledBareButton} {
43
+ margin-inline-start: 0;
44
+ margin-block-start: ${spacing};
45
+ }
46
+ `;
47
+ });
48
+ StyledQuickFilters.defaultProps = defaultThemeProp;
49
+ const ArticleSummary = (props) => {
50
+ const { articleId, href, title, abstract, onTitleClick, primaryActions, meta, quickFilters, onQuickFilterClick, feedback, ...restProps } = props;
51
+ return (_jsxs(ArticleCard, { as: 'li', role: 'article', ...restProps, children: [_jsxs(CardHeader, { container: { alignItems: 'start', justify: 'between' }, children: [_jsx(Link, { href: href ?? '/', onClick: onTitleClick, children: title }), primaryActions?.length && _jsx(Actions, { items: primaryActions })] }), _jsx(CardContent, { children: _jsx(Text, { children: abstract }) }), _jsxs(CardFooter, { children: [feedback && (_jsx(Flex, { container: { pad: [0.5, undefined] }, item: {
52
+ grow: 1,
53
+ basis: '100%'
54
+ }, children: _jsx(ArticleRating, { ...feedback,
55
+ onReaction: reaction => {
56
+ feedback?.onReaction(articleId, reaction);
57
+ } }) })), meta && _jsx(ArticleMeta, { ...meta }), quickFilters && quickFilters.length > 0 && (_jsx(Flex, { container: { gap: 0.5, wrap: 'wrap', pad: [undefined, undefined, 0.5] }, item: {
58
+ grow: 1,
59
+ basis: '100%'
60
+ }, as: StyledQuickFilters, children: quickFilters.map(({ id, name }) => (_jsx(Tag, { onClick: onQuickFilterClick ? e => onQuickFilterClick?.({ id, name }, e) : undefined, children: `#${name}` }, id))) }))] })] }));
61
+ };
62
+ export default ArticleSummary;
63
+ //# sourceMappingURL=ArticleSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArticleSummary.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,OAAO,EACP,IAAI,EACJ,GAAG,EACH,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAE5F,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AAIjD,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CACpC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC3B,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;4CAE8B,OAAO,CAAC,aAAa,CAAC;;6BAErC,OAAO;;;;YAIxB,gBAAgB;;;;YAIhB,iBAAiB,OAAO,gBAAgB;;;YAGxC,iBAAiB;+BACE,OAAO;;YAE1B,iBAAiB,MAAM,UAAU;;;;;;;KAOxC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,MAAM,EACJ,IAAI,EAAE,EAAE,OAA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I,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC1C,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EACvE,IAAI,EAAE;4BACJ,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,MAAM;yBACd,EACD,EAAE,EAAE,kBAAkB,YAErB,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAClC,KAAC,GAAG,IAEF,OAAO,EACL,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,YAE7E,IAAI,IAAI,EAAE,IAJL,EAAE,CAIU,CACpB,CAAC,GACG,CACR,IACU,IACD,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n CardHeader,\n CardContent,\n CardFooter,\n Link,\n Text,\n StyledText,\n Actions,\n Flex,\n Tag,\n defaultThemeProp\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';\nimport { StyledBareButton } from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nimport ArticleRating from '../Article/ArticleRating';\nimport ArticleMeta from '../Article/ArticleMeta';\n\nimport type { ArticleSummaryProps } from './ArticleList.types';\n\nconst ArticleCard = styled(StyledCard)(\n ({\n theme: {\n base: { spacing, palette }\n }\n }) => {\n return css`\n &:not(:last-child) {\n border-block-end: 0.0625rem solid ${palette['border-line']};\n border-radius: 0;\n padding-block-end: ${spacing};\n }\n &&& {\n border-radius: 0;\n > ${StyledCardHeader} {\n padding-block-start: 0;\n padding-inline: 0;\n }\n > ${StyledCardContent}, > ${StyledCardFooter} {\n padding-inline: 0;\n }\n > ${StyledCardContent} {\n padding-block-end: ${spacing};\n }\n > ${StyledCardContent} > ${StyledText} {\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n }\n `;\n }\n);\n\nexport const StyledQuickFilters = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n ${StyledBareButton} {\n margin-inline-start: 0;\n margin-block-start: ${spacing};\n }\n `;\n});\nStyledQuickFilters.defaultProps = defaultThemeProp;\n\nconst ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps> = (\n props: ArticleSummaryProps\n) => {\n const {\n articleId,\n href,\n title,\n abstract,\n onTitleClick,\n primaryActions,\n meta,\n quickFilters,\n onQuickFilterClick,\n feedback,\n ...restProps\n } = props;\n return (\n <ArticleCard as='li' role='article' {...restProps}>\n <CardHeader container={{ alignItems: 'start', justify: 'between' }}>\n <Link href={href ?? '/'} onClick={onTitleClick}>\n {title}\n </Link>\n {primaryActions?.length && <Actions items={primaryActions} />}\n </CardHeader>\n\n <CardContent>\n <Text>{abstract}</Text>\n </CardContent>\n <CardFooter>\n {feedback && (\n <Flex\n container={{ pad: [0.5, undefined] }}\n item={{\n grow: 1,\n basis: '100%'\n }}\n >\n <ArticleRating\n {...{\n ...feedback,\n onReaction: reaction => {\n feedback?.onReaction(articleId, reaction);\n }\n }}\n />\n </Flex>\n )}\n {meta && <ArticleMeta {...meta} />}\n {quickFilters && quickFilters.length > 0 && (\n <Flex\n container={{ gap: 0.5, wrap: 'wrap', pad: [undefined, undefined, 0.5] }}\n item={{\n grow: 1,\n basis: '100%'\n }}\n as={StyledQuickFilters}\n >\n {quickFilters.map(({ id, name }) => (\n <Tag\n key={id}\n onClick={\n onQuickFilterClick ? e => onQuickFilterClick?.({ id, name }, e) : undefined\n }\n >{`#${name}`}</Tag>\n ))}\n </Flex>\n )}\n </CardFooter>\n </ArticleCard>\n );\n};\n\nexport default ArticleSummary;\n"]}
@@ -0,0 +1,8 @@
1
+ export { default } from './ArticleList';
2
+ export type { ArticleListProps } from './ArticleList.types';
3
+ export { default as ArticleSummary } from './ArticleSummary';
4
+ export type { ArticleSummaryProps, Articles, QuickFilter } from './ArticleList.types';
5
+ export { default as ArticleListFilter } from './ArticleListFilter';
6
+ export type { ArticleBuddyProps } from './ArticleList.types';
7
+ export { default as ArticleBuddy } from './ArticleBuddy';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default } from './ArticleList';
2
+ export { default as ArticleSummary } from './ArticleSummary';
3
+ export { default as ArticleListFilter } from './ArticleListFilter';
4
+ export { default as ArticleBuddy } from './ArticleBuddy';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default } from './ArticleList';\nexport type { ArticleListProps } from './ArticleList.types';\nexport { default as ArticleSummary } from './ArticleSummary';\nexport type { ArticleSummaryProps, Articles, QuickFilter } from './ArticleList.types';\nexport { default as ArticleListFilter } from './ArticleListFilter';\nexport type { ArticleBuddyProps } from './ArticleList.types';\nexport { default as ArticleBuddy } from './ArticleBuddy';\n"]}
@@ -0,0 +1,21 @@
1
+ import type { FC } from 'react';
2
+ import type { ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import type { TaskItemProps } from '../Tasks/TaskList';
4
+ export interface AssignmentsProps extends NoChildrenProp {
5
+ /** An array of TaskItemProps to generate the list. */
6
+ items: TaskItemProps[];
7
+ /** Integer representing the total count of tasks. */
8
+ count: number;
9
+ /**
10
+ * Controls the collapsed state of the assignments list.
11
+ * @default false
12
+ */
13
+ collapsed?: boolean;
14
+ /**
15
+ * Call when the user clicks the collapsed element.
16
+ */
17
+ onToggleCollapsed?: () => void;
18
+ }
19
+ declare const Assignments: FC<ForwardProps & AssignmentsProps>;
20
+ export default Assignments;
21
+ //# sourceMappingURL=Assignments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assignments.d.ts","sourceRoot":"","sources":["../../../src/components/Assignments/Assignments.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAahC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,sDAAsD;IACtD,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,YAAY,GAAG,gBAAgB,CA0DpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { CardHeader, useI18n, EmptyState, ExpandCollapse, Icon, Text, Count, Flex, useUID } from '@pega/cosmos-react-core';
4
+ import TaskList, { TaskItem } from '../Tasks/TaskList';
5
+ import { StyledAssignments, StyledCardContent, StyledExpandButton } from './Assignments.styles';
6
+ const Assignments = ({ items, count, collapsed, onToggleCollapsed, ...restProps }) => {
7
+ const openItem = items.find(item => item.content);
8
+ const t = useI18n();
9
+ const assignmentsId = useUID();
10
+ const TaskItems = useMemo(() => {
11
+ return openItem ? _jsx(TaskItem, { ...openItem }) : _jsx(TaskList, { items: items });
12
+ }, [items, openItem]);
13
+ const tasks = (_jsx(StyledCardContent, { openItem: openItem, children: items.length > 0 ? TaskItems : _jsx(EmptyState, {}) }));
14
+ const header = (_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [typeof collapsed === 'boolean' && _jsx(Icon, { name: 'caret-right' }), _jsx(Text, { variant: 'h2', children: t('assignments') }), _jsx(Count, { children: count })] }));
15
+ return (_jsxs(StyledAssignments, { ...restProps, openItem: !!openItem, "data-app-region": true, children: [!openItem && (_jsxs(CardHeader, { container: { justify: 'start', alignItems: 'center', gap: 1 }, children: [typeof collapsed === 'boolean' && onToggleCollapsed && (_jsx(StyledExpandButton, { type: 'button', variant: 'text', onClick: () => {
16
+ onToggleCollapsed();
17
+ }, "aria-controls": assignmentsId, "aria-expanded": !collapsed ? 'true' : 'false', "aria-label": t('assignments'), children: header })), collapsed === undefined && header] })), typeof collapsed === 'boolean' && onToggleCollapsed && !openItem ? (_jsx(ExpandCollapse, { collapsed: collapsed, children: tasks })) : (tasks)] }));
18
+ };
19
+ export default Assignments;
20
+ //# sourceMappingURL=Assignments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assignments.js","sourceRoot":"","sources":["../../../src/components/Assignments/Assignments.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EACL,UAAU,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACP,MAAM,yBAAyB,CAAC;AAGjC,OAAO,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAkBhG,MAAM,WAAW,GAAwC,CAAC,EACxD,KAAK,EACL,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC;IAE/B,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAC,QAAQ,OAAK,QAAQ,GAAI,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;IAC5E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C,CAAC,CAAC,CAClE,KAAC,cAAc,IAAC,SAAS,EAAE,SAAS,YAAG,KAAK,GAAkB,CAC/D,CAAC,CAAC,CAAC,CACF,KAAK,CACN,IACiB,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport type { FC } from 'react';\n\nimport {\n CardHeader,\n useI18n,\n EmptyState,\n ExpandCollapse,\n Icon,\n Text,\n Count,\n Flex,\n useUID\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nimport TaskList, { TaskItem } from '../Tasks/TaskList';\nimport type { TaskItemProps } from '../Tasks/TaskList';\n\nimport { StyledAssignments, StyledCardContent, StyledExpandButton } from './Assignments.styles';\n\nexport interface AssignmentsProps extends NoChildrenProp {\n /** An array of TaskItemProps to generate the list. */\n items: TaskItemProps[];\n /** Integer representing the total count of tasks. */\n count: number;\n /**\n * Controls the collapsed state of the assignments list.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Call when the user clicks the collapsed element.\n */\n onToggleCollapsed?: () => void;\n}\n\nconst Assignments: FC<ForwardProps & AssignmentsProps> = ({\n items,\n count,\n collapsed,\n onToggleCollapsed,\n ...restProps\n}) => {\n const openItem = items.find(item => item.content);\n const t = useI18n();\n const assignmentsId = useUID();\n\n const TaskItems = useMemo(() => {\n return openItem ? <TaskItem {...openItem} /> : <TaskList items={items} />;\n }, [items, openItem]);\n\n const tasks = (\n <StyledCardContent openItem={openItem}>\n {items.length > 0 ? TaskItems : <EmptyState />}\n </StyledCardContent>\n );\n\n const header = (\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {typeof collapsed === 'boolean' && <Icon name='caret-right' />}\n <Text variant='h2'>{t('assignments')}</Text>\n <Count>{count}</Count>\n </Flex>\n );\n\n return (\n <StyledAssignments {...restProps} openItem={!!openItem} data-app-region>\n {!openItem && (\n <CardHeader container={{ justify: 'start', alignItems: 'center', gap: 1 }}>\n {typeof collapsed === 'boolean' && onToggleCollapsed && (\n <StyledExpandButton\n type='button'\n variant='text'\n onClick={() => {\n onToggleCollapsed();\n }}\n aria-controls={assignmentsId}\n aria-expanded={!collapsed ? 'true' : 'false'}\n aria-label={t('assignments')}\n >\n {header}\n </StyledExpandButton>\n )}\n {collapsed === undefined && header}\n </CardHeader>\n )}\n\n {typeof collapsed === 'boolean' && onToggleCollapsed && !openItem ? (\n <ExpandCollapse collapsed={collapsed}>{tasks}</ExpandCollapse>\n ) : (\n tasks\n )}\n </StyledAssignments>\n );\n};\n\nexport default Assignments;\n"]}
@@ -0,0 +1,8 @@
1
+ export declare const StyledExpandButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledAssignments: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
3
+ openItem?: boolean | undefined;
4
+ }, never>;
5
+ export declare const StyledCardContent: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardContentProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
6
+ openItem?: boolean | undefined;
7
+ }, never>;
8
+ //# sourceMappingURL=Assignments.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assignments.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Assignments/Assignments.styles.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,kBAAkB,qOA0B9B,CAAC;AAIF,eAAO,MAAM,iBAAiB;;SAM5B,CAAC;AAIH,eAAO,MAAM,iBAAiB;;SAQ7B,CAAC"}
@@ -0,0 +1,41 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { Button, Card, CardContent, defaultThemeProp, StyledCard, StyledIcon, useDirection } from '@pega/cosmos-react-core';
3
+ export const StyledExpandButton = styled(Button)(({ theme: { base: { animation } } }) => {
4
+ const { rtl } = useDirection();
5
+ return css `
6
+ ${StyledIcon} {
7
+ transition: transform ${animation.speed} ${animation.timing.ease};
8
+ }
9
+
10
+ &[aria-expanded='true'] ${StyledIcon} {
11
+ transform: rotate(90deg);
12
+ }
13
+
14
+ &[aria-expanded='false'] ${StyledIcon} {
15
+ transform: rotate(${rtl ? 180 : 0}deg);
16
+ }
17
+
18
+ &:hover,
19
+ &:active {
20
+ text-decoration: none;
21
+ }
22
+ `;
23
+ });
24
+ StyledExpandButton.defaultProps = defaultThemeProp;
25
+ export const StyledAssignments = styled(Card)(({ theme, openItem }) => {
26
+ return openItem
27
+ ? css `
28
+ box-shadow: ${theme.base.shadow.low};
29
+ `
30
+ : null;
31
+ });
32
+ StyledAssignments.defaultProps = defaultThemeProp;
33
+ export const StyledCardContent = styled(CardContent)(({ theme, openItem }) => {
34
+ return css `
35
+ &:not(${StyledCard} ${StyledCard} > &) {
36
+ padding: ${openItem ? theme.base.spacing : '0'} calc(2 * ${theme.base.spacing});
37
+ }
38
+ `;
39
+ });
40
+ StyledCardContent.defaultProps = defaultThemeProp;
41
+ //# sourceMappingURL=Assignments.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assignments.styles.js","sourceRoot":"","sources":["../../../src/components/Assignments/Assignments.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAC9C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,SAAS,EAAE,EACpB,EACF,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,GAAG,CAAA;QACN,UAAU;gCACc,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI;;;gCAGxC,UAAU;;;;iCAIT,UAAU;4BACf,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;;;;;;KAOpC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5F,OAAO,QAAQ;QACb,CAAC,CAAC,GAAG,CAAA;sBACa,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG;OACpC;QACH,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,CAClD,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtB,OAAO,GAAG,CAAA;cACA,UAAU,IAAI,UAAU;mBACnB,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,KAAK,CAAC,IAAI,CAAC,OAAO;;KAEhF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n defaultThemeProp,\n StyledCard,\n StyledIcon,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledExpandButton = styled(Button)(\n ({\n theme: {\n base: { animation }\n }\n }) => {\n const { rtl } = useDirection();\n return css`\n ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n &[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n &[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n\n &:hover,\n &:active {\n text-decoration: none;\n }\n `;\n }\n);\n\nStyledExpandButton.defaultProps = defaultThemeProp;\n\nexport const StyledAssignments = styled(Card)<{ openItem?: boolean }>(({ theme, openItem }) => {\n return openItem\n ? css`\n box-shadow: ${theme.base.shadow.low};\n `\n : null;\n});\n\nStyledAssignments.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled(CardContent)<{ openItem?: boolean }>(\n ({ theme, openItem }) => {\n return css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${openItem ? theme.base.spacing : '0'} calc(2 * ${theme.base.spacing});\n }\n `;\n }\n);\n\nStyledCardContent.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Assignments';
2
+ export type { AssignmentsProps } from './Assignments';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Assignments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Assignments';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Assignments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from './Assignments';\nexport type { AssignmentsProps } from './Assignments';\n"]}
@@ -0,0 +1,27 @@
1
+ import type { FunctionComponent, Ref } from 'react';
2
+ import type { ForwardProps, BaseProps, TestIdProp, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import type { CaseViewProps } from '../CaseView';
4
+ import type { CaseViewContextValue } from '../CaseView/CaseView.types';
5
+ export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, TestIdProp, BaseProps {
6
+ /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */
7
+ caseLink?: CaseViewContextValue['caseLink'];
8
+ /** If true, the Case Preview will be visible. */
9
+ open: boolean;
10
+ /** Callback fired before Case Preview opens. */
11
+ onBeforeOpen?: () => void;
12
+ /** Callback fired after Case Preview opens. */
13
+ onAfterOpen?: () => void;
14
+ /** Callback fired before Case Preview closes. */
15
+ onBeforeClose?: () => void;
16
+ /** Callback fired after Case Preview closes. */
17
+ onAfterClose?: () => void;
18
+ /** Callback fired when a click action occurs outside of the Case Preview. */
19
+ onOuterClick?: () => void;
20
+ /** Reference to the wrapping element. */
21
+ ref?: Ref<HTMLDivElement>;
22
+ }
23
+ declare const _default: FunctionComponent<CasePreviewProps & ForwardProps> & {
24
+ getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["close"]>;
25
+ };
26
+ export default _default;
27
+ //# sourceMappingURL=CasePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAoBrE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AASnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMvE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,uBAAuB,CAC1B,EACD,cAAc,EACd,UAAU,EACV,SAAS;IACX,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;;;;AA0KD,wBAA+D"}
@@ -0,0 +1,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useCallback, useEffect, useContext } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { readableColor } from 'polished';
5
+ import { Drawer, Icon, registerIcon, Button, Flex, tryCatch, defaultThemeProp, useBreakpoint, useElement, useDirection, useI18n, AppShellContext, useTestIds, withTestIds } from '@pega/cosmos-react-core';
6
+ import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
7
+ import CaseView, { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledSummaryRegion } from '../CaseView';
8
+ import { getCasePreviewTestIds } from './CasePreview.test-ids';
9
+ registerIcon(timesIcon);
10
+ const StyledPreviewHeader = styled.div(({ theme }) => {
11
+ return css `
12
+ z-index: ${theme.base['z-index'].drawer};
13
+ background-color: ${theme.base.palette['primary-background']};
14
+ `;
15
+ });
16
+ StyledPreviewHeader.defaultProps = defaultThemeProp;
17
+ const StyledPreviewActions = styled.div(({ theme: { base: { spacing, palette: { 'brand-primary': brandPrimary } } } }) => {
18
+ const buttonColor = tryCatch(() => readableColor(brandPrimary));
19
+ return css `
20
+ background-color: ${brandPrimary};
21
+ padding: ${spacing} calc(2 * ${spacing}) 0;
22
+
23
+ button {
24
+ color: ${buttonColor};
25
+ }
26
+ `;
27
+ });
28
+ StyledPreviewActions.defaultProps = defaultThemeProp;
29
+ const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {
30
+ return css `
31
+ height: calc(100vh - var(--appshell-offset, 0rem));
32
+ top: var(--appshell-offset, 0);
33
+ z-index: calc(${theme.base['z-index'].drawer} + 500);
34
+
35
+ ${StyledCaseView} {
36
+ height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});
37
+
38
+ @media (pointer: coarse) {
39
+ height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});
40
+ }
41
+
42
+ ${StyledSummaryRegion} {
43
+ position: relative;
44
+ top: 0;
45
+ }
46
+ }
47
+
48
+ ${StyledCaseViewContent} {
49
+ overflow-y: auto;
50
+
51
+ & > :last-child {
52
+ padding-bottom: calc(2 * ${theme.base.spacing});
53
+ }
54
+ }
55
+ `;
56
+ });
57
+ StyledPreviewDrawer.defaultProps = defaultThemeProp;
58
+ const CasePreview = forwardRef(function CasePreview(props, ref) {
59
+ const { testId, open: openProp, caseId, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, ...restProps } = props;
60
+ const testIds = useTestIds(testId, getCasePreviewTestIds);
61
+ const t = useI18n();
62
+ const { previewTriggerRef } = useContext(AppShellContext);
63
+ const [closeButtonEl, setCloseButtonEl] = useElement();
64
+ const isSmallOrAbove = useBreakpoint('sm');
65
+ const [open, setOpen] = useState(openProp);
66
+ const direction = useDirection();
67
+ const closePreview = useCallback(() => {
68
+ setOpen(false);
69
+ previewTriggerRef.current?.focus();
70
+ }, []);
71
+ useEffect(() => {
72
+ setOpen(openProp);
73
+ }, [openProp]);
74
+ useEffect(() => {
75
+ if (openProp && closeButtonEl) {
76
+ closeButtonEl.focus();
77
+ }
78
+ }, [openProp, closeButtonEl]);
79
+ return (_jsxs(Drawer, { "data-testid": testIds.root, ...restProps, as: StyledPreviewDrawer, role: 'complementary', forwardedAs: Flex, container: { direction: 'column' }, ref: ref, open: open && isSmallOrAbove, position: 'fixed', placement: direction.end, "aria-label": t('preview_of_noun', [heading]), shadow: true, nullWhenClosed: true, children: [_jsx(StyledPreviewActions, { children: _jsx(Button, { "data-testid": testIds.close, variant: 'simple', icon: true, onClick: closePreview, ref: setCloseButtonEl, label: t('close_preview'), children: _jsx(Icon, { name: 'times' }) }) }), _jsx(CaseView, { caseId: caseId, parentCases: parentCases, heading: heading, subheading: subheading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, summaryFields: summaryFields, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners, onEdit: onEdit, isPreview: true })] }));
80
+ });
81
+ export default withTestIds(CasePreview, getCasePreviewTestIds);
82
+ //# sourceMappingURL=CasePreview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,MAAM,EAAE,EAAE,GAAG,E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AC,OAAO,GAAG,GACd,GACY,EAEvB,KAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,SACT,IACK,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useCallback, useEffect, useContext } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Drawer,\n Icon,\n registerIcon,\n Button,\n Flex,\n tryCatch,\n defaultThemeProp,\n useBreakpoint,\n useElement,\n useDirection,\n useI18n,\n AppShellContext,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, BaseProps, TestIdProp, NoChildrenProp } from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, {\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\nimport type { CaseViewProps } from '../CaseView';\nimport type { CaseViewContextValue } from '../CaseView/CaseView.types';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n >,\n NoChildrenProp,\n TestIdProp,\n BaseProps {\n /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */\n caseLink?: CaseViewContextValue['caseLink'];\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** Callback fired before Case Preview opens. */\n onBeforeOpen?: () => void;\n /** Callback fired after Case Preview opens. */\n onAfterOpen?: () => void;\n /** Callback fired before Case Preview closes. */\n onBeforeClose?: () => void;\n /** Callback fired after Case Preview closes. */\n onAfterClose?: () => void;\n /** Callback fired when a click action occurs outside of the Case Preview. */\n onOuterClick?: () => void;\n /** Reference to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledPreviewHeader = styled.div(({ theme }) => {\n return css`\n z-index: ${theme.base['z-index'].drawer};\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledPreviewHeader.defaultProps = defaultThemeProp;\n\nconst StyledPreviewActions = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'brand-primary': brandPrimary }\n }\n }\n }) => {\n const buttonColor = tryCatch(() => readableColor(brandPrimary));\n\n return css`\n background-color: ${brandPrimary};\n padding: ${spacing} calc(2 * ${spacing}) 0;\n\n button {\n color: ${buttonColor};\n }\n `;\n }\n);\n\nStyledPreviewActions.defaultProps = defaultThemeProp;\n\nconst StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {\n return css`\n height: calc(100vh - var(--appshell-offset, 0rem));\n top: var(--appshell-offset, 0);\n z-index: calc(${theme.base['z-index'].drawer} + 500);\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n\n @media (pointer: coarse) {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});\n }\n\n ${StyledSummaryRegion} {\n position: relative;\n top: 0;\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledPreviewDrawer.defaultProps = defaultThemeProp;\n\nconst CasePreview: FunctionComponent<CasePreviewProps & ForwardProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const t = useI18n();\n const { previewTriggerRef } = useContext(AppShellContext);\n const [closeButtonEl, setCloseButtonEl] = useElement<HTMLButtonElement>();\n const isSmallOrAbove = useBreakpoint('sm');\n const [open, setOpen] = useState(openProp);\n const direction = useDirection();\n\n const closePreview = useCallback(() => {\n setOpen(false);\n previewTriggerRef.current?.focus();\n }, []);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (openProp && closeButtonEl) {\n closeButtonEl.focus();\n }\n }, [openProp, closeButtonEl]);\n\n return (\n <Drawer\n data-testid={testIds.root}\n {...restProps}\n as={StyledPreviewDrawer}\n role='complementary'\n forwardedAs={Flex}\n container={{ direction: 'column' }}\n ref={ref}\n open={open && isSmallOrAbove}\n position='fixed'\n placement={direction.end}\n aria-label={t('preview_of_noun', [heading])}\n shadow\n nullWhenClosed\n >\n <StyledPreviewActions>\n <Button\n data-testid={testIds.close}\n variant='simple'\n icon\n onClick={closePreview}\n ref={setCloseButtonEl}\n label={t('close_preview')}\n >\n <Icon name='times' />\n </Button>\n </StyledPreviewActions>\n\n <CaseView\n caseId={caseId}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summaryFields={summaryFields}\n tabs={tabs}\n stages={stages}\n tasks={tasks}\n tabContent={tabContent}\n utilities={utilities}\n utilitiesSummaryItems={utilitiesSummaryItems}\n actions={actions}\n banners={banners}\n onEdit={onEdit}\n isPreview\n />\n </Drawer>\n );\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getCasePreviewTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["close"]>;
2
+ //# sourceMappingURL=CasePreview.test-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CasePreview.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,0GAAoD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { createTestIds } from '@pega/cosmos-react-core';
2
+ export const getCasePreviewTestIds = createTestIds('case-preview', ['close']);
3
+ //# sourceMappingURL=CasePreview.test-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CasePreview.test-ids.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,cAAc,EAAE,CAAC,OAAO,CAAU,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getCasePreviewTestIds = createTestIds('case-preview', ['close'] as const);\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './CasePreview';
2
+ export type { CasePreviewProps } from './CasePreview';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './CasePreview';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CasePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from './CasePreview';\nexport type { CasePreviewProps } from './CasePreview';\n"]}
@@ -0,0 +1,4 @@
1
+ import type { FC } from 'react';
2
+ declare const CaseHeader: FC;
3
+ export default CaseHeader;
4
+ //# sourceMappingURL=CaseHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAsC5C,QAAA,MAAM,UAAU,EAAE,EAuRjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,127 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
3
+ import { parseToHsl } from 'polished';
4
+ import { Breadcrumbs, Flex, getEdge, Icon, registerIcon, Text, Link, Button, MenuButton, throttle, useDirection, useI18n, useAfterInitialEffect, useTheme, tryCatch } from '@pega/cosmos-react-core';
5
+ import * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';
6
+ import * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';
7
+ import { StyledCaseHeader, StyledCaseHeaderText, StyledExpandCollapseSummaryButton, StyledSubheading, StyledHeaderActions, StyledCaseHeaderPromotedAction } from '../CaseView.styles';
8
+ import { useCaseViewContext } from '../CaseView.context';
9
+ import Summary from './Summary';
10
+ registerIcon(pencilIcon, moreIcon);
11
+ const CaseHeader = () => {
12
+ const t = useI18n();
13
+ const { ltr } = useDirection();
14
+ const theme = useTheme();
15
+ const { testIds, caseId, icon, heading, subheading, actions, caseLink, parentCases, onEdit, followed, onFollowedChange, promotedActions, summaryExpanded, summaryFields, onToggleSummary, isPreview, aboveSM, aboveMD, persistentUtility } = useCaseViewContext();
16
+ const [wrapPromotedActions, setWrapPromotedActions] = useState(false);
17
+ const [summaryResetID, setSummaryResetID] = useState(Math.random());
18
+ const wrapActionsBreakpoint = useRef(null);
19
+ const iconBackground = useMemo(() => {
20
+ return tryCatch(() => {
21
+ const { lightness } = parseToHsl(theme.base.palette['brand-primary']);
22
+ return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';
23
+ });
24
+ }, [theme]);
25
+ const contentsEl = useRef(null);
26
+ const headerGroupEl = useRef(null);
27
+ const actionsContainerEl = useRef(null);
28
+ const toggleButtonRef = useRef(null);
29
+ const caseActions = actions
30
+ ? actions.map(action => {
31
+ return {
32
+ ...action,
33
+ primary: action.text,
34
+ visual: action.icon ? _jsx(Icon, { name: action.icon }) : null
35
+ };
36
+ })
37
+ : undefined;
38
+ const showExpandCollapse = !isPreview && aboveMD;
39
+ const collapsedMainHeader = (!isPreview && !aboveMD && aboveSM) || (showExpandCollapse && !summaryExpanded);
40
+ // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.
41
+ useAfterInitialEffect(() => {
42
+ if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {
43
+ toggleButtonRef.current.blur();
44
+ setTimeout(() => {
45
+ toggleButtonRef.current?.focus();
46
+ }, 0);
47
+ }
48
+ }, [summaryExpanded]);
49
+ // Actions wrapping
50
+ useLayoutEffect(() => {
51
+ if (!wrapPromotedActions &&
52
+ contentsEl.current &&
53
+ headerGroupEl.current &&
54
+ actionsContainerEl.current) {
55
+ const contentStart = getEdge({
56
+ el: contentsEl.current,
57
+ side: 'leading',
58
+ ltr
59
+ });
60
+ const headerGroupEnd = getEdge({
61
+ el: headerGroupEl.current,
62
+ side: 'trailing',
63
+ ltr
64
+ });
65
+ const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;
66
+ wrapActionsBreakpoint.current =
67
+ Math.ceil(headerGroupEnd) - Math.ceil(contentStart) + Math.ceil(actionsContainerWidth);
68
+ }
69
+ const promotedActionsWrapHandler = () => {
70
+ if (wrapActionsBreakpoint.current && contentsEl.current) {
71
+ setWrapPromotedActions(Math.ceil(contentsEl.current.offsetWidth) < wrapActionsBreakpoint.current);
72
+ }
73
+ };
74
+ const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));
75
+ promotedActionsWrapHandler();
76
+ if (contentsEl.current) {
77
+ resizeObserver.observe(contentsEl.current, { box: 'border-box' });
78
+ }
79
+ return () => {
80
+ resizeObserver.disconnect();
81
+ };
82
+ }, [
83
+ contentsEl,
84
+ headerGroupEl,
85
+ actionsContainerEl,
86
+ promotedActions,
87
+ heading,
88
+ subheading,
89
+ wrapPromotedActions
90
+ ]);
91
+ // Reset summary
92
+ useEffect(() => {
93
+ setSummaryResetID(Math.random());
94
+ }, [heading, summaryFields, promotedActions]);
95
+ return (_jsxs(Flex, { "data-testid": testIds.header, as: StyledCaseHeader, container: { direction: 'column', gap: 1.5 }, children: [_jsxs(Flex, { container: true, ref: contentsEl, children: [showExpandCollapse && onToggleSummary && !persistentUtility && (_jsx(StyledExpandCollapseSummaryButton, { ref: toggleButtonRef, onClick: onToggleSummary, label: t(summaryExpanded ? 'collapse' : 'expand'), "aria-label": t(summaryExpanded ? 'collapse_summary' : 'expand_summary'), icon: true, compact: true, children: _jsx(Icon, { name: 'arrow-micro-left' }) })), icon && (_jsx(Flex, { container: { pad: [1, 0, 0] }, item: { shrink: 0 }, children: _jsx(Icon, { "data-testid": testIds.icon, name: icon, background: iconBackground }) })), _jsxs(Flex, { as: StyledCaseHeaderText, container: {
96
+ direction: 'column',
97
+ pad: [0.5, 2, 0.5, 1.5],
98
+ alignItems: 'start'
99
+ }, item: aboveSM ? { shrink: wrapPromotedActions ? 1 : 0 } : { shrink: 1, grow: 1 }, ref: headerGroupEl, children: [_jsx(Text, { "data-testid": testIds.heading, variant: 'h1', children: caseLink ? _jsx(Link, { ...caseLink, children: heading }) : heading }), subheading && (!parentCases || subheading !== caseId) && (_jsx(StyledSubheading, { "data-testid": testIds.subheading, children: subheading })), parentCases && (_jsx(Breadcrumbs, { forwardedAs: 'p', path: [
100
+ ...parentCases,
101
+ {
102
+ ...caseLink,
103
+ id: caseId,
104
+ primary: caseId,
105
+ href: caseLink?.href
106
+ }
107
+ ], leafOnly: true }))] }), collapsedMainHeader && !wrapPromotedActions && (_jsx(Summary, { siblingRef: actionsContainerEl }, summaryResetID)), _jsxs(Flex, { as: StyledHeaderActions, item: { shrink: 0 }, container: { alignItems: 'start', pad: [0, 0, 0, 2] }, offsetEnd: !summaryExpanded, ref: actionsContainerEl, children: [collapsedMainHeader &&
108
+ !wrapPromotedActions &&
109
+ promotedActions &&
110
+ promotedActions.length > 0 ? (_jsx(_Fragment, { children: promotedActions.map(promotedAction => (_jsx(StyledCaseHeaderPromotedAction, { variant: 'secondary', onClick: (e) => promotedAction.onClick?.(promotedAction.id, e), children: promotedAction.text }, promotedAction.id))) })) : null, onEdit && (_jsx(Button, { "data-testid": testIds.edit, icon: true, variant: 'simple', onClick: onEdit, label: t('edit'), children: _jsx(Icon, { name: 'pencil' }) })), caseActions && (_jsx(MenuButton, { "data-testid": testIds.actions, icon: 'more', iconOnly: true, variant: 'simple', text: t('actions'), menu: {
111
+ items: followed !== undefined
112
+ ? [
113
+ {
114
+ id: 'follow',
115
+ primary: followed ? t('unfollow') : t('follow'),
116
+ onClick: () => onFollowedChange?.(!followed)
117
+ },
118
+ ...caseActions
119
+ ]
120
+ : caseActions,
121
+ scrollAt: 20
122
+ } }))] })] }), (!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&
123
+ promotedActions &&
124
+ promotedActions.length > 0 ? (_jsx(Flex, { "data-testid": testIds.promotedActions, container: { justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }, children: promotedActions.map(({ id, text, onClick }) => (_jsx("div", { children: _jsx(StyledCaseHeaderPromotedAction, { variant: 'secondary', onClick: (e) => onClick?.(id, e), children: text }) }, text))) })) : null] }));
125
+ };
126
+ export default CaseHeader;
127
+ //# sourceMappingURL=CaseHeader.js.map