@pega/cosmos-react-work 5.0.0-dev.4.8 → 5.0.0-dev.5.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 (333) 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/ArticleList.d.ts +6 -0
  30. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
  31. package/lib/components/ArticleList/ArticleList.js +132 -0
  32. package/lib/components/ArticleList/ArticleList.js.map +1 -0
  33. package/lib/components/ArticleList/ArticleList.types.d.ts +92 -0
  34. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
  35. package/lib/components/ArticleList/ArticleList.types.js +2 -0
  36. package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
  37. package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
  38. package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
  39. package/lib/components/ArticleList/ArticleListFilter.js +67 -0
  40. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
  41. package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
  42. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
  43. package/lib/components/ArticleList/ArticleListHeader.js +20 -0
  44. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
  45. package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
  46. package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
  47. package/lib/components/ArticleList/ArticleSummary.js +63 -0
  48. package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
  49. package/lib/components/ArticleList/index.d.ts +6 -0
  50. package/lib/components/ArticleList/index.d.ts.map +1 -0
  51. package/lib/components/ArticleList/index.js +4 -0
  52. package/lib/components/ArticleList/index.js.map +1 -0
  53. package/lib/components/Assignments/Assignments.d.ts +21 -0
  54. package/lib/components/Assignments/Assignments.d.ts.map +1 -0
  55. package/lib/components/Assignments/Assignments.js +20 -0
  56. package/lib/components/Assignments/Assignments.js.map +1 -0
  57. package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
  58. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
  59. package/lib/components/Assignments/Assignments.styles.js +41 -0
  60. package/lib/components/Assignments/Assignments.styles.js.map +1 -0
  61. package/lib/components/Assignments/index.d.ts +2 -0
  62. package/lib/components/Assignments/index.d.ts.map +1 -0
  63. package/lib/components/Assignments/index.js +2 -0
  64. package/lib/components/Assignments/index.js.map +1 -0
  65. package/lib/components/CasePreview/CasePreview.d.ts +27 -0
  66. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -0
  67. package/lib/components/CasePreview/CasePreview.js +82 -0
  68. package/lib/components/CasePreview/CasePreview.js.map +1 -0
  69. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  70. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  71. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  72. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  73. package/lib/components/CasePreview/index.d.ts +3 -0
  74. package/lib/components/CasePreview/index.d.ts.map +1 -0
  75. package/lib/components/CasePreview/index.js +2 -0
  76. package/lib/components/CasePreview/index.js.map +1 -0
  77. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts +4 -0
  78. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
  79. package/lib/components/CaseView/CaseHeader/CaseHeader.js +127 -0
  80. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
  81. package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
  82. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
  83. package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
  84. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
  85. package/lib/components/CaseView/CaseSummary.d.ts +4 -0
  86. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -0
  87. package/lib/components/CaseView/CaseSummary.js +18 -0
  88. package/lib/components/CaseView/CaseSummary.js.map +1 -0
  89. package/lib/components/CaseView/CaseSummaryFields.d.ts +6 -0
  90. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -0
  91. package/lib/components/CaseView/CaseSummaryFields.js +18 -0
  92. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -0
  93. package/lib/components/CaseView/CaseView.context.d.ts +5 -0
  94. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -0
  95. package/lib/components/CaseView/CaseView.context.js +5 -0
  96. package/lib/components/CaseView/CaseView.context.js.map +1 -0
  97. package/lib/components/CaseView/CaseView.d.ts +8 -0
  98. package/lib/components/CaseView/CaseView.d.ts.map +1 -0
  99. package/lib/components/CaseView/CaseView.js +421 -0
  100. package/lib/components/CaseView/CaseView.js.map +1 -0
  101. package/lib/components/CaseView/CaseView.styles.d.ts +45 -0
  102. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  103. package/lib/components/CaseView/CaseView.styles.js +559 -0
  104. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  105. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  106. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  107. package/lib/components/CaseView/CaseView.test-ids.js +18 -0
  108. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  109. package/lib/components/CaseView/CaseView.types.d.ts +98 -0
  110. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -0
  111. package/lib/components/CaseView/CaseView.types.js +2 -0
  112. package/lib/components/CaseView/CaseView.types.js.map +1 -0
  113. package/lib/components/CaseView/UtilitiesSummary.d.ts +9 -0
  114. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -0
  115. package/lib/components/CaseView/UtilitiesSummary.js +53 -0
  116. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -0
  117. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +9 -0
  118. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -0
  119. package/lib/components/CaseView/UtilitySummaryItemDialog.js +29 -0
  120. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -0
  121. package/lib/components/CaseView/index.d.ts +5 -0
  122. package/lib/components/CaseView/index.d.ts.map +1 -0
  123. package/lib/components/CaseView/index.js +4 -0
  124. package/lib/components/CaseView/index.js.map +1 -0
  125. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  126. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  127. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +86 -0
  128. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  129. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +41 -0
  130. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  131. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  132. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  133. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  134. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  135. package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
  136. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  137. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  138. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  139. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  140. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  141. package/lib/components/ConfigurableLayout/index.d.ts +4 -0
  142. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  143. package/lib/components/ConfigurableLayout/index.js +3 -0
  144. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  145. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  146. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  147. package/lib/components/ConfigurableLayout/options.js +10 -0
  148. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  149. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
  150. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
  151. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
  152. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
  153. package/lib/components/Confirmation/Confirmation.d.ts +19 -0
  154. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
  155. package/lib/components/Confirmation/Confirmation.js +29 -0
  156. package/lib/components/Confirmation/Confirmation.js.map +1 -0
  157. package/lib/components/Confirmation/index.d.ts +3 -0
  158. package/lib/components/Confirmation/index.d.ts.map +1 -0
  159. package/lib/components/Confirmation/index.js +2 -0
  160. package/lib/components/Confirmation/index.js.map +1 -0
  161. package/lib/components/Details/Details.d.ts +43 -0
  162. package/lib/components/Details/Details.d.ts.map +1 -0
  163. package/lib/components/Details/Details.js +95 -0
  164. package/lib/components/Details/Details.js.map +1 -0
  165. package/lib/components/Details/Details.styles.d.ts +50 -0
  166. package/lib/components/Details/Details.styles.d.ts.map +1 -0
  167. package/lib/components/Details/Details.styles.js +204 -0
  168. package/lib/components/Details/Details.styles.js.map +1 -0
  169. package/lib/components/Details/Details.test-ids.d.ts +2 -0
  170. package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
  171. package/lib/components/Details/Details.test-ids.js +9 -0
  172. package/lib/components/Details/Details.test-ids.js.map +1 -0
  173. package/lib/components/Details/DetailsContext.d.ts +9 -0
  174. package/lib/components/Details/DetailsContext.d.ts.map +1 -0
  175. package/lib/components/Details/DetailsContext.js +9 -0
  176. package/lib/components/Details/DetailsContext.js.map +1 -0
  177. package/lib/components/Details/index.d.ts +4 -0
  178. package/lib/components/Details/index.d.ts.map +1 -0
  179. package/lib/components/Details/index.js +4 -0
  180. package/lib/components/Details/index.js.map +1 -0
  181. package/lib/components/Glimpse/Glimpse.d.ts +20 -0
  182. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -0
  183. package/lib/components/Glimpse/Glimpse.js +12 -0
  184. package/lib/components/Glimpse/Glimpse.js.map +1 -0
  185. package/lib/components/Glimpse/index.d.ts +3 -0
  186. package/lib/components/Glimpse/index.d.ts.map +1 -0
  187. package/lib/components/Glimpse/index.js +2 -0
  188. package/lib/components/Glimpse/index.js.map +1 -0
  189. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
  190. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
  191. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +83 -0
  192. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
  193. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -0
  194. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +199 -0
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +35 -0
  198. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
  199. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
  200. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
  201. package/lib/components/IntelligentGuidance/index.d.ts +3 -0
  202. package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
  203. package/lib/components/IntelligentGuidance/index.js +2 -0
  204. package/lib/components/IntelligentGuidance/index.js.map +1 -0
  205. package/lib/components/Predictions/Predictions.d.ts +6 -0
  206. package/lib/components/Predictions/Predictions.d.ts.map +1 -0
  207. package/lib/components/Predictions/Predictions.js +68 -0
  208. package/lib/components/Predictions/Predictions.js.map +1 -0
  209. package/lib/components/Predictions/Predictions.types.d.ts +23 -0
  210. package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
  211. package/lib/components/Predictions/Predictions.types.js +2 -0
  212. package/lib/components/Predictions/Predictions.types.js.map +1 -0
  213. package/lib/components/Predictions/index.d.ts +3 -0
  214. package/lib/components/Predictions/index.d.ts.map +1 -0
  215. package/lib/components/Predictions/index.js +2 -0
  216. package/lib/components/Predictions/index.js.map +1 -0
  217. package/lib/components/SearchResults/Filter.d.ts +8 -0
  218. package/lib/components/SearchResults/Filter.d.ts.map +1 -0
  219. package/lib/components/SearchResults/Filter.js +45 -0
  220. package/lib/components/SearchResults/Filter.js.map +1 -0
  221. package/lib/components/SearchResults/SearchResult.d.ts +4 -0
  222. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -0
  223. package/lib/components/SearchResults/SearchResult.js +27 -0
  224. package/lib/components/SearchResults/SearchResult.js.map +1 -0
  225. package/lib/components/SearchResults/SearchResults.d.ts +6 -0
  226. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -0
  227. package/lib/components/SearchResults/SearchResults.js +121 -0
  228. package/lib/components/SearchResults/SearchResults.js.map +1 -0
  229. package/lib/components/SearchResults/SearchResults.styles.d.ts +11 -0
  230. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
  231. package/lib/components/SearchResults/SearchResults.styles.js +88 -0
  232. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
  233. package/lib/components/SearchResults/SearchResults.types.d.ts +100 -0
  234. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -0
  235. package/lib/components/SearchResults/SearchResults.types.js +2 -0
  236. package/lib/components/SearchResults/SearchResults.types.js.map +1 -0
  237. package/lib/components/SearchResults/index.d.ts +3 -0
  238. package/lib/components/SearchResults/index.d.ts.map +1 -0
  239. package/lib/components/SearchResults/index.js +2 -0
  240. package/lib/components/SearchResults/index.js.map +1 -0
  241. package/lib/components/Stages/StageGlimpse.d.ts +8 -0
  242. package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
  243. package/lib/components/Stages/StageGlimpse.js +11 -0
  244. package/lib/components/Stages/StageGlimpse.js.map +1 -0
  245. package/lib/components/Stages/Stages.d.ts +6 -0
  246. package/lib/components/Stages/Stages.d.ts.map +1 -0
  247. package/lib/components/Stages/Stages.js +107 -0
  248. package/lib/components/Stages/Stages.js.map +1 -0
  249. package/lib/components/Stages/Stages.styles.d.ts +14 -0
  250. package/lib/components/Stages/Stages.styles.d.ts.map +1 -0
  251. package/lib/components/Stages/Stages.styles.js +270 -0
  252. package/lib/components/Stages/Stages.styles.js.map +1 -0
  253. package/lib/components/Stages/Stages.types.d.ts +38 -0
  254. package/lib/components/Stages/Stages.types.d.ts.map +1 -0
  255. package/lib/components/Stages/Stages.types.js +2 -0
  256. package/lib/components/Stages/Stages.types.js.map +1 -0
  257. package/lib/components/Stages/index.d.ts +3 -0
  258. package/lib/components/Stages/index.d.ts.map +1 -0
  259. package/lib/components/Stages/index.js +2 -0
  260. package/lib/components/Stages/index.js.map +1 -0
  261. package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
  262. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  263. package/lib/components/Stakeholders/StakeholderForm.js +49 -0
  264. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  265. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  266. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  267. package/lib/components/Stakeholders/Stakeholders.js +220 -0
  268. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  269. package/lib/components/Stakeholders/Stakeholders.types.d.ts +75 -0
  270. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  271. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  272. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  273. package/lib/components/Stakeholders/index.d.ts +3 -0
  274. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  275. package/lib/components/Stakeholders/index.js +2 -0
  276. package/lib/components/Stakeholders/index.js.map +1 -0
  277. package/lib/components/Tags/Tags.d.ts +34 -0
  278. package/lib/components/Tags/Tags.d.ts.map +1 -0
  279. package/lib/components/Tags/Tags.js +230 -0
  280. package/lib/components/Tags/Tags.js.map +1 -0
  281. package/lib/components/Tags/index.d.ts +3 -0
  282. package/lib/components/Tags/index.d.ts.map +1 -0
  283. package/lib/components/Tags/index.js +2 -0
  284. package/lib/components/Tags/index.js.map +1 -0
  285. package/lib/components/Tasks/TaskList.d.ts +39 -0
  286. package/lib/components/Tasks/TaskList.d.ts.map +1 -0
  287. package/lib/components/Tasks/TaskList.js +71 -0
  288. package/lib/components/Tasks/TaskList.js.map +1 -0
  289. package/lib/components/Tasks/Tasks.d.ts +29 -0
  290. package/lib/components/Tasks/Tasks.d.ts.map +1 -0
  291. package/lib/components/Tasks/Tasks.js +52 -0
  292. package/lib/components/Tasks/Tasks.js.map +1 -0
  293. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  294. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  295. package/lib/components/Tasks/Tasks.test-ids.js +5 -0
  296. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  297. package/lib/components/Tasks/index.d.ts +4 -0
  298. package/lib/components/Tasks/index.d.ts.map +1 -0
  299. package/lib/components/Tasks/index.js +4 -0
  300. package/lib/components/Tasks/index.js.map +1 -0
  301. package/lib/components/Timeline/Timeline.d.ts +6 -0
  302. package/lib/components/Timeline/Timeline.d.ts.map +1 -0
  303. package/lib/components/Timeline/Timeline.js +26 -0
  304. package/lib/components/Timeline/Timeline.js.map +1 -0
  305. package/lib/components/Timeline/Timeline.styles.d.ts +21 -0
  306. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -0
  307. package/lib/components/Timeline/Timeline.styles.js +165 -0
  308. package/lib/components/Timeline/Timeline.styles.js.map +1 -0
  309. package/lib/components/Timeline/Timeline.types.d.ts +66 -0
  310. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -0
  311. package/lib/components/Timeline/Timeline.types.js +2 -0
  312. package/lib/components/Timeline/Timeline.types.js.map +1 -0
  313. package/lib/components/Timeline/TimelineItem.d.ts +13 -0
  314. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
  315. package/lib/components/Timeline/TimelineItem.js +33 -0
  316. package/lib/components/Timeline/TimelineItem.js.map +1 -0
  317. package/lib/components/Timeline/TimelineToolbar.d.ts +6 -0
  318. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -0
  319. package/lib/components/Timeline/TimelineToolbar.js +68 -0
  320. package/lib/components/Timeline/TimelineToolbar.js.map +1 -0
  321. package/lib/components/Timeline/index.d.ts +4 -0
  322. package/lib/components/Timeline/index.d.ts.map +1 -0
  323. package/lib/components/Timeline/index.js +3 -0
  324. package/lib/components/Timeline/index.js.map +1 -0
  325. package/lib/components/Timeline/utils.d.ts +15 -0
  326. package/lib/components/Timeline/utils.d.ts.map +1 -0
  327. package/lib/components/Timeline/utils.js +75 -0
  328. package/lib/components/Timeline/utils.js.map +1 -0
  329. package/lib/index.d.ts +37 -0
  330. package/lib/index.d.ts.map +1 -0
  331. package/lib/index.js +38 -0
  332. package/lib/index.js.map +1 -0
  333. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assignments.js","sourceRoot":"","sources":["../../../src/components/Assignments/Assignments.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,UAAU,EACV,OAAO,EAGP,UAAU,EACV,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACP,MAAM,yBAAyB,CAAC;AAEjC,OAAO,QAAQ,EAAE,EAAE,QAAQ,EAAiB,MAAM,mBAAmB,CAAC;AAEtE,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,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AS,KAAK,SAAS,IAAI,MAAM,IACvB,CACd,EAEA,OAAO,SAAS,KAAK,SAAS,IAAI,iBAAiB,IAAI,CAAC,QAAQ,CAAC,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 { FC, useMemo } from 'react';\n\nimport {\n CardHeader,\n useI18n,\n ForwardProps,\n NoChildrenProp,\n EmptyState,\n ExpandCollapse,\n Icon,\n Text,\n Count,\n Flex,\n useUID\n} from '@pega/cosmos-react-core';\n\nimport TaskList, { TaskItem, 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,2 @@
1
+ export { default, type AssignmentsProps } from './Assignments';
2
+ //# 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,KAAK,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,EAAyB,MAAM,eAAe,CAAC","sourcesContent":["export { default, type AssignmentsProps } from './Assignments';\n"]}
@@ -0,0 +1,27 @@
1
+ import { FunctionComponent, Ref } from 'react';
2
+ import { ForwardProps, BaseProps, TestIdProp, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import { CaseViewProps } from '../CaseView';
4
+ import { 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":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAKJ,MAAM,OAAO,CAAC;AAIf,OAAO,EAQL,YAAY,EAMZ,SAAS,EACT,UAAU,EACV,cAAc,EAGf,MAAM,yBAAyB,CAAC;AAGjC,OAAiB,EACf,aAAa,EAKd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,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,EACL,UAAU,EAIV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa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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 {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useContext\n} 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 ForwardProps,\n useBreakpoint,\n useElement,\n useDirection,\n useI18n,\n AppShellContext,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\nimport { 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 { 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":"AAAA,OAAO,EAAE,EAAE,EAAqE,MAAM,OAAO,CAAC;AAsC9F,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EAEJ,MAAM,EACN,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iCAAiC,EACjC,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEnC,MAAM,UAAU,GAAO,GAAG,EAAE;IAC1B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;I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,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC9C,wBACE,KAAC,8BAA8B,IAC7B,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,YAE9D,IAAI,GAC0B,IANzB,IAAI,CAOR,CACP,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, MouseEvent, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { parseToHsl } from 'polished';\n\nimport {\n Breadcrumbs,\n Flex,\n getEdge,\n Icon,\n registerIcon,\n Text,\n Link,\n MenuItemProps,\n Button,\n MenuButton,\n throttle,\n useDirection,\n useI18n,\n useAfterInitialEffect,\n useTheme,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseHeaderText,\n StyledExpandCollapseSummaryButton,\n StyledSubheading,\n StyledHeaderActions,\n StyledCaseHeaderPromotedAction\n} from '../CaseView.styles';\nimport { useCaseViewContext } from '../CaseView.context';\n\nimport Summary from './Summary';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n const { ltr } = useDirection();\n const theme = useTheme();\n\n const {\n testIds,\n caseId,\n icon,\n heading,\n subheading,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryExpanded,\n summaryFields,\n onToggleSummary,\n isPreview,\n aboveSM,\n aboveMD,\n persistentUtility\n } = useCaseViewContext();\n\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const [summaryResetID, setSummaryResetID] = useState<number | undefined>(Math.random());\n\n const wrapActionsBreakpoint = useRef<number | null>(null);\n\n const iconBackground = useMemo(() => {\n return tryCatch(() => {\n const { lightness } = parseToHsl(theme.base.palette['brand-primary']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n });\n }, [theme]);\n\n const contentsEl = useRef<HTMLDivElement>(null);\n const headerGroupEl = useRef<HTMLElement>(null);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n const caseActions: MenuItemProps[] | undefined = actions\n ? actions.map(action => {\n return {\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n })\n : undefined;\n const showExpandCollapse = !isPreview && aboveMD;\n const collapsedMainHeader =\n (!isPreview && !aboveMD && aboveSM) || (showExpandCollapse && !summaryExpanded);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n // Actions wrapping\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentsEl.current &&\n headerGroupEl.current &&\n actionsContainerEl.current\n ) {\n const contentStart = getEdge({\n el: contentsEl.current,\n side: 'leading',\n ltr\n });\n const headerGroupEnd = getEdge({\n el: headerGroupEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.ceil(headerGroupEnd) - Math.ceil(contentStart) + Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentsEl.current) {\n setWrapPromotedActions(\n Math.ceil(contentsEl.current.offsetWidth) < wrapActionsBreakpoint.current\n );\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n\n promotedActionsWrapHandler();\n\n if (contentsEl.current) {\n resizeObserver.observe(contentsEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n contentsEl,\n headerGroupEl,\n actionsContainerEl,\n promotedActions,\n heading,\n subheading,\n wrapPromotedActions\n ]);\n\n // Reset summary\n useEffect(() => {\n setSummaryResetID(Math.random());\n }, [heading, summaryFields, promotedActions]);\n\n return (\n <Flex\n data-testid={testIds.header}\n as={StyledCaseHeader}\n container={{ direction: 'column', gap: 1.5 }}\n >\n <Flex container ref={contentsEl}>\n {showExpandCollapse && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseSummaryButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse' : 'expand')}\n aria-label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseSummaryButton>\n )}\n\n {icon && (\n <Flex container={{ pad: [1, 0, 0] }} item={{ shrink: 0 }}>\n <Icon data-testid={testIds.icon} name={icon} background={iconBackground} />\n </Flex>\n )}\n\n {/* header group */}\n <Flex\n as={StyledCaseHeaderText}\n container={{\n direction: 'column',\n pad: [0.5, 2, 0.5, 1.5],\n alignItems: 'start'\n }}\n item={aboveSM ? { shrink: wrapPromotedActions ? 1 : 0 } : { shrink: 1, grow: 1 }}\n ref={headerGroupEl}\n >\n <Text data-testid={testIds.heading} variant='h1'>\n {caseLink ? <Link {...caseLink}>{heading}</Link> : heading}\n </Text>\n\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading data-testid={testIds.subheading}>{subheading}</StyledSubheading>\n )}\n\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n {\n ...caseLink,\n id: caseId,\n primary: caseId,\n href: caseLink?.href\n }\n ]}\n leafOnly\n />\n )}\n </Flex>\n\n {/* summary */}\n {collapsedMainHeader && !wrapPromotedActions && (\n <Summary siblingRef={actionsContainerEl} key={summaryResetID} />\n )}\n\n {/* inline actions */}\n <Flex\n as={StyledHeaderActions}\n item={{ shrink: 0 }}\n container={{ alignItems: 'start', pad: [0, 0, 0, 2] }}\n offsetEnd={!summaryExpanded}\n ref={actionsContainerEl}\n >\n {collapsedMainHeader &&\n !wrapPromotedActions &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <>\n {promotedActions.map(promotedAction => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n key={promotedAction.id}\n >\n {promotedAction.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </>\n ) : null}\n\n {onEdit && (\n <Button\n data-testid={testIds.edit}\n icon\n variant='simple'\n onClick={onEdit}\n label={t('edit')}\n >\n <Icon name='pencil' />\n </Button>\n )}\n\n {caseActions && (\n <MenuButton\n data-testid={testIds.actions}\n icon='more'\n iconOnly\n variant='simple'\n text={t('actions')}\n menu={{\n items:\n followed !== undefined\n ? [\n {\n id: 'follow',\n primary: followed ? t('unfollow') : t('follow'),\n onClick: () => onFollowedChange?.(!followed)\n },\n ...caseActions\n ]\n : caseActions,\n scrollAt: 20\n }}\n />\n )}\n </Flex>\n </Flex>\n\n {/* wrapped promoted actions */}\n {(!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <Flex\n data-testid={testIds.promotedActions}\n container={{ justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }}\n >\n {promotedActions.map(({ id, text, onClick }) => (\n <div key={text}>\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick?.(id, e)}\n >\n {text}\n </StyledCaseHeaderPromotedAction>\n </div>\n ))}\n </Flex>\n ) : null}\n </Flex>\n );\n};\n\nexport default CaseHeader;\n"]}
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+ declare const Summary: ({ siblingRef }: {
3
+ siblingRef: RefObject<HTMLDivElement>;
4
+ }) => JSX.Element;
5
+ export default Summary;
6
+ //# sourceMappingURL=Summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/Summary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAgD/D,QAAA,MAAM,OAAO;gBAAkC,UAAU,cAAc,CAAC;iBAkQvE,CAAC;AAEF,eAAe,OAAO,CAAC"}