@pega/cosmos-react-work 3.0.0-dev.22.0 → 3.0.0-dev.23.2

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 (71) hide show
  1. package/lib/components/CasePreview/CasePreview.d.ts +2 -2
  2. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  3. package/lib/components/CasePreview/CasePreview.js +1 -1
  4. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  5. package/lib/components/CaseView/CaseHeader.d.ts +4 -0
  6. package/lib/components/CaseView/CaseHeader.d.ts.map +1 -0
  7. package/lib/components/CaseView/CaseHeader.js +49 -0
  8. package/lib/components/CaseView/CaseHeader.js.map +1 -0
  9. package/lib/components/CaseView/CaseSummary.d.ts +4 -0
  10. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -0
  11. package/lib/components/CaseView/CaseSummary.js +13 -0
  12. package/lib/components/CaseView/CaseSummary.js.map +1 -0
  13. package/lib/components/CaseView/CaseSummaryFields.d.ts +6 -0
  14. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -0
  15. package/lib/components/CaseView/CaseSummaryFields.js +8 -0
  16. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -0
  17. package/lib/components/CaseView/CaseView.context.d.ts +5 -0
  18. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -0
  19. package/lib/components/CaseView/CaseView.context.js +5 -0
  20. package/lib/components/CaseView/CaseView.context.js.map +1 -0
  21. package/lib/components/CaseView/CaseView.d.ts +2 -27
  22. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  23. package/lib/components/CaseView/CaseView.js +210 -190
  24. package/lib/components/CaseView/CaseView.js.map +1 -1
  25. package/lib/components/CaseView/CaseView.styles.d.ts +13 -17
  26. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  27. package/lib/components/CaseView/CaseView.styles.js +225 -41
  28. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  29. package/lib/components/CaseView/CaseView.types.d.ts +100 -0
  30. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -0
  31. package/lib/components/CaseView/CaseView.types.js +2 -0
  32. package/lib/components/CaseView/CaseView.types.js.map +1 -0
  33. package/lib/components/CaseView/UtilitiesSummary.d.ts +4 -6
  34. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  35. package/lib/components/CaseView/UtilitiesSummary.js +6 -2
  36. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  37. package/lib/components/CaseView/index.d.ts +5 -2
  38. package/lib/components/CaseView/index.d.ts.map +1 -1
  39. package/lib/components/CaseView/index.js +4 -1
  40. package/lib/components/CaseView/index.js.map +1 -1
  41. package/lib/components/Stages/StageGlimpse.js +1 -1
  42. package/lib/components/Stages/StageGlimpse.js.map +1 -1
  43. package/lib/index.d.ts +0 -6
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +0 -6
  46. package/lib/index.js.map +1 -1
  47. package/package.json +2 -2
  48. package/lib/components/CaseHeader/CaseHeader.d.ts +0 -33
  49. package/lib/components/CaseHeader/CaseHeader.d.ts.map +0 -1
  50. package/lib/components/CaseHeader/CaseHeader.js +0 -133
  51. package/lib/components/CaseHeader/CaseHeader.js.map +0 -1
  52. package/lib/components/CaseHeader/index.d.ts +0 -4
  53. package/lib/components/CaseHeader/index.d.ts.map +0 -1
  54. package/lib/components/CaseHeader/index.js +0 -3
  55. package/lib/components/CaseHeader/index.js.map +0 -1
  56. package/lib/components/CaseSummary/CaseSummary.d.ts +0 -36
  57. package/lib/components/CaseSummary/CaseSummary.d.ts.map +0 -1
  58. package/lib/components/CaseSummary/CaseSummary.js +0 -131
  59. package/lib/components/CaseSummary/CaseSummary.js.map +0 -1
  60. package/lib/components/CaseSummary/index.d.ts +0 -4
  61. package/lib/components/CaseSummary/index.d.ts.map +0 -1
  62. package/lib/components/CaseSummary/index.js +0 -3
  63. package/lib/components/CaseSummary/index.js.map +0 -1
  64. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts +0 -22
  65. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +0 -1
  66. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +0 -25
  67. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +0 -1
  68. package/lib/components/CaseSummaryFields/index.d.ts +0 -4
  69. package/lib/components/CaseSummaryFields/index.d.ts.map +0 -1
  70. package/lib/components/CaseSummaryFields/index.js +0 -3
  71. package/lib/components/CaseSummaryFields/index.js.map +0 -1
@@ -1,23 +1,19 @@
1
- export declare const StyledCaseViewContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
- forceMobile?: boolean | undefined;
3
- isMediumOrAbove?: boolean | undefined;
4
- persistentUtility?: boolean | undefined;
5
- }, never>;
1
+ export declare const StyledCaseSummaryFields: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledCaseHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledCaseIconWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledFollowIconWrap: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const StyledCaseHeaderText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const StyledPromotedActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const StyledCaseSummaryInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const StyledExpandCollapseButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const StyledCaseSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const StyledWorkArea: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
11
  export declare const StyledUtilToggle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
7
- export declare const StyledCaseViewUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
- utilitiesShown: boolean;
9
- }, never>;
10
- export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
11
- forceMobile?: boolean | undefined;
12
- isMediumOrAbove?: boolean | undefined;
13
- stickyOffset: number;
14
- }, never>;
15
- export declare const StyledSummaryRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
16
- forceMobile?: boolean | undefined;
17
- desktop?: boolean | undefined;
18
- }, never>;
12
+ export declare const StyledUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const StyledSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
14
  export declare const StyledCaseDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
