@pega/cosmos-react-work 3.0.0-dev.9.1 → 3.0.0-rc.10

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 (171) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +4 -0
  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/CasePreview/CasePreview.d.ts +2 -2
  6. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  7. package/lib/components/CasePreview/CasePreview.js +2 -2
  8. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  9. package/lib/components/CaseView/CaseHeader.d.ts +4 -0
  10. package/lib/components/CaseView/CaseHeader.d.ts.map +1 -0
  11. package/lib/components/CaseView/CaseHeader.js +49 -0
  12. package/lib/components/CaseView/CaseHeader.js.map +1 -0
  13. package/lib/components/CaseView/CaseSummary.d.ts +4 -0
  14. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -0
  15. package/lib/components/CaseView/CaseSummary.js +13 -0
  16. package/lib/components/CaseView/CaseSummary.js.map +1 -0
  17. package/lib/components/CaseView/CaseSummaryFields.d.ts +6 -0
  18. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -0
  19. package/lib/components/CaseView/CaseSummaryFields.js +8 -0
  20. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -0
  21. package/lib/components/CaseView/CaseView.context.d.ts +5 -0
  22. package/lib/components/CaseView/CaseView.context.d.ts.map +1 -0
  23. package/lib/components/CaseView/CaseView.context.js +5 -0
  24. package/lib/components/CaseView/CaseView.context.js.map +1 -0
  25. package/lib/components/CaseView/CaseView.d.ts +2 -27
  26. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  27. package/lib/components/CaseView/CaseView.js +220 -191
  28. package/lib/components/CaseView/CaseView.js.map +1 -1
  29. package/lib/components/CaseView/CaseView.styles.d.ts +14 -17
  30. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  31. package/lib/components/CaseView/CaseView.styles.js +249 -41
  32. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  33. package/lib/components/CaseView/CaseView.types.d.ts +103 -0
  34. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -0
  35. package/lib/components/CaseView/CaseView.types.js +2 -0
  36. package/lib/components/CaseView/CaseView.types.js.map +1 -0
  37. package/lib/components/CaseView/UtilitiesSummary.d.ts +4 -6
  38. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  39. package/lib/components/CaseView/UtilitiesSummary.js +6 -2
  40. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  41. package/lib/components/CaseView/index.d.ts +5 -2
  42. package/lib/components/CaseView/index.d.ts.map +1 -1
  43. package/lib/components/CaseView/index.js +4 -1
  44. package/lib/components/CaseView/index.js.map +1 -1
  45. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  46. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +9 -16
  47. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  48. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +1 -1
  49. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -1
  50. package/lib/components/Confirmation/Confirmation.d.ts +2 -2
  51. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  52. package/lib/components/Confirmation/Confirmation.js +1 -1
  53. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  54. package/lib/components/Details/Details.d.ts +31 -10
  55. package/lib/components/Details/Details.d.ts.map +1 -1
  56. package/lib/components/Details/Details.js +77 -35
  57. package/lib/components/Details/Details.js.map +1 -1
  58. package/lib/components/Details/Details.styles.d.ts +47 -0
  59. package/lib/components/Details/Details.styles.d.ts.map +1 -0
  60. package/lib/components/Details/Details.styles.js +243 -0
  61. package/lib/components/Details/Details.styles.js.map +1 -0
  62. package/lib/components/Details/DetailsContext.d.ts +9 -0
  63. package/lib/components/Details/DetailsContext.d.ts.map +1 -0
  64. package/lib/components/Details/DetailsContext.js +9 -0
  65. package/lib/components/Details/DetailsContext.js.map +1 -0
  66. package/lib/components/Details/index.d.ts +2 -2
  67. package/lib/components/Details/index.d.ts.map +1 -1
  68. package/lib/components/Details/index.js +2 -1
  69. package/lib/components/Details/index.js.map +1 -1
  70. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
  71. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
  72. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +87 -0
  73. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
  74. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +8 -0
  75. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
  76. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +143 -0
  77. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
  78. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +31 -0
  79. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
  80. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
  81. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
  82. package/lib/components/IntelligentGuidance/index.d.ts +3 -0
  83. package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
  84. package/lib/components/IntelligentGuidance/index.js +2 -0
  85. package/lib/components/IntelligentGuidance/index.js.map +1 -0
  86. package/lib/components/SearchResults/SearchResult.d.ts +1 -1
  87. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  88. package/lib/components/SearchResults/SearchResult.js +9 -3
  89. package/lib/components/SearchResults/SearchResult.js.map +1 -1
  90. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  91. package/lib/components/SearchResults/SearchResults.js +56 -37
  92. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  93. package/lib/components/SearchResults/SearchResults.styles.d.ts +3 -0
  94. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  95. package/lib/components/SearchResults/SearchResults.styles.js +38 -17
  96. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -1
  97. package/lib/components/SearchResults/SearchResults.types.d.ts +4 -0
  98. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  99. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  100. package/lib/components/Stages/StageGlimpse.d.ts +10 -0
  101. package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
  102. package/lib/components/Stages/StageGlimpse.js +11 -0
  103. package/lib/components/Stages/StageGlimpse.js.map +1 -0
  104. package/lib/components/Stages/Stages.d.ts +1 -1
  105. package/lib/components/Stages/Stages.d.ts.map +1 -1
  106. package/lib/components/Stages/Stages.js +105 -112
  107. package/lib/components/Stages/Stages.js.map +1 -1
  108. package/lib/components/Stages/Stages.styles.d.ts +5 -7
  109. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  110. package/lib/components/Stages/Stages.styles.js +170 -189
  111. package/lib/components/Stages/Stages.styles.js.map +1 -1
  112. package/lib/components/Stages/Stages.types.d.ts +19 -4
  113. package/lib/components/Stages/Stages.types.d.ts.map +1 -1
  114. package/lib/components/Stages/Stages.types.js.map +1 -1
  115. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  116. package/lib/components/Stakeholders/Stakeholders.js +10 -4
  117. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  118. package/lib/components/Tags/Tags.d.ts.map +1 -1
  119. package/lib/components/Tags/Tags.js +23 -9
  120. package/lib/components/Tags/Tags.js.map +1 -1
  121. package/lib/components/Tasks/TaskList.d.ts +8 -5
  122. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  123. package/lib/components/Tasks/TaskList.js +12 -4
  124. package/lib/components/Tasks/TaskList.js.map +1 -1
  125. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  126. package/lib/components/Tasks/Tasks.js +2 -1
  127. package/lib/components/Tasks/Tasks.js.map +1 -1
  128. package/lib/components/Timeline/Timeline.styles.d.ts +1 -1
  129. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  130. package/lib/components/Timeline/Timeline.styles.js +1 -0
  131. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  132. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  133. package/lib/components/Timeline/TimelineItem.js +2 -2
  134. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  135. package/lib/index.d.ts +2 -6
  136. package/lib/index.d.ts.map +1 -1
  137. package/lib/index.js +2 -6
  138. package/lib/index.js.map +1 -1
  139. package/package.json +6 -5
  140. package/lib/components/CaseHeader/CaseHeader.d.ts +0 -30
  141. package/lib/components/CaseHeader/CaseHeader.d.ts.map +0 -1
  142. package/lib/components/CaseHeader/CaseHeader.js +0 -119
  143. package/lib/components/CaseHeader/CaseHeader.js.map +0 -1
  144. package/lib/components/CaseHeader/index.d.ts +0 -4
  145. package/lib/components/CaseHeader/index.d.ts.map +0 -1
  146. package/lib/components/CaseHeader/index.js +0 -3
  147. package/lib/components/CaseHeader/index.js.map +0 -1
  148. package/lib/components/CaseSummary/CaseSummary.d.ts +0 -36
  149. package/lib/components/CaseSummary/CaseSummary.d.ts.map +0 -1
  150. package/lib/components/CaseSummary/CaseSummary.js +0 -130
  151. package/lib/components/CaseSummary/CaseSummary.js.map +0 -1
  152. package/lib/components/CaseSummary/index.d.ts +0 -4
  153. package/lib/components/CaseSummary/index.d.ts.map +0 -1
  154. package/lib/components/CaseSummary/index.js +0 -3
  155. package/lib/components/CaseSummary/index.js.map +0 -1
  156. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts +0 -22
  157. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +0 -1
  158. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +0 -25
  159. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +0 -1
  160. package/lib/components/CaseSummaryFields/index.d.ts +0 -4
  161. package/lib/components/CaseSummaryFields/index.d.ts.map +0 -1
  162. package/lib/components/CaseSummaryFields/index.js +0 -3
  163. package/lib/components/CaseSummaryFields/index.js.map +0 -1
  164. package/lib/components/Stages/Steps.d.ts +0 -8
  165. package/lib/components/Stages/Steps.d.ts.map +0 -1
  166. package/lib/components/Stages/Steps.js +0 -12
  167. package/lib/components/Stages/Steps.js.map +0 -1
  168. package/lib/components/Stages/StepsContainer.d.ts +0 -8
  169. package/lib/components/Stages/StepsContainer.d.ts.map +0 -1
  170. package/lib/components/Stages/StepsContainer.js +0 -11
  171. package/lib/components/Stages/StepsContainer.js.map +0 -1
