@pega/cosmos-react-work 9.0.0-build.9.9 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +2 -1
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +36 -21
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/Article/ArticleRating.d.ts +1 -1
  6. package/lib/components/Article/ArticleRating.d.ts.map +1 -1
  7. package/lib/components/ArticleList/AIArticleSummary.d.ts +3 -1
  8. package/lib/components/ArticleList/AIArticleSummary.d.ts.map +1 -1
  9. package/lib/components/ArticleList/ArticleBuddy.d.ts +1 -1
  10. package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -1
  11. package/lib/components/ArticleList/ArticleBuddy.js +5 -1
  12. package/lib/components/ArticleList/ArticleBuddy.js.map +1 -1
  13. package/lib/components/ArticleList/ArticleBuddyList.d.ts +1 -1
  14. package/lib/components/ArticleList/ArticleBuddyList.d.ts.map +1 -1
  15. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts +189 -3
  16. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts.map +1 -1
  17. package/lib/components/ArticleList/ArticleBuddyResponse.js +1 -1
  18. package/lib/components/ArticleList/ArticleBuddyResponse.js.map +1 -1
  19. package/lib/components/ArticleList/ArticleFeedback.d.ts +3 -1
  20. package/lib/components/ArticleList/ArticleFeedback.d.ts.map +1 -1
  21. package/lib/components/ArticleList/ArticleList.d.ts +2 -2
  22. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -1
  23. package/lib/components/ArticleList/ArticleList.js +6 -0
  24. package/lib/components/ArticleList/ArticleList.js.map +1 -1
  25. package/lib/components/ArticleList/ArticleList.types.d.ts +17 -2
  26. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
  27. package/lib/components/ArticleList/ArticleList.types.js.map +1 -1
  28. package/lib/components/ArticleList/ArticleListHeader.d.ts +183 -1
  29. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -1
  30. package/lib/components/ArticleList/ArticleSummary.styles.d.ts +2 -2
  31. package/lib/components/ArticleList/ArticleSummary.styles.d.ts.map +1 -1
  32. package/lib/components/ArticleList/ArticleSummaryHeader.d.ts.map +1 -1
  33. package/lib/components/ArticleList/ArticleSummaryHeader.js +3 -1
  34. package/lib/components/ArticleList/ArticleSummaryHeader.js.map +1 -1
  35. package/lib/components/ArticleList/QuestionList.d.ts +5 -3
  36. package/lib/components/ArticleList/QuestionList.d.ts.map +1 -1
  37. package/lib/components/ArticleList/RelatedQuestions.d.ts +4 -2
  38. package/lib/components/ArticleList/RelatedQuestions.d.ts.map +1 -1
  39. package/lib/components/Assignments/Assignments.d.ts +2 -2
  40. package/lib/components/Assignments/Assignments.d.ts.map +1 -1
  41. package/lib/components/Assignments/Assignments.js +1 -1
  42. package/lib/components/Assignments/Assignments.js.map +1 -1
  43. package/lib/components/Assignments/Assignments.styles.d.ts +7 -3
  44. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -1
  45. package/lib/components/CaseHierarchy/CaseHierarchy.d.ts +2 -2
  46. package/lib/components/CaseHierarchy/CaseHierarchy.d.ts.map +1 -1
  47. package/lib/components/CaseHierarchy/CaseHierarchy.js +4 -3
  48. package/lib/components/CaseHierarchy/CaseHierarchy.js.map +1 -1
  49. package/lib/components/CaseHierarchy/CaseHierarchy.styles.d.ts +7 -3
  50. package/lib/components/CaseHierarchy/CaseHierarchy.styles.d.ts.map +1 -1
  51. package/lib/components/CaseHierarchy/CaseHierarchy.styles.js +9 -7
  52. package/lib/components/CaseHierarchy/CaseHierarchy.styles.js.map +1 -1
  53. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts +1 -1
  54. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts.map +1 -1
  55. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js +2 -1
  56. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js.map +1 -1
  57. package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts +7 -1
  58. package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts.map +1 -1
  59. package/lib/components/CaseHierarchy/CaseHierarchy.types.js.map +1 -1
  60. package/lib/components/CasePreview/CasePreview.d.ts +1 -1
  61. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  62. package/lib/components/CasePreview/CasePreview.js +83 -115
  63. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  64. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
  65. package/lib/components/CaseView/CaseHeader/CaseHeader.js +97 -27
  66. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
  67. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -1
  68. package/lib/components/CaseView/CaseHeader/Summary.js +8 -1
  69. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -1
  70. package/lib/components/CaseView/CaseSummaryFields.js +1 -1
  71. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
  72. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  73. package/lib/components/CaseView/CaseView.js +49 -20
  74. package/lib/components/CaseView/CaseView.js.map +1 -1
  75. package/lib/components/CaseView/CaseView.styles.d.ts +83 -47
  76. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  77. package/lib/components/CaseView/CaseView.styles.js +329 -122
  78. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  79. package/lib/components/CaseView/CaseView.types.d.ts +24 -8
  80. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  81. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  82. package/lib/components/CaseView/UtilitiesSummary.d.ts +1 -1
  83. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  84. package/lib/components/CaseView/UtilitiesSummary.js +14 -4
  85. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  86. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -1
  87. package/lib/components/CaseView/UtilitySummaryItemDialog.js +10 -4
  88. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -1
  89. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -1
  90. package/lib/components/ConfigurableLayout/LayoutCell.js +25 -25
  91. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -1
  92. package/lib/components/Confirmation/Confirmation.d.ts +10 -0
  93. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  94. package/lib/components/Confirmation/Confirmation.js +2 -2
  95. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  96. package/lib/components/Confirmation/index.d.ts +1 -1
  97. package/lib/components/Confirmation/index.d.ts.map +1 -1
  98. package/lib/components/Confirmation/index.js.map +1 -1
  99. package/lib/components/Details/Details.d.ts +3 -2
  100. package/lib/components/Details/Details.d.ts.map +1 -1
  101. package/lib/components/Details/Details.js +6 -5
  102. package/lib/components/Details/Details.js.map +1 -1
  103. package/lib/components/Details/Details.styles.d.ts +17 -15
  104. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  105. package/lib/components/Details/Details.styles.js +28 -15
  106. package/lib/components/Details/Details.styles.js.map +1 -1
  107. package/lib/components/Details/Details.test-ids.d.ts +1 -1
  108. package/lib/components/Details/Details.test-ids.d.ts.map +1 -1
  109. package/lib/components/Details/Details.test-ids.js +2 -1
  110. package/lib/components/Details/Details.test-ids.js.map +1 -1
  111. package/lib/components/Details/DetailsList.d.ts.map +1 -1
  112. package/lib/components/Details/DetailsList.js +1 -5
  113. package/lib/components/Details/DetailsList.js.map +1 -1
  114. package/lib/components/GenAICoach/ActiveCases.d.ts +5 -0
  115. package/lib/components/GenAICoach/ActiveCases.d.ts.map +1 -0
  116. package/lib/components/GenAICoach/ActiveCases.js +50 -0
  117. package/lib/components/GenAICoach/ActiveCases.js.map +1 -0
  118. package/lib/components/GenAICoach/CaseWorkflow.d.ts +5 -0
  119. package/lib/components/GenAICoach/CaseWorkflow.d.ts.map +1 -0
  120. package/lib/components/GenAICoach/CaseWorkflow.js +111 -0
  121. package/lib/components/GenAICoach/CaseWorkflow.js.map +1 -0
  122. package/lib/components/GenAICoach/ConversationHistory.d.ts.map +1 -1
  123. package/lib/components/GenAICoach/ConversationHistory.js +11 -13
  124. package/lib/components/GenAICoach/ConversationHistory.js.map +1 -1
  125. package/lib/components/GenAICoach/GenAICoach.d.ts +4 -3
  126. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  127. package/lib/components/GenAICoach/GenAICoach.js +721 -141
  128. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  129. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +1639 -35
  130. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  131. package/lib/components/GenAICoach/GenAICoach.styles.js +867 -82
  132. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  133. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts +3 -2
  134. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts.map +1 -1
  135. package/lib/components/GenAICoach/GenAICoach.test-ids.js +6 -1
  136. package/lib/components/GenAICoach/GenAICoach.test-ids.js.map +1 -1
  137. package/lib/components/GenAICoach/GenAICoach.types.d.ts +215 -9
  138. package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
  139. package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
  140. package/lib/components/GenAICoach/GenAIMessage.d.ts +6 -0
  141. package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
  142. package/lib/components/GenAICoach/GenAIMessage.js +101 -52
  143. package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
  144. package/lib/components/GenAICoach/GenAIMessageFeedback.d.ts +4 -0
  145. package/lib/components/GenAICoach/GenAIMessageFeedback.d.ts.map +1 -0
  146. package/lib/components/GenAICoach/GenAIMessageFeedback.js +95 -0
  147. package/lib/components/GenAICoach/GenAIMessageFeedback.js.map +1 -0
  148. package/lib/components/GenAICoach/GenAIMessageProgress.d.ts +4 -1
  149. package/lib/components/GenAICoach/GenAIMessageProgress.d.ts.map +1 -1
  150. package/lib/components/GenAICoach/GenAIMessageProgress.js +11 -35
  151. package/lib/components/GenAICoach/GenAIMessageProgress.js.map +1 -1
  152. package/lib/components/GenAICoach/InitialSuggestedMessage.d.ts.map +1 -1
  153. package/lib/components/GenAICoach/InitialSuggestedMessage.js +5 -6
  154. package/lib/components/GenAICoach/InitialSuggestedMessage.js.map +1 -1
  155. package/lib/components/GenAICoach/PortalAgentSplitView.d.ts +6 -0
  156. package/lib/components/GenAICoach/PortalAgentSplitView.d.ts.map +1 -0
  157. package/lib/components/GenAICoach/PortalAgentSplitView.js +75 -0
  158. package/lib/components/GenAICoach/PortalAgentSplitView.js.map +1 -0
  159. package/lib/components/GenAICoach/Questionnaire.d.ts +4 -0
  160. package/lib/components/GenAICoach/Questionnaire.d.ts.map +1 -0
  161. package/lib/components/GenAICoach/Questionnaire.js +155 -0
  162. package/lib/components/GenAICoach/Questionnaire.js.map +1 -0
  163. package/lib/components/GenAICoach/ToolCandidates.d.ts +4 -0
  164. package/lib/components/GenAICoach/ToolCandidates.d.ts.map +1 -0
  165. package/lib/components/GenAICoach/ToolCandidates.js +19 -0
  166. package/lib/components/GenAICoach/ToolCandidates.js.map +1 -0
  167. package/lib/components/GenAICoach/ToolConfirmationMessage.d.ts +4 -0
  168. package/lib/components/GenAICoach/ToolConfirmationMessage.d.ts.map +1 -0
  169. package/lib/components/GenAICoach/ToolConfirmationMessage.js +20 -0
  170. package/lib/components/GenAICoach/ToolConfirmationMessage.js.map +1 -0
  171. package/lib/components/GenAICoach/ToolDetails.d.ts +5 -0
  172. package/lib/components/GenAICoach/ToolDetails.d.ts.map +1 -0
  173. package/lib/components/GenAICoach/ToolDetails.js +99 -0
  174. package/lib/components/GenAICoach/ToolDetails.js.map +1 -0
  175. package/lib/components/GenAICoach/index.d.ts +5 -3
  176. package/lib/components/GenAICoach/index.d.ts.map +1 -1
  177. package/lib/components/GenAICoach/index.js +4 -2
  178. package/lib/components/GenAICoach/index.js.map +1 -1
  179. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts +55 -34
  180. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
  181. package/lib/components/HierarchicalAssignments/Assignments.styles.js +41 -11
  182. package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
  183. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +2 -0
  184. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
  185. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
  186. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +1 -1
  187. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -1
  188. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +7 -4
  189. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -1
  190. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts.map +1 -1
  191. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js +2 -2
  192. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js.map +1 -1
  193. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  194. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +1 -1
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -5
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  198. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +17 -3
  199. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  200. package/lib/components/InteractionNotification/InteractionNotification.d.ts +31 -8
  201. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
  202. package/lib/components/InteractionNotification/InteractionNotification.js +17 -10
  203. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
  204. package/lib/components/Predictions/Predictions.d.ts.map +1 -1
  205. package/lib/components/Predictions/Predictions.js +11 -2
  206. package/lib/components/Predictions/Predictions.js.map +1 -1
  207. package/lib/components/SearchResults/ActiveFilter.d.ts +1 -1
  208. package/lib/components/SearchResults/ActiveFilter.d.ts.map +1 -1
  209. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  210. package/lib/components/SearchResults/Filter.js +1 -1
  211. package/lib/components/SearchResults/Filter.js.map +1 -1
  212. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  213. package/lib/components/SearchResults/SearchResult.js +14 -6
  214. package/lib/components/SearchResults/SearchResult.js.map +1 -1
  215. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  216. package/lib/components/SearchResults/SearchResults.js +18 -3
  217. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  218. package/lib/components/SearchResults/SearchResults.styles.d.ts +12 -10
  219. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  220. package/lib/components/Shortcuts/Shortcuts.d.ts +7 -0
  221. package/lib/components/Shortcuts/Shortcuts.d.ts.map +1 -0
  222. package/lib/components/Shortcuts/Shortcuts.js +47 -0
  223. package/lib/components/Shortcuts/Shortcuts.js.map +1 -0
  224. package/lib/components/Shortcuts/Shortcuts.styles.d.ts +22 -0
  225. package/lib/components/Shortcuts/Shortcuts.styles.d.ts.map +1 -0
  226. package/lib/components/Shortcuts/Shortcuts.styles.js +114 -0
  227. package/lib/components/Shortcuts/Shortcuts.styles.js.map +1 -0
  228. package/lib/components/Shortcuts/Shortcuts.test-ids.d.ts +2 -0
  229. package/lib/components/Shortcuts/Shortcuts.test-ids.d.ts.map +1 -0
  230. package/lib/components/Shortcuts/Shortcuts.test-ids.js +8 -0
  231. package/lib/components/Shortcuts/Shortcuts.test-ids.js.map +1 -0
  232. package/lib/components/Shortcuts/Shortcuts.types.d.ts +64 -0
  233. package/lib/components/Shortcuts/Shortcuts.types.d.ts.map +1 -0
  234. package/lib/components/Shortcuts/Shortcuts.types.js +2 -0
  235. package/lib/components/Shortcuts/Shortcuts.types.js.map +1 -0
  236. package/lib/components/Shortcuts/index.d.ts +3 -0
  237. package/lib/components/Shortcuts/index.d.ts.map +1 -0
  238. package/lib/components/Shortcuts/index.js +2 -0
  239. package/lib/components/Shortcuts/index.js.map +1 -0
  240. package/lib/components/Stages/Stages.d.ts.map +1 -1
  241. package/lib/components/Stages/Stages.js +37 -12
  242. package/lib/components/Stages/Stages.js.map +1 -1
  243. package/lib/components/Stages/Stages.styles.d.ts +22 -15
  244. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  245. package/lib/components/Stages/Stages.styles.js +285 -119
  246. package/lib/components/Stages/Stages.styles.js.map +1 -1
  247. package/lib/components/Stages/Stages.types.d.ts +5 -0
  248. package/lib/components/Stages/Stages.types.d.ts.map +1 -1
  249. package/lib/components/Stages/Stages.types.js.map +1 -1
  250. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  251. package/lib/components/Stakeholders/Stakeholders.js +109 -145
  252. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  253. package/lib/components/Tags/Tags.d.ts +2 -2
  254. package/lib/components/Tags/Tags.d.ts.map +1 -1
  255. package/lib/components/Tags/Tags.js +12 -2
  256. package/lib/components/Tags/Tags.js.map +1 -1
  257. package/lib/components/Tasks/TaskList.d.ts +10 -3
  258. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  259. package/lib/components/Tasks/TaskList.js +59 -5
  260. package/lib/components/Tasks/TaskList.js.map +1 -1
  261. package/lib/components/Tasks/Tasks.d.ts +10 -3
  262. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  263. package/lib/components/Tasks/Tasks.js +29 -5
  264. package/lib/components/Tasks/Tasks.js.map +1 -1
  265. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts.map +1 -1
  266. package/lib/components/UtilitiesLayout/UtilitiesLayout.js +3 -2
  267. package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -1
  268. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts +2 -2
  269. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -1
  270. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js +3 -2
  271. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js.map +1 -1
  272. package/lib/index.d.ts +2 -0
  273. package/lib/index.d.ts.map +1 -1
  274. package/lib/index.js +2 -0
  275. package/lib/index.js.map +1 -1
  276. package/package.json +6 -7
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import { Count, EmptyState, ErrorState, Flex, Icon, Progress, Text, useI18n, useTestIds, withTestIds } from '@pega/cosmos-react-core';
3
+ import { colorIconMapping, Count, EmptyState, ErrorState, Flex, Icon, Progress, SearchInput, Text, useI18n, useTestIds, useTheme, withTestIds } from '@pega/cosmos-react-core';
4
4
  import { StyledCaseHierarchy, StyledCaseHierarchyHeader, StyledCaseHierarchyTree, StyledOverflowContainer } from './CaseHierarchy.styles';
