@pega/cosmos-react-work 4.0.0-dev.9.1 → 4.0.0-rc.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 (251) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +7 -21
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +3 -2
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/AppAnnouncement/index.d.ts +1 -1
  6. package/lib/components/AppAnnouncement/index.d.ts.map +1 -1
  7. package/lib/components/AppAnnouncement/index.js.map +1 -1
  8. package/lib/components/Article/Article.d.ts +49 -0
  9. package/lib/components/Article/Article.d.ts.map +1 -0
  10. package/lib/components/Article/Article.js +73 -0
  11. package/lib/components/Article/Article.js.map +1 -0
  12. package/lib/components/Article/ArticleFooter.d.ts +40 -0
  13. package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
  14. package/lib/components/Article/ArticleFooter.js +54 -0
  15. package/lib/components/Article/ArticleFooter.js.map +1 -0
  16. package/lib/components/Article/ArticleMeta.d.ts +13 -0
  17. package/lib/components/Article/ArticleMeta.d.ts.map +1 -0
  18. package/lib/components/Article/ArticleMeta.js +24 -0
  19. package/lib/components/Article/ArticleMeta.js.map +1 -0
  20. package/lib/components/Article/index.d.ts +5 -0
  21. package/lib/components/Article/index.d.ts.map +1 -0
  22. package/lib/components/Article/index.js +3 -0
  23. package/lib/components/Article/index.js.map +1 -0
  24. package/lib/components/ArticleList/ArticleList.d.ts +6 -0
  25. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
  26. package/lib/components/ArticleList/ArticleList.js +137 -0
  27. package/lib/components/ArticleList/ArticleList.js.map +1 -0
  28. package/lib/components/ArticleList/ArticleList.types.d.ts +87 -0
  29. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
  30. package/lib/components/ArticleList/ArticleList.types.js +2 -0
  31. package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
  32. package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
  33. package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
  34. package/lib/components/ArticleList/ArticleListFilter.js +61 -0
  35. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
  36. package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
  37. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
  38. package/lib/components/ArticleList/ArticleListHeader.js +20 -0
  39. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
  40. package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
  41. package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
  42. package/lib/components/ArticleList/ArticleSummary.js +56 -0
  43. package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
  44. package/lib/components/ArticleList/index.d.ts +6 -0
  45. package/lib/components/ArticleList/index.d.ts.map +1 -0
  46. package/lib/components/ArticleList/index.js +4 -0
  47. package/lib/components/ArticleList/index.js.map +1 -0
  48. package/lib/components/Assignments/Assignments.d.ts +21 -0
  49. package/lib/components/Assignments/Assignments.d.ts.map +1 -0
  50. package/lib/components/Assignments/Assignments.js +20 -0
  51. package/lib/components/Assignments/Assignments.js.map +1 -0
  52. package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
  53. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
  54. package/lib/components/Assignments/Assignments.styles.js +41 -0
  55. package/lib/components/Assignments/Assignments.styles.js.map +1 -0
  56. package/lib/components/Assignments/index.d.ts +2 -0
  57. package/lib/components/Assignments/index.d.ts.map +1 -0
  58. package/lib/components/Assignments/index.js +2 -0
  59. package/lib/components/Assignments/index.js.map +1 -0
  60. package/lib/components/CasePreview/CasePreview.d.ts +9 -4
  61. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  62. package/lib/components/CasePreview/CasePreview.js +7 -10
  63. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  64. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  65. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  66. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  67. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  68. package/lib/components/CasePreview/index.d.ts +1 -1
  69. package/lib/components/CasePreview/index.d.ts.map +1 -1
  70. package/lib/components/CasePreview/index.js.map +1 -1
  71. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
  72. package/lib/components/CaseView/CaseHeader/CaseHeader.js +119 -0
  73. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
  74. package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
  75. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
  76. package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
  77. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
  78. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -1
  79. package/lib/components/CaseView/CaseSummary.js +9 -4
  80. package/lib/components/CaseView/CaseSummary.js.map +1 -1
  81. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -1
  82. package/lib/components/CaseView/CaseSummaryFields.js +12 -3
  83. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
  84. package/lib/components/CaseView/CaseView.d.ts +4 -2
  85. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  86. package/lib/components/CaseView/CaseView.js +174 -67
  87. package/lib/components/CaseView/CaseView.js.map +1 -1
  88. package/lib/components/CaseView/CaseView.styles.d.ts +45 -22
  89. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  90. package/lib/components/CaseView/CaseView.styles.js +298 -79
  91. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  92. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  93. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  94. package/lib/components/CaseView/CaseView.test-ids.js +17 -0
  95. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  96. package/lib/components/CaseView/CaseView.types.d.ts +23 -24
  97. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  98. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  99. package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -1
  100. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  101. package/lib/components/CaseView/UtilitiesSummary.js +4 -8
  102. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  103. package/lib/components/CaseView/index.d.ts +1 -6
  104. package/lib/components/CaseView/index.d.ts.map +1 -1
  105. package/lib/components/CaseView/index.js +0 -4
  106. package/lib/components/CaseView/index.js.map +1 -1
  107. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  108. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +1 -1
  109. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  110. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +1 -3
  111. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  112. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -1
  113. package/lib/components/ConfigurableLayout/index.d.ts +1 -1
  114. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -1
  115. package/lib/components/ConfigurableLayout/index.js.map +1 -1
  116. package/lib/components/Confirmation/Confirmation.d.ts +1 -1
  117. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  118. package/lib/components/Confirmation/Confirmation.js +20 -5
  119. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  120. package/lib/components/Confirmation/index.d.ts +1 -1
  121. package/lib/components/Confirmation/index.d.ts.map +1 -1
  122. package/lib/components/Confirmation/index.js.map +1 -1
  123. package/lib/components/Details/Details.d.ts +8 -4
  124. package/lib/components/Details/Details.d.ts.map +1 -1
  125. package/lib/components/Details/Details.js +33 -21
  126. package/lib/components/Details/Details.js.map +1 -1
  127. package/lib/components/Details/Details.styles.d.ts +7 -4
  128. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  129. package/lib/components/Details/Details.styles.js +46 -101
  130. package/lib/components/Details/Details.styles.js.map +1 -1
  131. package/lib/components/Details/Details.test-ids.d.ts +2 -0
  132. package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
  133. package/lib/components/Details/Details.test-ids.js +9 -0
  134. package/lib/components/Details/Details.test-ids.js.map +1 -0
  135. package/lib/components/Glimpse/Glimpse.d.ts +10 -10
  136. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  137. package/lib/components/Glimpse/Glimpse.js +7 -17
  138. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  139. package/lib/components/Glimpse/index.d.ts +1 -1
  140. package/lib/components/Glimpse/index.d.ts.map +1 -1
  141. package/lib/components/Glimpse/index.js +0 -1
  142. package/lib/components/Glimpse/index.js.map +1 -1
  143. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  144. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +38 -27
  145. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  146. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +3 -2
  147. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  148. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +137 -81
  149. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  150. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +9 -9
  151. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -1
  152. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -1
  153. package/lib/components/IntelligentGuidance/index.d.ts +1 -1
  154. package/lib/components/IntelligentGuidance/index.d.ts.map +1 -1
  155. package/lib/components/IntelligentGuidance/index.js.map +1 -1
  156. package/lib/components/Predictions/Predictions.d.ts +6 -0
  157. package/lib/components/Predictions/Predictions.d.ts.map +1 -0
  158. package/lib/components/Predictions/Predictions.js +68 -0
  159. package/lib/components/Predictions/Predictions.js.map +1 -0
  160. package/lib/components/Predictions/Predictions.types.d.ts +23 -0
  161. package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
  162. package/lib/components/Predictions/Predictions.types.js +2 -0
  163. package/lib/components/Predictions/Predictions.types.js.map +1 -0
  164. package/lib/components/Predictions/index.d.ts +3 -0
  165. package/lib/components/Predictions/index.d.ts.map +1 -0
  166. package/lib/components/Predictions/index.js +2 -0
  167. package/lib/components/Predictions/index.js.map +1 -0
  168. package/lib/components/SearchResults/SearchResults.js +1 -1
  169. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  170. package/lib/components/SearchResults/SearchResults.types.d.ts +5 -5
  171. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  172. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  173. package/lib/components/SearchResults/index.d.ts +1 -1
  174. package/lib/components/SearchResults/index.d.ts.map +1 -1
  175. package/lib/components/SearchResults/index.js.map +1 -1
  176. package/lib/components/Stages/Stages.d.ts.map +1 -1
  177. package/lib/components/Stages/Stages.js +8 -8
  178. package/lib/components/Stages/Stages.js.map +1 -1
  179. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  180. package/lib/components/Stages/Stages.styles.js +0 -2
  181. package/lib/components/Stages/Stages.styles.js.map +1 -1
  182. package/lib/components/Stages/index.d.ts +1 -1
  183. package/lib/components/Stages/index.d.ts.map +1 -1
  184. package/lib/components/Stages/index.js.map +1 -1
  185. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  186. package/lib/components/Stakeholders/Stakeholders.js +3 -3
  187. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  188. package/lib/components/Stakeholders/Stakeholders.types.d.ts +5 -13
  189. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -1
  190. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -1
  191. package/lib/components/Stakeholders/index.d.ts +1 -1
  192. package/lib/components/Stakeholders/index.d.ts.map +1 -1
  193. package/lib/components/Stakeholders/index.js.map +1 -1
  194. package/lib/components/Tags/Tags.d.ts +1 -1
  195. package/lib/components/Tags/Tags.d.ts.map +1 -1
  196. package/lib/components/Tags/Tags.js +5 -21
  197. package/lib/components/Tags/Tags.js.map +1 -1
  198. package/lib/components/Tags/index.d.ts +2 -1
  199. package/lib/components/Tags/index.d.ts.map +1 -1
  200. package/lib/components/Tags/index.js.map +1 -1
  201. package/lib/components/Tasks/TaskList.d.ts +18 -7
  202. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  203. package/lib/components/Tasks/TaskList.js +48 -10
  204. package/lib/components/Tasks/TaskList.js.map +1 -1
  205. package/lib/components/Tasks/Tasks.d.ts +21 -15
  206. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  207. package/lib/components/Tasks/Tasks.js +9 -9
  208. package/lib/components/Tasks/Tasks.js.map +1 -1
  209. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  210. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  211. package/lib/components/Tasks/Tasks.test-ids.js +5 -0
  212. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  213. package/lib/components/Tasks/index.d.ts +3 -5
  214. package/lib/components/Tasks/index.d.ts.map +1 -1
  215. package/lib/components/Tasks/index.js +1 -0
  216. package/lib/components/Tasks/index.js.map +1 -1
  217. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  218. package/lib/components/Timeline/Timeline.js +15 -13
  219. package/lib/components/Timeline/Timeline.js.map +1 -1
  220. package/lib/components/Timeline/Timeline.styles.d.ts +4 -5
  221. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  222. package/lib/components/Timeline/Timeline.styles.js +28 -53
  223. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  224. package/lib/components/Timeline/Timeline.types.d.ts +8 -8
  225. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  226. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  227. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  228. package/lib/components/Timeline/TimelineItem.js +19 -7
  229. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  230. package/lib/components/Timeline/TimelineToolbar.js +1 -1
  231. package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
  232. package/lib/components/Timeline/index.d.ts +1 -1
  233. package/lib/components/Timeline/index.d.ts.map +1 -1
  234. package/lib/components/Timeline/index.js.map +1 -1
  235. package/lib/components/Timeline/utils.d.ts +1 -0
  236. package/lib/components/Timeline/utils.d.ts.map +1 -1
  237. package/lib/components/Timeline/utils.js +12 -0
  238. package/lib/components/Timeline/utils.js.map +1 -1
  239. package/lib/index.d.ts +8 -0
  240. package/lib/index.d.ts.map +1 -1
  241. package/lib/index.js +8 -0
  242. package/lib/index.js.map +1 -1
  243. package/package.json +14 -14
  244. package/lib/components/CaseView/CaseHeader.d.ts.map +0 -1
  245. package/lib/components/CaseView/CaseHeader.js +0 -49
  246. package/lib/components/CaseView/CaseHeader.js.map +0 -1
  247. package/lib/components/CaseView/MobileCaseView.d.ts +0 -13
  248. package/lib/components/CaseView/MobileCaseView.d.ts.map +0 -1
  249. package/lib/components/CaseView/MobileCaseView.js +0 -25
  250. package/lib/components/CaseView/MobileCaseView.js.map +0 -1
  251. /package/lib/components/CaseView/{CaseHeader.d.ts → CaseHeader/CaseHeader.d.ts} +0 -0
