@pega/cosmos-react-work 8.0.0-build.3.2 → 8.0.0-build.30.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 (291) 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 +1 -1
  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/Assignments/Assignments.js +2 -2
  54. package/lib/components/Assignments/Assignments.js.map +1 -1
  55. package/lib/components/Assignments/Assignments.styles.d.ts +3 -4
  56. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -1
  57. package/lib/components/CasePreview/CasePreview.d.ts +4 -4
  58. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  59. package/lib/components/CasePreview/CasePreview.js +7 -6
  60. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  61. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +1 -1
  62. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -1
  63. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
  64. package/lib/components/CaseView/CaseHeader/CaseHeader.js +4 -3
  65. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
  66. package/lib/components/CaseView/CaseHeader/Summary.d.ts +1 -1
  67. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -1
  68. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -1
  69. package/lib/components/CaseView/CaseView.context.d.ts +0 -1
  70. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -1
  71. package/lib/components/CaseView/CaseView.d.ts +1 -1
  72. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  73. package/lib/components/CaseView/CaseView.js +15 -15
  74. package/lib/components/CaseView/CaseView.js.map +1 -1
  75. package/lib/components/CaseView/CaseView.styles.d.ts +14 -14
  76. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  77. package/lib/components/CaseView/CaseView.styles.js +224 -100
  78. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  79. package/lib/components/CaseView/CaseView.test-ids.d.ts +1 -1
  80. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -1
  81. package/lib/components/CaseView/CaseView.types.d.ts +8 -2
  82. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  83. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  84. package/lib/components/CaseView/UtilitiesSummary.d.ts +1 -0
  85. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  86. package/lib/components/CaseView/UtilitiesSummary.js +61 -5
  87. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  88. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +0 -1
  89. package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -1
  90. package/lib/components/CaseView/UtilitySummaryItemDialog.js +1 -1
  91. package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -1
  92. package/lib/components/CaseView/index.d.ts +1 -1
  93. package/lib/components/CaseView/index.d.ts.map +1 -1
  94. package/lib/components/CaseView/index.js.map +1 -1
  95. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +0 -1
  96. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  97. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  98. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +0 -1
  99. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  100. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +1 -2
  101. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -1
  102. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -1
  103. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -1
  104. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -1
  105. package/lib/components/Confirmation/Confirmation.d.ts +3 -3
  106. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  107. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  108. package/lib/components/Details/Details.d.ts +4 -4
  109. package/lib/components/Details/Details.d.ts.map +1 -1
  110. package/lib/components/Details/Details.js +2 -2
  111. package/lib/components/Details/Details.js.map +1 -1
  112. package/lib/components/Details/Details.styles.d.ts +1 -1
  113. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  114. package/lib/components/Details/Details.styles.js +17 -4
  115. package/lib/components/Details/Details.styles.js.map +1 -1
  116. package/lib/components/Details/Details.test-ids.d.ts +1 -1
  117. package/lib/components/Details/Details.test-ids.d.ts.map +1 -1
  118. package/lib/components/Details/DetailsContext.d.ts +0 -1
  119. package/lib/components/Details/DetailsContext.d.ts.map +1 -1
  120. package/lib/components/GenAICoach/GenAICoach.d.ts +1 -1
  121. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  122. package/lib/components/GenAICoach/GenAICoach.js +35 -45
  123. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  124. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +9 -14
  125. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  126. package/lib/components/GenAICoach/GenAICoach.styles.js +18 -44
  127. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  128. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts +1 -1
  129. package/lib/components/GenAICoach/GenAICoach.test-ids.d.ts.map +1 -1
  130. package/lib/components/GenAICoach/GenAICoach.test-ids.js +4 -1
  131. package/lib/components/GenAICoach/GenAICoach.test-ids.js.map +1 -1
  132. package/lib/components/GenAICoach/GenAICoach.types.d.ts +14 -6
  133. package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
  134. package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
  135. package/lib/components/GenAICoach/GenAICoach.utils.d.ts +1 -1
  136. package/lib/components/GenAICoach/GenAICoach.utils.d.ts.map +1 -1
  137. package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
  138. package/lib/components/GenAICoach/GenAIMessage.js +77 -13
  139. package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
  140. package/lib/components/GenAICoach/InitialSuggestedMessage.js +1 -1
  141. package/lib/components/GenAICoach/InitialSuggestedMessage.js.map +1 -1
  142. package/lib/components/GenAICoach/index.d.ts +1 -1
  143. package/lib/components/GenAICoach/index.d.ts.map +1 -1
  144. package/lib/components/GenAICoach/index.js.map +1 -1
  145. package/lib/components/Glimpse/Glimpse.d.ts +3 -3
  146. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  147. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  148. package/lib/components/HierarchicalAssignments/AssignmentContext.d.ts +22 -0
  149. package/lib/components/HierarchicalAssignments/AssignmentContext.d.ts.map +1 -0
  150. package/lib/components/HierarchicalAssignments/AssignmentContext.js +12 -0
  151. package/lib/components/HierarchicalAssignments/AssignmentContext.js.map +1 -0
  152. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts +4 -2
  153. package/lib/components/HierarchicalAssignments/AssignmentDetail.d.ts.map +1 -1
  154. package/lib/components/HierarchicalAssignments/AssignmentDetail.js +2 -2
  155. package/lib/components/HierarchicalAssignments/AssignmentDetail.js.map +1 -1
  156. package/lib/components/HierarchicalAssignments/AssignmentNode.d.ts +15 -0
  157. package/lib/components/HierarchicalAssignments/AssignmentNode.d.ts.map +1 -0
  158. package/lib/components/HierarchicalAssignments/AssignmentNode.js +28 -0
  159. package/lib/components/HierarchicalAssignments/AssignmentNode.js.map +1 -0
  160. package/lib/components/HierarchicalAssignments/AssignmentTree.d.ts +15 -0
  161. package/lib/components/HierarchicalAssignments/AssignmentTree.d.ts.map +1 -0
  162. package/lib/components/HierarchicalAssignments/AssignmentTree.js +15 -0
  163. package/lib/components/HierarchicalAssignments/AssignmentTree.js.map +1 -0
  164. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts +32 -31
  165. package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
  166. package/lib/components/HierarchicalAssignments/Assignments.styles.js +93 -69
  167. package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
  168. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts +2 -3
  169. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.d.ts.map +1 -1
  170. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js +90 -8
  171. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.js.map +1 -1
  172. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts +3 -3
  173. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.d.ts.map +1 -1
  174. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.js +2 -1
  175. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.test-ids.js.map +1 -1
  176. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +12 -12
  177. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
  178. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
  179. package/lib/components/HierarchicalAssignments/helpers.d.ts +20 -0
  180. package/lib/components/HierarchicalAssignments/helpers.d.ts.map +1 -0
  181. package/lib/components/HierarchicalAssignments/helpers.js +164 -0
  182. package/lib/components/HierarchicalAssignments/helpers.js.map +1 -0
  183. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +14 -0
  184. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -0
  185. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +86 -0
  186. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -0
  187. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts +23 -0
  188. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.d.ts.map +1 -0
  189. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js +108 -0
  190. package/lib/components/HierarchicalAssignments/nodeItems/CaseDetail.js.map +1 -0
  191. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.d.ts +24 -0
  192. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.d.ts.map +1 -0
  193. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.js +54 -0
  194. package/lib/components/HierarchicalAssignments/nodeItems/useNodeFocus.js.map +1 -0
  195. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +2 -3
  196. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  197. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +5 -2
  198. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  199. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +2 -3
  200. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  201. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +32 -21
  202. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  203. package/lib/components/InteractionNotification/CountdownButton.d.ts +3 -3
  204. package/lib/components/InteractionNotification/CountdownButton.d.ts.map +1 -1
  205. package/lib/components/InteractionNotification/CountdownButton.js +1 -1
  206. package/lib/components/InteractionNotification/CountdownButton.js.map +1 -1
  207. package/lib/components/InteractionNotification/InteractionNotification.d.ts +3 -3
  208. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
  209. package/lib/components/InteractionNotification/InteractionNotification.js +1 -1
  210. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
  211. package/lib/components/Predictions/Predictions.d.ts +2 -3
  212. package/lib/components/Predictions/Predictions.d.ts.map +1 -1
  213. package/lib/components/Predictions/Predictions.js +1 -0
  214. package/lib/components/Predictions/Predictions.js.map +1 -1
  215. package/lib/components/SearchResults/ActiveFilter.d.ts +1 -2
  216. package/lib/components/SearchResults/ActiveFilter.d.ts.map +1 -1
  217. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  218. package/lib/components/SearchResults/Filter.js.map +1 -1
  219. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  220. package/lib/components/SearchResults/SearchResults.d.ts +2 -3
  221. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  222. package/lib/components/SearchResults/SearchResults.js +1 -2
  223. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  224. package/lib/components/SearchResults/SearchResults.styles.d.ts +1 -2
  225. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  226. package/lib/components/Stages/StageGlimpse.js +1 -1
  227. package/lib/components/Stages/StageGlimpse.js.map +1 -1
  228. package/lib/components/Stages/Stages.d.ts +2 -3
  229. package/lib/components/Stages/Stages.d.ts.map +1 -1
  230. package/lib/components/Stages/Stages.js +4 -1
  231. package/lib/components/Stages/Stages.js.map +1 -1
  232. package/lib/components/Stages/Stages.styles.d.ts +7 -6
  233. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  234. package/lib/components/Stages/Stages.styles.js +7 -5
  235. package/lib/components/Stages/Stages.styles.js.map +1 -1
  236. package/lib/components/Stakeholders/StakeholderForm.d.ts +1 -2
  237. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -1
  238. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -1
  239. package/lib/components/Stakeholders/Stakeholders.d.ts +2 -3
  240. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  241. package/lib/components/Stakeholders/Stakeholders.js +37 -26
  242. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  243. package/lib/components/Tags/Tags.d.ts +5 -5
  244. package/lib/components/Tags/Tags.d.ts.map +1 -1
  245. package/lib/components/Tags/Tags.js.map +1 -1
  246. package/lib/components/Tasks/TaskList.d.ts +13 -8
  247. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  248. package/lib/components/Tasks/TaskList.js +15 -7
  249. package/lib/components/Tasks/TaskList.js.map +1 -1
  250. package/lib/components/Tasks/Tasks.d.ts +8 -3
  251. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  252. package/lib/components/Tasks/Tasks.js +14 -4
  253. package/lib/components/Tasks/Tasks.js.map +1 -1
  254. package/lib/components/Tasks/Tasks.test-ids.d.ts +3 -3
  255. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -1
  256. package/lib/components/Timeline/Timeline.d.ts +3 -3
  257. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  258. package/lib/components/Timeline/Timeline.js +9 -2
  259. package/lib/components/Timeline/Timeline.js.map +1 -1
  260. package/lib/components/Timeline/Timeline.styles.d.ts +5 -6
  261. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  262. package/lib/components/Timeline/Timeline.styles.js +8 -3
  263. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  264. package/lib/components/Timeline/Timeline.types.d.ts +11 -1
  265. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  266. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  267. package/lib/components/Timeline/TimelineItem.d.ts +1 -2
  268. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  269. package/lib/components/Timeline/TimelineItem.js +10 -9
  270. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  271. package/lib/components/Timeline/TimelineToolbar.d.ts +2 -3
  272. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -1
  273. package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
  274. package/lib/components/Timeline/utils.js.map +1 -1
  275. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts +5 -0
  276. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts.map +1 -1
  277. package/lib/components/UtilitiesLayout/UtilitiesLayout.js +3 -3
  278. package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -1
  279. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts +2 -4
  280. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -1
  281. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js +2 -5
  282. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js.map +1 -1
  283. package/package.json +10 -9
  284. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts +0 -33
  285. package/lib/components/HierarchicalAssignments/AssignmentContainer.d.ts.map +0 -1
  286. package/lib/components/HierarchicalAssignments/AssignmentContainer.js +0 -46
  287. package/lib/components/HierarchicalAssignments/AssignmentContainer.js.map +0 -1
  288. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts +0 -11
  289. package/lib/components/HierarchicalAssignments/AssignmentItem.d.ts.map +0 -1
  290. package/lib/components/HierarchicalAssignments/AssignmentItem.js +0 -22
  291. package/lib/components/HierarchicalAssignments/AssignmentItem.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutCell.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/LayoutCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAC3B,CAAC,EACC,aAAa,GAAG,IAAI,EACpB,eAAe,EACf,QAAQ,EACR,KAAK,EAMN,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;0BAEY,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;;gCAEzB,eAAe;;;;;;wCAMP,QAAQ,IAAI,YAAY;;;;;QAKxD,CAAC,aAAa;QAChB,GAAG,CAAA;;OAEF;;QAEC,qBAAqB;;;;;;;;;;KAUxB,CAAC;AACJ,CAAC,CACF,CAAC;AACF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAElD,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAsB,EAAE,EAAE;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,OAAO,kBAAkB,CAAC,YAAY,CAAC,KAAwC,CAAC,IAAI,MAAM,CAAC;IAC7F,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;QAEpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,GAAG,KAAK,IAAI,CAAC;SACrB;QAED,IACE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACpB,KAAK,CAAC,MAAM,IAAI,CAAC;YACjB,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ;YAC5B,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClC;YACA,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SACjC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CACvB,KAAC,IAAI,IACH,EAAE,EAAE,UAAU,EACd,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR,EACD,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,EACtD,aAAa,EAAE,YAAY,CAAC,aAAa,EACzC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,YAEjB,MAAM,CAAC,OAAO,GACV,CACR,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport { Flex, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport { StyledAppAnnouncement } from '../AppAnnouncement/AppAnnouncement';\n\nimport type { Config } from './ConfigurableLayout.types';\nimport widthConfigOptions from './options';\nimport { itemMinWidth, cellGap } from './defaults';\n\nconst StyledCell = styled.div(\n ({\n fillAvailable = true,\n percentageWidth,\n minWidth,\n theme\n }: {\n fillAvailable: boolean;\n percentageWidth?: string;\n minWidth?: string | undefined;\n theme: DefaultTheme;\n }) => {\n return css`\n /* variables */\n --marginGap: calc(${cellGap} * ${theme.base.spacing});\n --totalMargin: calc(2 * var(--marginGap));\n --percentageBasis: calc(${percentageWidth} - var(--totalMargin));\n --maxWidth: calc(100% - var(--totalMargin));\n\n /* styles */\n flex-wrap: wrap;\n flex-basis: var(--percentageBasis);\n min-width: min(var(--maxWidth), ${minWidth || itemMinWidth});\n max-width: var(--maxWidth);\n margin-block-end: var(--totalMargin);\n margin-inline: var(--marginGap);\n\n ${!fillAvailable &&\n css`\n flex-grow: 0;\n `}\n\n ${StyledAppAnnouncement} {\n align-self: stretch;\n }\n\n > *,\n > [data-config-root] > * {\n width: 100%;\n height: auto;\n overflow-x: auto;\n }\n `;\n }\n);\nStyledCell.defaultProps = defaultThemeProp;\n\nconst validWidthUnits = ['px', 'ch', 'rem', 'em'];\n\nconst LayoutCell = ({ config }: { config: Config }) => {\n const layoutConfig = useMemo(() => config.layoutConfig, [config]);\n const percentageWidth = useMemo(() => {\n return widthConfigOptions[layoutConfig.width as keyof typeof widthConfigOptions] || '100%';\n }, [layoutConfig.width]);\n const minWidth = useMemo(() => {\n const value = layoutConfig.minWidth;\n\n if (typeof value === 'number') {\n return `${value}px`;\n }\n\n if (\n Array.isArray(value) &&\n value.length >= 2 &&\n typeof value[0] === 'number' &&\n validWidthUnits.includes(value[1])\n ) {\n return `${value[0]}${value[1]}`;\n }\n }, [layoutConfig.minWidth]);\n\n return config?.content ? (\n <Flex\n as={StyledCell}\n item={{\n grow: 1\n }}\n container={{ justify: 'stretch', alignItems: 'start' }}\n fillAvailable={layoutConfig.fillAvailable}\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n >\n {config.content}\n </Flex>\n ) : null;\n};\n\nexport default LayoutCell;\n"]}
1
+ {"version":3,"file":"LayoutCell.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/LayoutCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAC3B,CAAC,EACC,aAAa,GAAG,IAAI,EACpB,eAAe,EACf,QAAQ,EACR,KAAK,EAMN,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;0BAEY,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;;gCAEzB,eAAe;;;;;;wCAMP,QAAQ,IAAI,YAAY;;;;;QAKxD,CAAC,aAAa;QAChB,GAAG,CAAA;;OAEF;;QAEC,qBAAqB;;;;;;;;;;KAUxB,CAAC;AACJ,CAAC,CACF,CAAC;AACF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAElD,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAsB,EAAE,EAAE;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,OAAO,kBAAkB,CAAC,YAAY,CAAC,KAAwC,CAAC,IAAI,MAAM,CAAC;IAC7F,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;QAEpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,GAAG,KAAK,IAAI,CAAC;QACtB,CAAC;QAED,IACE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACpB,KAAK,CAAC,MAAM,IAAI,CAAC;YACjB,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ;YAC5B,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClC,CAAC;YACD,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAClC,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CACvB,KAAC,IAAI,IACH,EAAE,EAAE,UAAU,EACd,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR,EACD,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,EACtD,aAAa,EAAE,YAAY,CAAC,aAAa,EACzC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,YAEjB,MAAM,CAAC,OAAO,GACV,CACR,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport { Flex, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport { StyledAppAnnouncement } from '../AppAnnouncement/AppAnnouncement';\n\nimport type { Config } from './ConfigurableLayout.types';\nimport widthConfigOptions from './options';\nimport { itemMinWidth, cellGap } from './defaults';\n\nconst StyledCell = styled.div(\n ({\n fillAvailable = true,\n percentageWidth,\n minWidth,\n theme\n }: {\n fillAvailable: boolean;\n percentageWidth?: string;\n minWidth?: string | undefined;\n theme: DefaultTheme;\n }) => {\n return css`\n /* variables */\n --marginGap: calc(${cellGap} * ${theme.base.spacing});\n --totalMargin: calc(2 * var(--marginGap));\n --percentageBasis: calc(${percentageWidth} - var(--totalMargin));\n --maxWidth: calc(100% - var(--totalMargin));\n\n /* styles */\n flex-wrap: wrap;\n flex-basis: var(--percentageBasis);\n min-width: min(var(--maxWidth), ${minWidth || itemMinWidth});\n max-width: var(--maxWidth);\n margin-block-end: var(--totalMargin);\n margin-inline: var(--marginGap);\n\n ${!fillAvailable &&\n css`\n flex-grow: 0;\n `}\n\n ${StyledAppAnnouncement} {\n align-self: stretch;\n }\n\n > *,\n > [data-config-root] > * {\n width: 100%;\n height: auto;\n overflow-x: auto;\n }\n `;\n }\n);\nStyledCell.defaultProps = defaultThemeProp;\n\nconst validWidthUnits = ['px', 'ch', 'rem', 'em'];\n\nconst LayoutCell = ({ config }: { config: Config }) => {\n const layoutConfig = useMemo(() => config.layoutConfig, [config]);\n const percentageWidth = useMemo(() => {\n return widthConfigOptions[layoutConfig.width as keyof typeof widthConfigOptions] || '100%';\n }, [layoutConfig.width]);\n const minWidth = useMemo(() => {\n const value = layoutConfig.minWidth;\n\n if (typeof value === 'number') {\n return `${value}px`;\n }\n\n if (\n Array.isArray(value) &&\n value.length >= 2 &&\n typeof value[0] === 'number' &&\n validWidthUnits.includes(value[1])\n ) {\n return `${value[0]}${value[1]}`;\n }\n }, [layoutConfig.minWidth]);\n\n return config?.content ? (\n <Flex\n as={StyledCell}\n item={{\n grow: 1\n }}\n container={{ justify: 'stretch', alignItems: 'start' }}\n fillAvailable={layoutConfig.fillAvailable}\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n >\n {config.content}\n </Flex>\n ) : null;\n};\n\nexport default LayoutCell;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useTrackWrappedRegions.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/useTrackWrappedRegions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,QAAA,MAAM,sBAAsB,kBACX,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,aAC1B,OAAO;kBACD,IAAI,WAAW,GAAG,IAAI,CAAC;yBAAuB,OAAO,EAAE;CA2CzE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"useTrackWrappedRegions.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/useTrackWrappedRegions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,QAAA,MAAM,sBAAsB,kBACX,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,aAC1B,OAAO,KACjB;IAAE,YAAY,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAAC,mBAAmB,EAAE,OAAO,EAAE,CAAA;CA2CzE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTrackWrappedRegions.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/useTrackWrappedRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,sBAAsB,GAAG,CAC7B,aAAqC,EACrC,QAAkB,EACyD,EAAE;IAC7E,MAAM,YAAY,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAC5D,IAAI,K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AsB,CAAC","sourcesContent":["import { useRef, useEffect, useState } from 'react';\nimport type { Ref } from 'react';\n\nimport { debounce } from '@pega/cosmos-react-core';\n\nconst useTrackWrappedRegions = (\n regionElArray: (HTMLElement | null)[],\n disabled?: boolean\n): { containerRef: Ref<HTMLElement | null>; regionWrappedStates: boolean[] } => {\n const containerRef = useRef<HTMLElement | null>(null);\n const [regionWrappedStates, setRegionWrappedStates] = useState(\n new Array(regionElArray.length).fill(false)\n );\n\n useEffect(() => {\n if (disabled) return;\n\n let isMounted = true;\n\n const observer = new ResizeObserver(\n debounce(entries => {\n if (isMounted) {\n const containerWidth = entries[0].contentRect.width;\n const newWrappedStates = [...regionWrappedStates];\n\n regionElArray.forEach((regionEl, index) => {\n const regionWidth = regionEl?.getBoundingClientRect().width;\n\n if (regionWidth !== undefined && regionWidth >= containerWidth) {\n newWrappedStates[index] = true;\n } else {\n newWrappedStates[index] = false;\n }\n });\n\n setRegionWrappedStates(newWrappedStates);\n }\n }, 100)\n );\n\n if (containerRef.current && regionElArray.length) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n isMounted = false;\n observer.disconnect();\n };\n }, [containerRef, regionElArray]);\n\n return { containerRef, regionWrappedStates };\n};\n\nexport default useTrackWrappedRegions;\n"]}
1
+ {"version":3,"file":"useTrackWrappedRegions.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/useTrackWrappedRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,sBAAsB,GAAG,CAC7B,aAAqC,EACrC,QAAkB,EACyD,EAAE;IAC7E,MAAM,YAAY,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAC5D,IAAI,KAAK,CAAC,aAAa,CAAC,MAA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CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import { useRef, useEffect, useState } from 'react';\nimport type { Ref } from 'react';\n\nimport { debounce } from '@pega/cosmos-react-core';\n\nconst useTrackWrappedRegions = (\n regionElArray: (HTMLElement | null)[],\n disabled?: boolean\n): { containerRef: Ref<HTMLElement | null>; regionWrappedStates: boolean[] } => {\n const containerRef = useRef<HTMLElement | null>(null);\n const [regionWrappedStates, setRegionWrappedStates] = useState(\n new Array(regionElArray.length).fill(false)\n );\n\n useEffect(() => {\n if (disabled) return;\n\n let isMounted = true;\n\n const observer = new ResizeObserver(\n debounce(entries => {\n if (isMounted) {\n const containerWidth = entries[0].contentRect.width;\n const newWrappedStates = [...regionWrappedStates];\n\n regionElArray.forEach((regionEl, index) => {\n const regionWidth = regionEl?.getBoundingClientRect().width;\n\n if (regionWidth !== undefined && regionWidth >= containerWidth) {\n newWrappedStates[index] = true;\n } else {\n newWrappedStates[index] = false;\n }\n });\n\n setRegionWrappedStates(newWrappedStates);\n }\n }, 100)\n );\n\n if (containerRef.current && regionElArray.length) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n isMounted = false;\n observer.disconnect();\n };\n }, [containerRef, regionElArray]);\n\n return { containerRef, regionWrappedStates };\n};\n\nexport default useTrackWrappedRegions;\n"]}
@@ -1,5 +1,5 @@
1
- import type { FunctionComponent, ReactNode, Ref } from 'react';
2
- import type { ForwardProps, UnorderedListProps, NoChildrenProp } from '@pega/cosmos-react-core';
1
+ import type { ReactNode, Ref } from 'react';
2
+ import type { ForwardRefForwardPropsComponent, UnorderedListProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
3
  export interface ConfirmationProps extends NoChildrenProp {
4
4
  /** The title of the confirmation */
5
5
  title?: string;
@@ -14,6 +14,6 @@ export interface ConfirmationProps extends NoChildrenProp {
14
14
  /** Ref for the wrapping element. */
15
15
  ref?: Ref<HTMLElement>;
16
16
  }
17
- declare const Confirmation: FunctionComponent<ConfirmationProps & ForwardProps>;
17
+ declare const Confirmation: ForwardRefForwardPropsComponent<ConfirmationProps>;
18
18
  export default Confirmation;
19
19
  //# sourceMappingURL=Confirmation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAchF,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAUhG,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,iDAAiD;IACjD,SAAS,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAUD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAiDrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAc7D,OAAO,KAAK,EACV,+BAA+B,EAC/B,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAUjC,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,OAAO,CAAC,EAAE,SA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,GACK,GACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useContext, useMemo } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Card,\n CardContent,\n Flex,\n Text,\n useI18n,\n UnorderedList,\n Button,\n defaultThemeProp,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, UnorderedListProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nimport { StyledDetails, StyledFieldValueGroupLabel, DetailsContext } from '../Details';\n\nconst StyledWhatsNextList = styled(UnorderedList)`\n padding-inline-start: 0;\n`;\n\nStyledWhatsNextList.defaultProps = defaultThemeProp;\n\nexport interface ConfirmationProps extends NoChildrenProp {\n /** The title of the confirmation */\n title?: string;\n /** Region for a Field Value List component */\n details?: ReactNode;\n /** Array of React nodes to be put into a list */\n whatsNext?: UnorderedListProps['items'];\n /** Region for a Tasks component */\n tasks?: ReactNode;\n /** Called when the done/close button is clicked */\n onClose?: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nconst StyledConfirmationDetails = styled.div(() => {\n return css`\n > ${StyledDetails} > ${StyledFieldValueGroupLabel}:first-child {\n margin-block-start: 0;\n }\n `;\n});\n\nconst Confirmation: FunctionComponent<ConfirmationProps & ForwardProps> = forwardRef(\n function Confirmation(\n { title, details, whatsNext, tasks, onClose, ...restProps }: PropsWithoutRef<ConfirmationProps>,\n ref\n ) {\n const t = useI18n();\n const detailsContext = useContext(DetailsContext);\n\n const detailsCtxValue = useMemo(() => {\n return {\n ...detailsContext,\n depth: 4\n };\n }, [detailsContext]);\n\n return (\n <Card {...restProps} ref={ref}>\n <CardContent>\n <Flex container={{ gap: 3, direction: 'column' }}>\n {title && <Text variant='h3'>{title}</Text>}\n\n {details && (\n <DetailsContext.Provider value={detailsCtxValue}>\n <StyledConfirmationDetails>{details}</StyledConfirmationDetails>\n </DetailsContext.Provider>\n )}\n\n {whatsNext && (\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h4'>{t('confirmation_whats_next')}</Text>\n <StyledWhatsNextList items={whatsNext} as={StyledWhatsNextList} />\n </Flex>\n )}\n\n {tasks}\n\n {onClose && (\n <Flex container={{ justify: 'end' }}>\n <Button onClick={onClose} variant='primary'>\n {t('done')}\n {title ? <VisuallyHiddenText>{`- ${title}`}</VisuallyHiddenText> : null}\n </Button>\n </Flex>\n )}\n </Flex>\n </CardContent>\n </Card>\n );\n }\n);\n\nexport default Confirmation;\n"]}
1
+ {"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,mBAAmB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;CAEhD,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAiBpD,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IAChD,OAAO,GAAG,CAAA;QACJ,aAAa,MAAM,0BAA0B;;;GAGlD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAuD,UAAU,CACjF,SAAS,YAAY,CACnB,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,EA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,CACR,IACI,GACK,GACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useContext, useMemo } from 'react';\nimport type { PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Card,\n CardContent,\n Flex,\n Text,\n useI18n,\n UnorderedList,\n Button,\n defaultThemeProp,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n UnorderedListProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport { StyledDetails, StyledFieldValueGroupLabel, DetailsContext } from '../Details';\n\nconst StyledWhatsNextList = styled(UnorderedList)`\n padding-inline-start: 0;\n`;\n\nStyledWhatsNextList.defaultProps = defaultThemeProp;\n\nexport interface ConfirmationProps extends NoChildrenProp {\n /** The title of the confirmation */\n title?: string;\n /** Region for a Field Value List component */\n details?: ReactNode;\n /** Array of React nodes to be put into a list */\n whatsNext?: UnorderedListProps['items'];\n /** Region for a Tasks component */\n tasks?: ReactNode;\n /** Called when the done/close button is clicked */\n onClose?: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nconst StyledConfirmationDetails = styled.div(() => {\n return css`\n > ${StyledDetails} > ${StyledFieldValueGroupLabel}:first-child {\n margin-block-start: 0;\n }\n `;\n});\n\nconst Confirmation: ForwardRefForwardPropsComponent<ConfirmationProps> = forwardRef(\n function Confirmation(\n { title, details, whatsNext, tasks, onClose, ...restProps }: PropsWithoutRef<ConfirmationProps>,\n ref\n ) {\n const t = useI18n();\n const detailsContext = useContext(DetailsContext);\n\n const detailsCtxValue = useMemo(() => {\n return {\n ...detailsContext,\n depth: 4\n };\n }, [detailsContext]);\n\n return (\n <Card {...restProps} ref={ref}>\n <CardContent>\n <Flex container={{ gap: 3, direction: 'column' }}>\n {title && <Text variant='h3'>{title}</Text>}\n\n {details && (\n <DetailsContext.Provider value={detailsCtxValue}>\n <StyledConfirmationDetails>{details}</StyledConfirmationDetails>\n </DetailsContext.Provider>\n )}\n\n {whatsNext && (\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h4'>{t('confirmation_whats_next')}</Text>\n <StyledWhatsNextList items={whatsNext} as={StyledWhatsNextList} />\n </Flex>\n )}\n\n {tasks}\n\n {onClose && (\n <Flex container={{ justify: 'end' }}>\n <Button onClick={onClose} variant='primary'>\n {t('done')}\n {title ? <VisuallyHiddenText>{`- ${title}`}</VisuallyHiddenText> : null}\n </Button>\n </Flex>\n )}\n </Flex>\n </CardContent>\n </Card>\n );\n }\n);\n\nexport default Confirmation;\n"]}
@@ -1,5 +1,5 @@
1
- import type { FC, ReactNode, Ref } from 'react';
2
- import type { AdditionalInfoProps, ForwardProps, TestIdProp } from '@pega/cosmos-react-core';
1
+ import type { PropsWithoutRef, ReactNode, Ref } from 'react';
2
+ import type { AdditionalInfoProps, TestIdProp } from '@pega/cosmos-react-core';
3
3
  export type DetailsProps = TestIdProp & {
4
4
  /**
5
5
  * FieldValueItems to display as highlighted data above children
@@ -46,8 +46,8 @@ export type DetailsProps = TestIdProp & {
46
46
  additionalInfo?: never;
47
47
  collapsible?: never;
48
48
  });
49
- declare const _default: FC<DetailsProps & ForwardProps> & {
50
- getTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "highlighted-data", "data", "expand-collapse"]>;
49
+ declare const _default: import("react").ForwardRefExoticComponent<PropsWithoutRef<DetailsProps> & import("react").RefAttributes<HTMLDivElement>> & {
50
+ getTestIds: (testIdProp?: TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "highlighted-data", "data", "expand-collapse"]>;
51
51
  };
52
52
  export default _default;
53
53
  //# sourceMappingURL=Details.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AACA,OAAO,KA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
+ {"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAmB7D,OAAO,KAAK,EAAE,mBAAmB,EAAc,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAgB3F,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG;IACtC;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC;IAC9B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,EACH;QACE,CAAC,EAAE,SAAS,CAAC;QACb,CAAC,CAAC,EAAE,KAAK,CAAC;QACV,CAAC,CAAC,EAAE,KAAK,CAAC;KACX,GACD;QACE,CAAC,EAAE,SAAS,CAAC;QACb,CAAC,EAAE,SAAS,CAAC;QACb,CAAC,CAAC,EAAE,KAAK,CAAC;KACX,GACD;QACE,CAAC,EAAE,SAAS,CAAC;QACb,CAAC,EAAE,SAAS,CAAC;QACb,CAAC,EAAE,SAAS,CAAC;KACd,CAAC;IACN,6BAA6B;IAC7B,WAAW,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IAC1C,uCAAuC;IACvC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B,GAAG,CACE;IACE,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACzC,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;KAC1C,CAAC;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACD;IACE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CACJ,CAAC;;;;AAwNJ,wBAAuD"}
@@ -74,7 +74,7 @@ const Details = forwardRef(function Details({ testId, highlightedData, columns,
74
74
  const content = useMemo(() => {
75
75
  let applyColumnCount = columnCount;
76
76
  if (columnCount !== 1) {
77
- if (fitsThreeColumns) {
77
+ if (columnCount === 3 && fitsThreeColumns) {
78
78
  applyColumnCount = 3;
79
79
  }
80
80
  else if (fitsTwoColumns) {
@@ -104,7 +104,7 @@ const Details = forwardRef(function Details({ testId, highlightedData, columns,
104
104
  ]);
105
105
  return (_jsx(DetailsContext.Provider, { value: contextValue, children: _jsxs(StyledDetails, { "data-testid": testIds.root, ref: containerRef, variant: applyVariant, children: [name && (_jsx(StyledFieldValueGroupLabel, { "data-testid": testIds.heading, children: _jsx(Flex, { container: { alignItems: 'center', gap: 0.5 }, children: collapsible ? (_jsxs(_Fragment, { children: [_jsx(Button, { type: 'button', variant: 'text', onClick: () => {
106
106
  setOpen(cur => !cur);
107
- }, "aria-expanded": open ? 'true' : 'false', "aria-label": t(open ? 'collapse_noun' : 'expand_noun', [name]), children: _jsxs(Flex, { container: { alignItems: 'center', gap: 0.5 }, as: 'span', children: [_jsx(Icon, { name: 'caret-right' }), nameText] }) }), additionalInfo] })) : (_jsxs(_Fragment, { children: [nameText, additionalInfo] })) }) })), collapsible ? (_jsx(ExpandCollapse, { "data-testid": testIds.expandCollapse, collapsed: !open, children: content })) : (content)] }) }));
107
+ }, "aria-expanded": open, "aria-label": t(open ? 'collapse_noun' : 'expand_noun', [name]), children: _jsxs(Flex, { container: { alignItems: 'center', gap: 0.5 }, as: 'span', children: [_jsx(Icon, { name: 'caret-right' }), nameText] }) }), additionalInfo] })) : (_jsxs(_Fragment, { children: [nameText, additionalInfo] })) }) })), collapsible ? (_jsx(ExpandCollapse, { "data-testid": testIds.expandCollapse, collapsed: !open, children: content })) : (content)] }) }));
108
108
  });
109
109
  export default withTestIds(Details, getDetailsTestIds);
110
110
  //# sourceMappingURL=Details.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Details.js","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,cAAc,EACd,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,yBAAyB,EACzB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,2BAA2B,EAC3B,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAyD1B,MAAM,OAAO,GAAoC,UAAU,CAAC,SAAS,OAAO,CAC1E,EACE,MAAM,EACN,eAAe,EACf,OAAO,EACP,IAAI,EACJ,WAAW,EACX,WAAW,EACX,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,cAAc,EAAE,kBAAkB,EACnC,EACD,GAAG;IAEH,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACtD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAE7E,MAAM,YAAY,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,Q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EACb,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;wCACZ,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;oCACvB,CAAC,mBACc,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,gBAC1B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,YAE7D,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAC,MAAM,aAC5D,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,EAC1B,QAAQ,IACJ,GACA,EACR,cAAc,IACd,CACJ,CAAC,CAAC,CAAC,CACF,8BACG,QAAQ,EACR,cAAc,IACd,CACJ,GACI,GACoB,CAC9B,EAEA,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,cAAc,mBAAc,OAAO,CAAC,cAAc,EAAE,SAAS,EAAE,CAAC,IAAI,YAClE,OAAO,GACO,CAClB,CAAC,CAAC,CAAC,CACF,OAAO,CACR,IACa,GACQ,CAC3B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, Fragment, useState, useContext, useEffect, useMemo } from 'react';\nimport type { FC, ReactNode, Ref } from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n AdditionalInfo,\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useTheme,\n ExpandCollapse,\n Button,\n Flex,\n Icon,\n useChToPxConversionFactor,\n useI18n,\n HTML,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type {\n AdditionalInfoProps,\n ForwardProps,\n HeadingTag,\n TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport { getDetailsTestIds } from './Details.test-ids';\nimport DetailsContext from './DetailsContext';\nimport {\n StyledFieldValueGroupLabel,\n StyledDetails,\n StyledHighlightedDetailList,\n StyledDetailDescription,\n StyledDetailColumns,\n columnGapMultiplier,\n StyledDetailColumn\n} from './Details.styles';\n\ntype ColumnCount = 1 | 2 | 3;\n\nexport type DetailsProps = TestIdProp & {\n /**\n * FieldValueItems to display as highlighted data above children\n */\n highlightedData?: ReactNode[];\n /** Copy placed in paragraph below the name */\n description?: string;\n /**\n * Template children separated into 1-3 columns {a, b, c}\n */\n columns:\n | {\n a: ReactNode;\n b?: never;\n c?: never;\n }\n | {\n a: ReactNode;\n b: ReactNode;\n c?: never;\n }\n | {\n a: ReactNode;\n b: ReactNode;\n c: ReactNode;\n };\n /** Arrangement of columns */\n arrangement?: 'narrowWide' | 'wideNarrow';\n /** Style variant applied to element */\n variant?: 'field-group';\n ref?: Ref<HTMLDivElement>;\n} & (\n | {\n /** Text used as heading of list */\n name: string;\n /** Pass a heading and content to show additional information on the list */\n additionalInfo?: {\n heading?: AdditionalInfoProps['heading'];\n content: AdditionalInfoProps['children'];\n };\n /**\n * Whether the items children can be collapsed (only applies if name is provided)\n * @default false\n */\n collapsible?: boolean;\n }\n | {\n name?: undefined;\n additionalInfo?: never;\n collapsible?: never;\n }\n );\n\nconst Details: FC<DetailsProps & ForwardProps> = forwardRef(function Details(\n {\n testId,\n highlightedData,\n columns,\n name,\n description,\n arrangement,\n variant,\n collapsible = false,\n additionalInfo: additionalInfoProp\n },\n ref\n) {\n const testIds = useTestIds(testId, getDetailsTestIds);\n const t = useI18n();\n const { longestLabelLength, depth, ...context } = useContext(DetailsContext);\n\n const containerRef = useConsolidatedRef(ref);\n const [open, setOpen] = useState(true);\n\n // Observer and state for mobile.\n const columnCount = (() => {\n let count: ColumnCount = 1;\n\n if (columns.b) count = 2;\n if (columns.c) count = 3;\n\n return count;\n })();\n const {\n base: {\n 'content-width': { sm: smContentWidth }\n }\n } = useTheme();\n const chToPxConversionFactor = useChToPxConversionFactor();\n\n const fitsThreeColumns = useBreakpoint('xl', {\n breakpointRef: containerRef,\n themeProp: 'content-width'\n });\n const fitsTwoColumns = useBreakpoint('md', {\n breakpointRef: containerRef,\n themeProp: 'content-width'\n });\n const [contentMobileView, setContentMobileView] = useState(false);\n\n useEffect(() => {\n const checkBreakpoint = (elementWidth: number) => {\n const minWidthPx = parseInt(smContentWidth, 10) * chToPxConversionFactor;\n const oneRemInPx = parseInt(remToPx(1), 10);\n const colGapPxAllowance = oneRemInPx * (0.5 * columnGapMultiplier) * (columnCount - 1);\n const mobileViewBreakpoint = minWidthPx * columnCount + colGapPxAllowance;\n\n setContentMobileView(elementWidth < mobileViewBreakpoint);\n };\n const resizeObserver = new ResizeObserver(entries => {\n const containerPxWidth = entries[0].contentRect.width;\n checkBreakpoint(containerPxWidth);\n });\n\n if (containerRef.current) {\n checkBreakpoint(containerRef.current.offsetWidth);\n resizeObserver.observe(containerRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [columnCount]);\n\n // Context\n const headingDepth = depth ?? 1;\n const asFieldGroup = variant === 'field-group' && !!name && !description && !highlightedData;\n\n const contextValue = useMemo(() => {\n return {\n ...context,\n mobileView: contentMobileView,\n depth: name ? headingDepth + 1 : headingDepth,\n inFieldGroup: context.inFieldGroup ? true : asFieldGroup,\n longestLabelLength\n };\n }, [name, headingDepth, longestLabelLength, contentMobileView, asFieldGroup, context]);\n\n // Memoized Elements\n const applyVariant = asFieldGroup ? 'field-group' : undefined;\n\n const nameText = useMemo(() => {\n return <Text variant={`h${Math.min(headingDepth, 6)}` as HeadingTag}>{name}</Text>;\n }, [name, headingDepth]);\n\n const additionalInfo = useMemo(() => {\n return name && additionalInfoProp ? (\n <AdditionalInfo heading={additionalInfoProp.heading} contextualLabel={name}>\n {additionalInfoProp.content}\n </AdditionalInfo>\n ) : undefined;\n }, [name, additionalInfoProp?.heading, additionalInfoProp?.content]);\n\n const content = useMemo(() => {\n let applyColumnCount = columnCount;\n\n if (columnCount !== 1) {\n if (fitsThreeColumns) {\n applyColumnCount = 3;\n } else if (fitsTwoColumns) {\n applyColumnCount = 2;\n } else {\n applyColumnCount = 1;\n }\n }\n\n return (\n <>\n {description && (\n <StyledDetailDescription data-testid={testIds.description}>\n <HTML as='p' content={description} />\n </StyledDetailDescription>\n )}\n\n {highlightedData && (\n <>\n <Flex\n data-testid={testIds.highlightedData}\n as={StyledHighlightedDetailList}\n container={{ wrap: 'wrap', colGap: 10, rowGap: 1, alignItems: 'start' }}\n >\n {highlightedData.map((child, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={i}>{child}</Fragment>\n ))}\n </Flex>\n\n <hr />\n </>\n )}\n\n <Flex\n as={StyledDetailColumns}\n container={{\n direction: 'row',\n colGap: columnGapMultiplier\n }}\n data-testid={testIds.data}\n arrangement={arrangement}\n variant={applyVariant}\n columnCount={applyColumnCount}\n >\n <StyledDetailColumn>{columns.a}</StyledDetailColumn>\n {columns.b && <StyledDetailColumn>{columns.b}</StyledDetailColumn>}\n {columns.c && <StyledDetailColumn>{columns.c}</StyledDetailColumn>}\n </Flex>\n </>\n );\n }, [\n highlightedData,\n columnCount,\n columns.a,\n columns.b,\n columns.c,\n arrangement,\n testIds,\n fitsTwoColumns,\n fitsThreeColumns,\n description\n ]);\n\n return (\n <DetailsContext.Provider value={contextValue}>\n <StyledDetails data-testid={testIds.root} ref={containerRef} variant={applyVariant}>\n {name && (\n <StyledFieldValueGroupLabel data-testid={testIds.heading}>\n <Flex container={{ alignItems: 'center', gap: 0.5 }}>\n {collapsible ? (\n <>\n <Button\n type='button'\n variant='text'\n onClick={() => {\n setOpen(cur => !cur);\n }}\n aria-expanded={open ? 'true' : 'false'}\n aria-label={t(open ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as='span'>\n <Icon name='caret-right' />\n {nameText}\n </Flex>\n </Button>\n {additionalInfo}\n </>\n ) : (\n <>\n {nameText}\n {additionalInfo}\n </>\n )}\n </Flex>\n </StyledFieldValueGroupLabel>\n )}\n\n {collapsible ? (\n <ExpandCollapse data-testid={testIds.expandCollapse} collapsed={!open}>\n {content}\n </ExpandCollapse>\n ) : (\n content\n )}\n </StyledDetails>\n </DetailsContext.Provider>\n );\n});\n\nexport default withTestIds(Details, getDetailsTestIds);\n"]}
1
+ {"version":3,"file":"Details.js","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,cAAc,EACd,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,yBAAyB,EACzB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,2BAA2B,EAC3B,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAyD1B,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,OAAO,CACzC,EACE,MAAM,EACN,eAAe,EACf,OAAO,EACP,IAAI,EACJ,WAAW,EACX,WAAW,EACX,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,cAAc,EAAE,kBAAkB,EACJ,EAChC,GAAwB;IAExB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACtD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,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AAE,YAAY,aAC/E,IAAI,IAAI,CACP,KAAC,0BAA0B,mBAAc,OAAO,CAAC,OAAO,YACtD,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,YAChD,WAAW,CAAC,CAAC,CAAC,CACb,8BACE,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;wCACZ,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;oCACvB,CAAC,mBACc,IAAI,gBACP,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,YAE7D,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAC,MAAM,aAC5D,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,EAC1B,QAAQ,IACJ,GACA,EACR,cAAc,IACd,CACJ,CAAC,CAAC,CAAC,CACF,8BACG,QAAQ,EACR,cAAc,IACd,CACJ,GACI,GACoB,CAC9B,EAEA,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,cAAc,mBAAc,OAAO,CAAC,cAAc,EAAE,SAAS,EAAE,CAAC,IAAI,YAClE,OAAO,GACO,CAClB,CAAC,CAAC,CAAC,CACF,OAAO,CACR,IACa,GACQ,CAC3B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, Fragment, useState, useContext, useEffect, useMemo } from 'react';\nimport type { PropsWithoutRef, ReactNode, Ref } from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n AdditionalInfo,\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useTheme,\n ExpandCollapse,\n Button,\n Flex,\n Icon,\n useChToPxConversionFactor,\n useI18n,\n HTML,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type { AdditionalInfoProps, HeadingTag, TestIdProp } from '@pega/cosmos-react-core';\n\nimport { getDetailsTestIds } from './Details.test-ids';\nimport DetailsContext from './DetailsContext';\nimport {\n StyledFieldValueGroupLabel,\n StyledDetails,\n StyledHighlightedDetailList,\n StyledDetailDescription,\n StyledDetailColumns,\n columnGapMultiplier,\n StyledDetailColumn\n} from './Details.styles';\n\ntype ColumnCount = 1 | 2 | 3;\n\nexport type DetailsProps = TestIdProp & {\n /**\n * FieldValueItems to display as highlighted data above children\n */\n highlightedData?: ReactNode[];\n /** Copy placed in paragraph below the name */\n description?: string;\n /**\n * Template children separated into 1-3 columns {a, b, c}\n */\n columns:\n | {\n a: ReactNode;\n b?: never;\n c?: never;\n }\n | {\n a: ReactNode;\n b: ReactNode;\n c?: never;\n }\n | {\n a: ReactNode;\n b: ReactNode;\n c: ReactNode;\n };\n /** Arrangement of columns */\n arrangement?: 'narrowWide' | 'wideNarrow';\n /** Style variant applied to element */\n variant?: 'field-group';\n ref?: Ref<HTMLDivElement>;\n} & (\n | {\n /** Text used as heading of list */\n name: string;\n /** Pass a heading and content to show additional information on the list */\n additionalInfo?: {\n heading?: AdditionalInfoProps['heading'];\n content: AdditionalInfoProps['children'];\n };\n /**\n * Whether the items children can be collapsed (only applies if name is provided)\n * @default false\n */\n collapsible?: boolean;\n }\n | {\n name?: undefined;\n additionalInfo?: never;\n collapsible?: never;\n }\n );\n\nconst Details = forwardRef(function Details(\n {\n testId,\n highlightedData,\n columns,\n name,\n description,\n arrangement,\n variant,\n collapsible = false,\n additionalInfo: additionalInfoProp\n }: PropsWithoutRef<DetailsProps>,\n ref: DetailsProps['ref']\n) {\n const testIds = useTestIds(testId, getDetailsTestIds);\n const t = useI18n();\n const { longestLabelLength, depth, ...context } = useContext(DetailsContext);\n\n const containerRef = useConsolidatedRef(ref);\n const [open, setOpen] = useState(true);\n\n // Observer and state for mobile.\n const columnCount = (() => {\n let count: ColumnCount = 1;\n\n if (columns.b) count = 2;\n if (columns.c) count = 3;\n\n return count;\n })();\n const {\n base: {\n 'content-width': { sm: smContentWidth }\n }\n } = useTheme();\n const chToPxConversionFactor = useChToPxConversionFactor();\n\n const fitsThreeColumns = useBreakpoint('xl', {\n breakpointRef: containerRef,\n themeProp: 'content-width'\n });\n const fitsTwoColumns = useBreakpoint('md', {\n breakpointRef: containerRef,\n themeProp: 'content-width'\n });\n const [contentMobileView, setContentMobileView] = useState(false);\n\n useEffect(() => {\n const checkBreakpoint = (elementWidth: number) => {\n const minWidthPx = parseInt(smContentWidth, 10) * chToPxConversionFactor;\n const oneRemInPx = parseInt(remToPx(1), 10);\n const colGapPxAllowance = oneRemInPx * (0.5 * columnGapMultiplier) * (columnCount - 1);\n const mobileViewBreakpoint = minWidthPx * columnCount + colGapPxAllowance;\n\n setContentMobileView(elementWidth < mobileViewBreakpoint);\n };\n const resizeObserver = new ResizeObserver(entries => {\n const containerPxWidth = entries[0].contentRect.width;\n checkBreakpoint(containerPxWidth);\n });\n\n if (containerRef.current) {\n checkBreakpoint(containerRef.current.offsetWidth);\n resizeObserver.observe(containerRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [columnCount]);\n\n // Context\n const headingDepth = depth ?? 1;\n const asFieldGroup = variant === 'field-group' && !!name && !description && !highlightedData;\n\n const contextValue = useMemo(() => {\n return {\n ...context,\n mobileView: contentMobileView,\n depth: name ? headingDepth + 1 : headingDepth,\n inFieldGroup: context.inFieldGroup ? true : asFieldGroup,\n longestLabelLength\n };\n }, [name, headingDepth, longestLabelLength, contentMobileView, asFieldGroup, context]);\n\n // Memoized Elements\n const applyVariant = asFieldGroup ? 'field-group' : undefined;\n\n const nameText = useMemo(() => {\n return <Text variant={`h${Math.min(headingDepth, 6)}` as HeadingTag}>{name}</Text>;\n }, [name, headingDepth]);\n\n const additionalInfo = useMemo(() => {\n return name && additionalInfoProp ? (\n <AdditionalInfo heading={additionalInfoProp.heading} contextualLabel={name}>\n {additionalInfoProp.content}\n </AdditionalInfo>\n ) : undefined;\n }, [name, additionalInfoProp?.heading, additionalInfoProp?.content]);\n\n const content = useMemo(() => {\n let applyColumnCount = columnCount;\n\n if (columnCount !== 1) {\n if (columnCount === 3 && fitsThreeColumns) {\n applyColumnCount = 3;\n } else if (fitsTwoColumns) {\n applyColumnCount = 2;\n } else {\n applyColumnCount = 1;\n }\n }\n\n return (\n <>\n {description && (\n <StyledDetailDescription data-testid={testIds.description}>\n <HTML as='p' content={description} />\n </StyledDetailDescription>\n )}\n\n {highlightedData && (\n <>\n <Flex\n data-testid={testIds.highlightedData}\n as={StyledHighlightedDetailList}\n container={{ wrap: 'wrap', colGap: 10, rowGap: 1, alignItems: 'start' }}\n >\n {highlightedData.map((child, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={i}>{child}</Fragment>\n ))}\n </Flex>\n\n <hr />\n </>\n )}\n\n <Flex\n as={StyledDetailColumns}\n container={{\n direction: 'row',\n colGap: columnGapMultiplier\n }}\n data-testid={testIds.data}\n arrangement={arrangement}\n variant={applyVariant}\n columnCount={applyColumnCount}\n >\n <StyledDetailColumn>{columns.a}</StyledDetailColumn>\n {columns.b && <StyledDetailColumn>{columns.b}</StyledDetailColumn>}\n {columns.c && <StyledDetailColumn>{columns.c}</StyledDetailColumn>}\n </Flex>\n </>\n );\n }, [\n highlightedData,\n columnCount,\n columns.a,\n columns.b,\n columns.c,\n arrangement,\n testIds,\n fitsTwoColumns,\n fitsThreeColumns,\n description\n ]);\n\n return (\n <DetailsContext.Provider value={contextValue}>\n <StyledDetails data-testid={testIds.root} ref={containerRef} variant={applyVariant}>\n {name && (\n <StyledFieldValueGroupLabel data-testid={testIds.heading}>\n <Flex container={{ alignItems: 'center', gap: 0.5 }}>\n {collapsible ? (\n <>\n <Button\n type='button'\n variant='text'\n onClick={() => {\n setOpen(cur => !cur);\n }}\n aria-expanded={open}\n aria-label={t(open ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as='span'>\n <Icon name='caret-right' />\n {nameText}\n </Flex>\n </Button>\n {additionalInfo}\n </>\n ) : (\n <>\n {nameText}\n {additionalInfo}\n </>\n )}\n </Flex>\n </StyledFieldValueGroupLabel>\n )}\n\n {collapsible ? (\n <ExpandCollapse data-testid={testIds.expandCollapse} collapsed={!open}>\n {content}\n </ExpandCollapse>\n ) : (\n content\n )}\n </StyledDetails>\n </DetailsContext.Provider>\n );\n});\n\nexport default withTestIds(Details, getDetailsTestIds);\n"]}
@@ -39,7 +39,7 @@ export declare const StyledHighlightedDetailList: import("styled-components").St
39
39
  export declare const StyledInlineFieldValueItem: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
40
40
  export declare const StyledDetailsList: import("styled-components").StyledComponent<"dl", DefaultTheme, StyledFieldValueListProps & Pick<StyledDetailsListProps, keyof StyledDetailsListProps> & Required<Pick<StyledDetailsListProps, never>>, never>;
41
41
  export declare const StyledDetails: import("styled-components").StyledComponent<"div", DefaultTheme, {
42
- variant?: DetailsProps['variant'];
42
+ variant?: DetailsProps["variant"];
43
43
  }, never>;
44
44
  export declare const StyledDetailColumns: import("styled-components").StyledComponent<"div", DefaultTheme, StyledDetailColumnsProps, never>;
45
45
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Details.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAatD,OAAO,KAAK,EACV,yBAAyB,EAG1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,UAAU,sBAAuB,SAAQ,yBAAyB;IAChE,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,WAAW,CAAC,EAAE,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ACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,UAAU,wBAAwB;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,KAAK,EAAE,YAAY,CAAC;CACrB;AAKD,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,2BAA2B,UAAU,CAAC;AACnD,eAAO,MAAM,6BAA6B,SAAS,CAAC;AAEpD,eAAO,MAAM,0BAA0B,6EAkCrC,CAAC;AAIH,eAAO,MAAM,uBAAuB,6EAYlC,CAAC;AAIH,eAAO,MAAM,kBAAkB,6EAW7B,CAAC;AAIH,eAAO,MAAM,2BAA2B,4EAuBtC,CAAC;AAIH,eAAO,MAAM,0BAA0B,6EAItC,CAAC;AAEF,eAAO,MAAM,iBAAiB,gNAkH5B,CAAC;AAgBH,eAAO,MAAM,aAAa;cAA0B,YAAY,CAAC,SAAS,CAAC;SAmB1E,CAAC;AAIF,eAAO,MAAM,mBAAmB,mGAkG/B,CAAC"}
@@ -7,12 +7,18 @@ export const columnGapMultiplier = 5.5;
7
7
  export const oneColumnDetailsColumnWidth = '100ch';
8
8
  export const multiColumnDetailsColumnWidth = '80ch';
9
9
  export const StyledFieldValueGroupLabel = styled.div(({ theme }) => {
10
- const { base: { spacing, animation } } = theme;
10
+ const { base: { spacing, animation, palette } } = theme;
11
11
  const { rtl } = useDirection();
12
+ const { components: { 'field-value-list': { inline: { detached } } } } = theme;
12
13
  return css `
13
14
  width: 100%;
14
15
  grid-column: 1 / -1;
15
16
  margin-block-end: calc(${rowGapMultiplier} * ${spacing});
17
+ ${detached &&
18
+ css `
19
+ border-bottom: 0.0625rem solid ${palette['border-line']};
20
+ padding-bottom: calc(0.5 * ${spacing});
21
+ `}
16
22
 
17
23
  ${StyledButtonLink} ${StyledIcon} {
18
24
  transition: transform ${animation.speed} ${animation.timing.ease};
@@ -74,7 +80,7 @@ export const StyledInlineFieldValueItem = styled.div `
74
80
  }
75
81
  `;
76
82
  export const StyledDetailsList = styled(StyledFieldValueList)(({ stacked, labelLength, variant, theme, narrow = false }) => {
77
- const { base: { spacing }, components: { details: { 'field-label': fieldLabelPosition } } } = theme;
83
+ const { base: { spacing, palette }, components: { details: { 'field-label': fieldLabelPosition }, 'field-value-list': { inline: { detached } } } } = theme;
78
84
  const { inFieldGroup } = useContext(DetailsContext);
79
85
  const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';
80
86
  const isValueComparison = variant === 'value-comparison';
@@ -83,7 +89,7 @@ export const StyledDetailsList = styled(StyledFieldValueList)(({ stacked, labelL
83
89
  /* Field Grid Styles */
84
90
  display: flex;
85
91
  flex-direction: column;
86
- row-gap: calc(${rowGapMultiplier} * ${spacing});
92
+ row-gap: ${detached ? 0 : `calc(${rowGapMultiplier} * ${spacing})`};
87
93
  width: 100%;
88
94
  max-width: ${oneColumnDetailsColumnWidth};
89
95
  height: fit-content;
@@ -101,13 +107,20 @@ export const StyledDetailsList = styled(StyledFieldValueList)(({ stacked, labelL
101
107
  grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);
102
108
  grid-template-rows: max-content;
103
109
  column-gap: calc(${fieldValueGapMultiplier} * ${spacing});
110
+ ${detached &&
111
+ css `
112
+ padding-block: calc(0.5 * ${spacing});
113
+ &:not(:last-child) {
114
+ border-bottom: 0.0625rem dashed ${palette['border-line']};
115
+ }
116
+ `}
104
117
 
105
118
  ${inFieldGroup &&
106
119
  css `
107
120
  grid-template-columns:
108
121
  minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))
109
122
  minmax(14ch, 1fr);
110
- `}
123
+ `};
111
124
  }
