@pega/cosmos-react-work 8.0.0-build.4.3 → 8.0.0-build.40.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 (323) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +8 -4
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +6 -4
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/Article/Article.d.ts +2 -6
  6. package/lib/components/Article/Article.d.ts.map +1 -1
  7. package/lib/components/Article/Article.js +2 -7
  8. package/lib/components/Article/Article.js.map +1 -1
  9. package/lib/components/Article/ArticleMeta.js.map +1 -1
  10. package/lib/components/ArticleList/AIArticleSummary.d.ts +1 -2
  11. package/lib/components/ArticleList/AIArticleSummary.d.ts.map +1 -1
  12. package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -1
  13. package/lib/components/ArticleList/ArticleBuddy.js +6 -2
  14. package/lib/components/ArticleList/ArticleBuddy.js.map +1 -1
  15. package/lib/components/ArticleList/ArticleBuddyList.d.ts +0 -1
  16. package/lib/components/ArticleList/ArticleBuddyList.d.ts.map +1 -1
  17. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts +3 -3
  18. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts.map +1 -1
  19. package/lib/components/ArticleList/ArticleBuddyResponse.js +7 -8
  20. package/lib/components/ArticleList/ArticleBuddyResponse.js.map +1 -1
  21. package/lib/components/ArticleList/ArticleFeedback.d.ts +1 -2
  22. package/lib/components/ArticleList/ArticleFeedback.d.ts.map +1 -1
  23. package/lib/components/ArticleList/ArticleFeedback.js.map +1 -1
  24. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -1
  25. package/lib/components/ArticleList/ArticleList.js +4 -4
  26. package/lib/components/ArticleList/ArticleList.js.map +1 -1
  27. package/lib/components/ArticleList/ArticleList.types.d.ts +9 -5
  28. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
  29. package/lib/components/ArticleList/ArticleList.types.js.map +1 -1
  30. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -1
  31. package/lib/components/ArticleList/ArticleListHeader.d.ts +1 -1
  32. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -1
  33. package/lib/components/ArticleList/ArticleListHeader.js +9 -6
  34. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -1
  35. package/lib/components/ArticleList/ArticleSemanticSearch.d.ts +0 -1
  36. package/lib/components/ArticleList/ArticleSemanticSearch.d.ts.map +1 -1
  37. package/lib/components/ArticleList/ArticleSemanticSearch.js +11 -4
  38. package/lib/components/ArticleList/ArticleSemanticSearch.js.map +1 -1
  39. package/lib/components/ArticleList/ArticleSummaryHeader.js +1 -1
  40. package/lib/components/ArticleList/ArticleSummaryHeader.js.map +1 -1
  41. package/lib/components/ArticleList/ArticleTag.d.ts +0 -1
  42. package/lib/components/ArticleList/ArticleTag.d.ts.map +1 -1
  43. package/lib/components/ArticleList/ArticleTag.js +3 -3
  44. package/lib/components/ArticleList/ArticleTag.js.map +1 -1
  45. package/lib/components/ArticleList/QuestionList.d.ts +1 -2
  46. package/lib/components/ArticleList/QuestionList.d.ts.map +1 -1
  47. package/lib/components/ArticleList/QuestionList.js +1 -1
  48. package/lib/components/ArticleList/QuestionList.js.map +1 -1
  49. package/lib/components/ArticleList/RelatedQuestions.d.ts +19 -0
  50. package/lib/components/ArticleList/RelatedQuestions.d.ts.map +1 -0
  51. package/lib/components/ArticleList/RelatedQuestions.js +40 -0
  52. package/lib/components/ArticleList/RelatedQuestions.js.map +1 -0
  53. package/lib/components/ArticleList/index.d.ts +1 -0
  54. package/lib/components/ArticleList/index.d.ts.map +1 -1
  55. package/lib/components/ArticleList/index.js +1 -0
  56. package/lib/components/ArticleList/index.js.map +1 -1
  57. package/lib/components/Assignments/Assignments.js +2 -2
  58. package/lib/components/Assignments/Assignments.js.map +1 -1
  59. package/lib/components/Assignments/Assignments.styles.d.ts +3 -4
  60. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -1
  61. package/lib/components/CaseHierarchy/CaseHierarchy.d.ts +6 -0
  62. package/lib/components/CaseHierarchy/CaseHierarchy.d.ts.map +1 -0
  63. package/lib/components/CaseHierarchy/CaseHierarchy.js +24 -0
  64. package/lib/components/CaseHierarchy/CaseHierarchy.js.map +1 -0
  65. package/lib/components/CaseHierarchy/CaseHierarchy.styles.d.ts +6 -0
  66. package/lib/components/CaseHierarchy/CaseHierarchy.styles.d.ts.map +1 -0
  67. package/lib/components/CaseHierarchy/CaseHierarchy.styles.js +51 -0
  68. package/lib/components/CaseHierarchy/CaseHierarchy.styles.js.map +1 -0
  69. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts +2 -0
  70. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts.map +1 -0
  71. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js +6 -0
  72. package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js.map +1 -0
  73. package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts +23 -0
  74. package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts.map +1 -0
  75. package/lib/components/CaseHierarchy/CaseHierarchy.types.js +2 -0
  76. package/lib/components/CaseHierarchy/CaseHierarchy.types.js.map +1 -0
  77. package/lib/components/CaseHierarchy/index.d.ts +4 -0
  78. package/lib/components/CaseHierarchy/index.d.ts.map +1 -0
  79. package/lib/components/CaseHierarchy/index.js +3 -0
  80. package/lib/components/CaseHierarchy/index.js.map +1 -0
  81. package/lib/components/CasePreview/CasePreview.d.ts +4 -4
  82. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  83. package/lib/components/CasePreview/CasePreview.js +7 -6
  84. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  85. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +1 -1
  86. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -1
  87. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
  88. package/lib/components/CaseView/CaseHeader/CaseHeader.js +4 -3
  89. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
  90. package/lib/components/CaseView/CaseHeader/Summary.d.ts +1 -1
  91. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -1
  92. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -1
  93. package/lib/components/CaseView/CaseView.context.d.ts +0 -1
  94. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -1
  95. package/lib/components/CaseView/CaseView.d.ts +1 -1
  96. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  97. package/lib/components/CaseView/CaseView.js +65 -24
  98. package/lib/components/CaseView/CaseView.js.map +1 -1
  99. package/lib/components/CaseView/CaseView.styles.d.ts +19 -15
  100. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  101. package/lib/components/CaseView/CaseView.styles.js +287 -110
  102. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  103. package/lib/components/CaseView/CaseView.test-ids.d.ts +1 -1
  104. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -1
  105. package/lib/components/CaseView/CaseView.types.d.ts +8 -2
  106. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  107. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  108. package/lib/components/CaseView/UtilitiesSummary.d.ts +1 -0
  109. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  110. package/lib/components/CaseView/UtilitiesSummary.js +85 -19
  111. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  112. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +0 -1
  113. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -1
  114. package/lib/components/CaseView/UtilitySummaryItemDialog.js +1 -1
  115. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -1
  116. package/lib/components/CaseView/index.d.ts +1 -1
  117. package/lib/components/CaseView/index.d.ts.map +1 -1
  118. package/lib/components/CaseView/index.js.map +1 -1
  119. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +0 -1
  120. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  121. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  122. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +0 -1
  123. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  124. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +1 -2
  125. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -1
  126. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -1
  127. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -1
  128. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -1
  129. package/lib/components/Confirmation/Confirmation.d.ts +3 -3
  130. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  131. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  132. package/lib/components/Details/Details.d.ts +6 -4
  133. package/lib/components/Details/Details.d.ts.map +1 -1
  134. package/lib/components/Details/Details.js +4 -4
  135. package/lib/components/Details/Details.js.map +1 -1
  136. package/lib/components/Details/Details.styles.d.ts +1 -1
  137. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  138. package/lib/components/Details/Details.styles.js +17 -4
  139. package/lib/components/Details/Details.styles.js.map +1 -1
  140. package/lib/components/Details/Details.test-ids.d.ts +1 -1
  141. package/lib/components/Details/Details.test-ids.d.ts.map +1 -1
  142. package/lib/components/Details/DetailsContext.d.ts +0 -1
  143. package/lib/components/Details/DetailsContext.d.ts.map +1 -1
  144. package/lib/components/GenAICoach/ConversationHistory.d.ts +5 -0
  145. package/lib/components/GenAICoach/ConversationHistory.d.ts.map +1 -0
  146. package/lib/components/GenAICoach/ConversationHistory.js +73 -0
  147. package/lib/components/GenAICoach/ConversationHistory.js.map +1 -0
  148. package/lib/components/GenAICoach/GenAICoach.d.ts +1 -1
  149. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  150. package/lib/components/GenAICoach/GenAICoach.js +178 -140
  151. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  152. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +24 -14
  153. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  154. package/lib/components/GenAICoach/GenAICoach.styles.js +106 -57
  155. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  156. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts +2 -1
  157. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts.map +1 -1
  158. package/lib/components/GenAICoach/GenAICoach.test-ids.js +9 -1
  159. package/lib/components/GenAICoach/GenAICoach.test-ids.js.map +1 -1
  160. package/lib/components/GenAICoach/GenAICoach.types.d.ts +49 -8
  161. package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
  162. package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
  163. package/lib/components/GenAICoach/GenAICoach.utils.d.ts +1 -1
  164. package/lib/components/GenAICoach/GenAICoach.utils.d.ts.map +1 -1
  165. package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
  166. package/lib/components/GenAICoach/GenAIMessage.js +77 -13
  167. package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
  168. package/lib/components/GenAICoach/InitialSuggestedMessage.js +1 -1
  169. package/lib/components/GenAICoach/InitialSuggestedMessage.js.map +1 -1
  170. package/lib/components/GenAICoach/index.d.ts +1 -1
  171. package/lib/components/GenAICoach/index.d.ts.map +1 -1
  172. package/lib/components/GenAICoach/index.js.map +1 -1
  173. package/lib/components/Glimpse/Glimpse.d.ts +3 -3
  174. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  175. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  176. package/lib/components/HierarchicalAssignments/AssignmentContext.d.ts +28 -0
  177. package/lib/components/HierarchicalAssignments/AssignmentContext.d.ts.map +1 -0
  178. package/lib/components/HierarchicalAssignments/AssignmentContext.js +14 -0
  179. package/lib/components/HierarchicalAssignments/AssignmentContext.js.map +1 -0
  180. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts +4 -2
  181. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts.map +1 -1
  182. package/lib/components/HierarchicalAssignments/AssignmentDetail.js +2 -2
  183. package/lib/components/HierarchicalAssignments/AssignmentDetail.js.map +1 -1
  184. package/lib/components/HierarchicalAssignments/AssignmentNode.d.ts +19 -0
  185. package/lib/components/HierarchicalAssignments/AssignmentNode.d.ts.map +1 -0
  186. package/lib/components/HierarchicalAssignments/AssignmentNode.js +33 -0
  187. package/lib/components/HierarchicalAssignments/AssignmentNode.js.map +1 -0
  188. package/lib/components/HierarchicalAssignments/AssignmentTree.d.ts +15 -0
  189. package/lib/components/HierarchicalAssignments/AssignmentTree.d.ts.map +1 -0
  190. package/lib/components/HierarchicalAssignments/AssignmentTree.js +21 -0
  191. package/lib/components/HierarchicalAssignments/AssignmentTree.js.map +1 -0
  192. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts +31 -31
  193. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
  194. package/lib/components/HierarchicalAssignments/Assignments.styles.js +85 -69
  195. package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
  196. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts +2 -3
  197. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts.map +1 -1
  198. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js +117 -9
  199. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js.map +1 -1
  200. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts +3 -3
  201. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts.map +1 -1
  202. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.js +2 -1
  203. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.js.map +1 -1
  204. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +12 -12
  205. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
  206. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
  207. package/lib/components/HierarchicalAssignments/helpers.d.ts +23 -0
  208. package/lib/components/HierarchicalAssignments/helpers.d.ts.map +1 -0
  209. package/lib/components/HierarchicalAssignments/helpers.js +167 -0
  210. package/lib/components/HierarchicalAssignments/helpers.js.map +1 -0
  211. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +18 -0
  212. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -0
  213. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +105 -0
  214. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -0
  215. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts +23 -0
  216. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts.map +1 -0
  217. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js +105 -0
  218. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js.map +1 -0
  219. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.d.ts +23 -0
  220. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.d.ts.map +1 -0
  221. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.js +42 -0
  222. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.js.map +1 -0
  223. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +2 -3
  224. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  225. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +5 -2
  226. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  227. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +2 -3
  228. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  229. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +32 -21
  230. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  231. package/lib/components/InteractionNotification/CountdownButton.d.ts +3 -3
  232. package/lib/components/InteractionNotification/CountdownButton.d.ts.map +1 -1
  233. package/lib/components/InteractionNotification/CountdownButton.js +1 -1
  234. package/lib/components/InteractionNotification/CountdownButton.js.map +1 -1
  235. package/lib/components/InteractionNotification/InteractionNotification.d.ts +3 -3
  236. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
  237. package/lib/components/InteractionNotification/InteractionNotification.js +1 -1
  238. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
  239. package/lib/components/Predictions/Predictions.d.ts +2 -3
  240. package/lib/components/Predictions/Predictions.d.ts.map +1 -1
  241. package/lib/components/Predictions/Predictions.js +1 -0
  242. package/lib/components/Predictions/Predictions.js.map +1 -1
  243. package/lib/components/SearchResults/ActiveFilter.d.ts +1 -2
  244. package/lib/components/SearchResults/ActiveFilter.d.ts.map +1 -1
  245. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  246. package/lib/components/SearchResults/Filter.js.map +1 -1
  247. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  248. package/lib/components/SearchResults/SearchResults.d.ts +2 -3
  249. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  250. package/lib/components/SearchResults/SearchResults.js +1 -2
  251. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  252. package/lib/components/SearchResults/SearchResults.styles.d.ts +1 -2
  253. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  254. package/lib/components/Stages/StageGlimpse.js +1 -1
  255. package/lib/components/Stages/StageGlimpse.js.map +1 -1
  256. package/lib/components/Stages/Stages.d.ts +2 -3
  257. package/lib/components/Stages/Stages.d.ts.map +1 -1
  258. package/lib/components/Stages/Stages.js +4 -1
  259. package/lib/components/Stages/Stages.js.map +1 -1
  260. package/lib/components/Stages/Stages.styles.d.ts +7 -6
  261. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  262. package/lib/components/Stages/Stages.styles.js +6 -10
  263. package/lib/components/Stages/Stages.styles.js.map +1 -1
  264. package/lib/components/Stakeholders/StakeholderForm.d.ts +1 -2
  265. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -1
  266. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -1
  267. package/lib/components/Stakeholders/Stakeholders.d.ts +2 -3
  268. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  269. package/lib/components/Stakeholders/Stakeholders.js +37 -26
  270. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  271. package/lib/components/Tags/Tags.d.ts +5 -5
  272. package/lib/components/Tags/Tags.d.ts.map +1 -1
  273. package/lib/components/Tags/Tags.js.map +1 -1
  274. package/lib/components/Tasks/TaskList.d.ts +13 -8
  275. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  276. package/lib/components/Tasks/TaskList.js +15 -7
  277. package/lib/components/Tasks/TaskList.js.map +1 -1
  278. package/lib/components/Tasks/Tasks.d.ts +8 -3
  279. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  280. package/lib/components/Tasks/Tasks.js +14 -4
  281. package/lib/components/Tasks/Tasks.js.map +1 -1
  282. package/lib/components/Tasks/Tasks.test-ids.d.ts +3 -3
  283. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -1
  284. package/lib/components/Timeline/Timeline.d.ts +3 -3
  285. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  286. package/lib/components/Timeline/Timeline.js +9 -2
  287. package/lib/components/Timeline/Timeline.js.map +1 -1
  288. package/lib/components/Timeline/Timeline.styles.d.ts +5 -6
  289. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  290. package/lib/components/Timeline/Timeline.styles.js +10 -3
  291. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  292. package/lib/components/Timeline/Timeline.types.d.ts +11 -1
  293. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  294. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  295. package/lib/components/Timeline/TimelineItem.d.ts +1 -2
  296. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  297. package/lib/components/Timeline/TimelineItem.js +10 -9
  298. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  299. package/lib/components/Timeline/TimelineToolbar.d.ts +2 -3
  300. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -1
  301. package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
  302. package/lib/components/Timeline/utils.js.map +1 -1
  303. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts +5 -0
  304. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts.map +1 -1
  305. package/lib/components/UtilitiesLayout/UtilitiesLayout.js +3 -3
  306. package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -1
  307. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts +2 -4
  308. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -1
  309. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js +2 -5
  310. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js.map +1 -1
  311. package/lib/index.d.ts +2 -0
  312. package/lib/index.d.ts.map +1 -1
  313. package/lib/index.js +2 -0
  314. package/lib/index.js.map +1 -1
  315. package/package.json +10 -9
  316. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts +0 -33
  317. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts.map +0 -1
  318. package/lib/components/HierarchicalAssignments/AssignmentContainer.js +0 -46
  319. package/lib/components/HierarchicalAssignments/AssignmentContainer.js.map +0 -1
  320. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts +0 -11
  321. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts.map +0 -1
  322. package/lib/components/HierarchicalAssignments/AssignmentItem.js +0 -22
  323. package/lib/components/HierarchicalAssignments/AssignmentItem.js.map +0 -1