5
5
  import { getCaseHierarchyTestIds } from './CaseHierarchy.test-ids';
6
- const CaseHierarchy = forwardRef(function CaseHierarchy({ testId, heading, icon, loading, error, count, nodes, currentCaseId, ...restProps }, ref) {
6
+ const CaseHierarchy = forwardRef(function CaseHierarchy({ testId, heading, icon, loading, error, count, nodes, search, currentCaseId, ...restProps }, ref) {
7
7
  const t = useI18n();
8
+ const theme = useTheme();
8
9
  const testIds = useTestIds(testId, getCaseHierarchyTestIds);
9
10
  const content = (() => {
10
11
  if (error) {
@@ -18,7 +19,7 @@ const CaseHierarchy = forwardRef(function CaseHierarchy({ testId, heading, icon,
18
19
  }
19
20
  return _jsx(StyledCaseHierarchyTree, { ...restProps, currentNodeId: currentCaseId, nodes: nodes });
20
21
  })();
21
- return (_jsxs(StyledCaseHierarchy, { "data-testid": testIds.root, ref: ref, children: [_jsx(StyledCaseHierarchyHeader, { children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested', size: 's' }), _jsx(Text, { "data-testid": testIds.heading, variant: 'h3', children: heading }), !loading && typeof count === 'number' && (_jsx(Count, { "data-testid": testIds.count, children: count }))] }) }), _jsx(StyledOverflowContainer, { children: content })] }));
22
+ return (_jsxs(StyledCaseHierarchy, { "data-testid": testIds.root, ref: ref, children: [_jsx(StyledCaseHierarchyHeader, { children: _jsxs(Flex, { container: { direction: 'column', gap: 1 }, item: { grow: 1 }, children: [_jsxs(Flex, { container: { direction: 'row', alignItems: 'center', gap: 1 }, children: [theme.components['case-view'].utilities['icon-color'] ? (_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested', background: colorIconMapping(theme, icon ?? 'folder-nested'), shape: 'circle' })) : (_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested' })), _jsx(Text, { "data-testid": testIds.heading, variant: 'h3', children: heading }), !loading && typeof count === 'number' && (_jsx(Count, { "data-testid": testIds.count, children: count }))] }), search && (_jsx(SearchInput, { "data-testid": testIds.search, value: search.value, onSearchChange: search.handler }))] }) }), _jsx(StyledOverflowContainer, { children: content })] }));
22
23
  });
23
24
  export default withTestIds(CaseHierarchy, getCaseHierarchyTestIds);
24
25
  //# sourceMappingURL=CaseHierarchy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,KAAK,EACL,UAAU,EACV,UAAU,EACV,IAAI,E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AC,IAAI,mBAAc,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,eAAe,EAAE,IAAI,EAAC,GAAG,GAAG,EAC3E,KAAC,IAAI,mBAAc,OAAO,CAAC,OAAO,EAAE,OAAO,EAAC,IAAI,YAC7C,OAAO,GACH,EACN,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CACxC,KAAC,KAAK,mBAAc,OAAO,CAAC,KAAK,YAAG,KAAK,GAAS,CACnD,IACI,GACmB,EAC5B,KAAC,uBAAuB,cAAE,OAAO,GAA2B,IACxC,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\n\nimport {\n Count,\n EmptyState,\n ErrorState,\n Flex,\n Icon,\n Progress,\n Text,\n useI18n,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\n\nimport type { CaseHierarchyProps } from './CaseHierarchy.types';\nimport {\n StyledCaseHierarchy,\n StyledCaseHierarchyHeader,\n StyledCaseHierarchyTree,\n StyledOverflowContainer\n} from './CaseHierarchy.styles';\nimport { getCaseHierarchyTestIds } from './CaseHierarchy.test-ids';\n\nconst CaseHierarchy = forwardRef(function CaseHierarchy(\n {\n testId,\n heading,\n icon,\n loading,\n error,\n count,\n nodes,\n currentCaseId,\n ...restProps\n }: PropsWithoutRef<CaseHierarchyProps>,\n ref: Ref<HTMLUListElement>\n) {\n const t = useI18n();\n const testIds = useTestIds(testId, getCaseHierarchyTestIds);\n\n const content = (() => {\n if (error) {\n return <ErrorState message={t('error')} />;\n }\n\n if (loading) {\n return <Progress placement='block' />;\n }\n\n if (nodes.length === 0) {\n return <EmptyState />;\n }\n\n return <StyledCaseHierarchyTree {...restProps} currentNodeId={currentCaseId} nodes={nodes} />;\n })();\n\n return (\n <StyledCaseHierarchy data-testid={testIds.root} ref={ref}>\n <StyledCaseHierarchyHeader>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Icon data-testid={testIds.icon} name={icon ?? 'folder-nested'} size='s' />\n <Text data-testid={testIds.heading} variant='h3'>\n {heading}\n </Text>\n {!loading && typeof count === 'number' && (\n <Count data-testid={testIds.count}>{count}</Count>\n )}\n </Flex>\n </StyledCaseHierarchyHeader>\n <StyledOverflowContainer>{content}</StyledOverflowContainer>\n </StyledCaseHierarchy>\n );\n});\n\nexport default withTestIds(CaseHierarchy, getCaseHierarchyTestIds);\n"]}
1
+ {"version":3,"file":"CaseHierarchy.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,aAAa,CACrD,EACE,MAAM,EACN,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,aAAa,EACb,GAAG,SAAS,EACwB,EACtC,GAAwB;IAExB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAE5D,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE;QACpB,IAAI,KAAK,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IAAI,YAC7C,OAAO,GACH,EACN,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CACxC,KAAC,KAAK,mBAAc,OAAO,CAAC,KAAK,YAAG,KAAK,GAAS,CACnD,IACI,EACN,MAAM,IAAI,CACT,KAAC,WAAW,mBACG,OAAO,CAAC,MAAM,EAC3B,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,cAAc,EAAE,MAAM,CAAC,OAAO,GAC9B,CACH,IACI,GACmB,EAC5B,KAAC,uBAAuB,cAAE,OAAO,GAA2B,IACxC,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\n\nimport {\n colorIconMapping,\n Count,\n EmptyState,\n ErrorState,\n Flex,\n Icon,\n Progress,\n SearchInput,\n Text,\n useI18n,\n useTestIds,\n useTheme,\n withTestIds\n} from '@pega/cosmos-react-core';\n\nimport type { CaseHierarchyProps } from './CaseHierarchy.types';\nimport {\n StyledCaseHierarchy,\n StyledCaseHierarchyHeader,\n StyledCaseHierarchyTree,\n StyledOverflowContainer\n} from './CaseHierarchy.styles';\nimport { getCaseHierarchyTestIds } from './CaseHierarchy.test-ids';\n\nconst CaseHierarchy = forwardRef(function CaseHierarchy(\n {\n testId,\n heading,\n icon,\n loading,\n error,\n count,\n nodes,\n search,\n currentCaseId,\n ...restProps\n }: PropsWithoutRef<CaseHierarchyProps>,\n ref: Ref<HTMLDivElement>\n) {\n const t = useI18n();\n const theme = useTheme();\n const testIds = useTestIds(testId, getCaseHierarchyTestIds);\n\n const content = (() => {\n if (error) {\n return <ErrorState message={t('error')} />;\n }\n\n if (loading) {\n return <Progress placement='block' />;\n }\n\n if (nodes.length === 0) {\n return <EmptyState />;\n }\n\n return <StyledCaseHierarchyTree {...restProps} currentNodeId={currentCaseId} nodes={nodes} />;\n })();\n\n return (\n <StyledCaseHierarchy data-testid={testIds.root} ref={ref}>\n <StyledCaseHierarchyHeader>\n <Flex container={{ direction: 'column', gap: 1 }} item={{ grow: 1 }}>\n <Flex container={{ direction: 'row', alignItems: 'center', gap: 1 }}>\n {theme.components['case-view'].utilities['icon-color'] ? (\n <Icon\n data-testid={testIds.icon}\n name={icon ?? 'folder-nested'}\n background={colorIconMapping(theme, icon ?? 'folder-nested')}\n shape='circle'\n />\n ) : (\n <Icon data-testid={testIds.icon} name={icon ?? 'folder-nested'} />\n )}\n <Text data-testid={testIds.heading} variant='h3'>\n {heading}\n </Text>\n {!loading && typeof count === 'number' && (\n <Count data-testid={testIds.count}>{count}</Count>\n )}\n </Flex>\n {search && (\n <SearchInput\n data-testid={testIds.search}\n value={search.value}\n onSearchChange={search.handler}\n />\n )}\n </Flex>\n </StyledCaseHierarchyHeader>\n <StyledOverflowContainer>{content}</StyledOverflowContainer>\n </StyledCaseHierarchy>\n );\n});\n\nexport default withTestIds(CaseHierarchy, getCaseHierarchyTestIds);\n"]}
@@ -1,6 +1,10 @@
1
1
  import { StandardTree } from '@pega/cosmos-react-core';
2
2
  export declare const StyledCaseHierarchyTree: typeof StandardTree;
3
- export declare const StyledOverflowContainer: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardContentProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
4
- export declare const StyledCaseHierarchyHeader: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").CardHeaderProps>, import("styled-components").DefaultTheme, {}, never>;
5
- export declare const StyledCaseHierarchy: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").CardProps>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledOverflowContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@pega/cosmos-react-core").CardContentProps & import("@pega/cosmos-react-core").ForwardProps, never>> & string & Omit<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardContentProps & import("@pega/cosmos-react-core").ForwardProps>, keyof import("react").Component<any, {}, any>>;
4
+ export declare const StyledCaseHierarchyHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").CardHeaderProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
5
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
6
+ }, never>, never>> & string;
7
+ export declare const StyledCaseHierarchy: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").CardProps, "ref"> & import("react").RefAttributes<HTMLElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
8
+ ref?: ((instance: HTMLElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLElement> | null | undefined;
9
+ }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").CardProps>, keyof import("react").Component<any, {}, any>>;
6
10
  //# sourceMappingURL=CaseHierarchy.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAKjC,eAAO,MAAM,uBAAuB,EAAE,OAAO,YAU3C,CAAC;AAIH,eAAO,MAAM,uBAAuB,0OAoBnC,CAAC;AAIF,eAAO,MAAM,yBAAyB,wNAYpC,CAAC;AAIH,eAAO,MAAM,mBAAmB,kNAK/B,CAAC"}
1
+ {"version":3,"file":"CaseHierarchy.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAKb,MAAM,yBAAyB,CAAC;AAQjC,eAAO,MAAM,uBAAuB,EAAE,OAAO,YAe5C,CAAC;AAIF,eAAO,MAAM,uBAAuB,6ZAoBnC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;2BAYpC,CAAC;AAIH,eAAO,MAAM,mBAAmB;;yLAI/B,CAAC"}
@@ -1,19 +1,22 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { defaultThemeProp, StandardTree, Card, CardContent, StyledFlex } from '@pega/cosmos-react-core';
2
+ import { defaultThemeProp, StandardTree, Card, CardContent, StyledFlex, StyledButton } from '@pega/cosmos-react-core';
3
3
  import { StyledSummaryListHeader } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';
4
4
  import { StyledDialog } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.styles';
5
- import { StyledNodeInteraction } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';
6
- export const StyledCaseHierarchyTree = styled(StandardTree)(({ theme }) => {
7
- return css `
5
+ import { StyledLabelContainer, StyledNodeInteraction } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';
6
+ export const StyledCaseHierarchyTree = styled(StandardTree)(({ theme }) => css `
8
7
  display: table;
9
8
  width: 100%;
10
9
 
10
+ ${StyledLabelContainer} ${StyledButton} {
11
+ align-self: flex-start;
12
+ margin-block-start: calc(${theme.base.spacing} / 4);
13
+ }
14
+
11
15
  [aria-current='true'],
12
16
  [aria-current='page'] {
13
17
  font-weight: ${theme.base['font-weight']['semi-bold']};
14
18
  }
15
- `;
16
- });
19
+ `);
17
20
  StyledCaseHierarchyTree.defaultProps = defaultThemeProp;
18
21
  export const StyledOverflowContainer = styled(CardContent)(({ theme }) => css `
19
22
  overflow: auto;
@@ -51,7 +54,6 @@ export const StyledCaseHierarchyHeader = styled(StyledSummaryListHeader)(({ them
51
54
  StyledCaseHierarchyHeader.defaultProps = defaultThemeProp;
52
55
  export const StyledCaseHierarchy = styled(Card) `
53
56
  ${StyledDialog} & {
54
- /* stylelint-disable-next-line unit-allowed-list */
55
57
  max-height: calc(100dvh - 5rem);
56
58
  }
57
59
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.styles.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gEAAgE,CAAC;AACzG,OAAO,EAAE,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iEAAiE,CAAC;AAExG,MAAM,CAAC,MAAM,uBAAuB,GAAwB,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7F,OAAO,GAAG,CAAA;;;;;;qBAMS,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;GAExD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,WAAW,CAAC,CACxD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;;;MAId,qBAAqB;;sDAE2B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;sDAG3B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;qDAG5B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;qDAG3B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;GAG7E,CACF,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrF,OAAO,GAAG,CAAA;8BACkB,KAAK,CAAC,IAAI,CAAC,OAAO;;MAE1C,UAAU;oBACI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;;;sBAGjC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC;;;GAGvD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAC3C,YAAY;;;;CAIf,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StandardTree,\n Card,\n CardContent,\n StyledFlex\n} from '@pega/cosmos-react-core';\nimport { StyledSummaryListHeader } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';\nimport { StyledDialog } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.styles';\nimport { StyledNodeInteraction } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nexport const StyledCaseHierarchyTree: typeof StandardTree = styled(StandardTree)(({ theme }) => {\n return css`\n display: table;\n width: 100%;\n\n [aria-current='true'],\n [aria-current='page'] {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n `;\n});\n\nStyledCaseHierarchyTree.defaultProps = defaultThemeProp;\n\nexport const StyledOverflowContainer = styled(CardContent)(\n ({ theme }) => css`\n overflow: auto;\n max-height: inherit;\n\n ${StyledNodeInteraction} {\n border-top-right-radius: calc(\n var(--first-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-top-left-radius: calc(\n var(--first-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-bottom-left-radius: calc(\n var(--last-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-bottom-right-radius: calc(\n var(--last-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n }\n `\n);\n\nStyledOverflowContainer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHierarchyHeader = styled(StyledSummaryListHeader)(({ theme }) => {\n return css`\n padding-block-end: calc(${theme.base.spacing} / 2);\n\n ${StyledFlex} {\n min-height: ${theme.base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${theme.base['hit-area']['finger-min']};\n }\n }\n `;\n});\n\nStyledCaseHierarchyHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHierarchy = styled(Card)`\n ${StyledDialog} & {\n /* stylelint-disable-next-line unit-allowed-list */\n max-height: calc(100dvh - 5rem);\n }\n`;\n\nStyledCaseHierarchy.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"CaseHierarchy.styles.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gEAAgE,CAAC;AACzG,OAAO,EAAE,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAC3F,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB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AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StandardTree,\n Card,\n CardContent,\n StyledFlex,\n StyledButton\n} from '@pega/cosmos-react-core';\nimport { StyledSummaryListHeader } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';\nimport { StyledDialog } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.styles';\nimport {\n StyledLabelContainer,\n StyledNodeInteraction\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nexport const StyledCaseHierarchyTree: typeof StandardTree = styled(StandardTree)(\n ({ theme }) => css`\n display: table;\n width: 100%;\n\n ${StyledLabelContainer} ${StyledButton} {\n align-self: flex-start;\n margin-block-start: calc(${theme.base.spacing} / 4);\n }\n\n [aria-current='true'],\n [aria-current='page'] {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n `\n);\n\nStyledCaseHierarchyTree.defaultProps = defaultThemeProp;\n\nexport const StyledOverflowContainer = styled(CardContent)(\n ({ theme }) => css`\n overflow: auto;\n max-height: inherit;\n\n ${StyledNodeInteraction} {\n border-top-right-radius: calc(\n var(--first-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-top-left-radius: calc(\n var(--first-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-bottom-left-radius: calc(\n var(--last-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-bottom-right-radius: calc(\n var(--last-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n }\n `\n);\n\nStyledOverflowContainer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHierarchyHeader = styled(StyledSummaryListHeader)(({ theme }) => {\n return css`\n padding-block-end: calc(${theme.base.spacing} / 2);\n\n ${StyledFlex} {\n min-height: ${theme.base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${theme.base['hit-area']['finger-min']};\n }\n }\n `;\n});\n\nStyledCaseHierarchyHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHierarchy = styled(Card)`\n ${StyledDialog} & {\n max-height: calc(100dvh - 5rem);\n }\n`;\n\nStyledCaseHierarchy.defaultProps = defaultThemeProp;\n"]}
@@ -1,2 +1,2 @@
1
- export declare const getCaseHierarchyTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "icon", "count"]>;
1
+ export declare const getCaseHierarchyTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "icon", "count", "search"]>;
2
2
  //# sourceMappingURL=CaseHierarchy.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,iKAIzB,CAAC"}
1
+ {"version":3,"file":"CaseHierarchy.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,2KAKzB,CAAC"}
@@ -2,6 +2,7 @@ import { createTestIds } from '@pega/cosmos-react-core';
2
2
  export const getCaseHierarchyTestIds = createTestIds('case-hierarchy', [
3
3
  'heading',
4
4
  'icon',
5
- 'count'
5
+ 'count',
6
+ 'search'
6
7
  ]);
7
8
  //# sourceMappingURL=CaseHierarchy.test-ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.test-ids.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,EAAE;IACrE,SAAS;IACT,MAAM;IACN,OAAO;CACC,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getCaseHierarchyTestIds = createTestIds('case-hierarchy', [\n 'heading',\n 'icon',\n 'count'\n] as const);\n"]}
1
+ {"version":3,"file":"CaseHierarchy.test-ids.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,EAAE;IACrE,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;CACA,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getCaseHierarchyTestIds = createTestIds('case-hierarchy', [\n 'heading',\n 'icon',\n 'count',\n 'search'\n] as const);\n"]}
@@ -4,7 +4,8 @@ export interface CaseHierarchyNode extends OmitStrict<StandardTreeNode, 'nodes'>
4
4
  nodes?: CaseHierarchyNode[];
5
5
  caseTypeId?: string;
6
6
  }
7
- export interface CaseHierarchyProps extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref'>, TestIdProp {
7
+ export interface CaseHierarchyProps extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref' | 'nodes'>, TestIdProp {
8
+ nodes: CaseHierarchyNode[];
8
9
  /** Heading shown on the Card wrapping the component. */
9
10
  heading: string;
10
11
  /** The icon rendered as part of the header. If not set will default to 'folder-nested'. */
@@ -17,6 +18,11 @@ export interface CaseHierarchyProps extends OmitStrict<StandardTreeProps, 'curre
17
18
  error?: boolean;
18
19
  /** Will render the provided number in a count badge next to the heading. */
19
20
  count?: number;
21
+ /** If set, will render a search input above the tree to search nodes. */
22
+ search?: {
23
+ value: string;
24
+ handler: (value: string) => void;
25
+ };
20
26
  /** A ref to the wrapping element. */
21
27
  ref?: Ref<HTMLDivElement>;
22
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,iBAAkB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC9E,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBACf,SAAQ,UAAU,CAAC,iBAAiB,EAAE,eAAe,GAAG,KAAK,CAAC,EAC5D,UAAU;IACZ,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,mEAAmE;IACnE,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
1
+ {"version":3,"file":"CaseHierarchy.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,iBAAkB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC9E,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBACf,SAAQ,UAAU,CAAC,iBAAiB,EAAE,eAAe,GAAG,KAAK,GAAG,OAAO,CAAC,EACtE,UAAU;IACZ,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,mEAAmE;IACnE,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IAC7D,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHierarchy.types.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type {\n IconProps,\n OmitStrict,\n StandardTreeNode,\n StandardTreeProps,\n TestIdProp,\n TreeNode\n} from '@pega/cosmos-react-core';\n\nexport interface CaseHierarchyNode extends OmitStrict<StandardTreeNode, 'nodes'> {\n nodes?: CaseHierarchyNode[];\n caseTypeId?: string;\n}\n\nexport interface CaseHierarchyProps\n extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref'>,\n TestIdProp {\n /** Heading shown on the Card wrapping the component. */\n heading: string;\n /** The icon rendered as part of the header. If not set will default to 'folder-nested'. */\n icon?: IconProps['name'];\n /** The currently selected case, will be highlighted by default. */\n currentCaseId?: TreeNode['id'];\n /** If set, a progress indicator will render in place of the component. */\n loading?: boolean;\n /** If set, an error state will render in place of the component. */\n error?: boolean;\n /** Will render the provided number in a count badge next to the heading. */\n count?: number;\n /** A ref to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
1
+ {"version":3,"file":"CaseHierarchy.types.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type {\n IconProps,\n OmitStrict,\n StandardTreeNode,\n StandardTreeProps,\n TestIdProp,\n TreeNode\n} from '@pega/cosmos-react-core';\n\nexport interface CaseHierarchyNode extends OmitStrict<StandardTreeNode, 'nodes'> {\n nodes?: CaseHierarchyNode[];\n caseTypeId?: string;\n}\n\nexport interface CaseHierarchyProps\n extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref' | 'nodes'>,\n TestIdProp {\n nodes: CaseHierarchyNode[];\n /** Heading shown on the Card wrapping the component. */\n heading: string;\n /** The icon rendered as part of the header. If not set will default to 'folder-nested'. */\n icon?: IconProps['name'];\n /** The currently selected case, will be highlighted by default. */\n currentCaseId?: TreeNode['id'];\n /** If set, a progress indicator will render in place of the component. */\n loading?: boolean;\n /** If set, an error state will render in place of the component. */\n error?: boolean;\n /** Will render the provided number in a count badge next to the heading. */\n count?: number;\n /** If set, will render a search input above the tree to search nodes. */\n search?: { value: string; handler: (value: string) => void };\n /** A ref to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -2,7 +2,7 @@ import type { Ref } from 'react';
2
2
  import type { ForwardRefForwardPropsComponent, BaseProps, TestIdProp, NoChildrenProp, ErrorStateProps } from '@pega/cosmos-react-core';
3
3
  import type { CaseViewProps } from '../CaseView';
4
4
  import type { CaseViewContextValue } from '../CaseView/CaseView.types';
5
- export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'caseType' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, TestIdProp, BaseProps {
5
+ export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'caseType' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'color' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, TestIdProp, BaseProps {
6
6
  /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */
7
7
  caseLink?: CaseViewContextValue['caseLink'];
8
8
  /** If true, the Case Preview will be visible. */
@@ -1 +1 @@
1
- {"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AA0BlD,OAAO,KAAK,EACV,+BAA+B,EAC/B,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAUjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQvE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,UAAU,GACV,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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MAAM,GACN,OAAO,GACP,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,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAC1C,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;;;;AA6OD,wBAA+D"}
@@ -1,82 +1,32 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useState, useCallback, useEffect, useContext } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useState, useRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Drawer, Icon, registerIcon, Button, Flex, defaultThemeProp, useBreakpoint, useElement, useDirection, useI18n, AppShellContext, useTestIds, withTestIds, Progress, ErrorState, getFocusables, useConsolidatedRef, StyledButton, calculateForegroundColor, useFocusTrap, readableHue } from '@pega/cosmos-react-core';
5
- import { resizeDrawerDefaultWidth } from '@pega/cosmos-react-core/lib/styles/constants';
4
+ import { registerIcon, defaultThemeProp, useBreakpoint, useI18n, useTestIds, withTestIds, ErrorState, useConsolidatedRef, StyledPreviewDrawer, usePreviewManager } from '@pega/cosmos-react-core';
6
5
  import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
7
- import CaseView, { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledSummaryRegion } from '../CaseView';
6
+ import CaseView, { StyledCaseView, StyledCaseViewContent, StyledSummaryRegion } from '../CaseView';
8
7
  import { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';
9
- import { StyledCaseHeader } from '../CaseView/CaseView.styles';
8
+ import { StyledSummaryPrimaryList, StyledSummarySecondaryList } from '../CaseView/CaseView.styles';
10
9
  import { getCasePreviewTestIds } from './CasePreview.test-ids';
11
10
  registerIcon(timesIcon);
12
- const StyledPreviewHeader = styled.div(({ theme }) => {
11
+ const StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {
13
12
  return css `
14
- z-index: ${theme.base['z-index'].drawer};
15
- background-color: ${theme.base.palette['primary-background']};
16
- `;
17
- });
18
- StyledPreviewHeader.defaultProps = defaultThemeProp;
19
- const StyledPreviewActions = styled.div(({ theme: { base: { spacing, 'z-index': { backdrop, popover } }, components: { 'case-view': { header: { background, 'foreground-color': color } } } }, fixedHeaderHeight, progressActive }) => {
20
- const foregroundColor = calculateForegroundColor(background, color);
21
- return css `
22
- color: ${foregroundColor};
23
- padding: ${spacing} calc(2 * ${spacing}) calc(0.25 * ${spacing});
24
-
25
- ${fixedHeaderHeight
26
- ? css `
27
- background: ${background};
28
- `
29
- : css `
30
- position: absolute;
31
- z-index: ${popover + 1};
32
- `}
33
-
34
- ${StyledButton} {
35
- color: ${foregroundColor};
36
-
37
- ${progressActive &&
38
- css `
39
- z-index: ${backdrop + 1};
40
- color: ${foregroundColor};
41
- `}
42
- }
13
+ ${StyledSummaryPrimaryList} {
14
+ padding: unset;
15
+ }
43
16
 
44
- ${fixedHeaderHeight &&
45
- css `
46
- min-height: 6.625rem;
47
- `}
48
- `;
49
- });
50
- StyledPreviewActions.defaultProps = defaultThemeProp;
51
- const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {
52
- return css `
53
- background-color: ${theme.base.palette['app-background']};
54
- height: calc(100vh - var(--appshell-offset, 0rem));
55
- top: var(--appshell-offset, 0);
56
- z-index: calc(${theme.base['z-index'].drawer} + 500);
57
- transition-property: transform, box-shadow, opacity, border-inline-start;
58
- transition-duration: max(${theme.base.animation.speed}, 0.0001s);
59
- transition-timing-function: ${theme.base.animation.timing.ease};
17
+ ${StyledSummarySecondaryList} {
18
+ padding-block-start: unset;
19
+ padding-inline: unset;
20
+ }
60
21
 
61
22
  ${StyledCaseView} {
62
23
  height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});
24
+ z-index: 1;
63
25
 
64
26
  @media (pointer: coarse) {
65
27
  height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});
66
28
  }
67
29
 
68
- ${StyledCaseHeader} {
69
- padding-block-start: calc(
70
- (2.25 * ${theme.base.spacing}) + ${theme.base['hit-area']['mouse-min']}
71
- );
72
-
73
- @media (pointer: coarse) {
74
- padding-block-start: calc(
75
- (2.25 * ${theme.base.spacing}) + ${theme.base['hit-area']['finger-min']}
76
- );
77
- }
78
- }
79
-
80
30
  ${StyledSummaryRegion} {
81
31
  position: relative;
82
32
  top: 0;
@@ -95,69 +45,87 @@ const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {
95
45
  width: unset;
96
46
  min-width: unset;
97
47
  }
98
-
99
- @media (min-width: ${theme.base.breakpoints.xl}) {
100
- box-shadow: none;
101
- border-inline-start: 0.0625rem solid
102
- ${readableHue(theme.base.palette['border-line'], theme.base.palette['app-background'], {
103
- mode: 'both',
104
- level: 'AANonText'
105
- })};
106
- }
107
48
  `;
108
49
  });
109
- StyledPreviewDrawer.defaultProps = defaultThemeProp;
50
+ StyledCasePreviewDrawer.defaultProps = defaultThemeProp;
51
+ const CasePreviewContent = ({ error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, color, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit }) => {
52
+ const t = useI18n();
53
+ if (error) {
54
+ return _jsx(ErrorState, { message: t('preview_error'), onRetry: onErrorRetry });
55
+ }
56
+ return (_jsx(CaseView, { caseId: caseId, caseType: caseType, parentCases: parentCases, heading: heading, subheading: subheading, caseLink: caseLink, icon: icon, color: color, 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 }));
57
+ };
110
58
  const CasePreview = forwardRef(function CasePreview(props, ref) {
111
- const { testId, open: openProp, progress, error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, onBeforeOpen, onAfterOpen, onBeforeClose, ...restProps } = props;
59
+ const { testId, open: openProp, progress, error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, color, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, onBeforeOpen, onAfterOpen, onBeforeClose, onAfterClose, ...restProps } = props;
112
60
  const testIds = useTestIds(testId, getCasePreviewTestIds);
113
- const t = useI18n();
61
+ const { createPreview } = usePreviewManager();
62
+ const previewMethodsRef = useRef(undefined);
114
63
  const previewRef = useConsolidatedRef(ref);
115
- const { previewTriggerRef, setPreviewActive } = useContext(AppShellContext);
116
- const [closeButtonEl, setCloseButtonEl] = useElement();
117
64
  const isSmallOrAbove = useBreakpoint('sm');
118
65
  const [open, setOpen] = useState(openProp);
119
- const [progressActive, setProgressActive] = useState(false);
120
- const [progressVisible, setProgressVisible] = useState(false);
121
- const direction = useDirection();
122
- const closePreview = useCallback(() => {
123
- setOpen(false);
124
- previewTriggerRef.current?.focus();
125
- }, []);
126
- const setFocus = () => {
127
- if (progressVisible)
128
- return;
129
- const focusables = getFocusables(previewRef).filter(el => el !== closeButtonEl);
130
- const focusable = focusables[0] ?? closeButtonEl;
131
- focusable?.focus();
132
- };
133
66
  useEffect(() => {
134
67
  setOpen(openProp);
135
68
  }, [openProp]);
136
69
  useEffect(() => {
137
- if (!progressVisible) {
138
- setFocus();
70
+ if (open && isSmallOrAbove) {
71
+ const contentProps = {
72
+ error,
73
+ onErrorRetry,
74
+ caseId,
75
+ caseType,
76
+ heading,
77
+ subheading,
78
+ caseLink,
79
+ parentCases,
80
+ icon,
81
+ color,
82
+ followed,
83
+ onFollowedChange,
84
+ summaryFields,
85
+ tabs,
86
+ stages,
87
+ tasks,
88
+ tabContent,
89
+ utilities,
90
+ utilitiesSummaryItems,
91
+ actions,
92
+ banners,
93
+ onEdit
94
+ };
95
+ const metadata = {
96
+ previewProps: {
97
+ testId: testIds.root,
98
+ previewLabel: typeof heading === 'string' ? heading : heading?.text,
99
+ onBeforeOpen,
100
+ onAfterOpen,
101
+ onBeforeClose,
102
+ onAfterClose: () => {
103
+ onAfterClose?.();
104
+ setOpen(false);
105
+ if (previewMethodsRef.current) {
106
+ previewMethodsRef.current.unmountPreview();
107
+ previewMethodsRef.current = undefined;
108
+ }
109
+ },
110
+ as: StyledCasePreviewDrawer,
111
+ ref: previewRef,
112
+ progress,
113
+ ...restProps
114
+ }
115
+ };
116
+ if (previewMethodsRef.current) {
117
+ previewMethodsRef.current.updatePreview(contentProps, metadata);
118
+ }
119
+ else {
120
+ previewMethodsRef.current = createPreview(CasePreviewContent, contentProps, metadata);
121
+ }
139
122
  }
140
- }, [progressVisible]);
141
- useEffect(() => {
142
- return () => {
143
- setPreviewActive(false);
144
- };
145
- }, []);
146
- useFocusTrap(previewRef, true, [], false);
147
- const content = error ? (_jsx(ErrorState, { message: t('preview_error'), onRetry: onErrorRetry })) : (_jsx(CaseView, { caseId: caseId, caseType: caseType, 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 }));
148
- return (_jsxs(Drawer, { "data-testid": testIds.root, ...restProps, onBeforeOpen: () => {
149
- setPreviewActive(true);
150
- onBeforeOpen?.();
151
- }, onAfterOpen: () => {
152
- setFocus();
153
- onAfterOpen?.();
154
- }, onBeforeClose: () => {
155
- setPreviewActive(false);
156
- onBeforeClose?.();
157
- }, as: StyledPreviewDrawer, role: 'complementary', forwardedAs: Flex, container: { direction: 'column' }, ref: previewRef, open: open && isSmallOrAbove, position: 'fixed', placement: direction.end, "aria-label": t('preview_of_noun', [heading]), size: resizeDrawerDefaultWidth, resizeable: true, shadow: true, nullWhenClosed: true, children: [_jsx(StyledPreviewActions, { fixedHeaderHeight: !!error || !!progress, progressActive: progressActive, 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(Progress, { placement: 'local', visible: !!progress, focusOnVisible: true, delay: true, onTransitionStartIn: () => {
158
- setProgressActive(true);
159
- setProgressVisible(true);
160
- }, onTransitionStartOut: () => setProgressActive(false), onTransitionEndOut: () => setProgressVisible(false) }), !progress && content] }));
123
+ else if (!open) {
124
+ // This branch is needed for controlled component via open prop
125
+ previewMethodsRef.current = undefined;
126
+ }
127
+ }, [open, progress, error, tabs, banners, utilities, utilitiesSummaryItems, isSmallOrAbove]);
128
+ return null;
161
129
  });
162
130
  export default withTestIds(CasePreview, getCasePreviewTestIds);
163
131
  //# sourceMappingURL=CasePreview.js.map
@@ -1 +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,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,OAAO,EACP,eAAe,EACf,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,QAAQ,EAAE,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,YAAY,CAAC,SAAS,CAAC,CAAC;AAoDxB,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM;wBACnB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAo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IAAI,CAAC,CAAC;gBAC3B,CAAC,EACD,oBAAoB,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACpD,kBAAkB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,GACnD,EAED,CAAC,QAAQ,IAAI,OAAO,IACd,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 { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Drawer,\n Icon,\n registerIcon,\n Button,\n Flex,\n defaultThemeProp,\n useBreakpoint,\n useElement,\n useDirection,\n useI18n,\n AppShellContext,\n useTestIds,\n withTestIds,\n Progress,\n ErrorState,\n getFocusables,\n useConsolidatedRef,\n StyledButton,\n calculateForegroundColor,\n useFocusTrap,\n readableHue\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n ErrorStateProps\n} from '@pega/cosmos-react-core';\nimport { resizeDrawerDefaultWidth } from '@pega/cosmos-react-core/lib/styles/constants';\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';\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\nimport { StyledCaseHeader } from '../CaseView/CaseView.styles';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'caseType'\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 /** If true, the Case Preview will render in a progress state. */\n progress?: boolean;\n /** If true, the Case Preview will render in an error state. */\n error?: boolean;\n /** Callback fired when \"Try again\" button is clicked in an error state. */\n onErrorRetry?: ErrorStateProps['onRetry'];\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 fixedHeaderHeight?: boolean;\n progressActive?: boolean;\n}>(\n ({\n theme: {\n base: {\n spacing,\n 'z-index': { backdrop, popover }\n },\n components: {\n 'case-view': {\n header: { background, 'foreground-color': color }\n }\n }\n },\n fixedHeaderHeight,\n progressActive\n }) => {\n const foregroundColor = calculateForegroundColor(background, color);\n\n return css`\n color: ${foregroundColor};\n padding: ${spacing} calc(2 * ${spacing}) calc(0.25 * ${spacing});\n\n ${fixedHeaderHeight\n ? css`\n background: ${background};\n `\n : css`\n position: absolute;\n z-index: ${popover + 1};\n `}\n\n ${StyledButton} {\n color: ${foregroundColor};\n\n ${progressActive &&\n css`\n z-index: ${backdrop + 1};\n color: ${foregroundColor};\n `}\n }\n\n ${fixedHeaderHeight &&\n css`\n min-height: 6.625rem;\n `}\n `;\n }\n);\n\nStyledPreviewActions.defaultProps = defaultThemeProp;\n\nconst StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\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 transition-property: transform, box-shadow, opacity, border-inline-start;\n transition-duration: max(${theme.base.animation.speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\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 ${StyledCaseHeader} {\n padding-block-start: calc(\n (2.25 * ${theme.base.spacing}) + ${theme.base['hit-area']['mouse-min']}\n );\n\n @media (pointer: coarse) {\n padding-block-start: calc(\n (2.25 * ${theme.base.spacing}) + ${theme.base['hit-area']['finger-min']}\n );\n }\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 ${StyledGenAICoachContainer} {\n width: unset;\n min-width: unset;\n }\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n box-shadow: none;\n border-inline-start: 0.0625rem solid\n ${readableHue(theme.base.palette['border-line'], theme.base.palette['app-background'], {\n mode: 'both',\n level: 'AANonText'\n })};\n }\n `;\n});\n\nStyledPreviewDrawer.defaultProps = defaultThemeProp;\n\nconst CasePreview: ForwardRefForwardPropsComponent<CasePreviewProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n progress,\n error,\n onErrorRetry,\n caseId,\n caseType,\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 onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const t = useI18n();\n const previewRef = useConsolidatedRef(ref);\n\n const { previewTriggerRef, setPreviewActive } = useContext(AppShellContext);\n const [closeButtonEl, setCloseButtonEl] = useElement<HTMLButtonElement>();\n const isSmallOrAbove = useBreakpoint('sm');\n const [open, setOpen] = useState(openProp);\n const [progressActive, setProgressActive] = useState(false);\n const [progressVisible, setProgressVisible] = useState(false);\n const direction = useDirection();\n\n const closePreview = useCallback(() => {\n setOpen(false);\n previewTriggerRef.current?.focus();\n }, []);\n\n const setFocus = () => {\n if (progressVisible) return;\n\n const focusables = getFocusables(previewRef).filter(el => el !== closeButtonEl);\n const focusable = focusables[0] ?? closeButtonEl;\n focusable?.focus();\n };\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (!progressVisible) {\n setFocus();\n }\n }, [progressVisible]);\n\n useEffect(() => {\n return () => {\n setPreviewActive(false);\n };\n }, []);\n\n useFocusTrap(previewRef, true, [], false);\n\n const content = error ? (\n <ErrorState message={t('preview_error')} onRetry={onErrorRetry} />\n ) : (\n <CaseView\n caseId={caseId}\n caseType={caseType}\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 );\n\n return (\n <Drawer\n data-testid={testIds.root}\n {...restProps}\n onBeforeOpen={() => {\n setPreviewActive(true);\n onBeforeOpen?.();\n }}\n onAfterOpen={() => {\n setFocus();\n onAfterOpen?.();\n }}\n onBeforeClose={() => {\n setPreviewActive(false);\n onBeforeClose?.();\n }}\n as={StyledPreviewDrawer}\n role='complementary'\n forwardedAs={Flex}\n container={{ direction: 'column' }}\n ref={previewRef}\n open={open && isSmallOrAbove}\n position='fixed'\n placement={direction.end}\n aria-label={t('preview_of_noun', [heading])}\n size={resizeDrawerDefaultWidth}\n resizeable\n shadow\n nullWhenClosed\n >\n <StyledPreviewActions\n fixedHeaderHeight={!!error || !!progress}\n progressActive={progressActive}\n >\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 <Progress\n placement='local'\n visible={!!progress}\n focusOnVisible\n delay\n onTransitionStartIn={() => {\n setProgressActive(true);\n setProgressVisible(true);\n }}\n onTransitionStartOut={() => setProgressActive(false)}\n onTransitionEndOut={() => setProgressVisible(false)}\n />\n\n {!progress && content}\n </Drawer>\n );\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
1
+ {"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,QAAQ,EAA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iB,CAAC,OAAO,GAAG,SAAS,CAAC;wBACxC,CAAC;oBACH,CAAC;oBACD,EAAE,EAAE,uBAAuB;oBAC3B,GAAG,EAAE,UAAU;oBACf,QAAQ;oBACR,GAAG,SAAS;iBACb;aACF,CAAC;YACF,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;gBAC9B,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,iBAAiB,CAAC,OAAO,GAAG,aAAa,CAAC,kBAAkB,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACjB,+DAA+D;YAC/D,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;QACxC,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC,CAAC;IAE7F,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useEffect, useState, useRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n registerIcon,\n defaultThemeProp,\n useBreakpoint,\n useI18n,\n useTestIds,\n withTestIds,\n ErrorState,\n useConsolidatedRef,\n StyledPreviewDrawer,\n usePreviewManager\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n ErrorStateProps,\n PreviewMethods\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, { StyledCaseView, StyledCaseViewContent, StyledSummaryRegion } from '../CaseView';\nimport type { CaseViewProps } from '../CaseView';\nimport type { CaseViewContextValue } from '../CaseView/CaseView.types';\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\nimport { StyledSummaryPrimaryList, StyledSummarySecondaryList } from '../CaseView/CaseView.styles';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'color'\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 /** If true, the Case Preview will render in a progress state. */\n progress?: boolean;\n /** If true, the Case Preview will render in an error state. */\n error?: boolean;\n /** Callback fired when \"Try again\" button is clicked in an error state. */\n onErrorRetry?: ErrorStateProps['onRetry'];\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 StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n padding: unset;\n }\n\n ${StyledSummarySecondaryList} {\n padding-block-start: unset;\n padding-inline: unset;\n }\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n z-index: 1;\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 ${StyledGenAICoachContainer} {\n width: unset;\n min-width: unset;\n }\n `;\n});\n\nStyledCasePreviewDrawer.defaultProps = defaultThemeProp;\n\ntype CasePreviewContentProps = Pick<\n CasePreviewProps,\n | 'error'\n | 'onErrorRetry'\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'color'\n | 'followed'\n | 'onFollowedChange'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n | 'actions'\n | 'onEdit'\n>;\n\nconst CasePreviewContent = ({\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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}: CasePreviewContentProps) => {\n const t = useI18n();\n\n if (error) {\n return <ErrorState message={t('preview_error')} onRetry={onErrorRetry} />;\n }\n\n return (\n <CaseView\n caseId={caseId}\n caseType={caseType}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n color={color}\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 );\n};\n\nconst CasePreview: ForwardRefForwardPropsComponent<CasePreviewProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n progress,\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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 onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const { createPreview } = usePreviewManager();\n const previewMethodsRef = useRef<PreviewMethods | undefined>(undefined);\n const previewRef = useConsolidatedRef(ref);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const [open, setOpen] = useState(openProp);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (open && isSmallOrAbove) {\n const contentProps = {\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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 };\n\n const metadata = {\n previewProps: {\n testId: testIds.root,\n previewLabel: typeof heading === 'string' ? heading : heading?.text,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose: () => {\n onAfterClose?.();\n setOpen(false);\n if (previewMethodsRef.current) {\n previewMethodsRef.current.unmountPreview();\n previewMethodsRef.current = undefined;\n }\n },\n as: StyledCasePreviewDrawer,\n ref: previewRef,\n progress,\n ...restProps\n }\n };\n if (previewMethodsRef.current) {\n previewMethodsRef.current.updatePreview(contentProps, metadata);\n } else {\n previewMethodsRef.current = createPreview(CasePreviewContent, contentProps, metadata);\n }\n } else if (!open) {\n // This branch is needed for controlled component via open prop\n previewMethodsRef.current = undefined;\n }\n }, [open, progress, error, tabs, banners, utilities, utilitiesSummaryItems, isSmallOrAbove]);\n\n return null;\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
@@ -1 +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,EA4RjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
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;AA8C5C,QAAA,MAAM,UAAU,EAAE,EAyZjB,CAAC;AAEF,eAAe,UAAU,CAAC"}