@@ -1,28 +1,29 @@
1
1
  import { ReactElement, ReactNode, MouseEvent } from 'react';
2
- import { Tab, NoChildrenProp, FieldValueListItemProps, ForwardProps, MenuItemProps, Action, BaseProps, OmitStrict, RequireAtLeastOne } from '@pega/cosmos-react-core';
3
- export interface SummaryField extends OmitStrict<FieldValueListItemProps, 'value'> {
4
- value: FieldValueListItemProps['value'];
5
- }
6
- export declare type CaseSummaryFieldsProps = RequireAtLeastOne<{
2
+ import { Tab, NoChildrenProp, FieldValueListItemProps, ForwardProps, MenuItemProps, Action, BaseProps, TestIdProp } from '@pega/cosmos-react-core';
3
+ import type { getCaseViewTestIds } from './CaseView.test-ids';
4
+ export type CaseSummaryFieldsProps = {
7
5
  primary?: SummaryField[];
8
6
  secondary?: SummaryField[];
9
- }>;
10
- export interface CaseViewProps extends NoChildrenProp, BaseProps {
7
+ inSummaryPanel?: boolean;
8
+ };
9
+ export type SummaryField = {
10
+ name: FieldValueListItemProps['name'];
11
+ value: FieldValueListItemProps['value'];
12
+ simpleValue?: string | number | ReactNode;
13
+ variant?: FieldValueListItemProps['variant'];
14
+ };
15
+ export interface CaseViewProps extends NoChildrenProp, BaseProps, TestIdProp {
11
16
  /** A unique identifier for the case instance. */
12
17
  caseId: string;
13
18
  /** Text to quickly identify a case instance. */
14
19
  heading: string;
15
20
  /** Supplemental text to identify a case instance. */
16
21
  subheading?: string;
17
- /** A set of props including an href that will be forwarded to the case heading and caseId. */
18
- caseLink?: {
19
- href: string;
20
- } & ForwardProps;
21
22
  /** A set of Link props representing the case parents, rendered as Breadcrumbs. */
22
23
  parentCases?: MenuItemProps[];
23
24
  /** An icon to serve as a visual for the CaseView. */
24
25
  icon?: ReactElement;
25
- /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */
26
+ /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */
26
27
  followed?: boolean;
27
28
  /** Called when user chooses to follow or unfollow the case. Use this to update followed. */
28
29
  onFollowedChange?: (following: boolean) => void;
@@ -39,9 +40,7 @@ export interface CaseViewProps extends NoChildrenProp, BaseProps {
39
40
  * @default true
40
41
  */
41
42
  summaryExpanded?: boolean;
42
- /**
43
- * Callback to toggle the case summary's layout.
44
- */
43
+ /** Callback to toggle the case summary's layout. */
45
44
  onToggleSummary?: () => void;
46
45
  /** An object handling the rendering and functionality of the Tabs in CaseSummary. */
47
46
  tabs: {
@@ -65,15 +64,14 @@ export interface CaseViewProps extends NoChildrenProp, BaseProps {
65
64
  content: ReactNode;
66
65
  title: string;
67
66
  };
68
- /**
69
- * Provide an instance of IntelligentGuidance to be rendered for a case.
70
- */
67
+ /** Provide an instance of IntelligentGuidance to be rendered for a case. */
71
68
  intelligentGuidance?: ReactNode;
72
69
  /** A region for case widgets. */
73
70
  utilities?: ReactNode;
74
71
  /** An indicator of case widgets when the utilities are collapsed. */
75
72
  utilitiesSummaryItems?: {
76
73
  iconName: string;
74
+ name: string;
77
75
  count?: number;
78
76
  }[];
79
77
  /**
@@ -81,17 +79,18 @@ export interface CaseViewProps extends NoChildrenProp, BaseProps {
81
79
  * @default true
82
80
  */
83
81
  utilitiesExpanded?: boolean;
84
- /**
85
- * Callback to toggle the utilities.
86
- */
82
+ /** Callback to toggle the utilities. */
87
83
  onToggleUtilities?: () => void;
88
84
  }
89
- export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'caseLink' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'tabs' | 'summaryExpanded' | 'onToggleSummary' | 'utilitiesExpanded' | 'persistentUtility' | 'intelligentGuidance'> {
90
- summaryId: string;
91
- summary: ReactNode;
85
+ export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'tabs' | 'summaryExpanded' | 'summaryFields' | 'onToggleSummary' | 'utilitiesExpanded' | 'stages' | 'tasks' | 'persistentUtility' | 'intelligentGuidance'> {
86
+ testIds: Partial<ReturnType<typeof getCaseViewTestIds>>;
87
+ aboveSM: boolean;
92
88
  aboveMD: boolean;
93
89
  aboveLG: boolean;
94
90
  aboveXL: boolean;
95
91
  isPreview: boolean;
92
+ caseLink?: {
93
+ href: string;
94
+ } & ForwardProps;
96
95
  }
97
96
  //# sourceMappingURL=CaseView.types.d.ts.map
@@ -1 +1 @@
1
- {"version":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GACR,SAAS,GACT,YAAY,GACZ,UAAU,GACV,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,MAAM,GACN,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,CACxB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"CaseView.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EACL,GAAG,EACH,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,MAAM,EACN,SAAS,EACT,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtC,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,OAAO,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS,EAAE,UA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C;IAEpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAE1D,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC,iCAAiC;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,qEAAqE;IACrE,qBAAqB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE7E;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAOhC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CACV,aAAa,EACX,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,MAAM,GACN,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,QAAQ,GACR,OAAO,GACP,mBAAmB,GACnB,qBAAqB,CACxB;IACD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,YAAY,CAAC;CAC5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, ReactNode, MouseEvent } from 'react';\n\nimport {\n Tab,\n NoChildrenProp,\n FieldValueListItemProps,\n ForwardProps,\n MenuItemProps,\n Action,\n BaseProps,\n OmitStrict,\n RequireAtLeastOne\n} from '@pega/cosmos-react-core';\n\nexport interface SummaryField extends OmitStrict<FieldValueListItemProps, 'value'> {\n value: FieldValueListItemProps['value'];\n}\n\nexport type CaseSummaryFieldsProps = RequireAtLeastOne<{\n primary?: SummaryField[];\n secondary?: SummaryField[];\n}>;\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps {\n /** A unique identifier for the case instance. */\n caseId: string;\n\n /** Text to quickly identify a case instance. */\n heading: string;\n\n /** Supplemental text to identify a case instance. */\n subheading?: string;\n\n /** A set of props including an href that will be forwarded to the case heading and caseId. */\n caseLink?: { href: string } & ForwardProps;\n\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n\n /** Case level actions available in an action menu. */\n actions?: Action[];\n\n /** Visually promoted case level actions available outside the menu. */\n promotedActions?: Action[];\n\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n\n /** Field data to render in summary areas. */\n summaryFields: CaseSummaryFieldsProps;\n\n /**\n * Determines the layout state of the summary region.\n * @default true\n */\n summaryExpanded?: boolean;\n\n /**\n * Callback to toggle the case summary's layout.\n */\n onToggleSummary?: () => void;\n\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n\n /** A region within the center column that is controlled by tabs in CaseSummary. */\n tabContent?: { content: ReactNode; id: string }[];\n\n /** A region to hold a Stages component. */\n stages?: ReactNode;\n\n /** A region to hold a Tasks component. */\n tasks?: ReactNode;\n\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n\n /** A region to the right reserved for persistent utilities. */\n persistentUtility?: { content: ReactNode; title: string };\n\n /**\n * Provide an instance of IntelligentGuidance to be rendered for a case.\n */\n intelligentGuidance?: ReactNode;\n\n /** A region for case widgets. */\n utilities?: ReactNode;\n\n /** An indicator of case widgets when the utilities are collapsed. */\n utilitiesSummaryItems?: { iconName: string; count?: number }[];\n\n /**\n * Determines the layout state of the utilities.\n * @default true\n */\n utilitiesExpanded?: boolean;\n\n /**\n * Callback to toggle the utilities.\n */\n onToggleUtilities?: () => void;\n\n /**\n * Indicates CaseView is rendered within a CasePreview.\n * @internal\n */\n isPreview?: boolean;\n}\n\nexport interface CaseViewContextValue\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'tabs'\n | 'summaryExpanded'\n | 'onToggleSummary'\n | 'utilitiesExpanded'\n | 'persistentUtility'\n | 'intelligentGuidance'\n > {\n summaryId: string;\n summary: ReactNode;\n aboveMD: boolean;\n aboveLG: boolean;\n aboveXL: boolean;\n isPreview: boolean;\n}\n"]}
1
+ {"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, ReactNode, MouseEvent } from 'react';\n\nimport {\n Tab,\n NoChildrenProp,\n FieldValueListItemProps,\n ForwardProps,\n MenuItemProps,\n Action,\n BaseProps,\n TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport type { getCaseViewTestIds } from './CaseView.test-ids';\n\nexport type CaseSummaryFieldsProps = {\n primary?: SummaryField[];\n secondary?: SummaryField[];\n inSummaryPanel?: boolean;\n};\n\nexport type SummaryField = {\n name: FieldValueListItemProps['name'];\n value: FieldValueListItemProps['value'];\n simpleValue?: string | number | ReactNode;\n variant?: FieldValueListItemProps['variant'];\n};\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps, TestIdProp {\n /** A unique identifier for the case instance. */\n caseId: string;\n\n /** Text to quickly identify a case instance. */\n heading: string;\n\n /** Supplemental text to identify a case instance. */\n subheading?: string;\n\n /** @internal */\n caseLink?: CaseViewContextValue['caseLink'];\n\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n\n /** Case level actions available in an action menu. */\n actions?: Action[];\n\n /** Visually promoted case level actions available outside the menu. */\n promotedActions?: Action[];\n\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n\n /** Field data to render in summary areas. */\n summaryFields: CaseSummaryFieldsProps;\n\n /**\n * Determines the layout state of the summary region.\n * @default true\n */\n summaryExpanded?: boolean;\n\n /** Callback to toggle the case summary's layout. */\n onToggleSummary?: () => void;\n\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n\n /** A region within the center column that is controlled by tabs in CaseSummary. */\n tabContent?: { content: ReactNode; id: string }[];\n\n /** A region to hold a Stages component. */\n stages?: ReactNode;\n\n /** A region to hold a Tasks component. */\n tasks?: ReactNode;\n\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n\n /** A region to the right reserved for persistent utilities. */\n persistentUtility?: { content: ReactNode; title: string };\n\n /** Provide an instance of IntelligentGuidance to be rendered for a case. */\n intelligentGuidance?: ReactNode;\n\n /** A region for case widgets. */\n utilities?: ReactNode;\n\n /** An indicator of case widgets when the utilities are collapsed. */\n utilitiesSummaryItems?: { iconName: string; name: string; count?: number }[];\n\n /**\n * Determines the layout state of the utilities.\n * @default true\n */\n utilitiesExpanded?: boolean;\n\n /** Callback to toggle the utilities. */\n onToggleUtilities?: () => void;\n\n /**\n * Indicates CaseView is rendered within a CasePreview.\n * @internal\n */\n isPreview?: boolean;\n}\n\nexport interface CaseViewContextValue\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'tabs'\n | 'summaryExpanded'\n | 'summaryFields'\n | 'onToggleSummary'\n | 'utilitiesExpanded'\n | 'stages'\n | 'tasks'\n | 'persistentUtility'\n | 'intelligentGuidance'\n > {\n testIds: Partial<ReturnType<typeof getCaseViewTestIds>>;\n aboveSM: boolean;\n aboveMD: boolean;\n aboveLG: boolean;\n aboveXL: boolean;\n isPreview: boolean;\n caseLink?: { href: string } & ForwardProps;\n}\n"]}
@@ -2,7 +2,6 @@ import { FunctionComponent } from 'react';
2
2
  import { CaseViewProps } from './CaseView.types';
3
3
  export interface UtilitiesSummaryProps {
4
4
  items?: CaseViewProps['utilitiesSummaryItems'];
5
- onClick?: () => void;
6
5
  }
7
6
  export declare const StyledUtilitiesSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
7
  declare const UtilitiesSummary: FunctionComponent<UtilitiesSummaryProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/UtilitiesSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,yGAMjC,CAAC;AAEH,QAAA,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,CAiC9D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"UtilitiesSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/UtilitiesSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,sBAAsB,yGAKjC,CAAC;AAEH,QAAA,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,CA8B9D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,24 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled, { css } from 'styled-components';
3
- import { Card, Count, Flex, Icon, useI18n } from '@pega/cosmos-react-core';
3
+ import { Card, Count, Flex, Icon, useI18n, VisuallyHiddenText } from '@pega/cosmos-react-core';
4
4
  export const StyledUtilitiesSummary = styled.div(({ theme }) => {
5
5
  return css `
6
6
  width: 2.75rem;
7
7
  padding: ${theme.base.spacing} 0;
8
- cursor: pointer;
9
8
  `;
10
9
  });
11
- const UtilitiesSummary = ({ items = [], onClick }) => {
10
+ const UtilitiesSummary = ({ items = [] }) => {
12
11
  const t = useI18n();
13
- return items.length ? (_jsx(Card, { interactive: true, tabIndex: 0, role: 'button', container: { direction: 'column', alignItems: 'center', gap: 3 }, "aria-label": `${t('utilities_summary')}. ${t('expand_utilities_panel')}`, as: StyledUtilitiesSummary, onClick: onClick, onKeyDown: (e) => {
14
- if (e.key === ' ' || e.key === 'Enter')
15
- onClick?.();
16
- }, children: items.map(item => {
12
+ return items.length ? (_jsx(Card, { container: { direction: 'column', alignItems: 'center', gap: 3 }, as: StyledUtilitiesSummary, "aria-label": t('utilities_summary'), role: 'list', children: items.map(item => {
17
13
  return (_jsxs(Flex, { container: {
18
14
  direction: 'column',
19
15
  alignItems: 'center',
20
16
  gap: 0.5
21
- }, item: { grow: 1 }, children: [_jsx(Icon, { name: item.iconName }), item.count !== undefined && _jsx(Count, { children: item.count })] }, item.iconName));
17
+ }, item: { grow: 1 }, children: [_jsx(Icon, { name: item.iconName }), item.count !== undefined && _jsx(Count, { "aria-hidden": true, children: item.count }), _jsx(VisuallyHiddenText, { role: 'listitem', children: `${item.count ?? ''} ${item.name}` })] }, item.iconName));
22
18
  }) })) : null;
23
19
  };
24
20
  export default UtilitiesSummary;
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/UtilitiesSummary.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAS3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,OAAO,GAAG,CAAA;;eAEG,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAA6C,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IAC7F,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACpB,KAAC,IAAI,IACH,WAAW,QACX,QAAQ,EAAE,CAAC,EACX,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,gBACpD,GAAG,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,wBAAwB,CAAC,EAAE,EACvE,EAAE,EAAE,sBAAsB,EAC1B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,CAAC,CAAgC,EAAE,EAAE;YAC9C,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO;gBAAE,OAAO,EAAE,EAAE,CAAC;QACtD,CAAC,YAEA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,UAAU,EAAE,QAAQ;oBACpB,GAAG,EAAE,GAAG;iBACT,EACD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAGjB,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAI,EAC5B,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAC,KAAK,cAAE,IAAI,CAAC,KAAK,GAAS,KAHnD,IAAI,CAAC,QAAQ,CAIb,CACR,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { FunctionComponent, KeyboardEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Card, Count, Flex, Icon, useI18n } from '@pega/cosmos-react-core';\n\nimport { CaseViewProps } from './CaseView.types';\n\nexport interface UtilitiesSummaryProps {\n items?: CaseViewProps['utilitiesSummaryItems'];\n onClick?: () => void;\n}\n\nexport const StyledUtilitiesSummary = styled.div(({ theme }) => {\n return css`\n width: 2.75rem;\n padding: ${theme.base.spacing} 0;\n cursor: pointer;\n `;\n});\n\nconst UtilitiesSummary: FunctionComponent<UtilitiesSummaryProps> = ({ items = [], onClick }) => {\n const t = useI18n();\n return items.length ? (\n <Card\n interactive\n tabIndex={0}\n role='button'\n container={{ direction: 'column', alignItems: 'center', gap: 3 }}\n aria-label={`${t('utilities_summary')}. ${t('expand_utilities_panel')}`}\n as={StyledUtilitiesSummary}\n onClick={onClick}\n onKeyDown={(e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === ' ' || e.key === 'Enter') onClick?.();\n }}\n >\n {items.map(item => {\n return (\n <Flex\n container={{\n direction: 'column',\n alignItems: 'center',\n gap: 0.5\n }}\n item={{ grow: 1 }}\n key={item.iconName}\n >\n <Icon name={item.iconName} />\n {item.count !== undefined && <Count>{item.count}</Count>}\n </Flex>\n );\n })}\n </Card>\n ) : null;\n};\n\nexport default UtilitiesSummary;\n"]}
1
+ {"version":3,"file":"UtilitiesSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/UtilitiesSummary.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAQ/F,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,OAAO,GAAG,CAAA;;eAEG,KAAK,CAAC,IAAI,CAAC,OAAO;GAC9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAA6C,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE,EAAE;IACpF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACpB,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAChE,EAAE,EAAE,sBAAsB,gBACd,CAAC,CAAC,mBAAmB,CAAC,EAClC,IAAI,EAAC,MAAM,YAEV,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,UAAU,EAAE,QAAQ;oBACpB,GAAG,EAAE,GAAG;iBACT,EACD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAGjB,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAI,EAC5B,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAC,KAAK,mCAAc,IAAI,CAAC,KAAK,GAAS,EACpE,KAAC,kBAAkB,IAAC,IAAI,EAAC,UAAU,YAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,IACtD,IAAI,CAAC,IACP,EAAE,GAAsB,KANnB,IAAI,CAAC,QAAQ,CAOb,CACR,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Card, Count, Flex, Icon, useI18n, VisuallyHiddenText } from '@pega/cosmos-react-core';\n\nimport { CaseViewProps } from './CaseView.types';\n\nexport interface UtilitiesSummaryProps {\n items?: CaseViewProps['utilitiesSummaryItems'];\n}\n\nexport const StyledUtilitiesSummary = styled.div(({ theme }) => {\n return css`\n width: 2.75rem;\n padding: ${theme.base.spacing} 0;\n `;\n});\n\nconst UtilitiesSummary: FunctionComponent<UtilitiesSummaryProps> = ({ items = [] }) => {\n const t = useI18n();\n return items.length ? (\n <Card\n container={{ direction: 'column', alignItems: 'center', gap: 3 }}\n as={StyledUtilitiesSummary}\n aria-label={t('utilities_summary')}\n role='list'\n >\n {items.map(item => {\n return (\n <Flex\n container={{\n direction: 'column',\n alignItems: 'center',\n gap: 0.5\n }}\n item={{ grow: 1 }}\n key={item.iconName}\n >\n <Icon name={item.iconName} />\n {item.count !== undefined && <Count aria-hidden>{item.count}</Count>}\n <VisuallyHiddenText role='listitem'>{`${item.count ?? ''} ${\n item.name\n }`}</VisuallyHiddenText>\n </Flex>\n );\n })}\n </Card>\n ) : null;\n};\n\nexport default UtilitiesSummary;\n"]}
@@ -1,9 +1,4 @@
1
1
  export { default } from './CaseView';
2
- export { CaseViewProps } from './CaseView.types';
2
+ export type { CaseViewProps } from './CaseView.types';
3
3
  export { StyledCaseView, StyledWorkArea as StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummary as StyledSummaryRegion } from './CaseView.styles';
4
- export { default as MobileCaseView } from './MobileCaseView';
5
- export { MobileCaseViewProps } from './MobileCaseView';
6
- export { default as CaseSummary } from './CaseSummary';
7
- export { default as CaseSummaryFields } from './CaseSummaryFields';
8
- export { default as CaseHeader } from './CaseHeader';
9
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,IAAI,mBAAmB,EACrC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,cAAc,EACd,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,IAAI,mBAAmB,EACrC,MAAM,mBAAmB,CAAC"}
@@ -1,7 +1,3 @@
1
1
  export { default } from './CaseView';
2
2
  export { StyledCaseView, StyledWorkArea as StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummary as StyledSummaryRegion } from './CaseView.styles';
3
- export { default as MobileCaseView } from './MobileCaseView';
4
- export { default as CaseSummary } from './CaseSummary';
5
- export { default as CaseSummaryFields } from './CaseSummaryFields';
6
- export { default as CaseHeader } from './CaseHeader';
7
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,cAAc,EACd,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,IAAI,mBAAmB,EACrC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { default } from './CaseView';\nexport { CaseViewProps } from './CaseView.types';\nexport {\n StyledCaseView,\n StyledWorkArea as StyledCaseViewContent,\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledSummary as StyledSummaryRegion\n} from './CaseView.styles';\nexport { default as MobileCaseView } from './MobileCaseView';\nexport { MobileCaseViewProps } from './MobileCaseView';\nexport { default as CaseSummary } from './CaseSummary';\nexport { default as CaseSummaryFields } from './CaseSummaryFields';\nexport { default as CaseHeader } from './CaseHeader';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,cAAc,EACd,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,IAAI,mBAAmB,EACrC,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './CaseView';\nexport type { CaseViewProps } from './CaseView.types';\nexport {\n StyledCaseView,\n StyledWorkArea as StyledCaseViewContent,\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledSummary as StyledSummaryRegion\n} from './CaseView.styles';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableLayout.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AA+B1E,QAAA,MAAM,kBAAkB,iHA8EvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ConfigurableLayout.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AA+B1E,QAAA,MAAM,kBAAkB,iHA+EtB,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -27,7 +27,7 @@ const StyledContainerRuler = styled.div(({ theme }) => {
27
27
  `;
28
28
  });
29
29
  StyledContainerRuler.defaultProps = defaultThemeProp;
30
- const ConfigurableLayout = forwardRef(({ items, arrangement }, ref) => {
30
+ const ConfigurableLayout = forwardRef(function ConfigurableLayout({ items, arrangement }, ref) {
31
31
  const containerRulerRef = useRef(null);
32
32
  const renderMode = useMemo(() => {
33
33
  const activeArrangement = arrangement?.hasWrapped !== undefined && !arrangement.hasWrapped;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableLayout.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IAC/C,OAAO,GAAG,CAAA;;GAET,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9C,OAAO,GAAG,CAAA;;;yBAGa,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;6BAC/B,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;0BACtC,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;kCACvB,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;GAC9D,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK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AAC,CAAC;4BACb,MAAM,WAAW,GAAuD;gCACtE,KAAK,EAAE,KAAK;gCACZ,KAAK,EAAE,KAAK;gCACZ,KAAK,EAAE,MAAM;gCACb,KAAK,EAAE,MAAM;gCACb,KAAK,EAAE,MAAM;gCACb,IAAI,EAAE,MAAM;6BACb,CAAC;4BAEF,MAAM,CAAC,YAAY,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;4BAEnE,MAAM;yBACP;wBACD,KAAK,MAAM;4BACT,MAAM,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC;4BACnC,MAAM;wBACR;4BACE,MAAM,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC;4BACnC,MAAM;qBACT;iBACF;gBAED,OAAO,KAAC,UAAU,IAA0B,MAAM,EAAE,MAAM,IAAlC,GAAG,UAAU,CAAC,EAAE,EAAE,CAAoB,CAAC;YACjE,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IAExB,OAAO,CACL,KAAC,wBAAwB,cACvB,MAAC,IAAI,IACH,EAAE,EAAE,cAAc,EAClB,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,EACtE,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,EAAE,EAC3C,GAAG,EAAE,GAAG,aAER,KAAC,oBAAoB,IAAC,GAAG,EAAE,iBAAiB,GAAI,EAC/C,OAAO,IACH,GACkB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, Ref, useRef, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport type { ConfigurableLayoutProps } from './ConfigurableLayout.types';\nimport { containerMinWidth, cellGap } from './defaults';\nimport widthConfigOptions from './options';\nimport LayoutCell from './LayoutCell';\n\nconst StyledConfigurableLayout = styled.div(() => {\n return css`\n overflow: hidden;\n `;\n});\n\nconst StyledCellGrid = styled.div(({ theme }) => {\n return css`\n /* Note: inset position used to negate \"column\" inline margin on items */\n position: relative;\n width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});\n max-width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});\n inset-inline: calc(-${cellGap} * ${theme.base.spacing});\n margin-block-end: calc(-2 * ${cellGap} * ${theme.base.spacing});\n `;\n});\nStyledCellGrid.defaultProps = defaultThemeProp;\n\nconst StyledContainerRuler = styled.div(({ theme }) => {\n return css`\n margin-inline: calc(${cellGap} * ${theme.base.spacing});\n width: calc(100% - ${cellGap * 2} * ${theme.base.spacing});\n `;\n});\nStyledContainerRuler.defaultProps = defaultThemeProp;\n\nconst ConfigurableLayout = forwardRef(\n ({ items, arrangement }: PropsWithoutRef<ConfigurableLayoutProps>, ref: Ref<HTMLElement>) => {\n const containerRulerRef = useRef<HTMLDivElement>(null);\n\n const renderMode = useMemo(() => {\n const activeArrangement = arrangement?.hasWrapped !== undefined && !arrangement.hasWrapped;\n\n if (activeArrangement) {\n switch (arrangement.size) {\n case 'main':\n return 'direct';\n case 'half':\n return 'double';\n case 'narrow':\n return 'full';\n default:\n return 'direct';\n }\n }\n\n // Use direct by default\n return 'direct';\n }, [arrangement]);\n\n const content = useMemo(() => {\n if (items && !!items.length) {\n return items.map(itemConfig => {\n const config = {\n ...itemConfig,\n layoutConfig: { ...itemConfig.layoutConfig }\n };\n\n if (renderMode !== 'direct') {\n switch (renderMode) {\n case 'double': {\n const doubleWidth: { [key: string]: keyof typeof widthConfigOptions } = {\n '1/4': '1/2',\n '1/3': '2/3',\n '1/2': 'full',\n '2/3': 'full',\n '3/4': 'full',\n full: 'full'\n };\n\n config.layoutConfig.width = doubleWidth[config.layoutConfig.width];\n\n break;\n }\n case 'full':\n config.layoutConfig.width = 'full';\n break;\n default:\n config.layoutConfig.width = 'full';\n break;\n }\n }\n\n return <LayoutCell key={`${itemConfig.id}`} config={config} />;\n });\n }\n\n return null;\n }, [items, renderMode]);\n\n return (\n <StyledConfigurableLayout>\n <Flex\n as={StyledCellGrid}\n container={{ wrap: 'wrap', justify: 'stretch', alignItems: 'stretch' }}\n item={{ basis: containerMinWidth, grow: 1 }}\n ref={ref}\n >\n <StyledContainerRuler ref={containerRulerRef} />\n {content}\n </Flex>\n </StyledConfigurableLayout>\n );\n }\n);\n\nexport default ConfigurableLayout;\n"]}
1
+ {"version":3,"file":"ConfigurableLayout.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IAC/C,OAAO,GAAG,CAAA;;GAET,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9C,OAAO,GAAG,CAAA;;;yBAGa,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;6BAC/B,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;0BACtC,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;kCACvB,OAAO,MAAM,KAA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AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, Ref, useRef, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport type { ConfigurableLayoutProps } from './ConfigurableLayout.types';\nimport { containerMinWidth, cellGap } from './defaults';\nimport widthConfigOptions from './options';\nimport LayoutCell from './LayoutCell';\n\nconst StyledConfigurableLayout = styled.div(() => {\n return css`\n overflow: hidden;\n `;\n});\n\nconst StyledCellGrid = styled.div(({ theme }) => {\n return css`\n /* Note: inset position used to negate \"column\" inline margin on items */\n position: relative;\n width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});\n max-width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});\n inset-inline: calc(-${cellGap} * ${theme.base.spacing});\n margin-block-end: calc(-2 * ${cellGap} * ${theme.base.spacing});\n `;\n});\nStyledCellGrid.defaultProps = defaultThemeProp;\n\nconst StyledContainerRuler = styled.div(({ theme }) => {\n return css`\n margin-inline: calc(${cellGap} * ${theme.base.spacing});\n width: calc(100% - ${cellGap * 2} * ${theme.base.spacing});\n `;\n});\nStyledContainerRuler.defaultProps = defaultThemeProp;\n\nconst ConfigurableLayout = forwardRef(function ConfigurableLayout(\n { items, arrangement }: PropsWithoutRef<ConfigurableLayoutProps>,\n ref: Ref<HTMLElement>\n) {\n const containerRulerRef = useRef<HTMLDivElement>(null);\n\n const renderMode = useMemo(() => {\n const activeArrangement = arrangement?.hasWrapped !== undefined && !arrangement.hasWrapped;\n\n if (activeArrangement) {\n switch (arrangement.size) {\n case 'main':\n return 'direct';\n case 'half':\n return 'double';\n case 'narrow':\n return 'full';\n default:\n return 'direct';\n }\n }\n\n // Use direct by default\n return 'direct';\n }, [arrangement]);\n\n const content = useMemo(() => {\n if (items && !!items.length) {\n return items.map(itemConfig => {\n const config = {\n ...itemConfig,\n layoutConfig: { ...itemConfig.layoutConfig }\n };\n\n if (renderMode !== 'direct') {\n switch (renderMode) {\n case 'double': {\n const doubleWidth: { [key: string]: keyof typeof widthConfigOptions } = {\n '1/4': '1/2',\n '1/3': '2/3',\n '1/2': 'full',\n '2/3': 'full',\n '3/4': 'full',\n full: 'full'\n };\n\n config.layoutConfig.width = doubleWidth[config.layoutConfig.width];\n\n break;\n }\n case 'full':\n config.layoutConfig.width = 'full';\n break;\n default:\n config.layoutConfig.width = 'full';\n break;\n }\n }\n\n return <LayoutCell key={`${itemConfig.id}`} config={config} />;\n });\n }\n\n return null;\n }, [items, renderMode]);\n\n return (\n <StyledConfigurableLayout>\n <Flex\n as={StyledCellGrid}\n container={{ wrap: 'wrap', justify: 'stretch', alignItems: 'stretch' }}\n item={{ basis: containerMinWidth, grow: 1 }}\n ref={ref}\n >\n <StyledContainerRuler ref={containerRulerRef} />\n {content}\n </Flex>\n </StyledConfigurableLayout>\n );\n});\n\nexport default ConfigurableLayout;\n"]}
@@ -1,7 +1,5 @@
1
1
  import type widthConfigOptions from './options';
2
- /**
3
- * Type for config of a single ConfigurableLayout item.
4
- */
2
+ /** Type for config of a single ConfigurableLayout item. */
5
3
  export interface Config {
6
4
  /** Unique identifier in render region */
7
5
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableLayout.types.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,WAAW,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;IACrB,yBAAyB;IACzB,YAAY,EAAE;QACZ,8BAA8B;QAC9B,KAAK,EAAE,MAAM,OAAO,kBAAkB,CAAC;QACvC;;;WAGG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;KAC1D,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,6BAA6B;IAC7B,WAAW,CAAC,EAAE;QACZ;;;;;;WAMG;QACH,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;QACjC,4FAA4F;QAC5F,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;CACH"}
1
+ {"version":3,"file":"ConfigurableLayout.types.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,WAAW,CAAC;AAEhD,2DAA2D;AAC3D,MAAM,WAAW,MAAM;IACrB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;IACrB,yBAAyB;IACzB,YAAY,EAAE;QACZ,8BAA8B;QAC9B,KAAK,EAAE,MAAM,OAAO,kBAAkB,CAAC;QACvC;;;WAGG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;KAC1D,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,6BAA6B;IAC7B,WAAW,CAAC,EAAE;QACZ;;;;;;WAMG;QACH,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;QACjC,4FAA4F;QAC5F,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableLayout.types.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.types.ts"],"names":[],"mappings":"","sourcesContent":["import type widthConfigOptions from './options';\n\n/**\n * Type for config of a single ConfigurableLayout item.\n */\nexport interface Config {\n /** Unique identifier in render region */\n id: string;\n /** Element to render */\n content: JSX.Element;\n /** Config for element */\n layoutConfig: {\n /** Responsive width option */\n width: keyof typeof widthConfigOptions;\n /**\n * Fills remaining space if true, else does not grow beyond `width` value.\n * @default true\n */\n fillAvailable?: boolean;\n /** Flex basis (minimum fixed width) of element as:\n * - a numeric value to be applied in __pixels__\n * - a tuple of a numeric value and string unit\n */\n minWidth?: number | [number, 'px' | 'ch' | 'rem' | 'em'];\n };\n}\n\nexport interface ConfigurableLayoutProps {\n /** Array of configs for individual layout cells */\n items: Config[];\n /** Arrangement properties */\n arrangement?: {\n /** Defines the arrangement size of the given ConfigurableLayout.\n * Used to determine what width to apply to the given item when the arrangement is applied,\n * with the following mapping:\n * - 'narrow' --> applies 'full' width\n * - 'main' --> applies configured width\n * - 'half' --> applies double the configured width, or 'full' width (whichever is smaller)\n */\n size: 'narrow' | 'main' | 'half';\n /** Indicates when the ConfigurableLayout has wrapped to the full width of it's container */\n hasWrapped: boolean;\n };\n}\n"]}
1
+ {"version":3,"file":"ConfigurableLayout.types.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.types.ts"],"names":[],"mappings":"","sourcesContent":["import type widthConfigOptions from './options';\n\n/** Type for config of a single ConfigurableLayout item. */\nexport interface Config {\n /** Unique identifier in render region */\n id: string;\n /** Element to render */\n content: JSX.Element;\n /** Config for element */\n layoutConfig: {\n /** Responsive width option */\n width: keyof typeof widthConfigOptions;\n /**\n * Fills remaining space if true, else does not grow beyond `width` value.\n * @default true\n */\n fillAvailable?: boolean;\n /** Flex basis (minimum fixed width) of element as:\n * - a numeric value to be applied in __pixels__\n * - a tuple of a numeric value and string unit\n */\n minWidth?: number | [number, 'px' | 'ch' | 'rem' | 'em'];\n };\n}\n\nexport interface ConfigurableLayoutProps {\n /** Array of configs for individual layout cells */\n items: Config[];\n /** Arrangement properties */\n arrangement?: {\n /** Defines the arrangement size of the given ConfigurableLayout.\n * Used to determine what width to apply to the given item when the arrangement is applied,\n * with the following mapping:\n * - 'narrow' --> applies 'full' width\n * - 'main' --> applies configured width\n * - 'half' --> applies double the configured width, or 'full' width (whichever is smaller)\n */\n size: 'narrow' | 'main' | 'half';\n /** Indicates when the ConfigurableLayout has wrapped to the full width of it's container */\n hasWrapped: boolean;\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export { default } from './ConfigurableLayout';
2
2
  export { default as useTrackWrappedRegions } from './useTrackWrappedRegions';
3
- export { ConfigurableLayoutProps } from './ConfigurableLayout.types';
3
+ export type { ConfigurableLayoutProps } from './ConfigurableLayout.types';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { default } from './ConfigurableLayout';\nexport { default as useTrackWrappedRegions } from './useTrackWrappedRegions';\nexport { ConfigurableLayoutProps } from './ConfigurableLayout.types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { default } from './ConfigurableLayout';\nexport { default as useTrackWrappedRegions } from './useTrackWrappedRegions';\nexport type { ConfigurableLayoutProps } from './ConfigurableLayout.types';\n"]}
@@ -5,7 +5,7 @@ export interface ConfirmationProps extends NoChildrenProp {
5
5
  title?: string;
6
6
  /** Region for a Field Value List component */
7
7
  details?: ReactNode;
8
- /** Array of React nodes to be put into a list */
8
+ /** Array of React nodes to be put into a list */
9
9
  whatsNext?: UnorderedListProps['items'];
10
10
  /** Region for a Tasks component */
11
11
  tasks?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAGL,YAAY,EAOZ,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAQjC,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,kDAAkD;IAClD,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;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAqCrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,SAAS,EACT,GAAG,EAGJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,YAAY,EAOZ,kBAAkB,EAClB,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAUjC,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,14 +1,29 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import styled from 'styled-components';
4
- import { Card, CardContent, Flex, Text, useI18n, UnorderedList, Button, defaultThemeProp } from '@pega/cosmos-react-core';
2
+ import { forwardRef, useContext, useMemo } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { Card, CardContent, Flex, Text, useI18n, UnorderedList, Button, defaultThemeProp, VisuallyHiddenText } from '@pega/cosmos-react-core';
5
+ import { StyledDetails, StyledFieldValueGroupLabel, DetailsContext } from '../Details';
5
6
  const StyledWhatsNextList = styled(UnorderedList) `
