@pega/cosmos-react-work 8.0.0-build.2.0 → 8.0.0-build.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +3 -3
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  4. package/lib/components/Article/Article.d.ts +2 -6
  5. package/lib/components/Article/Article.d.ts.map +1 -1
  6. package/lib/components/Article/Article.js +2 -7
  7. package/lib/components/Article/Article.js.map +1 -1
  8. package/lib/components/Article/ArticleMeta.js.map +1 -1
  9. package/lib/components/ArticleList/AIArticleSummary.d.ts +1 -2
  10. package/lib/components/ArticleList/AIArticleSummary.d.ts.map +1 -1
  11. package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -1
  12. package/lib/components/ArticleList/ArticleBuddy.js.map +1 -1
  13. package/lib/components/ArticleList/ArticleBuddyList.d.ts +0 -1
  14. package/lib/components/ArticleList/ArticleBuddyList.d.ts.map +1 -1
  15. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts +3 -3
  16. package/lib/components/ArticleList/ArticleBuddyResponse.d.ts.map +1 -1
  17. package/lib/components/ArticleList/ArticleBuddyResponse.js +7 -8
  18. package/lib/components/ArticleList/ArticleBuddyResponse.js.map +1 -1
  19. package/lib/components/ArticleList/ArticleFeedback.d.ts +1 -2
  20. package/lib/components/ArticleList/ArticleFeedback.d.ts.map +1 -1
  21. package/lib/components/ArticleList/ArticleFeedback.js.map +1 -1
  22. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -1
  23. package/lib/components/ArticleList/ArticleList.js +1 -1
  24. package/lib/components/ArticleList/ArticleList.js.map +1 -1
  25. package/lib/components/ArticleList/ArticleList.types.d.ts +9 -5
  26. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
  27. package/lib/components/ArticleList/ArticleList.types.js.map +1 -1
  28. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -1
  29. package/lib/components/ArticleList/ArticleListHeader.d.ts +1 -1
  30. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -1
  31. package/lib/components/ArticleList/ArticleListHeader.js +1 -1
  32. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -1
  33. package/lib/components/ArticleList/ArticleSemanticSearch.d.ts +0 -1
  34. package/lib/components/ArticleList/ArticleSemanticSearch.d.ts.map +1 -1
  35. package/lib/components/ArticleList/ArticleSemanticSearch.js +11 -4
  36. package/lib/components/ArticleList/ArticleSemanticSearch.js.map +1 -1
  37. package/lib/components/ArticleList/ArticleSummaryHeader.js +1 -1
  38. package/lib/components/ArticleList/ArticleSummaryHeader.js.map +1 -1
  39. package/lib/components/ArticleList/ArticleTag.d.ts +0 -1
  40. package/lib/components/ArticleList/ArticleTag.d.ts.map +1 -1
  41. package/lib/components/ArticleList/ArticleTag.js +3 -3
  42. package/lib/components/ArticleList/ArticleTag.js.map +1 -1
  43. package/lib/components/ArticleList/QuestionList.d.ts +1 -2
  44. package/lib/components/ArticleList/QuestionList.d.ts.map +1 -1
  45. package/lib/components/ArticleList/QuestionList.js +1 -1
  46. package/lib/components/ArticleList/QuestionList.js.map +1 -1
  47. package/lib/components/ArticleList/RelatedQuestions.d.ts +19 -0
  48. package/lib/components/ArticleList/RelatedQuestions.d.ts.map +1 -0
  49. package/lib/components/ArticleList/RelatedQuestions.js +40 -0
  50. package/lib/components/ArticleList/RelatedQuestions.js.map +1 -0
  51. package/lib/components/Assignments/Assignments.js +1 -1
  52. package/lib/components/Assignments/Assignments.js.map +1 -1
  53. package/lib/components/Assignments/Assignments.styles.d.ts +3 -4
  54. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -1
  55. package/lib/components/CasePreview/CasePreview.d.ts +4 -4
  56. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  57. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  58. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +1 -1
  59. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -1
  60. package/lib/components/CaseView/CaseHeader/CaseHeader.js +1 -1
  61. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
  62. package/lib/components/CaseView/CaseHeader/Summary.d.ts +1 -1
  63. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -1
  64. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -1
  65. package/lib/components/CaseView/CaseView.context.d.ts +0 -1
  66. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -1
  67. package/lib/components/CaseView/CaseView.d.ts +1 -1
  68. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  69. package/lib/components/CaseView/CaseView.js +11 -14
  70. package/lib/components/CaseView/CaseView.js.map +1 -1
  71. package/lib/components/CaseView/CaseView.styles.d.ts +13 -13
  72. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  73. package/lib/components/CaseView/CaseView.styles.js +22 -10
  74. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  75. package/lib/components/CaseView/CaseView.test-ids.d.ts +1 -1
  76. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -1
  77. package/lib/components/CaseView/CaseView.types.d.ts +2 -0
  78. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  79. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  80. package/lib/components/CaseView/UtilitiesSummary.d.ts +1 -0
  81. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  82. package/lib/components/CaseView/UtilitiesSummary.js +61 -5
  83. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  84. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +0 -1
  85. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -1
  86. package/lib/components/CaseView/UtilitySummaryItemDialog.js +1 -1
  87. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -1
  88. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +0 -1
  89. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  90. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  91. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +0 -1
  92. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  93. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +1 -2
  94. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -1
  95. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -1
  96. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -1
  97. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -1
  98. package/lib/components/Confirmation/Confirmation.d.ts +3 -3
  99. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  100. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  101. package/lib/components/Details/Details.d.ts +4 -4
  102. package/lib/components/Details/Details.d.ts.map +1 -1
  103. package/lib/components/Details/Details.js +2 -2
  104. package/lib/components/Details/Details.js.map +1 -1
  105. package/lib/components/Details/Details.styles.d.ts +1 -1
  106. package/lib/components/Details/Details.test-ids.d.ts +1 -1
  107. package/lib/components/Details/Details.test-ids.d.ts.map +1 -1
  108. package/lib/components/Details/DetailsContext.d.ts +0 -1
  109. package/lib/components/Details/DetailsContext.d.ts.map +1 -1
  110. package/lib/components/GenAICoach/GenAICoach.d.ts +1 -1
  111. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  112. package/lib/components/GenAICoach/GenAICoach.js +5 -5
  113. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  114. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +12 -12
  115. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  116. package/lib/components/GenAICoach/GenAICoach.styles.js +14 -0
  117. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  118. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts +1 -1
  119. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts.map +1 -1
  120. package/lib/components/GenAICoach/GenAICoach.test-ids.js +4 -1
  121. package/lib/components/GenAICoach/GenAICoach.test-ids.js.map +1 -1
  122. package/lib/components/GenAICoach/GenAICoach.types.d.ts +8 -1
  123. package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
  124. package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
  125. package/lib/components/GenAICoach/GenAICoach.utils.d.ts +1 -1
  126. package/lib/components/GenAICoach/GenAICoach.utils.d.ts.map +1 -1
  127. package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
  128. package/lib/components/GenAICoach/GenAIMessage.js +74 -12
  129. package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
  130. package/lib/components/GenAICoach/InitialSuggestedMessage.js +1 -1
  131. package/lib/components/GenAICoach/InitialSuggestedMessage.js.map +1 -1
  132. package/lib/components/Glimpse/Glimpse.d.ts +3 -3
  133. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  134. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  135. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts +2 -3
  136. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts.map +1 -1
  137. package/lib/components/HierarchicalAssignments/AssignmentContainer.js.map +1 -1
  138. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts +1 -2
  139. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts.map +1 -1
  140. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts +3 -4
  141. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts.map +1 -1
  142. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts +22 -23
  143. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
  144. package/lib/components/HierarchicalAssignments/Assignments.styles.js +5 -1
  145. package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
  146. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts +2 -3
  147. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts.map +1 -1
  148. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js.map +1 -1
  149. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts +3 -3
  150. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts.map +1 -1
  151. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +2 -3
  152. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  153. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  154. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +2 -3
  155. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  156. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +0 -9
  157. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  158. package/lib/components/InteractionNotification/CountdownButton.d.ts +3 -3
  159. package/lib/components/InteractionNotification/CountdownButton.d.ts.map +1 -1
  160. package/lib/components/InteractionNotification/CountdownButton.js +1 -1
  161. package/lib/components/InteractionNotification/CountdownButton.js.map +1 -1
  162. package/lib/components/InteractionNotification/InteractionNotification.d.ts +3 -3
  163. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
  164. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
  165. package/lib/components/Predictions/Predictions.d.ts +2 -3
  166. package/lib/components/Predictions/Predictions.d.ts.map +1 -1
  167. package/lib/components/Predictions/Predictions.js +1 -0
  168. package/lib/components/Predictions/Predictions.js.map +1 -1
  169. package/lib/components/SearchResults/ActiveFilter.d.ts +1 -2
  170. package/lib/components/SearchResults/ActiveFilter.d.ts.map +1 -1
  171. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  172. package/lib/components/SearchResults/Filter.js.map +1 -1
  173. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  174. package/lib/components/SearchResults/SearchResults.d.ts +2 -3
  175. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  176. package/lib/components/SearchResults/SearchResults.js +1 -2
  177. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  178. package/lib/components/SearchResults/SearchResults.styles.d.ts +1 -2
  179. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  180. package/lib/components/Stages/StageGlimpse.js +1 -1
  181. package/lib/components/Stages/StageGlimpse.js.map +1 -1
  182. package/lib/components/Stages/Stages.d.ts +2 -3
  183. package/lib/components/Stages/Stages.d.ts.map +1 -1
  184. package/lib/components/Stages/Stages.js.map +1 -1
  185. package/lib/components/Stages/Stages.styles.d.ts +4 -5
  186. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  187. package/lib/components/Stakeholders/StakeholderForm.d.ts +1 -2
  188. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -1
  189. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -1
  190. package/lib/components/Stakeholders/Stakeholders.d.ts +2 -3
  191. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  192. package/lib/components/Stakeholders/Stakeholders.js +37 -26
  193. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  194. package/lib/components/Tags/Tags.d.ts +5 -5
  195. package/lib/components/Tags/Tags.d.ts.map +1 -1
  196. package/lib/components/Tags/Tags.js.map +1 -1
  197. package/lib/components/Tasks/TaskList.d.ts +7 -7
  198. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  199. package/lib/components/Tasks/TaskList.js.map +1 -1
  200. package/lib/components/Tasks/Tasks.d.ts +3 -3
  201. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  202. package/lib/components/Tasks/Tasks.js.map +1 -1
  203. package/lib/components/Tasks/Tasks.test-ids.d.ts +3 -3
  204. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -1
  205. package/lib/components/Timeline/Timeline.d.ts +2 -3
  206. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  207. package/lib/components/Timeline/Timeline.js.map +1 -1
  208. package/lib/components/Timeline/Timeline.styles.d.ts +5 -6
  209. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  210. package/lib/components/Timeline/TimelineItem.js +2 -2
  211. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  212. package/lib/components/Timeline/TimelineToolbar.d.ts +2 -3
  213. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -1
  214. package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
  215. package/lib/components/Timeline/utils.js.map +1 -1
  216. package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -1
  217. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts +3 -3
  218. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -1
  219. package/package.json +10 -9