15
  export declare const StyledCaseDrawerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
16
  export declare const StyledPersistentUtility: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
22
17
  export declare const ScrollStick: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
18
+ export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
19
  //# sourceMappingURL=CaseView.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;SAqBhC,CAAC;AAEH,eAAO,MAAM,gBAAgB,4GAM3B,CAAC;AAIH,eAAO,MAAM,uBAAuB;oBAAgC,OAAO;SAQ1E,CAAC;AAIF,eAAO,MAAM,cAAc;;;kBAGX,MAAM;SAiBpB,CAAC;AAIH,eAAO,MAAM,mBAAmB;;;SAiB9B,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAU3B,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAOlC,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGASlC,CAAC;AAIH,eAAO,MAAM,WAAW,yGAGvB,CAAC"}
1
+ {"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,uBAAuB,yGAelC,CAAC;AAIH,eAAO,MAAM,gBAAgB,4GAc3B,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAkB7B,CAAC;AAIH,eAAO,MAAM,oBAAoB,2GAShC,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAiC/B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAIhC,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAKhC,CAAC;AAIH,eAAO,MAAM,0BAA0B,qOA0BrC,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAqC5B,CAAC;AAIH,eAAO,MAAM,cAAc,yGAiBzB,CAAC;AAIH,eAAO,MAAM,gBAAgB,4GAM3B,CAAC;AAIH,eAAO,MAAM,eAAe,yGAY1B,CAAC;AAIH,eAAO,MAAM,aAAa,yGAgBxB,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAU3B,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAOlC,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAUlC,CAAC;AAIH,eAAO,MAAM,WAAW,yGAGvB,CAAC;AAEF,eAAO,MAAM,cAAc,yGAiBzB,CAAC"}
@@ -1,23 +1,200 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { defaultThemeProp } from '@pega/cosmos-react-core';
3
- export const StyledCaseViewContent = styled.div(({ theme, forceMobile, isMediumOrAbove, persistentUtility }) => {
2
+ import { hideVisually, parseToHsl, readableColor, transparentize } from 'polished';
3
+ import { Button, calculateFontSize, defaultThemeProp, StyledBreadcrumbs, StyledButton, StyledFieldValue, StyledFieldValueList, StyledIcon, StyledPopover, StyledText, StyledTooltip, tryCatch } from '@pega/cosmos-react-core';
4
+ import { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';
5
+ import { useCaseViewContext } from './CaseView.context';
6
+ export const StyledCaseSummaryFields = styled.div(({ theme }) => {
7
+ const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
4
8
  return css `
5
- grid-area: content;
6
9
  padding: calc(2 * ${theme.base.spacing});
7
10
 
8
- ${persistentUtility &&
9
- isMediumOrAbove &&
11
+ > ${StyledFieldValueList}:first-child {
12
+ grid-template-columns: 16ch auto;
13
+
14
+ ${StyledFieldValue} {
15
+ font-size: ${fontSizes[theme.components.text.h1['font-size']]};
16
+ font-weight: ${theme.components.text.h1['font-weight']};
17
+ }
18
+ }
19
+ `;
20
+ });
21
+ StyledCaseSummaryFields.defaultProps = defaultThemeProp;
22
+ export const StyledCaseHeader = styled.header(({ theme }) => {
23
+ const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));
24
+ return css `
25
+ background-color: ${theme.base.palette['brand-primary']};
26
+ color: ${color};
27
+ padding: calc(2 * ${theme.base.spacing});
28
+ position: relative;
29
+
30
+ ${StyledMenu} {
31
+ color: ${theme.base.palette['foreground-color']};
32
+ z-index: ${theme.base['z-index'].popover + 1};
33
+ }
34
+ `;
35
+ });
36
+ StyledCaseHeader.defaultProps = defaultThemeProp;
37
+ export const StyledCaseIconWrap = styled.div(({ theme }) => {
38
+ const spacing = theme.base.spacing;
39
+ const borderRadius = theme.base['border-radius'];
40
+ const backgroundColor = tryCatch(() => {
41
+ const { lightness } = parseToHsl(theme.base.palette['brand-primary']);
42
+ return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';
43
+ });
44
+ return css `
45
+ background: ${backgroundColor};
46
+ border-radius: calc(${borderRadius} / 2);
47
+ width: calc(5 * ${spacing});
48
+ height: calc(5 * ${spacing});
49
+ ${StyledIcon} {
50
+ font-size: calc(3 * ${spacing});
51
+ margin: auto;
52
+ }
53
+ `;
54
+ });
55
+ StyledCaseIconWrap.defaultProps = defaultThemeProp;
56
+ export const StyledFollowIconWrap = styled.label `
57
+ font-size: 1.25rem;
58
+ input {
59
+ ${hideVisually}
60
+ }
61
+
62
+ input:focus + svg {
63
+ box-shadow: ${({ theme }) => theme.base.shadow['focus-inverted']};
64
+ }
65
+ `;
66
+ StyledFollowIconWrap.defaultProps = defaultThemeProp;
67
+ export const StyledCaseHeaderText = styled.div(({ theme }) => {
68
+ const color = readableColor(theme.base.palette['brand-primary']);
69
+ const transparentColor = tryCatch(() => transparentize(0.2, color));
70
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
71
+ return css `
72
+ word-break: break-word;
73
+
74
+ ${StyledBreadcrumbs} {
75
+ > a,
76
+ > span,
77
+ > button,
78
+ > svg {
79
+ color: ${transparentColor};
80
+ font-size: ${fontSize.s};
81
+ font-weight: normal;
82
+ }
83
+
84
+ > a,
85
+ > button {
86
+ &:focus {
87
+ box-shadow: ${theme.base.shadow['focus-inverted']};
88
+ }
89
+ }
90
+
91
+ ${StyledPopover}:not(${StyledTooltip}) {
92
+ color: ${theme.base.palette['foreground-color']};
93
+ }
94
+ }
95
+
96
+ > ${StyledText} > ${StyledButton} {
97
+ color: ${color};
98
+ }
99
+ `;
100
+ });
101
+ StyledCaseHeaderText.defaultProps = defaultThemeProp;
102
+ export const StyledPromotedActions = styled.div(({ theme }) => {
103
+ return css `
104
+ border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
105
+ `;
106
+ });
107
+ StyledPromotedActions.defaultProps = defaultThemeProp;
108
+ export const StyledCaseSummaryInfo = styled.div(() => {
109
+ return css `
110
+ overflow: auto;
111
+ flex: 1;
112
+ `;
113
+ });
114
+ StyledCaseSummaryInfo.defaultProps = defaultThemeProp;
115
+ export const StyledExpandCollapseButton = styled(Button)(({ theme }) => {
116
+ const { summaryExpanded } = useCaseViewContext();
117
+ return css `
118
+ position: absolute;
119
+ z-index: 1;
120
+ bottom: 0;
121
+ inset-inline-start: ${summaryExpanded ? 'calc(100% - 0.75rem)' : '0'};
122
+ border-radius: ${summaryExpanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};
123
+ box-shadow: ${theme.base.shadow.low};
124
+ border: none;
125
+ opacity: 0;
126
+
127
+ /* Disbales core Button transition causing button to slide on toggle. */
128
+ transition: none;
129
+
130
+ &:focus {
131
+ opacity: 1;
132
+ }
133
+
134
+ ${StyledIcon} {
135
+ width: 1.5rem;
136
+ height: 1.5rem;
137
+ transform: rotate(${summaryExpanded ? 0 : css `180deg`});
138
+ }
139
+ `;
140
+ });
141
+ StyledExpandCollapseButton.defaultProps = defaultThemeProp;
142
+ export const StyledCaseSummary = styled.div(() => {
143
+ const { summaryExpanded, aboveMD, aboveLG } = useCaseViewContext();
144
+ return css `
145
+ position: relative;
146
+ height: 100%;
147
+
148
+ ${aboveMD &&
10
149
  css `
11
- margin-inline-start: calc(2 * ${theme.base.spacing});
150
+ ${summaryExpanded
151
+ ? css `
152
+ width: ${aboveLG ? css `25rem` : css `22rem`};
153
+
154
+ &:focus-within,
155
+ &:hover {
156
+ &::after {
157
+ content: '';
158
+ position: absolute;
159
+ top: 0;
160
+ bottom: 0;
161
+ inset-inline-start: 100%;
162
+ width: 0.75rem;
163
+ }
164
+
165
+ ${StyledExpandCollapseButton} {
166
+ opacity: 1;
167
+ }
168
+ }
169
+ `
170
+ : css `
171
+ width: 100%;
172
+ ${StyledExpandCollapseButton} {
173
+ opacity: 1;
174
+ }
175
+ `}
12
176
  `}
177
+ `;
178
+ });
179
+ StyledCaseSummary.defaultProps = defaultThemeProp;
180
+ export const StyledWorkArea = styled.div(({ theme }) => {
181
+ const { summaryExpanded, aboveMD } = useCaseViewContext();
182
+ return css `
183
+ grid-area: work-area;
184
+ padding: calc(2 * ${theme.base.spacing});
13
185
 
14
- ${!forceMobile &&
15
- isMediumOrAbove &&
186
+ ${aboveMD &&
16
187
  css `
17
188
  padding: calc(2 * ${theme.base.spacing}) 0;
189
+
190
+ ${!summaryExpanded &&
191
+ css `
192
+ margin-inline-start: calc(2 * ${theme.base.spacing});
193
+ `}
18
194
  `}
19
195
  `;
20
196
  });
197
+ StyledWorkArea.defaultProps = defaultThemeProp;
21
198
  export const StyledUtilToggle = styled.button(({ theme }) => {
22
199
  return css `
23
200
  align-self: flex-end;
@@ -26,56 +203,44 @@ export const StyledUtilToggle = styled.button(({ theme }) => {
26
203
  `;
27
204
  });
28
205
  StyledUtilToggle.defaultProps = defaultThemeProp;
29
- export const StyledCaseViewUtilities = styled.div(({ utilitiesShown, theme }) => {
30
- return css `
31
- width: ${utilitiesShown ? '25rem' : 'auto'};
32
- height: max-content;
33
- padding: calc(2 * ${theme.base.spacing}) 0 calc(2 * ${theme.base.spacing});
34
- `;
35
- });
36
- StyledCaseViewUtilities.defaultProps = defaultThemeProp;
37
- export const StyledCaseView = styled.div(({ theme, forceMobile, isMediumOrAbove, stickyOffset }) => {
206
+ export const StyledUtilities = styled.div(() => {
207
+ const { utilitiesExpanded, aboveLG } = useCaseViewContext();
38
208
  return css `
39
- --case-view-header-offset: ${stickyOffset}px;
40
- --case-view-content-height: calc(100vh - var(--case-view-header-offset, 0rem));
41
- min-height: calc(100vh - var(--appshell-offset, 0rem));
42
- position: relative;
43
- background-color: ${theme.base.palette['app-background']};
209
+ height: max-content;
44
210
 
45
- > :last-child {
46
- ${!forceMobile &&
47
- isMediumOrAbove &&
211
+ ${aboveLG &&
212
+ utilitiesExpanded &&
48
213
  css `
49
- margin-inline-end: calc(2 * ${theme.base.spacing});
50
- `}
51
- }
214
+ width: 25rem;
215
+ `}
52
216
  `;
53
217
  });
54
- StyledCaseView.defaultProps = defaultThemeProp;
55
- export const StyledSummaryRegion = styled.div(({ theme, forceMobile, desktop }) => {
218
+ StyledUtilities.defaultProps = defaultThemeProp;
219
+ export const StyledSummary = styled.div(({ theme }) => {
220
+ const { summaryExpanded, aboveMD } = useCaseViewContext();
56
221
  return css `
57
222
  position: sticky;
58
- top: var(--appshell-offset, 0);
223
+ top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset)'};
59
224
  width: 100%;
60
225
  background-color: ${theme.base.palette['primary-background']};
61
226
  z-index: ${theme.base['z-index'].popover};
62
227
 
63
- ${!forceMobile &&
64
- desktop &&
228
+ ${aboveMD &&
229
+ summaryExpanded &&
65
230
  css `
66
- height: var(--case-view-content-height);
231
+ height: var(--case-view-height);
67
232
  `}
68
233
  `;
69
234
  });
70
- StyledSummaryRegion.defaultProps = defaultThemeProp;
235
+ StyledSummary.defaultProps = defaultThemeProp;
71
236
  export const StyledCaseDrawer = styled.div(({ theme }) => {
72
237
  return css `
73
238
  min-width: 21.875rem;
74
239
  max-width: 31.25rem;
75
240
  width: calc((100vw - 31.25rem) / 10 + 21.875rem);
76
241
  background-color: ${theme.base.palette['primary-background']};
77
- height: var(--case-view-content-height);
78
- top: var(--case-view-header-offset);
242
+ height: var(--case-view-height);
243
+ top: var(--top-offset);
79
244
  z-index: ${theme.base['z-index'].drawer - 1};
80
245
  `;
81
246
  });
@@ -89,14 +254,15 @@ export const StyledCaseDrawerContent = styled.div(({ theme }) => {
89
254
  `;
90
255
  });
91
256
  StyledCaseDrawerContent.defaultProps = defaultThemeProp;
92
- export const StyledPersistentUtility = styled.div(() => {
257
+ export const StyledPersistentUtility = styled.div(({ theme }) => {
93
258
  return css `
94
- max-width: 60ch;
259
+ min-width: ${theme.base['content-width'].sm};
260
+ max-width: ${theme.base['content-width'].md};
95
261
  overflow: auto;
96
262
  position: sticky;
97
263
  z-index: 1;
98
- height: var(--case-view-content-height);
99
- top: var(--case-view-header-offset);
264
+ height: var(--case-view-height);
265
+ top: var(--top-offset);
100
266
  `;
101
267
  });
102
268
  StyledPersistentUtility.defaultProps = defaultThemeProp;
@@ -104,4 +270,22 @@ export const ScrollStick = styled.div `
104
270
  position: sticky;
105
271
  top: 0;
106
272
  `;
273
+ export const StyledCaseView = styled.div(({ theme }) => {
274
+ const { aboveMD } = useCaseViewContext();
275
+ return css `
276
+ --top-offset: calc(var(--appshell-offset, 0) + var(--summary-height));
277
+ --case-view-height: calc(100vh - var(--top-offset));
278
+ position: relative;
279
+ min-height: var(--case-view-height);
280
+ background-color: ${theme.base.palette['app-background']};
281
+
282
+ ${aboveMD &&
283
+ css `
284
+ ${StyledUtilities}:last-child {
285
+ margin-inline-end: calc(2 * ${theme.base.spacing});
286
+ }
287
+ `}
288
+ `;
289
+ });
290
+ StyledCaseView.defaultProps = defaultThemeProp;
107
291
  //# sourceMappingURL=CaseView.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAI5C,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,EAAE,EAAE;IAChE,OAAO,GAAG,CAAA;;wBAEY,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEpC,iBAAiB;QACnB,eAAe;QACf,GAAG,CAAA;sCAC+B,KAAK,CAAC,IAAI,CAAC,OAAO;KACnD;;MAEC,CAAC,WAAW;QACd,eAAe;QACf,GAAG,CAAA;0BACmB,KAAK,CAAC,IAAI,CAAC,OAAO;KACvC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1D,OAAO,GAAG,CAAA;;aAEC,KAAK,CAAC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AAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvD,OAAO,GAAG,CAAA;;;;wBAIY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;eAGjD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;GAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;wBACpC,KAAK,CAAC,IAAI,CAAC,OAAO;;;GAGvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IACrD,OAAO,GAAG,CAAA;;;;;;;GAOT,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGpC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledCaseViewContent = styled.div<{\n forceMobile?: boolean;\n isMediumOrAbove?: boolean;\n persistentUtility?: boolean;\n}>(({ theme, forceMobile, isMediumOrAbove, persistentUtility }) => {\n return css`\n grid-area: content;\n padding: calc(2 * ${theme.base.spacing});\n\n ${persistentUtility &&\n isMediumOrAbove &&\n css`\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `}\n\n ${!forceMobile &&\n isMediumOrAbove &&\n css`\n padding: calc(2 * ${theme.base.spacing}) 0;\n `}\n `;\n});\n\nexport const StyledUtilToggle = styled.button(({ theme }) => {\n return css`\n align-self: flex-end;\n color: ${theme.base.palette['foreground-color']};\n margin-inline-end: 0.375rem;\n `;\n});\n\nStyledUtilToggle.defaultProps = defaultThemeProp;\n\nexport const StyledCaseViewUtilities = styled.div<{ utilitiesShown: boolean }>(\n ({ utilitiesShown, theme }) => {\n return css`\n width: ${utilitiesShown ? '25rem' : 'auto'};\n height: max-content;\n padding: calc(2 * ${theme.base.spacing}) 0 calc(2 * ${theme.base.spacing});\n `;\n }\n);\n\nStyledCaseViewUtilities.defaultProps = defaultThemeProp;\n\nexport const StyledCaseView = styled.div<{\n forceMobile?: boolean;\n isMediumOrAbove?: boolean;\n stickyOffset: number;\n}>(({ theme, forceMobile, isMediumOrAbove, stickyOffset }) => {\n return css`\n --case-view-header-offset: ${stickyOffset}px;\n --case-view-content-height: calc(100vh - var(--case-view-header-offset, 0rem));\n min-height: calc(100vh - var(--appshell-offset, 0rem));\n position: relative;\n background-color: ${theme.base.palette['app-background']};\n\n > :last-child {\n ${!forceMobile &&\n isMediumOrAbove &&\n css`\n margin-inline-end: calc(2 * ${theme.base.spacing});\n `}\n }\n `;\n});\n\nStyledCaseView.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryRegion = styled.div<{\n forceMobile?: boolean;\n desktop?: boolean;\n}>(({ theme, forceMobile, desktop }) => {\n return css`\n position: sticky;\n top: var(--appshell-offset, 0);\n width: 100%;\n background-color: ${theme.base.palette['primary-background']};\n z-index: ${theme.base['z-index'].popover};\n\n ${!forceMobile &&\n desktop &&\n css`\n height: var(--case-view-content-height);\n `}\n `;\n});\n\nStyledSummaryRegion.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div(({ theme }) => {\n return css`\n min-width: 21.875rem;\n max-width: 31.25rem;\n width: calc((100vw - 31.25rem) / 10 + 21.875rem);\n background-color: ${theme.base.palette['primary-background']};\n height: var(--case-view-content-height);\n top: var(--case-view-header-offset);\n z-index: ${theme.base['z-index'].drawer - 1};\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\n padding: calc(2 * ${theme.base.spacing});\n height: 100%;\n overflow: auto;\n `;\n});\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div(() => {\n return css`\n max-width: 60ch;\n overflow: auto;\n position: sticky;\n z-index: 1;\n height: var(--case-view-content-height);\n top: var(--case-view-header-offset);\n `;\n});\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n"]}
1
+ {"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEnF,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,UAAU,EACV,aAAa,EACb,QAAQ,EAET,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,MAAM,SAAS,GAAG,iBAAiB,CAAC,K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BAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;wBACpC,KAAK,CAAC,IAAI,CAAC,OAAO;;;GAGvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;iBACK,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;iBAC9B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;;;;;GAM5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGpC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,MAAM,EAAE,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAEzC,OAAO,GAAG,CAAA;;;;;wBAKY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;;MAEtD,OAAO;QACT,GAAG,CAAA;QACC,eAAe;sCACe,KAAK,CAAC,IAAI,CAAC,OAAO;;KAEnD;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually, parseToHsl, readableColor, transparentize } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n StyledBreadcrumbs,\n StyledButton,\n StyledFieldValue,\n StyledFieldValueList,\n StyledIcon,\n StyledPopover,\n StyledText,\n StyledTooltip,\n tryCatch,\n FontSize\n} from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\n\nimport { useCaseViewContext } from './CaseView.context';\n\nexport const StyledCaseSummaryFields = styled.div(({ theme }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n padding: calc(2 * ${theme.base.spacing});\n\n > ${StyledFieldValueList}:first-child {\n grid-template-columns: 16ch auto;\n\n ${StyledFieldValue} {\n font-size: ${fontSizes[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n }\n `;\n});\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeader = styled.header(({ theme }) => {\n const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));\n\n return css`\n background-color: ${theme.base.palette['brand-primary']};\n color: ${color};\n padding: calc(2 * ${theme.base.spacing});\n position: relative;\n\n ${StyledMenu} {\n color: ${theme.base.palette['foreground-color']};\n z-index: ${theme.base['z-index'].popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseIconWrap = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n const borderRadius = theme.base['border-radius'];\n const backgroundColor = tryCatch(() => {\n const { lightness } = parseToHsl(theme.base.palette['brand-primary']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n });\n\n return css`\n background: ${backgroundColor};\n border-radius: calc(${borderRadius} / 2);\n width: calc(5 * ${spacing});\n height: calc(5 * ${spacing});\n ${StyledIcon} {\n font-size: calc(3 * ${spacing});\n margin: auto;\n }\n `;\n});\n\nStyledCaseIconWrap.defaultProps = defaultThemeProp;\n\nexport const StyledFollowIconWrap = styled.label`\n font-size: 1.25rem;\n input {\n ${hideVisually}\n }\n\n input:focus + svg {\n box-shadow: ${({ theme }) => theme.base.shadow['focus-inverted']};\n }\n`;\n\nStyledFollowIconWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderText = styled.div(({ theme }) => {\n const color = readableColor(theme.base.palette['brand-primary']);\n const transparentColor = tryCatch(() => transparentize(0.2, color));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n word-break: break-word;\n\n ${StyledBreadcrumbs} {\n > a,\n > span,\n > button,\n > svg {\n color: ${transparentColor};\n font-size: ${fontSize.s};\n font-weight: normal;\n }\n\n > a,\n > button {\n &:focus {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n }\n\n ${StyledPopover}:not(${StyledTooltip}) {\n color: ${theme.base.palette['foreground-color']};\n }\n }\n\n > ${StyledText} > ${StyledButton} {\n color: ${color};\n }\n `;\n});\n\nStyledCaseHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledPromotedActions = styled.div(({ theme }) => {\n return css`\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n `;\n});\n\nStyledPromotedActions.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryInfo = styled.div(() => {\n return css`\n overflow: auto;\n flex: 1;\n `;\n});\n\nStyledCaseSummaryInfo.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseButton = styled(Button)(({ theme }) => {\n const { summaryExpanded } = useCaseViewContext();\n\n return css`\n position: absolute;\n z-index: 1;\n bottom: 0;\n inset-inline-start: ${summaryExpanded ? 'calc(100% - 0.75rem)' : '0'};\n border-radius: ${summaryExpanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};\n box-shadow: ${theme.base.shadow.low};\n border: none;\n opacity: 0;\n\n /* Disbales core Button transition causing button to slide on toggle. */\n transition: none;\n\n &:focus {\n opacity: 1;\n }\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n transform: rotate(${summaryExpanded ? 0 : css`180deg`});\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummary = styled.div(() => {\n const { summaryExpanded, aboveMD, aboveLG } = useCaseViewContext();\n\n return css`\n position: relative;\n height: 100%;\n\n ${aboveMD &&\n css`\n ${summaryExpanded\n ? css`\n width: ${aboveLG ? css`25rem` : css`22rem`};\n\n &:focus-within,\n &:hover {\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n inset-inline-start: 100%;\n width: 0.75rem;\n }\n\n ${StyledExpandCollapseButton} {\n opacity: 1;\n }\n }\n `\n : css`\n width: 100%;\n ${StyledExpandCollapseButton} {\n opacity: 1;\n }\n `}\n `}\n `;\n});\n\nStyledCaseSummary.defaultProps = defaultThemeProp;\n\nexport const StyledWorkArea = styled.div(({ theme }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n grid-area: work-area;\n padding: calc(2 * ${theme.base.spacing});\n\n ${aboveMD &&\n css`\n padding: calc(2 * ${theme.base.spacing}) 0;\n\n ${!summaryExpanded &&\n css`\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `}\n `}\n `;\n});\n\nStyledWorkArea.defaultProps = defaultThemeProp;\n\nexport const StyledUtilToggle = styled.button(({ theme }) => {\n return css`\n align-self: flex-end;\n color: ${theme.base.palette['foreground-color']};\n margin-inline-end: 0.375rem;\n `;\n});\n\nStyledUtilToggle.defaultProps = defaultThemeProp;\n\nexport const StyledUtilities = styled.div(() => {\n const { utilitiesExpanded, aboveLG } = useCaseViewContext();\n\n return css`\n height: max-content;\n\n ${aboveLG &&\n utilitiesExpanded &&\n css`\n width: 25rem;\n `}\n `;\n});\n\nStyledUtilities.defaultProps = defaultThemeProp;\n\nexport const StyledSummary = styled.div(({ theme }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n position: sticky;\n top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset)'};\n width: 100%;\n background-color: ${theme.base.palette['primary-background']};\n z-index: ${theme.base['z-index'].popover};\n\n ${aboveMD &&\n summaryExpanded &&\n css`\n height: var(--case-view-height);\n `}\n `;\n});\n\nStyledSummary.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div(({ theme }) => {\n return css`\n min-width: 21.875rem;\n max-width: 31.25rem;\n width: calc((100vw - 31.25rem) / 10 + 21.875rem);\n background-color: ${theme.base.palette['primary-background']};\n height: var(--case-view-height);\n top: var(--top-offset);\n z-index: ${theme.base['z-index'].drawer - 1};\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\n padding: calc(2 * ${theme.base.spacing});\n height: 100%;\n overflow: auto;\n `;\n});\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div(({ theme }) => {\n return css`\n min-width: ${theme.base['content-width'].sm};\n max-width: ${theme.base['content-width'].md};\n overflow: auto;\n position: sticky;\n z-index: 1;\n height: var(--case-view-height);\n top: var(--top-offset);\n `;\n});\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n\nexport const StyledCaseView = styled.div(({ theme }) => {\n const { aboveMD } = useCaseViewContext();\n\n return css`\n --top-offset: calc(var(--appshell-offset, 0) + var(--summary-height));\n --case-view-height: calc(100vh - var(--top-offset));\n position: relative;\n min-height: var(--case-view-height);\n background-color: ${theme.base.palette['app-background']};\n\n ${aboveMD &&\n css`\n ${StyledUtilities}:last-child {\n margin-inline-end: calc(2 * ${theme.base.spacing});\n }\n `}\n `;\n});\n\nStyledCaseView.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,100 @@
1
+ import { ReactElement, ReactNode, MouseEvent } from 'react';
2
+ import { Tab, NoChildrenProp, ForwardProps, MenuItemProps, Action, BaseProps } from '@pega/cosmos-react-core';
3
+ export interface CaseViewProps extends NoChildrenProp, BaseProps {
4
+ /** A Case ID to display in the heading. */
5
+ caseId: string;
6
+ /** A text region for the title of the CaseView. */
7
+ heading: string;
8
+ /** A set of props including an href that will be forwarded to the case heading and caseId. */
9
+ caseLink?: {
10
+ href: string;
11
+ } & ForwardProps;
12
+ /** A set of Link props representing the case parents, rendered as Breadcrumbs. */
13
+ parentCases?: MenuItemProps[];
14
+ /** An icon to serve as a visual for the CaseView. */
15
+ icon?: ReactElement;
16
+ /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */
17
+ followed?: boolean;
18
+ /** Called when user chooses to follow or unfollow the case. Use this to update followed. */
19
+ onFollowedChange?: (following: boolean) => void;
20
+ /** Case level actions available in an action menu. */
21
+ actions?: Action[];
22
+ /** Visually promoted case level actions available outside the menu. */
23
+ promotedActions?: Action[];
24
+ /** A callback for when the edit button is clicked */
25
+ onEdit?: () => void;
26
+ /** A region to display any summary information about the CaseView. */
27
+ summary: ReactNode;
28
+ /**
29
+ * Determines the layout state of the summary region.
30
+ * @default true
31
+ */
32
+ summaryExpanded?: boolean;
33
+ /**
34
+ * Callback to toggle the case summary's layout.
35
+ */
36
+ onToggleSummary?: () => void;
37
+ /** An object handling the rendering and functionality of the Tabs in CaseSummary. */
38
+ tabs: {
39
+ items: Tab[];
40
+ onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
41
+ currentTabId: string;
42
+ };
43
+ /** A region within the center column that is controlled by tabs in CaseSummary. */
44
+ tabContent?: {
45
+ content: ReactNode;
46
+ id: string;
47
+ }[];
48
+ /** A region to hold a Stages component. */
49
+ stages?: ReactNode;
50
+ /** A region to hold a Tasks component. */
51
+ tasks?: ReactNode;
52
+ /** A region above the center column to display banners. */
53
+ banners?: ReactNode;
54
+ /** A region to the right reserved for persistent utilities. */
55
+ persistentUtility?: {
56
+ content: ReactNode;
57
+ title: string;
58
+ };
59
+ /** A region for case widgets. */
60
+ utilities?: ReactNode;
61
+ /** An indicator of case widgets when the utilities are collapsed. */
62
+ utilitiesSummaryItems?: {
63
+ iconName: string;
64
+ count?: number;
65
+ }[];
66
+ /**
67
+ * Determines the layout state of the utilities.
68
+ * @default true
69
+ */
70
+ utilitiesExpanded?: boolean;
71
+ /**
72
+ * Callback to toggle the utilities.
73
+ */
74
+ onToggleUtilities?: () => void;
75
+ /**
76
+ * Indicates CaseView is rendered within a CasePreview.
77
+ */
78
+ isPreview?: boolean;
79
+ }
80
+ export interface CaseSummaryFieldsProps {
81
+ /** The primary summary fields to display above secondary fields. */
82
+ primaryFields: {
83
+ id?: string;
84
+ name: string;
85
+ value: ReactNode;
86
+ }[];
87
+ /** The secondary summary fields to display below primary fields. */
88
+ secondaryFields: {
89
+ id?: string;
90
+ name: string;
91
+ value: ReactNode;
92
+ }[];
93
+ }
94
+ export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'caseLink' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summary' | 'tabs' | 'isPreview' | 'summaryExpanded' | 'onToggleSummary' | 'utilitiesExpanded' | 'persistentUtility'> {
95
+ summaryId: string;
96
+ aboveMD: boolean;
97
+ aboveLG: boolean;
98
+ aboveXL: boolean;
99
+ }
100
+ //# sourceMappingURL=CaseView.types.d.ts.map
@@ -0,0 +1 @@
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,YAAY,EACZ,aAAa,EACb,MAAM,EACN,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS;IAC9D,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,QA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AE,MAAM,CAAA;KAAE,CAAC;IAE1D,iCAAiC;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,qEAAqE;IACrE,qBAAqB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,aAAa,EAAE;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,CAAC;KAClB,EAAE,CAAC;IACJ,oEAAoE;IACpE,eAAe,EAAE;QACf,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,CAAC;KAClB,EAAE,CAAC;CACL;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CACV,aAAa,EACX,QAAQ,GACR,SAAS,GACT,UAAU,GACV,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,SAAS,GACT,MAAM,GACN,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,CACtB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CaseView.types.js.map
@@ -0,0 +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 ForwardProps,\n MenuItemProps,\n Action,\n BaseProps\n} from '@pega/cosmos-react-core';\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps {\n /** A Case ID to display in the heading. */\n caseId: string;\n /** A text region for the title of the CaseView. */\n heading: string;\n /** A set of props including an href that will be forwarded to the case heading and caseId. */\n caseLink?: { href: string } & ForwardProps;\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n /** Case level actions available in an action menu. */\n actions?: Action[];\n /** Visually promoted case level actions available outside the menu. */\n promotedActions?: Action[];\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n\n /** A region to display any summary information about the CaseView. */\n summary: ReactNode;\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 */\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 /** 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 /** A region to hold a Tasks component. */\n tasks?: ReactNode;\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n /** A region to the right reserved for persistent utilities. */\n persistentUtility?: { content: ReactNode; title: string };\n\n /** A region for case widgets. */\n utilities?: ReactNode;\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 * Callback to toggle the utilities.\n */\n onToggleUtilities?: () => void;\n /**\n * Indicates CaseView is rendered within a CasePreview.\n */\n isPreview?: boolean;\n}\n\nexport interface CaseSummaryFieldsProps {\n /** The primary summary fields to display above secondary fields. */\n primaryFields: {\n id?: string;\n name: string;\n value: ReactNode;\n }[];\n /** The secondary summary fields to display below primary fields. */\n secondaryFields: {\n id?: string;\n name: string;\n value: ReactNode;\n }[];\n}\n\nexport interface CaseViewContextValue\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'summary'\n | 'tabs'\n | 'isPreview'\n | 'summaryExpanded'\n | 'onToggleSummary'\n | 'utilitiesExpanded'\n | 'persistentUtility'\n > {\n summaryId: string;\n aboveMD: boolean;\n aboveLG: boolean;\n aboveXL: boolean;\n}\n"]}
@@ -1,12 +1,10 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
2
+ import { CaseViewProps } from './CaseView.types';
3
3
  export interface UtilitiesSummaryProps {
4
- items: {
5
- iconName: string;
6
- count?: number;
7
- }[];
4
+ items?: CaseViewProps['utilitiesSummaryItems'];
5
+ onClick?: () => void;
8
6
  }
9
7
  export declare const StyledUtilitiesSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
- declare const UtilitiesSummary: FunctionComponent<UtilitiesSummaryProps & ForwardProps>;
8
+ declare const UtilitiesSummary: FunctionComponent<UtilitiesSummaryProps>;
11
9
  export default UtilitiesSummary;
12
10
  //# sourceMappingURL=UtilitiesSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/UtilitiesSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAA2B,YAAY,EAAW,MAAM,yBAAyB,CAAC;AAEzF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C;AAED,eAAO,MAAM,sBAAsB,yGAKjC,CAAC;AAEH,QAAA,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,GAAG,YAAY,CAiC7E,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,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"}
@@ -5,11 +5,15 @@ 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;
8
9
  `;
9
10
  });
10
- const UtilitiesSummary = ({ items = [], ...restProps }) => {
11
+ const UtilitiesSummary = ({ items = [], onClick }) => {
11
12
  const t = useI18n();
12
- return items.length ? (_jsx(Card, { ...restProps, interactive: true, tabIndex: 0, role: 'button', container: { direction: 'column', alignItems: 'center', gap: 3 }, "aria-label": `${t('utilities_summary')}. ${t('expand_utilities_panel')}`, as: StyledUtilitiesSummary, children: items.map(item => {
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 => {
13
17
  return (_jsxs(Flex, { container: {
14
18
  direction: 'column',
15
19
  alignItems: 'center',
@@ -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,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAMzF,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,GAA4D,CAAC,EACjF,KAAK,GAAG,EAAE,EACV,GAAG,SAAS,EACU,EAAE,EAAE;IAC1B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACpB,KAAC,IAAI,OACC,SAAS,EACb,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,YAEzB,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,IAAC,OAAO,EAAC,SAAS,YAAE,IAAI,CAAC,KAAK,GAAS,KAHrE,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 } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Card, Count, Flex, Icon, ForwardProps, useI18n } from '@pega/cosmos-react-core';\n\nexport interface UtilitiesSummaryProps {\n items: { iconName: string; count?: number }[];\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 & ForwardProps> = ({\n items = [],\n ...restProps\n}: UtilitiesSummaryProps) => {\n const t = useI18n();\n return items.length ? (\n <Card\n {...restProps}\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 >\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 variant='default'>{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,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,IAAC,OAAO,EAAC,SAAS,YAAE,IAAI,CAAC,KAAK,GAAS,KAHrE,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 variant='default'>{item.count}</Count>}\n </Flex>\n );\n })}\n </Card>\n ) : null;\n};\n\nexport default UtilitiesSummary;\n"]}
@@ -1,6 +1,9 @@
1
1
  export { default } from './CaseView';
2
- export { CaseViewProps } from './CaseView';
3
- export { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummaryRegion } from './CaseView.styles';
2
+ export { CaseViewProps } from './CaseView.types';
3
+ export { StyledCaseView, StyledWorkArea as StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummary as StyledSummaryRegion } from './CaseView.styles';
4
4
  export { default as MobileCaseView } from './MobileCaseView';
5
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';
6
9
  //# 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,YAAY,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,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,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,4 +1,7 @@
1
1
  export { default } from './CaseView';
2
- export { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummaryRegion } from './CaseView.styles';
2
+ export { StyledCaseView, StyledWorkArea as StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummary as StyledSummaryRegion } from './CaseView.styles';
3
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';
4
7
  //# sourceMappingURL=index.js.map