@@ -1,23 +1,20 @@
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 StyledSubheading: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const StyledCaseHeaderText: import("styled-components").StyledComponent<"hgroup", import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const StyledPromotedActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const StyledCaseSummaryInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
+ 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>;
10
+ export declare const StyledCaseSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
+ export declare const StyledWorkArea: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
12
  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>;
13
+ export declare const StyledUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
14
+ export declare const StyledSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
15
  export declare const StyledCaseDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
16
  export declare const StyledCaseDrawerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
17
  export declare const StyledPersistentUtility: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
22
18
  export declare const ScrollStick: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
+ export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
20
  //# 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,yGAQlC,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,gBAAgB,uGAAa,CAAC;AAI3C,eAAO,MAAM,oBAAoB,4GA0C/B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAIhC,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAYhC,CAAC;AAIH,eAAO,MAAM,0BAA0B,qOAuBrC,CAAC;AAIH,eAAO,MAAM,iBAAiB,yGAqC5B,CAAC;AAIH,eAAO,MAAM,cAAc,yGA6BzB,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,223 @@
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 StyledSubheading = styled.p ``;
68
+ StyledSubheading.defaultProps = defaultThemeProp;
69
+ export const StyledCaseHeaderText = styled.hgroup(({ theme }) => {
70
+ const color = readableColor(theme.base.palette['brand-primary']);
71
+ const transparentColor = tryCatch(() => transparentize(0.1, color));
72
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
73
+ const idStyle = css `
74
+ color: ${transparentColor};
75
+ font-size: ${fontSize.s};
76
+ font-weight: normal;
77
+ `;
78
+ return css `
79
+ word-break: break-word;
80
+
81
+ ${StyledSubheading} {
82
+ ${idStyle}
83
+ }
84
+
85
+ ${StyledBreadcrumbs} {
86
+ > a,
87
+ > span,
88
+ > button,
89
+ > svg {
90
+ ${idStyle}
91
+ }
92
+
93
+ > a,
94
+ > button {
95
+ &:focus {
96
+ box-shadow: ${theme.base.shadow['focus-inverted']};
97
+ }
98
+ }
99
+
100
+ ${StyledPopover}:not(${StyledTooltip}) {
101
+ color: ${theme.base.palette['foreground-color']};
102
+ }
103
+ }
104
+
105
+ > ${StyledText} > ${StyledButton} {
106
+ color: ${color};
107
+ }
108
+ `;
109
+ });
110
+ StyledCaseHeaderText.defaultProps = defaultThemeProp;
111
+ export const StyledPromotedActions = styled.div(({ theme }) => {
112
+ return css `
113
+ border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
114
+ `;
115
+ });
116
+ StyledPromotedActions.defaultProps = defaultThemeProp;
117
+ export const StyledCaseSummaryInfo = styled.div(() => {
118
+ const { intelligentGuidance } = useCaseViewContext();
119
+ return css `
120
+ overflow: auto;
121
+ flex: 1;
122
+ ${intelligentGuidance &&
123
+ css `
124
+ /* Accounts for collapsed intelligentGuidance list covering summary panel content when fully scrolled. */
125
+ padding-block-end: 4rem;
126
+ `}
127
+ `;
128
+ });
129
+ StyledCaseSummaryInfo.defaultProps = defaultThemeProp;
130
+ export const StyledExpandCollapseButton = styled(Button)(({ theme }) => {
131
+ const { summaryExpanded } = useCaseViewContext();
132
+ return css `
133
+ position: absolute;
134
+ z-index: 1;
135
+ bottom: 0;
136
+ inset-inline-start: ${summaryExpanded ? 'calc(100% - 0.75rem)' : '0'};
137
+ border-radius: ${summaryExpanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};
138
+ box-shadow: ${theme.base.shadow.low};
139
+ border: none;
140
+ opacity: 0;
141
+
142
+ &:focus {
143
+ opacity: 1;
144
+ }
145
+
146
+ ${StyledIcon} {
147
+ width: 1.5rem;
148
+ height: 1.5rem;
149
+ transform: rotate(${summaryExpanded ? 0 : css `180deg`});
150
+ }
151
+ `;
152
+ });
153
+ StyledExpandCollapseButton.defaultProps = defaultThemeProp;
154
+ export const StyledCaseSummary = styled.div(() => {
155
+ const { summaryExpanded, aboveMD, aboveLG } = useCaseViewContext();
156
+ return css `
157
+ position: relative;
158
+ height: 100%;
159
+
160
+ ${aboveMD &&
10
161
  css `
11
- margin-inline-start: calc(2 * ${theme.base.spacing});
162
+ ${summaryExpanded
163
+ ? css `
164
+ width: ${aboveLG ? css `25rem` : css `22rem`};
165
+
166
+ &:focus-within,
167
+ &:hover {
168
+ &::after {
169
+ content: '';
170
+ position: absolute;
171
+ top: 0;
172
+ bottom: 0;
173
+ inset-inline-start: 100%;
174
+ width: 0.75rem;
175
+ }
176
+
177
+ ${StyledExpandCollapseButton} {
178
+ opacity: 1;
179
+ }
180
+ }
181
+ `
182
+ : css `
183
+ width: 100%;
184
+ ${StyledExpandCollapseButton} {
185
+ opacity: 1;
186
+ }
187
+ `}
12
188
  `}
189
+ `;
190
+ });
191
+ StyledCaseSummary.defaultProps = defaultThemeProp;
192
+ export const StyledWorkArea = styled.div(({ theme }) => {
193
+ const { summaryExpanded, aboveMD, intelligentGuidance } = useCaseViewContext();
194
+ let pbeRem = 0;
195
+ if (intelligentGuidance) {
196
+ pbeRem = aboveMD && !summaryExpanded ? 4 : 6;
197
+ }
198
+ return css `
199
+ grid-area: work-area;
200
+ padding: calc(2 * ${theme.base.spacing});
13
201
 
14
- ${!forceMobile &&
15
- isMediumOrAbove &&
202
+ ${aboveMD &&
16
203
  css `
17
204
  padding: calc(2 * ${theme.base.spacing}) 0;
205
+
206
+ ${!summaryExpanded &&
207
+ css `
208
+ margin-inline-start: calc(2 * ${theme.base.spacing});
209
+ `}
210
+ `}
211
+
212
+ /* Order of style here is necessary for overriding styles above. */
213
+ ${pbeRem > 0 &&
214
+ css `
215
+ /* Accounts for collapsed intelligentGuidance bubble covering work area content when fully scrolled. */
216
+ padding-block-end: ${pbeRem}rem;
18
217
  `}
19
218
  `;
20
219
  });