@@ -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,EACjC,GAAyB;IAEzB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C,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;AAC3B,OAAO,YAAY,MA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AAE,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,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 { 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\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 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,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,kNASrB,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,kNAU7B,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,6NAUrB,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAQ7B,CAAC"}
@@ -20,7 +20,7 @@ const TimelineItem = ({ item: { date, title, icon, status, content }, timeFormat
20
20
  const isSMContentWidthOrAbove = useBreakpoint('sm', {
21
21
  breakpointRef: contentListRef
22
22
  });
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: {
23
+ return (_jsxs(StyledTimelineListItem, { children: [isSmallOrAbove && _jsx(StyledTime, { variant: timeFormat, 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
24
  cols: 'auto 1fr',
25
25
  alignContent: 'evenly',
26
26
  alignItems: 'center',
@@ -29,7 +29,7 @@ const TimelineItem = ({ item: { date, title, icon, status, content }, timeFormat
29
29
  cols: '1fr auto',
30
30
  alignContent: 'evenly',
31
31
  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: {
32
+ }, 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: collapsed, nullWhenCollapsed: true, children: _jsx(StyledCardContent, { children: isValidElement(content) ? (content) : (_jsx(Grid, { container: {
33
33
  gap: 1,
34
34
  cols: isSMContentWidthOrAbove
35
35
  ? `repeat(${content.length > 1 ? '2' : '1'}, minmax(16ch, auto) minmax(25%, 1fr))`
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EACL,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC,MAAM,mBAAmB,GAAG,CAC1B,OAAkC,EACiD,EAAE;IACrF,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC1B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;KAC3B;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,YAAY,GAAwD,CAAC,EACzE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAC5C,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACsB,EAAE,EAAE;IACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,I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,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 { 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":";AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EACL,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC,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,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,CAAC,QAAQ,GAAU,GACtD,CACR,IACgB,GACR,GACT,EACL,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAC/B,KAAC,cAAc,IAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,kBACxE,KAAC,iBAAiB,cACf,cAAc,CAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAC9B,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,SAAS,EAAE;oCACT,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 { 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} 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={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} 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={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,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,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BACD;oBACE,EAAE,EAAE,MAAM;oBACV,IAAI,EAAE,CAAC,CAAC,6BAA6B,CAAC;oBACtC,QAAQ,EAAE,QAAQ,KAAK,MAAM;iBAC9B;aACF;YACD,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;gBACrB,KAAK,EAAE,WAAW,CAAC,EAAqB,EAAE,CAAC,CAAC,CAAC;YAC/C,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,KAAC,WAAW,OACN,SAAS,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,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EAAE,MAAM;oBACV,IAAI,EAAE,CAAC,CAAC,6BAA6B,CAAC;oBACtC,QAAQ,EAAE,QAAQ,KAAK,MAAM;iBAC9B;aACF;YACD,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE;gBACrB,KAAK,EAAE,WAAW,CAAC,EAAqB,EAAE,CAAC,CAAC,CAAC;YAC/C,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,KAAC,WAAW,OACN,SAAS,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 { 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACZ,MAAM,6DAA6D,CAAC;AAIrE,MAAM,UAAU,iBAAiB,CAAC,IAA4B;IAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAA4B;IACjE,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,EAA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,CAAC,CAAC;SAC1C;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC/C;QACD,KAAK,aAAa,CAAC,CAAC;YAClB,OAAO,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SACjD;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC1C;QACD;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,QAA0B,EAC1B,OAAwB;IAExB,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,MAA0B,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACjE,MAAM,kBAAkB,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvF,IAAI,kBAAkB,EAAE;YACtB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SACrB;aAAM;YACL,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwC,EAAE,OAAa;IAClF,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import {\n getQuarter,\n parseToDate\n} from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\n\nimport type { ActivityObject, TimelineGroupBy } from './Timeline.types';\n\nexport function getDatePartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());\n}\n\nexport function getMonthYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth());\n}\n\nexport function getYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear());\n}\n\nexport function isSameDate(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();\n}\n\nexport function isSameMonthYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return (\n getMonthYearPartAsDate(firstDate).getTime() === getMonthYearPartAsDate(secondDate).getTime()\n );\n}\n\nexport function isSameYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getYearPartAsDate(firstDate).getTime() === getYearPartAsDate(secondDate).getTime();\n}\n\nexport function isSameQuarterYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return isSameYear(firstDate, secondDate) && getQuarter(firstDate) === getQuarter(secondDate);\n}\n\nexport function isSameGroup(\n firstDate: string | number | Date | undefined,\n secondDate: string | number | Date | undefined,\n groupBy: TimelineGroupBy\n): boolean {\n if (!firstDate || !secondDate) return false;\n switch (groupBy) {\n case 'none': {\n return true;\n }\n case 'date': {\n return isSameDate(firstDate, secondDate);\n }\n case 'monthyear': {\n return isSameMonthYear(firstDate, secondDate);\n }\n case 'quarteryear': {\n return isSameQuarterYear(firstDate, secondDate);\n }\n case 'year': {\n return isSameYear(firstDate, secondDate);\n }\n default:\n return false;\n }\n}\n\nexport function groupByActivity(\n activity: ActivityObject[],\n groupBy: TimelineGroupBy\n): ActivityObject[][] {\n return activity.reduce((result: ActivityObject[][], item, index) => {\n const isFirstItemInGroup = !isSameGroup(activity[index - 1]?.date, item.date, groupBy);\n if (isFirstItemInGroup) {\n result.push([item]);\n } else {\n result[result.length - 1].push(item);\n }\n return result;\n }, []);\n}\n\nexport function isFutureDate(date: string | number | Date | undefined, current: Date): boolean {\n if (!date || !current) return false;\n return parseToDate(date).getTime() > current.getTime();\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACZ,MAAM,6DAA6D,CAAC;AAIrE,MAAM,UAAU,iBAAiB,CAAC,IAA4B;IAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAA4B;IACjE,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAA4B;IAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,SAAiC,EACjC,UAAkC;IAElC,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,KAAK,iBAAiB,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,SAAiC,EACjC,UAAkC;IAElC,OAAO,CACL,sBAAsB,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,KAAK,sBAAsB,CAAC,UAAU,CAAC,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QACjE,MAAM,kBAAkB,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvF,IAAI,kBAAkB,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwC,EAAE,OAAa;IAClF,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import {\n getQuarter,\n parseToDate\n} from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\n\nimport type { ActivityObject, TimelineGroupBy } from './Timeline.types';\n\nexport function getDatePartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());\n}\n\nexport function getMonthYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth());\n}\n\nexport function getYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear());\n}\n\nexport function isSameDate(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();\n}\n\nexport function isSameMonthYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return (\n getMonthYearPartAsDate(firstDate).getTime() === getMonthYearPartAsDate(secondDate).getTime()\n );\n}\n\nexport function isSameYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getYearPartAsDate(firstDate).getTime() === getYearPartAsDate(secondDate).getTime();\n}\n\nexport function isSameQuarterYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return isSameYear(firstDate, secondDate) && getQuarter(firstDate) === getQuarter(secondDate);\n}\n\nexport function isSameGroup(\n firstDate: string | number | Date | undefined,\n secondDate: string | number | Date | undefined,\n groupBy: TimelineGroupBy\n): boolean {\n if (!firstDate || !secondDate) return false;\n switch (groupBy) {\n case 'none': {\n return true;\n }\n case 'date': {\n return isSameDate(firstDate, secondDate);\n }\n case 'monthyear': {\n return isSameMonthYear(firstDate, secondDate);\n }\n case 'quarteryear': {\n return isSameQuarterYear(firstDate, secondDate);\n }\n case 'year': {\n return isSameYear(firstDate, secondDate);\n }\n default:\n return false;\n }\n}\n\nexport function groupByActivity(\n activity: ActivityObject[],\n groupBy: TimelineGroupBy\n): ActivityObject[][] {\n return activity.reduce((result: ActivityObject[][], item, index) => {\n const isFirstItemInGroup = !isSameGroup(activity[index - 1]?.date, item.date, groupBy);\n if (isFirstItemInGroup) {\n result.push([item]);\n } else {\n result[result.length - 1].push(item);\n }\n return result;\n }, []);\n}\n\nexport function isFutureDate(date: string | number | Date | undefined, current: Date): boolean {\n if (!date || !current) return false;\n return parseToDate(date).getTime() > current.getTime();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesLayout.js","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAgD,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,IAAI,EACJ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AC,UAAU,OACL,eAAe,EACnB,OAAO,EAAE;wBACP,SAAS,EAAE,QAAQ;wBACnB,OAAO,EAAE,GAAG,EAAE;4BACZ,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;4BAC5B,YAAY,CAAC,KAAK,CAAC,CAAC;4BACpB,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;wBACvC,CAAC;qBACF,GACD,GACuB,CAC5B,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC","sourcesContent":["import { useState, type FunctionComponent, type PropsWithoutRef, useRef, useEffect } from 'react';\n\nimport {\n Drawer,\n Flex,\n Icon,\n useBreakpoint,\n useDirection,\n useI18n,\n Text,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as arrowMicroRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-right.icon';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCoachButton,\n StyledExpandCollapseUtilitiesButton\n} from '../CaseView/CaseView.styles';\nimport { UtilitySummaryItemDialog } from '../CaseView';\nimport GenAICoach from '../GenAICoach';\nimport type { UtilitiesGenAICoachProps } from '../GenAICoach';\n\nimport StyledUtilitiesLayout from './UtilitiesLayout.styles';\n\nregisterIcon(polarisSolidIcon, arrowMicroRightIcon, arrowMicroLeftIcon);\n\nexport interface UtilitiesLayoutProps extends BaseProps {\n /** GenAICoach props */\n genAICoachProps?: UtilitiesGenAICoachProps;\n /** Callback triggered when utilities are expanded or collapsed */\n onToggleUtilities?: (utilitiesExpanded: boolean) => void;\n /** show utilities in expanded mode */\n defaultExpandUtilities?: boolean;\n}\n\nconst UtilitiesLayout: FunctionComponent<UtilitiesLayoutProps & ForwardProps> = ({\n genAICoachProps,\n defaultExpandUtilities = false,\n onToggleUtilities,\n ...restProps\n}: PropsWithoutRef<UtilitiesLayoutProps>) => {\n const [utilitiesExpanded, setUtilitiesExpanded] = useState(defaultExpandUtilities);\n const [showCoach, setShowCoach] = useState(false);\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const genAICoachButtonRef = useRef<HTMLButtonElement>(null);\n const utilitiesToggled = useRef(false);\n const { end, start } = useDirection();\n const mdOrAbove = useBreakpoint('md');\n const lgOrAbove = useBreakpoint('lg');\n const t = useI18n();\n\n useEffect(() => {\n onToggleUtilities?.(utilitiesExpanded);\n if (!utilitiesExpanded && utilitiesToggled.current) {\n toggleButtonRef.current?.focus();\n }\n }, [utilitiesExpanded]);\n\n const utilitiesToggleButton = (\n <StyledExpandCollapseUtilitiesButton\n compact\n icon\n label={t(utilitiesExpanded ? 'collapse' : 'expand')}\n aria-label={t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel')}\n onClick={() => {\n utilitiesToggled.current = true;\n setUtilitiesExpanded(prevState => !prevState);\n }}\n ref={toggleButtonRef}\n >\n <Icon name={`arrow-micro-${utilitiesExpanded ? end : start}`} />\n </StyledExpandCollapseUtilitiesButton>\n );\n\n const genAICoach = genAICoachProps && (\n <GenAICoach {...genAICoachProps} variant={{ placement: 'fullpage' }} />\n );\n\n if (!mdOrAbove && genAICoach) {\n return genAICoach;\n }\n\n if (utilitiesExpanded && !lgOrAbove) {\n return (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={end}\n shadow\n nullWhenClosed\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n data-app-region\n >\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n <Text variant='h2'>{t('utilities')}</Text>\n {utilitiesToggleButton}\n </Flex>\n {genAICoach}\n </Flex>\n </Drawer>\n );\n }\n\n return (\n <Flex\n {...restProps}\n container={{ direction: 'column', gap: 1 }}\n as={StyledUtilitiesLayout}\n utilitiesExpanded={utilitiesExpanded}\n lgOrAbove={lgOrAbove}\n starterMessage={genAICoachProps?.starterMessage}\n >\n <Flex container={{ alignItems: 'center', justify: 'between', pad: [0, 0, 1, 0] }}>\n {utilitiesExpanded && <Text variant='h2'>{t('utilities')}</Text>}\n {utilitiesToggleButton}\n </Flex>\n {utilitiesExpanded && genAICoach}\n {!utilitiesExpanded && (\n <StyledCoachButton\n iconOnly\n variant='primary'\n ref={genAICoachButtonRef}\n onClick={() => setShowCoach(cur => !cur)}\n label={t('coach', ['Pega GenAI™'])}\n />\n )}\n {genAICoachButtonRef.current && genAICoachProps && showCoach && (\n <UtilitySummaryItemDialog\n target={genAICoachButtonRef.current}\n onDismiss={() => setShowCoach(false)}\n >\n <GenAICoach\n {...genAICoachProps}\n variant={{\n placement: 'dialog',\n onClose: () => {\n genAICoachProps.onClose?.();\n setShowCoach(false);\n genAICoachButtonRef.current?.focus();\n }\n }}\n />\n </UtilitySummaryItemDialog>\n )}\n </Flex>\n );\n};\nexport default UtilitiesLayout;\n"]}
1
+ {"version":3,"file":"UtilitiesLayout.js","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAgD,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,gBAAgB,MAAM,sEAAsE,CAAC;AACzG,OAAO,KAAK,mBAAmB,MAAM,0EAA0E,CAAC;AAChH,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAE9G,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,mCAAmC,EACpC,MAAM,6BAA6B,CAAC;AACrC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C;qBACF,GACD,GACuB,CAC5B,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC","sourcesContent":["import { useState, type FunctionComponent, type PropsWithoutRef, useRef, useEffect } from 'react';\n\nimport {\n Drawer,\n Flex,\n Icon,\n useBreakpoint,\n useDirection,\n useI18n,\n Text,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as arrowMicroRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-right.icon';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCoachButton,\n StyledExpandCollapseUtilitiesButton\n} from '../CaseView/CaseView.styles';\nimport { UtilitySummaryItemDialog } from '../CaseView';\nimport GenAICoach from '../GenAICoach';\nimport type { UtilitiesGenAICoachProps } from '../GenAICoach';\n\nimport StyledUtilitiesLayout from './UtilitiesLayout.styles';\n\nregisterIcon(polarisSolidIcon, arrowMicroRightIcon, arrowMicroLeftIcon);\n\nexport interface UtilitiesLayoutProps extends BaseProps {\n /** GenAICoach props */\n genAICoachProps?: UtilitiesGenAICoachProps;\n /** Callback triggered when utilities are expanded or collapsed */\n onToggleUtilities?: (utilitiesExpanded: boolean) => void;\n /** show utilities in expanded mode */\n defaultExpandUtilities?: boolean;\n}\n\nconst UtilitiesLayout: FunctionComponent<UtilitiesLayoutProps & ForwardProps> = ({\n genAICoachProps,\n defaultExpandUtilities = false,\n onToggleUtilities,\n ...restProps\n}: PropsWithoutRef<UtilitiesLayoutProps>) => {\n const [utilitiesExpanded, setUtilitiesExpanded] = useState(defaultExpandUtilities);\n const [showCoach, setShowCoach] = useState(false);\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const genAICoachButtonRef = useRef<HTMLButtonElement>(null);\n const utilitiesToggled = useRef(false);\n const { end, start } = useDirection();\n const mdOrAbove = useBreakpoint('md');\n const lgOrAbove = useBreakpoint('lg');\n const t = useI18n();\n\n useEffect(() => {\n onToggleUtilities?.(utilitiesExpanded);\n if (!utilitiesExpanded && utilitiesToggled.current) {\n toggleButtonRef.current?.focus();\n }\n }, [utilitiesExpanded]);\n\n const utilitiesToggleButton = (\n <StyledExpandCollapseUtilitiesButton\n compact\n icon\n label={t(utilitiesExpanded ? 'collapse' : 'expand')}\n aria-label={t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel')}\n onClick={() => {\n utilitiesToggled.current = true;\n setUtilitiesExpanded(prevState => !prevState);\n }}\n ref={toggleButtonRef}\n >\n <Icon name={`arrow-micro-${utilitiesExpanded ? end : start}`} />\n </StyledExpandCollapseUtilitiesButton>\n );\n\n const genAICoach = genAICoachProps && (\n <GenAICoach {...genAICoachProps} variant={{ placement: 'fullpage' }} />\n );\n\n if (!mdOrAbove && genAICoach) {\n return genAICoach;\n }\n\n if (utilitiesExpanded && !lgOrAbove) {\n return (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={end}\n shadow\n nullWhenClosed\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n data-app-region\n >\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n <Text variant='h2'>{t('utilities')}</Text>\n {utilitiesToggleButton}\n </Flex>\n {genAICoach}\n </Flex>\n </Drawer>\n );\n }\n\n return (\n <Flex\n {...restProps}\n container={{ direction: 'column', gap: 1 }}\n as={StyledUtilitiesLayout}\n utilitiesExpanded={utilitiesExpanded}\n lgOrAbove={lgOrAbove}\n starterMessage={genAICoachProps?.starterMessage}\n >\n <Flex container={{ alignItems: 'center', justify: 'between', pad: [0, 0, 1, 0] }}>\n {utilitiesExpanded && <Text variant='h2'>{t('utilities')}</Text>}\n {utilitiesToggleButton}\n </Flex>\n {utilitiesExpanded && genAICoach}\n {!utilitiesExpanded && (\n <StyledCoachButton\n iconOnly\n variant='primary'\n ref={genAICoachButtonRef}\n onClick={() => setShowCoach(cur => !cur)}\n label={t('coach', ['Pega GenAI™'])}\n />\n )}\n {genAICoachButtonRef.current && genAICoachProps && showCoach && (\n <UtilitySummaryItemDialog\n target={genAICoachButtonRef.current}\n onDismiss={() => setShowCoach(false)}\n >\n <GenAICoach\n {...genAICoachProps}\n variant={{\n placement: 'dialog',\n onClose: () => {\n genAICoachProps.onClose?.();\n setShowCoach(false);\n genAICoachButtonRef.current?.focus();\n }\n }}\n />\n </UtilitySummaryItemDialog>\n )}\n </Flex>\n );\n};\nexport default UtilitiesLayout;\n"]}
@@ -1,8 +1,8 @@
1
1
  import type { GenAICoachProps } from '../GenAICoach';
2
2
  declare const StyledUtilitiesLayout: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
- utilitiesExpanded?: boolean | undefined;
4
- lgOrAbove?: boolean | undefined;
5
- starterMessage: GenAICoachProps['starterMessage'];
3
+ utilitiesExpanded?: boolean;
4
+ lgOrAbove?: boolean;
5
+ starterMessage: GenAICoachProps["starterMessage"];
6
6
  }, never>;
7
7
  export default StyledUtilitiesLayout;
8
8
  //# sourceMappingURL=UtilitiesLayout.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesLayout.styles.d.ts","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,QAAA,MAAM,qBAAqB;;;oBAGT,eAAe,CAAC,gBAAgB,CAAC;SAsBjD,CAAC;AAIH,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"UtilitiesLayout.styles.d.ts","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,QAAA,MAAM,qBAAqB;wBACL,OAAO;gBACf,OAAO;oBACH,eAAe,CAAC,gBAAgB,CAAC;SAsBjD,CAAC;AAIH,eAAe,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-work",
3
- "version": "8.0.0-build.2.0",
3
+ "version": "8.0.0-build.20.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pegasystems/cosmos-react.git",
@@ -19,23 +19,24 @@
19
19
  "build": "tsc -b tsconfig.build.json"
20
20
  },