@@ -5,20 +5,30 @@ import { Card, CardHeader, CardContent, CardFooter, Button, useI18n, defaultThem
5
5
  import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
6
6
  import TaskList, { TaskItem } from './TaskList';
7
7
  import { getTasksTestIds } from './Tasks.test-ids';
8
- export const StyledTasks = styled(Card)(({ theme, openItem }) => {
8
+ export const StyledTasks = styled(Card)(({ theme, openItem, fitToParent }) => {
9
9
  return openItem
10
10
  ? css `
11
11
  box-shadow: ${theme.base.shadow.low};
12
+ min-block-size: ${fitToParent ? '100%' : 'auto'};
12
13
  `
13
14
  : css `
15
+ min-block-size: ${fitToParent ? '100%' : 'auto'};
16
+
14
17
  ${StyledCardHeader}:not(& & > ${StyledCardHeader}) {
15
18
  padding-block-end: calc(${theme.base.spacing} / 2);
16
19
  }
17
20
  `;
18
21
  });
22
+ const StyledCardContent = styled(CardContent) `
23
+ overflow: auto;
24
+ flex-grow: 1;
25
+ flex-basis: 0;
26
+ min-block-size: 0;
27
+ min-inline-size: 0;
28
+ `;
19
29
  StyledTasks.defaultProps = defaultThemeProp;
20
30
  const Tasks = (props) => {
21
- const { testId, items = [], name, avatar, viewSelector, count = items.length, search, loadingMore = false, onExpandToggle, ...restProps } = props;
31
+ const { testId, items = [], name, avatar, viewSelector, count = items.length, search, loadingMore = false, fitToParent = false, onExpandToggle, ...restProps } = props;
22
32
  const testIds = useTestIds(testId, getTasksTestIds);
23
33
  const openItem = items.find(item => item.content);
24
34
  const t = useI18n();
@@ -27,14 +37,14 @@ const Tasks = (props) => {
27
37
  const containerRef = useRef(null);
28
38
  const hasFooter = !!(!openItem && onExpandToggle && count > 0);
29
39
  const TaskItems = useMemo(() => {
30
- return openItem ? (_jsx(TaskItem, { ...openItem })) : (_jsx(TaskList, { items: items, hasFooter: hasFooter, testId: testIds.root }));
40
+ return openItem ? (_jsx(TaskItem, { ...openItem, headingTag: 'h2' })) : (_jsx(TaskList, { items: items, hasFooter: hasFooter, testId: testIds.root }));
31
41
  }, [items, openItem]);
32
42
  useEffect(() => {
33
43
  if (!loadingMore && getActiveElement() === progressRef.current && toggleButtonRef.current) {
34
44
  toggleButtonRef?.current.focus();
35
45
  }
36
46
  }, [loadingMore]);
37
- return (_jsxs(StyledTasks, { "data-testid": testIds.root, ...restProps, openItem: !!openItem, "data-app-region": true, ref: containerRef, children: [!openItem && (_jsxs(CardHeader, { container: { justify: 'start', alignItems: 'center', gap: 1 }, children: [avatar && _jsx(Avatar, { ...avatar }), _jsx(ListToolbar, { name: name, headingTag: 'h2', viewSelector: viewSelector, count: { total: count }, search: search, item: { grow: 1 } })] })), _jsx(CardContent, { children: items.length > 0 ? TaskItems : _jsx(EmptyState, {}) }), _jsx(Progress, { placement: 'block', ref: progressRef, visible: loadingMore, focusOnVisible: true }), hasFooter && !loadingMore && (_jsx(CardFooter, { justify: 'center', children: _jsx(Button, { "data-testid": testIds.showMoreLess, variant: 'link', "aria-label": t(!!count && count > items.length ? 'show_more' : 'show_less', ['tasks']), onClick: (e) => {
47
+ return (_jsxs(StyledTasks, { "data-testid": testIds.root, ...restProps, openItem: !!openItem, fitToParent: fitToParent, "data-app-region": true, ref: containerRef, children: [!openItem && (_jsxs(CardHeader, { container: { justify: 'start', alignItems: 'center', gap: 1 }, children: [avatar && _jsx(Avatar, { ...avatar }), _jsx(ListToolbar, { name: name, headingTag: 'h2', viewSelector: viewSelector, count: { total: count }, search: search, item: { grow: 1 } })] })), fitToParent ? (_jsx(StyledCardContent, { children: items.length > 0 ? TaskItems : _jsx(EmptyState, {}) })) : (_jsx(CardContent, { children: items.length > 0 ? TaskItems : _jsx(EmptyState, {}) })), _jsx(Progress, { placement: 'block', ref: progressRef, visible: loadingMore, focusOnVisible: true }), hasFooter && !loadingMore && (_jsx(CardFooter, { justify: 'center', children: _jsx(Button, { "data-testid": testIds.showMoreLess, variant: 'link', "aria-label": t(!!count && count > items.length ? 'show_more' : 'show_less', ['tasks']), onClick: (e) => {
38
48
  onExpandToggle?.();
39
49
  if (!!count && count <= items.length) {
40
50
  const { currentTarget } = e;
@@ -1 +1 @@
1
- {"version":3,"file":"Tasks.js","sourceRoot":"","sources":["../../../src/components/Tasks/Tasks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,EACX,QAAQ,EACR,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAG1F,OAAO,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAwBnD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtF,OAAO,QAAQ;QACb,CAAC,CAAC,GAAG,CAAA;sBACa,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG;OACpC;QACH,CAAC,CAAC,GAAG,CAAA;UACC,gBAAgB,cAAc,gBAAgB;oCACpB,KAAK,CAAC,IAAI,CAAC,OAAO;;OAE/C,CAAC;AACR,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,KAAK,GAAkC,C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I,KAAK,CAAC,MAAM,EAAE;4BACpC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;4BAC5B,qBAAqB,CAAC,GAAG,EAAE;gCACzB,IAAI,aAAa,CAAC,qBAAqB,EAAE,CAAC,GAAG,GAAG,CAAC;oCAAE,aAAa,CAAC,cAAc,EAAE,CAAC;4BACpF,CAAC,CAAC,CAAC;yBACJ;oBACH,CAAC,EACD,GAAG,EAAE,eAAe,YAEnB,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,GACxD,GACE,CACd,IACW,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import { useEffect, useMemo, useRef } from 'react';\nimport type { FC, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Card,\n CardHeader,\n CardContent,\n CardFooter,\n Button,\n useI18n,\n defaultThemeProp,\n ListToolbar,\n EmptyState,\n useTestIds,\n Avatar,\n withTestIds,\n Progress,\n getActiveElement\n} from '@pega/cosmos-react-core';\nimport type {\n AvatarProps,\n ForwardProps,\n ListToolbarProps,\n NoChildrenProp,\n SearchInputProps,\n TestIdProp\n} from '@pega/cosmos-react-core';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport type { ViewSelectorProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\n\nimport TaskList, { TaskItem } from './TaskList';\nimport type { TaskItemProps } from './TaskList';\nimport { getTasksTestIds } from './Tasks.test-ids';\n\nexport interface TasksProps extends NoChildrenProp, TestIdProp {\n /** An array of TaskItemProps to generate the list. */\n items: TaskItemProps[];\n /** Heading text to render at the top of the list. */\n name: ListToolbarProps['name'];\n /** A visual to accompany the header text. */\n avatar?: Pick<AvatarProps, 'name' | 'icon' | 'imageSrc' | 'status'>;\n /** Definition of view selection. */\n viewSelector?: Pick<ViewSelectorProps, 'views' | 'onViewSelect'>;\n /** Integer representing the total count of tasks. */\n count?: number;\n /** Opt-in search configuration. */\n search?: Pick<SearchInputProps, 'value' | 'onSearchChange'>;\n /** Callback for when to show more/less button is clicked. Lists greater than 3 items will display the show toggle button in its footer if passed. */\n onExpandToggle?: () => void;\n /**\n * Flag indicating more items are being fetched\n * @default false\n */\n loadingMore?: boolean;\n}\n\nexport const StyledTasks = styled(Card)<{ openItem?: boolean }>(({ theme, openItem }) => {\n return openItem\n ? css`\n box-shadow: ${theme.base.shadow.low};\n `\n : css`\n ${StyledCardHeader}:not(& & > ${StyledCardHeader}) {\n padding-block-end: calc(${theme.base.spacing} / 2);\n }\n `;\n});\n\nStyledTasks.defaultProps = defaultThemeProp;\n\nconst Tasks: FC<ForwardProps & TasksProps> = (props: TasksProps) => {\n const {\n testId,\n items = [],\n name,\n avatar,\n viewSelector,\n count = items.length,\n search,\n loadingMore = false,\n onExpandToggle,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getTasksTestIds);\n const openItem = items.find(item => item.content);\n const t = useI18n();\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const progressRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const hasFooter = !!(!openItem && onExpandToggle && count > 0);\n\n const TaskItems = useMemo(() => {\n return openItem ? (\n <TaskItem {...openItem} />\n ) : (\n <TaskList items={items} hasFooter={hasFooter} testId={testIds.root} />\n );\n }, [items, openItem]);\n\n useEffect(() => {\n if (!loadingMore && getActiveElement() === progressRef.current && toggleButtonRef.current) {\n toggleButtonRef?.current.focus();\n }\n }, [loadingMore]);\n\n return (\n <StyledTasks\n data-testid={testIds.root}\n {...restProps}\n openItem={!!openItem}\n data-app-region\n ref={containerRef}\n >\n {!openItem && (\n <CardHeader container={{ justify: 'start', alignItems: 'center', gap: 1 }}>\n {avatar && <Avatar {...avatar} />}\n <ListToolbar\n name={name}\n headingTag='h2'\n viewSelector={viewSelector}\n count={{ total: count }}\n search={search}\n item={{ grow: 1 }}\n />\n </CardHeader>\n )}\n\n <CardContent>{items.length > 0 ? TaskItems : <EmptyState />}</CardContent>\n\n <Progress placement='block' ref={progressRef} visible={loadingMore} focusOnVisible />\n {hasFooter && !loadingMore && (\n <CardFooter justify='center'>\n <Button\n data-testid={testIds.showMoreLess}\n variant='link'\n aria-label={t(!!count && count > items.length ? 'show_more' : 'show_less', ['tasks'])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onExpandToggle?.();\n if (!!count && count <= items.length) {\n const { currentTarget } = e;\n requestAnimationFrame(() => {\n if (currentTarget.getBoundingClientRect().top < 0) currentTarget.scrollIntoView();\n });\n }\n }}\n ref={toggleButtonRef}\n >\n {t(!!count && count > items.length ? 'show_more' : 'show_less')}\n </Button>\n </CardFooter>\n )}\n </StyledTasks>\n );\n};\n\nexport default withTestIds(Tasks, getTasksTestIds);\n"]}
1
+ {"version":3,"file":"Tasks.js","sourceRoot":"","sources":["../../../src/components/Tasks/Tasks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,EACX,QAAQ,EACR,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAG1F,OAAO,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA4BnD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,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CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,GACxD,GACE,CACd,IACW,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import { useEffect, useMemo, useRef } from 'react';\nimport type { FC, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Card,\n CardHeader,\n CardContent,\n CardFooter,\n Button,\n useI18n,\n defaultThemeProp,\n ListToolbar,\n EmptyState,\n useTestIds,\n Avatar,\n withTestIds,\n Progress,\n getActiveElement\n} from '@pega/cosmos-react-core';\nimport type {\n AvatarProps,\n ForwardProps,\n ListToolbarProps,\n NoChildrenProp,\n SearchInputProps,\n TestIdProp\n} from '@pega/cosmos-react-core';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport type { ViewSelectorProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\n\nimport TaskList, { TaskItem } from './TaskList';\nimport type { TaskItemProps } from './TaskList';\nimport { getTasksTestIds } from './Tasks.test-ids';\n\nexport interface TasksProps extends NoChildrenProp, TestIdProp {\n /** An array of TaskItemProps to generate the list. */\n items: TaskItemProps[];\n /** Heading text to render at the top of the list. */\n name: ListToolbarProps['name'];\n /** A visual to accompany the header text. */\n avatar?: Pick<AvatarProps, 'name' | 'icon' | 'imageSrc' | 'status'>;\n /** Definition of view selection. */\n viewSelector?: Pick<ViewSelectorProps, 'views' | 'onViewSelect'>;\n /** Integer representing the total count of tasks. */\n count?: number;\n /** Opt-in search configuration. */\n search?: Pick<SearchInputProps, 'value' | 'onSearchChange'>;\n /** Callback for when to show more/less button is clicked. Lists greater than 3 items will display the show toggle button in its footer if passed. */\n onExpandToggle?: () => void;\n /**\n * Flag indicating more items are being fetched\n * @default false\n */\n loadingMore?: boolean;\n /**\n * Whether to fit Tasks widget in the parent element.\n */\n fitToParent?: boolean;\n}\n\nexport const StyledTasks = styled(Card)<{ openItem?: boolean; fitToParent?: boolean }>(({\n theme,\n openItem,\n fitToParent\n}) => {\n return openItem\n ? css`\n box-shadow: ${theme.base.shadow.low};\n min-block-size: ${fitToParent ? '100%' : 'auto'};\n `\n : css`\n min-block-size: ${fitToParent ? '100%' : 'auto'};\n\n ${StyledCardHeader}:not(& & > ${StyledCardHeader}) {\n padding-block-end: calc(${theme.base.spacing} / 2);\n }\n `;\n});\n\nconst StyledCardContent = styled(CardContent)`\n overflow: auto;\n flex-grow: 1;\n flex-basis: 0;\n min-block-size: 0;\n min-inline-size: 0;\n`;\n\nStyledTasks.defaultProps = defaultThemeProp;\n\nconst Tasks: FC<ForwardProps & TasksProps> = (props: TasksProps) => {\n const {\n testId,\n items = [],\n name,\n avatar,\n viewSelector,\n count = items.length,\n search,\n loadingMore = false,\n fitToParent = false,\n onExpandToggle,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getTasksTestIds);\n const openItem = items.find(item => item.content);\n const t = useI18n();\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const progressRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const hasFooter = !!(!openItem && onExpandToggle && count > 0);\n\n const TaskItems = useMemo(() => {\n return openItem ? (\n <TaskItem {...openItem} headingTag='h2' />\n ) : (\n <TaskList items={items} hasFooter={hasFooter} testId={testIds.root} />\n );\n }, [items, openItem]);\n\n useEffect(() => {\n if (!loadingMore && getActiveElement() === progressRef.current && toggleButtonRef.current) {\n toggleButtonRef?.current.focus();\n }\n }, [loadingMore]);\n\n return (\n <StyledTasks\n data-testid={testIds.root}\n {...restProps}\n openItem={!!openItem}\n fitToParent={fitToParent}\n data-app-region\n ref={containerRef}\n >\n {!openItem && (\n <CardHeader container={{ justify: 'start', alignItems: 'center', gap: 1 }}>\n {avatar && <Avatar {...avatar} />}\n <ListToolbar\n name={name}\n headingTag='h2'\n viewSelector={viewSelector}\n count={{ total: count }}\n search={search}\n item={{ grow: 1 }}\n />\n </CardHeader>\n )}\n\n {fitToParent ? (\n <StyledCardContent>{items.length > 0 ? TaskItems : <EmptyState />}</StyledCardContent>\n ) : (\n <CardContent>{items.length > 0 ? TaskItems : <EmptyState />}</CardContent>\n )}\n\n <Progress placement='block' ref={progressRef} visible={loadingMore} focusOnVisible />\n {hasFooter && !loadingMore && (\n <CardFooter justify='center'>\n <Button\n data-testid={testIds.showMoreLess}\n variant='link'\n aria-label={t(!!count && count > items.length ? 'show_more' : 'show_less', ['tasks'])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onExpandToggle?.();\n if (!!count && count <= items.length) {\n const { currentTarget } = e;\n requestAnimationFrame(() => {\n if (currentTarget.getBoundingClientRect().top < 0) currentTarget.scrollIntoView();\n });\n }\n }}\n ref={toggleButtonRef}\n >\n {t(!!count && count > items.length ? 'show_more' : 'show_less')}\n </Button>\n </CardFooter>\n )}\n </StyledTasks>\n );\n};\n\nexport default withTestIds(Tasks, getTasksTestIds);\n"]}
@@ -1,4 +1,4 @@
1
- export declare const getTasksTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["show-more-less"]>;
2
- export declare const getTaskListTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
3
- export declare const getTaskItemTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["open-task"]>;
1
+ export declare const getTasksTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["show-more-less"]>;
2
+ export declare const getTaskListTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
3
+ export declare const getTaskItemTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["open-task"]>;
4
4
  //# sourceMappingURL=Tasks.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tasks.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tasks/Tasks.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,0HAAsD,CAAC;AAEnF,eAAO,MAAM,kBAAkB,0GAA0C,CAAC;AAE1E,eAAO,MAAM,kBAAkB,qHAAqD,CAAC"}
1
+ {"version":3,"file":"Tasks.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tasks/Tasks.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,uJAAsD,CAAC;AAEnF,eAAO,MAAM,kBAAkB,uIAA0C,CAAC;AAE1E,eAAO,MAAM,kBAAkB,kJAAqD,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '@pega/cosmos-react-core';
1
+ import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
3
2
  import type TimelineProps from './Timeline.types';
4
- declare const Timeline: FunctionComponent<TimelineProps & ForwardProps>;
3
+ /** @deprecated */
4
+ declare const Timeline: ForwardRefForwardPropsComponent<TimelineProps>;
5
5
  export default Timeline;
6
6
  //# sourceMappingURL=Timeline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAShE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAUlD,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA+E5D,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAUlD,kBAAkB;AAClB,QAAA,MAAM,QAAQ,EAAE,+BAA+B,CAAC,aAAa,CAmF3D,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -4,6 +4,7 @@ import { Progress, useConsolidatedRef, useItemIntersection, DateTimeDisplay, Gri
4
4
  import { groupByActivity } from './utils';
5
5
  import { StyledDate, StyledTimeline, StyledLoadingCell, StyledTimelineListItem, StyledTimelineList } from './Timeline.styles';
6
6
  import TimelineItem from './TimelineItem';
7
+ /** @deprecated */
7
8
  const Timeline = forwardRef(function Timeline({ activity, currentTime, groupBy = 'date', loading, loadMore, ...restProps }, ref) {
8
9
  const listRef = useConsolidatedRef(ref);
9
10
  useItemIntersection(listRef, activity.length - 1, () => {
@@ -15,8 +16,14 @@ const Timeline = forwardRef(function Timeline({ activity, currentTime, groupBy =
15
16
  colGap: 0.75,
16
17
  alignItems: 'start'
17
18
  }, sm: { container: { cols: 'auto auto 1fr', colGap: 0.25 } }, as: StyledTimeline, ref: listRef, children: [groupBy === 'none'
18
- ? activity.map((item, index) => (_jsx(TimelineItem, { item: item, timeFormat: 'datetime', prevItemDate: activity[index - 1]?.date, nextItemDate: activity[index + 1]?.date, currentTime: currentTime }, item.id)))
19
- : groupByActivity(activity, groupBy).map(groupedData => (_jsxs(Grid, { item: { colStartEnd: '1/-1' }, as: StyledTimelineListItem, children: [_jsx(DateTimeDisplay, { as: StyledDate, variant: groupBy, format: 'long', value: groupedData[0].date }), _jsx(StyledTimelineList, { children: groupedData.map((item, index) => (_jsx(TimelineItem, { item: item, timeFormat: groupBy === 'date' ? 'time' : 'datetime', prevItemDate: groupedData[index - 1]?.date, nextItemDate: groupedData[index + 1]?.date, currentTime: currentTime }, item.id))) })] }, groupedData[0].id))), loading && (_jsx(StyledTimelineListItem, { children: _jsx(StyledLoadingCell, { children: _jsx(Progress, { placement: 'local' }) }) }))] }));
19
+ ? activity.map((item, index) => (_jsx(TimelineItem, { item: item, prevItemDate: activity[index - 1]?.date, nextItemDate: activity[index + 1]?.date, currentTime: currentTime }, item.id)))
20
+ : groupByActivity(activity, groupBy).map(groupedData => (_jsxs(Grid, { item: { colStartEnd: '1/-1' }, as: StyledTimelineListItem, children: [_jsx(DateTimeDisplay, { as: StyledDate, variant: groupBy, format: 'long', value: groupedData[0].date }), _jsx(StyledTimelineList, { children: groupedData.map((item, index) => (_jsx(TimelineItem, { item: {
21
+ ...item,
22
+ ...(groupBy === 'date' &&
23
+ (!item.dateVariant || item.dateVariant === 'datetime') && {
24
+ dateVariant: 'time'
25
+ })
26
+ }, prevItemDate: groupedData[index - 1]?.date, nextItemDate: groupedData[index + 1]?.date, currentTime: currentTime }, item.id))) })] }, groupedData[0].id))), loading && (_jsx(StyledTimelineListItem, { children: _jsx(StyledLoadingCell, { children: _jsx(Progress, { placement: 'local' }) }) }))] }));
20
27
  });
21
28
  export default Timeline;
22
29
  //# sourceMappingURL=Timeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,IAAI,EACL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,QAAQ,GAAoD,UAAU,CAAC,SAAS,QAAQ,CAC5F,EACE,QAAQ,EACR,WAAW,EACX,OAAO,GAAG,MAAM,EAChB,OAAO,EACP,QAAQ,EACR,GAAG,SAAS,EACmB,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AI,GAC1B,EACF,KAAC,kBAAkB,cAChB,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAChC,KAAC,YAAY,IAEX,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EACpD,YAAY,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAC1C,YAAY,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAC1C,WAAW,EAAE,WAAW,IALnB,IAAI,CAAC,EAAE,CAMZ,CACH,CAAC,GACiB,KAnBhB,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAoBjB,CACR,CAAC,EACL,OAAO,IAAI,CACV,KAAC,sBAAsB,cACrB,KAAC,iBAAiB,cAChB,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,GACZ,GACG,CAC1B,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport {\n Progress,\n useConsolidatedRef,\n useItemIntersection,\n DateTimeDisplay,\n Grid\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport { groupByActivity } from './utils';\nimport type TimelineProps from './Timeline.types';\nimport {\n StyledDate,\n StyledTimeline,\n StyledLoadingCell,\n StyledTimelineListItem,\n StyledTimelineList\n} from './Timeline.styles';\nimport TimelineItem from './TimelineItem';\n\nconst Timeline: FunctionComponent<TimelineProps & ForwardProps> = forwardRef(function Timeline(\n {\n activity,\n currentTime,\n groupBy = 'date',\n loading,\n loadMore,\n ...restProps\n }: PropsWithoutRef<TimelineProps>,\n ref: TimelineProps['ref']\n) {\n const listRef = useConsolidatedRef(ref);\n useItemIntersection(\n listRef,\n activity.length - 1,\n () => {\n if (!loading) loadMore?.();\n },\n ':scope li > div'\n );\n\n return (\n <Grid\n {...restProps}\n container={{\n cols: 'auto 1fr',\n colGap: 0.75,\n alignItems: 'start'\n }}\n sm={{ container: { cols: 'auto auto 1fr', colGap: 0.25 } }}\n as={StyledTimeline}\n ref={listRef}\n >\n {groupBy === 'none'\n ? activity.map((item, index) => (\n <TimelineItem\n key={item.id}\n item={item}\n timeFormat='datetime'\n prevItemDate={activity[index - 1]?.date}\n nextItemDate={activity[index + 1]?.date}\n currentTime={currentTime}\n />\n ))\n : groupByActivity(activity, groupBy).map(groupedData => (\n <Grid\n item={{ colStartEnd: '1/-1' }}\n as={StyledTimelineListItem}\n key={groupedData[0].id}\n >\n <DateTimeDisplay\n as={StyledDate}\n variant={groupBy}\n format='long'\n value={groupedData[0].date}\n />\n <StyledTimelineList>\n {groupedData.map((item, index) => (\n <TimelineItem\n key={item.id}\n item={item}\n timeFormat={groupBy === 'date' ? 'time' : 'datetime'}\n prevItemDate={groupedData[index - 1]?.date}\n nextItemDate={groupedData[index + 1]?.date}\n currentTime={currentTime}\n />\n ))}\n </StyledTimelineList>\n </Grid>\n ))}\n {loading && (\n <StyledTimelineListItem>\n <StyledLoadingCell>\n <Progress placement='local' />\n </StyledLoadingCell>\n </StyledTimelineListItem>\n )}\n </Grid>\n );\n});\n\nexport default Timeline;\n"]}
1
+ {"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,IAAI,EACL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AA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AE,MAAM,EAAE,EAC7B,EAAE,EAAE,sBAAsB,aAG1B,KAAC,eAAe,IACd,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAC,MAAM,EACb,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,GAC1B,EACF,KAAC,kBAAkB,cAChB,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAChC,KAAC,YAAY,IAEX,IAAI,EAAE;oCACJ,GAAG,IAAI;oCACP,GAAG,CAAC,OAAO,KAAK,MAAM;wCACpB,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,KAAK,UAAU,CAAC,IAAI;wCACxD,WAAW,EAAE,MAAM;qCACpB,CAAC;iCACL,EACD,YAAY,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAC1C,YAAY,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAC1C,WAAW,EAAE,WAAW,IAVnB,IAAI,CAAC,EAAE,CAWZ,CACH,CAAC,GACiB,KAxBhB,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAyBjB,CACR,CAAC,EACL,OAAO,IAAI,CACV,KAAC,sBAAsB,cACrB,KAAC,iBAAiB,cAChB,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,GACZ,GACG,CAC1B,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Progress,\n useConsolidatedRef,\n useItemIntersection,\n DateTimeDisplay,\n Grid\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport { groupByActivity } from './utils';\nimport type TimelineProps from './Timeline.types';\nimport {\n StyledDate,\n StyledTimeline,\n StyledLoadingCell,\n StyledTimelineListItem,\n StyledTimelineList\n} from './Timeline.styles';\nimport TimelineItem from './TimelineItem';\n\n/** @deprecated */\nconst Timeline: ForwardRefForwardPropsComponent<TimelineProps> = forwardRef(function Timeline(\n {\n activity,\n currentTime,\n groupBy = 'date',\n loading,\n loadMore,\n ...restProps\n }: PropsWithoutRef<TimelineProps>,\n ref: TimelineProps['ref']\n) {\n const listRef = useConsolidatedRef(ref);\n useItemIntersection(\n listRef,\n activity.length - 1,\n () => {\n if (!loading) loadMore?.();\n },\n ':scope li > div'\n );\n\n return (\n <Grid\n {...restProps}\n container={{\n cols: 'auto 1fr',\n colGap: 0.75,\n alignItems: 'start'\n }}\n sm={{ container: { cols: 'auto auto 1fr', colGap: 0.25 } }}\n as={StyledTimeline}\n ref={listRef}\n >\n {groupBy === 'none'\n ? activity.map((item, index) => (\n <TimelineItem\n key={item.id}\n item={item}\n prevItemDate={activity[index - 1]?.date}\n nextItemDate={activity[index + 1]?.date}\n currentTime={currentTime}\n />\n ))\n : groupByActivity(activity, groupBy).map(groupedData => (\n <Grid\n item={{ colStartEnd: '1/-1' }}\n as={StyledTimelineListItem}\n key={groupedData[0].id}\n >\n <DateTimeDisplay\n as={StyledDate}\n variant={groupBy}\n format='long'\n value={groupedData[0].date}\n />\n <StyledTimelineList>\n {groupedData.map((item, index) => (\n <TimelineItem\n key={item.id}\n item={{\n ...item,\n ...(groupBy === 'date' &&\n (!item.dateVariant || item.dateVariant === 'datetime') && {\n dateVariant: 'time'\n })\n }}\n prevItemDate={groupedData[index - 1]?.date}\n nextItemDate={groupedData[index + 1]?.date}\n currentTime={currentTime}\n />\n ))}\n </StyledTimelineList>\n </Grid>\n ))}\n {loading && (\n <StyledTimelineListItem>\n <StyledLoadingCell>\n <Progress placement='local' />\n </StyledLoadingCell>\n </StyledTimelineListItem>\n )}\n </Grid>\n );\n});\n\nexport default Timeline;\n"]}
@@ -1,12 +1,11 @@
1
- /// <reference types="react" />
2
- export declare const StyledCard: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const StyledCard: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").CardProps>, import("styled-components").DefaultTheme, {}, never>;
3
2
  export declare const StyledTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
3
  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, {}, never>;
5
- export declare const StyledToggleButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {
4
+ export declare const StyledToggleButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {
6
5
  collapsed: boolean;
7
6
  }, never>;
8
- export declare const StyledCardHeader: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core/lib/components/Grid/Grid.types").default & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
9
- export declare const StyledTimelineIcon: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FlexProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const StyledCardHeader: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").GridProps>, import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const StyledTimelineIcon: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
10
9
  interface StyledBulletWrapperProps {
11
10
  hasPrev: boolean;
12
11
  hasNext: boolean;
@@ -19,7 +18,7 @@ export declare const StyledDate: import("styled-components").StyledComponent<"h2
19
18
  export declare const StyledTimelineList: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
20
19
  export declare const StyledTimelineListItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
21
20
  export declare const StyledTimeline: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
22
- export declare const StyledTime: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").DateTimeDisplayProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
21
+ export declare const StyledTime: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").DateTimeDisplayProps>, import("styled-components").DefaultTheme, {}, never>;
23
22
  export declare const StyledLoadingCell: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
23
  export {};
25
24
  //# sourceMappingURL=Timeline.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.styles.ts"],"names":[],"mappings":";AAiBA,eAAO,MAAM,UAAU,mOASrB,CAAC;AAIH,eAAO,MAAM,WAAW,yGAKvB,CAAC;AAIF,eAAO,MAAM,iBAAiB,0OAS5B,CAAC;AAIH,eAAO,MAAM,kBAAkB;eAA+B,OAAO;SASnE,CAAC;AAIH,eAAO,MAAM,gBAAgB,gQAG5B,CAAC;AAIF,eAAO,MAAM,kBAAkB,mOAU7B,CAAC;AAIH,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,gIA8D/B,CAAC;AAIF,eAAO,MAAM,UAAU,wGAetB,CAAC;AAIF,eAAO,MAAM,kBAAkB,wGAE9B,CAAC;AAIF,eAAO,MAAM,sBAAsB,wGAMlC,CAAC;AAIF,eAAO,MAAM,cAAc,wGAQzB,CAAC;AAIH,eAAO,MAAM,UAAU,8OAUrB,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAQ7B,CAAC"}
1
+ {"version":3,"file":"Timeline.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.styles.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,UAAU,kNAUrB,CAAC;AAIH,eAAO,MAAM,WAAW,yGAKvB,CAAC;AAIF,eAAO,MAAM,iBAAiB,0OAS5B,CAAC;AAIH,eAAO,MAAM,kBAAkB;eAA+B,OAAO;SASnE,CAAC;AAIH,eAAO,MAAM,gBAAgB,kNAG5B,CAAC;AAIF,eAAO,MAAM,kBAAkB,kNAW7B,CAAC;AAIH,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,gIA6D/B,CAAC;AAIF,eAAO,MAAM,UAAU,wGAetB,CAAC;AAIF,eAAO,MAAM,kBAAkB,wGAE9B,CAAC;AAIF,eAAO,MAAM,sBAAsB,wGAYlC,CAAC;AAIF,eAAO,MAAM,cAAc,wGAQzB,CAAC;AAIH,eAAO,MAAM,UAAU,6NAUrB,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAQ7B,CAAC"}
@@ -4,6 +4,7 @@ export const StyledCard = styled(Card)(({ theme }) => {
4
4
  return css `
5
5
  border-block-start: 0.0625rem solid ${theme.base.palette['border-line']};
6
6
  padding-block: ${theme.base.spacing};
7
+
7
8
  &:not(& &) {
8
9
  border-radius: 0;
9
10
  background-color: transparent;
@@ -50,6 +51,7 @@ export const StyledTimelineIcon = styled(Flex)(({ theme }) => {
50
51
  border-radius: 50%;
51
52
  color: ${theme.base.palette.light};
52
53
  background: ${theme.base.palette.info};
54
+
53
55
  & > ${StyledIcon} {
54
56
  height: 1em;
55
57
  width: 1em;
@@ -81,7 +83,6 @@ export const StyledBulletWrapper = styled.span(({ theme, hasPrev, hasNext, isPre
81
83
  ${theme.base.palette.info};
82
84
  }
83
85
  `}
84
-
85
86
  ${hasNext &&
86
87
  css `
87
88
  &::after {
@@ -97,8 +98,7 @@ export const StyledBulletWrapper = styled.span(({ theme, hasPrev, hasNext, isPre
97
98
  ${theme.base.palette.info};
98
99
  }
99
100
  `}
100
-
101
- & > ${StyledTimelineIcon} {
101
+ & > ${StyledTimelineIcon} {
102
102
  position: relative;
103
103
  margin: 0;
104
104
  z-index: 1;
@@ -111,6 +111,7 @@ export const StyledBulletWrapper = styled.span(({ theme, hasPrev, hasNext, isPre
111
111
  &::before {
112
112
  height: calc(${theme.base.spacing} + 0.75rem);
113
113
  }
114
+
114
115
  &::after {
115
116
  inset-block-start: calc(${theme.base.spacing} + 0.75rem);
116
117
  height: calc(100% - ${theme.base.spacing} - 0.75rem);
@@ -139,6 +140,12 @@ export const StyledTimelineListItem = styled.li `
139
140
  &:first-child ${StyledDate} {
140
141
  padding-block-start: 0;
141
142
  }
143
+
144
+ &:has(${StyledCardContent} .cell-content > span:empty):not(:has(${StyledTimelineList}))
145
+ ${StyledCard}
146
+ ${StyledToggleButton} {
147
+ display: none;
148
+ }
142
149
  `;
143
150
  StyledTimelineListItem.defaultProps = defaultThemeProp;
144
151
  export const StyledTimeline = styled.ol(({ theme }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.styles.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB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CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n Button,\n calculateFontSize,\n Card,\n CardContent,\n DateTimeDisplay,\n defaultThemeProp,\n Flex,\n Grid,\n StyledBackdrop,\n StyledIcon,\n useDirection\n} from '@pega/cosmos-react-core';\nimport type { FontSize } from '@pega/cosmos-react-core';\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n border-block-start: 0.0625rem solid ${theme.base.palette['border-line']};\n padding-block: ${theme.base.spacing};\n &:not(& &) {\n border-radius: 0;\n background-color: transparent;\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledTitle = styled.div`\n display: -webkit-inline-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\nStyledTitle.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled(CardContent)(({ theme }) => {\n return css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing} 0 ${theme.base.spacing} ${theme.base['hit-area']['mouse-min']};\n @media (pointer: coarse) {\n padding-inline-start: ${theme.base['hit-area']['finger-min']};\n }\n }\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledToggleButton = styled(Button)<{ collapsed: boolean }>(({ theme, collapsed }) => {\n const { rtl } = useDirection();\n return css`\n ${StyledIcon} {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${collapsed ? `rotate(${rtl ? '90deg' : '-90deg'})` : 'rotate(0)'};\n }\n `;\n});\n\nStyledToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled(Grid)`\n padding: 0;\n min-height: 2rem;\n`;\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineIcon = styled(Flex)(({ theme }) => {\n return css`\n border-radius: 50%;\n color: ${theme.base.palette.light};\n background: ${theme.base.palette.info};\n & > ${StyledIcon} {\n height: 1em;\n width: 1em;\n }\n `;\n});\n\nStyledTimelineIcon.defaultProps = defaultThemeProp;\n\ninterface StyledBulletWrapperProps {\n hasPrev: boolean;\n hasNext: boolean;\n isPrevFuture: boolean;\n isNextFuture: boolean;\n hasIcon: boolean;\n}\n\nexport const StyledBulletWrapper = styled.span<StyledBulletWrapperProps>(\n ({ theme, hasPrev, hasNext, isPrevFuture, isNextFuture, hasIcon }) => {\n const { rtl } = useDirection();\n return css`\n height: 100%;\n position: relative;\n text-align: center;\n padding-block-start: calc(2.25 * ${theme.base.spacing} + 0.0625rem);\n min-width: 2rem;\n\n ${hasPrev &&\n css`\n &::before {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n width: 0.0625rem;\n height: calc(2.25 * ${theme.base.spacing} + 0.75rem);\n border-inline-start: 0.0625rem ${isPrevFuture ? 'dashed' : 'solid'}\n ${theme.base.palette.info};\n }\n `}\n\n ${hasNext &&\n css`\n &::after {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: calc(2.25 * ${theme.base.spacing} + 0.75rem);\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n width: 0.0625rem;\n height: calc(100% - 2.25 * ${theme.base.spacing} - 0.75rem);\n border-inline-start: 0.0625rem ${isNextFuture ? 'dashed' : 'solid'}\n ${theme.base.palette.info};\n }\n `}\n\n & > ${StyledTimelineIcon} {\n position: relative;\n margin: 0;\n z-index: 1;\n width: ${hasIcon ? '1.5rem' : '0.5rem'};\n height: ${hasIcon ? '1.5rem' : '0.5rem'};\n }\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n padding-block-start: calc(${theme.base.spacing} + 0.0625rem);\n &::before {\n height: calc(${theme.base.spacing} + 0.75rem);\n }\n &::after {\n inset-block-start: calc(${theme.base.spacing} + 0.75rem);\n height: calc(100% - ${theme.base.spacing} - 0.75rem);\n }\n }\n `;\n }\n);\n\nStyledBulletWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledDate = styled.h2(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing },\n components: { text }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n grid-column: 1 / -1;\n padding-block: calc(3 * ${spacing}) calc(1.25 * ${spacing});\n font-size: ${fontSizes[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n `;\n }\n);\n\nStyledDate.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineList = styled.ol`\n display: contents;\n`;\n\nStyledTimelineList.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineListItem = styled.li`\n display: contents;\n\n &:first-child ${StyledDate} {\n padding-block-start: 0;\n }\n`;\n\nStyledTimelineListItem.defaultProps = defaultThemeProp;\n\nexport const StyledTimeline = styled.ol(({ theme }) => {\n return css`\n @media (min-width: ${theme.base.breakpoints.sm}) {\n ${StyledCard} {\n padding-block: calc(0.5 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledTimeline.defaultProps = defaultThemeProp;\n\nexport const StyledTime = styled(DateTimeDisplay)(({ theme }) => {\n return css`\n opacity: ${theme.base.transparency['transparent-2']};\n white-space: nowrap;\n @media (min-width: ${theme.base.breakpoints.sm}) {\n text-align: end;\n line-height: ${theme.base['hit-area']['mouse-min']};\n padding-block-start: calc(0.5 * ${theme.base.spacing} + 0.0625rem);\n }\n `;\n});\n\nStyledTime.defaultProps = defaultThemeProp;\n\nexport const StyledLoadingCell = styled.div`\n grid-column: 1 / -1;\n position: relative;\n height: 2.8rem;\n\n ${StyledBackdrop} {\n background: transparent;\n }\n`;\n"]}
1
+ {"version":3,"file":"Timeline.styles.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,eAAe,EACf,gBAA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led-components';\n\nimport type { FontSize } from '@pega/cosmos-react-core';\nimport {\n Button,\n calculateFontSize,\n Card,\n CardContent,\n DateTimeDisplay,\n defaultThemeProp,\n Flex,\n Grid,\n StyledBackdrop,\n StyledIcon,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n border-block-start: 0.0625rem solid ${theme.base.palette['border-line']};\n padding-block: ${theme.base.spacing};\n\n &:not(& &) {\n border-radius: 0;\n background-color: transparent;\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledTitle = styled.div`\n display: -webkit-inline-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\nStyledTitle.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled(CardContent)(({ theme }) => {\n return css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing} 0 ${theme.base.spacing} ${theme.base['hit-area']['mouse-min']};\n @media (pointer: coarse) {\n padding-inline-start: ${theme.base['hit-area']['finger-min']};\n }\n }\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledToggleButton = styled(Button)<{ collapsed: boolean }>(({ theme, collapsed }) => {\n const { rtl } = useDirection();\n return css`\n ${StyledIcon} {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${collapsed ? `rotate(${rtl ? '90deg' : '-90deg'})` : 'rotate(0)'};\n }\n `;\n});\n\nStyledToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled(Grid)`\n padding: 0;\n min-height: 2rem;\n`;\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineIcon = styled(Flex)(({ theme }) => {\n return css`\n border-radius: 50%;\n color: ${theme.base.palette.light};\n background: ${theme.base.palette.info};\n\n & > ${StyledIcon} {\n height: 1em;\n width: 1em;\n }\n `;\n});\n\nStyledTimelineIcon.defaultProps = defaultThemeProp;\n\ninterface StyledBulletWrapperProps {\n hasPrev: boolean;\n hasNext: boolean;\n isPrevFuture: boolean;\n isNextFuture: boolean;\n hasIcon: boolean;\n}\n\nexport const StyledBulletWrapper = styled.span<StyledBulletWrapperProps>(\n ({ theme, hasPrev, hasNext, isPrevFuture, isNextFuture, hasIcon }) => {\n const { rtl } = useDirection();\n return css`\n height: 100%;\n position: relative;\n text-align: center;\n padding-block-start: calc(2.25 * ${theme.base.spacing} + 0.0625rem);\n min-width: 2rem;\n\n ${hasPrev &&\n css`\n &::before {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n width: 0.0625rem;\n height: calc(2.25 * ${theme.base.spacing} + 0.75rem);\n border-inline-start: 0.0625rem ${isPrevFuture ? 'dashed' : 'solid'}\n ${theme.base.palette.info};\n }\n `}\n ${hasNext &&\n css`\n &::after {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: calc(2.25 * ${theme.base.spacing} + 0.75rem);\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n width: 0.0625rem;\n height: calc(100% - 2.25 * ${theme.base.spacing} - 0.75rem);\n border-inline-start: 0.0625rem ${isNextFuture ? 'dashed' : 'solid'}\n ${theme.base.palette.info};\n }\n `}\n & > ${StyledTimelineIcon} {\n position: relative;\n margin: 0;\n z-index: 1;\n width: ${hasIcon ? '1.5rem' : '0.5rem'};\n height: ${hasIcon ? '1.5rem' : '0.5rem'};\n }\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n padding-block-start: calc(${theme.base.spacing} + 0.0625rem);\n &::before {\n height: calc(${theme.base.spacing} + 0.75rem);\n }\n\n &::after {\n inset-block-start: calc(${theme.base.spacing} + 0.75rem);\n height: calc(100% - ${theme.base.spacing} - 0.75rem);\n }\n }\n `;\n }\n);\n\nStyledBulletWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledDate = styled.h2(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing },\n components: { text }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n grid-column: 1 / -1;\n padding-block: calc(3 * ${spacing}) calc(1.25 * ${spacing});\n font-size: ${fontSizes[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n `;\n }\n);\n\nStyledDate.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineList = styled.ol`\n display: contents;\n`;\n\nStyledTimelineList.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineListItem = styled.li`\n display: contents;\n\n &:first-child ${StyledDate} {\n padding-block-start: 0;\n }\n\n &:has(${StyledCardContent} .cell-content > span:empty):not(:has(${StyledTimelineList}))\n ${StyledCard}\n ${StyledToggleButton} {\n display: none;\n }\n`;\n\nStyledTimelineListItem.defaultProps = defaultThemeProp;\n\nexport const StyledTimeline = styled.ol(({ theme }) => {\n return css`\n @media (min-width: ${theme.base.breakpoints.sm}) {\n ${StyledCard} {\n padding-block: calc(0.5 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledTimeline.defaultProps = defaultThemeProp;\n\nexport const StyledTime = styled(DateTimeDisplay)(({ theme }) => {\n return css`\n opacity: ${theme.base.transparency['transparent-2']};\n white-space: nowrap;\n @media (min-width: ${theme.base.breakpoints.sm}) {\n text-align: end;\n line-height: ${theme.base['hit-area']['mouse-min']};\n padding-block-start: calc(0.5 * ${theme.base.spacing} + 0.0625rem);\n }\n `;\n});\n\nStyledTime.defaultProps = defaultThemeProp;\n\nexport const StyledLoadingCell = styled.div`\n grid-column: 1 / -1;\n position: relative;\n height: 2.8rem;\n\n ${StyledBackdrop} {\n background: transparent;\n }\n`;\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { MouseEvent, ReactElement, ReactNode, Ref } from 'react';
2
- import type { BaseProps, FieldValueListProps, IconProps, ListToolbarProps, NoChildrenProp, OmitStrict, StatusProps } from '@pega/cosmos-react-core';
2
+ import type { BaseProps, DateTimeDisplayProps, FieldValueListProps, IconProps, ListToolbarProps, NoChildrenProp, OmitStrict, StatusProps } from '@pega/cosmos-react-core';
3
3
  import type { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTime.types';
4
4
  import type { AcceptedMouseEventElement } from '@pega/cosmos-react-core/lib/components/Menu/Menu.types';
5
5
  export interface ActivityObject {
@@ -7,10 +7,20 @@ export interface ActivityObject {
7
7
  id: string;
8
8
  /** Date as ISO8601 string, timestamp or native Date object. */
9
9
  date: string | number | Date;
10
+ /**
11
+ * Controls date time variant. Set to 'time' when groupBy is 'date'.
12
+ * @default datetime
13
+ */
14
+ dateVariant?: DateTimeDisplayProps['variant'];
10
15
  /** Header region for rendering text and links. */
11
16
  title: ReactNode;
12
17
  /** Name of the icon (to be selected from default Pega icon set) */
13
18
  icon?: IconProps['name'];
19
+ /**
20
+ * Default visually expanded state for the activity item.
21
+ * @default false
22
+ */
23
+ defaultExpanded?: boolean;
14
24
  /** Represents the current status of activity */
15
25
  status?: StatusProps;
16
26
  /** The set of field values to render in the list. */
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.types.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAC;AACtG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAExG,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAA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U,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAC;QACrF;;;WAGG;QACH,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACpC,CAAC;CACH"}
1
+ {"version":3,"file":"Timeline.types.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAC;AACtG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAExG,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC9C,kDAAkD;IAClD,KAAK,EAAE,SAAS,CAAC;IACjB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qDAAqD;IACrD,OAAO,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC;CACxD;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,YAAY,CAAC;AAC3D,MAAM,MAAM,eAAe,GACvB,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,MAAM,CAAC,GACvE,MAAM,CAAC;AAEX,MAAM,CAAC,OAAO,WAAW,aAAc,SAAQ,SAAS,EAAE,cAAc;IACtE,uBAAuB;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,2BAA2B;IAC3B,WAAW,EAAE,IAAI,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAqB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1F,IAAI,CAAC,EAAE;QACL,iDAAiD;QACjD,WAAW,EAAE,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,UAAU,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAC;QACvF;;;WAGG;QACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;KAC9B,CAAC;IACF,KAAK,CAAC,EAAE;QACN,iDAAiD;QACjD,WAAW,EAAE,CAAC,EAAE,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAC;QACrF;;;WAGG;QACH,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACpC,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.types.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent, ReactElement, ReactNode, Ref } from 'react';\n\nimport type {\n BaseProps,\n FieldValueListProps,\n IconProps,\n ListToolbarProps,\n NoChildrenProp,\n OmitStrict,\n StatusProps\n} from '@pega/cosmos-react-core';\nimport type { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTime.types';\nimport type { AcceptedMouseEventElement } from '@pega/cosmos-react-core/lib/components/Menu/Menu.types';\n\nexport interface ActivityObject {\n /** Unique id for activity */\n id: string;\n /** Date as ISO8601 string, timestamp or native Date object. */\n date: string | number | Date;\n /** Header region for rendering text and links. */\n title: ReactNode;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon?: IconProps['name'];\n /** Represents the current status of activity */\n status?: StatusProps;\n /** The set of field values to render in the list. */\n content?: FieldValueListProps['fields'] | ReactElement;\n}\n\nexport type TimelineSortOrder = 'ascending' | 'descending';\nexport type TimelineGroupBy =\n | Extract<DateTimeVariant, 'date' | 'monthyear' | 'quarteryear' | 'year'>\n | 'none';\n\nexport default interface TimelineProps extends BaseProps, NoChildrenProp {\n /** List of activity */\n activity: ActivityObject[];\n /** Current time as Date */\n currentTime: Date;\n /**\n * List of activity grouped by day, month, quarter or year.\n * @default 'date'\n */\n groupBy?: TimelineGroupBy;\n /**\n * Show a Progress indicator at the end of a list where newly loaded items will be appended.\n * @default false\n */\n loading?: boolean;\n /** Callback to fetch more activity items */\n loadMore?: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTableElement>;\n}\n\nexport interface TimelineToolbarProps extends OmitStrict<ListToolbarProps, 'sort' | 'group'> {\n sort?: {\n /** An item click handler for all item clicks. */\n onItemClick: (id: TimelineSortOrder, e: MouseEvent<AcceptedMouseEventElement>) => void;\n /**\n * Currently selected sort order.\n * @default 'descending'\n */\n selected?: TimelineSortOrder;\n };\n group?: {\n /** An item click handler for all item clicks. */\n onItemClick: (id: TimelineGroupBy, e: MouseEvent<AcceptedMouseEventElement>) => void;\n /**\n * Currently selected sort order.\n * @default 'date'\n */\n selected: TimelineProps['groupBy'];\n };\n}\n"]}
1
+ {"version":3,"file":"Timeline.types.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent, ReactElement, ReactNode, Ref } from 'react';\n\nimport type {\n BaseProps,\n DateTimeDisplayProps,\n FieldValueListProps,\n IconProps,\n ListToolbarProps,\n NoChildrenProp,\n OmitStrict,\n StatusProps\n} from '@pega/cosmos-react-core';\nimport type { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTime.types';\nimport type { AcceptedMouseEventElement } from '@pega/cosmos-react-core/lib/components/Menu/Menu.types';\n\nexport interface ActivityObject {\n /** Unique id for activity */\n id: string;\n /** Date as ISO8601 string, timestamp or native Date object. */\n date: string | number | Date;\n /**\n * Controls date time variant. Set to 'time' when groupBy is 'date'.\n * @default datetime\n */\n dateVariant?: DateTimeDisplayProps['variant'];\n /** Header region for rendering text and links. */\n title: ReactNode;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon?: IconProps['name'];\n /**\n * Default visually expanded state for the activity item.\n * @default false\n */\n defaultExpanded?: boolean;\n /** Represents the current status of activity */\n status?: StatusProps;\n /** The set of field values to render in the list. */\n content?: FieldValueListProps['fields'] | ReactElement;\n}\n\nexport type TimelineSortOrder = 'ascending' | 'descending';\nexport type TimelineGroupBy =\n | Extract<DateTimeVariant, 'date' | 'monthyear' | 'quarteryear' | 'year'>\n | 'none';\n\nexport default interface TimelineProps extends BaseProps, NoChildrenProp {\n /** List of activity */\n activity: ActivityObject[];\n /** Current time as Date */\n currentTime: Date;\n /**\n * List of activity grouped by day, month, quarter or year.\n * @default 'date'\n */\n groupBy?: TimelineGroupBy;\n /**\n * Show a Progress indicator at the end of a list where newly loaded items will be appended.\n * @default false\n */\n loading?: boolean;\n /** Callback to fetch more activity items */\n loadMore?: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTableElement>;\n}\n\nexport interface TimelineToolbarProps extends OmitStrict<ListToolbarProps, 'sort' | 'group'> {\n sort?: {\n /** An item click handler for all item clicks. */\n onItemClick: (id: TimelineSortOrder, e: MouseEvent<AcceptedMouseEventElement>) => void;\n /**\n * Currently selected sort order.\n * @default 'descending'\n */\n selected?: TimelineSortOrder;\n };\n group?: {\n /** An item click handler for all item clicks. */\n onItemClick: (id: TimelineGroupBy, e: MouseEvent<AcceptedMouseEventElement>) => void;\n /**\n * Currently selected sort order.\n * @default 'date'\n */\n selected: TimelineProps['groupBy'];\n };\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  import type { FunctionComponent } from 'react';
2
- import type { ForwardProps, DateTimeDisplayProps } from '@pega/cosmos-react-core';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
3
  import type { ActivityObject } from './Timeline.types';
4
4
  interface TimelineItemProps {
5
5
  item: ActivityObject;
6
- timeFormat: DateTimeDisplayProps['variant'];
7
6
  prevItemDate: ActivityObject['date'] | undefined;
8
7
  nextItemDate: ActivityObject['date'] | undefined;
9
8
  currentTime: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAU7D,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EAErB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcvD,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC5C,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,WAAW,EAAE,IAAI,CAAC;CACnB;AAgBD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAgHrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAG7D,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAqBrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,WAAW,EAAE,IAAI,CAAC;CACnB;AAgBD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAgHrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isValidElement, useCallback, useRef, useState } from 'react';
3
- import { ExpandCollapse, Grid, Icon, Status, useBreakpoint, FieldValueItem } from '@pega/cosmos-react-core';
4
- import { StyledCard, StyledCardHeader, StyledTimelineIcon, StyledCardContent, StyledBulletWrapper, StyledToggleButton, StyledTime, StyledTitle, StyledTimelineListItem } from './Timeline.styles';
2
+ import { isValidElement, useRef, useState } from 'react';
3
+ import { ExpandCollapse, FieldValueItem, Grid, Icon, Status, useBreakpoint } from '@pega/cosmos-react-core';
4
+ import { StyledBulletWrapper, StyledCard, StyledCardContent, StyledCardHeader, StyledTime, StyledTimelineIcon, StyledTimelineListItem, StyledTitle, StyledToggleButton } from './Timeline.styles';
5
5
  import { isFutureDate } from './utils';
6
6
  const shouldRenderContent = (content) => {
7
7
  if (!content) {
@@ -12,24 +12,25 @@ const shouldRenderContent = (content) => {
12
12
  }
13
13
  return true;
14
14
  };
15
- const TimelineItem = ({ item: { date, title, icon, status, content }, timeFormat, prevItemDate, nextItemDate, currentTime }) => {
16
- const [collapsed, setCollapsed] = useState(true);
15
+ const TimelineItem = ({ item: { date, dateVariant = 'datetime', title, icon, defaultExpanded = false, status, content }, prevItemDate, nextItemDate, currentTime }) => {
16
+ const [expanded, setExpanded] = useState(defaultExpanded);
17
17
  const isSmallOrAbove = useBreakpoint('sm');
18
- const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);
19
18
  const contentListRef = useRef(null);
20
19
  const isSMContentWidthOrAbove = useBreakpoint('sm', {
21
20
  breakpointRef: contentListRef
22
21
  });
23
- return (_jsxs(StyledTimelineListItem, { children: [isSmallOrAbove && _jsx(StyledTime, { variant: timeFormat, value: date }), _jsx(StyledBulletWrapper, { hasIcon: !!icon, hasPrev: !!prevItemDate, hasNext: !!nextItemDate, isPrevFuture: isFutureDate(prevItemDate, currentTime), isNextFuture: isFutureDate(nextItemDate, currentTime), children: _jsx(StyledTimelineIcon, { container: { inline: true, alignItems: 'center', justify: 'center' }, children: icon && _jsx(Icon, { name: icon }) }) }), _jsxs("div", { children: [_jsx("div", { children: _jsx(StyledCard, { children: _jsxs(StyledCardHeader, { container: {
22
+ return (_jsxs(StyledTimelineListItem, { children: [isSmallOrAbove && _jsx(StyledTime, { variant: dateVariant, value: date, format: 'short' }), _jsx(StyledBulletWrapper, { hasIcon: !!icon, hasPrev: !!prevItemDate, hasNext: !!nextItemDate, isPrevFuture: isFutureDate(prevItemDate, currentTime), isNextFuture: isFutureDate(nextItemDate, currentTime), children: _jsx(StyledTimelineIcon, { container: { inline: true, alignItems: 'center', justify: 'center' }, children: icon && _jsx(Icon, { name: icon }) }) }), _jsxs("div", { children: [_jsx("div", { children: _jsx(StyledCard, { children: _jsxs(StyledCardHeader, { container: {
24
23
  cols: 'auto 1fr',
25
24
  alignContent: 'evenly',
26
25
  alignItems: 'center',
27
26
  gap: 0.5
28
- }, sm: { container: { cols: 'auto 1fr auto' } }, children: [shouldRenderContent(content) && (_jsx(StyledToggleButton, { icon: true, variant: 'simple', onClick: toggleCollapse, collapsed: collapsed, "aria-expanded": !collapsed, compact: true, children: _jsx(Icon, { name: 'caret-down' }) })), _jsxs(Grid, { item: { colStart: '2', colEnd: '2' }, container: { rowGap: 0.25 }, children: [_jsx(StyledTitle, { children: title }), !isSmallOrAbove && (_jsxs(Grid, { container: {
27
+ }, sm: { container: { cols: 'auto 1fr auto' } }, children: [shouldRenderContent(content) && (_jsx(StyledToggleButton, { icon: true, variant: 'simple', onClick: () => {
28
+ setExpanded(cur => !cur);
29
+ }, collapsed: !expanded, "aria-expanded": expanded, compact: true, children: _jsx(Icon, { name: 'caret-down' }) })), _jsxs(Grid, { item: { colStart: '2', colEnd: '2' }, container: { rowGap: 0.25 }, children: [_jsx(StyledTitle, { children: title }), !isSmallOrAbove && (_jsxs(Grid, { container: {
29
30
  cols: '1fr auto',
30
31
  alignContent: 'evenly',
31
32
  alignItems: 'center'
32
- }, children: [_jsx(StyledTime, { variant: 'time', value: date }), status && _jsx(Status, { variant: status.variant, children: status.children })] }))] }), isSmallOrAbove && status && (_jsx(Grid, { sm: { item: { colStart: '3', colEnd: '3' } }, children: _jsx(Status, { variant: status.variant, children: status.children }) }))] }) }) }), shouldRenderContent(content) && (_jsx(ExpandCollapse, { dimension: 'height', collapsed: collapsed, nullWhenCollapsed: true, children: _jsx(StyledCardContent, { children: isValidElement(content) ? (content) : (_jsx(Grid, { container: {
33
+ }, children: [_jsx(StyledTime, { variant: 'time', value: date, format: 'short' }), status && _jsx(Status, { variant: status.variant, children: status.children })] }))] }), isSmallOrAbove && status && (_jsx(Grid, { sm: { item: { colStart: '3', colEnd: '3' } }, children: _jsx(Status, { variant: status.variant, children: status.children }) }))] }) }) }), shouldRenderContent(content) && (_jsx(ExpandCollapse, { dimension: 'height', collapsed: !expanded, children: _jsx(StyledCardContent, { children: isValidElement(content) ? (content) : (_jsx(Grid, { container: {
33
34
  gap: 1,
34
35
  cols: isSMContentWidthOrAbove
35
36
  ? `repeat(${content.length > 1 ? '2' : '1'}, minmax(16ch, auto) minmax(25%, 1fr))`
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":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c,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,IACxC,EAAE,IAAI,IAAI,CACf,CACH,CAAC;gCACJ,CAAC,CAAC,GACG,CACR,GACiB,GACL,CAClB,IACG,IACiB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { isValidElement, useCallback, useRef, useState } from 'react';\nimport type { FunctionComponent, ReactElement } from 'react';\n\nimport {\n ExpandCollapse,\n Grid,\n Icon,\n Status,\n useBreakpoint,\n FieldValueItem\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardProps,\n DateTimeDisplayProps,\n FieldValueListItemProps\n} from '@pega/cosmos-react-core';\n\nimport type { ActivityObject } from './Timeline.types';\nimport {\n StyledCard,\n StyledCardHeader,\n StyledTimelineIcon,\n StyledCardContent,\n StyledBulletWrapper,\n StyledToggleButton,\n StyledTime,\n StyledTitle,\n StyledTimelineListItem\n} from './Timeline.styles';\nimport { isFutureDate } from './utils';\n\ninterface TimelineItemProps {\n item: ActivityObject;\n timeFormat: DateTimeDisplayProps['variant'];\n prevItemDate: ActivityObject['date'] | undefined;\n nextItemDate: ActivityObject['date'] | undefined;\n currentTime: Date;\n}\n\nconst shouldRenderContent = (\n content: ActivityObject['content']\n): content is [FieldValueListItemProps, ...FieldValueListItemProps[]] | ReactElement => {\n if (!content) {\n return false;\n }\n\n if (Array.isArray(content)) {\n return content.length > 0;\n }\n\n return true;\n};\n\nconst TimelineItem: FunctionComponent<TimelineItemProps & ForwardProps> = ({\n item: { date, title, icon, status, content },\n timeFormat,\n prevItemDate,\n nextItemDate,\n currentTime\n}: TimelineItemProps & ForwardProps) => {\n const [collapsed, setCollapsed] = useState(true);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);\n const contentListRef = useRef<HTMLDivElement>(null);\n const isSMContentWidthOrAbove = useBreakpoint('sm', {\n breakpointRef: contentListRef\n });\n\n return (\n <StyledTimelineListItem>\n {isSmallOrAbove && <StyledTime variant={timeFormat} value={date} />}\n <StyledBulletWrapper\n hasIcon={!!icon}\n hasPrev={!!prevItemDate}\n hasNext={!!nextItemDate}\n isPrevFuture={isFutureDate(prevItemDate, currentTime)}\n isNextFuture={isFutureDate(nextItemDate, currentTime)}\n >\n <StyledTimelineIcon container={{ inline: true, alignItems: 'center', justify: 'center' }}>\n {icon && <Icon name={icon} />}\n </StyledTimelineIcon>\n </StyledBulletWrapper>\n <div>\n <div>\n <StyledCard>\n <StyledCardHeader\n container={{\n cols: 'auto 1fr',\n alignContent: 'evenly',\n alignItems: 'center',\n gap: 0.5\n }}\n sm={{ container: { cols: 'auto 1fr auto' } }}\n >\n {shouldRenderContent(content) && (\n <StyledToggleButton\n icon\n variant='simple'\n onClick={toggleCollapse}\n collapsed={collapsed}\n aria-expanded={!collapsed}\n compact\n >\n <Icon name='caret-down' />\n </StyledToggleButton>\n )}\n <Grid item={{ colStart: '2', colEnd: '2' }} container={{ rowGap: 0.25 }}>\n <StyledTitle>{title}</StyledTitle>\n {!isSmallOrAbove && (\n <Grid\n container={{\n cols: '1fr auto',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n >\n <StyledTime variant='time' value={date} />\n {status && <Status variant={status.variant}>{status.children}</Status>}\n </Grid>\n )}\n </Grid>\n {isSmallOrAbove && status && (\n <Grid sm={{ item: { colStart: '3', colEnd: '3' } }}>\n <Status variant={status.variant}>{status.children}</Status>\n </Grid>\n )}\n </StyledCardHeader>\n </StyledCard>\n </div>\n {shouldRenderContent(content) && (\n <ExpandCollapse dimension='height' collapsed={collapsed} nullWhenCollapsed>\n <StyledCardContent>\n {isValidElement<any>(content) ? (\n content\n ) : (\n <Grid\n container={{\n gap: 1,\n cols: isSMContentWidthOrAbove\n ? `repeat(${\n content.length > 1 ? '2' : '1'\n }, minmax(16ch, auto) minmax(25%, 1fr))`\n : 'minmax(0, 1fr)'\n }}\n ref={contentListRef}\n >\n {content.map(({ id, name, value, variant }) => {\n return (\n <FieldValueItem\n name={name}\n value={value}\n variant={isSmallOrAbove ? variant : 'stacked'}\n key={id ?? name}\n />\n );\n })}\n </Grid>\n )}\n </StyledCardContent>\n </ExpandCollapse>\n )}\n </div>\n </StyledTimelineListItem>\n );\n};\n\nexport default TimelineItem;\n"]}
1
+ {"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,EACL,cAAc,EACd,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AASvC,MAAM,mBAAmB,GAAG,CAC1B,OAAkC,EACiD,EAAE;IACrF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,YAAY,GAAwD,CAAC,EACzE,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,GAAG,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAC/F,YAAY,EACZ,YAAY,EACZ,WAAW,EACsB,EAAE,EA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,GAAG,EAAE,CAAC;oCACN,IAAI,EAAE,uBAAuB;wCAC3B,CAAC,CAAC,UACE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAC7B,wCAAwC;wCAC1C,CAAC,CAAC,gBAAgB;iCACrB,EACD,GAAG,EAAE,cAAc,YAElB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;oCAC5C,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,IACxC,EAAE,IAAI,IAAI,CACf,CACH,CAAC;gCACJ,CAAC,CAAC,GACG,CACR,GACiB,GACL,CAClB,IACG,IACiB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import type { FunctionComponent, ReactElement } from 'react';\nimport { isValidElement, useRef, useState } from 'react';\n\nimport type { FieldValueListItemProps, ForwardProps } from '@pega/cosmos-react-core';\nimport {\n ExpandCollapse,\n FieldValueItem,\n Grid,\n Icon,\n Status,\n useBreakpoint\n} from '@pega/cosmos-react-core';\n\nimport {\n StyledBulletWrapper,\n StyledCard,\n StyledCardContent,\n StyledCardHeader,\n StyledTime,\n StyledTimelineIcon,\n StyledTimelineListItem,\n StyledTitle,\n StyledToggleButton\n} from './Timeline.styles';\nimport type { ActivityObject } from './Timeline.types';\nimport { isFutureDate } from './utils';\n\ninterface TimelineItemProps {\n item: ActivityObject;\n prevItemDate: ActivityObject['date'] | undefined;\n nextItemDate: ActivityObject['date'] | undefined;\n currentTime: Date;\n}\n\nconst shouldRenderContent = (\n content: ActivityObject['content']\n): content is [FieldValueListItemProps, ...FieldValueListItemProps[]] | ReactElement => {\n if (!content) {\n return false;\n }\n\n if (Array.isArray(content)) {\n return content.length > 0;\n }\n\n return true;\n};\n\nconst TimelineItem: FunctionComponent<TimelineItemProps & ForwardProps> = ({\n item: { date, dateVariant = 'datetime', title, icon, defaultExpanded = false, status, content },\n prevItemDate,\n nextItemDate,\n currentTime\n}: TimelineItemProps & ForwardProps) => {\n const [expanded, setExpanded] = useState(defaultExpanded);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const contentListRef = useRef<HTMLDivElement>(null);\n const isSMContentWidthOrAbove = useBreakpoint('sm', {\n breakpointRef: contentListRef\n });\n\n return (\n <StyledTimelineListItem>\n {isSmallOrAbove && <StyledTime variant={dateVariant} value={date} format='short' />}\n <StyledBulletWrapper\n hasIcon={!!icon}\n hasPrev={!!prevItemDate}\n hasNext={!!nextItemDate}\n isPrevFuture={isFutureDate(prevItemDate, currentTime)}\n isNextFuture={isFutureDate(nextItemDate, currentTime)}\n >\n <StyledTimelineIcon container={{ inline: true, alignItems: 'center', justify: 'center' }}>\n {icon && <Icon name={icon} />}\n </StyledTimelineIcon>\n </StyledBulletWrapper>\n <div>\n <div>\n <StyledCard>\n <StyledCardHeader\n container={{\n cols: 'auto 1fr',\n alignContent: 'evenly',\n alignItems: 'center',\n gap: 0.5\n }}\n sm={{ container: { cols: 'auto 1fr auto' } }}\n >\n {shouldRenderContent(content) && (\n <StyledToggleButton\n icon\n variant='simple'\n onClick={() => {\n setExpanded(cur => !cur);\n }}\n collapsed={!expanded}\n aria-expanded={expanded}\n compact\n >\n <Icon name='caret-down' />\n </StyledToggleButton>\n )}\n <Grid item={{ colStart: '2', colEnd: '2' }} container={{ rowGap: 0.25 }}>\n <StyledTitle>{title}</StyledTitle>\n {!isSmallOrAbove && (\n <Grid\n container={{\n cols: '1fr auto',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n >\n <StyledTime variant='time' value={date} format='short' />\n {status && <Status variant={status.variant}>{status.children}</Status>}\n </Grid>\n )}\n </Grid>\n {isSmallOrAbove && status && (\n <Grid sm={{ item: { colStart: '3', colEnd: '3' } }}>\n <Status variant={status.variant}>{status.children}</Status>\n </Grid>\n )}\n </StyledCardHeader>\n </StyledCard>\n </div>\n {shouldRenderContent(content) && (\n <ExpandCollapse dimension='height' collapsed={!expanded}>\n <StyledCardContent>\n {isValidElement<any>(content) ? (\n content\n ) : (\n <Grid\n container={{\n gap: 1,\n cols: isSMContentWidthOrAbove\n ? `repeat(${\n content.length > 1 ? '2' : '1'\n }, minmax(16ch, auto) minmax(25%, 1fr))`\n : 'minmax(0, 1fr)'\n }}\n ref={contentListRef}\n >\n {content.map(({ id, name, value, variant }) => {\n return (\n <FieldValueItem\n name={name}\n value={value}\n variant={isSmallOrAbove ? variant : 'stacked'}\n key={id ?? name}\n />\n );\n })}\n </Grid>\n )}\n </StyledCardContent>\n </ExpandCollapse>\n )}\n </div>\n </StyledTimelineListItem>\n );\n};\n\nexport default TimelineItem;\n"]}
@@ -1,6 +1,5 @@
1
- import type { FunctionComponent } from 'react';
2
- import type { ForwardProps } from '@pega/cosmos-react-core';
1
+ import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
3
2
  import type { TimelineToolbarProps } from './Timeline.types';
4
- declare const TimelineToolbar: FunctionComponent<TimelineToolbarProps & ForwardProps>;
3
+ declare const TimelineToolbar: ForwardRefForwardPropsComponent<TimelineToolbarProps>;
5
4
  export default TimelineToolbar;
6
5
  //# sourceMappingURL=TimelineToolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAAsC,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEjG,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CA6E3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"TimelineToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,KAAK,EAAsC,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEjG,QAAA,MAAM,eAAe,EAAE,+BAA+B,CAAC,oBAAoB,CA6E1E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineToolbar.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAM/D,MAAM,eAAe,GAA2D,UAAU,CACxF,SAAS,eAAe,CACtB,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAyC,EACpE,GAAgC;IAEhC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,YAAY,GAAoB,OAAO,CAAC,GAAG,EAAE;QACjD,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,YAAY,CAAC;QAChD,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE;gBACL;oBACE,EAAE,EAAE,YAAY;oBAChB,IAAI,EAAE,CAAC,CAAC,kCAAkC,CAAC;oBAC3C,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,QAAQ,KAAK,YAAY;iBACpC;gBACD;oBACE,EAAE,EAAE,WAAW;oBACf,IAAI,EAAE,CAAC,CAAC,iCAAiC,CAAC;oBAC1C,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,QAAQ,KAAK,WAAW;iBACnC;aACF;YACD,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC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AS,EACb,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACrC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EACxC,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { ListToolbar, useI18n } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport type { PresetMenuProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\n\nimport type { TimelineGroupBy, TimelineSortOrder, TimelineToolbarProps } from './Timeline.types';\n\nconst TimelineToolbar: FunctionComponent<TimelineToolbarProps & ForwardProps> = forwardRef(\n function TimelineToolbar(\n { sort, group, ...restProps }: PropsWithoutRef<TimelineToolbarProps>,\n ref: TimelineToolbarProps['ref']\n ) {\n const t = useI18n();\n\n const timelineSort: PresetMenuProps = useMemo(() => {\n const selected = sort?.selected || 'descending';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'descending',\n text: t('timeline_toolbar_sort_descending'),\n icon: 'arrow-down',\n selected: selected === 'descending'\n },\n {\n id: 'ascending',\n text: t('timeline_toolbar_sort_ascending'),\n icon: 'arrow-up',\n selected: selected === 'ascending'\n }\n ],\n onItemClick: (id, e) => {\n sort?.onItemClick(id as TimelineSortOrder, e);\n }\n };\n }, [sort?.selected, sort?.onItemClick]);\n\n const timelineGroup: PresetMenuProps = useMemo(() => {\n const selected = group?.selected || 'date';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'date',\n text: t('timeline_toolbar_group_date'),\n selected: selected === 'date'\n },\n {\n id: 'monthyear',\n text: t('timeline_toolbar_group_monthyear'),\n selected: selected === 'monthyear'\n },\n {\n id: 'quarteryear',\n text: t('timeline_toolbar_group_quarteryear'),\n selected: selected === 'quarteryear'\n },\n {\n id: 'year',\n text: t('timeline_toolbar_group_year'),\n selected: selected === 'year'\n },\n {\n id: 'none',\n text: t('timeline_toolbar_group_none'),\n selected: selected === 'none'\n }\n ],\n onItemClick: (id, e) => {\n group?.onItemClick(id as TimelineGroupBy, e);\n }\n };\n }, [group?.selected, group?.onItemClick]);\n\n return (\n <ListToolbar\n {...restProps}\n sort={sort ? timelineSort : undefined}\n group={group ? timelineGroup : undefined}\n ref={ref}\n />\n );\n }\n);\n\nexport default TimelineToolbar;\n"]}
1
+ {"version":3,"file":"TimelineToolbar.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAM/D,MAAM,eAAe,GAA0D,UAAU,CACvF,SAAS,eAAe,CACtB,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAyC,EACpE,GAAgC;IAEhC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,YAAY,GAAoB,OAAO,CAAC,GAAG,EAAE;QACjD,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,YAAY,CAAC;QAChD,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE;gBACL;oBACE,EAAE,EAAE,YAAY;oBAChB,IAAI,EAAE,CAAC,CAAC,kCAAkC,CAAC;oBAC3C,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,QAAQ,KAAK,YAAY;iBACpC;gBACD;oBACE,EAAE,EAAE,WAAW;oBACf,IAAI,EAAE,CAAC,CAAC,iCAAiC,CAAC;oBAC1C,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,QAAQ,KAAK,WAAW;iBACnC;aACF;YACD,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC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AE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACrC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EACxC,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport { ListToolbar, useI18n } from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport type { PresetMenuProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\n\nimport type { TimelineGroupBy, TimelineSortOrder, TimelineToolbarProps } from './Timeline.types';\n\nconst TimelineToolbar: ForwardRefForwardPropsComponent<TimelineToolbarProps> = forwardRef(\n function TimelineToolbar(\n { sort, group, ...restProps }: PropsWithoutRef<TimelineToolbarProps>,\n ref: TimelineToolbarProps['ref']\n ) {\n const t = useI18n();\n\n const timelineSort: PresetMenuProps = useMemo(() => {\n const selected = sort?.selected || 'descending';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'descending',\n text: t('timeline_toolbar_sort_descending'),\n icon: 'arrow-down',\n selected: selected === 'descending'\n },\n {\n id: 'ascending',\n text: t('timeline_toolbar_sort_ascending'),\n icon: 'arrow-up',\n selected: selected === 'ascending'\n }\n ],\n onItemClick: (id, e) => {\n sort?.onItemClick(id as TimelineSortOrder, e);\n }\n };\n }, [sort?.selected, sort?.onItemClick]);\n\n const timelineGroup: PresetMenuProps = useMemo(() => {\n const selected = group?.selected || 'date';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'date',\n text: t('timeline_toolbar_group_date'),\n selected: selected === 'date'\n },\n {\n id: 'monthyear',\n text: t('timeline_toolbar_group_monthyear'),\n selected: selected === 'monthyear'\n },\n {\n id: 'quarteryear',\n text: t('timeline_toolbar_group_quarteryear'),\n selected: selected === 'quarteryear'\n },\n {\n id: 'year',\n text: t('timeline_toolbar_group_year'),\n selected: selected === 'year'\n },\n {\n id: 'none',\n text: t('timeline_toolbar_group_none'),\n selected: selected === 'none'\n }\n ],\n onItemClick: (id, e) => {\n group?.onItemClick(id as TimelineGroupBy, e);\n }\n };\n }, [group?.selected, group?.onItemClick]);\n\n return (\n <ListToolbar\n {...restProps}\n sort={sort ? timelineSort : undefined}\n group={group ? timelineGroup : undefined}\n ref={ref}\n />\n );\n }\n);\n\nexport default TimelineToolbar;\n"]}