220
+ StyledWorkArea.defaultProps = defaultThemeProp;
21
221
  export const StyledUtilToggle = styled.button(({ theme }) => {
22
222
  return css `
23
223
  align-self: flex-end;
@@ -26,56 +226,44 @@ export const StyledUtilToggle = styled.button(({ theme }) => {
26
226
  `;
27
227
  });
28
228
  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 }) => {
229
+ export const StyledUtilities = styled.div(() => {
230
+ const { utilitiesExpanded, aboveLG } = useCaseViewContext();
38
231
  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']};
232
+ height: max-content;
44
233
 
45
- > :last-child {
46
- ${!forceMobile &&
47
- isMediumOrAbove &&
234
+ ${aboveLG &&
235
+ utilitiesExpanded &&
48
236
  css `
49
- margin-inline-end: calc(2 * ${theme.base.spacing});
50
- `}
51
- }
237
+ width: 25rem;
238
+ `}
52
239
  `;
53
240
  });
54
- StyledCaseView.defaultProps = defaultThemeProp;
55
- export const StyledSummaryRegion = styled.div(({ theme, forceMobile, desktop }) => {
241
+ StyledUtilities.defaultProps = defaultThemeProp;
242
+ export const StyledSummary = styled.div(({ theme }) => {
243
+ const { summaryExpanded, aboveMD } = useCaseViewContext();
56
244
  return css `
57
245
  position: sticky;
58
- top: var(--appshell-offset, 0);
246
+ top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset, 0)'};
59
247
  width: 100%;
60
248
  background-color: ${theme.base.palette['primary-background']};
61
249
  z-index: ${theme.base['z-index'].popover};
62
250
 
63
- ${!forceMobile &&
64
- desktop &&
251
+ ${aboveMD &&
252
+ summaryExpanded &&
65
253
  css `
66
- height: var(--case-view-content-height);
254
+ height: var(--case-view-height);
67
255
  `}
68
256
  `;
69
257
  });
70
- StyledSummaryRegion.defaultProps = defaultThemeProp;
258
+ StyledSummary.defaultProps = defaultThemeProp;
71
259
  export const StyledCaseDrawer = styled.div(({ theme }) => {
72
260
  return css `
73
261
  min-width: 21.875rem;
74
262
  max-width: 31.25rem;
75
263
  width: calc((100vw - 31.25rem) / 10 + 21.875rem);
76
264
  background-color: ${theme.base.palette['primary-background']};
77
- height: var(--case-view-content-height);
78
- top: var(--case-view-header-offset);
265
+ height: var(--case-view-height);
266
+ top: var(--top-offset);
79
267
  z-index: ${theme.base['z-index'].drawer - 1};
80
268
  `;
81
269
  });
@@ -89,13 +277,15 @@ export const StyledCaseDrawerContent = styled.div(({ theme }) => {
89
277
  `;
90
278
  });
91
279
  StyledCaseDrawerContent.defaultProps = defaultThemeProp;
92
- export const StyledPersistentUtility = styled.div(() => {
280
+ export const StyledPersistentUtility = styled.div(({ theme }) => {
93
281
  return css `
94
- max-width: 60ch;
282
+ min-width: ${theme.base['content-width'].sm};
283
+ max-width: ${theme.base['content-width'].md};
95
284
  overflow: auto;
96
285
  position: sticky;
97
- height: var(--case-view-content-height);
98
- top: var(--case-view-header-offset);
286
+ z-index: 1;
287
+ height: var(--case-view-height);
288
+ top: var(--top-offset);
99
289
  `;
100
290
  });
101
291
  StyledPersistentUtility.defaultProps = defaultThemeProp;
@@ -103,4 +293,22 @@ export const ScrollStick = styled.div `
103
293
  position: sticky;
104
294
  top: 0;
105
295
  `;
296
+ export const StyledCaseView = styled.div(({ theme }) => {
297
+ const { aboveMD } = useCaseViewContext();
298
+ return css `
299
+ --top-offset: calc(var(--appshell-offset, 0rem) + var(--summary-height));
300
+ --case-view-height: calc(100vh - var(--top-offset));
301
+ position: relative;
302
+ min-height: var(--case-view-height);
303
+ background-color: ${theme.base.palette['app-background']};
304
+
305
+ ${aboveMD &&
306
+ css `
307
+ ${StyledUtilities}:last-child {
308
+ margin-inline-end: calc(2 * ${theme.base.spacing});
309
+ }
310
+ `}
311
+ `;
312
+ });
313
+ StyledCaseView.defaultProps = defaultThemeProp;
106
314
  //# sourceMappingURL=CaseView.sty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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;;;;;;GAMT,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 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,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEvF,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO;;QAElC,oBAAoB;;;QAGpB,gBAAgB;qBACH,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAa,CAAC;uBAC1D,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;;;GAG3D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAG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, 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 StyledSubheading = styled.p``;\n\nStyledSubheading.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderText = styled.hgroup(({ theme }) => {\n const color = readableColor(theme.base.palette['brand-primary']);\n const transparentColor = tryCatch(() => transparentize(0.1, color));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const idStyle = css`\n color: ${transparentColor};\n font-size: ${fontSize.s};\n font-weight: normal;\n `;\n\n return css`\n word-break: break-word;\n\n ${StyledSubheading} {\n ${idStyle}\n }\n\n ${StyledBreadcrumbs} {\n > a,\n > span,\n > button,\n > svg {\n ${idStyle}\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 const { intelligentGuidance } = useCaseViewContext();\n\n return css`\n overflow: auto;\n flex: 1;\n ${intelligentGuidance &&\n css`\n /* Accounts for collapsed intelligentGuidance list covering summary panel content when fully scrolled. */\n padding-block-end: 4rem;\n `}\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 &: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, intelligentGuidance } = useCaseViewContext();\n let pbeRem = 0;\n\n if (intelligentGuidance) {\n pbeRem = aboveMD && !summaryExpanded ? 4 : 6;\n }\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 /* Order of style here is necessary for overriding styles above. */\n ${pbeRem > 0 &&\n css`\n /* Accounts for collapsed intelligentGuidance bubble covering work area content when fully scrolled. */\n padding-block-end: ${pbeRem}rem;\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, 0)'};\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, 0rem) + 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,103 @@
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 unique identifier for the case instance. */
5
+ caseId: string;
6
+ /** Text to quickly identify a case instance. */
7
+ heading: string;
8
+ /** Supplemental text to identify a case instance. */
9
+ subheading?: string;
10
+ /** A set of props including an href that will be forwarded to the case heading and caseId. */
11
+ caseLink?: {
12
+ href: string;
13
+ } & ForwardProps;
14
+ /** A set of Link props representing the case parents, rendered as Breadcrumbs. */
15
+ parentCases?: MenuItemProps[];
16
+ /** An icon to serve as a visual for the CaseView. */
17
+ icon?: ReactElement;
18
+ /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */
19
+ followed?: boolean;
20
+ /** Called when user chooses to follow or unfollow the case. Use this to update followed. */
21
+ onFollowedChange?: (following: boolean) => void;
22
+ /** Case level actions available in an action menu. */
23
+ actions?: Action[];
24
+ /** Visually promoted case level actions available outside the menu. */
25
+ promotedActions?: Action[];
26
+ /** A callback for when the edit button is clicked */
27
+ onEdit?: () => void;
28
+ /** A region to display any summary information about the CaseView. */
29
+ summary: ReactNode;
30
+ /**
31
+ * Determines the layout state of the summary region.
32
+ * @default true
33
+ */
34
+ summaryExpanded?: boolean;
35
+ /**
36
+ * Callback to toggle the case summary's layout.
37
+ */
38
+ onToggleSummary?: () => void;
39
+ /** An object handling the rendering and functionality of the Tabs in CaseSummary. */
40
+ tabs: {
41
+ items: Tab[];
42
+ onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
43
+ currentTabId: string;
44
+ };
45
+ /** A region within the center column that is controlled by tabs in CaseSummary. */
46
+ tabContent?: {
47
+ content: ReactNode;
48
+ id: string;
49
+ }[];
50
+ /** A region to hold a Stages component. */
51
+ stages?: ReactNode;
52
+ /** A region to hold a Tasks component. */
53
+ tasks?: ReactNode;
54
+ /** A region above the center column to display banners. */
55
+ banners?: ReactNode;
56
+ /** A region to the right reserved for persistent utilities. */
57
+ persistentUtility?: {
58
+ content: ReactNode;
59
+ title: string;
60
+ };
61
+ /**
62
+ * Provide an instance of IntelligentGuidance to be rendered for a case.
63
+ */
64
+ intelligentGuidance?: ReactNode;
65
+ /** A region for case widgets. */
66
+ utilities?: ReactNode;
67
+ /** An indicator of case widgets when the utilities are collapsed. */
68
+ utilitiesSummaryItems?: {
69
+ iconName: string;
70
+ count?: number;
71
+ }[];
72
+ /**
73
+ * Determines the layout state of the utilities.
74
+ * @default true
75
+ */
76
+ utilitiesExpanded?: boolean;
77
+ /**
78
+ * Callback to toggle the utilities.
79
+ */
80
+ onToggleUtilities?: () => void;
81
+ }
82
+ export interface CaseSummaryFieldsProps {
83
+ /** The primary summary fields to display above secondary fields. */
84
+ primaryFields: {
85
+ id?: string;
86
+ name: string;
87
+ value: ReactNode;
88
+ }[];
89
+ /** The secondary summary fields to display below primary fields. */
90
+ secondaryFields: {
91
+ id?: string;
92
+ name: string;
93
+ value: ReactNode;
94
+ }[];
95
+ }
96
+ export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'caseLink' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summary' | 'tabs' | 'summaryExpanded' | 'onToggleSummary' | 'utilitiesExpanded' | 'persistentUtility' | 'intelligentGuidance'> {
97
+ summaryId: string;
98
+ aboveMD: boolean;
99
+ aboveLG: boolean;
100
+ aboveXL: boolean;
101
+ isPreview: boolean;
102
+ }
103
+ //# 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,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,YAAY,CAAC;IAC3C,kFAAkF;IAClF,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,qDAAqD;IACrD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB,sEAAsE;IACtE,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;I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AE,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,YAAY,GACZ,UAAU,GACV,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,SAAS,GACT,MAAM,GACN,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,CACxB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -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 unique identifier for the case instance. */\n caseId: string;\n /** Text to quickly identify a case instance. */\n heading: string;\n /** Supplemental text to identify a case instance. */\n subheading?: 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 * 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 /** 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 * @internal\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 | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'summary'\n | 'tabs'\n | 'summaryExpanded'\n | 'onToggleSummary'\n | 'utilitiesExpanded'\n | 'persistentUtility'\n | 'intelligentGuidance'\n > {\n summaryId: string;\n aboveMD: boolean;\n aboveLG: boolean;\n aboveXL: boolean;\n isPreview: 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":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,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;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AC,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"]}