21
21
  "dependencies": {
22
- "@pega/cosmos-react-core": "8.0.0-build.2.0",
23
- "@pega/cosmos-react-rte": "8.0.0-build.2.0",
24
- "@types/react": "^17.0.62",
25
- "@types/react-dom": "^17.0.20",
22
+ "@pega/cosmos-react-core": "8.0.0-build.20.1",
23
+ "@pega/cosmos-react-rte": "8.0.0-build.20.1",
24
+ "@types/marked": "^4.0.2",
25
+ "@types/react": "^17.0.62 || ^18.3.3",
26
+ "@types/react-dom": "^17.0.20 || ^18.3.0",
26
27
  "@types/styled-components": "^5.1.26",
27
28
  "polished": "^4.1.0",
28
- "react": "^17.0.0",
29
- "react-dom": "^17.0.0",
29
+ "react": "^17.0.0 || ^18.0.0",
30
+ "react-dom": "^17.0.0 || ^18.0.0",
30
31
  "styled-components": "^5.2.0"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@storybook/addon-actions": "~8.2.9",
34
35
  "@storybook/react": "~8.2.9",
35
- "@testing-library/react": "^12.1.3",
36
+ "@testing-library/react": "^16.0.0",
36
37
  "@testing-library/user-event": "^14.5.1",
37
38
  "@types/dompurify": "^3.0.5",
38
39
  "dompurify": "^3.1.6",
39
- "typescript": "~5.2.2"
40
+ "typescript": "~5.5.4"
40
41
  }
41
42
  }