6
7
  padding-inline-start: 0;
7
8
  `;
8
9
  StyledWhatsNextList.defaultProps = defaultThemeProp;
9
- const Confirmation = forwardRef(({ title, details, whatsNext, tasks, onClose, ...restProps }, ref) => {
10
+ const StyledConfirmationDetails = styled.div(() => {
11
+ return css `
12
+ > ${StyledDetails} > ${StyledFieldValueGroupLabel}:first-child {
13
+ margin-block-start: 0;
14
+ }
15
+ `;
16
+ });
17
+ const Confirmation = forwardRef(function Confirmation({ title, details, whatsNext, tasks, onClose, ...restProps }, ref) {
10
18
  const t = useI18n();
11
- return (_jsx(Card, { ...restProps, ref: ref, children: _jsx(CardContent, { children: _jsxs(Flex, { container: { gap: 3, direction: 'column' }, children: [title && _jsx(Text, { variant: 'h2', children: title }), details && (_jsxs(Flex, { container: { gap: 1, direction: 'column' }, children: [_jsx(Text, { variant: 'h3', children: t('confirmation_details') }), details] })), whatsNext && (_jsxs(Flex, { container: { gap: 1, direction: 'column' }, children: [_jsx(Text, { variant: 'h3', children: t('confirmation_whats_next') }), _jsx(StyledWhatsNextList, { items: whatsNext, as: StyledWhatsNextList })] })), tasks, onClose && (_jsx(Flex, { container: { justify: 'end' }, children: _jsx(Button, { onClick: onClose, variant: 'primary', children: t('done') }) }))] }) }) }));
19
+ const detailsContext = useContext(DetailsContext);
20
+ const detailsCtxValue = useMemo(() => {
21
+ return {
22
+ ...detailsContext,
23
+ depth: 4
24
+ };
25
+ }, [detailsContext]);
26
+ return (_jsx(Card, { ...restProps, ref: ref, children: _jsx(CardContent, { children: _jsxs(Flex, { container: { gap: 3, direction: 'column' }, children: [title && _jsx(Text, { variant: 'h3', children: title }), details && (_jsx(DetailsContext.Provider, { value: detailsCtxValue, children: _jsx(StyledConfirmationDetails, { children: details }) })), whatsNext && (_jsxs(Flex, { container: { gap: 1, direction: 'column' }, children: [_jsx(Text, { variant: 'h4', children: t('confirmation_whats_next') }), _jsx(StyledWhatsNextList, { items: whatsNext, as: StyledWhatsNextList })] })), tasks, onClose && (_jsx(Flex, { container: { justify: 'end' }, children: _jsxs(Button, { onClick: onClose, variant: 'primary', children: [t('done'), title ? _jsx(VisuallyHiddenText, { children: `- ${title}` }) : null] }) }))] }) }) }));
12
27
  });
13
28
  export default Confirmation;
14
29
  //# sourceMappingURL=Confirmation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsD,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,IAAI,EACJ,WAAW,EAEX,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,MAAM,EACN,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;CAEhD,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAiBpD,MAAM,YAAY,GAAwD,UAAU,CAClF,CACE,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,EAAsC,EAC/F,GAAG,EACH,EAAE;IACF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,KAAC,IAAI,OAAK,SAAS,EAAE,GAAG,EAAE,GAAG,YAC3B,KAAC,WAAW,cACV,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC7C,KAAK,IAAI,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAQ,EAC1C,OAAO,IAAI,CACV,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC9C,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,sBAAsB,CAAC,GAAQ,EACpD,OAAO,IACH,CACR,EACA,SAAS,IAAI,CACZ,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC9C,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,yBAAyB,CAAC,GAAQ,EACxD,KAAC,mBAAmB,IAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,mBAAmB,GAAI,IAC7D,CACR,EACA,KAAK,EACL,OAAO,IAAI,CACV,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YACjC,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,SAAS,YACxC,CAAC,CAAC,MAAM,CAAC,GACH,GACJ,CACR,IACI,GACK,GACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Card,\n CardContent,\n ForwardProps,\n Flex,\n Text,\n useI18n,\n UnorderedList,\n Button,\n defaultThemeProp,\n UnorderedListProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\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 Confirmation: FunctionComponent<ConfirmationProps & ForwardProps> = forwardRef(\n (\n { title, details, whatsNext, tasks, onClose, ...restProps }: PropsWithoutRef<ConfirmationProps>,\n ref\n ) => {\n const t = useI18n();\n\n return (\n <Card {...restProps} ref={ref}>\n <CardContent>\n <Flex container={{ gap: 3, direction: 'column' }}>\n {title && <Text variant='h2'>{title}</Text>}\n {details && (\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h3'>{t('confirmation_details')}</Text>\n {details}\n </Flex>\n )}\n {whatsNext && (\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h3'>{t('confirmation_whats_next')}</Text>\n <StyledWhatsNextList items={whatsNext} as={StyledWhatsNextList} />\n </Flex>\n )}\n {tasks}\n {onClose && (\n <Flex container={{ justify: 'end' }}>\n <Button onClick={onClose} variant='primary'>\n {t('done')}\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,EACL,UAAU,EAKV,UAAU,EACV,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,WAAW,EAEX,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,MAAM,EACN,gBAAgB,EAGhB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAEjC,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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AAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YACjC,MAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,SAAS,aACxC,CAAC,CAAC,MAAM,CAAC,EACT,KAAK,CAAC,CAAC,CAAC,KAAC,kBAAkB,cAAE,KAAK,KAAK,EAAE,GAAsB,CAAC,CAAC,CAAC,IAAI,IAChE,GACJ,CACR,IACI,GACK,GACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n Ref,\n useContext,\n useMemo\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Card,\n CardContent,\n ForwardProps,\n Flex,\n Text,\n useI18n,\n UnorderedList,\n Button,\n defaultThemeProp,\n UnorderedListProps,\n NoChildrenProp,\n VisuallyHiddenText\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: 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,3 +1,3 @@
1
1
  export { default } from './Confirmation';
2
- export { ConfirmationProps } from './Confirmation';
2
+ export type { ConfirmationProps } from './Confirmation';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Confirmation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default } from './Confirmation';\nexport { ConfirmationProps } from './Confirmation';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Confirmation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default } from './Confirmation';\nexport type { ConfirmationProps } from './Confirmation';\n"]}
@@ -1,10 +1,12 @@
1
1
  import { FC, ReactNode, Ref } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- export interface DetailsProps {
2
+ import { ForwardProps, TestIdProp } from '@pega/cosmos-react-core';
3
+ export interface DetailsProps extends TestIdProp {
4
4
  highlightedData?: ReactNode[];
5
5
  children?: ReactNode;
6
6
  /** Text used as heading of list */
7
7
  name?: string;
8
+ /** Copy placed in paragraph below the name */
9
+ description?: string;
8
10
  /**
9
11
  * Whether the items children can be collapsed (only applies if name is provided)
10
12
  * @default false
@@ -29,6 +31,8 @@ export interface DetailsProps {
29
31
  valueComparison?: boolean;
30
32
  ref?: Ref<HTMLDListElement>;
31
33
  }
32
- declare const Details: FC<DetailsProps & ForwardProps>;
33
- export default Details;
34
+ declare const _default: FC<DetailsProps & ForwardProps> & {
35
+ getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "highlighted-data", "data", "expand-collapse"]>;
36
+ };
37
+ export default _default;
34
38
  //# sourceMappingURL=Details.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EAEF,SAAS,EACT,GAAG,EAKJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAKL,YAAY,EAMb,MAAM,yBAAyB,CAAC;AAYjC,MAAM,WAAW,YAAY;IAC3B,eAAe,CAAC,EAAE,SAAS,EAAE,CAA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G,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;;;;AAoMD,wBAAuD"}
@@ -1,33 +1,42 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, Fragment, useState, useContext, useEffect, useMemo } from 'react';
3
3
  import { remToPx } from 'polished';
4
- import { Text, useBreakpoint, useConsolidatedRef, useTheme, ExpandCollapse, Button, Flex, Icon, useI18n } from '@pega/cosmos-react-core';
4
+ import { Text, useBreakpoint, useConsolidatedRef, useTheme, ExpandCollapse, Button, Flex, Icon, useChToPxConversionFactor, useI18n, HTML, useTestIds, withTestIds } from '@pega/cosmos-react-core';
5
+ import { getDetailsTestIds } from './Details.test-ids';
5
6
  import DetailsContext from './DetailsContext';
6
- import { StyledFieldValueGroupLabel, StyledDetails, StyledDetailList, StyledHighlightedDetailList, flexGapProp, chToRem } from './Details.styles';
7
- const Details = forwardRef(({ highlightedData, children, name, columnCount = 1, nested = false, asFlex = false, valueComparison = false, collapsible = false }, ref) => {
8
- const { longestLabelLength, mobileView, depth, ...context } = useContext(DetailsContext);
9
- const { base: { 'content-width': { sm } } } = useTheme();
7
+ import { StyledFieldValueGroupLabel, StyledDetails, StyledDetailList, StyledHighlightedDetailList, flexGapProp, StyledDetailDescription } from './Details.styles';
8
+ const Details = forwardRef(function Details({ testId, highlightedData, children, name, description, columnCount = 1, nested = false, asFlex = false, valueComparison = false, collapsible = false }, ref) {
9
+ const { longestLabelLength, mobileView: inMobileView, depth, ...context } = useContext(DetailsContext);
10
+ const { base: { 'content-width': { sm: smContentWidth } } } = useTheme();
10
11
  const isSmallOrAbove = useBreakpoint('sm');
11
12
  const listRef = useConsolidatedRef(ref);
12
- const flexRow = useBreakpoint(columnCount > 2 ? 'md' : 'sm', {
13
+ const isXsContentWidthOrAbove = useBreakpoint('xs', {
14
+ breakpointRef: listRef,
15
+ themeProp: 'content-width'
16
+ });
17
+ const isMdContentWidthOrAbove = useBreakpoint('md', {
18
+ breakpointRef: listRef,
19
+ themeProp: 'content-width'
20
+ });
21
+ const flexRow = useBreakpoint(columnCount > 2 ? 'lg' : 'md', {
13
22
  breakpointRef: listRef,
14
23
  themeProp: 'content-width'
15
24
  });
16
25
  const t = useI18n();
26
+ const testIds = useTestIds(testId, getDetailsTestIds);
17
27
  const [flexContextMobileView, setFlexContextMobileView] = useState(false);
18
28
  const [open, setOpen] = useState(true);
19
29
  const labelLength = Math.max(14, Math.min(longestLabelLength ?? 16, 40));
20
30
  const headingDepth = depth ?? 1;
21
- const applyMobileView = asFlex
22
- ? mobileView || (flexRow && flexContextMobileView) || !isSmallOrAbove
23
- : mobileView || !isSmallOrAbove;
24
- /**
25
- * Mount resize observer to update flex context mobile view & run initial check.
26
- */
31
+ const applyMobileView = inMobileView ||
32
+ !isSmallOrAbove ||
33
+ !isXsContentWidthOrAbove ||
34
+ (asFlex && flexRow && flexContextMobileView);
35
+ const chToPxConversionFactor = useChToPxConversionFactor();
36
+ // Mount resize observer to update flex context mobile view & run initial check.
27
37
  useEffect(() => {
28
38
  const checkBreakpoint = (elementWidth) => {
29
- const minWidthRem = chToRem(parseInt(sm, 10));
30
- const minWidthPx = parseInt(remToPx(minWidthRem), 10);
39
+ const minWidthPx = parseInt(smContentWidth, 10) * chToPxConversionFactor;
31
40
  const oneRemInPx = parseInt(remToPx(1), 10);
32
41
  const colGapPxAllowance = oneRemInPx * (0.5 * flexGapProp) * (columnCount - 1);
33
42
  const mobileViewBreakpoint = minWidthPx * columnCount + colGapPxAllowance;
@@ -54,12 +63,12 @@ const Details = forwardRef(({ highlightedData, children, name, columnCount = 1,
54
63
  };
55
64
  }, [applyMobileView, name, headingDepth, longestLabelLength, context]);
56
65
  const nameText = useMemo(() => {
57
- return (_jsx(Text, { variant: `h${Math.min(headingDepth, 6)}`, children: name }));
66
+ return _jsx(Text, { variant: `h${Math.min(headingDepth, 6)}`, children: name });
58
67
  }, [name, headingDepth]);
59
68
  const details = useMemo(() => {
60
- return (_jsxs(_Fragment, { children: [highlightedData && (_jsxs(_Fragment, { children: [_jsx(StyledHighlightedDetailList, { as: nested ? 'div' : 'dl', children: highlightedData.map((child, i) => (
69
+ return (_jsxs(_Fragment, { children: [highlightedData && (_jsxs(_Fragment, { children: [_jsx(Flex, { "data-testid": testIds.highlightedData, as: StyledHighlightedDetailList, forwardedAs: nested ? 'div' : 'dl', container: { wrap: 'wrap', colGap: 10, rowGap: 1, alignItems: 'start' }, children: highlightedData.map((child, i) => (
61
70
  // eslint-disable-next-line react/no-array-index-key
62
- _jsx(Fragment, { children: child }, i))) }), _jsx("hr", {})] })), _jsx(StyledDetailList, { ref: listRef, as: nested ? 'div' : 'dl', columnCount: columnCount, labelLength: labelLength, stacked: applyMobileView, hasName: !!name, nested: nested, flex: asFlex, wrapped: asFlex ? !flexRow : false, variant: valueComparison ? 'value-comparison' : undefined, children: children })] }));
71
+ _jsx(Fragment, { children: child }, i))) }), _jsx("hr", {})] })), children ? (_jsx(StyledDetailList, { "data-testid": testIds.data, ref: listRef, as: nested ? 'div' : 'dl', columnCount: columnCount, labelLength: labelLength, stacked: applyMobileView, nested: nested, flex: asFlex, wrapped: asFlex ? !flexRow : false, variant: valueComparison ? 'value-comparison' : undefined, narrow: !isMdContentWidthOrAbove, children: children })) : null] }));
63
72
  }, [
64
73
  highlightedData,
65
74
  nested,
@@ -70,11 +79,14 @@ const Details = forwardRef(({ highlightedData, children, name, columnCount = 1,
70
79
  asFlex,
71
80
  flexRow,
72
81
  valueComparison,
73
- children
82
+ children,
83
+ testIds
74
84
  ]);
75
- return (_jsx(DetailsContext.Provider, { value: contextValue, children: _jsxs(StyledDetails, { children: [name && (_jsx(StyledFieldValueGroupLabel, { children: collapsible ? (_jsx(Button, { type: 'button', variant: 'text', onClick: () => {
85
+ if (!name && !children && !highlightedData && !description)
86
+ return null;
87
+ return (_jsx(DetailsContext.Provider, { value: contextValue, children: _jsxs(StyledDetails, { "data-testid": testIds.root, children: [name && (_jsx(StyledFieldValueGroupLabel, { "data-testid": testIds.heading, children: collapsible ? (_jsx(Button, { type: 'button', variant: 'text', onClick: () => {
76
88
  setOpen(cur => !cur);
77
- }, "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] }) })) : (nameText) })), collapsible ? _jsx(ExpandCollapse, { collapsed: !open, children: details }) : details] }) }));
89
+ }, "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] }) })) : (nameText) })), description && (_jsx(StyledDetailDescription, { "data-testid": testIds.description, children: _jsx(HTML, { as: 'p', content: description }) })), collapsible ? (_jsx(ExpandCollapse, { "data-testid": testIds.expandCollapse, collapsed: !open, children: details })) : (details)] }) }));
78
90
  });
79
- export default Details;
91
+ export default withTestIds(Details, getDetailsTestIds);
80
92
  //# sourceMappingURL=Details.js.map