112
125
 
113
126
  /* Stacked Label Styles */
@@ -1 +1 @@
1
- {"version":3,"file":"Details.styles.js","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAQjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAkC9C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjE,MAAM,EACJ,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAC7B,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAE/B,OAAO,GAAG,CAAA;;;6BAGiB,gBAAgB,MAAM,OAAO;;MAEpD,gBAAgB,IAAI,UAAU;8BACN,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI;;;MAGhE,gBAAgB,0BAA0B,UAAU;;;;MAIpD,gBAAgB,2BAA2B,UAAU;0BACjC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;GAEpC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3D,MAAM,CAAC,MAAM,uBA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;;QAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;;wBAEe,gBAAgB,MAAM,OAAO;;UAE3C,OAAO,KAAK,aAAa;YAC3B,GAAG,CAAA;;kCAEuB,OAAO;;;;;6BAKZ,OAAO;;;qBAGf,WAAW;0BACN,WAAW;;SAE5B;OACF;;;UAGG,kBAAkB;;;UAGlB,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;mBACQ,6BAA6B;sCACV,mBAAmB,MAAM,OAAO;SAC7D;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;+BACoB,mBAAmB,MAAM,OAAO;;;6BAGlC,aAAa;cAC5B,UAAU,CAAC,OAAO,CAAC;;SAExB;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;YACC,WAAW,KAAK,YAAY;YAC9B,GAAG,CAAA;;;kBAGK,6BAA6B,UAAU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;;YAEC,WAAW,KAAK,YAAY;YAC9B,GAAG,CAAA;;;kBAGK,6BAA6B,UAAU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;SACF;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;;;;kCAIuB,aAAa;cACjC,UAAU,CAAC,OAAO,CAAC;;SAExB;;KAEJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { useContext } from 'react';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledIcon,\n useDirection,\n StyledButtonLink\n} from '@pega/cosmos-react-core';\nimport type {\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\nimport type { DetailsProps } from './Details';\nimport DetailsContext from './DetailsContext';\n\ninterface StyledDetailsListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n /**\n * Whether to apply narrow list styles\n * @default false\n */\n narrow?: boolean;\n theme: DefaultTheme;\n}\n\ninterface StyledDetailColumnsProps {\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /**\n * Arrangement of columns\n */\n arrangement?: DetailsProps['arrangement'];\n /**\n * Style variations\n */\n variant?: DetailsProps['variant'];\n theme: DefaultTheme;\n}\n\ntype StyledDetailsListPropsWithDefaults = PropsWithDefaults<StyledDetailsListProps>;\n\nconst rowGapMultiplier = 1;\nexport const columnGapMultiplier = 5.5;\nexport const oneColumnDetailsColumnWidth = '100ch';\nexport const multiColumnDetailsColumnWidth = '80ch';\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation }\n } = theme;\n const { rtl } = useDirection();\n\n return css`\n width: 100%;\n grid-column: 1 / -1;\n margin-block-end: calc(${rowGapMultiplier} * ${spacing});\n\n ${StyledButtonLink} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButtonLink}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButtonLink}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumn = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n `;\n});\n\nStyledDetailColumn.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n max-width: calc(${multiColumnDetailsColumnWidth} * 3 + ${columnGapMultiplier} * ${spacing} * 2);\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledInlineFieldValueItem = styled.div`\n > * {\n min-width: 0;\n }\n`;\n\nexport const StyledDetailsList = styled(StyledFieldValueList)<StyledDetailsListPropsWithDefaults>(({\n stacked,\n labelLength,\n variant,\n theme,\n narrow = false\n}) => {\n const {\n base: { spacing },\n components: {\n details: { 'field-label': fieldLabelPosition }\n }\n } = theme;\n\n const { inFieldGroup } = useContext(DetailsContext);\n const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';\n const isValueComparison = variant === 'value-comparison';\n const fieldValueGapMultiplier = 2;\n\n return css`\n /* Field Grid Styles */\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n max-width: ${oneColumnDetailsColumnWidth};\n height: fit-content;\n\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n }\n\n ${StyledInlineFieldValueItem}, ${StyledStackedFieldValue} {\n width: 100%;\n }\n\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);\n grid-template-rows: max-content;\n column-gap: calc(${fieldValueGapMultiplier} * ${spacing});\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))\n minmax(14ch, 1fr);\n `}\n }\n\n /* Stacked Label Styles */\n ${labelTop &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n\n dt {\n max-width: 100%;\n }\n\n ${!isValueComparison &&\n css`\n ${StyledStackedFieldValue}:not(:first-child) {\n margin-block-start: calc(${rowGapMultiplier} * ${spacing});\n }\n `}\n `}\n\n /* Value Comparison Styles */\n ${isValueComparison &&\n css`\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n\n > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n /* Responsive behavior */\n ${narrow &&\n !labelTop &&\n !isValueComparison &&\n css`\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(0, ${labelLength}ch) minmax(50%, 1fr);\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(0, calc(${labelLength}ch - ${spacing}))\n minmax(calc(50% + 0.5 * ${spacing}), 1fr);\n `}\n }\n\n dd {\n min-width: 50%;\n }\n `}\n `;\n});\n\nStyledDetailsList.defaultProps = defaultThemeProp;\n\nconst spacingTop = (spacing: string) => {\n return css`\n > ${StyledFieldValueGroupLabel} {\n margin-block-start: calc((1.5 * ${rowGapMultiplier}) * ${spacing});\n }\n\n > ${StyledDetailDescription}:first-child {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `;\n};\n\nexport const StyledDetails = styled.div<{ variant?: DetailsProps['variant'] }>(\n ({ variant, theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n &:not(:first-child) {\n ${spacingTop(spacing)}\n }\n\n ${variant === 'field-group' &&\n css`\n + ${StyledDetailsList} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `}\n `;\n }\n);\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumns = styled.div<StyledDetailColumnsProps>(\n ({ theme, arrangement, variant, columnCount = 1 }) => {\n const {\n base: {\n palette: { 'border-line': borderColor },\n spacing\n },\n components: {\n 'form-control': { 'border-width': borderWidth }\n }\n } = theme;\n\n return css`\n width: 100%;\n\n ${columnCount === 2 &&\n !arrangement &&\n css`\n flex-wrap: wrap;\n `}\n\n ${columnCount === 1 &&\n css`\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n\n ${variant === 'field-group' &&\n css`\n position: relative;\n padding-inline-start: ${spacing};\n\n &::before {\n content: '';\n position: absolute;\n top: calc(-1 * ${spacing});\n bottom: 0;\n left: 0;\n width: ${borderWidth};\n background: ${borderColor};\n }\n `}\n `};\n\n /* Column Widths */\n > ${StyledDetailColumn} {\n overflow: hidden;\n\n ${columnCount === 3 &&\n css`\n width: ${multiColumnDetailsColumnWidth};\n max-width: calc(33.33% - (${columnGapMultiplier} * ${spacing} * 2) / 3);\n `}\n\n ${columnCount === 2 &&\n css`\n width: calc(50% - (${columnGapMultiplier} * ${spacing}) / 2);\n max-width: unset;\n\n &:nth-child(3) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n\n ${columnCount !== 1 &&\n css`\n ${arrangement === 'narrowWide' &&\n css`\n &:nth-child(2) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n\n ${arrangement === 'wideNarrow' &&\n css`\n &:nth-child(1) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n `}\n\n ${columnCount === 1 &&\n css`\n width: 100%;\n max-width: 100%;\n\n &:not(:first-child) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n }\n `;\n }\n);\n\nStyledDetailColumns.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Details.sty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C,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { useContext } from 'react';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledIcon,\n useDirection,\n StyledButtonLink\n} from '@pega/cosmos-react-core';\nimport type {\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\nimport type { DetailsProps } from './Details';\nimport DetailsContext from './DetailsContext';\n\ninterface StyledDetailsListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n /**\n * Whether to apply narrow list styles\n * @default false\n */\n narrow?: boolean;\n theme: DefaultTheme;\n}\n\ninterface StyledDetailColumnsProps {\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /**\n * Arrangement of columns\n */\n arrangement?: DetailsProps['arrangement'];\n /**\n * Style variations\n */\n variant?: DetailsProps['variant'];\n theme: DefaultTheme;\n}\n\ntype StyledDetailsListPropsWithDefaults = PropsWithDefaults<StyledDetailsListProps>;\n\nconst rowGapMultiplier = 1;\nexport const columnGapMultiplier = 5.5;\nexport const oneColumnDetailsColumnWidth = '100ch';\nexport const multiColumnDetailsColumnWidth = '80ch';\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation, palette }\n } = theme;\n const { rtl } = useDirection();\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n return css`\n width: 100%;\n grid-column: 1 / -1;\n margin-block-end: calc(${rowGapMultiplier} * ${spacing});\n ${detached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n padding-bottom: calc(0.5 * ${spacing});\n `}\n\n ${StyledButtonLink} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButtonLink}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButtonLink}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumn = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n `;\n});\n\nStyledDetailColumn.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n max-width: calc(${multiColumnDetailsColumnWidth} * 3 + ${columnGapMultiplier} * ${spacing} * 2);\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledInlineFieldValueItem = styled.div`\n > * {\n min-width: 0;\n }\n`;\n\nexport const StyledDetailsList = styled(StyledFieldValueList)<StyledDetailsListPropsWithDefaults>(({\n stacked,\n labelLength,\n variant,\n theme,\n narrow = false\n}) => {\n const {\n base: { spacing, palette },\n components: {\n details: { 'field-label': fieldLabelPosition },\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n\n const { inFieldGroup } = useContext(DetailsContext);\n const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';\n const isValueComparison = variant === 'value-comparison';\n const fieldValueGapMultiplier = 2;\n\n return css`\n /* Field Grid Styles */\n display: flex;\n flex-direction: column;\n row-gap: ${detached ? 0 : `calc(${rowGapMultiplier} * ${spacing})`};\n width: 100%;\n max-width: ${oneColumnDetailsColumnWidth};\n height: fit-content;\n\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n }\n\n ${StyledInlineFieldValueItem}, ${StyledStackedFieldValue} {\n width: 100%;\n }\n\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);\n grid-template-rows: max-content;\n column-gap: calc(${fieldValueGapMultiplier} * ${spacing});\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem dashed ${palette['border-line']};\n }\n `}\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))\n minmax(14ch, 1fr);\n `};\n }\n\n /* Stacked Label Styles */\n ${labelTop &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n\n dt {\n max-width: 100%;\n }\n\n ${!isValueComparison &&\n css`\n ${StyledStackedFieldValue}:not(:first-child) {\n margin-block-start: calc(${rowGapMultiplier} * ${spacing});\n }\n `}\n `}\n\n /* Value Comparison Styles */\n ${isValueComparison &&\n css`\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n\n > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n /* Responsive behavior */\n ${narrow &&\n !labelTop &&\n !isValueComparison &&\n css`\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(0, ${labelLength}ch) minmax(50%, 1fr);\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(0, calc(${labelLength}ch - ${spacing}))\n minmax(calc(50% + 0.5 * ${spacing}), 1fr);\n `}\n }\n\n dd {\n min-width: 50%;\n }\n `}\n `;\n});\n\nStyledDetailsList.defaultProps = defaultThemeProp;\n\nconst spacingTop = (spacing: string) => {\n return css`\n > ${StyledFieldValueGroupLabel} {\n margin-block-start: calc((1.5 * ${rowGapMultiplier}) * ${spacing});\n }\n\n > ${StyledDetailDescription}:first-child {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `;\n};\n\nexport const StyledDetails = styled.div<{ variant?: DetailsProps['variant'] }>(\n ({ variant, theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n &:not(:first-child) {\n ${spacingTop(spacing)}\n }\n\n ${variant === 'field-group' &&\n css`\n + ${StyledDetailsList} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `}\n `;\n }\n);\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumns = styled.div<StyledDetailColumnsProps>(\n ({ theme, arrangement, variant, columnCount = 1 }) => {\n const {\n base: {\n palette: { 'border-line': borderColor },\n spacing\n },\n components: {\n 'form-control': { 'border-width': borderWidth }\n }\n } = theme;\n\n return css`\n width: 100%;\n\n ${columnCount === 2 &&\n !arrangement &&\n css`\n flex-wrap: wrap;\n `}\n\n ${columnCount === 1 &&\n css`\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n\n ${variant === 'field-group' &&\n css`\n position: relative;\n padding-inline-start: ${spacing};\n\n &::before {\n content: '';\n position: absolute;\n top: calc(-1 * ${spacing});\n bottom: 0;\n left: 0;\n width: ${borderWidth};\n background: ${borderColor};\n }\n `}\n `};\n\n /* Column Widths */\n > ${StyledDetailColumn} {\n overflow: hidden;\n\n ${columnCount === 3 &&\n css`\n width: ${multiColumnDetailsColumnWidth};\n max-width: calc(33.33% - (${columnGapMultiplier} * ${spacing} * 2) / 3);\n `}\n\n ${columnCount === 2 &&\n css`\n width: calc(50% - (${columnGapMultiplier} * ${spacing}) / 2);\n max-width: unset;\n\n &:nth-child(3) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n\n ${columnCount !== 1 &&\n css`\n ${arrangement === 'narrowWide' &&\n css`\n &:nth-child(2) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n\n ${arrangement === 'wideNarrow' &&\n css`\n &:nth-child(1) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n `}\n\n ${columnCount === 1 &&\n css`\n width: 100%;\n max-width: 100%;\n\n &:not(:first-child) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n }\n `;\n }\n);\n\nStyledDetailColumns.defaultProps = defaultThemeProp;\n"]}
@@ -1,2 +1,2 @@
1
- export declare const getDetailsTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "highlighted-data", "data", "expand-collapse"]>;
1
+ export declare const getDetailsTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "highlighted-data", "data", "expand-collapse"]>;
2
2
  //# sourceMappingURL=Details.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Details.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,iLAMnB,CAAC"}
1
+ {"version":3,"file":"Details.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,8MAMnB,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface DetailsContextValue {
3
2
  longestLabelLength?: number;
4
3
  setLongestLabelLength?: (val: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsContext.d.ts","sourceRoot":"","sources":["../../../src/components/Details/DetailsContext.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,8CAMlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DetailsContext.d.ts","sourceRoot":"","sources":["../../../src/components/Details/DetailsContext.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,8CAMlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { FunctionComponent } from 'react';
2
2
  import { type GenAICoachProps } from '.';
3
3
  declare const _default: FunctionComponent<GenAICoachProps> & {
4
- getTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
4
+ getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["user-message", "coach-message"]>;
5
5
  };
6
6
  export default _default;
7
7
  //# sourceMappingURL=GenAICoach.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAuD5D,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;;;;AA8nBhF,wBAA6D"}
1
+ {"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAkD5D,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;;;;AAulBhF,wBAA6D"}